/* =========================================================================
   OCEANFORGE — marine biotech AI digital workshop
   Dark, high-end, data-driven interface
   ========================================================================= */

:root {
  --bg: #02070b;
  --bg-deep: #010407;
  --panel: rgba(4, 14, 20, 0.92);
  --panel-strong: rgba(5, 17, 24, 0.91);
  --panel-soft: rgba(8, 24, 32, 0.56);
  --line: rgba(104, 216, 236, 0.14);
  --line-strong: rgba(104, 224, 245, 0.26);
  --text: #e7fbff;
  --text-soft: #b8d4db;
  --muted: #708f9b;
  --muted-dim: #445e68;
  --cyan: #5ceaff;
  --cyan-soft: rgba(92, 234, 255, 0.13);
  --green: #6cf5bd;
  --violet: #a397ff;
  --amber: #ffc46b;
  --red: #ff7182;
  --accent: #5ceaff;
  --font: "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", "SF Mono", "Menlo", "Consolas", monospace;
  --topbar-h: 78px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

button:focus-visible {
  outline: 1px solid var(--cyan);
  outline-offset: 3px;
}

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

.app {
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(ellipse 70% 55% at 50% 30%, rgba(8, 48, 63, 0.32), transparent 68%),
    radial-gradient(ellipse 40% 38% at 76% 62%, rgba(48, 33, 93, 0.12), transparent 72%),
    linear-gradient(180deg, #02080d 0%, #02070b 50%, #010406 100%);
}

.scene-root {
  position: absolute;
  inset: 0;
  z-index: 1;
  touch-action: none;
}

.scene-root canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}

.css2d-layer {
  z-index: 6;
  pointer-events: none;
  overflow: hidden;
}

.scene-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 64% 58% at 50% 45%, transparent 36%, rgba(1, 5, 8, 0.38) 78%, rgba(1, 4, 6, 0.82) 100%),
    linear-gradient(180deg, rgba(1, 5, 8, 0.72) 0%, transparent 14%, transparent 76%, rgba(1, 4, 6, 0.9) 100%);
}

.scene-grain {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.42'/%3E%3C/svg%3E");
  background-size: 220px 220px;
}

/* -------------------------------------------------------------------------
   Glass panels & header
   ------------------------------------------------------------------------- */

.glass {
  background:
    linear-gradient(135deg, rgba(19, 45, 57, 0.26), transparent 38%),
    var(--panel);
  border: 1px solid var(--line);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.44),
    inset 0 1px 0 rgba(190, 245, 255, 0.045);
}

.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 26px;
  background:
    linear-gradient(90deg, rgba(3, 12, 18, 0.94), rgba(3, 12, 18, 0.72) 42%, rgba(3, 12, 18, 0.9));
  border-bottom: 1px solid rgba(100, 220, 240, 0.12);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 26%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0.7;
  animation: header-scan 8s linear infinite;
}

@keyframes header-scan {
  0% { transform: translateX(-30%); opacity: 0; }
  12% { opacity: 0.8; }
  70% { opacity: 0.5; }
  100% { transform: translateX(420%); opacity: 0; }
}

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

.brand-mark {
  width: 46px;
  height: 46px;
  color: var(--cyan);
  filter: drop-shadow(0 0 12px rgba(92, 234, 255, 0.35));
}

.brand-mark svg {
  width: 100%;
  height: 100%;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 19px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #f0fdff;
}

.brand-version {
  padding: 3px 5px 2px;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.06em;
  color: var(--cyan);
  border: 1px solid rgba(92, 234, 255, 0.32);
  background: rgba(92, 234, 255, 0.07);
}

.brand-sub {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: rgba(211, 244, 250, 0.72);
  white-space: nowrap;
}

.brand-sub em {
  font-style: normal;
  font-size: 7px;
  letter-spacing: 0.19em;
  color: var(--muted);
}

.topbar-center {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 34px;
  padding: 0 16px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  min-width: 0;
  flex: 1;
  max-width: 520px;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--green);
}

.status-dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: soft-pulse 2.4s ease-in-out infinite;
}

.status-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid rgba(108, 245, 189, 0.4);
  animation: ring-pulse 2.4s ease-out infinite;
}

