/* Additions on top of design.css (the design export, kept verbatim).
   Only for UI the export does not cover; uses its tokens throughout. */

/* ---- Agent tool calls, shown inline in an agent message ---- */
.tool-card {
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-3);
  font-size: var(--fs-xs); overflow: hidden;
}
.tool-card summary {
  display: grid; grid-template-columns: 20px auto minmax(0, 1fr); align-items: center; gap: 8px;
  padding: 6px 10px; cursor: pointer; list-style: none;
}
.tool-card summary::-webkit-details-marker { display: none; }
.tool-card .tool-ic {
  width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center;
  background: var(--bg-1); border: 1px solid var(--line); color: var(--text-3);
}
.tool-card.is-running .tool-ic { color: var(--navy); border-color: var(--party-line); animation: pulse 1.2s ease-in-out infinite; }
.tool-card.is-done .tool-ic { color: var(--ok); border-color: var(--ok-line); background: var(--ok-dim); }
.tool-card.is-failed .tool-ic { color: var(--bad); border-color: var(--bad-line); background: var(--bad-dim); }
.tool-card .tool-name { font-family: var(--font-mono); font-weight: 600; color: var(--text); }
.tool-card .tool-args { font-family: var(--font-mono); color: var(--text-3); }
.tool-card pre {
  margin: 0; padding: 8px 10px; border-top: 1px solid var(--line); background: var(--bg-1);
  font-family: var(--font-mono); font-size: 11px; line-height: 1.5; color: var(--text-2);
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 180px; overflow-y: auto;
}

/* ---- Markdown from model agents ---- */
.msg-agent .msg-text :where(ul, ol) { margin: 4px 0 0; padding-left: 20px; }
.msg-agent .msg-text :where(p, ul, ol, pre, table) + :where(p, ul, ol, pre, table) { margin-top: 6px; }
.msg-agent .msg-text pre {
  margin: 6px 0 0; padding: 8px 10px; background: var(--bg-3); border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: var(--fs-xs); white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg-agent .msg-text table { border-collapse: collapse; font-size: var(--fs-xs); }
.msg-agent .msg-text :where(th, td) { border: 1px solid var(--line); padding: 3px 8px; }

/* ---- Agent thinking ---- */
.typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: pulse 1.2s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: 0.2s; }
.typing i:nth-child(3) { animation-delay: 0.4s; }

/* ---- QR code (rendered as SVG instead of the export's canvas) ---- */
.qr-frame .qr-svg { width: 200px; height: 200px; }
.qr-frame .qr-svg svg { display: block; width: 100%; height: 100%; }

/* ---- Phone widths: no horizontal page scroll ----
   The export overflows here: the off-canvas right drawer widens the page and
   the top bar is wider than the screen. Clip the drawers and slim the bar. */
@media (max-width: 1024px) {
  .workspace { overflow: clip; }
}
@media (max-width: 640px) {
  .brand > .od-stack, .topbar .invite-label { display: none; }
  .topbar .btn-sm:has(.invite-label) { width: 32px; padding: 0; border-radius: 50%; }
}

/* ---- Open model picker: a chip with a native select inside ---- */
.model-pick { position: relative; padding-right: 10px; cursor: pointer; }
.model-pick select {
  appearance: none; border: 0; background: transparent; color: inherit; cursor: pointer;
  font: inherit; padding: 0 14px 0 0; max-width: 220px; text-overflow: ellipsis;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 5px center, right 1px center; background-size: 4px 4px; background-repeat: no-repeat;
}
.model-pick select:disabled { cursor: not-allowed; opacity: 0.7; }
.model-pick select:focus-visible { outline: none; }
.model-pick:focus-within { box-shadow: var(--focus); }
.model-pick .pinned { opacity: 0.75; }

/* ---- Comment avatars show the party's initial (the export hardcodes A / O) ---- */
.comment[data-side] .meta::before { content: attr(data-initial); }

/* ---- The judge's verdict, released to the requester ---- */
.verdict {
  display: flex; align-items: baseline; gap: 12px; padding: 14px 16px;
  border-radius: var(--radius-sm); background: var(--ok-dim); border: 1px solid var(--ok-line);
}
.verdict-label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ok); }
.verdict-value { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 600; letter-spacing: 0.02em; color: var(--text); }
.verdict.blurred, .kv.blurred { filter: blur(5px); user-select: none; pointer-events: none; }

/* Output cards line up their content at the top when the other card is taller. */
.output-card { align-content: start; }

/* ---- Side panel: Chat / Files switch ---- */
.panel-switch { display: grid; grid-template-columns: 1fr 1fr; }
.panel-switch button { justify-content: center; }
.panel-switch button[aria-pressed="true"] { background: var(--party-dim); color: var(--party-strong); }
.panel-switch .count { min-width: 18px; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--bg-4); color: var(--text-2); font-size: 11px; display: inline-grid; place-items: center; }

/* Drop files anywhere on a visible panel. */
.party.is-dropping { box-shadow: inset 0 0 0 2px var(--party); background: var(--party-dim); }

/* ---- Empty chat: who the agent works for, and prompts to start with ---- */
.chat-empty { margin: auto 0; display: grid; justify-items: center; gap: 10px; text-align: center; padding: var(--sp-4) var(--sp-2); }
.chat-empty .avatar { width: 40px; height: 40px; border-radius: 12px; }
.chat-empty h4 { font-size: var(--fs-md); }
.chat-empty p { font-size: var(--fs-sm); color: var(--text-2); max-width: 34ch; }
.prompt-list { display: grid; gap: 8px; width: 100%; margin-top: 6px; }
.prompt {
  text-align: left; padding: 10px 14px; border-radius: var(--radius-lg); cursor: pointer;
  background: var(--bg-1); border: 1px solid var(--line); color: var(--text); font-size: var(--fs-sm);
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.prompt:hover { border-color: var(--party); background: var(--party-dim); }
.prompt:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Composer: paperclip instead of the export's dropzone ---- */
.composer .attach input { display: none; }
.composer .attach { flex: none; cursor: pointer; }

/* ---- Files view ---- */
.files-view { overflow-y: auto; overscroll-behavior: contain; padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); }
.files-view .section-head { display: flex; align-items: center; justify-content: space-between; }
.file-card[role="button"] { cursor: pointer; }
.file-card[role="button"]:hover { border-color: var(--line-strong); }
.file-card.is-revoked { opacity: 0.6; background: var(--bg-3); }
.file-card.is-revoked .fname { text-decoration: line-through; }

/* ---- Evidence tab ---- */
.evidence-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
.ev-list { padding: var(--sp-3); display: grid; gap: var(--sp-3); position: sticky; top: 0; }
.ev-group { display: grid; gap: 4px; }
.ev-group-head { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 600; padding: 4px 6px; }
.ev-file {
  display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent;
  text-align: left; font-size: var(--fs-sm); color: var(--text); cursor: pointer;
}
.ev-file:hover { background: var(--bg-3); }
.ev-file.is-selected { background: var(--navy-dim); border-color: var(--party-line); }
.ev-file[data-status="revoked"] { opacity: 0.55; text-decoration: line-through; }
.ev-file[data-status="sealed"] .od-icon { color: var(--box); }
.ev-file.is-sealed { cursor: default; color: var(--text-3); }
.ev-file .blur-text { filter: blur(3px); user-select: none; }
.ev-preview { display: grid; gap: var(--sp-3); min-height: 320px; align-content: start; }
.ev-preview .ev-head { display: flex; align-items: center; gap: 10px; }
.ev-preview .ev-head .t { font-family: var(--font-display); font-weight: 600; }
.ev-preview .ev-text {
  margin: 0; padding: 14px 16px; background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: var(--fs-xs); line-height: 1.6; color: var(--text-2);
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 70vh; overflow: auto;
}
.ev-empty { place-items: center; align-content: center; text-align: center; color: var(--text-3); }
.ev-empty p { max-width: 40ch; font-size: var(--fs-sm); }

/* ---- Focus: hide both side panels ---- */
.workspace.is-focus { grid-template-columns: minmax(0, 1fr); }
.workspace.is-focus > .party { display: none; }

@media (max-width: 1024px) {
  .evidence-layout { grid-template-columns: minmax(0, 1fr); }
  .ev-list { position: static; }
}

/* ---- CSV preview ---- */
.ev-table-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.ev-table { width: 100%; border-collapse: collapse; font-size: var(--fs-xs); }
.ev-table th { position: sticky; top: 0; background: var(--bg-3); text-align: left; font-weight: 600; color: var(--text-2); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ev-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--text); }
.ev-table tr:hover td { background: var(--bg-3); }

/* ---- Negotiate: comments rail hidden by default ---- */
.plan-layout.is-solo { grid-template-columns: minmax(0, 1fr); }
.plan-layout.is-solo .doc-body { max-width: 76ch; }
/* While comments are open, hide the side panel you aren't playing. */
.workspace.hide-alice { grid-template-columns: minmax(0, 1fr) var(--side-w); }
.workspace.hide-openbrain { grid-template-columns: var(--side-w) minmax(0, 1fr); }
.workspace.hide-alice > .party[data-side="alice"],
.workspace.hide-openbrain > .party[data-side="openbrain"] { display: none; }
@media (max-width: 1024px) {
  .workspace.hide-alice, .workspace.hide-openbrain { grid-template-columns: minmax(0, 1fr); }
}

/* ---- Negotiate: the LLM judge card ---- */
.judge-card { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--sp-5); align-items: center; }
.judge-pick { display: grid; gap: 8px; }
.judge-select { min-height: 44px; font-family: var(--font-display); font-size: var(--fs-md); font-weight: 500; cursor: pointer; }
.judge-card .dice { flex: none; width: 44px; min-height: 44px; }
.judge-card .dice.is-rolling .od-icon { animation: roll 500ms var(--ease-out); }
.judge-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.judge-stat { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-3); border: 1px solid var(--line); }
.judge-stat .k { font-size: var(--fs-xs); color: var(--text-3); }
.judge-stat .v { font-size: var(--fs-sm); font-weight: 600; }
@keyframes roll { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@media (max-width: 1180px) { .judge-card { grid-template-columns: minmax(0, 1fr); } }

/* ---- Steps: Negotiate (1) then Arbitrate (2) ---- */
.step-num {
  width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-size: 11px; font-weight: 600; background: var(--bg-4); color: var(--text-2);
}
.tab[aria-selected="true"] .step-num { background: var(--navy); color: var(--text-inverse); }
.btn-primary .step-num { background: rgba(255, 255, 255, 0.25); color: var(--text-inverse); }
.tab.is-locked { color: var(--text-3); }
.gate-card { display: grid; justify-items: center; gap: var(--sp-3); text-align: center; padding: var(--sp-6) var(--sp-5); }
.gate-card .gate-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--bg-3); border: 1px solid var(--line); color: var(--text-2); }
.gate-card .lead { font-size: var(--fs-sm); color: var(--text-2); max-width: 56ch; }
.agreed-row { padding-top: var(--sp-2); border-top: 1px solid var(--line); }

/* ---- Chat: clear button above the messages ---- */
.chat-tools { display: flex; justify-content: flex-end; margin: -6px -6px 0 0; }

/* ---- Drag over a side panel: the whole panel is the drop target ---- */
.drop-overlay {
  position: absolute; inset: 10px; z-index: 10; pointer-events: none;
  display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center; padding: var(--sp-5);
  border: 2px dashed var(--party); border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--party-dim) 94%, transparent); color: var(--party-strong);
  animation: fadein var(--dur-fast) var(--ease-out);
}
.drop-overlay b { font-family: var(--font-display); font-size: var(--fs-md); }
.drop-overlay span { font-size: var(--fs-xs); color: var(--text-2); max-width: 30ch; }
.party.is-dropping { box-shadow: none; background: var(--bg-1); }

/* ---- Background uploads on the Private Files tab ---- */
.uploads { display: grid; gap: 8px; }
.upload-row { display: grid; gap: 6px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--party-line); background: var(--party-dim); }
.upload-row .bar > i { background: var(--party); }
.judge-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: var(--fs-xs); }
.judge-meta a { font-weight: 500; text-decoration: none; }
.judge-meta a:hover { text-decoration: underline; }
.judge-card .dice[aria-pressed="true"] { background: var(--navy-dim); border-color: var(--navy); color: var(--navy); }

/* ---- Tracked changes: a suggested edit shown in place ----
   The old text is struck through; the replacement comes from data-ins, so
   it is not part of the document text (or the signed hash) until accepted. */
.hl.hl-suggest { background: var(--bad-dim); box-shadow: none; color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.hl.hl-suggest::after {
  content: attr(data-ins); margin-left: 4px; padding: 0 2px; border-radius: 2px;
  color: var(--ok); background: var(--ok-dim); text-decoration: none; display: inline;
  box-shadow: inset 0 -2px 0 var(--ok);
}
.hl.hl-suggest[data-ins=""]::after { content: none; }
.hl.hl-suggest.is-active { outline: 2px solid #f9ab00; outline-offset: 1px; }

.suggest-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 12px; border-radius: var(--radius-sm); background: var(--warn-dim); border: 1px solid var(--warn-line); color: var(--warn);
  font-size: var(--fs-sm);
}
.suggest-bar > span { color: var(--text); margin-right: auto; }

/* ---- Accept / Reject under an agent's propose_edit call ---- */
.suggestion-card { display: grid; gap: 8px; padding: 10px; border-radius: var(--radius-sm); border: 1px solid var(--warn-line); background: var(--warn-dim); }
.suggestion-card.is-done { background: transparent; border-color: var(--line); padding: 6px 10px; }
.suggestion-card .suggest { display: grid; gap: 4px; font-size: var(--fs-xs); font-family: var(--font-mono); padding: 8px; background: var(--bg-1); border-radius: 4px; border: 1px solid var(--line); }
.suggestion-card .suggest .del { color: var(--bad); text-decoration: line-through; }
.suggestion-card .suggest .ins { color: var(--ok); }

/* ---- Terms document: prompt, question, then the terms ---- */
.doc-section { display: grid; gap: 8px; }
.doc-section h3 { margin-top: 0; }
.doc-section h3 .od-icon { color: var(--text-3); }
.doc-byline { margin-left: auto; font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 400; color: var(--text-3); }
.doc-hint { font-size: var(--fs-xs); color: var(--text-3); margin-top: -4px; }
.doc-section.is-prompt {
  padding: var(--sp-4); border-radius: var(--radius-md); background: var(--bg-3); border: 1px solid var(--line);
}
.doc-section.is-prompt .doc-body { font-family: var(--font-mono); font-size: var(--fs-sm); line-height: 1.7; color: var(--text-2); }
.doc-section.is-prompt h3 .od-icon { color: var(--navy); }
.doc-section.is-question {
  padding: var(--sp-4); border-radius: var(--radius-md); background: var(--alice-dim); border: 1px solid var(--alice-line);
}
.doc-section.is-question h3 .od-icon { color: var(--alice-strong); }
.doc-section.is-question .doc-body { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 500; line-height: 1.5; }
.doc-group {
  margin-top: var(--sp-3); padding-top: var(--sp-4); border-top: 1px solid var(--line);
  font-size: var(--fs-xl);
}

/* ---- Per-part approval ticks (one per side) ---- */
.approve-bar { margin-left: auto; display: inline-flex; gap: 6px; }
.approve-tick {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong); background: var(--bg-1); color: var(--text-3); cursor: pointer;
  font-family: var(--font-display); font-size: 11px; font-weight: 600;
}
.approve-tick .od-icon { opacity: 0.35; }
.approve-tick:hover:not(:disabled) { border-color: var(--ok); color: var(--ok); }
.approve-tick.is-approved { background: var(--ok-dim); border-color: var(--ok-line); color: var(--ok); }
.approve-tick.is-approved .od-icon { opacity: 1; }
.approve-tick.is-stale { background: var(--warn-dim); border-color: var(--warn-line); color: var(--warn); }
.approve-tick:disabled { cursor: default; }
.doc-byline { margin-left: 8px; }

/* ---- Locked Terms ---- */
.lock-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--ok-dim); border: 1px solid var(--ok-line); color: var(--ok); font-size: var(--fs-sm);
}
.lock-bar > span { color: var(--text); margin-right: auto; }
.doc-body[contenteditable="false"] { cursor: default; }

/* ---- Empty sections and whole-section proposals ---- */
.doc-body:empty::before { content: attr(data-placeholder); color: var(--text-3); font-style: italic; }
.doc-section.is-terms h3 { font-size: var(--fs-xl); padding-top: var(--sp-4); border-top: 1px solid var(--line); margin-top: var(--sp-2); }
.proposal-block { display: grid; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px dashed var(--ok); background: var(--ok-dim); }
.proposal-body { font-size: var(--fs-md); line-height: 1.7; color: var(--text); }
.proposal-body ul { margin: 8px 0 0; padding-left: 22px; }
.proposal-body p + p { margin-top: 10px; }

