:root {
  --bg: #ffffff;
  --sidebar: #f9f9f9;
  --surface: #ffffff;
  --raised: #f4f4f5;
  --hover: rgba(0, 0, 0, 0.05);
  --press: rgba(0, 0, 0, 0.08);
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.14);
  --text: #0d0d0d;
  --text-2: #5f5f66;
  --text-3: #6b6b70;
  --accent: #0066cc;
  --accent-press: #0058b0;
  --accent-soft: rgba(0, 102, 204, 0.1);
  --on-accent: #ffffff;
  --ok: #34c759;
  --busy: #ff9f0a;
  --bad: #c4001a;
  --glass: rgba(255, 255, 255, 0.78);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
  --radius: 14px;
  --radius-lg: 22px;
  --sidebar-w: 260px;
  --topnav-h: 52px;
  --tabbar-h: 58px;
  --page-w: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", system-ui, sans-serif;
  --serif: "New York", "Iowan Old Style", "Charter", "Noto Serif", Georgia, "Noto Serif Devanagari", "Noto Serif Bengali", "Noto Serif Gujarati",
    "Noto Serif Gurmukhi", "Noto Serif Oriya", "Noto Serif Tamil", "Noto Serif Telugu", "Noto Serif Kannada", "Noto Serif Malayalam",
    "Noto Nastaliq Urdu", "Kohinoor Devanagari", "Times New Roman", serif;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1c1e;
    --sidebar: #141415;
    --surface: #242426;
    --raised: #2c2c2e;
    --hover: rgba(255, 255, 255, 0.07);
    --press: rgba(255, 255, 255, 0.11);
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.17);
    --text: #f2f2f7;
    --text-2: #aeaeb2;
    --text-3: #9e9ea4;
    --accent: #5aadff;
    --accent-press: #8cc4ff;
    --accent-soft: rgba(90, 173, 255, 0.18);
    --on-accent: #0b0b0d;
    --bad: #ff6b60;
    --glass: rgba(36, 36, 38, 0.8);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6);
  }
}
/* An explicit choice in localStorage "smriti-theme" (set on <html data-theme>) beats the system setting. */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1c1c1e;
  --sidebar: #141415;
  --surface: #242426;
  --raised: #2c2c2e;
  --hover: rgba(255, 255, 255, 0.07);
  --press: rgba(255, 255, 255, 0.11);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.17);
  --text: #f2f2f7;
  --text-2: #aeaeb2;
  --text-3: #9e9ea4;
  --accent: #5aadff;
  --accent-press: #8cc4ff;
  --accent-soft: rgba(90, 173, 255, 0.18);
  --on-accent: #0b0b0d;
  --bad: #ff6b60;
  --glass: rgba(36, 36, 38, 0.8);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.47 var(--font);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg text { stroke: none; fill: currentColor; font-size: 7px; font-weight: 700; font-family: var(--font); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
:is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="hidden"]), select, textarea):focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.composer textarea:focus-visible, .search-field input:focus-visible { outline: none; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; z-index: 100; left: 12px; top: -60px; padding: 10px 16px; border-radius: 10px;
  background: var(--text); color: var(--bg); font-weight: 600; transition: top 0.2s;
}
.skip-link:focus { top: 12px; }
kbd {
  margin-left: auto; padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: 6px;
  color: var(--text-3); font: 500 11px/1.5 var(--font);
}

/* Layout */

.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100%; }

.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 10px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--text); color: var(--bg); }
.brand-mark svg { width: 18px; height: 18px; stroke-width: 2.2; }
.brand-name { font: 650 18px/1 var(--font-display); letter-spacing: -0.02em; }

.new-search {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm);
  font-weight: 500; text-align: left; transition: background 0.15s;
}
.new-search:hover { background: var(--raised); }
.new-search svg { width: 18px; height: 18px; }

.nav { display: flex; flex-direction: column; gap: 1px; padding-top: 14px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 8px 10px;
  border: 0; border-radius: 10px; background: transparent; color: var(--text);
  text-align: left; font-weight: 450; text-decoration: none; transition: background 0.12s;
}
.nav-item:hover { background: var(--hover); }
.nav-item:active { background: var(--press); }
.nav-item.is-on { background: var(--press); font-weight: 600; }
.nav-icon { display: grid; place-items: center; color: var(--text-2); }
.nav-icon svg { width: 19px; height: 19px; }
.nav-item.is-on .nav-icon { color: var(--accent); }
.nav-text { flex: 1; }
.nav-count { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }

.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.staff { padding: 4px 10px 2px; }
.staff-link { color: var(--text-3); font-size: 12px; }
.staff-link:hover { color: var(--text-2); text-decoration: underline; }
.staff-who { display: flex; flex-direction: column; }
.staff-name { font-size: 13px; font-weight: 600; }
.staff-role { color: var(--text-3); font-size: 12px; text-transform: capitalize; }
.staff-console { display: inline-block; margin-top: 4px; color: var(--accent); font-size: 13px; font-weight: 500; }

.main { min-width: 0; padding-bottom: 140px; outline: none; }
.topbar {
  position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
}
.topbar-title { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--text-2); }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; }

/* Top navigation (listener site): slim sticky bar on desktop, bottom tab bar on phones */

.app.app-top { display: block; }
.topnav {
  position: sticky; top: 0; z-index: 12; height: var(--topnav-h);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.topnav-inner {
  display: grid; grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr); align-items: center; gap: 16px;
  height: 100%; max-width: calc(var(--page-w) + 56px); margin: 0 auto; padding: 0 28px;
}
.topnav .brand { justify-self: start; gap: 9px; padding: 4px 6px 4px 0; border-radius: 10px; }
.topnav .brand-mark { width: 28px; height: 28px; border-radius: 8px; }
.topnav .brand-mark svg { width: 17px; height: 17px; }
.topnav .brand-name { font-size: 17px; }
.topnav-tabs { display: flex; align-items: stretch; align-self: stretch; gap: 2px; }
.toptab {
  position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border: 0; background: none;
  color: var(--text-2); font-size: 14px; font-weight: 600; letter-spacing: -0.005em; white-space: nowrap; transition: color 0.15s;
}
.toptab:hover { color: var(--text); }
.toptab::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2.5px; border-radius: 3px 3px 0 0;
  background: var(--accent); transform: scaleX(0); transition: transform 0.25s var(--ease);
}
.toptab.is-on { color: var(--text); }
.toptab.is-on::after { transform: scaleX(1); }
.toptab:focus-visible { outline-offset: -8px; }
.toptab .nav-count {
  padding: 1px 6px; border-radius: 999px; background: var(--raised); color: var(--text-3);
  font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.toptab .nav-count:empty { display: none; }
.toptab svg { width: 14px; height: 14px; stroke-width: 2.2; }
.topnav-more { display: none; }
.topnav-actions { justify-self: end; display: flex; align-items: center; gap: 2px; }
.topnav .staff { display: flex; align-items: center; gap: 10px; margin-left: 6px; padding: 0; }
.topnav .staff-link {
  display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--text-2); font-size: 13px; font-weight: 500;
}
.topnav .staff-link:hover { color: var(--text); background: var(--hover); text-decoration: none; }
.topnav .staff-who { flex-direction: row; align-items: center; }
.topnav .staff-name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topnav .staff-role { display: none; }
.topnav .staff-console { margin-top: 0; white-space: nowrap; }

