/* ============================================================================
   PackTwin · Bottle & Closure Transit — module styles (owner: I6)

   Namespace: every rule starts with .bt- (shell), .btc- (config & closure), .btt- (transit), .btr- (results) or .btv- (viewer) 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.
   ============================================================================ */

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

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

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

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

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

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

.bt-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);
}
.bt-head__text { min-width: 0; }
.bt-head__eyebrow { display: block; margin-bottom: 6px; }
.bt-head__title { font-size: 30px; line-height: 1.1; letter-spacing: -0.02em; margin: 0; }
.bt-head__blurb { margin: 8px 0 0; max-width: 62ch; color: var(--ink-2); font-size: 14px; }
.bt-head__tools { display: flex; align-items: center; gap: var(--s-3); flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.bt-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);
}
.bt-head__nav { display: flex; gap: 4px; }

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

/* Theme toggle for the visualisation panels */
.bt-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);
}
.bt-theme:hover { border-color: var(--ink); color: var(--ink); }
.bt-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);
}
.bt-theme[aria-pressed="true"] .bt-theme__sun {
  background: radial-gradient(circle at 60% 40%, #f3f5fa 0 30%, #7c8aa5 32% 100%);
  border-color: #3c4658;
}

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

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

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

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

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

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

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

.bt-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);
}
.bt-btn--sm { padding: 7px 12px; font-size: 12.5px; }
.bt-btn--lg { padding: 14px 24px; font-size: 15px; font-weight: 600; }
.bt-btn--primary { background: var(--brand); color: #fff; box-shadow: 0 1px 0 var(--brand-3) inset; }
.bt-btn--primary:hover { background: var(--brand-2); }
.bt-btn--primary:active { background: var(--brand-3); }
.bt-btn--secondary { background: transparent; color: var(--brand); border-color: var(--brand); }
.bt-btn--secondary:hover { background: var(--brand-tint); }
.bt-btn--ghost { background: transparent; color: var(--ink-2); border-color: var(--rule); }
.bt-btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
.bt-btn--danger { background: transparent; color: var(--fail); border-color: var(--fail); }
.bt-btn--danger:hover { background: var(--fail-tint); }
.bt-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.bt-btn:focus-visible, .bt-input:focus-visible, .bt-toggle:focus-visible, .bt-seg__btn:focus-visible, .bt-tab:focus-visible, .bt-theme:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px;
}
.bt-btn__icon { font-size: 1.05em; line-height: 1; }

/* Stage footer: back / continue */
.bt-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);
}
.bt-stage-foot__note { font-size: 12.5px; color: var(--ink-mute); }

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

.bt-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; width: var(--bt-field-w, auto); }
.bt-field--inline { flex-direction: row; align-items: center; justify-content: space-between; gap: var(--s-3); }
.bt-field--inline .bt-field__label { flex: 1; }
.bt-field__label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.bt-field__name { color: var(--ink); }
.bt-field__control { position: relative; display: flex; align-items: stretch; }
.bt-field__control.has-unit .bt-input { padding-right: 56px; }
.bt-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;
}
.bt-field__hint { font-size: 12px; color: var(--ink-mute); line-height: 1.45; }
.bt-field__error { font-size: 12px; color: var(--fail); }
.bt-field.has-error .bt-input { border-color: var(--fail); }
.bt-field-grid { display: grid; grid-template-columns: repeat(var(--bt-cols, 2), minmax(0, 1fr)); gap: var(--s-3) var(--s-4); }
.bt-field-grid .bt-field--span { grid-column: 1 / -1; }

.bt-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);
}
.bt-input--number { font-family: var(--font-mono); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.bt-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); background: var(--plate); }
.bt-input:disabled { opacity: 0.55; cursor: not-allowed; }
.bt-input.is-readonly { background: var(--plate-2); border-style: dashed; }
.bt-input.is-invalid { border-color: var(--fail); box-shadow: 0 0 0 3px var(--fail-tint); }
.bt-input::-webkit-outer-spin-button, .bt-input::-webkit-inner-spin-button { opacity: 0.6; }
.bt-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 */
.bt-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); }
.bt-toggle__track { position: relative; width: 36px; height: 20px; border-radius: 10px; background: var(--rule-strong); transition: background var(--t-fast); flex-shrink: 0; }
.bt-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); }
.bt-toggle[aria-checked="true"] .bt-toggle__track { background: var(--brand); }
.bt-toggle[aria-checked="true"] .bt-toggle__knob { transform: translateX(16px); }
.bt-toggle:disabled { opacity: 0.5; cursor: not-allowed; }

