/* ============================================================================
   PackTwin · Biscuit transit-trial module — module styles (owner: I6; copied from the bottle module's stylesheet and renamed)

   Namespace: every rule starts with .bx- (shell), .bxc- (config: biscuit · pack), .bxt- (transit · run), .bxr- (results · compare · report, owner I7)
   or .bxv- (viewer, owner I7) so nothing here can collide with the
   host stylesheet. Tokens come from frontend/styles.css (--paper, --plate,
   --rule, --ink, --brand, --pass/--warn/--fail, fonts). The one deliberate
   addition is the provenance hue set: one hue per provenance label, used for
   chips, table keys and legend swatches, so "where did this number come from"
   is answered by colour everywhere, consistently.

   Other frontend agents append their own clearly-delimited blocks at the END
   of this file only.
   ============================================================================ */

.bx-root {
  /* Visualisation panel theme (light default; dark via data-theme) */
  --bx-viz-bg:        #fafafa;
  --bx-viz-ink:       var(--ink);
  --bx-viz-mute:      var(--ink-mute);
  --bx-viz-rule:      var(--rule);
  --bx-viz-plate:     #ffffff;

  /* Provenance hues — hue angle per data type (kept ≥ 20° apart) */
  --bx-h-measured_lab_test:      148;
  --bx-h-measured_cad:           122;
  --bx-h-measured_field:         170;
  --bx-h-derived_from_measured:  192;
  --bx-h-simulated:              206;
  --bx-h-standard_profile:       236;
  --bx-h-reference_simulation:   266;
  --bx-h-literature:             296;
  --bx-h-parametric:             328;
  --bx-h-calibrated_parameter:   16;
  --bx-h-engineering_assumption: 42;
  --bx-h-user:                   60;

  --bx-form-w: minmax(380px, 5fr);
  --bx-viz-w:  minmax(0, 7fr);

  color: var(--ink);
  font-family: var(--font-ui);
  min-width: 0;
}

/* ─────────────────────────────────────────────────────────── header ── */

.bx-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.bx-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--s-5);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--ink);
}
.bx-head__text { min-width: 0; }
.bx-head__eyebrow { display: block; margin-bottom: 6px; }
.bx-head__title { font-size: 30px; line-height: 1.1; letter-spacing: -0.02em; margin: 0; }
.bx-head__blurb { margin: 8px 0 0; max-width: 62ch; color: var(--ink-2); font-size: 14px; }
.bx-head__tools { display: flex; align-items: center; gap: var(--s-3); flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.bx-head__case {
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-mute);
  padding: 5px 10px; border: 1px solid var(--rule); border-radius: var(--r-pill); background: var(--plate);
}
.bx-head__nav { display: flex; gap: 4px; }

/* Stage sequence strip: ten segments; state colours mirror the rail dots. */
.bx-steps { display: grid; grid-template-columns: repeat(9, 1fr); gap: 3px; margin: var(--s-3) 0 var(--s-6); }
.bx-steps__seg { height: 3px; background: var(--rule); border-radius: 2px; transition: background var(--t-base); }
.bx-steps__seg[data-state="complete"] { background: var(--pass); }
.bx-steps__seg[data-state="active"]   { background: var(--brand-2); }
.bx-steps__seg.is-current { background: var(--brand); box-shadow: 0 0 0 2px var(--brand-tint); }

/* Theme toggle for the visualisation panels */
.bx-theme {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 6px; border-radius: var(--r-pill);
  border: 1px solid var(--rule); background: var(--plate); color: var(--ink-2);
  font: 500 12px/1 var(--font-ui);
}
.bx-theme:hover { border-color: var(--ink); color: var(--ink); }
.bx-theme__sun {
  width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffd766 0 38%, #e9a400 40% 100%);
  border: 1px solid #b57e00; transition: background var(--t-base), border-color var(--t-base);
}
.bx-theme[aria-pressed="true"] .bx-theme__sun {
  background: radial-gradient(circle at 60% 40%, #f3f5fa 0 30%, #7c8aa5 32% 100%);
  border-color: #3c4658;
}

/* ─────────────────────────────────────────────────────────── stage layout ── */

.bx-stage {
  display: grid;
  grid-template-columns: var(--bx-form-w) var(--bx-viz-w);
  gap: var(--s-5);
  align-items: start;
}
.bx-stage--single { grid-template-columns: minmax(0, 1fr); }
.bx-stage-mount { min-width: 0; }
.bx-form { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.bx-viz {
  position: sticky; top: 72px;
  display: flex; flex-direction: column; gap: var(--s-3);
  min-width: 0;
  background: var(--bx-viz-bg); color: var(--bx-viz-ink);
  border: 1px solid var(--bx-viz-rule); border-radius: var(--r-md);
  padding: var(--s-4);
  transition: background var(--t-base), color var(--t-base), border-color var(--t-base);
}
.bx-viz__canvas {
  position: relative; width: 100%; aspect-ratio: 4 / 3; min-height: 280px;
  border-radius: var(--r-sm); overflow: hidden; background: var(--bx-viz-plate);
  border: 1px solid var(--bx-viz-rule);
}
.bx-viz__canvas canvas { display: block; width: 100%; height: 100%; }
.bx-viz__toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bx-viz__note { font-size: 12px; color: var(--bx-viz-mute); }

/* Dark visualisation theme (SPEC §5.5: #0f1115) */
.bx-root[data-theme="dark"] {
  --bx-viz-bg:    #0f1115;
  --bx-viz-plate: #161a21;
  --bx-viz-ink:   #e8e9ec;
  --bx-viz-mute:  #9aa1ad;
  --bx-viz-rule:  #2a2f3a;
}
.bx-root[data-theme="dark"] .bx-viz .bx-legend,
.bx-root[data-theme="dark"] .bx-viz .bx-kpi,
.bx-root[data-theme="dark"] .bx-viz .bx-tabs,
.bx-root[data-theme="dark"] .bx-viz .bx-plate { background: var(--bx-viz-plate); border-color: var(--bx-viz-rule); color: var(--bx-viz-ink); }
.bx-root[data-theme="dark"] .bx-viz .bx-kpi__label,
.bx-root[data-theme="dark"] .bx-viz .bx-eyebrow,
.bx-root[data-theme="dark"] .bx-viz .bx-kpi__unit,
.bx-root[data-theme="dark"] .bx-viz .bx-legend__tick { color: var(--bx-viz-mute); }
.bx-root[data-theme="dark"] .bx-viz .bx-tab { color: var(--bx-viz-mute); }
.bx-root[data-theme="dark"] .bx-viz .bx-tab[aria-selected="true"] { color: var(--bx-viz-ink); border-color: var(--brand-2); }
.bx-root[data-theme="dark"] .bx-viz .bx-btn--ghost,
.bx-root[data-theme="dark"] .bx-viz .bx-btn--secondary { color: var(--bx-viz-ink); border-color: var(--bx-viz-rule); }
.bx-root[data-theme="dark"] .bx-viz .bx-btn--ghost:hover,
.bx-root[data-theme="dark"] .bx-viz .bx-btn--secondary:hover { background: #1f2430; }
.bx-root[data-theme="dark"] .bx-viz .bx-seg { background: #1f2430; border-color: var(--bx-viz-rule); }
.bx-root[data-theme="dark"] .bx-viz .bx-seg__btn { color: var(--bx-viz-mute); }
.bx-root[data-theme="dark"] .bx-viz .bx-seg__btn[aria-checked="true"] { background: #2a3140; color: var(--bx-viz-ink); }
.bx-root[data-theme="dark"] .bx-viz .bx-select,
.bx-root[data-theme="dark"] .bx-viz .bx-input { background: #1f2430; color: var(--bx-viz-ink); border-color: var(--bx-viz-rule); }
.bx-root[data-theme="dark"] .bx-viz .bx-table th { color: var(--bx-viz-mute); border-color: var(--bx-viz-rule); }
.bx-root[data-theme="dark"] .bx-viz .bx-table td { border-color: var(--bx-viz-rule); }

/* ─────────────────────────────────────────────────────────── plates ── */

.bx-plate {
  background: var(--plate);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: var(--s-5);
  min-width: 0;
}
.bx-plate--feature { border-color: var(--ink); }
.bx-plate--muted { background: var(--plate-2); }
.bx-plate--pass { border-color: var(--pass); }
.bx-plate--warn { border-color: var(--warn); }
.bx-plate--fail { border-color: var(--fail); }
.bx-plate__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-4); margin-bottom: var(--s-4); }
.bx-plate__head .bx-eyebrow { display: block; margin-bottom: 4px; }
.bx-plate__title { font-size: 16px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.bx-plate__sub { margin: 4px 0 0; font-size: 13px; color: var(--ink-mute); }
.bx-plate__actions { display: flex; gap: 6px; flex-shrink: 0; }
.bx-plate__body { display: flex; flex-direction: column; gap: var(--s-4); }
.bx-plate__body > p { margin: 0; }

.bx-section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s-4); margin: var(--s-2) 0 var(--s-3); }
.bx-section-head .bx-eyebrow { display: block; margin-bottom: 4px; }
.bx-section-head__title { font-size: 18px; margin: 0; letter-spacing: -0.01em; }
.bx-section-head__sub { margin: 4px 0 0; font-size: 13px; color: var(--ink-mute); max-width: 70ch; }
.bx-section-head__actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ─────────────────────────────────────────────────────────── buttons ── */

.bx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 500 14px/1 var(--font-ui); letter-spacing: 0.01em;
  padding: 11px 18px; border-radius: var(--r-sm); border: 1px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.bx-btn--sm { padding: 7px 12px; font-size: 12.5px; }
.bx-btn--lg { padding: 14px 24px; font-size: 15px; font-weight: 600; }
.bx-btn--primary { background: var(--brand); color: #fff; box-shadow: 0 1px 0 var(--brand-3) inset; }
.bx-btn--primary:hover { background: var(--brand-2); }
.bx-btn--primary:active { background: var(--brand-3); }
.bx-btn--secondary { background: transparent; color: var(--brand); border-color: var(--brand); }
.bx-btn--secondary:hover { background: var(--brand-tint); }
.bx-btn--ghost { background: transparent; color: var(--ink-2); border-color: var(--rule); }
.bx-btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
.bx-btn--danger { background: transparent; color: var(--fail); border-color: var(--fail); }
.bx-btn--danger:hover { background: var(--fail-tint); }
.bx-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.bx-btn:focus-visible, .bx-input:focus-visible, .bx-toggle:focus-visible, .bx-seg__btn:focus-visible, .bx-tab:focus-visible, .bx-theme:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px;
}
.bx-btn__icon { font-size: 1.05em; line-height: 1; }

/* Stage footer: back / continue */
.bx-stage-foot {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s-3);
  padding-top: var(--s-4); border-top: 1px solid var(--rule); margin-top: var(--s-2);
}
.bx-stage-foot__note { font-size: 12.5px; color: var(--ink-mute); }

/* ─────────────────────────────────────────────────────────── forms ── */

.bx-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; width: var(--bx-field-w, auto); }
.bx-field--inline { flex-direction: row; align-items: center; justify-content: space-between; gap: var(--s-3); }
.bx-field--inline .bx-field__label { flex: 1; }
.bx-field__label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.bx-field__name { color: var(--ink); }
.bx-field__control { position: relative; display: flex; align-items: stretch; }
.bx-field__control.has-unit .bx-input { padding-right: 56px; }
.bx-unit {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-mute); pointer-events: none;
}
.bx-field__hint { font-size: 12px; color: var(--ink-mute); line-height: 1.45; }
.bx-field__error { font-size: 12px; color: var(--fail); }
.bx-field.has-error .bx-input { border-color: var(--fail); }
.bx-field-grid { display: grid; grid-template-columns: repeat(var(--bx-cols, 2), minmax(0, 1fr)); gap: var(--s-3) var(--s-4); }
.bx-field-grid .bx-field--span { grid-column: 1 / -1; }