.tabbar {
  display: none; position: fixed; z-index: 15; left: 0; right: 0; bottom: 0;
  grid-template-columns: repeat(5, minmax(0, 1fr)); height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 0 4px env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line);
}
.tabbar-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; padding: 0; border: 0; border-radius: 12px;
  background: none; color: var(--text-2); font-size: 11px; font-weight: 600; letter-spacing: 0;
}
.tabbar-icon { display: grid; place-items: center; width: 52px; height: 28px; border-radius: 999px; transition: background 0.2s var(--ease), color 0.2s; }
.tabbar-icon svg { width: 22px; height: 22px; stroke-width: 1.8; }
.tabbar-item.is-on { color: var(--accent); }
.tabbar-item.is-on .tabbar-icon { background: var(--accent-soft); }
.tabbar-item:focus-visible { outline-offset: -3px; }
.tabbar-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.more-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.more-item {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 16px; border-radius: 14px;
  background: var(--raised); color: var(--text); font-weight: 600; transition: background 0.15s;
}
.more-item:hover { background: var(--press); }
.more-item.is-on { background: var(--accent-soft); color: var(--accent); }
.more-icon { display: grid; place-items: center; color: var(--text-2); }
.more-item.is-on .more-icon { color: var(--accent); }
.more-action { width: 100%; border: 0; background: none; color: var(--text); font-weight: 500; text-align: left; }
.more-action:hover { background: var(--hover); }
.more-action svg { width: 18px; height: 18px; color: var(--text-2); }
.more-staff { padding: 0 4px; }
.more-staff:empty { display: none; }
.more-mobile { display: none; }
.more-grid .more-mobile { display: none; }

.icon-button {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: 10px; background: transparent; color: var(--text-2);
  transition: background 0.12s, color 0.12s;
}
.icon-button:hover { background: var(--hover); color: var(--text); }
.icon-button.is-on { color: var(--accent); }
.icon-button.is-on svg { fill: currentColor; }

.pill-button {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 500; transition: background 0.12s;
}
.pill-button:hover { background: var(--raised); }
.pill-button svg { width: 17px; height: 17px; }
.pill-button.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.pill-button.primary:hover { background: var(--accent-press); }
.pill-button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

.text-button { padding: 4px 2px; border: 0; background: none; color: var(--accent); font-size: 14px; font-weight: 500; }
.text-button:hover { text-decoration: underline; }
.text-button.inline { margin-left: 6px; }
.text-button.danger { color: var(--bad); }

.primary-button {
  min-height: 46px; padding: 0 20px; border: 0; border-radius: 12px;
  background: var(--accent); color: var(--on-accent); font-size: 16px; font-weight: 600;
  transition: background 0.15s, transform 0.12s, opacity 0.15s;
}
.primary-button:hover:not(:disabled) { background: var(--accent-press); }
.primary-button:active:not(:disabled) { transform: scale(0.985); }
.primary-button:disabled { opacity: 0.45; cursor: default; }
.primary-button.compact { min-height: 38px; padding: 0 18px; border-radius: 999px; font-size: 15px; }

/* Pages and rows */

.view { animation: fade 0.25s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.page { max-width: var(--page-w); margin: 0 auto; padding: 8px 28px 0; }
.page-head { padding: 14px 0 18px; }
.page-kicker { margin: 0 0 2px; color: var(--text-2); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.page-title { margin: 0; font: 750 34px/1.1 var(--font-display); letter-spacing: -0.035em; }
.page-sub { margin: 6px 0 0; color: var(--text-2); font-size: 15px; max-width: 64ch; }
.updated-at { margin-left: 10px; color: var(--text-3); font: 500 12px/1 var(--font); letter-spacing: 0; vertical-align: middle; white-space: nowrap; }

.row { padding: 20px 0 8px; }
.row-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.row-title { margin: 0; font: 700 22px/1.2 var(--font-display); letter-spacing: -0.025em; }
.row-sub { margin: 2px 0 0; color: var(--text-2); font-size: 14px; }
.row-link { border: 0; background: none; color: var(--accent); font-size: 14px; font-weight: 500; white-space: nowrap; }
.row-link:hover { text-decoration: underline; }

.scroller {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 210px); gap: 16px;
  overflow-x: auto; padding: 4px 2px 12px; margin: 0 -2px; scroll-snap-type: x proximity; scrollbar-width: thin;
}
.scroller > * { scroll-snap-align: start; }
.scroller > .tcard { grid-column: span 1; min-width: 260px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 18px; }
.more-row { display: flex; justify-content: center; padding: 22px 0 0; }
.sentinel { height: 1px; }

.empty, .empty-state {
  padding: 40px 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg);
  color: var(--text-2); text-align: center;
}
.empty-title { margin: 0; color: var(--text); font: 650 17px/1.3 var(--font-display); }
.empty-body { margin: 6px auto 0; max-width: 52ch; }
.empty-state .pill-button { margin-top: 14px; }
.empty-state.big { padding: 72px 24px; }
.empty-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.empty-actions .pill-button { margin-top: 0; }

.crumbs { display: flex; gap: 8px; padding: 12px 0 4px; color: var(--text-2); font-size: 13px; }
.crumbs a { color: var(--accent); }
.crumbs > * + *::before { content: "›"; margin-right: 8px; color: var(--text-3); }

/* Chips, tabs, segmented controls */

.chip-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 14px; }
.filter-chip {
  min-height: 34px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.filter-chip:hover { background: var(--raised); }
.filter-chip[aria-checked="true"], .filter-chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tab {
  position: relative; min-height: 42px; padding: 0 14px; border: 0; background: none; color: var(--text-2);
  font-size: 15px; font-weight: 600; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2.5px; border-radius: 2px; background: var(--accent); }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; border-radius: 11px; background: var(--raised); }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span {
  display: block; padding: 6px 12px; border-radius: 8px; color: var(--text-2); font-size: 14px; font-weight: 500;
  text-align: center; white-space: nowrap; transition: background 0.2s var(--ease), color 0.2s, box-shadow 0.2s;
}
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12), 0 0 0 0.5px var(--line); }
.segmented input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.segmented.compact span { padding: 5px 10px; font-size: 13px; }

.search-field {
  display: flex; align-items: center; gap: 6px; width: min(260px, 100%); height: 36px; padding: 0 12px;
  border-radius: 10px; background: var(--raised); color: var(--text-3);
}
.search-field svg { width: 16px; height: 16px; }
.search-field input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text); }
.search-field:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.search-field.slim { width: min(220px, 100%); height: 34px; }

.toolbar, .read-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 0 0 18px; }
.toolbar .search-field { margin-left: auto; }
.read-controls .search-field { margin-left: auto; }
.select-pill select, .select-pill input, .pill-select {
  height: 34px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface); color: var(--text); font-size: 14px; outline: none;
}
.pill-select:focus, .select-pill select:focus { border-color: var(--accent); }

