/* Layout: glass header (brand · edition picker · view switch) over a toolbar of filters; one reading column of story cards + a quiet rail.
   Each newspaper owns a color mark; plum is the app's own accent. */
:root {
  --bg: #f4f4f7;
  --bg-2: #ececf1;
  --surface: #ffffff;
  --surface-2: #fafafc;
  --ink: #15161c;
  --ink-2: #3b3d47;
  --muted: #6b6e7a;
  --line: #e3e3ea;
  --line-2: #d4d4de;
  --accent: #7d3459;
  --accent-ink: #ffffff;
  --accent-soft: #f4e8ef;
  --s-est: #2f5bd3;
  --s-val: #0c8a6c;
  --s-glo: #d2591f;
  --up: #1f7a45; --up-soft: #e3f3e8;
  --down: #b4433a; --down-soft: #f8e6e3;
  --miss: #8a5a00; --miss-soft: #f7eed9;
  --focus: #1b63c6;
  --glass: rgb(255 255 255 / 0.78);
  --shadow-1: 0 1px 2px rgb(20 20 40 / 0.05), 0 1px 1px rgb(20 20 40 / 0.03);
  --shadow-2: 0 10px 30px -12px rgb(20 20 40 / 0.22), 0 2px 6px rgb(20 20 40 / 0.06);
  --f-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px;
  --seg-bg: #e9e9ef; --seg-thumb: #ffffff;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0e0f13; --bg-2: #15161c; --surface: #17181e; --surface-2: #1c1d24; --ink: #ececf1; --ink-2: #c9cad3; --muted: #9597a3; --line: #262730; --line-2: #33343f;
  --accent: #e590b8; --accent-ink: #1a0f15; --accent-soft: #35202b; --s-est: #8aa6ff; --s-val: #4fd1ab; --s-glo: #ff9a5c;
  --up: #5fcf8c; --up-soft: #16301f; --down: #f08a80; --down-soft: #3a1d1a; --miss: #e6b85c; --miss-soft: #33290f; --focus: #7fb0ff;
  --glass: rgb(23 24 30 / 0.78); --seg-bg: #0a0b0e; --seg-thumb: #2c2d37; --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4); --shadow-2: 0 14px 34px -12px rgb(0 0 0 / 0.7), 0 2px 6px rgb(0 0 0 / 0.4);
  color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #0e0f13; --bg-2: #15161c; --surface: #17181e; --surface-2: #1c1d24; --ink: #ececf1; --ink-2: #c9cad3; --muted: #9597a3; --line: #262730; --line-2: #33343f;
  --accent: #e590b8; --accent-ink: #1a0f15; --accent-soft: #35202b; --s-est: #8aa6ff; --s-val: #4fd1ab; --s-glo: #ff9a5c;
  --up: #5fcf8c; --up-soft: #16301f; --down: #f08a80; --down-soft: #3a1d1a; --miss: #e6b85c; --miss-soft: #33290f; --focus: #7fb0ff;
  --glass: rgb(23 24 30 / 0.78); --seg-bg: #0a0b0e; --seg-thumb: #2c2d37; --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4); --shadow-2: 0 14px 34px -12px rgb(0 0 0 / 0.7), 0 2px 6px rgb(0 0 0 / 0.4);
  color-scheme: dark }

* { box-sizing: border-box }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 var(--f-body); -webkit-font-smoothing: antialiased; font-feature-settings: "ss01", "cv11" }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface) }
button, input, select { font: inherit; color: inherit }
button { -webkit-tap-highlight-color: transparent }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 8px }
.wrap { max-width: 1160px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)) }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
.icon { display: block; flex: none }

/* ---------- Header ---------- */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--glass); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); border-bottom: 1px solid var(--line) }
.bar { display: flex; align-items: center; gap: 12px 18px; padding-block: 12px; flex-wrap: wrap }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; margin-right: auto }
.mark { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: var(--surface); display: grid; place-items: center; font: 700 0.9rem/1 var(--f-display) }
.mark-c { width: 32px; height: 32px; display: block; flex: none; filter: drop-shadow(0 2px 4px rgb(0 0 0 / 0.25)) }
.brand h1 { font: 700 1.25rem/1 var(--f-display); letter-spacing: -0.015em; margin: 0; white-space: nowrap }

