/* =========================================================
   AVIARY / MK-VII — structural teardown interface
   ========================================================= */

:root {
  --bg: #03070c;
  --bg-deep: #010407;
  --panel: rgba(5, 15, 22, 0.78);
  --panel-strong: rgba(4, 13, 20, 0.94);
  --ink: #d8f4fa;
  --ink-soft: #91abb5;
  --ink-mute: #5e7883;
  --cyan: #5ce7ff;
  --cyan-bright: #a9f6ff;
  --cyan-deep: #0da8c7;
  --amber: #ffbd69;
  --danger: #ff7b69;
  --line: rgba(106, 225, 255, 0.14);
  --line-strong: rgba(106, 225, 255, 0.32);
  --glass: rgba(3, 12, 18, 0.66);
  --font-sans: "Bahnschrift", "DIN Alternate", "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-mono: "Cascadia Code", "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

html {
  background: var(--bg);
}

body {
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 52% 42%, #0a1d29 0%, #040b11 36%, #02060a 68%, #010305 100%);
  font-family: var(--font-sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}

button {
  color: inherit;
  font: inherit;
}

svg {
  display: block;
}

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

::selection {
  color: #021217;
  background: var(--cyan);
}

button:focus-visible {
  outline: 1px solid rgba(120, 240, 255, 0.82);
  outline-offset: 2px;
}

/* ---------- scene shell ---------- */

#app {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 520px;
  isolation: isolate;
}

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

#scene:active {
  cursor: grabbing;
}

body.is-hovering-part #scene {
  cursor: pointer;
}

.atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(ellipse at 50% 46%, transparent 26%, rgba(1, 5, 8, 0.24) 62%, rgba(1, 4, 7, 0.84) 100%),
    linear-gradient(180deg, rgba(1, 5, 8, 0.58) 0%, transparent 22%, transparent 70%, rgba(1, 5, 8, 0.8) 100%);
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    repeating-linear-gradient(0deg, rgba(124, 238, 255, 0.026) 0 1px, transparent 1px 4px);
  mix-blend-mode: screen;
  pointer-events: none;
}

#hud {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

/* ---------- shared type & helpers ---------- */

.overline {
  margin-bottom: 6px;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.24em;
  line-height: 1;
  opacity: 0.8;
}

.live-dot {
  position: relative;
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  vertical-align: 1px;
}

.live-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 1px solid rgba(92, 231, 255, 0.5);
  border-radius: 50%;
  animation: live-pulse 2.4s ease-out infinite;
}

.mobile-only {
  display: none;
}

.hud-reveal {
  opacity: 0;
  transform: translateY(9px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

body.is-ready .hud-reveal {
  opacity: 1;
  transform: translateY(0);
}

body.is-ready .topbar { transition-delay: 0.06s; }
body.is-ready .parts-panel { transition-delay: 0.18s; }
body.is-ready .detail-panel { transition-delay: 0.26s; }
body.is-ready .stage-meta { transition-delay: 0.16s; }
body.is-ready .controls-hint { transition-delay: 0.62s; }
body.is-ready .dock { transition-delay: 0.38s; }

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

.boot {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(15, 50, 63, 0.34) 0%, transparent 34%),
    #020609;
  transition: opacity 0.8s var(--ease), visibility 0.8s;
}

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

.boot-grid {
  position: absolute;
  inset: -35%;
  background-image:
    linear-gradient(rgba(83, 214, 240, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(83, 214, 240, 0.08) 1px, transparent 1px);
  background-size: 58px 58px;
  transform: perspective(500px) rotateX(62deg) translateY(10%);
  mask-image: radial-gradient(circle at 50% 55%, black 0%, transparent 58%);
  animation: boot-grid-drift 12s linear infinite;
}

.boot-halo {
  position: absolute;
  width: min(70vw, 760px);
  aspect-ratio: 1;
  border: 1px solid rgba(74, 228, 255, 0.12);
  border-radius: 50%;
  box-shadow:
    0 0 0 60px rgba(52, 207, 235, 0.018),
    0 0 0 120px rgba(52, 207, 235, 0.012),
    inset 0 0 90px rgba(27, 166, 194, 0.06);
}

.boot-halo::before,
.boot-halo::after {
  content: "";
  position: absolute;
  inset: 12%;
  border: 1px dashed rgba(100, 227, 250, 0.12);
  border-radius: 50%;
  animation: spin 28s linear infinite;
}

.boot-halo::after {
  inset: 28%;
  border-style: solid;
  border-color: rgba(100, 227, 250, 0.08);
  animation-duration: 18s;
  animation-direction: reverse;
}

.boot-panel {
  position: relative;
  z-index: 2;
  width: min(560px, calc(100vw - 44px));
  padding: 24px 28px 20px;
  border: 1px solid rgba(104, 225, 248, 0.18);
  background:
    linear-gradient(140deg, rgba(8, 25, 34, 0.86), rgba(3, 10, 15, 0.76));
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(190, 250, 255, 0.06);
  backdrop-filter: blur(16px);
}

.boot-panel::before,
.boot-panel::after {
  content: "";
  position: absolute;
  width: 52px;
  height: 1px;
  top: -1px;
  background: var(--cyan);
  box-shadow: 0 0 14px var(--cyan);
}

.boot-panel::before { left: -1px; }
.boot-panel::after { right: -1px; }

.boot-topline,
.boot-meta,
.boot-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
}

.boot-topline {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(102, 224, 247, 0.1);
}

.boot-identity {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 28px 0 30px;
}

.boot-mark {
  position: relative;
  flex: 0 0 76px;
  width: 76px;
  height: 76px;
  border: 1px solid rgba(92, 231, 255, 0.28);
  border-radius: 50%;
  animation: spin 9s linear infinite;
}

.boot-mark::before,
.boot-mark::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.boot-mark::before {
  inset: 8px;
  border: 1px dashed rgba(92, 231, 255, 0.36);
}

.boot-mark::after {
  inset: 22px;
  border: 1px solid rgba(92, 231, 255, 0.16);
  box-shadow: 0 0 22px rgba(63, 219, 247, 0.16);
}

.boot-mark span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cyan-bright);
  box-shadow: 0 0 18px 4px rgba(80, 229, 255, 0.56);
  transform: translate(-50%, -50%);
}

