/* ============================================================
   行星发动机 · 结构拆解与点火模拟
   UEG PE-07 / Procedural Three.js Visualization
   UI system: dark tech + light clay model
   ============================================================ */

:root {
  --font-ui: "Bahnschrift", "DIN Alternate", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --font-cn: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  --font-mono: "Cascadia Code", "Cascadia Mono", Consolas, "SFMono-Regular", monospace;

  --blue: #5ce6ff;
  --orange: #ff7b35;
  --green: #56e3a4;
  --red: #ff6254;
  --amber: #ffc45c;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-tech: cubic-bezier(.2, .8, .2, 1);
}

body.theme-dark {
  --bg: #04080d;
  --bg2: #07131e;
  --panel: rgba(7, 15, 24, .82);
  --panel-2: rgba(10, 22, 33, .72);
  --panel-deep: rgba(4, 10, 16, .92);
  --line: rgba(112, 197, 232, .16);
  --line-2: rgba(112, 197, 232, .28);
  --line-strong: rgba(92, 230, 255, .52);
  --text: #dcebf2;
  --text-strong: #f5fbff;
  --muted: #7e93a1;
  --dim: #526471;
  --accent: #5ce6ff;
  --accent-rgb: 92, 230, 255;
  --accent-2: #ff7b35;
  --accent-2-rgb: 255, 123, 53;
  --ok: #56e3a4;
  --warn: #ffc45c;
  --danger: #ff6254;
  --label-bg: rgba(3, 11, 18, .84);
  --label-border: rgba(92, 230, 255, .28);
  --window-glow: rgba(40, 160, 210, .16);
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --grid-line: rgba(92, 230, 255, .08);
  --scene-fade: rgba(4, 8, 13, .72);
  --btn-bg: rgba(92, 230, 255, .045);
  --btn-bg-hover: rgba(92, 230, 255, .11);
  --track: rgba(122, 167, 187, .15);
  --theme-icon: "☾";
}

body.theme-light {
  --bg: #e8edf2;
  --bg2: #f7f9fb;
  --panel: rgba(255, 255, 255, .86);
  --panel-2: rgba(248, 250, 252, .82);
  --panel-deep: rgba(255, 255, 255, .95);
  --line: rgba(23, 54, 74, .13);
  --line-2: rgba(23, 54, 74, .22);
  --line-strong: rgba(0, 126, 156, .48);
  --text: #1d2d38;
  --text-strong: #0a1923;
  --muted: #5c7180;
  --dim: #8a9aa4;
  --accent: #007e9c;
  --accent-rgb: 0, 126, 156;
  --accent-2: #c35519;
  --accent-2-rgb: 195, 85, 25;
  --ok: #147f5a;
  --warn: #a76a08;
  --danger: #c43a2e;
  --label-bg: rgba(255, 255, 255, .92);
  --label-border: rgba(0, 126, 156, .3);
  --window-glow: rgba(0, 126, 156, .08);
  --shadow: 0 18px 50px rgba(40, 60, 80, .14);
  --grid-line: rgba(20, 70, 95, .08);
  --scene-fade: rgba(236, 241, 245, .2);
  --btn-bg: rgba(0, 126, 156, .045);
  --btn-bg-hover: rgba(0, 126, 156, .1);
  --track: rgba(28, 67, 86, .12);
  --theme-icon: "☀";
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .6s ease, color .35s ease;
}

button, input {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

svg { display: block; }
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

::selection { background: rgba(var(--accent-rgb), .28); color: var(--text-strong); }

/* ---------------- viewport & atmosphere ---------------- */

.viewport {
  position: fixed;
  inset: 0;
  z-index: 1;
  cursor: grab;
  background:
    radial-gradient(circle at 50% 45%, var(--bg2) 0%, var(--bg) 68%);
}
.viewport:active { cursor: grabbing; }
.viewport.is-hovering { cursor: pointer; }
.viewport canvas { display: block; width: 100%; height: 100%; }

.scene-vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 48%, transparent 34%, var(--scene-fade) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, .32), transparent 18%, transparent 75%, rgba(0, 0, 0, .26));
  transition: background .6s ease;
}

.theme-light .scene-vignette {
  background:
    radial-gradient(ellipse at 50% 48%, transparent 38%, rgba(210, 220, 228, .24) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, .2), transparent 22%, transparent 78%, rgba(196, 207, 216, .18));
}

.scene-scanlines {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: .2;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, .035) 0, rgba(255, 255, 255, .035) 1px, transparent 1px, transparent 3px);
  mix-blend-mode: overlay;
}
.scene-scanlines::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 20vh;
  top: -20vh;
  background: linear-gradient(to bottom, transparent, rgba(var(--accent-rgb), .035), transparent);
  animation: scanDown 9s linear infinite;
}
.theme-light .scene-scanlines { opacity: .08; }

@keyframes scanDown {
  to { transform: translateY(140vh); }
}

.corner-frame {
  position: fixed;
  inset: 13px;
  z-index: 4;
  pointer-events: none;
  opacity: .45;
}
.corner-frame i {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--line-strong);
  border-style: solid;
}
.corner-frame .c1 { left: 0; top: 0; border-width: 1px 0 0 1px; }
.corner-frame .c2 { right: 0; top: 0; border-width: 1px 1px 0 0; }
.corner-frame .c3 { left: 0; bottom: 0; border-width: 0 0 1px 1px; }
.corner-frame .c4 { right: 0; bottom: 0; border-width: 0 1px 1px 0; }

