/* ── Reset & Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:        #0a0c10;
    --bg-card:   #12161e;
    --bg-raised: #171c26;
    --bg-glass:  rgba(22, 28, 40, 0.6);
    --bg-modal:  #10141c;
    --border:    rgba(255, 255, 255, 0.06);
    --border-hi: rgba(255, 255, 255, 0.1);
    --text:      #e8ecf1;
    --text-dim:  #7a8494;
    --accent:    #4088C7;
    --accent-glow: rgba(64, 136, 199, 0.15);
    --accent-2:  #e8914a;
    --red:       #e5534b;
    --green:     #3fb950;
    --radius:    10px;
    --radius-sm: 6px;
    --shadow:    0 8px 32px rgba(0,0,0,.45);
    --shadow-sm: 0 2px 8px rgba(0,0,0,.3);
    --font:      'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-editorial: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
    --max-w:     1320px;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ───────────────────────────────────────────────────────────── */
.site-header {
    background: rgba(10, 12, 16, 0.85);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
}

.header-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

a.brand { text-decoration: none; color: inherit; cursor: pointer; }

.logo {
    font-size: 2.2rem;
    color: var(--text);
    display: flex;
    align-items: baseline;
    gap: 0;
    line-height: 1;
}

.logo-vs {
    font-family: var(--font);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: #4088C7;
}

.logo-sep {
    font-family: var(--font);
    font-weight: 300;
    color: #4088C7;
    margin: 0 0.01em;
    font-size: 0.85em;
}

.logo-news {
    font-family: var(--font-editorial);
    font-weight: 400;
    font-style: italic;
    color: #F0F1F4;
    letter-spacing: 0.01em;
    font-size: 1.08em;
}

.tagline {
    font-family: var(--font);
    font-size: 0.6rem;
    color: #A7AFBD;
    margin-top: 4px;
    letter-spacing: 0.02em;
    font-weight: 400;
    font-style: normal;
    text-transform: none;
}

.header-stats {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.68rem;
    color: var(--text-dim);
    opacity: 0.45;
    letter-spacing: 0.01em;
}
.header-stats-sep { opacity: 0.35; }

.header-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-dim);
    font-size: 0.82rem;
}

.btn-icon {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    color: var(--text-dim);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.25s ease;
    backdrop-filter: blur(8px);
}
.btn-icon:hover {
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}
.btn-icon.spinning svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Filters ──────────────────────────────────────────────────────────── */
.hero-filters {
    margin-top: 1rem;
}

.filters-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-group { display: flex; align-items: center; gap: 0.35rem; }

.filters-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-dim);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font);
}
.filter-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}
.filter-btn.active {
    color: var(--text);
    background: rgba(64, 136, 199, 0.12);
    border-color: rgba(64, 136, 199, 0.3);
}

/* Toggle switch */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    cursor: pointer;
    user-select: none;
}
.toggle-label input { display: none; }
.toggle-switch {
    width: 34px;
    height: 18px;
    background: rgba(255,255,255,0.08);
    border-radius: 9px;
    position: relative;
    transition: background 0.25s ease;
}
.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: var(--text-dim);
    border-radius: 50%;
    transition: all 0.25s ease;
}
.toggle-label input:checked + .toggle-switch {
    background: var(--accent);
}
.toggle-label input:checked + .toggle-switch::after {
    transform: translateX(16px);
    background: #fff;
}

.select-source {
    background: var(--bg-raised);
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
    font-family: var(--font);
    cursor: pointer;
    transition: border-color 0.2s;
}
.select-source:focus { outline: none; border-color: var(--accent); }

/* ── Hero search ──────────────────────────────────────────────────────── */
.hero-search {
    text-align: center;
    padding: 0 0 1rem;
    margin-bottom: 0.75rem;
    position: relative;
}

.hero-title {
    font-family: var(--font);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.85rem;
    letter-spacing: -0.015em;
}

.hero-ai-icon {
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.2rem;
    margin-bottom: 0.15rem;
    stroke: var(--accent);
    opacity: 0.55;
    transition: opacity 0.3s;
}
.hero-title:hover .hero-ai-icon { opacity: 0.85; }

.hero-input-wrap {
    position: relative;
    max-width: 540px;
    margin: 0 auto 1rem;
}

.hero-input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    opacity: 0.4;
    pointer-events: none;
}

.hero-input {
    width: 100%;
    background: var(--bg-raised);
    border: 1px solid var(--border-hi);
    border-radius: var(--radius);
    padding: 0.8rem 4rem 0.8rem 2.6rem;
    font-family: var(--font);
    font-size: 0.88rem;
    color: var(--text);
    outline: none;
    transition: all 0.25s ease;
}
.hero-input::placeholder { color: var(--text-dim); opacity: 0.5; }
.hero-input:focus {
    border-color: rgba(64, 136, 199, 0.4);
    box-shadow: 0 0 0 3px var(--accent-glow), 0 4px 20px rgba(0,0,0,0.2);
    background: rgba(23, 28, 38, 0.9);
}

.hero-input-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.2rem 0.35rem;
    border-radius: var(--radius-sm);
    line-height: 1;
    transition: all 0.2s;
}
.hero-input-clear:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.hero-ai-badge {
    position: absolute;
    right: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem 0.2rem 0.35rem;
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(64,136,199,0.12) 0%, rgba(100,80,200,0.10) 100%);
    border: 1px solid rgba(64,136,199,0.18);
    color: var(--accent);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    pointer-events: none;
    opacity: 0.55;
    transition: opacity 0.3s;
}
.hero-ai-badge svg {
    stroke: var(--accent);
    opacity: 0.85;
}
.hero-input:focus ~ .hero-ai-badge { opacity: 0.85; }
.hero-input-clear:not([hidden]) ~ .hero-ai-badge { display: none; }
.hero-input-clear:not([hidden]) ~ .ai-status { right: 3.2rem; }
.ai-status:not([hidden]) ~ .hero-ai-badge { display: none; }