.boot-mark i {
  position: absolute;
  left: 50%;
  top: -3px;
  width: 1px;
  height: 13px;
  background: var(--cyan);
  opacity: 0.55;
}

.boot-mark i:nth-child(2) { transform: rotate(120deg); transform-origin: 0 41px; }
.boot-mark i:nth-child(3) { transform: rotate(240deg); transform-origin: 0 41px; }

.boot-kicker {
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.28em;
}

.boot-identity h1 {
  margin: 5px 0 5px;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 500;
  letter-spacing: 0.05em;
}

.boot-identity h1 em {
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.48em;
  font-style: normal;
  letter-spacing: 0.12em;
  vertical-align: 3px;
}

.boot-identity p {
  margin: 0;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.22em;
}

.boot-progress {
  height: 1px;
  background: rgba(100, 225, 248, 0.12);
  overflow: hidden;
}

.boot-progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #137b91, var(--cyan-bright));
  box-shadow: 0 0 12px var(--cyan);
  transition: width 0.35s var(--ease);
}

.boot-meta {
  padding-top: 12px;
  color: var(--ink-soft);
}

#bootPercent {
  color: var(--cyan);
}

.boot-foot {
  position: absolute;
  left: 30px;
  right: 30px;
  bottom: 26px;
  color: rgba(109, 152, 161, 0.55);
}

/* ---------- top bar ---------- */

.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 30px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 15px;
}

.brand-mark {
  position: relative;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(103, 227, 249, 0.22);
  border-radius: 50%;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.brand-mark::before {
  inset: 6px;
  border: 1px dashed rgba(100, 226, 250, 0.38);
  animation: spin 18s linear infinite;
}

.brand-mark::after {
  inset: 15px;
  border: 1px solid rgba(102, 230, 252, 0.15);
}

.brand-mark span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan-bright);
  box-shadow: 0 0 12px 3px rgba(82, 231, 255, 0.55);
  transform: translate(-50%, -50%);
}

.brand-mark i {
  position: absolute;
  top: -3px;
  left: 50%;
  width: 1px;
  height: 8px;
  background: rgba(121, 239, 255, 0.6);
}

.brand-mark i:nth-child(2) { transform: rotate(120deg); transform-origin: 0 26px; }
.brand-mark i:nth-child(3) { transform: rotate(240deg); transform-origin: 0 26px; }

.brand-kicker {
  margin-bottom: 5px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.2em;
  white-space: nowrap;
}

.brand-kicker .slash {
  margin: 0 5px;
  color: rgba(105, 226, 250, 0.32);
}

.brand-copy h1 {
  margin: 0;
  color: #e6fbff;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-shadow: 0 0 22px rgba(82, 228, 255, 0.12);
  white-space: nowrap;
}

.brand-copy h1 em {
  margin-left: 7px;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 10px;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.16em;
  opacity: 0.88;
  vertical-align: 2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.telemetry {
  display: flex;
  align-items: stretch;
  gap: 0;
  height: 40px;
  padding: 0 4px;
  border: 1px solid rgba(100, 224, 248, 0.1);
  background: rgba(4, 13, 19, 0.38);
  backdrop-filter: blur(12px);
}

.telemetry-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 54px;
  padding: 0 12px;
  border-right: 1px solid rgba(100, 224, 248, 0.08);
}

.telemetry-item:last-child {
  border-right: 0;
}

.telemetry-item span {
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.18em;
}

.telemetry-item b {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.telemetry-item b.ok {
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(80, 230, 255, 0.35);
}

.ghost-btn,
.icon-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(100, 224, 248, 0.13);
  background: rgba(4, 13, 19, 0.48);
  color: var(--ink-soft);
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: color 0.25s, border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

.ghost-btn {
  gap: 7px;
  height: 40px;
  padding: 0 12px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
}

.ghost-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.ghost-btn.is-on {
  color: var(--cyan);
  border-color: rgba(92, 231, 255, 0.22);
}

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

.icon-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}

