/* =========================================================================
   CANON EOS 6D — 3D TEARDOWN LAB
   Deep navy optical-instrument UI, responsive from desktop to phone.
   ========================================================================= */

:root {
  --bg: #03070f;
  --bg-deep: #02040a;
  --bg-navy: #06101f;
  --panel: rgba(5, 13, 25, 0.88);
  --panel-solid: #071221;
  --panel-2: rgba(10, 24, 42, 0.78);
  --line: rgba(106, 191, 224, 0.16);
  --line-strong: rgba(106, 213, 245, 0.34);
  --line-soft: rgba(106, 191, 224, 0.09);
  --text: #dfeaf6;
  --text-2: #a8bacd;
  --muted: #6e849c;
  --muted-2: #4d6279;
  --cyan: #61e8ff;
  --cyan-2: #2eb8df;
  --cyan-dim: rgba(97, 232, 255, 0.14);
  --violet: #9a83ff;
  --violet-dim: rgba(154, 131, 255, 0.14);
  --amber: #ffc164;
  --amber-dim: rgba(255, 193, 100, 0.13);
  --green: #3ddbb0;
  --red: #ff6f76;
  --silver: #c8d5e3;
  --radius: 13px;
  --radius-sm: 8px;
  --mono: "SFMono-Regular", "Cascadia Code", "Consolas", "Liberation Mono", monospace;
  --sans: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --topbar-h: 76px;
  --control-h: 94px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { background: var(--bg-deep); }
body {
  margin: 0;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
  background:
    radial-gradient(ellipse 70% 55% at 52% 38%, rgba(24, 75, 110, 0.34), transparent 67%),
    radial-gradient(ellipse 60% 50% at 12% 62%, rgba(76, 53, 145, 0.16), transparent 72%),
    radial-gradient(ellipse 50% 40% at 88% 18%, rgba(14, 92, 120, 0.13), transparent 70%),
    linear-gradient(160deg, #050b16 0%, #02050b 50%, #040a13 100%);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(110, 190, 225, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(110, 190, 225, 0.022) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 48%, #000 20%, transparent 88%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(120, 210, 240, 0.012) 3px 4px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 1px solid var(--cyan); outline-offset: 2px; }
[hidden] { display: none !important; }
::selection { background: rgba(97, 232, 255, 0.28); color: #fff; }

/* -------------------------------------------------------------------------
   BOOT
   ------------------------------------------------------------------------- */

.boot {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 50% 45%, #071423 0%, #02050a 64%, #010204 100%);
  transition: opacity 0.7s ease, visibility 0.7s ease;
}
.boot.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(90, 190, 220, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90, 190, 220, 0.06) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 50%, #000 10%, transparent 70%);
}
.boot-grid::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 35%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(97, 232, 255, 0.5), transparent);
  box-shadow: 0 0 30px rgba(97, 232, 255, 0.35);
  animation: bootScan 3.4s ease-in-out infinite;
}
@keyframes bootScan {
  0%, 100% { transform: translateY(-120px); opacity: 0; }
  25%, 70% { opacity: 0.8; }
  60% { transform: translateY(160px); opacity: 0; }
}
.boot-card {
  position: relative;
  width: min(520px, 82vw);
  padding: 38px 40px 30px;
  border: 1px solid rgba(97, 232, 255, 0.18);
  border-radius: 3px;
  background: linear-gradient(150deg, rgba(8, 21, 37, 0.92), rgba(2, 6, 12, 0.94));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7), inset 0 0 60px rgba(43, 132, 166, 0.05);
}
.boot-card::before, .boot-card::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border: 1px solid var(--cyan);
  opacity: 0.7;
}
.boot-card::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.boot-card::after { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }
.boot-mark {
  position: relative;
  width: 54px; height: 54px;
  margin-bottom: 24px;
  border-radius: 50%;
  background: conic-gradient(from 10deg, transparent 0 52deg, rgba(97, 232, 255, 0.75) 53deg 56deg, transparent 57deg 110deg, rgba(97, 232, 255, 0.75) 111deg 114deg, transparent 115deg 180deg, rgba(154, 131, 255, 0.65) 181deg 184deg, transparent 185deg 250deg, rgba(97, 232, 255, 0.5) 251deg 254deg, transparent 255deg 360deg);
  border: 1px solid rgba(97, 232, 255, 0.25);
  box-shadow: inset 0 0 20px rgba(97, 232, 255, 0.08);
}
.boot-mark::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 1px solid rgba(200, 225, 245, 0.32);
}
.boot-mark::after {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 16px var(--cyan);
}
.boot-kicker, .panel-kicker, .overline, .hud-kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.19em;
  color: var(--cyan-2);
  text-transform: uppercase;
}
.boot-card h1 {
  margin: 8px 0 4px;
  font-size: 31px;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: #e8f2fb;
}
.boot-card h1 em { color: var(--cyan); font-style: normal; }
.boot-sub { margin: 0 0 30px; color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; }
.boot-bar { height: 2px; background: rgba(100, 190, 220, 0.12); overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan-2), var(--cyan), var(--violet)); box-shadow: 0 0 18px var(--cyan); transition: width 0.6s ease; }
.boot-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; font-family: var(--mono); font-size: 8px; letter-spacing: 0.11em; color: var(--muted-2); }

/* -------------------------------------------------------------------------
   SHELL
   ------------------------------------------------------------------------- */

.app {
  position: relative;
  z-index: 2;
  height: 100dvh;
  display: grid;
  grid-template-rows: var(--topbar-h) minmax(0, 1fr) var(--control-h);
  gap: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(4, 11, 21, 0.95), rgba(3, 8, 15, 0.72));
  backdrop-filter: blur(18px);
  min-width: 0;
}

