/* neutrons-A | drylab.style.css
 * High-contrast scientific instrument theme with zero external dependencies.
 */

:root {
  --bg-0: #050811;
  --bg-1: #0b1120;
  --bg-2: #111a2e;
  --bg-3: #182542;
  --line: rgba(125, 175, 235, 0.18);
  --line-hi: rgba(56, 189, 248, 0.48);
  --txt-0: #eef5ff;
  --txt-1: #a9bdd8;
  --txt-2: #6f86a6;

  --c-neut: #38bdf8;
  --c-prot: #fb7185;
  --c-elec: #fbbf24;
  --c-weak: #c084fc;
  --c-stab: #34d399;
  --c-warn: #f97316;
  --c-alpa: #eab308;

  --rad-sm: 6px;
  --rad-md: 10px;
  --mono: "SF Mono", "JetBrains Mono", "Menlo", "Consolas", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
  background: radial-gradient(circle at 18% 0%, #0e1933 0%, var(--bg-0) 58%);
  color: var(--txt-0);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

#app-shell {
  max-width: 1580px;
  margin: 0 auto;
  padding: 12px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Topbar */
.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(17, 26, 46, 0.94), rgba(11, 17, 32, 0.92));
  border: 1px solid var(--line);
  border-radius: var(--rad-md);
}

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

.brand-block h1 {
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--txt-0);
}

.ver-pill {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--c-neut);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.subtitle {
  margin-top: 2px;
  font-size: 0.82rem;
  color: var(--txt-1);
}

.global-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.status-pill {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  letter-spacing: 0.04em;
}

.status-wait {
  color: var(--c-elec);
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
}

.status-pass {
  color: var(--c-stab);
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.1);
}

.status-fail {
  color: var(--c-prot);
  border-color: rgba(251, 113, 133, 0.5);
  background: rgba(251, 113, 133, 0.14);
}

/* Buttons */
.btn {
  appearance: none;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--txt-0);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--rad-sm);
  padding: 6px 11px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}

.btn:hover {
  background: var(--bg-3);
  border-color: var(--line-hi);
}

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

.btn-primary {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.55);
  color: #e0f4ff;
}

.btn-primary:hover {
  background: rgba(56, 189, 248, 0.28);
}

.btn-warn {
  background: rgba(249, 115, 22, 0.16);
  border-color: rgba(249, 115, 22, 0.55);
  color: #ffedd5;
}

.btn-warn:hover {
  background: rgba(249, 115, 22, 0.28);
}

.btn-active {
  background: rgba(52, 211, 153, 0.18);
  border-color: rgba(52, 211, 153, 0.6);
  color: #d1fae5;
}

/* Regime Tabs */
.mode-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.mode-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 9px 12px;
  background: rgba(11, 17, 32, 0.86);
  border: 1px solid var(--line);
  border-radius: var(--rad-md);
  color: var(--txt-1);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.mode-tab:hover {
  background: rgba(20, 32, 56, 0.92);
  border-color: var(--line-hi);
  color: var(--txt-0);
}

.mode-tab.active {
  background: linear-gradient(135deg, rgba(22, 41, 74, 0.96), rgba(13, 24, 46, 0.96));
  border-color: var(--c-neut);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25), 0 6px 18px rgba(0, 0, 0, 0.35);
  color: var(--txt-0);
}

.tab-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.tab-code {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-neut);
}

.tab-key {
  font-family: var(--mono);
  font-size: 0.68rem;
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--txt-2);
  border: 1px solid var(--line);
}

.tab-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: inherit;
}

.tab-sub {
  font-size: 0.74rem;
  color: var(--txt-2);
}

.mode-tab.active .tab-sub {
  color: var(--txt-1);
}

/* Main Workspace */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(330px, 410px);
  gap: 12px;
  align-items: start;
}

.visual-col,
.inspector-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

/* Panels */
.panel {
  background: rgba(11, 17, 32, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--rad-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.panel-head.compact {
  gap: 8px;
}

.panel-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.kicker {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--txt-2);
}

.panel-head h2 {
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--txt-0);
}

.panel-head h3 {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--txt-0);
}

.verdict-pill {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.05em;
  border: 1px solid var(--line);
  white-space: nowrap;
}

.verdict-stable {
  color: var(--c-stab);
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.48);
}

.verdict-beta-minus {
  color: var(--c-neut);
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.52);
}

