:root {
  color-scheme: dark;
  --bg: #0b0f0c;
  --panel: #141b16;
  --panel-2: #19231c;
  --line: #2b392f;
  --text: #f2f5ef;
  --muted: #94a398;
  --lime: #b8f35b;
  --cyan: #68e4d1;
  --danger: #ff6f6f;
}

* { box-sizing: border-box; }

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 10, 8, 0.92);
  backdrop-filter: blur(12px);
}

.auth-gate[hidden] { display: none; }

.auth-card {
  width: min(100%, 420px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

.auth-card input {
  width: 100%;
  margin: 8px 0 16px;
  padding: 13px 14px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0c120e;
}
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% 8%, rgba(104, 228, 209, .09), transparent 28rem),
    linear-gradient(145deg, #080b09, var(--bg));
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 52px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 26px; }
.eyebrow, .section-label { color: var(--lime); font: 700 11px/1.2 ui-monospace, monospace; letter-spacing: .13em; text-transform: uppercase; }
h1 { font-size: clamp(26px, 4vw, 42px); margin: 7px 0 0; letter-spacing: -.04em; }
h2 { margin: 8px 0 12px; font-size: 24px; letter-spacing: -.03em; }
.connection { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.connection span { width: 9px; height: 9px; border-radius: 50%; background: #5d665f; box-shadow: 0 0 0 4px rgba(93,102,95,.12); }
.connection.online { color: var(--text); }
.connection.online span { background: var(--lime); box-shadow: 0 0 0 4px rgba(184,243,91,.13), 0 0 16px rgba(184,243,91,.45); }
.hero-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 18px; }
.camera-card, .mission-card, .state-card, .timeline-card { background: rgba(20,27,22,.92); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.camera-stage { min-height: 340px; position: relative; overflow: hidden; background: #080b09; }
.camera-stage > img { display: block; width: 100%; height: 340px; object-fit: cover; }
.camera-stage > img[hidden] { display: none; }
.camera-placeholder { min-height: 340px; display: grid; place-content: center; place-items: center; position: relative; background: repeating-linear-gradient(0deg, #101711, #101711 3px, #111a13 3px, #111a13 6px); color: var(--muted); }
.camera-placeholder p { margin: 18px 0 5px; font: 700 12px ui-monospace, monospace; letter-spacing: .14em; }
.camera-placeholder small { font-size: 12px; }
.reticle { width: 58px; height: 58px; border: 1px solid rgba(184,243,91,.55); border-radius: 50%; box-shadow: inset 0 0 0 22px transparent; position: relative; }
.reticle::before, .reticle::after { content: ""; position: absolute; background: var(--lime); }
.reticle::before { width: 78px; height: 1px; left: -11px; top: 28px; }
.reticle::after { width: 1px; height: 78px; top: -11px; left: 28px; }
.camera-meta { display: flex; justify-content: space-between; padding: 13px 16px; color: var(--muted); font: 12px ui-monospace, monospace; }
.monitor-controls { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 16px 16px; border-top: 1px solid var(--line); }
.monitor-controls strong { display: block; font-size: 13px; }
.monitor-controls small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.monitor-toggle { flex: 0 0 auto; min-height: 38px; color: var(--text); background: #26332a; border: 1px solid var(--line); }
.monitor-toggle[aria-pressed="true"] { color: #10150f; background: var(--lime); border-color: var(--lime); }
.monitor-actions { display: flex; align-items: center; gap: 8px; }
.monitor-actions select { min-height: 38px; max-width: 170px; padding: 0 10px; color: var(--text); background: #0e140f; border: 1px solid var(--line); border-radius: 9px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.mission-card { padding: 24px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.55; }
label { display: block; color: var(--muted); font-size: 12px; margin: 21px 0 8px; }
textarea { width: 100%; resize: vertical; border: 1px solid var(--line); border-radius: 10px; background: #0e140f; color: var(--text); padding: 12px; font: inherit; line-height: 1.5; }
textarea:focus { outline: 1px solid var(--lime); border-color: var(--lime); }
.button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
button { border: 0; border-radius: 10px; min-height: 46px; padding: 0 16px; font-weight: 800; cursor: pointer; }
button:disabled { opacity: .38; cursor: not-allowed; }
.primary { color: #10150f; background: var(--lime); }
.danger { color: #ffdede; background: rgba(255,111,111,.12); border: 1px solid rgba(255,111,111,.4); }
.notice { min-height: 20px; margin: 14px 0 0; color: var(--cyan); font-size: 12px; }
.status-grid { display: grid; grid-template-columns: .45fr 1.55fr; gap: 18px; margin-top: 18px; }
.state-card, .timeline-card { padding: 21px; }
.state-value { margin: 14px 0; font: 700 clamp(24px, 4vw, 38px) ui-monospace, monospace; color: var(--cyan); text-transform: uppercase; overflow-wrap: anywhere; }
.progress { height: 4px; background: #28332b; border-radius: 9px; overflow: hidden; }
.progress div { width: 0; height: 100%; background: linear-gradient(90deg, var(--lime), var(--cyan)); transition: width .35s ease; }
.section-heading { display: flex; align-items: center; justify-content: space-between; }
.section-heading span { color: var(--muted); font: 11px ui-monospace, monospace; }
ol { list-style: none; margin: 14px 0 0; padding: 0; max-height: 330px; overflow: auto; }
li { display: grid; grid-template-columns: 88px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); font-size: 13px; }
li .time { color: var(--muted); font: 11px ui-monospace, monospace; }
li .result { color: var(--lime); font: 11px ui-monospace, monospace; }
li.empty { display: block; color: var(--muted); border: 0; }

@media (max-width: 760px) {
  .shell { width: min(100% - 22px, 620px); padding-top: 18px; }
  .topbar { align-items: flex-start; }
  .connection b { display: none; }
  .hero-grid, .status-grid { grid-template-columns: 1fr; }
  .camera-stage, .camera-placeholder { min-height: 230px; }
  .camera-stage > img { height: 230px; }
  .monitor-controls { align-items: flex-start; }
  .monitor-actions { align-items: stretch; flex-direction: column; }
  .mission-card { padding: 20px; }
  li { grid-template-columns: 68px 1fr; }
  li .result { grid-column: 2; }
}