.brand { display: flex; align-items: center; gap: 13px; flex: 0 0 auto; }
.brand-symbol {
  position: relative;
  width: 43px; height: 43px;
  border-radius: 50%;
  border: 1px solid rgba(97, 232, 255, 0.4);
  background: conic-gradient(from 25deg, transparent 0 48deg, rgba(97, 232, 255, 0.55) 49deg 52deg, transparent 53deg 118deg, rgba(97, 232, 255, 0.45) 119deg 122deg, transparent 123deg 188deg, rgba(154, 131, 255, 0.5) 189deg 192deg, transparent 193deg 258deg, rgba(97, 232, 255, 0.4) 259deg 262deg, transparent 263deg 360deg);
  box-shadow: inset 0 0 20px rgba(97, 232, 255, 0.08);
}
.brand-symbol::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; border: 1px solid rgba(207, 228, 245, 0.35); }
.brand-symbol::after { content: ""; position: absolute; inset: 18px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.overline { color: var(--muted); letter-spacing: 0.16em; white-space: nowrap; }
.overline span { color: var(--cyan-2); }
.brand-title { display: flex; align-items: baseline; gap: 9px; margin-top: 4px; white-space: nowrap; }
.brand-title h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: 0.12em; color: #eff7ff; }
.brand-slash { color: var(--cyan-2); font-weight: 300; }
.brand-sub { font-family: var(--mono); font-size: 10px; letter-spacing: 0.24em; color: var(--text-2); }
.brand-version { font-family: var(--mono); font-size: 8px; letter-spacing: 0.12em; color: var(--muted-2); border: 1px solid var(--line); padding: 2px 5px; border-radius: 2px; }

.header-metrics { display: flex; gap: 20px; flex: 0 0 auto; }
.metric { min-width: 70px; }
.metric span { display: block; font-family: var(--mono); font-size: 8px; letter-spacing: 0.15em; color: var(--muted-2); }
.metric strong { display: flex; align-items: baseline; gap: 3px; margin-top: 2px; font-size: 17px; font-weight: 400; letter-spacing: 0.03em; color: var(--silver); }
.metric small { font-family: var(--mono); font-size: 8px; color: var(--muted); letter-spacing: 0.04em; }

.header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; min-width: 0; }
.view-switch {
  display: flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(8, 22, 38, 0.55);
  flex: 0 0 auto;
}
.view-switch button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 5px 9px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.view-switch button:hover { color: var(--text); background: rgba(97, 232, 255, 0.06); }
.view-switch button.is-active { color: #021019; background: linear-gradient(135deg, #74edff, #3bb6e0); font-weight: 600; box-shadow: 0 0 16px rgba(97, 232, 255, 0.2); }

.tool-row { display: flex; gap: 3px; flex: 0 0 auto; }
.tool-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 6px 7px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.tool-btn em { font-style: normal; font-size: 10px; white-space: nowrap; }
.tool-btn:hover { color: var(--text); border-color: var(--line); background: rgba(97, 232, 255, 0.05); }
.tool-btn.is-on { color: var(--cyan); border-color: rgba(97, 232, 255, 0.25); background: rgba(97, 232, 255, 0.09); box-shadow: inset 0 0 15px rgba(97, 232, 255, 0.04); }
.tool-ico { position: relative; width: 15px; height: 15px; display: inline-block; flex: 0 0 auto; }
.ico-light::before { content: ""; position: absolute; inset: 1px 4px; border: 1px solid currentColor; border-radius: 50% 50% 45% 45%; }
.ico-light::after { content: ""; position: absolute; left: 7px; top: 0; width: 1px; height: 15px; background: currentColor; transform: rotate(35deg); opacity: 0.7; }
.ico-cut::before { content: ""; position: absolute; left: 2px; top: 2px; width: 11px; height: 11px; border: 1px solid currentColor; transform: rotate(45deg); border-right-color: transparent; border-bottom-color: transparent; }
.ico-cut::after { content: ""; position: absolute; left: 7px; top: 0; width: 1px; height: 15px; background: currentColor; opacity: 0.45; }
.ico-label::before { content: ""; position: absolute; left: 2px; top: 3px; width: 8px; height: 8px; border: 1px solid currentColor; }
.ico-label::after { content: ""; position: absolute; left: 12px; top: 6px; width: 3px; height: 1px; background: currentColor; box-shadow: 0 3px 0 currentColor; }
.ico-rotate::before { content: ""; position: absolute; inset: 2px; border: 1px dashed currentColor; border-radius: 50%; }
.ico-rotate::after { content: ""; position: absolute; right: 0; top: 4px; border-left: 4px solid currentColor; border-top: 3px solid transparent; border-bottom: 3px solid transparent; }
.ico-diag::before { content: ""; position: absolute; left: 2px; bottom: 2px; width: 2px; height: 7px; background: currentColor; box-shadow: 4px -3px 0 currentColor, 8px -6px 0 currentColor; }
.ico-diag::after { content: ""; position: absolute; left: 1px; top: 1px; width: 13px; height: 13px; border-left: 1px solid currentColor; border-bottom: 1px solid currentColor; opacity: 0.4; }
.ico-help::before { content: "?"; position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--mono); font-size: 12px; border: 1px solid currentColor; border-radius: 50%; }

.mobile-actions { display: none; gap: 6px; }
.mobile-btn { border: 1px solid var(--line); background: rgba(9, 24, 41, 0.8); color: var(--text-2); padding: 7px 10px; border-radius: 5px; font-size: 11px; }

/* -------------------------------------------------------------------------
   WORKSPACE
   ------------------------------------------------------------------------- */

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 308px minmax(0, 1fr) 336px;
  gap: 10px;
  padding: 10px 12px;
}

.panel {
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(9, 22, 39, 0.88), rgba(4, 10, 19, 0.92)),
    radial-gradient(ellipse at 50% 0%, rgba(64, 157, 196, 0.08), transparent 70%);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(170, 225, 245, 0.045);
  backdrop-filter: blur(18px);
  overflow: hidden;
}
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(125deg, rgba(97, 232, 255, 0.06), transparent 24%, transparent 76%, rgba(154, 131, 255, 0.045));
}
.panel-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 16px 16px 13px;
  border-bottom: 1px solid var(--line-soft);
  flex: 0 0 auto;
}
.panel-head h2 { margin: 5px 0 0; font-size: 16px; font-weight: 500; letter-spacing: 0.06em; }
.panel-count { margin-left: auto; text-align: right; padding-top: 3px; }
.panel-count strong { display: block; font-size: 22px; font-weight: 300; color: var(--cyan); line-height: 1; letter-spacing: 0.04em; }
.panel-count span { font-family: var(--mono); font-size: 7px; letter-spacing: 0.13em; color: var(--muted-2); }
.drawer-close { display: none; margin-left: auto; border: 0; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; padding: 0 2px; cursor: pointer; }

.filter-row {
  display: flex;
  gap: 4px;
  padding: 10px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 0 0 auto;
  border-bottom: 1px solid var(--line-soft);
}
.filter-row::-webkit-scrollbar { display: none; }
.filter {
  border: 1px solid transparent;
  background: rgba(12, 30, 50, 0.45);
  color: var(--muted);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}
.filter:hover { color: var(--text); border-color: var(--line); }
.filter.is-active { color: var(--cyan); border-color: rgba(97, 232, 255, 0.3); background: rgba(97, 232, 255, 0.08); }

.part-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 8px 10px; scrollbar-width: thin; scrollbar-color: rgba(97, 232, 255, 0.2) transparent; }
.part-list::-webkit-scrollbar, .detail-scroll::-webkit-scrollbar { width: 5px; }
.part-list::-webkit-scrollbar-thumb, .detail-scroll::-webkit-scrollbar-thumb { background: rgba(97, 232, 255, 0.18); border-radius: 9px; }