/* Edition picker */
.edpick { display: inline-flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; box-shadow: var(--shadow-1) }
.edpick.off { display: none }
.edpick .nav { width: 30px; height: 30px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink-2) }
.edpick .nav:hover:not(:disabled) { background: var(--bg-2) }
.edpick .nav:disabled { opacity: .3; cursor: default }
.edpick .cur { border: 0; background: transparent; cursor: pointer; padding: 4px 10px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.875rem; white-space: nowrap }
.edpick .cur:hover { background: var(--bg-2) }
.edpick .cur .day { color: var(--muted); font-weight: 500 }
.edpick .live { width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 3px color-mix(in srgb, var(--up) 22%, transparent) }

/* Segmented control (views + newspapers) */
.seg { position: relative; display: inline-flex; background: var(--seg-bg); border-radius: 11px; padding: 3px; gap: 2px; isolation: isolate; max-width: 100%; overflow-x: auto; scrollbar-width: none }
.seg::-webkit-scrollbar { display: none }
.seg .thumb { position: absolute; z-index: -1; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 8px; background: var(--seg-thumb); box-shadow: var(--shadow-1); transition: transform .28s cubic-bezier(.3,.7,.2,1), width .28s cubic-bezier(.3,.7,.2,1) }
.seg button, .seg a { position: relative; border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-size: 0.8125rem; font-weight: 500; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; text-decoration: none; transition: color .2s }
.seg [aria-pressed="true"], .seg [aria-current="page"] { color: var(--ink) }
.seg .n { font: 500 0.6875rem var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted) }
.dot.s-est { background: var(--s-est) } .dot.s-val { background: var(--s-val) } .dot.s-glo { background: var(--s-glo) }

.install { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; font-size: 0.8125rem; font-weight: 600; cursor: pointer; display: inline-flex; gap: 6px; align-items: center }
.install:hover { border-color: var(--line-2) }

/* Toolbar */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-block: 0 12px }
.search { position: relative; flex: 1 1 220px; min-width: 180px; max-width: 340px }
.search input { width: 100%; height: 36px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 0 32px 0 34px; font-size: 0.875rem; box-shadow: var(--shadow-1) }
.search input::placeholder { color: var(--muted) }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft) }
.search .si { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none }
.search .clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border: 0; background: transparent; border-radius: 6px; color: var(--muted); cursor: pointer; display: grid; place-items: center }
.search .clear:hover { background: var(--bg-2); color: var(--ink) }
.ddbtn { height: 36px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 0 10px 0 12px; display: inline-flex; align-items: center; gap: 8px; font-size: 0.875rem; font-weight: 500; cursor: pointer; box-shadow: var(--shadow-1); white-space: nowrap }
.ddbtn:hover { border-color: var(--line-2) }
.ddbtn[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft) }
.ddbtn .badge-n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 600 0.6875rem/18px var(--f-mono); text-align: center }
.tokens { display: flex; gap: 6px; flex-wrap: wrap; align-items: center }
.token { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 0.8125rem; font-weight: 500 }
.token button { width: 18px; height: 18px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; display: grid; place-items: center }
.token button:hover { background: color-mix(in srgb, var(--accent) 16%, transparent) }
.linkbtn { border: 0; background: transparent; padding: 0; color: var(--muted); font-size: 0.8125rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2) }
.linkbtn:hover { color: var(--ink) }

