/* ===========================================================================
   This file no longer owns any colour.
   ===========================================================================
   Every value below is an alias onto @broadgroup/design, which is loaded ahead
   of this file by lib/html.js (the compiled src/portal.css entry). One palette
   now drives the whole portal: a button rendered by a React island and a button
   rendered by an Express template read the SAME custom property, instead of two
   hex values being kept in step by hand.

   There is no dark-mode block here any more, and there should never be one
   again. The design tokens redefine themselves for dark -- by OS preference,
   with the [data-theme="light"|"dark"] override the portal already used -- so
   aliasing them once is correct in both themes.

   Two renames were forced, and they matter:
     --muted  -> --text-muted   (here it is a TEXT colour; in the design system
                                 --muted is a SURFACE, so a server-rendered
                                 `bg-muted` would have come out as body text)
     --accent -> --action       (here it is the blue action colour; there
                                 --accent is the amber highlight and --primary
                                 is the action colour)

   The second value in each var() is a fallback used only if the front end has
   not been built -- the portal must still render if public/app/ is missing.
   See ~/CLAUDE.md: a literal hex in app code is a bug unless it is in ~/design.
   ========================================================================== */
:root {
  --bg: var(--background, #f6f7f9);
  --surface: var(--card, #ffffff);
  --text: var(--foreground, #1b2330);
  --text-muted: var(--muted-foreground, #5b6575);
  --line: var(--border, #dde2ea);
  --action: var(--primary, #1f5fbf);
  --action-text: var(--primary-foreground, #ffffff);
  --open: var(--warning, #b45309);
  --open-bg: var(--warning-subtle, #fff4e5);
  --done: var(--success, #15803d);
  --done-bg: var(--success-subtle, #ecfdf3);
  --claude-bg: var(--info-subtle, #eef4ff);
  --error: var(--destructive, #b42318);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--action); }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 12px; height: 56px; }
.brand { font-weight: 700; text-decoration: none; color: var(--text); }
.sub { color: var(--text-muted); }
main { padding: 24px 16px 64px; }
h1 { font-size: 1.8rem; margin: 0 0 4px; }
.muted, .meta { color: var(--text-muted); }
.lead { font-size: 1.05rem; }
.hero { padding: 48px 0; }
.button, button { display: inline-block; background: var(--action); color: var(--action-text); border: 0; border-radius: 8px; padding: 9px 16px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin: 16px 0 20px; }
.tabs a { padding: 8px 12px; text-decoration: none; color: var(--text-muted); border-bottom: 3px solid transparent; }
.tabs a[aria-current="page"] { color: var(--text); border-color: var(--action); font-weight: 600; }
.pill { background: var(--open); color: var(--surface); border-radius: 999px; padding: 0 7px; font-size: .8rem; font-weight: 700; }
.sortbar { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; }
select, input, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
textarea, .stack input { width: 100%; }
.q { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--done); border-radius: 10px; padding: 16px 18px; margin-bottom: 18px; }
.q.open { border-left-color: var(--open); }
.q header { display: flex; flex-wrap: wrap; gap: 10px; font-size: .85rem; color: var(--text-muted); }
.q .status { font-weight: 700; color: var(--done); }
.q.open .status { color: var(--open); }
.q h2 { font-size: 1.15rem; margin: 6px 0 8px; }
.q .detail p:first-child { margin-top: 0; }
.label { display: block; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); margin-bottom: 2px; }
.proposal, .answer { border-radius: 8px; padding: 8px 12px; margin: 10px 0; }
.proposal { background: var(--open-bg); }
.answer { background: var(--done-bg); }
.proposal p, .answer p { margin: 4px 0; }
.answer-form, .comments form { display: grid; gap: 6px; margin-top: 10px; }
.answer-form button, .comments form button { justify-self: start; }
.comments { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 8px; }
.comments h3 { font-size: .95rem; margin: 4px 0; }
.comments ol { list-style: none; padding: 0; margin: 0; }
.comment { padding: 8px 10px; border-radius: 8px; margin: 6px 0; border: 1px solid var(--line); }
.comment.claude { background: var(--claude-bg); }
.comment .meta { font-size: .82rem; }
.comments label { font-size: .9rem; color: var(--text-muted); }
.log { list-style: none; padding: 0; }
.log li { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 12px; }
.log h2 { font-size: 1.05rem; margin: 2px 0 6px; }
.prose { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 20px; overflow-wrap: anywhere; }
.prose table { border-collapse: collapse; display: block; overflow-x: auto; margin: 12px 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 8px; vertical-align: top; text-align: left; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.narrow { max-width: 420px; margin: 40px auto; }
.stack { display: grid; gap: 8px; }
.stack button { margin-top: 8px; }
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-right: 40px; }
.stack .pw-toggle, .pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); margin: 0; padding: 6px; background: none; border: 0; color: var(--muted, currentColor); display: flex; align-items: center; cursor: pointer; }
.pw-toggle svg { width: 20px; height: 20px; }
.pw-toggle .slash { display: none; }
.pw-toggle.on .slash { display: block; }
.error { color: var(--error); font-weight: 600; }
@media (max-width: 600px) { h1 { font-size: 1.5rem; } .q { padding: 14px; } }

/* ---- Training site ---- */
.top .wrap { flex-wrap: wrap; height: auto; min-height: 56px; }
nav.main { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-left: auto; }
nav.main a { text-decoration: none; color: var(--text-muted); }
nav.main a[aria-current="page"] { color: var(--text); font-weight: 600; }
.wide { max-width: 1100px; }
main.wrap:has(.wide) { max-width: 1100px; }
.button.secondary, button.secondary { background: transparent; color: var(--action); border: 1px solid var(--action); }
button.link { background: none; color: var(--action); padding: 0; font-weight: 400; text-decoration: underline; }
button.link.danger { color: var(--error); }
button[disabled] { opacity: .5; cursor: not-allowed; }
.inline { display: inline; }
.row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; margin: 8px 0; }
.row label { display: grid; gap: 2px; font-size: .9rem; }
.check { display: flex; gap: 8px; align-items: flex-start; }
.check input { width: auto; margin-top: 4px; }
.small { font-size: .88rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.flash { background: var(--done-bg); border-radius: 8px; padding: 8px 12px; }
.notice { background: var(--open-bg); border-radius: 8px; padding: 8px 12px; }
.notice.ok { background: var(--done-bg); }
.crumbs { margin: 0; font-size: .9rem; }
.card { margin-bottom: 16px; }
.card h2, .card h3 { margin-top: 0; }
.narrow-left { max-width: 520px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.score strong { display: block; font-size: 2rem; }
.badge { display: inline-block; font-size: .78rem; font-weight: 700; border-radius: 999px; padding: 1px 9px; background: var(--line); color: var(--text); vertical-align: middle; }
.badge.active { background: var(--done-bg); color: var(--done); }
.badge.expired, .badge.draft { background: var(--open-bg); color: var(--open); }
.badge.revoked { background: var(--error); color: var(--surface); }
.bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.bar span { display: block; height: 100%; background: var(--done); }
.table { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--surface); }
th, td { border-bottom: 1px solid var(--line); padding: 7px 8px; text-align: left; vertical-align: top; }
th { font-size: .85rem; color: var(--text-muted); }
td.actions a { margin-right: 8px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.filters a { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; text-decoration: none; color: var(--text); background: var(--surface); }
.filters a[aria-current="page"] { border-color: var(--action); font-weight: 600; }
.module h2 { font-size: 1.15rem; margin: 20px 0 8px; }
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.course { display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; text-decoration: none; color: var(--text); }
.course:hover { border-color: var(--action); }
.course.soon { opacity: .65; }
.lessons { list-style: none; padding: 0; }
.lesson { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.lesson .tick { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--line); font-weight: 700; }
.lesson.done .tick { background: var(--done); color: var(--surface); }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: 3px 0; color: var(--text-muted); }
.checklist li.ok { color: var(--text); }
.checklist li.ok span { color: var(--done); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.facts dt { color: var(--text-muted); }
.facts dd { margin: 0; font-weight: 600; }
.verify .badge { font-size: 1rem; padding: 3px 14px; }
.practical { border-left: 5px solid var(--action); }
.task-text p { margin: 6px 0; }
.player { position: relative; margin-bottom: 16px; }
.player video { width: 100%; background: #000; border-radius: 10px; display: block; }
/* Watermark: name, email and company repeated faintly over protected content. */
.protected { position: relative; }
.wm { position: absolute; inset: 0; overflow: hidden; pointer-events: none; display: flex; flex-wrap: wrap; align-content: space-around; justify-content: space-around; gap: 40px; opacity: .09; transform: rotate(-12deg); user-select: none; }
.wm span { font-size: .9rem; white-space: nowrap; color: var(--text); }
.player .wm { opacity: .14; }
.player .wm span { color: #fff; }
.guide { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 4px 20px; margin-bottom: 16px; }
.guide:empty { display: none; }
.exam fieldset.q { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin: 0 0 14px; padding: 12px 16px; }
.exam legend { font-weight: 700; padding: 0 4px; }
.exam .opt, .exam .order { display: flex; gap: 8px; align-items: center; padding: 3px 0; }
.exam .opt input { width: auto; }
.exam input[type="text"], .exam input:not([type]) { width: 100%; max-width: 360px; }
.timer { position: sticky; top: 0; z-index: 2; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; display: inline-block; }
.timer.low { border-color: var(--error); color: var(--error); }
.mail pre { white-space: pre-wrap; font: inherit; font-size: .9rem; }
.review details { margin: 6px 0; }
/* Printing course material gives a blank page; certificates are the shareable item. */
@media print { .protected, .practical, .guide { display: none !important; } }

/* ---- Certification road map ---- */
.rm-intro { margin: 16px 0 10px; max-width: 360px; }
.roadmap { display: grid; grid-template-columns: minmax(140px, .8fr) repeat(3, minmax(0, 1fr)) minmax(170px, 1fr); gap: 10px; align-items: stretch; margin-bottom: 8px; }
.rm-head { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); grid-row: 1; }
.rm-head:not(:first-child)::after { content: " →"; }
.rm-head:last-child::after { content: ""; }
.rm-path { grid-column: 1; display: flex; align-items: center; padding: 8px 10px; border-left: 4px solid var(--action); background: var(--surface); border-radius: 8px; }
.rm-cell { display: grid; gap: 6px; align-content: start; }
.rm-expert { display: flex; }
.rm-expert .rm-card { width: 100%; justify-content: center; border-width: 2px; border-color: var(--action); }
.rm-card { display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; text-decoration: none; color: var(--text); }
.rm-card:hover { border-color: var(--action); }
.rm-card.soon { border-style: dashed; }
.rm-code { font-size: .75rem; font-weight: 800; letter-spacing: .05em; color: var(--action); }
.rm-name { font-weight: 600; line-height: 1.25; }
.rm-card .badge { justify-self: start; margin-top: 2px; }
.rm-card.st-held { border-color: var(--done); background: var(--done-bg); }
.rm-card.st-doing { border-color: var(--action); }
.rm-card.st-locked { opacity: .6; }
.badge.st-held { background: var(--done-bg); color: var(--done); }
.badge.st-doing { background: var(--doing-bg); color: var(--doing-text); }
.badge.st-available { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.badge.st-locked { background: var(--line); color: var(--text-muted); }
.rm-legend .badge { margin-right: 6px; }
.checklist ul { list-style: none; padding-left: 20px; }
/* Phones: each path becomes its own block, levels labelled inline. */
@media (max-width: 760px) {
  .roadmap { grid-template-columns: 1fr; }
  .roadmap > * { grid-row: auto !important; grid-column: auto !important; }
  .rm-head { display: none; }
  .rm-path { margin-top: 10px; }
  .rm-cell::before { content: attr(data-level); font-size: .75rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
  .rm-expert { margin-top: 10px; }
}

/* ---- Brand: "Orbit" logo, Sora wordmark, Manrope tagline (fonts self-hosted, SIL OFL) ---- */
@font-face { font-family: "Sora"; font-weight: 600; font-display: swap; src: url("fonts/sora-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 700; font-display: swap; src: url("fonts/manrope-latin-700-normal.woff2") format("woff2"); }
/* The wordmark and the orbit chart. --brand-ink is the design system's own
   masthead ink and already inverts for dark, so the logo follows the theme with
   no second set of values here. The "off" greys are states of the orbit chart
   rather than brand colours, so they map onto the neutral tokens. */
:root {
  --ink: var(--brand-ink, #0E2A47);
  --brand-accent: var(--accent, #F5A524);
  --logo-ink: var(--brand-ink, #0E2A47);
  --logo-eye: var(--card, #FFFFFF);
  --logo-ring-op: .18;
  --node-off: var(--muted, #E6EAF0);
  --node-off-line: var(--border, #C9D1DC);
  --node-off-text: var(--muted-foreground, #8795A6);
  --link-off: var(--border, #D7DEE7);
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.wordmark { font-family: "Sora", system-ui, sans-serif; font-weight: 600; letter-spacing: -.02em; font-size: 1.15rem; line-height: 1; white-space: nowrap; }
.logo-ink { fill: var(--logo-ink); }
.logo-eye { fill: var(--logo-eye); }
.logo-ring { stroke: var(--logo-ink); stroke-opacity: var(--logo-ring-op); }
.logo-spokes { stroke: var(--logo-ink); }
h1, h2, .rm-name, .orbit-name { font-family: "Sora", system-ui, sans-serif; font-weight: 600; letter-spacing: -.01em; }
.tagline { font-family: "Manrope", system-ui, sans-serif; font-weight: 700; text-transform: uppercase; letter-spacing: .32em; font-size: .75rem; color: #4F6275; }

/* ---- Personal certification orbit (Profile › Certifications) ---- */
.orbit-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px; margin-bottom: 12px; }
.orbit { display: block; width: 100%; max-width: 880px; height: auto; margin: 0 auto; }
.orbit-ring { fill: none; stroke: var(--logo-ink); stroke-opacity: var(--logo-ring-op); stroke-width: 2; }
.orbit-expert { fill: none; stroke: var(--node-off-line); stroke-width: 5; stroke-dasharray: 10 9; }
.orbit-expert.on { stroke: var(--brand-accent); stroke-width: 7; stroke-dasharray: none; }
/* The ERP Practitioner ring, inside the Associates. Dashed and thinner than
   the Expert line: it is the first step, not the last. Tokens only. */
.orbit-practitioner { fill: none; stroke: var(--action); stroke-opacity: .4; stroke-width: 3; stroke-dasharray: 6 7; }
.orbit-practitioner.on { stroke: var(--action); stroke-width: 4; stroke-dasharray: none; }
/* The hub is PAINT, not ink. var(--ink) inverts to white in dark mode, which
   turned this into a white disc carrying white text -- the same inversion as
   the badges, the footer and the earned nodes. The two literal hexes went with
   it: they were the navy-surface pair, which the design system now names. */
.orbit-core { fill: var(--brand-surface); }
.orbit-name { fill: var(--brand-surface-foreground, #fff); text-anchor: middle; }
.orbit-tag { fill: var(--brand-surface-muted, #b9c8d8); text-anchor: middle; font-family: "Manrope", system-ui, sans-serif; font-weight: 700; font-size: 9px; letter-spacing: .18em; }
.orbit-node text { text-anchor: middle; font-family: "Manrope", system-ui, sans-serif; pointer-events: none; }
.orbit-node text.code { font-weight: 700; }
.orbit-node.off circle { fill: var(--node-off); stroke: var(--node-off-line); stroke-width: 2; }
.orbit-node.off text { fill: var(--node-off-text); }
/* An EARNED certification.
 *
 * Two things were wrong here, and they are the same bug in two places.
 *
 * The ring was var(--surface) -- the page's own card colour, so white on a
 * white page. It separated the node from the ring line behind it but said
 * nothing: "earned" was carried by the dark fill alone. It is now var(--earned),
 * a colour that exists to mean exactly this (see ~/design tokens.css).
 *
 * The fill was var(--ink), which is WORDMARK ink: it inverts to white in dark
 * mode. A white circle with the #FFFFFF label below made every earned node
 * invisible in dark mode -- the same inversion that blanked the badges and the
 * footer. --brand-surface is paint, stays navy in both themes, and --earned is
 * light in both so it reads against it either way. */
.orbit-node.on circle { fill: var(--brand-surface); stroke: var(--earned); stroke-width: 3.5; }
.orbit-node.on text { fill: var(--brand-surface-foreground, #fff); }
.orbit-node.on.accent circle { fill: var(--brand-accent); stroke: var(--earned); }
/* Expert is gold-filled. --accent-foreground is the token for text ON accent,
   and it is dark in both themes, which is what gold needs. */
.orbit-node.on.accent text { fill: var(--accent-foreground, #0e2a47); }
/* ERP Practitioner sits in a gap on the Associate ring but is a tier below it,
   so its bubble is outlined rather than filled like an Associate's. */
/* The ERP Practitioner capsule: a thick round-capped arc on its own ring, with
   its name set along the curve. cap-edge is the wider stroke underneath, which
   is what gives the capsule its outline. */
/* It is the starting point, so it carries the action colour even before it is
   earned, rather than sitting grey with everything else. Outlined when not yet
   earned and filled once it is, which keeps the chart's "filled = earned"
   language intact while still letting it stand out. */
.orbit-capsule .cap-edge { fill: none; stroke: var(--action); stroke-width: 26; stroke-linecap: round; }
.orbit-capsule .cap-fill { fill: none; stroke: var(--surface); stroke-width: 20; stroke-linecap: round; }
.orbit-capsule .cap-guide { fill: none; stroke: none; }
.orbit-capsule .cap-label { fill: var(--action); font-family: "Manrope", system-ui, sans-serif; font-weight: 700; font-size: 9px; letter-spacing: .06em; pointer-events: none; }
.orbit-capsule.on .cap-fill { stroke: var(--action); }
.orbit-capsule.on .cap-label { fill: var(--action-text); }

/* The three capsules travel clockwise around their ring as one group.
   transform-box is set so the rotation uses the inline transform-origin (the
   orbit's centre, written by lib/orbit.js) rather than the element's own
   bounding box.

   Two labels per capsule, one on each direction of the arc, swap so the name is
   never upside down: a single label would be inverted for half of every
   revolution. The swap offsets are tied to the FIRST capsule's start angle
   (298.5deg) -- it passes 0deg at 17.08% of a turn and 180deg at 67.08% -- so
   they must be recomputed if that angle changes. The other two capsules reuse
   these keyframes at their own phase, through a negative animation-delay that
   lib/orbit.js writes inline from their spacing and this duration; change the
   72s here and it must change there. The 0.01% steps make each swap instant
   rather than a cross-fade through two visible labels.

   With motion turned off none of this runs, and the inline opacity lib/orbit.js
   writes leaves each capsule on whichever of its two labels is upright where it
   stands. */
@keyframes orbit-cap-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes orbit-cap-upper { 0%, 17.08% { opacity: 1; } 17.09%, 67.07% { opacity: 0; } 67.08%, 100% { opacity: 1; } }
@keyframes orbit-cap-lower { 0%, 17.08% { opacity: 0; } 17.09%, 67.07% { opacity: 1; } 67.08%, 100% { opacity: 0; } }
.orbit-capsule { transform-box: view-box; }
.orbit-capsule .cap-label-alt { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .orbit-capsule { animation: orbit-cap-spin 72s linear infinite; }
  .orbit-capsule .cap-label { animation: orbit-cap-upper 72s linear infinite; }
  .orbit-capsule .cap-label-alt { animation: orbit-cap-lower 72s linear infinite; }
  /* It is a link: hold it still when someone goes to read or click it. */
  .orbit-capsule:hover, .orbit-capsule:focus-within,
  .orbit-capsule:hover .cap-label, .orbit-capsule:focus-within .cap-label,
  .orbit-capsule:hover .cap-label-alt, .orbit-capsule:focus-within .cap-label-alt { animation-play-state: paused; }
}
.orbit-node.doing circle { fill: var(--surface); stroke: var(--doing); stroke-width: 4; }
.orbit-node.doing text { fill: var(--text); }
.orbit-node:hover circle, .orbit-node:focus circle { stroke: var(--action); stroke-width: 4; }
.orbit-node:focus { outline: none; }
/* Pointing at a bubble (public/orbit.js): it and the certifications still needed for it stay bright, the rest fade. */
.orbit-node { transition: opacity .15s; }
.orbit.tracing .orbit-node:not(.is-target):not(.is-need) { opacity: .25; }
.orbit.tracing .orbit-node.is-need circle { stroke: var(--doing); stroke-width: 5; }
.orbit.tracing .orbit-node.is-target circle { stroke: var(--action); stroke-width: 5; }
/* The same two states for the capsule, which is built from paths, not a circle. */
.orbit.tracing .orbit-capsule.is-need .cap-edge { stroke: var(--doing); stroke-width: 30; }
.orbit.tracing .orbit-capsule.is-need .cap-label { fill: var(--doing); }
.orbit.tracing .orbit-capsule.is-need.on .cap-fill { stroke: var(--doing); }
.orbit.tracing .orbit-capsule.is-need.on .cap-label { fill: var(--action-text); }
.orbit.tracing .orbit-capsule.is-target .cap-edge { stroke: var(--action); stroke-width: 30; }
@media (prefers-reduced-motion: reduce) { .orbit-node { transition: none; } }
.orbit-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; font-size: .88rem; color: var(--text-muted); }
.orbit-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; margin-right: 6px; }
.orbit-legend .k-on { background: var(--brand-surface); border: 3px solid var(--earned); } .orbit-legend .k-doing { border: 3px solid var(--doing); }
.orbit-legend .k-off { background: var(--node-off); border: 2px solid var(--node-off-line); }
.orbit-legend .k-exp { border: 3px dashed var(--node-off-line); }
.level-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 12px 0; }
.level-counts .card { margin: 0; text-align: center; }
.level-counts strong { display: block; font-size: 1.5rem; font-family: "Sora", system-ui, sans-serif; }
.subnav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 8px 0 18px; }
.subnav a { padding: 8px 12px; text-decoration: none; color: var(--text-muted); border-bottom: 3px solid transparent; }
.subnav a[aria-current="page"] { color: var(--text); border-color: var(--action); font-weight: 600; }

/* ---- Road map poster: levels as rows, paths as columns ---- */
/* --pm-track is set inline from the number of paths on show, so the level rows
   and the full-width Practitioner/Expert bands always end on the same column.
   The literal below is the four-path default, used if the variable is absent. */
.pmap { display: grid; grid-template-columns: var(--pm-track, 130px minmax(0, 2fr) repeat(3, minmax(0, 1fr))); column-gap: 14px; row-gap: 0; margin: 26px 0 10px; }
.pm-corner { grid-column: 1; }
/* Column titles: no boxes, just the module codes over the path name, with a navy rule. */
.pm-path { display: grid; align-content: end; gap: 2px; padding: 0 4px 12px; border-bottom: 3px solid var(--ink); text-align: center; }
.pm-path-codes { font-family: "Sora", system-ui, sans-serif; font-weight: 600; font-size: 1.05rem; letter-spacing: .02em; color: var(--text); }
.pm-path-name { font-size: .8rem; color: var(--text-muted); line-height: 1.3; }
/* Each level is a band with breathing room; alternate bands are shaded so rows read across. */
.pm-band { padding: 18px 0; }
.pmap > .pm-band:nth-child(n) { border-bottom: 1px solid var(--line); }
.pm-level { grid-column: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.pm-level strong { font-family: "Sora", system-ui, sans-serif; font-weight: 600; }
.pm-cell { display: grid; gap: 10px; align-content: start; }
.pm-cell.pm-fspm > .pm-card:only-child { grid-column: 1 / -1; }
.pm-cell.pm-fspm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pm-span { grid-column: 2 / -1; display: flex; justify-content: center; align-items: center; }
.pm-none { display: block; }
.pm-card { display: grid; gap: 3px; align-content: center; min-height: 74px; background: var(--surface); border: 2px solid var(--ink); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: var(--text); }
.pm-card:hover { box-shadow: 0 2px 12px rgba(14, 42, 71, .14); }
.pm-card .rm-name { font-size: .95rem; line-height: 1.3; }
.pm-card.st-held { border-color: var(--done); background: var(--done-bg); }
.pm-card.st-doing { border-width: 4px; border-color: var(--doing); }
.pm-card.st-locked { opacity: .6; }
.pm-expert { width: 100%; border-color: var(--brand-accent); justify-items: center; text-align: center; }
.pm-practitioner { width: 100%; border-color: var(--action); justify-items: center; text-align: center; }
@media (max-width: 900px) {
  .pmap { grid-template-columns: 1fr; }
  .pmap > * { grid-column: 1 !important; }
  .pm-corner, .pm-path { display: none; }
  .pm-level { flex-direction: row; justify-content: flex-start; padding: 16px 0 8px; border-bottom: 0 !important; }
  .pm-band { padding: 6px 0; }
  .pm-cell:empty, .pm-cell:has(> .pm-none) { display: none; }
  .pm-cell::before { content: attr(data-path); font-size: .75rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
  .pm-cell.pm-fspm { grid-template-columns: 1fr 1fr; }
  .pm-cell.pm-fspm::before { grid-column: 1 / -1; }
}

/* ---- Level badges (ERP <Level> with stars) ---- */
.course-head { display: flex; align-items: center; gap: 14px; }
.course-head h1 { margin: 0; }
.level-counts .card { display: grid; justify-items: center; gap: 4px; }
.level-counts .not-yet .badge-hex { filter: grayscale(1); opacity: .45; }

/* ---- Courses by level ---- */
.course-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 16px; }
.course-item { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-decoration: none; color: var(--text); }
.course-item:hover { border-color: var(--action); }
.course-item.st-held { border-color: var(--done); background: var(--done-bg); }
.course-item.st-doing { border-color: var(--doing); }
.course-item.st-locked .badge-hex { filter: grayscale(1); opacity: .5; }
.course-item .badge-hex { flex: none; }
.flush { margin: 0; }

/* ---- Courses › level tab: big badge left, list right ---- */
.level-view { display: grid; grid-template-columns: minmax(200px, 260px) 1fr; gap: 28px; align-items: start; margin-top: 18px; }
.level-side { display: grid; justify-items: center; text-align: center; gap: 4px; position: sticky; top: 12px; }
.level-side h2 { margin: 8px 0 0; }
.level-side p { margin: 0; }
.level-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.level-row { display: flex; align-items: baseline; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--ink); border-radius: 10px; padding: 14px 16px; text-decoration: none; color: var(--text); }
.level-row:hover { border-color: var(--action); }
.level-row .rm-code { min-width: 4.5em; }
.level-row.st-held { border-left-color: var(--done); background: var(--done-bg); }
.level-row.st-doing { border-left-color: var(--doing); }
.level-row.st-locked { border-left-color: var(--line); color: var(--text-muted); }
@media (max-width: 700px) { .level-view { grid-template-columns: 1fr; } .level-side { position: static; } .level-side .badge-hex { width: 140px; height: auto; } }

/* Header lines up with wide pages; "The levels" cards sit four across. */
.top .wrap { max-width: 1100px; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.grid4 .card { margin: 0; }


/* Two-step sign-in recovery codes */
ul.codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, max-content); gap: .4rem 1.5rem; font-size: 1.1rem; }

/* ---- Level colours for the certification orbit: one per ring, matched in the key and the level cards ---- */
:root {
  --ring-associate: var(--level-associate, #3B82C4);
  --ring-analyst: var(--level-analyst, #1E9E8F);
  --ring-lead: var(--level-lead, #7A5BB5);
  --ring-expert: var(--level-expert, #F5A524);
  --lvl-associate-text: var(--level-associate-text, #2563A0);
  --lvl-analyst-text: var(--level-analyst-text, #137A6E);
  --lvl-lead-text: var(--level-lead-text, #64479C);
  --lvl-expert-text: var(--level-expert-text, #8F5B00);
}
.orbit-ring.ring-associate { stroke: var(--ring-associate); }
.orbit-ring.ring-analyst { stroke: var(--ring-analyst); }
.orbit-ring.ring-lead { stroke: var(--ring-lead); }
.orbit-ring[class*="ring-"] { stroke-opacity: .75; stroke-width: 3; }
.orbit-expert { stroke: var(--ring-expert); stroke-opacity: .75; }
.orbit-levels { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin: 6px 0 2px; font-family: "Sora", system-ui, sans-serif; font-weight: 600; }
.orbit-levels .lvl i { display: inline-block; width: 26px; height: 0; border-top: 4px solid; border-radius: 2px; vertical-align: middle; margin-right: 8px; }
/* Foundation sits before the orbit rather than on a ring, so it takes the
   existing muted/border tokens rather than a new brand hue: a new colour
   value belongs in the shared design system, reviewed once, not invented
   here. Its key marker is dotted, which reads as "the gate before the map". */
.lvl-foundation { color: var(--text-muted); } .lvl-foundation i { border-top-style: dotted; border-color: var(--line); }
.lvl-associate { color: var(--lvl-associate-text); } .lvl-associate i { border-color: var(--ring-associate); }
.lvl-analyst { color: var(--lvl-analyst-text); } .lvl-analyst i { border-color: var(--ring-analyst); }
.lvl-lead { color: var(--lvl-lead-text); } .lvl-lead i { border-color: var(--ring-lead); }
.lvl-expert { color: var(--lvl-expert-text); } .lvl-expert i { border-top-style: dashed; border-color: var(--ring-expert); }
.orbit-help { text-align: center; margin-top: 4px; }
.level-counts .lvl-card { border-top: 5px solid; }
.level-counts .lvl-card.lvl-foundation { border-top-color: var(--line); border-top-style: dotted; }
.level-counts .lvl-card.lvl-associate { border-top-color: var(--ring-associate); }
.level-counts .lvl-card.lvl-analyst { border-top-color: var(--ring-analyst); }
.level-counts .lvl-card.lvl-lead { border-top-color: var(--ring-lead); }
.level-counts .lvl-card.lvl-expert { border-top-color: var(--ring-expert); }
.level-counts .lvl-card .label { color: inherit; }

/* "In progress" colour (Roger: not gold, which is Expert). Coral from the designer's palette. */
/* --doing and --doing-text are now design-system tokens under those exact
   names, so the rules below read them directly -- aliasing a name onto itself
   is a cycle, and the only one that needs a local name is the subtle fill. */
:root {
  --doing-bg: var(--doing-subtle, #FFEDE8);
}

/* ---- Site footer (every page). The page fills the window so the footer sits at the bottom of short pages. ---- */
body { min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; width: 100%; }
/* The footer is a brand SURFACE, not brand ink: --brand-ink inverts to white
   for a dark masthead, and using it here turned the whole footer white with
   white text on it. --brand-surface stays navy in both themes. */
.site-footer { background: var(--brand-surface, #0E2A47); color: var(--brand-surface-muted, #C9D5E3); margin-top: 56px; padding: 36px 0 28px; }
.site-footer .wrap { max-width: 1100px; display: grid; grid-template-columns: 1fr auto; gap: 18px 32px; align-items: center; }
.foot-brand { display: flex; align-items: center; gap: 12px; }
.foot-brand > div { display: grid; gap: 4px; }
.site-footer .wordmark { color: var(--brand-surface-foreground, #FFFFFF); }
.site-footer .tagline { color: var(--brand-surface-muted, #B9C8D8); font-size: .68rem; }
.site-footer .logo-ink { fill: var(--brand-surface-foreground, #FFFFFF); }
.site-footer .logo-eye { fill: var(--brand-surface, #0E2A47); }
.site-footer .logo-ring { stroke: var(--brand-surface-foreground, #FFFFFF); stroke-opacity: .22; }
.site-footer .logo-spokes { stroke: var(--brand-surface-foreground, #FFFFFF); }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot-links a { color: var(--brand-surface-muted, #E3EAF2); text-decoration: none; }
.foot-links a:hover, .foot-links a:focus-visible { color: var(--brand-surface-foreground, #FFFFFF); text-decoration: underline; }
.foot-copy { grid-column: 1 / -1; margin: 6px 0 0; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .14); font-size: .85rem; color: var(--brand-surface-muted, #9FB1C5); }
@media (max-width: 700px) { .site-footer .wrap { grid-template-columns: 1fr; } }

/* ---- Certification journey (Courses). Routes through the catalogue, grouped
   by path rather than by job role (Roger, 13 Nov 2026). Level tokens are the
   ones the orbit legend already defines; no new colour values here. ---- */
.journeys { margin: 34px 0 10px; }
.jny-paths { display: grid; gap: 14px; }
.jny-path { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.jny-path-name { margin: 0 0 10px; font-size: 1.02rem; }
.jny-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.jny-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.jny-arrow, .jny-and { display: flex; align-items: center; color: var(--text-muted); font-weight: 700; }
.jny-arrow { font-size: 1.1rem; }
.jny-card { display: grid; align-content: center; gap: 2px; min-width: 132px; flex: 0 1 auto;
  background: var(--surface); color: var(--text); text-decoration: none;
  border: 1px solid var(--line); border-top: 4px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.jny-card:hover, .jny-card:focus-visible { box-shadow: 0 2px 12px rgba(14, 42, 71, .14); }
.jny-card .rm-name { font-size: .92rem; line-height: 1.25; }
.jny-lvl { font-family: "Manrope", system-ui, sans-serif; font-weight: 700; font-size: .64rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); }
/* The level stripe. Foundation is dotted, matching the orbit's key, because it
   is the gate before the map rather than a tier on it. */
.jny-card.lvl-foundation { color: var(--text); border-top-style: dotted; border-top-color: var(--action); }
.jny-card.lvl-associate { color: var(--text); border-top-color: var(--ring-associate); }
.jny-card.lvl-analyst { color: var(--text); border-top-color: var(--ring-analyst); }
.jny-card.lvl-lead { color: var(--text); border-top-color: var(--ring-lead); }
.jny-card.lvl-expert { color: var(--text); border-top-color: var(--ring-expert); }
.jny-card.jny-many { border-style: dashed; border-top-style: solid; }
/* Personal progress, in the same language the road map uses. */
.jny-card.st-held { border-color: var(--done); border-top-color: var(--done); background: var(--done-bg); }
.jny-card.st-doing { border-color: var(--doing); border-top-color: var(--doing); }
.jny-card.st-locked { opacity: .6; }
/* "Where the paths meet" is not a fifth path: it is the one certification no
   path owns, so it spans the grid and sits apart from the four. */
.jny-path.jny-meet { background: var(--bg); border-style: dashed; }
.jny-path.jny-meet > p { margin-bottom: 0; }
@media (min-width: 900px) { .jny-paths { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jny-path.jny-meet { grid-column: 1 / -1; } }

/* Profile › Module progress: title and percentage on one line, bar beneath. */
.modprog > li { list-style: none; margin: 0 0 14px; }
.modprog .enr-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.modprog .enr-line strong { font-variant-numeric: tabular-nums; }

/* Exam result › Where you went wrong.
   Tokens only: this file's surface token is --surface, and my first version
   used var(--card, #fff), which does not exist here -- so the fallback won and
   the cards stayed bright white in dark mode (Roger, 14 Nov 2026). Same for the
   tick and cross, which were literal hex: --done and --error already carry
   light- and dark-mode values. */
.exam-review { padding-left: 0; }
.exam-review > .rev { list-style: none; margin: 0 0 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); }
.exam-review .rev-q { font-weight: 600; margin: 0 0 10px; }
.exam-review .rev-a { margin: 4px 0; display: flex; gap: 10px; align-items: baseline; }
.exam-review .rev-label { flex: 0 0 7.5rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); }
.exam-review .rev-a.wrong::before { content: "✗"; color: var(--error); font-weight: 700; }
.exam-review .rev-a.right::before { content: "✓"; color: var(--done); font-weight: 700; }
.exam-review .rev-where { margin: 10px 0 0; }

/* ---- Floating dock: Ask (chat) bottom-left, Feedback bottom-right ---------
   Roger, 14 Nov 2026. Fixed, above the page but below a modal. The two sit on
   opposite sides so neither covers the other, and both clear the mobile
   viewport's bottom inset. The label hides on narrow screens, leaving the icon. */
.dock { position: fixed; inset: auto 0 0 0; pointer-events: none; z-index: 60; }
.dock-btn {
  position: fixed; bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem .95rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-size: .92rem;
  box-shadow: 0 2px 10px rgb(0 0 0 / 18%); cursor: pointer; pointer-events: auto;
  text-decoration: none;
}
.dock-btn:hover { border-color: var(--action); }
.dock-btn:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.dock-chat { left: 18px; }
.dock-fb { right: 18px; }
.dock-btn > span[aria-hidden] { font-size: 1.05rem; line-height: 1; }
@media (max-width: 560px) { .dock-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } }

/* The feedback dialog. A native <dialog>, so Escape and focus trapping are the
   browser's job rather than ours.

   pointer-events MUST be restored here. The dialog is rendered inside .dock,
   which sets pointer-events: none so the empty strip across the bottom of the
   viewport cannot swallow clicks on the page. pointer-events INHERITS, and
   promotion to the top layer does not break inheritance, so without this line
   the whole modal is click-through: the <select> will not open, the textarea
   cannot be clicked into and Send does nothing. .dock-btn and .dock-panel each
   restore it the same way. (Roger, 15 Nov 2026: "the drop down does not work".) */
.fbdlg {
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  color: var(--text); padding: 1.25rem; max-width: 30rem; width: calc(100vw - 2rem);
  pointer-events: auto;
}
.fbdlg::backdrop { background: rgb(0 0 0 / 45%); }
.fbdlg h2 { margin: 0 0 .25rem; font-size: 1.1rem; }
.fbdlg label { display: block; margin: .8rem 0 .25rem; font-weight: 600; font-size: .9rem; }
.fbdlg select, .fbdlg textarea {
  width: 100%; padding: .5rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text); font: inherit;
}
.fbrow { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; }

/* The chat panel the ChatDock island opens, anchored to its launcher. */
.dock-panel {
  position: fixed; left: 18px; bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  width: min(27rem, calc(100vw - 2rem)); max-height: min(34rem, calc(100vh - 7rem));
  display: flex; flex-direction: column; pointer-events: auto;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 6px 28px rgb(0 0 0 / 24%); z-index: 61;
}
.dock-panel-head { padding: .9rem 1rem .4rem; border-bottom: 1px solid var(--line); }
.dock-panel-head p { margin: .3rem 0 .5rem; }
.dock-panel-body { overflow: auto; padding: .75rem 1rem; flex: 1 1 auto; }
.dock-panel-foot { margin: 0; padding: .5rem 1rem .75rem; border-top: 1px solid var(--line); }
.dock-slot { display: contents; }

/* ---- Theme toggle -------------------------------------------------------
   Sits in the header beside the nav. Rendered hidden by the server and
   revealed by script, because without JavaScript it cannot do anything and
   should not pretend otherwise -- the design system's media query still
   follows the device in that case. */
.theme-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 12px; padding: 6px 10px;
  min-height: 32px;                   /* a real target on a phone */
  font: inherit; font-size: .82rem; font-weight: 600;
  color: var(--text-muted); background: transparent;
  border: 1px solid var(--line); border-radius: 999px;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--text); border-color: var(--action); }
.theme-toggle:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.theme-icon { font-size: .95rem; line-height: 1; }
@media (max-width: 560px) { .theme-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }
