/* FeedWatch Live — editorial redesign (NYT/Reuters broadsheet style) */

/* ── color tokens ─────────────────────────────────────────────── */
:root {
  --bg: #ffffff; --panel: #ffffff; --surface: #ffffff; --card: #ffffff;
  --sidebar: #fafaf8; --surface2: #f2f2ee; --chip: #f2f2ee;
  --line: #e2e2dd; --line2: #ededea;
  --text: #121212; --muted: #5a5a55; --faint: #6e6e68;
  --accent: #b3261e; --accent2: #b3261e; --glow: rgba(179,38,30,.07);
  --serif: 'Source Serif 4','Iowan Old Style',Palatino,Georgia,'Times New Roman',serif;
  --sans: 'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  --r: 14px; --rs: 8px;
  --shadow: 0 1px 2px rgba(20,18,12,.04), 0 2px 8px rgba(20,18,12,.05);
  --shadow-h: 0 6px 20px rgba(20,18,12,.10);
  --transition-fast: .15s ease; --transition-med: .22s ease;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg:#121211; --panel:#1a1917; --surface:#1a1917; --card:#1a1917;
    --sidebar:#181715; --surface2:#26241f; --chip:#26241f;
    --line:#33302a; --line2:#2a2823;
    --text:#ece8df; --muted:#a39e93; --faint:#8a857a;
    --accent:#f0a3a3; --accent2:#f0a3a3; --glow:rgba(240,163,163,.10);
    --shadow:0 1px 2px rgba(0,0,0,.25),0 2px 10px rgba(0,0,0,.3);
    --shadow-h:0 6px 22px rgba(0,0,0,.4);
  }
}
:root[data-theme="light"] {
  --bg:#fff; --panel:#fff; --surface:#fff; --card:#fff; --sidebar:#fafaf8;
  --surface2:#f2f2ee; --chip:#f2f2ee; --line:#e2e2dd; --line2:#ededea;
  --text:#121212; --muted:#5a5a55; --faint:#6e6e68;
  --accent:#b3261e; --accent2:#b3261e; --glow:rgba(179,38,30,.07);
  --shadow:0 1px 2px rgba(20,18,12,.04),0 2px 8px rgba(20,18,12,.05);
  --shadow-h:0 6px 20px rgba(20,18,12,.10);
}
:root[data-theme="dark"] {
  --bg:#121211; --panel:#1a1917; --surface:#1a1917; --card:#1a1917; --sidebar:#181715;
  --surface2:#26241f; --chip:#26241f; --line:#33302a; --line2:#2a2823;
  --text:#ece8df; --muted:#a39e93; --faint:#8a857a;
  --accent:#f0a3a3; --accent2:#f0a3a3; --glow:rgba(240,163,163,.10);
  --shadow:0 1px 2px rgba(0,0,0,.25),0 2px 10px rgba(0,0,0,.3);
  --shadow-h:0 6px 22px rgba(0,0,0,.4);
}

/* ── base ─────────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box }
[hidden] { display: none !important }
html, body { margin: 0; height: 100% }
body {
  font: 14px/1.45 var(--sans);
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden;
}
.spacer { flex: 1 }
.only-mobile { display: none }

/* ── keyboard focus — one visible ring for every control ──────── */
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible,
.navrow:focus-visible, .disc:focus-visible, .np-cat:focus-visible, .tbtn:focus-visible,
.story:focus-visible, .lead-main:focus-visible, .trend-chip:focus-visible,
.rb-btn:focus-visible, .rb-close:focus-visible, .rb-fs:focus-visible,
.mark-all-btn:focus-visible, .staging-pill:focus-visible, .citem:focus-visible,
.crumb-back:focus-visible, .src-hit:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px;
}
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px }

/* ── skip link ────────────────────────────────────────────────── */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 1000;
  background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 0 0 8px 0; font-weight: 600 }
.skip-link:focus { left: 0 }

/* ── respect reduced motion ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  .skel { animation: none; background: var(--surface2) }
  .reader, body.reading .reader, .side, body.drawer-open .side { transition: none }
}

/* ── vintage masthead ─────────────────────────────────────────── */
.masthead {
  text-align: center; background: var(--panel); flex: 0 0 auto;
  padding: 9px max(18px,env(safe-area-inset-right)) 8px max(18px,env(safe-area-inset-left));
  border-top: 3px solid var(--text); border-bottom: 3px double var(--text);
}
.mh-edition { font-family: var(--sans); font-size: 10px; letter-spacing: .26em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 5px }
.mh-logo { font-family: var(--serif); font-weight: 700; font-size: 46px; line-height: .92;
  letter-spacing: -1.4px; color: var(--text); text-decoration: none; display: inline-block }
