/* ═══════════════════════════════════════════════════════════════════════════
   LKTOP UC363 · TEARDOWN LAB
   UI stylesheet — dark avionics / teardown-lab instrument panel
   ---------------------------------------------------------------------------
   Owned by: interface (css/styles.css is the ONLY file this layer edits)
   Hooks covered
     · static markup in index.html (shell, topbar, rails, stage, rails panels)
     · JS-generated markup:
         #step-list   → .step / .step__btn / .step__no / .step__body / .step__state
         #part-list   → .part-row / __idx / __dot / __body / __name / __en
                        / __group / __mark
         #part-detail → .detail__head / __code / __close / __title / __summary
                        / __specs / __body / __actions
         #labels      → .label / __no / __text  (--x / --y / --accent)
         #focus-card  → .focus-card__head / __group / __title / __specs
         #mode-list   → .mode-chip / __dot / __text (--mode-color)
         #spec-sheet  → .spec-row > span / b / small
         #spec-modes  → .spec-mode (--mode-color)
         #guide-list  → .guide-row / __key (kbd)
         #keymap      → .keycap (kbd)
         #leaders     → generic svg line/path/polyline/circle rules
     · state classes: .is-active .is-done .is-detached .is-visible .is-hidden
       .is-open, [aria-pressed="true"] [aria-selected="true"] [aria-expanded]
       [hidden], body.rail-left-open / body.rail-right-open, .loading.is-done
   ---------------------------------------------------------------------------
   TODO for Lead (HTML hooks not present in the current skeleton — harmless
   generic fallbacks already written, but explicit hooks would be cleaner):
     · #toast / #hover-tip need one of `.is-visible` (JS already planned) —
       no data-state attribute needed.
     · Leader <line>/<polyline> should carry `.is-active` for the focused
       part; the generic #leaders rule already colors them, `.is-active`
       brightens them.
     · If the JS ever dims individual labels, prefer `.label.is-hidden`
       (implemented) over inline opacity.
     · Progress meter: JS may set either `style="--p:62%"` or inline width
       on #progress-bar — both are supported.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════
   00 · LOCAL FONTS — Oxanium (display / latin) · system sans for body
   ═══════════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Oxanium';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../assets/fonts/Oxanium/ox-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Oxanium';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../assets/fonts/Oxanium/ox-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ═══════════════════════════════════════════════════════════════════════════
   01 · DESIGN TOKENS
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  color-scheme: dark;

  /* — surfaces — */
  --bg-0: #08070e;
  --bg-1: #0d0b16;
  --bg-2: #12101a;
  --bg-3: #17131f;
  --panel-1: rgba(18, 16, 26, 0.86);
  --panel-2: rgba(13, 11, 22, 0.92);
  --panel-3: rgba(8, 7, 14, 0.78);

  /* — hairlines & edges — */
  --line-1: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --line-soft: rgba(255, 255, 255, 0.05);
  --line-accent: rgba(196, 181, 253, 0.34);

  /* — ink — */
  --ink-0: #f4f1fa;
  --ink-1: #ded9e8;
  --ink-2: #c9c4d6;
  --ink-3: #b4aec4;
  --ink-4: #a8a2b8;

  /* — accents — */
  --accent: #c4b5fd;
  --accent-soft: #e9d5ff;
  --cyan: #c08a5e;
  --amber: #fbbf24;
  --danger: #fb7185;
  --accent-05: rgba(196, 181, 253, 0.05);
  --accent-08: rgba(196, 181, 253, 0.08);
  --accent-16: rgba(196, 181, 253, 0.16);
  --accent-30: rgba(196, 181, 253, 0.3);
  --accent-45: rgba(196, 181, 253, 0.45);
  --accent-60: rgba(196, 181, 253, 0.6);
  --cyan-16: rgba(244, 114, 182, 0.16);
  --cyan-30: rgba(244, 114, 182, 0.3);
  --amber-16: rgba(251, 191, 36, 0.16);
  --amber-30: rgba(251, 191, 36, 0.3);
  --danger-16: rgba(251, 113, 133, 0.16);
  --danger-30: rgba(251, 113, 133, 0.3);

  /* — type — */
  --font-sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Noto Sans SC',
    'Helvetica Neue', 'Microsoft YaHei', sans-serif;
  --font-display: 'Oxanium', 'SF Mono', ui-monospace, 'Menlo', 'Consolas', monospace;

  /* — metrics — */
  --topbar-h: 64px;
  --statusbar-h: 30px;
  --rail-left-w: 300px;
  --rail-right-w: 360px;
  --gap: 16px;
  --pad-x: 20px;

  /* — radii (hard-edged instrument language: 2–10px only) — */
  --r-2: 8px;
  --r-3: 10px;
  --r-4: 12px;
  --r-5: 14px;
  --r-6: 16px;
  --r-8: 20px;
  --r-10: 24px;

  /* — motion — */
  --ease-out: cubic-bezier(0.22, 0.61, 0.25, 1);
  --ease-inout: cubic-bezier(0.65, 0.05, 0.36, 1);
  --t-1: 150ms;
  --t-2: 200ms;
  --t-3: 320ms;

  /* — elevation — */
  --shadow-panel: 0 18px 40px -32px #000, 0 2px 8px -6px rgba(0, 0, 0, 0.9);
  --shadow-float: 0 24px 60px -28px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(0, 0, 0, 0.4);
  --glow-accent: 0 0 0 1px rgba(255, 255, 255, 0.06);
  --blur-panel: blur(18px) saturate(1.15);

  /* — layers — */
  --z-stage-fx: 4;
  --z-backdrop: 55;
  --z-drawer: 60;
  --z-topbar: 70;
  --z-fx: 90;
}

/* ═══════════════════════════════════════════════════════════════════════════
   02 · RESET / BASE
   ═══════════════════════════════════════════════════════════════════════════ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--line-2) transparent;
}

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg-0);
  color: var(--ink-0);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg,
canvas {
  max-width: 100%;
}

img {
  -webkit-user-drag: none;
  user-select: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4,
p,
ol,
ul {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

em {
  font-style: normal;
}

::selection {
  background: rgba(196, 181, 253, 0.32);
  color: #fff;
}

/* Text numbers: Oxanium everywhere the .mono hook is used */
.mono {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum' 1, 'zero' 0;
  letter-spacing: 0.08em;
}

/* Global visibility helpers */
[hidden]:not(.rail-backdrop) {
  display: none !important;
}

.is-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.is-visible {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Keyboard focus — crisp accent ring, never removed */
:focus {
  outline: none;
}

:where(a, button, [tabindex], input, select, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-3);
}

/* Custom thin scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(196, 181, 253, 0.22) transparent;
}

*::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(196, 181, 253, 0.2);
  border-radius: 2px;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(196, 181, 253, 0.38);
}

/* ═══════════════════════════════════════════════════════════════════════════
   03 · APP SHELL
   ═══════════════════════════════════════════════════════════════════════════ */

.app {
  position: relative;
  display: grid;
  grid-template-rows: var(--topbar-h) minmax(0, 1fr) var(--statusbar-h);
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  background: #08070e;
}

/* — full-page atmospherics — */
.fx-grain {
  position: fixed;
  inset: 0;
  z-index: var(--z-fx);
  pointer-events: none;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  mix-blend-mode: overlay;
  animation: grain-shift 6s steps(6) infinite;
}

.fx-vignette {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-fx) - 1);
  pointer-events: none;
  background:
    radial-gradient(120% 92% at 50% 46%, transparent 52%, rgba(0, 0, 0, 0.42) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.22) 0%, transparent 16%,
      transparent 84%, rgba(0, 0, 0, 0.28) 100%);
}

/* ═══════════════════════════════════════════════════════════════════════════
   04 · TOPBAR
   ═══════════════════════════════════════════════════════════════════════════ */

.topbar {
  position: relative;
  z-index: var(--z-topbar);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  height: var(--topbar-h);
  padding: 0 var(--pad-x);
  border-bottom: 1px solid var(--line-1);
  background: linear-gradient(180deg, rgba(11, 9, 22, 0.96), rgba(9, 8, 18, 0.9));
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
}

.topbar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%,
    rgba(196, 181, 253, 0.28) 18%, rgba(244, 114, 182, 0.16) 54%,
    transparent 88%);
  opacity: 0.9;
  pointer-events: none;
}

/* — brand — */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand__logo {
  display: block;
  height: 20px;
  width: auto;
  filter: drop-shadow(0 0 14px rgba(196, 181, 253, 0.16));
}

.brand__divider {
  flex: none;
  width: 1px;
  height: 24px;
  background: linear-gradient(180deg, transparent, var(--line-2), transparent);
}

.brand__lab {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  line-height: 1.05;
}

.brand__lab strong {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--ink-1);
  white-space: nowrap;
}

.brand__lab small {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  white-space: nowrap;
}

/* — doc / status center — */
.topbar__center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 0;
  overflow: hidden;
}

.doc-id {
  flex: none;
  padding: 4px 8px;
  border: 1px solid var(--line-1);
  border-radius: var(--r-3);
  background: rgba(255, 255, 255, 0.015);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--ink-3);
  white-space: nowrap;
}

.topbar__rule {
  flex: none;
  width: 44px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
}

.system-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ink-2);
  white-space: nowrap;
}

#system-state-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* — LED — */
.led {
  flex: none;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: none;
}

.led--dim {
  background: var(--ink-3);
  box-shadow: none;
  animation: none;
}

/* — right cluster — */
.topbar__right {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 6px;
  min-width: 0;
}

.topbar__power {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  margin-right: 4px;
  padding-right: 10px;
  border-right: 1px solid var(--line-soft);
}

.topbar__power-label {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-4);
  white-space: nowrap;
}

.topbar__power strong {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--ink-0);
  white-space: nowrap;
}

.topbar__power em {
  margin-left: 2px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--accent);
}

/* — icon buttons — */
.icon-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line-1);
  border-radius: var(--r-5);
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink-2);
  cursor: pointer;
  transition: color var(--t-1) var(--ease-out),
    border-color var(--t-1) var(--ease-out),
    background-color var(--t-1) var(--ease-out),
    transform var(--t-1) var(--ease-out);
}

