/* ── Tokens ─────────────────────────────────────────────────────────────────── */

:root {
  --bg: #f7f4ee;
  --bg-2: #efeae1;
  --surface: #ffffff;
  --ink: #1f1d2b;
  --ink-2: #5d5a6b;
  --line: #e4ded3;
  --table: #e9e2d4;
  --table-edge: #d8cfbd;
  --accent: #5b4fd6;
  --accent-ink: #ffffff;
  --good: #1f9d6b;
  --warn: #c98a12;
  --bad: #d0453b;
  --shadow: 0 1px 2px rgb(31 29 43 / .06), 0 8px 24px rgb(31 29 43 / .06);

  --claude: #d97757;
  --chatgpt: #10a37f;
  --gemini: #6f7cf3;
  --gemini-2: #b46fd6;
  --grok: #2f2d3a;

  --radius: 16px;
  --font: "Inter", system-ui, sans-serif;
  --font-display: "Fredoka", "Inter", system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14131b;
    --bg-2: #1b1a24;
    --surface: #201f2b;
    --ink: #eeecf6;
    --ink-2: #a9a6ba;
    --line: #322f41;
    --table: #2a2838;
    --table-edge: #3a3750;
    --accent: #8f86ff;
    --accent-ink: #14131b;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
    --grok: #c9c7d6;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14131b; --bg-2: #1b1a24; --surface: #201f2b; --ink: #eeecf6; --ink-2: #a9a6ba;
  --line: #322f41; --table: #2a2838; --table-edge: #3a3750; --accent: #8f86ff; --accent-ink: #14131b;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25); --grok: #c9c7d6;
  color-scheme: dark;
}

/* ── Base ───────────────────────────────────────────────────────────────────── */

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); }
.small-text { font-size: 13px; }

.btn, .ghost {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 15px var(--font); text-decoration: none; cursor: pointer;
  border-radius: 999px; border: 1px solid var(--line);
  padding: 10px 18px; background: var(--surface); color: var(--ink);
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.small, .ghost.small { padding: 5px 12px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: progress; transform: none; box-shadow: none; }
.ghost { background: transparent; border-color: transparent; padding: 6px 10px; font-weight: 500; color: var(--ink-2); }
.ghost:hover { color: var(--ink); background: var(--bg-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px;
}

/* ── Top bar ────────────────────────────────────────────────────────────────── */

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 24px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font: 600 20px var(--font-display); color: var(--ink); text-decoration: none; }
.brand-dots { display: grid; grid-template-columns: 9px 9px; gap: 3px; }
.brand-dots i { width: 9px; height: 9px; border-radius: 50%; display: block; animation: dot-bob 2.4s ease-in-out infinite; }
.brand-dots i:nth-child(1) { background: var(--claude); }
.brand-dots i:nth-child(2) { background: var(--chatgpt); animation-delay: .3s; }
.brand-dots i:nth-child(3) { background: var(--grok); animation-delay: .9s; }
.brand-dots i:nth-child(4) { background: var(--gemini); animation-delay: .6s; }
@keyframes dot-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }

.user { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.user img { width: 28px; height: 28px; border-radius: 50%; }
#history-toggle { display: none; }

/* ── Signed out ─────────────────────────────────────────────────────────────── */

.signed-out { max-width: 720px; margin: 0 auto; padding: 32px 16px 64px; text-align: center; }
.signed-out h1 { font-size: clamp(28px, 5vw, 42px); margin: 8px 0 12px; }
.lede { font-size: 17px; color: var(--ink-2); max-width: 560px; margin: 0 auto 28px; }
.auth-msg { margin-top: 20px; color: var(--bad); font-weight: 500; }

/* ── Layout ─────────────────────────────────────────────────────────────────── */

.layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: calc(100vh - 57px); }
.history { border-right: 1px solid var(--line); padding: 20px 14px; background: var(--bg-2); }
.history-head { display: flex; align-items: center; justify-content: space-between; margin: 0 6px 12px; }
.history-head h2 { font-size: 17px; margin: 0; }
.history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.history-list a {
  display: block; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--ink);
  font-size: 14px; line-height: 1.35; border: 1px solid transparent;
}
.history-list a:hover { background: var(--surface); border-color: var(--line); }
.history-list a[aria-current="page"] { background: var(--surface); border-color: var(--accent); }
.history-idea { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.history-meta { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--ink-2); }
.history-dots { display: inline-flex; gap: 2px; }
.history-dots i { width: 7px; height: 7px; border-radius: 50%; display: block; background: var(--c); }