.ghost-btn:hover,
.icon-btn:hover {
  color: var(--cyan-bright);
  border-color: rgba(92, 231, 255, 0.4);
  background: rgba(9, 32, 43, 0.62);
  box-shadow: inset 0 0 20px rgba(47, 205, 234, 0.05), 0 0 18px rgba(47, 205, 234, 0.06);
}

/* ---------- stage meta ---------- */

.stage-meta {
  position: absolute;
  top: 88px;
  left: 33px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(113, 170, 180, 0.66);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.2em;
  pointer-events: none;
}

.stage-meta .stage-line {
  width: 30px;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  opacity: 0.6;
}

.stage-meta em {
  color: rgba(88, 132, 141, 0.5);
  font-style: normal;
  letter-spacing: 0.13em;
}

/* ---------- panels ---------- */

.panel {
  position: absolute;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(96, 221, 245, 0.14);
  background:
    linear-gradient(145deg, rgba(7, 20, 29, 0.82) 0%, rgba(3, 10, 16, 0.7) 56%, rgba(4, 14, 21, 0.78) 100%);
  box-shadow:
    0 22px 70px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(191, 250, 255, 0.035);
  backdrop-filter: blur(20px) saturate(115%);
  -webkit-backdrop-filter: blur(20px) saturate(115%);
}

.panel::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 20px;
  right: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(92, 231, 255, 0.52), transparent);
  pointer-events: none;
}

.corner {
  position: absolute;
  width: 9px;
  height: 9px;
  pointer-events: none;
  border-color: rgba(115, 238, 255, 0.58);
  border-style: solid;
}

.corner.tl { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.corner.tr { top: -1px; right: -1px; border-width: 1px 1px 0 0; }
.corner.bl { bottom: -1px; left: -1px; border-width: 0 0 1px 1px; }
.corner.br { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }

.parts-panel {
  top: 108px;
  bottom: 122px;
  left: 28px;
  width: 288px;
}

.detail-panel {
  top: 108px;
  bottom: 122px;
  right: 28px;
  width: 342px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 17px 18px 0;
}

.panel-head h2 {
  margin: 0;
  color: #dffaff;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.panel-head h2 sup {
  margin-left: 5px;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.08em;
  vertical-align: 3px;
}

.panel-rule {
  height: 1px;
  margin: 13px 18px 0;
  background: linear-gradient(90deg, rgba(101, 226, 250, 0.18), transparent 72%);
}

.panel-sub {
  margin: 11px 18px 8px;
  color: var(--ink-mute);
  font-size: 10px;
  line-height: 1.7;
  letter-spacing: 0.035em;
}

.panel-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}

.panel-close svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.parts-list {
  flex: 1;
  min-height: 0;
  padding: 0 8px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(92, 231, 255, 0.18) transparent;
}

.parts-list::-webkit-scrollbar,
.detail-scroll::-webkit-scrollbar {
  width: 3px;
}

.parts-list::-webkit-scrollbar-track,
.detail-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.parts-list::-webkit-scrollbar-thumb,
.detail-scroll::-webkit-scrollbar-thumb {
  background: rgba(92, 231, 255, 0.2);
}

.part-item {
  position: relative;
  display: grid;
  grid-template-columns: 23px 26px minmax(0, 1fr) 7px;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 6px 10px;
  border: 0;
  border-bottom: 1px solid rgba(105, 220, 242, 0.055);
  background: transparent;
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: background 0.24s, padding 0.24s;
}

.part-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 2px;
  height: 0;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  transform: translateY(-50%);
  transition: height 0.24s var(--ease);
}

.part-item:hover {
  background: rgba(54, 190, 220, 0.055);
}

.part-item.is-active {
  background: linear-gradient(90deg, rgba(42, 191, 220, 0.11), rgba(42, 191, 220, 0.015) 74%, transparent);
}

.part-item.is-active::before {
  height: 27px;
}

.part-item.is-active .part-index {
  color: var(--cyan);
}

.part-item.is-active .part-name {
  color: #f0feff;
}

.part-index {
  color: rgba(112, 158, 168, 0.7);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  transition: color 0.24s;
}

.part-icon {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid rgba(104, 224, 247, 0.1);
  background: rgba(35, 135, 157, 0.035);
  color: rgba(131, 206, 217, 0.7);
  transition: border-color 0.24s, color 0.24s, background 0.24s;
}

.part-icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.part-item.is-active .part-icon {
  color: var(--cyan);
  border-color: rgba(92, 231, 255, 0.25);
  background: rgba(66, 216, 246, 0.08);
  box-shadow: inset 0 0 14px rgba(57, 210, 238, 0.08);
}

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

.part-name {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.24s;
}

.part-en {
  overflow: hidden;
  color: rgba(105, 143, 152, 0.65);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.11em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.part-pin {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(114, 191, 202, 0.34);
  transition: background 0.24s, box-shadow 0.24s;
}

.part-item.is-active .part-pin {
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.part-item.is-detached .part-pin {
  background: var(--amber);
  box-shadow: 0 0 8px rgba(255, 189, 105, 0.6);
}

.panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 16px 0;
  padding: 11px 1px 12px;
  border-top: 1px solid rgba(104, 221, 243, 0.09);
  color: rgba(107, 155, 163, 0.62);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.1em;
}

.foot-status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(117, 190, 199, 0.72);
}