.icon-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn:hover {
  color: var(--ink-0);
  border-color: var(--accent-30);
  background: var(--accent-05);
  transform: translateY(-1px);
}

.icon-btn:active {
  transform: translateY(0) scale(0.96);
}

.icon-btn[aria-expanded='true'],
.icon-btn.is-active {
  color: var(--accent);
  border-color: var(--accent-45);
  background: var(--accent-08);
  box-shadow: 0 0 0 1px var(--accent-16), var(--glow-accent);
}

/* Drawer toggles only appear on compact layouts */
.mobile-only {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   05 · RAIL BACKDROP (mobile drawers)
   ═══════════════════════════════════════════════════════════════════════════ */

.rail-backdrop {
  position: fixed;
  inset: var(--topbar-h) 0 var(--statusbar-h);
  z-index: var(--z-backdrop);
  display: none;
  border: 0;
  background: rgba(4, 3, 8, 0.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-2) var(--ease-out),
    visibility var(--t-2) var(--ease-out);
}

.rail-backdrop[hidden] {
  display: none;
}

.rail-backdrop.is-visible {
  display: block;
  opacity: 1;
  visibility: visible;
}

/* ═══════════════════════════════════════════════════════════════════════════
   06 · WORKSPACE LAYOUT  (292px / 1fr / 344px)
   ═══════════════════════════════════════════════════════════════════════════ */

.workspace {
  position: static;
  display: grid;
  grid-template-columns: var(--rail-left-w) minmax(0, 1fr) var(--rail-right-w);
  gap: var(--gap);
  min-width: 0;
  min-height: 0;
  padding: 0 var(--pad-x) var(--gap);
}

.rail {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-width: 0;
  min-height: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   07 · PANELS (shared instrument surface)
   ═══════════════════════════════════════════════════════════════════════════ */

.panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line-1);
  border-radius: var(--r-8);
  background: linear-gradient(180deg, var(--panel-1), var(--panel-2));
  backdrop-filter: var(--blur-panel);
  -webkit-backdrop-filter: var(--blur-panel);
  box-shadow: var(--shadow-panel), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.panel::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 6%, rgba(255, 255, 255, 0.14) 48%,
    transparent 94%);
  opacity: 0.55;
  pointer-events: none;
}

.panel::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 38px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-45));
  pointer-events: none;
}

/* — panel header — */
.panel__head {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  gap: 9px;
  padding: 11px 14px 9px;
  min-width: 0;
}

.panel__head::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--line-2) 0%, var(--line-soft) 42%,
    transparent 100%);
  pointer-events: none;
}

.panel__index {
  flex: none;
  padding: 2px 4px;
  border: 1px solid var(--accent-30);
  border-radius: var(--r-2);
  background: var(--accent-05);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.panel__head h2 {
  min-width: 0;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--ink-0);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.panel__tag {
  flex: none;
  margin-left: auto;
  padding: 3px 6px;
  border: 1px solid var(--line-1);
  border-radius: var(--r-2);
  background: rgba(0, 0, 0, 0.25);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  white-space: nowrap;
}

.panel__head--compact {
  padding: 9px 14px 7px;
}

.panel__head--compact h2 {
  font-size: 11px;
}

.panel__lead {
  flex: none;
  padding: 7px 14px 8px;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.015em;
  color: var(--ink-2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   08 · BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */

.btn {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-5);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink-1);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap;
  cursor: pointer;
  overflow: hidden;
  transition: color var(--t-1) var(--ease-out),
    border-color var(--t-1) var(--ease-out),
    background-color var(--t-1) var(--ease-out),
    box-shadow var(--t-1) var(--ease-out),
    transform var(--t-1) var(--ease-out);
}

.btn svg {
  flex: none;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn:hover {
  color: var(--ink-0);
  border-color: var(--line-accent);
  background: rgba(255, 255, 255, 0.05);
}

.btn:active {
  transform: translateY(1px);
}

.btn--accent {
  border-color: transparent;
  background: #6d4aff;
  color: #fff;
}

.btn--accent::after { content: none; }

.btn--accent:hover {
  color: #fff;
  border-color: transparent;
  background: #5b3cf0;
}

.btn--ghost {
  border-color: var(--line-2);
  background: transparent;
  color: var(--ink-2);
}

.btn--ghost:hover {
  color: var(--accent);
  border-color: var(--accent-45);
  background: var(--accent-05);
}

.btn--wide {
  width: 100%;
}

/* — plain text button — */
.text-btn {
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-underline-offset: 3px;
  transition: color var(--t-1) var(--ease-out),
    text-decoration-color var(--t-1) var(--ease-out);
}

.text-btn:hover {
  color: var(--accent);
  text-decoration-color: var(--accent-45);
}

/* auto tour: the primary action turns amber while the tour is running */
#auto-tour.is-active {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.12);
  color: var(--amber);
}

#auto-tour.is-active svg {
  animation: tour-pulse 1.8s var(--ease-inout) infinite;
}

/* ═══════════════════════════════════════════════════════════════════════════
   09 · LEFT RAIL · TEARDOWN SEQUENCE
   ═══════════════════════════════════════════════════════════════════════════ */

.rail--left {
  gap: 14px;
}

.rail--left .panel--sequence {
  flex: 1 1 auto;
  min-height: 248px;
}

.rail--left .panel--focus,
.rail--left .panel--modes {
  flex: 0 0 auto;
}

/* — step list (JS-generated <li class="step"> rows) — */
#step-list.step-list,
.step-list {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  padding: 0 8px 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.step-list::-webkit-scrollbar-thumb,
.panel--tabs > .tab-panel::-webkit-scrollbar-thumb {
  background: rgba(196, 181, 253, 0.28);
}

.step {
  position: relative;
  margin: 0;
}

.step__btn {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 4px 8px 4px 10px;
  border: 1px solid transparent;
  border-radius: var(--r-5);
  background: transparent;
  color: inherit;
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  transition: background var(--t-1) var(--ease-out),
    border-color var(--t-1) var(--ease-out),
    transform var(--t-1) var(--ease-out);
}

.step__btn::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 50%;
  width: 2px;
  height: 0;
  border-radius: 1px;
  background: var(--accent);
  box-shadow: none;
  opacity: 0;
  transform: translateY(-50%);
  transition: height var(--t-2) var(--ease-out),
    opacity var(--t-2) var(--ease-out);
  pointer-events: none;
}

.step__btn:hover {
  border-color: var(--line-1);
  background: var(--accent-05);
}

.step__btn:active {
  transform: translateY(1px);
}

.step__no {
  display: inline-grid;
  place-items: center;
  min-width: 25px;
  height: 18px;
  padding: 0 4px;
  border: 1px solid var(--line-1);
  border-radius: var(--r-3);
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  transition: color var(--t-1) var(--ease-out),
    border-color var(--t-1) var(--ease-out),
    background-color var(--t-1) var(--ease-out);
}

.step__body {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.step__body strong {
  flex: none;
  overflow: hidden;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-1);
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: color var(--t-1) var(--ease-out);
}

.step__body small {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-4);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.step__state {
  min-width: 34px;
  padding: 2px 5px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-2);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-4);
  text-align: center;
  white-space: nowrap;
  transition: color var(--t-1) var(--ease-out),
    border-color var(--t-1) var(--ease-out),
    background-color var(--t-1) var(--ease-out);
}

/* active step */
.step.is-active .step__btn,
.step[aria-current='step'] .step__btn {
  border-color: var(--accent-30);
  background: linear-gradient(90deg, rgba(196, 181, 253, 0.1),
    rgba(196, 181, 253, 0.02) 62%, transparent);
}

.step.is-active .step__btn::before,
.step[aria-current='step'] .step__btn::before {
  height: 58%;
  opacity: 1;
}

.step.is-active .step__no,
.step[aria-current='step'] .step__no {
  border-color: var(--accent-45);
  background: var(--accent-08);
  color: var(--accent);
}

.step.is-active .step__body strong,
.step[aria-current='step'] .step__body strong {
  color: var(--ink-0);
}

.step.is-active .step__state,
.step[aria-current='step'] .step__state {
  border-color: var(--accent-45);
  background: var(--accent-05);
  color: var(--accent);
}

/* done step */
.step.is-done .step__btn {
  opacity: 0.94;
}

.step.is-done .step__no {
  color: var(--ink-2);
}

.step.is-done .step__state {
  border-color: var(--cyan-30);
  color: var(--cyan);
}

.step.is-done .step__body strong {
  color: var(--ink-1);
}

/* partially detached step (some parts released) */
.step.is-partial .step__no {
  border-color: var(--amber-30);
  color: var(--amber);
}

.step.is-partial .step__state {
  border-color: var(--amber-30);
  color: var(--amber);
}

.step.is-partial .step__btn::before {
  height: 34%;
  background: var(--amber);
  box-shadow: none;
}

/* — sequence actions — */
.sequence__actions {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 6px;
  padding: 7px 14px 9px;
  border-top: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.012), transparent);
}

.sequence__actions .btn {
  height: 29px;
  font-size: 11px;
}

.sequence__progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sequence__progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-4);
}

.sequence__progress-head .mono {
  font-size: inherit;
  letter-spacing: inherit;
}

#progress-text {
  color: var(--ink-2);
}

.meter {
  position: relative;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.meter i {
  display: block;
  width: var(--p, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, var(--cyan) 100%);
  box-shadow: none;
  transition: width 420ms var(--ease-out),
    box-shadow var(--t-2) var(--ease-out);
}

#progress-bar {
  min-width: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   10 · LEFT RAIL · FOCUS CARD
   ═══════════════════════════════════════════════════════════════════════════ */

#focus-card,
.focus-card {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 14px 10px;
}

.focus-card__empty {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 12px;
  border-radius: var(--r-6);
  background: transparent;
  text-align: center;
}

.focus-card__empty p {
  margin: 0;
  font-size: 11px;
  line-height: 1.75;
  letter-spacing: 0.02em;
  color: var(--ink-2);
}

/* crosshair reticle */
.crosshair {
  position: relative;
  flex: none;
  width: 26px;
  height: 26px;
  border: 1px solid var(--accent-30);
  border-radius: 50%;
  box-shadow: none;
}

.crosshair::before,
.crosshair::after {
  content: '';
  position: absolute;
  background: var(--accent);
  opacity: 0.5;
  pointer-events: none;
}

.crosshair::before {
  left: 50%;
  top: -5px;
  width: 1px;
  height: 36px;
  transform: translateX(-50%);
}

.crosshair::after {
  top: 50%;
  left: -5px;
  width: 36px;
  height: 1px;
  transform: translateY(-50%);
}

/* filled focus card (JS-generated) */
.focus-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-soft);
}