/* Segmented control */
.bt-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; }
.bt-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);
}
.bt-seg--sm .bt-seg__btn { padding: 5px 9px; font-size: 12px; }
.bt-seg__btn:hover { color: var(--ink); }
.bt-seg__btn[aria-checked="true"] { background: var(--plate); color: var(--brand); box-shadow: 0 1px 2px rgba(26,29,34,0.08); }
.bt-seg__btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Dropzone (Product stage CAD upload) */
.bt-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);
}
.bt-drop:hover, .bt-drop.is-over { border-color: var(--brand); background: var(--brand-tint-2); }
.bt-drop__formats { font-family: var(--font-mono); font-size: 11px; color: var(--ink-mute); letter-spacing: 0.04em; }

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

.bt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: var(--s-2); }
.bt-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;
}
.bt-kpi[data-tone="pass"] { border-left-color: var(--pass); }
.bt-kpi[data-tone="warn"] { border-left-color: var(--warn); }
.bt-kpi[data-tone="fail"] { border-left-color: var(--fail); }
.bt-kpi__label { font-size: 11.5px; color: var(--ink-mute); line-height: 1.3; }
.bt-kpi__value { display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; }
.bt-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; }
.bt-kpi[data-tone="fail"] .bt-kpi__num { color: var(--fail); }
.bt-kpi[data-tone="warn"] .bt-kpi__num { color: var(--warn); }
.bt-kpi[data-tone="pass"] .bt-kpi__num { color: var(--pass); }
.bt-kpi__unit { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-mute); }
.bt-kpi__foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.bt-kpi__delta { font-family: var(--font-mono); font-size: 11.5px; }
.bt-kpi__delta[data-sign="pos"] { color: var(--pass); }
.bt-kpi__delta[data-sign="neg"] { color: var(--fail); }
.bt-kpi__note { font-size: 11px; color: var(--ink-mute); }

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

.bt-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;
}
.bt-prov--compact { padding: 2px 6px 2px 5px; font-size: 10px; }
.bt-prov__dot { width: 6px; height: 6px; border-radius: 50%; background: hsl(var(--h) 60% 42%); flex-shrink: 0; }
.bt-prov__src { color: hsl(var(--h) 25% 45%); }
.bt-prov__src::before { content: "·"; margin-right: 5px; }
.bt-prov[data-type="measured_lab_test"]      { --h: var(--bt-h-measured_lab_test); }
.bt-prov[data-type="measured_cad"]           { --h: var(--bt-h-measured_cad); }
.bt-prov[data-type="measured_field"]         { --h: var(--bt-h-measured_field); }
.bt-prov[data-type="derived_from_measured"]  { --h: var(--bt-h-derived_from_measured); }
.bt-prov[data-type="simulated"]              { --h: var(--bt-h-simulated); }
.bt-prov[data-type="standard_profile"]       { --h: var(--bt-h-standard_profile); }
.bt-prov[data-type="reference_simulation"]   { --h: var(--bt-h-reference_simulation); }
.bt-prov[data-type="literature"]             { --h: var(--bt-h-literature); }
.bt-prov[data-type="parametric"]             { --h: var(--bt-h-parametric); }
.bt-prov[data-type="calibrated_parameter"]   { --h: var(--bt-h-calibrated_parameter); }
.bt-prov[data-type="engineering_assumption"] { --h: var(--bt-h-engineering_assumption); }
.bt-prov[data-type="user"]                   { --h: var(--bt-h-user); color: hsl(var(--h) 10% 30%); background: hsl(var(--h) 15% 95%); border-color: hsl(var(--h) 12% 78%); }
.bt-prov[data-type="user"] .bt-prov__dot     { background: hsl(var(--h) 10% 45%); }
.bt-prov[data-type="unknown"]                { color: var(--fail); background: var(--fail-tint); border-color: var(--fail); border-style: dashed; }
.bt-prov[data-type="unknown"] .bt-prov__dot  { background: var(--fail); }

/* Evidence ladder banner */
.bt-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);
}
.bt-ladder__rung { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1 1 160px; }
.bt-ladder__label { font-size: 13px; font-weight: 600; color: var(--ink); }
.bt-ladder__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bt-ladder__note { font-size: 11.5px; color: var(--ink-mute); }
.bt-ladder__arrow { align-self: center; color: var(--ink-mute-2); font-size: 18px; }

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