.main { padding: 24px; max-width: 1040px; width: 100%; margin: 0 auto; display: grid; gap: 20px; align-content: start; }

/* ── Composer ───────────────────────────────────────────────────────────────── */

.composer-label { display: block; font: 600 22px var(--font-display); margin-bottom: 12px; }
textarea, select {
  width: 100%; font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
textarea { resize: vertical; min-height: 120px; }
textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
select { padding: 9px 12px; }
.composer-meta { display: flex; justify-content: flex-end; min-height: 20px; }
.opts { border: 0; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.opt { display: grid; gap: 6px; align-content: start; }
.opt-wide { grid-column: 1 / -1; }
.opt-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px 7px 8px;
  font-weight: 500; background: var(--bg); transition: all .15s ease;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip .swatch { width: 18px; height: 18px; border-radius: 50%; background: var(--c); transition: transform .2s ease; }
.chip:has(input:checked) { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--surface)); }
.chip:has(input:not(:checked)) .swatch { transform: scale(.6); opacity: .45; }
.chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip.unavailable { opacity: .5; cursor: not-allowed; }
.chip small { color: var(--ink-2); font-weight: 400; }
.segmented { display: inline-grid; grid-auto-flow: column; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.segmented button {
  font: 500 14px var(--font); border: 0; background: transparent; color: var(--ink-2);
  padding: 6px 10px; border-radius: 9px; cursor: pointer; text-transform: capitalize;
}
.segmented button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.composer-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.form-error { color: var(--bad); margin: 0 auto 0 0; font-weight: 500; }

/* ── Debate view ────────────────────────────────────────────────────────────── */

.debate { display: grid; gap: 18px; }
.idea-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.idea-text { font-size: 17px; margin: 6px 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 12em; overflow: auto; }
.status-line { text-align: center; margin: -6px 0 0; font: 500 16px var(--font-display); color: var(--ink-2); min-height: 1.4em; }

/* ── The stage: a round table with blob panelists ───────────────────────────── */

.stage {
  position: relative; width: 100%; aspect-ratio: 16 / 8; max-height: 420px;
  border-radius: 24px; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 60%),
    var(--bg-2);
  border: 1px solid var(--line);
}
.stage-hero { max-width: 560px; margin: 0 auto 8px; aspect-ratio: 16 / 9; border: 0; background: transparent; }

.table {
  position: absolute; left: 50%; top: 52%; width: 46%; height: 42%;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--table) 70%, var(--surface)), var(--table));
  box-shadow: inset 0 -6px 0 var(--table-edge), 0 12px 30px rgb(0 0 0 / .08);
  display: grid; place-items: center; text-align: center;
}
.table-label { font: 600 clamp(13px, 2vw, 17px) var(--font-display); color: var(--ink-2); padding: 0 12%; }
.table-label b { display: block; font-size: 1.5em; color: var(--ink); }