.focus-card__head .mono {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--accent);
}

.focus-card__group {
  padding: 1px 5px;
  border: 1px solid var(--line-1);
  border-radius: var(--r-2);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  white-space: nowrap;
}

.focus-card__title {
  margin: 5px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--ink-0);
}

.focus-card__title small {
  display: block;
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}

.focus-card__specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 6px;
}

.focus-card__specs > div {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px 6px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-3);
  background: rgba(0, 0, 0, 0.2);
  min-width: 0;
}

.focus-card__specs span {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}

.focus-card__specs b {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-0);
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* focus code in panel header */
#focus-code {
  color: var(--ink-2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   11 · LEFT RAIL · CHARGE MODES
   ═══════════════════════════════════════════════════════════════════════════ */

#mode-list.mode-list,
.mode-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 14px 10px;
}

.mode-chip {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 4px 9px;
  border: 1px solid var(--line-1);
  border-radius: var(--r-5);
  background: rgba(0, 0, 0, 0.2);
  transition: border-color var(--t-1) var(--ease-out),
    background-color var(--t-1) var(--ease-out),
    transform var(--t-1) var(--ease-out);
}

.mode-chip:hover {
  border-color: var(--line-2);
  background: rgba(255, 255, 255, 0.025);
}

.mode-chip::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 50%;
  width: 2px;
  height: 0;
  border-radius: 1px;
  background: var(--mode-color, var(--accent));
  box-shadow: none;
  opacity: 0;
  transform: translateY(-50%);
  transition: height var(--t-2) var(--ease-out),
    opacity var(--t-2) var(--ease-out);
  pointer-events: none;
}

.mode-chip__dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mode-color, var(--accent));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--mode-color, var(--accent)) 14%,
    transparent), 0 0 12px color-mix(in srgb,
    var(--mode-color, var(--accent)) 60%, transparent);
}

.mode-chip__text {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.mode-chip__text strong {
  overflow: hidden;
  flex: none;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-1);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mode-chip__text small {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-4);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mode-chip > b {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  white-space: nowrap;
}

.mode-chip.is-active {
  border-color: color-mix(in srgb, var(--mode-color, var(--accent)) 42%,
    transparent);
  background: color-mix(in srgb, var(--mode-color, var(--accent)) 10%, transparent);
}

.mode-chip.is-active::before {
  height: 54%;
  opacity: 1;
}

.mode-chip.is-active .mode-chip__text strong,
.mode-chip.is-active > b {
  color: var(--mode-color, var(--accent));
}

.mode-chip.is-active .mode-chip__text small {
  color: color-mix(in srgb, var(--mode-color, var(--accent)) 65%,
    var(--ink-3));
}

/* ═══════════════════════════════════════════════════════════════════════════
   12 · STAGE (central 3D viewport)
   ═══════════════════════════════════════════════════════════════════════════ */

#stage,
.stage {
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line-1);
  border-radius: var(--r-10);
  background:
    radial-gradient(120% 85% at 50% 6%, #0f0d17 0%, #0b0914 46%, #07060b 100%);
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.8), 0 30px 90px -60px #000;
}

/* inner vignette + top light wash */
.stage::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: var(--z-stage-fx);
  background:
    linear-gradient(180deg, rgba(196, 181, 253, 0.025), transparent 20%),
    radial-gradient(72% 64% at 50% 48%, transparent 54%, rgba(0, 0, 0, 0.5));
  pointer-events: none;
}

/* v2：舞台不再叠扫描线 */
.stage::after { display: none; }

#scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
  outline: none;
}

body.is-dragging #scene {
  cursor: grabbing;
}

/* blueprint grid */
.stage__grid {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: none;
  background-position: center center;
  -webkit-mask-image: radial-gradient(76% 72% at 50% 52%, #000 6%,
    rgba(0, 0, 0, 0.55) 62%, transparent 92%);
  mask-image: radial-gradient(76% 72% at 50% 52%, #000 6%,
    rgba(0, 0, 0, 0.55) 62%, transparent 92%);
  pointer-events: none;
}

/* sweeping scan line on top of the grid */
.stage__grid::after { content: none; }

/* ambient coloured light */
.stage__glow {
  display: none;
  position: absolute;
  inset: -8% -8% auto -8%;
  z-index: 1;
  height: 78%;
  background:
    radial-gradient(46% 52% at 62% 34%, rgba(244, 114, 182, 0.1), transparent 70%),
    radial-gradient(52% 48% at 38% 66%, rgba(196, 181, 253, 0.075),
      transparent 72%);
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   13 · STAGE HERO
   ═══════════════════════════════════════════════════════════════════════════ */

.stage__hero {
  position: absolute;
  top: 56px;
  left: 28px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: min(58%, 520px);
  pointer-events: none;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--ink-3);
  white-space: nowrap;
}

.eyebrow__line {
  flex: none;
  width: 24px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.stage__title {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin: 0;
  line-height: 1;
}

.stage__power {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--font-display);
  font-size: clamp(46px, 5.6vw, 78px);
  font-weight: 700;
  line-height: 0.82;
  letter-spacing: -0.02em;
  color: var(--ink-0);
  font-variant-numeric: tabular-nums;
  
}

.stage__power em {
  align-self: flex-start;
  margin-left: 4px;
  margin-top: 0.12em;
  font-size: 0.33em;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent);
  
}

.stage__title-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 6px;
}

.stage__model {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.34em;
  color: var(--accent);
}

.stage__model::before {
  content: '';
  width: 3px;
  height: 3px;
  background: var(--accent);
  box-shadow: none;
}

.stage__name {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.42;
  letter-spacing: 0.08em;
  color: var(--ink-1);
}

.stage__sub {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  white-space: nowrap;
}

.stage__sub .mono {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ink-2);
}

.stage__sub-rule {
  width: 20px;
  height: 1px;
  background: linear-gradient(90deg, var(--line-2), transparent);
}

/* ═══════════════════════════════════════════════════════════════════════════
   14 · STAGE HUD + CORNER BRACKETS
   ═══════════════════════════════════════════════════════════════════════════ */

.hud {
  position: absolute;
  z-index: 7;
  pointer-events: none;
}

.hud--tr {
  top: 18px;
  right: 18px;
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line-1);
  border-radius: var(--r-6);
  background: rgba(7, 6, 15, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.hud__cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 76px;
  padding: 7px 11px;
  border-left: 1px solid var(--line-soft);
}

.hud__cell:first-child {
  border-left: 0;
}

.hud__label {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-4);
}

.hud__value {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.07em;
  color: var(--ink-1);
  white-space: nowrap;
}

.hud--tl {
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-4);
  white-space: nowrap;
}

.hud--tl .mono {
  font-size: inherit;
  letter-spacing: inherit;
  color: inherit;
}

.hud__corner {
  flex: none;
  width: 11px;
  height: 11px;
  border-top: 1px solid var(--accent-45);
  border-left: 1px solid var(--accent-45);
}

/* four corner ticks */
.stage__corners {
  position: absolute;
  inset: 8px;
  z-index: 8;
  pointer-events: none;
}

.stage__corners i {
  position: absolute;
  width: 13px;
  height: 13px;
  opacity: 0.55;
}

.stage__corners i:nth-child(1) {
  top: 0;
  left: 0;
  border-top: 1px solid var(--accent-45);
  border-left: 1px solid var(--accent-45);
}

.stage__corners i:nth-child(2) {
  top: 0;
  right: 0;
  border-top: 1px solid var(--accent-45);
  border-right: 1px solid var(--accent-45);
}

.stage__corners i:nth-child(3) {
  bottom: 0;
  left: 0;
  border-bottom: 1px solid rgba(244, 114, 182, 0.4);
  border-left: 1px solid rgba(244, 114, 182, 0.4);
}

.stage__corners i:nth-child(4) {
  bottom: 0;
  right: 0;
  border-bottom: 1px solid rgba(244, 114, 182, 0.4);
  border-right: 1px solid rgba(244, 114, 182, 0.4);
}

/* ═══════════════════════════════════════════════════════════════════════════
   15 · STAGE TOOLBAR
   ═══════════════════════════════════════════════════════════════════════════ */

.stage__toolbar {
  position: absolute;
  left: 50%;
  bottom: 16px;
  z-index: 20;
  display: flex;
  align-items: stretch;
  gap: 1px;
  max-width: calc(100% - 24px);
  padding: 5px;
  border: 1px solid var(--line-1);
  border-radius: var(--r-8);
  background: linear-gradient(180deg, rgba(22, 19, 42, 0.9),
    rgba(9, 8, 18, 0.92));
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  box-shadow: 0 22px 44px -26px rgba(0, 0, 0, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: translateX(-50%);
}

.tool {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: var(--r-5);
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-sans);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--t-1) var(--ease-out),
    background-color var(--t-1) var(--ease-out),
    border-color var(--t-1) var(--ease-out),
    transform var(--t-1) var(--ease-out);
}

.tool__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 20px;
  height: 20px;
  color: var(--ink-3);
  transition: color var(--t-1) var(--ease-out);
}

.tool__icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.1;
}

.tool__text strong {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: inherit;
  white-space: nowrap;
}

.tool__text small {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ink-4);
  white-space: nowrap;
  transition: color var(--t-1) var(--ease-out);
}

.tool:hover {
  border-color: var(--line-1);
  background: rgba(196, 181, 253, 0.05);
  color: var(--ink-0);
}

.tool:hover .tool__icon {
  color: var(--ink-1);
}