.mh-sub { font-family: var(--serif); font-style: italic; font-size: 13px; color: var(--muted); margin-top: 5px }

/* ── top bar ──────────────────────────────────────────────────── */
.top {
  display: flex; align-items: center; gap: 16px; height: 58px;
  padding: 0 max(18px,env(safe-area-inset-right)) 0 max(18px,env(safe-area-inset-left));
  background: var(--panel); border-bottom: 1px solid var(--line); flex: 0 0 auto; z-index: 30;
}
.brand {
  font-family: var(--serif); font-weight: 700; font-size: 25px; letter-spacing: -.5px;
  color: var(--text); text-decoration: none; flex: 0 0 auto;
}
.tabs { display: flex; align-items: center; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; min-width: 0 }
.tabs::-webkit-scrollbar { display: none }
.np-cat {
  font-family: var(--sans); font-weight: 600; font-size: 14px; color: var(--muted);
  padding: 7px 13px; border-radius: 8px; white-space: nowrap; cursor: pointer;
  border: 0; background: none; transition: background .12s, color .12s;
}
.np-cat:hover { background: var(--chip); color: var(--text) }
.np-cat.active { color: var(--text); background: var(--chip) }

.search {
  display: flex; align-items: center; gap: 8px; background: var(--chip); border-radius: 9px;
  padding: 8px 12px; width: 220px; flex: 0 0 auto;
}
.sf-ico { color: var(--faint); font-size: 14px; flex: 0 0 auto }
.search input { border: 0; background: none; outline: 0; font: inherit; color: var(--text); width: 100%; min-width: 0 }
.search input::placeholder { color: var(--faint) }
.search-x { background: none; border: 0; color: var(--faint); cursor: pointer; font-size: 12px; padding: 0 2px }

.tools { display: flex; gap: 2px; flex: 0 0 auto }
.tbtn {
  min-width: 36px; height: 36px; border-radius: 9px; border: 0; background: none;
  color: var(--muted); cursor: pointer; font-size: 14px; font-weight: 600; font-family: inherit;
  padding: 0 9px; transition: background .12s, color .12s;
}
.tbtn:hover { background: var(--chip); color: var(--text) }
.tbtn.active { color: var(--accent) }

/* ── shell ────────────────────────────────────────────────────── */
.shell { position: relative; flex: 1; display: flex; min-height: 0; overflow: hidden }

/* ── sidebar ──────────────────────────────────────────────────── */
.side {
  width: 248px; flex: 0 0 248px; background: var(--sidebar);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden;
}
.side-scroll { flex: 1; overflow-y: auto; scrollbar-width: none; padding: 12px 10px }
.side-scroll::-webkit-scrollbar { display: none }
.cap {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--faint); padding: 12px 12px 6px;
}
.cap:first-child { padding-top: 2px }
.nav { display: flex; flex-direction: column; gap: 1px }
.navrow {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px;
  background: none; border: 0; font: inherit; color: var(--text); cursor: pointer;
  text-align: left; width: 100%; transition: background .12s;
}
.navrow:hover { background: var(--chip) }
.navrow.active { background: var(--chip) }
.navrow.active .nm { font-weight: 600 }
.navrow .nm { flex: 1; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.navrow.small { padding: 7px 12px 7px 14px }
.navrow.small .nm { font-size: 13px; color: var(--muted) }
.navrow .cnt { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums }
.navrow.active .ico { color: var(--accent) }
.ico { width: 18px; flex: 0 0 18px; text-align: center; color: var(--muted); font-size: 14px;
  display: flex; align-items: center; justify-content: center }
.ico-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin: 0 5px }
.ico-star::before { content: "★" }
.ico-clock::before { content: "🔖"; font-size: 13px }
.ico-box::before { content: "📥"; font-size: 13px }
.ico-bell::before { content: "🔔"; font-size: 13px }
.fav { width: 16px; height: 16px; border-radius: 4px; flex: 0 0 16px; object-fit: cover }

.grp { margin-top: 1px }
.disc {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px;
  font-size: 14px; color: var(--text); cursor: pointer; list-style: none; user-select: none;
}
.disc::-webkit-details-marker { display: none }
.disc:hover { background: var(--chip) }
.disc .d-ic { width: 18px; flex: 0 0 18px; text-align: center; font-size: 14px; line-height: 1 }
.disc .nm { flex: 1; font-weight: 500 }
.disc .ct { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums }
.disc .chev { font-size: 16px; color: var(--faint); line-height: 1; margin-left: 4px;
  transition: transform .18s ease; transform: translateY(-1px) }
