/* AirFX — Hyperstudio: blueprint scratched into obsidian. See design.md. */
* { box-sizing: border-box; }

:root {
  /* ── Light: "blueprint on paper" (default) ─────────────────────────── */
  --canvas: #f4f4f1;        /* paper */
  --well: #ffffff;          /* recessed surfaces */
  --ink: #101010;           /* primary text */
  --ink-2: #3d3d3d;         /* secondary text */
  --ink-3: #6b6b67;         /* muted text — darkened to clear 4.5:1 on paper */
  --rule: #dededa;          /* hairline borders */
  --rule-2: #b4b4ae;        /* stronger border */
  --action: #101010;        /* solid button fill */
  --on-action: #f4f4f1;     /* text on a solid button */
  --gold: #6f6759;          /* icon strokes only */
  --pulse: #3f7d00;         /* live / active only */
  --danger: #b3261e;
  --scrim: rgba(16, 16, 16, .58);   /* always darkens — never follows the canvas */
  --on-scrim: #f4f4f1;
  --badge-fixed: rgba(16, 16, 16, .72);  /* over video, which is any brightness */
  --pulse-on-video: #98ff38;             /* live colour over video: fixed, like the scrim */
  --badge: #eaeae6;

  --sans: "Inter", "Satoshi", "General Sans", system-ui, -apple-system, Segoe UI, sans-serif;
  --mono: "IBM Plex Mono", "JetBrains Mono", "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 40px;
  --r-tag: 4px; --r-card: 8px; --r-pill: 9999px;
  --max: 1200px;
  color-scheme: light;
}

/* ── Dark: "blueprint scratched into obsidian" ─────────────────────────── */
:root[data-theme="dark"] {
  --canvas: #101010;
  --well: #080808;
  --ink: #f3f3f3;
  --ink-2: #c1c1c1;
  --ink-3: #9c9c9c;
  --rule: #212121;
  --rule-2: #474747;
  --action: #ffffff;
  --on-action: #101010;
  --gold: #8a8072;
  --pulse: #98ff38;
  --danger: #ff6b64;
  --scrim: rgba(8, 8, 8, .88);
  --on-scrim: #f3f3f3;
  --badge-fixed: rgba(8, 8, 8, .72);
  --pulse-on-video: #98ff38;
  --badge: #1a1a1a;
  color-scheme: dark;
}


html, body { height: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 16px/1.25 var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* ── Header ───────────────────────────────────────────────────────────── */
header {
  display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap;
  max-width: var(--max); margin: 0 auto;
  padding: var(--s5) var(--s5);
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: baseline; gap: var(--s2); font-size: 21px; line-height: .95; }
.brand .mark { color: var(--gold); }
.brand b { font-weight: 400; letter-spacing: -0.31px; }
.brand .tag {
  align-self: center; font: 400 8px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-3); border: 1px solid var(--rule); border-radius: var(--r-tag); padding: 5px 6px;
}
.warn {
  margin-left: auto; min-width: 0;
  font: 400 13px/1.4 var(--sans); color: var(--ink-3);
  border-left: 1px solid var(--rule); padding-left: var(--s4);
}
.help {
  background: transparent; color: var(--ink);
  border: 1px solid var(--action); border-radius: var(--r-card);
  padding: 10px 20px; font: 400 13px var(--sans); cursor: pointer;
}
.help:hover { background: var(--action); color: var(--on-action); }

/* ── Focus: visible on every interactive surface, in both themes ──────── */
:where(button, [role="button"], select, a, [tabindex]):focus-visible {
  outline: 2px solid var(--pulse);
  outline-offset: 2px;
}

.header-actions { display: flex; gap: var(--s2); align-items: center; }