.bx-input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--rule-strong); border-radius: var(--r-sm);
  font: 400 14px/1.4 var(--font-ui); color: var(--ink); background: var(--paper);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.bx-input--number { font-family: var(--font-mono); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.bx-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); background: var(--plate); }
.bx-input:disabled { opacity: 0.55; cursor: not-allowed; }
.bx-input.is-readonly { background: var(--plate-2); border-style: dashed; }
.bx-input.is-invalid { border-color: var(--fail); box-shadow: 0 0 0 3px var(--fail-tint); }
.bx-input::-webkit-outer-spin-button, .bx-input::-webkit-inner-spin-button { opacity: 0.6; }
.bx-select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-mute) 50%), linear-gradient(135deg, var(--ink-mute) 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}

/* Toggle switch */
.bx-toggle { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--ink-2); font: 500 13px/1 var(--font-ui); }
.bx-toggle__track { position: relative; width: 36px; height: 20px; border-radius: 10px; background: var(--rule-strong); transition: background var(--t-fast); flex-shrink: 0; }
.bx-toggle__knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(26,29,34,0.25); transition: transform var(--t-fast) var(--ease-out); }
.bx-toggle[aria-checked="true"] .bx-toggle__track { background: var(--brand); }
.bx-toggle[aria-checked="true"] .bx-toggle__knob { transform: translateX(16px); }
.bx-toggle:disabled { opacity: 0.5; cursor: not-allowed; }

/* Segmented control */
.bx-seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--plate-2); max-width: 100%; flex-wrap: wrap; }
.bx-seg__btn {
  border: 0; background: transparent; color: var(--ink-2);
  font: 500 13px/1 var(--font-ui); padding: 7px 12px; border-radius: 4px; cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.bx-seg--sm .bx-seg__btn { padding: 5px 9px; font-size: 12px; }
.bx-seg__btn:hover { color: var(--ink); }
.bx-seg__btn[aria-checked="true"] { background: var(--plate); color: var(--brand); box-shadow: 0 1px 2px rgba(26,29,34,0.08); }
.bx-seg__btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Dropzone (Product stage CAD upload) */
.bx-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: var(--s-6) var(--s-4); text-align: center;
  border: 1.5px dashed var(--rule-strong); border-radius: var(--r-md); background: var(--paper);
  color: var(--ink-2); font-size: 13.5px; cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast);
}
.bx-drop:hover, .bx-drop.is-over { border-color: var(--brand); background: var(--brand-tint-2); }
.bx-drop__formats { font-family: var(--font-mono); font-size: 11px; color: var(--ink-mute); letter-spacing: 0.04em; }

/* ─────────────────────────────────────────────────────────── KPI cards ── */

.bx-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: var(--s-2); }
.bx-kpi {
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
  padding: 12px 14px; background: var(--plate); border: 1px solid var(--rule); border-radius: var(--r-sm);
  border-left-width: 3px;
}
.bx-kpi[data-tone="pass"] { border-left-color: var(--pass); }
.bx-kpi[data-tone="warn"] { border-left-color: var(--warn); }
.bx-kpi[data-tone="fail"] { border-left-color: var(--fail); }
.bx-kpi__label { font-size: 11.5px; color: var(--ink-mute); line-height: 1.3; }
.bx-kpi__value { display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; }
.bx-kpi__num { font-family: var(--font-mono); font-size: 20px; font-weight: 500; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.bx-kpi[data-tone="fail"] .bx-kpi__num { color: var(--fail); }
.bx-kpi[data-tone="warn"] .bx-kpi__num { color: var(--warn); }
.bx-kpi[data-tone="pass"] .bx-kpi__num { color: var(--pass); }
.bx-kpi__unit { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-mute); }
.bx-kpi__foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.bx-kpi__delta { font-family: var(--font-mono); font-size: 11.5px; }
.bx-kpi__delta[data-sign="pos"] { color: var(--pass); }
.bx-kpi__delta[data-sign="neg"] { color: var(--fail); }
.bx-kpi__note { font-size: 11px; color: var(--ink-mute); }

/* ─────────────────────────────────────────────────────────── provenance chips ── */

.bx-prov {
  --h: 0;
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.02em; line-height: 1;
  padding: 4px 8px 4px 6px; border-radius: var(--r-pill);
  color: hsl(var(--h) 42% 28%);
  background: hsl(var(--h) 55% 95%);
  border: 1px solid hsl(var(--h) 38% 78%);
  white-space: nowrap; vertical-align: middle; cursor: help;
}
.bx-prov--compact { padding: 2px 6px 2px 5px; font-size: 10px; }
.bx-prov__dot { width: 6px; height: 6px; border-radius: 50%; background: hsl(var(--h) 60% 42%); flex-shrink: 0; }
.bx-prov__src { color: hsl(var(--h) 25% 45%); }
.bx-prov__src::before { content: "·"; margin-right: 5px; }
.bx-prov[data-type="measured_lab_test"]      { --h: var(--bx-h-measured_lab_test); }
.bx-prov[data-type="measured_cad"]           { --h: var(--bx-h-measured_cad); }
.bx-prov[data-type="measured_field"]         { --h: var(--bx-h-measured_field); }
.bx-prov[data-type="derived_from_measured"]  { --h: var(--bx-h-derived_from_measured); }
.bx-prov[data-type="simulated"]              { --h: var(--bx-h-simulated); }
.bx-prov[data-type="standard_profile"]       { --h: var(--bx-h-standard_profile); }
.bx-prov[data-type="reference_simulation"]   { --h: var(--bx-h-reference_simulation); }
.bx-prov[data-type="literature"]             { --h: var(--bx-h-literature); }
.bx-prov[data-type="parametric"]             { --h: var(--bx-h-parametric); }
.bx-prov[data-type="calibrated_parameter"]   { --h: var(--bx-h-calibrated_parameter); }
.bx-prov[data-type="engineering_assumption"] { --h: var(--bx-h-engineering_assumption); }
.bx-prov[data-type="user"]                   { --h: var(--bx-h-user); color: hsl(var(--h) 10% 30%); background: hsl(var(--h) 15% 95%); border-color: hsl(var(--h) 12% 78%); }
.bx-prov[data-type="user"] .bx-prov__dot     { background: hsl(var(--h) 10% 45%); }
.bx-prov[data-type="unknown"]                { color: var(--fail); background: var(--fail-tint); border-color: var(--fail); border-style: dashed; }
.bx-prov[data-type="unknown"] .bx-prov__dot  { background: var(--fail); }

/* Evidence ladder banner */
.bx-ladder {
  display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--plate-2);
}
.bx-ladder__rung { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1 1 160px; }
.bx-ladder__label { font-size: 13px; font-weight: 600; color: var(--ink); }
.bx-ladder__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bx-ladder__note { font-size: 11.5px; color: var(--ink-mute); }
.bx-ladder__arrow { align-self: center; color: var(--ink-mute-2); font-size: 18px; }

/* ─────────────────────────────────────────────────────────── verdict ── */

.bx-verdict-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0.12em;
  padding: 5px 11px 5px 9px; border-radius: var(--r-pill); border: 1px solid transparent; white-space: nowrap;
}
.bx-verdict-badge--lg { font-size: 14px; padding: 9px 16px 9px 13px; }
.bx-verdict-badge__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.bx-verdict-badge--lg .bx-verdict-badge__dot { width: 10px; height: 10px; }
.bx-verdict-badge[data-verdict="PASS"]     { color: var(--pass); background: var(--pass-tint); border-color: var(--pass); }
.bx-verdict-badge[data-verdict="MARGINAL"] { color: var(--warn); background: var(--warn-tint); border-color: var(--warn); }
.bx-verdict-badge[data-verdict="FAIL"]     { color: var(--fail); background: var(--fail-tint); border-color: var(--fail); }
.bx-verdict-badge[data-verdict="PENDING"]  { color: var(--ink-mute); background: var(--plate-2); border-color: var(--rule-strong); }

.bx-verdict {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); align-items: start;
  padding: var(--s-5) var(--s-6); border-radius: var(--r-md);
  background: var(--plate); border: 1px solid var(--rule); border-left: 6px solid var(--ink-mute-2);
}
.bx-verdict[data-verdict="PASS"]     { border-left-color: var(--pass); }
.bx-verdict[data-verdict="MARGINAL"] { border-left-color: var(--warn); }
.bx-verdict[data-verdict="FAIL"]     { border-left-color: var(--fail); background: linear-gradient(90deg, var(--fail-tint) 0, var(--plate) 45%); }
.bx-verdict__main { display: flex; align-items: center; gap: var(--s-4); min-width: 0; }
.bx-verdict__headline { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
.bx-verdict__reason { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-2); max-width: 70ch; }
.bx-verdict__stats { display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-6); padding-top: var(--s-3); border-top: 1px solid var(--rule); }
.bx-verdict__stat { display: flex; flex-direction: column; gap: 2px; min-width: 110px; max-width: 100%; }
.bx-verdict__v--text { font-size: 15px; white-space: normal; overflow-wrap: anywhere; }
.bx-verdict__k { font-size: 11.5px; color: var(--ink-mute); }
.bx-verdict__v { font-family: var(--font-mono); font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.bx-verdict__c { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-mute); }

/* ─────────────────────────────────────────────────────────── tabs ── */