@keyframes soft-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes ring-pulse {
  0% { transform: scale(0.6); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}

.status-divider {
  width: 1px;
  height: 14px;
  background: var(--line);
}

.status-note {
  font-size: 9px;
  letter-spacing: 0.07em;
  color: var(--muted);
  white-space: nowrap;
}

.status-note b {
  color: var(--text-soft);
  font-weight: 600;
}

.micro-label {
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.12em;
  color: var(--muted-dim);
}

.topbar-metrics {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
}

.top-metric {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 70px;
}

.top-metric__label {
  font-size: 7.5px;
  letter-spacing: 0.15em;
  color: var(--muted);
  white-space: nowrap;
}

.top-metric b {
  font-family: var(--mono);
  font-size: 17px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: #e9fcff;
}

.top-metric b small {
  margin-left: 2px;
  font-size: 9px;
  color: var(--muted);
}

.top-clock {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-left: 22px;
  border-left: 1px solid var(--line);
}

.top-clock b {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.09em;
  color: var(--cyan);
  text-shadow: 0 0 18px rgba(92, 234, 255, 0.22);
}

.sim-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255, 196, 107, 0.24);
  background: linear-gradient(135deg, rgba(255, 196, 107, 0.09), rgba(255, 196, 107, 0.02));
}

.sim-chip__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 9px var(--amber);
}

.sim-chip span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sim-chip b {
  font-size: 7.5px;
  letter-spacing: 0.17em;
  font-weight: 700;
  color: var(--amber);
}

.sim-chip small {
  font-size: 8.5px;
  letter-spacing: 0.06em;
  color: rgba(255, 219, 165, 0.62);
}

.panel-toggle {
  display: none;
  width: 34px;
  height: 34px;
  padding: 8px;
  border: 1px solid var(--line);
  color: var(--text-soft);
}

.panel-toggle svg {
  width: 100%;
  height: 100%;
}

/* -------------------------------------------------------------------------
   Process navigation
   ------------------------------------------------------------------------- */

.process-rail {
  position: absolute;
  z-index: 20;
  top: calc(var(--topbar-h) + 16px);
  left: 20px;
  bottom: 246px;
  width: 252px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 3px;
}

.rail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 42px;
  padding: 0 15px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
  font-size: 8px;
  letter-spacing: 0.18em;
  color: var(--text-soft);
}

.rail-heading > span:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rail-heading i {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 1px;
  background: var(--cyan);
  box-shadow: 0 0 7px var(--cyan);
}

.rail-heading__count {
  font-family: var(--mono);
  font-size: 7.5px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.station-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 7px 7px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(92, 234, 255, 0.18) transparent;
}

.station-nav::-webkit-scrollbar {
  width: 3px;
}

.station-nav::-webkit-scrollbar-thumb {
  background: rgba(92, 234, 255, 0.18);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 47px;
  padding: 8px 8px 8px 11px;
  text-align: left;
  border: 1px solid transparent;
  border-bottom-color: rgba(104, 216, 236, 0.06);
  transition: background 180ms ease, border-color 180ms ease;
}

.nav-item::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 9px;
  bottom: 9px;
  width: 2px;
  background: var(--item-accent, var(--cyan));
  opacity: 0;
  box-shadow: 0 0 12px var(--item-accent, var(--cyan));
  transition: opacity 180ms ease;
}

.nav-item:hover {
  background: rgba(83, 205, 229, 0.05);
  border-color: rgba(104, 216, 236, 0.1);
}

.nav-item.is-active {
  background: linear-gradient(90deg, color-mix(in srgb, var(--item-accent) 12%, transparent), rgba(10, 27, 35, 0.32));
  border-color: color-mix(in srgb, var(--item-accent) 20%, transparent);
}

.nav-item.is-active::before {
  opacity: 1;
}

.nav-item.is-selected {
  background: linear-gradient(90deg, color-mix(in srgb, var(--item-accent) 18%, transparent), rgba(10, 27, 35, 0.5));
  border-color: color-mix(in srgb, var(--item-accent) 36%, transparent);
}

.nav-index {
  flex-shrink: 0;
  width: 25px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.nav-item.is-active .nav-index,
.nav-item.is-selected .nav-index {
  color: var(--item-accent);
}

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

.nav-copy b {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(226, 249, 253, 0.84);
}

.nav-copy em {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-style: normal;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.07em;
  color: var(--muted-dim);
}

.nav-item.is-active .nav-copy b,
.nav-item.is-selected .nav-copy b {
  color: #f2feff;
}

.nav-state {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.08em;
  color: var(--muted-dim);
}

.nav-state i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.nav-item.is-done .nav-state {
  color: rgba(108, 245, 189, 0.7);
}

.nav-item.is-active .nav-state {
  color: var(--item-accent);
}

.nav-item.is-active .nav-state i {
  box-shadow: 0 0 7px var(--item-accent);
  animation: soft-pulse 1.5s ease-in-out infinite;
}

.rail-summary {
  flex-shrink: 0;
  padding: 13px 15px 14px;
  border-top: 1px solid var(--line);
  background: rgba(3, 12, 17, 0.42);
}

.rail-summary__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.rail-summary__top b {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--cyan);
}

