/* NewsNest: vivid, mobile-first, follows the system light/dark setting.
   Neon is used as a fill with dark ink on it, never as text on white:
   lime = new, yellow = updated, pink = the brand and "matters" (top story, watch, high score). */
@font-face {
  font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(/newsnest/demo/static/fonts/space-grotesk-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(/newsnest/demo/static/fonts/space-grotesk-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url(/newsnest/demo/static/fonts/jetbrains-mono-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url(/newsnest/demo/static/fonts/jetbrains-mono-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  color-scheme: light;
  --bg: #f2f2ef;
  --surface: #ffffff;
  --edge: transparent; /* chip outline: light mode lifts chips with a shadow instead */
  --chip-shadow: 0 1px 2px rgb(10 10 12 / 0.08), 0 2px 6px rgb(10 10 12 / 0.05);
  --surface-2: #f1f1ee;
  --surface-3: #e4e4e0;
  --text: #0a0a0c;
  --text-2: #3a3a42;
  --muted: #64646d;
  --border: #e3e3df;
  --accent: #ff3da6;
  --accent-text: #c4006c;
  --accent-soft: #ffe3f2;
  --accent-ink: #0a0a0c;
  --lime: #c6ff3d;
  --yellow: #ffe14d;
  --neon-ink: #0a0a0c;
  --logo-dot: #a8e000;
  --link: #c4006c;
  --danger: #b3261e;
  --danger-bg: #fdecea;
  --ok: #1d7a35;
  --warn: #8a5300;
  --shadow: 0 1px 2px rgb(10 10 12 / 0.06), 0 6px 20px rgb(10 10 12 / 0.06);
  --shadow-hi: 0 2px 4px rgb(10 10 12 / 0.08), 0 14px 34px rgb(10 10 12 / 0.12);
  --display: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  /* categorical slots (validated palette), used for source badges and category marks */
  --h1: #2a78d6; --h2: #eb6834; --h3: #1baf7a; --h4: #eda100;
  --h5: #e87ba4; --h6: #008300; --h7: #6250d6; --h8: #e34948;
  --series-up: #2a78d6;
  --series-down: #eb6834;
  --chart-surface: #fcfcfb;
  --radius: 8px;
  --spring: cubic-bezier(0.32, 0.72, 0, 1); /* iOS-like ease-out for the search morph */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0a0a0c;
    --surface: #141418;
    --edge: #26262d;
    --chip-shadow: none;
    --surface-2: #1e1e24;
    --surface-3: #2a2a31;
    --text: #f4f4f6;
    --text-2: #c9c9d1;
    --muted: #9a9aa5;
    --border: #26262d;
    --accent: #ff3da6;
    --accent-text: #ff6bbb;
    --accent-soft: #3a1028;
    --accent-ink: #0a0a0c;
    --logo-dot: #c6ff3d;
    --link: #ff6bbb;
    --danger: #ff8a80;
    --danger-bg: #3a1714;
    --ok: #7bd389;
    --warn: #f0b860;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 6px 20px rgb(0 0 0 / 0.25);
    --shadow-hi: 0 2px 4px rgb(0 0 0 / 0.5), 0 14px 34px rgb(0 0 0 / 0.4);
    --h1: #3987e5; --h2: #d95926; --h3: #199e70; --h4: #c98500;
    --h5: #d55181; --h6: #008300; --h7: #9085e9; --h8: #e66767;
    --series-up: #3987e5;
    --series-down: #d95926;
    --chart-surface: #141418;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0c; --surface: #141418; --edge: #26262d; --chip-shadow: none; --surface-2: #1e1e24; --surface-3: #2a2a31; --text: #f4f4f6;
  --text-2: #c9c9d1; --muted: #9a9aa5; --border: #26262d; --accent: #ff3da6; --accent-text: #ff6bbb; --accent-soft: #3a1028;
  --accent-ink: #0a0a0c; --logo-dot: #c6ff3d; --link: #ff6bbb; --danger: #ff8a80; --danger-bg: #3a1714; --ok: #7bd389; --warn: #f0b860;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 6px 20px rgb(0 0 0 / 0.25);
  --shadow-hi: 0 2px 4px rgb(0 0 0 / 0.5), 0 14px 34px rgb(0 0 0 / 0.4);
  --h1: #3987e5; --h2: #d95926; --h3: #199e70; --h4: #c98500; --h5: #d55181; --h6: #008300; --h7: #9085e9; --h8: #e66767;
  --series-up: #3987e5; --series-down: #d95926; --chart-surface: #141418;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 110px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--sans); }
a { color: var(--link); }
code { font: 0.88em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
/* --page: the width of a page's content. --bar: the top bar's, where its brand and buttons line up: the page's,
   except on wide screens, where every page has the home page's width, so the bar never jumps between pages */
:root { --page: 1080px; }
@media (min-width: 1240px) { :root { --bar: 1352px; } }
main { max-width: var(--page); margin: 0 auto; padding: 0 16px 56px; }
footer {
  max-width: var(--page); margin: 0 auto; padding: 16px; text-align: center; color: var(--muted);
  font: 500 0.7rem var(--mono); text-transform: uppercase; letter-spacing: 0.03em;
}
footer .bad { color: var(--danger); font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.h1 { --h: var(--h1); } .h2 { --h: var(--h2); } .h3 { --h: var(--h3); } .h4 { --h: var(--h4); }
.h5 { --h: var(--h5); } .h6 { --h: var(--h6); } .h7 { --h: var(--h7); } .h8 { --h: var(--h8); }
.c0 { --h: var(--muted); }
.c1 { --h: var(--h1); } .c2 { --h: var(--h2); } .c3 { --h: var(--h3); } .c4 { --h: var(--h4); }
.c5 { --h: var(--h5); } .c6 { --h: var(--h6); } .c7 { --h: var(--h7); } .c8 { --h: var(--h8); }

/* ---------- glass bars (Apple-style frosted: content scrolls behind and shows through blurred) ---------- */
.topbar, .tabbar, .docksearch, .appmenu {
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
}
.appmenu { background: color-mix(in srgb, var(--surface) 86%, transparent); }
.searchlayer {
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar, .tabbar, .docksearch, .appmenu { background: var(--surface); }
  .searchlayer { background: var(--bg); }
}
@media (prefers-reduced-transparency: reduce) {
  .topbar, .tabbar, .docksearch, .appmenu { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .searchlayer { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 6px;
  padding: 0 max(8px, (100% - var(--bar, var(--page))) / 2 + 8px) 0 max(16px, (100% - var(--bar, var(--page))) / 2 + 16px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.brand { display: flex; align-items: center; gap: 8px; margin-right: auto; text-decoration: none; color: var(--text); font: 700 1.15rem var(--display); padding: 10px 0; }
.logo { width: 28px; height: 28px; display: block; }
.logo-arc { fill: none; stroke: currentColor; stroke-width: 3.6; stroke-linecap: round; }
/* lime fades on white, so light mode uses a deeper lime for the dot */
.logo-dot { fill: var(--logo-dot); }
.topbar nav { display: flex; gap: 2px; }
.topbar nav a {
  position: relative; white-space: nowrap; text-decoration: none; color: var(--text-2); padding: 7px 14px;
  border-radius: 999px; font: 600 0.95rem var(--display); letter-spacing: -0.01em;
}
.topbar nav a:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.topbar nav a[aria-current="page"] { background: var(--text); color: var(--bg); }
.alert-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); margin-left: 5px; vertical-align: 2px; }
.menubtn {
  position: relative; flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: transparent; color: var(--text); cursor: pointer;
}
.menubtn svg { width: 22px; height: 22px; fill: currentColor; }
.menubtn:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.menubtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.menubtn .alert-dot { position: absolute; top: 6px; right: 5px; margin: 0; }

/* ---------- search: the desktop field grows out of the magnifier; results fill a frosted layer ---------- */
.topsearch { display: flex; align-items: center; flex-direction: row-reverse; }
.topsearch .search-open {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--text-2);
}
.topsearch .search-open:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.topsearch svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.topsearch input {
  width: 0; min-height: 36px; padding: 0; border: 0; border-radius: 999px; opacity: 0; background: var(--surface-2); font-size: 0.95rem;
  transition: width 0.42s var(--spring), padding 0.42s var(--spring), opacity 0.2s ease;
}
body.searching .topsearch input { width: min(320px, 34vw); padding: 0 14px; opacity: 1; }
.docksearch input::-webkit-search-cancel-button, .topsearch input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
body.searching .topsearch .search-open { color: var(--accent-text); }
.searchlayer {
  position: fixed; inset: 0; z-index: 15; overflow-y: auto; overscroll-behavior: contain;
  padding: calc(49px + env(safe-area-inset-top)) 16px 56px;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.42s var(--spring), visibility 0s linear 0.42s;
}
body.searching { overflow: hidden; }
body.searching .searchlayer { opacity: 1; visibility: visible; transform: none; transition: opacity 0.25s ease, transform 0.42s var(--spring), visibility 0s; }
.searchresults { padding-top: 14px; }
.searchresults .empty { color: var(--muted); }
.searchmore { margin: 18px 0 0; text-align: center; }
.searchpage-form { display: flex; gap: 8px; margin: 6px 0 4px; }
.searchpage-form input { flex: 1; font-size: 17px; }
@media (max-width: 760px) {
  .searchlayer { padding-bottom: calc(100px + max(env(safe-area-inset-bottom), var(--kb, 0px))); }
}

/* ⋯ menu: a popover under the ⋯ button, which sits at the page's right edge (--page), not the window's */
.appmenu {
  position: fixed; inset: auto; top: calc(54px + env(safe-area-inset-top)); right: max(10px, (100% - var(--bar, var(--page))) / 2 + 10px); margin: 0;
  width: 250px; max-height: calc(100dvh - 70px); overflow-y: auto; padding: 6px; color: var(--text);
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent); border-radius: 16px; box-shadow: var(--shadow-hi);
}
.appmenu::backdrop { background: transparent; }
.appmenu a.pop-item { text-decoration: none; }
.appmenu .pop-item[aria-current="page"] { background: color-mix(in srgb, var(--text) 8%, transparent); font-weight: 700; }
.appmenu .pill.bad { margin-left: auto; }
.appmenu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 8px; }

.banner {
  max-width: 1080px; margin: 14px auto 0; padding: 12px 14px; border-radius: var(--radius);
  background: var(--danger-bg); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
  display: flex; gap: 12px; align-items: flex-start;
}
@media (max-width: 1112px) { .banner { margin: 14px 16px 0; } }
.banner[hidden] { display: none; }
.banner svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.banner > div { flex: 1; min-width: 0; }
.banner ul { margin: 4px 0 0; padding-left: 18px; }
.banner-link { display: inline-block; margin-top: 8px; font-weight: 700; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.banner-close { flex: none; width: 36px; height: 36px; margin: -6px -8px 0 0; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.banner-close:hover { background: color-mix(in srgb, var(--danger) 14%, transparent); }
.banner-close svg { width: 18px; height: 18px; }

/* ---------- masthead ---------- */
.masthead { padding: 28px 0 8px; }
.dateline { margin: 0; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; }
.masthead h1 { margin: 4px 0 14px; font: 700 clamp(2rem, 6vw, 3rem)/1.05 var(--display); letter-spacing: -0.01em; }
.hint { color: var(--muted); font-size: 0.88rem; margin: 10px 0 0; }
.daynav { display: flex; gap: 8px; margin: 0 0 14px; flex-wrap: wrap; }

/* page heads for the other pages */
.pagehead { padding: 26px 0 6px; }
.pagehead h1 { margin: 0 0 6px; font: 700 clamp(1.7rem, 5vw, 2.3rem)/1.1 var(--display); }
.sub { margin: 0; color: var(--text-2); }

/* ---------- blocks and sections ---------- */
.block { margin-top: 34px; }
.blocktitle {
  font: 700 1.55rem/1.2 var(--display); margin: 0 0 6px; display: flex; align-items: center; gap: 12px;
}
.blocktitle::after { content: ""; flex: 1; height: 2px; background: var(--text); opacity: 0.85; }
.group { margin: 18px 0 8px; }
.sec { display: flex; align-items: center; gap: 8px; font: 700 0.8rem var(--sans); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-2); margin: 0 0 10px; }
.sec-mark { width: 10px; height: 10px; border-radius: 3px; background: var(--h, var(--accent)); }
.sec .count { color: var(--muted); font-weight: 500; letter-spacing: 0; }
details.group > summary { cursor: pointer; list-style: none; }
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary .sec::after { content: "▾"; color: var(--muted); margin-left: 2px; transition: transform 0.15s; }
details.group:not([open]) > summary .sec::after { transform: rotate(-90deg); }
.cards { display: grid; gap: 12px; }
@media (min-width: 900px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- badges, pills, ring ---------- */
.badge {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; flex: none;
  font: 800 0.62rem/1 var(--sans); letter-spacing: -0.02em; color: #fff; background: var(--h, var(--muted));
}
/* Logos are shown as the site serves them: no tile, outline or rounding (the letter badges keep theirs) */
.badge.logo, .savatar.logo { object-fit: contain; background: none; border-radius: 0; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 0.74rem; font-weight: 600; }
.pill.new { background: var(--accent); color: var(--accent-ink); }
.pill.watch { background: color-mix(in srgb, var(--link) 14%, transparent); color: var(--link); }
.ring {
  --p: 0; flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--text-2) calc(var(--p) * 1%), var(--surface-3) 0);
}
.ring.high { background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-3) 0); }
.ring b {
  width: 31px; height: 31px; border-radius: 50%; display: grid; place-items: center; background: var(--surface);
  font-size: 0.76rem; font-variant-numeric: tabular-nums;
}
.score { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- story cards ---------- */
.card {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 14px;
  background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow); transition: box-shadow 0.15s, transform 0.15s;
}
.card.has-img { grid-template-columns: minmax(0, 1fr) 104px; }
@media (min-width: 600px) { .card.has-img { grid-template-columns: minmax(0, 1fr) 140px; } }
.card:hover { box-shadow: var(--shadow-hi); }
.card.unseen::before {
  content: ""; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent);
}
.card-text { min-width: 0; }
.card h3 { margin: 6px 0 4px; font: 700 1.12rem/1.3 var(--display); letter-spacing: -0.005em; }
.card h3 a, .hero h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover, .hero h3 a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
/* The whole card opens the story: the title link's ::after stretches over the card (every .story is
   position: relative, and h3 / .card-text / .hero-body are not). Controls and the coverage list sit above it. */
.story h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.story .acts, .story .whybox, .story .coverage { position: relative; z-index: 2; }
@supports selector(:has(*)) {
  .story:has(h3 a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
  .story h3 a:focus-visible { outline: none; }
}
.fcard.big.unseen::before { pointer-events: none; }
.thumb-img { display: block; align-self: start; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
@media (min-width: 600px) { .thumb-img { aspect-ratio: 4 / 3; } }
.thumb-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s; }
.card:hover .thumb-img img { transform: scale(1.04); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--muted); min-width: 0; }
.meta .src { font-weight: 700; color: var(--text-2); }
.meta .sep { opacity: 0.6; }
.paid { display: inline-flex; align-self: center; color: var(--muted); }
.meta .paid { margin-left: -3px; }
.coverage li .paid { margin: 0 4px 0 2px; vertical-align: -1px; }
.paid svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kicker { color: var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.72rem; }
.summary, .snippet { margin: 4px 0 0; color: var(--text-2); font-size: 0.95rem; }
.clamp-2, .clamp-3, .clamp-4 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-2 { -webkit-line-clamp: 2; } .clamp-3 { -webkit-line-clamp: 3; } .clamp-4 { -webkit-line-clamp: 4; }
.card:focus-within .clamp-3 { -webkit-line-clamp: unset; }
.note { margin: 4px 0 0; font-size: 0.76rem; color: var(--warn); }
.foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.why { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.reason { font-size: 0.82rem; color: var(--muted); }
.subs { font-size: 0.74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.rate { display: flex; gap: 4px; flex: none; }
.act:focus-visible, .chip:focus-visible, .button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.coverage { grid-column: 1 / -1; margin-top: 8px; font-size: 0.85rem; }
.coverage summary { cursor: pointer; color: var(--text-2); display: flex; align-items: center; gap: 8px; list-style: none; }
.coverage summary::-webkit-details-marker { display: none; }
.coverage summary::after { content: "▾"; color: var(--muted); }
.coverage[open] summary::after { content: "▴"; }
.stack { display: inline-flex; }
.stack .badge { width: 20px; height: 20px; border: 2px solid var(--surface); margin-left: -6px; font-size: 0.56rem; }
.stack .badge:first-child { margin-left: 0; }
.coverage ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.coverage li { display: flex; gap: 8px; align-items: flex-start; }
.coverage li a { color: var(--text-2); text-decoration: none; }
.coverage li a:hover { text-decoration: underline; }
.coverage li strong { color: var(--text); margin-right: 4px; }
.hidden-note, .empty { color: var(--muted); font-size: 0.88rem; }

/* ---------- top stories ---------- */
.top-block { margin-top: 14px; }
.hero {
  position: relative; display: grid; background: var(--surface); border: 1px solid var(--edge); border-radius: 18px;
  overflow: hidden; box-shadow: var(--shadow-hi);
}
.hero-media {
  position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
  background: linear-gradient(135deg, var(--h, var(--accent)), color-mix(in srgb, var(--h, var(--accent)) 35%, #000));
}
.hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; transition: transform 0.4s; }
.hero:hover .hero-media img { transform: scale(1.03); }
.hero-mono { position: absolute; inset: 0; display: grid; place-items: center; font: 800 4rem var(--display); color: rgb(255 255 255 / 0.35); }
.hero-body { padding: 16px 18px 14px; }
.hero h3 { margin: 8px 0 6px; font: 700 clamp(1.35rem, 3.6vw, 2rem)/1.15 var(--display); letter-spacing: -0.01em; }
.hero .summary, .hero .snippet { font-size: 1rem; }
@media (min-width: 900px) {
  .hero { grid-template-columns: 1.25fr 1fr; }
  .hero .hero-media { aspect-ratio: auto; min-height: 340px; }
  .hero .hero-body { padding: 26px 26px 18px; display: flex; flex-direction: column; }
  .hero .foot { margin-top: auto; }
}
/* ---------- callouts, placeholders ---------- */
.callout { padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); margin: 14px 0; }
.callout.error { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); }
.callout.ok { color: var(--ok); border-color: var(--ok); }
.callout.invite {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-top: 20px;
  background: linear-gradient(120deg, var(--accent-soft), var(--surface)); border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.callout.invite h2 { margin: 0 0 4px; font: 700 1.3rem var(--display); }
.callout.invite p { margin: 0; color: var(--text-2); max-width: 52ch; }
.placeholder { display: flex; gap: 14px; align-items: center; padding: 18px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); }
.placeholder svg { width: 34px; height: 34px; flex: none; fill: var(--surface-3); }
.placeholder p { margin: 0; }

/* ---------- panels, tables, forms (other pages) ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 14px 0; box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 10px; font: 700 1.2rem var(--display); }
.panel.error { border-color: var(--danger); }
.tablewrap { overflow-x: auto; margin: 8px 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.current td { background: var(--surface-2); }
.url { word-break: break-all; font-size: 0.8rem; }
.state { font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.state.ok::before { content: "● "; } .state.ok { color: var(--ok); }
.state.warning::before { content: "▲ "; } .state.warning { color: var(--warn); }
.state.failing::before { content: "✖ "; } .state.failing { color: var(--danger); }
.state.pending, .state.disabled { color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0 0 12px; }
.stats div { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; }
.stats dt { font-size: 0.78rem; color: var(--muted); }
.stats dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.meter { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-bottom: 10px; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.days { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.days li a {
  display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; border-radius: 12px; text-decoration: none;
  background: var(--surface-2); color: var(--text); font-weight: 600;
}
.days li a:hover { background: var(--surface-3); }

form.grid { display: grid; gap: 10px; margin-top: 12px; }
@media (min-width: 640px) { form.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } form.grid .button { justify-self: start; } }
label { display: flex; flex-direction: column; gap: 4px; font-size: 0.88rem; color: var(--text-2); font-weight: 600; }
label.check { flex-direction: row; align-items: center; gap: 8px; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 11px; min-height: 42px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 1px; }
input[type="checkbox"] { width: 20px; min-height: 20px; accent-color: var(--accent); }
textarea { font: 0.9rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; }
form.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
form.inline label { flex: 1 1 260px; }
.inline-form { display: inline; }
.warn { color: var(--warn); }

.callout.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 60%, transparent);
  background: color-mix(in srgb, var(--warn) 10%, transparent); }
@keyframes feed-flash { from { background: color-mix(in srgb, var(--accent) 16%, transparent); } }
.iconbtn { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); cursor: pointer; }
.iconbtn:hover { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
.iconbtn.danger:hover { color: var(--danger); background: var(--danger-bg); }
.iconbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sec { scroll-margin-top: 90px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); border-radius: 999px;
  padding: 8px 18px; min-height: 42px; margin: 6px 0; transition: filter 0.15s, transform 0.1s;
}
.button:hover { filter: brightness(1.07); }
.button:active { transform: scale(0.98); }
.button:disabled { opacity: 0.45; cursor: not-allowed; }
.button.secondary { background: transparent; color: var(--text); border-color: var(--border); }
.button.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.button.small { padding: 4px 12px; min-height: 32px; font-size: 0.84rem; }

.onboard { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; }
.onboard li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px;
  background: var(--surface-2); border-radius: 12px;
}
.onboard li > div { font: 600 1rem/1.35 var(--display); }
.onboard li .muted { font: 600 0.75rem var(--sans); display: block; text-transform: uppercase; letter-spacing: 0.05em; }

.diff { overflow-x: auto; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px; font-size: 0.85rem; }
.diff .add { color: var(--ok); }
.diff .del { color: var(--danger); }
.diff .ctx { color: var(--muted); }

/* ---------- calibration chart ---------- */
.legend { display: flex; gap: 16px; font-size: 0.88rem; color: var(--text-2); margin: 4px 0; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.swatch.up { background: var(--series-up); }
.swatch.down { background: var(--series-down); }
.chart { margin: 8px 0; background: var(--chart-surface); border-radius: 10px; padding: 8px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart figcaption { font-size: 0.8rem; color: var(--muted); }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { stroke: var(--text-2); stroke-width: 1; }
.chart .threshold { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 4 3; }
.chart .tick { fill: var(--muted); font-size: 11px; }
.chart .mark { stroke: var(--chart-surface); stroke-width: 1; }
.chart .mark.up { fill: var(--series-up); }
.chart .mark.down { fill: var(--series-down); }
.chart .bar:hover .mark { opacity: 0.8; }

/* ---------- masthead counters ---------- */
.masthead h1 { font-size: clamp(1.7rem, 6vw, 2.6rem); margin-bottom: 8px; }
.counters { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; color: var(--muted); font-size: 0.92rem; }
.counters b { color: var(--text); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.counters .hot b { color: var(--accent); }
.counters a { color: inherit; text-decoration: none; }
.counters .bad, .counters .bad b { color: var(--danger); }

/* ---------- toolbar: filter chips + mark all read ---------- */
.toolbar {
  position: sticky; top: 49px; z-index: 10; display: flex; align-items: center; gap: 8px; margin: 14px -16px 0;
  padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--border);
}
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; padding: 2px 2px 6px; margin: -2px -2px -6px; } /* room for chip shadows inside the scroll clip */
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font: 600 0.9rem var(--sans); cursor: pointer;
  min-height: 36px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--edge);
  background: var(--surface); color: var(--text-2); box-shadow: var(--chip-shadow); transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip span { color: var(--muted); font-weight: 500; }
.chip:hover { border-color: var(--text-2); }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip[aria-pressed="true"] span { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.chip.toggle svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.5; }
.chip.toggle[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip.toggle[aria-pressed="true"] svg { fill: currentColor; }
.chip-sep { width: 1px; background: var(--border); margin: 4px 2px; flex: none; }
.readall { flex: none; }
.readall .button { margin: 0; }
.readall svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 560px) { .readall .button { font-size: 0; gap: 0; padding: 4px 9px; } .readall svg { width: 18px; height: 18px; } }
.filter-empty { text-align: center; color: var(--muted); padding: 48px 16px; font: 600 1.1rem var(--display); }

/* ---------- read / seen ---------- */
/* A read story looks like a visited link: only its title turns gray (regular weight), and the Read label
   says it in words. The picture, logo and text stay as they are: a faded photo reads as "disabled" or
   "still loading", not "done". The big photo card's title rule is as specific, hence .fcard.big here.
   An unread story carries a small accent dot after its time. */
.story.read h3 a, .fcard.big.read h3 a { color: var(--muted); font-weight: 500; }
.story:not(.read) .meta > .sep + *::after {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 7px; border-radius: 50%;
  background: var(--accent); vertical-align: middle; transform: translateY(-1px);
}
.pill.readmark { display: none; }
.story.read .pill.readmark { display: inline-block; }
.story.read .pill.new { display: none; }
.top-rest { margin-top: 12px; }
.clamp-1 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; }
.why .reason.clamp-1 { flex: 1 1 100%; }

/* ---------- action buttons (read, more, less) ---------- */
.acts { display: flex; gap: 4px; flex: none; }
.acts form { display: flex; gap: 4px; }
.act {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 1px solid transparent;
  background: var(--surface-2); color: var(--muted); cursor: pointer; transition: background 0.15s, color 0.15s, transform 0.1s;
}
.act svg { width: 18px; height: 18px; fill: currentColor; }
.act.readtoggle svg { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.act:hover { color: var(--text); background: var(--surface-3); }
.act:active { transform: scale(0.9); }
.act.readtoggle[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.act.savetoggle svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.act.savetoggle[aria-pressed="true"], .acts.slim .act.savetoggle[aria-pressed="true"] { color: var(--accent); }
.act.savetoggle[aria-pressed="true"] svg { fill: currentColor; }
.act.up[aria-pressed="true"] { background: var(--ok); color: var(--surface); }
.act.down[aria-pressed="true"] { background: var(--danger); color: var(--surface); }
.onboard .rate { flex: none; }

/* ---------- more page ---------- */
.menu { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 10px; }
.menu a {
  display: grid; gap: 2px; padding: 16px; border-radius: var(--radius); text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.menu a span { color: var(--muted); font-size: 0.9rem; }
.pill.bad { background: var(--danger-bg); color: var(--danger); }

/* ---------- mobile: the sections float at the bottom in a glass pill (Apple News style) ---------- */
.dock { display: none; }
@media (max-width: 760px) {
  .topbar nav, .topsearch { display: none; }
  body { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  /* the section pill and the search circle; while searching the pill shrinks to a circle and the
     circle widens into the field (Apple News). --kb is the keyboard height, set by app.js */
  .dock {
    position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30;
    max-width: 520px; margin: 0 auto; display: flex; gap: 10px;
  }
  body.searching .dock { bottom: max(calc(10px + env(safe-area-inset-bottom)), calc(var(--kb, 0px) + 8px)); }
  .tabbar, .docksearch {
    position: relative; min-width: 0; border: 1px solid color-mix(in srgb, var(--border) 70%, transparent); border-radius: 999px;
    box-shadow: 0 2px 6px rgb(10 10 12 / 0.06), 0 10px 30px rgb(10 10 12 / 0.14);
    transition: flex 0.42s var(--spring);
  }
  .tabbar {
    flex: 1 1 0; display: grid; grid-template-columns: repeat(var(--tabs, 4), minmax(0, 1fr)); gap: 2px; padding: 5px; overflow: hidden;
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 54px;
    border-radius: 999px; font: 600 0.7rem var(--sans); color: var(--text-2); text-decoration: none; white-space: nowrap;
    -webkit-tap-highlight-color: transparent; transition: opacity 0.2s ease 0.12s;
  }
  .tabbar svg, .docksearch svg { width: 23px; height: 23px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a[aria-current="page"] { color: var(--accent-text); background: color-mix(in srgb, var(--accent) 15%, transparent); }
  .tabbar a[aria-current="page"] svg { stroke-width: 2.2; }
  .tabcurrent {
    position: absolute; inset: 0; display: grid; place-items: center; border: 0; border-radius: 999px; padding: 0;
    background: transparent; color: var(--accent-text); cursor: pointer; opacity: 0; visibility: hidden;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s; -webkit-tap-highlight-color: transparent;
  }
  .tabcurrent svg { stroke-width: 2.2; }
  .docksearch { flex: 0 0 66px; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 21px; overflow: hidden; color: var(--accent-text); }
  body:not(.searching) .search-clear { visibility: hidden; }
  .docksearch .search-open { position: absolute; inset: 0; border-radius: 999px; -webkit-tap-highlight-color: transparent; }
  .docksearch input {
    flex: 1 1 auto; min-width: 0; min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; outline: none;
    font: 400 17px var(--sans); color: var(--text); opacity: 0; transition: opacity 0.2s ease;
  }
  .search-clear {
    flex: none; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; padding: 0;
    background: color-mix(in srgb, var(--text) 10%, transparent); color: var(--text-2); cursor: pointer;
  }
  .search-clear svg { width: 18px; height: 18px; stroke-width: 2.2; }
  .search-clear[hidden] { display: none; }
  body.searching .tabbar { flex: 0 0 66px; }
  body.searching .tabbar a { opacity: 0; pointer-events: none; transition-delay: 0s; transition-duration: 0.12s; }
  body.searching .tabcurrent { opacity: 1; visibility: visible; transition: opacity 0.2s ease 0.12s, visibility 0s; }
  body.searching .docksearch { flex: 1 1 0; color: var(--muted); }
  body.searching .docksearch .search-open { display: none; }
  body.searching .docksearch input { opacity: 1; transition-delay: 0.14s; }
  .card { padding: 12px; }
  .card h3 { font-size: 1.05rem; }
  .foot { gap: 8px; }
  .hero-body { padding: 14px; }
}

/* ---------- home feed (Discover-style single column) ---------- */
.feedwrap { max-width: 720px; margin: 0 auto; }
.feedwrap .toolbar { margin-left: -16px; margin-right: -16px; }
@media (min-width: 752px) { .feedwrap .toolbar { margin-left: 0; margin-right: 0; border-radius: 0 0 14px 14px; } }
.stream { display: grid; gap: 14px; margin-top: 14px; }
a.chip { text-decoration: none; }
.chip[aria-current="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip[aria-current="true"] span { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.pill.updated { background: color-mix(in srgb, var(--h3) 18%, transparent); color: var(--text); }

.fcard.big {
  position: relative; background: var(--surface); border: 1px solid var(--edge); border-radius: 18px;
  overflow: hidden; box-shadow: var(--shadow-hi);
}
.big-media {
  position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
  background: linear-gradient(135deg, var(--h, var(--accent)), color-mix(in srgb, var(--h, var(--accent)) 35%, #000));
}
.big-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; transition: transform 0.4s; }
.fcard.big:hover .big-media img { transform: scale(1.03); }
.big-body { padding: 14px 16px 12px; }
.fcard.big h3 { margin: 8px 0 6px; font: 700 clamp(1.25rem, 4.2vw, 1.6rem)/1.2 var(--display); letter-spacing: -0.01em; }
.fcard.big h3 a { color: var(--text); text-decoration: none; }
.fcard.big.unseen::before {
  content: ""; position: absolute; z-index: 2; left: 0; right: 0; top: 0; height: 4px; background: var(--accent);
}

/* card menu */
.kebab { position: relative; }
.kebab > summary { list-style: none; }
.kebab > summary::-webkit-details-marker { display: none; }
.kebab .act svg { fill: currentColor; }
.kebab[open] > summary { background: var(--text); color: var(--bg); }
.pop {
  position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 15; min-width: 250px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-hi);
}
.pop form { display: block; }
.pop-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text); font: 500 0.92rem var(--sans); text-align: left; cursor: pointer; min-height: 44px;
}
.pop-item:hover, .pop-item:focus-visible { background: var(--surface-2); }
.pop-item svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pop-item[aria-pressed="true"] { color: var(--ok); }
.pop-item[aria-pressed="true"] svg { fill: currentColor; }

.hiddenbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px;
  border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); font-size: 0.9rem;
}
.hiddenbar .button { margin: 0; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 40;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 0.9rem;
  box-shadow: var(--shadow-hi); display: flex; align-items: center; gap: 14px;
}
.toast[hidden] { display: none; }
.toast-undo {
  margin: -6px -8px -6px 0; padding: 6px 10px; border: 0; border-radius: 999px; background: transparent;
  color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.toast-undo:hover, .toast-undo:focus-visible { background: color-mix(in srgb, var(--bg) 18%, transparent); }
@media (max-width: 760px) { .toast { bottom: calc(90px + env(safe-area-inset-bottom)); } }

.caughtup { text-align: center; padding: 36px 16px 8px; color: var(--muted); }
.caughtup svg { width: 44px; height: 44px; fill: none; stroke: var(--ok); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.caughtup h2 { margin: 6px 0 4px; font: 700 1.3rem var(--display); color: var(--text); }
.caughtup p { margin: 4px 0; }
/* now and then one more line under the heading (newsnest/eggs.py), with the logo's dot in front */
.caughtup .caughtup-aside {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 10px;
  font: 500 0.78rem var(--mono);
}

/* ---------- v3: two-level chips, slim card footer ---------- */
.toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
.chips.sub { gap: 6px; }
.chip.small { min-height: 32px; padding: 4px 12px; font-size: 0.84rem; }
.chip.small .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--h, var(--muted)); }
/* selected sub-chip: outlined, not filled, so it reads in both themes and differs from the lit top chip */
.chip.small[aria-current="true"] {
  background: var(--surface); color: var(--text);
  border-color: var(--h, var(--text)); box-shadow: inset 0 0 0 1px var(--h, var(--text));
}
.chip.small[aria-current="true"] span { color: var(--muted); }
/* chip rows scroll to the screen edge and fade out there instead of being cut inside the padding */
.toolbar .chips {
  margin: -2px -16px -6px; padding: 2px 16px 6px; scroll-padding-inline: 16px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 24px), transparent);
}
.linkbutton {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; border: 0; background: none; cursor: pointer;
  color: var(--link); font: 600 0.9rem var(--sans);
}
.linkbutton svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* count and Mark all read share one row; they wrap only on very narrow screens */
.mastrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; }
.caughtup .readall { display: flex; justify-content: center; }

/* The score toggle sits on the left of the footer row and the buttons are pinned top-right, so opening
   the "why" panel drops it below the whole row at full width and the buttons never move */
.slimfoot { position: relative; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.card .slimfoot { grid-column: 1 / -1; }
.slimfoot > .acts.slim { position: absolute; top: 8px; right: 0; z-index: 3; }
.whybox { min-width: 0; }
.whybox > summary { display: flex; width: fit-content; align-items: center; gap: 8px; min-height: 34px; cursor: pointer; list-style: none; }
.whybox:not(:has(.whycaret)) > summary { cursor: default; }
.whybox > summary::-webkit-details-marker { display: none; }
.scorechip {
  flex: none; font: 800 0.78rem/1 var(--sans); font-variant-numeric: tabular-nums; padding: 5px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2);
}
.scorechip.high { background: var(--accent-soft); color: var(--accent); }
.reasonline { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.82rem; color: var(--muted); }
/* The reason and score breakdown stay one tap away; the card face shows only the score and a caret */
.whycaret { width: 7px; height: 7px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
.whybox[open] .whycaret { transform: translateY(1px) rotate(-135deg); }
.whyfull { display: grid; gap: 10px; padding: 8px 0 4px; font-size: 0.86rem; color: var(--text-2); }
.whyfull p { margin: 0; }
.whyreason { color: var(--text); font-size: 0.92rem; }
.whybars { display: grid; gap: 6px; }
.whybar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(60px, 34%) 2.2em; gap: 10px; align-items: center; font-size: 0.82rem; }
.whylabel small { color: var(--muted); font: 500 0.7rem var(--mono); margin-left: 2px; }
.whytrack { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.whytrack i { display: block; height: 100%; border-radius: 3px; background: var(--accent); transform-origin: left; }
/* Opening: the panel eases in and the bars fill from zero, one after another, so the eye lands on the breakdown */
.whybox[open] .whyfull { animation: tldr-in .18s ease-out; }
.whybox[open] .whytrack i { animation: why-fill .5s cubic-bezier(.2, .7, .2, 1) both; }
.whybox[open] .whybar:nth-child(2) .whytrack i { animation-delay: 60ms; }
.whybox[open] .whybar:nth-child(3) .whytrack i { animation-delay: 120ms; }
@keyframes why-fill { from { transform: scaleX(0); } }
.whybar b { font: 700 0.76rem var(--mono); text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.whyhead { font: 700 0.66rem var(--mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.whyplace { list-style: none; margin: -4px 0 0; padding: 0; display: grid; gap: 3px; font-size: 0.82rem; }
.whyplace li { position: relative; padding-left: 18px; }
.whyplace li::before { position: absolute; left: 0; width: 12px; text-align: center; font: 700 0.9rem/1.45 var(--mono); color: var(--muted); content: "·"; }
.whyplace li.up::before { content: "↑"; color: var(--ok); }
.whyplace li.down::before { content: "↓"; color: var(--danger); }
.acts.slim { gap: 2px; }
.acts.slim .act { width: 34px; height: 34px; background: transparent; }
.acts.slim .act:hover { background: var(--surface-2); }
.acts.slim .act svg { width: 17px; height: 17px; }
.kebab[open] > summary.act { background: var(--surface-2); color: var(--text); }
.fcard .coverage { margin-top: 4px; }

/* ---------- performance: long feeds on phones ---------- */
/* Off-screen cards are not laid out or painted until they come near the viewport */
.stream > .story { content-visibility: auto; contain-intrinsic-size: auto 260px; }
.stream > .fcard.big { contain-intrinsic-size: auto 520px; }
/* Shadows and zoom effects only where there is a mouse; flat cards scroll smoother on phones */
.card, .fcard.big { box-shadow: none; }
@media (hover: hover) {
  .card:hover, .fcard.big:hover { box-shadow: var(--shadow-hi); }
}
@media (hover: none) {
  .thumb-img img, .big-media img, .hero-media img { transition: none; }
  .card:hover .thumb-img img, .fcard.big:hover .big-media img, .hero:hover .hero-media img { transform: none; }
}

.loadmore {
  display: block; text-align: center; padding: 14px; border: 1px dashed var(--border); border-radius: var(--radius);
  color: var(--text-2); font-weight: 600; text-decoration: none;
}
.loadmore.loading { color: var(--muted); }

/* ---------- shared card menu: bottom sheet on phones, popover on desktop ---------- */
/* Both slide or fade in and out: [hidden] is display: none, which the transitions wait for (allow-discrete),
   and @starting-style is where they come from. Browsers without either just show and hide them. */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 45; background: rgb(0 0 0 / 0.35); touch-action: none;
  transition: opacity 0.2s ease, display 0.2s allow-discrete;
}
.sheet-backdrop[hidden] { opacity: 0; }
@starting-style { .sheet-backdrop:not([hidden]) { opacity: 0; } }
@media (min-width: 761px) { .sheet-backdrop { background: transparent; touch-action: auto; } }
.sheet {
  position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; padding: 8px 8px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface); border-radius: 18px 18px 0 0; box-shadow: var(--shadow-hi);
  touch-action: none; /* a drag down moves the sheet, not the page */
  transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1), display 0.24s allow-discrete;
}
.sheet[hidden] { transform: translateY(100%); transition-timing-function: cubic-bezier(0.4, 0, 1, 1); transition-duration: 0.18s; }
@starting-style { .sheet:not([hidden]) { transform: translateY(100%); } }
.sheet.dragging { transition: none; }
.sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 2px auto 6px; }
.sheet-title { margin: 2px 12px 6px; font-size: 0.8rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.sheet .pop-item[hidden] { display: none; }
.kebab-btn svg { fill: currentColor; }
.kebab-btn[aria-expanded="true"] { background: var(--surface-2); color: var(--text); }
@media (min-width: 761px) {
  .sheet {
    left: auto; right: auto; bottom: auto; width: 270px; padding: 6px; border-radius: 14px; border: 1px solid var(--border);
    touch-action: auto; transition: opacity 0.14s ease, transform 0.14s ease, display 0.14s allow-discrete;
  }
  .sheet[hidden] { opacity: 0; transform: scale(0.97); }
  @starting-style { .sheet:not([hidden]) { opacity: 0; transform: scale(0.97); } }
  .sheet::before { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet[hidden] { transition-property: opacity, display; }
  .sheet[hidden] { opacity: 0; }
  @starting-style { .sheet:not([hidden]) { opacity: 0; transform: none; } }
}

/* A card the reader said less about (or hid) stays in place under a veil with an Undo */
.story.veiled { min-height: 128px; }
.story.veiled > :not(.veil) { opacity: 0.25; filter: grayscale(1); }
.veil {
  position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 16px; text-align: center; border-radius: inherit;
  background: color-mix(in srgb, var(--surface) 55%, transparent); animation: veil-in 0.2s ease;
}
.veil p { margin: 0; max-width: 32ch; color: var(--text); font-weight: 600; }
.veil .button { margin: 0; }
@keyframes veil-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .veil { animation: none; } }

/* one-tap like / dislike */
.acts.slim .act.like[aria-pressed="true"] { background: var(--ok); color: var(--surface); }
.acts.slim .act.dislike:hover { color: var(--danger); }
@media (max-width: 420px) {
  .acts.slim .act { width: 32px; height: 32px; }
  .slimfoot { gap: 4px; }
}

/* discovered sources */
.pill.discovered { background: color-mix(in srgb, var(--h7) 16%, transparent); color: var(--h7); }
.pill.exploring { background: color-mix(in srgb, var(--h3) 16%, transparent); color: var(--h3); }
.callout.suggest { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 14px; }
.callout.suggest p { margin: 0; flex: 1 1 260px; }
.callout.suggest form { margin: 0; }
.small { font-size: 0.82rem; }
.panel h3.sec { margin-top: 12px; }

/* full coverage timeline */
.coverage ul.timeline { max-height: 280px; overflow-y: auto; padding-right: 4px; }
.coverage .timeline li { align-items: baseline; }
.coverage .timeline time { flex: none; margin-left: auto; padding-left: 8px; font-size: 0.78rem; white-space: nowrap; }
.coverage .timeline .badge { align-self: flex-start; margin-top: 2px; }
.coverage summary span:last-child { font-weight: 600; }

/* ---------- pull to refresh (feed page, touch) ----------
   The browser's own pull-to-reload is off here: a reload keeps the feed's order (feed sessions), so it
   would look like it did nothing. The indicator slides out from under the top bar as you pull. */
.pull-refresh, .pull-refresh body { overscroll-behavior-y: none; }
.ptr {
  --p: 0;
  position: fixed; z-index: 19; left: 50%; top: calc(54px + env(safe-area-inset-top));
  width: 40px; height: 40px; margin-left: -20px; display: grid; place-items: center; border-radius: 50%;
  background: var(--surface); color: var(--muted); border: 1px solid var(--edge); box-shadow: var(--shadow-hi);
  opacity: 0; pointer-events: none;
  /* slides out from under the top bar, growing from small as it comes */
  transform: translateY(calc(var(--pull, 0px) - 56px)) scale(calc(0.55 + 0.45 * var(--p)));
  transition: transform 0.38s var(--spring), opacity 0.22s ease, color 0.2s ease, background-color 0.2s ease;
}
.ptr svg {
  width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round;
  overflow: visible;
}
.ptr-track { stroke-width: 2.2; opacity: 0.14; }
.ptr-ring {
  stroke-width: 2.4; stroke-dasharray: 100 100; stroke-dashoffset: calc(100 - 82 * var(--p));
  transform-origin: 12px 12px; transform: rotate(calc(-90deg + 200deg * var(--p)));
}
.ptr-arrow {
  stroke-width: 2.2; transform-origin: 12px 12px; opacity: calc(0.35 + 0.65 * var(--p));
  transition: transform 0.32s var(--spring), opacity 0.15s ease;
}
.ptr.pulling { opacity: 1; transition: color 0.2s ease, background-color 0.2s ease; }  /* follows the finger without lag */
.ptr.armed, .ptr.refreshing { color: var(--accent-text); }
.ptr.armed { background: var(--accent-soft); animation: ptr-pop 0.32s var(--spring); }
.ptr.armed .ptr-arrow { transform: rotate(180deg); }  /* points up: let go */
.ptr.refreshing { opacity: 1; background: var(--accent-soft); }
.ptr.refreshing .ptr-arrow { opacity: 0; transform: rotate(180deg) scale(0.4); }
.ptr.refreshing .ptr-ring { animation: ptr-spin 0.9s linear infinite, ptr-arc 1.4s ease-in-out infinite; }
/* Pulled far past the mark: the chick from the About page's logo looks out of the ring from below, blinks,
   and ducks when you let go */
.ptr-peek { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; }
.ptr-peek svg {
  width: 100%; height: 100%; stroke: none; overflow: hidden;
  transform: translateY(75%); transition: transform 0.2s ease-in;
}
.ptr.peek .ptr-peek svg { transform: none; transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
.ptr.peek .ptr-arrow { opacity: 0; transition: opacity 0.1s ease; }
.ptr.peek .ptr-eye { animation: ptr-blink 2.8s 0.6s infinite; }
@keyframes ptr-blink {
  0%, 7%, 100% { transform: none; }
  3.5% { transform: scaleY(0.1); }
}
/* a small pop when the pull reaches the mark */
@keyframes ptr-pop {
  0% { transform: translateY(calc(var(--pull, 0px) - 56px)) scale(1); }
  45% { transform: translateY(calc(var(--pull, 0px) - 56px)) scale(1.14); }
  100% { transform: translateY(calc(var(--pull, 0px) - 56px)) scale(1); }
}
@keyframes ptr-spin { from { transform: rotate(-90deg); } to { transform: rotate(270deg); } }
/* the arc grows and shrinks as it turns, like a native spinner */
@keyframes ptr-arc {
  0% { stroke-dashoffset: 92; }
  50% { stroke-dashoffset: 25; }
  100% { stroke-dashoffset: 92; }
}
@media (prefers-reduced-motion: reduce) {
  .ptr { transition: opacity 0.2s ease, color 0.15s ease; }
  .ptr.armed { animation: none; }
  .ptr-arrow { transition: opacity 0.15s ease; }
  .ptr.refreshing .ptr-ring { animation: ptr-fade 1.2s ease-in-out infinite alternate; stroke-dashoffset: 0; }
  .ptr-peek svg, .ptr.peek .ptr-peek svg { transition: opacity 0.2s ease; transform: none; opacity: 0; }
  .ptr.peek .ptr-peek svg { opacity: 1; }
  .ptr.peek .ptr-eye { animation: none; }
  @keyframes ptr-fade { from { opacity: 1; } to { opacity: 0.35; } }
}

/* ---------- installed app (PWA) ---------- */
@media (display-mode: standalone) {
  .topbar { padding-top: env(safe-area-inset-top); }
  .appmenu { top: calc(54px + env(safe-area-inset-top)); }
  html { scroll-padding-top: calc(110px + env(safe-area-inset-top)); }
  .toolbar { top: calc(49px + env(safe-area-inset-top)); }
}

/* ---------- Today: categories scroll away with the page ---------- */
.feedwrap .banner { margin: 14px 0 0; }
.cats {
  display: flex; gap: 6px; margin: 2px -16px -4px; padding: 4px 16px 8px; overflow-x: auto; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 24px), transparent);
}
.cats::-webkit-scrollbar { display: none; }
.cats a {
  display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 36px; padding: 0 12px; border-radius: 999px;
  white-space: nowrap; text-decoration: none; color: var(--text-2); font: 600 0.88rem var(--sans);
  background: var(--surface); border: 1px solid var(--edge); box-shadow: var(--chip-shadow);
}
.cats a span { color: var(--muted); font-weight: 500; }
.cats a:hover { background: var(--surface-2); }
.cats a[aria-current="true"] { background: var(--surface-3); color: var(--text); }
.cats .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--h, var(--muted)); }
/* All / Local / World pick the part of the feed; a little air before the categories begin */
.cats a.scope + a:not(.scope) { margin-left: 8px; }