.tool:active {
  transform: translateY(1px);
}

.tool[aria-pressed='true'],
.tool.is-active {
  border-color: var(--accent-30);
  background: linear-gradient(180deg, rgba(196, 181, 253, 0.14),
    rgba(196, 181, 253, 0.03));
  color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.tool[aria-pressed='true'] .tool__icon,
.tool.is-active .tool__icon {
  color: var(--accent);
  filter: drop-shadow(0 0 6px rgba(196, 181, 253, 0.45));
}

.tool[aria-pressed='true'] .tool__text small,
.tool.is-active .tool__text small {
  color: var(--accent-60);
}

/* compact icon-forward toolbar variants */
.tool--icon {
  gap: 6px;
  padding: 6px 8px;
}

.tool--icon .tool__icon {
  width: 18px;
  height: 18px;
}

/* auto-rotate gets a slow spinning glyph while engaged */
#btn-rotate[aria-pressed='true'] .tool__icon svg {
  animation: tool-spin 5s linear infinite;
  transform-origin: 50% 50%;
}

.tool__sep {
  flex: none;
  align-self: stretch;
  width: 1px;
  margin: 3px 3px;
  background: linear-gradient(180deg, transparent, var(--line-2), transparent);
}

/* — bottom-left control hint — */
#stage-hint,
.stage__hint {
  position: absolute;
  left: 26px;
  bottom: 84px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-4);
  pointer-events: none;
}

.stage__hint b {
  font-weight: 500;
  color: var(--ink-2);
}

.mouse-icon {
  position: relative;
  flex: none;
  width: 11px;
  height: 16px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  opacity: 0.85;
}

.mouse-icon::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 3px;
  width: 2px;
  height: 4px;
  border-radius: 1px;
  background: var(--accent);
  transform: translateX(-50%);
  animation: wheel-hint 2.6s var(--ease-out) infinite;
}

/* ═══════════════════════════════════════════════════════════════════════════
   16 · 3D CALLOUTS · LEADERS · HOVER TIP · TOAST
   ═══════════════════════════════════════════════════════════════════════════ */

.leaders,
#leaders {
  position: absolute;
  inset: 0;
  z-index: 13;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  transition: opacity var(--t-2) var(--ease-out);
}

.leaders.is-hidden,
#leaders.is-hidden {
  opacity: 0;
}

/* colours come from inline SVG presentation attributes set by main.js —
   do not declare stroke/fill here or they would win over the per-part colour */
.leaders path,
.leaders line,
.leaders polyline,
#leaders path,
#leaders line,
#leaders polyline {
  vector-effect: non-scaling-stroke;
}

.leaders .is-active,
.leaders [data-active='true'],
#leaders .is-active,
#leaders [data-active='true'] {
  stroke: var(--accent);
  stroke-width: 1.5;
}

#labels.labels,
.labels {
  position: absolute;
  inset: 0;
  z-index: 14;
  pointer-events: none;
  transition: opacity var(--t-2) var(--ease-out);
}

.labels.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.label {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 4px;
  border: 1px solid color-mix(in srgb, var(--accent, #c4b5fd) 38%,
    transparent);
  border-radius: var(--r-3);
  background: rgba(7, 6, 15, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink-0);
  font-family: var(--font-sans);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -50%) scale(0.96);
  box-shadow: 0 8px 24px -12px #000;
  transition: opacity var(--t-2) var(--ease-out),
    visibility var(--t-2) var(--ease-out),
    transform var(--t-2) var(--ease-out),
    border-color var(--t-1) var(--ease-out),
    box-shadow var(--t-1) var(--ease-out);
}

.label.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.label:hover {
  z-index: 2;
  border-color: var(--accent, #c4b5fd);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent, #c4b5fd) 30%,
      transparent), 0 10px 26px -12px #000;
}

.label.is-active {
  border-color: var(--accent, #c4b5fd);
  background: color-mix(in srgb, var(--accent, #c4b5fd) 12%,
      rgba(7, 6, 15, 0.8));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent, #c4b5fd) 35%,
      transparent),
    0 0 22px -6px color-mix(in srgb, var(--accent, #c4b5fd) 55%, transparent);
}

.label__no {
  display: inline-grid;
  flex: none;
  place-items: center;
  min-width: 18px;
  padding: 1px 3px;
  border: 1px solid color-mix(in srgb, var(--accent, #c4b5fd) 40%,
    transparent);
  border-radius: var(--r-2);
  background: color-mix(in srgb, var(--accent, #c4b5fd) 12%, transparent);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent, #c4b5fd);
}

.label__text {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.25;
}

.label__text strong {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-0);
}

.label__text small {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}

/* — cursor-following hover tip — */
#hover-tip,
.hover-tip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 240px;
  padding: 6px 9px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-3);
  background: rgba(7, 6, 15, 0.9);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 120ms var(--ease-out),
    visibility 120ms var(--ease-out);
}

.hover-tip.is-visible {
  opacity: 1;
  visibility: visible;
}

.hover-tip__index {
  flex: none;
  padding: 1px 3px;
  border: 1px solid var(--accent-30);
  border-radius: var(--r-2);
  background: var(--accent-05);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.hover-tip__body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.hover-tip__body strong {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-0);
  white-space: nowrap;
}

.hover-tip__body small {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  white-space: nowrap;
}

.hover-tip__body em {
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--ink-2);
}

/* — transient toast — */
#toast,
.toast {
  position: absolute;
  left: 50%;
  bottom: 112px;
  z-index: 32;
  max-width: calc(100% - 40px);
  padding: 8px 14px;
  border: 1px solid var(--accent-30);
  border-radius: var(--r-4);
  background: rgba(13, 10, 25, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  width: max-content;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--ink-0);
  text-align: center;
  white-space: normal;
  box-shadow: var(--shadow-float);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px);
  transition: opacity var(--t-2) var(--ease-out),
    visibility var(--t-2) var(--ease-out),
    transform var(--t-2) var(--ease-out);
}

.toast:empty {
  display: none;
}

.toast strong {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--ink-0);
}

.toast span {
  font-size: 11px;
  line-height: 1.55;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}

.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.toast.is-error {
  border-color: var(--danger-30);
  box-shadow: var(--shadow-float);
}

/* ═══════════════════════════════════════════════════════════════════════════
   17 · LOADING OVERLAY + WEBGL FALLBACK
   ═══════════════════════════════════════════════════════════════════════════ */

#loading,
.loading {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 24px;
  background:
    radial-gradient(70% 60% at 50% 45%, rgba(17, 14, 33, 0.975),
      rgba(4, 3, 8, 0.995));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-align: center;
  transition: opacity 560ms var(--ease-out),
    visibility 560ms var(--ease-out);
}

#loading::after { content: none; }

.loading.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading__mark {
  display: flex;
  align-items: center;
  gap: 5px;
}

.loading__bracket {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 200;
  line-height: 1;
  color: var(--ink-4);
  opacity: 0.8;
}

#loading-percent,
.loading__num {
  min-width: 2.1em;
  font-family: var(--font-display);
  font-size: 46px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  text-align: center;
  
}

.loading__bar {
  position: relative;
  width: 220px;
  max-width: 62vw;
  height: 2px;
  margin: 18px 0 13px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.loading__bar i,
#loading-bar {
  display: block;
  width: var(--p, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  box-shadow: none;
  transition: width 280ms var(--ease-out);
}

#loading-text,
.loading__text {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--ink-2);
  text-transform: uppercase;
}

.loading__sub {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-4);
}

#no-webgl,
.no-webgl {
  position: absolute;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(7, 6, 15, 0.94);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  text-align: center;
}

.no-webgl h2 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--amber);
}

.no-webgl p {
  max-width: 400px;
  margin: 0 auto;
  font-size: 12px;
  line-height: 1.8;
  color: var(--ink-2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   18 · RIGHT RAIL · TABS PANEL
   ═══════════════════════════════════════════════════════════════════════════ */

.rail--right .panel--tabs {
  flex: 1 1 auto;
  min-height: 0;
}

.rail--right .panel--telemetry {
  flex: 0 0 auto;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding: 3px;
  border: 1px solid var(--line-1);
  border-radius: var(--r-5);
  background: rgba(0, 0, 0, 0.32);
}

.tab {
  padding: 5px 8px;
  border: 0;
  border-radius: var(--r-3);
  background: transparent;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--ink-3);
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--t-1) var(--ease-out),
    background-color var(--t-1) var(--ease-out),
    box-shadow var(--t-1) var(--ease-out);
}

.tab:hover {
  color: var(--ink-1);
  background: rgba(255, 255, 255, 0.03);
}

.tab.is-active,
.tab[aria-selected='true'] {
  color: var(--accent);
  background: rgba(196, 181, 253, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

#tab-tag {
  color: var(--ink-2);
}

/* tab panels */
.tab-panel {
  display: none;
  min-height: 0;
}

.tab-panel.is-active {
  display: block;
}

.panel--tabs > .tab-panel,
.panel--tabs > .tab-panel.is-active {
  flex: 1 1 auto;
  min-height: 0;
  padding: 11px 14px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.panel--tabs > .tab-panel:not(.is-active) {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   19 · RIGHT RAIL · PART LIST
   ═══════════════════════════════════════════════════════════════════════════ */

.partlist__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  margin-bottom: 7px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}

.partlist__meta > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#part-status {
  overflow: hidden;
  text-overflow: ellipsis;
}

#part-list.part-list,
.part-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.part-row {
  position: relative;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: var(--r-5);
  background: transparent;
  color: var(--ink-1);
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  transition: background-color var(--t-1) var(--ease-out),
    border-color var(--t-1) var(--ease-out),
    transform var(--t-1) var(--ease-out);
}

.part-row::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 50%;
  width: 2px;
  height: 0;
  border-radius: 1px;
  background: var(--part-color, var(--accent));
  box-shadow: none;
  opacity: 0;
  transform: translateY(-50%);
  transition: height var(--t-2) var(--ease-out),
    opacity var(--t-2) var(--ease-out);
  pointer-events: none;
}

