:root {
  color-scheme: dark;
  --bg: #050706;
  --bg-2: #0a0f0b;
  --panel: rgba(11, 17, 13, 0.92);
  --panel-2: rgba(15, 25, 19, 0.9);
  --line: rgba(166, 255, 77, 0.22);
  --line-strong: rgba(166, 255, 77, 0.56);
  --radar: #a6ff4d;
  --radar-soft: rgba(166, 255, 77, 0.16);
  --amber: #ffb547;
  --amber-soft: rgba(255, 181, 71, 0.16);
  --steel: #93a198;
  --text: #e8f3e6;
  --muted: #7f8c84;
  --danger: #ff5d4d;
  --olive: #445331;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 78% 18%, rgba(166, 255, 77, 0.12), transparent 30rem),
    radial-gradient(circle at 18% 72%, rgba(255, 181, 71, 0.1), transparent 28rem),
    linear-gradient(135deg, #020302, #0a0f0b 52%, #050706);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(166, 255, 77, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(166, 255, 77, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 15, 11, 0.94), rgba(4, 6, 5, 0.9));
}

.mark {
  display: grid;
  gap: 2px;
  padding: 18px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(135deg, rgba(166, 255, 77, 0.12), transparent),
    rgba(6, 10, 7, 0.86);
  box-shadow: inset 0 0 32px rgba(166, 255, 77, 0.08);
}

.mark__sigil {
  color: var(--radar);
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

.mark__name {
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.steps {
  display: grid;
  gap: 10px;
}

.step {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  min-height: 54px;
  padding: 0;
  border: 1px solid rgba(147, 161, 152, 0.16);
  color: var(--muted);
  background: rgba(8, 12, 9, 0.7);
  text-align: left;
}

.step.is-active {
  border-color: var(--line-strong);
  color: var(--text);
  background: linear-gradient(90deg, var(--radar-soft), rgba(8, 12, 9, 0.7));
}

.step__index {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--amber);
  border-right: 1px solid rgba(147, 161, 152, 0.16);
  font-size: 12px;
  font-weight: 900;
}

.step__label {
  padding: 0 14px;
  font-size: 14px;
  font-weight: 750;
}

.telemetry {
  display: grid;
  gap: 1px;
  margin-top: auto;
  border: 1px solid rgba(147, 161, 152, 0.16);
  background: rgba(147, 161, 152, 0.08);
}

.telemetry div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  min-height: 42px;
  padding: 11px 12px;
  background: rgba(3, 5, 4, 0.72);
}

.telemetry span {
  color: var(--muted);
  font-size: 12px;
}

.telemetry strong {
  color: var(--radar);
  font-size: 12px;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 4px;
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(30px, 4vw, 56px);
  line-height: 0.95;
}

h2 {
  font-size: 24px;
  line-height: 1.1;
}

.actions,
.pager,
.switch-row,
.launch-grid {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
}

.panel {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(166, 255, 77, 0.045), transparent 38%),
    var(--panel);
  box-shadow: var(--shadow);
}

.panel--primary {
  min-height: 680px;
}

.side {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 18px;
}

.screen {
  display: none;
  padding: 28px;
}

.screen.is-active {
  display: block;
}

.screen__header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.beacon {
  width: 18px;
  height: 54px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, var(--radar), rgba(166, 255, 77, 0.08));
  box-shadow: 0 0 28px rgba(166, 255, 77, 0.38);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field--compact {
  max-width: 180px;
}

.field--wide {
  grid-column: 1 / -1;
}

.field span,
.switch-row label,
.toggle span {
  color: var(--steel);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0 14px;
  border: 1px solid rgba(147, 161, 152, 0.24);
  border-radius: 0;
  outline: none;
  color: var(--text);
  background: rgba(3, 5, 4, 0.76);
}

.field input {
  min-height: 48px;
}

.field textarea {
  min-height: 104px;
  padding-top: 12px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--radar);
  box-shadow: 0 0 0 3px rgba(166, 255, 77, 0.12);
}

.icon-button,
.command-button,
.ghost-button,
.launch-button {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: rgba(8, 12, 9, 0.84);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  padding: 0;
}

