/* msgbench.com - simulated-reader roundtable.
   Paper-and-ink palette, one vermilion accent, five seat hues. System fonts only (no CDN). */

:root {
  --paper: #f6f4ef;
  --paper-2: #eeebe4;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --ink: #16171b;
  --ink-2: #3b3c43;
  --muted: #6d6e77;
  --faint: #a2a2aa;
  --line: rgba(22, 23, 27, 0.08);
  --line-2: rgba(22, 23, 27, 0.14);
  --accent: #b4432c;
  --accent-soft: rgba(180, 67, 44, 0.1);
  --shadow-color: #1b1508;
  --shadow-1: 0 1px 2px rgba(22, 20, 14, 0.04), 0 10px 30px rgba(22, 20, 14, 0.06);
  --shadow-2: 0 2px 8px rgba(22, 20, 14, 0.05), 0 30px 70px rgba(22, 20, 14, 0.12);
  --table-hi: #ffffff;
  --table-lo: #ece8df;

  --s1: #4f5bd5; --s1-hi: #8f97f0;
  --s2: #0e8a78; --s2-hi: #4cc3ae;
  --s3: #c07a0c; --s3-hi: #ecb24f;
  --s4: #c2456a; --s4-hi: #f08aa6;
  --s5: #7552c4; --s5-hi: #ad94f0;

  --radius: 20px;
  --radius-sm: 12px;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d0e11; --paper-2: #121318; --surface: #16171c; --surface-2: #1b1c22;
    --ink: #edebe5; --ink-2: #cfcdc6; --muted: #9b9ba4; --faint: #6c6c75;
    --line: rgba(255, 255, 255, 0.08); --line-2: rgba(255, 255, 255, 0.14);
    --accent: #e27a60; --accent-soft: rgba(226, 122, 96, 0.14);
    --shadow-color: #000; --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
    --shadow-2: 0 2px 8px rgba(0, 0, 0, 0.35), 0 30px 70px rgba(0, 0, 0, 0.5);
    --table-hi: #24252c; --table-lo: #17181d;
    --s1: #8b95ff; --s1-hi: #b8beff; --s2: #3ec7b2; --s2-hi: #8ee5d6; --s3: #e5a93a; --s3-hi: #f4cd85;
    --s4: #ef7f9c; --s4-hi: #f8b3c5; --s5: #a98ef0; --s5-hi: #cfc0f8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d0e11; --paper-2: #121318; --surface: #16171c; --surface-2: #1b1c22;
  --ink: #edebe5; --ink-2: #cfcdc6; --muted: #9b9ba4; --faint: #6c6c75;
  --line: rgba(255, 255, 255, 0.08); --line-2: rgba(255, 255, 255, 0.14);
  --accent: #e27a60; --accent-soft: rgba(226, 122, 96, 0.14);
  --shadow-color: #000; --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 2px 8px rgba(0, 0, 0, 0.35), 0 30px 70px rgba(0, 0, 0, 0.5);
  --table-hi: #24252c; --table-lo: #17181d;
  --s1: #8b95ff; --s1-hi: #b8beff; --s2: #3ec7b2; --s2-hi: #8ee5d6; --s3: #e5a93a; --s3-hi: #f4cd85;
  --s4: #ef7f9c; --s4-hi: #f8b3c5; --s5: #a98ef0; --s5-hi: #cfc0f8;
  color-scheme: dark;
}

.c0 { --seat: var(--s1); --seat-hi: var(--s1-hi); }
.c1 { --seat: var(--s2); --seat-hi: var(--s2-hi); }
.c2 { --seat: var(--s3); --seat-hi: var(--s3-hi); }
.c3 { --seat: var(--s4); --seat-hi: var(--s4-hi); }
.c4 { --seat: var(--s5); --seat-hi: var(--s5-hi); }

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
/* The closed drawer sits off-canvas to the right; clip (not hidden) keeps it from widening the
   page on mobile Safari and does not break the sticky header the way overflow:hidden can. */
html { overflow-x: clip; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent-soft); }

.grain {
  position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: 0.045; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] .grain { mix-blend-mode: screen; opacity: 0.03; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .grain { mix-blend-mode: screen; opacity: 0.03; } }

.display, .display-md, .display-sm, .brand-word, .step-n { font-family: var(--font-display); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* ------------------------------------------------------------------ nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 28px;
  padding: 14px max(24px, calc((100vw - 1240px) / 2));
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 28px; height: 28px; color: var(--ink); }
.brand-word { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.brand-word.small { font-size: 17px; }
.nav-links { display: flex; align-items: center; gap: 6px; margin-left: auto; font-size: 14.5px; }
.nav-links a { text-decoration: none; color: var(--ink-2); padding: 7px 14px; border-radius: 999px; transition: color 0.2s, background 0.2s; white-space: nowrap; }
.nav-links a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.nav-links a[aria-current="page"] { color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); font-weight: 600; }
.nav-links .nav-primary { color: var(--paper); background: var(--ink); font-weight: 600; margin-right: 6px; }
.nav-links .nav-primary:hover { color: var(--paper); background: color-mix(in srgb, var(--ink) 86%, var(--accent)); }
.nav-links .nav-primary[aria-current="page"] { color: var(--paper); background: var(--ink); box-shadow: 0 0 0 3px var(--accent-soft); }
.beta-pill { font-size: 12px; color: var(--muted); border: 1px dashed var(--line-2); border-radius: 999px; padding: 4px 11px; white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 10px; }
.skip-link:focus { left: 12px; }
.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; transition: border-color 0.2s, transform 0.2s var(--ease);
}
.theme-toggle:hover { border-color: var(--ink-2); transform: rotate(-12deg); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; display: none; }
.theme-toggle .fill { fill: var(--ink); stroke: none; }
.theme-toggle[data-mode="auto"] .i-auto, .theme-toggle[data-mode="light"] .i-sun, .theme-toggle[data-mode="dark"] .i-moon { display: block; }