/* Popover */
.pop { position: fixed; z-index: 40; min-width: 240px; max-width: min(340px, calc(100vw - 24px)); max-height: min(440px, calc(100vh - 120px)); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-2); padding: 6px; animation: pop .16s ease-out }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98) } to { opacity: 1; transform: none } }
.pop .ph { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 6px; font: 500 0.6875rem var(--f-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted) }
.opt { width: 100%; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 10px; border: 0; background: transparent; padding: 8px 10px; border-radius: 9px; text-align: left; cursor: pointer; font-size: 0.875rem }
.opt:hover, .opt:focus-visible { background: var(--bg-2); outline: none }
.opt .chk { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line-2); display: grid; place-items: center; color: transparent }
.opt[aria-checked="true"] .chk { background: var(--accent); border-color: var(--accent); color: var(--accent-ink) }
.opt .n { font: 500 0.75rem var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums }
.opt.ed { grid-template-columns: minmax(0, 1fr) auto }
.opt.ed[aria-current="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600 }
.opt .sub { color: var(--muted); font-size: 0.75rem; display: block; font-weight: 400 }
.pop .grp { padding: 10px 10px 4px; font: 500 0.6875rem var(--f-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted) }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; padding-block: 20px 56px; align-items: start }
.layout.saved { grid-template-columns: 236px minmax(0, 1fr) }
.layout.radio { grid-template-columns: minmax(0, 1fr) }
@media (max-width: 920px) { .layout, .layout.saved { grid-template-columns: minmax(0, 1fr) } }
.feed { display: flex; flex-direction: column; gap: 12px; min-width: 0 }
.past { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r-md); padding: 10px 14px; font-size: 0.875rem; color: var(--ink-2) }
.past .btn { margin-left: auto }
.resultline { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 0.8125rem; color: var(--muted); padding: 0 2px }
.resultline b { color: var(--ink); font-weight: 600 }

/* Story card */
.story { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px 14px; display: flex; flex-direction: column; gap: 9px; box-shadow: var(--shadow-1); transition: box-shadow .2s, border-color .2s, transform .2s }
.story:hover { box-shadow: var(--shadow-2); border-color: var(--line-2) }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 0.75rem; color: var(--muted); padding-right: 44px }
.srcpill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; color: var(--ink-2); font-size: 0.75rem }
.tag { font: 500 0.6875rem var(--f-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent) }
.rel { margin-left: auto; display: inline-flex; gap: 3px; align-items: center }
.rel i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2) }
.rel i.on { background: var(--accent) }
.story h2 { font: 600 1.1875rem/1.3 var(--f-display); letter-spacing: -0.01em; margin: 0; text-wrap: balance }
.story h2 a { color: inherit; text-decoration: none }
.story h2 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-lg); z-index: 0 }
.story h2 a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px }
.dek { margin: 0; color: var(--ink-2); max-width: 70ch }
.controls { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px }
.row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px }
.toggle { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 4px 0; color: var(--accent); font-weight: 600; font-size: 0.8125rem; cursor: pointer }
.toggle .icon { transition: transform .2s }
.toggle[aria-expanded="true"] .icon { transform: rotate(180deg) }
.readin { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 0.8125rem }
.readin .lbl { color: var(--muted); font-size: 0.75rem; margin-right: 2px }
.readin a { color: var(--ink-2); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface) }
.readin a:hover { border-color: var(--line-2); color: var(--ink) }
.summary { margin: 0; padding: 14px 16px 14px 32px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); display: flex; flex-direction: column; gap: 6px; max-width: 72ch; color: var(--ink-2) }
.srcs { list-style: none; margin: 6px 0 0 -16px; padding: 10px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; font-size: 0.8125rem }
.srcs a { color: var(--ink); text-decoration: none; display: inline-flex; gap: 8px; align-items: baseline }
.srcs a:hover .t { text-decoration: underline }
.srcs .s { font-weight: 600; flex: none; display: inline-flex; gap: 5px; align-items: center; width: 74px }
.srcs .sec { color: var(--muted); font-size: 0.75rem }