.bt-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;
}
.bt-verdict-badge--lg { font-size: 14px; padding: 9px 16px 9px 13px; }
.bt-verdict-badge__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.bt-verdict-badge--lg .bt-verdict-badge__dot { width: 10px; height: 10px; }
.bt-verdict-badge[data-verdict="PASS"]     { color: var(--pass); background: var(--pass-tint); border-color: var(--pass); }
.bt-verdict-badge[data-verdict="MARGINAL"] { color: var(--warn); background: var(--warn-tint); border-color: var(--warn); }
.bt-verdict-badge[data-verdict="FAIL"]     { color: var(--fail); background: var(--fail-tint); border-color: var(--fail); }
.bt-verdict-badge[data-verdict="PENDING"]  { color: var(--ink-mute); background: var(--plate-2); border-color: var(--rule-strong); }

.bt-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);
}
.bt-verdict[data-verdict="PASS"]     { border-left-color: var(--pass); }
.bt-verdict[data-verdict="MARGINAL"] { border-left-color: var(--warn); }
.bt-verdict[data-verdict="FAIL"]     { border-left-color: var(--fail); background: linear-gradient(90deg, var(--fail-tint) 0, var(--plate) 45%); }
.bt-verdict__main { display: flex; align-items: center; gap: var(--s-4); min-width: 0; }
.bt-verdict__headline { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
.bt-verdict__reason { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-2); max-width: 70ch; }
.bt-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); }
.bt-verdict__stat { display: flex; flex-direction: column; gap: 2px; min-width: 110px; max-width: 100%; }
.bt-verdict__v--text { font-size: 15px; white-space: normal; overflow-wrap: anywhere; }
.bt-verdict__k { font-size: 11.5px; color: var(--ink-mute); }
.bt-verdict__v { font-family: var(--font-mono); font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.bt-verdict__c { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-mute); }

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

.bt-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); overflow-x: auto; scrollbar-width: none; }
.bt-tabs::-webkit-scrollbar { display: none; }
.bt-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);
}
.bt-tab:hover { color: var(--ink); }
.bt-tab[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.bt-tab:disabled { opacity: 0.4; cursor: not-allowed; }
.bt-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 ── */

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

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

.bt-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;
}
.bt-legend__title { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 600; }
.bt-legend__unit { font-family: var(--font-mono); font-weight: 400; color: var(--ink-mute); font-size: 11px; }
.bt-legend__bar { height: 10px; border-radius: 3px; background: linear-gradient(90deg, #1f4de0 0%, #1fb35c 25%, #f2d21f 50%, #f28a1f 75%, #d81f1f 100%); }
.bt-legend__bar canvas { display: block; width: 100%; height: 100%; border-radius: 3px; }
.bt-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; }
.bt-legend__keys { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.bt-legend__key { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.bt-legend__swatch { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }

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

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

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

.bt-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); }
.bt-empty__title { font-weight: 600; font-size: 14px; }
.bt-empty__hint { margin: 0; font-size: 13px; color: var(--ink-mute); max-width: 60ch; }

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

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

.bt-note { font-size: 12.5px; color: var(--ink-mute); line-height: 1.5; }
.bt-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; }
.bt-inline-list { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.bt-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.bt-muted { color: var(--ink-mute); }

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

.bt-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; }
.bt-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: bt-toast-in var(--t-base) var(--ease-out);
}
.bt-toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity 200ms, transform 200ms; }
.bt-toast__bar { width: 4px; border-radius: 0 2px 2px 0; background: var(--brand-2); flex-shrink: 0; }
.bt-toast[data-kind="success"] .bt-toast__bar { background: #4ec27a; }
.bt-toast[data-kind="warn"] .bt-toast__bar { background: #e2a93a; }
.bt-toast[data-kind="error"] .bt-toast__bar { background: #e2675b; }
.bt-toast__body { flex: 1; min-width: 0; font-size: 13px; line-height: 1.4; }
.bt-toast__title { font-weight: 600; }
.bt-toast__msg { color: #d6d3cc; overflow-wrap: anywhere; }
.bt-toast__close { background: none; border: 0; color: #b3ada1; font-size: 18px; line-height: 1; padding: 0 6px; cursor: pointer; align-self: flex-start; }
.bt-toast__close:hover { color: var(--paper); }
@keyframes bt-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

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

.bt-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: bt-fade-in var(--t-fast) ease-out;
}
.bt-modal-backdrop.is-leaving { opacity: 0; transition: opacity 160ms; }
.bt-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);
}
.bt-modal--wide { width: min(920px, 100%); }
.bt-modal__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-4); margin-bottom: var(--s-4); }
.bt-modal__head .bt-eyebrow { display: block; margin-bottom: 4px; }
.bt-modal__title { font-size: 20px; margin: 0; }
.bt-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; }
.bt-modal__close:hover { border-color: var(--ink); color: var(--ink); }
.bt-modal__body { display: flex; flex-direction: column; gap: var(--s-4); }
.bt-modal__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: var(--s-5); }
@keyframes bt-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Processing overlay variant for the simulation run (mirrors #processing) */
.bt-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); }
.bt-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); }
.bt-processing__title { font-size: 22px; margin: 0; }
.bt-processing__line { font-size: 14px; color: var(--ink-2); min-height: 1.5em; }
.bt-processing__bar { height: 4px; background: var(--plate-2); border-radius: 2px; overflow: hidden; }
.bt-processing__fill { height: 100%; width: 10%; background: var(--brand); border-radius: 2px; transition: width 600ms var(--ease-out); }
.bt-processing__foot { font-family: var(--font-mono); font-size: 11px; color: var(--ink-mute); }

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

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

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

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

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

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

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

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