/* ------------------------------------------------------------------ buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; letter-spacing: 0.01em; text-decoration: none; cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn.primary { background: var(--ink); color: var(--paper); box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, 0 8px 20px -8px rgba(0,0,0,0.35); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -10px rgba(0,0,0,0.4); }
.btn.primary:disabled { opacity: 0.5; cursor: progress; transform: none; }
.btn.ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn.ghost:hover { border-color: var(--ink-2); background: var(--surface); }
.btn.ghost:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.small { height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn.large { height: 54px; padding: 0 30px; font-size: 16px; }
.link-btn { white-space: nowrap; background: none; border: none; padding: 0; color: var(--ink-2); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); cursor: pointer; }
.link-btn:hover { color: var(--accent); text-decoration-color: currentColor; }
.icon-btn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; display: grid; place-items: center; transition: 0.2s; }
.icon-btn:hover:not(:disabled) { color: var(--ink); border-color: var(--line-2); background: var(--surface); }
.icon-btn:disabled { opacity: 0.3; cursor: not-allowed; }

select {
  appearance: none; -webkit-appearance: none;
  height: 36px; padding: 0 32px 0 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23888' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center / 12px;
  font-size: 13.5px; cursor: pointer; transition: border-color 0.2s; width: 100%; min-width: 0;
}
select:hover { border-color: var(--ink-2); }
input[type="range"] { width: 100%; accent-color: var(--seat, var(--accent)); }

/* ------------------------------------------------------------------ hero */
.hero {
  position: relative;
  display: grid; grid-template-columns: 1.08fr 1fr; gap: 48px; align-items: center;
  max-width: 1240px; margin: 0 auto; padding: 96px 24px 72px;
}
.hero::before {
  content: ""; position: absolute; inset: -80px -10vw 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 50% at 78% 38%, color-mix(in srgb, var(--s1) 16%, transparent), transparent 70%),
    radial-gradient(30% 40% at 92% 70%, color-mix(in srgb, var(--s4) 12%, transparent), transparent 70%),
    radial-gradient(35% 45% at 60% 80%, color-mix(in srgb, var(--s3) 10%, transparent), transparent 70%),
    radial-gradient(30% 35% at 12% 10%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%);
  filter: blur(8px);
}
.display { font-size: clamp(44px, 4.8vw, 68px); line-height: 1.08; font-weight: 500; letter-spacing: -0.025em; margin: 22px 0 26px; text-wrap: balance; }
.lede { font-size: clamp(17px, 1.6vw, 19.5px); line-height: 1.8; color: var(--ink-2); max-width: 34em; }
.cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 38px; }
.pillars { list-style: none; padding: 0; margin: 56px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; border-top: 1px solid var(--line); padding-top: 26px; }
.pillars li { display: grid; gap: 4px; }
.pillars strong { font-size: 15px; }
.pillars span { font-size: 13.5px; color: var(--muted); line-height: 1.6; }

