/* Components. All colour comes from tokens.css. No raw hex here. */

/* Self-hosted so the demo works offline. uig.com uses ES Allianz, a licensed
 * face we do not ship; Inter is the substitute. See BUILD_CONTEXT.md. */
@font-face {
  font-family: "Inter";
  src: url("inter-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: var(--t-base)/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; }
h1, h2, h3, h4 { margin: 0 0 var(--s3); line-height: 1.22; font-weight: 600; }
h1 { font-size: var(--t-xl); letter-spacing: var(--track-tight); font-weight: 700; }
h2 { font-size: var(--t-lg); letter-spacing: var(--track-tight); }
h3 { font-size: var(--t-base); }
/* h4 is the eyebrow above a card heading. It names the source or the
 * kind of thing, so the heading itself does not have to. */
h4 {
  font-size: var(--t-xs); text-transform: uppercase; letter-spacing: var(--track-eyebrow);
  color: var(--ink-3); font-weight: 500; margin-bottom: var(--s1);
}
p  { margin: 0 0 var(--s3); }
.muted { color: var(--ink-3); }
.hint  { color: var(--ink-3); font-size: var(--t-sm); margin-bottom: 0; }
.lede  { font-size: var(--t-base); color: var(--ink-2); }

/* ---------- chrome ----------
 * The brand lives here. The working canvas below stays light. */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s5);
  padding: var(--s3) var(--s6);
  background: var(--brand); color: var(--on-brand);
}
.brand { display: flex; align-items: center; gap: var(--s4); min-width: 0; }
.brand-logo { height: 32px; width: auto; flex: none; }
.brand-rule { width: 1px; height: 28px; background: rgba(231, 231, 231, .28); flex: none; }
.top-l h1 { color: var(--on-brand); margin: 0; font-size: var(--t-lg); }
.top-l p {
  margin: 2px 0 0; color: var(--on-brand-dim); font-size: var(--t-xs);
  text-transform: uppercase; letter-spacing: var(--track-eyebrow); font-weight: 400;
}
.top-r { display: flex; align-items: center; gap: var(--s3); }
.packsel {
  padding: var(--s2) var(--s3); border: 1px solid rgba(231, 231, 231, .3);
  border-radius: var(--radius); background: var(--brand-deep); color: var(--on-brand);
  max-width: 380px; font-size: var(--t-sm);
}
.packsel:focus { outline: 2px solid var(--accent-bright); outline-offset: 1px; }
.btn-chrome {
  background: none; border-color: rgba(231, 231, 231, .3); color: var(--on-brand-dim);
  white-space: nowrap;
}
.btn-chrome:hover:not([disabled]) { border-color: var(--accent-bright); color: var(--on-brand); }
.btn-chrome[aria-pressed="true"] {
  background: var(--accent-bright); border-color: var(--accent-bright); color: var(--brand-deep);
  font-weight: 600;
}

/* ---------- act stepper ----------
 * Three acts, not six equal tabs. The room needs to know where it is in
 * the story, and the story has a shape. */
.acts {
  display: flex; gap: 0; padding: 0 var(--s6);
  background: var(--brand-deep);
}
.act {
  border: 0; background: none; cursor: pointer; text-align: left;
  padding: var(--s3) var(--s5) var(--s3) var(--s4);
  border-bottom: 3px solid transparent;
  display: grid; grid-template-columns: auto 1fr; column-gap: var(--s3);
  align-items: baseline; position: relative;
  transition: background var(--dur-1) var(--ease);
}
.act + .act::before {
  content: ""; position: absolute; left: 0; top: 22%; height: 56%;
  width: 1px; background: rgba(231, 231, 231, .16);
}
.act-n {
  grid-row: 1 / span 2; align-self: center;
  font-size: var(--t-xs); text-transform: uppercase; letter-spacing: var(--track-eyebrow);
  color: var(--on-brand-dim); font-variant-numeric: tabular-nums;
}
.act-l { color: var(--on-brand-dim); font-size: var(--t-sm); font-weight: 600; }
.act-s {
  grid-column: 2; color: var(--on-brand-dim); font-size: var(--t-xs); opacity: .72;
}
.act:hover { background: rgba(231, 231, 231, .06); }
.act:hover .act-l, .act:hover .act-n { color: var(--on-brand); }
.act-on { border-bottom-color: var(--accent-bright); background: rgba(231, 231, 231, .07); }
.act-on .act-l, .act-on .act-n { color: var(--on-brand); }
.act-on .act-n { font-weight: 600; }