/* The moderator's paper, shown on the table while drafting. */
.paper {
  position: absolute; left: 50%; top: 50%; width: 15%; aspect-ratio: 3 / 4;
  transform: translate(-50%, -50%) rotate(-4deg) scale(0); transition: transform .5s cubic-bezier(.3, 1.6, .5, 1);
  background: var(--surface); border-radius: 6px; box-shadow: var(--shadow);
  padding: 9px 8px; display: grid; gap: 5px; align-content: start;
}
.stage.drafting .paper, .stage.signing .paper, .stage.done .paper { transform: translate(-50%, -50%) rotate(-4deg) scale(1); }
.stage.drafting .table-label, .stage.signing .table-label, .stage.done .table-label { opacity: 0; }
.paper i { display: block; width: 100%; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--ink) 22%, transparent); transform-origin: left; }
.stage.drafting .paper i { animation: scribble 2.4s ease-in-out infinite; }
.paper i:nth-child(2) { animation-delay: .3s !important; width: 85%; }
.paper i:nth-child(3) { animation-delay: .6s !important; width: 92%; }
.paper i:nth-child(4) { animation-delay: .9s !important; width: 60%; }
.paper i:nth-child(5) { animation-delay: 1.2s !important; width: 78%; }
@keyframes scribble { 0% { transform: scaleX(0); } 45%, 100% { transform: scaleX(1); } }

/* Seats */
.seat {
  position: absolute; left: var(--x); top: var(--y); width: 0; height: 0;
  transition: left .6s ease, top .6s ease;
}
.seat-inner { position: absolute; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 6px; }
.seat-name { font: 600 13px var(--font-display); color: var(--ink-2); white-space: nowrap; }
.seat-role { font-size: 11px; font-weight: 500; color: var(--ink-2); opacity: .8; white-space: nowrap; margin-top: -4px; }

.blob-wrap { position: relative; width: clamp(52px, 9vw, 82px); aspect-ratio: 1; animation: breathe 4s ease-in-out infinite; animation-delay: var(--delay, 0s); }
.blob {
  position: absolute; inset: 0; background: var(--c);
  border-radius: 46% 54% 52% 48% / 52% 46% 54% 48%;
  animation: morph 7s ease-in-out infinite; animation-delay: var(--delay, 0s);
  box-shadow: inset -6px -8px 0 rgb(0 0 0 / .10), inset 5px 6px 0 rgb(255 255 255 / .18);
  transition: box-shadow .4s ease;
}
.seat[data-p="gemini"] .blob { background: linear-gradient(135deg, var(--gemini), var(--gemini-2)); }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035, .975); } }
@keyframes morph {
  0%, 100% { border-radius: 46% 54% 52% 48% / 52% 46% 54% 48%; }
  33% { border-radius: 54% 46% 44% 56% / 46% 56% 44% 54%; }
  66% { border-radius: 50% 50% 56% 44% / 56% 50% 50% 44%; }
}

/* Face */
.face { position: absolute; inset: 0; display: grid; place-items: center; }
.eyes { display: flex; gap: 18%; width: 56%; justify-content: center; margin-top: -8%; transform: translate(var(--lx, 0), var(--ly, 0)); transition: transform .4s ease; }
.eye {
  width: 22%; aspect-ratio: 1; background: #fff; border-radius: 50%; display: grid; place-items: center;
  animation: blink 5s infinite; animation-delay: var(--delay, 0s); transform-origin: center;
}
.eye::after { content: ""; width: 55%; aspect-ratio: 1; border-radius: 50%; background: #1f1d2b; }
.seat[data-p="grok"] .eye { box-shadow: 0 0 0 1.5px rgb(31 29 43 / .35); }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.mouth {
  position: absolute; left: 50%; top: 64%; width: 18%; height: 8%; transform: translateX(-50%);
  border: 2.5px solid rgb(31 29 43 / .55); border-top: 0; border-radius: 0 0 99px 99px;
  transition: all .3s ease;
}

/* Devil's advocate horns */
.horns { position: absolute; inset: 0; pointer-events: none; display: none; }
.seat.devil .horns { display: block; }
.horns::before, .horns::after {
  content: ""; position: absolute; top: -9%; width: 18%; height: 22%;
  background: var(--bad); clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.horns::before { left: 18%; transform: rotate(-18deg); }
.horns::after { right: 18%; transform: rotate(18deg); }

/* Moderator's little crown-ish gavel mark */
.seat.moderator .seat-name::after { content: " ✎"; color: var(--accent); }

/* Thought bubble (thinking) */
.bubble {
  position: absolute; bottom: 88%; left: 72%; display: flex; gap: 4px; padding: 7px 9px;
  background: var(--surface); border-radius: 999px; box-shadow: var(--shadow);
  opacity: 0; transform: scale(.4) translateY(8px); transform-origin: bottom left;
  transition: opacity .25s ease, transform .3s cubic-bezier(.3, 1.6, .5, 1);
}
.bubble::before, .bubble::after { content: ""; position: absolute; background: var(--surface); border-radius: 50%; box-shadow: var(--shadow); }
.bubble::before { width: 9px; height: 9px; left: -2px; bottom: -6px; }
.bubble::after { width: 5px; height: 5px; left: -8px; bottom: -12px; }
.bubble i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); animation: think-dot 1.2s ease-in-out infinite; }
.seat[data-p="gemini"] .bubble i { background: var(--gemini); }
.bubble i:nth-child(2) { animation-delay: .15s; }
.bubble i:nth-child(3) { animation-delay: .3s; }
@keyframes think-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.seat.thinking .bubble { opacity: 1; transform: scale(1) translateY(0); }
.seat.thinking .blob-wrap { animation: bob 1.1s ease-in-out infinite; }
.seat.thinking .eyes { --ly: -12%; --lx: 6%; }
.seat.thinking .mouth { width: 10%; height: 0; border-top: 2.5px solid rgb(31 29 43 / .55); border-radius: 2px; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6px) rotate(2deg); } }