.hero-visual { position: relative; aspect-ratio: 1; max-width: 560px; justify-self: center; width: 100%; }
.hero-table { width: 100%; height: 100%; overflow: visible; }
.hero-orbit { fill: none; stroke: var(--line-2); stroke-dasharray: 2 7; animation: spin 120s linear infinite; transform-origin: 260px 260px; }
.hero-top { stroke: var(--line-2); filter: drop-shadow(0 26px 40px color-mix(in srgb, var(--shadow-color) 16%, transparent)); }
.hero-inlay { fill: none; stroke: var(--line); }
.hero-caption { font-size: 11.5px; letter-spacing: 0.22em; text-transform: uppercase; fill: var(--muted); text-anchor: middle; }
.hero-clock { font-family: var(--font-display); font-size: 52px; fill: var(--ink); text-anchor: middle; font-variant-numeric: tabular-nums; }
.hero-track { fill: none; stroke: var(--line-2); stroke-width: 3; }
.hero-ring { fill: none; stroke: var(--seat); stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 226.2; stroke-dashoffset: calc(226.2 * (1 - var(--p))); transform: rotate(-90deg); animation: ring 3.6s var(--ease) both; }
.hero-av { fill: var(--seat); filter: drop-shadow(0 8px 14px color-mix(in srgb, var(--seat) 35%, transparent)); }
.hero-init { font-family: var(--font-display); font-size: 21px; fill: #fff; text-anchor: middle; font-weight: 600; }
.hero-chip {
  position: absolute; font-size: 12.5px; padding: 7px 13px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 86%, transparent); border: 1px solid var(--line);
  box-shadow: var(--shadow-1); backdrop-filter: blur(8px); white-space: nowrap;
  animation: float 7s ease-in-out infinite;
}
.chip-a { top: 4%; left: 62%; }
.chip-b { top: 46%; right: -2%; animation-delay: -2s; }
.chip-c { bottom: 3%; left: 64%; animation-delay: -4s; color: var(--accent); }
@keyframes ring { from { stroke-dashoffset: 226.2; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ------------------------------------------------------------------ sections & cards */
.section { max-width: 1240px; margin: 0 auto; padding: 72px 24px; scroll-margin-top: 64px; }
.section-head { display: grid; gap: 12px; margin-bottom: 34px; max-width: 760px; }
.display-md { font-size: clamp(30px, 3.6vw, 44px); font-weight: 500; line-height: 1.15; letter-spacing: -0.02em; }
.display-sm { font-size: 22px; font-weight: 500; line-height: 1.3; }
.section-lede { color: var(--ink-2); font-size: 16.5px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-1); padding: 22px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h3 { font-size: 16px; display: inline-flex; align-items: center; gap: 10px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.file-btn { position: relative; }
.count-pill { font-size: 12px; font-weight: 600; color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 9px; font-variant-numeric: tabular-nums; }
/* Marks anything a simulated reader says or is, wherever it appears. */
.sim-tag { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); border: 1px dashed var(--line-2); border-radius: 999px; padding: 0 7px; line-height: 17px; white-space: nowrap; }
.sim-note { flex-basis: 100%; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.chip:empty { display: none; }
.chip.ghost { background: transparent; }
.tag { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 2px 7px; border-radius: 6px; margin-right: 8px; }

/* ------------------------------------------------------------------ studio */
/* Two cards side by side. The material card is as tall as the window and stays put while the page
   scrolls; the roundtable card grows with its contents. */
.bench-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.panel { display: flex; flex-direction: column; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-head h3 { font-size: 16px; display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.material-card { position: sticky; top: 84px; height: calc(100vh - 108px); min-height: 520px; }
.material-card > .panel-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.material-card .editor textarea { flex: 1; height: auto; min-height: 0; resize: none; }
.material-card .article { flex: 1; max-height: none; min-height: 0; }
/* The transcript runs full width under both panels; remarks are laid out across it. */
.transcript-panel { margin-top: 22px; }
.transcript-panel .feed { max-height: none; overflow: visible; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: start; }
.transcript-panel .summary-card { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.editor textarea {
  width: 100%; height: clamp(360px, calc(100vh - 330px), 760px); resize: vertical; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface-2); padding: 18px 20px; font-size: 15.5px; line-height: 1.85;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.editor textarea:focus { outline: none; border-color: var(--line-2); box-shadow: 0 0 0 4px var(--accent-soft); }
.editor-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.count { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.count.over { color: var(--accent); font-weight: 600; }

.seat-card {
  position: relative; padding: 16px 16px 14px; border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--seat) 38%, var(--line));
  background: var(--surface-2); display: grid; gap: 10px;
  animation: rise 0.45s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms);
}
.seat-card-head { display: flex; align-items: center; gap: 12px; }
.seat-card-head .seat-title { flex: 1; min-width: 0; }
.seat-card-head .seat-title > span { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seat-title { display: grid; line-height: 1.3; }
.seat-title strong { font-size: 15.5px; }
.seat-title span { font-size: 12.5px; }
.seat-speed { margin-left: auto; font-size: 12.5px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-variant-numeric: tabular-nums; }
.seat-desc { font-size: 12.5px; color: var(--muted); }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.field { display: grid; gap: 4px; min-width: 0; }
.field-label { font-size: 11.5px; color: var(--muted); letter-spacing: 0.02em; }
.tune summary { cursor: pointer; font-size: 13px; color: var(--ink-2); display: inline-flex; gap: 8px; align-items: center; list-style: none; }
.tune summary::-webkit-details-marker { display: none; }
.tune summary::before { content: "+"; font-size: 14px; line-height: 1; color: var(--muted); transition: transform 0.2s; }
.tune[open] summary::before { transform: rotate(45deg); }
.tuned-flag { font-size: 11px; color: var(--seat); border: 1px solid color-mix(in srgb, var(--seat) 40%, transparent); border-radius: 999px; padding: 0 7px; }
.slider-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px 18px; margin-top: 12px; }
.slider { display: grid; grid-template-columns: 118px 1fr 46px; align-items: center; gap: 8px; }
.slider-value { font-size: 12.5px; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.tune-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.runbar { display: flex; align-items: center; gap: 18px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.run-status { font-size: 14px; color: var(--ink-2); }
.run-status.error { color: var(--accent); }
.engine-note { margin-top: 12px; line-height: 1.6; }
.seat-editor { margin-top: 6px; }
.seat-editor .seat-card { animation: rise 0.3s var(--ease) both; }
.seat-editor .field-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.seat-editor .tune summary { gap: 8px; }
.seat-editor .tune summary .muted { font-size: 12px; }
.link-btn:disabled { opacity: 0.4; cursor: not-allowed; text-decoration: none; }
.link-btn:disabled:hover { color: var(--ink-2); }
/* Setup (before a run) and run show different parts of the roundtable card. */
.table-card { container-type: inline-size; }
.table-card.is-setup .run-only { display: none; }
@container (max-width: 560px) {
  .status-row { grid-template-columns: 24px minmax(0, 1fr) auto; grid-template-areas: "a n s" "b b b" "k k d"; row-gap: 6px; }
  .status-row > .avatar { grid-area: a; }
  .status-row .row-name { grid-area: n; }
  .status-row .row-state { grid-area: s; }
  .status-row .row-bar { grid-area: b; }
  .status-row .spark { grid-area: k; width: 100%; }
  .status-row .link-btn { grid-area: d; }
  /* the table is drawn smaller here, so its labels are set larger to stay readable */
  .table-svg .seat-name { font-size: 19px; }
  .table-svg .seat-status-text { font-size: 15.5px; }
  .table-svg .seat-initial { font-size: 25px; }
  .table-svg .table-caption { font-size: 15px; }
  .status-row .row-name .muted { display: none; }
  .bubble { padding: 11px 13px 12px; }
  .bubble-text { font-size: 13px; line-height: 1.6; -webkit-line-clamp: 6; }
}
.table-card:not(.is-setup) .setup-only { display: none; }
.stage-note { margin: 0 0 4px; }
/* Controls sit in the top corners of the panel, beside the table. */
.table-tools { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 8px; pointer-events: none; }
.table-tools > * { pointer-events: auto; }
.table-card .run-status { margin: 4px 0 6px; }
.table-card .banner { margin: 10px 0 0; }
.run-status:empty { display: none; }

.avatar {
  display: inline-grid; place-items: center; flex: none; border-radius: 50%; color: #fff; font-family: var(--font-display); font-weight: 600;
  background: linear-gradient(135deg, var(--seat-hi), var(--seat));
  box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--seat) 60%, transparent);
}
.avatar-sm { width: 24px; height: 24px; font-size: 12px; }
.avatar-md { width: 38px; height: 38px; font-size: 17px; }
.avatar-lg { width: 54px; height: 54px; font-size: 24px; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------------------------ stage */
.banner { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 13.5px; padding: 12px 16px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); background: var(--accent-soft); color: var(--ink-2); margin-bottom: 14px; }
.banner strong { color: var(--accent); }
.banner.subtle { border-color: var(--line-2); background: var(--paper-2); }
.banner.subtle strong { color: var(--ink); }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar-note { margin-left: auto; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); }
.seg button { border: none; background: transparent; height: 28px; padding: 0 13px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); transition: 0.2s; font-variant-numeric: tabular-nums; }
.seg button[aria-pressed="true"], .seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.seg button:disabled { opacity: 0.4; cursor: not-allowed; }

.table-wrap { position: relative; }
.table-area { position: relative; aspect-ratio: 1; width: 100%; max-width: 560px; margin: 4px auto 0; }
.table-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.table-halo { fill: none; stroke: var(--line-2); stroke-dasharray: 2 7; }
.table-top { stroke: var(--line-2); }
.table-inlay { fill: none; stroke: var(--line); }
.table-caption { font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; fill: var(--muted); text-anchor: middle; transition: opacity 0.3s; }
.table-clock { font-family: var(--font-display); font-size: 56px; fill: var(--ink); text-anchor: middle; font-variant-numeric: tabular-nums; transition: opacity 0.3s; }
.table-caption.is-dim, .table-clock.is-dim { opacity: 0; }
.connector { stroke: var(--seat, var(--line-2)); stroke-width: 1.6; stroke-dasharray: 3 5; opacity: 0; transition: opacity 0.35s; }
.connector.visible { opacity: 0.75; animation: dash 1.2s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -16; } }
.seat { cursor: pointer; outline: none; }
.seat .ring-track { fill: none; stroke: var(--line-2); stroke-width: 3; }
.seat .ring { fill: none; stroke: var(--seat); stroke-width: 3.6; stroke-linecap: round; }
.seat-avatar { transition: opacity 0.4s; filter: drop-shadow(0 8px 12px color-mix(in srgb, var(--seat) 38%, transparent)); }
.seat-initial { font-family: var(--font-display); font-size: 22px; font-weight: 600; fill: #fff; text-anchor: middle; pointer-events: none; }
.seat-name { font-size: 15px; font-weight: 600; fill: var(--ink); text-anchor: middle; }
.seat-status-text { font-size: 12px; fill: var(--muted); text-anchor: middle; font-variant-numeric: tabular-nums; }
.seat .speak-halo { fill: none; stroke: var(--seat); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; }
.seat.is-speaking .speak-halo { opacity: 1; animation: halo 1.8s var(--ease) infinite; }
.seat.is-stopped .seat-avatar { opacity: 0.42; }
.seat.is-stopped .seat-status-text { fill: var(--accent); }
.seat:focus-visible .ring-track { stroke: var(--accent); }
@keyframes halo { 0% { transform: scale(0.92); opacity: 0.9; } 100% { transform: scale(1.18); opacity: 0; } }

/* Speech bubble: sits on the table top, leans toward the speaker (--bx/--by), and points its tail
   at them (data-tail, --tail-at); the words arrive one by one (.w, --i). */
.bubble {
  position: absolute; left: var(--bx, 50%); top: var(--by, 50%); width: 52%; max-height: 44%; overflow: hidden;
  transform: translate(-50%, -50%); opacity: 0; pointer-events: none; z-index: 2;
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--seat, var(--line)) 45%, var(--line));
  border-radius: 16px; padding: 14px 16px 15px;
  box-shadow: var(--shadow-2); transition: opacity 0.25s var(--ease);
}
.bubble.visible { opacity: 1; pointer-events: auto; overflow: visible; animation: bubble-in 0.45s var(--ease) both; }
.bubble::after {
  content: ""; position: absolute; width: 16px; height: 16px; background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--seat, var(--line)) 45%, var(--line)); border-radius: 3px;
  transform: rotate(45deg); display: none;
}
.bubble.visible::after { display: block; }
.bubble[data-tail="top"] { transform-origin: var(--tail-at) 0; }
.bubble[data-tail="top"]::after { top: -9px; left: calc(var(--tail-at) - 8px); border-right: none; border-bottom: none; }
.bubble[data-tail="bottom"] { transform-origin: var(--tail-at) 100%; }
.bubble[data-tail="bottom"]::after { bottom: -9px; left: calc(var(--tail-at) - 8px); border-left: none; border-top: none; }
.bubble[data-tail="left"] { transform-origin: 0 var(--tail-at); }
.bubble[data-tail="left"]::after { left: -9px; top: calc(var(--tail-at) - 8px); border-top: none; border-right: none; }
.bubble[data-tail="right"] { transform-origin: 100% var(--tail-at); }
.bubble[data-tail="right"]::after { right: -9px; top: calc(var(--tail-at) - 8px); border-bottom: none; border-left: none; }
@keyframes bubble-in { from { opacity: 0; scale: 0.82; } 60% { scale: 1.02; } to { opacity: 1; scale: 1; } }
.bubble-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; }
.bubble-head .sim-tag { margin-left: auto; }
.bubble-text { font-size: 14px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.bubble-text .w { opacity: 0; animation: word-in 0.35s var(--ease) forwards; animation-delay: calc(0.25s + var(--i) * 55ms); }
.bubble-text mark.q { animation: mark-in 0.4s var(--ease) both; animation-delay: calc(0.25s + var(--i, 0) * 55ms); }
@keyframes mark-in { from { background: transparent; } }
@keyframes word-in { from { opacity: 0; filter: blur(3px); } to { opacity: 1; filter: none; } }

/* Typing cue beside a seat while its remark is being written; ring around the seat being edited. */
.seat .typing { opacity: 0; transition: opacity 0.25s; pointer-events: none; }
.seat .typing rect { fill: var(--surface); stroke: var(--line-2); }
.seat .typing circle { fill: var(--seat); animation: blink 1.2s infinite; }
.seat .typing circle:nth-of-type(2) { animation-delay: 0.2s; }
.seat .typing circle:nth-of-type(3) { animation-delay: 0.4s; }
.seat.is-typing .typing { opacity: 1; }
.seat.is-selected .ring-track { stroke: var(--seat); stroke-width: 2; stroke-dasharray: 4 5; }
.seat:hover .seat-avatar { filter: drop-shadow(0 10px 16px color-mix(in srgb, var(--seat) 50%, transparent)) brightness(1.06); }

mark.q { background: color-mix(in srgb, var(--accent) 15%, transparent); color: inherit; border-radius: 4px; padding: 0 2px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
mark.q.clickable { cursor: pointer; transition: background 0.2s; }
mark.q.clickable:hover { background: color-mix(in srgb, var(--accent) 28%, transparent); }

.status-rows { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 6px; }
.status-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) 56px 120px 92px auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; transition: background 0.2s; }
.status-row:hover { background: var(--paper-2); }
.row-name { display: flex; gap: 6px; align-items: baseline; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.row-name .muted { font-size: 12px; }
.row-bar { height: 4px; border-radius: 999px; background: var(--line); overflow: hidden; }
.row-bar-fill { display: block; height: 100%; width: 0; background: var(--seat); border-radius: inherit; }
.row-state { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-state[data-state="stopped"] { color: var(--accent); }
.row-state[data-state="finished"] { color: var(--seat); }
.spark { width: 120px; height: 30px; overflow: visible; }
.spark-ghost { fill: none; stroke: var(--line-2); stroke-width: 1.4; }
.spark-line { fill: none; stroke: var(--seat); stroke-width: 1.8; stroke-linejoin: round; }
.spark-cursor { stroke: var(--ink-2); stroke-width: 1; opacity: 0.35; }
.mk-overload { fill: var(--accent); }
.mk-stagnation { fill: var(--s3); }
.mk-dip { fill: var(--muted); }
.mk-stop { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 2 2; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 14px; }
.lg { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: -8px; }
.lg-overload { background: var(--accent); }
.lg-stagnation { background: var(--s3); }
.lg-dip { width: 0; height: 0; border-radius: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 6px solid var(--muted); }
.lg-stop { width: 0; height: 12px; border-radius: 0; border-left: 1.5px dashed var(--accent); }

.follow { width: auto; height: 32px; font-size: 13px; }
.read-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.article { position: relative; max-height: clamp(360px, calc(100vh - 260px), 820px); overflow: auto; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); scroll-behavior: smooth; }
.article-content { position: relative; padding: 26px 28px 30px 54px; font-size: 15.5px; line-height: 2; color: var(--ink-2); }
.article-gutter { position: absolute; left: 0; top: 0; width: 50px; height: 100%; pointer-events: none; }
.art-h { font-family: var(--font-display); font-size: 24px; line-height: 1.4; color: var(--ink); margin: 6px 0 18px; font-weight: 500; }
.art-p { margin: 0 0 16px; }
.art-list { margin: 0 0 16px; padding-left: 1.2em; }
.art-quote { margin: 0 0 16px; padding-left: 14px; border-left: 2px solid var(--line-2); color: var(--muted); }
.art-pre { font-family: var(--font-mono); font-size: 13px; white-space: pre-wrap; }
.ev { border-radius: 4px; transition: background 0.3s, box-shadow 0.3s, color 0.3s; }
.ev.on { color: var(--ink); background: color-mix(in srgb, var(--c) 13%, transparent); box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--c) 70%, transparent); }
.ev.flash { animation: flash 2.2s var(--ease); }
@keyframes flash { 0%, 30% { background: color-mix(in srgb, var(--accent) 30%, transparent); } 100% { background: transparent; } }
.pin {
  position: absolute; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700; color: #fff; background: var(--seat); margin-top: 6px;
  box-shadow: 0 0 0 2px var(--surface-2), 0 4px 10px -2px color-mix(in srgb, var(--seat) 50%, transparent);
  transition: top 0.45s var(--ease);
}
.pin.stop { background: var(--surface-2); color: var(--seat); border: 1.5px solid var(--seat); font-size: 12px; }

