:root {
  color-scheme: light;
  --ink: #33263e;
  --muted: #63576d;
  --page: #f8f6f1;
  --rail: #efeaf0;
  --card: #fffcff;
  --line: #ded5e2;
  --lime: #deef9d;
  --amber: #faecd1;
  --danger: #922f42;
  --focus: #715089;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--page); }
button, input, textarea, select { color: inherit; font: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
a { color: #57376d; text-underline-offset: 3px; }
button, .button {
  display: inline-flex; gap: 6px; align-items: center; justify-content: center;
  min-height: 40px; padding: 8px 13px; border: 1px solid #cfc2d3; border-radius: 9px;
  background: white; color: var(--ink); font-weight: 650; text-decoration: none; cursor: pointer;
}
button:hover:not(:disabled), .button:hover { border-color: var(--ink); }
button:disabled { opacity: .66; cursor: default; }
button.primary { background: var(--ink); border-color: var(--ink); color: white; }
button.danger { background: var(--danger); border-color: var(--danger); color: white; }
button.quiet { border-color: transparent; background: none; padding-inline: 4px; color: #57376d; text-decoration: underline; }
.skip { position: fixed; top: 6px; left: 6px; background: white; padding: 10px; z-index: 5; transform: translateY(-150%); }
.skip:focus { transform: none; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 225px minmax(0,1fr); }
.rail { background: var(--rail); border-right: 1px solid var(--line); padding: 28px 17px 23px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.wordmark { display: flex; gap: 10px; align-items: center; font-size: 24px; font-weight: 680; letter-spacing: -.05em; }
.rail .wordmark, .rail .eyebrow { padding-inline: 10px; }
.mark { display: inline-grid; place-items: center; width: 39px; height: 39px; border-radius: 11px; background: var(--ink); color: white; font-size: 22px; font-weight: 720; letter-spacing: 0; }
.eyebrow { color: var(--muted); font-size: .75rem; text-transform: uppercase; font-weight: 710; letter-spacing: .11em; margin: 0 0 8px; }
.rail .eyebrow { margin: 21px 0 14px; }
nav { display: grid; gap: 4px; }
nav a { min-height: 41px; padding: 9px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 575; }
nav a:hover, nav a[aria-current="page"] { background: #fff; }
nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--ink); font-weight: 720; }
.staff { margin: auto 10px 0; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 4px; color: var(--muted); font-size: .82rem; }
.staff strong { color: var(--ink); }
.topbar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 66px; padding: 10px clamp(16px, 4vw, 52px); background: var(--page); border-bottom: 1px solid var(--line); }
.topbar p { margin: 0; }
main { padding: 32px clamp(16px, 4vw, 52px) 48px; max-width: 1650px; margin: auto; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { font-size: clamp(2.15rem, 4.5vw, 3.5rem); line-height: 1.07; letter-spacing: -.055em; margin: 0 0 11px; font-weight: 680; }
h2 { font-size: 1.3rem; letter-spacing: -.02em; margin: 0 0 12px; line-height: 1.23; }
h3 { font-size: 1rem; margin: 0 0 8px; line-height: 1.3; }
p { margin: 0 0 12px; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.hero p:last-child, .panel p:last-child { margin-bottom: 0; }
.muted, small, .unit { color: var(--muted); }
.small, small { font-size: .83rem; }
.row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin: 0 0 17px; }
.metric, .panel { min-width: 0; border: 1px solid var(--line); background: var(--card); border-radius: 13px; padding: 18px; }
.metric:first-child { background: #eef2d8; border-color: #d9e0b7; }
.metric .value { margin: 5px 0; font-size: clamp(1.3rem,2.7vw,2.45rem); line-height: 1.18; font-variant-numeric: tabular-nums; letter-spacing: -.04em; overflow-wrap: anywhere; }
.metric .value.missing { font-size: clamp(1.15rem,2vw,1.7rem); }
.unit { font-variant-numeric: tabular-nums; }
.grid { display: grid; grid-template-columns: minmax(0,1.75fr) minmax(260px,1fr); gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; }
.pill { display: inline-block; border-radius: 999px; padding: 4px 10px; line-height: 1.3; background: #eee8f0; color: var(--ink); font-size: .8rem; font-weight: 660; }
.pill.ok { background: var(--lime); color: #2e3b1b; }
.pill.warn { background: var(--amber); color: #694016; }
.pill.alert { background: #f6dce0; color: #712335; }
.panel header { display: flex; align-items: start; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.steps { display: grid; list-style: none; padding: 0; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 8px; margin: 0 0 17px; }
.steps li { border-radius: 8px; background: #eee8f0; padding: 8px 11px; font-weight: 650; font-size: .86rem; }
.steps .complete { background: var(--lime); }
.steps .current { background: var(--amber); }
.feedback { position: sticky; top: 66px; z-index: 2; padding: 10px clamp(16px,4vw,52px); background: #eee8f0; border-bottom: 1px solid var(--line); }
.feedback.error { background: #f9e0e2; color: #712335; }
.table-wrap { overflow: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: .77rem; color: var(--muted); letter-spacing: .035em; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
th button.quiet { min-height: 28px; padding-block: 0; }
td { overflow-wrap: anywhere; }
td.number { text-align: right; white-space: nowrap; }
.caption, caption { text-align: left; color: var(--muted); font-size: .84rem; padding: 8px 0; }
.empty { border: 1px dashed #d4c8d7; border-radius: 9px; background: #faf7fa; color: var(--muted); padding: 15px; }
dl { display: grid; grid-template-columns: minmax(110px, .85fr) minmax(0, 1.75fr); margin: 0; gap: 0 12px; }
dt, dd { margin: 0; padding: 7px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
dt { color: var(--muted); }
dd { font-variant-numeric: tabular-nums; }
form { display: grid; gap: 8px; }
form label { font-weight: 620; }
input:not([type="checkbox"]), textarea, select { width: 100%; min-height: 40px; padding: 8px 10px; background: white; border: 1px solid #bdb0c2; border-radius: 8px; }
textarea { min-height: 90px; resize: vertical; }
input[type="checkbox"] { margin-right: 7px; inline-size: 1.1rem; block-size: 1.1rem; vertical-align: middle; }
form > button { justify-self: start; margin-top: 5px; }
.field { display: grid; align-content: start; gap: 5px; }
.fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
fieldset { margin: 6px 0; padding: 13px; border: 1px solid var(--line); border-radius: 9px; min-width: 0; }
legend { font-weight: 700; }
details > summary { cursor: pointer; color: #57376d; font-weight: 650; padding: 7px 0; }
details > :not(summary):first-of-type { margin-top: 6px; }
code, pre { font-family: ui-monospace, SFMono-Regular, monospace; font-size: .8rem; overflow-wrap: anywhere; }
pre { white-space: pre-wrap; border-radius: 8px; background: #f4eff4; padding: 12px; }
.copy { min-height: 28px; white-space: nowrap; font-size: .82rem; font-family: ui-monospace, SFMono-Regular, monospace; }
.login { width: min(92%, 450px); margin: max(5vh,30px) auto; padding: clamp(22px,6vw,38px); border-radius: 18px; border: 1px solid var(--line); background: var(--card); }
.login .eyebrow { margin-top: 22px; }
.login form { margin: 20px 0; }
dialog { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 15px; max-width: min(93vw, 490px); padding: 25px; }
dialog::backdrop { background: #33263e6b; }
.dialog-actions { justify-content: flex-end; }
@media (max-width: 930px) {
  .shell { grid-template-columns: 177px minmax(0,1fr); }
  .grid { grid-template-columns: 1fr; }
  .rail { padding-inline: 11px; }
  .steps { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 650px) {
  .shell { display: block; }
  .rail { position: static; height: auto; padding: 12px 12px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail .eyebrow, .staff { display: none; }
  nav { display: flex; flex-wrap: wrap; margin-top: 8px; }
  nav a { padding: 7px 8px; min-height: 37px; }
  .topbar { min-height: 60px; font-size: .85rem; }
  .feedback { position: static; }
  main { padding-top: 24px; }
  .hero { align-items: start; flex-direction: column; }
  .metrics, .fields { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(3, 1fr); }
}
main > .grid + .stack, main > .grid + .panel, main > .panel + .panel, main > .stack + .panel { margin-top: 17px; }