.bx-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); overflow-x: auto; scrollbar-width: none; }
.bx-tabs::-webkit-scrollbar { display: none; }
.bx-tab {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  padding: 9px 12px; font: 500 13px/1 var(--font-ui); color: var(--ink-mute); cursor: pointer; white-space: nowrap;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.bx-tab:hover { color: var(--ink); }
.bx-tab[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.bx-tab:disabled { opacity: 0.4; cursor: not-allowed; }
.bx-tab__badge { font-family: var(--font-mono); font-size: 10px; padding: 1px 6px; border-radius: var(--r-pill); background: var(--plate-2); color: var(--ink-mute); }

/* ─────────────────────────────────────────────────────────── tables ── */

.bx-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--plate); }
.bx-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bx-table th {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-mute); padding: 9px 12px; border-bottom: 1px solid var(--rule-strong); background: var(--plate-2); white-space: nowrap;
}
.bx-table__unit { text-transform: none; letter-spacing: 0; margin-left: 4px; color: var(--ink-mute-2); }
.bx-table__unit::before { content: "("; } .bx-table__unit::after { content: ")"; }
.bx-table td { padding: 9px 12px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.bx-table tbody tr:last-child td { border-bottom: 0; }
.bx-table__num { font-family: var(--font-mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.bx-table__empty { color: var(--ink-mute); text-align: center; padding: var(--s-5) !important; }
.bx-table--compact th, .bx-table--compact td { padding: 6px 10px; }
.bx-table tr.is-clickable { cursor: pointer; }
.bx-table tr.is-clickable:hover td { background: var(--brand-tint-2); }
.bx-table tr.is-active td { background: var(--brand-tint); }
.bx-table td[data-status="pass"], .bx-status--pass { color: var(--pass); font-weight: 600; }
.bx-table td[data-status="warn"], .bx-status--warn { color: var(--warn); font-weight: 600; }
.bx-table td[data-status="fail"], .bx-status--fail { color: var(--fail); font-weight: 600; }

/* ─────────────────────────────────────────────────────────── legend ── */

.bx-legend {
  display: flex; flex-direction: column; gap: 5px;
  padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--plate); min-width: 0;
}
.bx-legend__title { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 600; }
.bx-legend__unit { font-family: var(--font-mono); font-weight: 400; color: var(--ink-mute); font-size: 11px; }
.bx-legend__bar { height: 10px; border-radius: 3px; background: linear-gradient(90deg, #1f4de0 0%, #1fb35c 25%, #f2d21f 50%, #f28a1f 75%, #d81f1f 100%); }
.bx-legend__bar canvas { display: block; width: 100%; height: 100%; border-radius: 3px; }
.bx-legend__ticks { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.bx-legend__keys { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.bx-legend__key { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.bx-legend__swatch { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }

/* ─────────────────────────────────────────────────────────── timeline ── */

.bx-timeline { position: relative; padding: var(--s-4) 0 var(--s-3); overflow-x: auto; }
.bx-timeline__track { position: relative; display: flex; align-items: stretch; min-width: 640px; height: 64px; }
.bx-timeline__axis { position: absolute; left: 0; right: 0; top: 30px; height: 2px; background: var(--rule-strong); }
.bx-timeline__leg {
  position: absolute; top: 20px; height: 22px; border-radius: 3px;
  background: var(--brand-tint); border: 1px solid var(--brand); color: var(--brand-3);
  display: flex; align-items: center; padding: 0 8px; font-family: var(--font-mono); font-size: 10.5px; white-space: nowrap; overflow: hidden;
  cursor: pointer; transition: box-shadow var(--t-fast);
}
.bx-timeline__leg[data-mode="ship"] { background: hsl(192 60% 92%); border-color: hsl(192 50% 40%); color: hsl(192 60% 24%); }
.bx-timeline__leg[data-mode="rail"] { background: hsl(266 50% 94%); border-color: hsl(266 40% 45%); color: hsl(266 50% 28%); }
.bx-timeline__leg[data-mode="air"]  { background: hsl(236 50% 94%); border-color: hsl(236 40% 48%); color: hsl(236 50% 30%); }
.bx-timeline__leg[data-mode="van"]  { background: hsl(206 55% 92%); border-color: hsl(206 55% 42%); color: hsl(206 60% 26%); }
.bx-timeline__leg[data-risk="warn"] { border-color: var(--warn); background: var(--warn-tint); color: var(--warn); }
.bx-timeline__leg[data-risk="fail"] { border-color: var(--fail); background: var(--fail-tint); color: var(--fail); }
.bx-timeline__leg.is-selected, .bx-timeline__event.is-selected { box-shadow: 0 0 0 3px var(--brand-tint), 0 0 0 4px var(--brand); }
.bx-timeline__dwell { position: absolute; top: 24px; height: 14px; border-radius: 2px; background: repeating-linear-gradient(90deg, var(--rule) 0 4px, transparent 4px 8px); }
.bx-timeline__station { position: absolute; top: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.bx-timeline__station-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--plate); border: 2px solid var(--ink); }
.bx-timeline__station-label { font-size: 10.5px; color: var(--ink-2); white-space: nowrap; }
.bx-timeline__event {
  position: absolute; top: 44px; transform: translateX(-50%);
  width: 12px; height: 12px; border-radius: 2px; rotate: 45deg;
  background: var(--warn); border: 1px solid var(--plate); cursor: pointer;
}
.bx-timeline__event[data-risk="fail"] { background: var(--fail); }
.bx-timeline__event[data-risk="pass"] { background: var(--pass); }
.bx-timeline__scale { display: flex; justify-content: space-between; margin-top: 6px; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-mute); min-width: 640px; }
.bx-timeline__detail { margin-top: var(--s-3); padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--plate-2); }
.bx-timeline__detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px 16px; }
.bx-timeline__detail-k { font-size: 11px; color: var(--ink-mute); }
.bx-timeline__detail-v { font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; }

/* ─────────────────────────────────────────────────────────── misc blocks ── */

.bx-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: var(--s-5); border: 1px dashed var(--rule-strong); border-radius: var(--r-sm); background: var(--paper); }
.bx-empty__title { font-weight: 600; font-size: 14px; }
.bx-empty__hint { margin: 0; font-size: 13px; color: var(--ink-mute); max-width: 60ch; }

.bx-placeholder { max-width: 720px; }
.bx-placeholder__blurb { color: var(--ink-2); }
.bx-placeholder__status { font-family: var(--font-mono); font-size: 12px; color: var(--ink-mute); }
.bx-placeholder__note { font-size: 13px; color: var(--ink-2); }
.bx-placeholder__actions { display: flex; gap: 8px; }

.bx-spinner { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-mute); }
.bx-spinner__ring { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--rule-strong); border-top-color: var(--brand); animation: bx-spin 0.9s linear infinite; }
@keyframes bx-spin { to { transform: rotate(360deg); } }