/* ---------- switching tabs: the old stories dim at once, placeholders hold the place while it loads ---------- */
.feedwrap.swapping .stream > :not(.skel-feed) { opacity: 0.45; transition: opacity 0.15s ease; }
.feedwrap.swapping .readall { opacity: 0.45; pointer-events: none; }  /* would mark the old tab read */
.skel-feed { display: grid; gap: 14px; animation: skel-in 0.2s ease both; }
/* The new stories fade up from the dimmed level, so the swap reads as one movement (the masthead stays put) */
.feedwrap.swapped > .cats, .feedwrap.swapped > .callout, .feedwrap.swapped > .stream { animation: feed-in 0.18s ease-out both; }
@keyframes feed-in { from { opacity: 0.45; } }
@keyframes skel-in { from { opacity: 0; } }
.skel-card {
  display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 0 14px; align-items: start;
  background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); padding: 14px;
}
@media (min-width: 600px) { .skel-card { grid-template-columns: minmax(0, 1fr) 140px; } }
.skel-card.big { display: block; padding: 0; border-radius: 18px; overflow: hidden; }
.skel-card.big .skel-text { padding: 14px 16px 18px; }
.skel { display: block; border-radius: 6px; background: var(--surface-3); }
.skel-meta { width: 34%; height: 10px; margin: 4px 0 12px; }
.skel-title { height: 16px; margin-bottom: 8px; }
.skel-title.short { width: 72%; }
.skel-line { width: 88%; height: 10px; margin-top: 12px; }
.skel-line + .skel-line { width: 60%; margin-top: 8px; }
.skel-thumb { aspect-ratio: 1; border-radius: 10px; }
.skel-media { aspect-ratio: 16 / 9; border-radius: 0; }
.skel-chips .skel { flex: none; width: 84px; height: 36px; border-radius: 999px; }
.skel-chips .skel:first-child { width: 56px; }
.skel-chips .skel:nth-child(3) { width: 104px; }
/* A soft sheen sweeps across every placeholder together, so it reads as one loading page */
.skel {
  background: linear-gradient(100deg, var(--surface-3) 40%, var(--surface-2) 50%, var(--surface-3) 60%) fixed;
  background-size: 200vw 100%;
  animation: skel-sheen 1.3s linear infinite;
}
@keyframes skel-sheen { from { background-position: 100vw 0; } to { background-position: -100vw 0; } }
@media (prefers-reduced-motion: reduce) {
  .skel { animation: none; background: var(--surface-3); }
  .skel-feed, .feedwrap.swapped > .cats, .feedwrap.swapped > .callout, .feedwrap.swapped > .stream { animation: none; }
  .feedwrap.swapping .stream > :not(.skel-feed) { transition: none; }
}