.progress-track {
  position: relative;
  height: 2px;
  margin: 10px 0 10px;
  background: rgba(90, 170, 190, 0.14);
}

.progress-track > span {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, #249ab6, var(--cyan));
  box-shadow: 0 0 12px rgba(92, 234, 255, 0.4);
  transition: width 600ms linear;
}

.progress-glow {
  position: absolute;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d7feff;
  box-shadow: 0 0 9px 2px var(--cyan);
  transform: translate(-50%, -50%);
  transition: left 600ms linear;
}

.rail-summary__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 7.5px;
  letter-spacing: 0.06em;
  color: var(--muted-dim);
}

.rail-summary__meta span:first-child {
  display: flex;
  align-items: center;
  gap: 5px;
}

.dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

.dot--green { background: var(--green); box-shadow: 0 0 5px var(--green); }
.dot--cyan { background: var(--cyan); box-shadow: 0 0 5px var(--cyan); }
.dot--amber { background: var(--amber); box-shadow: 0 0 5px var(--amber); }

/* -------------------------------------------------------------------------
   Detail panel
   ------------------------------------------------------------------------- */

.detail-panel {
  position: absolute;
  z-index: 22;
  top: calc(var(--topbar-h) + 16px);
  right: 20px;
  bottom: 23px;
  width: 382px;
  overflow: hidden;
  border-radius: 3px;
  transition: opacity 260ms ease;
}

.detail-panel.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.panel-content {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(92, 234, 255, 0.2) transparent;
}

.panel-content::-webkit-scrollbar {
  width: 4px;
}

.panel-content::-webkit-scrollbar-thumb {
  background: rgba(92, 234, 255, 0.2);
}

.panel-toolbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 38px;
  padding: 0 13px;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 14, 20, 0.94);
}

.panel-toolbar__back,
.panel-toolbar__close {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--muted);
  transition: color 160ms ease;
}

.panel-toolbar__back:hover,
.panel-toolbar__close:hover {
  color: var(--cyan);
}

.panel-toolbar__back svg,
.panel-toolbar__close svg {
  width: 12px;
  height: 12px;
}

.panel-toolbar__label {
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.16em;
  color: var(--muted-dim);
}

.panel-body {
  padding: 16px 17px 24px;
}

.panel-eyebrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 11px;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.15em;
  color: var(--muted);
}

.panel-eyebrow span:first-child {
  display: flex;
  align-items: center;
  gap: 7px;
}

.panel-eyebrow i {
  width: 4px;
  height: 4px;
  background: var(--accent);
  box-shadow: 0 0 7px var(--accent);
}

.panel-eyebrow b {
  font-weight: 600;
  color: var(--accent);
}

.detail-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #f0fdff;
}

.detail-en {
  margin: 6px 0 0;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.17em;
  color: var(--muted);
}

.detail-tagline {
  margin: 12px 0 0;
  padding-left: 10px;
  border-left: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  font-size: 10px;
  line-height: 1.65;
  letter-spacing: 0.02em;
  color: rgba(197, 230, 238, 0.7);
}

.detail-status {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin: 14px 0 0;
}

.status-pill,
.detail-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 23%, transparent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.09em;
  color: color-mix(in srgb, var(--accent) 80%, white);
}

.status-pill i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: soft-pulse 1.8s ease-in-out infinite;
}

.detail-chip {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.018);
  color: var(--muted);
}

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 16px;
}

.kpi-card {
  position: relative;
  min-height: 68px;
  padding: 10px 11px;
  border: 1px solid rgba(104, 216, 236, 0.09);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 5%, transparent), transparent 70%),
    rgba(6, 20, 27, 0.62);
  overflow: hidden;
}

.kpi-card::after {
  content: "";
  position: absolute;
  right: -15px;
  top: -15px;
  width: 40px;
  height: 40px;
  border: 1px solid color-mix(in srgb, var(--accent) 10%, transparent);
  transform: rotate(45deg);
}