/* ── Topic chips (mobile) ─────────────────────────────────────── */
.topics-chips {
    display: none;
    max-width: 540px;
    margin: 0 auto 0.75rem;
}

@media (pointer: coarse) {
    .topics-chips:not([hidden]) {
        display: flex;
        gap: 0.45rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 0.15rem 0.25rem;
    }
    .topics-chips::-webkit-scrollbar { display: none; }

    .topics-chips .topic-chip {
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        gap: 0.3rem;
        padding: 0.4rem 0.75rem;
        background: var(--bg-glass);
        border: 1px solid var(--border-hi);
        border-radius: 999px;
        color: var(--text);
        font-family: var(--font);
        font-size: 0.78rem;
        white-space: nowrap;
        cursor: pointer;
        transition: background 0.15s, border-color 0.15s;
    }
    .topics-chips .topic-chip:hover,
    .topics-chips .topic-chip:active {
        background: rgba(64,136,199,0.12);
        border-color: rgba(64,136,199,0.3);
    }
    .topics-chips .topic-chip-emoji {
        font-size: 0.9rem;
        line-height: 1;
    }
    .topics-chips .topic-chip-loading {
        display: flex;
        align-items: center;
        gap: 0.35rem;
        padding: 0.4rem 0.75rem;
        font-size: 0.72rem;
        color: var(--text-dim);
        white-space: nowrap;
    }
}

.hero-actions-wrap { position: relative; }

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: nowrap;
    max-width: 920px;
    margin: 0 auto;
}

.hero-action-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-hi);
    border-radius: var(--radius);
    padding: 1.1rem 0.6rem 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1 1 0;
    min-width: 0;
    max-width: 150px;
    font-family: var(--font);
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
}
.hero-action-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(64,136,199,0.06) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.hero-action-card[hidden] { display: none; }
.hero-action-card:hover::before { opacity: 1; }
.hero-action-card:hover {
    border-color: rgba(64, 136, 199, 0.35);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3), 0 0 0 1px rgba(64,136,199,0.1);
}

.hero-action-icon {
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.hero-action-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.35;
    text-align: center;
    position: relative;
    z-index: 1;
    letter-spacing: 0.005em;
}

/* ── Main content ─────────────────────────────────────────────────────── */
.main-content {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    min-height: 60vh;
}

/* Loading */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 4rem 1rem;
    color: var(--text-dim);
}
.spinner {
    width: 36px; height: 36px;
    border: 2px solid var(--border-hi);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ── News Grid ────────────────────────────────────────────────────────── */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1rem;
}

/* ── News Card ────────────────────────────────────────────────────────── */
.news-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}
.news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
    border-color: var(--border-hi);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg-raised);
}
.card-image-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--bg-raised) 0%, #151b27 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.06);
    font-size: 2.5rem;
}

.card-body { padding: 1.1rem 1.25rem; flex: 1; display: flex; flex-direction: column; }

.card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.card-category {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    color: var(--accent-2);
}

.card-date {
    font-size: 0.65rem;
    color: var(--text-dim);
    opacity: 0.7;
    white-space: nowrap;
}

.card-date::before {
    content: "·";
    margin-right: 0.5rem;
    color: var(--text-dim);
    opacity: 0.4;
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.6rem;
    color: var(--text);
}

.card-summary {
    font-size: 0.83rem;
    color: var(--text-dim);
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.source-badges { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.source-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

.card-footer-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.card-compare-hint {
    font-size: 0.7rem;
    color: var(--accent);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    opacity: 0.8;
}
.card-compare-hint svg { flex-shrink: 0; }

.card-single-source .card-compare-hint { display: none; }

.card-time {
    font-size: 0.68rem;
    color: var(--text-dim);
    margin-left: auto;
    opacity: 0.7;
}

/* ── Modal ────────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem;
    overflow-y: auto;
}
.modal-overlay[hidden] { display: none; }

.modal-content {
    background: var(--bg-modal);
    border: 1px solid var(--border-hi);
    border-radius: var(--radius);
    max-width: 1100px;
    width: 100%;
    position: relative;
    animation: modalIn 0.3s ease;
    box-shadow: 0 24px 80px rgba(0,0,0,.5);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(16px); } }

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 1.3rem;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s;
}
.modal-close:hover { background: var(--red); border-color: var(--red); color: #fff; }

/* Comparison inside modal */
.compare-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid var(--border);
}
.compare-header h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.3;
}
.compare-subtitle {
    margin-top: 0.5rem;
    color: var(--text-dim);
    font-size: 0.85rem;
}

.compare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1px;
    background: var(--border);
}

.compare-column {
    background: var(--bg-modal);
    padding: 1.5rem;
}