/* ── Start screen ─────────────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 10;
  display: grid; place-content: center; justify-items: center; gap: var(--s5);
  padding: var(--s5); text-align: center; background: var(--canvas);
}
.overlay[hidden] { display: none; }
.hero-title {
  margin: 0; max-width: 18ch;
  font: 400 44px/1.07 var(--sans); letter-spacing: -0.31px; color: var(--ink);
}
.hero-sub { margin: 0; max-width: 52ch; font: 400 16px/1.5 var(--sans); color: var(--ink-2); }
.hero-note { margin: 0; max-width: 46ch; font: 400 13px/1.6 var(--mono); color: var(--ink-3); }
#startBtn {
  background: var(--action); color: var(--on-action); border: 0;
  border-radius: var(--r-pill); padding: 12px 24px;
  font: 400 16px var(--sans); letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
}
#startBtn:hover { background: var(--ink-2); }
.error { color: var(--danger); font: 400 13px var(--mono); }

/* ── Workspace ────────────────────────────────────────────────────────── */
main {
  display: grid; gap: var(--s6);
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
  max-width: var(--max); margin: 0 auto; padding: var(--s6) var(--s5) var(--s7);
}
.col { min-width: 0; display: flex; flex-direction: column; gap: var(--s4); }
.col-title {
  font: 400 8px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3);
  padding-bottom: var(--s3); border-bottom: 1px solid var(--rule); margin: 0;
}
.col-right .col-title { text-align: right; }
.rack { display: grid; grid-template-columns: 1fr; gap: var(--s4); }

/* ── Camera stage ─────────────────────────────────────────────────────── */
.stage {
  position: relative; width: 100%; overflow: hidden;
  background: var(--well); border: 1px solid var(--rule); border-radius: var(--r-card);
}
video { width: 100%; height: auto; display: block; transform: scaleX(-1); min-height: 220px; }
#overlay { position: absolute; inset: 0; width: 100%; height: 100%; transform: scaleX(-1); pointer-events: none; }
.status {
  position: absolute; inset: 0; display: grid; place-content: center; padding: var(--s5);
  background: var(--scrim); color: var(--on-scrim);
  font: 400 13px/1.6 var(--mono); text-align: center; pointer-events: none;
}
.status:empty { display: none; }
.stage-tag {
  position: absolute; left: var(--s3); top: var(--s3);
  display: flex; align-items: center; gap: 6px;
  background: var(--badge-fixed); border: 1px solid rgba(255, 255, 255, .18); border-radius: var(--r-tag);
  padding: 5px 8px; font: 400 8px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase;
  color: #f3f3f3; pointer-events: none;
}
.stage-tag::before {
  content: ""; width: 5px; height: 5px; border-radius: var(--r-pill); background: var(--pulse);
}

/* ── Transport ────────────────────────────────────────────────────────── */
.transport {
  display: flex; flex-direction: column; gap: var(--s3);
  border: 1px solid var(--rule); border-radius: var(--r-card); padding: var(--s4);
}
.upload {
  display: block; text-align: center; cursor: pointer;
  background: var(--action); color: var(--on-action);
  border-radius: var(--r-pill); padding: 12px 24px;
  font: 400 13px var(--sans); letter-spacing: .06em; text-transform: uppercase;
}
.upload:hover { background: var(--ink-2); }
.track-actions { display: flex; gap: var(--s2); flex-wrap: wrap; }
.track-actions > * { flex: 1 1 140px; }
.upload--ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--rule-2); padding: 11px 24px;
}
.upload--ghost:hover { background: transparent; border-color: var(--action); }
.upload[disabled], .upload:disabled { opacity: .5; cursor: progress; }
.hint { margin: 0; font: 400 13px/1.5 var(--sans); color: var(--ink-3); }
.transport audio { width: 100%; height: 36px; }
:root[data-theme="dark"] .transport audio { filter: invert(1) grayscale(1) contrast(.85); }