.verdict-beta-plus {
  color: var(--c-prot);
  background: rgba(251, 113, 133, 0.14);
  border-color: rgba(251, 113, 133, 0.52);
}

.verdict-warn {
  color: var(--c-warn);
  background: rgba(249, 115, 22, 0.15);
  border-color: rgba(249, 115, 22, 0.55);
}

.verdict-blocked {
  color: var(--c-weak);
  background: rgba(192, 132, 252, 0.15);
  border-color: rgba(192, 132, 252, 0.55);
}

/* Canvases */
.canvas-wrap {
  position: relative;
  width: 100%;
  border-radius: var(--rad-sm);
  overflow: hidden;
  border: 1px solid rgba(125, 175, 235, 0.16);
  background: #04070f;
}

.stage-wrap {
  height: 455px;
}

.scope-wrap {
  height: 225px;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.hover-readout {
  position: absolute;
  top: 10px;
  right: 10px;
  pointer-events: none;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--txt-0);
  background: rgba(5, 8, 17, 0.88);
  border: 1px solid var(--line-hi);
  border-radius: var(--rad-sm);
  padding: 5px 9px;
}

.hidden {
  display: none;
}

.stage-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.stage-hint {
  font-size: 0.77rem;
  color: var(--txt-1);
}

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

.scope-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--txt-1);
}

.leg-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

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

/* Presets */
.preset-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-chip {
  appearance: none;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--txt-1);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.preset-chip:hover {
  color: var(--txt-0);
  border-color: var(--line-hi);
  background: var(--bg-3);
}

.preset-chip.active {
  color: #e0f4ff;
  border-color: var(--c-neut);
  background: rgba(56, 189, 248, 0.2);
}

/* Controls */
.control-rack {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

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

.ctrl-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.ctrl-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--txt-0);
}

.ctrl-val {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--c-neut);
  font-variant-numeric: tabular-nums;
}

.ctrl-sub {
  font-size: 0.72rem;
  color: var(--txt-2);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #1b2a47;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--c-neut);
  border: 2px solid #050811;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.65);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--c-neut);
  border: 2px solid #050811;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.65);
  cursor: pointer;
}

.seg-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.seg-btn {
  appearance: none;
  font-family: var(--mono);
  font-size: 0.76rem;
  padding: 6px 8px;
  border-radius: var(--rad-sm);
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--txt-1);
  cursor: pointer;
}

.seg-btn.active {
  background: rgba(56, 189, 248, 0.22);
  border-color: var(--c-neut);
  color: var(--txt-0);
  font-weight: 700;
}

/* Telemetry */
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tele-card {
  padding: 8px 10px;
  border-radius: var(--rad-sm);
  background: rgba(17, 26, 46, 0.72);
  border: 1px solid rgba(125, 175, 235, 0.14);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tele-key {
  font-family: var(--mono);
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--txt-2);
}

.tele-val {
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--txt-0);
  font-variant-numeric: tabular-nums;
}

.tele-note {
  font-size: 0.7rem;
  color: var(--txt-1);
}

/* Verdict Card */
.verdict-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--txt-1);
}

.verdict-card strong {
  color: var(--txt-0);
}

.verdict-eq {
  font-family: var(--mono);
  font-size: 0.77rem;
  color: #dbeafe;
  background: rgba(5, 8, 17, 0.7);
  border-left: 3px solid var(--c-neut);
  padding: 7px 10px;
  border-radius: 0 var(--rad-sm) var(--rad-sm) 0;
}

.verdict-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
}

.verdict-table th,
.verdict-table td {
  text-align: left;
  padding: 6px 7px;
  border-bottom: 1px solid rgba(125, 175, 235, 0.14);
}

.verdict-table th {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--txt-2);
}

.verdict-table tr.jump-row {
  cursor: pointer;
}

.verdict-table tr.jump-row:hover {
  background: rgba(56, 189, 248, 0.12);
}

.credit-foot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 6px;
  font-family: var(--mono);
  font-size: 0.69rem;
  color: var(--txt-2);
}

/* Responsive */
@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .mode-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stage-wrap {
    height: 410px;
  }
}

@media (max-width: 640px) {
  .mode-tabs {
    grid-template-columns: 1fr;
  }
  .stage-wrap {
    height: 350px;
  }
  .scope-wrap {
    height: 205px;
  }
  .telemetry-grid {
    grid-template-columns: 1fr;
  }
}