.list-group { margin: 5px 0 8px; }
.list-group-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 6px 6px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(7, 18, 32, 0.98), rgba(7, 18, 32, 0.9));
  backdrop-filter: blur(8px);
}
.group-index { font-family: var(--mono); font-size: 8px; color: var(--cyan-2); border: 1px solid rgba(97, 232, 255, 0.24); border-radius: 2px; padding: 2px 4px; }
.list-group-head div { min-width: 0; }
.list-group-head b { display: block; font-size: 10px; font-weight: 500; color: var(--text-2); letter-spacing: 0.06em; }
.list-group-head small { display: block; font-family: var(--mono); font-size: 7px; letter-spacing: 0.1em; color: var(--muted-2); }
.list-group-head em { margin-left: auto; font-style: normal; font-family: var(--mono); font-size: 8px; color: var(--muted-2); }

.part-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 27px 27px;
  align-items: stretch;
  border: 1px solid transparent;
  border-radius: 6px;
  margin: 2px 0;
  transition: background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}
.part-row:hover { background: rgba(80, 175, 210, 0.055); border-color: var(--line-soft); }
.part-row.is-selected { background: linear-gradient(90deg, rgba(97, 232, 255, 0.12), rgba(97, 232, 255, 0.03)); border-color: rgba(97, 232, 255, 0.34); }
.part-row.is-hovered { border-color: rgba(97, 232, 255, 0.2); }
.part-row.is-hidden { opacity: 0.42; }
.part-row.is-isolated { border-color: rgba(255, 193, 100, 0.45); }
.row-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 6px 4px 6px 6px;
  cursor: pointer;
}
.row-no { font-family: var(--mono); font-size: 8px; color: var(--muted-2); width: 16px; flex: 0 0 auto; }
.row-copy { min-width: 0; flex: 1 1 auto; }
.row-copy b { display: block; font-size: 11px; font-weight: 450; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.row-copy small { display: block; font-family: var(--mono); font-size: 7px; letter-spacing: 0.08em; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-swatch { width: 5px; height: 20px; border-radius: 3px; flex: 0 0 auto; background: var(--sw); box-shadow: 0 0 8px color-mix(in srgb, var(--sw) 55%, transparent); opacity: 0.85; }
.row-icon {
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}
.row-icon svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.25; }
.row-icon:hover { color: var(--cyan); background: rgba(97, 232, 255, 0.08); }
.row-icon.is-on { color: var(--amber); }

.panel-foot { flex: 0 0 auto; padding: 10px 13px 12px; border-top: 1px solid var(--line-soft); }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; margin-bottom: 9px; }
.legend span { font-family: var(--mono); font-size: 7px; letter-spacing: 0.07em; color: var(--muted-2); display: flex; align-items: center; gap: 4px; }
.dot { width: 4px; height: 4px; border-radius: 50%; display: inline-block; }
.dot-opt { background: var(--violet); box-shadow: 0 0 6px var(--violet); }
.dot-mech { background: var(--silver); box-shadow: 0 0 6px rgba(200, 213, 227, 0.6); }
.dot-elec { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot-fast { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.wide-btn { width: 100%; border: 1px solid var(--line); background: rgba(12, 32, 52, 0.6); color: var(--text-2); padding: 7px 8px; border-radius: 4px; font-size: 10px; letter-spacing: 0.04em; cursor: pointer; transition: all 0.18s ease; }
.wide-btn:hover { color: var(--cyan); border-color: rgba(97, 232, 255, 0.34); background: rgba(97, 232, 255, 0.07); }
.serial { margin: 8px 0 0; font-family: var(--mono); font-size: 7px; letter-spacing: 0.12em; color: var(--muted-2); text-align: center; }

/* -------------------------------------------------------------------------
   STAGE
   ------------------------------------------------------------------------- */

.stage-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse 56% 52% at 50% 52%, rgba(27, 80, 111, 0.32), transparent 67%),
    radial-gradient(ellipse 36% 40% at 82% 18%, rgba(70, 47, 135, 0.1), transparent 70%),
    linear-gradient(180deg, #040b16 0%, #02060d 100%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.44), inset 0 0 100px rgba(20, 100, 140, 0.06);
  overflow: hidden;
  isolation: isolate;
}
.stage { position: absolute; inset: 0; z-index: 1; }
.stage canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.stage canvas.is-dragging { cursor: grabbing; }
.stage-grid {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background-image:
    linear-gradient(rgba(91, 180, 215, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 180, 215, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 55%, #000 20%, transparent 72%);
  opacity: 0.7;
}
.stage-scanlines {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 2px, rgba(115, 218, 245, 0.018) 2px 3px);
  mix-blend-mode: screen;
}
.stage-scanlines::after {
  content: ""; position: absolute; left: 0; right: 0; height: 120px;
  background: linear-gradient(180deg, transparent, rgba(97, 232, 255, 0.045), transparent);
  animation: scanDown 9s linear infinite;
}
@keyframes scanDown { 0% { top: -16%; } 100% { top: 112%; } }
.stage-vignette {
  position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background: radial-gradient(ellipse at 50% 48%, transparent 48%, rgba(0, 0, 0, 0.36) 100%);
}

.stage-hud { position: absolute; z-index: 12; top: 15px; left: 16px; pointer-events: none; }
.hud-kicker { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 8px; }
.live-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: livePulse 2s ease-in-out infinite; }
@keyframes livePulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
.hud-state { display: flex; align-items: baseline; gap: 9px; margin-top: 7px; }
.hud-state i { width: 20px; height: 1px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.hud-state strong { font-size: 15px; font-weight: 400; letter-spacing: 0.1em; color: var(--text); }
.hud-state span { font-family: var(--mono); font-size: 10px; color: var(--cyan); letter-spacing: 0.08em; }
.hud-legend { display: flex; gap: 12px; margin-top: 12px; }
.hud-legend span { display: flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 7px; letter-spacing: 0.08em; color: var(--muted-2); }
.hud-legend i { width: 12px; height: 1px; display: inline-block; }
.line-cyan { background: var(--cyan); box-shadow: 0 0 7px var(--cyan); }
.line-amber { background: var(--amber); box-shadow: 0 0 7px var(--amber); }
.line-violet { background: var(--violet); box-shadow: 0 0 7px var(--violet); }

.axis-badge {
  position: absolute; z-index: 12; right: 16px; top: 16px;
  display: flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 8px; letter-spacing: 0.08em; color: var(--muted-2);
  pointer-events: none;
}
.axis-badge span { display: grid; place-items: center; width: 16px; height: 16px; border: 1px solid var(--line); border-radius: 50%; color: var(--text-2); }
.axis-badge i { width: 28px; height: 1px; background: linear-gradient(90deg, var(--cyan-2), transparent); }
.axis-badge small { margin-left: 4px; font-size: 7px; }

.zoom-cluster {
  position: absolute; z-index: 15; right: 15px; bottom: 92px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(5, 14, 25, 0.72);
  backdrop-filter: blur(10px);
}
.zoom-cluster button { width: 25px; height: 25px; border: 0; background: transparent; color: var(--text-2); font-size: 17px; line-height: 1; cursor: pointer; border-radius: 3px; }
.zoom-cluster button:hover { color: var(--cyan); background: rgba(97, 232, 255, 0.08); }
.zoom-cluster span { font-family: var(--mono); font-size: 6px; letter-spacing: 0.1em; color: var(--muted-2); }

.corner { position: absolute; z-index: 10; width: 13px; height: 13px; border: 1px solid rgba(97, 232, 255, 0.4); pointer-events: none; }
.corner-tl { left: 8px; top: 8px; border-right: 0; border-bottom: 0; }
.corner-tr { right: 8px; top: 8px; border-left: 0; border-bottom: 0; }
.corner-bl { left: 8px; bottom: 8px; border-right: 0; border-top: 0; }
.corner-br { right: 8px; bottom: 8px; border-left: 0; border-top: 0; }

.stage-bottom { position: absolute; z-index: 12; left: 16px; right: 16px; bottom: 12px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; pointer-events: none; }
.hint-bar { display: flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 8px; letter-spacing: 0.05em; color: var(--muted-2); flex-wrap: wrap; }
.hint-bar b { color: var(--muted-2); opacity: 0.5; }
.hint-bar .accent { color: var(--cyan-2); }
.mouse-icon { width: 12px; height: 17px; border: 1px solid var(--muted-2); border-radius: 6px; position: relative; }
.mouse-icon i { position: absolute; left: 50%; top: 3px; width: 1px; height: 4px; background: var(--cyan); transform: translateX(-50%); }
.selected-strip {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(5, 15, 27, 0.72);
  backdrop-filter: blur(10px);
  pointer-events: none;
  min-width: 0;
}
.strip-index { font-family: var(--mono); font-size: 8px; color: var(--cyan); }
.strip-name { font-size: 11px; color: var(--text); white-space: nowrap; }
.strip-spec { font-family: var(--mono); font-size: 7px; letter-spacing: 0.06em; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }

/* -------------------------------------------------------------------------
   LABELS / RETICLE
   ------------------------------------------------------------------------- */

.leader-layer { position: absolute; inset: 0; z-index: 13; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.leader-layer polyline { fill: none; stroke: var(--cyan); stroke-width: 0.8; stroke-dasharray: 3 3; transition: opacity 0.1s linear; }
.leader-layer circle { fill: var(--cyan); }

.label-layer { position: absolute; inset: 0; z-index: 14; pointer-events: none; }
.part-label {
  position: absolute;
  left: 0; top: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 172px;
  padding: 4px 7px 4px 5px;
  border: 1px solid rgba(97, 232, 255, 0.18);
  border-left: 2px solid rgba(97, 232, 255, 0.55);
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(7, 20, 34, 0.88), rgba(4, 11, 20, 0.68));
  color: var(--text-2);
  text-align: left;
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(8px);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  will-change: transform;
  white-space: nowrap;
}
.part-label:hover, .part-label.is-hovered { border-color: rgba(97, 232, 255, 0.55); background: rgba(9, 31, 48, 0.92); }
.part-label.is-selected { border-color: var(--amber); border-left-color: var(--amber); box-shadow: 0 0 16px rgba(255, 193, 100, 0.12); }
.part-label.is-left { flex-direction: row-reverse; border-left: 1px solid rgba(97, 232, 255, 0.18); border-right: 2px solid rgba(97, 232, 255, 0.55); }
.part-label.is-left.is-selected { border-right-color: var(--amber); }
.pl-no { font-family: var(--mono); font-size: 7px; color: var(--cyan); letter-spacing: 0.04em; }
.part-label.is-selected .pl-no { color: var(--amber); }
.pl-copy { display: flex; flex-direction: column; min-width: 0; }
.pl-copy b { font-size: 9px; font-weight: 500; line-height: 1.2; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.pl-copy small { font-family: var(--mono); font-size: 5.5px; line-height: 1.3; letter-spacing: 0.07em; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; }

.reticle {
  position: absolute; z-index: 16;
  left: 0; top: 0;
  width: 0; height: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  will-change: transform;
}
.reticle.is-visible { opacity: 1; }
.reticle-ring {
  position: absolute; left: -31px; top: -31px;
  width: 62px; height: 62px;
  border: 1px solid rgba(255, 193, 100, 0.8);
  border-radius: 50%;
  box-shadow: 0 0 16px rgba(255, 193, 100, 0.12), inset 0 0 18px rgba(255, 193, 100, 0.06);
  animation: reticleSpin 9s linear infinite;
}
.reticle-ring::before, .reticle-ring::after { content: ""; position: absolute; background: var(--amber); opacity: 0.8; }
.reticle-ring::before { left: 50%; top: -4px; width: 1px; height: 8px; }
.reticle-ring::after { left: 50%; bottom: -4px; width: 1px; height: 8px; }
@keyframes reticleSpin { to { transform: rotate(360deg); } }
.reticle i { position: absolute; left: -14px; top: 0; width: 28px; height: 1px; background: linear-gradient(90deg, transparent, var(--amber), transparent); }
.reticle b { position: absolute; left: 40px; top: -7px; font-family: var(--mono); font-size: 7px; letter-spacing: 0.1em; color: var(--amber); white-space: nowrap; }

/* -------------------------------------------------------------------------
   FLOAT PANELS
   ------------------------------------------------------------------------- */

.float-panel {
  position: absolute; z-index: 30;
  width: 302px;
  right: 16px; bottom: 112px;
  border: 1px solid rgba(97, 232, 255, 0.2);
  border-radius: 8px;
  background: linear-gradient(165deg, rgba(9, 23, 41, 0.96), rgba(3, 9, 17, 0.97));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(180, 230, 250, 0.06);
  backdrop-filter: blur(18px);
  overflow: hidden;
  animation: floatIn 0.24s ease both;
}
@keyframes floatIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.section-panel { right: auto; left: 16px; }
.diag-panel { right: 16px; bottom: 112px; width: 370px; max-height: min(64vh, 570px); display: flex; flex-direction: column; }
.float-head { display: flex; align-items: flex-start; gap: 10px; padding: 12px 13px 9px; border-bottom: 1px solid var(--line-soft); }
.float-head h3 { margin: 3px 0 0; font-size: 14px; font-weight: 500; letter-spacing: 0.06em; }
.float-head > button { margin-left: auto; border: 0; background: transparent; color: var(--muted); font-size: 19px; line-height: 1; cursor: pointer; padding: 0 2px; }
.float-head > button:hover { color: var(--cyan); }
.float-note { margin: 10px 13px 0; font-size: 10px; line-height: 1.7; color: var(--muted); }
.float-foot { margin: 8px 13px 11px; font-family: var(--mono); font-size: 7px; letter-spacing: 0.06em; color: var(--muted-2); }
.axis-picker { display: flex; gap: 4px; padding: 10px 13px 4px; }
.axis-picker button { flex: 1; border: 1px solid var(--line); background: rgba(11, 32, 53, 0.6); color: var(--muted); padding: 5px 0; border-radius: 4px; font-family: var(--mono); font-size: 9px; letter-spacing: 0.05em; cursor: pointer; }
.axis-picker button.is-active { color: #04121c; background: var(--cyan); border-color: var(--cyan); font-weight: 600; }
.section-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; padding: 6px 13px 0; }
.section-presets button { border: 1px solid var(--line-soft); background: rgba(9, 25, 43, 0.55); color: var(--muted); border-radius: 3px; padding: 4px 1px; font-size: 8px; cursor: pointer; white-space: nowrap; }
.section-presets button:hover { color: var(--cyan); border-color: rgba(97, 232, 255, 0.3); }
.section-presets button.is-active { color: var(--cyan); border-color: rgba(97, 232, 255, 0.38); background: rgba(97, 232, 255, 0.08); }
.range-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 5px 8px; padding: 9px 13px 4px; }
.range-row span { font-family: var(--mono); font-size: 8px; letter-spacing: 0.07em; color: var(--muted); }
.range-row b { font-family: var(--mono); font-size: 9px; color: var(--cyan); font-weight: 400; }
.range-row input { grid-column: 1 / -1; width: 100%; height: 3px; appearance: none; background: rgba(97, 232, 255, 0.16); border-radius: 4px; outline: none; }
.range-row input::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px rgba(97, 232, 255, 0.7); cursor: pointer; }
.range-row input::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px rgba(97, 232, 255, 0.7); cursor: pointer; }
.mini-btn { border: 1px solid var(--line); background: rgba(10, 30, 50, 0.7); color: var(--text-2); padding: 5px 8px; border-radius: 4px; font-family: var(--mono); font-size: 8px; letter-spacing: 0.04em; cursor: pointer; }
.mini-btn:hover { color: var(--cyan); border-color: rgba(97, 232, 255, 0.35); }
.mini-btn.is-on { color: var(--amber); border-color: rgba(255, 193, 100, 0.4); background: rgba(255, 193, 100, 0.08); }
.section-panel .mini-btn { margin: 7px 13px 12px; }
.light-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 10px 13px 4px; }
.light-toggles button { display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: rgba(10, 30, 50, 0.6); color: var(--muted); border-radius: 4px; padding: 7px 4px; font-size: 9px; cursor: pointer; }
.light-toggles button i { width: 12px; height: 1px; }
.light-toggles button.is-on { color: var(--text); border-color: rgba(97, 232, 255, 0.34); background: rgba(97, 232, 255, 0.08); }
.fire-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: calc(100% - 26px); margin: 9px 13px 6px; border: 1px solid rgba(255, 193, 100, 0.4); background: linear-gradient(90deg, rgba(255, 193, 100, 0.12), rgba(255, 127, 46, 0.06)); color: var(--amber); border-radius: 4px; padding: 8px; font-size: 10px; letter-spacing: 0.06em; cursor: pointer; transition: all 0.18s ease; }
.fire-btn:hover { background: rgba(255, 193, 100, 0.16); box-shadow: 0 0 20px rgba(255, 193, 100, 0.1); }
.fire-btn span { width: 0; height: 0; border-left: 7px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; }
.diag-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 13px 8px; }
.diag-top > span { font-family: var(--mono); font-size: 9px; letter-spacing: 0.05em; color: var(--green); }
.diag-top > span.is-fail { color: var(--red); }
.diag-results { list-style: none; margin: 0; padding: 0 10px 10px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.diag-results li { display: flex; align-items: flex-start; gap: 8px; padding: 6px 5px; border-bottom: 1px solid var(--line-soft); }
.diag-check { flex: 0 0 auto; font-family: var(--mono); font-size: 7px; letter-spacing: 0.05em; padding: 2px 4px; border-radius: 2px; }
.diag-results li.is-pass .diag-check { color: #052117; background: var(--green); }
.diag-results li.is-fail .diag-check { color: #2a0608; background: var(--red); }
.diag-results li > div { min-width: 0; flex: 1 1 auto; }
.diag-results b { display: block; font-size: 9px; font-weight: 450; color: var(--text); }
.diag-results small { display: block; font-family: var(--mono); font-size: 7px; line-height: 1.45; color: var(--muted-2); word-break: break-word; }
.diag-results em { font-style: normal; font-family: var(--mono); font-size: 7px; color: var(--muted-2); }
.diag-idle { color: var(--muted); font-size: 10px; padding: 13px 8px !important; line-height: 1.6; }

/* -------------------------------------------------------------------------
   RIGHT DETAIL
   ------------------------------------------------------------------------- */

.right-head { align-items: flex-start; }
.detail-index { margin-left: auto; font-family: var(--mono); font-size: 9px; color: var(--muted); border: 1px solid var(--line); padding: 3px 6px; border-radius: 3px; white-space: nowrap; }
.detail-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(97, 232, 255, 0.2) transparent; }
.detail-content { padding: 13px 14px 14px; }
.detail-empty { padding: 7px 2px 12px; }
.empty-orbit { position: relative; width: 108px; height: 108px; margin: 8px auto 18px; }
.empty-orbit span { position: absolute; inset: 8px; border: 1px solid rgba(97, 232, 255, 0.2); border-radius: 50%; animation: reticleSpin 18s linear infinite; }
.empty-orbit span::before { content: ""; position: absolute; left: 50%; top: -3px; width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.empty-orbit i { position: absolute; inset: 25px; border: 1px solid rgba(154, 131, 255, 0.25); border-radius: 50%; }
.empty-orbit b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--mono); font-size: 8px; letter-spacing: 0.18em; color: var(--cyan-2); }
.detail-empty h3 { margin: 5px 0 6px; font-size: 17px; font-weight: 450; letter-spacing: 0.05em; }
.detail-empty > p { margin: 0 0 12px; font-size: 11px; line-height: 1.75; color: var(--muted); }
.empty-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: 14px 0; }
.empty-stats div { border: 1px solid var(--line-soft); border-radius: 4px; padding: 8px 6px; text-align: center; background: rgba(8, 22, 39, 0.4); }
.empty-stats strong { display: block; font-family: var(--mono); font-size: 18px; font-weight: 300; color: var(--silver); }
.empty-stats span { font-size: 8px; color: var(--muted-2); }
.empty-note { font-family: var(--mono); font-size: 8px; letter-spacing: 0.06em; color: var(--muted-2); text-align: center; }

