@font-face {
  font-family: Rubik; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/fonts/rubik-hebrew.woff2) format("woff2");
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: Rubik; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/fonts/rubik-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: "Frank Ruhl Libre"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/fonts/frankruhl-hebrew.woff2) format("woff2");
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: "Frank Ruhl Libre"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/fonts/frankruhl-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 {
  --bg: #14162b;
  --surface: #1f2240;
  --surface-2: #2a2e55;
  --line: #31365f;
  --text: #ffffff;
  --text-2: #b9bedc;
  --text-3: #8e94bb;
  --accent: #ff8a3d;
  --accent-press: #f2742a;
  --on-accent: #14162b;
  --sky: #5ac8fa;
  --danger: #ff6b6b;
  --cat: #c9cce6;
  --link: #5ac8fa;
  --topbar-bg: rgb(20 22 43 / .94);
  --bar-bg: #0e1022;
  --mini-base: #20234a;
  --hover: rgb(255 255 255 / .06);
  --track: rgb(255 255 255 / .18);
  --error-ink: #ffd0d0;
  --transcript-ink: #e9eaf6;
  --shadow: rgb(0 0 0 / .35);
  --land-glow: rgb(124 108 255 / .30);
  --cover-badge: rgb(14 16 34 / .82); /* on artwork: the same in day mode */
  --on-cover-badge: #ffffff;
  /* Problem-report discs (the "!" sheet): artwork, so the same in day mode. One colour per kind of problem. */
  --rep-say: #ff6f7d;
  --rep-audio: #34aee8;
  --rep-story: #f2a91f;
  --rep-nikud: #9b7bf2;
  --rep-sync: #2fbf7f;
  --rep-other: #8a90b8;
  --rep-ring: #ffffff;
  --scrim: rgb(8 9 20 / .62);

  --r-card: 20px;
  --r-lg: 24px;
  --tab-h: 64px;
  --mini-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --gutter: 16px;
  --ease: cubic-bezier(.16, 1, .3, 1);

  color-scheme: dark;
  font-family: Rubik, "Noto Sans Hebrew", system-ui, sans-serif;
  font-size: calc(16px * var(--fs, 1));
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--line) transparent;
}

/* Day mode: same world in daylight. Category colours as text switch to an ink mix (see Day ink rule below). */
:root[data-theme="light"] {
  --bg: #f4f5fb;
  --surface: #ffffff;
  --surface-2: #e9ebf6;
  --line: #d9dcec;
  --text: #14162b;
  --text-2: #474c6e;
  --text-3: #5c6188;
  --link: #0b6fa8;
  --topbar-bg: rgb(244 245 251 / .94);
  --bar-bg: #ffffff;
  --mini-base: #ffffff;
  --hover: rgb(20 22 43 / .06);
  --track: rgb(20 22 43 / .14);
  --error-ink: #b42318;
  --transcript-ink: #1f2240;
  --shadow: rgb(20 22 43 / .14);
  --land-glow: rgb(90 160 250 / .22);
  --scrim: rgb(20 22 43 / .38);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; background: var(--bg); -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
svg { width: 24px; height: 24px; flex: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: rgb(90 200 250 / .4); color: var(--text); }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; border-radius: 12px; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
main:focus, h1:focus, [tabindex="-1"]:focus { outline: none; }
.hint { padding: 0 var(--gutter); color: var(--text-2); font-size: calc(15px * var(--fs, 1)); max-width: 48ch; }

.skip {
  position: fixed; inset-inline-start: 12px; top: -60px; z-index: 50;
  background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: 999px; font-weight: 600;
}
.skip:focus { top: 12px; }

/* ---------- Top bar + navigation ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 60px; padding-inline: var(--gutter);
  padding-top: env(safe-area-inset-top, 0px);
  box-sizing: content-box;
  background: var(--topbar-bg);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.brand { white-space: nowrap; font-size: 22px; font-weight: 700; letter-spacing: -.01em; display: inline-flex; align-items: center; gap: 8px; }
.brand::before {
  content: ""; width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: var(--accent) url("/favicon-mark.svg") center / 22px no-repeat;
}
.lang {
  height: 44px; padding-inline: 14px; border-radius: 999px; white-space: nowrap; flex: none;
  background: var(--surface); font-size: calc(14px * var(--fs, 1)); font-weight: 600;
}
@media (hover: hover) { .lang:hover { background: var(--surface-2); } }
/* Language picker: the pill shows the current language; the real <select> lies invisible on top of it. */
label.lang { position: relative; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
label.lang select { position: absolute; inset: 0; width: 100%; min-width: 0; max-width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: calc(16px * var(--fs, 1)); appearance: none; }
label.lang:focus-within { outline: 3px solid var(--link); outline-offset: 2px; }

.nav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--bar-bg); border-top: 1px solid var(--line);
}
.nav a {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: calc(12px * var(--fs, 1)); font-weight: 500; color: var(--text-3);
}
.nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"] svg { color: var(--accent); }
.nav-count {
  position: absolute; top: 6px; inset-inline-start: calc(50% + 6px);
  min-width: 18px; height: 18px; padding-inline: 5px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); font-size: calc(11px * var(--fs, 1)); font-weight: 700; line-height: 18px; text-align: center;
}

main {
  display: block; outline: none;
  padding-bottom: calc(var(--tab-h) + var(--mini-h) + 32px + var(--safe-b));
}

/* ---------- Shared bits ---------- */
.section { padding: 8px var(--gutter) 0; }
.section + .section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: calc(20px * var(--fs, 1)); font-weight: 700; }
.section-head a { font-size: calc(14px * var(--fs, 1)); font-weight: 500; color: var(--link); padding: 6px 0; }
/* a small action beside a section heading ("surprise me"): quiet surface pill, 44px tall for the thumb */
.head-btn {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding-inline: 14px 16px; border-radius: 999px;
  background: var(--surface); color: var(--text); font-size: calc(15px * var(--fs, 1)); font-weight: 500;
  transition: background .15s, transform .15s var(--ease);
}
.head-btn svg { width: 18px; height: 18px; color: var(--link); }
@media (hover: hover) { .head-btn:hover { background: var(--surface-2); } }
.head-btn:active { transform: scale(.97); }
@media (max-width: 359px) { /* the smallest phones: icon only, so the heading keeps one line */
  .head-btn { width: 44px; padding: 0; justify-content: center; }
  .head-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } /* still read aloud */
}
.page-title { font-size: calc(28px * var(--fs, 1)); font-weight: 700; padding: 16px var(--gutter) 4px; }

.chips {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 8px var(--gutter) 4px; scroll-padding-inline: var(--gutter);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding-inline: 16px; border-radius: 999px;
  background: var(--surface); font-size: calc(15px * var(--fs, 1)); font-weight: 500; color: var(--text);
  transition: background .15s;
}
.chip::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--cat); }
.chip.all::before { display: none; }
@media (hover: hover) { .chip:hover { background: var(--surface-2); } }
.chip[aria-current="page"] { background: var(--text); color: var(--bg); }

.segmented {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  margin: 12px var(--gutter) 4px; padding: 4px; border-radius: 14px; background: var(--surface);
}
.segmented button {
  height: 44px; border-radius: 10px; font-size: calc(15px * var(--fs, 1)); font-weight: 500; color: var(--text-2);
}
.segmented button[aria-pressed="true"] { background: var(--text); color: var(--bg); font-weight: 600; }

/* ---------- Covers ---------- */
.cover {
  position: relative; display: block; overflow: hidden; flex: none;
  aspect-ratio: 1; border-radius: var(--r-card);
  background: var(--cat); color: #fff6d8;
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cover--sm { width: 44px; border-radius: 12px; }
.cover--md { width: 112px; border-radius: 18px; }
.cover--xl { width: min(78vw, 340px); border-radius: 28px; margin-inline: auto; box-shadow: 0 18px 40px var(--shadow); }

/* ---------- Story cards ---------- */
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: 148px; gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter);
}
.rail::-webkit-scrollbar { display: none; }
.grid.grid--flush { padding: 0; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; padding: 16px var(--gutter) 0; }
.card { scroll-snap-align: start; min-width: 0; display: flex; flex-direction: column; }
.card-art { position: relative; }
.card-art > a { display: block; border-radius: var(--r-card); }
.card-art .cover { width: 100%; transition: transform .25s var(--ease); }
@media (hover: hover) { .card-art > a:hover .cover { transform: scale(1.02); } }
.card-play {
  position: absolute; bottom: 8px; inset-inline-end: 8px;
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent);
  box-shadow: 0 4px 12px var(--shadow);
  transition: transform .15s var(--ease), background .15s;
}
.card-play svg { width: 22px; height: 22px; }
@media (hover: hover) { .card-play:hover { background: var(--accent-press); transform: scale(1.06); } }
.card-play:active { transform: scale(.94); }
.card-title { display: block; margin-top: 10px; font-size: calc(15px * var(--fs, 1)); font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.card-meta { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: calc(13px * var(--fs, 1)); color: var(--text-2); }
/* cards in a row are equally tall; the meta row sits at the bottom so the add buttons line up whatever the title length */
.card > .card-meta { margin-top: auto; padding-top: 2px; }
.card-meta .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cat); flex: none; }
.card-meta .add { margin-inline-start: auto; align-self: flex-end; }
.card.is-live .card-title { color: var(--cat); }
.card-desc { display: none; }