.lang-chip {
  display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px;
  background: var(--raised); color: var(--text-2); font-size: 12px; font-weight: 500;
}
.badge {
  display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600;
}
.badge.muted { background: var(--raised); color: var(--text-2); }
.badge.ready { background: color-mix(in srgb, var(--ok) 18%, transparent); color: color-mix(in srgb, var(--ok) 70%, var(--text)); }
.full-badge {
  display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent); font-size: 11px; font-weight: 650; letter-spacing: 0.02em;
}

/* Skeletons */

.skeleton-list { display: flex; flex-direction: column; gap: 22px; padding: 8px 0; }
.sk-row { display: flex; flex-direction: column; gap: 8px; }
.sk { display: block; height: 12px; border-radius: 6px; background: var(--raised); animation: shimmer 1.4s infinite; }
.sk-kicker { width: 120px; height: 10px; }
.sk-head { width: 92%; height: 18px; }
.sk-head.short { width: 64%; }
.sk-line { width: 40%; height: 10px; }
@keyframes shimmer { 50% { opacity: 0.5; } }
.skeleton .card-art { background: var(--raised); animation: shimmer 1.4s infinite; }
.skeleton .card-title, .skeleton .card-meta { height: 12px; margin-top: 8px; border-radius: 6px; background: var(--raised); }
.skeleton .card-meta { width: 60%; }
.skeleton-feature { height: clamp(240px, 30vw, 360px); border-radius: 24px; background: var(--raised); animation: shimmer 1.4s infinite; }
.skeleton-station { aspect-ratio: 1; border-radius: 18px; background: var(--raised); animation: shimmer 1.4s infinite; }

/* Featured banner (Today hero, station header) */

.hero-slot { margin-bottom: 8px; }
.feature {
  position: relative; display: grid; min-height: clamp(260px, 32vw, 380px); border-radius: 24px; overflow: hidden;
  isolation: isolate; box-shadow: var(--shadow-md);
}
.feature-art.card-art { position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
.feature-art .card-scrim {
  opacity: 1 !important;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.25) 45%, transparent 75%), linear-gradient(to right, rgba(0, 0, 0, 0.35), transparent 60%) !important;
}
.feature-copy { position: relative; z-index: 3; align-self: end; padding: 28px 30px; color: #fff; max-width: 640px; pointer-events: none; }
.feature-copy > * { pointer-events: auto; }
.feature-kicker { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.88; }
.feature-title { margin: 4px 0 2px; font: 750 clamp(32px, 5vw, 56px)/1.02 var(--font-display); letter-spacing: -0.04em; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.25); }
.feature-sub { margin: 0; font-size: 15px; opacity: 0.9; }
.feature-actions { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.feature-play {
  display: inline-grid; place-items: center; width: 52px; height: 52px; border: 0; border-radius: 50%;
  background: #fff; color: #000; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); transition: transform 0.15s;
}
.feature-play svg { width: 20px; height: 20px; fill: currentColor; stroke: none; margin-left: 2px; }
.feature.is-playing:not(.paused) .feature-play svg { margin-left: 0; }
.feature-play:active { transform: scale(0.94); }
.feature-link { color: #fff; font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 255, 255, 0.5); }
.feature .art-credit { right: 16px; left: auto; bottom: 12px; text-align: right; max-width: 40%; }
.feature .gallery-toggle { top: 14px; right: 14px; }
.feature:not(.has-photo-done) .art-mono { font-size: 340px; }

/* Stations (Listen) */

.station-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 18px 16px; }
.station { display: flex; flex-direction: column; gap: 6px; color: var(--text); }
.station-art.card-art { aspect-ratio: 1; border-radius: 18px; }
.station-name {
  position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 2;
  color: var(--tone-ink); font: 700 19px/1.1 var(--font-display); letter-spacing: -0.02em;
}
.has-photo .station-name { color: #fff; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35); }
.station-meta { padding: 0 2px; color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.station:hover .station-art { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.station:focus-visible { outline: none; }
.station:focus-visible .station-art { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }

/* Bulletin rows (Apple Podcasts episodes) */

.brow-list { display: flex; flex-direction: column; }
.day-head { margin: 18px 0 4px; color: var(--text-2); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.brow {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 12px 4px; border-top: 1px solid var(--line);
}
.brow-art.art { width: 56px; height: 56px; border-radius: 12px; }
.brow-kicker { margin: 0; color: var(--text-2); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.brow-title { margin: 1px 0 3px; font-size: 16px; font-weight: 600; letter-spacing: -0.015em; }
.brow-title a:hover { text-decoration: underline; }
.brow-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; color: var(--text-2); font-size: 13px; }
.brow-actions { display: flex; align-items: center; gap: 4px; }
.brow.is-playing .brow-title { color: var(--accent); }
.round-play {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); transition: transform 0.15s, background 0.15s;
}
.round-play svg { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.round-play:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.round-play:active { transform: scale(0.92); }
.progress-mini { position: relative; height: 3px; margin-top: 6px; border-radius: 3px; background: var(--line-strong); overflow: hidden; max-width: 220px; }
.progress-mini::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(var(--p, 0)); }
.brow-left { color: var(--accent); font-weight: 600; }

/* Story cards (Today) and story groups (Stories) */

.story-card {
  --pv-h: 210; position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 18px 18px 16px; border-radius: 18px; overflow: hidden;
  background: var(--surface); box-shadow: 0 0 0 0.5px var(--line-strong), var(--shadow-sm); cursor: pointer;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.story-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: hsl(var(--pv-h) 45% 52%); }
.story-card:hover { transform: translateY(-2px); box-shadow: 0 0 0 0.5px var(--line-strong), var(--shadow-md); }
.story-card:has(.story-title a:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 3px; }
.story-card .story-title a:focus-visible { outline: none; }
.story-kicker { margin: 0; color: var(--text-2); font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.story-title {
  margin: 0; font: 700 19px/1.28 var(--serif); letter-spacing: -0.01em;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.story-title a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.story-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.story-row {
  --cols: 4; display: grid; grid-auto-flow: column; gap: 16px; grid-auto-columns: calc((100% - (var(--cols) - 1) * 16px) / var(--cols));
  overflow-x: auto; padding: 4px 2px 14px; margin: 0 -2px; scroll-snap-type: x proximity; scrollbar-width: thin;
}
.story-row > * { scroll-snap-align: start; }
.sk-story { min-height: 168px; cursor: default; }
.sk-story::before { background: var(--raised); }
.sk-story .sk-line { margin-top: auto; }
.story-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; color: var(--text-2); font-size: 13px; }
.source-stack { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.source-stack .pv-mark + .pv-mark { margin-left: -10px; box-shadow: 0 0 0 2px var(--surface); }
.stack-count { margin-left: 4px; color: var(--text-2); font-size: 12px; font-weight: 600; }
.story-group { padding: 18px 0; border-top: 1px solid var(--line); }
.story-group-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.story-group-title { margin: 0 0 6px; font: 700 24px/1.2 var(--serif); letter-spacing: -0.015em; }
.story-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.story-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 10px 22px; margin-top: 12px; }
.related-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.related-title { margin: 0; font-weight: 600; }
.related-meta { margin: 0; color: var(--text-2); font-size: 13px; }
.timeline-builder { margin: 4px 0 8px; padding: 22px; border-radius: 20px; background: var(--raised); }
.builder-form { display: flex; gap: 10px; margin-top: 12px; }
.builder-form input { flex: 1; min-width: 0; height: 42px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); outline: none; }
.builder-form input:focus { border-color: var(--accent); }
.topic-list { display: flex; flex-wrap: wrap; gap: 8px; }
.topic-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 14px; border-radius: 999px; background: var(--raised); font-weight: 500; }
.topic-chip .icon-button { width: 28px; height: 28px; }
.updated-chip {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; padding: 2px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; animation: fade 0.4s var(--ease);
}
.lang-block { margin-top: 6px; }
.lang-block-title { margin: 8px 0 8px; font: 650 17px/1.3 var(--serif); }
.upsc-card {
  display: flex; align-items: center; gap: 16px; margin: 16px 0 4px; padding: 16px 18px; border-radius: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface));
  box-shadow: 0 0 0 0.5px var(--line-strong);
}
.upsc-card h3 { margin: 0; font: 700 17px/1.3 var(--font-display); }
.upsc-card p { margin: 2px 0 0; color: var(--text-2); font-size: 13px; }
.upsc-card .pill-button { margin-left: auto; }

/* Live updates pill */

.fresh-pill {
  position: sticky; top: 62px; z-index: 5; display: flex; justify-content: center; height: 0; overflow: visible;
}
.fresh-pill button {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg);
  animation: drop-in 0.35s var(--ease);
}
.fresh-pill button svg { width: 15px; height: 15px; stroke-width: 2.4; }
@keyframes drop-in { from { opacity: 0; transform: translateY(-10px) scale(0.96); } }
.is-new { animation: arrive 0.6s var(--ease) both; }
@keyframes arrive { from { opacity: 0; transform: translateY(-10px); background: var(--accent-soft); } }

