:root {
  color-scheme: dark;
  --bg: #08111f;
  --surface: #101c2e;
  --surface-2: #15243a;
  --line: #293c59;
  --text: #eef4fb;
  --muted: #91a2b8;
  --green: #19b68c;
  --green-dark: #0d8f70;
  --blue: #4ba3ff;
  --orange: #f3a33c;
  --red: #ef6262;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; letter-spacing: 0; }
button, input { min-width: 0; font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

.topbar {
  height: 64px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line); background: #0b1626; position: sticky; top: 0; z-index: 10;
}
.topbar strong { font-size: 18px; margin-right: 16px; }
.page { width: min(1180px, calc(100% - 32px)); margin: 24px auto 56px; }

.status-band {
  display: grid; grid-template-columns: 210px 1fr 44px; gap: 24px; align-items: center;
  padding: 20px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
.eyebrow { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.profile-tabs { display: inline-flex; padding: 3px; background: #081425; border: 1px solid var(--line); border-radius: 7px; }
.profile-tab { width: 70px; height: 36px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font-weight: 700; }
.profile-tab.active { color: #fff; background: var(--green-dark); }
.dns-list { display: grid; gap: 7px; }
.dns-row { display: grid; grid-template-columns: minmax(150px, 1fr) 140px 12px; gap: 16px; align-items: center; }
.dns-row strong { font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.dot.orange { background: var(--orange); }
.icon-button { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--green); background: transparent; color: var(--green); font-size: 24px; }

.workspace, .history-section { margin-top: 18px; padding: 24px; border-top: 1px solid var(--line); background: var(--surface); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-heading > div { display: flex; align-items: center; gap: 10px; }
.section-heading h2 { font-size: 18px; margin: 0; }
.step { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--green-dark); font-weight: 800; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
fieldset { margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: 7px; }
legend { padding: 0 8px; font-weight: 700; color: #cbd7e5; }
label { display: grid; gap: 7px; color: #b7c5d7; margin-bottom: 14px; }
input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--text); outline: none; }
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(25,182,140,.13); }
input[readonly] { color: var(--muted); }
.pair { display: grid; grid-template-columns: 1fr 1.2fr; gap: 12px; }
.actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 18px; }
button.primary, button.secondary, button.danger, button.ghost { min-height: 42px; padding: 0 18px; border-radius: 6px; font-weight: 700; }
button.primary { color: #fff; border: 1px solid var(--green); background: var(--green-dark); }
button.secondary { color: var(--green); border: 1px solid var(--green); background: transparent; }
button.danger { color: #fff; border: 1px solid var(--red); background: #a83b43; }
button.ghost { color: var(--muted); border: 1px solid var(--line); background: transparent; }
button:disabled { cursor: not-allowed; opacity: .45; }
.preflight-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.preflight-grid pre, .job-log { margin: 0; padding: 16px; border: 1px solid var(--line); background: #07101d; color: #bcd0e6; border-radius: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.confirm-row { display: flex; grid-template-columns: none; align-items: flex-start; gap: 10px; margin: 18px 0 0; }
.confirm-row input { width: 18px; min-height: 18px; margin-top: 2px; accent-color: var(--green); }
.toggle-row { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: #0b1727; }
.toggle-row input { width: 18px; min-height: 18px; margin-top: 2px; accent-color: var(--green); }
.toggle-row span { display: grid; gap: 3px; }
.toggle-row small { color: var(--muted); }
.actions.compact { margin-top: 12px; padding: 0; }
.job-summary { margin-bottom: 12px; }
.job-log { height: 280px; overflow: auto; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.status-pill { display: inline-flex; align-items: center; min-height: 28px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700; }
.status-pill.running, .status-pill.queued { color: var(--blue); border-color: var(--blue); }
.status-pill.completed { color: var(--green); border-color: var(--green); }
.status-pill.failed { color: var(--red); border-color: var(--red); }
.history-list { display: grid; }
.history-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 52px; padding: 8px 4px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; }
.toast { position: fixed; right: 20px; bottom: 20px; max-width: min(420px, calc(100% - 40px)); padding: 13px 16px; background: #164e40; border: 1px solid var(--green); border-radius: 6px; box-shadow: 0 12px 36px rgba(0,0,0,.35); z-index: 30; }
.toast.error, .alert.error { background: #4b2028; border-color: var(--red); }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-shell { width: 100%; max-width: 420px; min-width: 0; }
.login-panel { width: 100%; min-width: 0; padding: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 7px; background: var(--green-dark); color: #fff; font-size: 22px; font-weight: 900; }
.login-panel h1 { margin: 22px 0 8px; font-size: 24px; }
.login-panel p { margin: 0 0 24px; color: var(--muted); }
.alert { padding: 11px 12px; margin-bottom: 16px; border: 1px solid; border-radius: 6px; }
.wide { width: 100%; }

@media (max-width: 760px) {
  .desktop-only { display: none; }
  .topbar { height: 58px; padding: 0 16px; }
  .page { width: 100%; margin: 0 auto 32px; }
  .status-band { grid-template-columns: 1fr 44px; gap: 14px; border-left: 0; border-right: 0; border-radius: 0; padding: 18px 16px; }
  .status-band > div:first-child { grid-column: 1; }
  .dns-list { grid-column: 1 / -1; grid-row: 2; }
  .icon-button { grid-column: 2; grid-row: 1; }
  .dns-row { grid-template-columns: 1fr auto 10px; gap: 8px; font-size: 13px; }
  .workspace, .history-section { margin-top: 10px; padding: 20px 16px; }
  .section-heading { align-items: flex-start; }
  .section-heading > .muted { font-size: 12px; text-align: right; }
  .form-grid, .preflight-grid { grid-template-columns: 1fr; }
  fieldset { padding: 14px; }
  .actions { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(to top, var(--surface) 75%, transparent); }
  .actions button { flex: 1; }
  .job-log { height: 340px; }
  .login-panel { padding: 24px; }
}
