/* Collabysis public site. Cyanotype Evolved (DESIGN.md). Evidence is the aesthetic:
   verified numbers look different from prose, and all routes use the three voices
   and the same restrained token set. */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden; /* the page body never scrolls sideways; wide blocks scroll inside */
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 560; line-height: 1.1; margin: 0; }
p { margin: 0; }
a { color: var(--structure); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }

/* Focus states - 2px structure outline, always visible (DESIGN.md line 80) */
:focus-visible {
  outline: 2px solid var(--structure);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
button:focus-visible, .btn:focus-visible { outline-offset: 3px; }

.skip-link {
  position: absolute; left: var(--sp-sm); top: -60px; z-index: 100;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--structure); border-radius: var(--r-sm);
  padding: var(--sp-sm) var(--sp-md); text-decoration: none;
  transition: top var(--dur-short) var(--ease-out);
}
.skip-link:focus { top: var(--sp-sm); }
@media (prefers-reduced-motion: reduce) { .skip-link { transition: none; } }
main[tabindex="-1"] { scroll-margin-top: 68px; }
main[tabindex="-1"]:focus-visible { outline: 2px solid var(--structure); outline-offset: -2px; }

.mono-label {
  font-family: var(--font-data);
  font-size: var(--fs-mono-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.num { font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.muted-cell { color: var(--muted); }
.noborder { border: 0; padding-top: 0; }

.wrap {
  width: 100%;
  max-width: var(--max-content);
  margin-inline: auto;
  padding-inline: var(--sp-lg);
}

/* ------------------------------------------------------------------ *
 * Top bar                                                            *
 * ------------------------------------------------------------------ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid var(--hairline);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-md);
  height: 60px;
}
.brand { display: flex; align-items: baseline; gap: var(--sp-sm); text-decoration: none; color: var(--ink); }
.brand .mark { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; letter-spacing: -0.01em; }
.brand .mark .dot { color: var(--accent); }
.brand .tag { font-family: var(--font-data); font-size: var(--fs-mono-label); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.topbar nav { display: flex; align-items: center; gap: var(--sp-lg); }
.topbar nav .navlink { color: var(--muted); text-decoration: none; font-size: var(--fs-small); font-weight: 500; }
.topbar nav .navlink:hover { color: var(--ink); }
.topbar nav .navlink[aria-current="page"] { color: var(--structure); text-decoration: underline; }
.nav-menu { display: none; position: relative; }
.nav-menu summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  color: var(--muted);
  cursor: pointer;
  font-size: var(--fs-small);
  font-weight: 600;
  list-style: none;
}
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary::after { content: "+"; margin-left: var(--sp-xs); font-family: var(--font-data); }
.nav-menu[open] summary::after { content: "−"; }
.nav-menu summary:hover,
.nav-menu summary:focus-visible { color: var(--ink); border-color: var(--structure); }
.nav-menu-panel {
  position: absolute;
  top: calc(100% + var(--sp-xs));
  right: 0;
  z-index: 70;
  display: grid;
  min-width: 190px;
  padding: var(--sp-xs);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.topbar .nav-menu-panel .navlink {
  display: block;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--ink);
}
.topbar .nav-menu-panel .navlink:hover { background: var(--surface-2); }
@media (max-width: 820px) {
  .topbar nav { gap: var(--sp-sm); }
  .topbar nav > .navlink { display: none; }
  .nav-menu { display: block; }
  .brand .tag, .theme-toggle .tt-label { display: none; }
}
@media (max-width: 520px) {
  .topbar-inner { gap: var(--sp-sm); }
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--muted);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  cursor: pointer;
  font-family: var(--font-data);
  font-size: var(--fs-mono-label);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  min-height: 44px;
  transition: color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out);
}
.theme-toggle:hover { color: var(--ink); border-color: var(--structure); }
@media (prefers-reduced-motion: reduce) { .theme-toggle { transition: none; } }

/* Buttons - solid inks only, no gradient CTAs (DESIGN.md line 25) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: var(--fs-small);
  border-radius: var(--r-md);
  padding: 12px 20px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  min-height: 44px;
  transition: transform var(--dur-micro) var(--ease-out),
              background var(--dur-short) var(--ease-move),
              border-color var(--dur-short) var(--ease-move),
              color var(--dur-short) var(--ease-move);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--action-bg); color: var(--action-fg); }
.btn-primary:hover { background: var(--action-hover-bg); color: var(--action-fg); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--hairline); }
.btn-secondary:hover { border-color: var(--structure); color: var(--structure); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary:disabled:hover { background: var(--action-bg); color: var(--action-fg); }
.btn-secondary:disabled:hover { background: transparent; border-color: var(--hairline); color: var(--ink); }
.btn:disabled:active { transform: none; }
.btn.is-disabled { opacity: 0.55; cursor: not-allowed; }
.btn.is-disabled:hover { background: var(--action-bg); }
.btn.is-disabled:active { transform: none; }
@media (prefers-reduced-motion: reduce) { .btn { transition: color var(--dur-short) var(--ease-move), background var(--dur-short) var(--ease-move), border-color var(--dur-short) var(--ease-move); } .btn:active { transform: none; } }

/* ------------------------------------------------------------------ *
 * Hero - the typeable moment. Split layout on a quiet paper wash.      *
 * ------------------------------------------------------------------ */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(var(--sp-2xl), 7vw, var(--sp-3xl));
  background: var(--structure-wash);
}
.hero-glow { display: none; }
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(var(--sp-xl), 4vw, var(--sp-3xl));
  align-items: center;
}
@media (max-width: 900px) { .hero-grid { grid-template-columns: minmax(0, 1fr); gap: var(--sp-2xl); } }
.hero-copy, .hero-product { min-width: 0; }

.eyebrow { display: inline-flex; align-items: center; gap: var(--sp-sm); margin-bottom: var(--sp-lg); }
.eyebrow .dotmark { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.hero h1 { font-size: var(--fs-display); letter-spacing: -0.015em; max-width: 15ch; }
.hero .subhead { margin-top: var(--sp-lg); font-size: 1.1rem; color: var(--muted); max-width: 52ch; line-height: 1.6; }
.hero .subhead strong { color: var(--ink); font-weight: 600; }

/* The ask box - the input is the primary interaction. */
.ask {
  margin-top: var(--sp-xl);
  display: flex;
  gap: var(--sp-sm);
  max-width: 44ch;
}
.ask-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  color: var(--ink);
  font-size: var(--fs-small);
  transition: border-color var(--dur-short) var(--ease-out), box-shadow var(--dur-short) var(--ease-out);
}
.ask-input::placeholder { color: var(--muted); }
.ask-input:focus-visible { outline: none; border-color: var(--structure); box-shadow: 0 0 0 2px color-mix(in srgb, var(--structure) 24%, transparent); }
.ask-input[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 2px color-mix(in srgb, var(--bad) 18%, transparent); }
.ask-input:disabled { opacity: 0.6; cursor: not-allowed; }
.ask-send { flex: none; padding-inline: 18px; }
.ask-send:disabled { opacity: 0.55; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .ask-input { transition: none; } }
.ask-hint { margin-top: var(--sp-sm); letter-spacing: 0.06em; }
.ask-validation { margin-top: var(--sp-sm); color: var(--bad); font-size: var(--fs-small); font-weight: 600; }
.ask-validation[hidden] { display: none; }

.chips { margin-top: var(--sp-lg); display: flex; flex-wrap: wrap; gap: var(--sp-sm); align-items: center; }
.chips-lead { flex-basis: 100%; margin-bottom: 2px; }
.engine-loading {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  min-height: 44px;
  padding: var(--sp-sm) var(--sp-md);
  border-left: 3px solid var(--structure);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: color-mix(in srgb, var(--structure) 8%, var(--surface));
  color: var(--muted);
  font-size: var(--fs-small);
  line-height: 1.45;
}
.engine-loading-indicator {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 2px solid var(--hairline);
  border-top-color: var(--structure);
  border-radius: 50%;
  animation: engine-loading-spin 0.9s linear infinite;
}
@keyframes engine-loading-spin { to { transform: rotate(360deg); } }
.chip {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  padding: 8px 11px;
  cursor: pointer;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--fs-small);
  line-height: 1.35;
  min-height: 44px;
  display: inline-flex;
  gap: var(--sp-sm);
  align-items: center;
  transition: border-color var(--dur-micro) var(--ease-out), background var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.chip:hover:not(:disabled) { border-color: var(--structure); background: var(--structure-wash); transform: translateY(-1px); }
.chip:disabled { opacity: 0.5; cursor: not-allowed; }
.chip[aria-disabled="true"] { opacity: 0.6; cursor: default; }
.chip .kind {
  font-family: var(--font-data);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--structure);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  padding: 2px 5px;
  flex: none;
  white-space: nowrap;
}
.chip.is-active { border-color: var(--structure); background: var(--structure-wash); }
@media (prefers-reduced-motion: reduce) {
  .engine-loading-indicator { animation: none; border-color: var(--structure); border-right-color: transparent; }
  .chip { transition: none; }
  .chip:hover:not(:disabled) { transform: none; }
}