.bx-note { font-size: 12.5px; color: var(--ink-mute); line-height: 1.5; }
.bx-note--model { padding: 10px 12px; border-left: 3px solid var(--rule-strong); background: var(--plate-2); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.bx-inline-list { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.bx-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.bx-muted { color: var(--ink-mute); }

/* ─────────────────────────────────────────────────────────── toasts ── */

.bx-toasts { position: fixed; right: 20px; bottom: 20px; z-index: 900; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.bx-toast {
  display: flex; align-items: stretch; gap: 10px; pointer-events: auto;
  background: var(--ink); color: var(--paper); border-radius: var(--r-sm);
  padding: 10px 10px 10px 0; box-shadow: var(--shadow-pop); overflow: hidden;
  animation: bx-toast-in var(--t-base) var(--ease-out);
}
.bx-toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity 200ms, transform 200ms; }
.bx-toast__bar { width: 4px; border-radius: 0 2px 2px 0; background: var(--brand-2); flex-shrink: 0; }
.bx-toast[data-kind="success"] .bx-toast__bar { background: #4ec27a; }
.bx-toast[data-kind="warn"] .bx-toast__bar { background: #e2a93a; }
.bx-toast[data-kind="error"] .bx-toast__bar { background: #e2675b; }
.bx-toast__body { flex: 1; min-width: 0; font-size: 13px; line-height: 1.4; }
.bx-toast__title { font-weight: 600; }
.bx-toast__msg { color: #d6d3cc; overflow-wrap: anywhere; }
.bx-toast__close { background: none; border: 0; color: #b3ada1; font-size: 18px; line-height: 1; padding: 0 6px; cursor: pointer; align-self: flex-start; }
.bx-toast__close:hover { color: var(--paper); }
@keyframes bx-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ─────────────────────────────────────────────────────────── modal ── */

.bx-modal-backdrop {
  position: fixed; inset: 0; z-index: 800;
  display: flex; align-items: center; justify-content: center; padding: var(--s-4);
  background: rgba(26, 29, 34, 0.45); backdrop-filter: blur(2px);
  animation: bx-fade-in var(--t-fast) ease-out;
}
.bx-modal-backdrop.is-leaving { opacity: 0; transition: opacity 160ms; }
.bx-modal {
  width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  background: var(--plate); border: 1px solid var(--ink); border-radius: var(--r-lg);
  padding: var(--s-6); box-shadow: var(--shadow-pop);
}
.bx-modal--wide { width: min(920px, 100%); }
.bx-modal__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-4); margin-bottom: var(--s-4); }
.bx-modal__head .bx-eyebrow { display: block; margin-bottom: 4px; }
.bx-modal__title { font-size: 20px; margin: 0; }
.bx-modal__close { background: none; border: 1px solid var(--rule); border-radius: 50%; width: 30px; height: 30px; font-size: 18px; line-height: 1; color: var(--ink-mute); cursor: pointer; }
.bx-modal__close:hover { border-color: var(--ink); color: var(--ink); }
.bx-modal__body { display: flex; flex-direction: column; gap: var(--s-4); }
.bx-modal__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: var(--s-5); }
@keyframes bx-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Processing overlay variant for the simulation run (mirrors #processing) */
.bx-processing { position: fixed; inset: 0; z-index: 850; display: flex; align-items: center; justify-content: center; background: rgba(247, 244, 238, 0.92); backdrop-filter: blur(3px); }
.bx-processing__card { width: min(520px, calc(100% - 32px)); background: var(--plate); border: 1px solid var(--ink); border-radius: var(--r-lg); padding: var(--s-6); display: flex; flex-direction: column; gap: var(--s-4); }
.bx-processing__title { font-size: 22px; margin: 0; }
.bx-processing__line { font-size: 14px; color: var(--ink-2); min-height: 1.5em; }
.bx-processing__bar { height: 4px; background: var(--plate-2); border-radius: 2px; overflow: hidden; }
.bx-processing__fill { height: 100%; width: 10%; background: var(--brand); border-radius: 2px; transition: width 600ms var(--ease-out); }
.bx-processing__foot { font-family: var(--font-mono); font-size: 11px; color: var(--ink-mute); }

/* ─────────────────────────────────────────────────────────── rail ── */

/* A host-side biscuit rail (#stages-biscuit) reuses .stages/.stage from the
   host; only the grouping hairlines between the biscuit / pack / results
   blocks are added here. The shell's own rail is .bx-rail. */
.stages--biscuit .stage[data-stage="transit"],
.stages--biscuit .stage[data-stage="results"] { margin-top: 6px; }
.stages--biscuit .stage[data-stage="transit"]::before,
.stages--biscuit .stage[data-stage="results"]::before {
  content: ""; position: absolute; left: 12px; right: 12px; top: -4px; height: 1px; background: var(--rule);
}

/* ─────────────────────────────────────────────────────────── responsive ── */

@media (max-width: 1100px) {
  .bx-stage { grid-template-columns: minmax(0, 1fr); }
  .bx-viz { position: static; }
  .bx-verdict { grid-template-columns: minmax(0, 1fr); }
  .bx-verdict__stats { flex-wrap: wrap; gap: var(--s-4); }
  .bx-head { flex-direction: column; align-items: flex-start; }
  .bx-head__tools { justify-content: flex-start; }
}
@media (max-width: 760px) {
  .bx-head__title { font-size: 24px; }
  .bx-field-grid { grid-template-columns: minmax(0, 1fr); }
  .bx-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bx-plate { padding: var(--s-4); }
  .bx-modal { padding: var(--s-5); }
  .bx-ladder__arrow { display: none; }
  .bx-viz__canvas { min-height: 220px; }
}

@media (prefers-reduced-motion: reduce) {
  .bx-toast, .bx-modal-backdrop, .bx-spinner__ring { animation: none; }
  .bx-toggle__knob, .bx-steps__seg, .bx-viz, .bx-processing__fill { transition: none; }
}

@media print {
  .bx-head__tools, .bx-steps, .bx-toasts, .bx-stage-foot { display: none !important; }
  .bx-stage { grid-template-columns: minmax(0, 1fr); }
  .bx-viz { position: static; border: 0; }
}

/* ============================================================================
   fe-transit block — Transit trial + Simulation stages and the shared journey
   timeline (frontend/biscuit_transit/stages-transit.js).  Namespace: .bxt-*, plus a
   handful of modifiers on the .bx-timeline vocabulary already defined above.
   Appended after the fe-shell block; nothing above this line is edited.
   ============================================================================ */

/* ── demo / provenance notices ─────────────────────────────────────────── */

.bxt-banner {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--warn); border-radius: var(--r-sm);
  background: var(--warn-tint);
  font-size: 12.5px; line-height: 1.45; color: var(--ink-2);
}
.bxt-banner__tag {
  flex-shrink: 0;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em;
  padding: 3px 7px; border-radius: var(--r-pill);
  background: var(--warn); color: var(--paper);
}
.bxt-banner__text { min-width: 0; }

.bxt-prov-line {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--ink-mute); line-height: 1.5;
}
.bxt-prov-line__k { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; }
.bxt-prov-line__src,
.bxt-code {
  font-family: var(--font-mono); font-size: 10.5px;
  padding: 1px 5px; border-radius: 3px;
  background: var(--plate-2); border: 1px solid var(--rule);
  overflow-wrap: anywhere;
}
.bxt-prov-line__text { flex: 1 1 220px; min-width: 0; }
.bxt-series { display: flex; flex-direction: column; gap: 6px; }

.bxt-provlist { display: flex; flex-direction: column; gap: 10px; }
.bxt-provlist__item {
  display: flex; flex-direction: column; gap: 4px;
  padding-bottom: 10px; border-bottom: 1px solid var(--rule);
}
.bxt-provlist__item:last-child { padding-bottom: 0; border-bottom: 0; }
.bxt-provlist__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bxt-provlist__name { font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.bxt-provlist__meta { font-size: 11px; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.bxt-provlist__src { align-self: flex-start; max-width: 100%; }
.bxt-provlist__note { margin: 0; font-size: 11.5px; line-height: 1.5; color: var(--ink-2); }

/* ── stage layout ──────────────────────────────────────────────────────── */

/* The transit stage is form-heavy: give the builder more of the grid than the
   shell's default 5fr / 7fr split, without touching the shell rule. */
.bxt-stage { --bx-form-w: minmax(0, 1fr); --bx-viz-w: minmax(340px, 1fr); }

/* ── leg builder ───────────────────────────────────────────────────────── */

.bxt-legs { display: flex; flex-direction: column; gap: var(--s-4); }
.bxt-legs__foot { display: flex; justify-content: flex-start; }
.bxt-leg { border-left: 3px solid var(--brand); }
.bxt-leg__modes { display: flex; flex-direction: column; gap: 6px; }
.bxt-leg__tools { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }

.bxt-profile-wrap { display: flex; flex-direction: column; gap: 8px; }
.bxt-profile {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--rule); border-left: 3px solid hsl(var(--bx-h-measured_field) 45% 45%);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--plate-2);
}
.bxt-profile__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bxt-profile__label { font-size: 13px; font-weight: 600; }
.bxt-profile__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px 14px; }
.bxt-stat { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bxt-stat__k { font-size: 10.5px; color: var(--ink-mute); }
.bxt-stat__v { font-size: 12.5px; overflow-wrap: anywhere; }
.bxt-profile__cite { margin: 0; font-size: 11.5px; line-height: 1.5; color: var(--ink-2); }
.bxt-profile__src { margin: 0; font-size: 11px; color: var(--ink-mute); overflow-wrap: anywhere; }
.bxt-profile__src code { font-family: var(--font-mono); font-size: 10.5px; }

/* ── per-leg event list ────────────────────────────────────────────────── */

.bxt-events { border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--plate); }
.bxt-events__summary {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; cursor: pointer; font-size: 13px; font-weight: 500;
  list-style: none;
}
.bxt-events__summary::-webkit-details-marker { display: none; }
.bxt-events__summary::before { content: "▸"; color: var(--ink-mute); font-size: 11px; }
.bxt-events[open] > .bxt-events__summary::before { content: "▾"; }
.bxt-events__hint { font-size: 11px; color: var(--ink-mute); font-weight: 400; }
.bxt-events__body { display: flex; flex-direction: column; gap: 10px; padding: 0 12px 12px; }
.bxt-events__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.bxt-row-act { display: inline-flex; gap: 2px; justify-content: flex-end; }
.bxt-event-form { display: flex; flex-direction: column; gap: var(--s-4); }
.bxt-event-form__prov { display: flex; flex-direction: column; gap: 6px; }

/* ── live preview ──────────────────────────────────────────────────────── */

.bxt-preview { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.bxt-ladder-wrap { display: flex; flex-direction: column; gap: 6px; }
.bxt-chart {
  position: relative; width: 100%; flex: none;
  border: 1px solid var(--bx-viz-rule); border-radius: var(--r-sm);
  background: var(--bx-viz-plate); overflow: hidden;
}
.bxt-chart__canvas { display: block; }
.bxt-chart-plate .bx-plate__body { gap: 10px; }

/* ── journey timeline additions ────────────────────────────────────────── */

.bxt-timeline-host { min-width: 0; }
.bxt-timeline .bx-timeline__track { height: 104px; margin-bottom: 4px; min-width: 460px; }
.bxt-timeline .bx-timeline__scale { min-width: 460px; }
/* A sliver of a leg still has to be clickable and carry its mode colour. */
.bxt-timeline .bx-timeline__leg { min-width: 14px; padding: 0 4px; }
/* Edge stations anchor inwards so the first and last labels are never clipped. */
.bxt-timeline .bx-timeline__station[data-edge="start"] { transform: none; align-items: flex-start; }
.bxt-timeline .bx-timeline__station[data-edge="end"]   { transform: translateX(-100%); align-items: flex-end; }
.bxt-timeline .bx-timeline__station-label {
  max-width: 128px; overflow: hidden; text-overflow: ellipsis;
  background: var(--plate); padding: 0 3px; border-radius: 2px;   /* stays legible over a neighbouring dot */
}
/* Stations sit above the axis so their labels never run into the leg bars. */
.bxt-timeline { padding-top: var(--s-6); }
.bxt-timeline .bx-timeline__station { top: -20px; flex-direction: column-reverse; }
.bxt-tl-cursor {
  position: absolute; top: 12px; bottom: 0; width: 2px;
  background: var(--brand); pointer-events: none; z-index: 3;
}
.bxt-tl-cursor::before {
  content: ""; position: absolute; top: -5px; left: -4px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--brand);
}
.bxt-tl-damage {
  position: absolute; top: 92px; transform: translateX(-50%);
  width: 8px; height: 8px; border-radius: 50%;
  border: 1px solid var(--plate); background: var(--warn); z-index: 2;
}
.bxt-tl-damage[data-severity="major"]   { background: var(--fail); }
.bxt-tl-damage[data-severity="failure"] { background: var(--fail); box-shadow: 0 0 0 3px var(--fail-tint); }
.bxt-tl-detail-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; font-size: 13.5px; }
.bxt-tl-cell { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bxt-tl-damage-note { margin-top: 10px; }
.bxt-tag {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 2px 7px; border-radius: var(--r-pill);
  border: 1px solid var(--rule-strong); color: var(--ink-mute); background: var(--plate);
}
.bxt-tag[data-kind="event"] { border-color: var(--warn); color: var(--warn); }
.bxt-tag[data-kind="dwell"] { border-style: dashed; }
.bxt-tag[data-risk="pass"] { border-color: var(--pass); color: var(--pass); }
.bxt-tag[data-risk="warn"] { border-color: var(--warn); color: var(--warn); }
.bxt-tag[data-risk="fail"] { border-color: var(--fail); color: var(--fail); }

/* ── simulation-mode selector (Transit trial · ISTA 1A) ───────────────── */

.bxt-mode .bx-plate__body { gap: 10px; }
.bxt-mode .bx-seg { flex-wrap: wrap; }
.bxt-mode .bx-seg__btn { white-space: normal; text-align: left; }
.bxt-mode__desc { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); max-width: 72ch; }
.bxt-mode__prov { display: inline-flex; }
.bxt-mode__prov:empty { display: none; }

/* ── simulation stage ──────────────────────────────────────────────────── */

.bxt-run { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.bxt-sum-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--s-4); }
.bxt-sum .bx-plate__body { gap: 6px; }
.bxt-sum__row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: baseline; gap: 6px 10px;
  padding: 5px 0; border-bottom: 1px solid var(--rule);
  font-size: 12.5px;
}
.bxt-sum__row:last-child { border-bottom: 0; }
.bxt-sum__k { color: var(--ink-mute); white-space: nowrap; }
.bxt-sum__v {
  font-family: var(--font-mono); font-size: 12.5px; font-variant-numeric: tabular-nums;
  text-align: right; min-width: 0; overflow-wrap: anywhere;
}

/* The run overlay reuses the host `.processing` chrome verbatim; it only needs
   to sit above the module's toasts and modals. */
.bxt-processing { z-index: 950; }

/* ── dark visualisation theme ──────────────────────────────────────────── */

/* The shell's dark block re-colours .bx-plate / .bx-kpi / .bx-table inside
   .bx-viz; the headings, notes and the timeline chrome this stage adds need
   the same treatment, so they are covered here under our own .bxt-viz hook. */
.bx-root[data-theme="dark"] .bxt-viz .bx-section-head__title,
.bx-root[data-theme="dark"] .bxt-viz .bx-plate__title,
.bx-root[data-theme="dark"] .bxt-viz .bxt-profile__label,
.bx-root[data-theme="dark"] .bxt-viz .bxt-tl-detail-head,
.bx-root[data-theme="dark"] .bxt-viz .bxt-tl-detail-head strong,
.bx-root[data-theme="dark"] .bxt-viz .bx-timeline__detail-v,
.bx-root[data-theme="dark"] .bxt-viz .bxt-provlist__name { color: var(--bx-viz-ink); }
.bx-root[data-theme="dark"] .bxt-viz .bx-section-head__sub,
.bx-root[data-theme="dark"] .bxt-viz .bx-plate__sub,
.bx-root[data-theme="dark"] .bxt-viz .bx-note,
.bx-root[data-theme="dark"] .bxt-viz .bx-timeline__detail-k,
.bx-root[data-theme="dark"] .bxt-viz .bx-timeline__station-label,
.bx-root[data-theme="dark"] .bxt-viz .bxt-provlist__note,
.bx-root[data-theme="dark"] .bxt-viz .bxt-profile__cite,
.bx-root[data-theme="dark"] .bxt-viz .bxt-profile__src { color: var(--bx-viz-mute); }
.bx-root[data-theme="dark"] .bxt-viz .bx-timeline__detail {
  background: var(--bx-viz-bg); border-color: var(--bx-viz-rule);
}
.bx-root[data-theme="dark"] .bxt-viz .bx-timeline__station-dot {
  background: var(--bx-viz-plate); border-color: var(--bx-viz-mute);
}
.bx-root[data-theme="dark"] .bxt-viz .bx-timeline__station-label,
.bx-root[data-theme="dark"] .bxt-viz .bx-timeline__event { border-color: var(--bx-viz-plate); }
.bx-root[data-theme="dark"] .bxt-viz .bx-timeline__station-label { background: var(--bx-viz-plate); }
.bx-root[data-theme="dark"] .bxt-viz .bx-timeline__axis { background: var(--bx-viz-rule); }
.bx-root[data-theme="dark"] .bxt-viz .bxt-provlist__item { border-bottom-color: var(--bx-viz-rule); }