/* ── Effect cards + arc knobs ─────────────────────────────────────────── */
.fx {
  position: relative; cursor: pointer; user-select: none;
  background: transparent; border: 1px solid var(--rule); border-radius: var(--r-card);
  padding: var(--s4) var(--s4) var(--s5);
  transition: border-color .18s ease;
}
.fx:hover { border-color: var(--rule-2); }
.fx.active { border-color: var(--action); }
.fx h3 {
  display: flex; align-items: center; gap: var(--s2); margin: 0 0 var(--s4);
  font: 400 13px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2);
}
.fx.active h3 { color: var(--ink); }
.fx h3::before {
  content: ""; width: 5px; height: 5px; border-radius: var(--r-pill);
  background: var(--rule-2); flex: none;
}
.fx.active h3::before { background: var(--pulse); }
.fx h3 .pwr {
  margin-left: auto; font: 400 8px/1 var(--mono); letter-spacing: .14em;
  color: var(--ink-3); border: 1px solid var(--rule); border-radius: var(--r-tag); padding: 4px 6px;
}
.fx.active h3 .pwr { color: var(--pulse); border-color: var(--rule-2); }

.knobs { display: flex; gap: var(--s4); flex-wrap: wrap; justify-content: center; }
.knob { text-align: center; }
.dial { width: 80px; height: 80px; display: block; margin: 0 auto var(--s2); }
.dial .track { fill: none; stroke: var(--rule); stroke-width: 6; stroke-linecap: butt; stroke-dasharray: 75 100; }
.dial .arc { fill: none; stroke: var(--rule-2); stroke-width: 6; stroke-linecap: butt; stroke-dasharray: 0 100; transition: stroke-dasharray .07s linear; }
.dial .hub { fill: none; stroke: var(--rule); stroke-width: 1; }
.dial .ptr { stroke: var(--rule-2); stroke-width: 2; stroke-linecap: butt; }
.fx.active .dial .arc, .fx.active .dial .ptr { stroke: var(--ink); }
.knob .lbl { display: block; font: 400 8px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.knob .val { display: block; font: 400 13px var(--mono); color: var(--ink-2); margin-top: 5px; }
.fx.active .knob .val { color: var(--ink); }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.actions { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
button {
  background: transparent; color: var(--ink);
  border: 1px solid var(--rule-2); border-radius: var(--r-card);
  padding: 10px 20px; font: 400 13px var(--sans); cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
button:hover { border-color: var(--action); }
button.danger { border-color: var(--danger); color: var(--danger); }
button.danger.on { background: var(--danger); color: var(--on-action); }
button.danger:hover { background: var(--danger); color: var(--on-action); border-color: var(--danger); }
select#preset {
  background: var(--well); color: var(--ink);
  border: 1px solid var(--rule-2); border-radius: var(--r-card);
  padding: 10px 12px; font: 400 13px var(--sans);
}
.ghost { background: transparent; border: 1px solid var(--rule); color: var(--ink-3); }
.ghost:hover { color: var(--ink); border-color: var(--rule-2); }

/* ── Readouts ─────────────────────────────────────────────────────────── */
#meters {
  font: 400 13px/1.9 var(--mono); color: var(--ink-3);
  border: 1px solid var(--rule); border-radius: var(--r-card); padding: var(--s3) var(--s4);
  overflow-x: auto;
}
#meters b { color: var(--ink); font-weight: 400; }
.meter { display: flex; gap: var(--s3); align-items: baseline; }
.meter b { flex: none; width: 5ch; font-size: 8px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.meter span { min-width: 0; }
.debug {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--badge); border: 1px solid var(--rule); border-radius: var(--r-tag);
  padding: 6px 8px; font: 400 8px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); text-align: center;
}
.debug::before { content: ""; width: 5px; height: 5px; border-radius: var(--r-pill); background: var(--pulse); flex: none; }
.debug.waiting { color: var(--ink-2); }
.debug.waiting::before { background: var(--rule-2); }
.debug.err { color: var(--danger); border-color: var(--danger); }
.debug.err::before { background: var(--danger); }

/* ── Mode toggle (Air vs Grab) ────────────────────────────────────────── */
.modes { display: flex; gap: var(--s2); }
.mode-btn { flex: 1; border-color: var(--rule); color: var(--ink-3); }
.mode-btn.on { background: var(--action); color: var(--on-action); border-color: var(--action); }