.part-row:hover,
.part-row.is-hover {
  border-color: var(--line-1);
  background: rgba(196, 181, 253, 0.04);
}

.part-row:active {
  transform: translateY(1px);
}

.part-row__idx {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-4);
  transition: color var(--t-1) var(--ease-out);
}

.part-row__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--part-color, var(--accent));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--part-color, var(--accent)) 22%,
      transparent), 0 0 10px -2px var(--part-color, var(--accent));
  flex: none;
}

.part-row__body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.part-row__name {
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-1);
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: color var(--t-1) var(--ease-out);
}

.part-row__en {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-4);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.part-row__group {
  padding: 1px 5px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-2);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  white-space: nowrap;
}

.part-row__mark {
  width: 12px;
  font-family: var(--font-display);
  font-size: 11px;
  line-height: 1;
  color: var(--ink-4);
  text-align: center;
  transition: color var(--t-1) var(--ease-out),
    transform var(--t-1) var(--ease-out);
}

/* active row */
.part-row.is-active,
.part-row[aria-pressed='true'] {
  border-color: color-mix(in srgb, var(--part-color, var(--accent)) 40%,
    transparent);
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--part-color, var(--accent)) 12%, transparent),
    transparent 74%);
}

.part-row.is-active::before,
.part-row[aria-pressed='true']::before {
  height: 56%;
  opacity: 1;
}

.part-row.is-active .part-row__idx,
.part-row[aria-pressed='true'] .part-row__idx {
  color: var(--part-color, var(--accent));
}

.part-row.is-active .part-row__name,
.part-row[aria-pressed='true'] .part-row__name {
  color: var(--ink-0);
}

.part-row.is-active .part-row__mark,
.part-row[aria-pressed='true'] .part-row__mark {
  color: var(--part-color, var(--accent));
}

/* detached row */
.part-row.is-detached .part-row__mark {
  color: var(--cyan);
}

.part-row.is-detached .part-row__dot {
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.3);
}

.part-row.is-detached .part-row__en {
  color: rgba(251, 191, 36, 0.65);
}

/* ═══════════════════════════════════════════════════════════════════════════
   20 · RIGHT RAIL · PART DETAIL (injected)
   ═══════════════════════════════════════════════════════════════════════════ */

#part-detail.part-detail,
.part-detail {
  position: relative;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--accent-30);
  border-left-width: 2px;
  border-radius: var(--r-6);
  background: linear-gradient(180deg, rgba(196, 181, 253, 0.05),
    rgba(13, 11, 26, 0.6));
  animation: detail-in 220ms var(--ease-out);
}

.part-detail.is-open {
  display: block;
}

.part-detail.has-selection {
  border-color: var(--accent-30);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 10px 26px -20px rgba(196, 181, 253, 0.5);
}

.detail__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.detail__code {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.detail__close {
  display: grid;
  flex: none;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid var(--line-1);
  border-radius: var(--r-3);
  background: transparent;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: color var(--t-1) var(--ease-out),
    border-color var(--t-1) var(--ease-out),
    background-color var(--t-1) var(--ease-out);
}

.detail__close:hover {
  color: var(--danger);
  border-color: var(--danger-30);
  background: var(--danger-16);
}

.detail__title {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--ink-0);
}

.detail__title small {
  margin-left: 6px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}

.detail__summary {
  margin: 4px 0 0;
  font-size: 11.5px;
  line-height: 1.65;
  letter-spacing: 0.01em;
  color: var(--ink-1);
}

.detail__specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}

.detail__specs > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-3);
  background: rgba(0, 0, 0, 0.26);
  min-width: 0;
}

.detail__specs span {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

.detail__specs b {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--ink-0);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.detail__body {
  margin: 10px 0 0;
  font-size: 11.5px;
  line-height: 1.82;
  letter-spacing: 0.015em;
  color: var(--ink-2);
}

.detail__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.detail__actions .btn {
  flex: 1 1 0;
  height: 32px;
  padding: 0 10px;
  font-size: 11px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   21 · RIGHT RAIL · SPEC SHEET & MODE CARDS
   ═══════════════════════════════════════════════════════════════════════════ */

.spec-hero {
  position: relative;
  padding: 2px 0 14px;
  border-bottom: 1px solid var(--line-soft);
}

.spec-hero > .mono {
  display: block;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
}

.spec-hero > strong {
  display: flex;
  align-items: baseline;
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: var(--ink-0);
  
}

.spec-hero > strong em {
  margin-left: 4px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.spec-hero > p {
  margin-top: 9px;
  font-size: 11px;
  line-height: 1.7;
  color: var(--ink-2);
}

#spec-sheet.spec-sheet,
.spec-sheet {
  display: flex;
  flex-direction: column;
  margin-top: 6px;
}

.spec-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 2px 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
}

.spec-row > span {
  overflow: hidden;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.spec-row > b {
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--ink-0);
  text-align: right;
  white-space: nowrap;
}

.spec-row > small {
  grid-column: 2;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--ink-4);
  text-align: right;
  line-height: 1.4;
}

#spec-modes.spec-modes,
.spec-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 14px;
}

.spec-mode {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--line-1);
  border-left: 2px solid var(--mode-color, var(--accent));
  border-radius: var(--r-4);
  background: rgba(0, 0, 0, 0.22);
  min-width: 0;
}

.spec-mode > span.mono {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--mode-color, var(--accent));
}

.spec-mode > strong {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--ink-0);
}

.spec-mode > p {
  margin: 1px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-3);
}

#spec-foot.spec-foot,
.spec-foot {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  color: var(--ink-4);
}

.source-links {
  display: block;
  line-height: 1.9;
}

.source-links a {
  color: var(--ink-3);
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-underline-offset: 2px;
  transition: color var(--t-1) var(--ease-out),
    text-decoration-color var(--t-1) var(--ease-out);
}

.source-links a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent-45);
}

.spec-foot:empty,
.guide-foot:empty {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   22 · RIGHT RAIL · GUIDE & KEYMAP
   ═══════════════════════════════════════════════════════════════════════════ */

.guide-intro {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.guide-intro > .mono {
  display: block;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
}

.guide-intro h3 {
  margin: 7px 0 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: var(--ink-0);
}

.guide-intro p {
  margin-top: 7px;
  font-size: 11px;
  line-height: 1.8;
  letter-spacing: 0.01em;
  color: var(--ink-2);
}

#guide-list.guide-list,
.guide-list {
  display: flex;
  flex-direction: column;
  margin-top: 6px;
}

.guide-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}

.guide-row__key {
  display: flex;
  align-items: flex-start;
  padding-top: 1px;
}

.guide-row kbd,
.guide-row__key kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 3px 7px;
  border: 1px solid var(--line-2);
  border-bottom-color: rgba(196, 181, 253, 0.32);
  border-radius: var(--r-3);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.5);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-1);
  white-space: nowrap;
}

.guide-row strong {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-1);
}

.guide-row p {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.62;
  color: var(--ink-3);
}

#keymap.keymap,
.keymap {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 12px;
}

.keymap__title {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ink-4);
}

.keymap__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.keycap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid var(--line-1);
  border-radius: var(--r-4);
  background: rgba(0, 0, 0, 0.25);
}

.keycap kbd {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  padding: 1px 4px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  background: rgba(196, 181, 253, 0.08);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent);
  white-space: nowrap;
}

.keycap b {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  white-space: nowrap;
}

#guide-foot.guide-foot,
.guide-foot {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  color: var(--ink-4);
}

/* ═══════════════════════════════════════════════════════════════════════════
   23 · RIGHT RAIL · TELEMETRY
   ═══════════════════════════════════════════════════════════════════════════ */

#telemetry.telemetry,
.telemetry {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px 14px 8px;
}

.telemetry__row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.telemetry__row > span {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-4);
}

.telemetry__row > b {
  min-width: 34px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-1);
  text-align: right;
  white-space: nowrap;
}

.telemetry__track {
  position: relative;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.telemetry__track i {
  display: block;
  width: var(--v, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--accent));
  box-shadow: none;
  transition: width 620ms var(--ease-out);
}

.telemetry__row--usb .telemetry__track i {
  background: linear-gradient(90deg, var(--amber), var(--cyan));
  box-shadow: none;
}

.telemetry__foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px 12px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-4);
}

/* ═══════════════════════════════════════════════════════════════════════════
   24 · STATUS BAR
   ═══════════════════════════════════════════════════════════════════════════ */

.statusbar {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--statusbar-h);
  padding: 0 var(--pad-x);
  border-top: 1px solid var(--line-1);
  background: linear-gradient(180deg, rgba(9, 8, 18, 0.94),
    rgba(7, 6, 15, 0.98));
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-4);
  white-space: nowrap;
}

.statusbar__left,
.statusbar__right {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  overflow: hidden;
}

.statusbar__left .mono,
.statusbar__right .mono {
  font-size: inherit;
  letter-spacing: inherit;
  color: var(--ink-3);
}

.statusbar__dot {
  flex: none;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: rgba(196, 181, 253, 0.5);
}

#fps-readout {
  color: var(--ink-2);
}

#clock-readout {
  color: var(--ink-2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   24b · EXPLICIT ID HOOKS
   These nodes are read/toggled directly by JS; their look comes from the
   component classes above. The rules here only pin behaviour that must stay
   local to the singleton node.
   ═══════════════════════════════════════════════════════════════════════════ */

#app {
  isolation: isolate;
}

#rail-backdrop {
  border: 0;
}

/* drawer toggles + utility icons keep their intrinsic square footprint */
#panel-left-toggle,
#panel-right-toggle,
#help-btn,
#fullscreen-btn {
  flex: none;
}

/* HUD readouts: the parts count is the one number that earns the accent */
#view-readout,
#lens-readout {
  color: var(--ink-1);
}

#parts-readout {
  color: var(--accent);
}

/* bottom toolbar nodes never shrink inside the scrollable strip */
#btn-explode,
#btn-assemble,
#btn-labels,
#btn-focus,
#btn-reset {
  flex: none;
}

#auto-tour {
  letter-spacing: 0.06em;
}