.kpi-card__label {
  display: block;
  margin-bottom: 8px;
  font-size: 8px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.kpi-card__value {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-family: var(--mono);
  font-size: 20px;
  line-height: 1;
  font-weight: 500;
  color: #eefeff;
  white-space: nowrap;
}

.kpi-card__value small {
  font-family: var(--font);
  font-size: 8px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.section-block {
  margin-top: 19px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}

.section-head h3 {
  margin: 0;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.09em;
  color: var(--text-soft);
}

.section-head em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.14em;
  color: var(--muted-dim);
}

.section-head__sim {
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.1em;
  color: rgba(255, 196, 107, 0.5);
}

.process-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: process;
}

.process-step {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 9px;
  padding: 0 0 15px;
}

.process-step:last-child {
  padding-bottom: 0;
}

.process-step::before {
  counter-increment: process;
  content: "0" counter(process);
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: start;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  background: rgba(4, 14, 20, 0.9);
  font-family: var(--mono);
  font-size: 7px;
  color: color-mix(in srgb, var(--accent) 75%, white);
}

.process-step::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 22px;
  bottom: 2px;
  width: 1px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 28%, transparent), rgba(104, 216, 236, 0.04));
}

.process-step:last-child::after {
  display: none;
}

.process-step h4 {
  margin: 0;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: rgba(225, 249, 253, 0.82);
}

.process-step p {
  margin: 4px 0 0;
  font-size: 8.5px;
  line-height: 1.65;
  color: rgba(158, 196, 207, 0.6);
}

.telemetry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  border: 1px solid rgba(104, 216, 236, 0.09);
  background: rgba(104, 216, 236, 0.09);
}

.telemetry-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 10px;
  background: rgba(5, 17, 23, 0.94);
}

.telemetry-cell span {
  font-size: 7.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.telemetry-cell b {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--accent);
}

.telemetry-cell b small {
  margin-left: 2px;
  font-size: 7.5px;
  color: var(--muted);
}

.spark-wrap {
  position: relative;
  height: 82px;
  padding: 8px 9px 4px;
  border: 1px solid rgba(104, 216, 236, 0.09);
  background:
    linear-gradient(180deg, rgba(92, 234, 255, 0.025), transparent),
    repeating-linear-gradient(0deg, transparent 0, transparent 19px, rgba(104, 216, 236, 0.04) 20px);
}

.spark-wrap::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 32px;
  border-top: 1px dashed rgba(255, 196, 107, 0.16);
}

.spark-wrap svg {
  width: 100%;
  height: 56px;
  overflow: visible;
}

.spark-wrap .spark-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--accent) 45%, transparent));
  stroke-dasharray: 260;
  stroke-dashoffset: 260;
  animation: draw-line 2.8s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

@keyframes draw-line {
  to { stroke-dashoffset: 0; }
}

.spark-legend {
  position: absolute;
  right: 10px;
  top: 7px;
  display: flex;
  gap: 10px;
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.08em;
  color: var(--muted-dim);
}

.spark-legend span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.spark-legend i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
}

.equipment-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.equipment-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid rgba(104, 216, 236, 0.1);
  background: rgba(8, 24, 31, 0.58);
  font-size: 7.5px;
  letter-spacing: 0.03em;
  color: rgba(177, 218, 227, 0.62);
}

.equipment-chip i {
  width: 3px;
  height: 3px;
  background: var(--accent);
}

.sim-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 18px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 196, 107, 0.15);
  background: rgba(255, 196, 107, 0.035);
  font-size: 7.5px;
  line-height: 1.6;
  letter-spacing: 0.03em;
  color: rgba(255, 217, 161, 0.55);
}

.sim-note b {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 6.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--amber);
}

/* Overview panel */

.overview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.overview-title {
  margin: 0;
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #effdff;
}

.overview-title small {
  display: block;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 400;
  letter-spacing: 0.17em;
  color: var(--muted);
}

.overview-live {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.12em;
  color: var(--green);
}

.overview-batch {
  display: grid;
  grid-template-columns: 126px 1fr;
  gap: 15px;
  align-items: center;
  margin-top: 18px;
  padding: 14px 12px;
  border: 1px solid rgba(104, 216, 236, 0.11);
  background:
    radial-gradient(circle at 25% 50%, rgba(56, 194, 220, 0.07), transparent 55%),
    rgba(5, 17, 23, 0.5);
}

.progress-orbit {
  position: relative;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: conic-gradient(from -90deg, var(--cyan) calc(var(--p) * 1%), rgba(83, 180, 199, 0.1) 0);
  box-shadow: 0 0 30px rgba(92, 234, 255, 0.08);
}

.progress-orbit::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #06151c;
}

.progress-orbit::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px dashed rgba(92, 234, 255, 0.15);
  animation: orbit-spin 28s linear infinite;
}

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