.compare-source-name {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.compare-source-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.source-logo-sm {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
    object-fit: contain;
}

.compare-thumb-wrap {
    margin-bottom: 0.75rem;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.compare-thumb {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.compare-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.6rem;
    line-height: 1.4;
}

.compare-summary {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.65;
    margin-bottom: 1rem;
}

.compare-link {
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* ── Compare sections ─────────────────────────────────────────────────── */
.compare-section {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.section-title svg { color: var(--accent); flex-shrink: 0; }

.section-desc {
    font-size: 0.82rem;
    color: var(--text-dim);
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* ── Framing section ──────────────────────────────────────────────────── */
.framing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.6rem;
}

.framing-card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.15rem;
}

.framing-source {
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
}

.framing-title {
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--text);
    font-style: italic;
    margin-bottom: 0.7rem;
}

.framing-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.framing-tag {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.18rem 0.5rem;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,.04);
    color: var(--text-dim);
    border: 1px solid var(--border);
}
.framing-tag.tone-alarm  { background: rgba(229,83,75,.1);  color: #e5534b; border-color: rgba(229,83,75,.2); }
.framing-tag.tone-positive { background: rgba(63,185,80,.1); color: #3fb950; border-color: rgba(63,185,80,.2); }
.framing-tag.tone-info   { background: rgba(64,136,199,.1); color: #4088C7; border-color: rgba(64,136,199,.2); }

/* ── Exclusive content section ────────────────────────────────────────── */
.exclusive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.6rem;
}

.exclusive-card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.15rem;
    border-left: 2px solid var(--accent-2);
}

.exclusive-source {
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
}

.exclusive-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.exclusive-item {
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text-dim);
    padding-left: 1rem;
    position: relative;
}
.exclusive-item::before {
    content: "›";
    position: absolute;
    left: 0;
    color: var(--accent-2);
    font-weight: 700;
}
.exclusive-item.exclusive-data {
    font-weight: 600;
    color: var(--accent);
}
.exclusive-item.exclusive-data::before {
    content: "#";
    color: var(--accent);
}

/* ── Back button ──────────────────────────────────────────────────────── */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-hi);
    color: var(--text-dim);
    padding: 0.45rem 1rem;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 1rem;
}
.btn-back:hover { color: var(--text); border-color: rgba(255,255,255,0.15); }

/* ── Metrics dashboard ────────────────────────────────────────────────── */
.metrics-view { padding-top: 2rem; }

.metrics-header {
    margin-bottom: 2rem;
}
.metrics-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.metrics-title svg { color: var(--accent); flex-shrink: 0; }
.metrics-subtitle {
    color: var(--text-dim);
    font-size: 0.88rem;
    margin-top: 0.4rem;
}