.grp[open] > .disc .chev { transform: rotate(90deg) translateX(-1px) }
.grp[open] > .disc { background: var(--chip) }
.grp[open] > .disc .nm { font-weight: 600 }
.sub { padding: 2px 0 8px }
#podcasts.sub, #sources.sub, #regions.sub { max-height: 300px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent }
#podcasts.sub::-webkit-scrollbar, #sources.sub::-webkit-scrollbar, #regions.sub::-webkit-scrollbar { width: 7px }
#podcasts.sub::-webkit-scrollbar-thumb, #sources.sub::-webkit-scrollbar-thumb,
#regions.sub::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px }

/* live filter inside long Sfoglia lists */
.grp-filter { width: calc(100% - 24px); margin: 2px 12px 6px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text);
  font: inherit; font-size: 13px }
.grp-filter::placeholder { color: var(--faint) }
.grp-filter:focus { outline: 2px solid var(--accent); outline-offset: 1px }

.side-foot { padding: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; flex: 0 0 auto }
.dl { display: flex; align-items: center; gap: 10px; background: var(--text); color: var(--bg);
  border-radius: 10px; padding: 9px 12px; text-decoration: none }
.dl:hover { opacity: .9 }
.dl-ic { width: 26px; height: 26px; border-radius: 6px; flex: 0 0 26px; object-fit: cover }
.dl-tx { flex: 1; display: flex; flex-direction: column; line-height: 1.25 }
.dl-t { font-weight: 600; font-size: 13px }
.dl-s { font-size: 11px; opacity: .7 }
.dl-cta { font-weight: 700; font-size: 11.5px; background: var(--bg); color: var(--text);
  padding: 5px 10px; border-radius: 7px; flex: 0 0 auto }

/* iOS install banner — mobile only, dismissible */
.app-banner { display: none }
.ab-main { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; text-decoration: none; color: inherit }
.ab-ic { width: 36px; height: 36px; border-radius: 8px; flex: 0 0 36px; object-fit: cover }
.ab-tx { display: flex; flex-direction: column; line-height: 1.25; min-width: 0 }
.ab-tx b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.ab-tx span { font-size: 11px; opacity: .7 }
.ab-cta { background: var(--bg); color: var(--text); font-weight: 700; font-size: 12px;
  padding: 8px 14px; border-radius: 8px; flex: 0 0 auto }
.ab-x { background: none; border: 0; color: var(--bg); opacity: .55; font-size: 14px;
  cursor: pointer; padding: 6px 8px; flex: 0 0 auto }
.ab-x:hover { opacity: 1 }
.legal { display: flex; gap: 8px; justify-content: center; font-size: 12px }
.legal a { color: var(--faint); text-decoration: none }
.legal a:hover { color: var(--text) }
.legal span { color: var(--faint); opacity: .5 }
.drawer-x { position: absolute; top: 10px; right: 10px; background: none; border: 0;
  color: var(--muted); font-size: 16px; cursor: pointer; z-index: 2 }

/* ── feed ─────────────────────────────────────────────────────── */
.feed { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg) }
/* the feed-head acts as the top section label ("In evidenza" + date) */
.feed-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1080px; width: 100%; margin: 0 auto; padding: 16px 28px 10px;
  border-bottom: 1px solid var(--text); flex: 0 0 auto;
}
.feed-title { font-family: var(--sans); font-weight: 700; font-size: 13px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text); margin: 0 }
.feed-meta { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; text-align: right }
.feed-head > div:first-child { display: flex; align-items: baseline; gap: 10px; min-width: 0 }
.unread-n { color: var(--accent); font-weight: 600 }
/* breadcrumb back chip when inside a single source/region */
.crumb-back { font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: none; color: var(--accent); background: none; border: 0; cursor: pointer; padding: 0 4px 0 0 }
.crumb-back:hover { text-decoration: underline }
/* search "jump to source" hits */
.src-hits { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 0 4px; border-bottom: 1px solid var(--line); margin-bottom: 6px }
.src-hits .sec-min { width: 100%; font-family: var(--sans); font-size: 11px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--faint) }
.src-hit { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 20px; background: var(--bg); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer }
.src-hit:hover { background: var(--chip); border-color: var(--accent) }
.src-hit .fav { width: 15px; height: 15px; border-radius: 3px }