.add {
  width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center;
  color: var(--text-2); background: var(--surface);
}
.add svg { width: 18px; height: 18px; }
@media (hover: hover) { .add:hover { color: var(--text); background: var(--surface-2); } }
.add:disabled, .btn--icon:disabled { opacity: 1; cursor: default; }
.add[aria-pressed="true"] { color: var(--on-accent); background: var(--sky); }

/* ---------- Category tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile {
  position: relative; overflow: hidden; display: grid; align-content: start; gap: 2px;
  min-height: 104px; padding: 14px 16px; border-radius: var(--r-card);
  background: var(--surface); color: var(--text);
  transition: transform .2s var(--ease);
}
@media (hover: hover) { .tile:hover { transform: translateY(-2px); } }
.tile b { font-size: calc(19px * var(--fs, 1)); font-weight: 700; line-height: 1.2; position: relative; z-index: 1; }
.tile small { font-size: calc(14px * var(--fs, 1)); font-weight: 500; color: var(--text-2); position: relative; z-index: 1; }
.tile::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 46%; background: var(--cat); opacity: .7;
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 40' preserveAspectRatio='none'%3E%3Cpath d='M0 18C20 6 40 6 56 14S86 24 100 12V40H0z'/%3E%3C/svg%3E");
  -webkit-mask: var(--wave) bottom / 100% 100% no-repeat; mask: var(--wave) bottom / 100% 100% no-repeat;
}
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } .tile { min-height: 132px; } }

/* ---------- Tonight feature ---------- */
.feature {
  margin: 12px var(--gutter) 0; padding: 16px; border-radius: var(--r-lg);
  background: color-mix(in oklab, var(--cat) 18%, var(--surface));
  display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center;
}
.feature-text { min-width: 0; }
.section-head--feature { padding: 16px var(--gutter) 0; margin-bottom: 0; align-items: center; }
.feature h3 { font-size: calc(22px * var(--fs, 1)); line-height: 1.2; margin: 0 0 6px; overflow-wrap: anywhere; }
.feature p.meta { font-size: calc(14px * var(--fs, 1)); color: var(--text-2); }
.feature .desc { display: none; }
.feature-actions { grid-column: 1 / -1; display: flex; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding-inline: 22px; border-radius: 999px;
  font-size: calc(16px * var(--fs, 1)); font-weight: 600; background: var(--surface-2); color: var(--text);
  transition: background .15s, transform .15s var(--ease);
}
.btn svg { width: 20px; height: 20px; }
@media (hover: hover) { .btn:hover { background: var(--line); } }
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
@media (hover: hover) { .btn--primary:hover { background: var(--accent-press); } }
.btn--grow { flex: 1; }
.btn[aria-pressed="true"] { background: var(--sky); color: var(--on-accent); }

/* ---------- Story page ---------- */
.story { padding: 12px var(--gutter) 0; }
.story-top { display: grid; gap: 18px; }
.story-top .cover { width: min(64vw, 260px); }
.story h1 { font-size: calc(28px * var(--fs, 1)); line-height: 1.2; font-weight: 700; }
.story .cat-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 0; padding-block: 10px; font-size: calc(15px * var(--fs, 1)); font-weight: 500; color: var(--text-2); }
.story .cat-link::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--cat); }
.stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: calc(14px * var(--fs, 1)); color: var(--text-3); }
.story-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; } /* a long French label plus three icon buttons do not fit one row at 320 px */
.btn--icon { width: 48px; padding: 0; flex: none; }
.story-actions .like[aria-pressed="true"] { color: var(--cat); background: var(--surface-2); }
.story section { margin-top: 32px; max-width: 70ch; }
.story h2 { font-size: calc(20px * var(--fs, 1)); font-weight: 700; margin-bottom: 10px; }
.story .desc { font-size: calc(17px * var(--fs, 1)); line-height: 1.7; color: var(--text-2); }
.transcript { font-size: calc(19px * var(--fs, 1)); line-height: 2.05; color: var(--transcript-ink); max-width: 62ch; }
.transcript p + p { margin-top: 1.1em; }
.transcript-note { font-size: calc(14px * var(--fs, 1)); color: var(--text-3); margin: -4px 0 12px; }
/* Listen / read switch: top centre of the story page, the reading page and the player sheet */
.mode-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-bottom: 10px; }
.mode-row .back { justify-self: start; }
.mode-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--hover); }
.mode-switch > * { width: 52px; height: 44px; border-radius: 999px; display: grid; place-items: center; color: var(--text-2); transition: color .15s, background-color .15s; }
.mode-switch svg { width: 22px; height: 22px; }
.mode-switch [aria-current] { background: var(--track); color: var(--text); }
@media (hover: hover) { .mode-switch > :not([aria-current]):hover { color: var(--text); } }
.back { display: inline-flex; align-items: center; gap: 4px; height: 44px; font-size: calc(15px * var(--fs, 1)); color: var(--text-2); }
.back svg { width: 20px; height: 20px; transform: scaleX(-1); }
.back:dir(rtl) svg { transform: none; }