.bx-root[data-theme="dark"] .bx-viz .bxt-profile,
.bx-root[data-theme="dark"] .bx-viz .bxt-events,
.bx-root[data-theme="dark"] .bx-viz .bxt-chart { background: var(--bx-viz-plate); border-color: var(--bx-viz-rule); }
.bx-root[data-theme="dark"] .bx-viz .bxt-prov-line,
.bx-root[data-theme="dark"] .bx-viz .bxt-stat__k,
.bx-root[data-theme="dark"] .bx-viz .bxt-sum__k { color: var(--bx-viz-mute); }
.bx-root[data-theme="dark"] .bx-viz .bxt-code,
.bx-root[data-theme="dark"] .bx-viz .bxt-prov-line__src { background: #1f2430; border-color: var(--bx-viz-rule); }

/* ── responsive ────────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .bxt-sum-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .bxt-profile__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bxt-leg__tools { width: 100%; }
  .bxt-sum__row { grid-template-columns: minmax(0, 1fr) auto; }
  .bxt-sum__row .bx-prov { grid-column: 2; }
}

/* ============================================================================
   End of fe-transit block.
   ============================================================================ */

/* ============================================================================
   BEGIN fe-config block (owner: fe-config, stages-config.js)
   Configuration stages: product · primary · secondary · outer · stacking.
   Namespace .bxc-*; nothing above this line is modified.
   ============================================================================ */

/* ─────────────────────────────────────────── stage scaffold & preview tag ── */

.bxc-stage { align-items: start; }
.bxc-stage > .bx-stage-foot { grid-column: 1 / -1; margin-top: 0; }
.bxc-form { gap: var(--s-4); }
.bxc-viz { gap: var(--s-3); }
.bxc-viz__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.bxc-canvas { aspect-ratio: 4 / 3; min-height: 300px; }

/* viewer.js paints its legend and damage strip on their own absolutely
   positioned canvases.  The shell's `.bx-viz__canvas canvas { width:100%;
   height:100% }` rule matches those too and stretched the compression legend
   over the whole viewport (its `bottom:10px` then pushed the title off the top
   edge).  Re-assert the viewer's own geometry, scoped to the config viewports
   so no other stage is affected. */
.bxc-canvas > canvas.bxv-gl { width: 100%; height: 100%; }
.bxc-canvas > canvas.bxv-legend { width: 230px; height: 52px; }
.bxc-canvas > canvas.bxv-legend.bxv-legend--fea { width: 142px; height: min(72%, 340px); }
.bxc-canvas > canvas.bxv-dmg { width: auto; height: auto; max-width: 70%; }
.bxc-note { min-height: 16px; }

.bxc-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: hsl(var(--bx-h-engineering_assumption) 70% 26%);
  background: hsl(var(--bx-h-engineering_assumption) 85% 92%);
  border: 1px solid hsl(var(--bx-h-engineering_assumption) 60% 72%);
  white-space: nowrap;
}
.bxc-tag::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.bxc-preview {
  display: flex; align-items: flex-start; gap: var(--s-3);
  padding: 12px 14px; border-radius: var(--r-sm);
  background: hsl(var(--bx-h-engineering_assumption) 85% 96%);
  border: 1px solid hsl(var(--bx-h-engineering_assumption) 60% 80%);
}
.bxc-preview[hidden] { display: none; }
.bxc-preview strong { display: block; font-size: 13.5px; color: var(--ink); }
.bxc-preview p { margin: 4px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }

/* ─────────────────────────────────────────────────────── viewer toolbar ── */

.bxc-toolbar { gap: var(--s-3) var(--s-4); }
.bxc-toolbar__group { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bxc-toolbar__label { font-size: 11.5px; color: var(--bx-viz-mute); white-space: nowrap; }
.bxc-range { width: 108px; accent-color: var(--brand); cursor: pointer; }

.bxc-kpi-block { display: flex; flex-direction: column; gap: 8px; }
.bxc-kpi-title {
  margin: 0; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--bx-viz-mute);
}
.bxc-kpis { grid-template-columns: repeat(auto-fit, minmax(136px, 1fr)); }

/* ────────────────────────────────────────────── product stage read-outs ── */

.bxc-drop { min-height: 120px; }
.bxc-drop strong { font-size: 14px; color: var(--ink); }
.bxc-intake__actions { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-3); }
.bxc-intake__status { margin-top: 8px; min-height: 18px; }

.bxc-ro { display: flex; flex-direction: column; gap: 0; }
.bxc-ro__row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center; gap: var(--s-3);
  padding: 7px 0; border-bottom: 1px dashed var(--rule);
}
.bxc-ro__row:last-child { border-bottom: 0; }
.bxc-ro__k { font-size: 13px; color: var(--ink-2); min-width: 0; }
.bxc-ro__v { font-size: 13px; color: var(--ink); white-space: nowrap; }

/* ────────────────────────────────────── partition-cell diagram card ── */

.bxc-cell {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px; border: 1px solid var(--rule); border-radius: var(--r-sm);
  background: var(--plate); color: var(--ink);
  margin-bottom: var(--s-3);
}
.bxc-cell .bxc-dia { max-width: 420px; }
.bxc-cell__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 10.5px; color: var(--ink-mute); }

/* ─────────────────────────────────────── (legacy) config picker cards ── */

.bxc-configs { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: var(--s-3); }
.bxc-config {
  display: flex; flex-direction: column; gap: 8px; text-align: left;
  padding: 12px; border: 1px solid var(--rule); border-radius: var(--r-sm);
  background: var(--plate); color: var(--ink); cursor: pointer; font: inherit;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.bxc-config:hover { border-color: var(--rule-strong); background: var(--plate-2); }
.bxc-config.is-active { border-color: var(--brand); background: var(--brand-tint-2); box-shadow: inset 0 0 0 1px var(--brand); }
.bxc-config:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.bxc-config__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bxc-config__letter {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px; flex: none;
  background: var(--ink); color: var(--paper);
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
}
.bxc-config.is-active .bxc-config__letter { background: var(--brand); }
.bxc-config__title { font-size: 12.5px; font-weight: 600; line-height: 1.3; min-width: 0; }
.bxc-config__badge {
  padding: 1px 6px; border-radius: 999px; flex: none;
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase;
  color: hsl(12 70% 32%); background: hsl(12 85% 94%); border: 1px solid hsl(12 65% 78%);
}
.bxc-config__desc { display: block; font-size: 11.5px; line-height: 1.45; color: var(--ink-mute); }
.bxc-config__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 10.5px; color: var(--ink-mute); }
.bxc-config__custom {
  display: flex; align-items: center; justify-content: center;
  height: 62px; border-radius: var(--r-sm); border: 1px dashed var(--rule-strong);
  background: var(--paper); font-size: 26px; color: var(--ink-mute);
}

/* Inline SVG diagrams: colours follow the module tokens, not the raw palette. */
.bxc-dia { display: block; width: 100%; height: auto; }
.bxc-dia__box { fill: var(--paper); stroke: var(--rule-strong); stroke-width: 1.2; }
.bxc-dia__cap { fill: var(--ink-mute); font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.06em; text-transform: uppercase; }
.bxc-dia__carton { fill: hsl(var(--bx-h-literature) 45% 93%); stroke: hsl(var(--bx-h-literature) 40% 62%); stroke-width: 0.9; }
.bxc-dia__bottle { fill: hsl(148 40% 84%); stroke: hsl(148 45% 34%); stroke-width: 0.9; }
.bxc-dia__spiral { fill: none; stroke: hsl(148 45% 34%); stroke-width: 1.1; stroke-linecap: round; }
.bxc-dia__wall { stroke: var(--rule-strong); stroke-width: 1.6; stroke-linecap: square; }
.bxc-dia__slab { fill: hsl(148 40% 84%); stroke: hsl(148 45% 34%); stroke-width: 0.6; }
.bxc-dia__load, .bxc-dia__flow { stroke: var(--fail); stroke-width: 1.4; fill: none; stroke-linecap: round; }
.bxc-dia__flow { stroke-dasharray: 2.5 2.2; opacity: 0.85; }
.bxc-dia__loadhead { fill: var(--fail); }

.bxc-mode {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-top: var(--s-3); padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--plate-2); border-left: 3px solid var(--pass);
}
.bxc-mode[data-worst="yes"] { border-left-color: var(--fail); }
.bxc-mode__k { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink); }
.bxc-mode__v { font-size: 12.5px; line-height: 1.5; color: var(--ink-2); min-width: 0; }

/* ──────────────────────────────────────────── stacking legend & footer ── */