/* ---------------- topbar ---------------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 76px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 22px;
  background:
    linear-gradient(180deg, rgba(4, 10, 16, .96) 0%, rgba(5, 13, 21, .8) 72%, rgba(5, 13, 21, 0) 100%);
  border-bottom: 1px solid transparent;
  pointer-events: none;
}
.theme-light .topbar {
  background: linear-gradient(180deg, rgba(248, 250, 252, .98) 0%, rgba(248, 250, 252, .82) 72%, rgba(248, 250, 252, 0) 100%);
}
.topbar > * { pointer-events: auto; }

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 300px;
}

.brand-mark {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
}
.brand-mark .ring {
  position: absolute;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}
.brand-mark .r1 { inset: 2px; opacity: .4; border-style: dashed; animation: spin 18s linear infinite; }
.brand-mark .r2 { inset: 8px; opacity: .8; border-color: var(--accent); }
.brand-mark .r3 { inset: 13px; border-color: var(--accent-2); transform: rotateX(64deg); }
.brand-mark .brand-core {
  position: absolute;
  left: 50%; top: 50%;
  width: 7px; height: 7px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent), 0 0 30px rgba(var(--accent-rgb), .38);
}
.brand-mark::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 32px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-2), transparent);
  transform: translate(-50%, -50%) rotate(-28deg);
  opacity: .8;
}
@keyframes spin { to { transform: rotate(360deg); } }

.brand-kicker {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .2em;
  color: var(--accent);
  opacity: .8;
  margin-bottom: 2px;
  white-space: nowrap;
}
.brand h1 {
  margin: 0;
  font-size: 19px;
  line-height: 1.15;
  letter-spacing: .1em;
  font-weight: 600;
  color: var(--text-strong);
  white-space: nowrap;
}
.brand h1 span {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .16em;
  color: var(--muted);
  margin-left: 8px;
}

.engine-id {
  padding-left: 24px;
  border-left: 1px solid var(--line);
  min-width: 206px;
}
.id-line {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .07em;
  color: var(--muted);
}
.id-line b { color: var(--text-strong); font-weight: 600; letter-spacing: .1em; }
.id-line em { font-style: normal; font-family: var(--font-cn); color: var(--muted); letter-spacing: .1em; }
.status-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
  animation: statusPulse 2.4s ease-in-out infinite;
}
@keyframes statusPulse { 50% { opacity: .35; transform: scale(.75); } }
.id-sub {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: .16em;
  color: var(--dim);
  white-space: nowrap;
}

.mode-pill {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  background: var(--btn-bg);
  font-size: 11px;
  letter-spacing: .08em;
  white-space: nowrap;
  position: relative;
  clip-path: polygon(0 6px, 6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%);
  transition: border-color .3s, background .3s;
}
.mode-pill small {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--dim);
  letter-spacing: .1em;
}
.mode-led {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}
.mode-pill[data-mode="igniting"] { border-color: rgba(var(--accent-2-rgb), .55); background: rgba(var(--accent-2-rgb), .08); }
.mode-pill[data-mode="igniting"] .mode-led { background: var(--accent-2); box-shadow: 0 0 12px var(--accent-2); animation: statusPulse .55s infinite; }
.mode-pill[data-mode="running"] { border-color: rgba(var(--accent-rgb), .5); background: rgba(var(--accent-rgb), .1); }
.mode-pill[data-mode="running"] .mode-led { background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.mode-pill[data-mode="launch"] { border-color: rgba(var(--accent-2-rgb), .6); background: rgba(var(--accent-2-rgb), .12); }
.mode-pill[data-mode="launch"] .mode-led { background: var(--accent-2); box-shadow: 0 0 14px var(--accent-2); animation: statusPulse .35s infinite; }

.top-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-left: 6px;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 9px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .06em;
  transition: color .22s, background .22s, border-color .22s;
  position: relative;
}
.icon-btn svg {
  width: 17px; height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-btn:hover {
  color: var(--text-strong);
  background: var(--btn-bg-hover);
  border-color: var(--line);
}
.icon-btn[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--line-2);
  background: rgba(var(--accent-rgb), .08);
}
.icon-btn[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  bottom: 3px; left: 50%;
  width: 3px; height: 3px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

/* ---------------- generic panel ---------------- */

.panel {
  position: fixed;
  top: 88px;
  bottom: 42px;
  z-index: 25;
  background:
    linear-gradient(160deg, rgba(var(--accent-rgb), .035), transparent 28%),
    var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .035);
  backdrop-filter: blur(18px) saturate(1.08);
  -webkit-backdrop-filter: blur(18px) saturate(1.08);
  clip-path: polygon(0 14px, 14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
  transition: transform .45s var(--ease-out), opacity .3s, background .6s, border-color .35s;
}
.panel::before {
  content: "";
  position: absolute;
  left: 14px; top: 0;
  width: 52px; height: 1px;
  background: var(--accent);
  opacity: .85;
  box-shadow: 0 0 12px var(--accent);
}
.panel::after {
  content: "";
  position: absolute;
  right: 14px; bottom: 0;
  width: 26px; height: 1px;
  background: var(--accent-2);
  opacity: .55;
}

.parts-panel {
  left: 18px;
  width: 294px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.right-panel {
  right: 18px;
  width: 338px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 18px 17px 11px;
  flex: 0 0 auto;
}
.panel-head.compact { padding: 15px 16px 8px; }
.panel-kicker {
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: .2em;
  color: var(--accent);
  opacity: .72;
  line-height: 1.4;
}
.panel-title {
  margin-top: 2px;
  font-family: var(--font-cn);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--text-strong);
  display: flex;
  align-items: center;
  gap: 8px;
}
.count-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--accent);
  border: 1px solid var(--line-2);
  padding: 1px 5px;
  border-radius: 2px;
}
.panel-collapse {
  display: inline-flex;
  width: 26px; height: 26px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.panel-collapse svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; }

/* ---------------- left: part index ---------------- */

.search-box {
  position: relative;
  margin: 3px 15px 10px;
  height: 34px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .12);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  transition: border-color .25s, background .25s;
}
.theme-light .search-box { background: rgba(255, 255, 255, .5); }
.search-box:focus-within { border-color: var(--line-strong); background: rgba(var(--accent-rgb), .035); }
.search-box svg { width: 14px; height: 14px; flex: 0 0 14px; fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-linecap: round; }
.search-box input {
  flex: 1; min-width: 0;
  border: 0; outline: 0;
  background: transparent;
  font-family: var(--font-cn);
  font-size: 11px;
  letter-spacing: .02em;
  color: var(--text);
}
.search-box input::placeholder { color: var(--dim); }
.search-box kbd {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--dim);
  border: 1px solid var(--line);
  padding: 0 4px;
  line-height: 15px;
}