/* ---------- vivid layer: grotesque headlines, mono labels, neon fills ---------- */
.brand { font-family: var(--display); letter-spacing: -0.02em; }
.masthead h1 { letter-spacing: -0.035em; }
.card h3, .fcard.big h3, .hero h3, .pagehead h1, .blocktitle { letter-spacing: -0.02em; }
.card h3 { line-height: 1.22; }
.dateline, .kicker { color: var(--accent-text); font-family: var(--mono); letter-spacing: 0.04em; }
.counters { font: 500 0.78rem var(--mono); text-transform: uppercase; letter-spacing: 0.03em; gap: 6px 14px; align-items: baseline; }
.counters b { font: 700 1.2rem var(--display); letter-spacing: -0.02em; }
.counters .hot b { color: var(--neon-ink); background: var(--lime); padding: 0 6px; border-radius: 3px; }
.meta { font: 500 0.7rem var(--mono); text-transform: uppercase; letter-spacing: 0.03em; }
.meta .src { color: var(--text); }
.sec, .sheet-title { font-family: var(--mono); }

.pill { font: 700 0.64rem/1.6 var(--mono); text-transform: uppercase; letter-spacing: 0.04em; padding: 0 6px; border-radius: 3px; }
.pill.new { background: var(--lime); color: var(--neon-ink); }
.pill.updated { background: var(--yellow); color: var(--neon-ink); }
.whatsnew { margin: 6px 0 0; padding-left: 10px; border-left: 3px solid var(--yellow); color: var(--text-2); font-size: 0.95rem; }
.whatsnew .src, .whatsnew time { font: 700 0.68rem var(--mono); text-transform: uppercase; letter-spacing: 0.03em; color: var(--text); }
.whatsnew time { font-weight: 500; color: var(--muted); margin-right: 4px; }
.pill.watch { background: var(--accent); color: var(--accent-ink); white-space: nowrap; }
.scorechip { font-family: var(--mono); border-radius: 3px; }
.scorechip.high { background: var(--accent); color: var(--accent-ink); }