/* tab triggers never shrink; panels keep a stable scrollbar gutter */
#tab-btn-parts,
#tab-btn-specs,
#tab-btn-guide {
  flex: none;
}

#tab-parts,
#tab-specs,
#tab-guide {
  scrollbar-gutter: stable;
}

#clear-selection {
  align-self: center;
}

/* ═══════════════════════════════════════════════════════════════════════════
   25 · NOSCRIPT
   ═══════════════════════════════════════════════════════════════════════════ */

.noscript {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg-0);
  color: var(--ink-1);
  font-family: var(--font-sans);
  font-size: 14px;
  text-align: center;
}

.noscript::before {
  content: '';
  position: absolute;
  inset: 24px;
  border: 1px solid var(--accent-30);
  border-radius: var(--r-6);
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   25b · READY-STATE ENTRANCE (body.is-ready is set by main.js)
   ═══════════════════════════════════════════════════════════════════════════ */

body.is-ready .stage__hero,
body.is-ready .hud--tl,
body.is-ready .hud--tr {
  animation: ui-rise 720ms var(--ease-out) both;
}

body.is-ready .hud--tr {
  animation-delay: 60ms;
}

body.is-ready .stage__toolbar {
  animation: fade-in 720ms 120ms var(--ease-out) both;
}

body.is-ready .stage__hint {
  animation: fade-in 800ms 240ms var(--ease-out) both;
}

/* ═══════════════════════════════════════════════════════════════════════════
   26 · KEYFRAMES
   ═══════════════════════════════════════════════════════════════════════════ */


@keyframes scan-sweep {
  from {
    background-position: 0 -240px;
  }
  to {
    background-position: 0 calc(100% + 240px);
  }
}

@keyframes grain-shift {
  0% {
    background-position: 0 0;
  }
  20% {
    background-position: -24px 12px;
  }
  40% {
    background-position: 18px -18px;
  }
  60% {
    background-position: -12px 24px;
  }
  80% {
    background-position: 24px 6px;
  }
  100% {
    background-position: 0 0;
  }
}

@keyframes wheel-hint {
  0%,
  100% {
    opacity: 0.35;
    transform: translateX(-50%) translateY(0);
  }
  40% {
    opacity: 1;
  }
  70% {
    opacity: 0.2;
    transform: translateX(-50%) translateY(4px);
  }
}

@keyframes loading-scan {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 0 120px;
  }
}

@keyframes tool-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes detail-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ui-rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes tour-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   27 · RESPONSIVE · WIDE (toolbar breathing room)
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1380px) {
  .tool__text small {
    display: none;
  }

  .tool {
    padding: 8px 9px;
  }
}

@media (max-width: 1320px) {
  .stage__toolbar {
    left: 12px;
    right: 12px;
    justify-content: flex-start;
    max-width: none;
    overflow-x: auto;
    scrollbar-width: none;
    transform: none;
  }

  .stage__toolbar::-webkit-scrollbar {
    display: none;
  }
}