.foot-status .live-dot {
  width: 4px;
  height: 4px;
}

.foot-code {
  color: rgba(95, 132, 140, 0.55);
  white-space: nowrap;
}

/* ---------- detail panel ---------- */

.detail-panel .panel-head {
  padding-bottom: 8px;
}

.detail-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 18px 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(92, 231, 255, 0.18) transparent;
}

.detail-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0 14px;
}

.detail-index {
  flex: 0 0 auto;
  color: transparent;
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.04em;
  -webkit-text-stroke: 1px rgba(96, 225, 250, 0.55);
  text-shadow: 0 0 22px rgba(92, 231, 255, 0.1);
}

.detail-heading {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.detail-heading h2 {
  margin: 0 0 5px;
  overflow: hidden;
  color: #effeff;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-heading p {
  margin: 0;
  overflow: hidden;
  color: var(--cyan-deep);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.14em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.state-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  margin-top: 3px;
  padding: 4px 6px;
  border: 1px solid rgba(92, 231, 255, 0.16);
  color: rgba(108, 212, 227, 0.76);
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.state-tag i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
}

.state-tag.is-detached {
  border-color: rgba(255, 189, 105, 0.24);
  color: var(--amber);
}

.state-tag.is-detached i {
  background: var(--amber);
  box-shadow: 0 0 6px var(--amber);
}

.schematic-wrap {
  position: relative;
  border: 1px solid rgba(101, 222, 245, 0.1);
  background:
    linear-gradient(rgba(98, 221, 244, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(98, 221, 244, 0.026) 1px, transparent 1px),
    rgba(2, 9, 14, 0.56);
  background-size: 16px 16px, 16px 16px, auto;
  overflow: hidden;
}

.schematic-meta,
.schematic-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  color: rgba(99, 147, 156, 0.62);
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: 0.09em;
}

.schematic-meta {
  border-bottom: 1px solid rgba(99, 222, 245, 0.06);
}

.schematic-meta b {
  color: rgba(104, 216, 235, 0.78);
  font-weight: 500;
}

.schematic-foot {
  border-top: 1px solid rgba(99, 222, 245, 0.06);
}

.schematic-stage {
  position: relative;
  height: 148px;
  overflow: hidden;
}

#schematic {
  width: 100%;
  height: 100%;
}

.sch-grid path {
  fill: none;
  stroke: rgba(104, 220, 242, 0.075);
  stroke-width: 0.7;
}

.sch-base {
  fill: none;
  stroke: rgba(116, 196, 207, 0.19);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sch-part {
  fill: none;
  stroke: rgba(100, 224, 248, 0.1);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 1;
  transition: stroke 0.3s, opacity 0.3s, filter 0.3s;
}

.sch-part.on {
  stroke: var(--cyan-bright);
  stroke-width: 1.6;
  filter: drop-shadow(0 0 4px rgba(61, 225, 255, 0.8));
}

.sch-cross {
  fill: none;
  stroke: rgba(104, 220, 242, 0.12);
  stroke-width: 0.8;
}

.sch-cross circle {
  fill: rgba(92, 231, 255, 0.45);
  stroke: none;
}

.schematic-scan {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 2%, rgba(95, 229, 255, 0.42) 40%, var(--cyan-bright) 50%, rgba(95, 229, 255, 0.42) 60%, transparent 98%);
  box-shadow: 0 0 12px rgba(75, 225, 253, 0.2);
  opacity: 0.62;
  animation: schematic-scan 4.8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.detail-desc {
  margin: 13px 0 0;
  color: #8ea8b1;
  font-size: 10.5px;
  line-height: 1.8;
  letter-spacing: 0.025em;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.tag {
  padding: 3px 6px;
  border: 1px solid rgba(98, 221, 245, 0.11);
  color: rgba(120, 190, 201, 0.8);
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: 0.08em;
}

.data-block {
  margin-top: 16px;
}

.block-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(96, 219, 241, 0.09);
  color: rgba(157, 215, 225, 0.76);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.block-label span:last-child {
  color: rgba(96, 140, 149, 0.55);
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: 0.14em;
}

.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(99, 220, 243, 0.08);
  border: 1px solid rgba(99, 220, 243, 0.08);
}

.spec-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 41px;
  padding: 7px 8px;
  background: rgba(4, 14, 20, 0.85);
}

.spec-item span {
  color: rgba(101, 145, 154, 0.7);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.spec-item b {
  color: rgba(199, 242, 249, 0.88);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  word-break: break-word;
}

.metrics {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.metric-row {
  display: grid;
  grid-template-columns: 67px 1fr 26px;
  align-items: center;
  gap: 8px;
}

.metric-row span {
  color: rgba(103, 147, 155, 0.7);
  font-size: 7px;
  letter-spacing: 0.06em;
}

.metric-row i {
  position: relative;
  height: 2px;
  overflow: hidden;
  background: rgba(89, 171, 183, 0.12);
}

.metric-row i::before {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--value, 50%);
  background: linear-gradient(90deg, rgba(18, 129, 149, 0.55), var(--cyan));
  box-shadow: 0 0 8px rgba(72, 225, 255, 0.22);
  transition: width 0.9s var(--ease);
}

.metric-row b {
  color: rgba(145, 217, 227, 0.8);
  font-family: var(--font-mono);
  font-size: 6.5px;
  font-weight: 400;
  text-align: right;
}

.detail-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
  margin-top: 0;
  padding: 10px 18px 1px;
  border-top: 1px solid rgba(96, 219, 241, 0.08);
  background: linear-gradient(180deg, rgba(5, 16, 23, 0.42), rgba(4, 13, 19, 0.78));
}