/* Save */
.savebtn { position: absolute; top: 12px; right: 12px; z-index: 2; width: 34px; height: 34px; border-radius: 10px; border: 1px solid transparent; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--muted); transition: background .15s, color .15s }
.savebtn:hover { background: var(--bg-2); color: var(--ink) }
.savebtn[aria-pressed="true"] { color: var(--accent) }
.savebtn[aria-pressed="true"] path { fill: currentColor }
.savebox { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2) }
.savebox .hd { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; font-weight: 600 }
.savebox .hd .ok { color: var(--accent) }
.savebox .hd .muted { color: var(--muted); font-weight: 400 }
.fopts { display: flex; flex-wrap: wrap; gap: 6px }
.fopt { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; height: 28px; padding: 0 12px; font-size: 0.8125rem; cursor: pointer; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center }
.fopt[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft) }
.newf { display: flex; gap: 6px; flex-wrap: wrap }
.newf input, .field { flex: 1; min-width: 160px; height: 34px; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 0 10px; font-size: 0.8125rem }
.newf input:focus, .field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft) }
.btn { height: 34px; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 0 12px; font-size: 0.8125rem; cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap }
.btn:hover { border-color: var(--line-2) }
.btn.primary { background: var(--ink); color: var(--surface); border-color: var(--ink) }
.btn.danger { color: var(--down) }
.fchips { display: flex; flex-wrap: wrap; gap: 6px }
.fchip { font-size: 0.75rem; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 9px; display: inline-flex; gap: 5px; align-items: center }

/* Review */
.review { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 8px }
.review .q { font-size: 0.75rem; color: var(--muted) }
.vote { display: inline-flex; align-items: center; gap: 6px; height: 30px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 0 12px; font-size: 0.8125rem; cursor: pointer; color: var(--ink-2) }
.vote:hover { border-color: var(--line-2) }
.vote.up[aria-pressed="true"] { background: var(--up-soft); border-color: var(--up); color: var(--up) }
.vote.down[aria-pressed="true"] { background: var(--down-soft); border-color: var(--down); color: var(--down) }
.reasons { display: flex; flex-wrap: wrap; gap: 6px }
.reason { border: 1px dashed var(--line-2); background: transparent; border-radius: 999px; height: 26px; padding: 0 10px; font-size: 0.75rem; cursor: pointer; color: var(--muted) }
.reason[aria-pressed="true"] { color: var(--ink); border-style: solid; border-color: var(--ink); background: var(--surface-2) }
.note { width: 100%; max-width: 520px; height: 34px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 9px; padding: 0 10px; font-size: 0.8125rem }
.note:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft) }

/* Rail */
.rail { display: flex; flex-direction: column; gap: 12px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 140px); min-width: 0 }
@media (max-width: 920px) { .rail { position: static } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow-1) }
.panel h3 { font: 500 0.6875rem/1.2 var(--f-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 12px }
.srcsum { display: flex; flex-direction: column; gap: 10px; font-size: 0.8125rem }
.srcsum .r { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 8px }
.srcsum .bar2 { grid-column: 2 / -1; height: 4px; border-radius: 2px; background: var(--bg-2); overflow: hidden }
.srcsum .bar2 span { display: block; height: 100% }
.srcsum .v { font: 0.75rem var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums }
.taste { display: flex; flex-direction: column; gap: 9px }
.trow { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 0.8125rem }
.tbar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--bg-2) }
.tbar span { display: block; height: 100% }
.tbar .u { background: var(--up) } .tbar .m { background: var(--miss) } .tbar .d { background: var(--down) }
.tnum { font: 0.6875rem var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums }
.legend { display: flex; gap: 12px; font-size: 0.6875rem; color: var(--muted); margin-top: 10px; flex-wrap: wrap }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px }
.learned { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 0.8125rem; color: var(--muted) }
.empty-note { font-size: 0.8125rem; color: var(--muted); margin: 0 }

/* Folders */
.folders { display: flex; flex-direction: column; gap: 2px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 90px) }
@media (max-width: 920px) { .folders { position: static } }
.fitem { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; text-align: left; padding: 9px 12px; border-radius: 10px; cursor: pointer; font-size: 0.875rem; color: var(--ink-2); width: 100% }
.fitem:hover { background: var(--surface) }
.fitem[aria-current="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1) }
.fitem .n { margin-left: auto; font: 0.6875rem var(--f-mono); color: var(--muted) }
.fsep { height: 1px; background: var(--line); margin: 8px 4px }
.fhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 2px }
.fhead h2 { font: 600 1.375rem var(--f-display); letter-spacing: -0.01em; margin: 0 }
.factions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center }