.subtabs {
  display: flex; gap: var(--s1); padding: var(--s2) var(--s6) 0;
  background: var(--brand-slate);
}
.subtab {
  border: 0; background: none; color: var(--on-brand-dim); cursor: pointer;
  padding: var(--s2) var(--s4); border-radius: var(--radius) var(--radius) 0 0;
  font-size: var(--t-sm);
}
.subtab:hover { color: var(--on-brand); background: rgba(231, 231, 231, .07); }
.subtab-on { color: var(--ink); background: var(--bg); font-weight: 600; }

.presenter {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s2) var(--s6);
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: var(--s2) var(--s3); border-radius: var(--radius); cursor: pointer;
  font-size: var(--t-sm); display: inline-flex; align-items: center; gap: 6px;
  transition: border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.btn:hover:not([disabled]) { border-color: var(--accent); color: var(--accent-text); }
.btn[disabled] { opacity: .4; cursor: default; }
.btn-ghost { background: none; }
.btn.sm, .cite-btn.sm { padding: var(--s1) var(--s2); font-size: var(--t-xs); }
.ic { width: 12px; height: 12px; fill: currentColor; stroke: currentColor; flex: none; }

/* Segmented run indicator. The room can see how long the run is before
 * it starts, which a bar cannot show. */
.pips { flex: 1; display: flex; gap: 3px; align-items: center; }
.pip {
  flex: 1; height: 5px; border-radius: 3px; background: var(--line-soft);
  transition: background var(--dur-2) var(--ease);
}
.pip-on { background: var(--accent-bright); }
.pip-live { background: var(--accent); }
.prog-t { font-size: var(--t-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; }

.main { padding: var(--s5) var(--s6) var(--s6); max-width: 1320px; margin: 0 auto; }
.foot {
  padding: var(--s5) var(--s6);
  background: var(--brand-slate); color: var(--on-brand-dim); font-size: var(--t-xs);
}
.foot-in { max-width: 1320px; margin: 0 auto; display: flex; gap: var(--s5); align-items: flex-start; }
.foot-logo { height: 24px; width: auto; flex: none; opacity: .75; }
.foot b { color: var(--on-brand); }

/* ---------- cards and the weight ladder ----------
 * elev-0 supports, elev-1 is an ordinary card, elev-2 is the one object
 * on the screen that carries the point. */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--s4) var(--s5);
  margin-bottom: var(--s4);
  box-shadow: var(--elev-1);
}
.card-hero {
  box-shadow: var(--elev-2); border-color: var(--line-strong);
  border-radius: var(--radius-lg); padding: var(--s5);
}
.card-hero > h2 { font-size: var(--t-2xl); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.card-flag { border-left: 3px solid var(--accent); }
.card-clock { border-left: 3px solid var(--risk); }
.card-warn  { background: var(--warn-fill); border-color: var(--warn); box-shadow: var(--elev-0); }
.card-warn h3 { color: var(--warn-text); }
.card-warn p  { color: var(--warn-text); }
.warnline { font-size: var(--t-sm); }
.card-start { text-align: left; }

.kvlist { display: grid; grid-template-columns: 132px 1fr; gap: var(--s1) var(--s4); margin: 0 0 var(--s4); }
.kvlist dt { color: var(--ink-3); font-size: var(--t-sm); }
.kvlist dd { margin: 0; font-size: var(--t-sm); }

/* ---------- hero numerals ----------
 * The three or four numbers that carry the argument. Nothing else may
 * use this size. Figures are tabular so a pack switch does not shuffle
 * the layout. */
.statrow {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--s3); margin-bottom: var(--s4);
}
.stat {
  background: var(--panel); border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: var(--radius); padding: var(--s3) var(--s4) var(--s4);
  box-shadow: var(--elev-1);
}
.stat-n {
  display: block; font-size: var(--t-hero); line-height: 1;
  letter-spacing: var(--track-num); font-weight: 700;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.stat-u { font-size: .42em; font-weight: 600; letter-spacing: 0; margin-left: 2px; }
.stat-l {
  display: block; margin-top: var(--s2);
  font-size: var(--t-sm); color: var(--ink-2); line-height: 1.35;
}
.stat-note {
  display: block; margin-top: var(--s1);
  font-size: var(--t-xs); color: var(--ink-3);
}
.stat-risk { border-left-color: var(--risk); background: var(--risk-wash); }
.stat-risk .stat-n, .stat-risk .stat-l { color: var(--risk-text); }
.stat-warn { border-left-color: var(--warn); }
.stat-warn .stat-n { color: var(--warn-text); }
.stat-ok   { border-left-color: var(--ok); }
.stat-ok   .stat-n { color: var(--ok-text); }
/* The pour is the point of no return. Green is the brand now, so the
 * heaviest treatment in the set carries it instead. */
.stat-stop { border-left-color: var(--brand-slate); background: var(--brand-slate); border-color: var(--brand-slate); }
.stat-stop .stat-n { color: var(--ink-invert); }
.stat-stop .stat-l { color: var(--on-brand); }
.stat-stop .stat-note { color: var(--on-brand-dim); }
/* inside a card, the numbers step down a notch */
.statrow-sm { margin-bottom: 0; gap: var(--s2); grid-template-columns: 1fr 1fr; }
.statrow-sm .stat { box-shadow: var(--elev-0); padding: var(--s2) var(--s3) var(--s3); }
.statrow-sm .stat-n { font-size: var(--t-3xl); }

/* ---------- document list ---------- */
.docs { display: grid; gap: var(--s1); }
.doc {
  display: grid; grid-template-columns: 74px 1fr auto; grid-template-rows: auto auto;
  gap: 0 var(--s3); text-align: left; cursor: pointer; align-items: center;
  border: 1px solid var(--line); background: var(--panel-2);
  border-radius: var(--radius); padding: var(--s2) var(--s3);
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.doc:hover { border-color: var(--accent); background: var(--accent-fill); }
.doc-kind {
  grid-row: 1 / span 2; align-self: center;
  font-size: var(--t-xs); color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em;
}
.doc-name { grid-column: 2; grid-row: 1; font-weight: 600; font-size: var(--t-sm); }
.doc-sub  { grid-column: 2; grid-row: 2; font-size: var(--t-xs); color: var(--ink-3); }
.doc-go {
  grid-column: 3; grid-row: 1 / span 2; align-self: center;
  font-size: var(--t-xs); color: var(--accent-text); opacity: 0;
  transition: opacity var(--dur-1) var(--ease);
}
.doc:hover .doc-go { opacity: 1; }
.doc-other { border-left: 3px solid var(--accent); }

/* ---------- agent run ---------- */
.steps { list-style: none; margin: 0; padding: 0; }
.step {
  display: grid; grid-template-columns: 30px 1fr; gap: var(--s4);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s3) var(--s5); margin-bottom: var(--s2); box-shadow: var(--elev-0);
}
.step-n {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--line);
  font-size: var(--t-xs); color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.step-body p { margin: 0 0 var(--s2); font-size: var(--t-sm); color: var(--ink-2); }
/* Only the step that just landed is raised, and only it animates. */
.step-live {
  border-color: var(--accent); box-shadow: var(--elev-2);
  animation: stepIn var(--dur-3) var(--ease) both;
}
.step-live .step-n { background: var(--accent); border-color: var(--accent); color: var(--ink-invert); }
@keyframes stepIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.step-alarm  { border-left: 3px solid var(--risk); }
.step-reject { border-left: 3px solid var(--risk); }
.step-find   { border-left: 3px solid var(--accent); }
.step-ok     { border-left: 3px solid var(--ok); }
.step-clock  { border-left: 3px solid var(--warn); }
.cite-btn {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--accent-text);
  padding: var(--s1) var(--s3); border-radius: var(--radius); cursor: pointer;
  font-size: var(--t-xs);
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.cite-btn:hover { border-color: var(--accent); background: var(--accent-fill); }
.run-done { padding: var(--s4); font-size: var(--t-sm); color: var(--ink-2); }
.linkish {
  border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--accent-text); text-decoration: underline; font-size: inherit;
}

