/* Phasm demo: the desktop app's shell and dark palette (desktop/src/app/Theme.cpp,
   desktop/src/ui/WorkspaceShell): title bar with menus and stages, a tab row on
   every pane, the tool rail, the Dutchman pane, the status bar. */
@font-face {
  font-family: "Metrophobic";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/upload-display.woff2) format("woff2");
}

:root {
  color-scheme: dark;
  --ground: #151412;
  --card: #1f1e1b;
  --subcard: #26241f;
  --well: #1b1a17;
  --chip: #2e2c28;
  --ink: #f4f4f5;
  --muted: #a9a69f;
  --tertiary: #918e87;
  --border: #34322e;
  --border2: #46443f;
  --pass: #4ade80;
  --fail: #f87171;
  --warn: #fbbf24;
  --info: #60a5fa;
  --on-ink: #121214;
  --scrim: rgba(21, 20, 18, 0.8);
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --serif: Cambria, Charter, Georgia, "Times New Roman", serif;
  --title-h: 40px;
  --tab-h: 32px;
  --status-h: 26px;
  --dutch-w: 520px;
  --summary-w: 300px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 13px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
button { font: inherit; color: inherit; }
a { color: inherit; }
kbd { font: inherit; }
[hidden] { display: none !important; }
svg { flex: none; }
button svg, .chev svg { width: 16px; height: 16px; }
:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }

/* --- the title bar ------------------------------------------------------------ */
.titlebar {
  height: var(--title-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: 22px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 20;
}
.brand { display: flex; align-items: center; color: var(--ink); text-decoration: none; }
.lockup { height: 17px; width: auto; display: block; }
.menus { display: flex; gap: 2px; padding-right: 18px; border-right: 1px solid var(--border2); }
.menu { position: relative; }
.menu-btn { background: none; border: 0; padding: 4px 9px; border-radius: 5px; cursor: pointer; }
.menu-btn:hover, .menu-btn[aria-expanded="true"] { background: var(--chip); }
.menu-pop {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 210px; padding: 5px;
  background: var(--card); border: 1px solid var(--border2); border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45); display: grid; gap: 1px;
}
.menu-pop > button, .menu-pop > a {
  all: unset; display: flex; justify-content: space-between; gap: 24px; padding: 6px 10px; border-radius: 5px; cursor: pointer; white-space: nowrap;
}
.menu-pop > button:hover, .menu-pop > a:hover, .menu-pop > button:focus-visible, .menu-pop > a:focus-visible { background: var(--chip); }
.menu-pop > button:disabled { color: var(--tertiary); cursor: default; background: none; }
.menu-pop kbd { color: var(--tertiary); }
.menu-pop hr { border: 0; border-top: 1px solid var(--border); margin: 4px 2px; }
.menu-pop [role="menuitemcheckbox"] { position: relative; padding-left: 26px; }
.menu-pop [aria-checked="true"]::before { content: "✓"; position: absolute; left: 9px; color: var(--muted); }

.crumbs { display: flex; align-items: center; gap: 6px; white-space: nowrap; min-width: 0; }
.crumb { background: none; border: 0; padding: 0; cursor: pointer; color: var(--muted); }
.crumb:hover { color: var(--ink); }
body[data-tab="folders"] .crumb { color: var(--ink); }
body[data-tab="folders"] .doc-only { display: none; }
.chev { color: var(--muted); display: inline-flex; }
.chev svg { width: 13px; height: 13px; }
.crumb-here { overflow: hidden; text-overflow: ellipsis; }