.progress-orbit__value {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.progress-orbit__value b {
  font-family: var(--mono);
  font-size: 26px;
  line-height: 1;
  font-weight: 500;
  color: #eafcff;
}

.progress-orbit__value b small {
  font-size: 9px;
  color: var(--muted);
}

.progress-orbit__value span {
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.batch-info {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.batch-info__label {
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.16em;
  color: var(--muted-dim);
}

.batch-info__id {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.03em;
  color: var(--cyan);
}

.batch-info__product {
  font-size: 10px;
  letter-spacing: 0.04em;
  color: rgba(229, 250, 253, 0.88);
}

.batch-info__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.batch-info__meta span {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 7px;
  color: var(--muted);
}

.batch-info__meta b {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  color: var(--text-soft);
}

.overview-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 13px;
}

.overview-kpi {
  padding: 9px 10px;
  border: 1px solid rgba(104, 216, 236, 0.08);
  background: rgba(5, 17, 23, 0.46);
}

.overview-kpi span {
  display: block;
  margin-bottom: 6px;
  font-size: 7.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.overview-kpi b {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 500;
  color: #e9fcff;
}

.overview-kpi b small {
  margin-left: 2px;
  font-family: var(--font);
  font-size: 7px;
  color: var(--muted);
}

.station-matrix {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.matrix-cell {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 48px;
  padding: 7px 7px;
  text-align: left;
  border: 1px solid rgba(104, 216, 236, 0.08);
  background: rgba(5, 17, 23, 0.5);
  transition: border-color 160ms ease, background 160ms ease;
}

.matrix-cell:hover {
  border-color: color-mix(in srgb, var(--cell-accent) 42%, transparent);
  background: color-mix(in srgb, var(--cell-accent) 6%, rgba(5, 17, 23, 0.5));
}

.matrix-cell__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 6px;
  color: var(--muted-dim);
}

.matrix-cell__top i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cell-accent);
  opacity: 0.5;
}

.matrix-cell.is-active .matrix-cell__top i {
  opacity: 1;
  box-shadow: 0 0 6px var(--cell-accent);
}

.matrix-cell b {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(219, 246, 252, 0.75);
}

.matrix-cell.is-active {
  border-color: color-mix(in srgb, var(--cell-accent) 28%, transparent);
}

.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.alert-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 7px 8px;
  border-left: 1px solid var(--line-strong);
  background: rgba(8, 24, 31, 0.35);
  font-size: 7.5px;
  line-height: 1.5;
  color: rgba(169, 209, 218, 0.62);
}

.alert-row i {
  width: 3px;
  height: 3px;
  margin-top: 5px;
  flex-shrink: 0;
  background: var(--green);
}

.alert-row em {
  margin-left: auto;
  flex-shrink: 0;
  font-style: normal;
  font-family: var(--mono);
  font-size: 6px;
  color: var(--muted-dim);
}

.overview-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 15px;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.07em;
  color: var(--muted-dim);
}

/* -------------------------------------------------------------------------
   Panel reopen control
   ------------------------------------------------------------------------- */

.panel-reopen {
  position: absolute;
  z-index: 21;
  top: calc(var(--topbar-h) + 16px);
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 126px;
  height: 38px;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.12em;
  color: var(--text-soft);
  opacity: 0;
  transform: translateX(10px);
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
}

.panel-reopen svg {
  width: 15px;
  height: 15px;
  color: var(--cyan);
}

body.panel-hidden .panel-reopen {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.panel-reopen:hover {
  border-color: var(--line-strong);
  color: var(--cyan);
}

/* -------------------------------------------------------------------------
   Station labels over the 3D scene
   ------------------------------------------------------------------------- */

.station-label {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 136px;
  max-width: 176px;
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, rgba(255, 255, 255, 0.04));
  background: linear-gradient(135deg, rgba(7, 22, 29, 0.94), rgba(3, 12, 17, 0.9));
  box-shadow: 0 7px 24px rgba(0, 0, 0, 0.32);
  pointer-events: auto;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.station-label::after {
  content: "";
  position: absolute;
  left: 18px;
  top: 100%;
  width: 1px;
  height: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 45%, transparent), transparent);
}

.station-label:hover {
  border-color: color-mix(in srgb, var(--accent) 52%, transparent);
  background: linear-gradient(135deg, rgba(12, 37, 47, 0.95), rgba(4, 16, 22, 0.88));
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 12%, transparent), 0 8px 26px rgba(0, 0, 0, 0.4);
}

.station-label.is-active {
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
}