/* keyword highlight + alerts manager */
mark { background: var(--glow); color: inherit; border-radius: 2px; padding: 0 1px;
  box-shadow: inset 0 -2px 0 rgba(179,38,30,.25) }
.kw-mgr { padding: 16px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px }
.kw-add { display: flex; gap: 8px }
.kw-add input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--bg); color: var(--text); font: inherit; font-size: 14px }
.kw-add input:focus { outline: 2px solid var(--accent); outline-offset: 1px }
.kw-addbtn { flex: 0 0 auto; padding: 9px 15px; border: 1px solid var(--accent); background: var(--accent);
  color: #fff; border-radius: 9px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer }
.kw-addbtn:hover { filter: brightness(1.06) }
.kw-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px }
.kw-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 8px 6px 13px;
  border: 1px solid var(--line); border-radius: 20px; background: var(--chip);
  font-size: 13px; font-weight: 500; color: var(--text) }
.kw-x { background: none; border: 0; color: var(--faint); cursor: pointer; font-size: 11px;
  width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center }
.kw-x:hover { background: var(--accent); color: #fff }
.mark-all-btn {
  font-size: 11px; color: var(--accent); cursor: pointer; font-weight: 600;
  padding: 4px 9px; border: 1px solid var(--line); background: var(--panel);
  white-space: nowrap; border-radius: 6px; flex: 0 0 auto;
}
.mark-all-btn:hover { background: var(--chip) }

.list { flex: 1; overflow: auto; scrollbar-width: none; padding: 0 0 50px }
.list::-webkit-scrollbar { width: 0 }
.edit { max-width: 1080px; margin: 0 auto; padding: 0 28px }

/* in-content section divider (Ultime notizie) */
.sec { display: flex; align-items: center; gap: 12px; padding: 20px 0 11px;
  border-bottom: 1px solid var(--text); margin-bottom: 2px }
.sec .l { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text); white-space: nowrap }

/* shared story atoms */
.kick { display: block; font-family: var(--sans); font-size: 10.5px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px }
.st-h, .lead-h { font-family: var(--serif); font-weight: 600; color: var(--text); display: block }
.st-sum, .lead-sum { font-family: var(--serif); color: var(--muted); display: block }
.by { display: block; font-family: var(--sans); font-size: 10.5px; color: var(--faint); margin-top: 7px }

/* lead block: main story + vertical rule + rail */
.lead { display: grid; grid-template-columns: 1.55fr 1px 1fr; padding: 18px 0 4px }
.vr { background: var(--line) }
.lead-main, .lead-rail { display: block }
.lead-main { padding: 0 26px 6px 0; background: none; border: 0; width: 100%; text-align: left; cursor: pointer; font: inherit; color: var(--text) }
.lead-h { font-size: 34px; line-height: 1.08; letter-spacing: -.5px; margin: 0 0 9px }
.lead-main .lead-sum { font-size: 16px; line-height: 1.5; margin: 0 }
.lead-img { width: 100%; aspect-ratio: 3/2; object-fit: cover; display: block; margin: 14px 0 0; background: var(--surface2) }
.lead-rail { padding: 0 0 0 26px; display: flex; flex-direction: column }

/* story (rail + columns): button, flat, hairline separated */
.story { display: flex; flex-direction: column; padding: 0 0 15px; margin-bottom: 15px;
  border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left;
  cursor: pointer; font: inherit; color: var(--text); width: 100% }
.story:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 4px }
.story .st-h { font-size: 15.5px; line-height: 1.2; margin: 0 }
.story .st-sum { font-size: 12.5px; line-height: 1.45; margin: 5px 0 0 }
.story:hover .st-h { color: var(--accent) }
.story.read .st-h { color: var(--muted); font-weight: 400 }
.story.active .st-h { color: var(--accent) }
.lead-rail .story .st-h { font-size: 18px }
.lead-rail .story .st-sum { font-size: 13.5px }
.lead-main:hover .lead-h { color: var(--accent) }
.lead-main.read .lead-h { color: var(--muted) }
.lead-main.active .lead-h { color: var(--accent) }

/* story with thumbnail */
.story.has-thumb { display: grid; grid-template-columns: 1fr 92px; gap: 12px; align-items: start }
.story.has-thumb .st-body { display: flex; flex-direction: column; min-width: 0 }
.story.has-thumb .st-sum { -webkit-line-clamp: 2; margin: 4px 0 0 }
.story .th { width: 92px; height: 70px; object-fit: cover; background: var(--surface2); flex: 0 0 auto }