.detail-hero { padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.detail-hero-top { display: flex; align-items: center; gap: 7px; }
.detail-no { font-family: var(--mono); font-size: 9px; color: var(--cyan); border: 1px solid rgba(97, 232, 255, 0.24); border-radius: 2px; padding: 2px 4px; }
.detail-group { font-family: var(--mono); font-size: 7px; letter-spacing: 0.07em; color: var(--accent); border-left: 1px solid var(--accent); padding-left: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail-state { margin-left: auto; font-family: var(--mono); font-size: 6.5px; letter-spacing: 0.08em; color: var(--green); }
.detail-state.is-hidden { color: var(--red); }
.detail-hero h3 { margin: 11px 0 1px; font-size: 22px; font-weight: 350; letter-spacing: 0.04em; color: #eef7ff; }
.detail-en { margin: 0 0 9px; font-family: var(--mono); font-size: 7.5px; letter-spacing: 0.13em; color: var(--muted-2); }
.detail-desc { margin: 0 0 10px; font-size: 10.5px; line-height: 1.78; color: var(--text-2); }
.detail-tags { display: flex; flex-wrap: wrap; gap: 3px; }
.detail-tags span { font-family: var(--mono); font-size: 6.5px; letter-spacing: 0.05em; color: var(--muted); border: 1px solid var(--line-soft); border-radius: 2px; padding: 2px 4px; }

.detail-block { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.detail-block:last-child { border-bottom: 0; padding-bottom: 3px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.block-head span { font-family: var(--mono); font-size: 7px; letter-spacing: 0.1em; color: var(--muted-2); }
.block-head b { font-family: var(--mono); font-size: 7px; font-weight: 400; letter-spacing: 0.04em; color: var(--cyan-2); text-align: right; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-progress { height: 3px; background: rgba(97, 232, 255, 0.1); border-radius: 4px; overflow: hidden; }
.detail-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan-2), var(--cyan)); box-shadow: 0 0 12px rgba(97, 232, 255, 0.45); transition: width 0.12s linear; }
.detail-progress-meta { display: flex; justify-content: space-between; margin-top: 5px; font-family: var(--mono); font-size: 7px; color: var(--muted-2); }
.detail-progress-meta span:first-child { color: var(--cyan); }
.detail-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; margin-top: 9px; }
.detail-actions button { border: 1px solid var(--line); background: rgba(9, 27, 46, 0.65); color: var(--text-2); border-radius: 3px; padding: 5px 2px; font-size: 8px; cursor: pointer; transition: all 0.17s ease; }
.detail-actions button:hover { color: var(--cyan); border-color: rgba(97, 232, 255, 0.4); background: rgba(97, 232, 255, 0.07); }
.spec-list { margin: 0; display: grid; gap: 0; }
.spec-list > div { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 7px; padding: 4px 0; border-bottom: 1px dotted rgba(110, 132, 156, 0.12); }
.spec-list > div:last-child { border-bottom: 0; }
.spec-list dt { margin: 0; font-size: 9px; color: var(--muted); }
.spec-list dd { margin: 0; font-family: var(--mono); font-size: 8px; line-height: 1.55; color: var(--text-2); word-break: break-word; }
.material-card { display: flex; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.material-card:last-child { border-bottom: 0; }
.mat-swatch { width: 35px; height: 35px; flex: 0 0 auto; border-radius: 4px; border: 1px solid rgba(220, 240, 255, 0.13); box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.4), 0 0 10px color-mix(in srgb, var(--sw) 20%, transparent); }
.mat-copy { min-width: 0; }
.mat-copy b { display: block; font-size: 9px; font-weight: 450; color: var(--text); }
.mat-copy small { display: block; font-family: var(--mono); font-size: 6px; letter-spacing: 0.07em; color: var(--muted-2); }
.mat-copy p { margin: 4px 0 3px; font-size: 8.5px; line-height: 1.6; color: var(--muted); }
.mat-metrics { display: flex; gap: 8px; font-family: var(--mono); font-size: 6px; letter-spacing: 0.04em; color: var(--muted-2); }
.detail-note { margin: 0; font-size: 9.5px; line-height: 1.8; color: var(--muted); }
.system-strip { display: grid; grid-template-columns: repeat(3, 1fr); flex: 0 0 auto; border-top: 1px solid var(--line-soft); }
.system-strip div { padding: 8px 9px; border-right: 1px solid var(--line-soft); }
.system-strip div:last-child { border-right: 0; }
.system-strip span { display: block; font-family: var(--mono); font-size: 6px; letter-spacing: 0.08em; color: var(--muted-2); }
.system-strip strong { display: block; margin-top: 2px; font-family: var(--mono); font-size: 8px; font-weight: 400; color: var(--text-2); white-space: nowrap; }

/* -------------------------------------------------------------------------
   CONTROL BAR
   ------------------------------------------------------------------------- */

.controlbar {
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr) 228px;
  align-items: center;
  gap: 18px;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(4, 11, 21, 0.98), rgba(3, 8, 15, 0.94));
  box-shadow: 0 -18px 60px rgba(0, 0, 0, 0.36);
  position: relative;
  z-index: 40;
}
.control-state { min-width: 0; }
.control-state-line { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 4px; }
.control-state-line strong { font-size: 12px; font-weight: 400; letter-spacing: 0.06em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.control-state-line span { font-family: var(--mono); font-size: 13px; color: var(--cyan); letter-spacing: 0.04em; }
.control-meter { height: 2px; margin-top: 6px; background: rgba(97, 232, 255, 0.12); overflow: hidden; }
.control-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan-2), var(--cyan), var(--violet)); box-shadow: 0 0 12px rgba(97, 232, 255, 0.45); transition: width 0.12s linear; }