/* ---------- data tables ---------- */
.data { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.data th, .data td { text-align: left; padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.data thead th { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: var(--track-eyebrow); color: var(--ink-3); font-weight: 500; }
.data tfoot th { border-top: 1px solid var(--line); border-bottom: 0; }
.data .amt { text-align: right; font-variant-numeric: tabular-nums; }
.data tr.ok  td { background: var(--ok-fill); }
.data tr.bad td { background: var(--risk-fill); color: var(--risk-text); }
/* Disqualified on a requirement. Meeting the date does not earn the green
 * row, so this one is stood down instead. */
.data tr.rejected td { background: var(--panel-3); color: var(--ink-3); }
.data tr.rejected td b { color: var(--ink-2); }
.data tr.r-fails td { background: var(--risk-fill); color: var(--risk-text); }
.data tr.r-judgement td { background: var(--warn-fill); color: var(--warn-text); }
.ok-t   { color: var(--ok-text);   font-weight: 600; }
.warn-t { color: var(--warn-text); font-weight: 600; }
.bad-t  { color: var(--risk-text); font-weight: 600; }
.delta  { font-weight: 600; }

.pill {
  display: inline-block; padding: 1px var(--s2); border-radius: 10px;
  font-size: var(--t-xs); border: 1px solid var(--line); background: var(--panel-2); color: var(--ink-3);
}
.pill-type { background: var(--accent-fill); border-color: var(--accent); color: var(--accent-text); }
.pill-gate { background: var(--risk-fill); border-color: var(--risk); color: var(--risk-text); }

.verdict {
  padding: var(--s3) var(--s5); border-radius: var(--radius);
  margin-bottom: var(--s4); font-size: var(--t-base);
}
.verdict-bad  { background: var(--risk-fill); border: 1px solid var(--risk); color: var(--risk-text); }
.verdict-hold { background: var(--warn-fill); border: 1px solid var(--warn); color: var(--warn-text); }

/* ---------- memo ---------- */
.memo { max-width: 940px; }
.memo-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s5);
  border-bottom: 2px solid var(--ink); padding-bottom: var(--s3); margin-bottom: var(--s4);
}
.memo-stamp {
  border: 1px solid var(--warn); background: var(--warn-fill); color: var(--warn-text);
  padding: var(--s2) var(--s3); border-radius: var(--radius);
  font-size: var(--t-xs); text-align: center; text-transform: uppercase; letter-spacing: .05em;
  white-space: nowrap;
}
.memo-stamp span { opacity: .8; }
.memo h3 { margin-top: var(--s4); }
.discs { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.disc { background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: var(--s3); }
.disc ul { margin: 0 0 var(--s2); padding-left: var(--s5); font-size: var(--t-sm); }
.disc .why { margin: 0; font-size: var(--t-xs); color: var(--ink-3); }
.opts { padding-left: var(--s5); font-size: var(--t-sm); }
.opts li { margin-bottom: var(--s2); }
.memo-foot {
  margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line-soft);
  font-size: var(--t-xs); color: var(--ink-3);
}

