/* Moore Infinity BI Foundation — workpaper-style design system */

:root {
  --paper: #f3f5f9;
  --surface: #ffffff;
  --ink: #0f1b33;
  --ink-2: #46526b;
  --ink-3: #6f7a91;
  --rule: #dce2ec;
  --rule-soft: #ebeef4;
  --navy: #12213f;
  --cobalt: #2447d1;
  --cobalt-soft: #e8edfc;
  --tick: #12805c;
  --tick-soft: #e2f4ec;
  --flag: #c23a2e;
  --flag-soft: #fbebe9;
  --amber: #9a6200;
  --amber-soft: #fdf1da;
  --gold: #b8892b;
  --gold-soft: #f8efd9;

  --font-ui: "Schibsted Grotesk", ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  --font-read: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-code: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(15, 27, 51, 0.04), 0 8px 24px -12px rgba(15, 27, 51, 0.12);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--cobalt); text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; border-radius: 4px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ───── Type ───── */
.h-display {
  font-size: clamp(1.9rem, 1.2rem + 2.4vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 650;
  text-wrap: balance;
}
.h-page { font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.2rem); line-height: 1.12; letter-spacing: -0.02em; font-weight: 650; text-wrap: balance; }
.h-section { font-size: 1.2rem; line-height: 1.25; letter-spacing: -0.01em; font-weight: 640; }
.lede { color: var(--ink-2); font-size: 1.05rem; max-width: 60ch; }
.muted { color: var(--ink-3); }
.small { font-size: 0.875rem; }
.num, .stats b, .score, .caption span:last-child, .qnum, .code, .ref { font-variant-numeric: tabular-nums; }

/* ───── App bar ───── */
.appbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.appbar-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 20px;
  height: 60px; display: flex; align-items: center; gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 650; letter-spacing: -0.01em; }
.brand span, .linkbtn { white-space: nowrap; }
.brand-mark { width: 30px; height: 18px; flex: none; }
.brand small { font-weight: 500; color: var(--ink-3); font-size: 0.9rem; letter-spacing: 0; }
.appnav { display: flex; gap: 4px; margin-right: auto; }
.appnav a {
  color: var(--ink-2); text-decoration: none; font-weight: 550; font-size: 0.95rem;
  padding: 8px 12px; border-radius: var(--radius-sm);
}
.appnav a:hover { background: var(--rule-soft); color: var(--ink); }
.appnav a[aria-current="page"] { color: var(--ink); background: var(--rule-soft); }
.usermenu { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--navy); color: #fff; font-size: 0.8rem; font-weight: 650;
  display: grid; place-items: center; letter-spacing: 0.02em;
}
.usermenu .who { font-size: 0.9rem; line-height: 1.2; text-align: right; }
.usermenu .who b { display: block; font-weight: 600; }
.usermenu .who span { color: var(--ink-3); font-size: 0.8rem; }
.linkbtn { background: none; border: 0; padding: 6px 8px; color: var(--ink-2); font: inherit; font-size: 0.9rem; cursor: pointer; border-radius: var(--radius-sm); }
.linkbtn:hover { background: var(--rule-soft); color: var(--ink); }

/* ───── Layout ───── */
.wrap { max-width: 1120px; margin: 0 auto; padding: 36px 20px 80px; }
.stack > * + * { margin-top: var(--gap, 16px); }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between { justify-content: space-between; }
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.panel-pad { padding: 24px; }
.pagehead { margin-bottom: 28px; display: grid; gap: 10px; }