.badge { border-radius: 4px; }
.fcard.big, .hero { border-radius: var(--radius); }
.thumb-img { border-radius: 4px; }
.button { border-radius: 6px; }
.acts.slim .act.like[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

.cats a { font-family: var(--display); }
.cats a[aria-current="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.cats a[aria-current="true"] span { color: color-mix(in srgb, var(--bg) 70%, transparent); }
/* Less-read categories fold behind More (only once JS has set .folded, so without JS every chip shows);
   opened, the row wraps instead of scrolling */
.cats.folded:not(.open) .extra { display: none; }
.cats.open { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; }
.cats-more {
  display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 36px; padding: 0 12px; border-radius: 999px;
  border: 1px dashed var(--border); background: var(--surface); color: var(--text-2); font: 600 0.88rem var(--display); cursor: pointer;
}
.cats-more span { color: var(--muted); font-weight: 500; }
.cats-more:hover { background: var(--surface-2); }
.cats-more[hidden] { display: none; }

/* ---------- Swipe: Tinder-style deck over the For you ranking ---------- */
.deckhead { flex: none; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 0 10px; }
.deckhead .dateline { margin: 0; }
.deckcount { margin: 0; font: 500 0.78rem var(--mono); text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
.deckcount b { font: 700 1.2rem var(--display); letter-spacing: -0.02em; color: var(--text); }
/* The page is exactly one screen: the deck takes whatever the bars, a banner and the buttons leave */
.swipepage main { padding-bottom: 12px; }
.swipepage footer { display: none; }
.swipewrap { display: flex; flex-direction: column; height: calc(100dvh - 49px - 12px - env(safe-area-inset-top)); min-height: 560px; }
@media (max-width: 760px) {
  /* the floating section bar takes 86px at the bottom (body padding); the deck buttons stay above it */
  .swipepage main { padding-bottom: 0; }
  .swipewrap { height: calc(100dvh - 49px - 86px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); min-height: 480px; }
}
.deck { position: relative; flex: 1 1 0; min-height: 340px; max-height: 660px; width: 100%; max-width: 520px; margin: 0 auto; }
.swipecard {
  position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-hi);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; cursor: grab;
  transition: transform 0.25s ease-out;
  --like: 0; --nope: 0; --skip: 0;
}
.swipecard:active { cursor: grabbing; }
.swipecard[data-pos="0"] { z-index: 4; }
.swipecard[data-pos="1"] { z-index: 3; transform: translateY(10px) scale(0.96); }
.swipecard[data-pos="2"] { z-index: 2; transform: translateY(20px) scale(0.92); }
.swipecard[data-pos="1"], .swipecard[data-pos="2"] { pointer-events: none; }
.swipecard[data-pos="2"] .swipe-body { opacity: 0.5; }
.swipecard[data-pos="3"] { visibility: hidden; }
.swipecard.leaving { z-index: 5; pointer-events: none; }
.swipe-media {
  position: relative; flex: 0 0 42%; overflow: hidden;
  background: linear-gradient(135deg, var(--h, var(--accent)), color-mix(in srgb, var(--h, var(--accent)) 35%, #000));
}
.swipe-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; -webkit-user-drag: none; }
.swipe-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 14px 16px 12px; }
.swipecard h2 {
  margin: 8px 0 6px; font: 700 clamp(1.3rem, 5.2vw, 1.7rem)/1.15 var(--display); letter-spacing: -0.02em;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden;
}
.swipecard h2 a { color: var(--text); text-decoration: none; -webkit-user-drag: none; -webkit-touch-callout: none; }
/* Tapping anywhere on the card opens the story; stamps and the stack sit above without catching taps */
.swipecard h2 a::after { content: ""; position: absolute; inset: 0; z-index: 3; }
.swipecard h2 a:focus-visible { outline: none; }
.swipecard:has(h2 a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.swipecard .summary, .swipecard .snippet { flex: 1; min-height: 0; overflow: hidden; margin: 0; font-size: 0.98rem; color: var(--text-2);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); }
.swipe-foot { display: flex; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); margin-top: 8px; min-width: 0; }
.swipe-foot .reasonline { flex: 1; }
.swipe-cov { display: inline-flex; align-items: center; gap: 6px; flex: none; margin-left: auto; font: 600 0.72rem var(--mono); text-transform: uppercase; color: var(--muted); }
.swipecard.read h2 a { color: var(--muted); }
.swipecard.read .pill.readmark { display: inline-block; }
.swipecard.read .pill.new { display: none; }

.stamp {
  position: absolute; top: 22px; z-index: 4; padding: 4px 12px; border-radius: 6px; pointer-events: none;
  font: 800 1.7rem/1.1 var(--display); text-transform: uppercase; letter-spacing: 0.02em; border: 3px solid currentColor;
}
.stamp.like { left: 18px; transform: rotate(-12deg); background: var(--lime); color: var(--neon-ink); opacity: var(--like); }
.stamp.nope { right: 18px; transform: rotate(12deg); background: var(--danger-bg); color: var(--danger); opacity: var(--nope); }
.stamp.skip { left: 50%; top: auto; bottom: 26%; transform: translateX(-50%); background: var(--yellow); color: var(--neon-ink); opacity: var(--skip); }

.swipecard ~ .deck-done { visibility: hidden; }
.deck-done {
  position: absolute; inset: 0; z-index: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 24px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: 14px;
}
.deck-done svg { width: 48px; height: 48px; fill: none; stroke: var(--ok); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.deck-done h2 { margin: 6px 0 2px; font: 700 1.5rem var(--display); color: var(--text); }
.deck-done p { margin: 0 0 10px; }

.deckbar { flex: none; display: flex; align-items: center; justify-content: center; gap: 18px; padding: 22px 0 6px; }
.deckbtn {
  width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); box-shadow: var(--shadow);
  transition: transform 0.1s, background 0.15s, color 0.15s;
}
.deckbtn svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.deckbtn.small { width: 46px; height: 46px; }
.deckbtn.small svg { width: 20px; height: 20px; }
.deckbtn.nope { color: var(--danger); }
.deckbtn.like { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.deckbtn.like svg { fill: currentColor; stroke: none; }
.deckbtn:active { transform: scale(0.9); }
.deckbtn:disabled { opacity: 0.35; cursor: default; }
.deckbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) { .deckbtn:not(:disabled):hover { transform: scale(1.06); } }
.deckhint { margin: 4px 0 0; text-align: center; font: 500 0.68rem var(--mono); text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
@media (max-width: 760px) { .deckhint { display: none; } .deckbar { padding: 16px 0 0; } }

/* ---------- key points: lede on the card, bullets one tap away, or a button that writes them ---------- */
/* Cards with a photo: headline, lede and photo share the top rows, but the key points and the button
   break out and use the full card width instead of the narrow column beside the photo */
.card.has-img > .card-text, .card.has-img .bodytext { display: contents; }
.card.has-img > .card-text > *, .card.has-img .bodytext > * { grid-column: 1; }
.card.has-img > .thumb-img { grid-column: 2; grid-row: 1 / span 3; }
.card.has-img .bodytext > .tldr, .card.has-img .bodytext > .sumform { grid-column: 1 / -1; }
/* Above the card-wide title link, so tapping these never opens the article */
.story .tldr, .story .sumform { position: relative; z-index: 2; }
.summary.lede { color: var(--text); }
.tldr { margin-top: 8px; }
.tldr > summary { display: flex; align-items: center; gap: 8px; min-height: 34px; cursor: pointer; list-style: none; }
.tldr > summary::-webkit-details-marker { display: none; }
.tldr-label { display: inline-flex; align-items: center; gap: 6px; font: 700 0.72rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text); }
.tldr-label svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.tldr-label svg circle { fill: var(--accent); stroke: none; }
.tldr-label b { padding: 2px 5px; border-radius: 3px; background: var(--text); color: var(--bg); font-size: 0.66rem; }
.tldr[open] .whycaret { transform: translateY(1px) rotate(-135deg); }
.depth {
  width: fit-content; margin-left: auto; padding: 3px 7px; border: 1.5px solid var(--accent); border-radius: 3px;
  font: 700 0.64rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: 0.03em; color: var(--accent-text); white-space: nowrap;
}
.tldr-body { margin-top: 4px; padding: 12px 14px 10px; border-radius: var(--radius); background: var(--surface-2); border-left: 3px solid var(--accent); }
.points { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.points li { position: relative; padding-left: 16px; font-size: 0.93rem; line-height: 1.4; color: var(--text); }
.points li::before { content: ""; position: absolute; left: 1px; top: 0.5em; width: 6px; height: 6px; border-radius: 1px; background: var(--accent); }
.tldr-lede { margin: 0 0 10px; font-size: 0.95rem; line-height: 1.45; color: var(--text); font-weight: 500; }
.tldr-why { margin: 0 0 10px; font-size: 0.9rem; line-height: 1.4; color: var(--text); }
.tldr-why .tag, .tldr-lede .tag {
  display: inline-block; margin-right: 8px; padding: 2px 6px; border-radius: 3px; vertical-align: 1px;
  font: 700 0.62rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: 0.04em; background: var(--accent); color: var(--accent-ink);
}
.tldr-lede .tag.ai { background: var(--text); color: var(--bg); }
.tldr-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin: 10px 0 0; padding-top: 8px; border-top: 1px solid var(--border); }
.verdict { font: 600 0.68rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: 0.03em; }
.verdict.ok { color: var(--ok); }
.verdict.ok::before { content: "✓ "; }
.verdict.full { color: var(--accent-text); }
.verdict.warn { color: var(--warn); }
.openlink { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; padding: 4px 0; color: var(--link); font-size: 0.84rem; font-weight: 600; text-decoration: none; }
.openlink svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.openlink:hover { text-decoration: underline; }
.openlink.strong { padding: 6px 12px; border-radius: 999px; background: var(--text); color: var(--bg); }
.openlink.strong:hover { text-decoration: none; opacity: 0.88; }
.sumbtn {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; min-height: 34px; padding: 6px 12px 6px 10px;
  border: 1.5px dashed var(--border); border-radius: 999px; background: transparent; color: var(--text); cursor: pointer;
  font: 700 0.72rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.04em; transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.sumbtn svg { width: 16px; height: 16px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .sumbtn:hover { border-style: solid; border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); } }
.sumbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sumbtn:disabled { cursor: progress; border-style: solid; border-color: var(--accent); color: var(--text-2); }
.sumbtn[aria-busy="true"] svg { animation: sum-pulse 0.9s ease-in-out infinite alternate; }
@keyframes sum-pulse { from { transform: scale(0.8) rotate(0deg); opacity: 0.5; } to { transform: scale(1.1) rotate(45deg); opacity: 1; } }
.sumnote { margin-top: 6px; }
.bodytext.fresh .tldr-body, .bodytext.fresh .lede { animation: tldr-in 0.3s ease-out; }
@keyframes tldr-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .sumbtn[aria-busy="true"] svg, .bodytext.fresh .tldr-body, .bodytext.fresh .lede { animation: none; }
  .whybox[open] .whyfull, .whybox[open] .whytrack i { animation: none; }
  /* search: no morph or slide, just a fade */
  .tabbar, .docksearch, .topsearch input { transition: opacity 0.2s ease !important; }
  .searchlayer, body.searching .searchlayer { transform: none; transition: opacity 0.2s ease, visibility 0s linear 0.2s; }
  body.searching .searchlayer { transition: opacity 0.2s ease, visibility 0s; }
}
.hero .points li { font-size: 0.98rem; }