.btt-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);
}
.btt-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);
}
.btt-banner__text { min-width: 0; }

.btt-prov-line {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--ink-mute); line-height: 1.5;
}
.btt-prov-line__k { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; }
.btt-prov-line__src,
.btt-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;
}
.btt-prov-line__text { flex: 1 1 220px; min-width: 0; }
.btt-series { display: flex; flex-direction: column; gap: 6px; }

.btt-provlist { display: flex; flex-direction: column; gap: 10px; }
.btt-provlist__item {
  display: flex; flex-direction: column; gap: 4px;
  padding-bottom: 10px; border-bottom: 1px solid var(--rule);
}
.btt-provlist__item:last-child { padding-bottom: 0; border-bottom: 0; }
.btt-provlist__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btt-provlist__name { font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.btt-provlist__meta { font-size: 11px; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.btt-provlist__src { align-self: flex-start; max-width: 100%; }
.btt-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. */
.btt-stage { --bt-form-w: minmax(0, 1fr); --bt-viz-w: minmax(340px, 1fr); }

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

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

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

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

.btt-events { border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--plate); }
.btt-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;
}
.btt-events__summary::-webkit-details-marker { display: none; }
.btt-events__summary::before { content: "▸"; color: var(--ink-mute); font-size: 11px; }
.btt-events[open] > .btt-events__summary::before { content: "▾"; }
.btt-events__hint { font-size: 11px; color: var(--ink-mute); font-weight: 400; }
.btt-events__body { display: flex; flex-direction: column; gap: 10px; padding: 0 12px 12px; }
.btt-events__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btt-row-act { display: inline-flex; gap: 2px; justify-content: flex-end; }
.btt-event-form { display: flex; flex-direction: column; gap: var(--s-4); }
.btt-event-form__prov { display: flex; flex-direction: column; gap: 6px; }

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

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

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

.btt-timeline-host { min-width: 0; }
.btt-timeline .bt-timeline__track { height: 104px; margin-bottom: 4px; min-width: 460px; }
.btt-timeline .bt-timeline__scale { min-width: 460px; }
/* A sliver of a leg still has to be clickable and carry its mode colour. */
.btt-timeline .bt-timeline__leg { min-width: 14px; padding: 0 4px; }
/* Edge stations anchor inwards so the first and last labels are never clipped. */
.btt-timeline .bt-timeline__station[data-edge="start"] { transform: none; align-items: flex-start; }
.btt-timeline .bt-timeline__station[data-edge="end"]   { transform: translateX(-100%); align-items: flex-end; }
.btt-timeline .bt-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. */
.btt-timeline { padding-top: var(--s-6); }
.btt-timeline .bt-timeline__station { top: -20px; flex-direction: column-reverse; }
.btt-tl-cursor {
  position: absolute; top: 12px; bottom: 0; width: 2px;
  background: var(--brand); pointer-events: none; z-index: 3;
}
.btt-tl-cursor::before {
  content: ""; position: absolute; top: -5px; left: -4px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--brand);
}
.btt-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;
}
.btt-tl-damage[data-severity="major"]   { background: var(--fail); }
.btt-tl-damage[data-severity="failure"] { background: var(--fail); box-shadow: 0 0 0 3px var(--fail-tint); }
.btt-tl-detail-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; font-size: 13.5px; }
.btt-tl-cell { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.btt-tl-damage-note { margin-top: 10px; }
.btt-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);
}
.btt-tag[data-kind="event"] { border-color: var(--warn); color: var(--warn); }
.btt-tag[data-kind="dwell"] { border-style: dashed; }
.btt-tag[data-risk="pass"] { border-color: var(--pass); color: var(--pass); }
.btt-tag[data-risk="warn"] { border-color: var(--warn); color: var(--warn); }
.btt-tag[data-risk="fail"] { border-color: var(--fail); color: var(--fail); }

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

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

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