.hero-actions { margin-top: var(--sp-xl); display: flex; flex-wrap: wrap; gap: var(--sp-md); align-items: center; }
.hero-trust {
  margin-top: var(--sp-lg);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm) var(--sp-lg);
  font-family: var(--font-data);
  font-size: var(--fs-mono-label);
  letter-spacing: 0.06em;
  color: var(--muted);
}
.hero-trust span { display: inline-flex; align-items: center; gap: 6px; }
.hero-trust .tick { color: var(--good); font-weight: 600; }
.boot-readout { margin-top: var(--sp-md); }

/* ------------------------------------------------------------------ *
 * The workbench product panel - the hero anchor, filled by the engine *
 * ------------------------------------------------------------------ */
.workbench {
  position: relative;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: box-shadow var(--dur-medium) var(--ease-out), border-color var(--dur-medium) var(--ease-out);
}
.workbench:hover { box-shadow: var(--shadow-soft), 0 0 0 1px color-mix(in srgb, var(--structure) 24%, transparent); }
.workbench[data-state="running"] { border-color: var(--structure); }
.workbench[data-state="failure"] { border-color: color-mix(in srgb, var(--bad) 58%, var(--hairline)); }
@media (prefers-reduced-motion: reduce) { .workbench { transition: none; } }
.wb-chrome {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-sm) var(--sp-md);
  border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--structure-wash) 60%, var(--surface));
}
.wb-dots { display: inline-flex; gap: 6px; flex: none; }
.wb-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--hairline); display: block; }
.wb-title { font-family: var(--font-data); font-size: var(--fs-mono-label); letter-spacing: 0.08em; color: var(--muted); }
.wb-title b { color: var(--ink); font-weight: 600; }
.wb-tabs { margin-left: auto; display: flex; gap: 2px; flex: none; }
.wb-tab { font-family: var(--font-ui); font-size: 0.72rem; font-weight: 600; color: var(--muted); padding: 4px 9px; border-radius: var(--r-sm); }
.wb-tab.active { color: var(--structure); background: var(--structure-wash); }
@media (max-width: 420px) { .wb-tabs { display: none; } }

.wb-body { display: grid; grid-template-columns: 148px minmax(0, 1fr); }