/* Hero + composer (Ask) */

.hero { display: flex; flex-direction: column; align-items: center; max-width: 780px; margin: 0 auto; padding: 9vh 24px 28px; transition: padding 0.4s var(--ease); }
.hero-title { margin: 0 0 26px; font: 700 clamp(28px, 4vw, 36px)/1.15 var(--font-display); letter-spacing: -0.03em; text-align: center; }
.composer {
  width: 100%; padding: 12px 12px 10px 20px; border: 1px solid var(--line-strong); border-radius: 28px;
  background: var(--surface); box-shadow: var(--shadow-md); transition: border-color 0.15s, box-shadow 0.2s;
}
.composer:focus-within { border-color: var(--accent); box-shadow: var(--shadow-md), 0 0 0 1px var(--accent); }
.composer textarea {
  display: block; width: 100%; max-height: 180px; min-height: 28px; padding: 6px 0; border: 0; outline: none; resize: none;
  background: transparent; font-size: 16px; line-height: 1.5;
}
.composer textarea::placeholder { color: var(--text-3); }
.composer-bar { display: flex; align-items: center; gap: 8px; padding-top: 4px; margin-left: -8px; }
.composer-hint { flex: 1; min-width: 0; color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.send {
  display: grid; place-items: center; margin-left: auto; width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: var(--text); color: var(--bg); transition: opacity 0.15s, transform 0.15s;
}
.send svg { stroke-width: 2.4; width: 18px; height: 18px; }
.send .i-stop { display: none; fill: currentColor; stroke: none; width: 14px; height: 14px; }
.send.is-stop .i-send { display: none; }
.send.is-stop .i-stop { display: block; }
.send:disabled { opacity: 0.18; cursor: default; }
.send:not(:disabled):active { transform: scale(0.94); }
.mic {
  position: relative; display: grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--text-2); transition: background 0.15s, color 0.15s, transform 0.15s;
}
.mic:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.mic:disabled { opacity: 0.35; cursor: default; }
.mic .i-stop, .mic .spinner { display: none; }
.mic .i-stop { fill: currentColor; stroke: none; width: 14px; height: 14px; }
.is-recording .mic { background: var(--bad); color: #fff; }
.is-recording .mic::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--bad) 45%, transparent); animation: ring 1.4s ease-out infinite; }
.is-recording .mic .i-mic { display: none; }
.is-recording .mic .i-stop { display: block; }
.is-transcribing .mic svg { display: none; }
.is-transcribing .mic .spinner { display: block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--text); animation: spin 0.8s linear infinite; }
@keyframes ring { from { opacity: 1; transform: scale(0.9); } to { opacity: 0; transform: scale(1.35); } }
.composer.is-recording { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.voice-mode-button {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; border-radius: 999px;
  background: var(--raised); color: var(--text); font-size: 13px; font-weight: 600;
}
.voice-mode-button:hover { background: var(--press); }
.voice-mode-button svg { width: 16px; height: 16px; }
.rec { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 13px; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); animation: pulse 1.2s ease-in-out infinite; }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 34px; }
.meter { display: inline-flex; align-items: center; gap: 3px; height: 22px; }
.meter i { width: 3px; height: 100%; border-radius: 3px; background: var(--bad); transform: scaleY(0.15); transform-origin: center; transition: transform 0.08s linear; }
.rec-hint { margin-left: auto; color: var(--text-3); font-size: 12px; white-space: nowrap; }
@keyframes pulse { 50% { opacity: 0.35; } }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.hero.chatting .chips { display: none; }
.chip { padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--text-2); font-size: 14px; transition: background 0.12s, color 0.12s; }
.chip:hover { background: var(--hover); color: var(--text); }

/* Chat */