/* ---------- value ---------- */
.vgrid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2) var(--s3); }
.vin { display: flex; flex-direction: column; gap: 2px; font-size: var(--t-sm); }
.vin span { color: var(--ink-2); }
.vin em { font-size: var(--t-xs); color: var(--ink-3); font-style: normal; }
.vin input {
  padding: var(--s2) var(--s3); border: 1px solid var(--line);
  border-radius: var(--radius); font: var(--t-sm) var(--mono); color: var(--ink);
  background: var(--panel-2);
}
.vin input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.vbtns { display: flex; gap: var(--s2); margin-top: var(--s4); }
.vnote {
  margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line-soft);
  font-size: var(--t-sm); color: var(--ink-2);
}
.vnote p { margin-bottom: var(--s2); }

/* ---------- artefact viewer ---------- */
.ovl {
  position: fixed; inset: 0; background: rgba(20, 24, 31, .55);
  display: grid; place-items: center; padding: var(--s4); z-index: 50;
  animation: fadeIn var(--dur-2) var(--ease) both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.ovl-box {
  background: var(--panel); border-radius: var(--radius);
  width: min(920px, 100%); max-height: 92vh; display: flex; flex-direction: column;
  box-shadow: var(--elev-3);
  animation: boxIn var(--dur-2) var(--ease) both;
}
@keyframes boxIn { from { opacity: 0; transform: translateY(8px) scale(.995); } to { opacity: 1; transform: none; } }
/* A D-size sheet in a 920 px dialog is unreadable, and an unreadable
 * drawing is worse than no drawing. */
.ovl-wide { width: min(1560px, 100%); }
.ovl-top {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s2) var(--s4); border-bottom: 1px solid var(--line);
  font-size: var(--t-sm);
}
.ovl-top .muted { flex: 1; font-size: var(--t-xs); }
.ovl-body { overflow: auto; padding: var(--s5); background: var(--bg); }
.ovl-body-sheet { padding: var(--s3); }

