/* OpenOrator — "marble and ink". Day session (light) is the default; night session is the alternate. */
:root {
  --bg: #F4EFE6; --surface: #FBF8F2; --sunk: #ECE5D8; --ink: #1C1A17; --muted: #6B645A;
  --line: #D9D0C0; --accent: #A3271F; --accent-ink: #FFFFFF; --laurel: #2F5D50;
  --s0: #1F4FBF; --s1: #0F766E; --s2: #A15C00; --s3: #6D3FC4; --s4: #B0246E; --s5: #487319; --s6: #475569; --s7: #C2410C;
  --shadow: 0 1px 2px rgba(28,26,23,.06), 0 8px 28px rgba(28,26,23,.08);
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --ui: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --r: 10px;
  color-scheme: light;
}
:root[data-theme="night"] {
  --bg: #141210; --surface: #1E1B18; --sunk: #191613; --ink: #EFE9DE; --muted: #A69D8F;
  --line: #36312B; --accent: #E5675C; --accent-ink: #1A0907; --laurel: #7FBFA9;
  --s0: #7FA2FF; --s1: #4FD1C5; --s2: #E0A848; --s3: #B49CFF; --s4: #F07DB8; --s5: #A3CF6A; --s6: #A8B4C6; --s7: #FF9466;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 32px rgba(0,0,0,.45);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--ui); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.08; letter-spacing: -.015em; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { width: min(1120px, 100% - 48px); margin-inline: auto; }
.mono { font-family: var(--mono); }
[hidden] { display: none !important; }

/* ---------- shared chrome ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 20px/1 var(--display); letter-spacing: -.01em; }
.brand svg { width: 26px; height: 26px; color: var(--accent); flex: none; }
.brand em { font-style: normal; color: var(--accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); text-decoration: none; font-weight: 600; font-size: 15px; transition: transform .15s, background .15s, border-color .15s; }
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn.ghost { background: transparent; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.icon-btn:hover { border-color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.tag { display: inline-block; font: 600 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
kbd { font: 500 12px var(--mono); padding: 2px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); }

/* ---------- landing ---------- */
.nav { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.nav.stuck { border-color: var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.nav nav { display: flex; gap: 24px; margin-left: auto; font-size: 15px; }
.nav nav a { text-decoration: none; color: var(--muted); }
.nav nav a:hover { color: var(--ink); }
.hero { padding: 72px 0 40px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(42px, 6.2vw, 76px); font-weight: 600; font-variation-settings: 'opsz' 144; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .lede { margin-top: 22px; font-size: 19px; color: var(--muted); max-width: 30em; }
.hero .cta { margin-top: 30px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero .fine { margin-top: 18px; font-size: 13px; color: var(--muted); }

.hemi { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 18px; }
.hemi-top { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.hemi-top { flex-wrap: wrap; }
.hemi-top .round { font: 600 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.hemi-top .spacer { flex: 1; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
.stepper button { width: 30px; height: 30px; border: 0; background: none; border-radius: 999px; font-size: 16px; line-height: 1; }
.stepper button:hover { background: var(--sunk); }
.stepper output { min-width: 22px; text-align: center; font: 600 14px var(--mono); }
.hemi svg { display: block; width: 100%; height: auto; margin-top: 6px; }
.hemi .seat { transition: transform .9s cubic-bezier(.2,.7,.2,1); }
.hemi .seat circle { transition: r .3s, opacity .3s; }
.hemi .seat.speaking circle.dot { animation: pulse 1s ease-in-out infinite; }
.hemi .seat text { font: 600 11px var(--mono); fill: #fff; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
:root[data-theme="night"] .hemi .seat text { fill: #141210; }
.hemi .beam { fill: none; stroke-width: 1.5; stroke-linecap: round; opacity: .55; stroke-dasharray: 400; stroke-dashoffset: 400; transition: stroke-dashoffset .7s ease-out, opacity .4s; }
.hemi .beam.on { stroke-dashoffset: 0; }
.hemi .meter-bg { fill: none; stroke: var(--line); stroke-width: 4; stroke-linecap: round; }
.hemi .meter { fill: none; stroke: var(--laurel); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2,.7,.2,1); }
.hemi .rostrum { fill: var(--accent); }
.hemi .pct { font: 600 13px var(--mono); fill: var(--laurel); text-anchor: middle; }
@keyframes pulse { 50% { opacity: .55; } }
.hemi-q { margin-top: 4px; text-align: center; font: 500 17px/1.3 var(--display); min-height: 2.6em; display: grid; place-items: center; padding: 0 12px; }
.hemi-says { margin-top: 10px; min-height: 76px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); padding: 12px 14px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.hemi-says .who { flex: none; font: 600 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; padding-top: 3px; min-width: 74px; }
.hemi-says.verdict { border-color: var(--laurel); }
.hemi-says .stamp { margin-left: auto; flex: none; font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--laurel); border: 1.5px solid var(--laurel); border-radius: 6px; padding: 3px 7px; transform: rotate(-3deg); }
.hemi-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.chip { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.chip:hover, .chip[aria-pressed="true"] { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

section.band { padding: 84px 0; }
section.band.alt { background: var(--surface); border-block: 1px solid var(--line); }
.band h2 { font-size: clamp(30px, 4vw, 46px); max-width: 18em; }
.band .sub { margin-top: 14px; color: var(--muted); font-size: 18px; max-width: 38em; }
.steps { margin-top: 44px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--bg); }
.step { padding: 28px; border-right: 1px solid var(--line); }
.step:last-child { border-right: 0; }
.step .num { font: italic 600 44px/1 var(--display); color: var(--accent); }
.step h3 { margin-top: 14px; font-size: 24px; }
.step p { margin-top: 8px; color: var(--muted); }
.grid { margin-top: 44px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.band.alt .card { background: var(--bg); }
.card h3 { font-size: 21px; }
.card p { margin-top: 8px; color: var(--muted); font-size: 15px; }
.card .glyph { width: 34px; height: 34px; color: var(--accent); margin-bottom: 14px; }

.code { margin-top: 36px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 28px; align-items: start; }
.codebox { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #171512; color: #EDE6D8; box-shadow: var(--shadow); }
.codebox .tabs { display: flex; gap: 2px; padding: 8px 8px 0; background: #201D19; }
.codebox .tabs button { border: 0; background: none; color: #A69D8F; padding: 8px 14px; border-radius: 8px 8px 0 0; font: 500 13px var(--mono); }
.codebox .tabs button[aria-selected="true"] { background: #171512; color: #EDE6D8; }
.codebox .tabs .copy { margin-left: auto; }
.codebox pre { margin: 0; padding: 18px 20px 22px; overflow-x: auto; font: 13.5px/1.65 var(--mono); tab-size: 2; }
.codebox .k { color: #F0A59E; } .codebox .s { color: #A8D5BF; } .codebox .c { color: #8A8174; }
.points { display: grid; gap: 18px; }
.points li { list-style: none; padding-left: 28px; position: relative; }
.points li::before { content: ''; position: absolute; left: 0; top: .45em; width: 14px; height: 8px; border-left: 2px solid var(--laurel); border-bottom: 2px solid var(--laurel); transform: rotate(-45deg); }
.points b { display: block; }
.points span { color: var(--muted); font-size: 15px; }
ul.points { margin: 0; padding: 0; }

.compare { margin-top: 40px; width: 100%; border-collapse: collapse; font-size: 15px; }
.compare th, .compare td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare thead th { font: 600 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.compare th[scope="row"] { font-weight: 600; width: 28%; }
.compare td.us { background: color-mix(in srgb, var(--laurel) 10%, transparent); font-weight: 500; }
.compare thead th.us { color: var(--laurel); }
.table-scroll { overflow-x: auto; }
.faq { margin-top: 36px; max-width: 760px; }
.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq summary { cursor: pointer; font: 600 19px var(--display); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::after { content: '+'; color: var(--accent); font-family: var(--mono); }
.faq details[open] summary::after { content: '–'; }
.faq p { margin-top: 10px; color: var(--muted); }
.closer { text-align: center; padding: 96px 0; }
.closer h2 { font-size: clamp(34px, 5vw, 60px); margin-inline: auto; }
.closer .cta { margin-top: 28px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
footer.foot { border-top: 1px solid var(--line); padding: 28px 0 36px; font-size: 14px; color: var(--muted); }
footer.foot .wrap { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
footer.foot .links { margin-left: auto; display: flex; gap: 20px; }
footer.foot .links a { text-decoration: none; }
footer.foot .links a:hover { color: var(--ink); }
/* the beta door: present for keyboard and screen-reader users, quiet for everyone else */
.beta-door { text-decoration: none; margin-left: 6px; padding: 4px 6px; opacity: .28; font-family: var(--display); font-style: italic; transition: opacity .2s, color .2s; }
.beta-door:hover, .beta-door:focus-visible { opacity: 1; color: var(--accent); }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s, transform .6s; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- app ---------- */
body.app { height: 100dvh; overflow: hidden; display: grid; grid-template-columns: 264px minmax(0, 1fr); }
.rail { border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.rail-head { padding: 16px; display: flex; align-items: center; justify-content: space-between; }
.rail .new { margin: 0 16px 12px; }
.rail-list { flex: 1; overflow-y: auto; padding: 0 8px 8px; }
.rail-list .label { padding: 10px 8px 6px; font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sess { width: 100%; display: flex; align-items: center; gap: 6px; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 8px; font-size: 14px; }
.sess .open { flex: 1; min-width: 0; border: 0; background: none; padding: 0; text-align: left; font: inherit; color: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sess:hover { background: var(--sunk); }
.sess[aria-current="true"] { background: var(--sunk); font-weight: 600; }
.sess .x { opacity: 0; border: 0; background: none; color: var(--muted); min-width: 24px; min-height: 24px; border-radius: 4px; }
.sess:hover .x, .sess .x:focus-visible { opacity: 1; }
@media (hover: none) { .sess .x { opacity: 1; } }
.sr:focus { position: fixed; left: 12px; top: 12px; z-index: 100; width: auto; height: auto; clip-path: none; padding: 10px 14px; background: var(--ink); color: var(--bg); border-radius: 8px; }
.codebox :focus-visible { outline-color: #F0A59E; }
.rail-foot { padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.rail-foot a { color: inherit; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { height: 56px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.topbar h1 { font: 600 17px var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.mode-pill { font: 600 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
.mode-pill.live { color: var(--laurel); border-color: var(--laurel); }
.mode-pill.demo { color: var(--s2); border-color: var(--s2); }
.menu-btn { display: none; }
.thread { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.thread-inner { width: min(860px, 100% - 32px); margin: 0 auto; padding: 28px 0 24px; }
.empty { text-align: center; padding: 6vh 0 0; }
.empty svg { width: 64px; height: 64px; color: var(--accent); }
.empty h2 { margin-top: 18px; font-size: clamp(28px, 4vw, 40px); }
.empty p { margin: 12px auto 0; color: var(--muted); max-width: 32em; }
.starters { margin-top: 26px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; text-align: left; }
.starters button { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 14px 16px; text-align: left; font-size: 14px; }
.starters button:hover { border-color: var(--ink); }
.starters b { display: block; font: 600 16px var(--display); margin-bottom: 2px; }
.starters span { color: var(--muted); }

.turn { margin-bottom: 40px; }
.ask { font: 500 clamp(20px, 2.6vw, 26px)/1.3 var(--display); white-space: pre-wrap; overflow-wrap: anywhere; }
.ask-meta { margin-top: 8px; font-size: 13px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.turn .verdict { margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.verdict-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.verdict-head h3 { font-size: 18px; }
.verdict-head .status { font-size: 13px; color: var(--muted); }
.gauge { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.gauge .bar { width: 120px; height: 6px; border-radius: 99px; background: var(--sunk); overflow: hidden; }
.gauge .bar i { display: block; height: 100%; width: 0; background: var(--laurel); border-radius: 99px; transition: width .8s cubic-bezier(.2,.7,.2,1); }
.gauge b { font: 600 14px var(--mono); color: var(--laurel); min-width: 3ch; text-align: right; }
.gauge svg { width: 54px; height: 18px; color: var(--laurel); }
.verdict-body { padding: 18px; font-size: 16.5px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 60px; }
.verdict-body.waiting { color: var(--muted); font-size: 14px; }
.verdict-body .dissent { display: block; margin: 4px 0 12px; padding: 10px 14px; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); border-radius: 0 8px 8px 0; font-size: 15px; }
.note { margin: 0 18px 14px; padding: 10px 12px; border-radius: 8px; font-size: 13px; background: color-mix(in srgb, var(--s2) 12%, transparent); border: 1px solid color-mix(in srgb, var(--s2) 40%, transparent); }
.note.err { background: color-mix(in srgb, var(--accent) 10%, transparent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.verdict-foot { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 10px 18px; border-top: 1px solid var(--line); font: 12px var(--mono); color: var(--muted); }
.verdict-foot .acts { margin-left: auto; display: flex; gap: 6px; }
.caret::after { content: ''; display: inline-block; width: 7px; height: 1.05em; margin-left: 2px; vertical-align: text-bottom; background: var(--accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.proc { margin-top: 12px; }
.proc > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 6px 2px; }
.proc > summary::before { content: '▸'; transition: transform .2s; }
.proc[open] > summary::before { transform: rotate(90deg); }
.proc-bar { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.proc .tabs { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--sunk); border: 1px solid var(--line); }
.proc .tabs button { border: 0; background: none; border-radius: 999px; padding: 5px 14px; font: 600 12px var(--mono); letter-spacing: .04em; color: var(--muted); }
.proc .tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.proc .tabs button .ag { margin-left: 6px; color: var(--laurel); font-weight: 500; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.cards { margin-top: 10px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.ocard { border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 10px; background: var(--surface); padding: 12px 14px; min-width: 0; }
.ocard header { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.ocard header b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ocard header .letter { font: 600 11px var(--mono); color: var(--c); border: 1px solid var(--c); border-radius: 5px; padding: 1px 5px; flex: none; }
.ocard header .role { color: var(--muted); font-size: 12px; white-space: nowrap; }
.ocard header .ms { margin-left: auto; font: 11px var(--mono); color: var(--muted); white-space: nowrap; }
.ocard .body { margin-top: 8px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 9.4em; overflow: hidden; position: relative; }
.ocard.open .body, .ocard.live .body { max-height: none; }
.ocard .body mark { background: color-mix(in srgb, var(--laurel) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.ocard .more { margin-top: 6px; border: 0; background: none; padding: 0; font-size: 12px; color: var(--muted); text-decoration: underline; }
.ocard.failed { opacity: .75; border-style: dashed; }
.ocard .fail { margin-top: 8px; font-size: 13px; color: var(--accent); overflow-wrap: anywhere; }

.composer-wrap { flex: none; padding: 0 16px 16px; }
.composer { width: min(860px, 100%); margin: 0 auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.composer:focus-within { border-color: var(--ink); }
.docket { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.docket .lab { font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.seats { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.seat-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 4px 10px 4px 8px; font-size: 13px; max-width: 180px; }
.seat-chip:hover { border-color: var(--c); }
.seat-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-chip small { color: var(--muted); }
.seat-chip .crown { color: var(--accent); font-size: 11px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--bg); }
.seg button { border: 0; background: none; min-width: 32px; height: 30px; font: 600 12px var(--display); color: var(--muted); }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--bg); }
.docket .est { margin-left: auto; font: 12px var(--mono); color: var(--muted); white-space: nowrap; }
.docket-pill { display: none; }
.entry { display: flex; align-items: flex-end; gap: 10px; padding: 10px 12px; }
.entry textarea { flex: 1; border: 0; background: none; resize: none; outline: none; min-height: 28px; max-height: 200px; line-height: 1.5; padding: 4px; }
.send { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.send svg { width: 18px; height: 18px; }
.send.stop { background: var(--ink); color: var(--bg); }
.hint { text-align: center; margin-top: 8px; font-size: 12px; color: var(--muted); }

/* overlays */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(20,18,16,.45); display: grid; place-items: start center; padding: 12vh 16px 16px; }
.sheet { width: min(560px, 100%); max-height: 76vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.sheet header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.sheet header h2 { font-size: 20px; }
.sheet .pad { padding: 18px 20px 20px; display: grid; gap: 16px; }
.field { display: grid; gap: 6px; font-size: 14px; }
.field > span { font-weight: 600; }
.field small { color: var(--muted); }
.field input, .field select { height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); padding: 0 12px; width: 100%; }
.radio-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.radio-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: block; cursor: pointer; background: var(--bg); }
.radio-card:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.radio-card b { display: block; }
.radio-card small { color: var(--muted); }
.radio-card input { position: absolute; opacity: 0; }
.radio-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.sheet .row { display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.sheet .row .msg { margin-right: auto; font-size: 13px; color: var(--muted); }
.palette input { width: 100%; height: 52px; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 0 20px; font-size: 17px; outline: none; }
.palette ul { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow: auto; }
.palette li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 15px; }
.palette li[aria-selected="true"] { background: var(--sunk); }
.palette li small { margin-left: auto; color: var(--muted); font: 12px var(--mono); }
.pop { position: fixed; z-index: 60; width: 300px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 12px; display: grid; gap: 10px; }
.pop h4 { margin: 0; font: 600 15px var(--display); display: flex; align-items: center; gap: 8px; }
.pop input, .pop select { height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); padding: 0 10px; width: 100%; font-size: 14px; }
.pop label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.pop .opts { max-height: 180px; overflow: auto; display: grid; gap: 2px; }
.pop .opts button { text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: 6px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop .opts button:hover, .pop .opts button[aria-pressed="true"] { background: var(--sunk); }
.pop .check { display: flex; grid-template-columns: none; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }
.pop .check input { width: auto; height: auto; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 70; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; box-shadow: var(--shadow); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }

/* ---------- responsive ---------- */
@media (max-width: 940px) {
  .hero .wrap, .code { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .step { border-right: 0; border-bottom: 1px solid var(--line); }
  .step:last-child { border-bottom: 0; }
  .nav nav a.opt { display: none; }
}
@media (max-width: 760px) {
  .wrap { width: calc(100% - 32px); }
  .hero { padding-top: 40px; }
  section.band { padding: 60px 0; }
  .grid { grid-template-columns: 1fr; }
  .nav nav { gap: 14px; }
  footer.foot .links { margin-left: 0; width: 100%; }
  body.app { grid-template-columns: 1fr; }
  .rail { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 40; transform: translateX(-102%); visibility: hidden; transition: transform .25s, visibility 0s .25s; box-shadow: var(--shadow); }
  body.rail-open .rail { transform: none; visibility: visible; transition: transform .25s; }
  #open-palette { display: none; }
  body.rail-open::after { content: ''; position: fixed; inset: 0; background: rgba(20,18,16,.4); z-index: 39; }
  .menu-btn { display: grid; }
  .starters { grid-template-columns: 1fr; }
  .composer-wrap { padding: 0 8px 8px; }
  .docket { display: none; }
  .composer.docket-open .docket { display: flex; }
  .docket-pill { display: flex; width: 100%; align-items: center; gap: 8px; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 9px 12px; font-size: 13px; color: var(--muted); text-align: left; }
  .docket .est { margin-left: 0; width: 100%; }
  .cards { grid-auto-flow: column; grid-auto-columns: 86%; grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .ocard { scroll-snap-align: start; }
  .gauge .bar { width: 70px; }
  .hint { display: none; }
  .radio-row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