/* Left column: the dataset's columns */
.wb-cols { border-right: 1px solid var(--hairline); padding: var(--sp-md) var(--sp-sm); min-width: 0; background: var(--zebra); }
.wb-cols .col-head { padding: 0 var(--sp-sm) var(--sp-sm); }
.wb-cols .col-head .fname { font-family: var(--font-data); font-size: var(--fs-mono-label); color: var(--ink); letter-spacing: 0.02em; display: block; overflow: hidden; text-overflow: ellipsis; }
.wb-cols .col-head .frows { font-family: var(--font-data); font-size: 0.64rem; letter-spacing: 0.06em; color: var(--muted); }
.wb-cols ul { list-style: none; margin: var(--sp-xs) 0 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.wb-cols .col {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 5px var(--sp-sm); border-radius: var(--r-sm); min-width: 0;
  transition: background var(--dur-short) var(--ease-out), box-shadow var(--dur-short) var(--ease-out);
}
.wb-cols .col .cn { font-family: var(--font-data); font-size: 0.68rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-cols .col .ct { font-family: var(--font-data); font-size: 0.56rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--hairline); border-radius: 3px; padding: 1px 4px; flex: none; }
.wb-cols .col.sel { background: var(--structure-wash); box-shadow: inset 2px 0 0 var(--structure); }
.wb-cols .col.sel .cn { color: var(--structure); font-weight: 600; }
.wb-cols .col.sel .ct { color: var(--structure); border-color: color-mix(in srgb, var(--structure) 40%, var(--hairline)); }
.wb-cols .col.col-loading .cn { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .wb-cols .col { transition: none; } }
@media (max-width: 520px) {
  .wb-body { grid-template-columns: minmax(0, 1fr); }
  .wb-cols { border-right: 0; border-bottom: 1px solid var(--hairline); padding: 12px; }
  .wb-cols .col-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-sm); padding-inline: var(--sp-xs); }
  .wb-cols ul { flex-direction: row; gap: var(--sp-xs); overflow-x: auto; padding: 0 0 var(--sp-xs); }
  .wb-cols .col { flex: 0 0 auto; min-height: 34px; border: 1px solid var(--hairline); background: var(--surface); }
  .wb-cols .col .cn { max-width: 180px; }
}

/* Right column: the single live result surface */
.wb-result { padding: var(--sp-lg); min-width: 0; min-height: 300px; display: flex; flex-direction: column; gap: var(--sp-md); }
@media (max-width: 520px) { .wb-result { padding: var(--sp-md); } }
.wb-result:focus-visible { outline-offset: -4px; }
.wb-boot { display: flex; flex-direction: column; gap: var(--sp-md); }
.wb-result .ru-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-md); }
.wb-result .ru-head .mono-label { margin-top: 3px; }
.wb-result .finding { font-family: var(--font-display); font-size: var(--fs-h3); line-height: 1.28; color: var(--ink); max-width: 42ch; }
.wb-result .finding em { color: var(--structure); font-style: italic; }
.wb-finding-lead { font-size: var(--fs-h3); }

/* Small clean bar chart - indigo --structure, never accent */
.wb-chart { padding-top: var(--sp-xs); }
.wb-chart .chart-cap { margin-bottom: var(--sp-xs); }
.wb-chart svg { width: 100%; height: auto; display: block; }
.wb-chart .bar { fill: var(--structure); }
.wb-chart .grid { stroke: var(--hairline); stroke-width: 1; }
.wb-chart .axis-txt { font-family: var(--font-data); font-size: 9px; fill: var(--muted); }
.wb-chart .val-txt { font-family: var(--font-data); font-size: 10px; fill: var(--ink); font-weight: 600; }
.wb-chart .cat-txt { font-family: var(--font-data); font-size: 10px; fill: var(--muted); }

.wb-caption { margin-top: var(--sp-md); font-family: var(--font-data); font-size: var(--fs-mono-label); letter-spacing: 0.04em; color: var(--muted); }

/* Suggestion card - a typed question the router could not map. */
.result-unit.suggest .finding { font-size: var(--fs-body); font-family: var(--font-ui); color: var(--muted); }
.suggest-list { display: flex; flex-direction: column; gap: var(--sp-sm); }
.suggest-chip {
  text-align: left; background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-sm); padding: 9px 12px; cursor: pointer; color: var(--ink);
  font-family: var(--font-ui); font-size: var(--fs-small); display: flex; gap: var(--sp-sm); align-items: center;
  min-height: 44px;
  transition: border-color var(--dur-micro) var(--ease-out), background var(--dur-micro) var(--ease-out);
}
.suggest-chip:hover { border-color: var(--structure); background: var(--structure-wash); }
.suggest-chip .kind { font-family: var(--font-data); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--structure); border: 1px solid var(--hairline); border-radius: 3px; padding: 2px 5px; flex: none; }
@media (prefers-reduced-motion: reduce) { .suggest-chip { transition: none; } }

/* ------------------------------------------------------------------ *
 * Shared result-voice pieces (workbench panel + result unit)          *
 * ------------------------------------------------------------------ */
.stamp {
  flex: none;
  font-family: var(--font-data);
  font-size: var(--fs-mono-label);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 6px 10px;
  border: 2px solid var(--structure);
  border-radius: var(--r-sm);
  color: var(--structure);
  transform: rotate(-4deg);
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--structure) 8%, transparent);
  white-space: nowrap;
}
.stamp.validated { border-color: var(--good); color: var(--good); box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--good) 8%, transparent); }
.stamp.sig { border-color: var(--structure); color: var(--structure); }
.stamp.nonsig { border-color: var(--muted); color: var(--muted); box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--muted) 8%, transparent); }
.stamp-animate { animation: stamp-press var(--dur-medium) var(--ease-out) both; }
@keyframes stamp-press {
  0% { opacity: 0; transform: rotate(-14deg) scale(1.5); }
  60% { opacity: 1; transform: rotate(-2deg) scale(0.96); }
  100% { transform: rotate(-4deg) scale(1); }
}
@media (prefers-reduced-motion: reduce) { .stamp-animate { animation: none; } }

.apa-line {
  font-family: var(--font-data);
  font-size: var(--fs-data);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--structure-wash);
  border-left: 3px solid var(--structure);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: var(--sp-md);
  overflow-x: auto;
  white-space: nowrap;
}
.apa-line .apa-tag { color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.66rem; margin-right: var(--sp-sm); }

.provenance {
  font-family: var(--font-data);
  font-size: var(--fs-mono-label);
  letter-spacing: 0.03em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  flex-wrap: wrap;
}
.provenance.top-rule { border-top: 1px solid var(--hairline); padding-top: var(--sp-md); }
.provenance .glyph { color: var(--good); }
.provenance code { color: var(--ink); }
.compute-ms { color: var(--structure); }

.result-caveat {
  font-family: var(--font-ui);
  font-size: var(--fs-small);
  color: var(--muted);
  border-top: 1px solid var(--hairline);
  padding-top: var(--sp-md);
}
.result-caveat.warn { color: var(--warn); }
.analysis-question { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.analysis-state-copy { color: var(--muted); font-size: var(--fs-small); }
.workbench-recovery { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-md); }