/* ------------------------------------------------------------------ feed & summary */
.stage { display: grid; gap: 18px; }
.stage[hidden] { display: none; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-height: 760px; overflow: auto; }
.feed-item { padding: 14px 16px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--seat) 32%, var(--line)); background: var(--surface-2); animation: rise 0.4s var(--ease) both; }
.feed-item.failed { opacity: 0.7; }
.feed-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; margin-bottom: 6px; }
.feed-head .muted { font-size: 12.5px; }
.feed-text { font-size: 14.5px; line-height: 1.85; color: var(--ink); }
.feed-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 10px 0 0; font-size: 13px; }
.feed-meta dt { color: var(--muted); }
.feed-meta dd { margin: 0; color: var(--ink-2); }
.stance { font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 6px; background: color-mix(in srgb, var(--seat) 14%, transparent); color: var(--seat); }
.stance.s-stopped { background: var(--accent-soft); color: var(--accent); }
.prov { margin-left: auto; font-size: 11.5px; color: var(--muted); font-family: var(--font-mono); }
.prov.is-mock { color: var(--accent); }
.dots { display: inline-flex; gap: 4px; padding: 6px 0; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: 0.2s; }
.dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.summary-card { animation: rise 0.5s var(--ease) both; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 18px; }
.summary-card h4, .drawer-section h4 { font-size: 12.5px; letter-spacing: 0.14em; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.clean-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.clean-list li { padding-left: 14px; position: relative; }
.clean-list li::before { content: ""; position: absolute; left: 0; top: 0.75em; width: 5px; height: 5px; border-radius: 50%; background: var(--faint); }
.disagree { display: grid; gap: 14px; }
.disagree-topic { font-weight: 600; font-size: 14.5px; margin-bottom: 6px; }
.seat-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 1px 9px; border-radius: 999px; color: var(--seat); background: color-mix(in srgb, var(--seat) 12%, transparent); white-space: nowrap; }
.edit-list { margin: 0; padding: 0; list-style: none; counter-reset: e; display: grid; gap: 14px; }
.edit-list li { counter-increment: e; display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; }
.edit-list li::before { content: counter(e, decimal-leading-zero); grid-row: span 3; font-family: var(--font-display); font-size: 22px; color: var(--accent); line-height: 1.2; }
.edit-title { font-weight: 600; font-size: 15px; }
.edit-why { font-size: 13.5px; }
.helps { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.caveat { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.honesty-inline { margin-top: 18px; text-align: center; font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------------ method & honesty */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.step { padding: 28px 26px 30px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(180deg, var(--surface), var(--surface-2)); box-shadow: var(--shadow-1); }
.step-n { font-size: 40px; color: var(--accent); line-height: 1; display: block; margin-bottom: 18px; }
.step h3 { font-size: 18px; margin-bottom: 10px; }
.step p { font-size: 14.5px; color: var(--ink-2); line-height: 1.85; }
.honesty-card { border-radius: 28px; padding: clamp(28px, 5vw, 56px); background: var(--ink); color: var(--paper); position: relative; overflow: hidden; }
.honesty-card::after { content: ""; position: absolute; right: -120px; top: -120px; width: 340px; height: 340px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--paper) 18%, transparent); box-shadow: 0 0 0 40px color-mix(in srgb, var(--paper) 3%, transparent), 0 0 0 90px color-mix(in srgb, var(--paper) 2%, transparent); }
.honesty-card .eyebrow { color: color-mix(in srgb, var(--paper) 65%, transparent); }
.claims { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 20px 40px; position: relative; z-index: 1; }
.claims li { font-size: 15px; line-height: 1.8; color: color-mix(in srgb, var(--paper) 82%, transparent); }
.claims strong { color: var(--paper); font-family: var(--font-display); font-size: 18px; font-weight: 500; margin-right: 6px; }

.footer { border-top: 1px solid var(--line); margin-top: 40px; }
.footer-inner { max-width: 1240px; margin: 0 auto; padding: 28px 24px 40px; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: baseline; }
.versions { flex-basis: 100%; font-family: var(--font-mono); font-size: 11.5px; }

/* ------------------------------------------------------------------ drawer */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 80; width: min(480px, 100vw);
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-2);
  transform: translateX(104%); transition: transform 0.4s var(--ease); overflow: auto; padding: 28px 28px 40px;
}
.drawer.open { transform: none; }
.drawer-close { position: absolute; top: 18px; right: 18px; }
.drawer-role { font-family: var(--font-sans); font-size: 15px; font-weight: 500; color: var(--muted); }
.scrim { position: fixed; inset: 0; z-index: 70; background: rgba(10, 10, 14, 0.32); backdrop-filter: blur(2px); animation: fade 0.3s both; }
@keyframes fade { from { opacity: 0; } }
.drawer-head { display: flex; gap: 14px; align-items: center; margin: 4px 40px 20px 0; }
.drawer-head p { font-size: 13px; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.kv { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 2px; }
.kv strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.drawer-section { margin-top: 26px; display: grid; gap: 8px; font-size: 14px; }
.dims { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.dim { display: grid; grid-template-columns: 62px 1fr 30px 44px; gap: 10px; align-items: center; font-size: 13px; }
.dim-bar { position: relative; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.dim-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--ink) 55%, transparent), var(--ink)); }
.dim-int { position: absolute; top: -1px; bottom: -1px; background: color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 2px; }
.dim-score { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.band { font-size: 11.5px; text-align: center; border-radius: 6px; padding: 1px 0; background: var(--paper-2); color: var(--ink-2); }
.band.b-strong, .band.b-adequate { color: var(--s2); }
.band.b-weak, .band.b-critical { color: var(--accent); }
.findings { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.finding { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); display: grid; gap: 6px; }
.finding-head { display: flex; gap: 8px; align-items: baseline; }
.sev { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--paper-2); color: var(--ink-2); }
.sev-high .sev { background: var(--accent-soft); color: var(--accent); }
.sev-medium .sev { background: color-mix(in srgb, var(--s3) 16%, transparent); color: var(--s3); }
.finding p { font-size: 13px; }
.evidence { display: flex; flex-wrap: wrap; gap: 6px; }
.evidence-btn { border: 1px solid var(--line-2); background: var(--surface); border-radius: 8px; font-size: 12.5px; padding: 4px 8px; cursor: pointer; text-align: left; transition: 0.2s; }
.evidence-btn:hover { border-color: var(--accent); color: var(--accent); }
.fix { font-size: 13px; color: var(--ink-2); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; padding-top: 64px; gap: 24px; }
  .hero-visual { max-width: 460px; }
  .display { font-size: clamp(40px, 6.2vw, 72px); }
  .steps { grid-template-columns: 1fr; }
}
/* The bench keeps its two halves side by side down to tablet width, then stacks them. */
@media (max-width: 860px) {
  .bench-grid { grid-template-columns: 1fr; }
  .material-card { position: static; height: auto; min-height: 0; }
  .material-card .editor textarea { flex: none; height: 340px; resize: vertical; }
  .material-card .article { flex: none; max-height: 60vh; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .nav { gap: 10px 12px; padding: 10px 16px 8px; flex-wrap: wrap; }
  .nav-links { order: 3; width: 100%; margin-left: 0; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { padding: 6px 12px; font-size: 14px; }
  .beta-pill { margin-left: auto; font-size: 11px; padding: 3px 9px; }
  .beta-more { display: none; }
  .theme-toggle { margin-left: auto; }
  .hero { padding: 40px 16px 28px; }
  .display { margin: 16px 0 18px; }
  .pillars { grid-template-columns: 1fr; gap: 14px; margin-top: 36px; }
  .chip-b { right: 0; }
  .section { padding: 48px 16px; }
  .card { padding: 16px; border-radius: 16px; }
  .editor textarea { height: 300px; padding: 14px; }
  .slider { grid-template-columns: 104px 1fr 44px; }
  .bubble { position: relative; left: auto; top: auto; width: auto; max-height: none; transform: none; margin-top: 14px; display: none; }
  .bubble.visible { display: block; }
  .bubble.visible::after { top: -9px; bottom: auto; left: calc(var(--tail-at, 50%) - 8px); right: auto; border: 1px solid color-mix(in srgb, var(--seat, var(--line)) 45%, var(--line)); border-right: none; border-bottom: none; }
  .table-caption.is-dim, .table-clock.is-dim { opacity: 1; }
  .table-area { margin-bottom: 0; }
  .seat-name { font-size: 25px; }
  .seat-status-text { display: none; } /* the status rows below carry it */
  .seat-initial { font-size: 26px; }
  .table-caption { font-size: 17px; }
  .status-row { grid-template-columns: 24px 1fr auto; grid-template-areas: "a n s" "b b b" "k k d"; row-gap: 6px; }
  .status-row > .avatar { grid-area: a; }
  .status-row .row-name { grid-area: n; }
  .status-row .row-state { grid-area: s; }
  .status-row .row-bar { grid-area: b; }
  .status-row .spark { grid-area: k; width: 100%; }
  .status-row .link-btn { grid-area: d; }
  .toolbar-note { display: none; }
  .article-content { padding: 18px 16px 22px 40px; font-size: 15px; }
  .article-gutter { width: 36px; }
  .summary-grid, .claims { grid-template-columns: 1fr; }
  .feed { max-height: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .bubble-text .w, .bubble-text mark.q { animation-delay: 0s !important; }
}

/* ================================================================== views (v2) */
.features { padding-top: 24px; }
.feature-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 22px; }
.feature {
  display: grid; align-content: start; gap: 10px; padding: 28px 26px; border-radius: var(--radius); text-decoration: none;
  border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-1);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s;
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--line-2); }
.feature h3 { font-family: var(--font-display); font-size: 24px; font-weight: 500; }
.feature p { color: var(--ink-2); font-size: 14.5px; line-height: 1.8; }
.feature-k { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.feature-go { margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.feature-go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s var(--ease); }
.feature:hover .feature-go svg { transform: translateX(3px); }
.feature-main { background: var(--ink); color: var(--paper); border-color: transparent; position: relative; overflow: hidden; }
.feature-main::after { content: ""; position: absolute; right: -70px; bottom: -90px; width: 260px; height: 260px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--paper) 16%, transparent); box-shadow: 0 0 0 34px color-mix(in srgb, var(--paper) 3%, transparent); }
.feature-main p { color: color-mix(in srgb, var(--paper) 78%, transparent); }
.feature-main .feature-k { color: color-mix(in srgb, var(--paper) 60%, transparent); }
.feature-main .feature-go { color: var(--paper); }
.btn.light { background: var(--paper); color: var(--ink); margin-top: 30px; position: relative; z-index: 1; }
.btn.light:hover { transform: translateY(-1px); }
.btn.primary-soft { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); border-color: transparent; }
.btn.primary-soft:hover { background: color-mix(in srgb, var(--ink) 14%, transparent); }
.btn.danger { color: var(--accent); }
.btn.danger:hover { border-color: var(--accent); background: var(--accent-soft); }
.btn.danger-solid { background: var(--accent); color: #fff; }
.two-step { display: inline-flex; gap: 6px; }

.view-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px 32px; flex-wrap: wrap; margin-bottom: 30px; }
.view-head > div:first-child { display: grid; gap: 12px; max-width: 760px; }
.view-head h1 { outline: none; }
.view-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.seat-foot { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.voice-note { border-bottom: 1px dashed var(--line-2); cursor: help; }
.range-wrap { position: relative; display: block; }
.range-wrap[style*="--prior"]::after { content: ""; position: absolute; left: var(--prior); top: 2px; bottom: 2px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--accent); opacity: 0.55; pointer-events: none; }
.hint-note { margin-top: 8px; font-size: 12.5px; color: var(--accent); background: var(--accent-soft); border-radius: 8px; padding: 6px 10px; }
.error-text { color: var(--accent); }
.ok-text { color: var(--s2); font-weight: 600; }