/* ── Onboarding tour ──────────────────────────────────────────────────── */
.ob-root { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.ob-spot {
  position: fixed; border-radius: var(--r-card);
  box-shadow: 0 0 0 9999px var(--scrim); /* scrim, not elevation */
  outline: 1px solid var(--action);
  transition: left .25s, top .25s, width .25s, height .25s;
}
.ob-card {
  position: fixed; max-width: min(360px, calc(100vw - 24px));
  background: var(--canvas); border: 1px solid var(--rule-2); border-radius: var(--r-card);
  padding: var(--s5); pointer-events: auto;
}
.ob-title { margin: 0 0 var(--s2); font: 400 21px/0.95 var(--sans); }
.ob-body { margin: 0 0 var(--s5); color: var(--ink-2); font: 400 16px/1.5 var(--sans); }
.ob-dots { display: flex; gap: var(--s1); margin-bottom: var(--s4); }
.ob-dot { width: 16px; height: 3px; border-radius: var(--r-pill); background: var(--rule); border: 0; padding: 0; cursor: pointer; }
.ob-dot.on { background: var(--action); }
.ob-cta { margin-bottom: var(--s3); }
.ob-cta:empty { display: none; }
.ob-ctabtn {
  width: 100%; background: var(--action); color: var(--on-action); border: 0;
  border-radius: var(--r-pill); padding: 12px 24px;
  font: 400 13px var(--sans); letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
}
.ob-engine {
  display: flex; align-items: center; gap: var(--s2);
  margin-bottom: var(--s3); padding: 8px 10px;
  background: var(--badge); border: 1px solid var(--rule); border-radius: var(--r-tag);
  font: 400 13px/1.4 var(--mono); color: var(--ink-2);
}
.ob-engine[hidden] { display: none; }
.ob-engine-dot {
  width: 7px; height: 7px; border-radius: var(--r-pill); flex: none;
  background: var(--pulse); animation: obPulse 1.2s ease-in-out infinite;
}
.ob-engine.failed { border-color: var(--danger); color: var(--danger); }
.ob-engine.failed .ob-engine-dot { background: var(--danger); animation: none; }
@keyframes obPulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ob-engine-dot { animation: none; } }

.ob-ctabtn:disabled { opacity: .45; cursor: progress; }

.ob-nav { display: flex; gap: var(--s2); align-items: center; }
.ob-next {
  margin-left: auto; background: var(--action); color: var(--canvas);
  border: 0; border-radius: var(--r-pill); padding: 12px 24px;
  font: 400 13px var(--sans); letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
}
.ob-back:disabled { opacity: .4; cursor: default; }
.ob-exit { margin-top: var(--s3); width: 100%; font-size: 13px; }
.ob-voice {
  position: absolute; top: var(--s3); right: var(--s3);
  background: transparent; border: 0; padding: 0; font-size: 1rem; line-height: 1; cursor: pointer;
  color: var(--gold);
}

/* ── Calibration ──────────────────────────────────────────────────────────
   The panel sits BELOW the stage and the guidance is drawn ON the video. A
   centred modal over a scrim used to cover the one thing you need to see. */

/* Everything except the stage and the calibration panel steps back. */
body.calibrating .col-left,
body.calibrating .col-right,
body.calibrating .transport,
body.calibrating .modes,
body.calibrating .actions,
body.calibrating #meters { opacity: .32; pointer-events: none; filter: saturate(.4); }

