:root {
  color-scheme: light;
  --ink: #12212d;
  --muted: #62717c;
  --line: #dbe2e6;
  --canvas: #f4f7f5;
  --surface: #ffffff;
  --surface-soft: #edf3f0;
  --forest: #0b5d4b;
  --forest-dark: #074638;
  --mint: #bcebd8;
  --amber: #c88009;
  --red: #b42318;
  --red-dark: #8d1a12;
  --shadow: 0 18px 50px rgba(18, 33, 45, .08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--canvas); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--canvas); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  min-height: 74px; padding: 12px clamp(18px, 4vw, 56px); border-bottom: 1px solid rgba(219, 226, 230, .85);
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand > span:last-child { display: grid; }
.brand strong { font-size: 16px; letter-spacing: -.01em; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.brand-mark { display: flex; align-items: end; gap: 4px; width: 48px; height: 48px; padding: 10px; border-radius: 14px; background: var(--forest); box-shadow: 0 10px 24px rgba(11, 93, 75, .23); }
.brand-mark span { display: block; width: 6px; border-radius: 8px; background: var(--mint); }
.brand-mark span:nth-child(1) { height: 12px; }
.brand-mark span:nth-child(2) { height: 25px; }
.brand-mark span:nth-child(3) { height: 18px; }
.brand-mark.small { width: 42px; height: 42px; padding: 9px; border-radius: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 16px; border: 1px solid transparent; border-radius: 10px; font-weight: 700; font-size: 13px; line-height: 1.2; text-decoration: none; cursor: pointer; transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid rgba(11, 93, 75, .2); outline-offset: 2px; }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.button-primary { color: white; background: var(--forest); }
.button-primary:hover { background: var(--forest-dark); }
.button-secondary { color: var(--forest); border-color: #b9cec6; background: #fff; }
.button-danger { color: white; background: var(--red); }
.button-danger:hover { background: var(--red-dark); }
.button-quiet { color: var(--muted); background: transparent; border-color: var(--line); }
.button-wide { width: 100%; }
.button-large { min-height: 48px; padding-inline: 22px; }
.button-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.status-pill, .badge { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; border-radius: 999px; font-size: 12px; font-weight: 750; }
.status-pill { padding: 8px 11px; background: #edf6f2; color: var(--forest); }
.status-pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(11, 93, 75, .12); }
.status-pill.status-live { color: var(--red); background: #fff0ef; }
.badge { padding: 7px 10px; border: 1px solid var(--line); color: var(--muted); background: #fff; }
.badge-safe { color: var(--forest); border-color: #b9d8cc; background: #edf6f2; }

.page-shell { width: min(1120px, calc(100% - 36px)); margin: 0 auto; padding: 54px 0 80px; }
.hero { display: grid; grid-template-columns: 1.4fr .8fr; gap: 40px; align-items: end; margin-bottom: 30px; }
.hero h1 { max-width: 700px; margin: 7px 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(38px, 6vw, 66px); font-weight: 500; line-height: .98; letter-spacing: -.045em; }
.hero p:not(.eyebrow) { max-width: 660px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.55; }
.eyebrow { margin: 0; color: var(--forest); font-size: 11px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.readiness-card { display: grid; gap: 2px; padding: 13px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, .7); }
.readiness-card > div { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px; padding: 9px; }
.readiness-card span:not(.readiness-dot) { color: var(--muted); font-size: 13px; }
.readiness-card strong { font-size: 12px; }
.readiness-dot { width: 9px; height: 9px; border-radius: 50%; background: #b5bec4; }
.readiness-dot.ready { background: var(--forest); box-shadow: 0 0 0 4px rgba(11, 93, 75, .1); }

.notice, .alert { border-radius: 12px; padding: 13px 15px; font-size: 13px; line-height: 1.5; }
.notice { margin-bottom: 22px; border: 1px solid #ebd6ad; color: #76520d; background: #fff9eb; }
.alert { position: sticky; top: 86px; z-index: 15; margin-bottom: 16px; border: 1px solid #b9d8cc; color: var(--forest-dark); background: #edf6f2; box-shadow: var(--shadow); }
.alert-error { position: static; color: var(--red-dark); border-color: #efc4c0; background: #fff3f2; box-shadow: none; }

.wizard { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.step-card { display: grid; grid-template-columns: 58px 1fr; gap: 6px; padding: clamp(22px, 4vw, 38px); border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.step-number { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; color: white; background: var(--ink); font-weight: 800; }
.step-content { min-width: 0; }
.step-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
.step-heading h2 { margin: 5px 0 0; font-size: clamp(22px, 3vw, 30px); letter-spacing: -.025em; }
.supporting { margin: 0 0 22px; max-width: 790px; color: var(--muted); line-height: 1.55; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.compact { margin-top: 18px; }
.field { display: grid; gap: 7px; color: var(--ink); font-size: 13px; font-weight: 750; }
.field small { color: var(--muted); font-weight: 500; }
.field-wide { grid-column: 1 / -1; }
input[type="text"], input[type="password"], input[type="number"] { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #c9d2d7; border-radius: 9px; color: var(--ink); background: white; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--forest); flex: 0 0 auto; }
.fine-print { color: var(--muted); font-size: 12px; line-height: 1.45; }

.drop-zone { display: grid; place-items: center; gap: 6px; min-height: 160px; padding: 25px; border: 1.5px dashed #9eb6ad; border-radius: 14px; text-align: center; cursor: pointer; background: #f7fbf9; }
.template-link { display: inline-block; margin: -8px 0 14px; color: var(--forest); font-size: 13px; font-weight: 750; text-underline-offset: 3px; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--forest); background: #eff8f4; }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-zone span { color: var(--muted); font-size: 12px; }
.upload-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: white !important; background: var(--forest); font-size: 19px !important; }
.validation-result { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.validation-summary { display: flex; justify-content: space-between; color: var(--forest); font-size: 13px; }
.target-list { display: grid; gap: 8px; margin-top: 12px; }
.target-row { display: grid; grid-template-columns: 1.3fr .8fr .8fr; gap: 12px; padding: 11px 13px; border-radius: 9px; background: var(--surface-soft); font-size: 12px; }
.target-row span { overflow-wrap: anywhere; }

fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
.mode-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mode-picker legend { margin-bottom: 10px; font-size: 13px; font-weight: 800; }
.mode-picker label { display: flex; gap: 10px; min-height: 90px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.mode-picker label:has(input:checked) { border-color: var(--forest); box-shadow: inset 0 0 0 1px var(--forest); background: #f3faf7; }
.mode-picker span, .toggle-list span { display: grid; gap: 4px; }
.mode-picker small, .toggle-list small { color: var(--muted); line-height: 1.4; }
.settings-panel { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.settings-panel summary { cursor: pointer; font-weight: 750; }
.toggle-list { display: grid; gap: 10px; margin-top: 18px; }
.toggle-list label, .production-gates > label:not(.field) { display: flex; gap: 10px; align-items: start; padding: 11px; border-radius: 9px; background: var(--surface-soft); font-size: 13px; }
.production-gates { margin-top: 18px; padding: 18px; border: 1px solid #e3c39a; border-radius: 13px; background: #fff9ef; }
.production-gates h3 { margin: 0 0 12px; }
.production-gates > label { margin-top: 8px; }
.confirmation-field { margin-top: 16px; }
code { padding: 2px 5px; border-radius: 5px; background: #e8ecea; font-size: .9em; }
.run-actions { border-top: 1px solid var(--line); padding-top: 18px; }

.empty-state { min-height: 100px; display: grid; place-items: center; padding: 22px; border: 1px dashed #bdc8ce; border-radius: 12px; color: var(--muted); text-align: center; }
.run-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.run-summary > div { display: grid; gap: 4px; padding: 12px; border-radius: 10px; background: var(--surface-soft); }
.run-summary small { color: var(--muted); }
.run-logs { min-height: 130px; max-height: 320px; overflow: auto; margin: 14px 0 0; padding: 16px; border-radius: 11px; color: #d9f3e9; background: #10241f; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px clamp(18px, 4vw, 56px); border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

.login-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: radial-gradient(circle at top right, #d7f1e7 0, transparent 38%), var(--canvas); }
.login-shell { width: min(460px, 100%); }
.login-panel { padding: clamp(30px, 7vw, 52px); border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: var(--shadow); }
.login-panel h1 { margin: 14px 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: 40px; font-weight: 500; letter-spacing: -.035em; }
.login-panel .lede { color: var(--muted); line-height: 1.55; }
.login-form { display: grid; gap: 9px; margin: 25px 0 17px; font-size: 13px; font-weight: 750; }
.login-form .button { margin-top: 7px; }

@media (max-width: 820px) {
  .topbar { align-items: flex-start; gap: 12px; }
  .topbar-actions { justify-content: flex-end; flex-wrap: wrap; }
  .brand small, #sign-out { display: none; }
  .hero { grid-template-columns: 1fr; gap: 22px; }
  .mode-picker { grid-template-columns: 1fr; }
  .mode-picker label { min-height: 0; }
}

@media (max-width: 620px) {
  .topbar { position: static; display: grid; }
  .topbar-actions { justify-content: stretch; display: grid; grid-template-columns: 1fr 1fr; }
  .status-pill { grid-column: 1 / -1; justify-content: center; }
  .topbar .button { padding-inline: 9px; }
  .page-shell { width: min(100% - 22px, 1120px); padding-top: 34px; }
  .step-card { grid-template-columns: 1fr; padding: 20px 16px; border-radius: 16px; }
  .step-number { margin-bottom: 8px; }
  .step-heading { display: grid; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .target-row { grid-template-columns: 1fr; }
  .run-summary { grid-template-columns: 1fr; }
  .button-row .button { flex: 1 1 auto; }
  footer { display: grid; }
}