/* ---------- Queue ---------- */
.list { list-style: none; margin: 0; padding: 0 var(--gutter); }
.list-head { font-size: calc(15px * var(--fs, 1)); font-weight: 600; color: var(--text-2); padding: 20px var(--gutter) 8px; display: flex; justify-content: space-between; align-items: center; }
.list-head button { font-size: calc(14px * var(--fs, 1)); color: var(--link); font-weight: 500; padding: 6px 0; }
.row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.row .cover { width: 52px; border-radius: 12px; }
.row-text { min-width: 0; }
.row-text b { display: block; font-weight: 500; font-size: calc(16px * var(--fs, 1)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-text small { font-size: calc(13px * var(--fs, 1)); color: var(--text-2); }
.row-play { text-align: start; display: contents; }
.row.is-live { background: color-mix(in oklab, var(--cat) 14%, transparent); border-radius: 16px; padding-inline: 10px; border-bottom-color: transparent; margin-bottom: 4px; }
.row.is-live b { color: var(--cat); }
.row.is-heard .cover { opacity: .55; }
.row .icon-btn { width: 44px; height: 44px; }

/* ---------- Empty + error states ---------- */
.empty {
  margin: 24px var(--gutter); padding: 32px 24px; border-radius: var(--r-lg);
  background: var(--surface); text-align: center;
}
.empty .cover { width: 88px; margin: 0 auto 16px; border-radius: 22px; }
.empty h2 { font-size: calc(19px * var(--fs, 1)); font-weight: 600; }
.empty p { margin-top: 6px; color: var(--text-2); font-size: calc(15px * var(--fs, 1)); }
.empty .btn { margin-top: 18px; }

/* ---------- Sign-in gate (reuses the empty state) ---------- */
.gated .nav, .gated .mini { display: none; }
.empty h1 { text-wrap: balance; }
.empty p { max-width: 42ch; margin-inline: auto; }
.gate-email { font-size: calc(15px * var(--fs, 1)); color: var(--text-3); overflow-wrap: anywhere; }
.gate-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.gate-actions .btn { margin-top: 0; }
.gate-link { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 12px; font-size: calc(15px * var(--fs, 1)); color: var(--link); }

/* ---------- Landing page (what a signed-out visitor sees; markup in js/landing.js) ---------- */
.gated main { padding-bottom: 0; } /* no tab bar or player to clear */
/* The static Hebrew copy in index.html is for crawlers and browsers without script; the app draws its own. */
@media (scripting: enabled) { .land--static { display: none; } }
.land { padding: 0 var(--gutter) calc(24px + var(--safe-b)); }
.land h2 { font-size: calc(22px * var(--fs, 1)); font-weight: 700; line-height: 1.25; }
/* Hero: label, big headline, two pills, the cookie line; tonight's story beside it on wide screens. */
.land-hero { position: relative; isolation: isolate; display: grid; gap: 32px; padding-block: 28px 0; }
.land-hero > * { min-width: 0; }
.land-hero::before { /* the glow: closest-side, so it fades out inside its own box and never shows an edge */
  content: ""; position: absolute; z-index: -1; inset-block-start: -90px; inset-inline-start: calc(var(--gutter) * -1); width: min(860px, 100% + var(--gutter) * 2); height: 600px; pointer-events: none;
  background: radial-gradient(closest-side, var(--land-glow), transparent);
}
.land-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  font-size: calc(13px * var(--fs, 1)); font-weight: 600; color: var(--text-2);
}
.land-eyebrow svg { flex: none; width: 15px; height: 15px; }
.land h1 { margin-top: 16px; font-size: calc(clamp(30px, 8.6vw, 36px) * var(--fs, 1)); font-weight: 700; line-height: 1.14; overflow-wrap: anywhere; }
.land-lead { margin-top: 14px; max-width: 46ch; font-size: calc(17px * var(--fs, 1)); line-height: 1.65; color: var(--text-2); }
.land-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.land-cta .btn { flex: 1 1 auto; height: auto; min-height: 52px; padding: 10px 16px; font-size: calc(15px * var(--fs, 1)); text-align: center; line-height: 1.3; } /* long French labels wrap at 320px */
.land-see { background: transparent; box-shadow: inset 0 0 0 1.5px var(--text-3); }
@media (hover: hover) { .land-see:hover { background: var(--hover); box-shadow: inset 0 0 0 1.5px var(--text-2); } }
.land-note { margin-top: 16px; max-width: 52ch; font-size: calc(14px * var(--fs, 1)); color: var(--text-3); }
.land-note .gate-link { display: flex; width: fit-content; padding-inline: 0; font-size: calc(14px * var(--fs, 1)); }
/* Length badge: sits on the artwork, so it keeps one dark ground in both themes. */
.land-badge {
  position: absolute; inset-block-end: 8px; inset-inline-start: 8px; display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 999px; background: var(--cover-badge); color: var(--on-cover-badge);
  font-size: calc(12px * var(--fs, 1)); font-weight: 600; line-height: 1.4; font-variant-numeric: tabular-nums;
}
.land-badge svg { flex: none; width: 14px; height: 14px; }
/* Tonight's story: the one framed story on the page. */
.land-tonight {
  display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 0 14px; align-content: start;
  padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
}
.land-tonight .cover { grid-row: 1 / 4; width: 100%; align-self: start; }
.land-tonight-text { display: contents; }
.land-tonight small { align-self: end; font-size: calc(13px * var(--fs, 1)); font-weight: 600; color: var(--text-2); }
.land-tonight b { margin-top: 4px; font-size: calc(19px * var(--fs, 1)); font-weight: 700; line-height: 1.25; }
.land-cat { display: flex; align-items: center; gap: 6px; margin-top: 6px; align-self: start; font-size: calc(13px * var(--fs, 1)); color: var(--text-2); }
.land-cat::before, .land-shelf h3::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--cat); }
.land-about {
  grid-column: 1 / -1; margin-top: 12px; font-size: calc(14px * var(--fs, 1)); line-height: 1.6; color: var(--text-2);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
/* Shelves: one row of covers per category. */
.land-shelves, .land-band, .land-faq { margin-top: 56px; }
.land-shelves h2 { scroll-margin-top: 76px; }
.land-hint { margin-top: 6px; max-width: 60ch; font-size: calc(15px * var(--fs, 1)); line-height: 1.6; color: var(--text-2); }
.land-shelf { margin-top: 28px; }
.land-shelf h3 { display: flex; align-items: center; gap: 8px; font-size: calc(17px * var(--fs, 1)); font-weight: 600; }
.land-shelf h3::before { width: 10px; height: 10px; }
.land-shelf .rail { list-style: none; grid-auto-columns: 164px; margin-block: 8px 0; padding-block: 4px; } /* 4px: room for the focus ring */
.land-shelf li { min-width: 0; scroll-snap-align: start; }
.land-card { display: block; border-radius: var(--r-card); }
.land-card .cover { width: 100%; transition: transform .25s var(--ease); }
.land-card b { display: block; margin-top: 8px; font-size: calc(15px * var(--fs, 1)); font-weight: 500; line-height: 1.35; }
@media (hover: hover) { .land-card:hover .cover { transform: scale(1.02); } .land-tonight:hover { border-color: var(--text-3); } }
.land-more { margin-top: 28px; font-size: calc(15px * var(--fs, 1)); color: var(--text-3); }
.land-more a { display: flex; width: fit-content; align-items: center; min-height: 44px; color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
/* "Put the phone down": one framed strip. */
.land-band {
  padding: 24px 18px 12px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: radial-gradient(ellipse 70% 110% at 50% -30%, var(--land-glow), transparent 70%) var(--surface);
}
.land-steps { list-style: none; counter-reset: step; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.land-steps li { counter-increment: step; display: flex; align-items: baseline; gap: 8px; font-size: calc(17px * var(--fs, 1)); font-weight: 600; }
.land-steps li::before { content: counter(step); font-size: calc(14px * var(--fs, 1)); font-weight: 500; color: var(--text-3); font-variant-numeric: tabular-nums; }
.land-own { margin: 18px 0 0; padding-top: 8px; border-top: 1px solid var(--line); display: grid; column-gap: 32px; }
.land-own > div { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; align-content: start; padding-block: 12px; }
.land-own dt { display: contents; font-size: calc(16px * var(--fs, 1)); font-weight: 600; }
.land-own svg { grid-row: 1 / 3; width: 44px; height: 44px; padding: 11px; border-radius: 14px; background: var(--surface-2); color: var(--text-2); }
.land-own dd { grid-column: 2; margin: 2px 0 0; font-size: calc(15px * var(--fs, 1)); line-height: 1.55; color: var(--text-2); }
/* Questions and answers: native <details>, so keyboard and screen readers get them for free. */
.land-faq { max-width: 760px; }
.land-faq h2 { margin-bottom: 8px; }
.land-faq details { border-bottom: 1px solid var(--line); }
.land-faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding-block: 12px;
  font-size: calc(17px * var(--fs, 1)); font-weight: 600; line-height: 1.35; cursor: pointer; list-style: none;
}
.land-faq summary::-webkit-details-marker { display: none; }
.land-faq summary svg { flex: none; width: 20px; height: 20px; color: var(--text-3); transition: transform .2s var(--ease); }
.land-faq details[open] summary svg { transform: rotate(180deg); }
.land-faq p { max-width: 65ch; padding-bottom: 16px; font-size: calc(16px * var(--fs, 1)); line-height: 1.7; color: var(--text-2); }
.land-faq p a { display: flex; width: fit-content; align-items: center; min-height: 44px; color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
@media (hover: hover) { .land-faq summary:hover svg { color: var(--text); } }
.land-foot { margin-top: 48px; padding-top: 12px; border-top: 1px solid var(--line); }
.land-foot nav { display: flex; flex-wrap: wrap; gap: 0 24px; }
.land-foot a { display: inline-flex; align-items: center; min-height: 44px; font-size: calc(15px * var(--fs, 1)); color: var(--link); }
@media (hover: hover) { .land-foot a:hover, .land-note a:hover { text-decoration: underline; text-underline-offset: 3px; } }
@media (prefers-reduced-motion: no-preference) {
  .land-tonight { animation: land-in .7s var(--ease) backwards; }
  @keyframes land-in { from { opacity: 0; transform: translateY(14px); } }
}
@media (min-width: 640px) {
  .land-cta .btn { flex: 0 1 auto; padding-inline: 24px; font-size: calc(16px * var(--fs, 1)); }
  .land-tonight { grid-template-columns: 168px minmax(0, 1fr); gap: 0 20px; padding: 18px; }
  .land-about { grid-column: 2; -webkit-line-clamp: 4; line-clamp: 4; }
  .land-tonight .cover { grid-row: 1 / 5; }
  .land-shelf .rail { grid-auto-columns: 184px; }
  .land-own { grid-template-columns: 1fr 1fr; }
  .land-band { padding: 28px 28px 16px; }
}
@media (min-width: 900px) {
  .land { padding-bottom: 40px; }
  .land h2 { font-size: calc(28px * var(--fs, 1)); }
  .land-hero { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 56px; align-items: center; padding-block: 64px 16px; }
  .land h1 { font-size: calc(52px * var(--fs, 1)); line-height: 1.1; }
  .land-lead { font-size: calc(19px * var(--fs, 1)); }
  .land-tonight { grid-template-columns: 224px minmax(0, 1fr); gap: 0 24px; padding: 20px; }
  .land-tonight b { font-size: calc(22px * var(--fs, 1)); }
  .land-about { -webkit-line-clamp: 5; line-clamp: 5; font-size: calc(15px * var(--fs, 1)); }
  .land-shelves, .land-band, .land-faq { margin-top: 88px; }
  .land-shelf { margin-top: 36px; }
  .land-shelf .rail { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; overflow: visible; margin-inline: 0; padding-inline: 0; }
  .land-card b { font-size: calc(16px * var(--fs, 1)); }
  .land-band { padding: 40px 40px 28px; }
  .land-steps { gap: 8px 36px; }
  .land-steps li { font-size: calc(20px * var(--fs, 1)); }
  .land-own { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 24px; padding-top: 16px; }
  .land-own > div { grid-template-columns: minmax(0, 1fr); row-gap: 10px; }
  .land-own svg { grid-row: auto; }
  .land-own dd { grid-column: auto; }
  .land-faq { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); column-gap: 56px; }
  .land-faq h2 { grid-row: 1 / span 6; }
  .land-faq details { grid-column: 2; }
  .land-faq details:nth-of-type(1) { border-top: 1px solid var(--line); }
  .land-foot { margin-top: 72px; }
}
.account { margin-top: 28px; padding-inline: var(--gutter); display: grid; justify-items: center; gap: 4px; }
.news { display: flex; align-items: center; gap: 10px; min-height: 44px; max-width: 46ch; font-size: calc(15px * var(--fs, 1)); color: var(--text-2); cursor: pointer; }
.news input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--link); }
.account button { min-height: 44px; padding-inline: 14px; border-radius: 999px; font-size: calc(15px * var(--fs, 1)); color: var(--text-3); }
@media (hover: hover) { .account button:hover { background: var(--hover); color: var(--text); } }
/* Privacy, accessibility statement and contact: the home page foot and the "no access" screen. */
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 20px; margin-top: 8px; }
.legal-links a { display: inline-flex; align-items: center; min-height: 44px; font-size: calc(15px * var(--fs, 1)); color: var(--link); }
/* The address inside a sentence: block padding makes a 44px target without pushing the lines apart. */
.gate-contact a, .locked-note p a, .locked-hint a { padding-block: 13px; color: var(--link); text-decoration: underline; text-underline-offset: 3px; } /* a link inside a sentence needs more than colour */
.gate-contact { font-size: calc(15px * var(--fs, 1)); }
@media (hover: hover) { :is(.legal-links, .gate-contact, .locked-note, .locked-hint) a:hover { text-decoration: underline; text-underline-offset: 3px; } }
.skeleton { background: var(--surface); border-radius: var(--r-card); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

/* ---------- Buttons used in player ---------- */
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center;
  color: var(--text-2); transition: color .15s, background .15s;
}
@media (hover: hover) { .icon-btn:hover { color: var(--text); background: var(--hover); } }
.icon-btn[aria-pressed="true"] { color: var(--link); }
.play-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent);
  transition: transform .15s var(--ease), background .15s;
}
@media (hover: hover) { .play-btn:hover { background: var(--accent-press); } }
.play-btn:active { transform: scale(.93); }
.play-btn--xl { width: 72px; height: 72px; }
.play-btn--xl svg { width: 34px; height: 34px; }
.chip-btn {
  min-width: 52px; height: 44px; padding-inline: 10px; border-radius: 999px;
  background: var(--surface-2); font-size: calc(14px * var(--fs, 1)); font-weight: 600; font-variant-numeric: tabular-nums;
  direction: ltr; unicode-bidi: isolate;
}
.chip-btn[aria-pressed="true"] { background: var(--sky); color: var(--on-accent); }