.cal-panel {
  border: 1px solid var(--action); border-radius: var(--r-card);
  padding: var(--s4) var(--s5) var(--s5);
  display: flex; flex-direction: column; gap: var(--s2);
}
.cal-head { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.cal-step { font: 400 8px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); }
.cal-skip { margin-left: auto; font: 400 13px var(--sans); padding: 6px 12px; }
.cal-text { margin: 0; font: 400 18px/1.31 var(--sans); color: var(--ink); }
.cal-sub { margin: 0; font: 400 13px/1.5 var(--sans); color: var(--ink-3); max-width: 58ch; }
.cal-actions { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s2); }
.cal-manual { font: 400 13px var(--sans); }
.cal-manual[hidden] { display: none; }
.cal-live { font: 400 13px var(--mono); color: var(--ink-3); min-width: 0; }
.cal-panel.warning { border-color: var(--danger); }
.cal-warn { border-top: 1px solid var(--rule); padding-top: var(--s3); margin-top: var(--s2); }
.cal-warn[hidden] { display: none; }
.cal-warn-text { margin: 0 0 var(--s3); font: 400 13px/1.5 var(--sans); color: var(--danger); max-width: 58ch; }
.cal-warn-actions { display: flex; gap: var(--s2); flex-wrap: wrap; }
.cal-redo { border-color: var(--danger); color: var(--danger); }
.cal-redo:hover { background: var(--danger); color: var(--on-action); border-color: var(--danger); }

/* ── The guide drawn over the video ───────────────────────────────────── */
.cal-guide-layer { position: absolute; inset: 0; pointer-events: none; z-index: 3; }

/* The half that is NOT in play is heavily darkened. A faint tint was invisible against a
   real, brightly lit room — the split has to survive any camera image. */
.cal-dim {
  position: absolute; top: 0; bottom: 0; width: 50%;
  background: rgba(0, 0, 0, .66);
  transition: left .25s ease;
}
.cal-guide-layer[data-side="left"] .cal-dim { left: 50%; }
.cal-guide-layer[data-side="right"] .cal-dim { left: 0; }

.cal-divider {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 2px;
  background: rgba(255, 255, 255, .9); transform: translateX(-50%);
}

.cal-side-tag {
  position: absolute; bottom: var(--s3); width: 50%; text-align: center;
  font: 400 11px/1 var(--mono); letter-spacing: .22em; text-transform: uppercase;
  color: #ffffff; text-shadow: 0 1px 4px rgba(0, 0, 0, .95);
}
.cal-guide-layer[data-side="left"] .cal-side-tag { left: 0; }
.cal-guide-layer[data-side="right"] .cal-side-tag { left: 50%; }

/* ── Ghost hand target ────────────────────────────────────────────────── */
.cal-ghost {
  position: absolute; height: 46%; aspect-ratio: 0.7 / 1;
  transform: translate(var(--anchor-x, -50%), var(--anchor-y, -58%));
  transition: left .3s ease, top .3s ease;
}

/* A demonstration hand that travels into the target on a loop, so the motion is shown
   rather than described. It runs only until the user's own hand is in the ring. */