/* ---- Signing key card ---- */
.key-card { display: grid; gap: 8px; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg-3); margin-top: var(--sp-2); }
.key-kv { grid-template-columns: 90px minmax(0, 1fr); font-size: var(--fs-xs); }
.key-secret { display: flex; align-items: center; gap: 6px; }

/* ---- Negotiate: step strip ---- */
.neg-steps { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; }
.neg-arrow { align-self: center; color: var(--text-3); }
.neg-step {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--radius-lg);
  border: 1px solid var(--line); background: var(--bg-1); cursor: pointer; font-size: var(--fs-sm); color: var(--text);
}
.neg-step:hover { border-color: var(--line-strong); }
.neg-step .neg-label { font-family: var(--font-display); font-weight: 500; }
.neg-step.is-done { border-color: var(--ok-line); background: var(--ok-dim); }
.neg-step.is-done .step-num { background: var(--ok); color: var(--text-inverse); }
.neg-step.is-waiting { color: var(--text-3); }
.neg-step.is-next { border-color: var(--navy); background: var(--navy-dim); color: var(--navy); }
.neg-ticks { display: inline-flex; gap: 3px; margin-left: 4px; }
.neg-tick { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; background: var(--bg-4); color: var(--text-3); }
.neg-tick.is-approved { background: var(--ok); color: var(--text-inverse); }

/* ---- Security: attestation status and the tab's countdown ---- */
.attest-status {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--radius-md);
  background: var(--ok-dim); border: 1px solid var(--ok-line);
}
.attest-status .attest-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: var(--text-inverse); }
.attest-status.is-checking { background: var(--warn-dim); border-color: var(--warn-line); }
.attest-status.is-checking .attest-dot { background: var(--warn); animation: pulse 1s ease-in-out infinite; }
.attest-mini {
  display: inline-flex; align-items: center; gap: 3px; height: 18px; padding: 0 6px; border-radius: 9px;
  background: var(--ok-dim); color: var(--ok); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.attest-mini.is-checking { background: var(--warn-dim); color: var(--warn); }

/* ---- Invite: one-line codes ---- */
.join-card .code-inline { font-family: var(--font-mono); font-size: var(--fs-lg); font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; }
.code-qr { font-family: var(--font-mono); font-size: var(--fs-md); font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; }

/* Joined from an invite: other views are shown but not usable. */
.seg button:disabled { opacity: 0.45; cursor: not-allowed; }
.seg button:disabled:hover { background: transparent; color: var(--text-2); }

/* ---- Leaving and ended sessions ---- */
.leave-modal { width: min(480px, 100%); }
.leave-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--bad-dim); color: var(--bad); border: 1px solid var(--bad-line); margin-bottom: 6px; }
.app.is-ended { grid-template-rows: var(--topbar-h) auto minmax(0, 1fr); }
.ended-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px var(--sp-4);
  background: var(--bad-dim); border-bottom: 1px solid var(--bad-line); color: var(--bad); font-size: var(--fs-sm);
}
.ended-banner span { color: var(--text); margin-right: auto; }
/* Ended: look around freely, but nothing that changes the session works. */
.app.is-ended :is(.composer, .approve-bar, .run-bar .right, .judge-pick select, .judge-pick .dice, .files-view .dropzone,
  .file-card .factions, .suggest-bar button, .proposal-block button, .suggestion-card button, .appeal-options,
  .prompt-list, .chat-tools, .agent-row .change, .sel-pop) { pointer-events: none; opacity: 0.5; }

/* ---- Simulate ---- */
.sim-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--bg-1); border: 1px solid var(--line); font-size: var(--fs-sm); color: var(--text-2); }
.sim-add { display: grid; gap: 10px; }
.sim-cases { display: grid; gap: var(--sp-3); }
.sim-case { display: grid; gap: 10px; }
.sim-evidence { margin: 0; padding: 10px 12px; background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: var(--fs-xs); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); max-height: 160px; overflow: auto; }
.sim-result { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---- Terms document: prompt, question and terms are equal cards ---- */
.doc-section,
.doc-section.is-prompt,
.doc-section.is-question,
.doc-section.is-terms {
  padding: var(--sp-4); border-radius: var(--radius-md); background: var(--bg-1);
  border: 1px solid var(--line); border-left: 4px solid var(--line-strong);
}
.doc-section.is-prompt { border-left-color: var(--navy); }
.doc-section.is-question { border-left-color: var(--alice); }
.doc-section.is-terms { border-left-color: var(--lab); }
.doc-section h3,
.doc-section.is-terms h3 { font-size: var(--fs-lg); padding-top: 0; border-top: 0; margin-top: 0; }
.doc-section.is-prompt h3 .od-icon { color: var(--navy); }
.doc-section.is-question h3 .od-icon { color: var(--alice-strong); }
.doc-section.is-terms h3 .od-icon { color: var(--lab-strong); }
.doc-section .doc-body,
.doc-section.is-prompt .doc-body,
.doc-section.is-question .doc-body {
  font-family: var(--font-body); font-size: var(--fs-md); font-weight: 400; line-height: 1.7; color: var(--text);
}
.attest-status .attest-fresh { flex: 1 1 160px; min-width: 120px; }
.attest-status .attest-fresh .bar > i { background: var(--ok); }
.attest-status.is-checking .attest-fresh .bar > i { background: var(--warn); }

/* ---- Notices: the other side changed the Terms ---- */
.notice-card { display: grid; gap: 6px; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); border-left: 3px solid var(--warn); background: var(--bg-1); }
.notice-card .od-icon { color: var(--warn); flex: none; }
.notice-text { font-size: var(--fs-sm); color: var(--text); }
.notice-summary { font-size: var(--fs-xs); color: var(--text-2); overflow-wrap: anywhere; }

/* ---- Simulate (step 2) ---- */
.sim-terms { display: grid; gap: 10px; }
.sim-terms-text { white-space: pre-wrap; max-height: 140px; overflow: auto; }
.sim-evidence-card { display: grid; gap: var(--sp-3); }
.sim-sources { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-4); }
.sim-source { display: grid; gap: 8px; align-content: start; }
.sim-preview { display: grid; gap: 8px; }
.judge-button { min-height: 44px; padding: 0 var(--sp-5); font-size: var(--fs-md); }
.sim-history { display: grid; gap: 10px; }
.sim-run { display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--bg-1); border: 1px solid var(--line); }
@media (max-width: 1180px) { .sim-sources { grid-template-columns: minmax(0, 1fr); } }

/* ---- LLM Judge as a section of the Terms ---- */
.doc-section.is-judge { padding: var(--sp-4); border-radius: var(--radius-md); background: var(--bg-1); border: 1px solid var(--line); border-left: 4px solid var(--box); }
.doc-section.is-judge h3 .od-icon { color: var(--box); }
.judge-row { display: flex; align-items: center; gap: 8px; }
.judge-row .judge-select { flex: 1; min-height: 40px; font-size: var(--fs-md); }
.judge-row .dice { width: 40px; min-height: 40px; flex: none; }
.judge-details { display: grid; gap: 10px; }
.judge-details .judge-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1180px) { .judge-details .judge-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.judge-chosen { font-size: var(--fs-xs); color: var(--text-3); }

/* ---- Side panel: three tabs, and the Settings view ---- */
.panel-switch { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel-switch button { padding: 0 8px; gap: 4px; white-space: nowrap; }
.prompt-editor { min-height: 140px; font-size: var(--fs-sm); line-height: 1.6; }

/* Inserted text must not inherit the strike-through: an inline-block stops
   text-decoration propagating from the struck-out span. */
.hl.hl-suggest::after { display: inline-block; max-width: 100%; text-decoration: none; white-space: normal; vertical-align: top; }
.proposal-block.is-draft { border-color: var(--line-strong); background: var(--bg-3); }
.suggestion-card.is-draft { border-style: dashed; }

/* ---- Chat tab: party-to-party messages ---- */
.dm-card { display: grid; grid-template-rows: minmax(0, 1fr) auto; height: calc(100dvh - 300px); min-height: 360px; padding: 0; overflow: hidden; }
.dm-list {
  overflow-y: auto; padding: var(--sp-4); display: flex; flex-direction: column; gap: 6px;
  background: repeating-linear-gradient(45deg, var(--bg-0) 0 12px, var(--bg-3) 12px 13px);
}
.dm-row { display: flex; }
.dm-row.is-mine { justify-content: flex-end; }
.dm-bubble {
  display: grid; gap: 2px; max-width: min(70%, 520px); padding: 6px 10px 4px; border-radius: 12px 12px 12px 3px;
  background: var(--bg-1); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.dm-row.is-mine .dm-bubble { border-radius: 12px 12px 3px 12px; background: #d9fdd3; border-color: #bfe8b8; }
.dm-name { font-size: var(--fs-xs); font-weight: 600; }
.dm-row[data-side="alice"] .dm-name { color: var(--alice-strong); }
.dm-row[data-side="openbrain"] .dm-name { color: var(--lab-strong); }
.dm-text { font-size: var(--fs-sm); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.dm-meta { justify-self: end; display: inline-flex; gap: 4px; font-size: 10px; color: var(--text-3); }
.dm-ticks { color: #53bdeb; letter-spacing: -2px; }
.dm-empty { margin: auto; display: grid; justify-items: center; gap: 8px; text-align: center; color: var(--text-3); max-width: 36ch; font-size: var(--fs-sm); }
.dm-composer { display: flex; gap: 8px; align-items: end; padding: var(--sp-3); border-top: 1px solid var(--line); background: var(--bg-1); }
.dm-composer textarea { flex: 1; min-height: 40px; max-height: 120px; resize: none; border-radius: 20px; }

/* ---- Scenario picker and the case brief ---- */
.scenario-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.case-card { display: grid; gap: 8px; }
.case-text { font-size: var(--fs-sm); line-height: 1.6; color: var(--text); white-space: pre-wrap; }
@media (max-width: 640px) { .scenario-grid { grid-template-columns: minmax(0, 1fr); } }

/* Chat cards never push past the panel; long proposals scroll. */
.msg-body, .msg-body > * { min-width: 0; }
.suggestion-card .suggest { max-height: 260px; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- Brand: Judgy, and the serif wordmark ---- */
.brand { gap: 12px; }
.brand-judgy {
  width: 40px; height: 40px; flex: none; object-fit: contain; padding: 2px;
  border-radius: 10px; background: var(--bg-1); border: 1px solid var(--line);
}
.brand-name {
  font-family: "Fraunces", Georgia, "Times New Roman", serif; font-weight: 700;
  font-size: 22px; line-height: 1.05; letter-spacing: -0.01em; color: var(--text);
}
.brand-name .brand-ai { font-style: italic; color: #b3263e; }
.brand-byline { font-size: var(--fs-xs); color: var(--text-3); letter-spacing: 0.01em; white-space: nowrap; }
.brand-mark {
  position: relative; flex: none; display: block; width: auto; height: auto;
  border-radius: 0; background: none; color: inherit;
}
.app-version {
  display: inline-block; margin-left: 10px; vertical-align: middle;
  font-family: var(--font-mono); font-size: 11px; font-weight: 400;
  line-height: 1; letter-spacing: 0; color: var(--text-3); white-space: nowrap;
}
.brand-mark .app-version {
  position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
  margin: 0; padding: 1px 2px; border-radius: 2px; background: var(--bg-1);
  font-size: 9px; line-height: 10px;
}

/* ---- Emphasis: bold pulls attention to the deciding terms ---- */
.doc-body strong, .proposal-body strong, .msg-text strong, .notice-text strong,
.comment .text strong, .comment .reply strong, .suggest .ins strong {
  font-weight: 700; color: var(--text);
  box-shadow: inset 0 -0.38em 0 color-mix(in srgb, var(--navy) 13%, transparent);
}
.doc-body em, .proposal-body em, .msg-text em { font-style: italic; color: var(--text); }
.doc-section.is-prompt .doc-body strong { box-shadow: none; }

/* ---- Tab bar: Chat | Negotiate & Simulate → Arbitrate | Evidence, Security ---- */
.tabbar { align-items: center; }
.tabbar .tab { align-self: flex-end; }
.tab-sep { width: 1px; height: 22px; background: var(--line-strong); flex: none; margin: 0 4px; }
.tab-group { display: inline-flex; align-items: flex-end; align-self: stretch; gap: 0; padding: 0 4px; border-radius: 10px 10px 0 0; background: color-mix(in srgb, var(--bg-3) 60%, transparent); }
.tab-amp { align-self: center; color: var(--text-3); font-size: var(--fs-xs); padding: 0 2px; }
.tab-arrow { align-self: center; color: var(--text-3); flex: none; }

/* ---- Negotiate steps: Simulate sits apart from the chain ---- */
.neg-aside { margin-left: auto; display: flex; padding-left: 12px; border-left: 1px solid var(--line); }
.neg-step.is-side { border-style: dashed; color: var(--text-2); }

/* ---- Arbitrate: what goes into the box ---- */
.inputs-card { display: grid; gap: 14px; margin-bottom: 16px; }
.in-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.in-tabs { display: inline-flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--bg-3); margin-left: auto; }
.in-tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 0; border-radius: 999px;
  background: transparent; color: var(--text-2); font: inherit; font-size: var(--fs-sm); font-weight: 500; cursor: pointer;
}
.in-tab:hover { color: var(--text); }
.in-tab[aria-selected="true"] { background: var(--bg-1); color: var(--navy); box-shadow: var(--shadow-sm); }
.in-tab[aria-selected="true"] .step-num { background: var(--navy); color: var(--text-inverse); }
.in-tab .count { min-width: 18px; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--bg-4); font-size: 11px; display: inline-grid; place-items: center; }
.in-body { display: grid; gap: 10px; min-height: 64px; }
.in-doc { max-height: 280px; overflow: auto; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg-1); border: 1px solid var(--line); font-size: var(--fs-sm); line-height: 1.6; }
.in-doc p { margin: 0 0 8px; }
.in-doc p:last-child { margin-bottom: 0; }
.in-status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-3); }
.in-status.ok { color: var(--ok); }
.sealed-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg-1);
}
.sealed-row .cn { font-weight: 500; }
.sealed-row .cm { font-size: var(--fs-xs); color: var(--text-3); }

/* ---- Arbitrate: the run, one view for everyone ---- */
.run-card { display: grid; grid-template-columns: minmax(220px, 0.8fr) 1.2fr; gap: 20px; margin-top: 16px; }
@media (max-width: 760px) { .run-card { grid-template-columns: 1fr; } }
.run-hero {
  display: grid; align-content: start; justify-items: start; gap: 8px; padding: 18px;
  border-radius: var(--radius-md); background: var(--bg-3); border: 1px solid var(--line);
}
.run-hero.is-released { background: var(--ok-dim); border-color: var(--ok-line); }
.run-hero.is-withheld { background: var(--bad-dim); border-color: var(--bad); }
.run-hero p { margin: 0; }
.run-verdict {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: "Fraunces", Georgia, serif; font-size: 34px; font-weight: 700; line-height: 1.1; color: var(--text);
}
.run-hero.is-running .run-verdict { font-size: 26px; color: var(--text-2); }
.spinner {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--navy);
  animation: roll 0.9s linear infinite;
}
.run-stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.run-stage { display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding: 10px 0; position: relative; }
.run-stage + .run-stage { border-top: 1px solid var(--line); }
.run-stage .pt {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg-3); color: var(--text-3); border: 1px solid var(--line);
}
.run-stage.ok .pt { background: var(--ok-dim); color: var(--ok); border-color: var(--ok-line); }
.run-stage.bad .pt { background: var(--bad-dim); color: var(--bad); border-color: var(--bad); }
.run-stage.running .pt { background: var(--navy-dim); color: var(--navy); border-color: var(--navy); }
.run-stage.running .pt .od-icon { animation: roll 1.2s linear infinite; }
.run-stage .tt { font-weight: 500; }

/* ---- Arbitrate: the judge trace (demo only) ---- */
.trace-card { display: grid; gap: 14px; margin-top: 16px; }
.trace-demo {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--bad-dim); color: var(--bad); border: 1px dashed var(--bad); font-size: var(--fs-sm);
}
.trace-demo b { letter-spacing: 0.08em; }
.trace-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.trace-list { list-style: none; margin: 0; padding: 0 0 0 11px; display: grid; gap: 8px; border-left: 2px solid var(--line); }
.trace-list > li { position: relative; margin-left: 14px; }
.trace-ic {
  position: absolute; left: -26px; top: 6px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: var(--navy-dim); color: var(--navy); border: 2px solid var(--bg-2);
}
.trace-ic.is-tool { background: var(--bg-3); color: var(--text-2); }
.trace-text .md { font-size: var(--fs-sm); line-height: 1.6; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--bg-1); border: 1px solid var(--line); }
.trace-text .md p { margin: 0 0 6px; }
.trace-text .md p:last-child { margin-bottom: 0; }
.trace-text .md strong { box-shadow: inset 0 -0.38em 0 color-mix(in srgb, var(--navy) 13%, transparent); }
.trace-text .typing { margin-left: 4px; }
.trace-tool details { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-1); }
.trace-tool summary {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px; cursor: pointer; list-style: none; font-size: var(--fs-sm);
}
.trace-tool summary::-webkit-details-marker { display: none; }
.trace-tool summary .args { flex: 1; min-width: 0; color: var(--text-3); font-size: var(--fs-xs); }
.trace-tool.is-running summary .xs { color: var(--navy); }
.trace-tool.is-failed summary .xs { color: var(--bad); }
.trace-tool pre, .trace-block pre {
  margin: 0; padding: 10px 12px; max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-word;
  font-family: var(--font-mono); font-size: var(--fs-xs); line-height: 1.55; background: var(--bg-3); border-top: 1px solid var(--line);
}
.trace-block { border: 1px solid var(--line); border-radius: var(--radius-sm); }
.trace-block summary { cursor: pointer; padding: 8px 12px; font-size: var(--fs-xs); color: var(--text-2); font-weight: 500; }