/* ── Metrics date filters ─────────────────────────────────────────────── */
.metrics-date-filters {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.date-quick-filters {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.date-quick-btn {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-hi);
    color: var(--text-dim);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
}
.date-quick-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.15); }
.date-quick-btn.active {
    color: var(--text);
    background: rgba(64, 136, 199, 0.12);
    border-color: rgba(64, 136, 199, 0.3);
}
.date-custom-range {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.date-custom-range label {
    font-size: 0.78rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.date-input {
    background: var(--bg-raised);
    color: var(--text);
    border: 1px solid var(--border-hi);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.6rem;
    font-size: 0.78rem;
    font-family: var(--font);
    color-scheme: dark;
}
.date-input:focus { outline: none; border-color: var(--accent); }
.date-apply-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.9rem;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: opacity 0.2s;
}
.date-apply-btn:hover { opacity: 0.85; }
.date-range-info {
    font-size: 0.72rem;
    color: var(--text-dim);
    font-style: italic;
}

.metrics-summary {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}
.metrics-summary-item {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    font-size: 0.78rem;
    color: var(--text-dim);
}
.metrics-summary-item strong {
    color: var(--accent);
    font-size: 1.05rem;
    margin-right: 0.3rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1rem;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.metric-card-wide { grid-column: 1 / -1; }

.metric-card-header {
    padding: 1.25rem 1.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
}
.metric-card-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.metric-card-header h3 svg { color: var(--accent); flex-shrink: 0; }
.metric-desc {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 0.3rem;
}

.metric-card-body {
    padding: 1.25rem 1.5rem;
}

/* ── Podio ────────────────────────────────────────────────────────────── */
.podio-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
}
.podio-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.podio-pedestal {
    width: 100px;
    border-radius: 6px 6px 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.5rem;
    font-weight: 800;
    font-size: 1.5rem;
    position: relative;
}
.podio-pedestal-1 { height: 120px; background: linear-gradient(180deg, #ffd700 0%, #b8860b 100%); color: #1a1a1a; }
.podio-pedestal-2 { height: 90px; background: linear-gradient(180deg, #c0c0c0 0%, #808080 100%); color: #1a1a1a; }
.podio-pedestal-3 { height: 65px; background: linear-gradient(180deg, #cd7f32 0%, #8b4513 100%); color: #1a1a1a; }
.podio-medal { font-size: 2rem; }
.podio-source {
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
    color: var(--text);
}
.podio-count {
    font-size: 0.72rem;
    color: var(--text-dim);
}

.ranking-rest {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.ranking-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-raised);
    border-radius: var(--radius-sm);
}
.ranking-pos {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-dim);
    min-width: 1.5rem;
    text-align: center;
}
.ranking-bar-track {
    flex: 1;
    height: 24px;
    background: rgba(255,255,255,0.03);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
.ranking-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
    display: flex;
    align-items: center;
    padding-left: 0.5rem;
}
.ranking-bar-label {
    font-size: 0.73rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}
.ranking-count {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-dim);
    min-width: 3rem;
    text-align: right;
}

/* ── Reaction time ────────────────────────────────────────────────────── */
.reaction-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.reaction-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.reaction-source {
    font-size: 0.82rem;
    font-weight: 600;
    min-width: 120px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.reaction-source-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.reaction-bar-track {
    flex: 1;
    height: 28px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}
.reaction-bar-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.6rem;
    transition: width 0.8s ease;
    min-width: 60px;
}
.reaction-value {
    font-size: 0.76rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}
.reaction-note {
    font-size: 0.68rem;
    color: var(--text-dim);
    min-width: 70px;
    text-align: right;
}

/* ── Exclusivity ──────────────────────────────────────────────────────── */
.exclusivity-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.exclusivity-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.exclusivity-source {
    font-size: 0.82rem;
    font-weight: 600;
    min-width: 120px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.exclusivity-source-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.exclusivity-bar-track {
    flex: 1;
    height: 28px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}
.exclusivity-bar-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    padding-left: 0.6rem;
    transition: width 0.8s ease;
}
.exclusivity-pct {
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}
.exclusivity-detail {
    font-size: 0.68rem;
    color: var(--text-dim);
    min-width: 80px;
    text-align: right;
    white-space: nowrap;
}
.exclusivity-legend {
    margin-top: 1rem;
    font-size: 0.73rem;
    color: var(--text-dim);
    line-height: 1.6;
    padding: 0.75rem;
    background: var(--bg-raised);
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--accent);
}

/* ── Footer ───────────────────────────────────────────────────────────── */
.site-footer {
    text-align: center;
    padding: 2rem 1rem;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.75rem;
    margin-top: 3rem;
    opacity: 0.6;
}
.footer-sources { margin-top: 0.5rem; font-size: 0.7rem; }
.footer-legal { margin-top: 0.75rem; font-size: 0.7rem; }
.footer-legal a { color: var(--text-dim); text-decoration: none; transition: color .2s; }
.footer-legal a:hover { color: var(--accent); }

/* ── Responsive ───────────────────────────────────────────────────────── */

/* Tablet & small desktop */
@media (max-width: 768px) {
    .logo { font-size: 1.4rem; }
    .header-inner { padding: 0.75rem 1rem; }
    .main-content { padding: 1rem; }
    .hero-search { padding: 1.5rem 0 1.25rem; margin-bottom: 1rem; }
    .hero-title { font-size: 1.15rem; margin-bottom: 1rem; }
    .hero-actions-wrap::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0.5rem;
        width: 40px;
        background: linear-gradient(to right, transparent, var(--bg));
        pointer-events: none;
        z-index: 1;
    }
    .hero-actions {
        gap: 0.5rem;
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        scroll-snap-type: x mandatory;
        padding: 0 0.75rem 0.5rem;
        margin: 0 -1rem;
        max-width: none;
    }
    .hero-actions::-webkit-scrollbar { display: none; }
    .hero-action-card {
        width: 120px;
        min-width: 120px;
        padding: 0.85rem 0.5rem 0.7rem;
        scroll-snap-align: start;
    }
    .hero-actions::after {
        content: '';
        min-width: 0.5rem;
        flex-shrink: 0;
    }
    .hero-action-label { font-size: 0.65rem; }
    .news-grid { grid-template-columns: 1fr; }
    .compare-grid { grid-template-columns: 1fr; }
    .framing-grid { grid-template-columns: 1fr; }
    .exclusive-grid { grid-template-columns: 1fr; }
    .compare-header { padding: 1.5rem 1.25rem 0.75rem; }
    .compare-section { padding: 1.25rem; }
    .compare-column { padding: 1.25rem; }
    .modal-content { margin: 0; border-radius: var(--radius-sm); }

    .filters-inner {
        padding: 0.6rem 0;
        gap: 0.5rem 0.75rem;
        flex-wrap: wrap;
    }

    .filter-group:first-child {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0.25rem;
    }
    .filter-group:first-child::-webkit-scrollbar { display: none; }

    .filter-btn {
        white-space: nowrap;
        flex-shrink: 0;
        min-height: 36px;
        padding: 0.4rem 0.8rem;
    }

    .filters-right {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 0.5rem 0.75rem;
        flex-wrap: nowrap;
    }

    .metrics-grid { grid-template-columns: 1fr; }
    .metric-card-wide { grid-column: auto; }
    .podio-pedestal { width: 80px; }
    .reaction-source, .exclusivity-source { min-width: 90px; font-size: 0.78rem; }
}

/* Mobile phones */
@media (max-width: 480px) {
    .tagline { display: none; }
    .logo { font-size: 1.25rem; }

    .hero-search { padding: 1.25rem 0 1rem; margin-bottom: 0.75rem; }
    .hero-title { font-size: 1.05rem; margin-bottom: 0.85rem; }
    .hero-input { font-size: 0.85rem; padding: 0.7rem 3.8rem 0.7rem 2.4rem; }
    .hero-action-card { min-width: 110px; width: 110px; }
    .hero-action-icon svg { width: 20px; height: 20px; }
    .hero-action-label { font-size: 0.65rem; }

    .header-inner {
        padding: 0.6rem 0.75rem;
    }
    .header-meta {
        gap: 0.5rem;
        font-size: 0.75rem;
    }
    #header-date {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .btn-icon {
        min-width: 44px;
        min-height: 44px;
        padding: 0.6rem;
    }

    .header-stats { display: none; }

    .filters-inner {
        padding: 0.5rem 0;
        gap: 0.4rem 0.6rem;
        flex-wrap: wrap;
        align-items: center;
    }

    .filter-group:first-child {
        width: 100%;
        display: flex;
        gap: 0.2rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .filter-group:first-child::-webkit-scrollbar { display: none; }

    .filter-btn {
        white-space: nowrap;
        flex-shrink: 0;
        font-size: 0.76rem;
        padding: 0.4rem 0.75rem;
        min-height: 36px;
    }

    .toggle-label {
        white-space: nowrap;
        font-size: 0.74rem;
        min-height: 36px;
        display: flex;
        align-items: center;
    }

    .select-source {
        min-height: 36px;
        font-size: 0.76rem;
        padding: 0.4rem 0.6rem;
        flex: 1;
        min-width: 0;
    }

    .filters-right {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        flex-wrap: nowrap;
    }

    /* Cards */
    .main-content { padding: 0.75rem; }
    .news-grid { gap: 0.6rem; }

    .card-image { height: 160px; }
    .card-image-placeholder { height: 120px; font-size: 2rem; }

    .card-body { padding: 0.85rem 1rem; }
    .card-title { font-size: 1.05rem; }
    .card-summary { font-size: 0.82rem; -webkit-line-clamp: 2; }

    .card-footer { padding: 0.6rem 1rem; gap: 0.4rem; }
    .source-badge { font-size: 0.62rem; padding: 0.15rem 0.45rem; }
    .card-compare-hint { font-size: 0.66rem; }
    .card-time { font-size: 0.66rem; }

    /* Modal: fullscreen on mobile */
    .modal-overlay {
        padding: 0;
        align-items: stretch;
    }
    .modal-content {
        border-radius: 0;
        border: none;
        min-height: 100vh;
        min-height: 100dvh;
        max-width: 100%;
        animation: modalSlideUp 0.3s ease;
    }
    @keyframes modalSlideUp {
        from { opacity: 0; transform: translateY(40px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .modal-close {
        top: 0.6rem;
        right: 0.6rem;
        width: 44px;
        height: 44px;
        font-size: 1.4rem;
    }

    .modal-drag-handle {
        display: flex;
        justify-content: center;
        padding: 0.6rem 0 0.2rem;
        cursor: grab;
    }
    .modal-drag-handle::after {
        content: '';
        width: 36px;
        height: 4px;
        border-radius: 2px;
        background: var(--border-hi);
    }

    .compare-header { padding: 1rem 1rem 0.75rem; }
    .compare-header h2 { font-size: 1.2rem; padding-right: 2.5rem; }
    .compare-subtitle { font-size: 0.8rem; }

    .compare-section { padding: 1rem; }
    .compare-column { padding: 1rem; }

    .section-title { font-size: 0.9rem; }
    .section-desc { font-size: 0.78rem; }

    .framing-card { padding: 0.85rem; }
    .framing-source { font-size: 0.8rem; }
    .framing-title { font-size: 0.84rem; }
    .framing-tag { font-size: 0.62rem; }

    .exclusive-card { padding: 0.85rem; }
    .exclusive-source { font-size: 0.8rem; }
    .exclusive-item { font-size: 0.78rem; }

    .compare-source-name { font-size: 0.9rem; }
    .compare-title { font-size: 0.88rem; }
    .compare-summary { font-size: 0.82rem; }
    .compare-link { font-size: 0.78rem; min-height: 44px; display: inline-flex; align-items: center; }

    /* Metrics mobile */
    .metrics-title { font-size: 1.2rem; }
    .metrics-subtitle { font-size: 0.8rem; }
    .metrics-grid { grid-template-columns: 1fr; }
    .metric-card-wide { grid-column: auto; }
    .metric-card-header { padding: 1rem 1.15rem 0.6rem; }
    .metric-card-body { padding: 1rem 1.15rem; }
    .podio-container { gap: 0.5rem; }
    .podio-pedestal { width: 70px; font-size: 1.2rem; }
    .podio-pedestal-1 { height: 100px; }
    .podio-pedestal-2 { height: 75px; }
    .podio-pedestal-3 { height: 55px; }
    .podio-source { font-size: 0.72rem; }
    .reaction-source, .exclusivity-source { min-width: 70px; font-size: 0.74rem; }
    .reaction-note, .exclusivity-detail { min-width: 55px; font-size: 0.65rem; }

    /* Footer */
    .site-footer { padding: 1.5rem 0.75rem; margin-top: 2rem; }
    .footer-sources { font-size: 0.65rem; line-height: 1.6; }
}

/* Small phones (< 360px) */
@media (max-width: 360px) {
    .logo { font-size: 1rem; }
    .card-image { height: 130px; }
    .card-body { padding: 0.75rem 0.85rem; }
    .card-title { font-size: 0.95rem; }
    .compare-header h2 { font-size: 1.1rem; }
}

/* Hide drag handle on desktop */
.modal-drag-handle { display: none; }

/* Safe area support for notched phones */
@supports (padding: env(safe-area-inset-top)) {
    .site-header {
        padding-top: env(safe-area-inset-top);
    }
    .modal-content {
        padding-bottom: env(safe-area-inset-bottom);
    }
    @media (max-width: 480px) {
        .filters-inner {
            padding-left: max(0.75rem, env(safe-area-inset-left));
            padding-right: max(0.75rem, env(safe-area-inset-right));
        }
        .main-content {
            padding-left: max(0.75rem, env(safe-area-inset-left));
            padding-right: max(0.75rem, env(safe-area-inset-right));
        }
    }
}

/* ── Empty state ──────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-dim);
}
.empty-state h3 { font-size: 1.15rem; margin-bottom: 0.5rem; color: var(--text); }
.empty-state p { font-size: 0.88rem; }

/* ── Toast notification ──────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    background: var(--bg-raised);
    border: 1px solid var(--border-hi);
    color: var(--text);
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 500;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    z-index: 2000;
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.35s ease;
    pointer-events: none;
    white-space: nowrap;
    backdrop-filter: blur(12px);
}
.toast-show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ── Weekly Summary ──────────────────────────────────────────────── */

.weekly-view { padding: 1.5rem; }

.weekly-header {
    max-width: 900px;
    margin: 0 auto 2rem;
    text-align: center;
}

.weekly-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}
.weekly-title svg { stroke: var(--accent); opacity: 0.7; }

.weekly-subtitle {
    font-size: 0.9rem;
    color: var(--text-dim);
    font-style: italic;
}

.weekly-ai-attribution {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.85rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
    background: linear-gradient(135deg, rgba(64, 136, 199, 0.12) 0%, rgba(100, 80, 200, 0.08) 100%);
    border: 1px solid rgba(64, 136, 199, 0.22);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    transition: background 0.4s, border-color 0.4s;
}
.weekly-ai-attribution svg {
    flex-shrink: 0;
    stroke: var(--accent);
    opacity: 0.85;
}
.weekly-ai-attribution .weekly-ai-sep {
    opacity: 0.45;
    font-weight: 400;
}
.weekly-ai-attribution .weekly-ai-dates {
    color: var(--text-dim);
    font-weight: 400;
}
.weekly-ai-attribution .ai-provider {
    color: var(--text-dim);
    font-weight: 400;
    font-style: italic;
}

/* Loading state — animated pulse dot + text */
.weekly-ai-loading {
    border-color: rgba(64, 136, 199, 0.4);
}
.ai-pulse-dot-sm {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    animation: ai-pulse-sm 1.4s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes ai-pulse-sm {
    0%, 100% { opacity: 0.35; transform: scale(0.85); }
    50%      { opacity: 1;    transform: scale(1.15); }
}

/* Done state — brief green "Listo" flash */
.weekly-ai-done {
    border-color: rgba(52, 199, 89, 0.4);
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.12) 0%, rgba(64, 136, 199, 0.08) 100%);
}
.weekly-ai-check {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
    color: #34c759;
    margin-left: 0.1rem;
    opacity: 1;
    transition: opacity 0.6s ease;
}
.weekly-ai-check::before {
    content: "✓";
    font-size: 0.9em;
}
.weekly-ai-check-hide {
    opacity: 0;
}

/* After "Listo" fades, revert to normal badge colors */
.weekly-ai-done:has(.weekly-ai-check-hide) {
    border-color: rgba(64, 136, 199, 0.22);
    background: linear-gradient(135deg, rgba(64, 136, 199, 0.12) 0%, rgba(100, 80, 200, 0.08) 100%);
}

/* Loading area (just spinner, no text) */
.weekly-loading-area {
    display: flex;
    justify-content: center;
    padding: 3rem 0;
}
.weekly-loading-area[hidden] {
    display: none;
}

.weekly-error {
    max-width: 600px;
    margin: 2rem auto;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.95rem;
}

.weekly-hero {
    max-width: 900px;
    margin: 0 auto 2rem;
    background: var(--bg-raised);
    border: 1px solid var(--border-hi);
    border-radius: var(--radius);
    overflow: hidden;
}

.weekly-hero-image {
    width: 100%;
    height: 380px;
    object-fit: cover;
    display: block;
}
.weekly-hero-image-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, rgba(64,136,199,0.08) 0%, rgba(100,80,200,0.06) 100%);
}

.weekly-hero-body {
    padding: 1.5rem 2rem 2rem;
}

.weekly-theme-emoji {
    font-size: 1.1rem;
}
.weekly-theme-emoji-lg {
    font-size: 1.6rem;
    display: block;
    margin-bottom: 0.3rem;
}

.weekly-hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.25;
    margin-bottom: 0.8rem;
}