.action-btn,
.action-icon {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 37px;
  border: 1px solid rgba(94, 226, 250, 0.25);
  background: linear-gradient(180deg, rgba(26, 95, 110, 0.24), rgba(7, 31, 40, 0.2));
  color: rgba(188, 246, 253, 0.92);
  cursor: pointer;
  transition: border-color 0.24s, background 0.24s, color 0.24s, box-shadow 0.24s;
}

.action-btn {
  flex: 1;
  gap: 7px;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.action-btn svg,
.action-icon svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}

.action-btn em {
  margin-left: auto;
  color: rgba(99, 164, 174, 0.6);
  font-family: var(--font-mono);
  font-size: 6px;
  font-style: normal;
  letter-spacing: 0.1em;
}

.action-icon {
  width: 38px;
  flex: 0 0 38px;
}

.action-btn:hover,
.action-icon:hover {
  border-color: rgba(92, 231, 255, 0.58);
  background: rgba(31, 127, 146, 0.25);
  color: #e7fdff;
  box-shadow: inset 0 0 18px rgba(72, 225, 255, 0.08), 0 0 18px rgba(63, 209, 237, 0.08);
}

.detail-foot {
  margin-top: 4px;
}

/* ---------- 3d labels ---------- */

.label-layer {
  position: fixed;
  inset: 0;
  z-index: 7;
  overflow: hidden;
  pointer-events: none;
}

.leader-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.leader-line {
  fill: none;
  stroke: rgba(111, 220, 238, 0.28);
  stroke-width: 0.8;
  stroke-dasharray: 2.5 4;
  opacity: 0;
  transition: opacity 0.35s;
}

.leader-dot {
  fill: var(--cyan);
  opacity: 0;
  filter: drop-shadow(0 0 4px rgba(80, 229, 255, 0.8));
  transition: opacity 0.35s;
}

.leader-line.is-visible,
.leader-dot.is-visible {
  opacity: 1;
}

.leader-line.is-active {
  stroke: rgba(138, 242, 255, 0.7);
  stroke-dasharray: none;
}

.part-label {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 96px;
  max-width: 170px;
  padding: 5px 8px 5px 7px;
  border: 1px solid rgba(107, 228, 250, 0.14);
  background: linear-gradient(105deg, rgba(3, 15, 22, 0.86), rgba(4, 18, 26, 0.66));
  color: inherit;
  text-align: left;
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -50%) scale(0.94);
  transform-origin: center;
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease), border-color 0.25s, background 0.25s;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

.part-label::before {
  content: "";
  width: 2px;
  align-self: stretch;
  min-height: 15px;
  background: rgba(77, 212, 236, 0.38);
}

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

.part-label:hover,
.part-label.is-active {
  z-index: 3;
  border-color: rgba(92, 231, 255, 0.42);
  background: linear-gradient(105deg, rgba(7, 30, 40, 0.94), rgba(4, 18, 26, 0.78));
}

.part-label.is-active {
  z-index: 4;
  box-shadow: 0 0 20px rgba(49, 207, 236, 0.12), inset 0 0 18px rgba(52, 211, 240, 0.04);
}

