/* The Party Line — "Now Playing" design system.
   Dark, mobile-first, app-like: sticky top bar, rounded artwork card, swipe rails, chat-bubble
   transcripts, floating bottom dock (call / listen / mini-player). Served as a static, versioned file. */

:root {
  --bg: #09090b;
  --surface: #141418;
  --surface-2: #1c1c22;
  --surface-3: #26262e;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #fafafa;
  --text-2: #d4d4d8;
  --muted: #a1a1aa;
  --faint: #71717a;
  --accent: #ff4d3d;
  --accent-2: #ff7a59;
  --accent-soft: rgba(255, 77, 61, .14);
  --amber: #ffb347;
  --amber-soft: rgba(255, 179, 71, .12);
  --ok: #34d399;
  --r-sm: 12px;
  --r: 20px;
  --r-lg: 28px;
  --pill: 999px;
  --shadow: 0 16px 48px rgba(0, 0, 0, .5);
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --wrap: 1120px;
  --gutter: 16px;
  --face: url('/images/remy-face-512.png');
  color-scheme: dark;
}
@media (min-width: 768px) { :root { --gutter: 28px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; min-height: 100dvh;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}
body.no-dock { padding-bottom: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
::selection { background: rgba(255, 77, 61, .35); }

.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.narrow { width: min(720px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: #fff; padding: 8px 12px; border-radius: 10px; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.ic { width: 18px; height: 18px; flex: none; }
.hide-sm { display: none !important; }
@media (min-width: 640px) { .hide-sm { display: revert !important; } }

h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -.02em; font-weight: 650; }
h1 { font-size: clamp(28px, 7vw, 46px); }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0 0 12px; }
.eyebrow, .issue { font: 500 12px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.issue a { color: var(--text-2); }
.lede { font-size: 17px; line-height: 1.55; color: var(--text-2); }

/* ---- top bar ---------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--line);
  background: rgba(9, 9, 11, .72); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.topbar .wrap { display: flex; align-items: center; gap: 10px; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; }
.brand .logo { width: 30px; height: 30px; border-radius: 50%; background: var(--face) center/cover, var(--surface-2); box-shadow: 0 0 0 2px var(--accent); }
.topnav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.topnav a.nav { padding: 8px 12px; border-radius: var(--pill); font-size: 14px; color: var(--muted); }
.topnav a.nav:hover, .topnav a.nav[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.status {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; margin-left: 6px; border-radius: var(--pill);
  font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.status.live { background: var(--accent-soft); color: #ffb4ab; border-color: rgba(255, 77, 61, .35); }
.status.live .dot { background: var(--accent); animation: ping 1.6s infinite; }
.status.waking { background: var(--amber-soft); color: var(--amber); border-color: rgba(255, 179, 71, .35); }
.status.waking .dot { background: var(--amber); animation: ping 1.6s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(255, 77, 61, .55); } 70% { box-shadow: 0 0 0 8px rgba(255, 77, 61, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 77, 61, 0); } }

/* ---- buttons ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: var(--pill); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font-weight: 600; font-size: 15px; white-space: nowrap; cursor: pointer; transition: transform .12s ease, background .15s, border-color .15s, filter .15s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.98); }
.btn-primary, .btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff;
  box-shadow: 0 8px 24px rgba(255, 77, 61, .32);
}
.btn-primary:hover, .btn.primary:hover { background: linear-gradient(135deg, var(--accent), var(--accent-2)); filter: brightness(1.07); }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-icon { width: 44px; padding: 0; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn .when-paused, .btn .when-playing { display: inline-flex; align-items: center; gap: 8px; }
.btn .when-playing { display: none; }
.btn.is-playing .when-playing { display: inline-flex; }
.btn.is-playing .when-paused { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ---- cards & sections ------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.section { margin-top: 32px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 18px; }
.section-head .more { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; color: var(--muted); }
.section-head .more:hover { color: var(--text); }
.page-head { padding: 26px 0 6px; }
.page-head h1 { margin-bottom: 10px; }

/* ---- home hero --------------------------------------------------------------- */
.hero { display: grid; gap: 18px; padding-top: 16px; }
@media (min-width: 900px) { .hero { grid-template-columns: minmax(340px, 460px) 1fr; gap: 44px; align-items: center; padding-top: 36px; } }
.art {
  position: relative; aspect-ratio: 6 / 5; border-radius: var(--r-lg); overflow: hidden; isolation: isolate;
  border: 1px solid var(--line); background: radial-gradient(120% 90% at 50% 100%, #1f1f27 0%, #131317 55%, #0c0c0f 100%);
}
@media (min-width: 900px) { .art { aspect-ratio: 1 / 1; } }
.art .glow {
  position: absolute; left: -15%; right: -15%; bottom: -35%; height: 95%; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 77, 61, .55), rgba(255, 179, 71, .12) 60%, transparent 75%);
  opacity: .25; transition: opacity .6s ease, transform .12s linear;
}
.state-listening .art .glow { opacity: .55; }
.state-talking .art .glow { opacity: calc(.6 + var(--level, 0) * .4); transform: scale(calc(1 + var(--level, 0) * .1)); }
.art .chip-live { position: absolute; left: 14px; top: 14px; }
.remy { position: absolute; inset: 6% 5% 0; }
.remy picture, .remy img { position: absolute; inset: 0; width: 100%; height: 100%; }
.remy img { object-fit: contain; object-position: center bottom; opacity: 0; transform-origin: 50% 100%; transition: opacity .45s ease; }
.state-asleep .remy img.r-asleep, .state-listening .remy img.r-listening, .state-talking .remy img.r-talking { opacity: 1; }
.state-asleep .remy img.r-asleep { animation: breathe 4.4s ease-in-out infinite; }
.state-listening .remy img.r-listening { animation: sway 3.6s ease-in-out infinite; }
.state-talking .remy img.r-talking { transform: scale(calc(1 + var(--level, 0) * .03)); transition: opacity .45s ease, transform .09s linear; }
@keyframes breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.016); } }
@keyframes sway { 0%, 100% { transform: rotate(-.8deg); } 50% { transform: rotate(.8deg); } }
.hero-info h1 { margin-bottom: 8px; }
.hero-info .sub { font-size: 16px; color: var(--text-2); margin-bottom: 6px; }
.hero-info .last { font-size: 14px; color: var(--muted); margin-bottom: 0; }
.hero-info .last a { color: var(--text-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.hero-info .disc { margin: 14px 0 0; font-size: 12px; line-height: 1.6; color: var(--faint); }
.hero-actions { display: none; }
@media (min-width: 900px) { .hero-actions { display: flex; gap: 10px; margin-top: 22px; } }

/* ---- live transcript / chat bubbles ----------------------------------------- */
.live-panel { margin-top: 16px; padding: 14px; }
.live-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.chat { display: flex; flex-direction: column; gap: 10px; }
.live-panel .chat { max-height: min(46vh, 440px); overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }
.msg { display: flex; align-items: flex-end; gap: 8px; }
.msg .av { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--face) center/cover, var(--surface-2); border: 1px solid var(--line-2); }
.msg .bubble {
  max-width: min(86%, 600px); padding: 9px 13px 10px; border-radius: 18px 18px 18px 6px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 15px; line-height: 1.5; overflow-wrap: anywhere;
}
.msg .who { display: block; margin-bottom: 2px; font: 500 11px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--amber); }
.msg .when { display: block; margin-top: 4px; font: 400 11px/1 var(--mono); color: var(--faint); }
.msg.caller { flex-direction: row-reverse; }
.msg.caller .av { display: none; }
.msg.caller .bubble { border-radius: 18px 18px 6px 18px; background: linear-gradient(135deg, rgba(255, 77, 61, .2), rgba(255, 122, 89, .12)); border-color: rgba(255, 77, 61, .28); }
.msg.caller .who { color: #ffb4ab; text-align: right; }
.msg.caller .when { text-align: right; }
.bubble .s { border-radius: 4px; transition: background .15s; }
.tx .bubble .s { cursor: pointer; }
.tx .bubble .s:hover { background: rgba(255, 255, 255, .06); }
.bubble .s.active { background: rgba(255, 179, 71, .22); }
.chat .note { align-self: center; max-width: 34ch; margin: 6px 0; text-align: center; font-size: 13px; color: var(--muted); }
.cursor { display: inline-block; width: 6px; height: 14px; margin-left: 4px; vertical-align: -2px; background: var(--accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { to { visibility: hidden; } }

/* ---- how it works -------------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 6px; }
.step { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 14px; background: var(--surface-2); }
.step .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 600 12px var(--mono); color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.step b { display: block; font-size: 13px; line-height: 1.3; font-weight: 600; }
.step small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.35; color: var(--muted); }
@media (min-width: 768px) { .step { flex-direction: row; align-items: center; gap: 12px; padding: 14px; } .step .n { width: 30px; height: 30px; flex: none; } .step b { font-size: 14px; } }

/* ---- privacy promise ---------------------------------------------------------- */
.promise { display: grid; gap: 2px; padding: 6px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
@media (min-width: 768px) { .promise { grid-template-columns: repeat(2, 1fr); gap: 6px; } .promise-item:last-child { grid-column: 1 / -1; } }
@media (min-width: 1040px) { .promise { grid-template-columns: repeat(5, 1fr); } .promise-item:last-child { grid-column: auto; } .promise-item { flex-direction: column; } }
.promise-item { display: flex; gap: 12px; padding: 12px; border-radius: 14px; }
.promise-item:hover { background: var(--surface-2); }
.promise-item .pi { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 12px; color: #6ee7b7; background: rgba(52, 211, 153, .12); border: 1px solid rgba(52, 211, 153, .22); }
.promise-item b { display: block; font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.promise-item span:not(.pi) { display: block; font-size: 13px; line-height: 1.45; color: var(--muted); }
.privacy-line { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; padding: 8px 12px; border-radius: var(--pill); width: fit-content; max-width: 100%; font-size: 12px; color: #a7f3d0; background: rgba(52, 211, 153, .1); border: 1px solid rgba(52, 211, 153, .2); }
.privacy-line .ic { width: 14px; height: 14px; }
.short-version { margin: 6px 0 18px; padding: 16px 18px; }
.short-version h2 { font-size: 16px; margin-bottom: 8px; }
.short-version ul { margin: 0; padding-left: 20px; color: var(--text-2); font-size: 15px; line-height: 1.6; }
.short-version li { margin-bottom: 4px; }

/* ---- horizontal rails ------------------------------------------------------- */
.rail {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  margin-inline: calc(-1 * var(--gutter)); padding: 2px var(--gutter) 6px; scroll-padding-inline: var(--gutter);
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { flex: none; scroll-snap-align: start; }
.ep-card { width: min(70vw, 250px); display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); transition: transform .15s, border-color .15s; }
.ep-card:hover { transform: translateY(-2px); border-color: var(--line-2); }
.ep-card .body { padding: 12px 14px 14px; }
.ep-card h3 { font-size: 15px; line-height: 1.3; min-height: 2.6em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ep-card .meta { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.cover {
  --h: 8; position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  background: linear-gradient(140deg, hsl(var(--h) 78% 56%), hsl(calc(var(--h) + 38) 72% 26%));
}
.cover::before { content: ""; position: absolute; inset: 0; background: radial-gradient(80% 70% at 15% 0%, rgba(255, 255, 255, .22), transparent 60%); }
.cover .face { position: absolute; right: -8%; bottom: -24%; width: 64%; aspect-ratio: 1; border-radius: 50%; background: var(--face) center/cover; filter: drop-shadow(0 8px 20px rgba(0, 0, 0, .35)); }
.cover .no { position: absolute; left: 12px; top: 10px; font: 500 11px var(--mono); letter-spacing: .08em; color: rgba(255, 255, 255, .9); }
.cover .play { position: absolute; left: 12px; bottom: 12px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: rgba(0, 0, 0, .42); backdrop-filter: blur(6px); }
.cover .play .ic { width: 16px; height: 16px; margin-left: 2px; }
.quote-card { width: min(80vw, 300px); display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.quote-card .stars { color: var(--amber); letter-spacing: 2px; font-size: 14px; }
.quote-card p { margin: 0; font-size: 15px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.quote-card .from { margin-top: auto; font-size: 13px; color: var(--muted); }
.write-card { justify-content: center; align-items: flex-start; background: linear-gradient(160deg, var(--surface-2), var(--surface)); }
.empty-card { padding: 18px; display: grid; gap: 12px; justify-items: start; }
.empty-card p { margin: 0; color: var(--text-2); }

/* ---- archive list --------------------------------------------------------------- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 4px calc(-1 * var(--gutter)) 8px; padding: 2px var(--gutter); }
.chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; flex: none; border-radius: var(--pill); background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--text-2); white-space: nowrap; }
.chip:hover { border-color: var(--line-2); color: var(--text); }
.chip.on { background: var(--text); color: var(--bg); border-color: transparent; }
.ep-list { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.ep-row { display: grid; grid-template-columns: 60px 1fr auto; gap: 14px; align-items: center; padding: 10px; margin-inline: -10px; border-radius: 16px; transition: background .15s; }
.ep-row:hover { background: var(--surface); }
.ep-row h3 { font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ep-row .summ { margin: 3px 0 0; font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ep-row .meta { margin: 5px 0 0; font: 12px var(--mono); color: var(--faint); }
.ep-row .chev { color: var(--faint); }
.thumb {
  --h: 8; position: relative; width: 60px; height: 60px; border-radius: 16px; overflow: hidden; flex: none;
  background: linear-gradient(140deg, hsl(var(--h) 78% 56%), hsl(calc(var(--h) + 38) 72% 26%));
}
.thumb::after { content: ""; position: absolute; right: -16%; bottom: -24%; width: 92%; aspect-ratio: 1; border-radius: 50%; background: var(--face) center/cover; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 22px; }
.pager .count { font: 12px var(--mono); color: var(--faint); }

/* ---- thread page ------------------------------------------------------------- */
.back { display: inline-flex; align-items: center; gap: 4px; margin-top: 16px; font-size: 14px; color: var(--muted); }
.back:hover { color: var(--text); }
.ep-head { display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: center; margin: 14px 0 10px; }
.ep-head .thumb { width: 76px; height: 76px; border-radius: 20px; }
.ep-head h1 { font-size: clamp(22px, 5.8vw, 34px); }
.ep-head .eyebrow { margin-bottom: 4px; }
.meta-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; }
.meta-chips .chip { height: 28px; font-size: 12px; }
.summary { margin-top: 14px; padding: 14px 16px; }
.summary p { margin: 0; color: var(--text-2); font-size: 15px; }
.summary.clamp p { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.summary .more-btn { margin-top: 6px; padding: 0; border: 0; background: none; color: var(--accent-2); font-size: 14px; cursor: pointer; }
.takeaway { margin: 12px 0 0; padding: 14px 16px; border-radius: var(--r); background: var(--amber-soft); border: 1px solid rgba(255, 179, 71, .22); color: #ffe3bd; font-size: 16px; line-height: 1.45; }
.takeaway::before { content: "\201C"; margin-right: 4px; font-size: 26px; line-height: 0; vertical-align: -9px; color: var(--amber); }
.part { margin-top: 24px; }
.part-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.part-head h2 { font-size: 17px; }
/* Studio sessions: the caller is an AI guest */
.chip.chip-ai { color: var(--amber); border-color: rgba(255, 179, 71, .35); background: var(--amber-soft); }
.ai-note { margin: -4px 0 12px; font-size: 13px; color: var(--muted); }
.ai-note::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 8px 1px 0; border-radius: 50%; background: var(--amber); vertical-align: middle; }
.part-head .meta { display: block; margin-top: 2px; font: 12px var(--mono); color: var(--faint); }
.part > .muted { font-size: 15px; }
.part .chat { margin-top: 14px; }
.notx { font-size: 14px; color: var(--muted); }
details.sources { margin-top: 14px; padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
details.sources summary { cursor: pointer; font-size: 14px; color: var(--text-2); }
details.sources ul { margin: 10px 0 2px; padding-left: 18px; font-size: 14px; }
details.sources li { margin-bottom: 6px; }
details.sources a { color: var(--text-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.cta-card { margin-top: 28px; padding: 18px; }
.cta-card h2 { margin-bottom: 6px; }
.cta-card p { color: var(--text-2); margin: 0; }

/* ---- listener comments ---------------------------------------------------------- */
.comments .count { margin-left: 6px; font: 500 14px var(--mono); color: var(--muted); }
.composer, .reply-form { display: grid; gap: 10px; padding: 12px; }
.reply-form { margin-top: 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.composer textarea, .composer input, .reply-form textarea, .reply-form input {
  width: 100%; padding: 11px 13px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.composer textarea, .reply-form textarea { min-height: 46px; resize: vertical; }
.composer textarea:focus, .composer input:focus, .reply-form textarea:focus, .reply-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer-more { display: grid; gap: 10px; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.reply-form .composer-actions { justify-content: flex-end; }
.hint { flex: 1 1 200px; font-size: 12px; line-height: 1.45; color: var(--faint); }
.reply-to { font-size: 12px; color: var(--muted); }
.composer-msg { margin: 0; padding: 10px 12px; border-radius: 12px; font-size: 14px; background: var(--surface-2); color: var(--text-2); }
.composer-msg.ok { background: rgba(52, 211, 153, .12); color: #a7f3d0; }
.composer-msg.err { background: var(--accent-soft); color: #ffb4ab; }
.cmt-list { display: flex; flex-direction: column; gap: 16px; margin-top: 18px; }
.cmt-empty { margin-top: 14px; font-size: 14px; }
.cmt-row { display: grid; grid-template-columns: 32px 1fr; gap: 10px; }
.cmt-av { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; font-size: 14px; font-weight: 600; color: #fff; background: hsl(var(--ah, 200) 55% 42%); }
.cmt-av.removed { background: var(--surface-3); }
.cmt-main { min-width: 0; }
.cmt-meta { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.cmt-name { font-weight: 600; color: var(--text); }
.cmt-time { font-size: 12px; color: var(--faint); }
.cmt-body { margin: 2px 0 2px; font-size: 15px; line-height: 1.5; color: var(--text-2); overflow-wrap: anywhere; }
.cmt-reply { display: inline-flex; align-items: center; gap: 6px; margin-left: -8px; padding: 4px 8px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.cmt-reply:hover { background: var(--surface-2); color: var(--text); }
.cmt-reply .ic { width: 14px; height: 14px; }
.cmt-children { display: flex; flex-direction: column; gap: 14px; margin: 10px 0 0 15px; padding-left: 16px; border-left: 2px solid var(--line); }
.cmt-children:empty { display: none; }
.cmt.new > .cmt-row { animation: newcmt 1.8s ease; border-radius: 12px; }
@keyframes newcmt { from { background: rgba(255, 179, 71, .18); } to { background: transparent; } }
@media (max-width: 420px) { .cmt-children { margin-left: 8px; padding-left: 10px; } }

/* ---- floating dock ---------------------------------------------------------------- */
.dock {
  position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 50; transform: translateX(-50%);
  width: min(560px, 100% - 24px); display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: var(--pill);
  background: rgba(22, 22, 27, .84); border: 1px solid var(--line-2); box-shadow: var(--shadow);
  backdrop-filter: saturate(1.4) blur(18px); -webkit-backdrop-filter: saturate(1.4) blur(18px);
}
.dock .btn { min-height: 48px; }
@media (min-width: 900px) {
  /* desktop: a compact floating bar in the corner instead of a full-width strip over the content */
  .dock { left: auto; right: 24px; transform: none; width: auto; max-width: calc(100% - 48px); }
  .dock .grow { flex: none; }
  .dock.player { width: min(460px, 100% - 48px); }
}
.dock .grow { flex: 1; min-width: 0; }
.dock.player { border-radius: 24px; padding: 8px 8px 8px 10px; }
.np { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.np-play { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--text); color: var(--bg); cursor: pointer; }
.np-play .ic { width: 18px; height: 18px; }
.np-play .when-playing { display: none; }
.np-play.is-playing .when-playing { display: block; }
.np-play.is-playing .when-paused { display: none; }
.np-meta { flex: 1; min-width: 0; }
.np-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-sub { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.np-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; cursor: pointer; }
.np-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--amber)); }
.np-time { font: 11px var(--mono); color: var(--muted); }

/* ---- bottom sheet --------------------------------------------------------------- */
dialog.sheet {
  width: min(560px, 100%); max-width: 100%; max-height: 90dvh; margin: auto auto 0; padding: 0; overflow: auto;
  color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-bottom: 0; border-radius: 24px 24px 0 0;
}
@media (min-width: 640px) { dialog.sheet { margin: auto; border-radius: 24px; border-bottom: 1px solid var(--line-2); } }
dialog.sheet::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(3px); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--line); }
.sheet-body { padding: 18px 20px calc(20px + env(safe-area-inset-bottom)); }

/* ---- forms --------------------------------------------------------------------------- */
.form, form.studio { display: grid; gap: 14px; }
.field, form.studio label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.field input, .field select, .field textarea, form.studio input, form.studio select, form.studio textarea {
  width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus, form.studio input:focus, form.studio select:focus, form.studio textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { min-height: 120px; resize: vertical; }
input.code { font-family: var(--mono); font-size: 24px; letter-spacing: .3em; text-align: center; }
.form-card { padding: 18px; margin-top: 16px; }

/* ---- prose / notes / flash -------------------------------------------------------- */
.prose { color: var(--text-2); font-size: 16px; line-height: 1.7; }
.prose h2 { margin: 28px 0 8px; font-size: 19px; color: var(--text); }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--text); }
.prose a, .note a { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.updated { margin: 0 0 6px; font: 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.note { margin-top: 16px; font-size: 14px; color: var(--muted); }
.flash { margin: 12px 0; padding: 12px 14px; border-radius: 14px; font-size: 14px; background: var(--accent-soft); border: 1px solid rgba(255, 77, 61, .35); }
.flash.success { background: rgba(52, 211, 153, .12); border-color: rgba(52, 211, 153, .35); }
.flash a { text-decoration: underline; }

/* ---- footer ---------------------------------------------------------------------- */
.foot { margin-top: 44px; padding: 22px 0 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.foot .brand { font-size: 15px; color: var(--text); }
.foot .brand .logo { width: 24px; height: 24px; }
.foot .links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 0; }
.foot .links a:hover { color: var(--text); }
.foot .disc { max-width: 76ch; margin: 0 0 8px; font-size: 12px; line-height: 1.6; color: var(--faint); }
.foot .copy { margin: 0; font-size: 12px; color: var(--faint); }

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