.icon-button svg {
  width: 20px;
  fill: none;
  stroke: var(--radar);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.command-button,
.ghost-button,
.launch-button {
  padding: 0 18px;
  font-weight: 850;
}

.command-button,
.launch-button {
  background: linear-gradient(180deg, rgba(166, 255, 77, 0.18), rgba(68, 83, 49, 0.35));
}

.launch-button--danger {
  border-color: rgba(255, 181, 71, 0.72);
  color: var(--amber);
  background: linear-gradient(180deg, rgba(255, 181, 71, 0.16), rgba(88, 52, 12, 0.42));
}

.ghost-button {
  border-color: rgba(147, 161, 152, 0.22);
  color: var(--steel);
}

.pager {
  justify-content: space-between;
  padding: 18px 28px;
  border-top: 1px solid var(--line);
}

.scan-list {
  display: grid;
  gap: 10px;
}

.scan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 16px;
  border: 1px solid rgba(147, 161, 152, 0.18);
  color: var(--text);
  background: rgba(3, 5, 4, 0.7);
}

.scan-row strong {
  color: var(--amber);
  font-size: 12px;
  text-transform: uppercase;
}

.scan-row.is-ok strong {
  color: var(--radar);
}

.discovery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.discovery div {
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid rgba(147, 161, 152, 0.16);
  background: rgba(166, 255, 77, 0.055);
}

.discovery span {
  color: var(--muted);
  font-size: 12px;
}

.discovery strong {
  overflow-wrap: anywhere;
  color: var(--radar);
  font-size: 13px;
}

.switch-row {
  margin-bottom: 22px;
}

.switch-row label,
.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(147, 161, 152, 0.18);
  background: rgba(3, 5, 4, 0.62);
}

input[type="checkbox"] {
  accent-color: var(--radar);
}

.mission-list {
  display: grid;
  gap: 8px;
  margin: 24px 0 0;
  padding-left: 28px;
}

.mission-list li {
  min-height: 32px;
  padding-left: 8px;
  color: var(--steel);
}

.mission-list li.is-done {
  color: var(--radar);
}

.radar {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid rgba(147, 161, 152, 0.18);
  background:
    radial-gradient(circle, rgba(166, 255, 77, 0.1), transparent 58%),
    rgba(3, 5, 4, 0.7);
}

.radar canvas {
  width: 100%;
  height: 100%;
}

.radar__readout {
  position: absolute;
  inset: auto auto 24px 24px;
  display: grid;
  gap: 2px;
}

.radar__readout strong {
  color: var(--radar);
  font-size: 34px;
  line-height: 1;
}

.radar__readout span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.console {
  border: 1px solid rgba(147, 161, 152, 0.18);
  background: rgba(3, 5, 4, 0.74);
}

.console header {
  display: flex;
  justify-content: space-between;
  min-height: 42px;
  padding: 12px;
  border-bottom: 1px solid rgba(147, 161, 152, 0.18);
  color: var(--steel);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.console header strong {
  color: var(--amber);
}

.console pre {
  min-height: 260px;
  max-height: 360px;
  margin: 0;
  overflow: auto;
  padding: 14px;
  color: var(--radar);
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.history {
  display: grid;
  gap: 10px;
  max-height: 260px;
  overflow: auto;
  padding: 12px;
}

.history p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.history__item {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(147, 161, 152, 0.18);
  background: rgba(166, 255, 77, 0.045);
}

.history__item strong {
  color: var(--text);
  font-size: 13px;
}

.history__item span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.history__item small {
  color: var(--amber);
  font-weight: 850;
  text-transform: uppercase;
}

@media (max-width: 1040px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    height: auto;
  }

  .steps {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .step {
    grid-template-columns: 1fr;
  }

  .step__index {
    min-height: 28px;
    border-right: 0;
    border-bottom: 1px solid rgba(147, 161, 152, 0.16);
  }

  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .workspace,
  .rail,
  .screen {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .steps,
  .field-grid,
  .discovery {
    grid-template-columns: 1fr;
  }

  .panel--primary {
    min-height: auto;
  }
}