.part-label.is-active::before {
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.label-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.label-copy b {
  overflow: hidden;
  color: rgba(208, 247, 253, 0.92);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.label-copy small {
  overflow: hidden;
  color: rgba(102, 161, 171, 0.78);
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: 0.07em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hover-tip {
  position: fixed;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 7px;
  border: 1px solid rgba(107, 231, 253, 0.22);
  background: rgba(3, 14, 20, 0.9);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(14px, 14px);
  transition: opacity 0.15s, visibility 0.15s;
  backdrop-filter: blur(10px);
}

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

.hover-index {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border: 1px solid rgba(92, 231, 255, 0.2);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 7px;
}

.hover-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hover-copy b {
  color: rgba(221, 250, 255, 0.9);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.hover-copy small {
  color: rgba(105, 154, 163, 0.72);
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: 0.06em;
}

/* ---------- controls hint ---------- */

.controls-hint {
  position: absolute;
  top: 90px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 7px 10px;
  border: 1px solid rgba(99, 220, 242, 0.1);
  background: rgba(4, 14, 20, 0.42);
  color: rgba(111, 166, 176, 0.72);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  transform: translateX(-50%) translateY(9px);
  backdrop-filter: blur(12px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

body.is-ready .controls-hint {
  transform: translateX(-50%) translateY(0);
}

.controls-hint.is-hidden {
  opacity: 0 !important;
  transform: translateX(-50%) translateY(-6px) !important;
}

.controls-hint > span {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.controls-hint svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: rgba(104, 209, 226, 0.7);
  stroke-width: 1.4;
}

.controls-hint button {
  pointer-events: auto;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(100, 144, 152, 0.55);
  cursor: pointer;
}

.controls-hint button svg {
  width: 9px;
  height: 9px;
}

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

.dock {
  position: absolute;
  bottom: 27px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 5px;
  width: min(758px, calc(100vw - 702px));
  min-width: 580px;
  padding: 7px;
  border: 1px solid rgba(101, 224, 247, 0.16);
  background:
    linear-gradient(180deg, rgba(9, 26, 35, 0.88), rgba(3, 11, 17, 0.84));
  box-shadow:
    0 18px 55px rgba(0, 0, 0, 0.44),
    inset 0 1px 0 rgba(188, 250, 255, 0.045);
  opacity: 0;
  transform: translateX(-50%) translateY(9px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  backdrop-filter: blur(20px) saturate(120%);
  pointer-events: auto;
}

body.is-ready .dock {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.dock::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(93, 231, 255, 0.6), transparent);
}

.dock-progress {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 116px;
  padding: 0 6px 0 7px;
}

.dock-kicker {
  color: rgba(94, 140, 149, 0.7);
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: 0.08em;
}

.progress-track {
  position: relative;
  flex: 1;
  height: 2px;
  overflow: hidden;
  background: rgba(98, 191, 203, 0.12);
}

.progress-track i {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #14788e, var(--cyan-bright));
  box-shadow: 0 0 8px rgba(83, 230, 255, 0.6);
  transition: width 0.1s linear;
}

.dock-progress b {
  min-width: 26px;
  color: rgba(139, 222, 234, 0.84);
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-align: right;
}

.dock-divider {
  width: 1px;
  height: 24px;
  margin: 0 2px;
  background: rgba(98, 218, 241, 0.12);
}

.dock-action {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 4px 9px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(158, 206, 214, 0.82);
  cursor: pointer;
  text-align: left;
  transition: color 0.24s, border-color 0.24s, background 0.24s, box-shadow 0.24s;
}

.dock-action:hover {
  color: #e6fdff;
  border-color: rgba(92, 231, 255, 0.13);
  background: rgba(41, 157, 179, 0.08);
}

.action-glyph {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(99, 219, 242, 0.12);
  background: rgba(37, 138, 158, 0.04);
  transition: border-color 0.24s, color 0.24s, background 0.24s;
}

.action-glyph svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
}

.action-copy b {
  color: inherit;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.07em;
}

.action-copy small {
  color: rgba(93, 139, 148, 0.68);
  font-family: var(--font-mono);
  font-size: 5.5px;
  letter-spacing: 0.08em;
}

.dock-action.primary {
  flex: 1 1 auto;
  justify-content: flex-start;
  border-color: rgba(91, 229, 254, 0.26);
  background: linear-gradient(115deg, rgba(29, 139, 160, 0.27), rgba(7, 36, 46, 0.22));
  color: #d9fbff;
  box-shadow: inset 0 0 22px rgba(52, 204, 232, 0.035);
}

.dock-action.primary:hover {
  border-color: rgba(105, 240, 255, 0.52);
  background: linear-gradient(115deg, rgba(38, 174, 197, 0.34), rgba(10, 47, 59, 0.3));
  box-shadow: inset 0 0 22px rgba(60, 219, 244, 0.08), 0 0 20px rgba(49, 198, 226, 0.1);
}

.dock-action.primary .action-glyph {
  color: var(--cyan);
  border-color: rgba(92, 231, 255, 0.28);
  background: rgba(55, 207, 234, 0.09);
  box-shadow: inset 0 0 15px rgba(67, 221, 245, 0.08);
}

.dock-action.is-on {
  color: var(--cyan);
}

.dock-action.is-on .action-glyph {
  color: var(--cyan);
  border-color: rgba(92, 231, 255, 0.24);
  background: rgba(50, 198, 224, 0.08);
}

.dock-action.icon-only {
  flex: 0 0 40px;
  justify-content: center;
  padding: 4px;
}

.dock-action.icon-only .action-glyph {
  border-color: transparent;
  background: transparent;
}

.dock-action.icon-only:hover .action-glyph {
  border-color: rgba(92, 231, 255, 0.18);
  background: rgba(41, 157, 179, 0.1);
}

.dock-action kbd {
  margin-left: auto;
  padding: 3px 4px;
  border: 1px solid rgba(100, 220, 243, 0.12);
  color: rgba(100, 160, 168, 0.6);
  font-family: var(--font-mono);
  font-size: 5.5px;
  font-weight: 400;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.mobile-dock {
  display: none;
}

/* ---------- toast ---------- */

.toast {
  position: absolute;
  z-index: 40;
  top: 133px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  border: 1px solid rgba(102, 228, 251, 0.18);
  background: rgba(3, 15, 22, 0.84);
  color: rgba(177, 231, 238, 0.85);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -8px);
  transition: opacity 0.32s var(--ease), transform 0.32s var(--ease), visibility 0.32s;
  backdrop-filter: blur(14px);
}

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

.toast-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 7px var(--cyan);
}

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

.modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 22px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s;
  pointer-events: auto;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 5, 8, 0.76);
  backdrop-filter: blur(9px);
}

.modal-card {
  position: relative;
  width: min(720px, 100%);
  max-height: calc(100dvh - 44px);
  padding: 30px 34px 24px;
  overflow-y: auto;
  border: 1px solid rgba(101, 225, 249, 0.18);
  background:
    linear-gradient(145deg, rgba(8, 24, 33, 0.98), rgba(3, 10, 15, 0.97));
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(192, 250, 255, 0.05);
  transform: translateY(14px) scale(0.985);
  transition: transform 0.5s var(--ease);
}

.modal.is-open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-card h2 {
  margin: 0;
  color: #effeff;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.modal-lead {
  max-width: 490px;
  margin: 9px 0 23px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.8;
  letter-spacing: 0.025em;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
}

.guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.guide-card {
  position: relative;
  min-height: 135px;
  padding: 15px 16px 13px;
  border: 1px solid rgba(99, 220, 243, 0.1);
  background:
    linear-gradient(130deg, rgba(12, 36, 46, 0.36), rgba(4, 13, 19, 0.2));
  overflow: hidden;
}

.guide-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 32px;
  height: 32px;
  border-top: 1px solid rgba(92, 231, 255, 0.25);
  border-right: 1px solid rgba(92, 231, 255, 0.25);
}

.guide-card > svg {
  width: 20px;
  height: 20px;
  margin-bottom: 13px;
  fill: none;
  stroke: var(--cyan);
  stroke-width: 1.2;
  opacity: 0.85;
}

.guide-no {
  position: absolute;
  top: 14px;
  right: 14px;
  color: rgba(95, 171, 182, 0.55);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.1em;
}

.guide-card h3 {
  margin: 0 0 6px;
  color: rgba(218, 250, 255, 0.9);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.guide-card p {
  margin: 0;
  color: rgba(117, 159, 167, 0.78);
  font-size: 9px;
  line-height: 1.7;
  letter-spacing: 0.02em;
}

.shortcut-row {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(99, 220, 243, 0.09);
  color: rgba(111, 161, 170, 0.76);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.04em;
}

.shortcut-row span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.shortcut-row kbd {
  min-width: 25px;
  padding: 3px 5px;
  border: 1px solid rgba(99, 220, 243, 0.17);
  color: rgba(161, 223, 233, 0.8);
  font-family: var(--font-mono);
  font-size: 6px;
  text-align: center;
}

.modal-confirm {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-top: 22px;
  padding: 10px 18px;
  border: 1px solid rgba(92, 231, 255, 0.3);
  background: rgba(31, 132, 151, 0.16);
  color: var(--cyan-bright);
  font-size: 9px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.24s, border-color 0.24s;
}

.modal-confirm span {
  color: var(--cyan);
}

.modal-confirm:hover {
  border-color: rgba(107, 240, 255, 0.55);
  background: rgba(35, 150, 171, 0.24);
}

.modal-foot {
  margin-top: 24px;
  color: rgba(83, 126, 134, 0.55);
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: 0.12em;
}

/* ---------- animations ---------- */

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes boot-grid-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 58px, 58px 0; }
}