/* swipe deck: everything shown at once, no toggles to fight the drag */
.swipe-points { flex: 1; min-height: 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); }
.swipe-points .lede { margin: 0 0 10px; font-size: 1rem; line-height: 1.4; color: var(--text); font-weight: 500; }
.swipe-points .points li { font-size: 0.92rem; color: var(--text-2); }
.swipe-points .tldr-why { font-size: 0.88rem; }
.swipe-points .depth { margin: 10px 0 0; }

/* ---------- settings: grouped lists, iOS Settings style ---------- */
/* Phones: /settings is the menu, each page has a back link. Wider screens: the menu is a sticky sidebar. */
.settings { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 40px; padding-bottom: 24px; }
.snav-title { margin: 0; padding: 26px 0 0; font: 700 clamp(1.7rem, 5vw, 2.3rem)/1.1 var(--display); letter-spacing: -0.02em; }
.sback {
  display: inline-flex; align-items: center; gap: 2px; min-height: 44px; margin: 8px 0 0 -6px; padding: 0 6px;
  color: var(--accent-text); font-weight: 600; text-decoration: none;
}
.sback svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.sback + .pagehead { padding-top: 2px; }
.spage .pagehead .sub { color: var(--muted); font-size: 0.92rem; max-width: 60ch; }
@media (max-width: 899px) {
  .settings.is-root .spage, .settings:not(.is-root) .snav { display: none; }
}
@media (min-width: 900px) {
  .settings { grid-template-columns: 256px minmax(0, 680px); justify-content: center; align-items: start; }
  .snav { position: sticky; top: 56px; max-height: calc(100vh - 56px); overflow-y: auto; padding-bottom: 16px; scrollbar-width: thin; }
  .snav-title { font-size: 1.5rem; }
  .snav .sgroup { margin-top: 16px; }
  .sback { display: none; }
  .sback + .pagehead { padding-top: 26px; }
  /* The sidebar is a plain menu, not the phone's drill-down cards: no boxes or hairlines, no chevrons,
     titles wrap instead of ending in "…", only short counts on the right (the version is under the menu),
     and the current page is an ink pill like the top bar's tabs */
  .snav .slist { background: none; border: 0; box-shadow: none; overflow: visible; }
  .snav .slist > * + *::before { display: none; }
  .snav .sgroup { margin-top: 18px; }
  .snav .sgroup-title { margin-left: 10px; }
  .snav .srow { gap: 10px; min-height: 38px; padding: 6px 10px; border-radius: 10px; font-size: 0.94rem; }
  .snav .stile { width: 26px; height: 26px; border-radius: 7px; }
  .snav .stile svg { width: 16px; height: 16px; }
  .snav .srow-title { white-space: normal; overflow: visible; }
  .snav .chev, .snav .srow[href$="/about"] .srow-value { display: none; }
  .snav .srow-value { font-size: 0.86rem; }
  @media (hover: hover) { .snav a.srow:not([aria-current="page"]):hover { background: var(--surface); } }
  .snav a.srow:not([aria-current="page"]):active { background: var(--surface-2); }
  .snav .srow[aria-current="page"] { background: var(--text); color: var(--bg); }
  .snav .srow[aria-current="page"] .srow-title { font-weight: 700; }
  .snav .srow[aria-current="page"] .srow-end { color: color-mix(in srgb, var(--bg) 70%, transparent); }
  .snav .snav-version { margin-left: 10px; }
  .snav-version a { white-space: nowrap; }
}
/* Wide screens: the home page's width and edges, the menu in the home page's sidebar column and the
   page filling the rest, so nothing moves sideways between the feed and settings */
@media (min-width: 1240px) {
  body:has(main > .settings) { --page: 1352px; }
  body:has(main > .settings) .banner { max-width: calc(var(--page) - 32px); }
  .settings { grid-template-columns: 248px minmax(0, 1fr); column-gap: 48px; }
}