/* avoid topbar crowding before the 760 breakpoint */
@media (max-width: 980px) {
  .doc-id,
  .topbar__rule {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   28 · RESPONSIVE · COMPACT (≤1180px) — rails become drawers
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1180px) {
  :root {
    --pad-x: 12px;
    --gap: 12px;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    padding: 10px var(--pad-x) 10px;
  }

  .mobile-only {
    display: grid;
  }

  /* — drawers — */
  .rail {
    position: fixed;
    top: var(--topbar-h);
    bottom: var(--statusbar-h);
    z-index: var(--z-drawer);
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(88vw, 360px);
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    background: linear-gradient(180deg, rgba(15, 13, 30, 0.985),
      rgba(9, 8, 18, 0.99));
    backdrop-filter: blur(22px) saturate(1.1);
    -webkit-backdrop-filter: blur(22px) saturate(1.1);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.7);
    transition: transform var(--t-3) var(--ease-inout);
  }

  .rail--left {
    left: 0;
    border-right: 1px solid var(--line-2);
    border-radius: 0 var(--r-10) var(--r-10) 0;
    transform: translate3d(-103%, 0, 0);
  }

  .rail--right {
    right: 0;
    border-left: 1px solid var(--line-2);
    border-radius: var(--r-10) 0 0 var(--r-10);
    transform: translate3d(103%, 0, 0);
  }

  body.rail-left-open .rail--left,
  body.rail-right-open .rail--right {
    transform: translate3d(0, 0, 0);
  }

  body.rail-left-open .rail--right {
    transform: translate3d(103%, 0, 0);
  }

  body.rail-right-open .rail--left {
    transform: translate3d(-103%, 0, 0);
  }

  body.rail-left-open,
  body.rail-right-open {
    overflow: hidden;
  }

  /* backdrop follows body state, even if JS keeps the [hidden] attribute */
  .rail-backdrop,
  body.rail-left-open .rail-backdrop,
  body.rail-right-open .rail-backdrop {
    display: block;
    border: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  body.rail-left-open .rail-backdrop,
  body.rail-right-open .rail-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  /* panels size to content inside the scrolling drawer */
  .rail--left .panel--sequence,
  .rail--left .panel--focus,
  .rail--left .panel--modes,
  .rail--right .panel--tabs,
  .rail--right .panel--telemetry {
    flex: 0 0 auto;
    min-height: 0;
  }

  .step-list,
  .panel--tabs > .tab-panel,
  .panel--tabs > .tab-panel.is-active {
    flex: 0 0 auto;
    overflow: visible;
  }

  .panel--tabs > .tab-panel.is-active {
    display: block;
  }

  /* — stage HUD compact — */
  .stage__power {
    font-size: clamp(44px, 5.4vw, 64px);
  }

  .hud--tr .hud__cell:nth-child(2) {
    display: none;
  }

  .stage__toolbar {
    left: 12px;
    right: 12px;
    justify-content: flex-start;
    max-width: none;
    overflow-x: auto;
    scrollbar-width: none;
    transform: none;
  }

  .stage__toolbar::-webkit-scrollbar {
    display: none;
  }

  .tool__text small {
    display: none;
  }

  .tool {
    padding: 8px 9px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   29 · RESPONSIVE · MOBILE (≤760px)
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 760px) {
  :root {
    --topbar-h: 56px;
    --statusbar-h: 28px;
    --pad-x: 10px;
    --gap: 10px;
  }

  /* — topbar simplification — */
  .topbar {
    gap: 8px;
    padding: 0 var(--pad-x);
  }

  .topbar__center {
    display: none;
  }

  .brand {
    gap: 8px;
  }

  .brand__logo {
    height: 16px;
  }

  .brand__divider {
    height: 18px;
  }

  .brand__lab strong {
    font-size: 11px;
    letter-spacing: 0.16em;
  }

  .brand__lab small {
    display: none;
  }

  .topbar__power {
    margin-right: 0;
    padding-right: 0;
    border-right: 0;
  }

  .topbar__power-label {
    display: none;
  }

  .topbar__power strong {
    font-size: 14px;
  }

  .topbar__right {
    gap: 4px;
  }

  .icon-btn {
    width: 28px;
    height: 28px;
  }

  .icon-btn svg {
    width: 14px;
    height: 14px;
  }

  /* — stage — */
  .workspace {
    padding: 8px var(--pad-x);
  }

  #stage,
  .stage {
    border-radius: var(--r-8);
  }

  .stage__hero {
    top: 44px;
    left: 16px;
    gap: 7px;
    max-width: calc(100% - 32px);
  }

  .eyebrow {
    font-size: 11px;
    letter-spacing: 0.16em;
    white-space: normal;
  }

  .eyebrow__line {
    width: 14px;
  }

  .stage__title {
    gap: 10px;
  }

  /* hero is compacted to roughly 40–45% of its desktop footprint */
  .stage__power {
    font-size: clamp(36px, 11vw, 48px);
  }

  .stage__title-side {
    gap: 4px;
    padding-bottom: 3px;
  }

  .stage__model {
    font-size: 11px;
    letter-spacing: 0.24em;
  }

  .stage__name {
    font-size: 11px;
    letter-spacing: 0.05em;
  }

  .stage__sub {
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
    letter-spacing: 0.1em;
    white-space: normal;
  }

  .stage__sub .mono {
    font-size: 11px;
    letter-spacing: 0.1em;
  }

  .stage__sub-rule {
    display: none;
  }

  .hud--tr {
    top: 12px;
    right: 12px;
  }

  .hud--tr .hud__cell:first-child {
    display: none;
  }

  .hud__cell {
    min-width: 64px;
    padding: 6px 9px;
  }

  .hud__label {
    font-size: 11px;
  }

  .hud__value {
    font-size: 11px;
  }

  .hud--tl {
    top: 14px;
    left: 14px;
    font-size: 11px;
    letter-spacing: 0.14em;
  }

  .stage__corners {
    inset: 6px;
  }

  .stage__corners i {
    width: 10px;
    height: 10px;
  }

  /* — callouts — */
  .label {
    gap: 4px;
    padding: 2px 6px 2px 3px;
  }

  .label__no {
    min-width: 16px;
    font-size: 11px;
  }

  .label__text strong {
    font-size: 11px;
  }

  .label__text small {
    display: none;
  }

  /* — toolbar: icon-only, safe-area aware — */
  .stage__toolbar {
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    gap: 0;
    padding: 4px;
    border-radius: var(--r-6);
  }

  .tool {
    gap: 0;
    padding: 7px 8px;
  }

  .tool__icon {
    width: 22px;
    height: 22px;
  }

  .tool__icon svg {
    width: 17px;
    height: 17px;
  }

  .tool__text {
    display: none;
  }

  .tool__sep {
    margin: 3px 2px;
  }

  /* — hint & toast — */
  #stage-hint,
  .stage__hint {
    display: none;
  }

  #toast,
  .toast {
    bottom: 74px;
    max-width: calc(100% - 28px);
    width: max-content;
    white-space: normal;
    font-size: 11px;
    line-height: 1.5;
  }

  .hover-tip {
    font-size: 11px;
  }

  /* — drawers — */
  .rail {
    width: min(92vw, 380px);
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
    gap: 10px;
  }

  .rail--left {
    border-radius: 0 var(--r-8) var(--r-8) 0;
  }

  .rail--right {
    border-radius: var(--r-8) 0 0 var(--r-8);
  }

  .panel {
    border-radius: var(--r-6);
  }

  .panel__head {
    padding: 11px 12px 9px;
  }

  .panel__lead {
    padding: 9px 12px 10px;
  }

  .step-list {
    padding: 0 7px 2px;
  }

  .sequence__actions {
    padding: 10px 12px 12px;
  }

  .mode-list {
    padding: 0 12px 12px;
  }

  .panel--tabs > .tab-panel,
  .panel--tabs > .tab-panel.is-active {
    padding: 10px 12px 12px;
  }

  .part-row {
    padding: 8px;
  }

  .part-row__group {
    display: none;
  }

  .part-row {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
  }

  .detail__specs,
  .focus-card__specs {
    grid-template-columns: 1fr 1fr;
  }

  .spec-modes {
    grid-template-columns: 1fr 1fr;
  }

  /* — statusbar — */
  .statusbar {
    padding: 0 var(--pad-x);
    font-size: 11px;
    letter-spacing: 0.09em;
  }

  .statusbar .statusbar__dot,
  .statusbar__left span:not(.mono),
  .statusbar__right span:not(#fps-readout):not(#clock-readout) {
    display: none;
  }

  .statusbar__left,
  .statusbar__right {
    gap: 7px;
  }

  /* — loading — */
  .loading__num,
  #loading-percent {
    font-size: 38px;
  }

  .loading__bar {
    width: 180px;
  }

  .loading__text {
    font-size: 11px;
    letter-spacing: 0.14em;
  }

  .loading__sub {
    font-size: 11px;
    letter-spacing: 0.14em;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   30 · MOTION & CONTRAST PREFERENCES
   ═══════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .stage__grid::after { content: none; }

@media (prefers-contrast: more) {
  :root {
    --line-1: rgba(196, 181, 253, 0.26);
    --line-2: rgba(233, 213, 255, 0.36);
    --ink-3: #a49fbc;
    --ink-4: #8b86a4;
  }

  .panel,
  .stage {
    border-color: var(--line-2);
  }
}

/* backdrop-filter fallback: make glass surfaces solid enough to read */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .panel {
    background: linear-gradient(180deg, #16132a, #0d0b16);
  }

  .stage__toolbar,
  .hud--tr {
    background: #0b0914;
  }

  .loading {
    background: radial-gradient(70% 60% at 50% 45%, #100d1c, #07060b);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   END — css/styles.css
   ═══════════════════════════════════════════════════════════════════════════ */


/* ═══════════════════════════════════════════════════════════════════════════
   LEAD INTEGRATION · teardown mode & HUD refinements
   ═══════════════════════════════════════════════════════════════════════════ */
.stage__hero,
.stage__hint,
.stage__sub {
  transition: opacity 420ms var(--ease-out), transform 420ms var(--ease-out);
}

.app.is-teardown .stage__hero {
  opacity: 0.24;
  transform: translate3d(-6px, -8px, 0) scale(0.98);
  pointer-events: none;
}

.app.is-teardown .stage__hint {
  opacity: 0.32;
}

#toast strong,
#toast span {
  display: block;
}

#toast span {
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 11px;
  white-space: normal;
}

.part-detail.has-selection {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent),
    0 18px 40px -30px #000;
}

/* 移动端右侧抽屉内给部件列表更多呼吸空间 */
@media (max-width: 760px) {
  .stage__hero {
    max-width: 58%;
  }
  .label {
    transform: translate(-50%, -50%) scale(0.92);
  }
  .label.is-visible {
    transform: translate(-50%, -50%) scale(0.92);
  }
}

/* 移动端内部滚动宽度修正：氛围光不再向 stage 外扩展 */
.stage__glow {
  inset: 0;
  height: 100%;
}

/* ═══════════════════════════════════════════════════════════════════════════
   WHYSHU · INTERACTIVE CASE THEME
   Aligns this experience with whyshu.com: deep-space surfaces, lavender /
   pink / blue accents, glass panels and large soft-corner cards.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --whyshu-violet: #8b5cf6;
  --whyshu-violet-bright: #c4b5fd;
  --whyshu-pink: #c08a5e;
  --whyshu-blue: #c08a5e;
  --whyshu-gradient: #6d4aff;
  --whyshu-panel: rgba(18, 16, 26, 0.72);
  --whyshu-panel-strong: rgba(13, 11, 22, 0.94);
  --whyshu-line: rgba(255, 255, 255, 0.08);
  --whyshu-glow: 0 24px 60px -36px rgba(0, 0, 0, 0.6);
}

.app {
  /* v2：深墨纯色底，不再叠紫/蓝/粉径向光 */
  background: #08070e;
}

.fx-grain {
  /* v2：只保留中性颗粒（星点交给 3D 舞台本身） */
  opacity: 0.2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  mix-blend-mode: overlay;
}

.fx-vignette {
  background:
    radial-gradient(120% 90% at 50% 46%, transparent 48%, rgba(3, 2, 8, 0.5) 100%),
    linear-gradient(180deg, rgba(3, 2, 8, 0.22), transparent 15%, transparent 84%, rgba(3, 2, 8, 0.34));
}

/* ── Top bar ─────────────────────────────────────────────────────────── */
.topbar {
  border-bottom-color: rgba(255, 255, 255, 0.08);
  background: rgba(8, 7, 14, 0.86);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
}
.topbar::after {
  background: rgba(255, 255, 255, 0.1);
}
.topbar__center { color: var(--ink-3); }
.topbar__center .doc-id { color: var(--ink-2); letter-spacing: 0.18em; }
.system-state { color: var(--ink-3); }
.system-state .led { background: var(--whyshu-violet-bright); box-shadow: none; }
.brand--whyshu { gap: 10px; }
.brand__logo--whyshu {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.brand__lab strong { display: flex; align-items: baseline; gap: 6px; font-size: 12px; letter-spacing: 0.08em; }
.brand__latin { font-family: var(--font-display); font-size: 11px; letter-spacing: 0.24em; color: var(--whyshu-violet-bright); font-weight: 500; }
@media (max-width: 760px) { .stage__hero--case::before { inset: 0; border-radius: 24px; } }
.brand__lab small { color: var(--ink-3); font-size: 11px; letter-spacing: 0.2em; }
.topbar__right { gap: 10px; }
.topbar__back,
.topbar__contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink-1);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: border-color 200ms var(--ease-out), background 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.topbar__back:hover { color: #fff; border-color: rgba(196, 181, 253, 0.4); transform: translateY(-1px); }
.topbar__contact {
  border-color: rgba(255, 255, 255, 0.12);
  background: #6d4aff;
  color: #fff;
}
.topbar__contact:hover { transform: translateY(-1px); background: #5b3cf0; border-color: rgba(255, 255, 255, 0.2); }
.icon-btn {
  border-color: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
}
.icon-btn:hover { border-color: rgba(196, 181, 253, 0.42); background: rgba(196, 181, 253, 0.08); }

/* ── Rails & cards ───────────────────────────────────────────────────── */
.rail { gap: 12px; }
.panel {
  border: 1px solid rgba(196, 181, 253, 0.12);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 26%),
    var(--whyshu-panel);
  box-shadow: 0 18px 50px -36px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
}
.panel__head { border-bottom-color: rgba(196, 181, 253, 0.1); }
.panel__index { display: none; }
.panel__tag { border-color: rgba(196, 181, 253, 0.16); background: rgba(196, 181, 253, 0.055); color: var(--ink-3); }
.panel__lead { color: var(--ink-2); line-height: 1.85; }

.step__btn {
  border-radius: 16px;
  border-color: rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.022);
}
.step__btn:hover { border-color: rgba(196, 181, 253, 0.26); background: rgba(196, 181, 253, 0.06); }
.step.is-active .step__btn {
  border-color: rgba(196, 181, 253, 0.34);
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.2), rgba(196, 181, 253, 0.055));
  box-shadow: 0 8px 24px -20px rgba(0, 0, 0, 0.6);
}
.step__no { color: var(--whyshu-violet-bright); }
.step.is-done .step__no { color: var(--whyshu-pink); }
.step__state { color: var(--whyshu-violet-bright); }
.step__body strong { letter-spacing: 0.02em; }
.step__body small { color: var(--ink-4); }

.focus-card, .part-detail {
  border-radius: 18px;
  border-color: rgba(196, 181, 253, 0.16);
  background: rgba(7, 6, 15, 0.36);
}
.focus-card__head, .detail__head { color: var(--ink-3); }
.focus-card__group, .detail__code { color: var(--whyshu-violet-bright); }
.focus-card__title, .detail__title { color: var(--ink-0); }
.focus-card__specs div, .detail__specs div { border-color: rgba(255, 255, 255, 0.07); }
.focus-card__specs span, .detail__specs span { color: var(--ink-3); }
.focus-card__specs b, .detail__specs b { color: var(--ink-1); }

.mode-chip {
  border-radius: 16px;
  border-color: rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.022);
}
.mode-chip:hover { border-color: rgba(196, 181, 253, 0.26); }
.mode-chip.is-active {
  border-color: rgba(196, 181, 253, 0.32);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.18), rgba(196, 181, 253, 0.05));
}
.mode-chip.is-active::before { background: var(--whyshu-gradient); }
.mode-chip__dot { box-shadow: none; }

.tab {
  border-radius: 999px;
  border-color: transparent;
  background: transparent;
  color: var(--ink-3);
  padding: 4px 8px;
  font-size: 11px;
}
.tab:hover { color: var(--ink-1); background: rgba(255, 255, 255, 0.04); }
.tab.is-active {
  color: #fff;
  background: rgba(196, 181, 253, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.tabs { gap: 2px; flex-wrap: nowrap; }
.panel--tabs .panel__head { gap: 8px; }
.panel--tabs .panel__tag { flex: none; }

.part-row {
  border-radius: 14px;
  border-color: rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.022);
}
.part-row:hover { border-color: rgba(196, 181, 253, 0.26); background: rgba(196, 181, 253, 0.06); }
.part-row.is-active {
  border-color: rgba(196, 181, 253, 0.32);
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.17), rgba(196, 181, 253, 0.04));
}
.part-row.is-hover { border-color: rgba(196, 181, 253, 0.22); }
.part-row__dot { box-shadow: none; }
.part-row__idx, .part-row__mark { color: var(--ink-4); }
.part-row.is-active .part-row__idx, .part-row.is-active .part-row__mark { color: var(--whyshu-violet-bright); }
.part-row__name { color: var(--ink-0); }
.part-row__en { color: var(--ink-4); }