.filter-tabs {
  display: flex;
  gap: 3px;
  padding: 0 13px 10px;
  flex: 0 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tabs button {
  flex: 0 0 auto;
  padding: 4px 7px;
  font-family: var(--font-cn);
  font-size: 10px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: color .2s, background .2s, border-color .2s;
}
.filter-tabs button:hover { color: var(--text); background: var(--btn-bg); }
.filter-tabs button.active {
  color: var(--accent);
  border-color: var(--line-2);
  background: rgba(var(--accent-rgb), .075);
}

.part-list {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1px 8px 10px;
  scrollbar-gutter: stable;
}
.part-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 47px;
  padding: 7px 9px 7px 10px;
  border-left: 1px solid transparent;
  cursor: pointer;
  transition: background .18s, border-color .18s;
}
.part-item::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent 80%);
  opacity: .55;
}
.part-item:hover { background: var(--btn-bg); border-left-color: var(--line-2); }
.part-item.active {
  background:
    linear-gradient(90deg, rgba(var(--accent-rgb), .12), rgba(var(--accent-rgb), .025));
  border-left-color: var(--accent);
}
.part-item.active::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 9px var(--accent);
}
.part-no {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--dim);
  width: 19px;
  flex: 0 0 19px;
  letter-spacing: .02em;
}
.part-item.active .part-no { color: var(--accent); }
.part-cat-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  flex: 0 0 4px;
  background: var(--cat-color, var(--accent));
  box-shadow: 0 0 6px var(--cat-color, var(--accent));
}
.part-item-main { flex: 1 1 auto; min-width: 0; }
.part-name {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-cn);
  font-size: 12px;
  color: var(--text);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.part-item.active .part-name { color: var(--text-strong); }
.part-name .detached-mark {
  display: none;
  font-size: 8px;
  color: var(--accent-2);
  border: 1px solid rgba(var(--accent-2-rgb), .35);
  padding: 0 3px;
  line-height: 12px;
  letter-spacing: .05em;
}
.part-item.detached .part-name .detached-mark { display: inline-block; }
.part-en {
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: .07em;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.part-go {
  width: 13px; height: 13px;
  flex: 0 0 13px;
  opacity: .22;
  transition: opacity .2s, transform .2s;
}
.part-go svg { width: 13px; height: 13px; fill: none; stroke: var(--accent); stroke-width: 1.5; }
.part-item:hover .part-go { opacity: .9; transform: translateX(2px); }
.part-item.active .part-go { opacity: 1; }

.part-empty {
  padding: 30px 14px;
  text-align: center;
  color: var(--dim);
  font-family: var(--font-cn);
  font-size: 11px;
  letter-spacing: .05em;
}

.parts-foot {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  padding: 11px 14px 12px;
  background: rgba(0, 0, 0, .1);
}
.theme-light .parts-foot { background: rgba(255, 255, 255, .28); }
.assembly-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-cn);
  font-size: 9px;
  color: var(--muted);
}
.assembly-mini .mini-track {
  flex: 1;
  height: 3px;
  background: var(--track);
  overflow: hidden;
}
.assembly-mini .mini-track i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--ok));
  box-shadow: 0 0 8px var(--accent);
  transition: width .45s var(--ease-out), background .3s;
}
.assembly-mini b {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  color: var(--text);
  width: 33px;
  text-align: right;
}
.detached-count {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 7px;
}
.detached-count b {
  font-family: var(--font-mono);
  font-size: 18px;
  line-height: 1;
  font-weight: 500;
  color: var(--accent-2);
  text-shadow: 0 0 12px rgba(var(--accent-2-rgb), .35);
}
.detached-count span { font-family: var(--font-cn); font-size: 9px; color: var(--dim); letter-spacing: .06em; }

/* ---------------- right: dossier ---------------- */

.detail-zone {
  flex: 0 0 auto;
  max-height: 43%;
  min-height: 208px;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--line);
}
.detail-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0 16px 14px;
}
.code-chip {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .1em;
  color: var(--accent);
  border: 1px solid var(--line-2);
  padding: 2px 5px;
  white-space: nowrap;
}
.dossier-hero { position: relative; padding-right: 4px; }
.dossier-cat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-cn);
  font-size: 8px;
  letter-spacing: .12em;
  color: var(--cat-color, var(--accent));
  margin-bottom: 4px;
}
.dossier-cat::before {
  content: "";
  width: 12px; height: 1px;
  background: currentColor;
  box-shadow: 0 0 5px currentColor;
}
.dossier-name {
  margin: 0;
  font-family: var(--font-cn);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text-strong);
  line-height: 1.2;
}
.dossier-en {
  font-family: var(--font-mono);
  font-size: 7.5px;
  color: var(--dim);
  letter-spacing: .08em;
  line-height: 1.45;
  margin-top: 3px;
  text-transform: uppercase;
}
.dossier-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 10px;
  border: 1px solid var(--line);
  background: var(--line);
}
.dossier-metric {
  background: var(--panel-deep);
  padding: 6px 7px;
}
.dossier-metric span {
  display: block;
  font-family: var(--font-cn);
  font-size: 7.5px;
  color: var(--dim);
  letter-spacing: .08em;
  margin-bottom: 2px;
}
.dossier-metric b {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dossier-desc {
  margin: 9px 0 0;
  font-family: var(--font-cn);
  font-size: 10.5px;
  line-height: 1.68;
  color: var(--muted);
}
.dossier-specs { margin-top: 9px; display: flex; flex-direction: column; gap: 6px; }
.spec-line {
  display: grid;
  grid-template-columns: 58px 1fr 58px;
  gap: 6px;
  align-items: center;
  font-family: var(--font-cn);
  font-size: 8.5px;
  color: var(--muted);
}
.spec-line em { font-style: normal; color: var(--dim); }
.spec-line b {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 400;
  color: var(--text);
  text-align: right;
  white-space: nowrap;
}
.spec-track { height: 2px; background: var(--track); position: relative; overflow: hidden; }
.spec-track i {
  position: absolute; inset: 0 auto 0 0;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), .45), var(--accent));
  box-shadow: 0 0 6px rgba(var(--accent-rgb), .45);
}
.dossier-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 9px; }
.dossier-chips span {
  font-family: var(--font-cn);
  font-size: 8px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--btn-bg);
  padding: 2px 5px;
}
.dossier-actions { display: flex; gap: 5px; margin-top: 10px; }
.ghost-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 30px;
  border: 1px solid var(--line-2);
  color: var(--text);
  background: var(--btn-bg);
  font-family: var(--font-cn);
  font-size: 9.5px;
  letter-spacing: .06em;
  transition: background .2s, border-color .2s, color .2s;
}
.ghost-btn svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.ghost-btn:hover { background: var(--btn-bg-hover); border-color: var(--line-strong); color: var(--accent); }
.ghost-btn.primary { color: var(--accent); border-color: rgba(var(--accent-rgb), .38); }
.ghost-btn.warm { color: var(--accent-2); border-color: rgba(var(--accent-2-rgb), .32); }

