

:root {
  --chassis: #0a0d16;
  --panel: #12151f;
  --panel-raised: #171b28;
  --hairline: rgba(255, 255, 255, 0.07);
  --hairline-strong: rgba(255, 255, 255, 0.14);
  --text: #e8eaf2;
  --text-dim: #7d8299;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  --accent: #4dff9e;
  --accent-dim: rgba(77, 255, 158, 0.35);
  --danger: #f87171;

  --amber: #ffb454;
  --violet: #a78bfa;
  --teal: #4de8c9;
  --pink: #ff7eb6;
  --blue: #5fa8ff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--chassis);
  color: var(--text);
  font-family: var(--sans);
}



.gate {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(77, 255, 158, 0.06), transparent 60%),
    var(--chassis);
}


.gate[hidden],
.app[hidden] {
  display: none;
}

.gate-panel {
  width: 100%;
  max-width: 440px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.gate-panel h1 {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 2px;
  letter-spacing: 0.02em;
}

.gate-sub {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 20px;
}

.gate-copy {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0 0 24px;
}

.field {
  display: block;
  margin-bottom: 20px;
}

.field span {
  display: block;
  font-family: var(--sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.field select {
  width: 100%;
}

select, input[type="range"], button {
  font-family: var(--sans);
}

select {
  width: 100%;
  background: var(--panel-raised);
  color: var(--text);
  border: 1px solid var(--hairline-strong);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
}

.btn-primary, .btn-secondary {
  width: 100%;
  padding: 11px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #04211c;
  border: none;
}
.btn-primary:hover { filter: brightness(1.08); }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--hairline-strong);
  margin-top: 10px;
}
.btn-secondary:hover { border-color: var(--accent-dim); }

.gate-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 14px;
  line-height: 1.4;
}



.app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--hairline);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
}

.brand {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.03em;
}
.brand span { color: var(--text-dim); }
.brand-home { color: inherit; text-decoration: none; }
.brand-home:hover { color: var(--accent, #e8a33d); text-decoration: underline; }

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}
.brand-mark { flex: none; display: block; }
.brand-lockup-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.brand-appname {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.01em;
}
.brand-sub {
  font-family: var(--sans);
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}
.brand-lockup:hover .brand-appname { filter: brightness(1.15); }

.page-nav {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 3px;
}
.page-nav-link {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--text-dim);
  padding: 6px 14px;
  border-radius: 999px;
}
.page-nav-link:hover { color: var(--text); }
.page-nav-link.active {
  color: #04211c;
  background: var(--accent);
  font-weight: 600;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--hairline-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
}

.pill.mode {
  color: var(--violet);
  border-color: rgba(167, 139, 250, 0.35);
  background: rgba(167, 139, 250, 0.08);
}

.pill.live { color: var(--text-dim); }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}
.status-dot.live {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.stage {
  flex: 1;
  display: flex;
  gap: 18px;
  padding: 18px 22px 26px 22px;
  min-height: 0;
}



.scope-wrap {
  flex: 1;
  min-width: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.6), inset 0 0 2px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.02);
  position: relative;
  background: #000;
}

#scopeCanvas {
  width: 100%;
  height: 100%;
  display: block;
}



.panel {
  width: 280px;
  flex-shrink: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 16px;
}

.panel-group h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin: 0 0 12px;
  font-weight: 600;
}

.chip {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.chip svg { width: 11px; height: 11px; }
.chip.amber { background: rgba(255, 180, 84, 0.15); color: var(--amber); }
.chip.violet { background: rgba(167, 139, 250, 0.15); color: var(--violet); }
.chip.teal { background: rgba(77, 232, 201, 0.15); color: var(--teal); }
.chip.pink { background: rgba(255, 126, 182, 0.15); color: var(--pink); }
.chip.blue { background: rgba(95, 168, 255, 0.15); color: var(--blue); }

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.row:last-child { margin-bottom: 0; }

.row label {
  font-size: 12px;
  color: var(--text);
}

.row select { width: auto; flex: 1; }
.row input[type="range"] { flex: 1; accent-color: var(--accent); }
.row input[type="checkbox"] { accent-color: var(--accent); }

.readout dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
}
.readout dt {
  font-size: 12px;
  color: var(--text-dim);
}
.readout dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  text-align: right;
}

.status-value {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.status-value.trig { color: var(--accent); }
.status-value.hold { color: #fbbf24; }
.status-value.armed { color: #fbbf24; }



.hero-card {
  background: linear-gradient(160deg, var(--panel-raised), var(--panel));
  border: 1px solid rgba(77, 255, 158, 0.18);
  box-shadow: 0 0 0 1px rgba(77, 255, 158, 0.06), 0 8px 30px rgba(0, 0, 0, 0.4);
}

.hero-label {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.hero-value {
  font-family: var(--mono);
  font-size: 36px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.1;
  text-shadow: 0 0 18px rgba(77, 255, 158, 0.5), 0 0 40px rgba(77, 255, 158, 0.22);
  margin-bottom: 4px;
  word-break: break-word;
}
.hero-unit {
  font-size: 16px;
  color: var(--text-dim);
  text-shadow: none;
  margin-left: 4px;
}

.hero-sub {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--text-dim);
  min-height: 15px;
}

@media (max-width: 800px) {
  .stage { flex-direction: column; }
  .panel { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .card { flex: 1 1 220px; }
}



#supportWidget {
  position: fixed;
  right: 14px;
  bottom: 34px;
  z-index: 10;
}
#supportWidget img { display: block; }

#legalBar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 5px 12px;
  font-size: 10.5px;
  color: var(--text-dim);
  background: rgba(10, 13, 22, 0.88);
  border-top: 1px solid var(--hairline);
}
#legalBar a { color: var(--text-dim); text-decoration: none; }
#legalBar a:hover { color: var(--accent); }