/* ------------------------------------------------------------------ profile library */
.account { padding-top: 56px; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 24px; align-items: start; }
.lib-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.lib-head h3 { font-size: 16px; display: inline-flex; align-items: center; gap: 8px; }
.lib-list { display: grid; gap: 12px; }
.lib-card {
  padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-1);
  display: grid; gap: 8px; transition: border-color 0.2s, box-shadow 0.2s; min-width: 0;
}
.lib-card:hover { border-color: var(--line-2); }
.lib-card.is-editing { border-color: color-mix(in srgb, var(--seat) 55%, transparent); box-shadow: var(--shadow-1), 0 0 0 3px color-mix(in srgb, var(--seat) 14%, transparent); }
.lib-card-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lib-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.lib-title strong { font-size: 15.5px; }
.lib-card-head .seat-speed { margin-left: auto; }
.lib-desc { font-size: 13.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-theta { font-variant-numeric: tabular-nums; }
.lib-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.badge { font-size: 11px; font-weight: 600; letter-spacing: 0.02em; padding: 1px 8px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.src-demographic-prior { color: var(--s1); background: color-mix(in srgb, var(--s1) 10%, transparent); border-color: transparent; }
.badge.src-imported { color: var(--s2); background: color-mix(in srgb, var(--s2) 10%, transparent); border-color: transparent; }
.badge.src-custom { color: var(--s3); background: color-mix(in srgb, var(--s3) 12%, transparent); border-color: transparent; }
.badge.src-interview { color: var(--s5); background: color-mix(in srgb, var(--s5) 12%, transparent); border-color: transparent; }
.badge.ghost { background: transparent; color: var(--muted); }

.editor-pane { position: sticky; top: 84px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-1); padding: 24px; display: grid; gap: 18px; max-height: calc(100vh - 104px); overflow: auto; min-width: 0; }
.editor-pane.schema-card { background: linear-gradient(180deg, var(--surface), var(--surface-2)); }
.schema { display: grid; gap: 12px; min-width: 0; }
.code { margin: 0; font-family: var(--font-mono); font-size: 12px; line-height: 1.7; background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; overflow: auto; color: var(--ink-2); max-width: 100%; }
.schema-foot { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.editor-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.editor-head .eyebrow { margin-bottom: 4px; }
.editor-body { display: grid; gap: 20px; min-width: 0; }
.editor-form { display: grid; gap: 12px; min-width: 0; }
.editor-form input[type="text"], .editor-form textarea, .dialog textarea, .set-control input[type="text"], input.rename {
  width: 100%; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); padding: 9px 12px; font-size: 14px; transition: border-color 0.2s, box-shadow 0.2s;
}
.editor-form input:focus, .editor-form textarea:focus, .dialog textarea:focus, .set-control input:focus, input.rename:focus { outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 4px var(--accent-soft); }
.editor-form textarea { resize: vertical; line-height: 1.7; }
.editor-sub { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.editor-sub:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.editor-sub h4, .preview h4 { font-size: 12.5px; letter-spacing: 0.14em; color: var(--muted); font-weight: 600; }
.field-grid.two { grid-template-columns: 1fr 1fr; }
.slider-stack { display: grid; gap: 8px; }
.slider.is-over .field-label { color: var(--ink); font-weight: 600; }
.editor-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line); }
.editor-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.provenance { margin-top: -6px; }