.transport { min-width: 0; }
.transport-buttons { display: flex; gap: 4px; }
.transport-btn { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: rgba(9, 25, 43, 0.68); color: var(--text-2); border-radius: 5px; padding: 7px 10px; cursor: pointer; transition: all 0.18s ease; white-space: nowrap; }
.transport-btn em { font-style: normal; font-size: 10px; }
.transport-btn:hover { color: var(--text); border-color: rgba(97, 232, 255, 0.34); background: rgba(97, 232, 255, 0.06); }
.transport-btn.is-active { color: #04121c; background: linear-gradient(135deg, #6de8ff, #38b9df); border-color: var(--cyan); }
.transport-btn.is-active .trans-ico { border-color: #04121c; }
.transport-btn.is-active .ico-play { border-left-color: #04121c; }
.transport-btn.is-active .ico-reverse { border-right-color: #04121c; }
.trans-ico { width: 11px; height: 11px; display: inline-block; position: relative; flex: 0 0 auto; }
.ico-play { width: 0; height: 0; border-left: 8px solid var(--cyan); border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.ico-pause::before, .ico-pause::after { content: ""; position: absolute; top: 0; width: 3px; height: 11px; background: currentColor; }
.ico-pause::before { left: 0; }
.ico-pause::after { right: 0; }
.ico-reverse { width: 0; height: 0; border-right: 8px solid var(--cyan); border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.ico-assemble::before { content: ""; position: absolute; inset: 1px; border: 1px solid currentColor; border-radius: 3px; border-right-color: transparent; border-bottom-color: transparent; transform: rotate(45deg); }
.ico-assemble::after { content: ""; position: absolute; left: 4px; top: 4px; width: 3px; height: 3px; background: currentColor; }
.scrub-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.scrub-row > span { font-family: var(--mono); font-size: 7px; color: var(--muted-2); }
.scrub { position: relative; flex: 1 1 auto; height: 18px; border-radius: 4px; background: rgba(97, 232, 255, 0.07); border: 1px solid rgba(97, 232, 255, 0.1); }
.scrub input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; appearance: none; background: transparent; cursor: pointer; z-index: 3; }
.scrub input::-webkit-slider-thumb { appearance: none; width: 9px; height: 18px; border-radius: 2px; background: var(--amber); box-shadow: 0 0 12px rgba(255, 193, 100, 0.55); border: 0; }
.scrub input::-moz-range-thumb { width: 9px; height: 18px; border: 0; border-radius: 2px; background: var(--amber); box-shadow: 0 0 12px rgba(255, 193, 100, 0.55); }
.scrub input::-webkit-slider-runnable-track { height: 18px; background: transparent; }
.scrub input::-moz-range-track { height: 18px; background: transparent; }
.scrub > i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, rgba(46, 184, 223, 0.4), rgba(97, 232, 255, 0.3)); z-index: 1; pointer-events: none; }
.scrub-marks { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.scrub-marks span { position: absolute; top: 1px; font-family: var(--mono); font-size: 6px; color: rgba(220, 238, 250, 0.28); }
.scrub-marks span:nth-child(1) { left: 25%; }
.scrub-marks span:nth-child(2) { left: 50%; }
.scrub-marks span:nth-child(3) { left: 75%; }

.control-extra { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
.speed-row { display: flex; align-items: center; gap: 8px; }
.speed-row > span { font-family: var(--mono); font-size: 7px; letter-spacing: 0.08em; color: var(--muted-2); }
#speedButtons { display: flex; gap: 2px; border: 1px solid var(--line-soft); border-radius: 3px; padding: 2px; }
#speedButtons button { border: 0; background: transparent; color: var(--muted); padding: 2px 5px; border-radius: 2px; font-family: var(--mono); font-size: 7px; cursor: pointer; }
#speedButtons button.is-active { color: #04121c; background: var(--cyan-2); }
.preset-row { display: flex; gap: 3px; }
.preset-row button { border: 1px solid var(--line-soft); background: rgba(10, 26, 44, 0.55); color: var(--muted); padding: 3px 6px; border-radius: 2px; font-family: var(--mono); font-size: 7px; cursor: pointer; }
.preset-row button:hover { color: var(--cyan); border-color: rgba(97, 232, 255, 0.3); }
.preset-row button.is-active { color: var(--amber); border-color: rgba(255, 193, 100, 0.38); background: rgba(255, 193, 100, 0.07); }

/* -------------------------------------------------------------------------
   MODAL / TOAST / SCRIM
   ------------------------------------------------------------------------- */

.drawer-scrim { display: none; position: fixed; inset: 0; z-index: 70; background: rgba(1, 5, 10, 0.7); backdrop-filter: blur(3px); opacity: 0; transition: opacity 0.22s ease; }
.drawer-scrim.is-open { display: block; opacity: 1; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--control-h) + 18px);
  z-index: 90;
  transform: translate(-50%, 12px);
  padding: 9px 15px;
  border: 1px solid rgba(97, 232, 255, 0.3);
  border-left: 2px solid var(--cyan);
  border-radius: 4px;
  background: rgba(4, 14, 25, 0.94);
  color: var(--text);
  font-size: 10px;
  letter-spacing: 0.03em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s ease;
  backdrop-filter: blur(12px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; visibility: hidden; opacity: 0; transition: opacity 0.25s ease, visibility 0.25s ease; }
.modal.is-open { visibility: visible; opacity: 1; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(1, 4, 9, 0.78); backdrop-filter: blur(7px); }
.modal-card { position: relative; width: min(760px, 94vw); max-height: 88vh; overflow-y: auto; padding: 30px 32px 26px; border: 1px solid rgba(97, 232, 255, 0.24); border-radius: 4px; background: linear-gradient(155deg, rgba(8, 21, 38, 0.98), rgba(3, 8, 16, 0.99)); box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7); }
.modal-card::before { content: ""; position: absolute; left: 0; top: 0; width: 40%; height: 1px; background: linear-gradient(90deg, var(--cyan), transparent); }
.modal-card h2 { margin: 7px 0 8px; font-size: 26px; font-weight: 350; letter-spacing: 0.05em; }
.modal-lead { margin: 0 0 20px; color: var(--muted); font-size: 11px; line-height: 1.75; }
.modal-close { position: absolute; right: 13px; top: 11px; border: 0; background: transparent; color: var(--muted); font-size: 24px; cursor: pointer; }
.modal-close:hover { color: var(--cyan); }
.guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.guide-grid article { position: relative; padding: 14px 14px 12px; border: 1px solid var(--line-soft); border-radius: 4px; background: rgba(10, 26, 44, 0.36); }
.guide-no { font-family: var(--mono); font-size: 8px; color: var(--cyan-2); }
.guide-grid h3 { margin: 6px 0 5px; font-size: 13px; font-weight: 450; }
.guide-grid p { margin: 0; font-size: 10px; line-height: 1.7; color: var(--muted); }
.shortcut-row { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.shortcut-row span { display: flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 7px; color: var(--muted-2); }
kbd { font-family: var(--mono); font-size: 7px; color: var(--text-2); border: 1px solid var(--line); border-bottom-color: rgba(97, 232, 255, 0.3); border-radius: 2px; padding: 1px 4px; background: rgba(10, 26, 44, 0.7); }
.btn-primary { display: inline-flex; align-items: center; gap: 10px; margin-top: 20px; border: 1px solid var(--cyan); background: linear-gradient(135deg, rgba(97, 232, 255, 0.18), rgba(46, 184, 223, 0.08)); color: var(--cyan); padding: 9px 16px; border-radius: 3px; font-size: 11px; letter-spacing: 0.05em; cursor: pointer; }
.btn-primary:hover { background: rgba(97, 232, 255, 0.22); box-shadow: 0 0 26px rgba(97, 232, 255, 0.13); }
.modal-cta span { font-size: 14px; }

/* -------------------------------------------------------------------------
   STATE CLASSES
   ------------------------------------------------------------------------- */

body.section-on .ico-cut,
body.light-on .ico-light { color: var(--cyan); }
body.labels-off .leader-layer { opacity: 0.15; }

/* -------------------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------------------- */

@media (max-width: 1320px) {
  .workspace { grid-template-columns: 278px minmax(0, 1fr) 306px; }
  .header-metrics { display: none; }
  .tool-btn { padding: 7px 6px; }
  .brand-title h1 { font-size: 20px; }
}

@media (max-width: 1120px) {
  .workspace { grid-template-columns: 268px minmax(0, 1fr); }
  .panel-right {
    position: fixed;
    z-index: 80;
    right: 10px; top: calc(var(--topbar-h) + 8px); bottom: calc(var(--control-h) + 8px);
    width: min(340px, 90vw);
    transform: translateX(calc(100% + 20px));
    transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: -20px 0 80px rgba(0, 0, 0, 0.6);
  }
  .panel-right.is-open { transform: translateX(0); }
  .panel-right .drawer-close { display: block; }
  .header-metrics { display: none; }
  .tool-btn em { display: none; }
  .view-switch button { padding: 5px 7px; }
}

@media (max-width: 900px) {
  :root { --topbar-h: 96px; --control-h: 138px; }
  body { font-size: 12px; }
  .app { grid-template-rows: var(--topbar-h) minmax(0, 1fr) var(--control-h); }
  .topbar { flex-wrap: wrap; padding: 6px 10px; gap: 5px 8px; align-items: center; }
  .brand { gap: 9px; flex: 1 1 auto; min-width: 0; }
  .brand-symbol { width: 34px; height: 34px; }
  .brand-symbol::before { inset: 7px; }
  .brand-symbol::after { inset: 14px; }
  .overline { display: none; }
  .brand-title { margin-top: 0; gap: 6px; }
  .brand-title h1 { font-size: 16px; }
  .brand-sub { font-size: 8px; letter-spacing: 0.15em; }
  .brand-version { display: none; }
  .header-actions { order: 2; flex: 1 0 100%; width: 100%; margin-left: 0; gap: 6px; overflow-x: auto; padding-bottom: 1px; scrollbar-width: none; }
  .header-actions::-webkit-scrollbar { display: none; }
  .view-switch { order: 0; max-width: none; flex: 0 0 auto; }
  .view-switch button { font-size: 9px; padding: 4px 6px; }
  .tool-row { order: 1; gap: 0; flex: 0 0 auto; }
  .tool-btn { padding: 5px; }
  .tool-btn em { display: none; }
  .mobile-actions { display: flex; order: 1; margin-left: auto; flex: 0 0 auto; }
  .mobile-btn { padding: 6px 8px; font-size: 10px; }
  .mobile-btn + .mobile-btn { margin-left: 4px; }

  .workspace { grid-template-columns: minmax(0, 1fr); padding: 6px; gap: 6px; }
  .panel-left {
    position: fixed;
    z-index: 80;
    left: 8px; top: calc(var(--topbar-h) + 6px); bottom: calc(var(--control-h) + 6px);
    width: min(330px, 92vw);
    transform: translateX(calc(-100% - 20px));
    transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .panel-left.is-open { transform: translateX(0); }
  .panel-left .drawer-close { display: block; }
  .panel-right { top: calc(var(--topbar-h) + 6px); bottom: calc(var(--control-h) + 6px); right: 8px; width: min(340px, 92vw); }
  .stage-wrap { border-radius: 10px; }
  .stage-hud { top: 9px; left: 10px; }
  .hud-state strong { font-size: 12px; }
  .hud-state span { font-size: 8px; }
  .hud-legend { display: none; }
  .axis-badge { display: none; }
  .zoom-cluster { right: 8px; bottom: 68px; padding: 4px; }
  .zoom-cluster button { width: 22px; height: 22px; }
  .stage-bottom { left: 9px; right: 9px; bottom: 8px; flex-direction: column; align-items: stretch; gap: 5px; }
  .hint-bar { display: none; }
  .selected-strip { align-self: flex-start; max-width: 100%; }
  .strip-spec { max-width: 120px; }
  .part-label { max-width: 142px; padding: 3px 6px; }
  .pl-copy b { font-size: 8px; }
  .pl-copy small { display: none; }
  .reticle-ring { width: 48px; height: 48px; left: -24px; top: -24px; }
  .reticle b { left: 30px; }
  .float-panel { position: absolute; left: 8px !important; right: 8px !important; width: auto; bottom: 62px; max-height: 58vh; overflow-y: auto; }
  .diag-panel { width: auto; }
  .section-panel .mini-btn { margin-bottom: 11px; }
  .corner { display: none; }

  .controlbar { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 6px 8px; padding: 7px 10px 8px; min-width: 0; width: 100%; }
  .control-state { grid-column: 1 / 2; grid-row: 1; min-width: 0; }
  .control-extra { grid-column: 2 / 3; grid-row: 1; flex-direction: row; align-items: center; gap: 7px; }
  .speed-row { display: none; }
  .preset-row button { padding: 2px 5px; font-size: 6.5px; }
  .transport { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
  .transport-buttons { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
  .transport-btn { justify-content: center; padding: 6px 2px; gap: 3px; min-width: 0; }
  .transport-btn em { font-size: 8px; letter-spacing: 0; }
  .scrub-row { margin-top: 5px; gap: 4px; min-width: 0; }
  .scrub-row > span { font-size: 6px; }
  .scrub { min-width: 0; }
  .toast { bottom: calc(var(--control-h) + 12px); width: max-content; max-width: 88vw; text-align: center; }
  .modal-card { padding: 24px 18px 20px; }
  .guide-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  :root { --topbar-h: 94px; --control-h: 134px; }
  .brand-title h1 { font-size: 14px; }
  .brand-sub { font-size: 7px; }
  .mobile-btn { padding: 5px 7px; font-size: 9px; }
  .tool-btn { padding: 4px; }
  .transport-btn em { font-size: 8px; }
  .transport-btn { gap: 2px; }
  .control-state-line strong { font-size: 10px; }
  .control-state-line span { font-size: 11px; }
  .preset-row { display: none; }
  .controlbar { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; }
  .control-extra { display: none; }
  .detail-hero h3 { font-size: 19px; }
  .float-panel { bottom: 56px; }
  .part-label { max-width: 120px; }
  .stage-hud .hud-kicker { font-size: 7px; }
}

@media (max-height: 700px) and (min-width: 901px) {
  .panel-head { padding: 11px 14px 9px; }
  .panel-foot { padding: 7px 12px 9px; }
  .legend { display: none; }
  .part-row { margin: 1px 0; }
  .row-main { padding-top: 4px; padding-bottom: 4px; }
}

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

