/* Castopod Mobile — hi-fi stylesheet.
   Pine & Linen defaults for first paint; theme.js overwrites the tokens from
   /api/themes (3 themes × light/dark). Never hardcode a theme color below —
   derive everything from the custom properties. */

@font-face {
  font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 600;
  font-display: swap; src: url("/fonts/bricolage-600.woff2") format("woff2");
}
@font-face {
  font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 700;
  font-display: swap; src: url("/fonts/bricolage-700.woff2") format("woff2");
}
@font-face {
  font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 800;
  font-display: swap; src: url("/fonts/bricolage-800.woff2") format("woff2");
}

:root {
  --bg: #F6F1E7; --surface: #FDFAF4; --surface-2: #EFE8D9; --ink: #23201A;
  --muted: #6E675B; --line: #DDD4C2; --primary: #00564B; --primary-soft: #0A7C6C;
  --primary-tint: #E1EAE4; --accent: #C97B22; --accent-tint: #F3E3CC;
  --special: #6D4A6E; --on-primary: #F6F1E7;
  --good: #2E7D4F; --warn: #B07818; --stale: #8A8375;

  /* derived (recompute automatically when the base tokens change) */
  --font-display: "Bricolage Grotesque", "Avenir Next", "Seravek", "Segoe UI", system-ui, sans-serif;
  --font-sans: "Avenir Next", "Seravek", "Segoe UI", system-ui, sans-serif;
  --font-serif: Charter, "Iowan Old Style", Georgia, serif;
  --accent-bright: color-mix(in srgb, var(--accent) 78%, #fff);
  --pine-top: color-mix(in srgb, var(--primary) 74%, #000);
  --pine-bot: color-mix(in srgb, var(--primary) 62%, #000);
  --route-top: color-mix(in srgb, var(--ink) 92%, #000);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow-cover: 0 4px 14px -6px rgba(0, 0, 0, .4);
  --shadow-pop: 0 18px 40px -12px rgba(0, 0, 0, .45);
  --safe-b: env(safe-area-inset-bottom);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font-sans); line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.ic { display: block; }

#app {
  max-width: 520px; margin: 0 auto; height: 100dvh;
  display: flex; flex-direction: column; background: var(--bg); position: relative;
}
#main { flex: 1; overflow-y: auto; padding: calc(8px + env(safe-area-inset-top)) 18px 22px; -webkit-overflow-scrolling: touch; }
@media (prefers-reduced-motion: no-preference) {
  #main.enter { animation: screenIn .32s var(--ease); }
}

/* ---------- type ---------- */
h1.screen {
  font-family: var(--font-display); font-size: 29px; font-weight: 700;
  letter-spacing: -0.02em; margin: 6px 0 18px;
}
.display { font-family: var(--font-display); letter-spacing: -0.015em; }
.sub {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; color: var(--muted); letter-spacing: .11em; text-transform: uppercase;
  font-weight: 700; margin: 22px 0 10px;
}
.sub:first-child { margin-top: 6px; }
/* Padding + matching negative margin: a thumb-sized hit area, same visual spot.
   Without it this is a ~19px-tall sliver that's near-impossible to tap. */
.sub .more { text-transform: none; letter-spacing: 0; color: var(--primary); font-weight: 600; font-size: 12.5px;
  padding: 13px 4px 13px 16px; margin: -13px -4px -13px 0; }
.sub .eyebrow-ic { display: inline-flex; align-items: center; gap: 7px; color: var(--primary); }
.serif { font-family: var(--font-serif); }

/* ---------- cards & rows ---------- */
.card {
  display: block;  /* cards are often <a> — without this the inline box paints a stray tall background */
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 11px; margin-bottom: 10px; box-shadow: var(--shadow-card);
}
.card.tappable { cursor: pointer; transition: background .12s, transform .12s; }
.card.tappable:active { background: var(--surface-2); transform: scale(.994); }
.row { display: flex; gap: 12px; align-items: center; }
.grow { flex: 1; min-width: 0; }
.tt { font-weight: 650; font-size: 14.5px; line-height: 1.28; }
.tt.ellipsis, .st.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st { font-size: 12px; color: var(--muted); }
.dim { opacity: .5; }

/* artwork */
.art {
  width: 52px; height: 52px; border-radius: 11px; flex-shrink: 0; position: relative;
  overflow: hidden; background: linear-gradient(135deg, var(--primary), var(--primary-soft));
  color: var(--on-primary); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
}
.art.big { width: 84px; height: 84px; border-radius: 16px; font-size: 26px; }
.art.img { background-size: cover; background-position: center; background-color: var(--surface-2); }
.art > img { width: 100%; height: 100%; object-fit: cover; }
.art .dot {
  position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px;
  border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  padding: 0 6px; border: 2.5px solid var(--bg);
}
.art .fresh-cover {
  position: absolute; bottom: 6px; left: 6px; font-size: 9.5px; font-weight: 700;
  letter-spacing: .02em; padding: 2px 7px; border-radius: 999px; backdrop-filter: blur(4px);
}

.covers { display: flex; gap: 12px; overflow-x: auto; padding: 4px 18px 6px; margin: 0 -18px; scrollbar-width: none; }
.covers::-webkit-scrollbar { display: none; }
.coveritem { width: 100px; flex-shrink: 0; cursor: pointer; }
.coveritem .art { width: 100px; height: 100px; border-radius: 16px; box-shadow: var(--shadow-cover); overflow: visible; }
.coveritem .art .imgwrap { position: absolute; inset: 0; border-radius: 16px; overflow: hidden; }
.coveritem .cap { font-size: 12px; font-weight: 600; color: var(--ink); margin: 8px 0 0; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coveritem .capsub { font-size: 10.5px; color: var(--muted); margin-top: 2px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* progress */
.progress { height: 4px; border-radius: 3px; background: var(--surface-2); margin-top: 7px; overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 3px; background: var(--accent); transition: width .3s linear; }

/* round play button (on cards) */
.pbtn {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: var(--on-primary);
}
.pbtn .ic { width: 16px; height: 16px; }
.pbtn.outline { background: transparent; border: 1.6px solid var(--primary); color: var(--primary); width: 36px; height: 36px; }
.pbtn.outline .ic { width: 15px; height: 15px; }

/* ---------- freshness pills ---------- */
.fresh {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  padding: 2px 9px; border-radius: 999px;
}
.fresh::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.f-fresh { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.f-new { color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); }
.f-irregular { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.f-stale { color: var(--stale); background: color-mix(in srgb, var(--stale) 16%, transparent); }
.f-cult { color: var(--special); background: color-mix(in srgb, var(--special) 15%, transparent); }
/* cover variant fills */
.fc-fresh { background: color-mix(in srgb, var(--good) 82%, transparent); color: #fff; }
.fc-new { background: color-mix(in srgb, var(--accent) 84%, transparent); color: #fff; }
.fc-irregular { background: color-mix(in srgb, var(--warn) 84%, transparent); color: #fff; }
.fc-stale { background: color-mix(in srgb, var(--stale) 84%, transparent); color: #fff; }
.fc-cult { background: color-mix(in srgb, var(--special) 84%, transparent); color: #fff; }

/* ---------- chips ---------- */
.chiprow { display: flex; gap: 8px; overflow-x: auto; margin: 14px -18px 0; padding: 0 18px 2px; scrollbar-width: none; }
.chiprow::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; font-size: 12.5px; font-weight: 500; padding: 7px 14px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); white-space: nowrap;
}
.chip.on { background: var(--primary-tint); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }

/* ---------- buttons ---------- */
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  font-size: 14px; font-weight: 600; padding: 10px 18px; border-radius: 999px;
  transition: transform .1s;
}
.btn .ic { width: 17px; height: 17px; }
.btn.p { background: var(--primary); color: var(--on-primary); }
.btn.s { border: 1.5px solid var(--primary); color: var(--primary); }
.btn.g { background: var(--surface-2); border: 1px solid var(--line); }
.btn.a { background: transparent; border: 1.5px solid var(--accent); color: var(--accent); }
.btn:active { transform: scale(.97); }
.btn.icononly { padding: 10px; border-radius: 50%; }
.iconbtn {
  width: 38px; height: 38px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; color: var(--ink);
}
.iconbtn.chrome { background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line); }
.iconbtn .ic { width: 19px; height: 19px; }
/* radio station: on-air state + pulsing red dot */
.iconbtn.radio { position: relative; }
.iconbtn.radio.onair { color: #e2483d; }
.onairdot { position: absolute; top: 5px; right: 5px; width: 9px; height: 9px; border-radius: 50%;
  background: #e2483d; box-shadow: 0 0 0 2px var(--bg); animation: onair 1.6s ease-in-out infinite; }
.onairdot.big { position: static; width: 11px; height: 11px; box-shadow: none; flex: none; }
@keyframes onair { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- search ---------- */
.searchfield {
  display: flex; align-items: center; gap: 9px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; padding: 3px 14px; box-shadow: var(--shadow-card);
}
.searchfield .ic { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.searchfield input {
  flex: 1; font: inherit; font-size: 16px; color: var(--ink); background: none;
  border: none; padding: 12px 0; min-width: 0;
}
.searchfield input:focus { outline: none; }
.searchfield input::placeholder { color: var(--muted); }
.searchbox {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.searchbox:focus { outline: 2px solid var(--primary); border-color: transparent; }
.hint { display: flex; align-items: flex-start; gap: 7px; font-size: 11.5px; color: var(--stale); margin-top: 10px; }
.hint .ic { width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; }

/* moment (transcript) card */
.moment {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer;
}
.moment .quote { font-family: var(--font-serif); font-size: 14.5px; font-style: italic; color: var(--ink); line-height: 1.45; }
.moment .at { display: flex; align-items: center; gap: 7px; margin-top: 9px; font-size: 11.5px; color: var(--muted); }
.moment .at .stamp { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-weight: 600; }
.moment .at .stamp .ic { width: 13px; height: 13px; }

/* ---------- home ---------- */
.resume { display: flex; gap: 12px; align-items: center; }
.curated {
  border-radius: 18px; overflow: hidden; border: 1px solid var(--line);
  box-shadow: var(--shadow-card); cursor: pointer;
}
.curated .hdr { height: 116px; position: relative; display: flex; align-items: flex-end; padding: 12px; background: linear-gradient(120deg, var(--special), color-mix(in srgb, var(--special) 55%, #000)); }
.curated .hdr img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.curated .scrim { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, .55)); pointer-events: none; }
.curated .title { position: relative; font-family: var(--font-display); font-size: 19px; font-weight: 700; color: #fff; line-height: 1.15; letter-spacing: -0.01em; text-shadow: 0 1px 8px rgba(0, 0, 0, .35); }
.curated .signed {
  position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 6px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); border-radius: 999px; padding: 3px 10px 3px 4px;
}
.curated .signed .av { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; }
.curated .signed span { font-size: 11px; font-weight: 700; color: var(--ink); }
.curated .hdr { background-size: cover; background-position: center; }
.curated .foot { background: var(--surface); padding: 9px 12px; font-size: 12px; color: var(--muted); }

/* Editorial — article page */
.articlehero { height: 200px; border-radius: 16px; background-size: cover; background-position: center; background-color: var(--surface-2); }
.articlesub { font-size: 16px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.articlebody { margin-top: 16px; }
.articlebody.clamp { display: -webkit-box; -webkit-line-clamp: 10; line-clamp: 10; -webkit-box-orient: vertical; overflow: hidden; }

/* Editorial — back-office editor */
.edimgwrap { display: flex; gap: 12px; align-items: flex-start; }
.edimg { width: 88px; height: 88px; border-radius: 12px; background-size: cover; background-position: center; background-color: var(--surface-2); flex: none; }
.edimg.empty { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.edpicked { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.edrow { display: flex; align-items: center; gap: 10px; padding: 7px 8px; background: var(--surface); border-radius: 10px; }
.art.sm { width: 36px; height: 36px; border-radius: 8px; font-size: 12px; flex: none; }
.edprev { min-height: 120px; padding: 10px 12px; background: var(--surface); border-radius: 12px; }
#edResults { max-height: 260px; overflow-y: auto; margin-top: 8px; }
#edResults .sres { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 10px; cursor: pointer; }
#edResults .sres:active { background: var(--surface-2); }
#edResults .sres .ic { width: 18px; height: 18px; color: var(--primary); flex-shrink: 0; }
.edrow .iconbtn { flex: none; }
.reasonline { font-size: 13px; color: var(--muted); font-style: italic; margin: 0 0 12px; }
.recrow { display: flex; gap: 10px; overflow-x: auto; margin: 0 -18px; padding: 0 18px 4px; scrollbar-width: none; }
.recrow::-webkit-scrollbar { display: none; }
.reccard { width: 150px; flex-shrink: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px; cursor: pointer; box-shadow: var(--shadow-card); }
.reccard .art { width: 100%; height: 78px; border-radius: 10px; margin-bottom: 9px; }

/* ---------- show page ---------- */
.showbanner { position: relative; height: 150px; margin: 0 -18px 0; border-radius: 16px; overflow: hidden; }
.showbanner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.showbanner .fill { position: absolute; inset: 0; background: linear-gradient(135deg, var(--primary), var(--primary-soft)); }
.showbanner .scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .1), rgba(0, 0, 0, .35)); }
.showbanner .back { position: absolute; top: 14px; left: 14px; }
.showhead { display: flex; gap: 14px; align-items: flex-end; margin: -46px 0 0; position: relative; }
.showhead .art { width: 88px; height: 88px; border-radius: 16px; border: 3px solid var(--bg); }
.showhead .meta { flex: 1; min-width: 0; padding-bottom: 4px; }
.showhead .meta .st { margin-top: 3px; }
.statrow { display: flex; gap: 16px; align-items: center; margin: 14px 0 2px; font-size: 12.5px; color: var(--muted); }
.statrow .s { display: inline-flex; align-items: center; gap: 5px; }
.statrow .s .ic { width: 15px; height: 15px; }
.statrow .s.fedi { color: var(--special); }
.eplist .ep { display: flex; gap: 12px; align-items: center; padding: 12px 2px; border-top: 1px solid var(--line); }
.eplist .ep:first-child { border-top: none; }
.eplist .ep .grow .tt { font-size: 14px; }
.eplist .ep.read { opacity: .5; }
.pressblurb { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; }
.pressblurb .lbl { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.pressblurb .txt { font-family: var(--font-serif); font-size: 14px; color: var(--ink); line-height: 1.5; }

/* ---------- episode page ---------- */
.epmeta { font-size: 12.5px; color: var(--muted); }
.fedibar { display: flex; align-items: center; gap: 12px; margin: 10px 0 2px; font-size: 12.5px; color: var(--muted); }
.fedibar .g { display: inline-flex; align-items: center; gap: 5px; }
.fedibar .g .ic { width: 15px; height: 15px; }
.fedibar .g.likes { color: var(--special); }
.fedibar a.fedi-acct { color: var(--primary); font-weight: 600; }
.fedibar .fedilike { color: var(--muted); font-weight: 600; }
.fedibar .fedilike.on { color: var(--special); }
.fedibar .fedilike.on .ic { fill: var(--special); }
.fedibar .fedilike:active { transform: scale(.94); }
.fedicompose { margin: 6px 0 14px; }
.fedicompose textarea.searchbox { resize: vertical; min-height: 54px; line-height: 1.4; }
.fediposts .card.mine { border-color: var(--primary); }
.fediposts .mine-tag { color: var(--primary); font-weight: 700; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.fedibar .share { margin-left: auto; color: var(--primary); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.fedibar .share .ic { width: 16px; height: 16px; }
.fediposts { margin-top: 4px; }
.segtabs { display: flex; gap: 8px; overflow-x: auto; margin: 16px -18px 14px; padding: 0 18px; scrollbar-width: none; }
.segtabs::-webkit-scrollbar { display: none; }
.segtab { flex-shrink: 0; font-size: 13px; font-weight: 500; padding: 7px 15px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); }
.segtab.on { background: var(--primary-tint); border-color: var(--primary); color: var(--primary); font-weight: 700; }
.shownotes { font-family: var(--font-serif); font-size: 15.5px; line-height: 1.62; color: var(--ink); }
.shownotes a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.chapters .ch { display: flex; gap: 12px; align-items: center; padding: 11px 2px; border-top: 1px solid var(--line); }
.chapters .ch:first-child { border-top: none; }
.chapters .ch .time { width: 46px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.chapters .ch.now .time, .chapters .ch.now .lbl { color: var(--accent); }
.chapters .ch .lbl { flex: 1; font-size: 13.5px; color: var(--ink); }
.chapters .ch .now-tag { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); display: inline-flex; align-items: center; gap: 4px; }
.guest { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px; margin-bottom: 10px; }
.guest .avatar { width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0; overflow: hidden; background: linear-gradient(135deg, var(--special), var(--primary-soft)); }
.guest .role { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); }
.guest .name { font-family: var(--font-display); font-weight: 700; font-size: 16px; margin: 1px 0; }
.guest .handle { font-size: 12px; color: var(--special); }
.guest .bio { font-family: var(--font-serif); font-size: 13.5px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.linkcard { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 11px; margin-bottom: 10px; }
.linkcard .badge { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; background: var(--primary-tint); color: var(--primary); }
.linkcard .ext { color: var(--muted); }
.linkcard .ext .ic { width: 17px; height: 17px; }
.holdbtn { border: 1.5px solid var(--accent); color: var(--accent); border-radius: 999px; padding: 11px 18px; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; user-select: none; touch-action: none; }
.holdbtn.recording { background: var(--accent); color: #fff; }
.holdbtn .ic { width: 17px; height: 17px; }
.resumecard { display: flex; align-items: center; gap: 12px; background: var(--primary); color: var(--on-primary); border-radius: 16px; padding: 13px 16px; margin: 14px 0; }
.resumecard .grow .lbl { font-weight: 700; font-size: 15px; }
.resumecard .grow .sub2 { font-size: 12px; opacity: .8; margin-top: 2px; }
.resumecard .go { width: 42px; height: 42px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.resumecard .go .ic { width: 17px; height: 17px; }

/* ---------- selections ---------- */
.selcard { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow-card); }
.selcard .tile { width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.selcard .tile .ic { width: 22px; height: 22px; }
.selcard .kindlbl { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.selcard .prompt { font-family: var(--font-serif); font-style: italic; font-size: 13px; color: var(--muted); margin-top: 2px; }
.selcard .radio { color: var(--primary); }
.radiocard { border: 1.5px solid var(--primary); border-radius: 16px; padding: 14px; margin-bottom: 10px; }
.radiocard .hd { display: flex; align-items: center; gap: 9px; color: var(--primary); font-weight: 700; font-size: 15px; }
.radiocard .hd .ic { width: 20px; height: 20px; }
.artcard { border: 1.5px dashed var(--line); border-radius: 16px; padding: 14px; margin-bottom: 10px; }
.artcard .hd { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.artcard .hd .ic { width: 20px; height: 20px; color: var(--primary); }

/* ---------- bookmarks ---------- */
.bmrow { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 11px; margin-bottom: 10px; }
.bmrow .rule { width: 3px; align-self: stretch; border-radius: 3px; background: var(--accent); flex-shrink: 0; }
.bmrow .fediget { color: var(--special); }
.bmrow .fediget .ic, .bmrow .del .ic { width: 18px; height: 18px; }

/* ---------- mini-player ---------- */
#playerbar:empty { display: none; }
#playerbar { position: relative; margin: 0 8px; z-index: 5; }
.mini {
  background: var(--primary); border-radius: 16px; overflow: hidden;
  box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--primary) 60%, transparent);
}
@media (prefers-reduced-motion: no-preference) { .mini { animation: playerUp .32s var(--ease); } }
.mini .body { display: flex; align-items: center; gap: 11px; padding: 9px 11px; }
.mini .art { width: 40px; height: 40px; border-radius: 9px; }
.mini .meta { flex: 1; min-width: 0; cursor: pointer; }
.mini .meta .t { font-weight: 650; font-size: 13px; color: var(--on-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .meta .s { font-size: 11px; color: color-mix(in srgb, var(--on-primary) 72%, transparent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .skip { color: var(--on-primary); opacity: .85; padding: 4px; }
.mini .skip .ic { width: 22px; height: 22px; }
.mini .pp { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mini .pp .ic { width: 15px; height: 15px; }
.mini .seek { position: relative; height: 18px; cursor: pointer; touch-action: none; }
.mini .seek .track { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); height: 4px; border-radius: 3px; background: color-mix(in srgb, var(--on-primary) 24%, transparent); }
.mini .seek .fill { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.mini .seek .cursor { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 13px; height: 13px; border-radius: 50%; background: var(--on-primary); box-shadow: 0 1px 5px rgba(0, 0, 0, .45); }

/* ---------- full-screen player ---------- */
#fullplayer:empty, #routelayer:empty, #routechip:empty { display: none; }
.fullplayer {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column;
  padding: calc(46px + env(safe-area-inset-top)) 26px calc(30px + var(--safe-b));
  background: linear-gradient(180deg, var(--pine-top) 0%, var(--primary) 46%, var(--pine-bot) 100%);
  color: var(--on-primary); max-width: 520px; margin: 0 auto;
}
@media (prefers-reduced-motion: no-preference) { .fullplayer { animation: playerUp .34s var(--ease); } }
.fullplayer .top { display: flex; align-items: center; justify-content: space-between; }
.fullplayer .top .lbl { font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; opacity: .75; }
.fullplayer .top .ic { width: 25px; height: 25px; }
.fullplayer .stage { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 26px; }
.fullplayer .cover { width: min(236px, 62vw); aspect-ratio: 1; border-radius: 22px; overflow: hidden; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .55); background: linear-gradient(135deg, var(--primary-soft), var(--special)); }
.fullplayer .ti { text-align: center; }
.fullplayer .ti .t { font-family: var(--font-display); font-size: 23px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.fullplayer .ti .s { font-size: 14px; opacity: .68; margin-top: 6px; }
.fullplayer .seek { height: 6px; border-radius: 4px; background: color-mix(in srgb, var(--on-primary) 22%, transparent); position: relative; cursor: pointer; touch-action: none; }
.fullplayer .seek .fill { display: block; height: 100%; border-radius: 4px; background: var(--accent-bright); }
.fullplayer .seek .cursor { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 15px; height: 15px; border-radius: 50%; background: var(--on-primary); box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.fullplayer .times { display: flex; justify-content: space-between; font-size: 12px; opacity: .7; margin-top: 8px; font-variant-numeric: tabular-nums; }
.fullplayer .transport { display: flex; align-items: center; justify-content: center; gap: 26px; margin-top: 20px; }
.fullplayer .transport .skip .ic { width: 30px; height: 30px; }
.fullplayer .bigplay { width: 70px; height: 70px; border-radius: 50%; background: var(--on-primary); color: var(--primary); display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px -6px rgba(0, 0, 0, .4); }
.fullplayer .bigplay .ic { width: 26px; height: 26px; }
.fullplayer .extra { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; color: color-mix(in srgb, var(--on-primary) 82%, transparent); }
.fullplayer .speed { font-size: 13px; font-weight: 700; background: color-mix(in srgb, var(--on-primary) 14%, transparent); padding: 6px 12px; border-radius: 999px; }
.fullplayer .sb { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--accent-bright); }
.fullplayer .sb .ic { width: 17px; height: 17px; }
.fullplayer .bm .ic { width: 20px; height: 20px; }

/* ---------- mode route ---------- */
.routemode {
  position: fixed; inset: 0; z-index: 65; display: flex; flex-direction: column;
  padding: calc(46px + env(safe-area-inset-top)) 22px calc(30px + var(--safe-b));
  background: linear-gradient(180deg, var(--route-top) 0%, var(--pine-bot) 100%);
  color: var(--on-primary); max-width: 520px; margin: 0 auto;
}
@media (prefers-reduced-motion: no-preference) { .routemode { animation: fadeIn .3s; } }
.routemode .top { display: flex; align-items: center; justify-content: space-between; }
.routemode .top .lbl { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-bright); }
.routemode .top .lbl .ic { width: 20px; height: 20px; }
.routemode .top .quit { font-size: 14px; font-weight: 600; color: color-mix(in srgb, var(--on-primary) 80%, transparent); padding: 6px 10px; }
.routemode .stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.routemode .visual { width: 180px; height: 180px; border-radius: 22px; overflow: hidden; box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .6); background: linear-gradient(135deg, var(--primary), var(--special)); }
.routemode .cap { text-align: center; font-size: 13px; color: color-mix(in srgb, var(--on-primary) 66%, transparent); max-width: 240px; line-height: 1.5; }
.routemode .rtitle { font-family: var(--font-display); font-size: 20px; font-weight: 700; text-align: center; line-height: 1.2; margin-bottom: 16px; }
.routemode .seek { height: 6px; border-radius: 4px; background: color-mix(in srgb, var(--on-primary) 22%, transparent); margin-bottom: 22px; cursor: pointer; touch-action: none; position: relative; }
.routemode .seek .fill { display: block; height: 100%; border-radius: 4px; background: var(--accent-bright); }
.routemode .transport { display: flex; align-items: center; justify-content: center; gap: 24px; }
.routemode .sidebtn { width: 76px; height: 76px; border-radius: 50%; background: color-mix(in srgb, var(--on-primary) 14%, transparent); display: flex; align-items: center; justify-content: center; }
.routemode .sidebtn .ic { width: 38px; height: 38px; }
.routemode .bigplay { width: 100px; height: 100px; border-radius: 50%; background: var(--accent-bright); color: var(--ink); display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 30px -8px color-mix(in srgb, var(--accent) 60%, transparent); }
.routemode .bigplay .ic { width: 40px; height: 40px; }
.routemode .voice { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 24px; padding: 15px; border-radius: 16px; background: color-mix(in srgb, var(--on-primary) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); font-size: 14px; font-weight: 600; color: var(--accent-bright); }
.routemode .voice .ic { width: 20px; height: 20px; }
.routechip {
  position: fixed; right: 14px; bottom: calc(150px + var(--safe-b)); z-index: 37;
  display: inline-flex; align-items: center; gap: 7px; background: var(--ink); color: var(--bg);
  font-size: 12px; font-weight: 600; padding: 9px 13px; border-radius: 999px;
  box-shadow: 0 8px 22px -8px rgba(0, 0, 0, .5); cursor: pointer;
}
.routechip .ic { width: 17px; height: 17px; color: var(--accent-bright); }

/* ---------- tab bar ---------- */
#tabbar {
  display: flex; height: 76px; background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(16px); border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
#tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding-top: 11px; font-size: 10px; color: var(--muted); font-weight: 500;
}
#tabbar a svg { width: 24px; height: 24px; }
#tabbar a.on { color: var(--primary); font-weight: 700; }

/* ---------- À suivre overlay ---------- */
#overlay:empty, #sheet:empty { display: none; }
#overlay { position: fixed; left: 0; right: 0; bottom: calc(76px + var(--safe-b)); z-index: 55; max-width: 520px; margin: 0 auto; padding: 0 8px; }
.nextup { background: var(--surface); border: 1.5px solid var(--accent); border-radius: 18px; padding: 12px; box-shadow: var(--shadow-pop); }
@media (prefers-reduced-motion: no-preference) { .nextup { animation: playerUp .3s var(--ease); } }
.nextup .hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.nextup .hd .t { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.nextup .countdown { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--accent); font-weight: 600; }
.nextup .countdown .ic { width: 13px; height: 13px; }
.nextup .n { display: flex; gap: 10px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 9px; margin-bottom: 7px; cursor: pointer; }
.nextup .n .art { width: 38px; height: 38px; border-radius: 9px; }
.nextup .n .kind { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.nextup .n .t { font-weight: 650; font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nextup .n .reason { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nextup .n .play { color: var(--primary); }
.nextup .n .play .ic { width: 18px; height: 18px; }
.nextup .cancel { text-align: center; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 6px; width: 100%; }

/* ---------- Apparence sheet ---------- */
#sheet { position: fixed; inset: 0; z-index: 70; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(35, 32, 26, .4); }
@media (prefers-reduced-motion: no-preference) { .sheet-scrim { animation: fadeIn .2s; } }
.sheetbody {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 520px; margin: 0 auto;
  background: var(--bg); border-radius: 26px 26px 0 0; padding: 10px 22px calc(30px + var(--safe-b));
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .25);
}
@media (prefers-reduced-motion: no-preference) { .sheetbody { animation: sheetUp .32s var(--ease); } }
.sheetbody .grab { width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 16px; }
.sheetbody h2 { font-family: var(--font-display); font-size: 20px; font-weight: 700; margin: 0 0 3px; }
.sheetbody .subhead { font-size: 13px; color: var(--muted); margin: 0 0 18px; }
.themegrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.themecard { border: 2px solid var(--line); border-radius: 14px; padding: 10px 8px; cursor: pointer; }
.themecard.on { border-color: var(--primary); }
.themecard .swatches { display: flex; gap: 4px; justify-content: center; margin-bottom: 8px; }
.themecard .swatches i { width: 16px; height: 16px; border-radius: 5px; display: block; border: 1px solid rgba(127, 127, 127, .18); }
.themecard .nm { font-size: 12px; font-weight: 700; text-align: center; }
.segmented { display: flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; }
.segmented button { flex: 1; padding: 9px 0; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); }
.segmented button.on { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* ---------- new-selection form (sheet) ---------- */
.sheetbody.form { max-height: 88dvh; overflow-y: auto; }
.selform .fieldlabel { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 16px 0 7px; }
.selform textarea.searchbox { resize: vertical; min-height: 58px; line-height: 1.4; }
.selform .kindstatic { display: inline-block; font-weight: 700; font-size: 13.5px; color: var(--primary); background: var(--primary-tint); border-radius: 10px; padding: 8px 13px; }
.selform .kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.selform .kindpick { border: 2px solid var(--line); border-radius: 13px; padding: 10px 12px; text-align: left; }
.selform .kindpick.on { border-color: var(--primary); background: var(--primary-tint); }
.selform .kindpick .k { font-weight: 700; font-size: 13.5px; color: var(--ink); }
.selform .kindpick .h { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.3; }
.selform .minihint { display: flex; align-items: flex-start; gap: 7px; font-size: 12px; color: var(--muted); margin-top: 9px; line-height: 1.4; }
.selform .minihint .ic { width: 13px; height: 13px; flex-shrink: 0; margin-top: 2px; color: var(--special); }
.selform .results { max-height: 200px; overflow-y: auto; margin-top: 8px; }
.selform .sres { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 10px; cursor: pointer; }
.selform .sres:active { background: var(--surface-2); }
.selform .sres .ic { width: 18px; height: 18px; color: var(--primary); flex-shrink: 0; }
.selform .picked { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.selform .pchip { display: inline-flex; align-items: center; gap: 7px; background: var(--primary-tint); color: var(--primary); border-radius: 999px; padding: 5px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.selform .pchip .x { font-size: 16px; line-height: 1; opacity: .8; }
.selform .createbtn { margin-top: 22px; }
/* add-to-selection picker rows */
.selrow { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; margin-bottom: 8px; background: var(--surface); }
.selrow.on { border-color: var(--primary); background: var(--primary-tint); }
.selrow .tt { font-weight: 600; font-size: 14px; }
.selrow .kindlbl { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.selrow .mark { color: var(--primary); flex-shrink: 0; display: inline-flex; }
.selrow .mark .ic { width: 18px; height: 18px; }
.selrow:disabled { opacity: .4; }
.selform .createbtn:disabled { opacity: .45; }
.selcard .del { color: var(--warn); flex-shrink: 0; }
.selcard .del.confirm { width: auto; padding: 7px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: color-mix(in srgb, var(--warn) 13%, transparent); }

/* ---------- account sheet ---------- */
.acctcard { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.acctcard .acctav { width: 46px; height: 46px; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 800; font-size: 18px; flex-shrink: 0; }
.acctcard .acctname { font-weight: 700; font-size: 15px; }
.logoutbtn { color: var(--warn); }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; bottom: calc(150px + var(--safe-b)); transform: translateX(-50%); z-index: 80; pointer-events: none; }
#toast:empty { display: none; }
.toast { display: flex; align-items: center; gap: 8px; background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 600; padding: 11px 18px; border-radius: 999px; box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .5); white-space: nowrap; }
@media (prefers-reduced-motion: no-preference) { .toast { animation: toastIn .25s; } }
.toast .ic { width: 16px; height: 16px; color: var(--accent-bright); }

/* ---------- skeletons ---------- */
.skel { border-radius: 10px; background: var(--surface-2); position: relative; overflow: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .skel { background: linear-gradient(90deg, var(--surface-2) 25%, var(--bg) 50%, var(--surface-2) 75%); background-size: 640px 100%; animation: shimmer 1.3s linear infinite; }
}
.skel-line { height: 13px; margin-bottom: 8px; }
.skel-title { height: 26px; width: 55%; margin: 6px 0 20px; border-radius: 8px; }
.skel-card { height: 74px; border-radius: 16px; margin-bottom: 10px; }
.skel-cover { width: 100px; height: 100px; border-radius: 16px; flex-shrink: 0; }

/* ---------- utility ---------- */
.center { text-align: center; }
.empty { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px 20px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.5; }
/* ---------- vectorization monitor ---------- */
.vecstat { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.vecbadge { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.vecbadge.on { background: var(--primary); color: var(--on-primary); }
.vecbadge.paused { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.vecbarlbl { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.vecbar { height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.vecbar i { display: block; height: 100%; background: var(--primary); border-radius: 999px; transition: width .4s var(--ease); }
.vecsched { margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }

.backbtn { font-size: 14px; font-weight: 600; color: var(--primary); margin: 2px 0 12px; display: inline-flex; align-items: center; gap: 2px; }
.backbtn .ic { width: 18px; height: 18px; }

/* ---------- login ---------- */
body.locked #tabbar, body.locked #playerbar, body.locked #routechip { display: none !important; }
.login { display: flex; flex-direction: column; justify-content: center; min-height: 80dvh; max-width: 360px; margin: 0 auto; }
.login .brand { font-size: 40px; font-weight: 800; color: var(--primary); text-align: center; }
.login .sublede { text-align: center; color: var(--muted); margin: 4px 0 26px; }
.login .card { padding: 18px; }
.logout-row { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.logout-row .who { font-size: 13px; color: var(--muted); }
.logout-row button { font-size: 13px; font-weight: 600; color: var(--warn); }

/* ---------- keyframes ---------- */
@keyframes shimmer { to { background-position: -640px 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
.searching { display: flex; align-items: center; gap: 9px; padding: 12px 6px; color: var(--muted); font-size: 12.5px; }
.searching .sp { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; flex: none; }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sheetUp { from { transform: translateY(102%); } to { transform: translateY(0); } }
@keyframes playerUp { from { transform: translateY(101%); } to { transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
