/* TWATM stylesheet  — v4 */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;1,400&display=swap');
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #f4f4f0;
    --surface: #ffffff;
    --border: #e0ddd8;
    --text: #1a1a1a;
    --muted: #6b6b6b;
    --accent: #1d4ed8;
    --accent-light: #eff6ff;
    --danger: #dc2626;
    --success: #16a34a;
    --radius: 10px;
    --shadow: 0 1px 4px rgba(0, 0, 0, .08), 0 4px 16px rgba(0, 0, 0, .06);
}

html {
    overflow-x: hidden;
    /* iOS Safari needs this on html element */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

img {
    max-width: 100%;
}

/* ── Setup screen ──────────────────────────────────────────── */
#setup {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.setup-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 2.5rem;
    max-width: 560px;
    width: 100%;
}

.setup-card h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -.5px;
    margin-bottom: .25rem;
}

.setup-card h1 span {
    color: var(--accent);
}

.setup-card .subtitle {
    color: var(--muted);
    margin-bottom: 2rem;
    font-size: .95rem;
}

label.field-label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    margin-bottom: .5rem;
}

textarea#profileText {
    width: 100%;
    height: 110px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .75rem 1rem;
    font-size: .95rem;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color .15s;
    color: var(--text);
    background: var(--bg);
}

textarea#profileText:focus {
    border-color: var(--accent);
    background: #fff;
}

.region-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .25rem;
    margin-bottom: 1.5rem;
}

.region-chip {
    padding: .35rem .85rem;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: all .15s;
    background: var(--surface);
}

.region-chip.selected {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .7rem 1.4rem;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity .15s, transform .1s;
}

.btn:active {
    transform: scale(.97);
}

.btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    width: 100%;
    justify-content: center;
    font-size: 1rem;
    padding: .85rem;
}

.btn-primary:hover:not(:disabled) {
    opacity: .9;
}

.field-group {
    margin-bottom: 1.25rem;
}

/* ── App shell ─────────────────────────────────────────────── */
#app {
    display: none;
    flex-direction: column;
    min-height: 100vh;
}

header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(244, 244, 240, .92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    padding: .75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.logo.logo-text-only {
    flex: 0 0 auto;
}

.logo-wordmark {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -.3px;
    line-height: 1;
}

.logo-tagline {
    font-size: .68rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-top: .18rem;
}

.header-meta {
    flex: 1;
    font-size: .8rem;
    color: var(--muted);
}

.btn-sm {
    padding: .4rem .9rem;
    font-size: .8rem;
    border-radius: 8px;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-outline.active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.btn-danger-outline {
    background: transparent;
    border: 1.5px solid #fecaca;
    color: var(--danger);
}

/* ── Edit modal ────────────────────────────────────────────── */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-backdrop.open {
    display: flex;
}

.modal {
    background: var(--surface);
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .2);
}

.modal h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.reader-modal {
    max-width: 860px;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.reader-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.reader-header h3 {
    margin: 0;
    font-family: 'Lora', Georgia, serif;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.35;
}

.reader-meta {
    font-size: .78rem;
    color: var(--muted);
}

.reader-notice {
    font-size: .75rem;
    color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .45rem .65rem;
}

.reader-content {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    padding: 1.5rem 2rem;
    overflow-y: auto;
    min-height: 180px;
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text);
    letter-spacing: 0.01em;
}

.reader-content p {
    margin: 0 0 1.2rem;
    text-align: justify;
    hyphens: auto;
}

.reader-content p:first-child::first-letter {
    font-size: 3em;
    font-weight: 600;
    line-height: 1;
    float: left;
    margin: .05em .12em 0 0;
    color: var(--accent);
}

.reader-content p:last-child {
    margin-bottom: 0;
}

.reader-actions {
    display: flex;
    justify-content: flex-end;
}

.modal-footer {
    display: flex;
    gap: .75rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
}

/* ── Newspaper layout ──────────────────────────────────────── */
main {
    max-width: 1240px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 4rem;
}

.feed-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .5rem;
}

.feed-header-main {
    display: flex;
    align-items: baseline;
    gap: .75rem;
    min-width: 0;
}

.feed-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
}

.feed-count {
    font-size: .8rem;
    color: var(--muted);
    background: var(--border);
    padding: .15rem .55rem;
    border-radius: 999px;
}

.feed-logo-image {
    margin-left: auto;
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: .28rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    flex: 0 0 auto;
}