/* ---------- Mini player ---------- */
.mini {
  position: fixed; z-index: 25; inset-inline: 8px;
  bottom: calc(var(--tab-h) + var(--safe-b) + 8px);
  height: var(--mini-h); padding-inline: 10px 6px; border-radius: 18px;
  display: flex; align-items: center; gap: 8px; overflow: hidden;
  background: color-mix(in oklab, var(--cat) 26%, var(--mini-base));
  box-shadow: 0 8px 24px var(--shadow);
  animation: rise .35s var(--ease);
}
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
.mini-progress { position: absolute; inset: auto 12px 0 12px; height: 3px; background: var(--track); border-radius: 2px; }
.mini-progress i { display: block; height: 100%; width: 0; background: var(--text); border-radius: 2px; }
.mini-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: start; height: 100%; }
.mini-open:focus-visible { outline-offset: -4px; }
.mini-text { min-width: 0; display: grid; }
.mini-text b, .mini-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-text b { font-weight: 500; font-size: calc(15px * var(--fs, 1)); }
.mini-text small { font-size: calc(12px * var(--fs, 1)); color: var(--text-2); }
.mini-ctl { display: flex; align-items: center; gap: 2px; }
.mini-ctl .icon-btn { color: var(--text); }
.desk { display: none !important; }

/* ---------- Problem report (the "!" beside the heart) ----------
   A native modal <dialog>: a sheet from the bottom on phones, a centred window from 900px. */
.now-acts { display: flex; align-items: center; gap: 4px; flex: none; }
.now .report-btn { width: 48px; height: 48px; }
.report {
  position: fixed; inset: auto 0 0; margin: 0 auto; padding: 0; border: 0;
  width: 100%; max-width: 560px; max-height: calc(100dvh - 24px); overflow-y: auto;
  border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--surface); color: var(--text);
  box-shadow: 0 -12px 40px var(--shadow);
}
.report::backdrop { background: var(--scrim); }
@media (prefers-reduced-motion: no-preference) { .report[open] { animation: sheet .3s var(--ease); } }
.rep-inner { position: relative; display: grid; gap: 14px; padding: 22px var(--gutter) calc(20px + var(--safe-b)); }
.rep-inner > h2 { font-size: calc(20px * var(--fs, 1)); text-align: center; padding-inline: 48px; }
.rep-x { position: absolute; inset-block-start: 8px; inset-inline-end: 8px; }
.rep-sub { margin-top: -8px; text-align: center; font-size: calc(14px * var(--fs, 1)); color: var(--text-2); }
.rep-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 6px; padding-block: 6px 4px; }
.rep-tile { display: grid; justify-items: center; align-content: start; gap: 8px; min-height: 44px; padding: 4px 2px; border-radius: 16px; }
.rep-tile span { font-size: calc(14px * var(--fs, 1)); line-height: 1.3; text-align: center; }
.rep-disc {
  display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; flex: none;
  background: var(--c); border: 4px solid var(--rep-ring); overflow: hidden;
  box-shadow: 0 6px 14px var(--shadow), inset 0 -6px 0 color-mix(in srgb, var(--c) 72%, var(--bg));
}
.rep-disc img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
@media (hover: hover) { .rep-tile:hover .rep-disc { transform: translateY(-2px); } }
@media (prefers-reduced-motion: no-preference) { .rep-disc { transition: transform .2s var(--ease); } }
.rep-tile:active .rep-disc { transform: scale(.94); }
.rep-chosen { display: flex; align-items: center; gap: 12px; font-size: calc(18px * var(--fs, 1)); padding-inline-end: 48px; }
.rep-chosen .rep-disc { width: 48px; height: 48px; border-width: 3px; box-shadow: none; }
.rep-change { justify-self: start; min-height: 44px; margin-top: -10px; color: var(--link); font-size: calc(15px * var(--fs, 1)); font-weight: 500; }
.rep-where { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: calc(15px * var(--fs, 1)); color: var(--text-2); }
.rep-where .num { padding: 4px 10px; border-radius: 12px; background: var(--surface-2); color: var(--text); }
.rep-where small { color: var(--text-3); font-size: calc(13px * var(--fs, 1)); }
.rep-label { font-size: calc(15px * var(--fs, 1)); color: var(--text-2); margin-bottom: -6px; }
.report textarea {
  width: 100%; min-height: 72px; resize: vertical; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-size: calc(16px * var(--fs, 1)); line-height: 1.5;
}
.report textarea::placeholder { color: var(--text-3); }
.report textarea:focus-visible { outline: 2px solid var(--link); outline-offset: 1px; }
.rep-error { color: var(--error-ink); font-size: calc(14px * var(--fs, 1)); }
.rep-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 900px) {
  .report { inset: 0; margin: auto; width: min(640px, calc(100vw - 48px)); max-width: none; height: fit-content; border-radius: var(--r-lg); box-shadow: 0 24px 60px var(--shadow); }
  .rep-inner { padding: 26px 28px 22px; }
  .rep-grid { grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); }
}

/* ---------- Now playing ---------- */
.now {
  position: fixed; inset: 0; z-index: 40; overflow-y: auto;
  background: linear-gradient(to bottom, color-mix(in oklab, var(--cat) 34%, var(--bg)) 0, var(--bg) 62%);
  padding: env(safe-area-inset-top, 0px) var(--gutter) calc(24px + var(--safe-b));
  animation: sheet .35s var(--ease);
}
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
.now-inner { max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.now-head { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.now-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.now-meta h2 { font-size: calc(24px * var(--fs, 1)); line-height: 1.25; }
.now-sub { display: inline-block; padding-block: 10px; font-size: calc(15px * var(--fs, 1)); color: var(--text-2); }
@media (hover: hover) { .now-sub:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; } }
.now .like { width: 48px; height: 48px; }
.now .like[aria-pressed="true"] { color: var(--cat); }
.now-error { padding: 12px 14px; border-radius: 14px; background: rgb(255 107 107 / .14); color: var(--error-ink); font-size: calc(15px * var(--fs, 1)); }
.times { display: flex; justify-content: space-between; font-size: calc(13px * var(--fs, 1)); color: var(--text-2); font-variant-numeric: tabular-nums; margin-top: 4px; }
.transport { display: flex; align-items: center; justify-content: space-between; }
.transport .icon-btn { color: var(--text); }
.transport .icon-btn[data-act="loop"][aria-pressed="true"] { color: var(--link); }
.timer { background: var(--hover); border-radius: 18px; padding: 14px; }
.timer-label { display: flex; align-items: center; gap: 8px; font-size: calc(15px * var(--fs, 1)); font-weight: 600; margin-bottom: 10px; }
.timer-label svg { width: 20px; height: 20px; color: var(--link); }
.timer-label b { margin-inline-start: auto; font-weight: 600; color: var(--link); font-variant-numeric: tabular-nums; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills button { height: 44px; padding-inline: 14px; border-radius: 999px; background: var(--surface-2); font-size: calc(14px * var(--fs, 1)); font-weight: 500; }
.pills button[aria-pressed="true"] { background: var(--sky); color: var(--on-accent); font-weight: 600; }

/* ---------- Range scrubber (always LTR: media timeline) ---------- */
.scrub {
  --p: 0%;
  -webkit-appearance: none; appearance: none; width: 100%; height: 24px; margin: 0; background: transparent; cursor: pointer;
}
.scrub::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--text) var(--p), var(--track) var(--p)); }
.scrub::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--text) var(--p), var(--track) var(--p)); }
.scrub::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -5px; border-radius: 50%; background: var(--text); border: 0; }
.scrub::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--text); border: 0; }
.scrub:focus-visible { outline-offset: 4px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 45; inset-inline: 0; margin-inline: auto; width: max-content; max-width: calc(100% - 32px);
  bottom: calc(var(--tab-h) + var(--mini-h) + 24px + var(--safe-b));
  padding: 10px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: calc(15px * var(--fs, 1)); font-weight: 500;
  opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s, transform .2s var(--ease);
}
.toast.show { opacity: 1; transform: none; }
/* Over the now-playing sheet, keep the toast clear of the controls (under the sheet header). */
.now:not([hidden]) ~ .toast { bottom: auto; top: calc(env(safe-area-inset-top, 0px) + 64px); }