/* columns grid (Ultime notizie) */
.cols { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); padding: 16px 0 0 }
.col { padding: 0 18px; border-right: 1px solid var(--line); min-width: 0 }
.col:first-child { padding-left: 0 }
.col:last-child { border-right: 0; padding-right: 0 }

/* banner ad slot (NYT-style: labeled, centered, hairline-framed) */
.ad-banner { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  text-align: center; padding: 16px; margin: 24px 0 }
.ad-banner .ad-label { display: block; font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 9px }
.ad-banner ins { display: block; min-height: 90px }

/* preview placeholder (visible "ad space" until real ads go live) */
.ad-ph-box { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 100px; background: var(--surface2); border: 1px dashed var(--line); border-radius: var(--rs);
  color: var(--faint) }
.ad-ph-t { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--muted) }
.ad-ph-s { font-family: var(--serif); font-style: italic; font-size: 12px }
.ad-inarticle.ad-ph { margin: 26px 0; padding-top: 0; border-top: 0 }

/* ── list states ──────────────────────────────────────────────── */
.skel { height: 320px; border-radius: var(--rs); margin-bottom: 14px;
  background: linear-gradient(90deg, var(--card) 25%, var(--surface2) 37%, var(--card) 63%);
  background-size: 400% 100%; animation: sh 1.2s infinite }
.skel-lead { height: 300px; margin-bottom: 0 }
.skel-row { height: 60px; margin-bottom: 14px }
@keyframes sh { 0% { background-position: 100% 0 } 100% { background-position: -100% 0 } }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 72px 32px; gap: 10px }
.empty-mark { width: 52px; height: 52px; background: var(--surface2); border: 1px solid var(--line);
  border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 22px; margin-bottom: 6px }
.empty-t { font-family: var(--serif); font-size: 17px; font-weight: 600 }
.empty-s { font-size: 13px; color: var(--faint); max-width: 240px; line-height: 1.5 }
.list-end { text-align: center; color: var(--faint); font-size: 12px; padding: 26px 0 30px; font-style: italic }
.load-sentinel { height: 1px }
.feed-err { color: var(--accent); font-size: 11px; font-weight: 600; cursor: pointer;
  border-bottom: 1px dotted var(--accent) }
.feed-err:hover { background: var(--glow) }

/* ── back to top ──────────────────────────────────────────────── */
.back-top { position: fixed; bottom: 24px; right: 22px; width: 40px; height: 40px;
  background: var(--text); color: var(--bg); border: 0; border-radius: 50%;
  font-size: 16px; cursor: pointer; z-index: 100; transition: opacity .2s; box-shadow: var(--shadow-h) }
.back-top[hidden] { display: none }
.back-top:hover { opacity: .85 }

/* ── trending chips ───────────────────────────────────────────── */
.trending { display: flex; align-items: center; gap: 7px; padding: 10px 28px 2px;
  max-width: 1080px; width: 100%; margin: 0 auto;
  overflow-x: auto; flex-shrink: 0; scrollbar-width: none }
.trending::-webkit-scrollbar { display: none }
.trending-label { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); white-space: nowrap; flex: 0 0 auto }
.trend-chip { background: var(--chip); border: 1px solid var(--line); color: var(--muted);
  padding: 4px 12px; font: inherit; font-size: 12px; font-weight: 600; border-radius: 16px;
  cursor: pointer; white-space: nowrap; flex: 0 0 auto; transition: background .12s, color .12s }
.trend-chip:hover, .trend-chip.active { background: var(--text); color: var(--bg); border-color: var(--text) }

/* ── staging pill ─────────────────────────────────────────────── */
.staging-pill { display: block; margin: 8px auto 0; max-width: 1080px; width: calc(100% - 56px); padding: 9px 18px;
  background: var(--accent); color: #fff; border: 0; border-radius: 8px;
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-align: center; animation: pill-in .22s ease }
.staging-pill:hover { filter: brightness(1.08) }
@keyframes pill-in { from { opacity: 0; transform: translateY(-5px) } to { opacity: 1; transform: none } }

/* ── pull-to-refresh ──────────────────────────────────────────── */
.ptr { display: flex; align-items: center; justify-content: center; height: 0; overflow: hidden;
  transition: height .12s; background: var(--bg); flex-shrink: 0 }
.ptr-spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--text);
  border-radius: 50%; animation: ptr-spin .7s linear infinite }