.sgroup { margin: 24px 0 0; }
.sgroup-title { margin: 0 0 6px 16px; font: 600 0.72rem var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.slist { background: var(--surface); border: 1px solid var(--edge); border-radius: 12px; box-shadow: var(--chip-shadow); overflow: hidden; }
.snav-version { margin: 20px 16px 0; font-size: 0.8rem; color: var(--muted); }
.snav-version a, .spage-foot a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.about-hero { text-align: center; padding: 18px 0 0; }
/* The app icon, drawn in the page: an ink tile with the mark at 72%, as tools/make_icons.py renders the PNGs.
   The colours are the icon's own in both themes. Its dot is an egg (app.js): after a few taps the tile grows,
   the view moves in on the dot, which turns out to be a speckled egg and cracks, and then a chick hatches,
   sits in the lower shell and wears the upper one. Nothing hints at it: no pointer, no hover.
   Every moving part turns and grows around its own origin (see the template), in the SVG's units. */
.egg {
  --tile: 72px;
  display: grid; place-items: center; width: var(--tile); height: var(--tile); margin: 0 auto 16px; padding: 0; border: 0;
  border-radius: 22%; background: #0a0a0c; color: #f4f4f6; cursor: default; overflow: hidden;
  touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  transition: width 0.6s var(--spring), height 0.6s var(--spring), box-shadow 0.4s ease;
}
/* in the dark theme the tile is the page's colour: once the view moves in, an edge shows where it ends */
.egg[data-stage], .egg.hatched { box-shadow: 0 0 0 1px var(--edge); }
.egg:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.egg svg { display: block; width: 72%; height: 72%; overflow: visible; pointer-events: none; }
.egg-arc { fill: none; stroke: currentColor; stroke-width: 3.6; stroke-linecap: round; }
.egg-dot { fill: #c6ff3d; transition: opacity 0.25s ease; }
/* the view: closer to the dot with every crack, until the chick fills the tile and the arcs sweep behind it */
.egg-cam { transition: transform 0.6s var(--spring); }
.egg[data-stage="1"] { --tile: 96px; }
.egg[data-stage="2"] { --tile: 120px; }
.egg[data-stage="3"] { --tile: 140px; }
.egg.hatched { --tile: 160px; }
.egg[data-stage="1"] .egg-cam { transform: translate(0.6px, 0.5px) scale(1.3); }
.egg[data-stage="2"] .egg-cam { transform: translate(1.6px, 1.1px) scale(1.6); }
.egg[data-stage="3"] .egg-cam { transform: translate(2.7px, 1.7px) scale(1.9); }
.egg.hatched .egg-cam { transform: translate(3.7px, 2.3px) scale(2.2); }
/* at rest the egg waits, a little smaller, under the flat dot */
.egg-scene { transform: scale(0.8); transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
.egg[data-stage] .egg-scene, .egg.hatched .egg-scene { transform: none; }
.egg[data-stage] .egg-dot, .egg.hatched .egg-dot { opacity: 0; }
.egg-rim { fill: none; stroke: #f3ffc4; stroke-width: 1.5; stroke-linejoin: round; }
.egg-crack {
  fill: none; stroke: #3c5600; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 100 100; stroke-dashoffset: 100; transition: stroke-dashoffset 0.32s ease-out, opacity 0.1s ease;
}
.egg[data-stage="1"] .egg-crack:not(.egg-crack-2, .egg-crack-3) { stroke-dashoffset: 62; }
.egg[data-stage="2"] .egg-crack:not(.egg-crack-3), .egg[data-stage="3"] .egg-crack { stroke-dashoffset: 0; }
.egg[data-stage="2"] .egg-crack:not(.egg-crack-2, .egg-crack-3) { stroke-dashoffset: 26; }
.egg.hatched .egg-crack { opacity: 0; }
.egg-chick, .egg-wing, .egg-shard, .egg-note { opacity: 0; }
.egg-shard { fill: #e6ff9a; }
.egg-note ellipse { fill: currentColor; }
.egg-note path { fill: none; stroke: currentColor; stroke-width: 0.42; stroke-linecap: round; stroke-linejoin: round; }
.egg-note { color: #ff3da6; }  /* the brand pink reads on the ink tile and on the white arcs alike */
/* hatching: a shake, the upper shell jumps and lands on the chick's head as it comes up, its wings grab the rim */
.egg.hatched .egg-rock { animation: egg-shake 0.3s ease-out; }
.egg.hatched .egg-chick { opacity: 1; animation: egg-rise 0.75s cubic-bezier(0.34, 1.56, 0.64, 1) 0.28s backwards; }
.egg.hatched .egg-cap {
  transform: translate(-8px, -31px) rotate(-27deg) scale(0.82);
  animation: egg-cap 0.95s 0.25s backwards;
}
.egg.hatched .egg-wing {
  opacity: 1; animation: egg-wing 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.72s backwards;
}
.egg.hatched .egg-shard { animation: egg-shard 0.8s cubic-bezier(0.2, 0.7, 0.3, 1) 0.25s backwards; }
.egg.hatched .egg-eye { animation: egg-blink 4.2s 1.3s infinite; }
@keyframes egg-shake {
  25% { transform: rotate(-9deg); }
  50% { transform: rotate(8deg); }
  75% { transform: rotate(-5deg); }
}
@keyframes egg-rise { from { transform: translateY(34px); } }
@keyframes egg-cap {
  0% { transform: none; animation-timing-function: cubic-bezier(0.2, 0.8, 0.3, 1); }
  38% { transform: translate(-5px, -62px) rotate(-44deg) scale(0.9); animation-timing-function: ease-in; }
  72% { transform: translate(-8px, -27px) rotate(-22deg) scale(0.82); animation-timing-function: ease-out; }
  86% { transform: translate(-8px, -35px) rotate(-31deg) scale(0.82); animation-timing-function: ease-in; }
}
@keyframes egg-wing { from { opacity: 0; transform: translateY(8px) scale(0.3); } }
/* out fast, then a little fall as they fade */
@keyframes egg-shard {
  0% { opacity: 1; transform: none; }
  55% { opacity: 1; transform: translate(var(--dx), var(--dy)) rotate(var(--turn)); }
  100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 14px)) rotate(calc(var(--turn) * 1.3)); }
}
@keyframes egg-blink {
  0%, 4.5%, 9%, 13.5%, 100% { transform: none; }
  2.2%, 11.2% { transform: scaleY(0.1); }
}
/* the line that owns up to it; no room is kept for it until it is there */
.about-egg {
  display: flex; align-items: center; justify-content: center; gap: 8px; max-height: 0; margin: 0; overflow: hidden; opacity: 0;
  font: 500 0.78rem var(--mono); color: var(--muted);
  transition: max-height 0.5s var(--spring), margin 0.5s var(--spring), opacity 0.45s ease 0.15s;
}
.about-egg.on { max-height: 3em; margin-top: 12px; opacity: 1; }
.about-egg::before, .caughtup-aside::before {
  content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--logo-dot);
}
@media (prefers-reduced-motion: reduce) {
  .egg, .egg-cam, .egg-scene, .about-egg, .egg-crack { transition: opacity 0.2s ease, box-shadow 0.2s ease; }
  .egg.hatched .egg-rock, .egg.hatched .egg-chick, .egg.hatched .egg-cap, .egg.hatched .egg-wing,
  .egg.hatched .egg-shard, .egg.hatched .egg-eye { animation: none; }
}
.about-name { margin: 10px 0 0; font: 700 1.3rem var(--display); }
.about-name .mono { font-size: 0.8rem; font-weight: 500; color: var(--muted); }
.about-tag { margin: 4px auto 0; max-width: 34ch; font-size: 0.9rem; color: var(--muted); }
.tile-about { --h: var(--h5); }
.sgroup-foot { margin: 7px 16px 0; font-size: 0.82rem; line-height: 1.4; color: var(--muted); }
.spage-foot { margin-top: 28px; }

/* A row: [icon] [title + subtitle] [value or control]. The right side never wraps under the text. */
.srow {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 9px 14px 9px 16px;
  color: var(--text); text-decoration: none; font: 400 1rem/1.3 var(--sans);
}
/* hairline between rows, inset like iOS (past the icon when there is one) */
.slist > * { position: relative; }
.slist > * + *::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; border-top: 1px solid var(--border); pointer-events: none; }
.has-icons > * + *::before { left: 58px; }
.slist label.srow { flex-direction: row; font-size: 1rem; font-weight: 400; color: var(--text); cursor: pointer; }
@media (hover: hover) { a.srow:hover, label.srow:hover { background: var(--surface-2); } }
a.srow:active { background: var(--surface-3); }
.srow:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.srow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.srow-title, .srow-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow-sub { font-size: 0.84rem; color: var(--muted); }
.srow-end { flex: none; display: flex; align-items: center; gap: 6px; color: var(--muted); }
.srow-value { font-variant-numeric: tabular-nums; }
.srow-unit { color: var(--muted); }
.chev { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0.7; }
.sdot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }

/* coloured icon tiles in the menu */
.stile { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--h, var(--muted)); }
.stile svg { width: 19px; height: 19px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tile-general, .tile-import { --h: #8e8e93; } .tile-feeds { --h: var(--h2); } .tile-discover { --h: var(--h7); }
.tile-topics { --h: var(--h3); } .tile-more { --h: var(--h1); } .tile-profile { --h: var(--accent); }

/* iOS switch */
input.switch[type="checkbox"] {
  -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 51px; min-height: 0; height: 31px;
  margin: 0; padding: 0; border: 0; border-radius: 999px; background: var(--surface-3); cursor: pointer; transition: background 0.2s;
}
input.switch[type="checkbox"]::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.2), 0 0 1px rgb(0 0 0 / 0.2); transition: transform 0.22s var(--spring);
}
input.switch[type="checkbox"]:checked { background: var(--accent); }
input.switch[type="checkbox"]:checked::before { transform: translateX(20px); }
input.switch[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* a value typed in place, right-aligned */
input.sinput {
  min-height: 36px; padding: 6px 10px; border: 1px solid transparent; border-radius: 8px; background: var(--surface-2);
  color: var(--text); text-align: right; font-variant-numeric: tabular-nums;
}
input.sinput:focus { background: var(--bg); border-color: var(--border); }
input.sinput:invalid { border-color: var(--danger); }
.slist.saving { opacity: 0.7; }
/* A row saving in place (data-inplace in app.js) dims until the new page is in */
.srow.saving, .srow-expand.saving { opacity: 0.6; transition: opacity 0.2s ease; }

/* ---------- settings: feeds, folds, expanding rows, menus ---------- */
.srow-form { display: contents; }
.srow-end .srow-form { display: block; margin: 0; }
.srow-accent { color: var(--accent-text); font-weight: 600; }
/* How much of each interest: a level other than Normal stands out, like a section you picked */
.level-set .vselect { color: var(--accent-text); font-weight: 600; }
.level-set .vselect .chev { stroke: currentColor; }
/* An interest's words with a pencil; the pencil turns them into a field in the same place */
.line-view, .line-edit { display: flex; align-items: center; gap: 2px; min-width: 0; margin: 0; }
.line-view[hidden], .line-edit[hidden] { display: none; }
.line-view .srow-title { min-width: 0; cursor: text; }
@media (hover: hover) { .line-view:hover .line-btn { color: var(--text); } }
.iconbtn.line-btn { flex: none; width: 32px; height: 32px; color: var(--muted); }
.iconbtn.line-btn svg { width: 17px; height: 17px; }
.line-edit { gap: 4px; }
.line-input { flex: 1 1 auto; min-width: 0; min-height: 36px; padding: 6px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg); color: var(--text); font: 400 1rem/1.3 var(--sans); }
.line-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
/* Adding a line: the field and its Add button */
.line-form { display: flex; align-items: center; gap: 8px; margin: 0; padding-top: 12px; }
.line-form .button { margin: 0; }
.srow-sub.warn { color: var(--warn); font-weight: 600; }
.srow-sub.ok { color: var(--ok); font-weight: 600; }
.srow-value.progress { color: var(--accent-text); font-weight: 600; }
.mono { font-family: var(--mono); font-size: 0.9rem; }
.savatar {
  flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-2); font: 700 0.78rem var(--mono); letter-spacing: 0.02em;
}
.feed-row.paused .srow-title, .feed-row.paused .savatar { opacity: 0.5; }
.feed-row.flagged { background: color-mix(in srgb, var(--warn) 10%, transparent); }
.feed-row:target { animation: feed-flash 2.4s ease-out; }
.srow-end .iconbtn { margin-right: -8px; }
.srow-end .button { margin: 0; min-height: 34px; }

/* a button that looks like a row ("Forget all tuning") */
.sact { width: 100%; border: 0; background: transparent; cursor: pointer; text-align: left; font-family: inherit; }
.sact-accent .srow-title { color: var(--accent-text); font-weight: 600; }
.sact-danger .srow-title { color: var(--danger); font-weight: 600; }
@media (hover: hover) { .sact:hover { background: var(--surface-2); } }
.slist > .srow-form { display: block; }
.srow-danger { color: var(--danger); font-weight: 600; }

/* a group header with a link at its right ("Arrange", "Done") */
.sgroup-title.has-action { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-right: 16px; }
.sgroup-action { font: 600 0.92rem var(--sans); text-transform: none; letter-spacing: 0; color: var(--accent-text); text-decoration: none; }
.sgroup-action:hover { text-decoration: underline; }
/* Arrange: ↑ ↓ at the end of each section's row; the first can't go up, the last can't go down */
.srow-end.arrange { gap: 2px; }
.srow-end.arrange .iconbtn { margin-right: 0; color: var(--accent-text); }
.srow-end.arrange .iconbtn:disabled { color: var(--muted); opacity: 0.35; cursor: default; background: none; }
/* a page below a settings page (a section under Feeds) keeps its back link on wide screens too */
.sback.deep { display: inline-flex; }
.sback.deep + .pagehead { padding-top: 2px; }
.sempty { margin: 24px 16px 0; color: var(--muted); font-size: 0.92rem; }