/* ───── Flash ───── */
.flash {
  max-width: 1120px; margin: 16px auto 0; padding: 0 20px;
}
.flash > div {
  padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.95rem; font-weight: 500;
  border: 1px solid; display: flex; gap: 10px; align-items: flex-start;
}
.flash .ok { background: var(--tick-soft); border-color: #b7e0cd; color: #0b5a40; }
.flash .err { background: var(--flag-soft); border-color: #f1c4bf; color: #8e261d; }

/* ───── Buttons ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 0.95rem; line-height: 1;
  padding: 12px 18px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  background: var(--navy); color: #fff;
  transition: background-color 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { background: #1c3160; }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--rule); }
.btn-ghost:hover { background: var(--paper); border-color: #c5cdda; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: #a37a22; }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 13px; font-size: 0.875rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ───── Forms ───── */
.field { display: grid; gap: 6px; }
.field label { font-size: 0.875rem; font-weight: 600; color: var(--ink-2); }
.input {
  width: 100%; font: inherit; color: var(--ink);
  padding: 11px 13px; border: 1px solid #c9d1de; border-radius: var(--radius-sm);
  background: #fff; min-height: 44px;
}
.input:hover { border-color: #aab4c6; }
.input:focus { outline: 2px solid var(--cobalt); outline-offset: 0; border-color: var(--cobalt); }
.hint { font-size: 0.85rem; color: var(--ink-3); }
.form-error { background: var(--flag-soft); color: #8e261d; border: 1px solid #f1c4bf; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.92rem; }

/* ───── Tick box (the signature mark) ───── */
.tickbox {
  width: 30px; height: 30px; flex: none; border-radius: 7px;
  border: 1.5px solid #b9c2d3; background: #fff; display: grid; place-items: center; position: relative;
}
.tickbox svg { width: 18px; height: 18px; }
.tickbox.is-done { border-color: var(--tick); background: var(--tick-soft); }
.tickbox.is-done svg path { stroke: var(--tick); }
.tickbox.is-current { border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--cobalt-soft); }
.tickbox.is-started::after {
  content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--cobalt); opacity: 0.85;
}
.tickbox.is-done::after { content: none; }
.tickbox .tick-path { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* ───── Segment bar (7 phases) ───── */
.segments { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.segments i { display: block; height: 8px; border-radius: 3px; background: var(--rule); }
.segments i.is-done { background: var(--tick); }
.segments i.is-started { background: linear-gradient(90deg, var(--cobalt) 50%, var(--rule) 50%); }
.segments-sm { gap: 3px; min-width: 112px; }
.segments-sm i { height: 6px; border-radius: 2px; }
.segments-lg i { height: 12px; border-radius: 4px; }

/* ───── Pills ───── */
.pill {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: 0.8rem; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: var(--rule-soft); color: var(--ink-2);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.7; }
.pill-done { background: var(--tick-soft); color: #0b5a40; }
.pill-wait { background: var(--amber-soft); color: var(--amber); }
.pill-live { background: var(--cobalt-soft); color: #1a36a0; }
.pill-gold { background: var(--gold-soft); color: #7d5a14; }

/* ───── Continue card (dashboard hero) ───── */
.dash-hero { display: grid; gap: 28px; margin-bottom: 36px; }
.continue {
  display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center;
  padding: 26px; background: var(--surface);
  border: 1px solid var(--rule); border-left: 4px solid var(--cobalt); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.ref {
  font-family: var(--font-code); font-weight: 500; font-size: 1.05rem;
  border: 1.5px solid var(--ink); border-radius: 6px; padding: 8px 11px;
  letter-spacing: -0.02em; transform: rotate(-3deg); color: var(--ink); background: #fff;
  white-space: nowrap;
}
.continue h2 { font-size: 1.35rem; letter-spacing: -0.015em; font-weight: 650; line-height: 1.2; }
.continue p { color: var(--ink-2); margin-top: 4px; max-width: 56ch; }
.continue .meta { color: var(--ink-3); font-size: 0.875rem; margin-top: 8px; }

.progress-line { display: grid; gap: 10px; max-width: 520px; }
.progress-line .caption { display: flex; justify-content: space-between; color: var(--ink-2); font-size: 0.92rem; font-weight: 550; }

.approved-card {
  display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 22px 26px; border-radius: var(--radius);
  background: var(--gold-soft); border: 1px solid #e8d4a0;
}
.approved-card h2 { font-size: 1.15rem; font-weight: 650; }
.note-card {
  padding: 18px 22px; border-radius: var(--radius); background: var(--amber-soft);
  border: 1px solid #f0d9a4; color: #6b4300;
}
.note-card b { font-weight: 650; }

/* ───── Ledger (phase list) ───── */
.ledger { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.ledger li + li { border-top: 1px solid var(--rule-soft); }
.ledger a.entry {
  display: grid; grid-template-columns: 30px 64px 1fr auto; gap: 16px; align-items: center;
  padding: 18px 22px; color: inherit; text-decoration: none;
}
.ledger a.entry:hover { background: #fafbfd; }
.ledger .code { font-family: var(--font-code); font-size: 0.9rem; color: var(--ink-3); }
.ledger .title { font-weight: 620; letter-spacing: -0.005em; }
.ledger .desc { color: var(--ink-3); font-size: 0.92rem; margin-top: 2px; max-width: 62ch; }
.ledger .when { text-align: right; font-size: 0.875rem; color: var(--ink-3); display: grid; gap: 4px; justify-items: end; }
.ledger li.is-current { background: linear-gradient(90deg, var(--cobalt-soft), transparent 40%); }

/* ───── Phase page ───── */
.phase-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 48px; align-items: start; }
.outline { position: sticky; top: 84px; display: grid; gap: 4px; }
.outline h2 { font-size: 0.9rem; font-weight: 650; color: var(--ink-2); padding: 0 10px 8px; }
.outline a {
  display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: var(--radius-sm); text-decoration: none; color: var(--ink-2); font-size: 0.9rem; line-height: 1.3;
}
.outline a:hover { background: var(--rule-soft); }
.outline a[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 620; box-shadow: inset 0 0 0 1px var(--rule); }
.outline .tickbox { width: 22px; height: 22px; border-radius: 6px; }
.outline .tickbox svg { width: 13px; height: 13px; }
.outline .tickbox.is-started::after { width: 7px; height: 7px; }

.lesson-head { display: grid; gap: 12px; margin-bottom: 28px; }
.crumb { color: var(--ink-3); font-size: 0.9rem; text-decoration: none; }
.crumb:hover { color: var(--ink); }
.lesson-head .meta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; color: var(--ink-3); font-size: 0.9rem; }

.prose { font-family: var(--font-read); font-size: 1.125rem; line-height: 1.72; max-width: 66ch; color: #19243b; }
.prose > * + * { margin-top: 1.1em; }
.prose p { margin: 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin-bottom: 0; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--ink-3); }
.prose strong { font-weight: 650; color: var(--ink); }
.prose a { color: var(--cobalt); }
.prose code {
  font-family: var(--font-code); font-size: 0.82em; background: var(--rule-soft);
  padding: 0.14em 0.4em; border-radius: 4px; color: #1b2a4d;
}
.prose pre {
  font-family: var(--font-code); font-size: 0.86rem; line-height: 1.65;
  background: var(--navy); color: #e7ecf8; padding: 18px 20px; border-radius: var(--radius);
  overflow-x: auto; margin-top: 1.2em;
}
.prose pre code { background: none; padding: 0; color: inherit; font-size: inherit; }

.prose h2, .prose h3 { font-family: var(--font-ui); letter-spacing: -0.015em; line-height: 1.25; color: var(--ink); text-wrap: balance; }
.prose h2 { font-size: 1.55rem; font-weight: 650; margin-top: 2.2em; padding-top: 0.2em; }
.prose h3 { font-size: 1.2rem; font-weight: 640; margin-top: 1.7em; }
.prose > h2:first-child, .prose > p:first-child + h2 { margin-top: 1.6em; }
.prose h2 + *, .prose h3 + * { margin-top: 0.7em; }
.prose ol { padding-left: 1.5em; }
.prose table { width: 100%; border-collapse: collapse; font-family: var(--font-ui); font-size: 0.92rem; line-height: 1.5; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 11px 14px; border-bottom: 1px solid var(--rule-soft); }
.prose th { background: #fafbfd; font-weight: 600; color: var(--ink-2); font-size: 0.85rem; white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }
.prose td code { font-size: 0.85em; white-space: nowrap; }
.callout { font-family: var(--font-ui); font-size: 0.95rem; line-height: 1.55; padding: 14px 18px; background: var(--cobalt-soft); border-left: 3px solid var(--cobalt); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: #16246b; }
.callout.audit { background: var(--gold-soft); border-left-color: var(--gold); color: #5d4410; }
.callout strong { color: inherit; }
.callout code { background: rgba(255, 255, 255, 0.6); }

.milestone {
  margin-top: 32px; max-width: 66ch; display: grid; grid-template-columns: 30px 1fr; gap: 14px;
  padding: 18px 20px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
}
.milestone b { display: block; font-weight: 650; margin-bottom: 2px; }
.milestone p { color: var(--ink-2); font-size: 0.98rem; }
.milestone code { font-family: var(--font-code); font-size: 0.85em; background: var(--rule-soft); padding: 0.1em 0.35em; border-radius: 4px; }

/* ───── Quiz ───── */
.quiz { margin-top: 56px; max-width: 720px; scroll-margin-top: 80px; }
.quiz-head { display: grid; gap: 6px; margin-bottom: 20px; }
.result {
  display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center;
  padding: 20px 22px; border-radius: var(--radius); margin-bottom: 24px; border: 1px solid;
}
.result.pass { background: var(--tick-soft); border-color: #b7e0cd; }
.result.fail { background: var(--amber-soft); border-color: #f0d9a4; }
.result .score { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.result.pass .score { color: var(--tick); }
.result.fail .score { color: var(--amber); }
.result h3 { font-size: 1.05rem; font-weight: 650; }
.result p { color: var(--ink-2); font-size: 0.95rem; margin-top: 2px; }
.result .actions { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

.question { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px; }
.question + .question { margin-top: 14px; }
.question fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.question legend { padding: 0; font-weight: 640; line-height: 1.4; letter-spacing: -0.005em; margin-bottom: 14px; display: grid; grid-template-columns: 30px 1fr; gap: 12px; }
.qnum { font-family: var(--font-code); font-size: 0.85rem; color: var(--ink-3); padding-top: 1px; }
.options { display: grid; gap: 8px; margin-left: 42px; }
.option {
  display: grid; grid-template-columns: 20px 1fr 20px; gap: 12px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--radius-sm);
  cursor: pointer; background: #fff; transition: border-color 0.12s, background-color 0.12s;
}
.option:hover { border-color: #aeb9cd; background: #fafbfd; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option .dot { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #aab4c6; background: #fff; display: grid; place-items: center; }
.option:has(input:checked) { border-color: var(--cobalt); background: var(--cobalt-soft); }
.option:has(input:checked) .dot { border-color: var(--cobalt); }
.option:has(input:checked) .dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--cobalt); }
.option:has(input:focus-visible) { outline: 2px solid var(--cobalt); outline-offset: 2px; }
.option .mark { width: 20px; height: 20px; }
.option.is-right, .option.is-right:has(input:checked) { border-color: var(--tick); background: var(--tick-soft); }
.option.is-right:has(input:checked) .dot { border-color: var(--tick); }
.option.is-right:has(input:checked) .dot::after { background: var(--tick); }
.option.is-right .dot { border-color: var(--tick); }
.option.is-right .dot::after { background: var(--tick); }
.option.is-wrong, .option.is-wrong:has(input:checked) { border-color: var(--flag); background: var(--flag-soft); }
.option.is-wrong:has(input:checked) .dot { border-color: var(--flag); }
.option.is-wrong:has(input:checked) .dot::after { background: var(--flag); }
.option.is-wrong .dot { border-color: var(--flag); }
.option.is-wrong .dot::after { background: var(--flag); }
.explain { margin: 14px 0 0 42px; padding-left: 14px; border-left: 2px solid var(--rule); color: var(--ink-2); font-size: 0.93rem; max-width: 60ch; }

.submitbar {
  position: sticky; bottom: 0; margin-top: 22px; padding: 14px 0;
  background: linear-gradient(to top, var(--paper) 70%, transparent);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.submitbar .count { color: var(--ink-2); font-size: 0.92rem; font-weight: 550; }

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--rule); max-width: 720px; }
.pager a { text-decoration: none; color: var(--ink); display: grid; gap: 2px; font-weight: 620; }
.pager a span { color: var(--ink-3); font-size: 0.85rem; font-weight: 500; }
.pager a:last-child { text-align: right; margin-left: auto; }

/* ───── Admin ───── */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.stats > div { padding: 18px 22px; }
.stats > div + div { border-left: 1px solid var(--rule-soft); }
.stats b { display: block; font-size: 1.9rem; letter-spacing: -0.03em; font-weight: 680; line-height: 1.1; }
.stats span { color: var(--ink-3); font-size: 0.9rem; }
.stats .hot b { color: var(--amber); }

.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
table.grid { width: 100%; border-collapse: collapse; min-width: 640px; }
.grid th { text-align: left; font-size: 0.85rem; font-weight: 600; color: var(--ink-3); padding: 12px 18px; border-bottom: 1px solid var(--rule); background: #fafbfd; white-space: nowrap; }
.grid td { padding: 14px 18px; border-bottom: 1px solid var(--rule-soft); vertical-align: middle; }
.grid tr:last-child td { border-bottom: 0; }
.grid tr.attn td { background: #fffaf0; }
.grid .who b { font-weight: 620; display: block; }
.grid .who span { color: var(--ink-3); font-size: 0.875rem; }
.grid td.end { text-align: right; white-space: nowrap; }

.callout-wait { background: var(--amber-soft); border: 1px solid #f0d9a4; border-radius: var(--radius); padding: 18px 22px; }
.callout-wait h2 { font-size: 1.05rem; font-weight: 650; color: #6b4300; margin-bottom: 10px; }
.callout-wait ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.callout-wait li { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #fff; border: 1px solid #f0d9a4; border-radius: var(--radius-sm); padding: 10px 14px; }

details.addbox { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
details.addbox > summary { list-style: none; cursor: pointer; padding: 16px 22px; font-weight: 620; display: flex; align-items: center; justify-content: space-between; }
details.addbox > summary::-webkit-details-marker { display: none; }
details.addbox > summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--ink-3); }
details.addbox[open] > summary::after { content: "\2212"; }
details.addbox form { padding: 0 22px 22px; display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; align-items: end; }

.detail-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 28px; align-items: start; }
.kv { display: grid; gap: 14px; }
.kv dt { font-size: 0.85rem; color: var(--ink-3); font-weight: 550; }
.kv dd { margin: 2px 0 0; font-weight: 550; word-break: break-word; }
.linkbox { display: grid; gap: 8px; }
.linkbox code {
  font-family: var(--font-code); font-size: 0.78rem; line-height: 1.5; word-break: break-all;
  background: var(--rule-soft); padding: 10px 12px; border-radius: var(--radius-sm); display: block; color: #1b2a4d;
}
.signoff { border: 1px solid #e8d4a0; background: var(--gold-soft); border-radius: var(--radius); padding: 20px; display: grid; gap: 12px; }
.signoff h2 { font-size: 1.05rem; font-weight: 650; }
.signoff p { color: #5d4410; font-size: 0.95rem; }
.signoff.done { background: var(--tick-soft); border-color: #b7e0cd; }
.signoff.done p { color: #0b5a40; }

/* ───── Auth screens ───── */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-side {
  background: var(--navy); color: #e8edf8; padding: 48px clamp(32px, 5vw, 72px);
  display: flex; flex-direction: column; justify-content: space-between; gap: 48px; position: relative; overflow: hidden;
}
.auth-side .brand { color: #fff; }
.auth-side .brand small { color: #9fb0d4; }
.auth-side h1 { color: #fff; max-width: 15ch; }
.auth-side p { color: #b6c3e0; max-width: 44ch; margin-top: 14px; font-size: 1.05rem; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; display: grid; gap: 22px; }
.auth-card h2 { font-size: 1.6rem; letter-spacing: -0.02em; font-weight: 650; }
.auth-card form { display: grid; gap: 16px; }

.wp { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; max-width: 420px; }
.wp li {
  display: grid; grid-template-columns: 28px 52px 1fr; gap: 14px; align-items: center;
  padding: 11px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); font-size: 0.95rem;
}
.wp li:first-child { border-top: 1px solid rgba(255, 255, 255, 0.1); }
.wp .code { font-family: var(--font-code); font-size: 0.82rem; color: #8fa2cc; }
.wp .tb {
  width: 24px; height: 24px; border-radius: 6px; border: 1.5px solid rgba(255, 255, 255, 0.3);
  display: grid; place-items: center;
}
.wp .tb svg { width: 15px; height: 15px; }
.wp .tb .tick-path { fill: none; stroke: #6fe0b4; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw 0.5s ease-out forwards; animation-delay: calc(0.5s + var(--i) * 0.28s); }
@keyframes draw { to { stroke-dashoffset: 0; } }

.center-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.center-card { max-width: 460px; width: 100%; text-align: left; display: grid; gap: 16px; }

/* ───── Responsive ───── */
@media (max-width: 960px) {
  .phase-layout { grid-template-columns: 1fr; gap: 28px; }
  .outline { position: static; }
  .outline a { padding: 6px 10px; }
  .detail-layout { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 28px 24px; gap: 28px; }
  .wp { display: none; }
}
@media (max-width: 720px) {
  .appnav { display: none; }
  .appbar-inner { gap: 12px; }
  .appbar .brand small { display: none; }
  .usermenu .who { display: none; }
  .continue { grid-template-columns: 1fr; gap: 16px; }
  .ref { justify-self: start; }
  .ledger a.entry { grid-template-columns: 30px 1fr; row-gap: 8px; padding: 16px; }
  .ledger .code { display: none; }
  .ledger .when { grid-column: 2; justify-items: start; text-align: left; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats > div:nth-child(3) { border-left: 0; }
  .stats > div:nth-child(n+3) { border-top: 1px solid var(--rule-soft); }
  details.addbox form { grid-template-columns: 1fr; }
  .options, .explain { margin-left: 0; }
  .question legend { grid-template-columns: 1fr; gap: 4px; }
  .wrap { padding-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .wp .tb .tick-path { animation: none; stroke-dashoffset: 0; }
  * { transition: none !important; }
}
@media print {
  .appbar, .outline, .submitbar { display: none; }
}