.paper-date {
    text-align: center;
    border-top: 3px solid var(--text);
    border-bottom: 1px solid var(--border);
    padding: .45rem 0;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1.5rem;
}

.paper-section-label {
    display: block;
    font-size: .67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .13em;
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
    padding-bottom: .28rem;
    margin-bottom: 1rem;
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero-article {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
    padding-bottom: 1.75rem;
    margin-bottom: 1.75rem;
    border-bottom: 1px solid var(--border);
}

/* Grid children MUST have min-width:0 or they won't shrink on mobile */
.hero-image-wrap,
.hero-content {
    min-width: 0;
}

.hero-article.no-img {
    grid-template-columns: 1fr;
    max-width: 700px;
}

.hero-image-wrap {
    border-radius: var(--radius);
    overflow: hidden;
    line-height: 0;
    width: 100%;
}

.hero-image-wrap img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: var(--radius);
    display: block;
}

.hero-kicker {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
    margin-bottom: .5rem;
}

.hero-headline {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -.025em;
    margin-bottom: .65rem;
    color: var(--text);
    overflow-wrap: break-word;
    word-break: break-word;
}

.hero-headline a {
    color: inherit;
    text-decoration: none;
}

.hero-headline a:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.hero-snippet {
    font-size: .97rem;
    line-height: 1.65;
    color: var(--text);
    opacity: .85;
    margin-bottom: .8rem;
    overflow-wrap: break-word;
}

.article-byline {
    font-size: .72rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
    margin-bottom: .7rem;
}

.article-actions {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
}

.featured-actions {
    display: flex;
    align-items: center;
    gap: .3rem;
    flex-wrap: wrap;
    margin-top: .3rem;
}

/* ── Featured ──────────────────────────────────────────────── */
.paper-featured {
    margin-bottom: 1.75rem;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
}

.featured-article {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    padding-right: 1.25rem;
    margin-right: 1.25rem;
    border-right: 1px solid var(--border);
    min-width: 0;
}

.featured-article:last-child {
    border-right: none;
    margin-right: 0;
    padding-right: 0;
}

.featured-image-wrap {
    width: 100%;
    overflow: hidden;
    line-height: 0;
    border-radius: calc(var(--radius) - 2px);
}

.featured-image-wrap img {
    width: 100%;
    aspect-ratio: 3/2;
    object-fit: cover;
    display: block;
    margin-bottom: .3rem;
}

.featured-kicker {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-wrap: wrap;
}

.featured-headline {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.28;
    letter-spacing: -.01em;
    color: var(--text);
    overflow-wrap: break-word;
    word-break: break-word;
}

.featured-headline a {
    color: inherit;
    text-decoration: none;
}

.featured-headline a:hover {
    text-decoration: underline;
}

.featured-snippet {
    font-size: .8rem;
    line-height: 1.5;
    color: var(--text);
    opacity: .8;
    flex: 1;
    overflow-wrap: break-word;
}

.featured-byline {
    font-size: .68rem;
    color: var(--muted);
    display: flex;
    gap: .3rem;
    align-items: center;
    margin-top: auto;
}

/* ── Standard grid ─────────────────────────────────────────── */
.paper-body {
    display: grid;
    grid-template-columns: 1fr 265px;
    gap: 0 2.5rem;
    align-items: start;
}

.standard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    padding-top: .5rem;
}

.standard-article {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    padding: 0 1rem 1.1rem 0;
    margin: 0 1rem 1.1rem 0;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    min-width: 0;
}

.standard-article:nth-child(3n) {
    border-right: none;
    padding-right: 0;
    margin-right: 0;
}

.standard-image-wrap {
    width: 100%;
    overflow: hidden;
    line-height: 0;
    border-radius: calc(var(--radius) - 2px);
}

.standard-image-wrap img {
    width: 100%;
    aspect-ratio: 3/2;
    object-fit: cover;
    display: block;
    margin-bottom: .3rem;
}

.standard-kicker {
    display: flex;
    align-items: center;
    gap: .3rem;
    flex-wrap: wrap;
}

.standard-headline {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: .88rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text);
    overflow-wrap: break-word;
    word-break: break-word;
}

.standard-headline a {
    color: inherit;
    text-decoration: none;
}

.standard-headline a:hover {
    text-decoration: underline;
}

.standard-snippet {
    font-size: .75rem;
    line-height: 1.45;
    color: var(--muted);
    overflow-wrap: break-word;
}