.btn--accent {
  border-radius: 999px;
  background: var(--whyshu-gradient);
  border-color: transparent;
  box-shadow: 0 12px 30px -18px rgba(0, 0, 0, 0.65);
}
.btn--ghost { border-radius: 999px; border-color: rgba(196, 181, 253, 0.24); }
.btn--ghost:hover { border-color: rgba(196, 181, 253, 0.5); background: rgba(196, 181, 253, 0.08); }

/* ── Stage ───────────────────────────────────────────────────────────── */
.stage {
  border-color: rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  background: #0b0a12;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.75);
}
.stage::before {
  background: radial-gradient(74% 66% at 50% 48%, transparent 54%, rgba(3, 2, 8, 0.42));
}
/* v2：去掉扫描线与蓝图网格（装饰噪声） */
.stage::after { display: none; }
.stage__grid {
  display: none;
}
.stage__grid::after { content: none; }
.stage__glow {
  background: none;
}
.stage__corners { display: none; }
.hud {
  border-radius: 18px;
  border-color: rgba(196, 181, 253, 0.14);
  background: rgba(9, 7, 18, 0.62);
  box-shadow: 0 10px 34px -28px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.hud__label { color: var(--ink-4); }
.hud__value { color: var(--ink-1); }
.hud--tl { border-radius: 999px; padding: 6px 12px; background: rgba(9, 7, 18, 0.54); }
.stage__hint {
  border-radius: 999px;
  border-color: rgba(196, 181, 253, 0.14);
  background: rgba(9, 7, 18, 0.56);
  color: var(--ink-2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.stage__hint b { color: var(--ink-0); }

.stage__toolbar {
  border-radius: 999px;
  border-color: rgba(196, 181, 253, 0.16);
  background: rgba(13, 10, 25, 0.82);
  box-shadow: 0 22px 50px -30px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.tool { border-radius: 999px; }
.tool:hover { background: rgba(196, 181, 253, 0.07); color: var(--ink-0); }
.tool[aria-pressed="true"] {
  border-color: rgba(196, 181, 253, 0.34);
  background: rgba(196, 181, 253, 0.12);
  color: #fff;
}
.tool__sep { background: rgba(196, 181, 253, 0.14); }

/* ── New case hero ───────────────────────────────────────────────────── */
.stage__hero--case {
  top: 36px;
  left: 30px;
  max-width: min(62%, 540px);
  gap: 10px;
  pointer-events: none;
  text-shadow: 0 2px 22px rgba(7, 6, 11, 0.55);
}
.stage__hero--case::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 40px;
  background:
    radial-gradient(74% 90% at 22% 42%, rgba(7, 6, 11, 0.78), rgba(7, 6, 11, 0.32) 58%, transparent 78%),
    linear-gradient(90deg, rgba(7, 6, 11, 0.5), transparent 72%);
  pointer-events: none;
}
.stage__hero--case .eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--whyshu-violet-bright);
}
.stage__hero--case .eyebrow__line { background: rgba(255, 255, 255, 0.28); width: 30px; }
.stage__title--case {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(32px, 3.55vw, 52px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.045em;
  color: var(--ink-0);
}
.stage__title-accent {
  color: #c4b5fd;
}
.stage__client {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 3px;
  padding: 7px 11px;
  border: 1px solid rgba(196, 181, 253, 0.14);
  border-radius: 999px;
  background: rgba(22, 19, 42, 0.58);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  width: fit-content;
}
.stage__client-label { font-size: 11px; color: var(--ink-4); letter-spacing: 0.2em; }
.stage__client-logo { height: 14px; width: auto; opacity: 0.9; }
.stage__client-rule { width: 1px; height: 11px; background: rgba(196, 181, 253, 0.22); }
.stage__client-product { font-size: 11px; letter-spacing: 0.03em; color: var(--ink-2); }
.stage__sub--case {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  max-width: 510px;
  margin-top: 1px;
  font-size: 11px;
  line-height: 1.8;
  letter-spacing: 0.01em;
  color: var(--ink-1);
}
.stage__sub--case .mono { font-size: 11px; }
.stage__sub-rule { width: 22px; height: 1px; background: rgba(196, 181, 253, 0.3); }
.stage__hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 8px;
  pointer-events: auto;
}
.hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 200ms var(--ease-out), border-color 200ms var(--ease-out), background 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.hero-btn--primary {
  background: #6d4aff;
  color: #fff;
}
.hero-btn--primary:hover { transform: translateY(-1px); background: #5b3cf0; }
.hero-btn--ghost {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink-1);
}
.hero-btn--ghost:hover { border-color: rgba(196, 181, 253, 0.44); background: rgba(196, 181, 253, 0.07); transform: translateY(-1px); }
.hero-btn span { font-size: 14px; line-height: 1; }

/* ── Case story tab ──────────────────────────────────────────────────── */
.case-panel { padding: 16px 2px 4px; }
.case-panel__kicker { color: var(--whyshu-violet-bright); font-size: 11px; letter-spacing: 0.16em; }
.case-panel__title {
  margin-top: 12px;
  font-family: var(--font-sans);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -0.035em;
  color: var(--ink-0);
}
.case-panel__title span {
  color: #c4b5fd;
}
.case-panel__lead { margin-top: 12px; font-size: 12px; line-height: 1.9; color: var(--ink-2); }
.case-panel__capabilities { display: grid; gap: 8px; margin-top: 16px; }
.case-cap {
  padding: 11px 12px;
  border: 1px solid rgba(196, 181, 253, 0.11);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}
.case-cap__no { display: block; margin-bottom: 5px; color: var(--whyshu-violet-bright); font-size: 11px; letter-spacing: 0.16em; }
.case-cap strong { display: block; font-size: 12px; font-weight: 600; color: var(--ink-0); }
.case-cap p { margin-top: 4px; font-size: 11px; line-height: 1.7; color: var(--ink-3); }
.case-panel__contact {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 16px;
  padding: 13px;
  border: 1px solid rgba(196, 181, 253, 0.16);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.13), rgba(244, 114, 182, 0.05));
}
.case-panel__contact span { font-size: 11px; color: var(--ink-2); }
.case-panel__contact a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  color: var(--whyshu-violet-bright);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}
.case-panel__contact a:hover { color: #fff; }
.case-panel__foot { margin-top: 12px; font-size: 11px; line-height: 1.7; color: var(--ink-4); }

/* ── Footer / loading / misc ─────────────────────────────────────────── */
.statusbar { border-top-color: rgba(196, 181, 253, 0.1); color: var(--ink-4); }
.statusbar__left { color: var(--ink-4); }
.statusbar__left .mono { color: var(--ink-3); }
.statusbar__right a { color: var(--whyshu-violet-bright); text-decoration: none; }
.statusbar__right a:hover { color: #fff; }
.loading { background: rgba(7, 6, 11, 0.94); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
.loading__num { color: var(--whyshu-violet-bright); }
.loading__bar { background: rgba(196, 181, 253, 0.12); }
.loading__bar i { background: #6d4aff; }
.loading__text { color: var(--ink-2); }
.loading__sub { color: var(--ink-4); }
.label {
  border-color: color-mix(in srgb, var(--accent, #c4b5fd) 38%, transparent);
  background: rgba(13, 10, 25, 0.82);
  border-radius: 12px;
  box-shadow: 0 10px 28px -16px #000;
}
.label.is-active { background: color-mix(in srgb, var(--accent, #c4b5fd) 13%, rgba(13, 10, 25, 0.9)); }
.hover-tip, .toast {
  border-color: rgba(196, 181, 253, 0.18);
  background: rgba(13, 10, 25, 0.92);
  border-radius: 12px;
}
.toast { box-shadow: 0 20px 50px -30px #000; }

/* ── Responsive case hero ────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .stage__hero--case { max-width: min(66%, 500px); }
  .stage__title--case { font-size: clamp(30px, 3.5vw, 44px); }
  .topbar__back { display: none; }
}

@media (max-width: 760px) {
  .topbar__contact { display: none; }
  .brand__latin { display: none; }
  .brand__lab small { font-size: 11px; letter-spacing: 0.14em; }
  .stage__hero--case { top: 34px; left: 16px; right: 16px; max-width: none; gap: 9px; }
  .stage__hero--case .eyebrow { font-size: 11px; letter-spacing: 0.18em; white-space: normal; }
  .stage__title--case { font-size: clamp(25px, 7.4vw, 32px); line-height: 1.2; }
  .stage__client { padding: 5px 8px; gap: 6px; }
  .stage__client-logo { height: 11px; }
  .stage__client-product { font-size: 11px; }
  .stage__sub--case { font-size: 11px; line-height: 1.7; gap: 6px; }
  .stage__sub-rule { display: none; }
  .stage__hero-actions { gap: 7px; margin-top: 5px; }
  .hero-btn { height: 32px; padding: 0 12px; font-size: 11px; }
  .hero-btn--ghost { display: none; }
  .tabs { flex-wrap: wrap; }
  .tab { padding: 3px 6px; font-size: 11px; }
  .panel--tabs .panel__tag { display: none; }
  .case-panel__title { font-size: 20px; }
  .stage__hint { display: none; }
}

/* 进入拆解后，让案例标题退场，把舞台让给产品结构 */
.app.is-teardown .stage__hero--case {
  animation: none;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(-6px, -10px, 0) scale(0.985);
  transition: opacity 360ms var(--ease-out), visibility 360ms var(--ease-out),
    transform 480ms var(--ease-out);
}
.app.is-teardown .stage__hint {
  opacity: 0;
  visibility: hidden;
}