/* Left out */
.out { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1) }
.out summary { cursor: pointer; padding: 14px 18px; font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; list-style: none }
.out summary::-webkit-details-marker { display: none }
.out summary .hint { font-weight: 400; color: var(--muted); font-size: 0.8125rem }
.out summary .icon { margin-left: auto; transition: transform .2s; color: var(--muted) }
.out[open] summary .icon { transform: rotate(180deg) }
.out ul { list-style: none; margin: 0; padding: 0 18px 12px; display: flex; flex-direction: column }
.out li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line) }
.out li a { color: var(--ink); text-decoration: none; flex: 1; min-width: 0; font-size: 0.875rem }
.out li a:hover { text-decoration: underline }
.out .otag { font: 500 0.625rem var(--f-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); width: 84px; flex: none }
.out .osrc { width: 72px; flex: none; font-size: 0.75rem; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; color: var(--ink-2) }
.iconbtn { border: 1px solid transparent; background: transparent; border-radius: 8px; width: 30px; height: 30px; display: grid; place-items: center; cursor: pointer; color: var(--muted); flex: none }
.iconbtn:hover { background: var(--bg-2); color: var(--ink) }
.iconbtn[aria-pressed="true"] { color: var(--accent) }
.iconbtn[aria-pressed="true"] path { fill: currentColor }
.miss { border: 1px solid var(--line); background: transparent; border-radius: 999px; height: 28px; padding: 0 10px; font-size: 0.75rem; cursor: pointer; color: var(--muted); white-space: nowrap }
.miss[aria-pressed="true"] { background: var(--miss-soft); border-color: var(--miss); color: var(--miss) }
@media (max-width: 600px) { .out .otag { display: none } .search { max-width: none } .brand h1 { font-size: 1.125rem } }

/* Reader */
.layout.reader { grid-template-columns: minmax(0, 1fr) }
.rd { max-width: 760px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 18px }
.rd-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 66px); z-index: 4; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding-block: 8px; border-bottom: 1px solid var(--line) }
.rd-bar .grow { flex: 1 }
.fontsz { display: inline-flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-1) }
.fontsz button { border: 0; background: transparent; height: 34px; padding: 0 12px; cursor: pointer; font-weight: 600; color: var(--ink-2) }
.fontsz button:hover:not(:disabled) { background: var(--bg-2) }
.fontsz button:disabled { opacity: .35; cursor: default }
.fontsz .sep { width: 1px; height: 20px; background: var(--line) }
.fontsz .lvl { font: 500 0.75rem var(--f-mono); color: var(--muted); padding: 0 8px; min-width: 44px; text-align: center }
.rd-save[aria-pressed="true"] { color: var(--accent); border-color: var(--accent) }
.rd-save[aria-pressed="true"] path { fill: currentColor }
.rd-head { display: flex; flex-direction: column; gap: 12px }
.rd-head h1 { font: 700 clamp(1.6rem, 3.2vw, 2.2rem)/1.15 var(--f-display); letter-spacing: -0.02em; margin: 0; text-wrap: balance }
.rd-dek { margin: 0; font-size: 1.125rem; color: var(--ink-2); max-width: 62ch }
.rd-by { font-size: 0.8125rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center }
.rd-body { --rd-size: 18px; font: 400 var(--rd-size)/1.72 "Source Serif 4", Georgia, "Times New Roman", serif; color: var(--ink); max-width: 66ch; display: flex; flex-direction: column; gap: 0.9em }
.rd-body h2 { font: 600 calc(var(--rd-size) * 1.15)/1.3 var(--f-display); letter-spacing: -0.01em; margin: 0.6em 0 0 }
.rd-body p { margin: 0; text-wrap: pretty }
.rd-cta { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-1) }
.rd-cta h3 { margin: 0; font: 600 1rem var(--f-display) }
.rd-cta .lst { display: flex; flex-direction: column; gap: 8px }
.rd-cta a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface-2) }
.rd-cta a:hover { border-color: var(--line-2) }
.rd-cta a .nm { font-weight: 600; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap }
.rd-cta a .tt { color: var(--muted); font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.rd-note { font-size: 0.75rem; color: var(--muted); margin: 0 }
.rd-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }
.rd-nav button { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-width: 0 }
.rd-nav button:hover:not(:disabled) { border-color: var(--line-2) }
.rd-nav button:disabled { opacity: .4; cursor: default }
.rd-nav .k { font: 500 0.6875rem var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted) }
.rd-nav .t { font-weight: 600; font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.rd-nav .next { text-align: right; align-items: flex-end }
.readbtn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent); font-size: 0.8125rem; font-weight: 600; text-decoration: none }
.readbtn:hover { filter: brightness(0.97) }
@media (max-width: 600px) { .rd-nav { grid-template-columns: 1fr } .rd-bar { top: calc(env(safe-area-inset-top, 0px) + 112px) } }

