/* Cyber Academy by TechCatalyst.
   World: the client's compliance register. Royal navigation frame, white work area,
   Ink-ruled sections and ledgers, Mist for tints, dividers and chart fills only.
   Colors from the TechCatalyst Brand Style Guide v1.0; dark mode sits on Ink. */
/* Self-hosted variable faces (SIL Open Font License, see /fonts). Archivo's width axis
   gives the wide grotesque of the brand guide; JetBrains Mono sets codes and dates. */
@font-face { font-family: "Archivo"; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%; src: url("fonts/archivo-var.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 100 800; src: url("fonts/jetbrains-mono-var.woff2") format("woff2"); }

:root {
  --royal: #1F4487;
  --mist: #93A7CB;
  --ink-brand: #101821;

  --paper: #FFFFFF;
  --paper-2: #F4F6FA;
  --tint: #E9EDF5;
  --rule: #CBD4E4;
  --rule-strong: #101821;
  --ink: #101821;
  --ink-2: #3D4859;
  --muted: #586579;
  --brand: #1F4487;
  --brand-hover: #173768;
  --brand-ink: #1F4487;
  --brand-soft: #E4E9F3;
  --on-brand: #FFFFFF;
  --on-brand-2: #C9D3E8;
  --rail: #1F4487;
  --rail-hover: #2A5199;
  --rail-active: #FFFFFF;
  --s1: #1F4487;
  --s2: #7B91BC;
  --grid: #E6EAF2;
  --good: #3B8A5A;
  --good-ink: #1F6B3E;
  --good-soft: #E6F1EA;
  --warn: #C4891F;
  --warn-ink: #7A5200;
  --warn-soft: #F7EEDB;
  --crit: #B8322B;
  --crit-ink: #9E2A23;
  --crit-soft: #F6E4E2;
  --shadow: 0 2px 4px rgba(16, 24, 33, .06), 0 12px 32px rgba(16, 24, 33, .12);
  --font: "Archivo", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --wide: 118%;
  --r: 6px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #101821; --paper-2: #151F2C; --tint: #1B283B; --rule: #2A384D; --rule-strong: #93A7CB;
    --ink: #F2F5FA; --ink-2: #C5CFDE; --muted: #9AABC9;
    --brand: #2B56A3; --brand-hover: #3563B5; --brand-ink: #A9BCE3; --brand-soft: #1A2B47;
    --rail: #1F4487; --rail-hover: #2A5199;
    --s1: #8FA9DD; --s2: #4E6591; --grid: #1E2A3B;
    --good: #5FAF80; --warn: #D9A441; --crit: #D9665C; --good-ink: #7CC79A; --warn-ink: #E3B868; --crit-ink: #F2958C;
    --good-soft: #10301B; --warn-soft: #33290F; --crit-soft: #3A1A1D;
    --shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 16px 40px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #101821; --paper-2: #151F2C; --tint: #1B283B; --rule: #2A384D; --rule-strong: #93A7CB;
  --ink: #F2F5FA; --ink-2: #C5CFDE; --muted: #9AABC9;
  --brand: #2B56A3; --brand-hover: #3563B5; --brand-ink: #A9BCE3; --brand-soft: #1A2B47;
  --rail: #1F4487; --rail-hover: #2A5199;
  --s1: #8FA9DD; --s2: #4E6591; --grid: #1E2A3B;
  --good: #5FAF80; --warn: #D9A441; --crit: #D9665C; --good-ink: #7CC79A; --warn-ink: #E3B868; --crit-ink: #F2958C;
  --good-soft: #10301B; --warn-soft: #33290F; --crit-soft: #3A1A1D;
  --shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 16px 40px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
#app { min-height: 100%; display: flex; flex-direction: column; }
#app > * { flex: 1 0 auto; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; caret-color: var(--brand-ink); scrollbar-color: var(--rule) transparent; }
::selection { background: var(--royal); color: #FFFFFF; }
h1, h2, h3 { margin: 0; line-height: 1.12; text-wrap: balance; color: var(--ink); }
h1 { font-size: 2.1rem; font-weight: 700; font-stretch: var(--wide); letter-spacing: -.015em; color: var(--brand-ink); }
h2 { font-size: 1.08rem; font-weight: 700; font-stretch: var(--wide); letter-spacing: -.005em; }
h3 { font-size: .98rem; font-weight: 650; }
p { margin: 0; }
a { color: var(--brand-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 2px; }
.mono { font-family: var(--mono); font-size: .82em; letter-spacing: 0; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; }
.label { font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.ic { width: 16px; height: 16px; flex: none; }

/* ---------- shell: the Royal frame ---------- */
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100%; }
.rail { background: var(--rail); color: var(--on-brand); display: flex; flex-direction: column; gap: 22px; padding: 22px 14px 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-color: rgba(255,255,255,.25) transparent; }
.brand { display: grid; gap: 10px; padding: 0 8px; text-decoration: none; color: inherit; }
.brand img { height: 22px; width: auto; display: block; }
.product { font-weight: 700; font-stretch: 125%; font-size: 1.28rem; letter-spacing: -.01em; line-height: 1; color: #FFFFFF; }
.ctx { border-top: 1px solid rgba(255, 255, 255, .22); border-bottom: 1px solid rgba(255, 255, 255, .22); padding: 12px 8px; display: grid; gap: 3px; }
.ctx .label { color: var(--on-brand-2); }
.ctx-name { font-weight: 650; font-size: .95rem; line-height: 1.3; }
.ctx-meta { font-family: var(--mono); font-size: .72rem; color: var(--on-brand-2); }
.ctx a { color: #FFFFFF; font-size: .82rem; margin-top: 4px; }
.nav { display: grid; gap: 1px; }
.nav-label { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--on-brand-2); padding: 12px 10px 5px; }
.nav a { display: flex; align-items: center; gap: 11px; color: #FFFFFF; text-decoration: none; padding: 8px 10px; border-radius: 5px; font-weight: 500; transition: background-color .15s ease-out; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .75; }
.nav a:hover { background: var(--rail-hover); }
.nav a[aria-current="page"] { background: var(--rail-active); color: var(--royal); font-weight: 650; }
.nav a[aria-current="page"] svg { opacity: 1; }
.nav a:focus-visible { outline-color: #FFFFFF; }
.rail-foot { margin-top: auto; display: grid; gap: 10px; border-top: 1px solid rgba(255, 255, 255, .22); padding-top: 14px; }
.who { display: flex; gap: 10px; align-items: center; padding: 0 6px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; font-size: .76rem; flex: none; }
.rail .avatar { background: #FFFFFF; color: var(--royal); }
.who-name { font-weight: 600; font-size: .88rem; line-height: 1.2; }
.who-role { font-size: .75rem; color: var(--on-brand-2); }
.rail-btn { background: none; border: 1px solid rgba(255, 255, 255, .35); color: #FFFFFF; border-radius: 5px; padding: 5px 10px; cursor: pointer; font-size: .82rem; text-decoration: none; }
.rail-btn:hover { background: var(--rail-hover); }
.rail-btn:focus-visible { outline-color: #FFFFFF; }
.main { min-width: 0; padding: 30px 40px 64px; }
.topbar-mobile { display: none; }
.demo-banner { border: 1px solid var(--rule); background: var(--paper-2); border-radius: var(--r); padding: 8px 12px; font-size: .84rem; margin-bottom: 22px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: var(--ink-2); }
.demo-banner b { color: var(--ink); }

/* ---------- page header: title, then the register line ---------- */
.page { display: flex; flex-direction: column; gap: 28px; max-width: 1320px; }
.page-head { display: flex; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 2px solid var(--rule-strong); }
.page-head .titles { display: grid; gap: 8px; min-width: 0; flex: 1 1 420px; }
.meta { font-family: var(--mono); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.meta span + span::before { content: ""; display: inline-block; width: 4px; height: 4px; background: var(--mist); margin: 0 12px 2px 0; vertical-align: middle; }
.page-head .sub { color: var(--ink-2); max-width: 72ch; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumb { font-size: .86rem; margin-bottom: -12px; }
.crumb a { text-decoration: none; font-weight: 600; }

/* binder tabs: in-page section index */
.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--rule-strong); margin-top: -12px; overflow-x: auto; position: sticky; top: 0; background: var(--paper); z-index: 5; }
.tabs { align-items: flex-end; padding-top: 8px; }
.tabs a { display: inline-flex; gap: 8px; align-items: baseline; padding: 8px 14px 8px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .86rem; white-space: nowrap; background: var(--tint); border: 1px solid var(--rule); border-bottom: 0; border-radius: 5px 5px 0 0; margin-bottom: 0; transition: background-color .15s ease-out, color .15s ease-out; }
.tabs a span { font-family: var(--mono); font-size: .72rem; color: var(--muted); font-weight: 500; }
.tabs a:hover { color: var(--brand-ink); background: var(--brand-soft); }
.tabs a[aria-current="true"] { color: var(--brand-ink); background: var(--paper); border-color: var(--rule-strong); border-top: 3px solid var(--brand-ink); padding-top: 6px; margin-bottom: -1px; position: relative; }

/* ---------- ruled sections (not cards) ---------- */
.card { border-top: 2px solid var(--rule-strong); padding-top: 14px; min-width: 0; scroll-margin-top: 56px; }
.card-head { display: flex; align-items: baseline; gap: 6px 14px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head .no { font-family: var(--mono); font-size: .76rem; color: var(--brand-ink); font-weight: 500; }
.card-head p { color: var(--muted); font-size: .84rem; }
.card-head .right { margin-left: auto; }
.card.flush .card-head { margin-bottom: 4px; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 36px 32px; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; } .span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; }

/* ---------- summary strip ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-bottom: 1px solid var(--rule); }
.tile { padding: 4px 18px 16px; display: grid; gap: 4px; align-content: start; border-left: 1px solid var(--rule); min-width: 0; }
.tile:first-child { border-left: 0; padding-left: 0; }
.tile-label { min-height: 2.5em; font-family: var(--mono); font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.tile-value { font-size: 1.7rem; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tile-value small { font-size: .85rem; font-weight: 500; color: var(--muted); margin-left: 2px; }
.tile-note { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.tile.hero .tile-value { font-size: 2.9rem; font-weight: 700; font-stretch: var(--wide); color: var(--brand-ink); letter-spacing: -.03em; line-height: 1.05; }
.delta-good { color: var(--good-ink); font-weight: 650; }
.delta-bad { color: var(--crit-ink); font-weight: 650; }

/* ---------- program ledger (signature) ---------- */
.ledger12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.mcol { display: grid; grid-template-rows: auto auto 1fr auto; gap: 6px; padding: 10px 10px 12px; border-left: 1px solid var(--rule); text-decoration: none; color: var(--ink); min-width: 0; position: relative; transition: background-color .15s ease-out; }
.mcol:first-child { border-left: 0; }
.mcol:hover, .mcol:focus-visible { background: var(--brand-soft); box-shadow: inset 0 -3px 0 var(--mist); }
.mcol:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: -2px; }
.mcol .m { font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; color: var(--muted); }
.mcol .code { font-size: .74rem; }
.mcol .pctv { font-size: 1.15rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.mcol .bar { height: 4px; background: var(--tint); border-radius: 2px; overflow: hidden; }
.mcol .bar i { display: block; height: 100%; background: var(--s1); }
.mcol.scheduled { background: var(--paper-2); }
.mcol.scheduled .pctv { color: var(--muted); font-size: .8rem; font-weight: 500; font-family: var(--mono); }
.mcol.open { box-shadow: inset 0 0 0 2px var(--brand-ink); background: var(--brand-soft); }
.mcol .extra { font-family: var(--mono); font-size: .64rem; color: var(--brand-ink); }
.ledger-key { display: flex; gap: 16px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-top: 10px; }

/* ---------- evidence stamp ---------- */
.stamp { display: inline-flex; align-items: center; gap: 5px; border: 1.5px solid var(--brand-ink); color: var(--brand-ink); border-radius: 3px; padding: 1px 6px; font-family: var(--mono); font-size: .64rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 500; white-space: nowrap; line-height: 1.5; }
.stamp.late { border-color: var(--muted); color: var(--muted); }

/* ---------- status marks ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; border: 1px solid currentColor; border-radius: 2px; background: none; padding: 1px 6px 1px 5px; font-family: var(--mono); font-size: .68rem; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; line-height: 1.55; }
.pill svg { width: 12px; height: 12px; flex: none; }
.pill-good { color: var(--good-ink); }
.pill-warn { color: var(--warn-ink); }
.pill-crit { color: var(--crit-ink); }
.pill-neutral { color: var(--ink-2); border-color: var(--rule); }
.pill-accent { color: var(--brand-ink); }
.risk { display: inline-flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; font-weight: 600; }
.risk-bar { width: 44px; height: 6px; border-radius: 3px; background: var(--tint); overflow: hidden; }
.risk-bar i { display: block; height: 100%; }
.statusbar { display: flex; height: 16px; border-radius: 3px; overflow: hidden; gap: 2px; background: var(--paper); }
.statusbar span { display: block; height: 100%; min-width: 3px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .8rem; color: var(--ink-2); }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend .key { width: 16px; height: 2px; display: inline-block; }
.legend .sq { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.meter { height: 6px; background: var(--tint); border-radius: 3px; overflow: hidden; min-width: 60px; }
.meter i { display: block; height: 100%; background: var(--s1); border-radius: 3px; }

/* ---------- ledgers (tables) ---------- */
.table-wrap { overflow-x: auto; position: relative; }
table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.data th { text-align: left; font-family: var(--mono); font-size: .68rem; font-weight: 500; color: var(--muted); letter-spacing: .07em; text-transform: uppercase; padding: 9px 12px; border-bottom: 1.5px solid var(--rule-strong); white-space: nowrap; background: var(--paper); position: sticky; top: 0; }
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
table.data td.nowrap, table.data th.nowrap { white-space: nowrap; }
table.data th:first-child, table.data td:first-child { padding-left: 0; }
table.data th:last-child, table.data td:last-child { padding-right: 0; }
table.data td.r, table.data th.r { text-align: right; }
table.data tbody tr.link { cursor: pointer; transition: background-color .15s ease-out; }
table.data tbody tr.link:hover td { background: var(--paper-2); }
table.data td.regno { font-family: var(--mono); font-size: .74rem; color: var(--muted); width: 1%; white-space: nowrap; }
.cell-main { font-weight: 600; }
.cell-sub { font-size: .8rem; color: var(--muted); }
.empty { padding: 28px 0; color: var(--muted); }
.group-row td { background: var(--paper-2); font-weight: 700; font-stretch: var(--wide); font-size: .9rem; color: var(--brand-ink); padding-top: 14px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--rule); background: var(--paper); color: var(--brand-ink); border-radius: var(--r); padding: 8px 14px; font-weight: 650; font-size: .86rem; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color .15s ease-out, border-color .15s ease-out; }
.btn:hover { background: var(--brand-soft); border-color: var(--mist); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #FFFFFF; }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-sm { padding: 4px 10px; font-size: .78rem; }
.btn-link { background: none; border: 0; padding: 0; color: var(--brand-ink); font-weight: 650; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.btn[disabled] { opacity: .5; cursor: progress; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field > .label-t { font-size: .82rem; font-weight: 650; color: var(--ink-2); }
.field .hint { font-size: .78rem; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); padding: 9px 11px; min-width: 0; color: var(--ink); }
.input::placeholder { color: var(--muted); }
.input:hover { border-color: var(--mist); }
textarea.input { min-height: 140px; font-family: var(--mono); font-size: .8rem; }
.input:focus { outline: 2px solid var(--brand-ink); outline-offset: 0; border-color: transparent; }
.pw { position: relative; }
.pw .input { padding-right: 42px; }
.pw-toggle { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); display: grid; place-items: center; width: 34px; height: 34px; background: none; border: 0; border-radius: var(--r); color: var(--muted); cursor: pointer; }
.pw-toggle:hover { color: var(--ink); }
.pw-toggle svg { width: 18px; height: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; gap: 7px; align-items: center; border: 1px solid var(--rule); border-radius: var(--r); padding: 6px 11px; font-size: .85rem; cursor: pointer; }
.check input { accent-color: var(--brand); }
.check:has(input:checked) { border-color: var(--brand-ink); background: var(--brand-soft); }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.filters .field { min-width: 170px; }
.error { color: var(--crit-ink); font-size: .86rem; }
.notice { background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--r); padding: 12px 14px; font-size: .88rem; }
.secret { font-family: var(--mono); background: var(--paper-2); border: 1px dashed var(--mist); border-radius: 4px; padding: 5px 10px; user-select: all; display: inline-block; }
.footnote { font-size: .8rem; color: var(--muted); max-width: 90ch; }

/* ---------- modal & toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(16, 24, 33, .55); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--paper); border-radius: 8px; width: min(620px, 100%); max-height: calc(100% - 32px); overflow: auto; box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px 14px; border-bottom: 2px solid var(--rule-strong); position: sticky; top: 0; background: var(--paper); }
.modal-body { padding: 18px 22px; display: grid; gap: 16px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--rule); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.x { margin-left: auto; background: none; border: 0; cursor: pointer; color: var(--muted); padding: 4px; border-radius: 4px; display: grid; }
.x:hover { color: var(--ink); background: var(--tint); }
.toast { position: fixed; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--ink-brand); color: #FFFFFF; padding: 10px 16px; border-radius: 6px; font-weight: 600; font-size: .86rem; z-index: 60; box-shadow: var(--shadow); max-width: calc(100% - 32px); border-left: 0; }

/* ---------- charts ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--muted); font: 11px var(--mono); font-variant-numeric: tabular-nums; }
.chart .lbl { fill: var(--ink); font: 600 11.5px var(--font); }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--ink-2); stroke-width: 1; }
.tip { position: absolute; pointer-events: none; background: var(--ink-brand); color: #FFFFFF; border-radius: 5px; padding: 7px 10px; font-size: .78rem; line-height: 1.45; white-space: nowrap; z-index: 5; transform: translate(-50%, calc(-100% - 10px)); box-shadow: var(--shadow); }
.tip b { font-weight: 700; }
.tip .k { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.hbars { display: grid; gap: 9px; }
.hbar { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr) 52px; gap: 12px; align-items: center; font-size: .86rem; }
.hbar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.hbar .track { height: 12px; background: var(--tint); border-radius: 0 3px 3px 0; position: relative; }
.hbar .fill { height: 100%; border-radius: 0 3px 3px 0; }
.hbar .val { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.hbar .target { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }

/* ---------- learner ---------- */
.player { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 32px; align-items: start; }
.steps { display: grid; gap: 0; position: sticky; top: 16px; border-top: 2px solid var(--rule-strong); }
.steps button { text-align: left; background: none; border: 0; border-bottom: 1px solid var(--rule); padding: 10px 4px; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); font-size: .88rem; transition: color .15s ease-out; }
.steps button:hover { color: var(--brand-ink); }
.steps button[aria-current="step"] { color: var(--brand-ink); font-weight: 650; }
.steps .n { font-family: var(--mono); font-size: .72rem; min-width: 22px; padding-top: 2px; color: var(--muted); }
.steps button[aria-current="step"] .n { color: var(--brand-ink); }
.steps .done .n { color: var(--good-ink); }
.lesson { border-top: 2px solid var(--rule-strong); padding: 18px 0 8px; display: grid; gap: 18px; }
.lesson h2 { font-size: 1.55rem; color: var(--brand-ink); }
.lesson-body { max-width: 68ch; font-size: 1.04rem; line-height: 1.7; display: grid; gap: 14px; }
.lesson-body ul, .lesson-body ol { margin: 0; padding-left: 1.3em; display: grid; gap: 7px; }
.lesson-body li::marker { color: var(--brand-ink); }
.lesson.scenario .lesson-body, .lesson.action .lesson-body { background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--r); padding: 18px 20px; }
.lesson-nav { display: flex; gap: 8px; justify-content: space-between; border-top: 1px solid var(--rule); padding-top: 16px; }
.q { border: 0; border-bottom: 1px solid var(--rule); padding: 0 0 18px; margin: 0; display: grid; gap: 9px; }
.q > legend { float: left; width: 100%; padding: 0; margin-bottom: 4px; font-weight: 650; }
.q > legend + * { clear: both; }
.q-title { font-weight: 650; }
.opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--rule); border-radius: var(--r); padding: 10px 12px; cursor: pointer; transition: border-color .15s ease-out, background-color .15s ease-out; }
.opt input { accent-color: var(--brand); margin-top: 4px; }
.opt:hover { border-color: var(--mist); }
.opt:has(input:checked) { border-color: var(--brand-ink); background: var(--brand-soft); }
.opt.right { border-color: var(--good); background: var(--good-soft); }
.opt.wrong { border-color: var(--crit); background: var(--crit-soft); }
.explain { font-size: .88rem; color: var(--ink-2); display: flex; gap: 6px; align-items: flex-start; }
.explain.ok { color: var(--good-ink); }
.explain.bad { color: var(--crit-ink); }
.result { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--r); padding: 16px 18px; }
.score-ring { width: 88px; height: 88px; flex: none; }

/* ---------- certificate ---------- */
.cert { max-width: 900px; background: #FFFFFF; color: #101821; border: 1px solid #CBD4E4; border-radius: 4px; overflow: hidden; }
.cert-band { background: #1F4487; padding: 22px 40px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cert-band img { height: 24px; }
.cert-band span { font-family: var(--mono); color: #C9D3E8; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; }
.cert-inner { padding: 44px 40px 40px; display: grid; gap: 14px; }
.cert-inner .ttl { font-weight: 700; font-stretch: 125%; font-size: 2.3rem; color: #1F4487; letter-spacing: -.02em; line-height: 1.05; }
.cert-name { font-size: 2rem; font-weight: 700; letter-spacing: -.01em; border-bottom: 2px solid #101821; padding-bottom: 10px; }
.cert-course { font-size: 1.25rem; font-weight: 650; color: #1F4487; }
.cert-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid #CBD4E4; margin-top: 18px; }
.cert-meta div { padding: 12px 16px 0 0; display: grid; gap: 2px; font-size: .95rem; font-weight: 600; }
.cert-meta .label { color: #586579; }
.cert .stamp { border-color: #1F4487; color: #1F4487; font-size: .74rem; padding: 4px 10px; }

/* ---------- sign-in ---------- */
.login { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.login-side { background: var(--royal); color: #FFFFFF; padding: 44px 52px; display: flex; flex-direction: column; gap: 32px; justify-content: space-between; }
.login-side img { height: 28px; width: auto; align-self: flex-start; }
.login-side h1 { color: #FFFFFF; font-size: clamp(2.6rem, 5vw, 4rem); font-stretch: 125%; letter-spacing: -.03em; line-height: .98; }
.login-side p { max-width: 44ch; color: #DCE3F0; font-size: 1.05rem; }
.login-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid rgba(255, 255, 255, .3); }
.login-facts div { padding: 12px 12px 0 0; font-size: .82rem; color: #DCE3F0; }
.login-facts b { display: block; color: #FFFFFF; font-size: 1.45rem; font-weight: 700; font-stretch: var(--wide); }
.tagline { font-family: var(--mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: #C9D3E8; }
.login-main { display: grid; place-items: center; padding: 32px 16px; background: var(--paper); }
.login-box { width: min(420px, 100%); display: grid; gap: 18px; }
.login-box h2 { font-size: 1.5rem; color: var(--brand-ink); }
.demo-accounts { display: grid; border-top: 1.5px solid var(--rule-strong); }
.demo-acct { display: flex; gap: 12px; align-items: center; border: 0; border-bottom: 1px solid var(--rule); background: none; padding: 10px 2px; cursor: pointer; text-align: left; color: var(--ink); transition: background-color .15s ease-out; }
.demo-acct:hover { background: var(--paper-2); }
.demo-acct .r { font-size: .78rem; color: var(--muted); }
.demo-acct .go { margin-left: auto; color: var(--brand-ink); }

@media print {
  .rail, .topbar-mobile, .no-print, .demo-banner, .tabs { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .card, .tile { break-inside: avoid; }
  body { background: #FFFFFF; color: #101821; }
}

@media (max-width: 1180px) {
  .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; }
  .ledger12 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .mcol:nth-child(7) { border-left: 0; }
  .mcol:nth-child(n+7) { border-top: 1px solid var(--rule); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 40; transform: translateX(-100%); transition: transform .2s ease-out; height: 100%; padding-top: calc(22px + env(safe-area-inset-top, 0px)); }
  .shell.nav-open .rail { transform: none; box-shadow: var(--shadow); }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(16, 24, 33, .5); z-index: 30; }
  .topbar-mobile { display: flex; align-items: center; gap: 12px; background: var(--royal); color: #FFFFFF; padding: 10px 16px; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; }
  .topbar-mobile img { height: 18px; }
  .topbar-mobile b { font-stretch: 125%; font-weight: 700; margin-left: auto; }
  .topbar-mobile button { background: none; border: 1px solid rgba(255, 255, 255, .4); color: inherit; border-radius: 5px; padding: 5px 8px; display: grid; }
  .main { padding: 20px 16px 48px; }
  h1 { font-size: 1.6rem; }
  .tabs { top: 50px; }
  .tile { padding: 4px 12px 12px; }
  .tile.hero { grid-column: 1 / -1; border-bottom: 1px solid var(--rule); padding-left: 0; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles .tile:nth-child(even) { border-left: 0; padding-left: 0; }
  .ledger12 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mcol:nth-child(3n+1) { border-left: 0; }
  .mcol:nth-child(n+4) { border-top: 1px solid var(--rule); }
  .player { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .steps { position: static; grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
  .steps button { border-bottom: 2px solid transparent; }
  .steps button[aria-current="step"] { border-bottom-color: var(--brand-ink); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-side { padding: 28px 20px; gap: 22px; }
  .hbar { grid-template-columns: minmax(0, 110px) minmax(0, 1fr) 48px; }
  .cert-band, .cert-inner { padding-left: 20px; padding-right: 20px; }
  .cert-meta { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ---------- attestation (evidence pack sign-off) ---------- */
.attest { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 8px; }
.attest div { display: grid; gap: 6px; }
.attest .line { border-bottom: 1px solid var(--rule-strong); height: 34px; }
.attest .k { font-family: var(--mono); font-size: .68rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 860px) { .attest { grid-template-columns: minmax(0, 1fr); } }