/* ------------------------------------------------------------------ *
 * Section scaffolding                                                *
 * ------------------------------------------------------------------ */
section { padding-block: clamp(var(--sp-2xl), 6vw, var(--sp-3xl)); }
.section-head { max-width: var(--measure); margin-bottom: var(--sp-2xl); }
.section-head .kicker { margin-bottom: var(--sp-md); }
.section-head h2 { font-size: var(--fs-h2); letter-spacing: -0.01em; }
.section-head p { margin-top: var(--sp-md); color: var(--muted); }

/* ------------------------------------------------------------------ *
 * Live case - one result with its evidence ledger                     *
 * ------------------------------------------------------------------ */
.case { border-top: 1px solid var(--hairline); background: var(--surface); }
.case-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, .92fr);
  gap: var(--sp-lg);
  align-items: stretch;
}
.case-result,
.case-ledger {
  margin: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--bg);
  box-shadow: var(--shadow-soft);
}
.case-result { padding: var(--sp-xl); }
.case-finding {
  margin-top: var(--sp-lg);
  max-width: 34ch;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.6vw, 2.2rem);
  line-height: 1.25;
}
.case-finding strong { color: var(--structure); font-weight: 600; }
.case-apa {
  margin-top: var(--sp-lg);
  padding-top: var(--sp-md);
  border-top: 1px solid var(--hairline);
  color: var(--ink);
  font-size: var(--fs-data);
}
.case-caveat { margin-top: var(--sp-sm); color: var(--muted); font-size: var(--fs-small); }
.case-ledger { padding: var(--sp-sm) var(--sp-lg); }
.case-ledger > div {
  display: grid;
  grid-template-columns: minmax(92px, .35fr) minmax(0, .65fr);
  gap: var(--sp-md);
  padding: var(--sp-md) 0;
  border-bottom: 1px solid var(--hairline);
}
.case-ledger > div:last-child { border-bottom: 0; }
.case-ledger dt { color: var(--muted); font-size: var(--fs-small); }
.case-ledger dd { margin: 0; color: var(--ink); font-size: var(--fs-small); }
.case-methodology {
  margin-top: var(--sp-lg);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--bg);
  box-shadow: var(--shadow-soft);
}
.case-methodology summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-md);
  min-height: 52px;
  padding: var(--sp-md) var(--sp-lg);
  cursor: pointer;
  color: var(--ink);
  font-weight: 650;
}
.case-methodology summary::marker { color: var(--structure); }
.case-methodology-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-lg);
  padding: 0 var(--sp-lg) var(--sp-lg);
  border-top: 1px solid var(--hairline);
}
.case-methodology-body > div { padding-top: var(--sp-lg); }
.case-methodology-body h3 { font-size: var(--fs-small); margin-bottom: var(--sp-xs); }
.case-methodology-body p { color: var(--muted); font-size: var(--fs-small); line-height: 1.6; }
.case-methodology-body code { color: var(--ink); font-family: var(--font-data); }
.case-downloads {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-sm);
  margin-top: var(--sp-lg);
}
.case-run-link,
.download-release { color: var(--structure); font-size: var(--fs-small); }
@media (max-width: 820px) {
  .case-grid,
  .case-methodology-body { grid-template-columns: minmax(0, 1fr); }
  .case-methodology summary { align-items: flex-start; flex-direction: column; }
}

/* ------------------------------------------------------------------ *
 * How it works - numbered steps (a real sequence, so an ordered list)  *
 * ------------------------------------------------------------------ */
.how { border-top: 1px solid var(--hairline); }
.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-lg);
  counter-reset: step;
}
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-xl); } }
@media (max-width: 520px) { .steps { grid-template-columns: minmax(0, 1fr); } }
.step { min-width: 0; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--r-md);
  background: var(--structure-wash); color: var(--structure);
  font-family: var(--font-data); font-weight: 600; font-size: 1rem;
  border: 1px solid color-mix(in srgb, var(--structure) 30%, var(--hairline));
  margin-bottom: var(--sp-md);
}
.step h3 { font-size: var(--fs-h3); margin-bottom: var(--sp-sm); }
.step p { color: var(--muted); font-size: var(--fs-small); line-height: 1.55; max-width: 34ch; }

/* ------------------------------------------------------------------ *
 * Capabilities - a small accessible tabbed showcase                    *
 * ------------------------------------------------------------------ */
.caps { border-top: 1px solid var(--hairline); background: var(--bg); }
.tabs { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--surface); margin-bottom: var(--sp-xl); }
.tab {
  appearance: none; background: transparent; border: 0; cursor: pointer;
  font-family: var(--font-ui); font-weight: 600; font-size: var(--fs-small);
  color: var(--muted); padding: 8px 18px; border-radius: var(--r-sm);
  min-height: 44px;
  transition: background var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out);
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--structure-wash); color: var(--structure); }
@media (prefers-reduced-motion: reduce) { .tab { transition: none; } }

.cap-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(var(--sp-lg), 4vw, var(--sp-2xl)); align-items: start; }
@media (max-width: 820px) { .cap-grid { grid-template-columns: minmax(0, 1fr); gap: var(--sp-lg); } }
.cap-grid > * { min-width: 0; }
.cap-copy h3 { font-size: var(--fs-h2); margin-bottom: var(--sp-md); }
.cap-copy p { color: var(--muted); font-size: 1.02rem; line-height: 1.6; max-width: var(--measure); }
.cap-copy p + p { margin-top: var(--sp-md); }

.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
}
.panel-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-sm);
  padding: var(--sp-md) var(--sp-lg);
  border-bottom: 1px solid var(--hairline);
}
.panel-head h4 { font-size: 1rem; font-family: var(--font-ui); font-weight: 600; }

.cap-list { list-style: none; margin: 0; padding: var(--sp-sm) var(--sp-lg) var(--sp-md); }
.cap-list li { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-md); padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.cap-list li:last-child { border-bottom: 0; }
.cap-list .cl-k { font-family: var(--font-ui); font-weight: 600; font-size: var(--fs-small); color: var(--ink); }
.cap-list .cl-v { font-family: var(--font-data); font-size: var(--fs-mono-label); letter-spacing: 0.04em; color: var(--muted); text-align: right; }