.hero.chatting { padding-top: 12px; padding-bottom: 0; }
.hero.chatting .hero-title {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.dock { width: 100%; }
.hero.chatting .dock { position: sticky; bottom: 0; z-index: 3; padding: 18px 0 16px; background: linear-gradient(to bottom, transparent, var(--bg) 22px); }
body.has-player .hero.chatting .dock { bottom: 100px; padding-bottom: 8px; }
.thread { width: 100%; padding: 4px 0; display: flex; flex-direction: column; gap: 22px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.turn { animation: rise 0.35s var(--ease); }
.turn.user { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.turn-note { margin: 0 6px 0 0; color: var(--text-3); font-size: 12px; }
.bubble { max-width: 75%; margin: 0; padding: 10px 16px; border-radius: 20px; background: var(--raised); white-space: pre-wrap; word-break: break-word; }
.turn.assistant { display: flex; gap: 14px; }
.answer-mark { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border: 1px solid var(--line-strong); border-radius: 50%; }
.answer-mark svg { width: 16px; height: 16px; }
.answer-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding-top: 3px; }
.trace { color: var(--text-2); font-size: 13px; }
.trace summary { display: inline-flex; align-items: center; gap: 4px; padding: 2px 0; list-style: none; cursor: pointer; user-select: none; }
.trace summary::-webkit-details-marker { display: none; }
.trace summary::after { content: "›"; font-size: 15px; line-height: 1; transition: transform 0.2s var(--ease); }
.trace[open] summary::after { transform: rotate(90deg); }
.trace summary:hover { color: var(--text); }
.trace.is-live summary {
  background: linear-gradient(90deg, var(--text-3) 0%, var(--text) 50%, var(--text-3) 100%) 0 0 / 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: sheen 1.6s linear infinite;
}
@keyframes sheen { to { background-position: -200% 0; } }
.trace-steps { margin: 6px 0 2px 2px; padding: 0 0 0 14px; list-style: none; border-left: 2px solid var(--line-strong); }
.trace-steps li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.trace-ms { flex: none; color: var(--text-3); font-variant-numeric: tabular-nums; }
.answer-text { line-height: 1.6; overflow-wrap: anywhere; }
.answer-text p { margin: 0 0 10px; }
.answer-text p:last-child { margin-bottom: 0; }
.answer-text ul, .answer-text ol { margin: 0 0 10px; padding-left: 22px; }
.answer-text li { margin: 2px 0; }
.answer-text li::marker { color: var(--text-3); }
.answer-text strong { font-weight: 600; }
.answer-error { margin: 0; color: var(--bad); font-size: 14px; }
.caret { display: inline-block; width: 8px; height: 8px; margin-left: 4px; border-radius: 50%; background: var(--text); vertical-align: middle; animation: pulse 1s ease-in-out infinite; }
.cite {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin: 0 2px; padding: 0 5px; border: 0; border-radius: 999px; vertical-align: 2px;
  background: var(--raised); color: var(--text-2); font: 600 11px/1 var(--font); font-variant-numeric: tabular-nums; transition: background 0.12s, color 0.12s;
}
.cite:hover:not(:disabled) { background: var(--accent); color: var(--on-accent); }
.cite:disabled { opacity: 0.5; cursor: default; }
.sources { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 240px); gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.src {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 8px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; scroll-snap-align: start; transition: background 0.12s, border-color 0.12s, box-shadow 0.2s;
}
.src:hover { background: var(--raised); }
.src.is-playing { border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.src-art.art { width: 42px; height: 42px; border-radius: 10px; font-size: 14px; }
.src-n { position: absolute; left: 3px; top: 3px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 999px; background: rgba(0, 0, 0, 0.35); color: #fff; font: 700 9px/15px var(--font); text-align: center; }
.src-copy { flex: 1; min-width: 0; }
.src-title { margin: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-meta { margin: 1px 0 0; color: var(--text-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-play { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--text); color: var(--bg); transition: transform 0.15s; }
.src-play svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.answer-actions { display: flex; align-items: center; gap: 2px; margin-left: -8px; }
.action { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font-size: 13px; transition: background 0.12s, color 0.12s; }
.action:hover { background: var(--hover); color: var(--text); }
.action svg { width: 16px; height: 16px; }
.answer-meta { margin-left: 8px; color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.thinking { display: inline-flex; gap: 5px; padding: 8px 0; }
.thinking span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); animation: blink 1.2s infinite ease-in-out; }
.thinking span:nth-child(2) { animation-delay: 0.15s; }
.thinking span:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); } 40% { opacity: 1; transform: scale(1); } }
.action-chip {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 5px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; animation: rise 0.3s var(--ease);
}
.play-cards { display: flex; flex-direction: column; gap: 8px; }
.play-cards[hidden] { display: none; }
.pcard { border: 1px solid var(--line); border-radius: var(--radius-lg, 14px); background: var(--surface); overflow: hidden; transition: border-color 0.12s, box-shadow 0.2s; }
.pcard.is-playing { border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.pcard-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.pcard-art.art { width: 48px; height: 48px; border-radius: 11px; font-size: 15px; }
.pcard-copy { flex: 1; min-width: 0; }
.pcard-title { margin: 0; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard-meta { margin: 1px 0 0; color: var(--text-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pcard-note { margin: 3px 0 0; color: var(--text-3); font-size: 12px; }
.pcard-play.src-play { width: 38px; height: 38px; }
.pcard-play:disabled { opacity: 0.35; cursor: default; }
.pcard-stories { margin: 0; padding: 4px 6px 6px; list-style: none; border-top: 1px solid var(--line); }
.pcard-story { display: flex; align-items: baseline; gap: 8px; width: 100%; padding: 6px 6px; border: 0; border-radius: 8px; background: none; color: var(--text); font-size: 13.5px; text-align: left; }
.pcard-story:hover:not(:disabled) { background: var(--hover); }
.pcard-story:disabled { cursor: default; }
.pcard-story.is-now { background: var(--accent-soft); }
.pcard-story.is-now .pcard-at { color: var(--accent); }
.pcard-n { flex: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--raised); color: var(--text-2); font: 600 11px/18px var(--font); text-align: center; font-variant-numeric: tabular-nums; }
.pcard-n:empty { display: none; }
.pcard-at { flex: none; min-width: 34px; color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.pcard-story-text { flex: 1; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.45; }

/* Artwork base */

.art {
  --hue: 210; position: relative; display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 12px; overflow: hidden;
  background: radial-gradient(120% 120% at 0% 0%, hsl(var(--hue) 85% 68%) 0%, transparent 60%), radial-gradient(120% 120% at 100% 100%, hsl(calc(var(--hue) + 40) 80% 45%) 0%, transparent 65%), hsl(calc(var(--hue) + 20) 70% 55%);
  color: #fff; font: 700 16px/1 var(--font-display); letter-spacing: -0.02em;
}
.art-lg { width: 112px; height: 112px; border-radius: 20px; font-size: 32px; box-shadow: var(--shadow-md); }

/* Mini player (Apple Music) */

.miniplayer {
  position: fixed; z-index: 20; left: calc(var(--sidebar-w) + 24px); right: 24px; bottom: 16px; max-width: 920px; margin: 0 auto;
  border: 1px solid var(--line); border-radius: 20px; background: var(--glass);
  backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px);
  box-shadow: var(--shadow-lg); animation: rise 0.35s var(--ease);
}
.app-top ~ .miniplayer { left: 24px; }
.mp-row {
  display: grid; align-items: center; gap: 4px 12px; grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: "expand controls close" "timeline timeline timeline"; padding: 10px 12px 8px 10px;
}
.mp-expand { grid-area: expand; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 0; border: 0; border-radius: 12px; background: none; text-align: left; }
.mp-expand:hover .mp-title { text-decoration: underline; }
.mp-art.art { width: 46px; height: 46px; border-radius: 10px; }
.mp-copy { display: flex; flex-direction: column; min-width: 0; }
.mp-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-sub { color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-controls { grid-area: controls; display: flex; align-items: center; gap: 4px; }
.mp-close { grid-area: close; }
.mp-state { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.play-button { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--text); color: var(--bg); transition: transform 0.15s; }
.play-button:active { transform: scale(0.92); }
.play-button svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.play-button .i-play { margin-left: 2px; }
.play-button .i-pause, .play-button .spinner { display: none; }
.is-playing .play-button .i-play { display: none; }
.is-playing .play-button .i-pause { display: block; }
.is-loading .play-button svg { display: none; }
.is-loading .play-button .spinner { display: block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--bg) 35%, transparent); border-top-color: var(--bg); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.mp-timeline { grid-area: timeline; display: flex; align-items: center; gap: 10px; }
.mp-time { min-width: 38px; color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.mp-time:last-child { text-align: right; }
.scrub { position: relative; flex: 1; height: 18px; }
.scrub::before, .scrub-buffer, .scrub-fill { content: ""; position: absolute; left: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 4px; transition: height 0.15s, margin 0.15s; }
.scrub::before { right: 0; background: var(--line-strong); }
.scrub-buffer { width: 0; background: color-mix(in srgb, var(--text) 22%, transparent); }
.scrub-fill { width: 0; background: var(--text); }
.scrub:hover::before, .scrub:hover .scrub-buffer, .scrub:hover .scrub-fill { height: 6px; margin-top: -3px; }
.scrub input { position: absolute; inset: 0; width: 100%; margin: 0; opacity: 0; cursor: pointer; }
.scrub:focus-within::before { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.video-frame { padding: 10px 10px 0; }
.video-frame video { display: block; width: 100%; max-height: 52vh; border-radius: 14px; background: #000; }

/* Now Playing (full screen) */

.np {
  width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0;
  background: var(--bg); color: var(--text); overflow: hidden;
}
.np[open] { animation: np-up 0.42s var(--ease); }
@keyframes np-up { from { transform: translateY(40px); opacity: 0; } }
.np::backdrop { background: rgba(0, 0, 0, 0.4); }
.np-shell { display: flex; flex-direction: column; height: 100%; max-width: 1240px; margin: 0 auto; padding: 8px 28px 20px; }
.np-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 52px; }
.np-label { margin: 0; color: var(--text-2); font-size: 13px; font-weight: 600; text-align: center; }
.np-head-actions { justify-self: end; display: flex; gap: 4px; }
.np-close svg { width: 24px; height: 24px; }
.np-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(300px, 460px) minmax(0, 1fr); gap: 48px; padding-top: 8px; }
.np-left { display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.np-art.card-art { width: 100%; aspect-ratio: 1; max-height: 46vh; border-radius: 22px; box-shadow: var(--shadow-lg); }
.np-art .art-mono { font-size: 300px; }
.np-art .gallery-toggle { top: 12px; right: 12px; }
.np-art .art-credit { left: 14px; bottom: 10px; opacity: 1; }
.np-title { margin: 0; font: 750 26px/1.15 var(--font-display); letter-spacing: -0.03em; }
.np-sub { margin: 4px 0 0; color: var(--text-2); font-size: 15px; }
.np-scrub .scrub { height: 22px; }
.np-times { display: flex; justify-content: space-between; color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.np-controls-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.np-big { width: 52px; height: 52px; color: var(--text); }
.np-big svg { width: 32px; height: 32px; stroke-width: 1.6; }
.np-big svg text { font-size: 6.5px; }
.np-play { position: relative; display: grid; place-items: center; width: 72px; height: 72px; border: 0; border-radius: 50%; background: var(--text); color: var(--bg); box-shadow: var(--shadow-md); transition: transform 0.15s; }
.np-play:active { transform: scale(0.94); }
.np-play svg { width: 28px; height: 28px; fill: currentColor; stroke: none; }
.np-play .i-play { margin-left: 3px; }
.np-play .i-pause, .np-play .spinner { display: none; }
.np.is-playing .np-play .i-play { display: none; }
.np.is-playing .np-play .i-pause { display: block; }
.np.is-loading .np-play svg { display: none; }
.np.is-loading .np-play .spinner { display: block; width: 26px; height: 26px; border-radius: 50%; border: 3px solid color-mix(in srgb, var(--bg) 35%, transparent); border-top-color: var(--bg); animation: spin 0.8s linear infinite; }
.np-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 56px; height: 36px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums;
}
.np-pill svg { width: 16px; height: 16px; }
.np-pill.is-on { border-color: var(--accent); color: var(--accent); }
.np-menu {
  position: absolute; z-index: 5; bottom: calc(100% + 8px); display: flex; flex-direction: column; min-width: 180px; padding: 6px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--glass); backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px); box-shadow: var(--shadow-lg);
}
.np-controls-row .np-menu:has(+ *), .np-controls-row .np-menu { left: 0; }
.np-menu-item { padding: 8px 12px; border: 0; border-radius: 8px; background: none; color: var(--text); text-align: left; font-size: 14px; }
.np-menu-item:hover, .np-menu-item:focus-visible { background: var(--hover); outline: none; }
.np-menu-item[aria-checked="true"] { color: var(--accent); font-weight: 650; }
.np-menu-item[aria-checked="true"]::after { content: " ✓"; }
.np-right { display: flex; flex-direction: column; min-height: 0; }
.np-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: var(--raised); align-self: flex-start; }
.np-tab { padding: 6px 16px; border: 0; border-radius: 9px; background: none; color: var(--text-2); font-size: 14px; font-weight: 600; }
.np-tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
.np-qcount { color: var(--accent); }
.np-panel { flex: 1; min-height: 0; overflow-y: auto; margin-top: 14px; padding: 4px 4px 40px 0; scroll-behavior: auto; outline: none; }
.np-note { margin: 0 0 10px; color: var(--text-2); font-size: 14px; }
.np-note.small { font-size: 12px; color: var(--text-3); }
.np-segs { margin: 0; padding: 0; list-style: none; }
.seg {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 12px;
  background: none; color: var(--text-3); text-align: left; font: 600 clamp(18px, 1.7vw, 22px)/1.45 var(--serif); letter-spacing: -0.005em;
  transition: color 0.25s, background 0.25s;
}
.seg:hover { background: var(--hover); color: var(--text-2); }
.seg.is-past { color: var(--text-2); }
.seg.is-current { color: var(--text); background: var(--accent-soft); }
.seg-time { padding-top: 5px; color: var(--text-3); font: 500 12px/1.4 var(--font); font-variant-numeric: tabular-nums; }
.seg.is-current .seg-time { color: var(--accent); }
.np-empty { padding: 30px 6px; }
.np-empty-title { margin: 0 0 6px; font: 700 20px/1.3 var(--font-display); }
.np-plain { margin: 12px 0 0; color: var(--text-2); font: 400 17px/1.6 var(--serif); white-space: pre-wrap; }
.qhead { display: flex; justify-content: space-between; align-items: center; }
.qhead h3, .qsub { margin: 4px 0 8px; font-size: 15px; font-weight: 700; }
.qsub { margin-top: 22px; color: var(--text-2); }
.qrow { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.qrow-art.art { width: 44px; height: 44px; border-radius: 9px; }
.qrow-copy { cursor: pointer; min-width: 0; }
.qrow-title { margin: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qrow-sub { margin: 0; color: var(--text-2); font-size: 13px; }
body.np-open .miniplayer { visibility: hidden; }

/* Watch */

.screen { margin-top: 8px; border-radius: 18px; overflow: hidden; background: #000; }
.screen video { display: block; width: 100%; max-height: 70vh; }
.watch-stage { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 8px 28px; }
.watch-stage .crumbs, .watch-stage .screen, .watch-stage .screen-copy { grid-column: 1; }
.screen-side { grid-column: 2; grid-row: 2 / span 2; }
.chapters { margin: 0; padding: 0; list-style: none; }
.chapter { display: grid; grid-template-columns: 44px 1fr; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 10px; background: none; text-align: left; }
.chapter:hover { background: var(--hover); }

/* Sheets (Apple) */

.sheet {
  width: min(540px, calc(100vw - 32px)); max-height: min(86vh, 820px); padding: 0; border: 1px solid var(--line); border-radius: 24px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); overflow: hidden;
}
.sheet[open] { display: flex; flex-direction: column; animation: sheet 0.35s var(--ease); }
@keyframes sheet { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
.sheet::backdrop, .lang-sheet::backdrop { background: rgba(0, 0, 0, 0.36); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 16px 14px 8px 22px; }
.sheet-head h2 { margin: 0; font: 700 22px/1.2 var(--font-display); letter-spacing: -0.025em; }
.sheet-body { display: flex; flex-direction: column; gap: 18px; padding: 8px 22px 22px; overflow-y: auto; }
.group { display: flex; flex-direction: column; gap: 8px; }
.group-label { margin: 0; color: var(--text-2); font-size: 13px; font-weight: 600; }
.group-note { margin: 0; color: var(--text-2); font-size: 14px; }
.list { border-radius: 14px; background: var(--raised); overflow: hidden; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 8px 14px; }
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-link { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.list-link:hover { color: var(--accent); }
.privacy { padding: 16px; border-radius: 16px; background: var(--accent-soft); }
.privacy-title { margin: 0 0 4px; font-weight: 700; }
.fine { margin: 0; color: var(--text-2); font-size: 13px; }
.error-text { margin: 0; color: var(--bad); font-size: 14px; }

/* Language picker (onboarding sheet) */

.lang-sheet {
  width: min(560px, calc(100vw - 24px)); max-height: min(88vh, 860px); padding: 0; border: 0; border-radius: 26px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); overflow: hidden;
}
.lang-sheet[open] { display: flex; flex-direction: column; animation: sheet 0.4s var(--ease); }
.sheet-handle { display: none; }
.ls-head { position: relative; padding: 28px 28px 14px; }
.ls-close { position: absolute; top: 14px; right: 14px; }
.ls-title { margin: 0; font: 750 30px/1.12 var(--font-display); letter-spacing: -0.035em; }
.ls-sub { margin: 6px 0 16px; color: var(--text-2); font-size: 15px; }
.ls-search {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 12px; background: var(--raised); color: var(--text-3);
}
.ls-search svg { width: 17px; height: 17px; }
.ls-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text); font-size: 16px; }
.ls-search:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.ls-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 28px 20px; overscroll-behavior: contain; }
.ls-loading { padding: 30px 0; color: var(--text-2); text-align: center; }
.ls-group { margin-top: 14px; }
.ls-group-title { margin: 0 0 10px; color: var(--text-2); font-size: 13px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }
details.ls-more > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; list-style: none; border-radius: 10px; }
details.ls-more > summary::-webkit-details-marker { display: none; }
details.ls-more > summary::after { content: ""; width: 8px; height: 8px; margin-left: 2px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 0.2s var(--ease); }
details.ls-more[open] > summary::after { transform: rotate(45deg); }
.ls-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 10px; }
.ls-tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px;
  min-height: 72px; padding: 12px 36px 12px 14px; border: 0; border-radius: 14px; background: var(--raised); color: var(--text);
  text-align: left; box-shadow: inset 0 0 0 1px transparent; transition: background 0.15s, box-shadow 0.15s, transform 0.12s;
}
.ls-tile:hover { background: var(--press); }
.ls-tile:active { transform: scale(0.97); }
.ls-tile:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }
.ls-native { font: 600 21px/1.25 var(--serif); letter-spacing: -0.005em; }
.ls-native.same { font-family: var(--font-display); font-size: 18px; }
.ls-english { color: var(--text-2); font-size: 13px; font-weight: 500; }
.ls-count { color: var(--text-3); font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; }
.ls-check {
  position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--line-strong); color: transparent; transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.ls-check svg { width: 14px; height: 14px; stroke-width: 3; }
