:root {
  --bg: #f2efe7; --surface: #fffcf5; --surface-2: #eae6dc; --surface-3: #e0dbcf;
  --border: #d4cec0; --border-2: #b6ae9e; --text: #26252b; --muted: #68635c; --faint: #736d64;
  --accent: #5941a9; --accent-hover: #49328f; --on-accent: #ffffff; --accent-soft: #eae3fa;
  --id-gpt: #17686c; --id-kimi: #97375d; --id-claude: #885539; --id-glm: #355faa; --id-you: #5b615b;
  --st-queued: #626773; --st-working: #805c09; --st-done: #276446; --st-error: #a02f29; --st-timeout: #945016; --st-cancel: #934234;
  --tint-working: #f6ecd0; --tint-timeout: #f7e8d6; --tint-error: #f8e5df; --tint-cancel: #f3e1da; --tint-done: #e3efe5; --on-status: #ffffff;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --serif: Georgia, "Iowan Old Style", Palatino, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 4px; --sw: 268px; --iw: 330px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191a20; --surface: #23242c; --surface-2: #2d2e38; --surface-3: #393a46;
    --border: #42434f; --border-2: #656674; --text: #eeeae1; --muted: #b4b0a7; --faint: #a19c94;
    --accent: #c3adff; --accent-hover: #d2c0ff; --on-accent: #21182f; --accent-soft: #39304f;
    --id-gpt: #73c5c7; --id-kimi: #ec96b6; --id-claude: #dab08f; --id-glm: #93b6ef; --id-you: #b6c1b5;
    --st-queued: #afb4c2; --st-working: #e0bc63; --st-done: #87cba6; --st-error: #f4a29a; --st-timeout: #efb47e; --st-cancel: #eba99a;
    --tint-working: #3b321d; --tint-timeout: #403021; --tint-error: #442b2a; --tint-cancel: #402e29; --tint-done: #253a2d; --on-status: #191a20;
  }
}
:root[data-theme="light"] {
  --bg: #f2efe7; --surface: #fffcf5; --surface-2: #eae6dc; --surface-3: #e0dbcf;
  --border: #d4cec0; --border-2: #b6ae9e; --text: #26252b; --muted: #68635c; --faint: #736d64;
  --accent: #5941a9; --accent-hover: #49328f; --on-accent: #ffffff; --accent-soft: #eae3fa;
  --id-gpt: #17686c; --id-kimi: #97375d; --id-claude: #885539; --id-glm: #355faa; --id-you: #5b615b;
  --st-queued: #626773; --st-working: #805c09; --st-done: #276446; --st-error: #a02f29; --st-timeout: #945016; --st-cancel: #934234;
  --tint-working: #f6ecd0; --tint-timeout: #f7e8d6; --tint-error: #f8e5df; --tint-cancel: #f3e1da; --tint-done: #e3efe5; --on-status: #ffffff;
}
:root[data-theme="dark"] {
  --bg: #191a20; --surface: #23242c; --surface-2: #2d2e38; --surface-3: #393a46;
  --border: #42434f; --border-2: #656674; --text: #eeeae1; --muted: #b4b0a7; --faint: #a19c94;
  --accent: #c3adff; --accent-hover: #d2c0ff; --on-accent: #21182f; --accent-soft: #39304f;
  --id-gpt: #73c5c7; --id-kimi: #ec96b6; --id-claude: #dab08f; --id-glm: #93b6ef; --id-you: #b6c1b5;
  --st-queued: #afb4c2; --st-working: #e0bc63; --st-done: #87cba6; --st-error: #f4a29a; --st-timeout: #efb47e; --st-cancel: #eba99a;
  --tint-working: #3b321d; --tint-timeout: #403021; --tint-error: #442b2a; --tint-cancel: #402e29; --tint-done: #253a2d; --on-status: #191a20;
}
* { box-sizing: border-box; }
html, body { overflow-x: clip; height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 13px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6 { overflow-wrap: anywhere; min-width: 0; margin: 0; font-weight: 600; }
p { margin: 0; overflow-wrap: anywhere; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.num, .mono { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
button { background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r); padding: 7px 12px; min-height: 36px; cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
button:hover:not(:disabled) { background: var(--surface-3); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: 1; color: var(--faint); background: var(--surface-2); border-color: var(--border); cursor: not-allowed; }
button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
button.primary:disabled { color: var(--faint); background: var(--surface-3); border-color: transparent; }
button.quiet { background: none; border-color: transparent; color: var(--text); padding: 5px 7px; }
button.quiet:hover:not(:disabled) { background: var(--surface-3); }
button.quiet:disabled { color: var(--muted); }
button.mini { font-size: 13px; padding: 4px 8px; min-height: 30px; }
button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
input[type="text"], input[type="search"], input[type="number"], select, textarea { background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r); padding: 7px 9px; width: 100%; min-width: 0; }
input:disabled, select:disabled, textarea:disabled { color: var(--faint); background: var(--surface-2); cursor: not-allowed; }
textarea { resize: vertical; line-height: 1.5; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
label { color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--r); padding: 2px; gap: 2px; }
.seg button { border: 0; border-radius: 2px; padding: 4px 8px; min-height: 28px; background: transparent; font-size: 13px; }
.seg button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.hint { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.hint.bad { color: var(--text); font-weight: 650; }
.faint { color: var(--faint); }
.stub { color: var(--muted); font-style: italic; }
.app { display: flex; flex-direction: column; height: 100%; }
#topbar { display: flex; gap: 16px; align-items: center; padding: 15px 20px; border-bottom: 1px solid var(--border); background: var(--surface); flex: 0 0 auto; position: relative; z-index: 40; }
#topbar .brand { font: 25px/1 var(--serif); letter-spacing: -.8px; color: var(--accent); }
#topbar .title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#topbar .edition { font: 10px/1.3 var(--mono); letter-spacing: 1.5px; text-transform: uppercase; display: block; margin-top: 5px; }
#fakebar { flex: 0 0 auto; padding: 5px 20px; font-weight: 650; letter-spacing: 1.2px; text-transform: uppercase; font-size: 10px; background: var(--surface-3); color: var(--text); border-bottom: 1px solid var(--border-2); position: relative; z-index: 40; }
.frame { display: flex; flex: 1 1 auto; min-height: 0; min-width: 0; position: relative; }
#sidebar { flex: 0 1 var(--sw); }
#info { flex: 0 1 var(--iw); }
#main { flex: 1 1 0%; min-width: min(320px, 100%); display: flex; flex-direction: column; min-height: 0; background: var(--surface); container-type: inline-size; }
.gutter { flex: 0 0 5px; background: var(--border); cursor: col-resize; }
.gutter:hover { background: var(--border-2); }
.app[data-sidebar="off"] #sidebar, .app[data-info="off"] #info { display: none; }
.app[data-sidebar="off"] #gutL, .app[data-info="off"] #gutR { display: none; }
#sidebar, #info { background: var(--bg); border-right: 1px solid var(--border); overflow: auto; min-width: 0; }
#info { border-right: 0; border-left: 1px solid var(--border); }
#stream { flex: 1 1 auto; overflow: auto; padding: 28px 32px 40px; scroll-padding: 20px; }
.wrap { max-width: 1080px; margin: 0 auto; }
#readingStatus { flex: 0 0 auto; display: flex; gap: 24px; align-items: center; flex-wrap: wrap; padding: 11px 32px; border-bottom: 1px solid var(--border); background: var(--surface); }
#readingStatus[hidden], .app[data-info="on"] #readingStatus { display: none; }
.seat-status { display: flex; gap: 7px; align-items: center; min-width: 0; }
.seat-status > .who { font-size: 12px; }
#readingStatus .pill { font-size: 11px; gap: 4px; padding: 1px 5px; }
.sbhead { padding: 20px 16px 12px; display: grid; gap: 12px; position: sticky; top: 0; background: var(--bg); border-bottom: 1px solid var(--border); z-index: 1; }
.sbhead #btnNew { text-align: left; min-height: 42px; }
.slist { padding: 8px; display: grid; gap: 8px; }
.srow { display: grid; gap: 6px; padding: 12px 10px 8px; border-radius: 3px; cursor: pointer; background: none; border: 1px solid transparent; text-align: left; width: 100%; }
.srow:hover { background: var(--surface-2); }
.srow[aria-current="true"] { background: var(--accent-soft); border-color: transparent; }
.srow .st { display: block; font-family: var(--serif); font-size: 18px; line-height: 1.25; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow .sm { color: var(--muted); font-size: 11.5px; display: flex; gap: 6px; flex-wrap: wrap; }
.sacts { display: flex; gap: 2px; padding: 0 8px 6px; }
.srow-wrap { border-bottom: 1px solid var(--border); padding: 0 0 4px; }
.srow-wrap:hover .sacts button, .srow-wrap:focus-within .sacts button { background: var(--surface-3); }
.sacts button { opacity: 1; font-size: 13px; padding: 2px 6px; }
.pinned { color: var(--muted); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; padding: 8px 10px 2px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; margin: 0 0 16px; }
.sys { background: none; border: 0; padding: 0 0 14px; margin: 0; color: var(--muted); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 12px; }
.sys b { color: var(--text); font-weight: 650; }
.rounddiv { display: flex; gap: 10px; align-items: center; margin: 104px 0 16px; flex-wrap: wrap; }
.rounddiv:first-child { margin-top: 0; }
.rounddiv .rule { flex: 1 1 60px; height: 1px; background: var(--border-2); }
.rounddiv .rlabel { font: 600 13px/1.5 var(--mono); text-transform: uppercase; letter-spacing: 2px; color: var(--accent); font-variant-numeric: tabular-nums; }
.msg { display: grid; grid-template-columns: 154px minmax(0, 1fr); column-gap: 28px; background: none; border: 0; border-radius: 0; border-top: 1px solid var(--border); margin: 0; padding: 26px 0 20px; min-width: 0; }
.msg:first-child { border-top: 0; }
.msg .mhead { grid-column: 1; grid-row: 1 / span 3; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; padding: 0; border: 0; min-width: 0; }
.msg .mhead > .grow { display: none; }
.msg .cli, .msg .mbody, .msg > .acts { grid-column: 2; min-width: 0; }
.msg .mbody { padding: 8px 0 10px; }
.msg .prose { font-size: 16px; line-height: 1.7; max-width: 68ch; }
.msg.you { display: block; padding: 8px 0 30px; border-top: 0; }
.msg.you .mhead { flex-direction: row; align-items: center; margin-bottom: 12px; }
.msg.you .mhead > .grow { display: block; }
.msg.you .prose { font: 34px/1.2 var(--serif); letter-spacing: -.8px; max-width: 28ch; }
.msg.you .prose p { margin: 0; }
/* the quoted answer under a question: reading size, not headline size */
.msg.you .prose.you-quote { font: 15px/1.6 var(--sans); letter-spacing: 0; max-width: 68ch; margin: 0 0 14px; padding: .1em 0 .1em .9em; border-left: 2px solid var(--border-2); color: var(--muted); }
.msg.you .prose.you-quote p { margin: .5em 0; }
.msg.bad .mhead { color: var(--st-error); }
.msg.cancelled .mhead { color: var(--st-cancel); }
.msg.timeout .mhead { color: var(--st-timeout); }
.msg.bad { background: var(--tint-error); padding: 20px 16px; margin: 8px 0; }
.msg.cancelled { background: var(--tint-cancel); padding: 20px 16px; margin: 8px 0; }
.msg.timeout { background: var(--tint-timeout); padding: 20px 16px; margin: 8px 0; }
.msg.superseded { opacity: 1; }
.msg.superseded .prose { color: var(--muted); }
.mono-tile { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.mono-tile svg { display: block; width: 100%; height: 100%; }
.tile-gpt { color: var(--id-gpt); }
.tile-kimi { color: var(--id-kimi); }
.tile-glm { color: var(--id-glm); }
.tile-claude { color: var(--id-claude); }
.tile-you { color: var(--id-you); }
.tile-neutral { color: var(--muted); }
.rosterrow .mono-tile, .seat-status .mono-tile { width: 20px; height: 20px; }
.chip .mono-tile, .mention .mono-tile { width: 16px; height: 16px; }
.who { font-weight: 650; font-size: 14px; }
.tier { color: var(--muted); font: 12px var(--mono); }
.pill { display: inline-flex; gap: 5px; align-items: center; border-radius: 3px; padding: 2px 6px; font-size: 11.5px; font-weight: 600; border: 1px solid currentColor; font-variant-numeric: tabular-nums; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.p-queued { color: var(--st-queued); }
.p-working { color: var(--st-working); background: var(--tint-working); }
.p-done { color: var(--st-done); }
.p-error { color: var(--on-status); background: var(--st-error); border-color: var(--st-error); }
.p-timed_out { color: var(--on-status); background: var(--st-timeout); border-color: var(--st-timeout); }
.p-cancelled { color: var(--on-status); background: var(--st-cancel); border-color: var(--st-cancel); }
.p-error .dot, .p-timed_out .dot, .p-cancelled .dot { width: 10px; height: 10px; background: none; border-radius: 0; position: relative; }
.p-error .dot::before, .p-timed_out .dot::before, .p-cancelled .dot::before { content: "×"; position: absolute; inset: -5px 0 0; font-size: 15px; }
.waiting-dial { display: inline-block; width: 12px; height: 12px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; flex: 0 0 auto; animation: orbit 2.4s linear infinite; }
.pending-state { display: flex; gap: 16px; align-items: center; padding: 28px 0 34px; color: var(--st-working); min-height: 100px; }
.msg[data-status="queued"] .pending-state { color: var(--st-queued); }
.pending-state .waiting-dial { width: 32px; height: 32px; border-width: 2px; }
.pending-state .hint { font-size: 14px; max-width: 30ch; }
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes arrive { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.msg.arrival { animation: arrive .3s ease-out; }
.badge { border: 1px solid var(--border-2); border-radius: 3px; padding: 1px 6px; font-size: 11px; color: var(--muted); }
.badge.warn { color: var(--st-working); border-color: var(--st-working); }
.badge.sup { color: var(--muted); border-color: var(--border-2); font-style: normal; }
.badge.bad { color: var(--text); border-color: var(--border-2); font-weight: 650; }
.cli { font: 11.5px/1.5 var(--mono); color: var(--muted); overflow-wrap: anywhere; padding: 0; }
.acts { display: flex; gap: 4px; flex-wrap: wrap; padding: 6px 0 0; border: 0; max-height: none; overflow: visible; opacity: 1; }
.acts button { text-decoration: underline; text-decoration-color: var(--border-2); text-underline-offset: 4px; }
.prose h1, .prose h2, .prose h3 { font-size: 1.08em; margin: 1.1em 0 .35em; }
.prose h4, .prose h5, .prose h6 { font-size: 1em; margin: 1em 0 .3em; }
.prose p { margin: .65em 0; }
.prose ul, .prose ol { margin: .6em 0; padding-left: 1.35em; }
.prose li { margin: .25em 0; }
.prose code { color: var(--text); font-family: var(--mono); font-size: .88em; background: var(--surface-3); padding: 1px 4px; border-radius: 3px; }
.prose pre { background: var(--surface-3); border-radius: var(--r); padding: 12px; overflow-x: auto; max-width: 100%; min-width: 0; margin: .6em 0; }
.prose pre code { background: none; padding: 0; font-size: 12.5px; }
.prose blockquote { margin: .6em 0; padding: .1em 0 .1em .8em; border-left: 2px solid var(--border-2); color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 1em 0; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.errnote { color: var(--st-error); padding: 8px 0; font: 12px/1.5 var(--mono); overflow-wrap: anywhere; white-space: pre-wrap; margin-top: 8px; }
.packet { background: var(--surface-3); border-radius: var(--r); padding: 12px; margin-top: 8px; }
.packet pre { margin: 6px 0 0; font: 12px/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: none; }
.pk > details > summary { display: none; }
.pk > details > summary + * { margin-top: 0; }
details > summary { cursor: pointer; color: var(--text); font-size: 13px; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "+ "; font-family: var(--mono); }
details[open] > summary::before { content: "\2212 "; }
/* --cols comes from compareCols(): 1, 2, 3 across, and 2 at four seats (a 2x2).
   Row gap is 0 so a second row's card rule sits 20px under the row above and
   26px over its author row — the transcript's own rhythm — instead of floating
   40px below it; the 20px column gap is unchanged. */
.compare { display: grid; gap: 0 20px; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); margin-bottom: 12px; }
.compare .msg { display: block; margin: 0; }
.compare .mhead { flex-direction: row; flex-wrap: wrap; margin-bottom: 12px; }
.compare > .msg { border-top: 1px solid var(--border); }
@media (max-width: 900px) { .compare { grid-template-columns: minmax(0, 1fr); } }
.thread { background: var(--bg); border-radius: var(--r); padding: 18px; margin: 18px 0; }
.thread > .thead { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 14px; }
.thread > .thead .tname { font: 22px var(--serif); }
.thread.superseded { opacity: 1; }
.card.bad { border-color: var(--st-error); }
.card > fieldset { border: 0; background: none; padding: 10px 0 0; margin: 10px 0 0; border-top: 1px solid var(--border); border-radius: 0; }
.card > fieldset > legend { padding: 0; }
.tablewrap { overflow-x: auto; max-width: 100%; min-width: 0; margin: 8px 0 4px; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 650; }
td.unparsed { white-space: normal; color: var(--muted); }
.round-actions { padding: 20px 0 0; margin: 12px 0 24px; border-top: 1px solid var(--border); }
.round-actions > .row > .hint { flex-basis: 100%; color: var(--text); font-size: 13px; font-weight: 600; }
.round-actions > details { margin-top: 12px; }
.round-actions > details > summary { color: var(--text); font-size: 13px; width: fit-content; }
.round-actions > details > .row { padding-top: 8px; }
.round-actions > fieldset { margin: 12px 0 0; }
#flash { padding: 0 24px; }
.flash { border-radius: var(--r); padding: 9px 12px; margin-bottom: 8px; font-size: 12.5px; display: flex; gap: 8px; align-items: baseline; }
.flash.err { background: var(--tint-error); color: var(--st-error); }
.flash.ok { background: var(--surface-3); color: var(--text); }
#composer { flex: 0 0 auto; background: var(--bg); padding: 12px 24px 16px; border-top: 1px solid var(--border); }
#composer .cwrap { max-width: 1080px; margin: 0 auto; display: grid; gap: 0; padding: 4px 10px 8px; border: 0; border-top: 2px solid var(--accent); border-radius: 0; background: var(--surface); }
#msg { min-height: 40px; max-height: 30vh; resize: vertical; border: 0; background: transparent; padding: 9px 6px; font-size: 16px; }
#mentionRow { padding: 3px 6px; }
#mentionRow:empty { display: none; }
/* Reply chip (2026-09-07): a pending quote sits ABOVE the textarea as one
   line, the way a chat reply does. The display line is cut with an ellipsis;
   the record behind it is the complete answer and goes out whole on send. */
#quoteRow { padding: 4px 6px 2px; min-width: 0; }
#quoteRow[hidden] { display: none; }
.quote-chip { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; padding: 3px 4px 3px 9px; border-left: 2px solid var(--border-2); border-radius: 3px; background: var(--surface-2); font-size: 12.5px; line-height: 1.4; }
.quote-chip .quote-glyph { width: 14px; height: 14px; flex: 0 0 auto; color: var(--muted); }
.quote-chip .quote-glyph svg { display: block; width: 100%; height: 100%; }
.quote-chip .quote-label { flex: 0 0 auto; min-width: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quote-chip .quote-who { font-weight: 650; }
.quote-chip .quote-line { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
/* the size tag is the chip's own evidence: over the server's cap it goes red
   and Send is refused with the same numbers, so nothing is cut out of sight */
.quote-chip .quote-tag { flex: 0 0 auto; white-space: nowrap; font-size: 11.5px; color: var(--muted); }
.quote-chip .quote-tag.bad { color: var(--st-error); font-weight: 600; }
.quote-chip[data-over="on"] { border-left-color: var(--st-error); }
.quote-chip[data-held="on"] .quote-line { color: var(--muted); }
.quote-chip .quote-tools { display: flex; flex: 0 0 auto; align-items: center; gap: 2px; }
.quote-chip .x, .quote-chip .edit { flex: 0 0 auto; border: 0; background: none; min-height: 28px; border-radius: 3px; color: var(--text); line-height: 1; cursor: pointer; }
.quote-chip .edit { padding: 0 7px; font-size: 12px; color: var(--muted); }
.quote-chip .x { padding: 0 7px; font-size: 16px; }
.quote-chip .x:hover, .quote-chip .edit:hover { background: var(--surface-3); }
.composer-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
#ctxBox { flex: 0 0 auto; }
#ctxBox[open] { flex-basis: 100%; }
#ctxSummary { font-size: 13px; color: var(--text); padding: 6px; border-radius: var(--r); }
#ctxSummary:hover { background: var(--surface-3); }
#ctx { margin-top: 4px; max-height: 25vh; border: 0; background: var(--surface-2); }
#delivery { width: auto; flex: 0 1 auto; max-width: 100%; margin-left: auto; border-color: transparent; background: var(--surface-2); }
#btnSend { margin-left: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; border-radius: 3px; }
#btnSend[data-compact="true"] { min-width: 76px; }
#btnSend[data-compact="true"] #sendLabel { position: static; width: auto; height: auto; margin: 0; clip-path: none; font-size: 0; }
#btnSend[data-compact="true"] #sendLabel::after { content: "Send"; font-size: 13px; }
#btnSend svg { width: 18px; height: 18px; flex: 0 0 auto; transform: rotate(90deg); }
#deliveryNote { flex-basis: 100%; order: 5; }
#deliveryNote:empty { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; border: 0; background: var(--surface-3); border-radius: 3px; padding: 3px 6px; font-size: 12px; }
.chip .x { border: 0; background: none; padding: 0 3px; color: var(--text); cursor: pointer; line-height: 1; }
.mention { display: inline-flex; vertical-align: baseline; align-items: center; gap: 4px; font-weight: 600; background: var(--surface-2); border-radius: 3px; padding: 0 4px; }
.drawerclose, .drawerbar { display: none; }
.sect { border-bottom: 1px solid var(--border); padding: 18px 14px; }
.sect > h3 { font: 21px var(--serif); color: var(--text); margin-bottom: 12px; }
.kv { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 4px 10px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.roster { display: grid; gap: 8px; }
.rosterrow { display: flex; gap: 8px; align-items: center; }
.hash { font: 11.5px/1.45 var(--mono); overflow-wrap: anywhere; background: var(--surface-3); border-radius: 3px; padding: 7px; white-space: pre-wrap; }
.field { display: grid; gap: 4px; margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
fieldset { border: 1px solid var(--border); border-radius: var(--r); padding: 14px; margin: 0 0 18px; background: var(--bg); }
legend { font-size: 11.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); padding: 0 5px; }
.memberbox { background: var(--surface); border-radius: var(--r); padding: 12px; margin-bottom: 8px; }
.picker { border: 1px solid var(--border-2); border-radius: var(--r); background: var(--surface); padding: 6px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.picker input { border: 0; flex: 1 1 120px; padding: 3px 4px; min-width: 90px; }
.picker input:focus { outline: none; }
.picker:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.suggest { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.decision-record { position: relative; margin: 48px 0 16px; padding: 28px 0; border-top: 3px double var(--text); border-bottom: 1px solid var(--border-2); }
.decision-record h2 { font: 34px/1.15 var(--serif); margin: 12px 0 20px; }
.decision-record .prose { max-width: 68ch; font-size: 16px; line-height: 1.7; }
.decision-record .decision-kicker { font: 12px var(--mono); letter-spacing: 1.5px; text-transform: uppercase; }
.decision-record .decision-label { font: 12px var(--mono); margin: 24px 0 8px; text-transform: uppercase; letter-spacing: 1px; }
.decision-rationale, .decision-dissent { white-space: pre-wrap; font-size: 16px; line-height: 1.7; max-width: 68ch; }
.decision-actions { margin-top: 24px; }
.decision-stance { text-transform: capitalize; }
.decision-record .decision-signature { margin: 20px 0; font: 12px var(--mono); font-variant-numeric: tabular-nums; }
.decision-record.decision-arrival { animation: arrive .4s ease-out; }
.decision-record.decision-arrival::before { content: ""; position: absolute; top: -3px; left: 0; height: 3px; width: 100%; background: var(--text); transform-origin: left; animation: sign-rule .45s ease-out; }
@keyframes sign-rule { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.atlas-intro { padding: 40px 0; max-width: 640px; }
.atlas-intro h1 { font: 56px/1.05 var(--serif); letter-spacing: -1.5px; margin: 18px 0 22px; }
.atlas-intro p { font-size: 16px; line-height: 1.7; max-width: 44ch; color: var(--muted); margin-bottom: 24px; }
.atlas-kicker { color: var(--accent); font: 12px var(--mono); letter-spacing: 2px; text-transform: uppercase; }
@container (max-width: 700px) {
  .msg { display: block; }
  .msg .mhead { flex-direction: row; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
  .msg .mhead > .grow { display: block; }
  .msg.you .prose { font-size: 30px; }
  .compare { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 980px) {
  .drawerclose { display: inline-flex; }
  .drawerbar { display: flex; gap: 8px; align-items: center; padding: 10px 14px; }
  #gutL, #gutR { display: none; }
  #sidebar, #info { position: fixed; top: var(--chrome-h, 41px); bottom: 0; width: min(340px, 90vw); z-index: 30; border: 1px solid var(--border); box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35); }
  #sidebar { left: 0; } #info { right: 0; }
  .app[data-sidebar="off"] #sidebar, .app[data-info="off"] #info { display: none; }
  .app[data-sidebar="on"] #sidebar, .app[data-info="on"] #info { display: block; }
}
@media (max-width: 700px) {
  #topbar { flex-wrap: wrap; row-gap: 6px; }
  #topbar .seg, #topbar #btnSidebar, #topbar #btnInfo { flex: 0 0 auto; }
  #topbar .title { order: 5; flex: 1 1 100%; min-width: 0; }
  #topbar #topMeta { order: 6; flex: 0 0 auto; }
}
@media (max-width: 560px) {
  #topbar { gap: 7px; padding: 10px 12px; }
  #topbar .brand { font-size: 23px; flex: 1; order: -2; }
  #topbar #btnSidebar { order: -3; }
  #topbar #btnInfo { order: -1; }
  #topbar .edition { font-size: 8px; letter-spacing: 1px; }
  #topbar .seg { margin-left: auto; }
  #topbar .seg button { padding: 3px 8px; font-size: 13px; }
  #topbar .title { flex: 1 1 140px; order: 0; font-size: 12px; }
  #topbar #topMeta { display: none; }
  #fakebar { padding: 4px 12px; font-size: 9px; letter-spacing: .7px; }
  #stream { padding: 20px 16px 24px; }
  #composer { padding: 8px 10px 10px; }
  #composer .cwrap { padding: 2px 6px 6px; }
  .quote-chip { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 6px; row-gap: 2px; padding-right: 2px; }
  .quote-chip .quote-line, .quote-chip .quote-tag { grid-column: 1 / -1; }
  .quote-chip .quote-tools { grid-column: 3; grid-row: 1; }
  #readingStatus { gap: 8px; padding: 8px 12px; justify-content: space-between; }
  .seat-status { display: grid; grid-template-columns: 18px auto; gap: 4px; }
  .seat-status .mono-tile { width: 18px; height: 18px; }
  .seat-status > .pill, .seat-status > .hint { grid-column: 1 / -1; }
  #readingStatus .pill { padding: 1px 4px; gap: 3px; font-size: 10.5px; }
  #delivery { max-width: 160px; padding-left: 5px; padding-right: 3px; font-size: 12px; }
  #btnSend { padding: 6px 8px; }
  #btnSend[data-compact="false"] { margin-left: auto; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .rounddiv { gap: 7px; }
  .msg { padding: 22px 0 18px; }
  .msg.you .prose { font-size: 29px; }
  .msg .prose { font-size: 16px; }
  .msg.bad, .msg.cancelled, .msg.timeout { padding: 16px 12px; }
  .thread { padding: 12px; }
  .atlas-intro { padding: 28px 0; }
  .atlas-intro h1 { font-size: 43px; }
}
@media (prefers-reduced-motion: reduce) {
  .waiting-dial { animation: none !important; transform: none !important; }
  button:active:not(:disabled) { transform: none; }
  *, *::before, *::after { animation: none !important; transition-duration: 0s !important; }
}
/* lab replay: replaces the one inline width attribute on #turns (the page runs under a CSP) */
input.w-62 { width: 62px; }