@keyframes ptr-spin { to { transform: rotate(360deg) } }

/* ── reader (overlay — slides in from right on desktop) ──────── */
.reader { position: absolute; top: 0; right: 0; bottom: 0; width: 720px; max-width: 100%;
  transform: translateX(100%); transition: transform .22s ease;
  background: var(--panel); border-left: 1px solid var(--line);
  overflow: auto; scrollbar-width: none; z-index: 40 }
body.reading .reader { transform: translateX(0) }
.reader::-webkit-scrollbar { width: 0 }
.read-progress { position: sticky; top: 0; height: 2px; background: var(--accent); width: 0%; z-index: 10;
  transition: width .1s linear; border-radius: 0 1px 1px 0 }
.reader-bar { position: sticky; top: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 9px 18px; background: var(--panel); border-bottom: 1px solid var(--line); z-index: 5 }
.rb-back { background: var(--chip); border: 1px solid var(--line); border-radius: 8px;
  color: var(--muted); padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer }
.rb-close { display: inline-flex; align-items: center; gap: 6px; background: var(--chip);
  border: 1px solid var(--line); border-radius: 8px; color: var(--text);
  padding: 7px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; flex: 0 0 auto }
.rb-close:hover { background: var(--accent); color: #fff; border-color: var(--accent) }
.rb-btn { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600;
  color: var(--muted); padding: 6px 11px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; cursor: pointer; text-decoration: none }
.rb-btn:hover { color: var(--text); background: var(--chip) }
.rb-btn.on { color: var(--accent); border-color: var(--accent) }
.rb-fs { background: none; border: 1px solid var(--line); border-radius: 8px; color: var(--muted);
  cursor: pointer; padding: 5px 10px; font-size: 12px; font-weight: 700; font-family: inherit }
.rb-fs:hover { background: var(--chip); color: var(--text) }
.article { --fs: 1; max-width: 680px; margin: 0 auto; padding: 30px 40px 80px }
.article-src { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 11px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--accent) }
.article-src .card-fav { width: 18px; height: 18px; border-radius: 4px }
.article-srcname { color: var(--accent2) }
.dot-sep { color: var(--faint) }
.card-time { color: var(--faint) }
.pod-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700;
  color: var(--accent); background: var(--glow); padding: 3px 8px; border-radius: 6px; text-transform: uppercase }
.article-title { font-family: var(--serif); font-size: calc(32px * (1 + (var(--fs,1) - 1) * 0.6)); line-height: 1.18; font-weight: 700;
  margin: .1em 0 .55em; letter-spacing: -.4px }
.hero { width: 100%; margin: 6px 0 20px; border-radius: var(--rs); border: 1px solid var(--line) }
.hero-ph { aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center;
  background: var(--surface2); color: var(--faint); font-size: 12px; border-radius: var(--rs) }
.prose { font-family: var(--serif); font-size: calc(16px * var(--fs,1)); line-height: 1.78; color: var(--text); max-width: 62ch }
.prose p { margin: 0 0 20px }
.prose p:last-child { margin-bottom: 0 }
.prose img { max-width: 100%; height: auto; border-radius: var(--rs) }
.prose a { color: var(--accent2); text-decoration-thickness: 1px; text-underline-offset: 2px }
.prose a:hover { color: var(--text) }
.prose h2, .prose h3 { font-family: var(--serif); font-weight: 600; line-height: 1.3; margin: 1.5em 0 .5em; color: var(--text) }
.prose h2 { font-size: 22px }
.prose h3 { font-size: 18px }
.prose blockquote { margin: 1.5em 0; padding: .75em 1.2em; border-left: 3px solid var(--accent);
  color: var(--muted); font-style: italic; background: var(--surface2); border-radius: 0 var(--rs) var(--rs) 0 }
.readfull { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; border-radius: 10px;
  background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600; padding: 11px 20px; text-decoration: none }
.readfull:hover { opacity: .82 }

/* ── audio player ─────────────────────────────────────────────── */
.player { display: flex; align-items: center; gap: 12px; background: var(--surface2);
  border: 1px solid var(--line); border-radius: var(--rs); padding: 13px 16px; margin: 4px 0 22px }
.player .play { width: 44px; height: 44px; border-radius: 50%; background: var(--text); color: var(--bg);
  border: 0; cursor: pointer; font-size: 16px; flex: 0 0 44px }