.ls-tile[aria-pressed="true"] { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.ls-tile[aria-pressed="true"] .ls-check { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.ls-tile[aria-pressed="true"] .ls-english { color: color-mix(in srgb, var(--accent) 70%, var(--text)); }
.ls-suggested .ls-grid { grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); }
.ls-foot {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 28px 20px;
  border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 92%, transparent);
}
.ls-continue { width: 100%; min-height: 50px; border-radius: 14px; }
.ls-skip { min-height: 36px; padding: 0 12px; border: 0; background: none; color: var(--accent); font-size: 15px; font-weight: 500; }
.ls-skip:hover { text-decoration: underline; }

/* Voice mode */

.voice-mode {
  width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0;
  background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--accent) 14%, var(--bg)), var(--bg) 60%); color: var(--text);
}
.voice-mode[open] { animation: fade 0.3s var(--ease); }
.vm-shell { display: flex; flex-direction: column; height: 100%; max-width: 760px; margin: 0 auto; padding: 12px 24px 24px; }
.vm-head { display: flex; justify-content: space-between; align-items: center; }
.vm-label { margin: 0; color: var(--text-2); font-size: 13px; font-weight: 600; }
.vm-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; min-height: 0; text-align: center; }
.vm-orb {
  --level: 0; position: relative; width: 168px; height: 168px; border: 0; border-radius: 50%; padding: 0;
  background: radial-gradient(circle at 35% 30%, #8fd3ff, var(--accent) 55%, #5e2ce0);
  box-shadow: 0 20px 60px color-mix(in srgb, var(--accent) 45%, transparent);
  transform: scale(calc(1 + var(--level) * 0.12)); transition: transform 0.08s linear;
}
.vm-orb span { position: absolute; inset: -14px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); opacity: 0; }
.voice-mode[data-mode="listening"] .vm-orb span { animation: ring 1.4s ease-out infinite; }
.voice-mode[data-mode="thinking"] .vm-orb { animation: breathe 1.6s ease-in-out infinite; }
.voice-mode[data-mode="speaking"] .vm-orb { animation: speak 0.9s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(0.94); filter: saturate(0.7); } }
@keyframes speak { 50% { transform: scale(1.06); } }
.vm-state { margin: 0; color: var(--text-2); font-weight: 600; }
.vm-captions { max-width: 620px; }
.vm-user { margin: 0 0 8px; color: var(--text-2); font-size: 16px; }
.vm-answer { margin: 0; font: 600 clamp(20px, 2.6vw, 26px)/1.4 var(--serif); max-height: 30vh; overflow-y: auto; }
.vm-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.vm-sources { display: flex; gap: 8px; overflow-x: auto; max-width: 100%; padding: 4px; }
.vm-source {
  display: grid; grid-template-columns: auto 1fr; gap: 0 8px; min-width: 180px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); text-align: left;
}
.vm-source-n { grid-row: span 2; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--raised); font-size: 11px; font-weight: 700; }
.vm-source-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vm-source-meta { color: var(--text-2); font-size: 12px; }
.vm-hint { margin: 0; color: var(--text-3); font-size: 12px; text-align: center; }

