:root {
  color-scheme: dark;
  --bg: #020617;
  --steel-0: #07111f;
  --steel-1: #0b1220;
  --steel-2: #111827;
  --steel-3: #1f2937;
  --panel: rgba(11, 18, 32, 0.9);
  --panel-strong: rgba(15, 23, 42, 0.96);
  --line: rgba(148, 163, 184, 0.24);
  --line-strong: rgba(96, 165, 250, 0.58);
  --text: #e5e7eb;
  --text-bright: #f9fafb;
  --muted: #9ca3af;
  --muted-soft: #6b7280;
  --accent: #3b82f6;
  --accent-soft: #60a5fa;
  --accent-2: #22d3ee;
  --danger: #ef4444;
  --ok: #22c55e;
  --field: rgba(2, 6, 23, 0.76);
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.46);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.075) 0, rgba(255, 255, 255, 0.018) 18%, transparent 34%),
    repeating-linear-gradient(100deg, rgba(255, 255, 255, 0.032) 0 1px, transparent 1px 9px),
    linear-gradient(180deg, rgba(17, 24, 39, 0.82) 0%, rgba(2, 6, 23, 0.98) 58%, #000 100%),
    var(--bg);
  background-size: auto, 18px 18px, auto, auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.05), transparent),
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.46));
}

button,
input,
textarea,
select {
  font: inherit;
}

.shell {
  position: relative;
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 44px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0 22px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mark {
  width: 52px;
  height: 52px;
  object-fit: contain;
  display: block;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: var(--text-bright);
  font-size: clamp(28px, 4vw, 50px);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
}

.eyebrow {
  color: var(--accent-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(96, 165, 250, 0.26);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.66);
  color: var(--muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.72);
}

.command-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.55fr);
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.control-panel,
.telemetry-panel,
.job-history {
  padding: 18px;
}

.panel-heading {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
}

.panel-heading.inline {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.preset-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.radio-card {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(31, 41, 55, 0.48), rgba(2, 6, 23, 0.5)),
    rgba(3, 10, 18, 0.72);
  cursor: pointer;
}

.radio-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.radio-card:has(input:checked) {
  border-color: var(--accent);
  background:
    linear-gradient(180deg, rgba(59, 130, 246, 0.16), rgba(34, 211, 238, 0.05)),
    rgba(2, 6, 23, 0.86);
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.2), 0 0 22px rgba(59, 130, 246, 0.12);
}

.radio-card span {
  font-weight: 800;
}

.radio-card small {
  color: var(--muted);
}

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

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

label,
fieldset {
  min-width: 0;
}

label span,
legend {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 6px;
  background: var(--field);
  color: var(--text);
  padding: 10px 11px;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 94px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

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

.options-band {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

fieldset {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 7px;
  background: rgba(2, 6, 23, 0.48);
  padding: 12px;
}

fieldset label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 7px 16px 7px 0;
  color: var(--text);
}

fieldset input {
  width: auto;
}

.launch-button,
.ghost-button {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(96, 165, 250, 0.22), rgba(37, 99, 235, 0.16)),
    rgba(2, 6, 23, 0.76);
  color: var(--text);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.launch-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 16px;
  padding: 0 16px;
  font-weight: 900;
}

.ghost-button {
  padding: 0 14px;
}

.launch-button:hover,
.ghost-button:hover {
  border-color: rgba(34, 211, 238, 0.62);
  background:
    linear-gradient(180deg, rgba(96, 165, 250, 0.28), rgba(34, 211, 238, 0.12)),
    rgba(2, 6, 23, 0.86);
}

.current-job {
  min-height: 112px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 7px;
  background: var(--panel-strong);
  padding: 14px;
}

.current-job.empty {
  color: var(--muted);
}

.job-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.stage {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.progress-rail {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  margin-top: 14px;
}

.progress-fill {
  height: 100%;
  width: 18%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 220ms ease;
}

.metric-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.metric {
  min-height: 72px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(31, 41, 55, 0.34), rgba(2, 6, 23, 0.5)),
    rgba(2, 8, 18, 0.62);
}

.metric strong {
  display: block;
  font-size: 22px;
}

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

.downloads {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.download-link {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  color: var(--text);
  text-decoration: none;
  background: rgba(59, 130, 246, 0.08);
}

.download-link:hover {
  border-color: var(--accent-soft);
  background: rgba(59, 130, 246, 0.13);
}

.job-history {
  margin-top: 18px;
}

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

.job-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  padding: 11px 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(31, 41, 55, 0.28), rgba(2, 6, 23, 0.44)),
    rgba(2, 8, 18, 0.62);
  cursor: pointer;
}

.job-row:hover {
  border-color: var(--accent);
}

.job-row small {
  color: var(--muted);
}

.badge {
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.badge.complete {
  color: var(--ok);
  border-color: rgba(34, 197, 94, 0.48);
}

.badge.failed {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.48);
}

.log-box {
  max-height: 240px;
  overflow: auto;
  margin-top: 12px;
  padding: 12px;
  border-radius: 7px;
  background: #020617;
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #bfdbfe;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

@media (max-width: 1020px) {
  .command-grid,
  .field-grid,
  .field-grid.compact,
  .options-band {
    grid-template-columns: 1fr;
  }

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

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

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