.player .skip { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 600; flex: 0 0 auto }
.player .skip:hover { color: var(--text) }
.player-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px }
.player-bar { height: 4px; background: var(--line); border-radius: 2px; position: relative; cursor: pointer }
.player-fill { height: 100%; background: var(--text); border-radius: 2px; position: relative; width: 0 }
.player-knob { position: absolute; right: -4px; top: 50%; transform: translateY(-50%); width: 10px; height: 10px;
  border-radius: 50%; background: var(--bg); border: 1.5px solid var(--text) }
.player-times { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums }
.player-show { color: var(--faint); font-weight: 600 }
.player .speed { background: none; border: 0; color: var(--muted); font-weight: 700; font-size: 12px; cursor: pointer; width: 36px; flex: 0 0 36px }
.player .speed:hover { color: var(--text) }

/* ── ads ──────────────────────────────────────────────────────── */
.ad-card { position: relative; border-radius: var(--r); padding: 12px 14px; background: var(--card); border: 1px solid var(--line) }
.ad-card .ad-feed-ins { min-height: 160px }
.ad-inarticle { position: relative; margin: 26px 0; padding-top: 18px; border-top: 1px solid var(--line) }
.ad-inarticle ins { min-height: 90px }
.ad-label { display: block; font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 6px; opacity: .75 }
ins.adsbygoogle { background: transparent }

/* ── scrim (mobile drawer) ────────────────────────────────────── */
.scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35 }
body.drawer-open .scrim { display: block }
/* dim the feed and allow click-outside-to-close while reading (desktop) */
body.reading .scrim { display: block; background: rgba(0,0,0,.28) }

/* ── keyboard shortcuts ───────────────────────────────────────── */
.shortcuts-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200;
  display: flex; align-items: center; justify-content: center }
.shortcuts-overlay[hidden] { display: none }
.shortcuts-box { background: var(--panel); padding: 28px 32px; min-width: 320px; border-radius: var(--r);
  position: relative; border: 1px solid var(--line) }
.shortcuts-title { font-family: var(--serif); font-size: 16px; font-weight: 600; margin-bottom: 18px }
.shortcuts-grid { display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; align-items: center }
.shortcuts-grid kbd { background: var(--chip); border: 1px solid var(--line); border-radius: 6px;
  padding: 3px 8px; font-size: 12px; font-family: inherit; white-space: nowrap }
.shortcuts-grid span { font-size: 13px; color: var(--muted) }
.shortcuts-close { position: absolute; top: 14px; right: 16px; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px }
.shortcuts-close:hover { color: var(--text) }

/* ── live radio bar ───────────────────────────────────────────── */
.radio-bar { position: fixed; z-index: 88; display: flex; align-items: center; gap: 11px;
  left: 50%; transform: translateX(-50%); bottom: max(14px, env(safe-area-inset-bottom));
  background: var(--text); color: var(--bg); border-radius: 12px;
  padding: 9px 12px 9px 14px; box-shadow: var(--shadow-h); width: min(440px, calc(100% - 24px)) }
.radio-bar[hidden] { display: none }
.rad-live { width: 9px; height: 9px; border-radius: 50%; background: #e2483d; flex: 0 0 9px;
  animation: rad-pulse 1.6s ease-in-out infinite }
@keyframes rad-pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
.rad-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25 }
.rad-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.rad-state { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; opacity: .7 }
.rad-btn { background: none; border: 0; color: var(--bg); cursor: pointer; font-size: 16px;
  width: 36px; height: 36px; border-radius: 8px; flex: 0 0 auto }
.rad-btn:hover { background: rgba(255,255,255,.14) }
/* when radio bar is up on phones, lift the FAB above it too */
@media (max-width: 900px) { body.radio-on .back-top { bottom: calc(72px + env(safe-area-inset-bottom)) } }

/* ── context menu (long-press / right-click) ──────────────────── */
.ctx-menu { position: fixed; z-index: 400; min-width: 220px; display: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-h); padding: 5px }
.ctx-menu button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  background: none; border: 0; font: inherit; font-size: 13.5px; color: var(--text);
  padding: 10px 12px; border-radius: 8px; cursor: pointer }
.ctx-menu button:hover { background: var(--chip) }

/* ── toast ────────────────────────────────────────────────────── */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(8px);
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 20px; font-size: 13px; font-weight: 500; color: var(--text);
  box-shadow: var(--shadow-h); z-index: 300; white-space: nowrap; transition: opacity .25s, transform .25s; opacity: 0 }
.toast[hidden] { display: none }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0) }