.weekly-hero-summary {
    font-family: 'Libre Baskerville', serif;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.weekly-theme-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.weekly-source-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(64,136,199,0.12);
    border: 1px solid rgba(64,136,199,0.2);
    color: var(--text-dim);
    white-space: nowrap;
}

.weekly-themes-grid {
    max-width: 900px;
    margin: 0 auto 2rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.weekly-theme-card {
    background: var(--bg-raised);
    border: 1px solid var(--border-hi);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.weekly-theme-card:hover {
    border-color: rgba(64,136,199,0.3);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.weekly-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}
.weekly-card-image-placeholder {
    width: 100%;
    height: 100px;
    background: linear-gradient(135deg, rgba(64,136,199,0.06) 0%, rgba(100,80,200,0.04) 100%);
}

.weekly-card-body {
    padding: 1rem 1.25rem 1.25rem;
}

.weekly-card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    margin: 0.3rem 0 0.6rem;
}

.weekly-card-summary {
    font-family: 'Libre Baskerville', serif;
    font-size: 0.85rem;
    line-height: 1.65;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
}

.weekly-footer {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-dim);
}

@media (max-width: 768px) {
    .weekly-themes-grid { grid-template-columns: 1fr; }
    .weekly-hero-image { height: 240px; }
    .weekly-hero-body { padding: 1.2rem 1.25rem 1.5rem; }
    .weekly-hero-title { font-size: 1.3rem; }
    .weekly-hero-summary { font-size: 0.92rem; }
    .weekly-title { font-size: 1.5rem; }
}