.overview-hero { padding-top: 1px; }
.overview-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: .13em;
  color: var(--accent-2);
  border: 1px solid rgba(var(--accent-2-rgb), .32);
  padding: 1px 5px;
  margin-bottom: 6px;
}
.overview-title {
  margin: 0;
  font-family: var(--font-cn);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: .03em;
}
.overview-sub {
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: .1em;
  color: var(--dim);
  margin-top: 2px;
}
.overview-copy {
  margin: 8px 0 0;
  font-family: var(--font-cn);
  font-size: 10px;
  line-height: 1.65;
  color: var(--muted);
}
.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 9px;
}
.overview-cell { background: var(--panel-deep); padding: 6px 7px; }
.overview-cell span { display: block; font-family: var(--font-cn); font-size: 7.5px; color: var(--dim); }
.overview-cell b { display: block; margin-top: 1px; font-family: var(--font-mono); font-size: 11px; font-weight: 400; color: var(--text); }
.overview-note {
  margin-top: 8px;
  padding: 6px 8px;
  border-left: 1px solid var(--accent-2);
  background: rgba(var(--accent-2-rgb), .035);
  font-family: var(--font-cn);
  font-size: 8px;
  line-height: 1.55;
  color: var(--dim);
}

.control-zone {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.zone-scroll {
  overflow-y: auto;
  padding: 12px 15px 16px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 1px 0 8px;
  font-family: var(--font-cn);
  font-size: 10px;
  color: var(--text);
  letter-spacing: .08em;
}
.section-label::before {
  content: "";
  width: 2px; height: 9px;
  background: var(--accent);
  box-shadow: 0 0 7px rgba(var(--accent-rgb), .6);
}
.section-label em {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 7px;
  color: var(--dim);
  letter-spacing: .1em;
}
.section-label b {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 400;
  color: var(--accent-2);
  letter-spacing: .04em;
}

.range-wrap { padding: 0 2px 3px; }
.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  background: transparent;
  cursor: pointer;
  margin: 0;
}
.range::-webkit-slider-runnable-track {
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0 var(--range-fill, 0%), var(--track) var(--range-fill, 0%) 100%);
}
.range::-moz-range-track { height: 3px; background: var(--track); }
.range::-moz-range-progress { height: 3px; background: var(--accent); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 9px; height: 13px;
  margin-top: -5px;
  border-radius: 0;
  background: var(--text-strong);
  border: 1px solid var(--accent);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), .45);
}
.range::-moz-range-thumb {
  width: 9px; height: 13px;
  border-radius: 0;
  background: var(--text-strong);
  border: 1px solid var(--accent);
}
.range-ticks {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 6.5px;
  color: var(--dim);
  padding: 0 0 7px;
}

.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.cmd-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--btn-bg);
  text-align: left;
  transition: border-color .2s, background .2s, transform .15s;
}
.cmd-btn:hover { border-color: var(--line-strong); background: var(--btn-bg-hover); }
.cmd-btn:active { transform: translateY(1px); }
.cmd-btn svg { width: 15px; height: 15px; flex: 0 0 15px; fill: none; stroke: var(--accent); stroke-width: 1.3; stroke-linecap: round; }
.cmd-btn span { min-width: 0; }
.cmd-btn b {
  display: block;
  font-family: var(--font-cn);
  font-size: 10px;
  font-weight: 400;
  color: var(--text);
  white-space: nowrap;
  letter-spacing: .02em;
}
.cmd-btn em {
  display: block;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 6.5px;
  color: var(--dim);
  letter-spacing: .09em;
  margin-top: 1px;
  white-space: nowrap;
}

.micro-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  margin: 8px 0 13px;
}
.micro-stats > div { padding: 5px 6px; border-right: 1px solid var(--line); }
.micro-stats > div:last-child { border-right: 0; }
.micro-stats span { display: block; font-family: var(--font-cn); font-size: 7px; color: var(--dim); }
.micro-stats b { font-family: var(--font-mono); font-size: 12px; font-weight: 400; color: var(--text); line-height: 1.25; }
.micro-stats em { font-family: var(--font-mono); font-style: normal; font-size: 6.5px; color: var(--dim); margin-left: 1px; }

.seq-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  margin-bottom: 8px;
}
.seq-step {
  position: relative;
  padding: 4px 2px 3px;
  border: 1px solid var(--line);
  text-align: center;
  transition: border-color .25s, background .25s, color .25s;
}
.seq-step i {
  display: block;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 6.5px;
  color: var(--dim);
  letter-spacing: .04em;
}
.seq-step span {
  display: block;
  font-family: var(--font-cn);
  font-size: 7.5px;
  color: var(--muted);
  letter-spacing: .03em;
  margin-top: 1px;
}
.seq-step.active {
  border-color: rgba(var(--accent-2-rgb), .55);
  background: rgba(var(--accent-2-rgb), .08);
}
.seq-step.active i { color: var(--accent-2); }
.seq-step.active span { color: var(--text-strong); }
.seq-step.done { border-color: rgba(var(--accent-rgb), .28); background: rgba(var(--accent-rgb), .05); }
.seq-step.done i { color: var(--ok); }
.seq-step.done span { color: var(--muted); }
.seq-step.active::after {
  content: "";
  position: absolute;
  left: 15%; right: 15%; bottom: -1px;
  height: 1px;
  background: var(--accent-2);
  box-shadow: 0 0 8px var(--accent-2);
}