/* ---------- Search ---------- */
.search {
  position: relative; display: flex; align-items: center; gap: 10px;
  margin: 8px var(--gutter) 4px; height: 52px; padding-inline: 16px 6px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--text-3); color: var(--text-3);
}
.search:focus-within { border-color: var(--link); }
.search > svg { width: 22px; height: 22px; flex: none; }
.search input {
  flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none;
  font: inherit; font-size: calc(17px * var(--fs, 1)); color: var(--text);
}
.search input::placeholder { color: var(--text-3); }
/* dir="auto" resolves an empty field to LTR; keep the placeholder on the page's side until the user types. */
html[dir="rtl"] .search input:placeholder-shown { direction: rtl; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.search-clear { width: 44px; height: 44px; flex: none; }
.search--link { text-decoration: none; font-size: calc(16px * var(--fs, 1)); }
.search--link span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (hover: hover) { .search--link:hover { border-color: var(--text-2); } }
mark { background: color-mix(in oklab, var(--cat) 34%, transparent); color: inherit; border-radius: 4px; padding-inline: 2px; }

/* ---------- Results bar + view toggle ---------- */
.results-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px var(--gutter) 0; }
.results-count { min-width: 0; overflow-wrap: anywhere; font-size: calc(15px * var(--fs, 1)); color: var(--text-2); }
.view-toggle { display: flex; gap: 2px; padding: 2px; border-radius: 14px; background: var(--surface); flex: none; }
.view-toggle .icon-btn { border-radius: 12px; }
.view-toggle .icon-btn[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }

/* ---------- List rows ---------- */
.lrows { padding: 8px var(--gutter) 0; }
.lrow {
  display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.lrow-art { display: block; border-radius: 16px; }
.lrow-art .cover { width: 72px; border-radius: 16px; }
.lrow-text { min-width: 0; }
.lrow-title { display: block; font-size: calc(17px * var(--fs, 1)); font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.lrow .card-meta { margin-top: 2px; }
.lrow-desc {
  margin-top: 4px; font-size: calc(14px * var(--fs, 1)); line-height: 1.55; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lrow-actions { display: flex; align-items: center; gap: 8px; }
.lrow.is-live .lrow-title { color: var(--cat); }

/* ---------- Top bar actions (theme + language) ---------- */
.top-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.top-btn { color: var(--text-2); background: var(--surface); }
.lang .short { display: none; }
@media (max-width: 419px) {
  .lang { min-width: 44px; padding-inline: 10px; }
  .lang .long { display: none; }
  .lang .short { display: inline; }
}

/* Day ink: category colours used as text or small icons get a darker mix so they pass contrast on white. */
:root[data-theme="light"] :is(.card.is-live .card-title, .row.is-live b, .lrow.is-live .lrow-title, .story-actions .like[aria-pressed="true"], .now .like[aria-pressed="true"]) {
  color: color-mix(in srgb, var(--cat) 45%, #14162b);
}

/* ---------- Speed pills (numbers stay LTR inside RTL pages) ---------- */
.pills--num button { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; min-width: 48px; padding-inline: 10px; }
.now-head-end { display: flex; gap: 4px; }

/* ---------- Reading (book) mode ---------- */
body.reading .mini { display: none !important; }
body.reading .topbar { background: var(--bg); } /* big book text must not show through the sticky header */
body.reading main { padding-bottom: calc(132px + var(--safe-b)); }
.read { padding: 4px var(--gutter) 0; }
/* The listen / read switch stays under the top bar while the text scrolls */
.read .mode-row {
  position: sticky; top: calc(60px + env(safe-area-inset-top, 0px)); z-index: 10;
  margin: 0 calc(var(--gutter) * -1) 6px; padding: 0 var(--gutter) 6px; background: var(--bg);
}
.read-head { max-width: 34em; margin: 0 auto 16px; }
.read-head h1 { font-size: calc(26px * var(--fs, 1)); line-height: 1.25; }
.read-sub { margin-top: 4px; font-size: calc(15px * var(--fs, 1)); color: var(--text-2); }
.read-hint { margin-top: 8px; font-size: calc(14px * var(--fs, 1)); color: var(--text-3); }
.read-page {
  max-width: 34em; margin: 0 auto; padding: 24px 20px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
  font-family: "Frank Ruhl Libre", Rubik, serif; font-size: calc(var(--read-size, 26px) * var(--fs, 1)); line-height: 1.95;
  color: var(--transcript-ink);
}
.read-page p { margin: 0 -10px; padding: 6px 10px; border-radius: 14px; cursor: pointer; transition: color .5s, background-color .5s; }
.read-page p + p { margin-top: .5em; }
.read-page.is-following p { color: var(--text-3); }
.read-page.is-following p.is-now { color: var(--transcript-ink); background: color-mix(in oklab, var(--cat) 16%, transparent); }
@media (hover: hover) { .read-page p:hover { background: var(--hover); } }
.read-page p:focus-visible { outline-offset: 0; }
.read-page .read-empty { color: var(--text-2); cursor: default; background: none; }
.read-bar {
  position: fixed; inset: auto 0 calc(var(--tab-h) + var(--safe-b)) 0; z-index: 26;
  padding: 10px var(--gutter); background: var(--bar-bg); border-top: 1px solid var(--line);
}
.read-row { display: flex; align-items: center; gap: 10px; max-width: 760px; margin: 0 auto; }
.read-progress { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: calc(12px * var(--fs, 1)); color: var(--text-2); font-variant-numeric: tabular-nums; }
.read-rate { margin-inline-start: auto; }
.read-progress:not([hidden]) + .read-rate { margin-inline-start: 0; }
.read-size { display: flex; gap: 2px; }
.read-size .icon-btn { font-size: calc(16px * var(--fs, 1)); font-weight: 700; color: var(--text); }
.read-bar { display: flex; flex-direction: column-reverse; } /* speed panel follows the row in tab order, shows above it */
.read-speed { width: 100%; max-width: 760px; margin: 0 auto 10px; justify-content: center; }
.read-other { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: calc(14px * var(--fs, 1)); color: var(--text-2); }
.read-other-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.read-other:not([hidden]) + .read-rate { margin-inline-start: 0; }
/* Keep focused or auto-scrolled paragraphs clear of the sticky header and the fixed bars. */
html:has(body.reading) { scroll-padding-block: 132px calc(var(--tab-h) + 96px + var(--safe-b)); }
body.reading:has(#read-speed:not([hidden])) main { padding-bottom: calc(260px + var(--safe-b)); }
@media (max-width: 419px) {
  .read-row { flex-wrap: wrap; row-gap: 6px; }
  .read-progress { flex-basis: 100%; order: -1; }
  body.reading main { padding-bottom: calc(176px + var(--safe-b)); }
  html:has(body.reading) { scroll-padding-block: 132px calc(var(--tab-h) + 120px + var(--safe-b)); }
}

/* ---------- Sleep sounds ---------- */
:root[data-theme="light"] .nav-dot { background: var(--link); }
.nav-dot { position: absolute; top: 10px; inset-inline-start: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--sky); }
.pills a { display: inline-flex; align-items: center; height: 44px; padding-inline: 14px; border-radius: 999px; background: var(--surface-2); font-size: calc(14px * var(--fs, 1)); font-weight: 500; }
.sounds-intro { margin-top: 2px; }
.sounds-hero { display: flex; align-items: center; gap: 16px; padding: 16px var(--gutter) 8px; }
.sounds-status { font-size: calc(17px * var(--fs, 1)); font-weight: 600; color: var(--text-2); }
.mixer { display: grid; gap: 10px; padding: 8px var(--gutter) 0; }
.mix { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; align-items: center; padding: 12px 14px; border-radius: var(--r-card); background: var(--surface); }
.mix-icon { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; color: var(--text-3); background: var(--surface-2); transition: background-color .25s, color .25s; }
.mix-icon svg { width: 28px; height: 28px; }
.mix.is-on .mix-icon { color: var(--text); background: color-mix(in oklab, var(--cat) 30%, var(--surface)); }
.mix-body { display: grid; gap: 4px; min-width: 0; }
.mix-name { font-size: calc(16px * var(--fs, 1)); font-weight: 600; }
.vol { --p: 0%; --fill-dir: to right; -webkit-appearance: none; appearance: none; width: 100%; height: 44px; margin: 0; background: transparent; cursor: pointer; }
.vol:dir(rtl) { --fill-dir: to left; }
.vol::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(var(--fill-dir), var(--vol-fill, var(--cat)) var(--p), var(--track) var(--p)); }
.vol::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(var(--fill-dir), var(--vol-fill, var(--cat)) var(--p), var(--track) var(--p)); }
.vol::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: var(--text); border: 0; }
.vol::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--text); border: 0; }
:root[data-theme="light"] .vol { --vol-fill: color-mix(in srgb, var(--cat) 45%, #14162b); }
.sound-settings .timer { margin: 16px var(--gutter) 0; }
.ios-note { margin-top: 12px; font-size: calc(13px * var(--fs, 1)); color: var(--text-3); }
@media (min-width: 640px) { .mixer { grid-template-columns: 1fr 1fr; } }

/* ---------- Desktop ---------- */
/* 900–1023 px: five tabs + theme + language don't fit beside the full wordmark; keep the mark only. */
@media (min-width: 900px) and (max-width: 1023px) { .topbar .brand { font-size: 0; gap: 0; } }
@media (min-width: 900px) {
  :root { --gutter: 40px; --mini-h: 84px; }
  .topbar { height: 72px; }
  .nav {
    position: static; display: flex; gap: 4px; height: auto; padding: 0; background: none; border: 0;
    margin-inline-end: auto; margin-inline-start: 24px;
  }
  .nav a { flex-direction: row; gap: 8px; height: 40px; padding-inline: 14px; border-radius: 999px; font-size: calc(15px * var(--fs, 1)); color: var(--text-2); }
  @media (hover: hover) { .nav a:hover { color: var(--text); background: var(--surface); } }
  .nav a[aria-current="page"] { background: var(--surface); }
  .nav svg { width: 20px; height: 20px; }
  .nav-count { position: static; }
  .nav-dot { position: static; }
  main { padding-bottom: calc(var(--mini-h) + 48px); max-width: 1200px; margin-inline: auto; }
  .page-title { font-size: calc(36px * var(--fs, 1)); padding-top: 28px; }
  .rail { grid-auto-columns: 184px; gap: 20px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); gap: 32px 20px; }
  /* A small library (2–3 stories) shows wide cards with a description instead of a mostly empty grid. */
  .grid--few { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .grid--few .card { display: grid; grid-template-columns: 168px minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: 20px; padding: 16px; border-radius: var(--r-lg); background: var(--surface); }
  .grid--few .card-art { grid-row: 1 / 4; }
  .grid--few .card-title { margin-top: 4px; font-size: calc(19px * var(--fs, 1)); font-weight: 600; }
  .grid--few .card-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: 8px; font-size: calc(15px * var(--fs, 1)); line-height: 1.6; color: var(--text-2); }
  .grid--few .card-meta { grid-column: 2; grid-row: 2; margin-top: 4px; padding-top: 0; }
  .grid--few .add:not([aria-pressed="true"]) { background: var(--surface-2); }
  .grid--few .card-desc { grid-column: 2; grid-row: 3; align-self: start; }
  .segmented { max-width: 480px; margin-inline: var(--gutter); }
  .feature {
    grid-template-columns: 220px minmax(0, 1fr); grid-template-rows: 1fr auto auto 1fr; column-gap: 32px; row-gap: 20px;
    padding: 24px; margin-top: 12px;
  }
  .feature > a { grid-column: 1; grid-row: 1 / 5; }
  .feature-text { grid-column: 2; grid-row: 2; }
  .feature-actions { grid-column: 2; grid-row: 3; }
  .feature .cover--md { width: 220px; border-radius: 24px; }
  .feature h3 { font-size: calc(36px * var(--fs, 1)); }
  .feature .desc { display: block; margin-top: 12px; max-width: 60ch; color: var(--text-2); font-size: calc(16px * var(--fs, 1)); }
  .feature-actions .btn--grow { flex: none; }
  .story-top { grid-template-columns: 300px 1fr; gap: 40px; align-items: end; }
  .story-top .cover { width: 300px; }
  body.reading main { padding-bottom: calc(120px + var(--safe-b)); }
  .read-bar { inset: auto 0 0 0; }
  .read-head h1 { font-size: calc(34px * var(--fs, 1)); }
  .read-page { padding: 40px 48px; }
  html:has(body.reading) { scroll-padding-block: 144px 104px; }
  .lrow { grid-template-columns: 96px minmax(0, 1fr) auto; gap: 20px; padding: 16px 0; }
  .lrow-art .cover { width: 96px; border-radius: 18px; }
  .lrow-title { font-size: calc(19px * var(--fs, 1)); }
  .lrow-desc { font-size: calc(15px * var(--fs, 1)); max-width: 80ch; }
  .search { max-width: 640px; }
  .story h1 { font-size: calc(40px * var(--fs, 1)); }
  .story-actions .btn--grow { flex: none; }
  .icon-btn.desk { display: inline-grid !important; }
  .mini {
    inset-inline: 0; bottom: 0; height: var(--mini-h); border-radius: 0; padding-inline: 20px;
    display: grid; grid-template-columns: minmax(200px, 1fr) minmax(320px, 560px) minmax(200px, 1fr);
    grid-template-rows: auto auto; column-gap: 24px; row-gap: 0;
    background: var(--bar-bg); border-top: 1px solid var(--line); box-shadow: none;
  }
  .mini-progress { display: none; }
  .mini-open { grid-row: 1 / 3; }
  .cover--sm { width: 56px; }
  .mini-ctl { grid-column: 2; justify-self: center; align-self: end; gap: 8px; }
  .mini-scrub { grid-column: 2; display: flex !important; align-items: center; gap: 10px; font-size: calc(12px * var(--fs, 1)); color: var(--text-2); font-variant-numeric: tabular-nums; }
  .mini-extra { grid-column: 3; grid-row: 1 / 3; display: flex !important; align-items: center; justify-content: flex-end; gap: 8px; }
  .toast { bottom: calc(var(--mini-h) + 24px); }
  .now { display: grid; place-items: center; }
  .now-inner { width: 100%; }
}

@media (max-width: 359px) {
  .topbar { gap: 8px; }
  .brand { font-size: 18px; }
  .transport .icon-btn { width: 36px; }
  .play-btn--xl { width: 60px; height: 60px; }
  .transport .chip-btn { min-width: 44px; }
  .feature { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Admin ---------- */
.admin .topbar { gap: 8px; }
@media (max-width: 559px) {
  .admin-tag { display: none; }
  .admin .lang { padding-inline: 12px; }
  .admin .brand { font-size: 0; gap: 0; } /* icon only; the link text stays for screen readers */
}
.nav[hidden] { display: none; }
.admin-tag { font-size: calc(14px * var(--fs, 1)); font-weight: 600; color: var(--on-accent); background: var(--sky); padding: 4px 10px; border-radius: 999px; }
.spacer { flex: 1; }
.admin-main { max-width: 920px; margin-inline: auto; padding: 16px var(--gutter) calc(var(--tab-h) + 32px + var(--safe-b)); display: grid; gap: 20px; }
.panel { background: var(--surface); border-radius: var(--r-lg); padding: 20px; display: grid; gap: 16px; }
.panel h1 { font-size: calc(24px * var(--fs, 1)); }
.panel h2 { font-size: calc(20px * var(--fs, 1)); }
.field { display: grid; gap: 6px; font-size: calc(15px * var(--fs, 1)); font-weight: 500; }
.field input:not([type="file"]), .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--text-3); background: var(--bg); color: var(--text);
  font: inherit; font-weight: 400; line-height: 1.6;
}
.field textarea { resize: none; field-sizing: content; min-height: 6lh; max-height: 60vh; }
.field select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23b9bedc' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center / 20px;
  padding-inline-end: 44px;
}
.field select:dir(rtl) { background-position: left 14px center; }
:root[data-theme="light"] .field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23474c6e' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--link); outline-offset: 1px; border-color: transparent; }
.field input[type="file"] { font-size: calc(14px * var(--fs, 1)); color: var(--text-2); }
.field input[type="file"]::file-selector-button { font: inherit; font-weight: 600; margin-inline-end: 12px; padding: 8px 14px; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--text); cursor: pointer; }
.field-note { font-size: calc(14px * var(--fs, 1)); font-weight: 400; color: var(--text-2); }
.cols { display: grid; gap: 16px; }
.drop {
  position: relative; display: grid; gap: 4px; place-items: center; text-align: center;
  padding: 24px 16px; border-radius: 16px; border: 2px dashed var(--line); background: var(--bg); cursor: pointer;
}
.drop:focus-within { border-color: var(--link); }
@media (hover: hover) { .drop:hover { border-color: var(--link); } }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop b { font-weight: 600; overflow-wrap: anywhere; }
.drop small { color: var(--text-3); font-size: calc(13px * var(--fs, 1)); }
.form-error { padding: 12px 14px; border-radius: 12px; background: rgb(255 107 107 / .14); color: var(--error-ink); font-size: calc(15px * var(--fs, 1)); }
.progress { height: 8px; border-radius: 4px; background: var(--bg); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--link); transition: width .2s; }
.form-actions { display: flex; gap: 10px; }
#panel:not([hidden]) { display: grid; gap: 20px; }
.admin-list { list-style: none; margin: 0; padding: 0; }
.admin-row { display: grid; grid-template-columns: 64px 1fr; gap: 12px 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.admin-row .cover { width: 64px; border-radius: 14px; }
.admin-row .row-text { display: grid; }
.admin-row small { color: var(--text-2); font-size: calc(13px * var(--fs, 1)); }
.admin-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
/* The sign-in button is the one long label here: at 320px in English it takes two lines, so it grows instead of squeezing them. */
#login .btn { height: auto; min-height: 48px; padding-block: 8px; text-align: center; }
.admin-row--user, .admin-row--report { grid-template-columns: 1fr; }
.admin-row--report .row-text { gap: 4px; }
.admin-row--report .row-text b { white-space: normal; overflow: visible; text-overflow: clip; }
.admin-row--report a { color: var(--link); }
.report-word { padding: 8px 12px; border-radius: 12px; background: var(--surface-2); color: var(--text); font-size: calc(15px * var(--fs, 1)); overflow-wrap: anywhere; }
.note {
  width: 100%; min-height: 44px; margin-top: 8px; padding: 8px 12px; border-radius: 12px;
  border: 1px solid var(--text-3); background: var(--bg); color: var(--text); font: inherit; font-size: calc(15px * var(--fs, 1));
}
.note::placeholder { color: var(--text-3); }
.note:focus-visible { outline: 3px solid var(--link); outline-offset: 1px; border-color: transparent; }
/* Overview: plain figures in one panel, no tiles; the numbers are the content. */
.panel h3 { font-size: calc(15px * var(--fs, 1)); font-weight: 600; color: var(--text-2); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; margin: 0; }
.figures div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.figures dt { font-size: calc(13px * var(--fs, 1)); color: var(--text-2); }
.figures dd { margin: 0; font-size: calc(20px * var(--fs, 1)); font-weight: 700; }
/* admin overview: sign out on every device */
.everywhere { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-block-start: 20px; color: var(--text-2); font-size: calc(14px * var(--fs, 1)); }
.top-list { list-style: none; margin: 8px 0 0; padding: 0; counter-reset: top; }
.top-list li { counter-increment: top; display: grid; grid-template-columns: 2ch minmax(0, 1fr) auto; gap: 10px; padding: 8px 0; font-size: calc(15px * var(--fs, 1)); }
.top-list li::before { content: counter(top); color: var(--text-3); font-variant-numeric: tabular-nums; }
.top-list li.hint { display: block; padding: 4px 0; }
.top-list li.hint::before { content: none; }
.top-list .top-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-list .num { color: var(--text-2); }
.user-tools { display: grid; gap: 10px; }
.user-tools .search { margin: 0; height: 48px; border-radius: 12px; background: var(--bg); }
.user-tools .segmented, #report-filter { margin: 0; max-width: 360px; background: var(--bg); }
.user-tools .segmented button { font-size: calc(13px * var(--fs, 1)); }
.user-tools .segmented .num, #report-filter .num { color: var(--text-3); }
.user-tools .segmented [aria-pressed="true"] .num, #report-filter [aria-pressed="true"] .num { color: inherit; }
.user-tools .field--inline select { min-height: 48px; }
/* Insights. One data colour (the Sky link ink of each theme) on every chart; orange stays for actions.
   Time and hour axes run left to right in both languages, like the player's timeline. */
.insights, .overview { display: grid; gap: 20px; }
.ins-window { margin: 0; font-size: calc(15px * var(--fs, 1)); color: var(--text-2); }
.ins-note { margin: 6px 0 0; max-width: 60ch; font-size: calc(15px * var(--fs, 1)); color: var(--text-2); }
:is(.insights, .overview) .panel > div > h3 { margin-bottom: 8px; }
.chart { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 8px; margin: 0; padding-top: 18px; } /* room for the peak label */
.chart-y { display: flex; flex-direction: column; justify-content: space-between; height: 132px; font-size: calc(13px * var(--fs, 1)); line-height: 1; color: var(--text-3); text-align: end; }
.chart-plot { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); height: 132px; border-bottom: 1px solid var(--line); }
.chart .col { display: flex; align-items: flex-end; justify-content: center; }
.chart .col i { position: relative; width: calc(100% - 2px); max-width: 24px; height: calc(var(--v) * 100%); border-radius: 4px 4px 0 0; background: var(--link); }
.chart .col b { position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%); font-size: calc(13px * var(--fs, 1)); font-weight: 600; font-style: normal; color: var(--text); }
@media (hover: hover) { .chart .col:hover { background: var(--hover); } }
.chart-x { grid-column: 2; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); font-size: calc(13px * var(--fs, 1)); color: var(--text-3); }
.chart-x span { grid-row: 1; grid-column: calc(var(--i) + 1); justify-self: center; white-space: nowrap; }
.chart figcaption { grid-column: 1 / -1; margin-top: 4px; font-size: calc(13px * var(--fs, 1)); color: var(--text-2); }
.chart-table { margin-top: 6px; font-size: calc(13px * var(--fs, 1)); color: var(--text-2); }
.chart-table summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; color: var(--link); }
.chart-table table { border-collapse: collapse; }
.chart-table th, .chart-table td { padding: 4px 16px 4px 0; text-align: start; font-weight: 400; }
.chart-table th { color: var(--text-3); }
.hbars, .share-links, .group-list { list-style: none; margin: 0; padding: 0; }
.hbars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; padding: 8px 0; font-size: calc(15px * var(--fs, 1)); }
.hb-label { display: grid; min-width: 0; }
.hb-label > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-label small { font-size: calc(13px * var(--fs, 1)); color: var(--text-3); }
.hb-val { color: var(--text-2); white-space: nowrap; }
.hb-track { grid-column: 1 / -1; grid-row: 2; height: 8px; border-radius: 4px; background: var(--track); }
.hb-track i { display: block; width: calc(var(--v) * 100%); min-width: 4px; height: 100%; border-radius: 4px; background: var(--link); }
.split { display: grid; gap: 16px; }
/* One listener's page */
.back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: calc(15px * var(--fs, 1)); font-weight: 500; color: var(--link); justify-self: start; }
.back-link::before { content: "‹"; font-size: calc(20px * var(--fs, 1)); line-height: 1; }
[dir="rtl"] .back-link::before { content: "›"; }
.user-mail { display: inline-flex; align-items: center; min-height: 44px; font-size: calc(15px * var(--fs, 1)); color: var(--link); overflow-wrap: anywhere; }
.figures--text dd { font-size: calc(16px * var(--fs, 1)); font-weight: 600; overflow-wrap: anywhere; }
.row-text b a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
@media (hover: hover) { .row-text b a:hover { text-decoration-color: var(--link); } }
.recent { list-style: none; margin: 0; padding: 0; }
.recent li { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: calc(15px * var(--fs, 1)); }
.recent li > span:first-child { color: var(--text-3); font-size: calc(13px * var(--fs, 1)); align-self: center; }
.recent li > span:nth-child(2) { color: var(--text-2); }
.recent-story { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent a { color: var(--text); font-weight: 600; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
@media (hover: hover) { .recent a:hover { text-decoration-color: var(--link); } }
.recent .recent-muted { color: var(--text-2); }
.recent--wrap .recent-story { white-space: normal; overflow-wrap: anywhere; } /* today's stories: every one is shown */
.recent--wrap li > span:first-child { align-self: start; }
.recent--wrap .recent-story > span { display: block; padding-block: 2px; }
.recent--wrap .recent-story .num { color: var(--text-3); font-size: calc(13px * var(--fs, 1)); }
@media (max-width: 559px) { .recent li { grid-template-columns: auto minmax(0, 1fr); } .recent-story { grid-column: 1 / -1; } }
.share-links li, .group-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: calc(15px * var(--fs, 1)); }
.share-links code { grid-column: 1 / -1; grid-row: 2; min-width: 0; overflow-wrap: anywhere; font: inherit; font-size: calc(13px * var(--fs, 1)); color: var(--text-2); text-align: start; }
.share-links li { grid-template-columns: minmax(0, 1fr) auto; }
.group-list b { font-weight: 700; }
.panel .results-count { margin: 0; }
.panel .results-count:empty { display: none; }
.admin-row--user small { overflow-wrap: anywhere; }
.admin-row .tier { color: var(--link); font-weight: 500; }
.btn--sm { height: 44px; padding-inline: 14px; font-size: calc(14px * var(--fs, 1)); }
.btn--danger { color: var(--error-ink); }
@media (hover: hover) { .btn--danger:hover { background: rgb(255 107 107 / .18); } }
@media (min-width: 720px) {
  .cols { grid-template-columns: 1fr 1fr; }
  .admin-row { grid-template-columns: 64px 1fr auto; }
  .admin-row--user, .admin-row--report { grid-template-columns: minmax(0, 1fr) auto; }
  .figures { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .user-tools { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .split { grid-template-columns: 1fr 1fr; gap: 32px; }
  .user-tools .segmented button { padding-inline: 14px; }
  .admin-actions { grid-column: auto; }
}
.drop--sm { padding: 16px; }

/* ---------- Locked stories (free accounts) ---------- */
.locked-section { margin-top: 28px; }
.locked-hint { margin: -4px 0 12px; max-width: 60ch; color: var(--text-2); font-size: calc(15px * var(--fs, 1)); }
.card--locked .cover { opacity: .55; }
.card-lock {
  position: absolute; bottom: 8px; inset-inline-end: 8px;
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-2); pointer-events: none;
}
.card-lock svg { width: 20px; height: 20px; }
.locked-note {
  margin-top: 18px; padding: 16px; border-radius: var(--r-card); background: var(--surface);
  display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; align-items: start; max-width: 52ch;
}
.locked-note > svg { width: 24px; height: 24px; margin-top: 2px; color: var(--text-2); }
.locked-note h2 { font-size: calc(17px * var(--fs, 1)); font-weight: 600; }
.locked-note p { margin-top: 4px; color: var(--text-2); font-size: calc(15px * var(--fs, 1)); }
.locked-note .btn { grid-column: 1 / -1; justify-self: start; }

/* ---------- Public story pages (/stories/…, generated by test/browser/story-pages.mjs; one language per page) ---------- */
.pub { max-width: 960px; margin-inline: auto; padding: 8px var(--gutter) calc(40px + var(--safe-b)); }
.pub-back { display: inline-flex; align-items: center; min-height: 44px; font-size: calc(15px * var(--fs, 1)); font-weight: 500; color: var(--link); }
.pub-story { display: grid; gap: 24px; margin-top: 8px; }
.pub-story .cover { width: min(100%, 320px); }
.pub-text { min-width: 0; }
.pub .land-cat { margin-top: 0; font-size: calc(14px * var(--fs, 1)); }
.pub h1 { margin-top: 8px; font-size: calc(clamp(28px, 7.6vw, 34px) * var(--fs, 1)); font-weight: 700; line-height: 1.18; text-wrap: balance; overflow-wrap: anywhere; }
.pub-about { margin-top: 14px; max-width: 62ch; font-size: calc(17px * var(--fs, 1)); line-height: 1.7; color: var(--text-2); }
.pub .btn { height: auto; min-height: 52px; margin-top: 24px; padding-block: 10px; text-align: center; line-height: 1.3; }
.pub-head { padding-top: 20px; }
.pub-shelf { margin-top: 48px; }
.pub-shelf h2 { display: flex; align-items: center; gap: 10px; font-size: calc(20px * var(--fs, 1)); font-weight: 700; }
.pub-shelf h2::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--cat); }
.pub-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; column-gap: 32px; }
.pub-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.pub-list a { flex: 1; display: flex; align-items: center; min-height: 48px; padding-block: 8px; font-size: calc(16px * var(--fs, 1)); font-weight: 500; line-height: 1.35; }
.pub-list small { flex: none; font-size: calc(13px * var(--fs, 1)); color: var(--text-3); font-variant-numeric: tabular-nums; }
.pub-langs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 48px; }
.pub-langs .lang { display: inline-flex; align-items: center; }
.pub-langs [aria-current] { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--text-2); }
.pub .land-foot { margin-top: 24px; }
@media (hover: hover) { .pub-back:hover, .pub-list a:hover { text-decoration: underline; text-underline-offset: 3px; } }
@media (min-width: 640px) {
  .pub-story { grid-template-columns: 240px minmax(0, 1fr); gap: 32px; align-items: start; }
  .pub-story .cover { width: 100%; }
  .pub-list { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .pub { padding-top: 24px; }
  .pub-story { grid-template-columns: 320px minmax(0, 1fr); gap: 48px; }
  .pub h1 { font-size: calc(44px * var(--fs, 1)); line-height: 1.12; }
  .pub-list { grid-template-columns: repeat(3, 1fr); }
  .pub-shelf { margin-top: 64px; }
}

/* ---------- Privacy page (static: the pre-paint script sets <html lang>, and only that language shows) ---------- */
.by-lang > [lang] { display: none; }
:root[lang="he"] .by-lang > [lang="he"], :root[lang="en"] .by-lang > [lang="en"], :root[lang="fr"] .by-lang > [lang="fr"] { display: revert; }
.legal { max-width: 68ch; margin-inline: auto; padding: 8px var(--gutter) 64px; }
.legal-langs { display: flex; flex-wrap: wrap; gap: 8px; }
.legal-langs .lang { display: inline-flex; align-items: center; }
.legal h1 { margin-top: 24px; font-size: calc(28px * var(--fs, 1)); font-weight: 700; }
.legal h2 { margin-top: 28px; font-size: calc(20px * var(--fs, 1)); font-weight: 700; }
.legal p { margin-top: 8px; color: var(--text-2); }
.legal-back { display: inline-flex; align-items: center; min-height: 44px; margin-top: 16px; color: var(--link); font-weight: 500; }

/* ---------- Accessibility menu (js/a11y.js): one data-a11y-* attribute on <html> per choice ---------- */
/* Larger text: sizes are px, so every font-size above is multiplied by --fs (the wordmark is a logo and stays). */
:root[data-a11y-text="1"] { --fs: 1.15; }
:root[data-a11y-text="2"] { --fs: 1.3; }
:root[data-a11y-text] .feature-actions { flex-wrap: wrap; }
:root[data-a11y-text] .segmented button { height: auto; min-height: 44px; padding: 4px 6px; line-height: 1.25; } /* a long French label wraps to two lines */
/* High contrast: new token values only. Never a filter on the root: it would unpin the fixed player and bars. */
:root[data-a11y-contrast]:not([data-theme="light"]) {
  --bg: #000000; --surface: #14162b; --surface-2: #262a52; --line: #9aa0c8;
  --text-2: #ffffff; --text-3: #dfe2f5; --link: #8fdcff;
  --topbar-bg: #000000; --bar-bg: #000000; --mini-base: #14162b;
  --hover: rgb(255 255 255 / .14); --track: rgb(255 255 255 / .4); --transcript-ink: #ffffff;
}
:root[data-a11y-contrast][data-theme="light"] {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #e3e6f5; --line: #474c6e;
  --text: #000000; --text-2: #14162b; --text-3: #2a2e55; --link: #06476e;
  --topbar-bg: #ffffff; --bar-bg: #ffffff; --mini-base: #ffffff;
  --hover: rgb(20 22 43 / .1); --track: rgb(20 22 43 / .35); --error-ink: #8a1a10; --transcript-ink: #000000;
}
:root[data-a11y-contrast][data-theme="light"] :is(.card.is-live .card-title, .row.is-live b, .lrow.is-live .lrow-title, .story-actions .like[aria-pressed="true"], .now .like[aria-pressed="true"]) {
  color: color-mix(in srgb, var(--cat) 25%, #14162b);
}
:root[data-a11y-contrast][data-theme="light"] .vol { --vol-fill: color-mix(in srgb, var(--cat) 25%, #14162b); }
/* Surfaces that sit on a ground of nearly the same colour get an edge. */
:root[data-a11y-contrast] :is(.btn, .lang, .top-btn, .chip, .chip-btn, .segmented, .pills button, .pills a, .feature, .tile, .timer, .mini, .search):not(:focus-visible, :focus-within) { outline: 1px solid var(--line); outline-offset: -1px; }
:root[data-a11y-font] { font-family: Arial, "Noto Sans Hebrew", system-ui, sans-serif; }
:root[data-a11y-font] .read-page { font-family: inherit; }
:root[data-a11y-links] a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
:root[data-a11y-headings] :is(h1, h2, h3) { outline: 2px solid var(--link); outline-offset: 4px; border-radius: 4px; }
:root[data-a11y-headings] .page-title { outline-offset: -2px; } /* full-width box with its own padding: keep the frame inside it, clear of the sticky top bar */
:root[data-a11y-motion] *, :root[data-a11y-motion] *::before, :root[data-a11y-motion] *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }

.a11y { display: flex; flex: none; }
.a11y-btn[aria-expanded="true"] { color: var(--link); }
/* The top bar is sticky with its own layer; lift it over the mini player and reading bar while the menu is open. */
.topbar:has(.a11y-panel:not([hidden])) { z-index: 35; }
.a11y-panel {
  position: fixed; inset-block-start: calc(68px + env(safe-area-inset-top, 0px)); inset-inline-end: 8px;
  width: min(320px, calc(100vw - 16px));
  max-height: calc(100dvh - 84px - env(safe-area-inset-top, 0px) - var(--tab-h) - var(--mini-h) - var(--safe-b)); /* ends above the mini player */
  overflow-y: auto; overscroll-behavior: contain;
  padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 8px 24px var(--shadow);
}
body.reading .a11y-panel { max-height: calc(100dvh - 84px - env(safe-area-inset-top, 0px) - var(--tab-h) - 132px - var(--safe-b)); } /* the reading bar is taller than the mini player */
.a11y-title { margin-bottom: 10px; font-size: calc(15px * var(--fs, 1)); font-weight: 600; color: var(--text-2); }
.a11y-panel .pills button { height: auto; min-height: 44px; padding-block: 6px; }
.a11y-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 8px; margin-top: 8px; }
.a11y-foot :is(button, a) { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 4px; font-size: calc(15px * var(--fs, 1)); color: var(--link); }
@media (hover: hover) { .a11y-foot :is(button, a):hover { text-decoration: underline; text-underline-offset: 3px; } }
@media (min-width: 900px) { .a11y-panel { inset-block-start: calc(80px + env(safe-area-inset-top, 0px)); inset-inline-end: var(--gutter); } }
/* 320 px: the longer English and French wordmarks need to shrink to leave room for the menu button. */
@media (max-width: 359px) { :root:not([lang="he"]) .topbar:has(.a11y) .brand { font-size: 14px; gap: 6px; } }
/* With the menu button in the bar, the full wordmark fits beside five tabs only from 1100 px (was 1024). */
@media (min-width: 1024px) and (max-width: 1099px) { .topbar:has(.a11y) .brand { font-size: 0; gap: 0; } }
/* Desktop with larger text: the five tab labels keep their room by dropping their icons. */
@media (min-width: 900px) { :root[data-a11y-text] .nav svg { display: none; } }