.btt-run { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.btt-sum-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--s-4); }
.btt-sum .bt-plate__body { gap: 6px; }
.btt-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;
}
.btt-sum__row:last-child { border-bottom: 0; }
.btt-sum__k { color: var(--ink-mute); white-space: nowrap; }
.btt-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 bottle toasts and modals. */
.btt-processing { z-index: 950; }

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

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

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

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

@media (max-width: 1100px) {
  .btt-sum-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .btt-profile__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .btt-leg__tools { width: 100%; }
  .btt-sum__row { grid-template-columns: minmax(0, 1fr) auto; }
  .btt-sum__row .bt-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 .btc-*; nothing above this line is modified.
   ============================================================================ */

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

.btc-stage { align-items: start; }
.btc-stage > .bt-stage-foot { grid-column: 1 / -1; margin-top: 0; }
.btc-form { gap: var(--s-4); }
.btc-viz { gap: var(--s-3); }
.btc-viz__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.btc-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 `.bt-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. */
.btc-canvas > canvas.btv-gl { width: 100%; height: 100%; }
.btc-canvas > canvas.btv-legend { width: 230px; height: 52px; }
.btc-canvas > canvas.btv-legend.btv-legend--fea { width: 142px; height: min(72%, 340px); }
.btc-canvas > canvas.btv-dmg { width: auto; height: auto; max-width: 70%; }
.btc-note { min-height: 16px; }

.btc-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(--bt-h-engineering_assumption) 70% 26%);
  background: hsl(var(--bt-h-engineering_assumption) 85% 92%);
  border: 1px solid hsl(var(--bt-h-engineering_assumption) 60% 72%);
  white-space: nowrap;
}
.btc-tag::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

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

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

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

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

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

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

.btc-ro { display: flex; flex-direction: column; gap: 0; }
.btc-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);
}
.btc-ro__row:last-child { border-bottom: 0; }
.btc-ro__k { font-size: 13px; color: var(--ink-2); min-width: 0; }
.btc-ro__v { font-size: 13px; color: var(--ink); white-space: nowrap; }

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

.btc-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);
}
.btc-cell .btc-dia { max-width: 420px; }
.btc-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 ── */

.btc-configs { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: var(--s-3); }
.btc-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);
}
.btc-config:hover { border-color: var(--rule-strong); background: var(--plate-2); }
.btc-config.is-active { border-color: var(--brand); background: var(--brand-tint-2); box-shadow: inset 0 0 0 1px var(--brand); }
.btc-config:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btc-config__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btc-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;
}
.btc-config.is-active .btc-config__letter { background: var(--brand); }
.btc-config__title { font-size: 12.5px; font-weight: 600; line-height: 1.3; min-width: 0; }
.btc-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%);
}
.btc-config__desc { display: block; font-size: 11.5px; line-height: 1.45; color: var(--ink-mute); }
.btc-config__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 10.5px; color: var(--ink-mute); }
.btc-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. */
.btc-dia { display: block; width: 100%; height: auto; }
.btc-dia__box { fill: var(--paper); stroke: var(--rule-strong); stroke-width: 1.2; }
.btc-dia__cap { fill: var(--ink-mute); font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.06em; text-transform: uppercase; }
.btc-dia__carton { fill: hsl(var(--bt-h-literature) 45% 93%); stroke: hsl(var(--bt-h-literature) 40% 62%); stroke-width: 0.9; }
.btc-dia__bottle { fill: hsl(148 40% 84%); stroke: hsl(148 45% 34%); stroke-width: 0.9; }
.btc-dia__spiral { fill: none; stroke: hsl(148 45% 34%); stroke-width: 1.1; stroke-linecap: round; }
.btc-dia__wall { stroke: var(--rule-strong); stroke-width: 1.6; stroke-linecap: square; }
.btc-dia__slab { fill: hsl(148 40% 84%); stroke: hsl(148 45% 34%); stroke-width: 0.6; }
.btc-dia__load, .btc-dia__flow { stroke: var(--fail); stroke-width: 1.4; fill: none; stroke-linecap: round; }
.btc-dia__flow { stroke-dasharray: 2.5 2.2; opacity: 0.85; }
.btc-dia__loadhead { fill: var(--fail); }

.btc-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);
}
.btc-mode[data-worst="yes"] { border-left-color: var(--fail); }
.btc-mode__k { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink); }
.btc-mode__v { font-size: 12.5px; line-height: 1.5; color: var(--ink-2); min-width: 0; }

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

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

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

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

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

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

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

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

/* ============================================================================
   BEGIN results block (frontend/bottle/stages-results.js, owner I11; generic rules carried over)

   Results / Validation / Final-report stages (SPEC §5.4, §7.3, §7.5, §7.6).
   Everything here is namespaced `.btr-*` (plus two `.bt-demo-flag` / `.bt-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 */
.bt-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);
}
.bt-kv { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.bt-kv__k { color: var(--ink-mute); }
.bt-kv__v { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink); }