.main-action {
  position: relative;
  width: 100%;
  min-height: 45px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid rgba(var(--accent-2-rgb), .36);
  background:
    linear-gradient(90deg, rgba(var(--accent-2-rgb), .12), rgba(var(--accent-2-rgb), .025) 58%, transparent);
  overflow: hidden;
  transition: border-color .25s, background .25s, transform .15s;
}
.main-action:hover { border-color: rgba(var(--accent-2-rgb), .7); background: linear-gradient(90deg, rgba(var(--accent-2-rgb), .18), rgba(var(--accent-2-rgb), .04)); }
.main-action:active { transform: translateY(1px); }
.main-action svg {
  width: 21px; height: 21px;
  flex: 0 0 21px;
  fill: none;
  stroke: var(--accent-2);
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 5px rgba(var(--accent-2-rgb), .35));
}
.action-glow {
  position: absolute;
  left: -30px; top: -20px;
  width: 120px; height: 90px;
  background: radial-gradient(circle, rgba(var(--accent-2-rgb), .15), transparent 68%);
  pointer-events: none;
}
.action-copy { flex: 1; min-width: 0; text-align: left; }
.action-copy b { display: block; font-family: var(--font-cn); font-size: 11px; font-weight: 500; color: var(--text-strong); letter-spacing: .04em; }
.action-copy em { display: block; font-family: var(--font-mono); font-style: normal; font-size: 6.5px; color: var(--dim); letter-spacing: .12em; margin-top: 1px; }
.action-state {
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: .08em;
  color: var(--accent-2);
  border: 1px solid rgba(var(--accent-2-rgb), .32);
  padding: 2px 4px;
  white-space: nowrap;
}
.main-action.running {
  border-color: rgba(var(--accent-rgb), .42);
  background: linear-gradient(90deg, rgba(var(--accent-rgb), .1), transparent 64%);
}
.main-action.running svg { stroke: var(--accent); filter: drop-shadow(0 0 5px rgba(var(--accent-rgb), .4)); }
.main-action.running .action-state { color: var(--accent); border-color: rgba(var(--accent-rgb), .4); }

.gauge-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 8px 0 13px;
}
.gauge {
  border: 1px solid var(--line);
  padding: 5px 6px 6px;
  background: rgba(0, 0, 0, .07);
}
.theme-light .gauge { background: rgba(255, 255, 255, .3); }
.gauge-top { display: flex; align-items: baseline; gap: 3px; }
.gauge-top span { font-family: var(--font-cn); font-size: 7px; color: var(--dim); letter-spacing: .04em; }
.gauge-top b { margin-left: auto; font-family: var(--font-mono); font-size: 11px; font-weight: 400; color: var(--text); }
.gauge-top em { font-family: var(--font-mono); font-style: normal; font-size: 6px; color: var(--dim); }
.gauge-bar { height: 2px; background: var(--track); margin-top: 4px; overflow: hidden; }
.gauge-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .16s linear; box-shadow: 0 0 6px rgba(var(--accent-rgb), .5); }

.launch-btn { border-color: rgba(var(--accent-rgb), .34); background: linear-gradient(90deg, rgba(var(--accent-rgb), .1), transparent 64%); }
.launch-btn svg { stroke: var(--accent); filter: drop-shadow(0 0 5px rgba(var(--accent-rgb), .35)); }
.launch-btn .action-state { color: var(--accent); border-color: rgba(var(--accent-rgb), .32); }
.launch-btn:hover { border-color: rgba(var(--accent-rgb), .62); background: linear-gradient(90deg, rgba(var(--accent-rgb), .16), transparent 70%); }
.launch-btn.abort { border-color: rgba(var(--danger), .5); }
.flight-readout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  margin-top: 6px;
}
.flight-readout > div { padding: 4px 6px; border-right: 1px solid var(--line); }
.flight-readout > div:last-child { border-right: 0; }
.flight-readout span { display: block; font-family: var(--font-cn); font-size: 6.5px; color: var(--dim); }
.flight-readout b { font-family: var(--font-mono); font-size: 10px; font-weight: 400; color: var(--text); }
.flight-readout em { font-family: var(--font-mono); font-style: normal; font-size: 6px; color: var(--dim); margin-left: 1px; }

/* ---------------- guide dock ---------------- */

.guide-dock {
  position: fixed;
  left: 50%;
  bottom: 42px;
  transform: translateX(-50%);
  width: min(720px, calc(100vw - 700px));
  min-width: 430px;
  z-index: 26;
  padding: 8px 12px 9px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px) saturate(1.08);
  -webkit-backdrop-filter: blur(16px) saturate(1.08);
  clip-path: polygon(0 10px, 10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  transition: transform .45s var(--ease-out), opacity .3s, background .6s, border-color .3s;
}
.guide-dock::before {
  content: "";
  position: absolute;
  left: 10px; top: 0;
  width: 40px; height: 1px;
  background: var(--accent);
  box-shadow: 0 0 9px var(--accent);
  opacity: .8;
}
.guide-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.guide-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.guide-badge {
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: .13em;
  color: var(--accent);
  border: 1px solid var(--line-2);
  padding: 1px 4px;
}
.guide-title b { font-family: var(--font-cn); font-size: 10px; font-weight: 500; color: var(--text); letter-spacing: .05em; white-space: nowrap; }
.guide-title em { font-family: var(--font-mono); font-style: normal; font-size: 7px; color: var(--dim); letter-spacing: .04em; }
.guide-actions { display: flex; align-items: center; gap: 3px; }
.mini-btn {
  min-width: 22px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 18px;
  transition: border-color .2s, background .2s, color .2s;
}
.mini-btn:hover { border-color: var(--line-strong); color: var(--accent); background: var(--btn-bg); }
.mini-btn:disabled { opacity: .28; cursor: default; }
.mini-btn.guide-auto { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-cn); font-size: 8px; }
.mini-btn.guide-auto span { width: 4px; height: 4px; border-radius: 50%; background: var(--dim); }
.mini-btn.guide-auto[aria-pressed="true"] { color: var(--accent); border-color: var(--line-2); }
.mini-btn.guide-auto[aria-pressed="true"] span { background: var(--accent); box-shadow: 0 0 6px var(--accent); }

.guide-steps {
  display: flex;
  gap: 3px;
  margin: 6px 0 5px;
}
.guide-step {
  flex: 1;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid var(--line);
  background: transparent;
  font-family: var(--font-cn);
  font-size: 7.5px;
  color: var(--dim);
  transition: border-color .2s, background .2s, color .2s;
}
.guide-step i { font-family: var(--font-mono); font-style: normal; font-size: 6px; opacity: .7; }
.guide-step:hover { border-color: var(--line-2); color: var(--muted); }
.guide-step.active { border-color: rgba(var(--accent-rgb), .55); background: rgba(var(--accent-rgb), .09); color: var(--accent); }
.guide-step.done { border-color: rgba(var(--accent-rgb), .2); color: var(--muted); }
.guide-step.done i { color: var(--ok); }

