:root {
    color-scheme: light;
    --bg: #f4efe6;
    --panel: #fffdf8;
    --text: #1e1b18;
    --muted: #6a625a;
    --accent: #b85042;
    --border: #dccfbe;
}

body {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    background: linear-gradient(180deg, #f8f3eb 0%, var(--bg) 100%);
    color: var(--text);
}

main {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 20px 48px;
}

.account-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 14px 20px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
}

.page-nav,
.account-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.account-actions form {
    margin: 0;
}

.account-email {
    color: var(--muted);
    font-size: 0.95rem;
}

.account-status {
    padding: 4px 8px;
    border: 1px solid #d08b1d;
    border-radius: 999px;
    background: #fff5d6;
    color: #5f450e;
    font-size: 0.85rem;
    font-weight: 600;
}

.link-button {
    padding: 0;
    background: none;
    color: var(--accent);
    border: 0;
    border-radius: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1rem;
}

.link-button:hover {
    opacity: 1;
    text-decoration: underline;
}

h1 {
    margin-bottom: 24px;
    font-size: 2.2rem;
}

h2 {
    margin: 0 0 12px;
    line-height: 1.3;
}

a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

a:hover {
    text-decoration: underline;
}

button {
    padding: 12px 24px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    transition: opacity 0.2s;
}

button:hover {
    opacity: 0.9;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"] {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1rem;
    color: var(--text);
}

input[type="checkbox"] {
    accent-color: var(--accent);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--accent);
    background: white;
}

details {
    margin-top: 12px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 600;
}

.list {
    display: grid;
    gap: 16px;
}

.card,
.search-form {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(76, 54, 35, 0.08);
}

.card {
    padding: 20px;
}

.search-form {
    padding: 24px;
    margin-bottom: 32px;
}

.form-group {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.topic-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.topic-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #f7eee5;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.95rem;
}

.topic-chip:hover {
    opacity: 1;
    border-color: var(--accent);
}

.checkbox-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.stacked-fields {
    display: grid;
    gap: 10px;
}

.stacked-fields label,
.frequency-group legend {
    color: var(--muted);
    font-weight: 600;
}

.frequency-group {
    display: flex;
    gap: 18px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 4px 0 8px;
}

.frequency-group label {
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--text);
    font-weight: 400;
}

.test-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.help-text {
    font-size: 0.9rem;
    color: var(--muted);
    margin-top: 8px;
}

.meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 0.95rem;
}

.content {
    margin-top: 10px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.loading {
    text-align: center;
    color: var(--muted);
    padding: 20px;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error {
    background: #fce4e4;
    border: 1px solid #f5a6a6;
    color: #c33;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.success {
    background: #e8f7ed;
    border: 1px solid #9ed3ad;
    color: #246b38;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.results {
    margin-top: 32px;
}

.results .card {
    margin-bottom: 16px;
}

.ai-summary {
    background: #f0f8ff;
    border-left: 4px solid var(--accent);
    padding: 12px;
    margin: 12px 0;
    border-radius: 4px;
    font-style: italic;
    color: #333;
}

.news-summary {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(76, 54, 35, 0.08);
}

.news-summary h2 {
    margin-bottom: 12px;
}

.news-summary h3 {
    margin: 0 0 12px;
    line-height: 1.3;
}

.topic-section {
    margin-bottom: 28px;
}

.topic-section > h2 {
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.summary-empty {
    border-color: #d08b1d;
}

.summary-empty .content {
    color: #5f450e;
}

.article-warning {
    background: #fff5d6;
    border-left: 4px solid #d08b1d;
    padding: 10px 12px;
    margin: 12px 0;
    border-radius: 4px;
    color: #5f450e;
}

.debug-section {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-top: 32px;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--muted);
}

.debug-toggle {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-weight: 600;
    padding: 0;
    font-size: 0.9rem;
}

.debug-content {
    margin-top: 12px;
    background: #f8f8f8;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid var(--border);
    max-height: 520px;
    overflow-y: auto;
}

.debug-entry {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
}

.debug-entry:last-child {
    margin-bottom: 0;
}

.debug-entry h3 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 10px;
}

.debug-entry-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.debug-part-toggle {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--accent);
    cursor: pointer;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 10px;
}

.debug-part-toggle.is-open {
    background: #f7eee5;
}

.debug-block {
    margin-bottom: 12px;
}

.debug-block:last-child {
    margin-bottom: 0;
}

.debug-section h4 {
    margin: 0 0 10px;
    color: var(--accent);
}

.debug-box {
    background: #fff;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid var(--border);
    white-space: pre-wrap;
}

.no-results {
    color: var(--muted);
}

.status-sent {
    color: #246b38;
    font-weight: 600;
}

.status-failed {
    color: #c33;
    font-weight: 600;
}

.product-card h3 {
    margin: 0;
    line-height: 1.3;
}

.product-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.product-price {
    color: var(--accent);
    font-size: 1.25rem;
    font-weight: 700;
    text-align: right;
    min-width: 120px;
}

.analyzed-pages {
    margin-top: 16px;
}

.auth-page {
    max-width: 520px;
    min-height: calc(100vh - 80px);
    display: grid;
    align-items: center;
}

.auth-panel h1 {
    margin-bottom: 16px;
}

.auth-form {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
}

.auth-form label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-weight: 600;
}

.auth-form input {
    width: 100%;
    box-sizing: border-box;
}

.auth-actions {
    display: grid;
    gap: 12px;
    text-align: center;
}

.google-button {
    display: block;
    padding: 12px 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
}