.station-label.is-selected {
  border-color: color-mix(in srgb, var(--accent) 78%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 15%, rgba(8, 27, 35, 0.94)), rgba(4, 16, 22, 0.92));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent), 0 0 30px color-mix(in srgb, var(--accent) 16%, transparent);
}

.station-label__index {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: color-mix(in srgb, var(--accent) 85%, white);
}

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

.station-label__name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(232, 251, 255, 0.9);
}

.station-label__en {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: var(--mono);
  font-size: 5.5px;
  letter-spacing: 0.08em;
  color: var(--muted-dim);
}

.station-label__status {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  flex-shrink: 0;
  align-self: flex-start;
  padding-top: 1px;
  font-family: var(--mono);
  font-size: 5.5px;
  letter-spacing: 0.04em;
  color: var(--muted-dim);
}

.station-label__status i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.45;
}

.station-label.is-active .station-label__status {
  color: var(--accent);
}

.station-label.is-active .station-label__status i {
  opacity: 1;
  box-shadow: 0 0 6px var(--accent);
  animation: soft-pulse 1.5s ease-in-out infinite;
}

.core-label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px 5px 7px;
  border: 1px solid rgba(92, 234, 255, 0.18);
  background: rgba(3, 14, 20, 0.72);
  pointer-events: auto;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease;
}

.core-label:hover,
.core-label.is-selected {
  border-color: rgba(92, 234, 255, 0.4);
  background: rgba(7, 28, 36, 0.84);
}

.core-label__pulse {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 9px var(--cyan);
  animation: soft-pulse 2s ease-in-out infinite;
}

.core-label__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: left;
}

.core-label__text b {
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--cyan);
}

.core-label__text em {
  font-style: normal;
  font-size: 5.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* -------------------------------------------------------------------------
   Event feed & bottom HUD
   ------------------------------------------------------------------------- */

.telemetry-feed {
  position: absolute;
  z-index: 18;
  left: 20px;
  bottom: 101px;
  width: 304px;
  padding: 9px 11px 8px;
  border-radius: 2px;
  pointer-events: none;
}

.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(104, 216, 236, 0.09);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.13em;
  color: var(--muted);
}

.feed-header > span:first-child {
  display: flex;
  align-items: center;
  gap: 6px;
}

.feed-header i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 5px var(--green);
}

.feed-sim {
  color: rgba(255, 196, 107, 0.5);
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 82px;
  overflow: hidden;
}

.feed-item {
  display: grid;
  grid-template-columns: 42px 10px 1fr;
  gap: 4px;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid rgba(104, 216, 236, 0.035);
  font-size: 7px;
  line-height: 1.45;
  color: rgba(161, 204, 214, 0.65);
  animation: feed-in 420ms ease both;
}

.feed-item:last-child {
  border-bottom: 0;
}

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

.feed-time {
  font-family: var(--mono);
  font-size: 6px;
  color: var(--muted-dim);
}

.feed-code {
  font-family: var(--mono);
  font-size: 6px;
  color: var(--cyan);
}

.feed-item[data-type="ai"] .feed-code { color: var(--violet); }
.feed-item[data-type="warn"] .feed-code { color: var(--amber); }
.feed-item[data-type="ok"] .feed-code { color: var(--green); }