.bxc-legendkeys { display: flex; flex-direction: column; gap: 8px; }
.bxc-legendkey { display: flex; align-items: flex-start; gap: 10px; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.bxc-swatch { flex: none; width: 16px; height: 16px; border-radius: 4px; margin-top: 1px; border: 1px solid var(--rule-strong); }
.bxc-swatch--path { background: linear-gradient(180deg, transparent 38%, var(--fail) 38%, var(--fail) 62%, transparent 62%); }
.bxc-swatch--cog { border-radius: 50%; background: #f2d21f; }
.bxc-swatch--contact { background: repeating-linear-gradient(45deg, var(--rule-strong) 0 2px, transparent 2px 4px); }
.bxc-swatch--util { background: linear-gradient(90deg, #1f4de0, #1fb35c, #f2d21f, #f28a1f, #d81f1f); }

.bxc-foot__right { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; justify-content: flex-end; }

/* ──────────────────────────────────────────────── dark visualisation ── */

.bx-root[data-theme="dark"] .bxc-viz .bxc-kpi-title,
.bx-root[data-theme="dark"] .bxc-viz .bxc-toolbar__label { color: var(--bx-viz-mute); }
.bx-root[data-theme="dark"] .bxc-viz .bxc-tag {
  color: hsl(var(--bx-h-engineering_assumption) 80% 74%);
  background: hsl(var(--bx-h-engineering_assumption) 40% 16%);
  border-color: hsl(var(--bx-h-engineering_assumption) 40% 32%);
}

/* ─────────────────────────────────────────────────────────── responsive ── */

@media (max-width: 1100px) {
  .bxc-viz { position: static; }
  .bxc-canvas { min-height: 260px; }
}
@media (max-width: 760px) {
  .bxc-configs { grid-template-columns: minmax(0, 1fr); }
  .bxc-ro__row { grid-template-columns: minmax(0, 1fr) auto; }
  .bxc-ro__row .bx-prov { grid-column: 2; }
  .bxc-foot__right { width: 100%; justify-content: space-between; }
}

/* ============================================================================
   END fe-config block
   ============================================================================ */

/* ============================================================================
   BEGIN results block (carried over from the bottle module for frontend/biscuit_transit/stages-results.js, owner I7)

   Results / Validation / Final-report stages (SPEC §5.4, §7.3, §7.5, §7.6).
   Everything here is namespaced `.bxr-*` (plus two `.bx-demo-flag` / `.bx-kv`
   primitives the module needs) so nothing collides with the shell block above.
   ============================================================================ */

.btr { display: flex; flex-direction: column; gap: var(--s-5); min-width: 0; }

/* Small primitives shared by the three stages */
.bx-demo-flag {
  display: inline-flex; align-items: center;
  font: 600 10px/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 7px; border-radius: var(--r-pill);
  color: var(--warn); background: var(--warn-tint); border: 1px solid var(--warn);
}
.bx-kv { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.bx-kv__k { color: var(--ink-mute); }
.bx-kv__v { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink); }

.bxr-status {
  display: inline-flex; align-items: center; gap: 5px;
  font: 600 10.5px/1 var(--font-mono); letter-spacing: 0.08em;
  padding: 4px 7px; border-radius: var(--r-pill);
  color: var(--pass); background: var(--pass-tint); border: 1px solid currentColor;
  white-space: nowrap;
}
.bxr-status[data-status="warn"] { color: var(--warn); background: var(--warn-tint); }
.bxr-status[data-status="fail"] { color: var(--fail); background: var(--fail-tint); }

/* ── 3D inspector ────────────────────────────────────────────────────────── */

.bxr-inspector { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 300px); gap: var(--s-4); align-items: start; }
.bxr-inspector__view { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.bxr-inspector__side { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.bxr-viewer {
  height: clamp(320px, 52vh, 560px);
  background: var(--bx-viz-bg); border: 1px solid var(--bx-viz-rule); border-radius: var(--r-sm);
}
.bxr-viewer-note { min-height: 1em; font-family: var(--font-mono); font-size: 11.5px; }
.bxr-loadbar { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.bxr-loadview { margin: 0; padding: 6px 10px; border-left: 3px solid var(--accent, #2f6fed); background: color-mix(in srgb, var(--accent, #2f6fed) 8%, transparent); border-radius: var(--r-sm); }
.bxr-loadview[data-custom="true"] { border-left-color: var(--ink-mute); background: transparent; }
.bxr-det__stamp { margin: 0; }
.bxr-var-desc { margin: 0; }
.bxr-legend__ticks { gap: 4px; }
.bxr-legend__foot { display: flex; justify-content: space-between; gap: 8px; font-size: 10.5px; color: var(--ink-mute); }
.bxr-legend__ck { white-space: nowrap; }
.bxr-legend__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bxr-markers { display: flex; flex-direction: column; gap: 6px; font-size: 12px; }

.bxr-ctls { display: flex; flex-direction: column; gap: var(--s-2); padding-top: var(--s-2); border-top: 1px solid var(--rule); }
.bxr-ctl { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-width: 0; }
.bxr-ctl__label { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: baseline; gap: 4px; flex-shrink: 0; white-space: nowrap; }
.bxr-ctl__label small { color: var(--ink-mute); font-size: 11px; }
.bxr-ctl .bx-select, .bxr-ctl .bx-input { max-width: 160px; }
/* VIEW-8: a "Show" variable this run's payload lacks (the per-biscuit journey peak / sustained stack-load stress) stays listed, greyed out */
.bxr-ctl .bx-select option:disabled, .bxr-ctl select option:disabled { color: var(--ink-mute, #8a93a0); opacity: 0.55; }
.bxr-ctl .bx-seg { flex: 0 1 auto; min-width: 0; justify-content: flex-end; }
/* A control whose options cannot share a row with its label (the six "What" levels): label above, options below, full width. */
.bxr-ctl--stack { flex-direction: column; align-items: stretch; gap: 6px; }
.bxr-ctl--stack .bx-seg { justify-content: flex-start; }
.bxr-range { width: 150px; padding: 0; background: transparent; border: 0; accent-color: var(--brand); }
/* VIEW-6: what each level stands for (counts from the hierarchy / result), under the level tabs */
.bxr-counts { font-size: 11.5px; line-height: 1.45; font-variant-numeric: tabular-nums; margin: -2px 0 0; }
/* the most-susceptible table (VIEW-7): fixed column widths so it fits the plate at 1,440 px — every cell wraps, nothing scrolls
   sideways; numbers stay tabular */
.bxr-sus { overflow-x: visible; }
.bxr-sus .bx-table { table-layout: fixed; width: 100%; }
.bxr-sus th, .bxr-sus td { white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
.bxr-sus th { line-height: 1.3; }
.bxr-sus td:nth-child(4), .bxr-sus td:nth-child(5), .bxr-sus td:nth-child(6) { font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .bxr-sus { overflow-x: auto; } .bxr-sus .bx-table { table-layout: auto; min-width: 640px; } }

/* ── 3-D inspector legend band (viewer.js, FE-deck layout as the bottle inspector) ───────────── */
.bxv-host { display: flex; flex-direction: column; min-width: 0; }
.bxv-host > canvas.bxv-gl { display: block; flex: 1 1 auto; min-height: 0; }
.bxv-legend-band { flex: 0 0 auto; padding: 8px 12px 10px; border-top: 1px solid var(--bx-viz-rule, rgba(255,255,255,0.08)); display: grid; gap: 4px; }
.bxv-legend-band .bx-legend__title { align-items: baseline; }
.bxv-legend__bar { display: flex; height: 12px; border-radius: 2px; overflow: hidden; border: 1px solid rgba(0, 0, 0, 0.3); background: none; }
.bxv-legend__seg { flex: 1 1 0; min-width: 0; }
.bxv-legend__ticks { display: flex; justify-content: space-between; gap: 4px; font-family: var(--font-mono, ui-monospace, Menlo, monospace); font-size: 10.5px; font-variant-numeric: tabular-nums; color: var(--ink-mute); }
.bxv-legend__ticks span { flex: 1 1 0; min-width: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bxv-legend__ticks span:first-child { text-align: left; }
.bxv-legend__ticks span:last-child { text-align: right; }
.bxv-legend__event { font-size: 11px; line-height: 1.4; color: var(--ink-mute); }
.bxv-legend-band[data-nq="true"] .bxv-legend__bar { opacity: 0.25; }
.bx-root[data-theme="dark"] .bxv-legend-band, .bxv-host[data-theme="dark"] .bxv-legend-band { color: var(--bx-viz-ink, #e6ebf0); }


/* ── per-level KPI strip ─────────────────────────────────────────────────── */

.bxr-kpi-levels { display: flex; flex-direction: column; gap: var(--s-4); }
.bxr-kpi-level { display: flex; flex-direction: column; gap: var(--s-2); }
.bxr-kpi-level__head { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.bxr-kpi-level__title { margin: 0; font-size: 14px; letter-spacing: -0.01em; }
.bxr-kpi-level__where { font-size: 11.5px; color: var(--ink-mute); }

/* ── journey scrubber ────────────────────────────────────────────────────── */

.bxr-timeline-host { min-width: 0; }
.bxr-scrubber { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; padding: var(--s-3) 0; }
.bxr-scrubber__controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.bxr-scrubber__track { flex: 1 1 320px; display: flex; flex-direction: column; gap: 4px; min-width: 240px; }
.bxr-scrub { width: 100%; padding: 0; background: transparent; border: 0; accent-color: var(--brand); }
.bxr-scrub__stamp { font-size: 11px; color: var(--ink-mute); }
.bxr-tl-cursor { position: absolute; top: 14px; bottom: 6px; width: 2px; background: var(--brand); transform: translateX(-1px); pointer-events: none; z-index: 3; }
.bxr-tl-cursor__flag {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  font: 500 10px/1 var(--font-mono); white-space: nowrap;
  padding: 2px 5px; border-radius: 3px; background: var(--brand); color: #fff;
}

/* ── charts ──────────────────────────────────────────────────────────────── */

.bxr-chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: var(--s-4); }
.bxr-chart { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bxr-chart__cap { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.bxr-chart__title { font-size: 13px; font-weight: 600; }
.bxr-chart__sub { font-size: 11px; color: var(--ink-mute); }
.bxr-chart__canvas {
  display: block; width: 100%; height: 240px;
  border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--plate);
}
.bxr-chart__canvas:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.bxr-seg-picker { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-2); }

/* ── expandable panels ───────────────────────────────────────────────────── */

.bxr-panel { border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--paper); }
.bxr-panel + .bxr-panel { margin-top: var(--s-3); }
.bxr-panel__summary {
  display: flex; align-items: baseline; gap: var(--s-3); flex-wrap: wrap;
  padding: 11px 14px; cursor: pointer; list-style: none; user-select: none;
}
.bxr-panel__summary::-webkit-details-marker { display: none; }
.bxr-panel__summary::before {
  content: "▸"; color: var(--ink-mute); font-size: 11px; transition: transform var(--t-fast);
}
.bxr-panel[open] > .bxr-panel__summary::before { transform: rotate(90deg); }
.bxr-panel__title { font-size: 13.5px; font-weight: 600; }
.bxr-panel__sub { font-size: 11.5px; color: var(--ink-mute); }
.bxr-panel__body { padding: 0 14px 14px; }

/* ── deterioration panel ─────────────────────────────────────────────────── */

.bxr-det__head { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.bxr-det__readout {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 6px var(--s-4);
  padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--plate-2);
}
.bxr-det__readout:empty { display: none; }

/* ── damage log ──────────────────────────────────────────────────────────── */

.bxr-damage { display: flex; flex-direction: column; gap: var(--s-3); }
.bxr-damage__summary { display: flex; gap: var(--s-5); flex-wrap: wrap; }
.bxr-damage__summary:empty { display: none; }
.bxr-damage__kind { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.bxr-nodamage {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px; border-radius: var(--r-sm);
  border: 1px solid var(--pass); border-left-width: 3px; background: var(--pass-tint);
  font-size: 13px; color: var(--ink);
}
.bxr-nodamage strong { font-size: 14px; }

/* ── validation ──────────────────────────────────────────────────────────── */

.bxr-notes { display: flex; flex-direction: column; gap: 8px; }
.bxr-note-row { display: grid; grid-template-columns: minmax(160px, 260px) minmax(0, 1fr); gap: var(--s-3); font-size: 12.5px; }
.bxr-note-row__k { font-weight: 600; color: var(--ink-2); }
.bxr-note-row__v { color: var(--ink-mute); line-height: 1.5; }
.bxr-factors { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--s-3); }
.bxr-factor { margin: 0; padding: 12px 14px; border: 1px solid var(--rule); border-left: 3px solid var(--brand-2); border-radius: var(--r-sm); background: var(--plate); }
.bxr-factor__head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.bxr-factor__name { font-size: 13px; font-weight: 600; }
.bxr-factor__value { font-size: 14px; color: var(--brand); }
.bxr-factor__why { margin: 0; font-size: 12.5px; color: var(--ink-mute); line-height: 1.55; }
.bxr-summary { margin: 0 0 var(--s-3); font-size: 13.5px; line-height: 1.6; color: var(--ink-2); max-width: 78ch; }
.bxr-limits { margin: 0; padding-left: 1.1em; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--ink-mute); line-height: 1.55; max-width: 84ch; }

/* ── report (in-flow, SPEC §7.6 — never a document frame) ────────────────── */

.bxr-report__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
.bxr-report__title { margin: 4px 0 6px; font-size: 22px; letter-spacing: -0.02em; }
.bxr-report__actions { display: flex; gap: 8px; flex-shrink: 0; }
.bxr-prose { display: flex; flex-direction: column; gap: 10px; max-width: 80ch; }
.bxr-prose p { margin: 0; font-size: 13.5px; line-height: 1.65; color: var(--ink-2); }
.bxr-provbox { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--plate-2); }
.bxr-provbox__row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; }
.bxr-provbox__k { color: var(--ink-2); }
.bxr-provbox__note { color: var(--ink-mute); }
.bxr-report__figs { display: flex; flex-direction: column; gap: var(--s-3); }
.bxr-report__figs-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.bxr-report__pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--s-4); }
.bxr-report__fig { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bxr-report__viewer {
  height: clamp(260px, 36vh, 400px);
  background: var(--bx-viz-bg); border: 1px solid var(--bx-viz-rule); border-radius: var(--r-sm);
}

/* ── dark visualisation theme ────────────────────────────────────────────── */

.bx-root[data-theme="dark"] .bxr-chart__canvas,
.bx-root[data-theme="dark"] .bxr-panel { background: var(--bx-viz-plate); border-color: var(--bx-viz-rule); }

/* ── responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .bxr-inspector { grid-template-columns: minmax(0, 1fr); }
  .bxr-viewer { height: clamp(280px, 44vh, 420px); }
  .bxr-chart-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .bxr-note-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .bxr-scrubber__controls { width: 100%; }
  .bxr-report__pair { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .bxr-panel__summary::before { transition: none; }
}

/* ============================================================================
   END fe-results block
   ============================================================================ */

/* ============================================================================
   BEGIN fe-results append-2 · SPEC §8.2 (never render an empty chart frame)
   Owner: fe-results.  Appended block, additive only.
   ============================================================================ */

/* A chart with no data hides itself (charts.js sets `data-chart-empty` and
   takes the canvas out of the flow). These rules take the *card* with it, so
   no caption, border or placeholder box is left behind. */
.bxr-chart__canvas[data-chart-empty="true"] { display: none !important; }
.bxr-chart.is-empty,
.bxr-chart:has(> canvas[data-chart-empty="true"]) { display: none !important; }

/* A chart group whose charts have all gone is dropped whole (§8.2). */
.bxr-panel--charts.is-empty { display: none !important; }

/* The chart-group column: the panels keep their own spacing rules, so this
   only has to space the segment picker and the one explanatory line. */
.bxr-chart-groups > .bxr-seg-picker { margin-bottom: var(--s-3); }
.bxr-charts-none[hidden],
.bxr-det__none[hidden] { display: none !important; }
.bxr-charts-none { margin: 0; }

/* ============================================================================
   END fe-results append-2
   ============================================================================ */

/* ── Embedded panels: shell stages rendered beneath the host's own
   Transit / Results / Report content. The host owns the page chrome. ───────── */
.bx-root.bx-embed { margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--rule); }
.bx-embed .bx-embed__stage + .bx-embed__stage { margin-top: var(--s-6); }
.bx-embed .bx-mode-plate { margin-bottom: var(--s-5); }
.bx-embed .bx-mode-plate .seg-control { margin-top: var(--s-3); }

/* ============================================================================
   BEGIN fe-results append-3 · focused panels (SPEC §9 embedded stages)
   Owner: fe-results.  Appended block, additive only.

   Results: four tab groups (Overview · 3D inspector · Deterioration & charts ·
   Positions & details), one shown at a time.  Report page: Validation /
   Transit trial report switcher.  Transit: collapsible blocks so the mode
   selector and the legs come first.  Nothing is removed, only organised.
   ============================================================================ */

/* ── tab bar (results tabs and the report switcher share it) ─────────────── */
.bxr-tabbar {
  position: sticky; top: 0; z-index: 6;
  margin: 0 0 var(--s-2);
  padding: var(--s-2) 0 var(--s-2);
  background: var(--paper);
  box-shadow: 0 1px 0 var(--rule);
}
.bxr-tabbar .bx-tabs { border-bottom: 0; gap: 4px; }
.bxr-tabbar .bx-tab { font-size: 13px; padding: 8px 12px; }
.bxr-tabbar__help {
  margin: 6px 0 0;
  font-size: 12.5px; line-height: 1.5;
  color: var(--ink-mute);
}
.bx-embed__tabbar { margin-bottom: var(--s-4); }
.bx-embed .bx-mode-plate + .bx-embed__tabbar { margin-top: 0; }

/* ── tab panes ───────────────────────────────────────────────────────────── */
.bxr-pane { display: flex; flex-direction: column; gap: var(--s-5); min-width: 0; }
.bxr-pane[hidden],
.bx-embed .bx-embed__stage[hidden] { display: none !important; }
/* The panes carry the section spacing now; keep the stage foot at its distance. */
.btr > .bxr-pane + .bx-stage-foot { margin-top: var(--s-2); }

/* Shortcuts on the Overview damage plate. */
.bxr-jump { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s-3); }
.bxr-damage__summary:empty { display: none; }

/* ── transit: collapsible blocks ─────────────────────────────────────────── */
.bxt-fold { border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--plate); min-width: 0; }
.bxt-fold__summary {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; cursor: pointer; list-style: none; user-select: none;
}
.bxt-fold__summary::-webkit-details-marker { display: none; }
.bxt-fold__summary::before {
  content: "▸"; color: var(--ink-mute); font-size: 11px; line-height: 1;
  transition: transform 120ms ease; display: inline-block;
}
.bxt-fold[open] > .bxt-fold__summary::before { transform: rotate(90deg); }
.bxt-fold__summary:hover .bxt-fold__title { color: var(--brand); }
.bxt-fold__title { font-size: 13.5px; font-weight: 600; }
.bxt-fold__hint { font-size: 11.5px; color: var(--ink-mute); overflow-wrap: anywhere; }
.bxt-fold__body { display: flex; flex-direction: column; gap: var(--s-4); padding: 0 14px 14px; min-width: 0; }
/* A plate folded inside the block keeps its content but not its own frame. */
.bxt-fold__body > .bx-plate { border: 0; padding: 0; background: transparent; }
/* Inside a leg card the block is a lighter divider, not a second frame. */
.bxt-fold--leg { background: transparent; border-color: var(--rule); }
.bxt-fold--leg > .bxt-fold__summary { padding: 10px 12px; }
.bxt-fold--leg > .bxt-fold__body { padding: 0 12px 12px; }
.bx-root[data-theme="dark"] .bx-viz .bxt-fold { background: var(--bx-viz-plate); border-color: var(--bx-viz-rule); }

@media (prefers-reduced-motion: reduce) {
  .bxt-fold__summary::before { transition: none; }
}
@media (max-width: 720px) {
  .bxr-tabbar { position: static; }
}

/* ============================================================================
   END fe-results append-3
   ============================================================================ */

/* ============================================================================
   ui-integration block — rules for shell classes the stage modules render but
   no block above styles (option cards, shell rail, folds, read-outs, the
   "not quantified" marker, tagged numbers). Namespace .bx-*; appended only.
   ============================================================================ */

.bx-rail { display: flex; flex-wrap: wrap; gap: 4px; margin: var(--s-4, 16px) 0; padding: 4px; border: 1px solid var(--rule); border-radius: 10px; background: var(--plate, #fff); }
.bx-rail__item { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); font: inherit; font-size: 13px; cursor: pointer; }
.bx-rail__item:hover { background: var(--brand-tint); }
.bx-rail__item.active { background: var(--brand); color: #fff; }
.bx-rail__dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--ink-mute); background: transparent; flex-shrink: 0; }
.bx-rail__item[data-state="complete"] .bx-rail__dot { background: var(--pass); border-color: var(--pass); }
.bx-rail__item[data-state="incomplete"] .bx-rail__dot { background: var(--warn); border-color: var(--warn); }
.bx-rail__item[data-state="stale"] .bx-rail__dot { background: transparent; border-color: var(--warn); border-style: dashed; }
.bx-rail__item.active .bx-rail__dot { border-color: #fff; }
.bx-rail__missing { font-size: 11px; color: var(--ink-mute); }
.bx-rail__item.active .bx-rail__missing { color: #fff; }

.bx-cards { display: grid; grid-template-columns: repeat(var(--bx-card-cols, auto-fill), minmax(150px, 1fr)); gap: 8px; }
.bx-cards--sm { grid-template-columns: repeat(var(--bx-card-cols, auto-fill), minmax(120px, 1fr)); }
.bx-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; text-align: left; border: 1px solid var(--rule); border-radius: 10px; background: var(--plate, #fff); color: var(--ink); font: inherit; cursor: pointer; }
.bx-card:hover { border-color: var(--brand); }
.bx-card[aria-checked="true"] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; background: var(--brand-tint); }
.bx-card:disabled { opacity: .5; cursor: not-allowed; }
.bx-card__glyph { font-size: 20px; line-height: 1; color: var(--brand); }
.bx-card__label { font-weight: 600; font-size: 13.5px; }
.bx-card__desc { font-size: 12px; color: var(--ink-mute); line-height: 1.4; }
.bx-card__badge { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-mute); }

.bx-btn__label { white-space: nowrap; }
.bx-field__req { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-mute); margin-left: 6px; }
.bx-field__chip { display: inline-flex; margin-left: 6px; }

.bx-fold { border: 1px solid var(--rule); border-radius: 10px; margin: 10px 0; background: var(--plate, #fff); }
.bx-fold__summary { display: flex; align-items: baseline; gap: 10px; padding: 10px 14px; cursor: pointer; list-style-position: inside; }
.bx-fold__title { font-weight: 600; font-size: 13.5px; }
.bx-fold__hint { font-size: 12px; color: var(--ink-mute); }
.bx-fold__body { padding: 0 14px 14px; }

.bx-ro { display: flex; flex-direction: column; gap: 2px; }
.bx-ro__row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dashed var(--rule); font-size: 13px; }
.bx-ro__k { color: var(--ink-mute); }
.bx-ro__v { text-align: right; }

.bx-nq { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-mute); font-style: italic; }
.bx-nq__dot { width: 6px; height: 6px; border-radius: 50%; border: 1px solid var(--ink-mute); }
.bx-nq--compact { font-size: 11.5px; }
.bx-tagged { display: inline-flex; align-items: center; gap: 6px; }
.bx-warn { color: var(--warn); }
.bx-fail { color: var(--fail); }

/* neck-finish drawing (stages-config.js) */
.bxc-finish__svg { display: block; width: 100%; max-width: 360px; height: auto; margin: 8px auto; }
.bxc-finish__wall { fill: hsl(148 40% 88%); stroke: hsl(148 45% 34%); stroke-width: 1.2; }
.bxc-finish__bore { fill: var(--paper, #fff); stroke: var(--rule-strong, #999); stroke-width: 0.8; }
.bxc-finish__crest { fill: hsl(148 45% 34%); }
.bxc-finish__dim { stroke: var(--ink-mute); stroke-width: 0.8; }
.bxc-finish__txt { fill: var(--ink-2, #333); font-family: var(--font-mono); font-size: 10px; }
.bxc-finish__txt--foot { fill: var(--ink-mute); font-size: 9px; }

/* The host's JS-fail safety net keeps the first stage page (Intake) rendered on
   every route, pushing #/biscuit/<stage> below the fold. Collapse it while the
   biscuit page is the active one (same rule as the other family shells). */
body:has(.stage-page[data-page="biscuit"].active)
  main.canvas > section.stage-page:first-of-type:not(.active) {
  display: none;
}

/* ── Closure stage: part cards, securing chain, card progress (classes used by stages-closure.js / stages-config.js) ── */
.bxc-completeness:empty { display: none; }
.bxc-complete { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--ink-2); margin-bottom: var(--s-2, 8px); }
.bxc-complete .bx-rail__dot { flex: 0 0 auto; margin-top: 5px; }
.bxc-parts { display: flex; flex-direction: column; gap: var(--s-3, 12px); }
.bxc-part { border: 1px solid var(--rule); border-radius: var(--r-sm, 6px); padding: 10px 12px; background: var(--plate); }
.bxc-part[data-envelope="1"] { border-color: var(--warn); }
.bxc-part__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.bxc-part__title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.bxc-part__name { font-weight: 600; overflow-wrap: anywhere; }
.bxc-part__role { font-size: 12px; color: var(--ink-2); padding: 1px 8px; border: 1px solid var(--rule); border-radius: var(--r-pill, 999px); }
.bxc-part__tools { display: flex; gap: 4px; }
.bxc-badge { font-size: 11px; padding: 1px 6px; border-radius: var(--r-pill, 999px); border: 1px solid currentColor; }
.bxc-badge--envelope, .bxc-badge--warn { color: var(--warn); }
.bxc-warnings { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: var(--warn); }
.bxc-sub { display: flex; flex-direction: column; gap: 6px; margin-top: var(--s-3, 12px); }
.bxc-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bxc-geo-badge { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.bxc-chain { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; margin: var(--s-2, 8px) 0; }
.bxc-chain__node { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; border: 1px solid var(--rule); border-radius: var(--r-sm, 6px); background: var(--plate-2, var(--plate)); min-width: 90px; }
.bxc-chain__node[data-state="missing"] { border-style: dashed; border-color: var(--warn); }
.bxc-chain__label { font-weight: 600; font-size: 13px; }
.bxc-chain__line { font-size: 12px; color: var(--ink-2); }
.bxc-chain__link { align-self: center; color: var(--ink-3, var(--ink-2)); }
.bxc-card__status { margin-top: var(--s-2, 8px); }
.bxc-card__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bxc-progress { height: 6px; border-radius: 3px; background: var(--rule); overflow: hidden; }
.bxc-progress__bar { height: 100%; background: var(--brand); transition: width .3s; }
.bxc-progress[data-state="failed"] .bxc-progress__bar { background: var(--fail); }
.bxc-progress[data-state="done"] .bxc-progress__bar { background: var(--pass); }
.bxc-progress__text { font-size: 12px; color: var(--ink-2); margin-top: 4px; }

/* ── Accuracy honesty (results / validation / report / bottle CAD): PARTIAL verdict, deck-validation strip,
      beyond-yield flags, indicative tags, the customer-CAD bottle plate. ── */
.bx-verdict-badge[data-verdict="PARTIAL"]        { color: var(--pass); background: var(--plate); border-color: var(--pass); border-style: dashed; }
.bx-verdict-badge[data-verdict="NOT_QUANTIFIED"] { color: var(--ink-mute); background: var(--plate-2); border-color: var(--rule-strong); border-style: dashed; }
.bx-verdict[data-verdict="PARTIAL"]        { border-left-color: var(--pass); border-left-style: dashed; }
.bx-verdict[data-verdict="NOT_QUANTIFIED"] { border-left-color: var(--rule-strong); border-left-style: dashed; }

.bxr-val { display: flex; flex-direction: column; gap: 8px; padding: 10px 14px 12px; border: 1px solid var(--rule);
  border-radius: var(--r-md, 8px); background: var(--plate-2, var(--plate)); }
.bx-verdict + .bxr-val { margin-top: -6px; border-top: 0; border-radius: 0 0 var(--r-md, 8px) var(--r-md, 8px); }
.bxr-val__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bxr-val__title { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.bxr-val__items { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.bxr-val__item { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.bxr-val__comp { color: var(--ink-2); }
.bxr-val__chip { display: inline-block; font-family: var(--font-mono); font-size: 11px; padding: 1px 8px; border-radius: var(--r-pill, 999px); border: 1px solid var(--rule-strong); color: var(--ink-mute); background: var(--plate); white-space: nowrap; }
.bxr-val__chip[data-state="within"]  { color: var(--pass); border-color: var(--pass); background: var(--pass-tint); }
.bxr-val__chip[data-state="outside"] { color: var(--fail); border-color: var(--fail); background: var(--fail-tint); }
.bxr-val__chip[data-state="indicative"], .bxr-val__chip[data-state="nq"] { color: var(--ink-mute); border-style: dashed; }
.bxr-val__cal { font-size: 11px; color: var(--ink-mute); font-style: italic; }
.bxr-val__foot { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; }
.bxr-val__count { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-2); }
.bxr-val__rule { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.bxr-val[data-state="unavailable"] { border-style: dashed; }

.bxr-vnotes { padding: 8px 14px; border: 1px solid var(--rule); border-left: 3px solid var(--warn); border-radius: var(--r-sm, 6px); background: var(--plate); font-size: 13px; }
.bxr-vnotes .bxr-list { margin: 0; }

.bxr-yield { display: flex; flex-direction: column; gap: 4px; padding: 6px 10px; border: 1px solid var(--warn); border-radius: var(--r-sm, 6px); background: var(--warn-tint); font-size: 12.5px; color: var(--ink); }
.bxr-yield__tag { display: inline-block; margin-right: 6px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 1px 6px; border-radius: var(--r-pill, 999px); color: var(--warn); border: 1px solid var(--warn); background: var(--plate); white-space: nowrap; }
.bxr-yield__tag--inline { margin: 0 0 0 6px; font-size: 9.5px; padding: 0 5px; vertical-align: 1px; cursor: help; }
.bxr-yield__note { margin: 0; font-size: 11.5px; color: var(--ink-2); }
.bxr-over { color: var(--warn); font-weight: 600; }
.bxr-over__key { margin: 0 0 6px; }

.bxr-fm[data-tone="nq"] { border-left: 3px dashed var(--rule-strong); }
.bxr-fm__main { margin: 0; font-size: 13.5px; color: var(--ink); line-height: 1.45; }
.bxr-fm__val { display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.bxr-fm__deck { display: inline-flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.bxr-fm__qual { margin: 0; font-size: 11.5px; color: var(--fail); text-align: right; }

.bxr-tag { display: inline-block; margin-left: 6px; font-size: 10.5px; padding: 0 6px; border-radius: var(--r-pill, 999px); border: 1px solid var(--rule-strong); color: var(--ink-mute); background: var(--plate); white-space: nowrap; vertical-align: 1px; }
.bxr-tag--indicative { margin-left: 0; font-family: var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; border-style: dashed; background: var(--plate-2); }
.bxr-tag--cad { color: var(--ink-2); border-color: hsl(var(--bx-h-measured_cad) 30% 55%); }
.bxr-comp { white-space: nowrap; }
.bxr-row--indicative td { background: var(--plate-2); color: var(--ink-2); }
.bxr-row--indicative td:first-child { box-shadow: inset 3px 0 0 var(--rule-strong); }
.bxr-deck-note { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--ink-2); max-width: 70ch; }
.bxr-deck-note__geo .bxr-tag { margin-left: 0; }
.bxr-rep-bottle { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; border-left: 3px solid hsl(var(--bx-h-measured_cad) 35% 50%); background: var(--plate-2); border-radius: 0 var(--r-sm, 6px) var(--r-sm, 6px) 0; }
.bxr-rep-bottle p { margin: 0; font-size: 13px; }

.bxc-refcad { display: flex; flex-direction: column; gap: 10px; }
.bxc-refcad__lead { margin: 0; font-size: 13px; color: var(--ink-2); }
.bxc-refcad__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 16px; }
.bxc-refcad__group { display: flex; flex-direction: column; gap: 2px; }
.bxc-wallstep { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 12.5px; }
.bxc-wallstep__seg { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.bxc-wallstep__bar { display: block; height: 10px; border-radius: 2px; background: hsl(var(--bx-h-measured_cad) 30% 60%); }
.bxc-wallstep__bar[data-kind="override"] { background: hsl(var(--bx-h-user) 25% 55%); }
.bxc-wallstep__k { font-family: var(--font-ui); font-size: 11px; color: var(--ink-mute); }
.bxc-wallstep__arrow { color: var(--ink-mute); }
.bxc-override-state { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.bxc-chain__chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.bxc-chain__node[data-state="declared"] { border-style: dashed; border-color: hsl(var(--bx-h-user) 15% 60%); }
.bxr-fm .bxr-fm__head { flex-wrap: wrap; align-items: flex-start; }
.bxr-fm .bxr-fm__head .bx-verdict-badge { flex: 0 0 auto; }
.bxr-rep-bottle > .bx-prov { align-self: flex-start; }

/* Header navigation: large, labelled, unmistakable (2026-10-04). */
.bx-head__nav { gap: 10px; }
.bx-head__nav .bx-btn--lg { padding: 13px 22px; font-size: 15px; font-weight: 600; border-radius: 10px; }
.bx-head__nav .bx-head__next.bx-btn--primary { box-shadow: 0 6px 18px rgba(47, 93, 232, .28); }
.bx-head__nav .bx-btn:disabled { opacity: .45; box-shadow: none; }
.bx-theme { display: none !important; }

/* ============================================================================
   BEGIN biscuit block (owner: I6) — the two test stacks as tiles. Shared by the Transit stage (the loading plan:
   dropped / horizontal tiers marked) and the Results stage (owner I7: the same tiles coloured by the predicted damaged
   share through `--tile-fill`, with the dropped / horizontal marks kept). One tile = one test shipper.
   ============================================================================ */
.bx-stacks { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-end; padding: 6px 2px; }
.bx-stack { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 120px; }
.bx-stack__name { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-mute); font-weight: 600; }
.bx-stack__tiles { display: flex; flex-direction: column; gap: 2px; padding: 4px; border-bottom: 3px solid var(--ink-2, #444); }   /* top tier first (the page reverses the plan) */
.bx-stack__foot { font-size: 11.5px; color: var(--ink-2); }
.bx-tile {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  width: 104px; height: 22px; border: 1.5px solid var(--ink-2, #444); border-radius: 3px;
  background: var(--tile-fill, var(--plate, #fff)); color: var(--ink); font: 600 11px/1 var(--font-mono);
  transition: background var(--t-base, .2s), border-color var(--t-base, .2s);
}
.bx-tile[data-orientation="horizontal"] { width: 72px; height: 30px; border-style: dashed; }
.bx-tile[data-dropped="1"] { border-width: 2.5px; border-color: hsl(var(--bx-h-engineering_assumption, 42) 70% 38%); background: var(--tile-fill, hsl(var(--bx-h-engineering_assumption, 42) 70% 86%)); }
.bx-tile__n { pointer-events: none; }
.bx-tile__mark { font-style: normal; font-size: 11px; line-height: 1; color: var(--ink-2); }
.bx-tile__mark--drop { color: hsl(var(--bx-h-engineering_assumption, 42) 70% 32%); font-weight: 700; }
.bx-tile.is-selected, .bx-tile:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.bx-tile--legend { width: 22px; height: 12px; vertical-align: middle; margin-right: 4px; }
.bx-stack-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.bx-root[data-theme="dark"] .bx-tile { background: var(--tile-fill, var(--bx-viz-plate)); color: var(--bx-viz-ink); border-color: var(--bx-viz-ink); }
/* END biscuit block */

/* ───────── results: survived (green) / did not survive (red) — PHYSICS_V2 §A, §F (no verdict) ───────── */
:root { --bxr-ok: #1a9850; --bxr-bad: #d73027; }
.bxr-pair { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line, #d9dee6); border-radius: 10px; background: var(--surface, #fff); min-width: 0; }
.bxr-pair__title { font-weight: 600; font-size: 0.86rem; color: var(--ink-soft, #44506a); }
.bxr-pair__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bxr-pair__cell { border-left: 5px solid; padding: 4px 10px; min-width: 0; }
.bxr-pair__cell--ok { border-color: var(--bxr-ok); }
.bxr-pair__cell--bad { border-color: var(--bxr-bad); }
.bxr-pair__cell--ok .bxr-pair__value { color: var(--bxr-ok); }
.bxr-pair__cell--bad .bxr-pair__value { color: var(--bxr-bad); }
.bxr-pair__value { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.bxr-pair--big .bxr-pair__value { font-size: 2.4rem; }
.bxr-pair__label { font-weight: 600; font-size: 0.9rem; }
.bxr-pair__count, .bxr-pair__basis { font-size: 0.8rem; color: var(--ink-mute, #6b7487); }
.bxr-pairs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-top: 10px; }
.bxr-sub { margin: 14px 0 6px; font-size: 0.92rem; }
.bxr-truck { overflow-x: auto; }
.bxr-truck__grid { display: grid; gap: 2px; min-width: 0; }
.bxr-truck__cell { height: 18px; border-radius: 2px; display: block; }
.bxr-truck__axis { font-size: 0.72rem; color: var(--ink-mute, #6b7487); white-space: nowrap; }
.bxr-truck__legend { margin-top: 6px; font-size: 0.8rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bxr-truck__ramp { display: inline-block; width: 90px; height: 10px; border-radius: 3px; background: linear-gradient(90deg, #d73027, #fee08b, #1a9850); }
.bxt-roadbasis { display: grid; gap: 6px; }
.bxt-roadbasis__axes { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.bxt-roadbasis__axis { border: 1px solid var(--line, #d9dee6); border-radius: 8px; padding: 6px 10px; }
.bxt-roadbasis__axis strong { display: block; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .bxr-pair--big .bxr-pair__value { font-size: 1.8rem; } .bxr-pair__row { grid-template-columns: 1fr; } }

/* ── results · PHYSICS_V2 §G2 / §G3 / §G6 panels (stack weight, sliding, where the damage comes from, accumulation) ── */