/* Data-voice table (dataset preview + stat tables) */
/* position:relative keeps absolutely positioned descendants (the visually-hidden
   role-override labels) inside the scroller instead of widening the page. */
.data-table-scroll { position: relative; min-width: 0; max-width: 100%; overflow-x: auto; }
table.data-voice {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-data);
  font-size: var(--fs-data);
  font-variant-numeric: tabular-nums;
}
table.data-voice thead th {
  position: sticky; top: 0;
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
  font-size: var(--fs-mono-label);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  text-align: left;
  padding: var(--sp-sm) var(--sp-md);
  border-bottom: 2px solid var(--hairline);
  white-space: nowrap;
}
table.data-voice td {
  padding: 6px var(--sp-md);
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
  color: var(--ink);
}
table.data-voice td.num, table.data-voice th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data-voice td.cat { font-family: var(--font-ui); }
table.data-voice tbody tr:nth-child(even) td { background: var(--zebra); }
table.data-voice tbody tr:last-child td { border-bottom: 0; }
.preview-scroll { max-height: 300px; overflow: auto; }
.preview-foot {
  padding: var(--sp-sm) var(--sp-lg);
  border-top: 1px solid var(--hairline);
  font-family: var(--font-data);
  font-size: var(--fs-mono-label);
  color: var(--muted);
  letter-spacing: 0.04em;
}
/* Compact stat tables inside the workbench result surface. */
.wb-result table.data-voice thead th { position: static; padding: var(--sp-xs) var(--sp-sm); }
.wb-result table.data-voice td { padding: 6px var(--sp-sm); }
.wb-result table.data-voice tbody tr:nth-child(even) td { background: transparent; }

.result-unit { display: flex; flex-direction: column; gap: var(--sp-md); }
.result-unit .ru-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-md); }
.result-unit .ru-title { font-family: var(--font-ui); font-weight: 600; font-size: var(--fs-small); color: var(--muted); max-width: 40ch; }
.result-unit .finding { font-family: var(--font-display); font-size: var(--fs-h3); line-height: 1.28; color: var(--ink); max-width: 42ch; }
.result-unit .finding em { color: var(--structure); font-style: italic; }
.stat-block .block-label { margin-bottom: var(--sp-sm); }

/* Boot and run states use text plus a determinate runtime progress element. */
.boot { display: flex; flex-direction: column; gap: var(--sp-md); }
.boot .boot-line { display: flex; align-items: center; gap: var(--sp-md); font-family: var(--font-data); font-size: var(--fs-data); color: var(--muted); }
.boot .boot-line .ix { color: var(--structure); }
.boot .boot-line.done .ix { color: var(--good); }
.boot .boot-line.active { color: var(--ink); }
.boot-progress { width: 100%; height: 5px; appearance: none; border: 0; border-radius: 3px; overflow: hidden; background: var(--hairline); color: var(--structure); }
.boot-progress::-webkit-progress-bar { background: var(--hairline); }
.boot-progress::-webkit-progress-value { background: var(--structure); }
.boot-progress::-moz-progress-bar { background: var(--structure); }
.boot .cursor { display: inline-block; width: 8px; height: 1.05em; background: var(--accent); margin-left: 2px; vertical-align: text-bottom; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .boot .cursor { animation: none; } }
.wb-result .boot { padding: 0; }

/* ------------------------------------------------------------------ *
 * Browser analysis workbench                                         *
 * ------------------------------------------------------------------ */
.browser-workbench {
  padding-block: var(--sp-2xl);
  border-top: 1px solid var(--hairline);
  background: var(--surface-2);
}
.workbench-section-head { max-width: 720px; margin-bottom: var(--sp-xl); }
.workbench-section-head h2 { margin-top: var(--sp-xs); font-size: var(--fs-h2); }
.workbench-section-head p { margin-top: var(--sp-sm); color: var(--muted); }
.workbench-access-note {
  display: grid;
  gap: var(--sp-xs);
  margin-top: var(--sp-lg);
  padding: var(--sp-md) var(--sp-lg);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--structure);
  border-radius: var(--r-md);
  background: var(--surface);
}
.workbench-access-note p { margin: 0; font-size: var(--fs-small); line-height: 1.55; }
.workbench-access-note strong { color: var(--ink); }
.browser-workbench-shell {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.workbench-route-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-md);
  border-bottom: 1px solid var(--hairline);
  background: var(--bg);
}
.workbench-route-tabs {
  display: flex;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}
.workbench-route-tab {
  flex: 0 0 auto;
  min-height: 52px;
  padding: 15px var(--sp-lg) 12px;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-size: var(--fs-small);
  font-weight: 650;
  text-decoration: none;
}
.workbench-route-tab[aria-selected="true"] {
  border-bottom-color: var(--accent);
  color: var(--ink);
  background: var(--surface);
}
.workbench-step { padding-right: var(--sp-lg); white-space: nowrap; }
.workbench-route-panel {
  min-width: 0;
  padding: var(--sp-xl);
}
.workbench-route-panel[hidden] { display: none; }
.workbench-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-md);
  margin-bottom: var(--sp-lg);
}
.workbench-panel-heading h3 { margin-top: 3px; font-size: var(--fs-h2); }
.workbench-session-note,
.workbench-local-note,
.workbench-message,
.workbench-error {
  margin-bottom: var(--sp-md);
  padding: var(--sp-sm) var(--sp-md);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  background: var(--structure-wash);
  font-size: var(--fs-small);
}
.workbench-session-note { margin: var(--sp-md) var(--sp-xl) 0; color: var(--structure); }
.workbench-error { border-color: var(--danger, #a33); background: color-mix(in srgb, #b64040 9%, var(--surface)); }
.workbench-fieldset {
  min-width: 0;
  margin: var(--sp-lg) 0;
  padding: var(--sp-lg);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
}
.workbench-fieldset legend { padding-inline: var(--sp-xs); font-weight: 650; }
.source-picker { display: flex; flex-wrap: wrap; gap: var(--sp-md) var(--sp-xl); }
.source-picker label,
.checkbox-line { display: inline-flex; align-items: center; gap: var(--sp-xs); }
.csv-import-controls { display: grid; gap: var(--sp-sm); margin-block: var(--sp-lg); }
.storage-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-sm) var(--sp-lg);
  margin-block: var(--sp-md);
}
.storage-controls .button-link { margin-left: auto; }
.csv-drop-zone {
  display: grid;
  place-items: center;
  min-height: 132px;
  padding: var(--sp-lg);
  border: 2px dashed var(--structure);
  border-radius: var(--r-md);
  background: var(--structure-wash);
  text-align: center;
  cursor: pointer;
}
.csv-drop-zone span { color: var(--muted); font-size: var(--fs-small); }
.csv-drop-zone.is-dragging { border-color: var(--accent); background: var(--surface); }
.workbench-progress { width: 100%; accent-color: var(--structure); }
.dataset-summary { margin-bottom: var(--sp-sm); font-weight: 600; }
.workbench-data-table { width: 100%; min-width: 760px; }
.workbench-data-table select { min-width: 140px; }
.workbench-data-table td { white-space: normal; overflow-wrap: anywhere; }
.workbench-example-cell { max-width: 22rem; overflow-wrap: anywhere; }
.field-help { color: var(--muted); font-size: var(--fs-small); }
.dataset-profile > .field-help { margin-top: var(--sp-sm); }