.standard-byline {
    font-size: .66rem;
    color: var(--muted);
    display: flex;
    gap: .3rem;
    align-items: center;
    margin-top: auto;
}

.standard-actions {
    display: flex;
    align-items: center;
    gap: .3rem;
    flex-wrap: wrap;
    margin-top: .25rem;
}

/* ── Desktop briefing sidebar ──────────────────────────────── */
.paper-briefing {
    position: sticky;
    top: 65px;
    max-height: calc(100vh - 85px);
    overflow-y: auto;
    border-left: 1px solid var(--border);
    padding-left: 1.5rem;
}

.paper-briefing::-webkit-scrollbar {
    width: 4px;
}

.paper-briefing::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.briefing-list {
    display: flex;
    flex-direction: column;
    padding-top: .25rem;
}

.briefing-item {
    padding: .65rem 0;
    border-bottom: 1px solid var(--border);
}

.briefing-item:last-child {
    border-bottom: none;
}

.briefing-kicker {
    display: flex;
    align-items: center;
    gap: .3rem;
    flex-wrap: wrap;
    margin-bottom: .2rem;
}

.briefing-headline {
    font-size: .8rem;
    font-weight: 700;
    line-height: 1.35;
    font-family: Georgia, 'Times New Roman', serif;
    color: var(--text);
    overflow-wrap: break-word;
    word-break: break-word;
}

.briefing-headline a {
    color: inherit;
    text-decoration: none;
}

.briefing-headline a:hover {
    text-decoration: underline;
}

.briefing-meta {
    font-size: .65rem;
    color: var(--muted);
    margin-top: .25rem;
}

.briefing-actions {
    display: flex;
    align-items: center;
    gap: .25rem;
    margin-top: .3rem;
}

/* ── Mobile briefing strip ─────────────────────────────────── */
.mobile-briefing {
    display: none;
}