.guide-instruction {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 31px;
}
.guide-index {
  font-family: var(--font-mono);
  font-size: 18px;
  line-height: 1;
  color: var(--accent);
  opacity: .65;
  width: 24px;
  flex: 0 0 24px;
  text-shadow: 0 0 12px rgba(var(--accent-rgb), .3);
}
.guide-copy { flex: 1; min-width: 0; }
.guide-copy b { display: block; font-family: var(--font-cn); font-size: 10px; font-weight: 500; color: var(--text-strong); letter-spacing: .03em; line-height: 1.3; }
.guide-copy p {
  margin: 1px 0 0;
  font-family: var(--font-cn);
  font-size: 8.5px;
  line-height: 1.4;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.guide-do {
  flex: 0 0 auto;
  min-height: 27px;
  padding: 0 9px;
  border: 1px solid rgba(var(--accent-rgb), .35);
  background: rgba(var(--accent-rgb), .06);
  color: var(--accent);
  font-family: var(--font-cn);
  font-size: 9px;
  letter-spacing: .04em;
  transition: background .2s, border-color .2s;
}
.guide-do:hover { background: rgba(var(--accent-rgb), .13); border-color: var(--line-strong); }
.guide-do span { margin-left: 4px; }

/* ---------------- status bar ---------------- */

.statusbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 30px;
  z-index: 27;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 18px;
  background: linear-gradient(180deg, transparent, rgba(3, 8, 13, .86));
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: .06em;
  color: var(--dim);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.theme-light .statusbar { background: linear-gradient(180deg, transparent, rgba(247, 250, 252, .9)); }
.status-left { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; white-space: nowrap; }
.status-led { width: 4px; height: 4px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 6px var(--ok); flex: 0 0 4px; }
.status-left b { color: var(--muted); font-weight: 400; }
.status-left .divider { width: 1px; height: 9px; background: var(--line-2); flex: 0 0 1px; }
#footerHint { overflow: hidden; text-overflow: ellipsis; font-family: var(--font-cn); font-size: 8px; letter-spacing: .03em; color: var(--dim); }
.status-right { display: flex; align-items: center; gap: 13px; flex: 0 0 auto; }
.status-right b { color: var(--muted); font-weight: 400; }
.status-right .disclaimer {
  font-family: var(--font-cn);
  color: var(--dim);
  border: 1px solid var(--line);
  padding: 1px 5px;
  letter-spacing: .02em;
}
#fpsVal { color: var(--ok); }
#fpsVal.low { color: var(--warn); }
#fpsVal.bad { color: var(--danger); }

/* ---------------- labels & hover ---------------- */

.labels-layer {
  position: fixed;
  inset: 0;
  z-index: 16;
  pointer-events: none;
  overflow: hidden;
}
.label-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.label-lines line { stroke: rgba(var(--accent-rgb), .48); stroke-width: 1; stroke-dasharray: 2 4; }
.label-lines circle { fill: var(--accent); opacity: .8; }
.part-label {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--label-border);
  background: var(--label-bg);
  color: var(--text);
  font-family: var(--font-cn);
  font-size: 8.5px;
  letter-spacing: .03em;
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  transform: translate(0, -50%);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
  transition: opacity .18s, border-color .18s, background .18s, color .18s, transform .18s;
  will-change: left, top;
}
.part-label::before {
  content: "";
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--label-color, var(--accent));
  box-shadow: 0 0 6px var(--label-color, var(--accent));
}
.part-label .pl-name { font-weight: 500; color: var(--text-strong); }
.part-label .pl-val {
  font-family: var(--font-mono);
  font-size: 6.5px;
  color: var(--dim);
  border-left: 1px solid var(--line);
  padding-left: 5px;
  letter-spacing: .02em;
}
.part-label:hover,
.part-label.active {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), .1);
  color: var(--accent);
  transform: translate(0, -50%) scale(1.03);
}
.theme-light .part-label:hover,
.theme-light .part-label.active { background: rgba(var(--accent-rgb), .08); }
.part-label.is-hidden { opacity: 0; pointer-events: none; }
.part-label.is-occluded { opacity: .62; }

.hover-tip {
  position: fixed;
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  transform: translate(10px, 14px);
  transition: opacity .12s;
  background: rgba(4, 12, 19, .92);
  border: 1px solid var(--line-strong);
  padding: 5px 8px;
  font-family: var(--font-cn);
  font-size: 9px;
  color: var(--text);
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .34);
}
.hover-tip.show { opacity: 1; }
.hover-tip b { display: block; color: var(--text-strong); font-weight: 500; font-size: 9.5px; }
.hover-tip span { font-family: var(--font-mono); font-size: 6.5px; color: var(--accent); letter-spacing: .06em; }
.theme-light .hover-tip { background: rgba(255, 255, 255, .95); border-color: var(--line-strong); box-shadow: 0 8px 24px rgba(40, 60, 80, .14); }
.hover-tip em {
  display: block;
  font-family: var(--font-cn);
  font-style: normal;
  font-size: 7px;
  color: var(--dim);
  margin-top: 1px;
}

/* ---------------- launch overlay ---------------- */

.launch-hud {
  position: fixed;
  left: 50%;
  top: 102px;
  transform: translate(-50%, -8px);
  z-index: 22;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s, transform .4s var(--ease-out);
}
.launch-hud.show { opacity: 1; transform: translate(-50%, 0); }
.launch-kicker { font-family: var(--font-mono); font-size: 7.5px; letter-spacing: .24em; color: var(--accent-2); text-shadow: 0 0 12px rgba(var(--accent-2-rgb), .4); }
.launch-count {
  font-family: var(--font-mono);
  font-size: 52px;
  line-height: 1.04;
  letter-spacing: .06em;
  color: var(--text-strong);
  text-shadow: 0 0 20px rgba(var(--accent-rgb), .45), 0 0 60px rgba(var(--accent-rgb), .2);
}
.launch-status { font-family: var(--font-cn); font-size: 10px; letter-spacing: .18em; color: var(--muted); margin-top: 1px; }
.launch-stats {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 7px;
  color: var(--dim);
  letter-spacing: .06em;
}
.launch-stats b { color: var(--accent); font-weight: 400; }