.btr-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;
}
.btr-status[data-status="warn"] { color: var(--warn); background: var(--warn-tint); }
.btr-status[data-status="fail"] { color: var(--fail); background: var(--fail-tint); }

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

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

.btr-ctls { display: flex; flex-direction: column; gap: var(--s-2); padding-top: var(--s-2); border-top: 1px solid var(--rule); }
.btr-ctl { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-width: 0; }
.btr-ctl__label { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: baseline; gap: 4px; min-width: 0; }
.btr-ctl__label small { color: var(--ink-mute); font-size: 11px; }
.btr-ctl .bt-select, .btr-ctl .bt-input { max-width: 160px; }
.btr-ctl .bt-seg { flex-shrink: 0; }
.btr-range { width: 150px; padding: 0; background: transparent; border: 0; accent-color: var(--brand); }

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

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

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

.btr-timeline-host { min-width: 0; }
.btr-scrubber { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; padding: var(--s-3) 0; }
.btr-scrubber__controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.btr-scrubber__track { flex: 1 1 320px; display: flex; flex-direction: column; gap: 4px; min-width: 240px; }
.btr-scrub { width: 100%; padding: 0; background: transparent; border: 0; accent-color: var(--brand); }
.btr-scrub__stamp { font-size: 11px; color: var(--ink-mute); }
.btr-tl-cursor { position: absolute; top: 14px; bottom: 6px; width: 2px; background: var(--brand); transform: translateX(-1px); pointer-events: none; z-index: 3; }
.btr-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 ──────────────────────────────────────────────────────────────── */

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

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

.btr-panel { border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--paper); }
.btr-panel + .btr-panel { margin-top: var(--s-3); }
.btr-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;
}
.btr-panel__summary::-webkit-details-marker { display: none; }
.btr-panel__summary::before {
  content: "▸"; color: var(--ink-mute); font-size: 11px; transition: transform var(--t-fast);
}
.btr-panel[open] > .btr-panel__summary::before { transform: rotate(90deg); }
.btr-panel__title { font-size: 13.5px; font-weight: 600; }
.btr-panel__sub { font-size: 11.5px; color: var(--ink-mute); }
.btr-panel__body { padding: 0 14px 14px; }

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

.btr-det__head { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.btr-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);
}
.btr-det__readout:empty { display: none; }

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

.btr-damage { display: flex; flex-direction: column; gap: var(--s-3); }
.btr-damage__summary { display: flex; gap: var(--s-5); flex-wrap: wrap; }
.btr-damage__summary:empty { display: none; }
.btr-damage__kind { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btr-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);
}
.btr-nodamage strong { font-size: 14px; }

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

.btr-notes { display: flex; flex-direction: column; gap: 8px; }
.btr-note-row { display: grid; grid-template-columns: minmax(160px, 260px) minmax(0, 1fr); gap: var(--s-3); font-size: 12.5px; }
.btr-note-row__k { font-weight: 600; color: var(--ink-2); }
.btr-note-row__v { color: var(--ink-mute); line-height: 1.5; }
.btr-factors { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--s-3); }
.btr-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); }
.btr-factor__head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.btr-factor__name { font-size: 13px; font-weight: 600; }
.btr-factor__value { font-size: 14px; color: var(--brand); }
.btr-factor__why { margin: 0; font-size: 12.5px; color: var(--ink-mute); line-height: 1.55; }
.btr-summary { margin: 0 0 var(--s-3); font-size: 13.5px; line-height: 1.6; color: var(--ink-2); max-width: 78ch; }
.btr-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) ────────────────── */

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

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

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

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