/* ---- Simulated files: for the Simulate tab only, never sealed ---- */
.ev-subhead {
  display: flex; align-items: center; gap: 6px; margin: 8px 0 2px; padding: 0 10px;
  font-size: var(--fs-xs); color: var(--warn); font-weight: 500;
}
.ev-file.is-simulated { border-style: dashed; }
.ev-file.is-simulated .od-icon { color: var(--warn); }

/* ---- Arbitrate: seal your own files from the Evidence tab ---- */
.seal-list { display: grid; gap: 6px; margin-top: 4px; }
.seal-row {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px;
  padding: 6px 6px 6px 12px; border-radius: var(--radius-sm); border: 1px dashed var(--line-strong);
}

/* ---- Toasts: top middle, clear of the chat composers ---- */
.toasts { left: 50%; right: auto; top: 72px; bottom: auto; transform: translateX(-50%); justify-items: center; }

/* ---- Chat stays light: one-line notices and follow-ups, small buttons.
   Reading and editing happen on the Negotiate tab. ---- */
.notice-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.notice-line .notice-text { flex: 1; min-width: 0; }
.notice-summary { margin: 0; }
.sg-btns { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sg-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--bg-1); color: var(--text); font: inherit;
  font-size: var(--fs-xs); font-weight: 500; cursor: pointer; white-space: nowrap;
}
.sg-btn:hover:not(:disabled) { border-color: var(--navy); color: var(--navy); }
.sg-btn:disabled { opacity: 0.5; cursor: default; }
.sg-btn.is-primary { background: var(--navy); border-color: var(--navy); color: var(--text-inverse); }
.sg-btn.is-primary:hover { color: var(--text-inverse); filter: brightness(1.08); }
.sg-btn.is-quiet { border-color: transparent; color: var(--text-2); padding: 0 6px; }
.sg-state { font-size: var(--fs-xs); color: var(--text-3); padding: 0 4px; }
.followups { display: grid; gap: 6px; margin-top: 8px; }
.sg-strip {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 8px 6px 10px;
  border-radius: var(--radius-sm); border: 1px dashed var(--line-strong); background: var(--bg-1);
}
.sg-strip > .od-icon { color: var(--warn); flex: none; }
.sg-strip .sg-label { flex: 1; min-width: 120px; font-size: var(--fs-xs); color: var(--text-2); }
.sg-strip .sg-label b { color: var(--text); font-weight: 600; }

/* ---- Canned requests (Seek advice) show as a chip, not the prompt ---- */
.request-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 4px 10px; border-radius: 999px; font-size: var(--fs-xs); color: var(--text-2);
  background: var(--bg-1); border: 1px solid var(--line-strong);
}
.request-chip b { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Negotiate steps: one row, scrolling sideways rather than wrapping ---- */
.neg-steps { flex-wrap: nowrap; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.neg-steps::-webkit-scrollbar { display: none; }
.neg-steps > * { flex: none; }
.neg-step { padding: 7px 12px; gap: 7px; white-space: nowrap; }
.neg-arrow { font-size: var(--fs-sm); }

/* ---- Simulate: tick the files the judge sees together ---- */
.sim-file {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px; padding-left: 10px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
}
.sim-file input { width: 16px; height: 16px; accent-color: var(--navy); cursor: pointer; }
.sim-file.is-ticked { background: var(--navy-dim); }
.sim-file.is-previewed { border-color: var(--navy); }
.sim-file-name {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; min-width: 0;
  padding: 8px 10px; border: 0; background: transparent; font: inherit; color: var(--text); text-align: left; cursor: pointer;
}

/* ---- Private files: the name gets the full width, actions go underneath ---- */
.file-card { grid-template-columns: 34px minmax(0, 1fr); row-gap: 8px; }
.file-card .factions { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; }
.file-card .factions:empty { display: none; }

/* ---- Private Files tab: your files as a strip above the preview ---- */
.pf-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.pf-file {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-1); color: var(--text); font: inherit; font-size: var(--fs-sm); cursor: pointer;
}
.pf-file:hover { border-color: var(--line-strong); }
.pf-file.is-selected { border-color: var(--navy); background: var(--navy-dim); }
.pf-file.is-sealed { border-color: var(--box-line); }
.pf-file.is-sealed > .od-icon { color: var(--box); }
.pf-file.is-simulated { border-style: dashed; }
.pf-file.is-simulated > .od-icon { color: var(--warn); }
.pf-name { white-space: nowrap; }

/* ---- Arbitrate: the evidence step, until something is sealed ---- */
.add-evidence { display: grid; gap: 12px; margin-bottom: 16px; border: 1px solid var(--navy); background: var(--navy-dim); }
.add-evidence-head { display: flex; gap: 12px; align-items: flex-start; }
.add-evidence h3 { margin: 0; }
.add-evidence p { margin: 0; }
.add-evidence .step-badge {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--navy); color: var(--text-inverse);
}
.add-evidence .seal-row { background: var(--bg-1); }