/* ── Badges & buttons ──────────────────────────────────────── */
.source-name {
    font-size: .68rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.region-badge {
    font-size: .62rem;
    font-weight: 700;
    padding: .12rem .38rem;
    border-radius: 3px;
    letter-spacing: .03em;
}

.badge-EU {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-MENA {
    background: #fef3c7;
    color: #92400e;
}

.badge-APAC {
    background: #dcfce7;
    color: #166534;
}

.badge-NA {
    background: #fce7f3;
    color: #9d174d;
}

.badge-LATAM {
    background: #ede9fe;
    color: #5b21b6;
}

.badge-AF {
    background: #ffedd5;
    color: #9a3412;
}

.badge-GLOBAL {
    background: #f0f9ff;
    color: #0369a1;
}

.badge-default {
    background: #f3f4f6;
    color: #374151;
}

.translated-badge {
    font-size: .62rem;
    font-weight: 700;
    padding: .12rem .38rem;
    border-radius: 3px;
    background: #fef9c3;
    color: #854d0e;
    letter-spacing: .02em;
}

.btn-icon {
    padding: .25rem .5rem;
    border-radius: 5px;
    font-size: .75rem;
    background: transparent;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all .1s;
}

.btn-icon:hover {
    background: #f9f9f9;
}

.btn-icon.liked,
.btn-icon.saved {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

.btn-icon.disliked {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

.read-link {
    font-size: .72rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    padding: .25rem .55rem;
    border-radius: 5px;
    border: 1px solid #bfdbfe;
    transition: all .1s;
}

.read-link:hover {
    background: var(--accent-light);
}

.read-original-link {
    color: var(--muted);
    border-color: var(--border);
}

/* ── Headline tap-to-read button reset ─────────────────────── */
.headline-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    display: block;
    width: 100%;
    text-decoration: none;
}

.hero-headline .headline-btn:hover,
.featured-headline .headline-btn:hover,
.standard-headline .headline-btn:hover,
.briefing-headline .headline-btn:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

/* ── Perspectives ──────────────────────────────────────────── */
.perspectives-toggle {
    font-size: .72rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-light);
    border: none;
    cursor: pointer;
    padding: .28rem .6rem;
    border-radius: 6px;
    width: 100%;
    text-align: left;
    transition: background .1s;
    margin-top: .3rem;
}

.perspectives-toggle:hover {
    background: #dbeafe;
}

.perspectives-list {
    display: none;
    flex-direction: column;
    gap: .4rem;
    padding-top: .4rem;
    border-top: 1px dashed var(--border);
    margin-top: .25rem;
}

.perspectives-list.open {
    display: flex;
}

.perspective-item {
    font-size: .78rem;
    display: flex;
    flex-direction: column;
    gap: .12rem;
}

.perspective-item .p-source {
    font-weight: 700;
    color: var(--muted);
}

.perspective-item .p-title {
    color: var(--text);
    line-height: 1.3;
}

.perspective-item a {
    font-size: .72rem;
    color: var(--accent);
    text-decoration: none;
}

/* ── Loading / Spinner / Toast ─────────────────────────────── */
.spinner-wrap {
    display: flex;
    justify-content: center;
    padding: 4rem 0;
}

.spinner-wrap.compact {
    padding: .75rem 0 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.loading-state {
    min-height: 380px;
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.loading-state.no-image {
    min-height: 220px;
}

.loading-splash {
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    background: white;
    border-bottom: 1px solid var(--border);
}

.loading-panel {
    width: min(100%, 680px);
    margin: 0 auto;
    text-align: center;
    color: var(--text);
    padding: 1.5rem 1.25rem 2rem;
}

.loading-state.no-image .loading-panel {
    color: var(--text);
}

.loading-title {
    font-size: clamp(1.4rem, 2.4vw, 2rem);
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.1;
}

.loading-subtitle {
    margin: .75rem auto 0;
    max-width: 40rem;
    font-size: .98rem;
    line-height: 1.55;
    color: var(--muted);
}

.loading-state.no-image .loading-subtitle {
    color: var(--muted);
}

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

.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--muted);
}

.empty-state h3 {
    margin-bottom: .5rem;
    font-size: 1.1rem;
}

.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: #1a1a1a;
    color: white;
    padding: .7rem 1.2rem;
    border-radius: var(--radius);
    font-size: .85rem;
    z-index: 999;
    opacity: 0;
    transform: translateY(8px);
    transition: all .25s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — mobile-first breakpoints
   ══════════════════════════════════════════════════════════════ */

/* ── ≤1000px: collapse sidebar, show briefing chip strip ─── */
@media (max-width: 1000px) {
    main {
        padding: .75rem .75rem 3rem;
        max-width: 100%;
    }

    .paper-body {
        grid-template-columns: 1fr;
    }

    .hero-article,
    .featured-grid,
    .standard-grid {
        grid-template-columns: 1fr !important;
    }

    .hero-image-wrap,
    .hero-content,
    .featured-article,
    .standard-article,
    .featured-image-wrap,
    .standard-image-wrap {
        min-width: 0;
        max-width: 100%;
    }

    .hero-headline,
    .hero-snippet,
    .featured-headline,
    .featured-snippet,
    .standard-headline,
    .standard-snippet,
    .briefing-headline {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .paper-briefing {
        display: none;
    }

    .mobile-briefing {
        display: block;
        overflow-x: auto;
        border-top: 2px solid var(--text);
        border-bottom: 1px solid var(--border);
        padding: .75rem 0;
        margin-top: 1.5rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scroll-snap-type: x mandatory;
    }

    .mobile-briefing-inner {
        display: flex;
        gap: .75rem;
        padding: .25rem 0 .25rem 1.5rem;
    }

    /* spacer so last chip isn't clipped by Safari scroll container */
    .mobile-briefing-inner::after {
        content: '';
        flex: 0 0 1.5rem;
    }

    .mobile-briefing-chip {
        display: inline-flex;
        flex-direction: column;
        gap: .25rem;
        min-width: 180px;
        max-width: 200px;
        flex-shrink: 0;
        padding: .5rem .65rem;
        border: 1px solid var(--border);
        border-radius: 8px;
        text-decoration: none;
        color: var(--text);
        transition: all .1s;
        scroll-snap-align: start;
    }

    .mobile-briefing-chip:hover,
    .mobile-briefing-chip:active {
        background: var(--accent-light);
        border-color: var(--accent);
    }

    .mobile-briefing-chip-headline {
        font-size: .78rem;
        font-weight: 700;
        font-family: Georgia, serif;
        line-height: 1.3;
        white-space: normal;
    }

    .mobile-briefing-chip-meta {
        font-size: .65rem;
        color: var(--muted);
    }
}

/* ── ≤800px: tighten padding, single-col hero + featured ─── */
@media (max-width: 800px) {
    main {
        padding: .75rem .75rem 3rem;
    }

    .standard-grid {
        grid-template-columns: 1fr;
    }

    main {
        padding: 1rem 1rem 3rem;
    }

    .hero-article {
        grid-template-columns: 1fr;
        gap: 1.1rem;
    }

    .hero-headline {
        font-size: 1.6rem;
    }

    .featured-grid {
        grid-template-columns: 1fr;
    }

    .featured-article {
        border-right: none;
        padding-right: 0;
        margin-right: 0;
        border-bottom: 1px solid var(--border);
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }

    .featured-article:last-child {
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
    }

    /* 2-column standard grid at tablet width */
    .standard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* override the 3n no-border rule — restore right divider for col-1 items */
    .standard-article:nth-child(3n) {
        border-right: 1px solid var(--border);
        padding-right: 1rem;
        margin-right: 1rem;
    }

    /* col-2 (rightmost): no right divider */
    .standard-article:nth-child(2n) {
        border-right: none;
        padding-right: 0;
        margin-right: 0;
    }
}

/* ── ≤600px: single column everything, mobile header ───── */
@media (max-width: 600px) {
    header {
        padding: .6rem 1rem;
        gap: .5rem;
        flex-wrap: wrap;
    }

    .header-meta {
        display: none;
    }

    .btn-sm {
        padding: .35rem .6rem;
        font-size: .75rem;
    }

    .logo-wordmark {
        font-size: 1.02rem;
    }

    .logo-tagline {
        font-size: .58rem;
    }

    main {
        padding: .75rem .75rem 3rem;
    }

    .hero-headline {
        font-size: 1.35rem;
    }

    .standard-grid {
        grid-template-columns: 1fr;
    }

    .standard-article {
        border-right: none !important;
        padding-right: 0 !important;
        margin-right: 0 !important;
    }

    /* larger tap targets */
    .btn-icon {
        min-height: 40px;
        padding: .5rem .7rem;
        font-size: .8rem;
    }

    .read-link {
        min-height: 40px;
        padding: .5rem .7rem;
        font-size: .8rem;
        display: inline-flex;
        align-items: center;
    }

    /* keep hero image proportional on small screens */
    .hero-image-wrap img {
        aspect-ratio: 16/9;
        max-height: 56vw;
    }

    /* narrower briefing chips on small phones */
    .mobile-briefing-chip {
        min-width: 155px;
        max-width: 175px;
    }

    .feed-header {
        align-items: flex-start;
        gap: .6rem;
    }

    .feed-header-main {
        flex-wrap: wrap;
    }

    .feed-logo-image {
        width: 42px;
        height: 42px;
        border-radius: 10px;
        padding: .2rem;
    }

    .loading-state {
        min-height: 280px;
        border-radius: 14px;
    }

    .loading-splash {
        max-height: 220px;
    }

    .loading-panel {
        padding: 1.4rem .9rem;
    }

    .loading-subtitle {
        font-size: .9rem;
    }
}

/* ── Narrow phones: thumbnail-list layout ───────────────────
    Width-only trigger is more reliable than orientation checks
    on some mobile browsers/webviews. */
@media (max-width: 700px) {

    /* Hero: smaller image so a bit of text is visible above fold */
    .hero-image-wrap img {
        aspect-ratio: 16/9;
        max-height: 42vw;
    }

    /* ── Featured: stacked card layout (safe anti-overflow) ── */
    .featured-article {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: .45rem;
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: .75rem;
        margin: 0 0 .75rem 0;
        border-right: 1px solid var(--border);
    }

    .featured-image-wrap {
        width: 100%;
        flex: 0 0 auto;
    }

    .featured-image-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        object-fit: cover;
        margin-bottom: 0;
    }

    .featured-kicker {
        margin-bottom: .15rem;
    }

    .featured-headline {
        font-size: .95rem;
        line-height: 1.25;
    }

    .featured-snippet {
        display: none;
        /* hide snippet — save space for more articles */
    }

    /* ── Standard: stacked card layout (safe anti-overflow) ── */
    .standard-article {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: .35rem;
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: .65rem;
        margin: 0 0 .75rem 0;
        border-right: 1px solid var(--border) !important;
    }

    .standard-image-wrap {
        width: 100%;
        flex: 0 0 auto;
    }

    .standard-image-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        object-fit: cover;
        margin-bottom: 0;
    }

    .standard-headline {
        font-size: .88rem;
        line-height: 1.25;
    }

    .standard-snippet {
        display: none;
    }

    .featured-actions,
    .standard-actions {
        width: 100%;
        margin-top: .45rem;
        justify-content: flex-start;
        align-items: center;
    }

    .featured-actions .read-link,
    .standard-actions .read-link {
        margin-left: 0;
    }
}