.cal-demo {
  position: absolute; height: 46%; aspect-ratio: 0.7 / 1;
  opacity: 0; pointer-events: none;
  transform: translate(var(--anchor-x, -50%), var(--anchor-y, -58%));
}
.cal-guide-layer.demo-on[data-dir="up"] .cal-demo { animation: calDemoUp 2.9s ease-in-out infinite; }
.cal-guide-layer.demo-on[data-dir="down"] .cal-demo { animation: calDemoDown 2.9s ease-in-out infinite; }
.cal-demo .cal-ghost-bones line { stroke: #ffffff; stroke-dasharray: none; stroke-width: 3; opacity: 1; }
.cal-demo .cal-ghost-joints circle { fill: #ffffff; r: 2; }

/* Travel is expressed in the element's own height, so it scales with the stage. */
@keyframes calDemoUp {
  0%, 6%   { transform: translate(var(--anchor-x), calc(var(--anchor-y) + 105%)) scale(.88); opacity: 0; }
  18%      { opacity: .85; }
  60%, 80% { transform: translate(var(--anchor-x), var(--anchor-y)) scale(.88); opacity: .85; }
  100%     { transform: translate(var(--anchor-x), var(--anchor-y)) scale(.88); opacity: 0; }
}
@keyframes calDemoDown {
  0%, 6%   { transform: translate(var(--anchor-x), calc(var(--anchor-y) - 105%)) scale(.88); opacity: 0; }
  18%      { opacity: .85; }
  60%, 80% { transform: translate(var(--anchor-x), var(--anchor-y)) scale(.88); opacity: .85; }
  100%     { transform: translate(var(--anchor-x), var(--anchor-y)) scale(.88); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .cal-guide-layer.demo-on .cal-demo { animation: none; opacity: .5; }
}
/* The ring is the real hit tolerance, sized by JS from HIT_RADIUS. */
.cal-target {
  position: absolute; aspect-ratio: 1; transform: translate(-50%, -50%);
  transition: left .3s ease, top .3s ease;
}
.cal-ghost-svg { position: absolute; height: 100%; width: 100%; overflow: visible; }
.cal-ghost-bones line {
  stroke: #ffffff; stroke-width: 2.6; stroke-linecap: round; fill: none;
  opacity: .95; stroke-dasharray: 7 5;
}
.cal-ghost-joints circle { fill: #ffffff; opacity: .8; }
.cal-ghost-svg { filter: drop-shadow(0 0 6px rgba(0, 0, 0, .95)); }

/* Hold ring: fills while the hand stays inside the target. */
.cal-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transform: rotate(-90deg); }
.cal-ring-track { fill: none; stroke: rgba(255, 255, 255, .30); stroke-width: 2.5; }
.cal-ring-fill {
  fill: none; stroke: var(--pulse-on-video); stroke-width: 4; stroke-linecap: round;
  stroke-dasharray: 0 100; transition: stroke-dasharray .08s linear;
}

/* In the target: the ghost goes solid and green, so "it fits" is unmistakable. */
.cal-guide-layer.in-target .cal-ghost-bones line { stroke: var(--pulse-on-video); stroke-dasharray: none; opacity: 1; }
.cal-guide-layer.in-target .cal-ghost-joints circle { fill: var(--pulse-on-video); opacity: 1; }

.cal-hud {
  position: absolute; left: 50%; top: var(--s4); transform: translateX(-50%);
  max-width: 56%; text-align: center;
  background: rgba(16, 16, 16, .85); color: #f3f3f3;
  border-radius: var(--r-tag); padding: 6px 10px;
  font: 400 11px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase;
}
.cal-hud:empty { display: none; }
.cal-guide-layer.in-target .cal-hud { background: var(--pulse-on-video); color: #08140a; }

/* ── Grab-mode virtual-hand cursors ───────────────────────────────────── */
.grab-layer { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.grab-cursor { position: fixed; transform: translate(-50%, -50%); display: grid; place-items: center; pointer-events: none; }
.grab-cursor .gc-ring {
  width: 44px; height: 44px; border-radius: var(--r-pill);
  border: 1px solid var(--c); background: transparent;
  transition: width .08s, height .08s, background .08s, border-width .08s;
}
.grab-cursor .gc-label { position: absolute; font: 400 8px/1 var(--mono); letter-spacing: .14em; color: var(--c); }
.grab-cursor.left { --c: var(--ink); }
.grab-cursor.right { --c: var(--gold); }
.grab-cursor.pinch .gc-ring { width: 24px; height: 24px; background: var(--c); }
.grab-cursor.hold .gc-ring { border-width: 2px; }

/* ── Responsive: floor is 375px, zero horizontal overflow ─────────────── */
@media (max-width: 900px) {
  main { grid-template-columns: minmax(0, 1fr); gap: var(--s5); padding: var(--s5) var(--s4) var(--s6); }
  .col-center { order: -1; }
  .col-right .col-title { text-align: left; }
  .rack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  header { padding: var(--s4); gap: var(--s3); }
  .warn { flex-basis: 100%; margin-left: 0; border-left: 0; padding-left: 0; order: 3; }
  .help { margin-left: auto; }
}
@media (max-width: 640px) {
  .hero-title { font-size: 34px; line-height: 1.03; letter-spacing: 0; }
}
@media (max-width: 420px) {
  .rack { grid-template-columns: minmax(0, 1fr); }
  main { padding: var(--s4) var(--s3) var(--s6); }
  header { padding: var(--s3); }
  .actions button, .actions select { flex: 1 1 auto; }
}