/* A feed row that opens the feed's page: the name is the link and covers the row; the select and ⋮ sit above it */
.feed-row.has-page .feed-link { color: inherit; text-decoration: none; }
.feed-row.has-page .feed-link::after { content: ""; position: absolute; inset: 0; }
.feed-row.has-page .srow-end { position: relative; z-index: 1; }
@media (hover: hover) { .feed-row.has-page:has(.feed-link:hover) { background: var(--surface-2); } }
.feed-row.has-page:has(.feed-link:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.feed-row.has-page .feed-link:focus-visible { outline: none; }

/* A feed's page: its latest stories, two lines each, the ones kept out of the feed in gray */
.story-row .srow-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.story-row.dim .srow-title { color: var(--text-2); }
.story-row .srow-sub .ok { color: var(--ok); font-weight: 600; }
.srow-value.score { font: 600 0.92rem var(--mono); }
.story-row.dim .srow-value.score { color: var(--muted); font-weight: 400; }
.spage .pagehead .sub a { color: inherit; }

/* a group that folds */
.sfold > summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; min-height: 36px; margin: 0 0 0 16px; padding-right: 16px; }
.sfold > summary::-webkit-details-marker, .srow-expand > summary::-webkit-details-marker { display: none; }
.sfold > summary .count { font-weight: 500; letter-spacing: 0; }
.sfold > summary .chev { margin-left: auto; transition: transform 0.15s; }
.sfold[open] > summary .chev { transform: rotate(180deg); }
.sfold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* a row that opens its form in place */
.srow-expand > summary { list-style: none; cursor: pointer; }
.srow-expand > summary .expand-chev { transition: transform 0.15s; }
.srow-expand[open] > summary .expand-chev { transform: rotate(180deg); }
@media (hover: hover) { .srow-expand > summary:hover { background: var(--surface-2); } }
.sbody { padding: 4px 16px 16px; border-top: 1px solid var(--border); }
.sform { display: grid; gap: 10px; padding-top: 12px; }
.sform .button { justify-self: start; }
.sform p { margin: 0; }
.slist > .sform { padding: 12px 16px 16px; }
@media (min-width: 640px) { .sform { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sform > p, .sform > .check, .sform > .button { grid-column: 1 / -1; } }
/* Discover: what a trial is, then the sources on trial with their weekly reads as dots */
.trial-how > summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; min-height: 30px; padding-right: 16px; }
.trial-how > summary::-webkit-details-marker { display: none; }
.trial-how > summary .chev { margin-left: auto; transition: transform 0.15s; }
.trial-how[open] > summary .chev { transform: rotate(180deg); }
.trial-steps { margin: 0; padding: 4px 16px 4px 40px; font-size: 0.92rem; line-height: 1.45; color: var(--text-2); }
.trial-steps li { padding: 8px 0; }
.trial-steps li::marker { color: var(--accent-text); font-weight: 700; }
.trial-steps b { color: var(--text); font-weight: 600; }
/* the weekly reads as dots; the row menu beside them is a vertical ⋮, so the two never look alike */
.trial-dots { display: inline-flex; gap: 4px; align-items: center; margin-right: 2px; font-variant-numeric: tabular-nums; }
.trial-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--surface-3); }
.trial-dots i.on { background: var(--accent); }
/* a ⋯ menu row that picks from a list: the native <select> covers the whole row */
label.pop-select { position: relative; flex-direction: row; gap: 10px; font: 500 0.92rem var(--sans); color: var(--text); }
.pop-select .pop-value { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-weight: 400; }
.pop-select .pop-value .chev { width: 14px; height: 14px; }
.pop-select select { position: absolute; inset: 0; width: 100%; min-height: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; font-size: 16px; }
.pop-select:focus-within { outline: 2px solid var(--accent); outline-offset: -2px; }
form.saving .pop-select { opacity: 0.5; }
.trial-row:target { animation: feed-flash 2.4s ease-out; }
@media (max-width: 520px) { .trial-row .srow-sub { white-space: normal; } }   /* the dots and ⋯ leave little room */
.trial-row .nowrap { white-space: nowrap; }
.catalog-invite { margin-top: 24px; }
.catalog-invite .button { margin: 0; }

/* the feed catalog: search and topic chips that narrow the list, the section each topic goes to, and a bar that follows the scroll */
.catalog-tools { display: grid; gap: 10px; margin-top: 16px; scroll-margin-top: 72px; }
.catalog-search { width: 100%; min-height: 42px; font-size: 16px; }
/* Every topic in sight: the chips wrap where there's room; on phones they scroll, and the fading edge says there are more */
.catalog-topics { flex: none; flex-wrap: wrap; overflow: visible; }
@media (max-width: 760px) {
  .catalog-topics { flex-wrap: nowrap; overflow-x: auto; padding-right: 32px;
    mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
}
.chip.picked::after { content: ""; width: 7px; height: 7px; margin-left: 2px; border-radius: 50%; background: var(--accent); }
.catalog-empty { margin: 24px 16px 0; }
.ctopic { scroll-margin-top: 72px; }
.ctopic-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 6px; min-height: 30px; }
.ctopic-head .sgroup-title { margin-bottom: 0; }
.ctopic-head .button { min-height: 30px; margin-right: 2px; }
.cfeed input { flex: none; margin: 0; width: 22px; min-height: 22px; cursor: pointer; }
.cfeed.is-taken { cursor: default; }
.cfeed.is-taken .srow-title, .cfeed.is-taken .savatar { opacity: 0.55; }
@media (hover: hover) { .slist label.cfeed.is-taken:hover { background: transparent; } }
.ctopic-dest { display: flex; align-items: center; gap: 4px; margin: -2px 0 6px 16px; font-size: 0.88rem; color: var(--muted); }
.ctopic-dest .vselect { min-height: 30px; color: var(--accent-text); font-weight: 600; }
.ctopic-dest .vselect .chev { stroke: currentColor; }
.cbar {
  position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 20; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; margin: 24px 0 0; padding: 8px 8px 8px 18px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--edge); box-shadow: var(--shadow-hi);
}
@media (max-width: 760px) { .cbar { bottom: calc(86px + env(safe-area-inset-bottom)); } }   /* above the dock */
.cbar-count { color: var(--text-2); font-variant-numeric: tabular-nums; }
.cbar .button { margin: 0; }

/* a feed found from a website address: title, how often it posts, its latest headlines, then Add */
.sbody > .callout { margin: 14px 0 0; }
.found-feed { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.found-headlines { grid-column: 1 / -1; margin: 0; padding-left: 18px; color: var(--text-2); }
.found-headlines li { overflow-wrap: anywhere; }

/* the section of a feed as gray text; the real <select> sits invisibly on top */
.vselect { position: relative; display: inline-flex; align-items: center; gap: 2px; min-height: 40px; color: var(--muted); }
.vselect select {
  position: absolute; inset: 0; width: 100%; min-height: 0; opacity: 0; cursor: pointer; font-size: 16px; border: 0; padding: 0;
}
.vselect:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 6px; }
.vselect .chev { width: 14px; height: 14px; }
form.saving .vselect { opacity: 0.5; }

/* the ⋯ sheet's actions */
.sheet form { margin: 0; }
.sheet .pop-item { width: 100%; }
.pop-item.danger { color: var(--danger); }

/* mute / always-show words as chips */
.chipbox { padding: 10px 12px; }
.chipbox textarea { width: 100%; }
.chipbox-ui { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.schip {
  display: inline-flex; align-items: center; gap: 2px; min-height: 32px; padding: 0 4px 0 12px; border-radius: 999px;
  background: var(--surface-2); color: var(--text); font-size: 0.9rem; max-width: 100%;
}
.schip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schip button { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; padding: 0; }
.schip button:hover { color: var(--danger); }
.schip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
input.chipinput { flex: 1 1 140px; min-width: 120px; width: auto; min-height: 32px; border: 0; background: transparent; padding: 0 6px; }
input.chipinput:focus { outline: none; }

/* ---------- profile: how the feed is tuned ---------- */
.srow-title.wrap { white-space: normal; overflow: visible; line-height: 1.3; }
.sbody-plain { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 16px 12px; border-top: 1px solid var(--border); }
.sbody-plain .button { margin: 0; }
.tuning-title { margin-top: 30px; font-size: 0.82rem; color: var(--text-2); }
.tuning-intro { margin-top: 0; }
.savatar.topic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* three dots: how far an outlet or topic is pushed up (accent) or down (danger) */
.strength { display: inline-flex; gap: 4px; align-items: center; }
.strength i { width: 8px; height: 8px; border-radius: 50%; background: var(--surface-3); }
.strength.more i.on { background: var(--accent); }
.strength.less i.on { background: var(--danger); }
/* "Show N more": rows folded inside a group */
.srow-more > summary { list-style: none; cursor: pointer; }
.srow-more > summary::-webkit-details-marker { display: none; }
.srow-more > summary .expand-chev { transition: transform 0.15s; }
.srow-more[open] > summary .expand-chev { transform: rotate(180deg); }
.srow-more > * { position: relative; }
.srow-more > * + *::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; border-top: 1px solid var(--border); pointer-events: none; }
.has-icons .srow-more > * + *::before { left: 58px; }
@media (hover: hover) { .srow-more > summary:hover { background: var(--surface-2); } }