@media (max-width: 480px) {
    .weekly-view { padding: 1rem 0.75rem; }
    .weekly-hero-image { height: 180px; }
    .weekly-hero-body { padding: 1rem; }
    .weekly-hero-title { font-size: 1.15rem; }
    .weekly-hero-summary { font-size: 0.88rem; }
    .weekly-card-image { height: 140px; }
    .weekly-card-title { font-size: 0.95rem; }
    .weekly-card-summary { font-size: 0.82rem; }
    .weekly-title { font-size: 1.25rem; }
}

/* ── Resumen de Temas View ────────────────────────────────────────── */

.temas-view {
    padding: 2rem 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
}
.temas-header {
    text-align: center;
    margin-bottom: 2rem;
}
.temas-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.temas-title svg {
    stroke: var(--accent);
    flex-shrink: 0;
}
.temas-subtitle {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-top: 0.3rem;
    font-style: italic;
}

.temas-grid {
    max-width: 720px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.tema-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 1.8rem 1rem;
    background: var(--bg-raised);
    border: 1px solid var(--border-hi);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    text-align: center;
    font-family: var(--font);
    color: var(--text);
}
.tema-card:hover {
    border-color: rgba(64, 136, 199, 0.4);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.tema-card-emoji {
    font-size: 2.2rem;
    line-height: 1;
}
.tema-card-label {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
}
.tema-card-hint {
    font-size: 0.7rem;
    color: var(--text-dim);
    opacity: 0;
    transition: opacity 0.2s;
}
.tema-card:hover .tema-card-hint {
    opacity: 1;
}

.temas-detail-summary {
    max-width: 700px;
    margin: 0 auto 1.25rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(64, 136, 199, 0.07), rgba(64, 136, 199, 0.02));
    border: 1px solid rgba(64, 136, 199, 0.18);
    border-radius: var(--radius);
    font-family: 'Libre Baskerville', serif;
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.temas-detail-count {
    max-width: 700px;
    margin: 0 auto 1rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

@media (max-width: 768px) {
    .temas-grid { grid-template-columns: repeat(2, 1fr); }
    .temas-title { font-size: 1.4rem; }
}
@media (max-width: 480px) {
    .temas-view { padding: 1rem 0.75rem; }
    .temas-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .tema-card { padding: 1.2rem 0.75rem; }
    .tema-card-emoji { font-size: 1.8rem; }
    .tema-card-label { font-size: 0.85rem; }
    .temas-title { font-size: 1.2rem; }
}

/* ── Top Story View ───────────────────────────────────────────────── */

.topstory-view {
    padding: 2rem 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
}
.topstory-header {
    text-align: center;
    margin-bottom: 2rem;
}
.topstory-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.topstory-title svg {
    stroke: var(--accent);
    flex-shrink: 0;
}
.topstory-subtitle {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-top: 0.3rem;
    font-style: italic;
}

.topstory-hero {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-raised);
    border: 1px solid var(--border-hi);
    border-radius: var(--radius);
    overflow: hidden;
}
.topstory-hero-image {
    width: 100%;
    height: 420px;
    object-fit: cover;
    display: block;
}
.topstory-hero-image-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, rgba(64,136,199,0.08) 0%, rgba(100,80,200,0.06) 100%);
}
.topstory-hero-body {
    padding: 2rem 2.5rem 2.5rem;
}