/* Toast */

.toast {
  position: fixed; z-index: 40; left: 50%; top: 16px; transform: translateX(-50%); max-width: calc(100vw - 32px);
  padding: 10px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg); animation: drop 0.3s var(--ease);
}
@keyframes drop { from { opacity: 0; transform: translate(-50%, -8px); } }

/* Responsive */

.only-mobile { display: none; }

@media (max-width: 1000px) {
  .np-grid { grid-template-columns: 1fr; gap: 18px; overflow-y: auto; }
  .np-left { max-width: 520px; width: 100%; margin: 0 auto; }
  .np-art.card-art { max-height: 38vh; aspect-ratio: auto; height: 38vh; }
  .np-panel { overflow: visible; }
  .watch-stage { grid-template-columns: 1fr; }
  .screen-side { grid-column: 1; grid-row: auto; }
}

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 30; left: 0; top: 0; bottom: 0; width: min(300px, 86vw);
    transform: translateX(-102%); transition: transform 0.35s var(--ease); box-shadow: var(--shadow-lg);
  }
  .app.nav-open .sidebar { transform: none; }
  .only-mobile { display: inline-grid; }
  .scrim { position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, 0.3); opacity: 0; pointer-events: none; transition: opacity 0.3s; display: block; }
  .app.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .topbar { padding: 0 10px; }
  .page { padding: 4px 16px 0; }
  .page-title { font-size: 30px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(min(156px, 100%), 1fr)); gap: 14px; }
  .station-grid { grid-template-columns: repeat(auto-fill, minmax(min(130px, 100%), 1fr)); gap: 14px 12px; }
  .scroller { grid-auto-columns: minmax(156px, 170px); }
  .feature-copy { padding: 20px; }
  .miniplayer { left: 8px; right: 8px; bottom: 8px; border-radius: 18px; }
  .mp-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "expand controls" "timeline timeline"; }
  .mp-close, #mp-back, #mp-forward { display: none; }
  .rec-hint { display: none; }
  .bubble { max-width: 88%; }
  .sources { grid-auto-columns: minmax(190px, 78%); }
  body.has-player .hero.chatting .dock { bottom: 88px; }
  .toolbar .search-field, .read-controls .search-field { margin-left: 0; width: 100%; }
  .np-shell { padding: 4px 16px 16px; }
  .np-title { font-size: 22px; }
  .app-top ~ .miniplayer { left: 8px; }
}