/* ---------- issued-looking paper ---------- */
.letter, .email, .sheet-body, .tb {
  background: var(--paper); color: var(--paper-ink);
  border: 1px solid var(--paper-line);
}
.tb {
  display: flex; justify-content: space-between; gap: var(--s5);
  padding: var(--s3) var(--s4); border-bottom: 0;
  font-size: var(--t-xs);
}
.tb-owner { font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.tb-proj  { font-size: var(--t-sm); font-weight: 600; }
.tb-sub   { color: var(--ink-3); }
.tb-right { min-width: 260px; }
.tb-row { display: flex; justify-content: space-between; gap: var(--s3); border-bottom: 1px dotted var(--paper-line); padding: 1px 0; }
.tb-row span { color: var(--ink-3); }
.sheet-body { padding: var(--s5); }
.sheet-note { font-size: var(--t-xs); color: var(--ink-3); margin: var(--s4) 0 0; }
.sheet-table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.sheet-table th, .sheet-table td {
  text-align: left; padding: var(--s2) var(--s3); border: 1px solid var(--paper-line);
}
.sheet-table thead th { background: var(--panel-2); font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .05em; }
.ms-gate td { background: var(--accent-fill); }
.ms-irreversible td { background: var(--risk-fill); color: var(--risk-text); }

.letter, .email { padding: var(--s5); }
.lh { border-bottom: 2px solid var(--paper-ink); padding-bottom: var(--s2); margin-bottom: var(--s4); }
.lh-name { font-size: var(--t-lg); font-weight: 700; letter-spacing: .02em; }
.lh-sub  { font-size: var(--t-xs); color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
.kv { border-collapse: collapse; margin-bottom: var(--s4); font-size: var(--t-sm); width: 100%; }
.kv td { padding: 3px var(--s3) 3px 0; vertical-align: top; }
.kv td:first-child { color: var(--ink-3); width: 190px; }
.quote-lead { font-size: var(--t-base); padding: var(--s3); background: var(--panel-2); border-left: 3px solid var(--accent); }
.fineprint { font-size: var(--t-xs); color: var(--ink-3); }
.sig { margin-top: var(--s5); font-size: var(--t-sm); font-style: italic; }
.email .hdr { border-collapse: collapse; font-size: var(--t-sm); margin-bottom: var(--s4); width: 100%; }
.email .hdr td { padding: 2px var(--s3) 2px 0; border-bottom: 1px solid var(--line-soft); }
.email .hdr td:first-child { color: var(--ink-3); width: 70px; }
.email-body { font-size: var(--t-sm); }

.otherjob {
  background: var(--accent-fill); border: 1px solid var(--accent); color: var(--accent-text);
  padding: var(--s3) var(--s4); border-radius: var(--radius);
  font-size: var(--t-sm); margin-bottom: var(--s3);
}

/* cited field highlight — pulses once when the agent points at it */
.cite-on {
  background: var(--warn-fill); box-shadow: 0 0 0 2px var(--warn);
  border-radius: 2px; padding: 0 2px;
  animation: citePulse 1.1s var(--ease) 2;
}
@keyframes citePulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--warn); }
  50%      { box-shadow: 0 0 0 6px var(--warn-fill); }
}