.topstory-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    font-size: 0.78rem;
    color: var(--text-dim);
}
.topstory-category {
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--accent);
}
.topstory-source-count {
    font-weight: 500;
}
.topstory-time {
    opacity: 0.7;
}

.topstory-emoji {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.4rem;
}

.topstory-headline {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 900;
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 0.6rem;
}

.topstory-original-title {
    font-size: 0.82rem;
    color: var(--text-dim);
    font-style: italic;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.topstory-summary {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.topstory-key-points {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.topstory-key-points li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--text);
    padding: 0.65rem 1rem;
    background: rgba(64, 136, 199, 0.06);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.topstory-sources-section,
.topstory-articles-section {
    margin-top: 1.5rem;
}
.topstory-section-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-dim);
    margin-bottom: 0.6rem;
}

.topstory-articles-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.topstory-article-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    transition: background 0.15s;
}
.topstory-article-link:hover {
    background: rgba(255,255,255,0.03);
}
.topstory-article-link:last-child {
    border-bottom: none;
}
.topstory-article-source {
    font-weight: 600;
    font-size: 0.82rem;
    white-space: nowrap;
    min-width: 80px;
}
.topstory-article-title {
    flex: 1;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
.topstory-article-link svg {
    flex-shrink: 0;
    stroke: var(--text-dim);
    opacity: 0.5;
}

@media (max-width: 768px) {
    .topstory-hero-image { height: 280px; }
    .topstory-hero-body { padding: 1.5rem; }
    .topstory-headline { font-size: 1.5rem; }
    .topstory-summary { font-size: 0.95rem; }
    .topstory-title { font-size: 1.4rem; }
}
@media (max-width: 480px) {
    .topstory-view { padding: 1rem 0.75rem; }
    .topstory-hero-image { height: 200px; }
    .topstory-hero-body { padding: 1rem; }
    .topstory-headline { font-size: 1.25rem; }
    .topstory-summary { font-size: 0.9rem; }
    .topstory-title { font-size: 1.2rem; }
    .topstory-article-source { min-width: 60px; font-size: 0.75rem; }
    .topstory-article-title { font-size: 0.82rem; }
}

/* ── Word Cloud ────────────────────────────────────────────────────── */

.wordcloud-view {
    padding: 2rem 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
}
.wordcloud-header {
    text-align: center;
    margin-bottom: 2rem;
}
.wordcloud-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.wordcloud-title svg {
    stroke: var(--accent);
    flex-shrink: 0;
}
.wordcloud-subtitle {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-top: 0.3rem;
    font-style: italic;
}
.wordcloud-canvas-wrap {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-raised);
    border: 1px solid var(--border-hi);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}