/* ---- Simulate, at the bottom of Negotiate ---- */
.sim-section { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); scroll-margin-top: 16px; }
.sim-against { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.sim-against select { width: auto; min-width: 240px; max-width: 100%; }
.sim-against .xs { margin-left: auto; }

/* ---- File viewer: find box, coloured JSON ---- */
.file-view { display: grid; gap: 8px; min-width: 0; }
.find-box {
  display: flex; align-items: center; gap: 8px; max-width: 320px; padding: 0 10px; height: 32px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg-1); color: var(--text-3);
}
.find-box:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-dim); }
.find-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: var(--fs-sm); color: var(--text); }
.ev-text.ev-json, .ev-text.ev-jsonl {
  margin: 0; padding: 12px 14px; background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: var(--fs-xs); line-height: 1.65; color: var(--text-2);
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 70vh; overflow: auto;
}
.ev-jsonl { display: grid; gap: 0; }
.jl-row { display: grid; grid-template-columns: 3ch 1fr; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.jl-row:last-child { border-bottom: 0; }
.jl-n { color: var(--text-3); text-align: right; user-select: none; }
.jl-row code { font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.jk { color: #7b5ad8; }            /* keys */
.js { color: #188038; }            /* strings */
.jn { color: #c5221f; }            /* numbers */
.jb, .jl { color: #1a73e8; font-weight: 500; } /* true / false / null */
.jp { color: var(--text-3); }      /* punctuation */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .jk { color: #b39ddb; }
  :root:not([data-theme="light"]) .js { color: #81c995; }
  :root:not([data-theme="light"]) .jn { color: #f28b82; }
  :root:not([data-theme="light"]) :is(.jb, .jl) { color: #8ab4f8; }
}

/* ---- Simulate: generating data comes first, on its own row ---- */
.sim-sources { grid-template-columns: minmax(0, 1fr); }
.sim-generate { margin-bottom: var(--sp-4); padding-bottom: var(--sp-4); border-bottom: 1px solid var(--line); }
.sim-generate .btn { justify-self: start; }
.sim-num { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-sm); color: var(--text); white-space: nowrap; }
.sim-run .od-row { flex-wrap: wrap; }

/* ---- Arbitrate: tick files, then seal (and start) ---- */
.seal-row { grid-template-columns: auto auto 1fr auto; cursor: pointer; }
.seal-row input { width: 16px; height: 16px; accent-color: var(--navy); cursor: pointer; }
.seal-row.is-ticked { border-style: solid; border-color: var(--navy); background: var(--navy-dim); }
.seal-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* ---- Side panel switch: room for each label and its count ---- */
.panel-switch { display: flex; gap: 4px; padding: 4px; }
.panel-switch button { flex: 1 1 auto; justify-content: center; gap: 6px; padding: 0 14px; min-height: 34px; white-space: nowrap; }
.panel-switch .count { margin-left: 2px; }

/* ---- Judge trace, in order: model, prompt, Terms, steps, output ---- */
.trace-section { display: grid; gap: 8px; }
.trace-label { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.trace-model { grid-template-columns: auto auto; justify-content: start; align-items: center; gap: 12px; }
.trace-block summary { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.trace-output {
  padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--ok-line); background: var(--ok-dim);
  font-size: var(--fs-sm); line-height: 1.6;
}
.trace-output p { margin: 0 0 6px; }
.trace-output { display: grid; gap: 6px; }
.trace-verdict { font-family: var(--font-mono); font-weight: 700; letter-spacing: 0.04em; color: var(--text); }
.trace-output p:last-child { margin-bottom: 0; }
.msg-took { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }

/* ---- Chat: the message column never grows past the panel. A grid's
   default auto column sizes to its widest nowrap child (tool arguments),
   which pushed everything off the edge. ---- */
.msg-body, .followups, .notice-card { grid-template-columns: minmax(0, 1fr); }
.msg-body .msg-text { overflow-wrap: anywhere; }
.tool-card .tool-args { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Side panels: one column exactly the panel's width, so the chat
   lines up with the header instead of growing past the divider. ---- */
.party { grid-template-columns: minmax(0, 1fr); }
.party > *, .chat > * { min-width: 0; max-width: 100%; }

/* ---- Invite code prompt ---- */
.join-key-modal { display: grid; gap: 14px; }
.join-key-input { font-family: var(--font-mono); font-size: 28px; letter-spacing: 0.4em; text-align: center; padding: 12px; }
.trace-q-label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.trace-question { margin: 0 0 6px; font-size: var(--fs-sm); color: var(--text-2); }
.trace-verdict { font-size: 22px; }

/* ---- The judging overlay: a gavel that bangs, then the verdict ---- */
.judging {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px;
  background: color-mix(in srgb, #0b0d11 72%, transparent); backdrop-filter: blur(6px);
  animation: fadein var(--dur-med) var(--ease-out);
}
.judging-card {
  width: min(560px, 100%); display: grid; justify-items: center; gap: 14px; text-align: center;
  padding: 32px 28px; border-radius: 20px; background: var(--bg-1); box-shadow: var(--shadow-md);
}
.gavel-stage { width: 180px; height: 135px; }
.gavel-swing {
  transform-box: fill-box; transform-origin: 100% 50%;
  animation: gavel-bang 0.9s cubic-bezier(.5, 0, .3, 1) infinite;
}
.gavel-ring { transform-box: fill-box; transform-origin: center; opacity: 0; animation: gavel-ring 0.9s ease-out infinite; }
@keyframes gavel-bang {
  0%   { transform: rotate(32deg); }
  55%  { transform: rotate(32deg); }
  70%  { transform: rotate(-2deg); }
  78%  { transform: rotate(3deg); }
  100% { transform: rotate(32deg); }
}
@keyframes gavel-ring {
  0%, 68% { opacity: 0; transform: scale(0.5); }
  72%     { opacity: 0.9; transform: scale(1); }
  100%    { opacity: 0; transform: scale(1.8); }
}
/* With the verdict: one last bang, and it stays down. */
.judging:not(.is-running) .gavel-swing { animation: gavel-final 0.7s cubic-bezier(.5, 0, .3, 1) both; }
.judging:not(.is-running) .gavel-ring { animation: gavel-ring-once 0.9s ease-out 0.35s both; }
@keyframes gavel-final { 0% { transform: rotate(32deg); } 60% { transform: rotate(-2deg); } 100% { transform: rotate(0deg); } }
@keyframes gavel-ring-once { 0% { opacity: 0.9; transform: scale(1); } 100% { opacity: 0; transform: scale(2.2); } }
.judging-title { margin: 0; font-family: "Fraunces", Georgia, serif; font-size: 34px; }
.judging-dots i { font-style: normal; animation: pulse 1.2s ease-in-out infinite; }
.judging-dots i:nth-child(2) { animation-delay: 0.2s; }
.judging-dots i:nth-child(3) { animation-delay: 0.4s; }
.judging-q { display: grid; gap: 4px; max-width: 46ch; }
.judging-q-label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.judging-q p { margin: 0; font-size: var(--fs-sm); color: var(--text-2); max-height: 7.5em; overflow: auto; }
.judging-step { margin: 0; font-size: var(--fs-xs); color: var(--text-3); font-family: var(--font-mono); }
.judging-verdict {
  font-family: "Fraunces", Georgia, serif; font-size: 64px; font-weight: 700; line-height: 1; letter-spacing: 0.02em;
  animation: verdict-in 0.5s cubic-bezier(.2, 1.4, .4, 1) 0.45s both;
}
.judging.is-true .judging-verdict { color: var(--ok); }
.judging.is-false .judging-verdict { color: #b3263e; }
.judging.is-withheld .judging-verdict { color: var(--text-3); font-size: 44px; }
@keyframes verdict-in { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .gavel-swing, .gavel-ring, .judging-verdict, .judging-dots i { animation: none !important; }
}

/* ---- The verdict in the parties' chat ---- */
.dm-verdict {
  align-self: center; display: grid; justify-items: center; gap: 4px; max-width: 520px; margin: 8px auto;
  padding: 12px 18px; border-radius: 14px; background: var(--bg-1); border: 1px solid var(--line-strong); text-align: center;
}
.dm-verdict-head { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-3); }
.dm-verdict-q { font-size: var(--fs-sm); color: var(--text-2); }
.dm-verdict-v { font-family: "Fraunces", Georgia, serif; font-size: 28px; font-weight: 700; }
.dm-verdict[data-verdict="true"] .dm-verdict-v { color: var(--ok); }
.dm-verdict[data-verdict="false"] .dm-verdict-v { color: #b3263e; }
.dm-verdict[data-verdict="withheld"] .dm-verdict-v { color: var(--text-3); }

.trace-output[data-verdict="false"] { border-color: #f1b8bf; background: #fdecee; }
.trace-output[data-verdict="false"] .trace-verdict { color: #b3263e; }
.trace-output[data-verdict="true"] .trace-verdict { color: var(--ok); }

/* ---- Centre column: exactly its share of the workspace. The tab bar
   scrolls inside it instead of widening it (which clipped content on
   phones). ---- */
.center { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.tabbar, .tab-panels { min-width: 0; }

/* ---- Cards built on grids: one column exactly the card's width, so a
   long unbroken line (tool arguments, a question) never widens the card
   past a phone screen. ---- */
.trace-card, .trace-section, .trace-list, .run-card, .run-hero, .inputs-card, .in-body,
.add-evidence, .seal-list, .graph-wrap, .sim-evidence-card, .sim-sources, .sim-source,
.file-view, .ev-preview { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.trace-list > li, .trace-tool details, .trace-tool summary { min-width: 0; }
.trace-output, .trace-question { overflow-wrap: anywhere; }
@media (max-width: 760px) { .run-card { grid-template-columns: minmax(0, 1fr); } }
.graph { width: 100%; height: auto; }
.graph-wrap > .od-row { flex-wrap: wrap; }
/* Every tab's content column: the panel's width, never its widest child
   (the steps strip scrolls inside it instead). */
.panel-inner { grid-template-columns: minmax(0, 1fr); min-width: 0; }
/* Sign-off: the two signatures stack when there is no room side by side. */
.signoff, .signoff .sig { min-width: 0; }
.signoff .sigs { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.signoff .od-row { flex-wrap: wrap; }
.signoff .sig .chip { white-space: normal; max-width: 100%; }
.signoff { grid-template-columns: minmax(0, 1fr); }
/* Tab headers: their controls (e.g. the judge model and run status on
   Arbitrate) wrap under the title on narrow screens. */
.panel-title { flex-wrap: wrap; }
.panel-title > *, .panel-title .od-row { min-width: 0; max-width: 100%; }
.panel-title .od-row { flex-wrap: wrap; }
.panel-title .chip { white-space: normal; max-width: 100%; }
/* The ledger table scrolls sideways inside its card on narrow screens. */
table.ledger { display: block; max-width: 100%; overflow-x: auto; }

/* ---- One side panel at a time, and it comes first: it stays docked as the
   window narrows and the centre gives way; only phones get the drawer. ---- */
:root { --side-w: 380px; }
@media (max-width: 1180px) { :root { --side-w: 340px; } }
@media (max-width: 900px) { :root { --side-w: 300px; } }
@media (min-width: 761px) and (max-width: 1024px) {
  .workspace.hide-alice { grid-template-columns: minmax(0, 1fr) var(--side-w); }
  .workspace.hide-openbrain { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .workspace:is(.hide-alice, .hide-openbrain) > .party {
    position: static; transform: none; width: auto; box-shadow: none;
  }
  .drawer-toggle { display: none; }
}
/* The panel switch gives way before the panel does. */
.panel-switch button { min-width: 0; padding: 0 clamp(6px, 1vw, 14px); overflow: hidden; }
@media (max-width: 900px) { :root { --side-w: 320px; } }

/* ---- Thinking: Claude Code style, orange star and a changing verb ---- */
.thinking { --think: #d97757; display: inline-flex; align-items: center; gap: 8px; color: var(--think); font-size: var(--fs-sm); font-weight: 500; }
.thinking-star { display: inline-block; animation: think-spin 2.4s linear infinite, think-pulse 1.2s ease-in-out infinite; }
.thinking-word { animation: think-word 0.45s var(--ease-out); }
.thinking.is-big { font-family: "Fraunces", Georgia, serif; font-size: 34px; font-weight: 700; gap: 12px; }
.thinking.is-big .thinking-star { font-size: 28px; }
@keyframes think-spin { to { transform: rotate(360deg); } }
@keyframes think-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes think-word { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.judging-title { margin: 0; min-height: 44px; }
.trace-thinking { padding: 4px 0 4px 4px; }
.msg-body > .thinking { padding: 4px 0; }

/* ---- The judge's live ticker in the overlay ---- */
.ticker {
  list-style: none; margin: 4px 0 0; padding: 10px 14px; width: 100%; max-width: 480px;
  display: grid; gap: 4px; text-align: left; min-height: 104px; align-content: end;
  font-family: var(--font-mono); font-size: var(--fs-xs); line-height: 1.5;
  background: #1f1b18; color: #e9e3dc; border-radius: 10px;
}
.ticker li {
  display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 8px;
  animation: ticker-in 0.4s var(--ease-out); transition: opacity 0.4s;
}
.ticker li:nth-last-child(2) { opacity: 0.6; }
.ticker li:nth-last-child(3) { opacity: 0.35; }
.ticker li:nth-last-child(n + 4) { opacity: 0.15; }
.ticker-mark { color: #d97757; }
.ticker li.is-tool .ticker-text { color: #f2c6a8; }
.ticker-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticker li:last-child .ticker-text { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@keyframes ticker-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .thinking-star, .thinking-word, .ticker li { animation: none !important; }
}

/* ---- The judging gavel: an animated image (from art/), its light
   background blended away and its edges feathered into the card. ---- */
.gavel-stage { width: auto; height: auto; display: grid; place-items: center; }
.gavel-anim {
  width: 144px; height: auto; mix-blend-mode: multiply;
  -webkit-mask-image: radial-gradient(ellipse 70% 72% at 50% 50%, #000 62%, transparent 100%);
  mask-image: radial-gradient(ellipse 70% 72% at 50% 50%, #000 62%, transparent 100%);
}
.judging:not(.is-running) .gavel-anim { animation: verdict-in 0.45s cubic-bezier(.2, 1.4, .4, 1) both; }

/* ---- Proposals take the colour of the side making them: Alice purple,
   Bob teal (red is kept for FALSE and withheld). ---- */
.proposal-block[data-side="alice"] { border-color: var(--alice-line); background: var(--alice-dim); }
.proposal-block[data-side="openbrain"] { border-color: var(--lab-line); background: var(--lab-dim); }
.proposal-block.is-draft { background: var(--bg-1); }
.sg-strip[data-side="alice"] { border-color: var(--alice-line); background: color-mix(in srgb, var(--alice-dim) 70%, var(--bg-1)); }
.sg-strip[data-side="openbrain"] { border-color: var(--lab-line); background: color-mix(in srgb, var(--lab-dim) 70%, var(--bg-1)); }
.sg-strip[data-side="alice"] > .od-icon { color: var(--alice-strong); }
.sg-strip[data-side="openbrain"] > .od-icon { color: var(--lab-strong); }
.notice-card[data-side="alice"] { border-left-color: var(--alice); background: color-mix(in srgb, var(--alice-dim) 55%, var(--bg-1)); }
.notice-card[data-side="openbrain"] { border-left-color: var(--lab); background: color-mix(in srgb, var(--lab-dim) 55%, var(--bg-1)); }
.notice-card[data-side="alice"] .od-icon { color: var(--alice-strong); }
.notice-card[data-side="openbrain"] .od-icon { color: var(--lab-strong); }

/* ---- A simulation: title, files, then model / terms / question / answer ---- */
.sim-run { gap: 10px; padding: 14px 16px; }
.sim-head { display: flex; align-items: center; gap: 10px; }
.sim-head .sim-num { font-size: var(--fs-md); }
.sim-head .sim-time { margin-left: auto; }
.sim-files { display: flex; flex-wrap: wrap; gap: 6px; }
.sim-chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--bg-3); border: 1px solid var(--line); color: var(--text-2); }
.sim-out { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: var(--fs-sm); }
.sim-out dt { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); padding-top: 2px; }
.sim-out dd { margin: 0; color: var(--text-2); overflow-wrap: anywhere; }
.sim-answer {
  display: flex; align-items: baseline; gap: 10px; padding-top: 8px; border-top: 1px solid var(--line);
  font-family: "Fraunces", Georgia, serif; font-size: 28px; font-weight: 700; line-height: 1.1;
}
.sim-answer.is-yes { color: var(--ok); }
.sim-answer.is-no { color: #b3263e; }
.sim-answer.is-error { color: var(--text-3); font-size: 20px; }
.sim-answer.is-error .small { font-family: var(--font-body); font-weight: 400; }

/* Your own suggestion in the comments rail: a note, not a decision. */
.comment .actions { flex-wrap: wrap; align-items: center; }
.comment .comment-waiting { margin-right: auto; }

/* ---- Diffs: removed in red and struck through, added in green ---- */
del, .compare-doc del, .proposal-body del { background: var(--bad-dim); color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1.5px; border-radius: 3px; padding: 0 1px; }
ins, .compare-doc ins, .proposal-body ins { background: var(--ok-dim); color: var(--ok); text-decoration: none; box-shadow: inset 0 -1.5px 0 var(--ok); border-radius: 3px; padding: 0 1px; }
.compare-stat { font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; }
.compare-stat ins, .compare-stat del { font-weight: 600; box-shadow: none; padding: 1px 5px; text-decoration: none; }

/* ---- Proposal blocks: who it is from, then actions, then the changes ---- */
.proposal-block { gap: 8px; padding: 14px 16px; }
.proposal-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; min-width: 0; }
.proposal-from { font-size: var(--fs-sm); color: var(--text-2); font-weight: 500; }
.proposal-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.proposal-body.is-diff { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-1); border: 1px solid var(--line); }
.proposal-block { cursor: pointer; }

/* ---- Compare view ---- */
.compare-overlay { z-index: 60; }
.modal.compare { width: min(1240px, 100%); height: min(900px, calc(100vh - 32px)); display: flex; flex-direction: column; gap: 14px; padding: 20px 24px; border-radius: 22px; overflow: hidden; }
.compare-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.compare-crumbs { display: flex; align-items: center; gap: 6px; font-size: var(--fs-md); min-width: 0; }
.compare-crumbs b { font-weight: 600; }
.compare-lead { font-size: var(--fs-sm); color: var(--text-2); margin: 0; }
.compare-timeline { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; flex: none; }
.compare-step { flex: none; font: inherit; font-size: var(--fs-xs); font-weight: 500; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-1); color: var(--text-2); cursor: pointer; }
.compare-step:hover { border-color: var(--line-strong); color: var(--text); }
.compare-step.is-current { background: var(--navy-dim); border-color: var(--navy); color: var(--navy); }
.compare-step[data-side="alice"] { border-color: var(--alice-line); }
.compare-step[data-side="openbrain"] { border-color: var(--lab-line); }
.compare-step[data-side="alice"].is-current { background: var(--alice-dim); color: var(--alice-strong); border-color: var(--alice); }
.compare-step[data-side="openbrain"].is-current { background: var(--lab-dim); color: var(--lab-strong); border-color: var(--lab); }
.compare-pick { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; flex: none; }
.compare-pick label { display: grid; gap: 4px; flex: 1 1 260px; min-width: 0; }
.compare-pick label > span { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.compare-pick select { width: 100%; }
.compare-pick .compare-stat { align-self: center; }
.compare-panes { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.compare-panes.is-single { grid-template-columns: minmax(0, 1fr); }
.compare-pane { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-1); overflow: hidden; }
.compare-pane[data-side="alice"] { border-color: var(--alice-line); }
.compare-pane[data-side="openbrain"] { border-color: var(--lab-line); }
.compare-pane-label { display: flex; align-items: center; gap: 8px; padding: 10px 16px; font-size: var(--fs-xs); color: var(--text-2); background: var(--bg-2); border-bottom: 1px solid var(--line); }
.compare-pane[data-side="alice"] .compare-pane-label { background: var(--alice-dim); }
.compare-pane[data-side="openbrain"] .compare-pane-label { background: var(--lab-dim); }
.compare-tag { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; }
.compare-tag.is-old { background: var(--bad-dim); color: var(--bad); }
.compare-tag.is-new { background: var(--ok-dim); color: var(--ok); }
.compare-doc { flex: 1; overflow-y: auto; padding: 16px 20px; font-size: var(--fs-md); line-height: 1.75; color: var(--text); }
.compare-doc p + p, .compare-doc ul, .compare-doc ol { margin-top: 12px; }
.compare-doc ul, .compare-doc ol { padding-left: 22px; }
.compare-doc .hl { background: none; box-shadow: none; outline: 0; color: inherit; text-decoration: none; }
.compare-doc .hl::after { content: none; }
.compare-editor { flex: 1; min-height: 0; resize: none; border: 0; outline: 0; padding: 16px 20px; font: inherit; font-family: var(--font-mono); font-size: var(--fs-sm); line-height: 1.7; background: var(--bg-1); color: var(--text); }
.compare-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: none; padding-top: 4px; }
.compare-reason { flex: 1 1 240px; min-width: 0; }
.compare-parts { flex: 1; min-height: 0; overflow-y: auto; display: grid; gap: 14px; align-content: start; padding-right: 4px; }
.compare-part { border: 1px solid var(--line); border-radius: 14px; background: var(--bg-1); overflow: hidden; }
.compare-part-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.compare-part-head h3 { font-size: var(--fs-md); margin: 0; }
.compare-part .compare-doc { max-height: 320px; }
@media (max-width: 760px) {
  .modal.compare { padding: 14px; height: calc(100vh - 16px); }
  .compare-panes { grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(0, 1fr); }
}

/* ---- Comments rail: chips beside their text; the open one expands ---- */
.comments { position: static; align-content: start; }
.comment-stack { position: relative; }
.comment-stack > [data-anchor] { position: absolute; left: 0; right: 0; transition: top 0.18s var(--ease-out); }
.comment-stack.is-flow { display: grid; gap: 8px; }
.comment-stack.is-flow > [data-anchor] { position: static; }
.comments-resolved { justify-self: start; }
.comment { padding: 0; gap: 0; }
.comment .comment-full { display: none; gap: 8px; padding: 12px 14px; }
.comment.is-active .comment-full { display: grid; }
.comment.is-active .comment-chip { display: none; }
.comment.is-active { transform: none; z-index: 2; }
.comment-chip { display: flex; align-items: center; gap: 7px; padding: 6px 10px; min-width: 0; font-size: var(--fs-xs); color: var(--text-2); }
.comment-chip::before { content: attr(data-initial); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; flex: none; background: var(--bg-4); color: #fff; }
.comment[data-side="alice"] .comment-chip::before { background: var(--alice); }
.comment[data-side="openbrain"] .comment-chip::before { background: var(--lab); }
.comment[data-side="alice"] { border-left: 3px solid var(--alice); }
.comment[data-side="openbrain"] { border-left: 3px solid var(--lab); }
.cchip-who { font-weight: 600; color: var(--text); flex: none; }
.cchip-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cchip-count { flex: none; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 999px; background: var(--bg-3); }
.comment.is-resolved .comment-chip { opacity: 0.7; }
.comment[data-side="openbrain"] .meta::before { content: attr(data-initial); }
.comment-via { margin-top: -4px; }
.quote-part { font-style: normal; font-weight: 600; color: var(--text-2); }
.comment .suggest { gap: 6px; padding: 10px 12px; font-family: var(--font-body); font-size: var(--fs-sm); line-height: 1.5; border-left: 3px solid var(--line-strong); }
.comment .suggest[data-side="alice"] { background: var(--alice-dim); border-color: var(--alice-line); border-left-color: var(--alice); }
.comment .suggest[data-side="openbrain"] { background: var(--lab-dim); border-color: var(--lab-line); border-left-color: var(--lab); }
.comment .suggest .ins { color: var(--ok); font-weight: 500; }
.suggest-label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); }
.comment .suggest.is-section { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.comment .suggest.is-section .btn { margin-left: auto; }
.comment-form { position: absolute; z-index: 3; }

/* A drafted tracked change: only its author sees it, until proposed. */
.hl.hl-suggest.hl-draft { outline: 1.5px dashed var(--line-strong); outline-offset: 1px; opacity: 0.85; }
.hl.hl-suggest.hl-draft::after { opacity: 0.85; }

/* ---- Approval held: approved, but a change is waiting for a decision ---- */
.approve-tick.is-approved.is-held { background: var(--warn-dim); border-color: var(--warn-line); color: var(--warn); }
.approve-tick.is-stale { background: transparent; border-color: var(--line-strong); border-style: dashed; color: var(--text-3); }
.approve-tick.is-stale .od-icon { opacity: 0.35; }

/* ---- Notices: say which part, and what changes ---- */
.notice-text { overflow-wrap: anywhere; }
.notice-about { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.notice-part { flex: none; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--bg-3); color: var(--text-2); }
.notice-about .notice-summary { flex: 1 1 200px; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- Simulate: Terms to test, evidence tabs, the answer in line ---- */
.sim-evidence-card { gap: 18px; padding: 22px 24px; }
.sim-context { display: grid; gap: 6px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.sim-context .eyebrow { margin-bottom: 4px; }
.sim-ctx-row { display: grid; grid-template-columns: auto 92px minmax(0, 1fr); align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-1); cursor: pointer; font-size: var(--fs-sm); }
.sim-ctx-row:hover { border-color: var(--line-strong); }
.sim-ctx-row:has(input:checked) { background: var(--navy-dim); border-color: var(--navy); }
.sim-ctx-row[data-side="alice"] { border-left: 3px solid var(--alice); }
.sim-ctx-row[data-side="openbrain"] { border-left: 3px solid var(--lab); }
.sim-ctx-row.is-base { cursor: default; background: var(--bg-2); }
.sim-ctx-row input { width: 16px; height: 16px; margin: 0; }
.sim-ctx-part { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sim-ctx-label { min-width: 0; overflow-wrap: anywhere; color: var(--text); }
.sim-evidence-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sim-out .sim-answer-k { align-self: center; }
.sim-out dd.sim-answer { padding: 0; margin: 0; border: 0; font-size: 26px; line-height: 1.1; }
.sim-out dt.sim-answer-k { padding-top: 10px; border-top: 1px solid var(--line); margin-top: 4px; }
.sim-out dd.sim-answer { padding-top: 6px; border-top: 1px solid var(--line); margin-top: 4px; }

/* ---- Private files as a list ---- */
.pf-strip { display: grid; gap: 0; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-1); overflow: hidden; }
.pf-file { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; border: 0; border-radius: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.pf-file:last-child { border-bottom: 0; }
.pf-file:hover { background: var(--bg-2); border-color: var(--line); }
.pf-file.is-selected { background: var(--navy-dim); border-color: var(--line); box-shadow: inset 3px 0 0 var(--navy); }
.pf-file.is-sealed, .pf-file.is-simulated { border-style: solid; border-color: var(--line); }
.pf-main { display: grid; gap: 2px; min-width: 0; }
.pf-name { font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-note { font-size: var(--fs-xs); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-size { font-size: var(--fs-xs); color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ---- Colour means a side: Alice (left) purple, Bob (right) teal. The parts
   of the Terms are told apart by their icon, not a colour. ---- */
.doc-section.is-prompt, .doc-section.is-question, .doc-section.is-terms, .doc-section.is-judge { border-left-color: var(--line-strong); }
.doc-section h3 .od-icon,
.doc-section.is-prompt h3 .od-icon, .doc-section.is-question h3 .od-icon, .doc-section.is-terms h3 .od-icon, .doc-section.is-judge h3 .od-icon { color: var(--text-2); }
.part-badge { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--bg-1); border: 1px solid var(--line); color: var(--text-2); flex: none; }
.part-badge .od-icon { color: var(--text-2); }
.notice-part { display: inline-flex; align-items: center; gap: 4px; }
.notice-part .od-icon { color: var(--text-2); }
.sim-ctx-part { display: inline-flex; align-items: center; gap: 5px; }
.compare-part-head h3 { display: inline-flex; align-items: center; gap: 6px; }
.comment-chip .od-icon { color: var(--text-3); flex: none; }
.modal.compare { width: min(1480px, 100%); height: calc(100vh - 32px); max-height: none; }
.comment .suggest.is-section .btn-ghost { margin-left: auto; }
.comment .suggest.is-section .btn:not(.btn-ghost) { margin-left: 0; }
.compare-steps { display: flex; align-items: center; gap: 8px; flex: none; min-width: 0; }
.compare-steps .compare-timeline { flex: 1; min-width: 0; }
.compare-steps .btn-icon { font-size: 18px; line-height: 1; }
.compare-pos { flex: none; font-variant-numeric: tabular-nums; }
.doc-history { margin-left: auto; font-size: var(--fs-xs); }
.doc-history + .approve-bar { margin-left: 0; }

/* ---- Auto goal ---- */
.auto-btn { flex: none; border: 1px solid var(--line); border-radius: 999px; font-size: var(--fs-xs); }
.auto-btn.is-on { background: var(--ok-dim); border-color: var(--ok-line); color: var(--ok); }
.auto-btn.is-on .od-icon { animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.auto-status { display: flex; align-items: center; gap: 8px; min-width: 0; margin-bottom: 8px; padding: 6px 10px; border-radius: 10px; background: var(--ok-dim); border: 1px solid var(--ok-line); font-size: var(--fs-xs); color: var(--text-2); }
.auto-status .od-icon { color: var(--ok); flex: none; }
.auto-goal { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.auto-modal { width: min(620px, 100%); }
.auto-field { display: grid; gap: 8px; }
.request-chip.is-auto .od-icon { color: var(--ok); }
@media (prefers-reduced-motion: reduce) { .auto-btn.is-on .od-icon { animation: none; } }

/* ---- Approve all ---- */
.doc-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.approve-all { margin-left: auto; }
.approve-all[data-side="alice"] { border-color: var(--alice-line); color: var(--alice-strong); }
.approve-all[data-side="openbrain"] { border-color: var(--lab-line); color: var(--lab-strong); }
.doc-history { font-weight: 500; }

/* ---- Waiting on you ---- */
.waiting { position: relative; flex: none; }
.waiting.is-them { font-size: var(--fs-xs); color: var(--text-3); padding: 6px 12px; border: 1px dashed var(--line-strong); border-radius: 999px; white-space: nowrap; }
.waiting-pill { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: var(--fs-sm); font-weight: 600; padding: 6px 8px 6px 12px; border-radius: 999px; border: 1px solid var(--warn-line); background: var(--warn-dim); color: var(--warn); cursor: pointer; white-space: nowrap; position: relative; isolation: isolate; }
/* A tint and a ring growing out of the pill, as opacity and transform only (composited). */
.waiting-pill::before, .waiting-pill::after { content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit; opacity: 0; pointer-events: none; animation: waiting-flash 1.6s ease-in-out infinite; }
.waiting-pill::before { background: color-mix(in srgb, var(--warn) 22%, var(--bg-1)); }
.waiting-pill::after { box-shadow: 0 0 0 2px color-mix(in srgb, var(--warn) 45%, transparent); animation-name: waiting-ring; }
.waiting-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.waiting-count { min-width: 20px; height: 20px; display: grid; place-items: center; border-radius: 999px; background: var(--warn); color: #fff; font-size: 11px; }
@keyframes waiting-flash { 50% { opacity: 1; } }
@keyframes waiting-ring { 0% { opacity: 1; transform: none; } 50%, 100% { opacity: 0; transform: scale(1.08, 1.35); } }
@media (prefers-reduced-motion: reduce) { .waiting-pill::before, .waiting-pill::after { animation: none; } }
.waiting-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 240px; display: grid; padding: 6px; border-radius: 14px; background: var(--bg-1); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.waiting-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: var(--fs-sm); color: var(--text); cursor: pointer; text-align: left; }
.waiting-item:hover { background: var(--bg-3); }
@media (max-width: 760px) { .waiting-pill { font-size: 0; gap: 4px; } .waiting-pill .waiting-count { font-size: 11px; } }

/* Into the box: the tabs sit on the left, under the label. */
.in-head { flex-direction: column; align-items: flex-start; gap: 10px; }
.in-tabs { margin-left: 0; max-width: 100%; overflow-x: auto; }

/* Arbitrate steps tick green when done. */
.step-num.is-done { background: var(--ok); color: #fff; display: inline-grid; place-items: center; }
.step-num.is-done .od-icon { color: #fff; }
.add-evidence.is-done { background: var(--ok-dim); border-color: var(--ok-line); }
.add-evidence.is-done .step-badge { background: var(--ok); }

/* The gavel's frames have a pure white background; multiply makes it vanish. */
.gavel-anim { -webkit-mask-image: none; mask-image: none; }

/* The judge's reasoning, in the debug trace only. */
.trace-reasoning { display: grid; gap: 6px; margin-top: 10px; padding: 12px 16px; border-radius: 12px; border: 1px dashed var(--line-strong); background: var(--bg-2); }
.trace-reasoning .trace-q-label { display: inline-flex; align-items: center; gap: 4px; }
.trace-reasoning .md { font-size: var(--fs-sm); line-height: 1.6; color: var(--text-2); }

/* The question while judging: larger and easy to read. */
.judging-q { max-width: 62ch; gap: 8px; }
.judging-q p { font-size: var(--fs-md); line-height: 1.6; color: var(--text); max-height: 12em; text-align: left; padding: 12px 16px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }

/* ---- Appeal ---- */
.appeal-btn { justify-self: start; }
.appeal-btn[data-side="alice"] { border-color: var(--alice-line); color: var(--alice-strong); }
.appeal-btn[data-side="openbrain"] { border-color: var(--lab-line); color: var(--lab-strong); }
.judging-actions { justify-content: center; gap: 10px; }
.appeal-overlay { z-index: 70; }
.appeal-modal { width: min(560px, 100%); }
.appeal-grounds { display: grid; gap: 6px; }
.appeal-ground { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: var(--fs-sm); }
.appeal-ground:has(input:checked) { border-color: var(--navy); background: var(--navy-dim); }
.sim-gen-live { margin: 0; max-height: 9.5em; overflow: hidden; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font-family: var(--font-mono); font-size: var(--fs-xs); line-height: 1.5; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.sim-history { margin-top: 28px; gap: 12px; }
.sim-history > .eyebrow { padding-left: 2px; }
/* Auto sits with the attach button: same height, no border until it is on. */
.composer .auto-btn { height: 36px; padding: 0 10px; gap: 5px; border-color: transparent; color: var(--text-2); font-weight: 600; }
.composer .auto-btn:hover { background: var(--bg-3); color: var(--text); }
.composer .auto-btn.is-on { border-color: var(--ok-line); color: var(--ok); }
.composer .attach { margin-right: -4px; }

/* A tracked edit that only adds words: the old words read normally. */
.hl.hl-suggest.hl-insert { background: none; color: inherit; text-decoration: none; }
.comment .suggest.is-edit { display: grid; gap: 6px; }
.suggest-diff { font-size: var(--fs-sm); line-height: 1.55; color: var(--text); }
.suggest-diff p { margin: 0; }
.suggest-actions { display: flex; justify-content: flex-end; gap: 6px; }
.comment .comment-waiting { flex-basis: 100%; margin-right: 0; }
/* Above the judging overlay, which it opens from. */
.appeal-overlay { z-index: 90; }

/* Add the evidence: one section per side. */
.evidence-side { display: grid; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-1); }
.evidence-side[data-side="alice"] { border-left: 3px solid var(--alice); }
.evidence-side[data-side="openbrain"] { border-left: 3px solid var(--lab); }
.evidence-side-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.evidence-side-head .avatar { width: 26px; height: 26px; font-size: 12px; }
.evidence-side.is-submitted { background: var(--ok-dim); }
.add-evidence { display: grid; gap: 12px; }

/* Top bar view switch: never wraps; the short labels take over sooner. */
.topbar .seg button { white-space: nowrap; }
@media (max-width: 1100px) {
  .topbar .seg .seg-label { display: none; }
  .topbar .seg .seg-short { display: inline; }
  .topbar .seg button { min-width: 36px; }
}

/* ---- Appeal ---- */
.tab-appeal { display: inline-flex; align-items: center; gap: 6px; flex: none; align-self: center; margin-left: 8px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--warn-line); background: var(--warn-dim); color: var(--warn); font: inherit; font-size: var(--fs-xs); font-weight: 700; cursor: pointer; white-space: nowrap; }
.appeal-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--warn-line); background: var(--warn-dim); font-size: var(--fs-sm); color: var(--text); }
.appeal-bar .od-icon { color: var(--warn); flex: none; }
.appeal-bar span { flex: 1 1 280px; }
.doc-section.is-frozen { opacity: 0.72; }
.doc-section.is-frozen h3::after { content: "Frozen"; margin-left: 8px; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--bg-3); color: var(--text-3); }
.appeal-card { display: grid; gap: 14px; border-color: var(--warn-line); }
.appeal-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.appeal-card-head h3 { margin: 0; font-size: var(--fs-md); }
.appeal-card-head > .od-icon { color: var(--warn); }
.appeal-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.appeal-col { display: grid; gap: 8px; align-content: start; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-1); min-width: 0; }
.appeal-col.is-frozen { background: var(--bg-2); }
.appeal-col .eyebrow { display: inline-flex; align-items: center; gap: 4px; }
.appeal-col .doc-body { font-size: var(--fs-sm); }
.appeal-verdict { font-family: "Fraunces", Georgia, serif; font-size: 28px; font-weight: 700; line-height: 1; }
.appeal-verdict[data-verdict="true"] { color: var(--ok); }
.appeal-verdict[data-verdict="false"] { color: #b3263e; }
.appeal-files { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: var(--fs-sm); }
.appeal-files li { display: flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.appeal-files.is-added li { color: var(--ok); }
.appeal-reasoning summary { cursor: pointer; color: var(--text-3); }
.appeal-result { display: inline-block; justify-self: start; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; padding: 3px 10px; border-radius: 999px; }
.appeal-result[data-result="sustained"] { background: var(--navy-dim); color: var(--navy); }
.appeal-result[data-result="overturned"] { background: var(--warn-dim); color: var(--warn); }
.appeal-result.is-big { font-size: 15px; padding: 6px 16px; margin-top: -6px; justify-self: center; }
.dm-appeal { display: grid; gap: 8px; margin: 6px auto; width: min(560px, 100%); padding: 12px 16px; border-radius: 14px; border: 1px solid var(--warn-line); background: var(--warn-dim); }
.dm-appeal .dm-verdict-head .od-icon { color: var(--warn); }
.dm-appeal p { margin: 0; color: var(--text-2); }
.dm-appeal-actions { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 900px) { .appeal-cols { grid-template-columns: minmax(0, 1fr); } }

/* About */
.brand { align-items: center; }
.about-btn { margin-left: 6px; font-size: var(--fs-xs); color: var(--text-3); }
.about-modal { width: min(520px, 100%); }
.about-modal a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 640px) { .about-btn { display: none; } }

/* Private simulation decisions and references to saved evidence. */
.sim-decision { display: grid; gap: 10px; min-width: 0; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.sim-decision .od-row { gap: 10px; flex-wrap: wrap; }
.sim-private { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; color: var(--text-3); }
.sim-explanation { font-size: var(--fs-sm); line-height: 1.6; overflow-wrap: anywhere; }
.sim-explanation p { margin: 0; }
.sim-citations { display: grid; gap: 8px; min-width: 0; }
.sim-citation { min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-1); overflow: hidden; }
.sim-citation > summary { display: flex; align-items: center; gap: 8px; padding: 10px 12px; color: var(--navy); font-size: var(--fs-sm); cursor: pointer; overflow-wrap: anywhere; }
.sim-citation-excerpt { padding: 8px 0; border-top: 1px solid var(--line); background: var(--bg-2); max-height: 320px; overflow: auto; }
.sim-source-line { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 10px; padding: 5px 12px; font-size: var(--fs-xs); line-height: 1.6; }
.sim-source-line.is-cited { background: var(--navy-dim); box-shadow: inset 3px 0 var(--navy); }
.sim-line-number { font-family: var(--font-mono); color: var(--text-3); text-align: right; user-select: none; }
.sim-source-line code { white-space: pre-wrap; overflow-wrap: anywhere; }
.sim-citation > .btn { margin: 6px 10px; }
.sim-citation-source { padding: 10px 12px; border-top: 1px solid var(--line); min-width: 0; overflow: auto; }
.sim-reference-warning { margin: 0; color: var(--text-3); }
.sim-inspection > summary, .sim-instructions > summary { font-size: var(--fs-xs); color: var(--text-3); cursor: pointer; padding: 4px 0; }
.sim-inspection .trace-list { margin-top: 10px; }
.sim-inspection .args { overflow-wrap: anywhere; }
.sim-instructions pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow: auto; font-size: var(--fs-xs); padding: 12px; background: var(--bg-2); border-radius: 10px; }
/* Auto goal dialog: the intro spans the full width like the goal box below,
   and the interval switch is only as wide as its options. */
.auto-modal .modal-head p, .appeal-modal .modal-head p, .about-modal .modal-head p { max-width: none; }
.auto-modal .modal-head h2 { line-height: 1.25; }
.auto-field .seg { justify-self: start; }
.auto-interval { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.auto-custom { display: inline-flex; align-items: center; gap: 6px; }
.auto-custom .input { width: 84px; }

/* ---- Watch: both sides on screen, nothing acts ---- */
.watch-banner { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px 16px; font-size: var(--fs-xs); font-weight: 600; color: var(--navy); background: var(--navy-dim); border-bottom: 1px solid var(--line); }
.seg .seg-watch { display: inline-flex; align-items: center; gap: 6px; }
/* Anything that acts is inert; reading, scrolling and moving around still work. */
.app.is-watching .workspace :is(button, input, textarea, select, label.btn, [contenteditable="true"], .seal-row, .sim-ctx-row, .approve-tick):not(
  .tab, .tab-appeal, .panel-switch button, .doc-history, .is-read, .comment, .comment *, .sg-btn.is-quiet, summary, .in-tab, .seg button, .compare-step, .pf-file, .sim-file-name, .about-btn
) { pointer-events: none; }
.app.is-watching .workspace .comment :is(.actions, .reply-form) { pointer-events: none; }
.app.is-watching :is(.compare-foot, .dm-appeal-actions) { pointer-events: none; }
/* Watching (not the tutorial), what cannot be used is greyed out. */
/* Anything that acts is inert; reading, scrolling and moving around still work. */
.app.is-watching:not(.is-tutorial) .workspace :is(button, input, textarea, select, label.btn, [contenteditable="true"], .seal-row, .sim-ctx-row, .approve-tick):not(
  .tab, .tab-appeal, .panel-switch button, .doc-history, .is-read, .comment, .comment *, .sg-btn.is-quiet, summary, .in-tab, .seg button, .compare-step, .pf-file, .sim-file-name, .about-btn
) { opacity: 0.55; }
.app.is-watching:not(.is-tutorial) .workspace .comment :is(.actions, .reply-form) { opacity: 0.55; }
.app.is-watching:not(.is-tutorial) :is(.compare-foot, .dm-appeal-actions) { opacity: 0.55; }
.app.is-watching .workspace .composer { pointer-events: none; }
.app.is-watching:not(.is-tutorial) .workspace .composer { opacity: 0.55; }

/* Simulation explanations: [T1] / [E1] markers as chips that go there. */
.sim-ref { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; margin: 0 2px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--bg-1); font: inherit; font-size: var(--fs-xs); line-height: 1.6; vertical-align: baseline; cursor: pointer; color: var(--text); }
.sim-ref:hover { border-color: var(--navy); color: var(--navy); }
.sim-ref q { color: var(--text-2); font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 28ch; }
.sim-ref.is-term span { font-weight: 600; }
.sim-ref.is-evidence { font-family: var(--font-mono); }
.sim-ref .od-icon { color: var(--text-3); flex: none; }
.sim-citation.is-flash, .doc-section.is-flash { animation: ref-flash 1.6s ease-out; }
@keyframes ref-flash { 0%, 30% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--navy) 45%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* Generating data: simulated or real. */
.sim-generate-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.generate-real { justify-self: start; }
.generate-real-form { display: grid; gap: 8px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-1); }

/* A question is plain prose, even if it was stored as a quote. */
.doc-section.is-question blockquote { margin: 0; padding: 0; border: 0; font-size: inherit; color: inherit; }

/* On appeal: the original question above the amended one. */
.appeal-original { display: grid; gap: 6px; margin: 4px 0 12px; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); border: 1px dashed var(--line-strong); }
.appeal-original .eyebrow { display: inline-flex; align-items: center; gap: 4px; }
.appeal-original .doc-body { font-size: var(--fs-md); color: var(--text-2); }
.appeal-amend-label { display: inline-flex; align-items: center; gap: 4px; color: var(--warn); margin-bottom: 4px; }
.appeal-amend-note { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--text-3); }

/* ---- Tutorial ---- */
.tutorial-offer { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; border-radius: 16px; border: 1px solid var(--navy); background: var(--navy-dim); color: var(--navy); font: inherit; text-align: left; cursor: pointer; }
.tutorial-offer > span { display: grid; gap: 2px; }
.tutorial-offer:hover { box-shadow: var(--shadow-sm); }
.tutorial-bubble { position: fixed; z-index: 120; width: min(360px, calc(100vw - 24px)); display: grid; gap: 8px; padding: 14px 16px; border-radius: 16px; background: var(--bg-1); border: 1px solid var(--navy); box-shadow: var(--shadow-lg); transition: left 0.25s var(--ease-out), top 0.25s var(--ease-out); }
.tutorial-bubble h3 { margin: 0; font-size: var(--fs-md); }
.tutorial-bubble p { margin: 0; font-size: var(--fs-sm); line-height: 1.55; color: var(--text-2); }
.tutorial-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tutorial-count { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--navy); }
.tutorial-foot { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.tutorial-target { outline: 3px solid var(--navy) !important; outline-offset: 4px; border-radius: 12px; transition: outline-color 0.2s; }
/* The tutorial is read-only like Watch, without greying everything out. */
.app.is-tutorial .judging { z-index: 90; }

/* Tutorial bubble: roomier, larger type, short paragraphs and lists. */
.tutorial-bubble { width: min(460px, calc(100vw - 24px)); padding: 18px 22px; gap: 10px; }
.tutorial-bubble h3 { font-size: var(--fs-lg); }
.tutorial-body { display: grid; gap: 8px; font-size: var(--fs-md); line-height: 1.55; color: var(--text-2); }
.tutorial-body p { margin: 0; }
.tutorial-body ul, .tutorial-body ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.tutorial-body strong { color: var(--text); font-weight: 700; }
.tutorial-bubble .tutorial-body p { font-size: inherit; line-height: inherit; color: inherit; }


/* Tutorial spotlight: everything but the highlighted part dims a little. */
.tutorial-spot { position: fixed; z-index: 115; border-radius: 14px; pointer-events: none; box-shadow: 0 0 0 200vmax rgba(15, 22, 34, 0.22); transition: left 0.25s var(--ease-out), top 0.25s var(--ease-out), width 0.25s var(--ease-out), height 0.25s var(--ease-out); }
.tutorial-quit { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--warn-dim); border: 1px solid var(--warn-line); font-size: var(--fs-sm); }
.tutorial-quit span { flex: 1 1 180px; font-weight: 600; color: var(--text); }

/* About: its own colour, with a small shine passing over it. */
.about-btn { position: relative; overflow: hidden; margin-left: 10px; padding: 5px 14px; border-radius: 999px; border: 1px solid #e0b64a; background: linear-gradient(135deg, #fff4d4, #fbd77a); color: #7a5300; font-weight: 700; font-size: var(--fs-xs); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 2px 6px rgba(167, 120, 0, 0.18); }
.about-btn:hover { background: linear-gradient(135deg, #ffefc2, #f6c95a); color: #5e3f00; }
.about-btn::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.85), transparent); transform: skewX(-20deg); animation: about-shine 4.5s ease-in-out infinite; pointer-events: none; }
/* From left: -60% to 130% of the button, in the shine's own widths (40%), so it is composited. */
@keyframes about-shine { 0%, 70% { transform: translateX(0) skewX(-20deg); } 100% { transform: translateX(475%) skewX(-20deg); } }
@media (prefers-reduced-motion: reduce) { .about-btn::after { animation: none; display: none; } }

/* ---- Landing page ---- */
.landing { position: fixed; inset: 0; z-index: 140; overflow-y: auto; overflow-x: hidden; background:
  radial-gradient(900px 520px at 85% -10%, color-mix(in srgb, var(--navy) 14%, transparent), transparent 70%),
  radial-gradient(700px 480px at -10% 30%, color-mix(in srgb, var(--alice) 10%, transparent), transparent 70%),
  var(--bg-2); }
.landing-inner { width: min(1120px, 100%); margin: 0 auto; padding: 32px 24px 40px; display: grid; gap: 88px; }
.landing-kicker { font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--navy); }

.landing-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); align-items: center; gap: 32px; min-height: min(82vh, 720px); }
.landing-hero-text { display: grid; gap: 18px; justify-items: start; }
.landing-modes { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; background: var(--bg-1); border: 1px solid var(--line); color: var(--text-2); font-size: var(--fs-xs); font-weight: 600; box-shadow: var(--shadow-sm); }
.landing-modes .od-icon { color: var(--navy); }
.landing-brand { font-size: 30px; }
.landing-hero h1 { margin: 0; font-family: var(--font-display); font-size: clamp(32px, 4.6vw, 54px); line-height: 1.08; letter-spacing: -0.01em; color: var(--text); }
.landing-paradox { display: block; margin-bottom: 10px; font-family: var(--font-body); font-size: 13px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: #b3263e; }
.landing-hero h1 em { font-style: italic; color: #b3263e; text-decoration: underline; text-decoration-thickness: 4px; text-underline-offset: 6px; text-decoration-color: color-mix(in srgb, #b3263e 35%, transparent); }
.landing-lead { margin: 0; font-size: 19px; line-height: 1.6; color: var(--text-2); max-width: 54ch; }
.landing-lead b { color: var(--text); }
.landing-hero-art { display: grid; place-items: center; position: relative; }
.landing-hero-art::before { content: ""; position: absolute; width: 340px; height: 340px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--navy) 22%, transparent), transparent 68%); }
.landing-judgy { position: relative; width: min(300px, 100%); height: auto; filter: drop-shadow(0 24px 36px rgba(22, 36, 58, 0.22)); animation: landing-float 5s ease-in-out infinite; }
@keyframes landing-float { 50% { transform: translateY(-10px) rotate(-1.5deg); } }

/* Start and tutorial: two large, clear choices. */
.landing-ctas { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.landing-cta { display: inline-flex; align-items: center; gap: 14px; padding: 14px 20px; border-radius: 18px; font: inherit; text-align: left; cursor: pointer; transition: transform 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out); }
.landing-cta:hover { transform: translateY(-2px); }
/* Tapped on index.html's copy of the landing page, before the app has started. */
.landing-cta.is-waiting { cursor: progress; opacity: 0.7; transform: none; }
.landing-cta-text { display: grid; gap: 2px; }
.landing-cta-text b { font-size: 17px; }
.landing-cta-text span { font-size: var(--fs-xs); opacity: 0.85; }
.landing-cta-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; flex: none; }
.landing-cta.is-start { border: 0; color: #fff; background: linear-gradient(135deg, #2f6fe4, #5a3fd0); box-shadow: 0 10px 24px rgba(47, 111, 228, 0.32); }
.landing-cta.is-start:hover { box-shadow: 0 14px 30px rgba(47, 111, 228, 0.4); }
.landing-cta.is-start .landing-cta-icon { background: rgba(255, 255, 255, 0.18); }
.landing-cta.is-tutorial { border: 1px solid var(--line-strong); background: var(--bg-1); color: var(--text); box-shadow: var(--shadow-sm); }
.landing-cta.is-tutorial .landing-cta-icon { background: var(--navy-dim); color: var(--navy); }
.landing-cta.is-tutorial .landing-cta-text span { color: var(--text-3); opacity: 1; }

/* The answer: a dark band with the flow drawn out. */
.landing-answer { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: center; padding: 40px; border-radius: 28px; background: linear-gradient(140deg, #16243a, #24315a 60%, #3a2c6e); color: #eef2fb; box-shadow: var(--shadow-lg); }
.landing-answer .landing-kicker { color: #9fc0ff; }
.landing-answer h2 { margin: 8px 0 10px; font-family: var(--font-display); font-size: clamp(26px, 3vw, 36px); line-height: 1.15; color: #fff; }
.landing-answer p { margin: 0; font-size: var(--fs-md); line-height: 1.6; color: #c9d3ea; }

/* How it works, played on a loop: question, agreed, sealed, judged, answered, shut down. */
.how { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 28px; align-items: center; }
.how-stage { display: grid; gap: 14px; align-content: center; min-height: 340px; padding: 20px; border-radius: 20px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); }
.how-question { display: grid; justify-items: center; gap: 6px; padding: 12px 14px; border-radius: 14px; background: #fff; color: #16243a; text-align: center; opacity: 0; transform: translateY(-8px) scale(0.97); transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out); }
.is-asked .how-question { opacity: 1; transform: none; }
.how-q-label { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--navy); }
.how-question b { font-size: var(--fs-md); line-height: 1.35; }
.how-agree { display: flex; justify-content: center; gap: 8px; min-height: 22px; }
.how-tick { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; color: #fff; opacity: 0; transform: scale(0.6); transition: opacity 0.3s, transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1); }
.how-tick[data-side="alice"] { background: var(--alice); }
.how-tick[data-side="openbrain"] { background: var(--lab); transition-delay: 0.25s; }
.is-agreed .how-tick { opacity: 1; transform: none; }
.how-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1fr); gap: 10px; align-items: center; }
.how-party { display: grid; justify-items: center; gap: 6px; font-size: var(--fs-xs); color: #c9d3ea; }
.how-party b { color: #fff; font-size: var(--fs-sm); }
.how-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-weight: 800; color: #fff; }
.how-party[data-side="alice"] .how-avatar { background: var(--alice); }
.how-party[data-side="openbrain"] .how-avatar { background: var(--lab); }
.how-file { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.12); color: #eef2fb; font-size: 11px; transition: transform 0.7s var(--ease-out), opacity 0.7s var(--ease-out); }
.is-sealed .how-party[data-side="alice"] .how-file { transform: translateX(80%) scale(0.6); opacity: 0; }
.is-sealed .how-party[data-side="openbrain"] .how-file { transform: translateX(-80%) scale(0.6); opacity: 0; }
.how-box { position: relative; overflow: hidden; display: grid; justify-items: center; gap: 8px; padding: 16px 10px; border-radius: 16px; text-align: center; font-size: 11px; color: #c9d3ea; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(159, 192, 255, 0.5); box-shadow: 0 0 0 6px rgba(159, 192, 255, 0.08), 0 0 32px rgba(159, 192, 255, 0.2); transition: opacity 0.6s, filter 0.6s, box-shadow 0.6s; }
.how-box-head { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-xs); font-weight: 700; color: #fff; }
.how-box-head .od-icon { color: #9fc0ff; }
.how-box-files { display: flex; gap: 6px; min-height: 24px; }
.how-sealed { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; color: #fff; opacity: 0; transform: scale(0.4); transition: opacity 0.4s 0.5s, transform 0.4s 0.5s; }
.how-sealed[data-side="alice"] { background: var(--alice); }
.how-sealed[data-side="openbrain"] { background: var(--lab); }
.is-sealed .how-sealed { opacity: 1; transform: none; }
.how-llm { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.is-judging .how-llm { color: #fff; }
.is-judging .how-llm .od-icon { animation: how-think 0.9s ease-in-out infinite; }
.is-judging .how-box::after { content: ""; position: absolute; left: 0; right: 0; top: -40%; height: 40%; background: linear-gradient(transparent, rgba(159, 192, 255, 0.35), transparent); animation: how-scan 1.2s linear infinite; }
@keyframes how-scan { to { top: 100%; } }
@keyframes how-think { 50% { transform: scale(1.25); color: #9fc0ff; } }
.how-off { display: none; align-items: center; gap: 4px; font-weight: 700; color: #ff9aac; }
.is-off .how-box { opacity: 0.6; filter: grayscale(1); box-shadow: none; }
.is-off .how-sealed { opacity: 0; transform: scale(0.2) rotate(20deg); transition-delay: 0s; }
.is-off .how-llm { display: none; }
.is-off .how-off { display: inline-flex; }
.how-verdict { display: grid; justify-items: center; min-height: 48px; }
.how-verdict span { font-family: "Fraunces", Georgia, serif; font-weight: 700; font-size: 36px; line-height: 1.2; color: #7ee2a4; opacity: 0; transform: translateY(-14px) scale(0.8); transition: opacity 0.4s, transform 0.5s cubic-bezier(0.3, 1.5, 0.5, 1); }
.is-answered .how-verdict span { opacity: 1; transform: none; }
.how-side { display: grid; gap: 10px; justify-items: start; }
.how-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; width: 100%; }
.how-steps button { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 10px; border-radius: 12px; cursor: pointer; color: #9aa7c4; transition: background 0.3s; }
.how-steps button:focus-visible { outline: 2px solid #9fc0ff; outline-offset: 2px; }
.how-num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 12px; font-weight: 800; color: #c9d3ea; background: rgba(255, 255, 255, 0.1); transition: background 0.3s, color 0.3s; }
.how-text { display: grid; gap: 2px; }
.how-text b { color: #c9d3ea; font-size: var(--fs-sm); }
.how-text span { font-size: var(--fs-xs); line-height: 1.45; }
.how-steps li.is-active button { background: rgba(255, 255, 255, 0.1); }
.how-steps li.is-active b { color: #fff; }
.how-steps li.is-active .how-num { background: #9fc0ff; color: #16243a; }
.how-steps li.is-done .how-num { background: rgba(126, 226, 164, 0.22); color: #7ee2a4; }
.how-play { all: unset; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; color: #c9d3ea; border: 1px solid rgba(255, 255, 255, 0.18); cursor: pointer; }
.how-play:focus-visible { outline: 2px solid #9fc0ff; }
@media (max-width: 760px) {
  .how { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .how-stage { min-height: 300px; padding: 14px; }
  .how-row { gap: 6px; }
  .how-question b { font-size: var(--fs-sm); }
  /* Only the current step says more, so the list stays short. */
  .how-steps li:not(.is-active) .how-text span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .how-stage *, .how-stage *::after { animation: none !important; transition: none !important; }
}

/* The story: chapters alternate text and a framed screenshot. */
.landing-story { display: grid; gap: 72px; }
.landing-story > .landing-kicker { justify-self: center; font-size: 13px; }
.landing-chapter { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 48px; align-items: center; }
.landing-chapter.is-flipped .chapter-text { order: 2; }
.chapter-text { display: grid; gap: 12px; align-content: center; }
.chapter-num { font-family: var(--font-display); font-size: 44px; line-height: 1; font-weight: 700; color: color-mix(in srgb, var(--navy) 30%, transparent); }
.chapter-text h3 { margin: 0; font-family: var(--font-display); font-size: clamp(24px, 2.6vw, 32px); line-height: 1.15; color: var(--text); }
.chapter-text p { margin: 0; font-size: 17px; line-height: 1.65; color: var(--text-2); }
.chapter-guarantees { margin: 6px 0 0; padding: 0; list-style: none; display: flex; gap: 8px; flex-wrap: wrap; }
.chapter-guarantees li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--ok-dim); border: 1px solid var(--ok-line); color: var(--ok); font-size: var(--fs-xs); font-weight: 700; }
.chapter-shot { margin: 0; border-radius: 18px; overflow: hidden; background: var(--bg-1); border: 1px solid var(--line); box-shadow: 0 30px 60px -20px rgba(22, 36, 58, 0.35), 0 12px 24px -12px rgba(22, 36, 58, 0.2); transform: perspective(1400px) rotateY(-3deg); transition: transform 0.4s var(--ease-out); }
.landing-chapter.is-flipped .chapter-shot { transform: perspective(1400px) rotateY(3deg); }
.chapter-shot:hover, .landing-chapter.is-flipped .chapter-shot:hover { transform: none; }
.shot-bar { display: flex; gap: 6px; padding: 10px 14px; background: var(--bg-3); border-bottom: 1px solid var(--line); }
.shot-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.shot-bar i:first-child { background: #f2a0a0; }
.shot-bar i:nth-child(2) { background: #f2d38f; }
.shot-bar i:nth-child(3) { background: #9fd8a8; }
.chapter-shot img { display: block; width: 100%; height: auto; max-height: 560px; object-fit: cover; object-position: top; }

.landing-demo { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-radius: 18px; border: 1px dashed var(--warn-line); background: color-mix(in srgb, var(--warn-dim) 60%, var(--bg-1)); }
.landing-demo .od-icon { color: var(--warn); flex: none; }
.landing-demo p { margin: 0; font-size: var(--fs-md); line-height: 1.55; color: var(--text-2); }
.landing-demo b { color: var(--text); }

.landing-scenarios, .landing-faq { display: grid; gap: 18px; }
.landing-scenario-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.landing-scenario { display: grid; gap: 8px; padding: 22px 24px; border-radius: 20px; background: var(--bg-1); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.landing-scenario b { font-size: var(--fs-lg); }
.landing-scenario p { margin: 0; font-size: var(--fs-sm); line-height: 1.6; color: var(--text-2); }

/* FAQ: every answer shown, in two columns. */
.faq-grid { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 32px; }
.faq-item { padding: 18px 0; border-top: 1px solid var(--line); }
.faq-item dt { font-weight: 700; font-size: var(--fs-md); color: var(--text); margin-bottom: 6px; }
.faq-item dd { margin: 0; font-size: var(--fs-sm); line-height: 1.65; color: var(--text-2); }

/* The final judgement. */
.landing-final { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 48px 24px; border-radius: 28px; background: var(--bg-1); border: 1px solid var(--line); box-shadow: var(--shadow-md); }
.landing-gavel { width: 170px; height: auto; mix-blend-mode: multiply; }
.landing-final-verdict { font-family: "Fraunces", Georgia, serif; font-size: clamp(56px, 9vw, 96px); font-weight: 700; line-height: 1; color: var(--ok); letter-spacing: 0.02em; }
.landing-final p { margin: 0 0 10px; font-size: var(--fs-md); color: var(--text-2); }
.landing-final .landing-ctas { justify-content: center; }

.landing-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 8px; font-size: var(--fs-sm); color: var(--text-3); }
.landing-footer a { color: var(--navy); }
.landing-links { display: inline-flex; gap: 14px; }
.landing-links a { font-weight: 600; }

@media (prefers-reduced-motion: reduce) { .landing-judgy { animation: none; } .chapter-shot { transform: none !important; } }
@media (max-width: 900px) {
  .landing-inner { gap: 64px; }
  .landing-hero { grid-template-columns: minmax(0, 1fr); min-height: 0; text-align: left; }
  .landing-hero-art { order: -1; }
  .landing-judgy { width: 180px; }
  .landing-hero-art::before { width: 220px; height: 220px; }
  .landing-answer { grid-template-columns: minmax(0, 1fr); padding: 26px; }
  .landing-chapter, .landing-chapter.is-flipped { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .landing-chapter.is-flipped .chapter-text { order: 0; }
  .chapter-shot, .landing-chapter.is-flipped .chapter-shot { transform: none; }
  .landing-scenario-grid, .faq-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .landing-cta { width: 100%; }
}

/* The tutorial offer in the setup dialog. */
.tutorial-offer { display: flex; align-items: center; gap: 16px; width: 100%; padding: 16px 18px; border-radius: 20px; border: 0; background: linear-gradient(135deg, #2f6fe4, #5a3fd0); color: #fff; font: inherit; text-align: left; cursor: pointer; box-shadow: 0 10px 24px rgba(47, 111, 228, 0.28); transition: transform 0.15s var(--ease-out); }
.tutorial-offer:hover { transform: translateY(-1px); }
.tutorial-offer > .od-icon { display: none; }
.tutorial-offer > span { display: grid; gap: 3px; flex: 1; }
.tutorial-offer b { font-size: var(--fs-md); color: #fff; }
.tutorial-offer .xs { color: rgba(255, 255, 255, 0.85) !important; }
.tutorial-offer-art { width: 56px; height: auto; flex: none; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.2)); }
.tutorial-offer-go { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); flex: none; }
/* Auto can always be stopped, even while watching. */
.app.is-watching .workspace .composer .auto-status { pointer-events: auto; opacity: 1; }

/* ---- Case tab ---- */
.case-main { display: grid; gap: 12px; }
.case-main-head, .case-side-head { display: flex; align-items: center; gap: 10px; }
.case-main-head > .od-icon { color: var(--warn); }
.case-main .case-brief { font-size: var(--fs-md); line-height: 1.6; }
.case-sides { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; margin-top: 16px; }
.case-side { display: grid; gap: 10px; }
.case-side[data-side="alice"] { border-left: 3px solid var(--alice); }
.case-side[data-side="openbrain"] { border-left: 3px solid var(--lab); }
.case-side-head .avatar { width: 30px; height: 30px; font-size: 13px; }
.case-side .xs { display: inline-flex; align-items: center; gap: 2px; }
.case-next { display: flex; justify-content: flex-end; margin-top: 16px; }
.case-summary { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font: inherit; cursor: pointer; }
.case-summary:hover { border-color: var(--line-strong); }
.case-summary > .od-icon { color: var(--warn); flex: none; }
.case-summary .eyebrow { flex: none; }
.case-summary-text { flex: 1; min-width: 0; font-size: var(--fs-sm); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-btn { margin-left: 10px; padding: 5px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-1); color: var(--text-2); font-size: var(--fs-xs); font-weight: 700; text-decoration: none; }
.home-btn:hover { color: var(--text); border-color: var(--line-strong); }
.home-btn + .about-btn { margin-left: 6px; }
@media (max-width: 640px) { .home-btn { display: none; } }

/* Thinking text stays still: the words only fade, and the line keeps its
   height while one word is swapped for the next. */
@keyframes think-word { from { opacity: 0; } to { opacity: 1; } }
.thinking { line-height: 1.3; min-height: 1.3em; vertical-align: middle; }
.thinking-star { width: 1em; line-height: 1; text-align: center; transform-origin: 50% 50%; flex: none; }
.thinking-word { display: inline-block; white-space: nowrap; }
.sim-out dd.sim-answer { align-items: center; min-height: 34px; }
/* The play modes sit right under the Start button. */
.landing-hero .landing-modes { margin-top: -4px; }

/* ---- Landing page on small screens ---- */
/* One column the width of the screen; nothing inside may push it wider. */
.landing-inner { grid-template-columns: minmax(0, 1fr); }
.landing-inner > *, .landing-hero > *, .landing-chapter > *, .landing-answer > * { min-width: 0; }
.landing-hero h1, .landing-lead, .chapter-text p, .landing-answer p { overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .landing-inner { padding: 20px 16px 32px; gap: 56px; }
  .landing-hero { gap: 16px; }
  .landing-hero-text { justify-items: stretch; }
  .landing-ctas { flex-direction: column; align-items: stretch; }
  .landing-cta { width: 100%; justify-content: space-between; }
  .landing-modes { justify-self: start; white-space: normal; }
  .landing-answer { gap: 24px; }
  .chapter-shot img { max-height: 420px; }
  .landing-story { gap: 56px; }
  .landing-final { padding: 32px 16px; }
  .landing-footer { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  .landing-hero h1 { font-size: clamp(28px, 8vw, 36px); }
  .landing-lead { font-size: var(--fs-md); }
  .landing-brand { font-size: 26px; }
  .landing-judgy { width: 150px; }
  .landing-hero-art::before { width: 180px; height: 180px; }
  .landing-answer { padding: 22px 18px; border-radius: 22px; }
  .landing-chapter { gap: 16px; }
  .chapter-num { font-size: 34px; }
  .chapter-text p { font-size: var(--fs-md); }
  .landing-demo { align-items: flex-start; }
  .landing-final-verdict { font-size: 64px; }
  .landing-gavel { width: 130px; }
}

/* Start and the tutorial side by side; stacked on phones. */
.landing-hero .landing-ctas, .landing-final .landing-ctas { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; width: 100%; max-width: 680px; }
.landing-final .landing-ctas { margin: 0 auto; }
.landing-cta { min-width: 0; }
.landing-cta-text { min-width: 0; }
@media (max-width: 560px) {
  .landing-hero .landing-ctas, .landing-final .landing-ctas { grid-template-columns: minmax(0, 1fr); }
}

/* ---- The top bar on phones: everything fits the screen ---- */
.topbar { min-width: 0; max-width: 100vw; }
.topbar > * { min-width: 0; }
@media (max-width: 640px) {
  .brand .od-stack { display: none; }
  .home-btn { display: none; }
  .about-btn { margin-left: 4px; padding: 4px 10px; }
  .about-btn::after { display: none; }
  .topbar-right { gap: 4px; }
  .topbar-right .btn-sm .invite-label { display: none; }
  .waiting-pill { padding: 4px 6px 4px 8px; }
}
@media (max-width: 420px) {
  .topbar .seg button { padding-left: 8px; padding-right: 8px; }
  .attest-pill { display: none; }
}
/* Mid-size screens: the top bar's buttons go icon-only before anything spills. */
@media (max-width: 1000px) {
  .topbar-right .btn-sm .invite-label { display: none; }
  .brand-byline { display: none; }
}
@media (max-width: 900px) {
  .home-btn { display: none; }
  .attest-pill .label { display: none; }
}
/* The hero's three steps. */
.landing-lead-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.landing-lead-steps li { display: flex; align-items: flex-start; gap: 12px; font-size: 18px; line-height: 1.5; color: var(--text-2); }
.landing-lead-steps b { color: var(--text); }
.lead-num { display: grid; place-items: center; width: 28px; height: 28px; flex: none; margin-top: -1px; border-radius: 50%; background: var(--navy-dim); color: var(--navy); font-size: 14px; font-weight: 800; }
@media (max-width: 560px) { .landing-lead-steps li { font-size: var(--fs-md); } }
/* Three ways in: solo, with a friend, or the tutorial. */
.landing-hero .landing-ctas, .landing-final .landing-ctas { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 820px; }
.landing-cta { flex-direction: row; align-items: center; justify-content: flex-start; }
.landing-cta.is-friend { border: 0; color: #fff; background: linear-gradient(135deg, #12808a, #2f8f6a); box-shadow: 0 10px 24px rgba(18, 128, 138, 0.28); }
.landing-cta.is-friend .landing-cta-icon { background: rgba(255, 255, 255, 0.18); }
.landing-cta-text b { font-size: 16px; }
@media (max-width: 900px) {
  .landing-hero .landing-ctas, .landing-final .landing-ctas { grid-template-columns: minmax(0, 1fr); max-width: 520px; }
}

/* ============================================================
   Phones (≤760px): one adaptive layout, same design language.
   Tablets 761–1024px keep the docked single panel above.
   ============================================================ */

/* The "more" menu lives in the top bar only on phones. */
.topbar-more { display: none; position: relative; flex: none; }
.more-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 200px; display: grid; padding: 6px;
  border-radius: 14px; background: var(--bg-1); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  animation: fadein var(--dur-fast) var(--ease-out);
}
.more-item {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px;
  background: transparent; font: inherit; font-size: var(--fs-sm); font-weight: 500; color: var(--text); cursor: pointer; text-align: left; text-decoration: none;
}
.more-item:hover { background: var(--bg-3); }
.more-item .od-icon { color: var(--text-2); flex: none; }
.drawer-close, .drawer-scrim { display: none; }

/* Nothing in the app shell may push the viewport sideways. */
html, body { overflow-x: clip; }
.app { overflow-x: clip; min-width: 0; }
.topbar { min-width: 0; }
.topbar > * { min-width: 0; }

@media (max-width: 760px) {
  :root { --topbar-h: 56px; }

  /* ---- Top bar: panel button, mark, A / B / Watch, Waiting, enclave dot, more ---- */
  .topbar { gap: 8px; padding: 0 10px; }
  .brand { gap: 0; }
  .brand > .od-stack, .brand-session, .home-btn, .about-btn, .attest-pill .label { display: none; }
  .brand-judgy { width: 36px; height: 36px; border-radius: 9px; }
  .topbar-center { justify-content: center; flex: 1 1 auto; }
  .topbar .seg { padding: 2px; }
  .topbar .seg button { min-width: 34px; min-height: 32px; padding: 0 10px; }
  .topbar .seg .seg-label { display: none; }
  .topbar .seg .seg-short { display: inline; }
  .topbar-right { gap: 6px; flex: none; }
  .topbar-right > .btn:has(.invite-label) { display: none; }
  .topbar-more { display: block; }
  .topbar .btn-icon { width: 36px; min-height: 36px; }
  .attest-pill { padding: 0 11px; gap: 0; }
  .waiting-pill { min-height: 36px; padding: 0 8px 0 10px; }
  .waiting.is-them { max-width: 120px; overflow: hidden; text-overflow: ellipsis; padding: 6px 10px; }
  .waiting-menu, .more-menu { max-width: calc(100vw - 20px); }

  /* ---- Tab strip: scrolls sideways, the current tab kept in view ---- */
  .tabbar { gap: 2px; padding: 0 10px; scroll-padding-inline: 16px; mask-image: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 10px), transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 10px), transparent); }
  .tabbar .spacer, .tabbar .tab-sep { display: none; }
  .tab { min-height: 48px; padding: 0 10px; font-size: 14px; }
  .tab-group { padding: 0 2px; }
  .tab-appeal { margin-left: 4px; }
  .tab-arrow { padding: 0 2px; }

  /* ---- Side panel as a drawer with a backdrop and a close button ---- */
  .party { width: min(420px, 100vw); top: 0; bottom: 0; }
  .party[data-side="alice"] { border-right: 0; }
  .party[data-side="openbrain"] { border-left: 0; }
  .party.is-open { box-shadow: var(--shadow-lg); }
  .drawer-scrim { display: block; position: absolute; inset: 0; z-index: 15; background: rgba(22, 36, 58, 0.38); animation: fadein var(--dur-fast) var(--ease-out); }
  .drawer-close { display: inline-flex; flex: none; }
  .party-head .you + .drawer-close { margin-left: 4px; }
  .party-head .who:not(:has(.you)) .drawer-close { margin-left: auto; }
  .party-head { padding: 12px 12px 10px; gap: 10px; }
  .chat { padding: 12px; }
  .composer { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .files-view { padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
  .veil-foot { padding-bottom: calc(var(--sp-3) + env(safe-area-inset-bottom)); }
  .panel-switch button { min-height: 40px; }

  /* ---- Touch sizes; 16px inputs so iOS does not zoom the page ---- */
  .btn { min-height: 40px; }
  .btn-sm { min-height: 36px; }
  .btn-icon { width: 40px; }
  .btn-icon.btn-sm { width: 36px; }
  .seg button { min-height: 34px; }
  .input, .textarea, .select { font-size: 16px; min-height: 44px; }
  .composer textarea, .dm-composer textarea { min-height: 44px; }
  .approve-tick, .sg-btn { height: 32px; }
  .tab .count, .panel-switch .count { min-width: 20px; height: 20px; }

  /* ---- Tab content: one column, tighter rhythm ---- */
  .tab-panel { padding: 16px 12px calc(16px + env(safe-area-inset-bottom)); }
  .panel-inner { gap: 16px; }
  .panel-title .lead { max-width: none; }
  .attest-hero { grid-template-columns: minmax(0, 1fr); justify-items: start; padding: 16px; gap: 12px; }
  .guarantees, .attest-grid, .submissions, .outputs, .appeal-cols, .sim-sources, .judge-stats, .judge-details .judge-stats,
  .scenario-grid, .side-grid, .agent-grid, .party-status, .signoff .sigs, .appeal-options, .evidence-layout, .plan-layout,
  .invite-grid, .case-sides { grid-template-columns: minmax(0, 1fr); }
  .box-status { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 12px; }
  .stat .v { font-size: 22px; }
  .doc { padding: 16px 14px; }
  .doc-body, .plan-layout.is-solo .doc-body { max-width: none; }
  .doc-section, .doc-section.is-prompt, .doc-section.is-question, .doc-section.is-terms, .doc-section.is-judge { padding: 14px 12px; }
  .doc-section h3 { flex-wrap: wrap; gap: 6px 8px; }
  .doc-section h3 .doc-byline { margin-left: 0; flex-basis: 100%; }
  .kv, .key-kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .kv dt { margin-top: 8px; }
  .sim-out { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .sim-out dt { margin-top: 8px; }
  .sim-out dt.sim-answer-k { margin-top: 10px; }
  .sim-out dd.sim-answer { border-top: 0; margin-top: 0; padding-top: 0; }
  .sim-ctx-row { grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; }
  .sim-ctx-row .sim-ctx-label { grid-column: 2; }
  .sim-evidence-card { padding: 16px 14px; gap: 14px; }
  .sim-section { margin-top: 24px; padding-top: 18px; }
  .sim-against select { min-width: 0; width: 100%; }
  .sim-against .xs { margin-left: 0; }
  .sealed-row { grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; }
  .sealed-row > :nth-child(3) { grid-column: 2; }
  .seal-row { gap: 8px; padding-left: 8px; }
  .judge-row { flex-wrap: wrap; }
  .judge-row .judge-select { flex: 1 1 200px; }
  .run-hero { padding: 14px; }
  .run-verdict { font-size: 28px; }
  .gate-card { padding: 24px 16px; }
  .dm-card { height: calc(100dvh - 210px); min-height: 300px; }
  .dm-bubble { max-width: 86%; }
  .dm-list { padding: 12px; }
  .in-tabs { width: 100%; }
  .in-tab { padding: 8px 12px; }
  .neg-step { padding: 8px 10px; }
  .file-card { padding: 10px; }
  .ev-text, .ev-table-wrap { max-height: 60vh; }
  .qr-frame canvas, .qr-frame .qr-svg { width: 168px; height: 168px; }
  .code-big { font-size: 22px; letter-spacing: 0.08em; }
  .link-row { grid-template-columns: minmax(0, 1fr); }
  .case-main .case-brief { font-size: var(--fs-sm); }
  .appeal-verdict, .sim-answer { font-size: 24px; }

  /* ---- Overlays: compare fills the screen, the judging card and tutorial fit ---- */
  .compare-overlay { padding: 0; }
  .modal.compare { width: 100%; height: 100dvh; max-height: none; border-radius: 0; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
  .compare-doc { padding: 12px 14px; font-size: var(--fs-sm); }
  .compare-editor { padding: 12px 14px; }
  .judging { padding: 12px; }
  .judging-card { padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); border-radius: 16px; gap: 12px; }
  /* The tutorial over the judging card: its bubble docks at the bottom in
     room kept for it, and the card scrolls above, never underneath. */
  body:has(.tutorial-bubble) .judging { place-items: start center; overflow-y: auto; padding-bottom: calc(42dvh + 24px); }
  body:has(.judging) .tutorial-bubble { left: 12px !important; right: 12px; top: auto !important; bottom: 12px; width: auto; max-height: 42dvh; overflow-y: auto; transform: none !important; }
  .judging-title { font-size: 26px; }
  .judging-verdict { font-size: 52px; }
  .judging.is-withheld .judging-verdict { font-size: 36px; }
  .judging-q p { padding: 10px 12px; }
  .ticker { max-width: 100%; }
  .gavel-anim { width: 112px; }
  .tutorial-bubble {
    left: 12px !important; right: 12px; top: auto !important; bottom: calc(12px + env(safe-area-inset-bottom));
    width: auto; max-height: 56dvh; overflow-y: auto; padding: 14px 16px; gap: 8px;
  }
  .tutorial-bubble h3 { font-size: var(--fs-md); }
  .tutorial-body { font-size: var(--fs-sm); }
  .toasts { top: calc(var(--topbar-h) + 8px); width: calc(100% - 24px); }
  .toast { max-width: 100%; }
  .waiting-menu { right: -8px; }
}

/* ---- Compact phones (≤480px): modals become bottom sheets ---- */
@media (max-width: 480px) {
  .topbar { gap: 6px; padding: 0 8px; }
  .brand-judgy { width: 32px; height: 32px; border-radius: 8px; }
  .topbar .seg button { padding: 0 8px; min-width: 32px; }
  .attest-pill { display: none; }
  .waiting.is-them { max-width: 92px; }
  .tab-panel { padding: 12px 10px calc(12px + env(safe-area-inset-bottom)); }
  .party { width: 100vw; }
  .box-status { grid-template-columns: minmax(0, 1fr); }

  .overlay:not(.compare-overlay) { padding: 0; align-items: end; justify-items: stretch; }
  .overlay:not(.compare-overlay) .modal {
    width: 100%; max-height: calc(100dvh - 24px); border-radius: 24px 24px 0 0; gap: 18px;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); animation: sheetin var(--dur-med) var(--ease-out);
  }
  .modal-foot { flex-wrap: wrap; gap: 8px; }
  .modal-foot .btn-primary { flex: 1 1 auto; }
  .modal-head p { max-width: none; }
  .tutorial-offer { padding: 14px; gap: 12px; }
  .join-key-input { font-size: 24px; letter-spacing: 0.3em; }
}
@keyframes sheetin { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ---- Landing page on phones ---- */
@media (max-width: 760px) {
  .landing { overflow-x: clip; }
  .landing-inner { padding: 20px 16px calc(32px + env(safe-area-inset-bottom)); gap: 48px; }
  .landing-hero { gap: 18px; }
  .landing-hero-text { gap: 14px; }
  .landing-brand { font-size: 26px; }
  .landing-hero h1 { font-size: clamp(28px, 7.6vw, 38px); line-height: 1.12; }
  .landing-paradox { font-size: 12px; margin-bottom: 6px; }
  .landing-lead { font-size: 17px; line-height: 1.55; }
  .landing-ctas { width: 100%; gap: 10px; }
  .landing-cta { width: 100%; padding: 14px 16px; border-radius: 16px; }
  .landing-cta-text b { font-size: 16px; }
  .landing-modes { height: auto; padding: 8px 14px; white-space: normal; text-align: center; line-height: 1.4; }
  .landing-answer { padding: 22px 18px; gap: 22px; border-radius: 20px; }
  .landing-answer h2 { font-size: 24px; }
  .landing-story { gap: 44px; }
  .landing-chapter, .landing-chapter.is-flipped { gap: 14px; }
  .chapter-num { font-size: 32px; }
  .chapter-text { gap: 8px; }
  .chapter-text h3 { font-size: 22px; }
  .chapter-text p { font-size: 15.5px; line-height: 1.6; }
  .chapter-shot { border-radius: 12px; }
  /* Full frame at the screenshot's own ratio: nothing cropped away. */
  .chapter-shot img { max-height: none; object-fit: fill; }
  .landing-demo { padding: 14px 16px; align-items: flex-start; border-radius: 14px; }
  .landing-demo p { font-size: var(--fs-sm); }
  .landing-scenarios, .landing-faq { gap: 12px; }
  .landing-scenario { padding: 18px 16px; border-radius: 16px; }
  .landing-scenario b { font-size: var(--fs-md); }
  .faq-grid { gap: 0; }
  .faq-item { padding: 14px 0; }
  .landing-final { padding: 32px 16px; border-radius: 20px; }
  .landing-gavel { width: 120px; }
  .landing-final-verdict { font-size: clamp(52px, 18vw, 80px); }
  .landing-footer { flex-direction: column; align-items: flex-start; gap: 8px; font-size: var(--fs-xs); }
}
@media (max-width: 560px) {
  .landing-hero-text { justify-items: center; text-align: center; }
  .landing-lead { max-width: none; }
  .landing-judgy { width: 150px; }
  .landing-hero-art::before { width: 200px; height: 200px; }
  .landing-hero .landing-modes { margin-top: 0; }
}

/* The paradox: room below the logo, a clear label, the question in quotes. */
.landing-brand { margin-bottom: 18px; }
.landing-paradox { display: inline-block; margin-bottom: 16px; padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, #b3263e 10%, var(--bg-1)); border: 1px solid color-mix(in srgb, #b3263e 30%, transparent); font-size: 12px; letter-spacing: 0.18em; }
.landing-paradox::after { content: ":"; }
.landing-quote { display: block; }

/* Screenshots: shown at the app's real scale, in frames of a consistent size. */
.chapter-shot { display: grid; justify-items: center; align-content: start; background: var(--bg-2); }
.chapter-shot img { width: auto; max-width: 100%; max-height: 440px; object-fit: cover; object-position: top center; }
.landing-chapter .chapter-shot { min-height: 200px; }

/* The tutorial's first bubble shows Judgy and the name. */
.tutorial-welcome { display: flex; align-items: center; gap: 12px; }
.tutorial-welcome img { width: 72px; height: auto; filter: drop-shadow(0 6px 10px rgba(22, 36, 58, 0.18)); }
.tutorial-welcome .brand-name { font-size: 26px; }
/* Screenshots at one zoom: the frame fits the shot; the window bar spans it. */
.chapter-shot { display: block; width: 100%; justify-self: center; background: var(--bg-1); }
.chapter-shot img { width: 100%; max-width: none; max-height: 520px; object-fit: cover; object-position: top left; }
.shot-bar { justify-content: flex-start; }
.landing-chapter .chapter-shot { min-height: 0; }

/* Tutorial: the spotlight follows its target closely. */
.tutorial-spot { transition: left 0.12s linear, top 0.12s linear, width 0.12s linear, height 0.12s linear; }
.tutorial-target { transition: none; }
.tutorial-offer > .tutorial-offer-go { flex: none; width: 44px; height: 44px; }
.case-next { align-items: center; gap: 12px; }
.case-required { color: var(--warn); font-weight: 600; }
.case-req { color: #b3263e; }

/* Setup: the invite link. */
.ob-invite { display: grid; gap: 8px; }
.ob-invite-row { display: flex; gap: 8px; }
.ob-invite-row .input { flex: 1; min-width: 0; font-size: var(--fs-sm); }

.brand-home { display: inline-flex; color: inherit; text-decoration: none; }

/* Dropdowns: our own chevron, with room to breathe on the right. */
select.select, select.input {
  appearance: none; -webkit-appearance: none; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236b7385' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px;
}
/* Screenshots are parts of the app, not windows: a plain soft card. */
.chapter-shot { border-radius: 14px; transform: none !important; box-shadow: 0 18px 40px -18px rgba(22, 36, 58, 0.3), 0 4px 12px -6px rgba(22, 36, 58, 0.15); }

/* ---- Phones: the tabs live in the menu; a chat button opens your agent ---- */
.nav-menu-wrap { display: none; position: relative; flex: none; }
.nav-toggle { position: relative; }
.nav-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: #d14d4d; box-shadow: 0 0 0 2px var(--bg-1); }
.nav-menu { position: absolute; left: 0; top: calc(100% + 8px); z-index: 60; width: min(300px, calc(100vw - 20px)); display: grid; gap: 2px; padding: 8px; border-radius: 16px; background: var(--bg-1); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; font: inherit; font-size: var(--fs-md); color: var(--text); text-align: left; cursor: pointer; }
.nav-item:hover { background: var(--bg-3); }
.nav-item.is-current { background: var(--navy-dim); color: var(--navy); font-weight: 600; }
.nav-item.is-locked { color: var(--text-3); }
.nav-item .od-icon { color: var(--text-3); flex: none; }
/* Your agents, first in the menu: the robot in the side's colour. */
.nav-agent { font-weight: 600; }
.nav-agent-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; background: var(--alice); flex: none; }
.nav-agent[data-side="openbrain"] .nav-agent-icon { background: var(--lab); }
.nav-agent .nav-agent-icon .od-icon { color: #fff; }
/* Phones: the agent button is a filled pill in its side's colour, labelled
   "Agent"; with both sides' buttons showing, robot and letter only. */
.drawer-toggle-label { display: none; }
@media (max-width: 760px) {
  .topbar .drawer-toggle { width: auto; min-width: 40px; height: 34px; padding: 0 12px 0 10px; border-radius: 999px; color: #fff; background: var(--alice); box-shadow: 0 2px 8px color-mix(in srgb, var(--alice) 35%, transparent); }
  .topbar .drawer-toggle[data-side="openbrain"] { background: var(--lab); box-shadow: 0 2px 8px color-mix(in srgb, var(--lab) 35%, transparent); }
  .drawer-toggle:hover { color: #fff; filter: brightness(1.08); }
  .drawer-toggle .drawer-toggle-chat { align-items: center; gap: 6px; }
  .drawer-toggle .drawer-toggle-chat .od-icon { color: #fff; }
  .drawer-toggle-label { display: inline; font-size: 13px; font-weight: 700; letter-spacing: 0.01em; }
  .topbar:has(.drawer-toggle-right) .drawer-toggle-label { display: none; }
  .topbar:has(.drawer-toggle-right) .drawer-toggle { padding: 0 8px; gap: 4px; }
  .drawer-toggle .drawer-side { position: static; box-shadow: none; background: rgba(255, 255, 255, 0.25); }
}
/* The narrowest phones: the labelled agent button over the logo (Home is in the ⋮ menu). */
@media (max-width: 380px) {
  .topbar:not(:has(.drawer-toggle-right)) .brand { display: none; }
}
.nav-item .step-num { flex: none; }
.nav-label { flex: 1; }
.nav-item .count { min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 999px; background: #d14d4d; color: #fff; font-size: 12px; font-weight: 700; }
.nav-sep { padding: 10px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.drawer-toggle-chat { display: none; }
@media (max-width: 760px) {
  .nav-menu-wrap { display: block; }
  .drawer-toggle-menu { display: none; }
  .drawer-toggle-chat { display: inline-flex; }
  .center > .tabbar { display: none; }
}

/* Composer: the message box gets the room; Auto is a small robot button. */
.composer .auto-btn { width: 36px; height: 36px; min-height: 36px; padding: 0; justify-content: center; border-radius: 50%; border: 1px solid transparent; }
.composer .auto-btn.is-on { background: var(--ok-dim); border-color: var(--ok-line); color: var(--ok); }
.composer .auto-btn.is-on .od-icon { animation: none; }
.composer .auto-btn.is-on::after { content: ""; position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px var(--bg-1); }
.composer .auto-btn { position: relative; }
.composer .attach { margin-right: 0; }
.composer-row { gap: 6px; }
.composer-row .textarea { flex: 1; min-width: 0; resize: none; overflow-y: auto; min-height: 44px; max-height: 160px; line-height: 1.4; padding: 11px 16px; white-space: pre-wrap; }

/* Scenario picker: three columns in a wider dialog, an icon on each card. */
.modal:has(.scenario-grid) { width: min(1080px, 100%); }
.scenario-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 12px; }
.scenario-grid .side-opt { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 10px; row-gap: 6px; align-content: start; padding: 14px 16px; }
.scenario-grid .scenario-icon { grid-row: 1; font-size: 22px; line-height: 1.3; }
.scenario-grid .side-opt .n { grid-row: 1; align-self: center; font-size: var(--fs-md); line-height: 1.3; }
.scenario-grid .side-opt .d { grid-column: 1 / -1; font-size: var(--fs-sm); line-height: 1.5; }
@media (max-width: 900px) { .scenario-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
@media (max-width: 560px) { .scenario-grid { grid-template-columns: minmax(0, 1fr) !important; } .scenario-grid .side-opt .d { display: none; } }

/* Tutorial on a phone: the bubble docks along the bottom edge. */
.tutorial-bubble { max-height: calc(100vh - 24px); overflow-y: auto; }
@media (max-width: 760px) {
  .tutorial-bubble { left: 10px !important; right: 10px; top: auto !important; bottom: 10px; width: auto; transform: none !important; max-height: 55vh; padding: 14px 16px; }
  /* A target low on the screen: the bubble docks under the top bar instead. */
  .tutorial-bubble.is-high { top: calc(var(--topbar-h, 56px) + 8px) !important; bottom: auto; max-height: 45vh; }
  .tutorial-welcome img { width: 52px; }
  .tutorial-body { font-size: var(--fs-sm); }
}
/* Two chat buttons (both sides on screen): each shows whose agent it opens. */
.drawer-toggle { position: relative; }
.drawer-side { display: none; position: absolute; right: 1px; bottom: 1px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 999px; font-size: 10px; font-weight: 800; line-height: 16px; text-align: center; color: #fff; background: var(--alice); box-shadow: 0 0 0 2px var(--bg-1); }
.drawer-side[data-side="openbrain"] { background: var(--lab); }
@media (max-width: 760px) { .drawer-side { display: block; } }
/* Phones: keep each scenario's description, a little smaller. */
@media (max-width: 560px) {
  .scenario-grid .side-opt .d { display: block; font-size: var(--fs-xs); line-height: 1.45; color: var(--text-2); }
  .scenario-grid .side-opt { padding: 12px 14px; row-gap: 4px; }
}

/* ---- Landing: how a secure enclave works ---- */
.landing-enclave { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 20px 48px; align-items: start; }
.enclave-intro { display: grid; gap: 10px; position: sticky; top: 24px; }
.enclave-intro h2 { margin: 0; font-family: var(--font-display); font-size: clamp(24px, 2.6vw, 32px); line-height: 1.15; }
.enclave-intro p { margin: 0; font-size: 17px; line-height: 1.65; color: var(--text-2); }
.enclave-stack { margin: 0; padding: 0; list-style: none; display: grid; gap: 0; position: relative; }
.enclave-layer { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; padding: 16px 18px; background: var(--bg-1); border: 1px solid var(--line); border-top-width: 0; }
.enclave-layer:first-child { border-top-width: 1px; border-radius: 16px 16px 0 0; }
.enclave-layer:last-child { border-radius: 0 0 16px 16px; }
.enclave-layer b { display: flex; align-items: center; gap: 8px; font-size: var(--fs-md); }
.enclave-layer p { margin: 4px 0 0; font-size: var(--fs-sm); line-height: 1.6; color: var(--text-2); }
.enclave-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--navy-dim); color: var(--navy); }
.enclave-num { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--bg-3); color: var(--text-2); font-size: 11px; font-weight: 800; }
.enclave-sum { grid-column: 2; display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: 16px; background: var(--ok-dim); border: 1px solid var(--ok-line); }
.enclave-sum .od-icon { color: var(--ok); flex: none; margin-top: 3px; }
.enclave-sum p { margin: 0; font-size: var(--fs-md); line-height: 1.6; color: var(--text); }
.enclave-caveat { grid-column: 2; margin: 0; font-size: var(--fs-sm); line-height: 1.6; color: var(--text-3); }
@media (max-width: 900px) {
  .landing-enclave { grid-template-columns: minmax(0, 1fr); }
  .enclave-intro { position: static; }
  .enclave-sum, .enclave-caveat { grid-column: auto; }
}