/* Radio */
.radio-wrap { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start }
@media (max-width: 860px) { .radio-wrap { grid-template-columns: minmax(0, 1fr) } }
.deck { background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 30%, #15161c), #15161c 60%); color: #f4f4f7; border-radius: 20px; padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; grid-column: 1 / -1; box-shadow: var(--shadow-2) }
.deck .top-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap }
.onair { font: 500 0.6875rem var(--f-mono); letter-spacing: 0.14em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; border: 1px solid rgb(255 255 255 / 0.25); color: rgb(255 255 255 / 0.7); display: inline-flex; gap: 6px; align-items: center }
.onair::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .6 }
.onair.live { background: #e0412f; border-color: #e0412f; color: #fff }
.onair.live::before { opacity: 1; animation: blink 1.2s infinite }
@keyframes blink { 50% { opacity: .2 } }
.deck h2 { font: 700 1.625rem/1.15 var(--f-display); letter-spacing: -0.015em; margin: 0; text-wrap: balance }
.deck .sub { font-size: 0.875rem; color: rgb(255 255 255 / 0.7) }
.transport { display: flex; align-items: center; gap: 10px; flex-wrap: wrap }
.tbtn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgb(255 255 255 / 0.22); background: rgb(255 255 255 / 0.04); color: #fff; display: grid; place-items: center; cursor: pointer }
.tbtn:hover:not(:disabled) { background: rgb(255 255 255 / 0.12) }
.tbtn:disabled { opacity: .35; cursor: default }
.tbtn.big { width: 60px; height: 60px; background: #fff; color: #15161c; border-color: #fff }
.tbtn.big:hover:not(:disabled) { background: #ececf1 }
.now { font-size: 0.875rem; color: rgb(255 255 255 / 0.8); min-width: 0 }
.now b { color: #fff }
.prefs { display: flex; gap: 14px; flex-wrap: wrap; align-items: end; font-size: 0.75rem; color: rgb(255 255 255 / 0.7) }
.prefs label { display: flex; flex-direction: column; gap: 4px }
.prefs select { background: rgb(255 255 255 / 0.06); color: #fff; border: 1px solid rgb(255 255 255 / 0.22); border-radius: 8px; padding: 5px 8px; font-size: 0.8125rem }
.prefs select option { color: #15161c }
.chapters { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 80px) }
@media (max-width: 860px) { .chapters { position: static } }
.chap { width: 100%; text-align: left; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; border: 1px solid transparent; background: transparent; border-radius: 12px; padding: 10px 12px; cursor: pointer }
.chap:hover { background: var(--surface) }
.chap[aria-current="true"] { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-1) }
.chap .num { font: 500 0.75rem var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums }
.chap[aria-current="true"] .num { color: var(--accent) }
.chap .ct { font-weight: 600; font-size: 0.875rem }
.chap .cm { font: 0.6875rem var(--f-mono); color: var(--muted) }
.chap.heard .ct { color: var(--muted) }
.transcript { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; min-width: 0; box-shadow: var(--shadow-1) }
.transcript h3 { font: 600 1.125rem var(--f-display); margin: 0 0 8px }
.tline { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 8px 10px; border-radius: 10px; max-width: 76ch; color: var(--ink-2) }
.tline .who { font: 600 0.6875rem var(--f-mono); text-transform: uppercase; letter-spacing: 0.08em; padding-top: 3px }
.tline .who.p { color: var(--s-est) } .tline .who.h { color: var(--s-glo) }
.tline.on { background: var(--accent-soft); color: var(--ink) }

.state { background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r-lg); padding: 28px 22px; color: var(--muted) }
.state h2 { font: 600 1.125rem var(--f-display); color: var(--ink); margin: 0 0 6px }
.state p { margin: 0 }
.skel { height: 140px; border-radius: var(--r-lg); background: linear-gradient(90deg, var(--surface), var(--bg-2), var(--surface)); background-size: 200% 100%; animation: sh 1.4s infinite linear; border: 1px solid var(--line) }
@keyframes sh { to { background-position: -200% 0 } }
@media (prefers-reduced-motion: reduce) { .skel, .onair.live::before { animation: none } .toggle .icon, .seg .thumb, .story, .pop { transition: none; animation: none } }
.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 9px 16px; border-radius: 999px; font-size: 0.8125rem; z-index: 50; box-shadow: var(--shadow-2) }

/* ---------- PWA: login, conta, player de áudio ---------- */
.mt8 { margin-top: 8px }
.field.w240 { max-width: 240px }
.legend .lg-up { background: var(--up) } .legend .lg-miss { background: var(--miss) } .legend .lg-down { background: var(--down) }
.login { max-width: 440px; margin: 8vh auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px 24px; box-shadow: var(--shadow-2); display: flex; flex-direction: column; gap: 14px; grid-column: 1 / -1 }
.login h2 { font: 700 1.5rem/1.15 var(--f-display); margin: 0; letter-spacing: -0.01em }
.login-form { display: flex; flex-direction: column; gap: 10px }
.field.big { height: 46px; font-size: 1rem; border-radius: 12px; padding: 0 14px }
.field.code { font: 500 1.25rem var(--f-mono); letter-spacing: 0.3em; text-align: center }
.btn.big { height: 46px; font-size: 0.9375rem; justify-content: center; border-radius: 12px; font-weight: 600 }
.btn:disabled { opacity: .55; cursor: default }
.login .row { display: flex; gap: 16px; flex-wrap: wrap }
.login-msg { min-height: 1.4em; margin: 0; font-size: 0.875rem; color: var(--ink-2) }
.account { display: flex; flex-direction: column; gap: 8px; align-items: flex-start }
.account p { overflow-wrap: anywhere }
.tbtn.txt { font: 600 0.75rem var(--f-mono) }
.seekrow { display: flex; align-items: center; gap: 12px }
.seekrow .time { font: 500 0.75rem var(--f-mono); color: rgb(255 255 255 / 0.75); font-variant-numeric: tabular-nums; white-space: nowrap }
.seekbar { --p: 0%; flex: 1; min-width: 0; appearance: none; -webkit-appearance: none; height: 28px; background: transparent; cursor: pointer }
.seekbar::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: linear-gradient(90deg, #fff var(--p), rgb(255 255 255 / 0.22) var(--p)) }
.seekbar::-moz-range-track { height: 6px; border-radius: 999px; background: linear-gradient(90deg, #fff var(--p), rgb(255 255 255 / 0.22) var(--p)) }
.seekbar::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -5px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / 0.4) }
.seekbar::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff }
.seekbar:disabled { opacity: .4 }
.deck .prefs { justify-content: space-between; align-items: center }
.deck .now { font-size: 0.875rem; color: rgb(255 255 255 / 0.85) }
@media (max-width: 600px) { .transport { justify-content: center } .tbtn { width: 42px; height: 42px } .tbtn.big { width: 58px; height: 58px } }
[hidden] { display: none !important }
.layout.auth { grid-template-columns: minmax(0, 1fr) }