.stages { position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; height: 100%; }
.stage {
  background: none; border: 0; padding: 0 10px; cursor: pointer; color: var(--muted); height: 100%;
  display: flex; align-items: center; font-size: 13.5px;
}
.stage span { padding: 2px 0; border-bottom: 1px solid transparent; }
.stage:hover { color: var(--ink); }
.stage[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
body[data-tab="folders"] .stages { visibility: hidden; }

.bar-end { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.replay-pill {
  font-size: 12px; color: var(--muted); border: 1px solid var(--border2); background: none;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap; cursor: pointer;
}
.replay-pill:hover { color: var(--ink); }
.cta {
  text-decoration: none; background: var(--ink); color: var(--on-ink); font-weight: 600;
  padding: 5px 13px; border-radius: 6px; white-space: nowrap;
}
.cta:hover { background: #fff; }

/* --- panes and their tab rows ------------------------------------------------------ */
.shell { flex: 1; min-height: 0; display: flex; }
.pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pane-doc { flex: 1; }
.pane-dutch { width: var(--dutch-w); flex: none; border-left: 1px solid var(--border); }
body.no-dutch .pane-dutch { display: none; }
body.max-doc .pane-dutch { display: none; }
body.max-dutch .pane-doc { display: none; }
body.max-dutch .pane-dutch { flex: 1; width: auto; border-left: 0; }
body.max-dutch .dutchman > * { max-width: 760px; margin-inline: auto; width: 100%; }

.tabrow {
  height: var(--tab-h); flex: none; display: flex; align-items: stretch; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.tabs { display: flex; align-items: stretch; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.doc-tab-wrap { display: flex; align-items: center; position: relative; }
.doc-tab {
  background: none; border: 0; cursor: pointer; padding: 0 12px; height: 100%; color: var(--muted); white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.doc-tab-wrap .doc-tab { padding-right: 30px; }
.doc-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.doc-tab:hover { color: var(--ink); }
.tab-x {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; border: 0; border-radius: 4px;
  background: none; cursor: pointer; color: var(--muted); font-size: 16px; line-height: 1; display: grid; place-items: center;
}
.tab-x:hover { background: var(--chip); color: var(--ink); }
.pane-ctl { display: flex; align-items: center; padding-right: 6px; }
.pane-ctl button {
  width: 30px; height: 26px; border: 0; background: none; cursor: pointer; color: var(--muted); border-radius: 4px; display: grid; place-items: center;
}
.pane-ctl button:hover { background: var(--chip); color: var(--ink); }
.pane-ctl svg { width: 11px; height: 11px; }
.pane-body { flex: 1; min-height: 0; position: relative; display: flex; }

/* --- folders home ------------------------------------------------------------------ */
.home { flex: 1; overflow-y: auto; padding: 72px max(24px, 4.5vw) 40px; }
.welcome { font: 600 clamp(40px, 5vw, 60px)/1.1 var(--sans); letter-spacing: -0.02em; text-align: center; margin: 24px 0 70px; }
.home-rule { border-top: 1px solid var(--border2); }
.home-head { display: flex; justify-content: space-between; align-items: center; margin: 40px 0 30px; color: var(--muted); font-size: 12px; }
.home-sort { border: 1px solid var(--border2); border-radius: 6px; padding: 5px 12px; color: var(--ink); font-size: 13px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.tile {
  all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 4px; padding: 12px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--well); text-decoration: none;
}
.tile:hover, .tile:focus-visible { border-color: var(--border2); background: var(--card); }
.tile-img { aspect-ratio: 16 / 10; border-radius: 9px; background: var(--ground); overflow: hidden; margin-bottom: 8px; display: block; }
.tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-name { font-size: 14px; font-weight: 600; }
.tile-sub { color: var(--muted); font-size: 12px; }
.tile-new { border-style: dashed; border-width: 2px; align-items: center; justify-content: center; min-height: 220px; }
.plus { width: 48px; height: 48px; border-radius: 12px; background: var(--chip); display: grid; place-items: center; font-size: 26px; color: var(--muted); margin-bottom: 8px; }

/* --- the model document ---------------------------------------------------------- */
.doc { flex: 1; display: flex; min-width: 0; min-height: 0; }
.summary { width: var(--summary-w); flex: none; border-right: 1px solid var(--border); overflow-y: auto; padding: 16px 16px 24px; scrollbar-color: var(--border2) transparent; }
body:not([data-stage="results"]) .summary { display: none; }
body.summary-shut .summary { width: 44px; padding: 14px 0; overflow: hidden; }
body.summary-shut .summary > :not(.sum-head) { display: none; }
body.summary-shut .sum-head > :not(.collapse) { display: none; }
body.summary-shut .sum-head { justify-content: center; }

.viewport { position: relative; flex: 1; min-width: 0; overflow: hidden; background: var(--ground); }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* the tool rail (desktop ToolPanel: icon and key letter, a rule before Simulation) */
.rail {
  position: absolute; left: 12px; top: 14px; display: flex; flex-direction: column; gap: 4px; padding-left: 4px;
  border-left: 1px solid var(--border2);
}
.rail-btn {
  position: relative; display: flex; align-items: flex-end; gap: 1px; background: none; border: 0; padding: 4px 6px 4px 8px; cursor: pointer; color: var(--muted); border-radius: 5px;
}
.rail-btn svg { width: 16px; height: 16px; }
.rail-btn kbd { font-size: 9.5px; line-height: 1; color: var(--tertiary); margin-bottom: -2px; }
.rail-btn:hover:not(:disabled) { color: var(--ink); background: rgba(46, 44, 40, 0.7); }
.rail-btn[aria-pressed="true"] { color: var(--ink); }
.rail-btn[aria-pressed="true"]::before { content: ""; position: absolute; left: -6px; top: 4px; bottom: 4px; width: 2px; background: var(--ink); border-radius: 1px; }
.rail-btn:disabled { opacity: 0.35; cursor: default; }
.rail-rule { height: 1px; background: var(--border2); margin: 4px 6px 4px 8px; }

.vp-tools { position: absolute; top: 12px; right: 12px; display: flex; align-items: center; gap: 2px; }
.vp-btn { background: none; border: 0; padding: 5px; border-radius: 5px; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.vp-btn:hover { color: var(--ink); background: var(--chip); }
.vp-btn[aria-pressed="false"] { opacity: 0.5; }
.vp-rule { width: 1px; height: 16px; background: var(--border2); margin: 0 4px; }

.vp-caption { position: absolute; left: 50%; transform: translateX(-50%); top: 14px; color: var(--muted); white-space: nowrap; max-width: calc(100% - 260px); overflow: hidden; text-overflow: ellipsis; }
.vp-caption strong { color: var(--ink); font-weight: 600; }
.legend {
  position: absolute; right: 16px; bottom: 44px; display: flex; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.legend-title { color: var(--muted); }
.legend-bar {
  width: 130px; height: 7px; border-radius: 1px;
  background: linear-gradient(90deg, rgb(26, 26, 140), rgb(26, 166, 242), rgb(51, 217, 51), rgb(242, 230, 26), rgb(242, 77, 26), rgb(255, 166, 217));
}
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; display: inline-block; }
.mode-bar {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 72px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  background: var(--scrim); border: 1px solid var(--border); border-radius: 8px; padding: 4px; max-width: calc(100% - 140px);
}
.mode-bar button { flex: none; white-space: nowrap; background: none; border: 0; color: var(--muted); padding: 3px 8px; border-radius: 5px; cursor: pointer; font-size: 12px; font-variant-numeric: tabular-nums; }
.mode-bar button[aria-pressed="true"] { background: var(--chip); color: var(--ink); }
.gizmo { position: absolute; left: 14px; bottom: 12px; width: 48px; height: 48px; color: var(--muted); }
.scale-bar { position: absolute; right: 16px; bottom: 14px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--muted); padding: 0 12px 2px; }

.run-strip {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 14px; width: min(420px, calc(100% - 200px));
  display: grid; gap: 6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.run-strip .bar { height: 2px; background: var(--chip); overflow: hidden; }
.run-strip .bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width 0.3s linear; }

.loading {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  color: var(--muted); background: var(--ground); transition: opacity 0.5s ease; z-index: 6;
}
.loading.done { opacity: 0; pointer-events: none; }

/* The 3x3 lattice: Dutchman's glyph while it thinks (desktop ThoughtLine). */
.lattice { width: 22px; height: 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; flex: none; }
.lattice i { width: 4px; height: 4px; border-radius: 50%; background: var(--ink); opacity: 0.25; animation: lat 1.2s infinite ease-in-out; }
@keyframes lat { 0%, 100% { opacity: 0.2; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1.15); } }

/* weak-spot callouts on the model (desktop ResultsStage) */
.callouts { position: absolute; inset: 0; pointer-events: none; }
.callout {
  position: absolute; transform: translate(-7px, -50%); pointer-events: auto; cursor: pointer;
  display: flex; align-items: center; gap: 5px; font-size: 11.5px; white-space: nowrap; font-variant-numeric: tabular-nums;
  background: none; border: 0; padding: 0; color: var(--ink);
}
.callout .ring { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid currentColor; background: rgba(21, 20, 18, 0.35); }
.callout .lab { color: var(--muted); text-shadow: 0 0 4px var(--ground), 0 0 4px var(--ground); }
.callout .lab b { color: currentColor; font-weight: 400; }
.callout[data-tone="critical"] { color: var(--fail); }
.callout[data-tone="warning"] { color: var(--warn); }
.callout[data-tone="ok"] { color: var(--pass); }
.callout[aria-pressed="true"] .ring { background: currentColor; box-shadow: 0 0 0 3px rgba(21, 20, 18, 0.7); }

/* the opened callout: the weak spot's card over the stage */
.spot-card {
  position: absolute; top: 52px; right: 14px; width: 300px; max-height: calc(100% - 120px); overflow-y: auto;
  background: var(--card); border: 1px solid var(--border2); border-radius: 10px; padding: 14px 16px 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45); z-index: 4;
}
.spot-card .sc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.spot-card .sc-rank { color: var(--muted); margin-right: 6px; }
.spot-card .sc-name { font-size: 15px; }
.spot-card .sc-x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 2px; }
.spot-card .sc-x:hover { color: var(--ink); }
.spot-card .sc-case { color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.spot-card .sc-util { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; }
.spot-card .sc-util b { font-size: 20px; font-weight: 400; font-variant-numeric: tabular-nums; }
.spot-card .sc-util small { color: var(--muted); }
.spot-card .sc-fig { color: var(--muted); font-size: 12px; margin-top: 2px; }
.spot-card h4 { font-size: 13px; font-weight: 600; margin: 14px 0 4px; }
.spot-card p { margin: 0; color: var(--ink); }

/* --- the results summary panel (desktop SummaryPanel) ------------------------------------ */
.sum-head { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.sum-head b { font-weight: 600; }
.sum-head .sub { color: var(--info); font-size: 12px; }
.collapse { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 3px; border-radius: 4px; display: grid; place-items: center; }
.collapse:hover { color: var(--ink); background: var(--chip); }
.verdict-row { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 6px; align-items: start; }
.verdict-row svg { width: 16px; height: 16px; margin-top: 2px; }
.verdict { font-size: 15px; }
.verdict[data-tone="fail"], .verdict-row[data-tone="fail"] { color: var(--fail); }
.verdict[data-tone="warn"], .verdict-row[data-tone="warn"] { color: var(--warn); }
.verdict[data-tone="pass"], .verdict-row[data-tone="pass"] { color: var(--pass); }
.verdict-sub { color: var(--muted); }
.sum-sec { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 14px; }
.sum-sec:first-of-type { border-top: 0; }
.sec-title { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 8px; }
.sec-title svg { width: 15px; height: 15px; color: var(--muted); }
.sec-title .count { margin-left: auto; color: var(--muted); font-weight: 400; font-size: 12px; }
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 4px 0; }
.kv > span:first-child { color: var(--muted); }
.kv > span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.kv small { color: var(--muted); }
.bullets { margin: 0; padding-left: 16px; display: grid; gap: 6px; }
.bullets li::marker { color: var(--muted); }
.more-link { background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; margin-top: 8px; display: inline-flex; align-items: center; gap: 6px; }
.more-link svg { width: 13px; height: 13px; }

.spot { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 6px; padding: 8px 6px; margin: 0 -6px; cursor: pointer; border-radius: 6px; border: 0; background: none; width: calc(100% + 12px); text-align: left; }
.spot:hover, .spot[aria-pressed="true"] { background: var(--card); }
.spot .rank { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; padding-top: 1px; }
.spot .case-t { color: var(--tertiary); font-size: 12px; }
.spot .util { font-variant-numeric: tabular-nums; text-align: right; }
.util[data-tone="critical"] { color: var(--fail); }
.util[data-tone="warning"] { color: var(--warn); }
.util[data-tone="ok"] { color: var(--pass); }
.meter { height: 2px; background: var(--chip); margin-top: 5px; overflow: hidden; }
.meter > i { display: block; height: 100%; }

.case { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 7px 6px; margin: 0 -6px; border-radius: 6px; border: 0; background: none; width: calc(100% + 12px); text-align: left; cursor: pointer; }
.case:hover:not(:disabled) { background: var(--card); }
.case:disabled { cursor: default; }
.case.selected { background: var(--card); }
.case .title { min-width: 0; }
.case .family { color: var(--tertiary); font-size: 12px; display: block; }
.case .fig { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; color: var(--muted); }
.state { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--border2); margin-top: 5px; }
.state[data-s="running"] { width: 11px; height: 11px; margin-top: 4px; border-color: var(--info); border-top-color: transparent; animation: spin 0.8s linear infinite; }
.state[data-s="pass"] { border-color: var(--pass); background: var(--pass); }
.state[data-s="fail"] { border-color: var(--fail); background: var(--fail); }
@keyframes spin { to { transform: rotate(360deg); } }

table.checks { width: 100%; border-collapse: collapse; font-size: 12px; }
table.checks th, table.checks td { text-align: left; padding: 6px 6px 6px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
table.checks th { color: var(--muted); font-weight: 400; }
.agree { color: var(--pass); }
.disagree { color: var(--fail); }
.note { padding: 6px 0; }
.note b { font-weight: 600; }
.note p { margin: 2px 0 0; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border: 0; border-radius: 6px; padding: 10px 14px; font-weight: 600; cursor: pointer;
  background: var(--ink); color: var(--on-ink); font-size: 13.5px; text-decoration: none;
}
.btn:hover:not(:disabled) { background: #fff; }
.btn:disabled { background: var(--chip); color: var(--muted); cursor: default; }
.btn.secondary { background: none; color: var(--ink); border: 1px solid var(--border2); font-weight: 400; }
.btn.secondary:hover:not(:disabled) { background: var(--chip); }
.btn.inline { width: auto; }
.btn svg, .sec-title svg, .collapse svg { width: 16px; height: 16px; }

/* --- Dutchman ------------------------------------------------------------------ */
.dutchman { flex-direction: column; overflow-y: auto; padding: 28px 28px 24px; scrollbar-color: var(--border2) transparent; }
.d-mark { display: flex; justify-content: center; margin: 60px 0 14px; color: var(--ink); }
.d-title { font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1.2; text-align: center; margin: 0 0 8px; text-wrap: balance; }
.d-lede { color: var(--muted); text-align: center; margin: 0 auto 24px; max-width: 34em; text-wrap: pretty; }
.prompt { border: 1px solid var(--border2); padding: 14px; background: var(--well); }
.prompt textarea { width: 100%; min-height: 48px; resize: none; border: 0; background: none; color: var(--ink); font: inherit; outline: none; }
.prompt .p-foot { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; gap: 12px; }
.send { width: 30px; height: 30px; border: 1px solid var(--border2); background: none; cursor: pointer; color: var(--ink); flex: none; }
.send:disabled { opacity: 0.4; cursor: default; }
.d-small { color: var(--muted); font-size: 12px; text-align: center; margin: 10px 0 0; }
.section-label { font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 26px 0 6px; }
.suggest { all: unset; display: flex; justify-content: space-between; gap: 12px; width: 100%; box-sizing: border-box; padding: 11px 8px; border-bottom: 1px solid var(--border); cursor: pointer; }
.suggest:hover, .suggest:focus-visible { background: var(--card); }
.suggest span:last-child { color: var(--muted); }
.thread { display: flex; flex-direction: column; gap: 18px; }
.msg-user { align-self: flex-end; background: var(--card); padding: 9px 13px; border-radius: 10px; max-width: 85%; }
.msg-ai { font-family: var(--serif); font-size: 15px; line-height: 1.6; }
.msg-ai p { margin: 0 0 10px; }
.msg-ai .sans { font-family: var(--sans); font-size: 13px; line-height: 1.45; }
.thought { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.proposed { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; gap: 1px; font-family: var(--sans); font-size: 13px; line-height: 1.45; }
.proposed li { padding: 9px 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; }
.proposed .ct { color: var(--ink); }
.proposed .crit { color: var(--muted); font-size: 12px; margin-top: 2px; }
.proposed .ev { color: var(--muted); }
details.assume { font-family: var(--sans); font-size: 13px; line-height: 1.45; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 10px 0; margin: 4px 0 14px; }
details.assume summary { cursor: pointer; color: var(--ink); list-style: none; display: flex; justify-content: space-between; }
details.assume summary::-webkit-details-marker { display: none; }
details.assume summary::after { content: "Show"; color: var(--muted); }
details.assume[open] summary::after { content: "Hide"; }
.a-group { margin-top: 12px; }
.a-group h5 { margin: 0 0 4px; font-size: 12px; font-weight: 400; color: var(--muted); }
.a-group h5[data-k="typical"] { color: var(--warn); }
.a-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.a-row:last-child { border-bottom: 0; }
.a-row .val { font-variant-numeric: tabular-nums; text-align: right; }
.a-row .why { grid-column: 1 / -1; color: var(--tertiary); font-size: 12px; }

.run-block { font-family: var(--sans); font-size: 13px; line-height: 1.45; display: grid; gap: 2px; }
.run-meta { display: flex; justify-content: space-between; color: var(--muted); font-variant-numeric: tabular-nums; margin: 6px 0 8px; }
.progress { height: 2px; background: var(--chip); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--ink); transition: width 0.3s linear; }

.d-verdict-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.d-verdict { font-size: 24px; margin: 0; font-weight: 400; }
.d-verdict[data-tone="fail"] { color: var(--fail); }
.d-verdict[data-tone="warn"] { color: var(--warn); }
.d-verdict[data-tone="pass"] { color: var(--pass); }
.d-headline { font-family: var(--serif); font-size: 15px; line-height: 1.65; margin: 14px 0 0; }
.claim { border-bottom: 1px solid var(--border); padding: 14px 0; }
.claim summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 100px minmax(0, 1fr) auto; gap: 12px; }
.claim summary::-webkit-details-marker { display: none; }
.claim .cstate[data-s="proved"], .claim .margin[data-s="proved"] { color: var(--pass); }
.claim .cstate[data-s="not_proved"], .claim .margin[data-s="not_proved"] { color: var(--fail); }
.claim .cstate[data-s="inconclusive"], .claim .margin[data-s="inconclusive"] { color: var(--warn); }
.claim .ctitle { font-weight: 600; }
.claim .csum { color: var(--muted); margin-top: 3px; }
.claim .margin { white-space: nowrap; font-variant-numeric: tabular-nums; }
.claim ul { margin: 8px 0 0 112px; padding: 0 0 0 14px; color: var(--tertiary); font-size: 12px; }
.claim li { margin: 3px 0; }
.fade-in { animation: fadein 0.45s ease both; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* --- the status bar ------------------------------------------------------------------ */
.statusbar {
  flex: none; height: var(--status-h); display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  border-top: 1px solid var(--border); font-size: 12px;
}
#status-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.status-end { display: flex; align-items: center; gap: 14px; flex: none; }
.live { width: 6px; height: 6px; border-radius: 50%; background: var(--pass); }
.link { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font-size: 12px; }

.dialog-back { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.dialog { background: var(--card); border: 1px solid var(--border2); border-radius: 12px; padding: 22px 24px; max-width: 460px; width: 100%; }
.dialog h2 { margin: 0 0 10px; font-size: 17px; font-weight: 600; }
.dialog p { color: var(--muted); margin: 0 0 10px; }
.dialog-foot { display: flex; gap: 10px; margin-top: 16px; }
.dialog-foot .btn { width: auto; flex: 1; }

/* --- narrower screens ------------------------------------------------------------ */
@media (max-width: 1360px) {
  :root { --dutch-w: 420px; --summary-w: 270px; }
  .crumbs { display: none; }
}
@media (max-width: 1100px) {
  :root { --dutch-w: 360px; }
  .replay-pill { display: none; }
  .menus { display: none; }
  .stages { position: static; transform: none; margin-left: 4px; }
  .vp-caption { left: 64px; transform: none; max-width: calc(100% - 180px); }
}
@media (max-width: 760px) {
  body { height: auto; min-height: 100vh; overflow: visible; }
  .titlebar { gap: 8px; }
  .lockup { height: 13px; }
  .stages { gap: 0; margin-left: 0; }
  .stage { padding: 0 6px; font-size: 13px; }
  .cta { padding: 4px 9px; font-size: 12.5px; }
  .shell { flex-direction: column; }
  .pane-dutch { width: auto; border-left: 0; border-top: 1px solid var(--border); }
  body.no-dutch .pane-dutch { display: flex; }
  .pane-ctl, .tab-x[data-act="dutchman"] { display: none; }
  .doc { flex-direction: column; }
  .viewport { flex: none; height: 62vh; }
  .summary { width: auto; border-right: 0; border-top: 1px solid var(--border); order: 2; overflow: visible; }
  body.summary-shut .summary { width: auto; padding: 14px 16px; }
  .collapse { display: none; }
  .home { padding: 32px 16px; }
  .welcome { margin: 8px 0 32px; }
  .dutchman { padding: 20px 16px 28px; overflow: visible; }
  .d-mark { margin-top: 12px; }
  .vp-tools { top: 8px; right: 8px; }
  .vp-caption { top: 12px; left: 56px; right: 112px; transform: none; max-width: none; white-space: normal; text-align: left; font-size: 12px; }
  .legend { bottom: 40px; right: 12px; }
  .legend-title { display: none; }
  .legend-bar { width: 90px; }
  .mode-bar { bottom: 104px; max-width: calc(100% - 24px); }
  .spot-card { top: auto; bottom: 8px; left: 8px; right: 8px; width: auto; max-height: 42%; padding: 12px 14px; }
  .run-strip { width: calc(100% - 140px); left: 70px; transform: none; }
  .proposed li, .claim summary { grid-template-columns: 1fr; gap: 2px; }
  .claim ul { margin-left: 0; }
  .statusbar { height: auto; padding-block: 6px; }
  .statusbar .link { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
body[data-tab="folders"] .pane-dutch { display: none; }
body[data-tab="folders"] .doc, body[data-tab="model"] .home { display: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.dot[data-tone="critical"] { background: var(--fail); } .dot[data-tone="warning"] { background: var(--warn); } .dot[data-tone="ok"] { background: var(--pass); }
body[data-tab="folders"] .pane-doc .pane-ctl { visibility: hidden; }
