:root {
  color-scheme: light dark;
  --bg: #f3f4ef;
  --surface: #fff;
  --ink: #17201c;
  --muted: #66706b;
  --line: #dce1da;
  --brand: #166b4f;
  --soft: #e7f2ec;
  --warn: #985c12;
  --bad: #a33434;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, select { font: inherit; }
button, select { min-height: 44px; }
.skip { position: fixed; left: 1rem; top: -5rem; z-index: 10; padding: .7rem 1rem; background: var(--ink); color: #fff; }
.skip:focus { top: 1rem; }
:focus-visible { outline: 3px solid #47a986; outline-offset: 3px; }
.topbar { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 2rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { color: inherit; text-decoration: none; font-weight: 760; display: flex; align-items: center; gap: .65rem; }
.brand b { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; background: var(--brand); }
.brand span, .actor { color: var(--muted); font-weight: 520; }
.actor span { color: #28a36d; }
.layout { display: grid; grid-template-columns: 245px minmax(0, 1fr); max-width: 1440px; margin: auto; min-height: calc(100vh - 64px); }
.rail { padding: 2rem 1.5rem; border-right: 1px solid var(--line); }
.eyebrow { margin: 0 0 .6rem; color: var(--muted); font-size: .72rem; letter-spacing: .11em; font-weight: 780; }
.rail ol { padding: 0; margin: 1.2rem 0 2rem; list-style: none; display: grid; gap: .3rem; }
.rail button { width: 100%; border: 0; border-radius: 10px; background: transparent; color: var(--muted); text-align: left; padding: .55rem; cursor: pointer; }
.rail button span { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: .7rem; border: 1px solid var(--line); border-radius: 50%; }
.rail button[aria-current="step"] { background: var(--soft); color: var(--brand); font-weight: 720; }
.rail button[data-complete="true"] span { color: #fff; background: var(--brand); border-color: var(--brand); }
.rail aside { padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--surface) 75%, transparent); font-size: .84rem; line-height: 1.5; }
.rail aside p { margin: .4rem 0 0; color: var(--muted); }
.content { padding: 2.2rem clamp(1rem, 4vw, 4rem) 7rem; min-width: 0; }
.heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.5rem; }
h1 { font-size: clamp(2rem, 4vw, 3.3rem); letter-spacing: -.045em; margin: 0; }
.heading p:last-child { margin: .55rem 0 0; color: var(--muted); }
.scenario { display: grid; gap: .35rem; font-size: .78rem; color: var(--muted); }
select { border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); padding: 0 .8rem; }
.status { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; border: 1px solid #b8d8c8; background: var(--soft); border-radius: 13px; margin-bottom: 1rem; }
.status > div { display: grid; grid-template-columns: auto 1fr; column-gap: .7rem; }
.status small { grid-column: 2; color: var(--muted); margin-top: .15rem; }
.dot { width: 10px; height: 10px; margin-top: .35rem; border-radius: 50%; background: var(--brand); grid-row: 1 / span 2; }
.badge { display: inline-flex; align-items: center; width: max-content; padding: .3rem .55rem; border-radius: 999px; background: #edf0ec; color: var(--muted); font-size: .75rem; font-weight: 720; }
.badge.good { background: #d8eee2; color: #0b6746; }
.badge.warn { background: #faecd5; color: var(--warn); }
.badge.bad { background: #f7dede; color: var(--bad); }
.grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 1rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1.25rem; min-width: 0; }
.card header { display: flex; align-items: start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
h2 { margin: 0; font-size: 1.15rem; }
dl { margin: 0; display: grid; }
dl div { padding: .75rem 0; border-top: 1px solid var(--line); }
dt { color: var(--muted); font-size: .76rem; }
dd { margin: .2rem 0 0; overflow-wrap: anywhere; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; }
.metric { min-height: 90px; padding: .8rem; border-radius: 10px; background: var(--bg); display: flex; flex-direction: column; justify-content: space-between; }
.metric span { color: var(--muted); font-size: .75rem; }
.metric b { font-size: 1.65rem; }
.note { margin: 1rem 0 0; color: var(--muted); font-size: .84rem; line-height: 1.5; }
.audit { grid-column: 1 / -1; }
.audit ol { list-style: none; padding: 0; margin: 0; }
.audit li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .75rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.audit li div { display: grid; gap: .18rem; }
.audit small, .audit time { color: var(--muted); font-size: .76rem; }
.audit-mark { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--soft); color: var(--brand); }
.quiet { color: var(--brand); border: 0; background: transparent; cursor: pointer; }
.actions { position: fixed; left: max(245px, calc((100vw - 1440px) / 2 + 245px)); right: max(0px, calc((100vw - 1440px) / 2)); bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: .7rem; padding: .85rem clamp(1rem, 4vw, 4rem); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); }
.actions div { display: grid; margin-right: auto; }
.actions small { color: var(--muted); }
.actions button { border-radius: 9px; padding: 0 1rem; cursor: pointer; }
.primary { background: var(--brand); color: #fff; border: 1px solid var(--brand); }
.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
button:disabled { cursor: not-allowed; opacity: .5; }
/* Keep preview metrics readable before the side rail narrows both cards. */
@media (max-width: 1024px) {
  .grid { grid-template-columns: 1fr; }
  .audit { grid-column: auto; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .topbar { padding: 0 1rem; }
  .actor { font-size: 0; }
  .actor span { font-size: 1rem; }
  .layout { display: block; }
  .rail { border-right: 0; border-bottom: 1px solid var(--line); padding: 1rem; overflow-x: auto; }
  .rail > .eyebrow, .rail aside { display: none; }
  .rail ol { display: flex; width: max-content; margin: 0; }
  .rail button { width: auto; white-space: nowrap; }
  .content { padding: 1.4rem 1rem 9rem; }
  .heading { display: grid; align-items: start; }
  .actions { left: 0; right: 0; display: grid; grid-template-columns: 1fr 1fr; }
  .actions div { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media (prefers-color-scheme: dark) {
  :root { --bg: #141815; --surface: #1d231f; --ink: #edf3ee; --muted: #9aa69f; --line: #354038; --soft: #1d392e; }
}