/* Spoke: a squash-and-stretch pop when a reply lands */
.seat.spoke .blob-wrap { animation: pop .6s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes pop { 0% { transform: scale(1); } 30% { transform: scale(1.18, .86); } 60% { transform: scale(.94, 1.08); } 100% { transform: scale(1); } }
.seat.nod .blob-wrap { animation: nod .5s ease; }
@keyframes nod { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(4px) scaleY(.96); } }

/* Ready ring */
.seat.ready .blob { box-shadow: inset -6px -8px 0 rgb(0 0 0 / .10), inset 5px 6px 0 rgb(255 255 255 / .18), 0 0 0 4px var(--surface), 0 0 0 7px color-mix(in srgb, var(--good) 70%, transparent); }
.seat.ready .mouth { height: 12%; }

/* Status chip under the name */
.badge {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; line-height: 1.5;
  background: var(--bg); border: 1px solid var(--line); color: var(--ink-2);
  transform: scale(0); transition: transform .35s cubic-bezier(.3, 1.6, .5, 1);
}
.badge.show { transform: scale(1); }
.badge.good { background: color-mix(in srgb, var(--good) 14%, var(--surface)); color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.badge.warn { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.badge.bad { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }

/* Sign-off stamp */
.stamp {
  position: absolute; right: -10%; top: -6%; width: 40%; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font: 700 clamp(11px, 1.6vw, 15px) var(--font);
  box-shadow: 0 0 0 3px var(--surface); transform: scale(0) rotate(-30deg); z-index: 2;
}
.stamp.yes { background: var(--good); }
.stamp.no { background: var(--bad); }
.stamp.show { animation: stamp .5s cubic-bezier(.3, 1.6, .5, 1) forwards; }
@keyframes stamp { from { transform: scale(2.2) rotate(-30deg); opacity: 0; } to { transform: scale(1) rotate(-8deg); opacity: 1; } }

/* Sleeping (signed out / idle) */
.stage.sleeping .eye { animation: none; transform: scaleY(.12); }
.stage.sleeping .blob-wrap { animation-duration: 5.5s; }
.zzz { position: absolute; right: -6%; top: -18%; font: 600 14px var(--font-display); color: var(--ink-2); opacity: 0; pointer-events: none; }
.stage.sleeping .zzz { animation: zzz 3.2s ease-in-out infinite; animation-delay: var(--delay, 0s); }
@keyframes zzz { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 30% { opacity: .9; } 100% { opacity: 0; transform: translate(14px, -26px) scale(1.2); } }

/* Failed: droopy */
.stage.failed .eye::after { width: 70%; height: 3px; border-radius: 2px; }
.stage.failed .blob-wrap { animation: none; transform: translateY(4px) scaleY(.94); filter: saturate(.6); }

/* Idea particles flying between panelists */
.particle {
  position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--c);
  pointer-events: none; z-index: 3; left: 0; top: 0;
}
.confetti { position: absolute; width: 8px; height: 12px; border-radius: 2px; pointer-events: none; z-index: 4; left: 0; top: 0; }

/* ── Positions strip ────────────────────────────────────────────────────────── */

.positions { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.position {
  border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: 14px;
  background: var(--surface); padding: 12px 14px; font-size: 14px; animation: rise .4s ease;
}
.position-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 4px; }
.position-name { font: 600 14px var(--font-display); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Conclusion ─────────────────────────────────────────────────────────────── */

.conclusion h2 { margin: 6px 0 2px; font-size: 22px; }
.outcome { display: inline-flex; align-items: center; gap: 8px; font: 600 15px var(--font-display); padding: 6px 14px; border-radius: 999px; }
.outcome.unanimous { background: color-mix(in srgb, var(--good) 15%, var(--surface)); color: var(--good); }
.outcome.majority { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent); }
.outcome.split, .outcome.none { background: color-mix(in srgb, var(--warn) 16%, var(--surface)); color: var(--warn); }
.signoff-title { font-size: 17px; margin: 22px 0 10px; }
.signoffs { display: grid; gap: 10px; }
.signoff { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 12px; border-radius: 12px; background: var(--bg); animation: rise .4s ease; }
.signoff-mark { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; }
.signoff-mark.yes { background: var(--good); }
.signoff-mark.no { background: var(--bad); }
.signoff .md { font-size: 14px; }
.signoff-name { font: 600 14px var(--font-display); }

.error-card { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); color: var(--bad); }