/* ---------------- boot ---------------- */

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 48%, rgba(17, 45, 62, .78) 0%, rgba(4, 9, 14, .98) 52%, #02060a 100%);
  transition: opacity .8s ease, visibility .8s;
  overflow: hidden;
}
.theme-light .boot-screen {
  background: radial-gradient(circle at 50% 48%, rgba(242, 247, 250, .98) 0%, rgba(229, 235, 241, .99) 56%, #dce3e9 100%);
}
.boot-screen.is-gone { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-grid {
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 58px 58px;
  transform: perspective(500px) rotateX(62deg) translateY(20%);
  mask-image: radial-gradient(circle at 50% 50%, #000 0, transparent 66%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 0, transparent 66%);
  opacity: .65;
  animation: bootGrid 8s linear infinite;
}
@keyframes bootGrid { to { background-position: 0 58px, 58px 0; } }
.boot-panel {
  position: relative;
  z-index: 2;
  width: min(560px, calc(100vw - 44px));
  text-align: center;
  padding: 20px;
}
.boot-emblem {
  position: relative;
  width: 104px;
  height: 104px;
  margin: 0 auto 18px;
}
.be-ring {
  position: absolute;
  border: 1px solid rgba(var(--accent-rgb), .5);
  border-radius: 50%;
}
.be-ring.a { inset: 0; border-style: dashed; opacity: .38; animation: spin 23s linear infinite; }
.be-ring.b { inset: 17px; border-color: var(--accent); opacity: .7; animation: spin 15s linear infinite reverse; }
.be-ring.c { inset: 34px; border-color: var(--accent-2); opacity: .9; animation: spin 9s linear infinite; }
.be-core {
  position: absolute;
  left: 50%; top: 50%;
  width: 17px; height: 17px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #fff, var(--accent) 32%, rgba(var(--accent-rgb), .06) 76%);
  box-shadow: 0 0 22px var(--accent), 0 0 55px rgba(var(--accent-rgb), .5);
  animation: corePulse 2.4s ease-in-out infinite;
}
@keyframes corePulse { 50% { transform: translate(-50%, -50%) scale(.86); opacity: .8; } }
.be-tick { position: absolute; background: var(--accent-2); opacity: .7; }
.be-tick.t1 { width: 9px; height: 1px; left: -4px; top: 50%; }
.be-tick.t2 { width: 1px; height: 9px; right: 50%; top: -4px; }
.boot-kicker { font-family: var(--font-mono); font-size: 7px; letter-spacing: .23em; color: var(--accent); opacity: .85; }
.boot-panel h2 {
  margin: 9px 0 2px;
  font-family: var(--font-cn);
  font-size: 33px;
  font-weight: 600;
  letter-spacing: .3em;
  text-indent: .3em;
  color: var(--text-strong);
  text-shadow: 0 0 30px rgba(var(--accent-rgb), .16);
}
.boot-sub { font-family: var(--font-mono); font-size: 7px; letter-spacing: .14em; color: var(--muted); }
.boot-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0 11px; color: var(--dim); font-family: var(--font-mono); font-size: 6.5px; letter-spacing: .13em; }
.boot-divider i { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line-2)); }
.boot-divider i:last-child { background: linear-gradient(90deg, var(--line-2), transparent); }
.boot-progress { height: 2px; background: var(--track); overflow: hidden; position: relative; }
.boot-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 10px rgba(var(--accent-rgb), .5);
  transition: width .35s ease;
}
.boot-log { min-height: 17px; margin-top: 7px; font-family: var(--font-mono); font-size: 7px; color: var(--dim); letter-spacing: .04em; text-align: left; }
.boot-enter {
  margin-top: 17px;
  min-width: 190px;
  height: 38px;
  border: 1px solid var(--line-strong);
  background: rgba(var(--accent-rgb), .06);
  color: var(--accent);
  font-family: var(--font-cn);
  font-size: 10px;
  letter-spacing: .1em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s, background .2s, border-color .2s;
}
.boot-enter span { display: block; font-family: var(--font-mono); font-size: 6px; letter-spacing: .11em; color: var(--dim); margin-top: 1px; }
.boot-enter.ready { opacity: 1; pointer-events: auto; }
.boot-enter:hover { background: rgba(var(--accent-rgb), .14); border-color: var(--accent); }
.boot-foot {
  position: absolute;
  bottom: 18px;
  left: 0; right: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: .14em;
  color: var(--dim);
  opacity: .55;
}

/* ---------------- toasts ---------------- */

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 158px;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  pointer-events: none;
  width: min(440px, calc(100vw - 32px));
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 7px 11px;
  background: var(--panel-deep);
  border: 1px solid var(--line-2);
  border-left: 2px solid var(--accent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .32);
  font-family: var(--font-cn);
  font-size: 9px;
  letter-spacing: .02em;
  color: var(--text);
  animation: toastIn .35s var(--ease-out);
}
.toast.warn { border-left-color: var(--warn); }
.toast.bad { border-left-color: var(--danger); }
.toast.good { border-left-color: var(--ok); }
.toast b { color: var(--text-strong); font-weight: 500; }
.toast .t-code { font-family: var(--font-mono); font-size: 6.5px; color: var(--accent); letter-spacing: .08em; }
.toast.out { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(7px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-4px); } }