/* ======================================================================
 * CAD sheets
 *
 * Line weight carries meaning. The pen ladder is in tokens.css, and a
 * drawing may only use those five weights. Strokes scale with the sheet,
 * the way a plotted drawing does.
 * ==================================================================== */
.cad { width: 100%; height: auto; display: block; }
.cad text {
  font-family: var(--cad-font); fill: var(--cad-ink);
  letter-spacing: .04em;
}
.cad .tx-b { font-weight: 700; }
.cad .tx-2 { fill: var(--cad-thin); }
.cad .tx-z { fill: var(--cad-dim); letter-spacing: .1em; }
.cad .dimtx { fill: var(--cad-dim); }
.cad .hl-tx { fill: var(--cad-hl); font-weight: 700; }

.cad .ln { fill: none; stroke: var(--cad-ink); stroke-linecap: square; }
.cad .w-hair  { stroke-width: var(--pen-hair); }
.cad .w-thin  { stroke-width: var(--pen-thin); }
.cad .w-med   { stroke-width: var(--pen-med); }
.cad .w-thick { stroke-width: var(--pen-thick); }
.cad .w-heavy { stroke-width: var(--pen-heavy); }

.cad .dimln   { stroke: var(--cad-dim); }
.cad .centre  { stroke: var(--cad-dim); stroke-dasharray: 24 4 6 4; }
.cad .zone    { stroke: var(--cad-grid); }
.cad .trim    { stroke: var(--cad-grid); }

.cad .paper-fill { fill: var(--cad-paper); }
.cad .panel-fill { fill: var(--panel-3); stroke: none; }
.cad .no-fill    { fill: none; }
.cad .no-stroke  { stroke: none; }
.cad .fill-ink   { fill: var(--cad-ink); stroke: none; }
.cad .fill-dim   { fill: var(--cad-dim); stroke: none; }
.cad .dimbg      { fill: var(--cad-paper); stroke: none; }
.cad .issue      { fill: var(--panel-3); }

/* the tag under discussion, and the candidate it is compared against */
.cad .hl  { stroke: var(--cad-hl); }
.cad .alt { stroke: var(--cad-alt); }
.cad .hl-box { stroke: var(--cad-hl); stroke-dasharray: 8 5; }

/* Section fills come from namespaced patterns; these style the tile. */
.cad .hatch-f { fill: var(--cad-hatch); stroke: none; }
.cad .hatch-s { stroke: var(--cad-hatch); stroke-width: .7; fill: none; }
.cad .stamp-tx {
  fill: var(--cad-hl); font-weight: 700; letter-spacing: .3em; opacity: .17;
}

/* A sheet shown inline on a working screen, not in the viewer. */
.sheet-embed {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--cad-paper); overflow: hidden; cursor: zoom-in;
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.sheet-embed:hover { border-color: var(--accent); box-shadow: var(--elev-1); }
.sheet-embed:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ======================================================================
 * Information graphics
 * ==================================================================== */
