:root {
  --bg: #04060a;
  --panel: rgba(8, 12, 20, 0.72);
  --line: rgba(44, 240, 210, 0.18);
  --ink: #eef7f6;
  --muted: #8fa3ad;
  --cyan: #2cf0d2;
  --gold: #e4c27a;
  --danger: #ff6b7a;
  --watch: #f0b429;
  --elevated: #ff8b4a;
  --font: "Outfit", system-ui, sans-serif;
  --display: "Syne", "Outfit", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font); }
body {
  background:
    radial-gradient(900px 520px at 8% -12%, rgba(44, 240, 210, 0.1), transparent 52%),
    radial-gradient(820px 480px at 108% 0%, rgba(228, 194, 122, 0.09), transparent 48%),
    var(--bg);
}
#fx { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#grid {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.14;
  background-image:
    linear-gradient(rgba(44,240,210,.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(44,240,210,.14) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 80%);
}
.vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 2;
  box-shadow: inset 0 0 180px rgba(0,0,0,.55);
}
.hud {
  position: fixed; z-index: 3; width: 28px; height: 28px; pointer-events: none;
  border: 1px solid rgba(44,240,210,.35);
}
.hud.tl { top: 12px; left: 12px; border-right: 0; border-bottom: 0; }
.hud.tr { top: 12px; right: 12px; border-left: 0; border-bottom: 0; }
.hud.bl { bottom: 12px; left: 12px; border-right: 0; border-top: 0; }
.hud.br { bottom: 12px; right: 12px; border-left: 0; border-top: 0; }

.hidden { display: none !important; }
.gate, .shell { position: relative; z-index: 4; }