/* ---------------- modal ---------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(1, 5, 9, .65);
  backdrop-filter: blur(7px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
}
.modal-backdrop.open { opacity: 1; visibility: visible; }
.help-modal {
  position: relative;
  width: min(720px, 100%);
  max-height: min(76vh, 640px);
  overflow-y: auto;
  background: var(--panel-deep);
  border: 1px solid var(--line-2);
  padding: 24px 26px 18px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .5);
  clip-path: polygon(0 16px, 16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%);
}
.help-modal h3 { margin: 4px 0 14px; font-family: var(--font-cn); font-size: 23px; font-weight: 600; letter-spacing: .12em; color: var(--text-strong); }
.modal-close {
  position: absolute;
  right: 12px; top: 12px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  border: 1px solid var(--line);
}
.modal-close:hover { color: var(--accent); border-color: var(--line-2); }
.modal-close svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; }
.help-grid h4 {
  margin: 0 0 5px;
  padding-left: 7px;
  border-left: 2px solid var(--accent);
  font-family: var(--font-cn);
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: .06em;
}
.help-grid p { margin: 0 0 4px; font-family: var(--font-cn); font-size: 9.5px; line-height: 1.65; color: var(--muted); }
kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 8px;
  padding: 0 4px;
  border: 1px solid var(--line-2);
  background: var(--btn-bg);
  color: var(--text);
  line-height: 15px;
  margin: 0 1px;
}
.help-foot { margin-top: 17px; padding-top: 9px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 6.5px; letter-spacing: .08em; color: var(--dim); }

.noscript {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050a10;
  color: #fff;
  font-family: var(--font-cn);
}

.mobile-rail { display: none; }
.only-mobile { display: none !important; }

/* ---------------- scrollbars ---------------- */

.part-list::-webkit-scrollbar,
.detail-body::-webkit-scrollbar,
.zone-scroll::-webkit-scrollbar,
.help-modal::-webkit-scrollbar { width: 4px; }
.part-list::-webkit-scrollbar-track,
.detail-body::-webkit-scrollbar-track,
.zone-scroll::-webkit-scrollbar-track,
.help-modal::-webkit-scrollbar-track { background: transparent; }
.part-list::-webkit-scrollbar-thumb,
.detail-body::-webkit-scrollbar-thumb,
.zone-scroll::-webkit-scrollbar-thumb,
.help-modal::-webkit-scrollbar-thumb { background: var(--line-2); }
.part-list, .detail-body, .zone-scroll, .help-modal { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

/* ---------------- responsive ---------------- */

@media (max-width: 1320px) {
  .parts-panel { width: 272px; }
  .right-panel { width: 318px; }
  .guide-dock { width: min(640px, calc(100vw - 638px)); min-width: 390px; }
  .brand { min-width: 270px; }
  .engine-id { min-width: 180px; }
  .icon-btn span { display: none; }
  .icon-btn { padding: 0 8px; }
}

@media (max-width: 1120px) {
  .engine-id { display: none; }
  .brand { min-width: 0; }
  .mode-pill { margin-left: auto; }
  .brand h1 span { display: none; }
  .guide-dock { width: 400px; }
  .guide-copy p { max-width: 240px; }
}

@media (max-width: 900px) {
  .topbar {
    height: 61px;
    padding: 0 12px;
    gap: 8px;
    background: var(--panel-deep);
    border-bottom: 1px solid var(--line);
  }
  .brand-mark { width: 32px; height: 32px; flex-basis: 32px; }
  .brand-mark .r1 { inset: 1px; }
  .brand-mark .r2 { inset: 6px; }
  .brand-mark .r3 { inset: 10px; }
  .brand h1 { font-size: 15px; letter-spacing: .06em; }
  .brand-kicker { font-size: 6px; letter-spacing: .12em; }
  .mode-pill { display: none; }
  .top-actions { margin-left: auto; }
  .icon-btn { height: 30px; padding: 0 6px; }
  .icon-btn svg { width: 16px; height: 16px; }
  .icon-btn#labelsBtn, .icon-btn#autoRotateBtn, .icon-btn#fullscreenBtn { display: none; }

  .panel {
    top: 61px;
    bottom: 36px;
    width: min(320px, calc(100vw - 24px));
    transform: translateX(-108%);
    opacity: 0;
    pointer-events: none;
    z-index: 60;
    clip-path: none;
    border-radius: 0;
  }
  .right-panel { right: 12px; transform: translateX(108%); }
  .parts-panel { left: 12px; }
  .panel.mobile-open { transform: translateX(0); opacity: 1; pointer-events: auto; }
  .only-mobile { display: inline-flex !important; }
  .panel-collapse svg { width: 16px; height: 16px; }

  .guide-dock {
    width: calc(100vw - 24px);
    min-width: 0;
    left: 12px;
    right: 12px;
    transform: none;
    bottom: 36px;
    padding: 7px 10px 8px;
    z-index: 24;
  }
  .guide-dock.collapsed .guide-main { display: none; }
  .guide-dock.collapsed { padding-bottom: 6px; }
  .guide-copy p { max-width: none; }
  .guide-index { width: 21px; flex-basis: 21px; font-size: 15px; }
  .statusbar { height: 36px; padding: 0 10px; }
  .status-left .divider, #footerHint { display: none; }
  .status-right { gap: 7px; }
  .status-right .disclaimer, .status-right span:nth-child(2) { display: none; }

  .mobile-rail {
    position: fixed;
    z-index: 28;
    left: 12px; right: 12px; bottom: 132px;
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: 4px;
    pointer-events: none;
  }
  .mobile-rail button {
    pointer-events: auto;
    height: 28px;
    background: var(--panel-deep);
    border: 1px solid var(--line);
    font-family: var(--font-cn);
    font-size: 8px;
    color: var(--muted);
    letter-spacing: .04em;
  }
  #mobileModeBtn { color: var(--accent); border-color: var(--line-2); }

  .toast-stack { bottom: 174px; }
  .launch-hud { top: 76px; }
  .launch-count { font-size: 38px; }
  .corner-frame { inset: 7px; opacity: .2; }
  .part-label { height: 20px; padding: 0 5px; font-size: 8px; gap: 4px; }
  .part-label .pl-val { display: none; }
  .label-lines line { stroke-opacity: .28; }

  .help-grid { grid-template-columns: 1fr; gap: 12px; }
  .help-modal { padding: 20px 18px 16px; }
}

@media (max-width: 520px) {
  .brand h1 { font-size: 13px; }
  .brand-kicker { display: none; }
  .brand { gap: 8px; }
  .top-actions { gap: 0; }
  .icon-btn { padding: 0 5px; }
  .guide-copy b { font-size: 9px; }
  .guide-copy p { font-size: 7.5px; }
  .guide-do { padding: 0 7px; font-size: 8px; }
  .guide-step { font-size: 0; gap: 0; }
  .guide-step i { font-size: 7px; opacity: 1; }
  .guide-auto { display: none !important; }
  .status-right span:first-child { display: none; }
  .boot-panel h2 { font-size: 26px; }
  .boot-panel { padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001s !important;
  }
}