.preview { border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); padding: 16px; display: grid; gap: 12px; min-width: 0; }
.preview-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.preview-head p { margin-top: 4px; max-width: 30em; }
.preview-body { display: grid; gap: 12px; transition: opacity 0.2s; }
.preview-body.pending { opacity: 0.55; }
.preview-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pstat { padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 2px; min-width: 0; }
.pstat strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.pstat.warn strong { color: var(--accent); }
.preview-spark { width: 100%; height: 64px; overflow: visible; }
.preview-spark .spark-line { stroke-width: 2; }
.mini-dims { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mini-dims li { display: grid; grid-template-columns: 58px 1fr 28px; gap: 10px; align-items: center; font-size: 12.5px; color: var(--ink-2); }
.mini-bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.mini-bar span { display: block; height: 100%; background: var(--seat); border-radius: inherit; transition: width 0.3s var(--ease); }
.mini-dims b { text-align: right; font-variant-numeric: tabular-nums; }
.preview-foot { margin-top: -2px; }

.dialog { width: min(640px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--ink); padding: 24px; box-shadow: var(--shadow-2); }
.dialog::backdrop { background: rgba(10, 10, 14, 0.4); backdrop-filter: blur(3px); }
.dialog[open] { display: grid; gap: 12px; animation: rise 0.3s var(--ease); }
.dialog textarea { font-family: var(--font-mono); font-size: 12.5px; resize: vertical; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; }
.import-result h4 { font-size: 12.5px; color: var(--muted); margin: 10px 0 6px; letter-spacing: 0.1em; }
.report-list { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); display: grid; gap: 4px; max-height: 180px; overflow: auto; }
.report-list.rejected { color: var(--accent); }