.wordcloud-canvas-wrap canvas {
    display: block;
    max-width: 100%;
}
@media (max-width: 768px) {
    .wordcloud-title { font-size: 1.4rem; }
    .wordcloud-canvas-wrap { padding: 1rem; min-height: 220px; }
}
@media (max-width: 480px) {
    .wordcloud-view { padding: 1rem 0.75rem; }
    .wordcloud-title { font-size: 1.2rem; }
    .wordcloud-canvas-wrap { padding: 0.75rem; min-height: 180px; }
}

/* ── AI Search ─────────────────────────────────────────────────────── */

/* Status indicator inside the search bar */
.ai-status {
    position: absolute;
    right: 2.6rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    transition: all 0.3s ease;
}
/* Suggestions dropdown */
.search-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-raised);
    border: 1px solid var(--border-hi);
    border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    z-index: 50;
    overflow: hidden;
    animation: aiFadeIn 0.2s ease;
}
.suggestions-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem 0.35rem;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
}
.suggestion-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.55rem 1rem;
    background: none;
    border: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}
.suggestion-item:hover { background: rgba(255,255,255,0.05); }
.suggestion-item:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.suggestion-emoji {
    font-size: 1rem;
    width: 1.4rem;
    text-align: center;
    flex-shrink: 0;
}
.suggestion-label { flex: 1; }

.ai-status-on svg { stroke: var(--green); opacity: 0.8; }
.ai-status-off {
    cursor: help;
}
.ai-status-off svg { stroke: var(--red); opacity: 0.7; }
.ai-status-loading { cursor: default; }

.ai-pulse-dot-sm {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: aiPulse 1s ease-in-out infinite;
}

@keyframes aiPulse {
    0%, 100% { opacity: 0.4; transform: scale(0.8); }
    50%      { opacity: 1;   transform: scale(1.2); }
}

/* Summary panel */
.ai-summary-panel {
    max-width: 660px;
    margin: 0 auto 1.25rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(64, 136, 199, 0.07), rgba(64, 136, 199, 0.02));
    border: 1px solid rgba(64, 136, 199, 0.18);
    border-radius: var(--radius);
    text-align: left;
    animation: aiFadeIn 0.35s ease;
}
.ai-summary-loading {
    background: linear-gradient(135deg, rgba(64, 136, 199, 0.04), transparent);
    border-color: rgba(64, 136, 199, 0.1);
}

.ai-summary-header {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.5rem;
}
.ai-summary-loading .ai-summary-header { margin-bottom: 0; }

.ai-sparkle-icon { stroke: var(--accent); flex-shrink: 0; }

.ai-summary-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
}
.ai-summary-provider {
    font-size: 0.68rem;
    font-weight: 400;
    font-style: italic;
    color: var(--text-dim);
    margin-left: auto;
}

.ai-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: aiPulse 1s ease-in-out infinite;
    flex-shrink: 0;
}

.ai-summary-text {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text);
    margin: 0;
}

.ai-summary-history {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 0.75rem;
    color: var(--text-dim);
}

@keyframes aiFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    .ai-summary-panel { margin: 0 0.75rem 1rem; padding: 0.85rem 1rem; }
    .ai-status { right: 2.2rem; }
    .hero-input-clear:not([hidden]) ~ .ai-status { right: 2.8rem; }
}

/* ── Auth UI ─────────────────────────────────────────────────────────── */

.auth-area { display: flex; align-items: center; margin-left: 0.5rem; }

.btn-login {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.btn-login:hover { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.25); }

.user-menu { position: relative; }

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s;
}
.user-menu-toggle:hover { background: rgba(255,255,255,0.08); }

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.15);
}
.user-avatar[src=""] { display: none; }

.user-name {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    padding: 0.4rem 0;
    z-index: 200;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.55rem 1rem;
    font-size: 0.82rem;
    color: var(--text);
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}
.user-dropdown-item:hover { background: rgba(255,255,255,0.06); }

/* ── Login modal ───────────────────────────────────────────────────── */

.login-modal-content {
    max-width: 400px;
    padding: 2.5rem 2rem 2rem;
    text-align: center;
}

.login-modal-title {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 0.3rem;
}

.login-modal-subtitle {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin: 0 0 1.5rem;
}

.login-google-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.7rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1f1f1f;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: box-shadow 0.2s, background 0.2s;
}
.login-google-btn:hover { background: #f8f9fa; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }

.login-divider {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 1.2rem 0;
    color: var(--text-dim);
    font-size: 0.78rem;
}
.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.magic-link-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.magic-email-input {
    width: 100%;
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
    color: var(--text);
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.magic-email-input:focus { border-color: var(--accent); }
.magic-email-input::placeholder { color: var(--text-dim); }

.magic-link-btn {
    width: 100%;
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
}
.magic-link-btn:hover { opacity: 0.9; }
.magic-link-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.magic-link-status {
    margin-top: 0.6rem;
    padding: 0.6rem 0.8rem;
    font-size: 0.82rem;
    border-radius: 6px;
    text-align: left;
}
.magic-link-status.success {
    background: rgba(45,106,79,0.15);
    color: #6ecf96;
    border: 1px solid rgba(45,106,79,0.3);
}
.magic-link-status.error {
    background: rgba(230,57,70,0.15);
    color: #ff8a8a;
    border: 1px solid rgba(230,57,70,0.3);
}

.hero-action-admin {
    border: 1px dashed rgba(255,255,255,0.2);
}

@media (max-width: 600px) {
    .user-name { display: none; }
    .login-modal-content { padding: 2rem 1.2rem 1.5rem; }
}