.workbench-route-panel label:not(.checkbox-line):not(.csv-drop-zone) {
  display: block;
  margin-top: var(--sp-md);
  margin-bottom: var(--sp-xs);
  font-weight: 600;
}
.workbench-route-panel input[type="text"],
.workbench-route-panel input[type="file"],
.workbench-route-panel select,
.workbench-route-panel textarea {
  max-width: 100%;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--ink);
}
.workbench-route-panel input[type="text"],
.workbench-route-panel select,
.workbench-route-panel textarea { width: 100%; padding: 10px 12px; }
.workbench-route-panel textarea { resize: vertical; }
.workbench-route-panel select[multiple] { min-height: 132px; }
.workbench-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-sm); margin-block: var(--sp-lg); }
.button-link {
  min-height: 44px;
  padding: 8px;
  border: 0;
  background: transparent;
  color: var(--structure);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.question-proposal,
.method-picker,
.analysis-result,
.package-contents {
  margin-top: var(--sp-lg);
  padding: var(--sp-lg);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--bg);
}
.question-proposal p { margin-top: var(--sp-sm); }
.workbench-suggestions { display: grid; gap: var(--sp-sm); margin-top: var(--sp-sm); }
.workbench-suggestions button { text-align: left; }
.method-params,
.methodology-grid,
.filter-grid,
.transformation-controls { display: grid; grid-template-columns: minmax(170px, 0.34fr) minmax(0, 1fr); gap: var(--sp-sm) var(--sp-lg); align-items: start; }
.method-params label,
.methodology-grid > label,
.filter-grid label,
.transformation-controls label { margin: 10px 0 0 !important; }
.methodology-grid .field-help,
.methodology-span { grid-column: 1 / -1; }
.filter-grid + .filter-grid { margin-top: var(--sp-lg); padding-top: var(--sp-lg); border-top: 1px solid var(--hairline); }
.transformation-controls > div { display: contents; }
.method-fit { margin-top: var(--sp-sm); font-family: var(--font-data); font-size: var(--fs-small); }
.fit-recommended { color: var(--good); }
.fit-possible { color: var(--structure); }
.fit-not-recommended { color: var(--danger, #a33); }
.fit-badge { display: inline-block; margin-left: var(--sp-xs); font-family: var(--font-data); font-size: var(--fs-mono-label); }
.method-catalog-details { margin-top: var(--sp-lg); }
.method-catalog { columns: 2; padding-left: var(--sp-lg); }
.method-catalog li { break-inside: avoid; margin-bottom: var(--sp-xs); }
.method-catalog button { width: 100%; padding: var(--sp-sm); border: 1px solid var(--hairline); border-radius: var(--r-sm); background: var(--bg); color: var(--ink); text-align: left; cursor: pointer; }
.method-catalog small { display: block; margin-top: 3px; color: var(--muted); }
#methodology-preview { max-height: 420px; overflow: auto; padding: var(--sp-lg); background: var(--bg); white-space: pre-wrap; }

.analysis-result > h4 { font-size: var(--fs-h2); }
.result-comparison { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: var(--sp-lg); margin-top: var(--sp-md); }
.result-primary { min-width: 0; }
.result-section.sensitivity-result { margin-top: 0; padding: var(--sp-lg); border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--structure-wash); }
.result-interpretation { margin-top: var(--sp-sm); }
.result-statistics { width: 100%; margin-top: var(--sp-lg); }
.result-statistics th { text-align: left; }
.result-evidence,
.result-caveat { margin-top: var(--sp-md); }
.result-evidence[hidden] { display: none; }
.result-evidence h5 { margin: 0 0 var(--sp-sm); font-family: var(--font-display); font-size: var(--fs-body); }
.result-evidence-list { display: grid; gap: var(--sp-xs); margin: 0; }
.result-evidence-list > div { display: flex; justify-content: space-between; gap: var(--sp-lg); }
.result-evidence-list dt { font-weight: 650; }
.result-evidence-list dd { margin: 0; font-family: var(--font-data); text-align: right; }
.result-section { margin-top: var(--sp-xl); padding-top: var(--sp-lg); border-top: 1px solid var(--hairline); }
.result-section h5 { margin: 0 0 var(--sp-md); font-family: var(--font-display); font-size: var(--fs-h3); }
.result-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: var(--sp-lg); }
.result-charts figure { min-width: 0; margin: 0; overflow-x: auto; padding: var(--sp-sm); border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--surface); }
.result-charts canvas,
.result-charts svg { display: block; max-width: 100%; height: auto; }
.provenance-panel dl { display: grid; grid-template-columns: minmax(150px, 0.3fr) minmax(0, 1fr); gap: var(--sp-xs) var(--sp-lg); }
.provenance-panel dt { font-weight: 650; }
.provenance-panel dd { min-width: 0; margin: 0; overflow-wrap: anywhere; font-family: var(--font-data); font-size: var(--fs-small); }
.package-contents ul { padding-left: var(--sp-lg); }