.gfx { width: 100%; height: auto; display: block; margin: var(--s3) 0; }
.gfx .g-tx { font-family: var(--font); fill: var(--ink-2); }
.gfx .g-tx-b { fill: var(--ink); font-weight: 600; }
.gfx .g-tx-2 { fill: var(--ink-2); }
.gfx .g-tx-3 { fill: var(--ink-3); }
.gfx .g-tx-h { fill: var(--ink-3); text-transform: uppercase; letter-spacing: var(--track-eyebrow); }
.gfx .g-tx-acc { fill: var(--accent-text); }
.gfx .g-tx-mono { font-family: var(--mono); fill: var(--ink); font-weight: 600; }
.gfx .g-tx-num { font-weight: 700; letter-spacing: var(--track-num); font-variant-numeric: tabular-nums; }
.gfx .g-on { fill: var(--ink-invert); }
.gfx .g-on-dim { fill: var(--ink-invert); opacity: .8; }

.gfx .g-ln { stroke: var(--line); stroke-width: 1; fill: none; }
.gfx .g-axis { stroke: var(--line-strong); stroke-width: 1.5; }
.gfx .g-tick { stroke: var(--line-strong); }
.gfx .g-year { stroke: var(--line-soft); stroke-dasharray: 3 4; }

.gfx .g-late { fill: var(--risk-wash); }
.gfx .g-late-tx { fill: var(--risk-text); font-weight: 600; letter-spacing: var(--track-eyebrow); }

.gfx .g-bar-risk { fill: var(--risk); }
.gfx .g-bar-ok   { fill: var(--ok); }
.gfx .g-bar-mute { fill: var(--ink-3); }

.gfx .g-over { stroke: var(--risk); stroke-width: 1.4; }
.gfx .g-over-tx { fill: var(--risk-text); font-weight: 700; letter-spacing: .04em; }

.gfx .g-gate-need { stroke: var(--risk); stroke-width: 2; stroke-dasharray: 7 4; }
.gfx .g-gate-need-fill { fill: var(--risk); }
.gfx .g-gate-need-tx { fill: var(--risk-text); }
.gfx .g-gate-soft { stroke: var(--ink-3); stroke-width: 1.4; stroke-dasharray: 4 4; }
.gfx .g-gate-soft-fill { fill: var(--ink-3); }
.gfx .g-gate-stop { stroke: var(--brand-slate); stroke-width: 2.4; }
.gfx .g-gate-stop-fill { fill: var(--brand-slate); }
.gfx .g-gate-stop-tx { fill: var(--brand-slate); }

.gfx .g-win-open { fill: var(--accent-fill); stroke: var(--accent); stroke-width: 1; }
.gfx .g-win-shut { fill: var(--warn-fill); stroke: var(--warn); stroke-width: 1; }
.gfx .g-win-gone { fill: var(--risk-wash); stroke: var(--risk); stroke-width: 1; }
.gfx .g-now-fill { fill: var(--brand); }

.gfx .g-link { stroke: var(--line-strong); stroke-width: 1.2; fill: none; opacity: .75; }
.gfx .g-link-2 { stroke: var(--line); }
.gfx .g-node { fill: var(--panel); stroke: var(--line); stroke-width: 1; }
.gfx .g-node-src { fill: var(--risk-wash); stroke: var(--risk); }
.gfx .g-node-bar { fill: var(--risk); stroke: none; }
.gfx .g-node-disc { fill: var(--accent-fill); stroke: var(--accent); }
.gfx .g-node-item { fill: var(--panel-2); stroke: var(--line); }

/* ---------- narrow ---------- */
@media (max-width: 1180px) {
  .grid2, .discs, .vgrid { grid-template-columns: 1fr; }
  .main, .foot { padding: var(--s4); }
  .top, .acts, .subtabs, .presenter { padding-left: var(--s4); padding-right: var(--s4); }
  .acts, .subtabs { overflow-x: auto; }
  .act-s { display: none; }
  .stat-n { font-size: var(--t-4xl); }
}