@keyframes live-pulse {
  0% { transform: scale(0.7); opacity: 0.7; }
  70%, 100% { transform: scale(1.7); opacity: 0; }
}

@keyframes schematic-scan {
  0% { top: 0%; opacity: 0; }
  8% { opacity: 0.7; }
  68% { top: 100%; opacity: 0.4; }
  80%, 100% { top: 100%; opacity: 0; }
}

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

@media (max-width: 1260px) {
  .parts-panel { width: 264px; left: 22px; }
  .detail-panel { width: 320px; right: 22px; }
  .topbar { padding-left: 24px; padding-right: 24px; }
  .dock { width: min(690px, calc(100vw - 642px)); min-width: 552px; }
  .stage-meta { left: 26px; }
}

@media (max-width: 1120px) {
  .parts-panel { width: 244px; }
  .detail-panel { width: 300px; }
  .dock { width: min(590px, calc(100vw - 590px)); min-width: 520px; }
  .dock-progress { flex-basis: 96px; }
  .telemetry-item { min-width: 46px; padding: 0 8px; }
  .brand-copy h1 { font-size: 19px; }
  .stage-meta { display: none; }
}

@media (max-width: 980px) {
  .telemetry { display: none; }
  .parts-panel { width: 232px; }
  .detail-panel { width: 286px; }
  .ghost-btn { padding: 0 9px; }
  .dock { width: calc(100vw - 500px); min-width: 470px; }
  .dock-progress { display: none; }
  .dock-divider { display: none; }
  .brand-mark { flex-basis: 40px; width: 40px; height: 40px; }
  .brand-mark i:nth-child(2),
  .brand-mark i:nth-child(3) { transform-origin: 0 23px; }
}