/* ── Transcript ─────────────────────────────────────────────────────────────── */

.transcript h2 { font-size: 20px; margin: 8px 0 12px; }
.round { margin-bottom: 18px; }
.round-title { font: 600 15px var(--font-display); color: var(--ink-2); margin: 0 0 10px; display: flex; align-items: center; gap: 10px; }
.round-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.turns { display: grid; gap: 10px; }
.turn { border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 12px; background: var(--surface); padding: 14px 16px; animation: rise .4s ease; }
.turn-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.turn-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.turn-name { font: 600 15px var(--font-display); }
.turn-head .badge { transform: none; margin-left: auto; }
.turn-body { position: relative; }
.turn-body.clamped { max-height: 9.5em; overflow: hidden; }
.turn-body.clamped::after { content: ""; position: absolute; inset: auto 0 0; height: 3em; background: linear-gradient(transparent, var(--surface)); }
.more { margin-top: 6px; }

/* Rendered markdown */
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol { margin: 0 0 .7em; }
.md ul, .md ol { padding-left: 1.3em; }
.md h3, .md h4 { font-size: 16px; margin: 1em 0 .4em; }
.md code { font-size: .9em; background: var(--bg-2); padding: 1px 5px; border-radius: 5px; }
.md pre { background: var(--bg-2); padding: 10px 12px; border-radius: 10px; overflow: auto; }
.md pre code { background: none; padding: 0; }
.md .meta-line { color: var(--ink-2); font-size: 13px; }

/* Panelist colors */
[data-p="claude"] { --c: var(--claude); }
[data-p="chatgpt"] { --c: var(--chatgpt); }
[data-p="gemini"] { --c: var(--gemini); }
[data-p="grok"] { --c: var(--grok); }

/* ── Responsive ─────────────────────────────────────────────────────────────── */

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  #history-toggle { display: inline-flex; }
  .history { display: none; border-right: 0; border-bottom: 1px solid var(--line); }
  .history.open { display: block; }
  .opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main { padding: 16px; }
  .topbar { padding: 10px 16px; }
  #user-name { display: none; }
  .stage { aspect-ratio: 1 / 1; max-height: none; }
  .table { width: 52%; height: 38%; }
  .paper { width: 22%; }
  .kbd-hint { display: none; }
}

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