.feed-text {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.bottom-hud {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 28;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}

.control-dock {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 48px;
  padding: 5px 7px;
  border-radius: 3px;
  pointer-events: auto;
  background:
    linear-gradient(180deg, rgba(12, 34, 44, 0.76), rgba(4, 15, 21, 0.92));
}

.dock-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid transparent;
  color: rgba(178, 218, 226, 0.65);
  font-size: 8px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.dock-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.dock-btn:hover {
  color: var(--cyan);
  background: rgba(92, 234, 255, 0.055);
  border-color: rgba(92, 234, 255, 0.12);
}

.dock-btn.is-active {
  color: var(--cyan);
  background: rgba(92, 234, 255, 0.07);
  border-color: rgba(92, 234, 255, 0.15);
}

.dock-btn--primary {
  color: #031217;
  background: linear-gradient(135deg, #8af3ff, #4bddff);
  border-color: transparent;
  font-weight: 600;
}

.dock-btn--primary:hover {
  color: #031217;
  background: linear-gradient(135deg, #b4f8ff, #6ce8ff);
  border-color: transparent;
}

.dock-btn--primary .icon-play { display: none; }
body.is-paused .dock-btn--primary .icon-pause { display: none; }
body.is-paused .dock-btn--primary .icon-play { display: block; }
body.is-paused .dock-btn--primary {
  color: var(--amber);
  background: rgba(255, 196, 107, 0.08);
  border-color: rgba(255, 196, 107, 0.2);
}

.dock-btn--icon {
  width: 34px;
  padding: 0;
  justify-content: center;
}

.dock-sep {
  width: 1px;
  height: 22px;
  margin: 0 3px;
  background: var(--line);
}

.dock-caption {
  display: flex;
  align-items: center;
  gap: 15px;
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.05em;
  color: rgba(109, 150, 162, 0.56);
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.dock-caption > span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.dock-caption__sim {
  color: rgba(255, 196, 107, 0.44);
}

/* -------------------------------------------------------------------------
   Tooltip, toast, loading
   ------------------------------------------------------------------------- */

.tooltip {
  position: fixed;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 190px;
  padding: 8px 10px;
  border: 1px solid rgba(92, 234, 255, 0.28);
  background: rgba(3, 15, 21, 0.94);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5), 0 0 20px rgba(92, 234, 255, 0.06);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.tooltip__code {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(92, 234, 255, 0.22);
  font-family: var(--mono);
  font-size: 9px;
  color: var(--cyan);
}

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

.tooltip__copy b {
  font-size: 9px;
  font-weight: 500;
  color: #eafcff;
}

.tooltip__copy em {
  font-style: normal;
  font-size: 7px;
  color: var(--muted);
}

.tooltip__cue {
  margin-left: auto;
  padding-left: 10px;
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.08em;
  color: var(--cyan);
  opacity: 0.7;
}

.toast {
  position: fixed;
  z-index: 80;
  top: calc(var(--topbar-h) + 18px);
  left: 50%;
  padding: 8px 16px;
  border: 1px solid rgba(92, 234, 255, 0.22);
  background: rgba(4, 16, 22, 0.94);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  opacity: 0;
  transform: translate(-50%, -8px);
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
}

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

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 44%, rgba(13, 57, 72, 0.45), transparent 38%),
    #02070b;
  transition: opacity 700ms ease, visibility 700ms ease;
}

.loading-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(92, 234, 255, 0.018) 4px);
}

.loading-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.loading-orbit {
  position: relative;
  width: 148px;
  height: 148px;
  margin-bottom: 20px;
}

.loading-orbit > span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(92, 234, 255, 0.14);
}

.loading-orbit > span:nth-child(1) {
  animation: orbit-spin 9s linear infinite;
  border-top-color: rgba(92, 234, 255, 0.8);
}

.loading-orbit > span:nth-child(2) {
  inset: 14px;
  animation: orbit-spin 6s linear infinite reverse;
  border-right-color: rgba(108, 245, 189, 0.7);
}

.loading-orbit > span:nth-child(3) {
  inset: 28px;
  border-style: dashed;
  animation: orbit-spin 16s linear infinite;
}

.loading-mark {
  position: absolute;
  inset: 42px;
  color: var(--cyan);
  filter: drop-shadow(0 0 16px rgba(92, 234, 255, 0.4));
}

.loading-mark svg {
  width: 100%;
  height: 100%;
}

.loading-brand {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.32em;
  color: #eefeff;
  text-indent: 0.32em;
}

.loading-title {
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: 0.17em;
  color: rgba(198, 239, 246, 0.7);
}

.loading-sub {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.17em;
  color: var(--muted-dim);
}

.loading-bar {
  width: 260px;
  height: 1px;
  margin-top: 24px;
  overflow: hidden;
  background: rgba(92, 234, 255, 0.1);
}

.loading-bar span {
  display: block;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  animation: loading-sweep 1.6s ease-in-out infinite;
}

@keyframes loading-sweep {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(350%); }
}

.loading-meta {
  display: flex;
  justify-content: space-between;
  width: 260px;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.08em;
  color: var(--muted-dim);
}

.loading-error {
  max-width: 420px;
  margin-top: 20px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 113, 130, 0.3);
  background: rgba(255, 113, 130, 0.06);
  font-size: 10px;
  line-height: 1.6;
  color: #ffb5be;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #02070b;
  color: #ffb5be;
  font-size: 14px;
}

body.is-paused .status-dot {
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
  animation: none;
}

body.is-paused .system-status {
  color: var(--amber);
}

body.is-paused .topbar::after {
  animation-play-state: paused;
}

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */

@media (max-width: 1500px) {
  .topbar-center {
    gap: 11px;
    padding: 0 12px;
  }
  .status-note:nth-of-type(2) {
    display: none;
  }
  .topbar-metrics {
    gap: 17px;
  }
  .detail-panel {
    width: 358px;
  }
}