@media (max-width: 860px) {
  .topbar {
    align-items: center;
    padding: 16px 16px 0;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
  }

  .brand-mark::before { inset: 5px; }
  .brand-mark::after { inset: 11px; }
  .brand-mark i { height: 6px; }
  .brand-mark i:nth-child(2),
  .brand-mark i:nth-child(3) { transform-origin: 0 20px; }

  .brand-copy h1 {
    font-size: 16px;
    letter-spacing: 0.07em;
  }

  .brand-kicker {
    font-size: 6px;
    letter-spacing: 0.1em;
  }

  .brand-copy h1 em { font-size: 8px; margin-left: 4px; }

  .topbar-right { gap: 6px; }

  .ghost-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
  }

  .ghost-btn span { display: none; }

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

  .parts-panel,
  .detail-panel {
    position: fixed;
    z-index: 36;
    top: 70px;
    bottom: 138px;
    width: min(88vw, 330px);
    border-color: rgba(99, 225, 248, 0.23);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.6);
    transition: transform 0.46s var(--ease), opacity 0.46s var(--ease);
    opacity: 0;
    pointer-events: none;
  }

  .parts-panel {
    left: 14px;
    transform: translateX(calc(-100% - 22px));
  }

  .detail-panel {
    right: 14px;
    left: auto;
    width: min(93vw, 350px);
    transform: translateX(calc(100% + 22px));
  }

  body.is-ready .parts-panel {
    opacity: 0;
    transform: translateX(calc(-100% - 22px));
    pointer-events: none;
  }

  body.is-ready .detail-panel {
    opacity: 0;
    transform: translateX(calc(100% + 22px));
    pointer-events: none;
  }

  body.is-ready .parts-panel.is-open,
  body.is-ready .detail-panel.is-open {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
  }

  .mobile-only { display: flex; }

  .panel-close {
    display: flex;
  }

  .part-item {
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .stage-meta,
  .controls-hint { display: none; }

  .toast { top: 68px; }

  .dock {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    min-width: 0;
    transform: translateY(9px);
    padding: 6px;
    gap: 2px;
  }

  body.is-ready .dock {
    transform: translateY(0);
  }

  .dock-progress,
  .dock-divider,
  .dock-action kbd { display: none; }

  .dock-action {
    flex: 1 1 0;
    justify-content: center;
    min-height: 44px;
    padding: 4px 6px;
  }

  .dock-action.primary { flex: 1.7 1 0; justify-content: center; }
  .dock-action.icon-only { flex: 0 0 38px; }
  .action-copy small { display: none; }
  .action-copy b { font-size: 8.5px; }
  .action-glyph { width: 25px; height: 25px; }

  .mobile-dock {
    position: fixed;
    z-index: 34;
    left: 50%;
    bottom: 74px;
    display: flex;
    gap: 6px;
    transform: translateX(-50%);
    pointer-events: auto;
  }

  .mobile-dock button {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 11px;
    border: 1px solid rgba(101, 223, 246, 0.17);
    background: rgba(4, 15, 22, 0.82);
    color: rgba(144, 207, 217, 0.8);
    font-size: 8px;
    letter-spacing: 0.08em;
    backdrop-filter: blur(12px);
  }

  .mobile-dock svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
  }

  .modal-card { padding: 25px 21px 20px; }
  .guide-grid { grid-template-columns: 1fr; }
  .guide-card { min-height: 0; }

  .part-label {
    max-width: 138px;
    padding: 4px 6px;
  }

  .part-label .label-copy small { display: none; }
  .part-label .label-copy b { font-size: 7.5px; }
  .leader-line { display: none; }
}

@media (max-width: 520px) {
  .brand-kicker { display: none; }
  .brand-copy h1 { font-size: 14px; }
  .brand-copy h1 em { display: none; }
  .topbar { padding: 12px 12px 0; }
  .brand-mark { flex-basis: 30px; width: 30px; height: 30px; }
  .brand-mark i:nth-child(2),
  .brand-mark i:nth-child(3) { transform-origin: 0 18px; }
  .brand-mark i { height: 5px; }
  .brand-mark::after { inset: 9px; }

  .topbar-right .ghost-btn { display: none; }

  .parts-panel,
  .detail-panel {
    top: 58px;
    bottom: 134px;
    width: calc(100vw - 24px);
    left: 12px;
    right: 12px;
  }

  .detail-panel { width: calc(100vw - 24px); }

  .dock-action.primary { flex: 1.5 1 0; }
  .dock-action .action-copy b { font-size: 8px; }
  .dock-action .action-glyph { display: none; }
  .dock-action.primary .action-glyph { display: grid; width: 22px; height: 22px; }
  .dock-action.icon-only { display: none; }

  .mobile-dock { bottom: 70px; }

  .modal { padding: 10px; }
  .modal-card { max-height: calc(100dvh - 20px); padding: 22px 16px 18px; }
  .modal-card h2 { font-size: 21px; }
  .shortcut-row { gap: 8px; }
  .schematic-stage { height: 126px; }

  .toast { top: 56px; max-width: calc(100vw - 24px); white-space: nowrap; }
}

@media (max-height: 790px) and (min-width: 861px) {
  .parts-panel,
  .detail-panel {
    top: 92px;
    bottom: 100px;
  }

  .schematic-stage { height: 126px; }
  .detail-title { padding-top: 6px; padding-bottom: 10px; }
  .detail-desc { line-height: 1.65; }
  .data-block { margin-top: 12px; }
  .detail-actions { padding-top: 8px; }
  .part-item { padding-top: 5px; padding-bottom: 5px; }
  .controls-hint { top: 82px; }
  .stage-meta { top: 79px; }
}

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