:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #071019;
  color: #eaf2fb;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #071019; color: #eaf2fb; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
code { font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace; font-size: .9em; }

.shell { width: min(920px, calc(100% - 32px)); margin: 0 auto; padding: 36px 0 72px; }
.shell.wide { width: min(1160px, calc(100% - 32px)); }
.hero { margin-bottom: 28px; }
.eyebrow, .step { margin: 0 0 12px; font-size: .78rem; font-weight: 800; letter-spacing: .15em; color: #7db7ff; }
h1 { margin: 0; max-width: 760px; font-size: clamp(2.5rem, 7vw, 5rem); line-height: .98; letter-spacing: -.05em; }
h2 { margin: 4px 0 14px; font-size: clamp(1.45rem, 3vw, 2rem); letter-spacing: -.025em; }
.lede { max-width: 780px; margin: 22px 0 0; font-size: 1.05rem; line-height: 1.7; color: #c5d7ea; }

.boundary, .card, .status-grid { border: 1px solid #29465f; border-radius: 16px; background: #0c1924; }
.boundary { display: grid; gap: 9px; padding: 20px; margin: 24px 0; line-height: 1.55; color: #d8e7f5; }
.boundary strong { color: #66c5ff; }
.compact-boundary { grid-template-columns: auto 1fr; align-items: start; column-gap: 18px; }
.compact-boundary strong { grid-row: 1 / span 2; }

.status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 24px 0; overflow: hidden; }
.status-grid.runtime-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.status-grid div { padding: 15px 18px; border-bottom: 1px solid #243d50; }
.status-grid div:nth-child(odd) { border-right: 1px solid #243d50; }
.status-grid.runtime-grid div { border-right: 1px solid #243d50; }
.status-grid.runtime-grid div:nth-child(4n) { border-right: 0; }
.status-grid.runtime-grid div:nth-last-child(-n+4) { border-bottom: 0; }
.status-grid:not(.runtime-grid) div:nth-last-child(-n+2) { border-bottom: 0; }
.status-grid.compact { margin: 16px 0 0; background: #08141d; }
dt { color: #93b3cc; font-size: .82rem; margin-bottom: 5px; }
dd { margin: 0; overflow-wrap: anywhere; font-weight: 650; }
.status { margin: 20px 0; color: #9fcaef; }

.card { margin-top: 24px; padding: clamp(20px, 4vw, 30px); }
.card p { color: #bfd0df; line-height: 1.65; }
.card.success { border-color: #2c6d55; background: #091c19; }
.card.critical { border-color: #6d5931; background: #1a160c; }
.card.error { border-color: #8f3946; background: #261015; }
.slim-card { padding: 18px 20px; }

form { display: grid; gap: 12px; margin-top: 20px; }
.form-compact { max-width: 640px; }
label { font-weight: 700; color: #dce8f3; }
input[type="password"], input[type="file"], input[type="text"], select, textarea {
  width: 100%; border: 1px solid #36556e; border-radius: 10px; background: #06101a; color: #edf6ff; padding: 13px;
}
input[type="file"] { padding: 10px; }
select { appearance: auto; }
textarea { min-height: 110px; resize: vertical; }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0; font-weight: 500; line-height: 1.5; color: #c2d3e2; }
.check input { margin-top: 4px; }
button, .button-link { border: 0; border-radius: 10px; padding: 13px 17px; background: #e8f3ff; color: #071019; font-weight: 800; text-decoration: none; display: inline-block; }
button:hover, .button-link:hover { filter: brightness(.96); }
button:disabled { opacity: .55; cursor: progress; }
button.secondary, .button-link.secondary { border: 1px solid #36556e; background: #102433; color: #dcecff; }
button.danger { border: 1px solid #70434b; background: #2a151a; color: #ffdbe1; }
button.small { padding: 8px 10px; font-size: .82rem; }
a { color: #85c8ff; }
.final-note { margin-bottom: 0; }
.muted { color: #8fa8bc !important; }

.toolbar, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.toolbar-actions, .inline-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar .step, .section-heading .step { margin-bottom: 4px; }
.two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }

.object-list, .draft-list { display: grid; gap: 10px; margin-top: 18px; }
.object-row, .draft-row { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 14px 16px; border: 1px solid #233e53; border-radius: 12px; background: #08151f; }
.object-copy { min-width: 0; display: grid; gap: 4px; }
.object-copy strong { overflow-wrap: anywhere; }
.object-copy > span { color: #91abc0; font-size: .84rem; overflow-wrap: anywhere; }
.object-copy .object-value { color: #d4e2ee; font-size: .93rem; }
.object-actions { flex: 0 0 auto; }
.draft-row > span { color: #c8d9e7; overflow-wrap: anywhere; }
.review-list { display: grid; gap: 8px; color: #d4e2ee; line-height: 1.5; }
.error-inline { margin-top: 16px; padding: 14px; border: 1px solid #8f3946; border-radius: 10px; background: #261015; }
.error-inline p { margin-bottom: 0; }

.diagnostics-card summary { cursor: pointer; font-weight: 800; color: #a8cce8; }
.diagnostics-card pre { max-height: 280px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; padding: 14px; border-radius: 10px; background: #050c12; color: #9bb7cc; font-size: .78rem; }

[hidden] { display: none !important; }

@media (max-width: 900px) {
  .status-grid.runtime-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-grid.runtime-grid div:nth-child(4n) { border-right: 1px solid #243d50; }
  .status-grid.runtime-grid div:nth-child(2n) { border-right: 0; }
  .status-grid.runtime-grid div:nth-last-child(-n+4) { border-bottom: 1px solid #243d50; }
  .status-grid.runtime-grid div:nth-last-child(-n+2) { border-bottom: 0; }
}

@media (max-width: 700px) {
  .two-column { grid-template-columns: 1fr; gap: 0; }
  .toolbar, .section-heading, .object-row, .draft-row { align-items: stretch; flex-direction: column; }
  .toolbar-actions, .inline-actions, .object-actions { width: 100%; }
  .toolbar-actions button, .toolbar-actions .button-link, .inline-actions button, .inline-actions .button-link, .object-actions button { flex: 1 1 auto; text-align: center; }
  .compact-boundary { grid-template-columns: 1fr; }
  .compact-boundary strong { grid-row: auto; }
}

@media (max-width: 650px) {
  .shell, .shell.wide { width: min(100% - 22px, 920px); padding-top: 24px; }
  .status-grid, .status-grid.runtime-grid { grid-template-columns: 1fr; }
  .status-grid div, .status-grid div:nth-child(odd), .status-grid div:nth-last-child(-n+2),
  .status-grid.runtime-grid div, .status-grid.runtime-grid div:nth-child(2n), .status-grid.runtime-grid div:nth-child(4n), .status-grid.runtime-grid div:nth-last-child(-n+4) {
    border-right: 0; border-bottom: 1px solid #243d50;
  }
  .status-grid div:last-child, .status-grid.runtime-grid div:last-child { border-bottom: 0; }
}