/* ------------------------------------------------------------------ settings */
.settings-grid { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 32px; align-items: start; }
.set-nav { position: sticky; top: 92px; display: grid; gap: 2px; }
.set-nav a { text-decoration: none; color: var(--ink-2); font-size: 14px; padding: 8px 12px; border-radius: 10px; transition: background 0.2s, color 0.2s; }
.set-nav a:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); color: var(--ink); }
.set-main { display: grid; gap: 44px; min-width: 0; }
.set-section { scroll-margin-top: 84px; display: grid; gap: 14px; min-width: 0; }
.set-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 20px; flex-wrap: wrap; }
.set-head p { margin-top: 4px; font-size: 14px; }
.set-card { padding: 4px 24px; }
.set-row { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 16px 32px; padding: 20px 0; border-top: 1px solid var(--line); align-items: start; }
.set-row:first-child { border-top: none; }
.set-label strong { font-size: 15px; }
.set-label p { margin-top: 4px; line-height: 1.7; }
.set-control { display: grid; gap: 10px; justify-items: start; min-width: 0; }
.set-control .seg { flex-wrap: wrap; }
.set-control input[type="text"] { max-width: 320px; }
.avail { line-height: 1.7; }
.key-note { line-height: 1.8; }
.seat-picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; width: 100%; }
.switch { width: 46px; height: 28px; border-radius: 999px; border: none; padding: 3px; background: var(--line-2); cursor: pointer; transition: background 0.25s var(--ease); display: inline-flex; }
.switch .knob { width: 22px; height: 22px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: transform 0.25s var(--ease); }
.switch[aria-checked="true"] { background: var(--ink); }
.switch[aria-checked="true"] .knob { transform: translateX(18px); }
.save-list { list-style: none; margin: 0; padding: 0; }
.save-row { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; padding: 18px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.save-row:first-child { border-top: none; }
.save-main { display: grid; gap: 4px; min-width: 0; flex: 1 1 320px; }
.save-title { font-size: 15.5px; }
.save-seats { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.save-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { padding: 28px 0; text-align: center; display: grid; gap: 4px; }
table.usage { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0; }
table.usage th, table.usage td { text-align: right; padding: 12px 8px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
table.usage thead th { border-top: none; color: var(--muted); font-weight: 600; font-size: 12.5px; }
table.usage th:first-child { text-align: left; }

.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 120; display: grid; gap: 8px; justify-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow-2); animation: rise 0.3s var(--ease); transition: opacity 0.4s, transform 0.4s; }
.toast.error { background: var(--accent); color: #fff; }
.toast.out { opacity: 0; transform: translateY(6px); }

@media (max-width: 1080px) {
  .feature-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .editor-pane { position: static; max-height: none; }
  .settings-grid { grid-template-columns: 1fr; gap: 16px; }
  .set-nav { position: static; display: flex; overflow-x: auto; gap: 4px; }
  .set-nav a { white-space: nowrap; }
}
@media (max-width: 760px) {
  .account { padding-top: 28px; }
  .set-card { padding: 2px 16px; }
  .set-row { grid-template-columns: 1fr; gap: 10px; }
  .preview-stats { gap: 6px; }
  .pstat { padding: 8px; }
  .pstat strong { font-size: 15px; }
  .field-grid.two { grid-template-columns: 1fr; }
  .editor-pane { padding: 16px; }
  table.usage { font-size: 12.5px; }
  table.usage th, table.usage td { padding: 10px 4px; }
  .dialog { padding: 18px; }
}