@media (max-width: 680px) {
  .workbench-access-note { padding: var(--sp-md); }
  .workbench-route-panel { padding: var(--sp-lg); }
  .workbench-session-note { margin-inline: var(--sp-lg); }
  .workbench-route-head { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .workbench-step { padding: var(--sp-xs) var(--sp-lg); border-top: 1px solid var(--hairline); }
  .workbench-route-tab { padding-inline: var(--sp-md); }
  .method-params,
  .methodology-grid,
  .filter-grid,
  .transformation-controls,
  .provenance-panel dl { grid-template-columns: minmax(0, 1fr); }
  .methodology-grid .field-help,
  .methodology-span { grid-column: auto; }
  .method-catalog { columns: 1; }
}
@media (max-width: 400px) {
  .browser-workbench .wrap { padding-inline: var(--sp-sm); }
  .workbench-route-panel { padding: var(--sp-md); }
  .workbench-session-note { margin-inline: var(--sp-md); }
  .workbench-panel-heading { align-items: stretch; flex-direction: column; }
  .workbench-panel-heading .btn { width: 100%; }
  .workbench-fieldset,
  .question-proposal,
  .method-picker,
  .analysis-result,
  .package-contents { padding: var(--sp-md); }
}

/* ------------------------------------------------------------------ *
 * Trust / proof - tier cards + factual comparison                     *
 * ------------------------------------------------------------------ */
.trust { border-top: 1px solid var(--hairline); }
.tier-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-lg); margin-bottom: var(--sp-2xl); }
@media (max-width: 820px) { .tier-grid { grid-template-columns: minmax(0, 1fr); gap: var(--sp-md); } }
.tier {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
  padding: var(--sp-lg);
  display: flex; flex-direction: column; gap: var(--sp-sm);
}
.tier .stamp { align-self: flex-start; margin-bottom: var(--sp-xs); }
.tier h3 { font-size: var(--fs-h3); }
.tier p { color: var(--muted); font-size: var(--fs-small); line-height: 1.55; }

.cmp-head { margin-bottom: var(--sp-md); }
.cmp-head h3 { font-size: var(--fs-h3); }
.cmp-head p { margin-top: var(--sp-xs); }
.cmp-scroll { overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-soft); }
table.cmp { width: 100%; border-collapse: collapse; min-width: 560px; }
table.cmp thead th { text-align: left; padding: var(--sp-md) var(--sp-lg); border-bottom: 1px solid var(--hairline); vertical-align: bottom; }
table.cmp thead th .h-lab { font-family: var(--font-ui); font-weight: 600; font-size: var(--fs-small); }
table.cmp thead th.us .h-lab { color: var(--structure); }
table.cmp thead th .h-sub { display: block; font-family: var(--font-data); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
table.cmp tbody th {
  text-align: left; font-family: var(--font-ui); font-weight: 500; font-size: var(--fs-small);
  color: var(--ink); padding: var(--sp-md) var(--sp-lg); border-bottom: 1px solid var(--hairline); vertical-align: top;
}
table.cmp tbody th .cap { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 400; margin-top: 2px; }
table.cmp td {
  padding: var(--sp-md) var(--sp-lg); border-bottom: 1px solid var(--hairline);
  font-family: var(--font-data); font-size: var(--fs-data); font-variant-numeric: tabular-nums;
  color: var(--muted); vertical-align: top; white-space: nowrap;
}
table.cmp td.us { color: var(--ink); background: color-mix(in srgb, var(--structure-wash) 55%, transparent); }
table.cmp td .yes { color: var(--good); font-weight: 600; }
table.cmp td .metric { color: var(--good); font-weight: 600; }
table.cmp td .sub { display: block; font-size: 0.62rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
table.cmp tbody tr:last-child th, table.cmp tbody tr:last-child td { border-bottom: 0; }

/* ------------------------------------------------------------------ *
 * Download                                                           *
 * ------------------------------------------------------------------ */
.download { background: var(--structure-wash); border-top: 1px solid var(--hairline); }
.download-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-xl); }
.download-card > div { min-width: 0; }
.download-card h2 { font-size: var(--fs-h2); max-width: 20ch; letter-spacing: -0.01em; }
.download-card p { color: var(--muted); margin-top: var(--sp-sm); max-width: 48ch; }
.download-meta { display: flex; flex-wrap: wrap; gap: var(--sp-sm) var(--sp-lg); margin-top: var(--sp-md); font-family: var(--font-data); font-size: var(--fs-mono-label); letter-spacing: 0.06em; color: var(--muted); }
.download-meta span { display: inline-flex; align-items: center; gap: 6px; }
.download-meta .tick { color: var(--good); font-weight: 600; }
.download-note { font-family: var(--font-data); font-size: var(--fs-mono-label); color: var(--muted); letter-spacing: 0.04em; margin-top: var(--sp-md); }
.download-actions { display: flex; flex-direction: column; gap: var(--sp-sm); }
.download-release { text-align: center; }
.download-page .section-head { max-width: 720px; }
.download-grid { margin-top: var(--sp-xl); }
.download-option {
  min-width: 0;
  margin: 0;
  padding: var(--sp-xl);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--bg);
  box-shadow: var(--shadow-soft);
}
.download-option-primary { border-color: color-mix(in srgb, var(--accent) 42%, var(--hairline)); }
.download-option h2 { margin-top: var(--sp-xs); font-size: var(--fs-h3); }
.download-option p { margin-top: var(--sp-md); }
.download-option .btn { width: fit-content; max-width: 100%; }
.download-checksum {
  padding: var(--sp-sm);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--structure);
  font-size: var(--fs-small);
  line-height: 1.6;
  overflow-wrap: anywhere;
  word-break: break-all;
}
.download-page .case-grid + .section-head { margin-top: var(--sp-2xl); }
.download-page h1 { font-size: clamp(2.1rem, 1.45rem + 2.5vw, 3rem); letter-spacing: -0.015em; }
.download-cautions p + p { margin-top: var(--sp-md); }
.checksum-block { margin-top: var(--sp-lg); }
.checksum-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: var(--sp-sm);
  margin-top: var(--sp-sm);
}
.checksum-row code {
  min-width: 0;
  padding: var(--sp-sm);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--structure);
  font-family: var(--font-data);
  font-size: var(--fs-data);
  line-height: 1.6;
  overflow-wrap: anywhere;
  word-break: break-all;
  user-select: text;
}
.checksum-copy { padding-inline: 14px; white-space: nowrap; }
.copy-status { min-height: 1.5em; margin-top: var(--sp-sm) !important; text-transform: none; letter-spacing: 0.03em; }
.clipboard-proxy { position: fixed; left: -10000px; top: 0; width: 1px; height: 1px; opacity: 0; }