@media (max-width: 1280px) {
  .topbar-center {
    display: none;
  }
  .telemetry-feed {
    display: none;
  }
  .process-rail {
    bottom: 104px;
  }
}

@media (max-width: 1100px) {
  :root { --topbar-h: 70px; }
  .topbar {
    gap: 14px;
    padding: 0 16px;
  }
  .brand {
    min-width: 0;
  }
  .brand-sub em {
    display: none;
  }
  .topbar-metrics {
    gap: 13px;
  }
  .top-metric {
    min-width: 55px;
  }
  .sim-chip {
    display: none;
  }
  .process-rail {
    left: 12px;
    width: 228px;
  }
  .detail-panel {
    right: 12px;
    width: 340px;
  }
  .dock-btn span {
    display: none;
  }
  .dock-btn {
    width: 36px;
    padding: 0;
    justify-content: center;
  }
  .dock-btn--primary {
    width: auto;
    padding: 0 12px;
  }
  .dock-btn--primary span {
    display: inline;
  }
}

@media (max-width: 880px) {
  :root { --topbar-h: 62px; }
  .brand-mark {
    width: 36px;
    height: 36px;
  }
  .brand-title {
    font-size: 15px;
  }
  .brand-sub {
    font-size: 8.5px;
  }
  .top-metric {
    display: none;
  }
  .top-clock {
    padding-left: 0;
    border-left: 0;
  }
  .process-rail {
    top: calc(var(--topbar-h) + 10px);
    left: 10px;
    bottom: 94px;
    width: 216px;
    transform: translateX(calc(-100% - 18px));
    transition: transform 260ms cubic-bezier(0.2, 0.7, 0.3, 1);
    opacity: 0.98;
  }
  .process-rail.is-mobile-open {
    transform: translateX(0);
  }
  .panel-toggle {
    display: block;
    margin-left: auto;
    flex-shrink: 0;
  }
  .topbar-metrics {
    margin-left: auto;
  }
  .panel-reopen {
    display: none;
  }
  .detail-panel {
    top: auto;
    bottom: 84px;
    right: 10px;
    left: 10px;
    width: auto;
    max-height: 54vh;
    transform: translateY(calc(100% + 100px));
    transition: transform 320ms cubic-bezier(0.2, 0.7, 0.3, 1), opacity 240ms ease;
    opacity: 0;
    pointer-events: none;
  }
  .detail-panel.is-mobile-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .detail-panel.is-hidden {
    opacity: 0;
    pointer-events: none;
  }
  .bottom-hud {
    bottom: 10px;
  }
  .dock-caption {
    display: none;
  }
  .station-label {
    min-width: 100px;
    max-width: 126px;
    padding: 4px 6px;
    gap: 5px;
  }
  .station-label__name {
    font-size: 7.5px;
  }
  .station-label__en {
    display: none;
  }
  .station-label__status {
    display: none;
  }
  .core-label__text em {
    display: none;
  }
}

@media (max-width: 600px) {
  .topbar {
    padding: 0 12px;
  }
  .brand-sub {
    display: none;
  }
  .top-clock {
    display: none;
  }
  .topbar-metrics {
    gap: 0;
  }
  .detail-panel {
    max-height: 58vh;
  }
  .panel-body {
    padding: 13px 13px 20px;
  }
  .detail-title {
    font-size: 20px;
  }
  .overview-batch {
    grid-template-columns: 98px 1fr;
    gap: 10px;
  }
  .progress-orbit {
    width: 92px;
    height: 92px;
  }
  .progress-orbit__value b {
    font-size: 21px;
  }
  .control-dock {
    height: 44px;
  }
  .dock-btn {
    height: 32px;
    width: 32px;
  }
  .dock-btn--primary {
    width: auto;
    padding: 0 10px;
  }
  .dock-btn--primary span {
    display: none;
  }
  .dock-btn--primary .icon-play,
  .dock-btn--primary .icon-pause {
    display: block !important;
  }
  body.is-paused .dock-btn--primary .icon-pause { display: none !important; }
  body:not(.is-paused) .dock-btn--primary .icon-play { display: none !important; }
  .station-label {
    display: none;
  }
  .core-label {
    display: none;
  }
  .dock-caption {
    display: none;
  }
  .telemetry-feed {
    display: none;
  }
  .topbar .sim-chip {
    display: none;
  }
}

@media (max-height: 760px) {
  .process-rail {
    bottom: 94px;
  }
  .rail-summary {
    display: none;
  }
  .telemetry-feed {
    display: none;
  }
  .detail-panel {
    bottom: 14px;
  }
}

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