/* ---------- suggested changes (weekly proposal) ---------- */
.srow-sub.wrap { white-space: normal; overflow: visible; }
.optag { flex: none; align-self: flex-start; margin-top: 2px; min-width: 62px; text-align: center; padding: 2px 8px; border-radius: 6px; font: 700 0.68rem var(--mono); text-transform: uppercase; letter-spacing: 0.04em; }
.optag.add { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.optag.remove { background: var(--danger-bg); color: var(--danger); }
.optag.reword { background: var(--surface-2); color: var(--text-2); }
.change .srow-title ins { text-decoration: none; background: color-mix(in srgb, var(--ok) 20%, transparent); border-radius: 3px; }
.change .srow-title del { color: var(--muted); text-decoration-color: var(--danger); }
.actions-row { display: flex; gap: 10px; margin: 14px 0 0; }
.actions-row .button { margin: 0; }
.sform textarea { grid-column: 1 / -1; }

/* ---------- status ---------- */
.tile-status { --h: var(--h3); }
.lead-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.lead-dot.ok { background: var(--ok); } .lead-dot.warning { background: var(--warn); } .lead-dot.failing { background: var(--danger); }
.lead-dot.pending, .lead-dot.disabled { background: var(--surface-3); }
.srow-sub.failing { color: var(--danger); font-weight: 600; } .srow-sub.warning { color: var(--warn); font-weight: 600; }
.srow-meter { min-height: 0; padding-top: 2px; padding-bottom: 12px; }
.srow-meter .meter { flex: 1; margin: 0; }
.sbody-plain > p { flex: 1 1 100%; margin: 0; }
.tile-calibration { --h: var(--h4); } .tile-app { --h: var(--h7); }
[hidden] { display: none !important; }

/* ---------- calibration ---------- */
.daypick { margin: 4px 0 0; }
.schart { margin: 0; padding: 12px 14px 8px; border-radius: 0; background: transparent; }
.schart .legend { margin: 0 0 6px; }
.charttable > summary { cursor: pointer; font-size: 0.84rem; color: var(--accent-text); font-weight: 600; padding: 6px 0 2px; }
.limit-row.is-current { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.limit-row .srow-title .pill, .srow .srow-title .pill { vertical-align: 2px; margin-left: 4px; }
.chart-narrow { display: none !important; }
@media (max-width: 600px) { .chart-wide { display: none !important; } .chart-narrow { display: block !important; } }

/* ---------- desktop home: a front page beside the feed ---------- */
/* From 1240px the home page has two lanes, each read top to bottom. On the left the front page: the lead
   story large, its headline on a panel over the photo and its score as a block on it, then packages (Top
   stories, then a category each): one story large beside a few headlines, under a rule in the package's
   colour. On the right, behind a dashed line, the feed itself, in rank order, as compact cards, without the
   stories already on the front page (.on-front; they are in the page for phones). Both lanes have the
   buttons and the seen and read tracking. The feed stops after its first page with More stories, so both
   lanes end together; that opens the list view (view=list, no front page): the whole feed as the phone's
   column, with a way back. Below 1240px the front page is not shown and the feed is the phone's column,
   loading on. Read state follows both copies of a story.
   Every two-lane rule is scoped to :has(> .front); the list view has its own section below. */
.front, .lane-head, .lane-more { display: none; }
.feedwrap.swapping > .front { opacity: 0.45; transition: opacity 0.15s ease; }
.feedwrap.swapped > .front { animation: feed-in 0.18s ease-out both; }
@media (prefers-reduced-motion: reduce) {
  .feedwrap.swapping > .front { transition: none; }
  .feedwrap.swapped > .front { animation: none; }
}
@media (min-width: 1240px) {
  body.feedpage:has(.feedwrap.home > .front) { --page: 1352px; }
  .feedwrap.home:has(> .front) { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) 400px; column-gap: 28px; align-items: start; }
  .feedwrap.home:has(> .front) > * { grid-column: 1 / -1; }
  .feedwrap.home:has(> .front) .banner { max-width: none; }
  /* Every chip shows, wrapped, instead of scrolling off the edge or folding behind More */
  .feedwrap.home:has(> .front) > .cats { flex-wrap: wrap; overflow: visible; margin: 2px 0 -4px; padding: 4px 0 8px; -webkit-mask-image: none; mask-image: none; }
  .feedwrap.home:has(> .front) > .cats.folded:not(.open) .extra { display: inline-flex; }
  .feedwrap.home:has(> .front) > .cats .cats-more { display: none; }

  /* --- the two lanes --- */
  .feedwrap.home:has(> .front) > .front { display: block; grid-column: 1; min-width: 0; margin-top: 20px; }
  .feedwrap.home:has(> .front) > .stream { grid-column: 2; min-width: 0; gap: 10px; margin-top: 20px; padding-left: 28px; border-left: 1px dashed var(--border); }
  .feedwrap.home:has(> .front) .lane-head {
    display: flex; align-items: center; gap: 10px; margin: 0 0 6px;
    font: 500 0.68rem var(--mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted);
  }
  .lane-head span { padding: 7px 14px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 0.74rem; }
  /* The lane's end: the rest of the feed is one click away, in the list view */
  .feedwrap.home:has(> .front) .stream > .loadmore { display: none; }
  /* on the front page already, or past its end (app.js fitLane); above the cards' own display: grid below */
  .feedwrap.home:has(> .front) .stream > .story:is(.on-front, .lane-over) { display: none !important; }
  /* fitLane measures the lane's cards: off-screen skipping would report placeholder heights (it is one page) */
  .feedwrap.home:has(> .front) .stream > .story { content-visibility: visible; }
  .feedwrap.home:has(> .front) .lane-more {
    display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 8px; min-height: 52px; padding: 0 18px;
    border-radius: 999px; background: var(--text); color: var(--bg); text-decoration: none; font: 700 1rem var(--display);
  }
  .feedwrap.home:has(> .front) .lane-more[hidden] { display: none; }
  .lane-more span { font: 500 0.72rem var(--mono); text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.7; }
  .lane-more svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
  .lane-more:hover { background: var(--accent); color: var(--accent-ink); }
  .lane-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

  /* --- front page: shared --- */
  .front .story { position: relative; }
  .front .story :is(h2, h3) a { color: var(--text); text-decoration: none; }
  .front .story :is(h2, h3) a::after { content: ""; position: absolute; inset: 0; z-index: 1; }  /* the whole story opens it */
  .front .story :is(h2, h3) a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
  .front .story:has(:is(h2, h3) a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 4px; }
  .front .story :is(h2, h3) a:focus-visible { outline: none; }
  .front .big-media { border-radius: var(--radius); }
  @media (hover: hover) {
    .front .story:hover :is(.big-media, .thumb-img) img { transform: scale(1.03); }
  }
  .fdek { margin: 0; color: var(--text-2); font-size: 0.95rem; line-height: 1.5; }
  .flabels { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .flabel {
    padding: 0 7px; border-radius: 3px; background: var(--h, var(--muted)); color: #fff;
    font: 700 0.64rem/1.6 var(--mono); text-transform: uppercase; letter-spacing: 0.04em;
  }
  /* The source line, the buttons at its end (they wrap below it when the column is narrow) */
  .ffoot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin: 10px 0 0; }
  .ffoot .acts { margin: -6px -6px -6px auto; }
  .fbyline {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0;
    font: 500 0.68rem var(--mono); text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted);
  }
  .fbyline .src { color: var(--accent-text); font-weight: 700; }
  .fbyline .badge { width: 18px; height: 18px; font-size: 0.5rem; }
  .fbyline .fcov::before { content: "·"; margin-right: 8px; }
  /* The score, as a block on the photo */
  .fscore {
    position: absolute; z-index: 3; top: 16px; right: 16px; display: grid; justify-items: center; min-width: 76px;
    padding: 9px 12px 8px; border-radius: 4px; background: var(--lime); color: var(--neon-ink);
    box-shadow: 0 6px 18px rgb(0 0 0 / 0.28); pointer-events: none;
  }
  .fscore b { font: 800 2.15rem/1 var(--display); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
  .fscore small { margin-top: 3px; font: 700 0.6rem var(--mono); text-transform: uppercase; letter-spacing: 0.06em; }
  .fscore.high { background: var(--accent); color: var(--accent-ink); }
  .front .story.read :is(h2, h3) a { color: var(--muted); }

  /* --- the lead --- */
  .flead { margin: 0 0 52px; }
  /* Wide but not a whole screen tall, so the headline panel shows on the first screen */
  .flead-media { aspect-ratio: auto; height: clamp(320px, 46vh, 460px); }
  .flead-media .hero-mono { font-size: 6rem; }
  .flead-panel {
    position: relative; z-index: 2; width: min(84%, 760px); margin: -128px 0 0 32px; padding: 22px 28px 18px;
    background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); box-shadow: var(--shadow-hi);
  }
  .flead h2 { margin: 12px 0 10px; font: 700 clamp(2rem, 2.6vw, 2.75rem)/1.04 var(--display); letter-spacing: -0.04em; text-wrap: balance; }
  .flead .fdek { max-width: 64ch; font-size: 1.08rem; }
  .flead .fdek:has(+ .fpoints) { -webkit-line-clamp: 2; }  /* the key points say the rest */
  .fpoints {
    list-style: none; display: grid; gap: 6px; margin: 14px 0 4px; padding: 11px 14px;
    background: var(--surface-2); border-left: 3px solid var(--accent); border-radius: var(--radius);
  }
  .fpoints li { position: relative; padding-left: 16px; font-size: 0.9rem; line-height: 1.4; }
  .fpoints li::before { content: ""; position: absolute; left: 1px; top: 0.5em; width: 6px; height: 6px; border-radius: 1px; background: var(--accent); }

  /* --- packages --- */
  .fpack { margin: 0 0 52px; }
  .fpack.top { --h: var(--accent); }
  .fpack-head {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin: 0 0 22px; padding-top: 12px;
    border-top: 4px solid var(--h, var(--accent)); font: 700 1.6rem/1.15 var(--display); letter-spacing: -0.025em;
  }
  .fpack-head span { font: 400 1.12rem var(--sans); letter-spacing: 0; color: var(--muted); }
  .fpack-head i { font-style: normal; font-weight: 700; color: var(--h, var(--accent)); }
  .fpack-body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0 32px; align-items: start; }
  .fbig-media { aspect-ratio: 4 / 3; margin-bottom: 14px; }
  .fbig-media .hero-mono { font-size: 3.4rem; }
  .fbig .fscore { top: 12px; right: 12px; min-width: 60px; padding: 7px 9px 6px; }
  .fbig .fscore b { font-size: 1.55rem; }
  .fbig h3 { margin: 8px 0; font: 700 1.7rem/1.1 var(--display); letter-spacing: -0.03em; text-wrap: balance; }
  .fbig .fdek { font-size: 1rem; }
  .fitem { display: grid; grid-template-columns: minmax(0, 1fr) 92px; gap: 0 16px; align-items: start; padding: 16px 0; border-top: 1px solid var(--border); }
  .fitem:first-child { padding-top: 0; border-top: 0; }
  .fitem h3 { margin: 6px 0; font: 700 1.12rem/1.22 var(--display); letter-spacing: -0.015em; }
  .fitem .fdek { font-size: 0.9rem; }
  .front .fitem-thumb { aspect-ratio: 1; border-radius: 6px; }

  /* --- the feed lane: the phone's cards, compact, the photo as a square beside the text --- */
  .feedwrap.home:has(> .front) .stream .card { padding: 12px 14px; }
  .feedwrap.home:has(> .front) .stream .card.has-img { grid-template-columns: minmax(0, 1fr) 88px; column-gap: 12px; }
  .feedwrap.home:has(> .front) .stream .thumb-img { aspect-ratio: 1; }
  .feedwrap.home:has(> .front) .stream > .fcard.big { display: grid; grid-template-columns: minmax(0, 1fr) 88px; column-gap: 12px; align-items: start; padding: 12px 14px; }
  .feedwrap.home:has(> .front) .stream > .fcard.big > .big-body, .feedwrap.home:has(> .front) .stream > .fcard.big .bodytext { display: contents; }
  .feedwrap.home:has(> .front) .stream > .fcard.big > .big-body > *, .feedwrap.home:has(> .front) .stream > .fcard.big .bodytext > * { grid-column: 1; }
  /* Beside the photo: the source line and the headline; the lede and everything after use the full width */
  .feedwrap.home:has(> .front) .stream > .fcard.big :is(.slimfoot, .coverage, .tldr, .sumform, .summary, .snippet, .note) { grid-column: 1 / -1; }
  .feedwrap.home:has(> .front) .stream > .fcard.big > .big-media { grid-column: 2; grid-row: 1 / span 2; aspect-ratio: 1; border-radius: 6px; }
  .feedwrap.home:has(> .front) .stream > .fcard.big .hero-mono { font-size: 1.4rem; }
  .feedwrap.home:has(> .front) .stream > .fcard.big.unseen::before { left: 0; right: auto; top: 12px; bottom: 12px; width: 4px; height: auto; border-radius: 0 4px 4px 0; }
  .feedwrap.home:has(> .front) .stream .story h3 { margin: 6px 0 4px; font-size: 1.04rem; line-height: 1.25; }
  .feedwrap.home:has(> .front) .stream .story :is(.snippet, .summary.lede) {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 0.9rem;
  }
}

/* ---------- desktop home: the list view (More stories), like a social feed on a desktop ---------- */
/* From 1240px: the same page width as the front page, in three columns. On the left (sticky) the way back to
   the front page, the categories as a column of chips and shortcuts; in the middle the feed exactly as on the
   phone; on the right (sticky) today's numbers and the top five. Below 1240px the left sidebar is display:
   contents with only its chips showing (they are the usual row under the masthead) and the right one is gone. */
.listnav { display: contents; }
.listnav > :not(.cats), .listrail { display: none; }
.listnote { margin: 14px 0 -4px; font: 500 0.7rem var(--mono); text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.listnote a { color: var(--accent-text); font-weight: 700; }
@media (min-width: 1240px) {
  body.feedpage:has(.feedwrap.home > .listnav) { --page: 1352px; }
  .feedwrap.home:has(> .listnav) {
    max-width: none; display: grid; grid-template-columns: 248px minmax(0, 1fr) 300px; column-gap: 40px; align-items: start;
  }
  .feedwrap.home:has(> .listnav) > * { grid-column: 2; min-width: 0; }
  .feedwrap.home:has(> .listnav) .banner { max-width: none; }
  /* The sidebars span every row of the page grid and stay in view while the feed scrolls */
  .feedwrap.home:has(> .listnav) > :is(.listnav, .listrail) {
    grid-row: 1 / span 12; position: sticky; top: calc(49px + 20px); margin-top: 28px;
    max-height: calc(100dvh - 49px - 40px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  }
  .feedwrap.home:has(> .listnav) > .listnav { grid-column: 1; display: flex; flex-direction: column; }
  .feedwrap.home:has(> .listnav) > .listrail { grid-column: 3; display: grid; gap: 14px; align-content: start; }
  .listnav > :not(.cats) { display: revert; }

  /* --- left: back, categories, shortcuts --- */
  .listnav > .listback {
    display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin: 0 0 16px; padding: 8px 16px 8px 10px;
    border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 700 0.92rem var(--display); text-decoration: none;
  }
  .listback:hover { background: var(--text); color: var(--bg); }
  .listback svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
  .listnav > .cats {
    flex-direction: column; flex-wrap: nowrap; gap: 6px; margin: 0; padding: 2px; overflow: visible;
    -webkit-mask-image: none; mask-image: none;
  }
  .listnav > .cats a { min-height: 40px; padding: 0 14px; }
  .listnav > .cats a span { margin-left: auto; font-variant-numeric: tabular-nums; }
  .listnav > .cats a.scope + a:not(.scope) { margin: 8px 0 0; }
  .listnav > .cats.folded:not(.open) .extra { display: inline-flex; }  /* the column has room for all */
  .listnav > .cats .cats-more { display: none; }
  .listnav > .skel-chips .skel { width: 100%; height: 40px; }
  .railtitle { margin: 22px 4px 8px; font: 700 0.66rem var(--mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
  .listnav > .railtitle:first-child { margin-top: 0; }
  .listnav > .raillinks { display: grid; gap: 2px; }  /* as specific as the revert above, and after it */
  .raillinks a {
    display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 10px;
    color: var(--text); text-decoration: none; font: 600 0.92rem var(--sans);
  }
  .raillinks a:hover { background: var(--surface-2); }
  .raillinks svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

  /* --- right: today, top five --- */
  .railbox { padding: 16px 18px; background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); box-shadow: var(--chip-shadow); }
  .railbox .railtitle { margin: 0 0 10px; }
  .railnew { display: flex; align-items: baseline; gap: 8px; margin: 0; font: 500 0.78rem var(--mono); text-transform: uppercase; color: var(--muted); }
  .railnew b { font: 700 2rem/1 var(--display); letter-spacing: -0.03em; color: var(--text); }
  .railnew b.hot { padding: 2px 8px; border-radius: 4px; background: var(--lime); color: var(--neon-ink); }
  .railstats { list-style: none; display: grid; gap: 4px; margin: 10px 0 0; padding: 0; font: 500 0.72rem var(--mono); text-transform: uppercase; letter-spacing: 0.03em; }
  .railstats a { color: var(--text-2); text-decoration: none; }
  .railstats a:hover { text-decoration: underline; }
  .railstats a.bad { color: var(--danger); font-weight: 700; }
  .railtop { list-style: none; display: grid; gap: 14px; margin: 0; padding: 0; counter-reset: top; }
  .railtop li { display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 8px; counter-increment: top; }
  .railtop li::before { content: counter(top); grid-row: 1 / span 2; font: 800 1.35rem/1.1 var(--display); color: var(--accent); }
  .railtop a {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
    color: var(--text); text-decoration: none; font: 700 0.95rem/1.25 var(--display); letter-spacing: -0.01em;
  }
  .railtop a:hover { text-decoration: underline; }
  .railtop span { margin-top: 3px; font: 500 0.64rem var(--mono); text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
  .railtop li.read a, .railtop li.read::before { color: var(--muted); }
}