/* ------------------------------------------------------------------ *
 * Missing route                                                      *
 * ------------------------------------------------------------------ */
.not-found { min-height: calc(100vh - 60px); display: grid; align-items: center; background: var(--structure-wash); }
.not-found-inner { max-width: 760px; }
.not-found .kicker { margin-bottom: var(--sp-md); }
.not-found h1 { font-size: clamp(2.2rem, 1.4rem + 3.5vw, 3.4rem); max-width: 18ch; letter-spacing: -0.015em; }
.not-found p { margin-top: var(--sp-lg); color: var(--muted); max-width: 56ch; font-size: 1.05rem; }
.not-found-actions { display: flex; flex-wrap: wrap; gap: var(--sp-md); margin-top: var(--sp-xl); }

/* ------------------------------------------------------------------ *
 * FAQ - expandable native details/summary                             *
 * ------------------------------------------------------------------ */
.faq { border-top: 1px solid var(--hairline); }
.faq-list { max-width: 760px; }
.faq-item { border-bottom: 1px solid var(--hairline); }
.faq-item summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-md);
  padding: var(--sp-lg) 0;
  font-family: var(--font-display); font-weight: 560; font-size: var(--fs-h3); color: var(--ink);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; flex: none;
  font-family: var(--font-data); font-weight: 400; color: var(--structure); font-size: 1.4rem; line-height: 1;
  transition: transform var(--dur-short) var(--ease-out);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) { .faq-item summary::after { transition: none; } }
.faq-item p { color: var(--muted); font-size: 1.02rem; line-height: 1.62; max-width: var(--measure); padding-bottom: var(--sp-lg); }

/* ------------------------------------------------------------------ *
 * Legal document pages                                               *
 * ------------------------------------------------------------------ */
.legal-page { min-height: 100vh; background: var(--bg); }
.legal-document {
  width: 100%;
  max-width: 78ch;
  margin-inline: auto;
  padding: clamp(var(--sp-lg), 4vw, var(--sp-2xl));
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  overflow-wrap: anywhere;
}
.legal-document h1 { font-size: var(--fs-h2); }
.legal-document h2 { margin-top: var(--sp-xl); font-size: var(--fs-h3); }
.legal-document p,
.legal-document li { line-height: 1.7; }
.legal-document p,
.legal-document ul,
.legal-document ol,
.legal-document pre { margin-block: var(--sp-md) 0; }
.legal-document ul,
.legal-document ol { padding-inline-start: var(--sp-xl); }
pre.legal-document,
.legal-document pre {
  max-width: 100%;
  margin-block: 0;
  padding: var(--sp-md);
  overflow-x: auto;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-data);
  font-size: var(--fs-small);
  line-height: 1.65;
  white-space: pre-wrap;
}
.legal-source-link {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-xs);
  min-height: 44px;
  margin-top: var(--sp-lg);
  color: var(--structure);
  font-size: var(--fs-small);
  font-weight: 650;
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .legal-page { padding-block: var(--sp-lg); }
  .legal-document { padding: var(--sp-lg); border-radius: var(--r-md); }
}

/* ------------------------------------------------------------------ *
 * Footer                                                             *
 * ------------------------------------------------------------------ */
footer { border-top: 1px solid var(--hairline); padding-block: var(--sp-2xl); }
.footer-inner { display: flex; flex-wrap: wrap; gap: var(--sp-lg); justify-content: space-between; align-items: flex-start; }
footer .brand .mark { font-size: 1.1rem; }
footer small { color: var(--muted); font-size: var(--fs-small); max-width: 62ch; display: block; margin-top: var(--sp-sm); }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--sp-lg); font-size: var(--fs-small); }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--ink); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Release update banner. Fixed positioning keeps the workbench layout stable. */
.update-banner {
  position: fixed;
  left: 50%;
  bottom: var(--sp-lg);
  z-index: 120;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-md) var(--sp-lg);
  width: min(92vw, 720px);
  padding: var(--sp-md) var(--sp-lg);
  border: 1px solid var(--structure);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  transform: translateX(-50%);
}
.update-banner[hidden],
.update-banner [hidden] { display: none; }
.update-banner p { font-weight: 600; }
.update-banner-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-sm); }
.update-banner button:focus-visible { outline: 3px solid var(--structure); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .browser-workbench,
  .browser-workbench *,
  .browser-workbench *::before,
  .browser-workbench *::after,
  .update-banner,
  .update-banner *,
  .update-banner *::before,
  .update-banner *::after {
    animation: none !important;
    transition: none !important;
  }
}
@media (max-width: 600px) {
  .update-banner { grid-template-columns: minmax(0, 1fr); bottom: var(--sp-md); }
  .update-banner-actions { justify-content: flex-start; }
}

/* Small-screen density */
@media (max-width: 480px) {
  .wrap { padding-inline: var(--sp-md); }
  table.data-voice td, table.data-voice thead th { padding-inline: var(--sp-sm); }
  .ask { max-width: none; flex-wrap: wrap; }
  .ask-input { flex-basis: 240px; }
  .ask-send { flex: 1 1 auto; }
  .mono-label,
  .hero-trust,
  .boot-readout,
  .wb-caption,
  .provenance,
  .download-meta,
  .download-note,
  .preview-foot { font-size: 0.76rem; line-height: 1.5; }
  .chip .kind, .suggest-chip .kind { font-size: 0.7rem; }
  .wb-cols .col .cn { font-size: 0.73rem; }
  .wb-cols .col .ct { font-size: 0.65rem; }
  .checksum-row { grid-template-columns: minmax(0, 1fr); }
  .checksum-copy { width: 100% !important; }
  .download-option { padding: var(--sp-lg); }
}