@media (max-width: 1100px) {
  .btr-inspector { grid-template-columns: minmax(0, 1fr); }
  .btr-viewer { height: clamp(280px, 44vh, 420px); }
  .btr-chart-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .btr-note-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .btr-scrubber__controls { width: 100%; }
  .btr-report__pair { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .btr-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. */
.btr-chart__canvas[data-chart-empty="true"] { display: none !important; }
.btr-chart.is-empty,
.btr-chart:has(> canvas[data-chart-empty="true"]) { display: none !important; }

/* A chart group whose charts have all gone is dropped whole (§8.2). */
.btr-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. */
.btr-chart-groups > .btr-seg-picker { margin-bottom: var(--s-3); }
.btr-charts-none[hidden],
.btr-det__none[hidden] { display: none !important; }
.btr-charts-none { margin: 0; }

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

/* ── Embedded panels: bottle stages rendered beneath the host's own
   Transit / Results / Report content. The host owns the page chrome. ───────── */
.bt-root.bt-embed { margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--rule); }
.bt-embed .bt-embed__stage + .bt-embed__stage { margin-top: var(--s-6); }
.bt-embed .bt-mode-plate { margin-bottom: var(--s-5); }
.bt-embed .bt-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) ─────────────── */
.btr-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);
}
.btr-tabbar .bt-tabs { border-bottom: 0; gap: 4px; }
.btr-tabbar .bt-tab { font-size: 13px; padding: 8px 12px; }
.btr-tabbar__help {
  margin: 6px 0 0;
  font-size: 12.5px; line-height: 1.5;
  color: var(--ink-mute);
}
.bt-embed__tabbar { margin-bottom: var(--s-4); }
.bt-embed .bt-mode-plate + .bt-embed__tabbar { margin-top: 0; }

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

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

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

@media (prefers-reduced-motion: reduce) {
  .btt-fold__summary::before { transition: none; }
}
@media (max-width: 720px) {
  .btr-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 .bt-*; appended only.
   ============================================================================ */

.bt-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); }
.bt-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; }
.bt-rail__item:hover { background: var(--brand-tint); }
.bt-rail__item.active { background: var(--brand); color: #fff; }
.bt-rail__dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--ink-mute); background: transparent; flex-shrink: 0; }
.bt-rail__item[data-state="complete"] .bt-rail__dot { background: var(--pass); border-color: var(--pass); }
.bt-rail__item[data-state="incomplete"] .bt-rail__dot { background: var(--warn); border-color: var(--warn); }
.bt-rail__item[data-state="stale"] .bt-rail__dot { background: transparent; border-color: var(--warn); border-style: dashed; }
.bt-rail__item.active .bt-rail__dot { border-color: #fff; }
.bt-rail__missing { font-size: 11px; color: var(--ink-mute); }
.bt-rail__item.active .bt-rail__missing { color: #fff; }

.bt-cards { display: grid; grid-template-columns: repeat(var(--bt-card-cols, auto-fill), minmax(150px, 1fr)); gap: 8px; }
.bt-cards--sm { grid-template-columns: repeat(var(--bt-card-cols, auto-fill), minmax(120px, 1fr)); }
.bt-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; }
.bt-card:hover { border-color: var(--brand); }
.bt-card[aria-checked="true"] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; background: var(--brand-tint); }
.bt-card:disabled { opacity: .5; cursor: not-allowed; }
.bt-card__glyph { font-size: 20px; line-height: 1; color: var(--brand); }
.bt-card__label { font-weight: 600; font-size: 13.5px; }
.bt-card__desc { font-size: 12px; color: var(--ink-mute); line-height: 1.4; }
.bt-card__badge { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-mute); }

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

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

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

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