.gate {
  min-height: 100svh; display: grid; place-items: center; padding: 24px;
}
.gate-orbit {
  position: absolute; width: min(540px, 86vw); height: min(540px, 86vw);
  border-radius: 50%; border: 1px dashed rgba(44,240,210,.18);
  animation: spin 48s linear infinite; pointer-events: none;
}
.gate-orbit::before, .gate-orbit::after {
  content: ""; position: absolute; inset: 40px; border-radius: 50%;
  border: 1px solid rgba(228,194,122,.12);
}
.gate-orbit::after { inset: 80px; animation: spin 28s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.gate-card {
  width: min(440px, 100%);
  padding: 36px 32px 32px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5), 0 0 0 1px rgba(44,240,210,.04);
  backdrop-filter: blur(18px);
}
.mark { font-family: var(--display); letter-spacing: .28em; text-transform: uppercase; font-size: 12px; color: var(--cyan); }
.gate h1 { font-family: var(--display); font-size: 34px; margin: 10px 0 8px; letter-spacing: -.03em; }
.gate p { color: var(--muted); margin: 0 0 22px; }
.gate label { display: block; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 12px 0 6px; }
.gate input {
  width: 100%; background: #07090f; border: 1px solid var(--line); color: var(--ink);
  border-radius: 12px; padding: 12px 14px; outline: none;
}
.gate input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(44,240,210,.08); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 12px 18px; font-weight: 600; cursor: pointer;
  text-decoration: none; color: #04120f;
  background: linear-gradient(120deg, var(--cyan), #7cf0c8);
}
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.gold { background: linear-gradient(120deg, #f0d38a, #c9a24a); color: #1b1406; }
.btn.danger { background: #3a1218; color: #ffd0d5; border: 1px solid #7a303a; }
.btn.wide { width: 100%; margin-top: 18px; }
.err { color: var(--danger); min-height: 1.2em; font-size: 14px; }

.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100svh; }
.side {
  display: flex; flex-direction: column;
  border-right: 1px solid var(--line); padding: 22px 16px;
  background: rgba(5,7,12,.78); backdrop-filter: blur(18px);
}
.brand .clock {
  display: block; margin-top: 8px; font-family: var(--mono); font-size: 12px;
  color: var(--gold); letter-spacing: .08em;
}
.side nav { display: grid; gap: 4px; margin-top: 22px; }
.nav-label {
  margin: 14px 12px 4px; font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase; color: rgba(143,163,173,.7);
}
.side a, .side button.link {
  background: none; border: 0; color: var(--muted); text-align: left;
  padding: 10px 12px; border-radius: 10px; cursor: pointer; font: inherit; text-decoration: none;
}
.side a.active, .side button.link.active, .side a:hover, .side button.link:hover {
  color: var(--ink); background: rgba(44,240,210,.08);
}
.who { margin-top: auto; padding-top: 24px; color: var(--muted); font-size: 13px; }
.main { padding: 28px 32px 60px; }
.top {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px;
}
h2 { font-family: var(--display); font-size: clamp(28px, 4vw, 40px); margin: 0; letter-spacing: -.03em; }
.kicker { color: var(--cyan); letter-spacing: .2em; text-transform: uppercase; font-size: 11px; margin: 0 0 6px; }
.panel-title { font-family: var(--display); font-size: 22px; margin: 0 0 12px; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 20px;
  backdrop-filter: blur(10px);
}
.row { display: flex; gap: 10px; flex-wrap: wrap; }
input, select {
  background: #07090f; border: 1px solid var(--line); color: var(--ink);
  border-radius: 12px; padding: 11px 12px; outline: none; font: inherit;
}
input:focus, select:focus { border-color: var(--cyan); }
.grow { flex: 1; min-width: 180px; }

.stats, .ops-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat { padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.stat b { display: block; font-family: var(--display); font-size: 26px; }
.stat span { color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid rgba(255,255,255,.06); vertical-align: top; }
th { color: var(--muted); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
tr:hover td { background: rgba(44,240,210,.03); }
.tag {
  display: inline-block; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--cyan); font-size: 11px; letter-spacing: .06em;
}
.tag.ao { color: var(--gold); border-color: rgba(228,194,122,.35); }
.tag.hot { color: var(--danger); border-color: rgba(255,107,122,.4); }
.live { display: flex; align-items: center; gap: 8px; color: var(--gold); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 0 rgba(228,194,122,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(228,194,122,0); } }

.lede { color: var(--muted); max-width: 68ch; line-height: 1.55; margin: 0 0 18px; }
.split { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; margin-top: 14px; }
.tree-wrap { margin-top: 8px; }
.console {
  font-family: var(--mono); font-size: 12px; line-height: 1.55; max-height: 220px; overflow: auto;
  background: #05070c; border-radius: 12px; padding: 12px; color: #9fe7d8;
}
.constellation {
  position: relative; min-height: 560px; padding: 28px 18px 32px;
  border-radius: 16px; border: 1px solid var(--line); overflow: hidden;
  display: flex; flex-direction: column; align-items: center; gap: 32px;
  background:
    radial-gradient(700px 240px at 50% 8%, rgba(44,240,210,.08), transparent 58%),
    radial-gradient(500px 200px at 80% 90%, rgba(228,194,122,.05), transparent 50%),
    #05070c;
}
.constellation.live::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(44,240,210,.05), transparent);
  animation: sweep 3.4s linear infinite;
}
@keyframes sweep { 0% { transform: translateY(-100%); } 100% { transform: translateY(100%); } }
.const-core {
  position: relative; z-index: 1; width: 168px; height: 168px; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  background: radial-gradient(circle at 40% 30%, #2a3344, #101820 70%);
  border: 2px solid var(--gold); box-shadow: 0 0 40px rgba(228,194,122,.18);
  cursor: pointer;
}
.const-core strong { font-family: var(--display); font-size: 16px; max-width: 130px; line-height: 1.2; }
.const-core em { position: absolute; bottom: 22px; font-style: normal; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.const-core .ring {
  position: absolute; inset: -10px; border-radius: 50%; border: 1px dashed rgba(228,194,122,.28);
  animation: spin 22s linear infinite; pointer-events: none;
}
.const-core .r2 { inset: -22px; animation-duration: 36s; animation-direction: reverse; border-color: rgba(44,240,210,.2); }
.const-fams {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 28px 34px; width: 100%;
}
.orb {
  --c: var(--cyan);
  width: 138px; height: 138px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; text-align: center; padding: 12px;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.08), #0c121a 68%);
  border: 2px solid color-mix(in srgb, var(--c) 70%, #000);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 35%, transparent);
  transition: transform .2s ease, box-shadow .2s ease;
}
.orb:hover, .orb.open { transform: translateY(-4px); box-shadow: 0 0 28px color-mix(in srgb, var(--c) 40%, transparent); }
.orb b { display: block; font-family: var(--display); font-size: 14px; line-height: 1.2; }
.orb span { display: block; margin-top: 6px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.const-types {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 16px; width: 100%; min-height: 0;
}
.type-chip {
  min-width: 170px; padding: 16px 18px; border-radius: 16px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(12,18,26,.9); text-align: left;
}
.type-chip.open { border-color: #7ab8ff; background: #132032; }
.type-chip b { display: block; font-size: 14px; }
.type-chip span { color: var(--muted); font-size: 12px; }
.const-leaves {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px; width: 100%;
}
.leaf-plate {
  min-height: 108px; padding: 16px 18px; border-radius: 16px; cursor: pointer;
  border: 1px solid var(--line); background: linear-gradient(180deg, rgba(20,28,36,.9), rgba(8,12,18,.95));
}
.leaf-plate:hover { border-color: var(--cyan); }
.leaf-plate.hot { border-color: rgba(255,107,122,.45); }
.leaf-plate h4 { margin: 8px 0 6px; font-size: 15px; line-height: 1.3; }
.leaf-plate p { margin: 0; color: var(--muted); font-size: 13px; }
.engine-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 12px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
}
.pill i { width: 7px; height: 7px; border-radius: 50%; background: #3a5560; }
.pill.on { color: var(--cyan); border-color: rgba(44,240,210,.4); background: rgba(44,240,210,.06); }
.pill.on i { background: var(--cyan); box-shadow: 0 0 0 0 rgba(44,240,210,.6); animation: pulse 1.6s infinite; }
.pill.gold { color: var(--gold); border-color: rgba(228,194,122,.4); }
.pill.gold i { background: var(--gold); }
.pill.dim { opacity: .7; }
.feeds { display: flex; flex-wrap: wrap; gap: 6px; min-height: 8px; margin: 8px 0 12px; }
.feed {
  font-size: 11px; letter-spacing: .04em; padding: 4px 9px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); background: rgba(255,255,255,.02);
}
.feed.running { color: var(--gold); border-color: rgba(228,194,122,.35); }
.feed.done { color: var(--cyan); border-color: rgba(44,240,210,.28); }
.feed.error { color: var(--danger); }
.hunt-panel { box-shadow: 0 0 0 1px rgba(44,240,210,.04), 0 20px 60px rgba(0,0,0,.28); }
.flight-grid { display: grid; grid-template-columns: 1.45fr .75fr; gap: 14px; margin-top: 12px; }
.sky-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 12px 0 8px; }
.sky-stage { position: relative; }
#flight-map {
  height: min(72vh, 760px); min-height: 520px; border-radius: 12px;
  border: 1px solid var(--line); background: #081018;
}
.radar-sweep {
  position: absolute; inset: 0; pointer-events: none; border-radius: 12px; overflow: hidden;
  background: conic-gradient(from 0deg, transparent 0 78%, rgba(44,240,210,.08) 88%, transparent 100%);
  animation: spin 8s linear infinite; mix-blend-mode: screen; opacity: .55;
}
.avionics {
  background: #05070c; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; max-height: min(72vh, 760px); overflow: auto;
}
.avionics-glass { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 12px; }
.glass-cell {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #0a1016;
}
.glass-cell b { display: block; font-family: var(--display); font-size: 20px; }
.glass-cell span { color: var(--muted); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.heading-rose {
  width: 72px; height: 72px; border-radius: 50%; margin: 6px auto 0;
  border: 2px solid var(--cyan); position: relative;
}
.heading-rose i {
  position: absolute; left: 50%; top: 6px; width: 2px; height: 28px; background: var(--gold);
  transform-origin: bottom center;
}
.plane-mark {
  width: 22px; height: 22px; color: #2cf0d2; filter: drop-shadow(0 0 6px #2cf0d2);
}
.plane-mark.sel { color: #e4c27a; filter: drop-shadow(0 0 8px #e4c27a); }
.flight-meta { color: var(--muted); font-size: 13px; margin-top: 8px; }
.flight-list { margin-top: 12px; max-height: 280px; overflow: auto; }
.flight-row {
  display: grid; grid-template-columns: 1fr auto; gap: 8px;
  padding: 8px 0; border-top: 1px solid rgba(255,255,255,.06);
  cursor: pointer; font-size: 13px;
}
.flight-row:hover { color: var(--cyan); }
.flight-row b { font-family: var(--mono); letter-spacing: .04em; }
.results { max-height: 280px; overflow: auto; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.drawer {
  background: #05070c; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 14px 16px; margin-bottom: 12px; min-height: 180px; max-height: 360px; overflow: auto;
}
.drawer h3 { font-family: var(--display); font-size: 18px; margin: 4px 0 8px; word-break: break-word; }
.drawer-item { border-top: 1px solid rgba(255,255,255,.06); padding: 8px 0; font-size: 13px; }
.drawer-item b { display: block; color: var(--cyan); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.drawer-item pre {
  white-space: pre-wrap; word-break: break-word; margin: 6px 0 0;
  font-family: var(--font); font-size: 13px; color: #d5ece7;
}
.drawer-link { color: var(--cyan); word-break: break-all; display: inline-block; margin-top: 6px; }

.launch { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 8px 0 22px; }
.img-board { display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px; margin-top: 14px; }
.img-preview {
  min-height: 220px; border-radius: 14px; border: 1px dashed var(--line);
  display: grid; place-items: center; color: var(--muted); overflow: hidden; background: #070b10;
}
.img-preview img { width: 100%; height: 100%; object-fit: contain; max-height: 420px; }
.img-map, #cam-map {
  height: min(62vh, 640px); min-height: 360px; border-radius: 12px;
  border: 1px solid var(--line); background: #081018; margin-top: 10px;
}
#img-links .tile { padding: 12px 14px; }
#img-links .tile h3 { font-size: 16px; margin: 0; }
.tile {
  text-align: left; cursor: pointer; color: inherit;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 20px;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.tile:hover {
  transform: translateY(-3px);
  border-color: rgba(44,240,210,.45);
  box-shadow: 0 16px 40px rgba(0,0,0,.35), 0 0 24px rgba(44,240,210,.08);
}
.tile.gold:hover { border-color: rgba(228,194,122,.5); box-shadow: 0 16px 40px rgba(0,0,0,.35), 0 0 24px rgba(228,194,122,.1); }
.tile h3 { font-family: var(--display); font-size: 26px; margin: 4px 0 8px; }
.tile p { color: var(--muted); margin: 0; line-height: 1.45; }
.deck-grid { display: grid; grid-template-columns: .8fr 1.1fr 1.1fr; gap: 14px; }
.stack { display: grid; gap: 8px; }
.stack-item {
  display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(255,255,255,.02); cursor: pointer;
}
.stack-item:hover { border-color: rgba(44,240,210,.4); }
.stack-item b { font-size: 14px; }
.stack-item span { color: var(--muted); font-size: 12px; }

.ops {
  display: grid; grid-template-columns: 140px 1.4fr 1fr; gap: 14px; align-items: stretch; margin: 4px 0 12px;
}
.gauge {
  position: relative; display: grid; place-items: center;
  min-height: 132px; border-radius: 16px; border: 1px solid var(--line);
  background: #070b10;
}
.gauge-ring {
  position: absolute; width: 104px; height: 104px; border-radius: 50%;
  background: conic-gradient(var(--g, var(--cyan)) calc(var(--p, 0) * 1%), rgba(255,255,255,.06) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent 62%, #000 63%);
  mask: radial-gradient(farthest-side, transparent 62%, #000 63%);
  transition: background .4s ease;
}
.gauge-read { position: relative; text-align: center; }
.gauge-read b { display: block; font-family: var(--display); font-size: 28px; line-height: 1; }
.gauge-read span { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.gauge[data-level="watch"] { --g: var(--watch); }
.gauge[data-level="elevated"] { --g: var(--elevated); }
.gauge[data-level="severe"] { --g: var(--danger); }
.brief-pane {
  border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; background: rgba(7,11,16,.7);
}
.brief-text { margin: 0 0 8px; line-height: 1.5; font-size: 15px; }
.brief-points { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.ticker {
  font-family: var(--mono); font-size: 12px; color: #9fe7d8;
  white-space: nowrap; overflow: hidden; min-height: 1.4em; margin: 0 0 8px;
  border-left: 2px solid var(--cyan); padding-left: 10px;
}
.cards { display: grid; gap: 8px; max-height: 420px; overflow: auto; }
.card {
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
  background: rgba(255,255,255,.02); cursor: pointer;
}
.card:hover { border-color: rgba(44,240,210,.4); }
.card.hot { border-color: rgba(255,107,122,.45); background: rgba(58,18,24,.28); }
.card h4 { margin: 6px 0 4px; font-size: 15px; font-weight: 600; }
.card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.raw { margin-top: 12px; color: var(--muted); }
.raw summary { cursor: pointer; margin-bottom: 8px; }

@media (max-width: 1100px) {
  .launch, .deck-grid, .ops { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: flex; flex-direction: row; align-items: center; gap: 12px; overflow: auto; }
  .side nav { display: flex; margin: 0; }
  .stats, .split, .flight-grid, .ops-stats, .sky-stats, .img-board { grid-template-columns: 1fr; }
  .main { padding: 18px 14px 40px; }
  .hud, .vignette { display: none; }
}
