/* =====================================================================
   vab.css — Vehicle Assembly Building rocket builder   (mount: #vab-builder)
   Every rule is scoped under .vab / vab- so nothing leaks.
   ===================================================================== */

#vab-builder { width: 100%; }

/* The host console panel has padding:0, so the builder carries its own inner gutter. */
.vab {
  position: relative;
  display: grid;
  gap: 14px;
  grid-template-columns: 236px minmax(0, 1fr) 304px;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "top top top" "palette bay tele";
  height: 712px;
  padding: 14px clamp(14px, 1.6vw, 20px) clamp(14px, 1.6vw, 20px);
  outline: none;
  color: var(--text);
}
/* first fit / container resize: jump straight to the new framing (no zoom-in from scale 1) */
.vab.is-instant .vab-rocket,
.vab.is-instant .vab-sl__t, .vab.is-instant .vab-sl__dv, .vab.is-instant .vab-dim__t, .vab.is-instant .vab-ghost__t { transition: none; }

/* --------------------------------------------------------------- top bar */
.vab__top {
  grid-area: top;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.vab__title { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.vab__title-sep { width: 1px; height: 12px; background: var(--line-strong); }
.vab__title-hint { color: var(--ignite); }
.vab__presets { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.vab__presets-k { margin-right: 4px; color: var(--text-faint); }
.vab-preset { cursor: pointer; transition: color .25s, border-color .25s, background .25s; }
.vab-preset:hover { color: var(--text); border-color: var(--silver); }
.vab-preset[aria-pressed="true"] { color: var(--ignite); border-color: rgba(255, 138, 42, .55); background: rgba(255, 138, 42, .06); }
.vab-clear { margin-left: 4px; color: var(--text-faint); }

/* --------------------------------------------------------------- palette */
.vab__palette {
  grid-area: palette;
  min-height: 0; overflow-y: auto;
  display: grid; align-content: start; gap: 8px;
  padding-right: 6px;
  scrollbar-width: thin; scrollbar-color: var(--ink-600) transparent;
}
.vab-grp__k { color: var(--text-faint); padding: 0 8px 4px; display: flex; align-items: center; gap: 10px; }
.vab-grp__k::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.vab-grp__list { display: grid; gap: 2px; }
.vab-part {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  min-height: 29px; padding: 2px 8px;
  border: 1px solid transparent; border-radius: 2px;
  text-align: left; color: var(--text);
  transition: border-color .25s, background .25s, transform .35s var(--ease-out);
}
.vab-part:hover, .vab-part:focus-visible { border-color: var(--line-strong); background: rgba(255, 255, 255, .035); }
.vab-part:active { transform: scale(.985); }
.vab-part.is-full { opacity: .45; }
.vab-part__t { display: flex; align-items: baseline; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; }
/* the model name never shrinks; the series label gives way first */
.vab-part__main { flex: none; font-weight: 700; font-size: .8rem; letter-spacing: .01em; }
.vab-part__sub { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-family: var(--f-display); font-size: .5rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text-faint); order: -1; }
.vab-part__stat { display: inline-flex; align-items: center; gap: 6px; font-size: .66rem; color: var(--text-faint); white-space: nowrap; }
.vab-part__crew { display: inline-flex; gap: 2px; }
.vab-part__crew i { width: 4px; height: 4px; background: var(--silver); opacity: .75; }
.vab-ico { width: 24px; height: 26px; }
.vab-ico__body { fill: #d5d8dc; }
.vab-ico__dark { fill: #2a2f38; }
.vab-ico__bell { fill: #353b45; }
.vab-ico__line { stroke: rgba(0, 0, 0, .22); stroke-width: .8; }
.vab-ico__rim { stroke: rgba(255, 255, 255, .45); stroke-width: .9; }

/* --------------------------------------------------------------- bay (centre) */
.vab__bay {
  grid-area: bay; min-height: 0; min-width: 0;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr);
  border: 1px solid var(--line); background: rgba(7, 9, 12, .55);
}
.vab-bay__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 12px; border-bottom: 1px solid var(--line);
  /* the Remove button (24px) appears and disappears with the selection — hold the row at its taller height so the
     bay view (and the 3D camera framing, which tracks its size) doesn't jump every time a part is selected */
  min-height: 41px;
}
.vab-bay__hint { font-size: .66rem; color: var(--text-faint); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; text-align: center; transition: color .25s; }
.vab-bay__hint.is-err { color: var(--warn); }
.vab-remove {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 24px; padding: 0 8px;
  font-family: var(--f-display); font-size: .52rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-dim); border: 1px solid var(--line-strong); border-radius: 2px;
  transition: color .2s, border-color .2s, background .2s;
}
.vab-remove[hidden] { display: none; }
.vab-remove__x { font-family: var(--f-mono); font-size: .8rem; line-height: 1; letter-spacing: 0; }
.vab-remove:hover, .vab-remove:focus-visible { color: var(--warn); border-color: rgba(255, 90, 60, .55); background: rgba(255, 90, 60, .06); }
.vab-bay__hk { display: inline-flex; gap: 6px; align-items: baseline; color: var(--text-faint); }
.vab-bay__h { color: var(--text); font-size: .74rem; letter-spacing: .04em; }
.vab-bay__view {
  position: relative; min-height: 0; overflow: hidden;
  background:
    radial-gradient(70% 55% at 50% 52%, rgba(255, 255, 255, .04), transparent 72%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 40px);
}
/* absolutely placed so the SVG (whose viewBox tracks the measured bay) never feeds back into the grid's sizing */
.vab-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; max-width: none; }
.vab.is-rollout .vab-svg { animation: vab-rollout .9s var(--ease-io) both; }
@keyframes vab-rollout { 0% { transform: none; } 45% { transform: translateY(-10px); } 100% { transform: none; } }

.vab-rocket { transition: transform .6s var(--ease-out); will-change: transform; }
/* label font sizes are set inline as (px / scale) so they stay screen-sized; ease them with the same curve as the rocket */
.vab-sl__t, .vab-sl__dv, .vab-dim__t, .vab-ghost__t { transition: font-size .6s var(--ease-out); }

/* rocket materials */
.vab-body { fill: url(#vab-g-body); }
.vab-graphite { fill: url(#vab-g-graphite); }
.vab-bell { fill: url(#vab-g-bell); }
.vab-bell--vac { fill: url(#vab-g-bellv); }
.vab-shield { fill: #1a1e24; }
.vab-window { fill: #0b1118; stroke: rgba(255, 255, 255, .4); stroke-width: .8; }
.vab-accent { fill: var(--ignite); }
.vab-accent-line { fill: rgba(255, 138, 42, .6); }
.vab-dec__notch { fill: rgba(255, 255, 255, .16); }
.vab-hl { stroke: rgba(255, 255, 255, .14); stroke-width: 1; fill: none; }
.vab-hl--panel { stroke: rgba(0, 0, 0, .18); }
.vab-hl--panel-v { stroke: rgba(0, 0, 0, .09); }
.vab-hl--rim { stroke: rgba(255, 255, 255, .38); }
.vab-hl--bell { stroke: rgba(255, 255, 255, .08); }
.vab-hl--stage { stroke: rgba(255, 255, 255, .2); }
.vab-hl--pad { stroke: rgba(255, 255, 255, .24); }
.vab-dim .vab-hl { stroke: rgba(255, 255, 255, .16); }

/* interactive parts */
.vab-p { cursor: pointer; outline: none; }
.vab-p__hit { fill: transparent; stroke: transparent; stroke-width: 1; transition: stroke .25s; }
.vab-p:hover .vab-p__hit { stroke: rgba(255, 255, 255, .5); }
.vab-p:focus-visible .vab-p__hit { stroke: var(--ignite); }
.vab-p.is-selected .vab-p__hit { stroke: var(--ignite); stroke-dasharray: 5 3; }
.vab-p.is-new, .vab-ghost.is-new { animation: vab-snap .5s var(--ease-out) both; transform-box: fill-box; transform-origin: center; }
@keyframes vab-snap { from { opacity: 0; transform: scale(1.12); } to { opacity: 1; transform: none; } }

.vab-ghost { cursor: pointer; }
.vab-ghost__box { fill: rgba(255, 138, 42, .04); stroke: rgba(255, 138, 42, .55); stroke-width: 1; stroke-dasharray: 5 4; }
.vab-ghost__t { fill: var(--ignite); font-family: var(--f-display); letter-spacing: .18em; }
.vab-sl__t { fill: var(--text-faint); font-family: var(--f-display); letter-spacing: .2em; transition: fill .25s; }
.vab-sl.is-active .vab-sl__t { fill: var(--ignite); }
.vab-sl.is-active .vab-hl--stage { stroke: rgba(255, 138, 42, .8); }
.vab-sl__dv { fill: var(--text-dim); font-family: var(--f-mono); }
.vab-sl__hit { fill: transparent; cursor: pointer; }
.vab-sl:hover .vab-sl__t { fill: var(--text); }
.vab-dim__t { fill: var(--text-faint); font-family: var(--f-mono); letter-spacing: .06em; }

/* stage rows */
.vab-stages { border-top: 1px solid var(--line); padding: 4px 8px 8px; }
.vab-stage {
  display: grid; grid-template-columns: 34px 88px auto minmax(0, 1fr) auto 24px; align-items: center; gap: 10px;
  padding: 4px 4px; border-bottom: 1px solid var(--line);
  font-size: .76rem; color: var(--text-dim); cursor: pointer;
  transition: background .25s, color .25s;
}
.vab-stage:hover { background: rgba(255, 255, 255, .025); }
.vab-stage.is-active { background: rgba(255, 138, 42, .055); color: var(--text); }
.vab-stage__pick { font-size: .7rem; height: 26px; border: 1px solid var(--line-strong); color: var(--text-dim); transition: color .25s, border-color .25s; }
.vab-stage.is-active .vab-stage__pick { border-color: var(--ignite); color: var(--ignite); }
.vab-stage__eng { font-weight: 700; font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vab-stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); }
.vab-stepper__b { width: 24px; height: 24px; display: grid; place-items: center; color: var(--text-dim); font-size: .9rem; line-height: 1; transition: color .2s, background .2s; }
.vab-stepper__b:hover:not(:disabled) { color: var(--ignite); background: rgba(255, 255, 255, .04); }
.vab-stepper__b:disabled { opacity: .28; cursor: default; }
.vab-stepper__n { min-width: 30px; text-align: center; font-size: .7rem; }
.vab-stage__tanks { font-size: .68rem; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vab-stage__dv { font-size: .7rem; color: var(--text-dim); white-space: nowrap; }
.vab-stage__rm { width: 24px; height: 24px; display: grid; place-items: center; color: var(--text-faint); font-size: 1rem; line-height: 1; transition: color .2s; }
.vab-stage__rm:hover { color: var(--warn); }
.vab-stage__rm.is-ghost { visibility: hidden; }
.vab-addstage { width: 100%; margin-top: 8px; }
.vab-addstage:disabled { opacity: .4; cursor: default; }
.vab-addstage:disabled::before { display: none; }
.vab-addstage:disabled:hover { color: var(--text); border-color: var(--line-strong); }

/* --------------------------------------------------------------- telemetry */
.vab__tele {
  grid-area: tele; min-height: 0; min-width: 0;
  display: grid; grid-template-rows: minmax(0, 1fr) auto;
  padding: 0;
  background: rgba(255, 255, 255, .02); -webkit-backdrop-filter: none; backdrop-filter: none;
}
.vab-tele__body {
  min-height: 0; overflow-y: auto;
  display: grid; align-content: start; gap: 10px;
  padding: 12px 16px 8px;
  scrollbar-width: thin; scrollbar-color: var(--ink-600) transparent;
}
.vab-tele__foot { padding: 10px 16px 14px; border-top: 1px solid var(--line); background: linear-gradient(180deg, rgba(4, 6, 8, 0), rgba(4, 6, 8, .5)); }
.vab-tele__name { display: grid; gap: 6px; }
.vab-tele__namehead { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 24px; }
.vab-name {
  width: 100%; height: 34px; padding: 0 10px;
  background: rgba(0, 0, 0, .25); border: 1px solid var(--line-strong); border-radius: 2px;
  color: var(--text); font-size: .86rem; letter-spacing: .04em;
  transition: border-color .25s;
}
.vab-name:focus { outline: none; border-color: var(--ignite); }
.vab-status { padding: 4px 8px; font-size: .56rem; letter-spacing: .16em; white-space: nowrap; }
.vab-status.is-go { color: var(--signal); border-color: rgba(116, 196, 80, .4); }
.vab-status.is-sub, .vab-status.is-low, .vab-status.is-risk { color: var(--ignite); border-color: rgba(255, 138, 42, .45); }
.vab-status.is-nogo { color: var(--warn); border-color: rgba(255, 90, 60, .45); }
.vab-tele__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.vab-ro .readout__v { font-size: 1.05rem; }
.vab-twr { display: grid; gap: 8px; }
.vab-twr .readout__v { font-size: 1.05rem; }
.vab-twr__bar { display: flex; gap: 3px; }
.vab-twr__bar .segbar__seg { width: 100%; max-width: 22px; flex: 1; }

.vab-dv { display: grid; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.vab-dv__rows { display: grid; gap: 4px; }
.vab-dv__row { display: grid; grid-template-columns: 24px 84px minmax(0, 1fr) 46px; align-items: center; gap: 8px; font-size: .74rem; color: var(--text-dim); }
.vab-dv__row.is-off { color: var(--text-faint); }
.vab-dv__row-k { color: var(--text-faint); font-size: .66rem; }
.vab-dv__row-e { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vab-dv__row-bar { height: 3px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.vab-dv__row-fill { display: block; height: 100%; width: 100%; background: var(--silver); transform-origin: left; transition: transform .6s var(--ease-out); }
.vab-dv__row-v { text-align: right; font-size: .7rem; color: var(--text); }
.vab-dv__row.is-off .vab-dv__row-v { color: var(--text-faint); }
.vab-dv__total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-top: 2px; }
.vab-dv__total .readout__v { font-size: 1.15rem; }
.vab-dv__bar { position: relative; height: 8px; margin-top: 12px; background: rgba(255, 255, 255, .07); }
.vab-dv__fill { position: absolute; inset: 0; background: var(--ignite); transform-origin: left; transform: scaleX(0); transition: transform .6s var(--ease-out), background .3s; }
.vab-dv__bar.is-go .vab-dv__fill { background: var(--signal); }
.vab-dv__orbit { position: absolute; top: -5px; bottom: -5px; width: 1px; background: var(--text); }
.vab-dv__orbit-k { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 3px; white-space: nowrap; font-family: var(--f-display); font-size: .5rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text-dim); }

.vab-tele__flags { display: grid; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.vab-flags { display: grid; gap: 6px; }
.vab-flag { display: grid; grid-template-columns: 6px 1fr; gap: 10px; align-items: start; font-size: .76rem; line-height: 1.45; color: var(--text-dim); }
.vab-flag .dot { margin-top: 7px; }
.vab-flag.is-crit { color: var(--text); }
.vab-flag.is-crit .dot { color: var(--warn); }
.vab-flag.is-warn .dot { color: var(--ignite); }
.vab-flag.is-info .dot { color: var(--silver); box-shadow: none; }
.vab-flag.is-ok { color: var(--signal); }
.vab-flag.is-ok .dot { color: var(--signal); }

.vab-launch { width: 100%; }
.vab-launch.is-disabled { opacity: .55; filter: saturate(.3); font-size: .62rem; letter-spacing: .14em; padding-inline: 12px; cursor: not-allowed; }
.vab-launch.is-disabled::before { display: none; }

/* --------------------------------------------------------------- tooltip */
.vab-tip {
  position: absolute; z-index: 6; width: 280px; max-width: calc(100% - 16px);
  padding: 12px 14px 12px;
  background: var(--glass-strong); border: 1px solid var(--line-strong);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  pointer-events: none;
  display: grid; gap: 6px;
  animation: vab-tip-in .22s var(--ease-out) both;
}
.vab-tip::before, .vab-tip::after { content: ""; position: absolute; width: 10px; height: 10px; border-color: var(--ignite); border-style: solid; opacity: .9; }
.vab-tip::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.vab-tip::after { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }
.vab-tip[hidden] { display: none; }
@keyframes vab-tip-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.vab-tip__k { color: var(--ignite); font-size: .52rem; }
.vab-tip__n { font-family: var(--f-display); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text); }
.vab-tip__d { font-size: .76rem; line-height: 1.5; color: var(--text-dim); }
.vab-tip__f { display: grid; gap: 2px; padding-left: 0; font-size: .72rem; color: var(--text-dim); }
.vab-tip__f li { display: flex; gap: 8px; align-items: baseline; }
.vab-tip__f li::before { content: ""; width: 4px; height: 4px; flex: none; background: var(--silver); transform: rotate(45deg); position: relative; top: -2px; }
.vab-tip__s { font-size: .66rem; color: var(--text-faint); padding-top: 4px; border-top: 1px solid var(--line); }

/* --------------------------------------------------------------- 3D bay (ASA3D)
   .vab.is-3d is set once the live view has replaced the SVG drawing. */
.vab.is-3d { gap: 12px; grid-template-columns: 224px minmax(0, 1fr) 290px; }
.vab.is-3d .vab__bay { background: #090c10; border-color: var(--line-strong); }
.vab.is-3d .vab-bay__view { background: radial-gradient(80% 60% at 50% 70%, #11161d, #07090c 75%); }
.vab.is-3d .vab-stages { padding: 2px 8px 6px; }
.vab.is-3d .vab-stage { padding-block: 2px; }
.vab.is-3d .vab-addstage { margin-top: 6px; min-height: 32px; }
.vab.is-rollout .vab3d { animation: vab-rollout .9s var(--ease-io) both; }

.vab3d { position: absolute; inset: 0; overflow: hidden; }
.vab3d .a3d-canvas { cursor: grab; }
.vab3d .a3d-canvas:active { cursor: grabbing; }
/* the kit's drag hint sits bottom-centre by default; park it bottom-right, clear of the fire button */
.vab3d .a3d-hint { left: auto; right: 14px; bottom: 14px; transform: none; }
/* narrow bay (900–1250px desktop layouts): the hint would run under the Test fire button — the +/− buttons cover it */
.vab3d.is-tight .a3d-hint { display: none; }
/* kit overlay buttons set display:inline-flex, which beats the [hidden] attribute — restore it here */
.vab3d .a3d-tap[hidden], .vab3d .a3d-done[hidden], .vab3d .a3d-live-ring[hidden] { display: none; }
.vab3d .a3d-tap { white-space: nowrap; }
.vab3d-ui { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.vab3d-layer { position: absolute; inset: 0; }
.vab3d-ui::before, .vab3d-ui::after {
  content: ""; position: absolute; width: 14px; height: 14px; border-color: var(--silver); border-style: solid; opacity: .55;
}
.vab3d-ui::before { top: 8px; left: 8px; border-width: 1px 0 0 1px; }
.vab3d-ui::after { bottom: 8px; right: 8px; border-width: 0 1px 1px 0; }

.vab3d-corner {
  position: absolute; left: 16px; top: 13px;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .52rem; letter-spacing: .26em; color: var(--text-faint);
}
.vab3d-corner .dot { width: 5px; height: 5px; color: var(--signal); box-shadow: 0 0 8px currentColor; animation: pulse 2.4s ease-in-out infinite; }

/* zoom / reset — vertical rail on the right edge, clear of the kit's top-right "Done" (touch) */
.vab3d-ctrl {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  display: grid; gap: 4px; pointer-events: auto;
}
.vab3d-btn {
  width: 32px; height: 32px; display: grid; place-items: center;
  color: var(--text-dim); background: rgba(6, 8, 11, .62); border: 1px solid var(--line-strong); border-radius: 2px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: color .2s, border-color .2s, background .2s;
}
.vab3d-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: square; }
.vab3d-btn:hover, .vab3d-btn:focus-visible { color: var(--ignite); border-color: rgba(255, 138, 42, .55); background: rgba(20, 12, 6, .7); }

/* test fire */
.vab3d-fire {
  position: absolute; left: 14px; bottom: 14px; pointer-events: auto;
  display: inline-flex; align-items: center; gap: 9px; height: 34px; padding: 0 14px 0 11px;
  font-family: var(--f-display); font-size: .56rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ignite); background: rgba(22, 11, 4, .62); border: 1px solid rgba(255, 138, 42, .5); border-radius: 2px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: color .25s, background .25s, border-color .25s, opacity .25s;
}
.vab3d-fire__ico svg { width: 14px; height: 14px; display: block; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linejoin: round; }
.vab3d-fire:hover, .vab3d-fire:focus-visible { color: #1a0b00; background: var(--ignite); border-color: var(--ignite); }
.vab3d-fire.is-off { opacity: .5; }
.vab3d-fire.is-off:hover { color: var(--ignite); background: rgba(22, 11, 4, .62); border-color: rgba(255, 138, 42, .5); }
.vab3d-fire.is-firing { color: #1a0b00; background: var(--ignite-hot); border-color: var(--ignite-hot); cursor: default; animation: vab3d-firing .5s ease-in-out infinite alternate; }
@keyframes vab3d-firing { from { box-shadow: 0 0 0 rgba(255, 138, 42, 0); } to { box-shadow: 0 0 22px rgba(255, 138, 42, .55); } }

/* stage brackets — one column to the right of the widest part; height tracks the stage */
.vab3d-sl { position: absolute; left: 0; top: 0; width: 1px; will-change: transform; transition: opacity .3s; }
.vab3d-sl__line {
  position: absolute; left: 0; top: 0; bottom: 0; width: 8px;
  border: 1px solid rgba(255, 255, 255, .26); border-left: 0;
}
.vab3d-sl__lbl {
  position: absolute; left: 14px; top: -2px; pointer-events: auto;
  display: grid; gap: 1px; text-align: left; white-space: nowrap; padding: 2px 4px 2px 0;
}
.vab3d-sl__t { font-family: var(--f-display); font-size: .5rem; letter-spacing: .22em; text-transform: uppercase; color: var(--text-faint); transition: color .25s; }
.vab3d-sl__dv { font-size: .66rem; color: var(--text-dim); }
.vab3d-sl__lbl:hover .vab3d-sl__t { color: var(--text); }
.vab3d-sl.is-active .vab3d-sl__line { border-color: rgba(255, 138, 42, .85); }
.vab3d-sl.is-active .vab3d-sl__t { color: var(--ignite); }

/* empty-slot hologram label */
.vab3d-ghost {
  position: absolute; left: 0; top: 0; pointer-events: auto; white-space: nowrap;
  padding: 5px 9px; font-family: var(--f-display); font-size: .52rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ignite); background: rgba(20, 10, 3, .55); border: 1px dashed rgba(255, 138, 42, .55); border-radius: 2px;
  transition: opacity .3s, background .2s;
}
.vab3d-ghost:hover { background: rgba(255, 138, 42, .14); }

/* selected-part tag (left of the part, with a leader line) */
/* positioned from JS: transform = translate(anchor) translate(-100%, -50%) — written as one transform so older browsers
   without the individual `translate` property place it correctly; max-width is set per frame so it can't leave the bay */
.vab3d-tag {
  position: absolute; left: 0; top: 0; will-change: transform;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; justify-items: end; text-align: right;
  margin-left: -26px; transform-origin: right center; max-width: 320px;
  padding: 6px 10px 6px 12px;
  background: rgba(8, 10, 13, .78); border: 1px solid rgba(255, 138, 42, .45); border-radius: 2px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.vab3d-tag[hidden] { display: none; }
.vab3d-tag__k, .vab3d-tag__n { max-width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.vab3d-tag.is-narrow { margin-left: 6px; padding: 5px 8px; }
.vab3d-tag.is-narrow::before, .vab3d-tag.is-narrow::after { display: none; }
.vab3d-tag.is-narrow .vab3d-tag__n { font-size: .6rem; letter-spacing: .05em; }
.vab3d-tag::after { content: ""; position: absolute; left: 100%; top: 50%; width: 26px; height: 1px; background: linear-gradient(90deg, rgba(255, 138, 42, .8), rgba(255, 138, 42, .2)); }
.vab3d-tag::before { content: ""; position: absolute; left: calc(100% + 24px); top: calc(50% - 2px); width: 5px; height: 5px; background: var(--ignite); transform: rotate(45deg); box-shadow: 0 0 10px var(--ignite); }
.vab3d-tag.is-in { animation: vab3d-tag-in .35s var(--ease-out) both; }
@keyframes vab3d-tag-in { from { opacity: 0; filter: blur(3px); } to { opacity: 1; filter: none; } }
.vab3d-tag__k { font-family: var(--f-display); font-size: .48rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ignite); }
.vab3d-tag__n { font-family: var(--f-display); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text); white-space: nowrap; }

/* keyboard twins of the 3D parts — invisible until focused, then a bracketed box around the part */
.vab3d-hots { position: absolute; inset: 0; }
.vab3d-hot {
  position: absolute; left: 0; top: 0; width: 1px; height: 1px;
  pointer-events: none; opacity: 0; border: 1px solid var(--ignite); border-radius: 2px;
  background: rgba(255, 138, 42, .05);
}
.vab3d-hot:focus { outline: none; }
.vab3d-hot:focus-visible { opacity: 1; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5), 0 0 18px rgba(255, 138, 42, .25); }

/* --------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .vab.is-3d { grid-template-columns: 212px minmax(0, 1fr) 272px; }
  .vab { grid-template-columns: 212px minmax(0, 1fr) 272px; }
  /* the centre column gets narrow between 900 and 1100px — drop the tank list from the stage rows */
  .vab-stage { grid-template-columns: 34px minmax(0, 1fr) auto auto 24px; gap: 8px; }
  .vab-stage__tanks { display: none; }
}
@media (max-width: 899px) {
  .vab {
    height: auto;
    padding: 12px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
    grid-template-areas: "top" "palette" "bay" "tele";
  }
  .vab-stage { grid-template-columns: 34px 88px auto minmax(0, 1fr) auto 30px; gap: 10px; }
  .vab-stage__tanks { display: block; }
  .vab__palette {
    display: flex; gap: 16px; align-items: center;
    overflow-x: auto; overflow-y: hidden; padding: 2px 0 8px;
    -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
  }
  .vab-grp { display: flex; align-items: center; gap: 10px; flex: none; }
  .vab-grp + .vab-grp { padding-left: 14px; border-left: 1px solid var(--line); }
  /* horizontal section tag inside the scrolling row (a rotated label made the row twice as tall as the chips) */
  .vab-grp__k { padding: 0; font-size: .52rem; letter-spacing: .2em; white-space: nowrap; scroll-snap-align: start; }
  .vab-grp__k::after { display: none; }
  .vab-grp__list { display: flex; gap: 6px; }
  .vab-part {
    display: inline-flex; align-items: center; gap: 8px; flex: none; scroll-snap-align: start;
    min-height: 44px; padding: 4px 10px 4px 6px; border-color: var(--line);
  }
  .vab-part__stat { display: none; }
  /* bigger touch targets in the stage rows */
  .vab-stage__pick { height: 30px; }
  .vab-stepper__b, .vab-stage__rm { width: 30px; height: 30px; }
  .vab-stepper__n { min-width: 22px; }
  .vab-remove { height: 30px; }
  .vab-bay__head { min-height: 47px; }
  /* the bay sits under the parts chips at roughly 60% of the small viewport height */
  .vab-bay__view { height: 60vh; height: 60svh; min-height: 320px; max-height: 640px; }
  .vab.is-3d { grid-template-columns: minmax(0, 1fr); }
  .vab-tele__body { overflow: visible; }
  .vab-tip { width: 300px; }
}
@media (max-width: 899px) and (orientation: landscape) {
  /* a landscape phone's bay is only ~320px tall — the kit's centred "Tap to interact" would sit on the engines and the stand */
  .vab3d .a3d-tap { left: auto; right: 14px; bottom: 14px; transform: none; min-height: 34px; padding: 0 12px; }
}
@media (max-width: 560px) {
  .vab-stage { grid-template-columns: 34px minmax(0, 1fr) auto auto 30px; gap: 8px; }
  .vab-stage__tanks { display: none; }
  .vab-bay__hint { display: none; }
  .vab-bay__hint.is-err { display: block; }
  .vab__presets-k { display: none; }
  .vab__title { flex-wrap: wrap; gap: 4px 10px; }
  .vab__title .label { font-size: .58rem; letter-spacing: .14em; white-space: nowrap; }
  .vab__presets { gap: 6px; }
  .vab-preset { padding: 6px 8px; letter-spacing: .14em; }
  .vab-clear { margin-left: 0; }
  /* touch: the kit's "Tap to interact" owns the bottom edge — fire button moves under the corner label */
  .vab3d-fire { left: 12px; top: 34px; bottom: auto; height: 30px; padding: 0 10px 0 9px; }
  .vab3d-corner { left: 13px; top: 12px; }
  .vab3d-btn { width: 34px; height: 34px; }
  .vab3d-sl__dv { font-size: .6rem; }
}

@media (max-width: 420px) {
  /* per-stage Δv is already printed beside the drawing and in the telemetry — give the engine name the room */
  .vab-stage { grid-template-columns: 34px minmax(0, 1fr) auto 30px; }
  .vab-stage__dv { display: none; }
}

/* --------------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  .vab-rocket, .vab-dv__fill, .vab-dv__row-fill { transition: none; }
  .vab-p.is-new, .vab-ghost.is-new, .vab-tip, .vab.is-rollout .vab-svg, .vab.is-rollout .vab3d,
  .vab3d-tag.is-in, .vab3d-fire.is-firing, .vab3d-corner .dot { animation: none; }
}