/* neck-finish drawing (stages-config.js) */
.btc-finish__svg { display: block; width: 100%; max-width: 360px; height: auto; margin: 8px auto; }
.btc-finish__wall { fill: hsl(148 40% 88%); stroke: hsl(148 45% 34%); stroke-width: 1.2; }
.btc-finish__bore { fill: var(--paper, #fff); stroke: var(--rule-strong, #999); stroke-width: 0.8; }
.btc-finish__crest { fill: hsl(148 45% 34%); }
.btc-finish__dim { stroke: var(--ink-mute); stroke-width: 0.8; }
.btc-finish__txt { fill: var(--ink-2, #333); font-family: var(--font-mono); font-size: 10px; }
.btc-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 #/bottle/<stage> below the fold. Collapse it while the
   bottle page is the active one (same rule as the coil and biscuit shells). */
body:has(.stage-page[data-page="bottle"].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) ── */
.btc-completeness:empty { display: none; }
.btc-complete { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--ink-2); margin-bottom: var(--s-2, 8px); }
.btc-complete .bt-rail__dot { flex: 0 0 auto; margin-top: 5px; }
.btc-parts { display: flex; flex-direction: column; gap: var(--s-3, 12px); }
.btc-part { border: 1px solid var(--rule); border-radius: var(--r-sm, 6px); padding: 10px 12px; background: var(--plate); }
.btc-part[data-envelope="1"] { border-color: var(--warn); }
.btc-part__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.btc-part__title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.btc-part__name { font-weight: 600; overflow-wrap: anywhere; }
.btc-part__role { font-size: 12px; color: var(--ink-2); padding: 1px 8px; border: 1px solid var(--rule); border-radius: var(--r-pill, 999px); }
.btc-part__tools { display: flex; gap: 4px; }
.btc-badge { font-size: 11px; padding: 1px 6px; border-radius: var(--r-pill, 999px); border: 1px solid currentColor; }
.btc-badge--envelope, .btc-badge--warn { color: var(--warn); }
.btc-warnings { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: var(--warn); }
.btc-sub { display: flex; flex-direction: column; gap: 6px; margin-top: var(--s-3, 12px); }
.btc-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btc-geo-badge { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.btc-chain { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; margin: var(--s-2, 8px) 0; }
.btc-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; }
.btc-chain__node[data-state="missing"] { border-style: dashed; border-color: var(--warn); }
.btc-chain__label { font-weight: 600; font-size: 13px; }
.btc-chain__line { font-size: 12px; color: var(--ink-2); }
.btc-chain__link { align-self: center; color: var(--ink-3, var(--ink-2)); }
.btc-card__status { margin-top: var(--s-2, 8px); }
.btc-card__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btc-progress { height: 6px; border-radius: 3px; background: var(--rule); overflow: hidden; }
.btc-progress__bar { height: 100%; background: var(--brand); transition: width .3s; }
.btc-progress[data-state="failed"] .btc-progress__bar { background: var(--fail); }
.btc-progress[data-state="done"] .btc-progress__bar { background: var(--pass); }
.btc-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. ── */
.bt-verdict-badge[data-verdict="PARTIAL"]        { color: var(--pass); background: var(--plate); border-color: var(--pass); border-style: dashed; }
.bt-verdict-badge[data-verdict="NOT_QUANTIFIED"] { color: var(--ink-mute); background: var(--plate-2); border-color: var(--rule-strong); border-style: dashed; }
.bt-verdict[data-verdict="PARTIAL"]        { border-left-color: var(--pass); border-left-style: dashed; }
.bt-verdict[data-verdict="NOT_QUANTIFIED"] { border-left-color: var(--rule-strong); border-left-style: dashed; }

.btr-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)); }
.bt-verdict + .btr-val { margin-top: -6px; border-top: 0; border-radius: 0 0 var(--r-md, 8px) var(--r-md, 8px); }
.btr-val__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btr-val__title { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.btr-val__items { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.btr-val__item { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.btr-val__comp { color: var(--ink-2); }
.btr-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; }
.btr-val__chip[data-state="within"]  { color: var(--pass); border-color: var(--pass); background: var(--pass-tint); }
.btr-val__chip[data-state="outside"] { color: var(--fail); border-color: var(--fail); background: var(--fail-tint); }
.btr-val__chip[data-state="indicative"], .btr-val__chip[data-state="nq"] { color: var(--ink-mute); border-style: dashed; }
.btr-val__cal { font-size: 11px; color: var(--ink-mute); font-style: italic; }
.btr-val__foot { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; }
.btr-val__count { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-2); }
.btr-val__rule { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.btr-val[data-state="unavailable"] { border-style: dashed; }

.btr-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; }
.btr-vnotes .btr-list { margin: 0; }

.btr-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); }
.btr-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; }
.btr-yield__tag--inline { margin: 0 0 0 6px; font-size: 9.5px; padding: 0 5px; vertical-align: 1px; cursor: help; }
.btr-yield__note { margin: 0; font-size: 11.5px; color: var(--ink-2); }
.btr-over { color: var(--warn); font-weight: 600; }
.btr-over__key { margin: 0 0 6px; }

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

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

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

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