@media (max-width: 1239px) {
  .toptab .nav-count { display: none; }
}

@media (max-width: 999px) {
  .toptab-extra { display: none; }
  .topnav-more { display: inline-flex; }
  .topnav-inner { padding: 0 16px; gap: 10px; }
  .toptab { padding: 0 10px; }
}

@media (max-width: 759px) {
  .topnav-inner { grid-template-columns: 1fr auto; padding: 0 8px 0 16px; }
  .topnav-tabs, .topnav .topnav-desk { display: none; }
  .tabbar { display: grid; }
  .app-top .main { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 120px); }
  .app-top ~ .miniplayer { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px); }
  .app-top .hero.chatting .dock { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  body.has-player .app-top .hero.chatting .dock { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 84px); }
  .more-grid .more-mobile { display: flex; }
  .list.more-mobile, .more-staff.more-mobile { display: block; }
}

@media (max-width: 640px) {
  .lang-sheet {
    width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 22px 22px 0 0;
    transition: transform 0.2s var(--ease);
  }
  .lang-sheet[open] { animation: sheet-up 0.38s var(--ease); }
  @keyframes sheet-up { from { transform: translateY(100%); } }
  .sheet-handle { display: block; width: 40px; height: 5px; margin: 8px auto 0; border-radius: 3px; background: var(--line-strong); cursor: grab; touch-action: none; }
  .ls-head { padding: 12px 18px 10px; }
  .ls-title { font-size: 26px; }
  .ls-body { padding: 4px 18px 16px; }
  .ls-foot { padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); }
  .ls-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 22px 22px 0 0; max-height: 90dvh; }
}

@media (max-width: 400px) {
  .page-title { font-size: 27px; }
  .brow { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; }
  .brow-art.art { width: 44px; height: 44px; }
  .brow-actions .icon-button { display: none; }
  .feature-title { font-size: 30px; }
  .np-controls-row { gap: 2px; }
  .np-pill { min-width: 48px; padding: 0 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media (prefers-contrast: more) {
  :root { --text-2: #3a3a3c; --text-3: #545458; --line: rgba(0, 0, 0, 0.2); --line-strong: rgba(0, 0, 0, 0.35); }
}

/* Place pages (Listen station view): "News from {place}" mixes article tiles with bulletin tiles. */
.place-news { align-items: stretch; }
.place-news > .tcard-tile { min-height: 0; }
.place-more { display: flex; margin: 16px auto 0; }
.place-head { margin-bottom: 8px; }
.place-head .page-sub a { color: var(--accent); }
@media (max-width: 640px) {
  .place-news { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .place-news > .tcard { grid-column: 1 / -1; }
}

/* Machine-read (OCR) text label */
.ocr-note { margin: 6px 0; padding: 4px 10px; border-left: 3px solid #c98a12; background: rgba(201, 138, 18, 0.10); color: var(--text-2); font-size: 0.85em; border-radius: 4px; }
.ocr-note::before { content: "⚠︎ "; }

/* Markdown in AI answers (js/markdown.js) */
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md blockquote, .md pre, .md .md-table { margin: 0 0 10px; }
.md ul, .md ol { padding-left: 1.4em; }
.md li + li { margin-top: 3px; }
.md li > ul, .md li > ol { margin: 4px 0 0; }
.md h3, .md h4, .md h5, .md h6 { margin: 16px 0 6px; font-family: var(--font-display); font-weight: 650; line-height: 1.3; letter-spacing: -0.01em; }
.md h3 { font-size: 1.12em; }
.md h4 { font-size: 1.04em; }
.md h5, .md h6 { font-size: 1em; color: var(--text-2); }
.md strong { font-weight: 650; }
.md a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.md code { padding: 1px 5px; border-radius: 5px; background: var(--raised); font: 0.9em ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.md pre { padding: 10px 12px; border-radius: 10px; background: var(--raised); overflow-x: auto; }
.md pre code { padding: 0; background: none; font-size: 0.86em; line-height: 1.5; }
.md blockquote { padding: 2px 0 2px 12px; border-left: 3px solid var(--line-strong); color: var(--text-2); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.md .md-table { overflow-x: auto; }
.md table { border-collapse: collapse; font-size: 0.92em; min-width: 50%; }
.md th, .md td { padding: 6px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.md th { background: var(--raised); font-weight: 600; }