/* ── responsive ───────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .cols { grid-template-columns: repeat(2, minmax(0,1fr)); column-gap: 0 }
  .col:nth-child(2) { border-right: 0; padding-right: 0 }
  .col:nth-child(3) { padding-left: 0 }
  .col:nth-child(n+3) { border-top: 1px solid var(--text); padding-top: 14px; margin-top: 2px }
}
@media (max-width: 900px) {
  .only-mobile { display: inline-flex }
  .masthead { padding-top: 7px; padding-bottom: 6px }
  .mh-logo { font-size: 32px; letter-spacing: -1px }
  .mh-edition { font-size: 9px; letter-spacing: .2em; margin-bottom: 3px }
  .mh-sub { display: none }

  /* TWO-ROW TOP BAR: row 1 = brand + search + tools (incl ☰), row 2 = tabs.
     Everything that can shrink does, so ☰ and the tools never get pushed off. */
  .top { flex-wrap: wrap; height: auto; row-gap: 0; padding: 6px max(10px,env(safe-area-inset-left)) 0 max(10px,env(safe-area-inset-right)); gap: 8px }
  .brand { order: 1; font-size: 21px }
  .search { order: 3; width: auto; flex: 1 1 120px; min-width: 0 }
  .tools { order: 4; flex: 0 0 auto; margin-left: auto }
  .tbtn { min-width: 40px; height: 40px }
  #np-cats.tabs { order: 5; flex: 1 0 100%; width: 100%; gap: 4px; padding: 4px 0 5px; margin-top: 4px; border-top: 1px solid var(--line) }
  .np-cat { padding: 9px 13px; font-size: 14px }

  .side {
    position: fixed; top: 0; left: 0; bottom: 0; width: 290px; max-width: 85vw; z-index: 60;
    padding-left: env(safe-area-inset-left);
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-h);
  }
  body.drawer-open .side { transform: translateX(0) }
  .reader { position: fixed; inset: 0; width: 100%; height: 100dvh; z-index: 70 }
  .reader-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-top: max(9px,env(safe-area-inset-top)) }
  .reader-bar::-webkit-scrollbar { display: none }
  .rb-tx { display: none }

  /* editorial layout collapses to a single column on phones */
  .lead { grid-template-columns: 1fr; padding-top: 14px }
  .lead .vr { display: none }
  .lead-main { padding: 0 0 16px 0; border-bottom: 1px solid var(--line); margin-bottom: 16px }
  .lead-h { font-size: 27px }
  .lead-rail { padding-left: 0 }
  .cols { grid-template-columns: 1fr }
  .col { padding: 0; border-right: 0 }
  .col + .col { border-top: 1px solid var(--text); padding-top: 14px; margin-top: 2px }
  .edit { padding: 0 16px }
  .feed-head { padding: 14px 16px 10px }

  /* bigger touch targets on phones */
  .trend-chip { padding: 8px 14px }
  .search-x { padding: 8px; min-width: 34px; min-height: 34px; display: flex; align-items: center; justify-content: center }
  .legal a { padding: 8px 4px; display: inline-block }
  .navrow.small { padding-top: 10px; padding-bottom: 10px }

  /* iOS install banner pinned to the bottom (honoring the home indicator) */
  .app-banner:not([hidden]) {
    display: flex; align-items: center; gap: 8px;
    position: fixed; z-index: 90;
    left: max(8px,env(safe-area-inset-left)); right: max(8px,env(safe-area-inset-right));
    bottom: max(8px,env(safe-area-inset-bottom));
    background: var(--text); color: var(--bg);
    border-radius: 12px; padding: 8px 8px 8px 11px; box-shadow: var(--shadow-h);
  }
  .ab-x { padding: 10px 12px }
  .list { padding-bottom: calc(70px + env(safe-area-inset-bottom)) }
  /* lift the floating FAB + toast above the banner while it is showing */
  body.banner-on .back-top { bottom: calc(74px + env(safe-area-inset-bottom)) }
  body.banner-on .toast { bottom: calc(74px + env(safe-area-inset-bottom)) }
}
@media (max-width: 560px) {
  /* collapse search to a magnifier that expands on focus to reclaim width */
  .top .search { flex: 0 0 40px; width: 40px; padding: 8px; transition: flex-basis .18s, width .18s }
  .top .search input { width: 0; padding: 0 }
  .top .search.open { flex: 1 1 100%; width: auto; padding: 8px 12px }
  .top .search.open input { width: 100% }
  .article { padding: 24px 20px 70px }
  .article-title { font-size: 26px }
}
