/* /course: the free course. "The Ruled Record" carried into a course: the register is the course map, progress is a
   dated record entry, never a badge or a bar. Uses the tokens in site.css only. Red, amber and green appear only inside
   the quiz frame, as the status of an answer. Motion: transform only, and none under reduced motion. */

.cx-meta { font-size: 0.8125rem; line-height: 1.25rem; color: var(--muted); }
.cx-facts { margin: -8px 0 28px; font-size: 0.875rem; line-height: 1.375rem; color: var(--ink-2); }
.cx-fine { margin-top: 16px; font-size: 0.875rem; line-height: 1.375rem; color: var(--muted); max-width: 70ch; }
.cx-opt { font-weight: 400; color: var(--muted); }
.field__l { font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; color: var(--ink-2); }
.cx-mhead h1 { max-width: 22em; }
.cx-mhead .cx-meta { margin-bottom: 14px; }

/* ---- the record mark: an empty ruled box that takes a drawn tick when the entry is made */
.cx-mark { flex: none; width: 16px; height: 16px; border: 1px solid var(--rule-2); border-radius: 3px; position: relative; background: var(--paper); }
.is-done > a .cx-mark, .is-done > .cx-mark, .cx-end__mark.is-done .cx-mark { border-color: var(--accent); background: var(--accent); }
.is-done > a .cx-mark::after, .cx-end__mark.is-done .cx-mark::after, .cx-entry.is-done .cx-mark::after { content: ""; position: absolute; left: 4px; top: 1.5px; width: 5px; height: 9px; border: solid var(--paper); border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); }

/* ---- lesson layout: the contents rail and one reading column */
.cx-lesson { display: grid; grid-template-columns: 288px minmax(0, 1fr); gap: 56px; padding-block: 32px 72px; align-items: start; }
.cx-rail { position: sticky; top: 88px; max-height: calc(100vh - 112px); max-height: calc(100dvh - 112px); overflow: auto; padding-inline-end: 8px; scrollbar-width: thin; }
.cx-rail > summary { display: none; }
.cx-rail__mod { font-size: 0.875rem; line-height: 1.25rem; padding-bottom: 12px; border-bottom: 1px solid var(--rule-2); }
.cx-rail__mod a { color: var(--ink); font-weight: 600; display: block; }
.cx-rail__mod .mono { display: block; font-weight: 400; color: var(--muted); font-size: 0.75rem; margin-bottom: 2px; }
.cx-rail__list { list-style: none; padding: 0; margin: 0; }
.cx-rail__list li { border-bottom: 1px solid var(--rule); }
.cx-rail__list a { display: grid; grid-template-columns: 22px minmax(0, 1fr) 16px; gap: 10px; align-items: start; padding-block: 10px; padding-inline: 0 4px; color: var(--ink-2); font-size: 0.875rem; line-height: 1.25rem; text-decoration: none; }
.cx-rail__list a:hover { color: var(--ink); }
.cx-rail__list a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.cx-rail__list a[aria-current="page"] .cx-rail__n { color: var(--accent); }
.cx-rail__n { font-size: 0.75rem; color: var(--muted); line-height: 1.25rem; }
.cx-rail__list .cx-mark { margin-top: 2px; }

.cx-read { min-width: 0; max-width: 46rem; }
.cx-read__head { padding-bottom: 20px; margin-bottom: 28px; border-bottom: 1px solid var(--rule); }
.cx-read__head h1 { font-size: clamp(2rem, 1.6579rem + 1.4035vw, 2.5rem); line-height: 1.12; letter-spacing: -0.022em; margin-bottom: 10px; }

/* ---- the book's text */
.cx-text { color: var(--ink-2); font-size: 1.125rem; line-height: 1.875rem; }
.cx-text > * + *, .cx-text .keep > * + * { margin-top: 18px; }
.cx-text .keep + *, .cx-text * + .keep { margin-top: 18px; }
.cx-text :is(h2, h3) { font-size: 1.3125rem; line-height: 1.875rem; color: var(--ink); margin-top: 40px; letter-spacing: -0.01em; scroll-margin-top: 96px; }
.cx-text .keep > :is(h2, h3):first-child { margin-top: 40px; }
.cx-text > .keep:first-child > :is(h2, h3):first-child { margin-top: 0; }
.cx-text strong { color: var(--ink); font-weight: 600; }
.cx-text ul, .cx-text ol { padding-inline-start: 1.3em; }
.cx-text li + li { margin-top: 8px; }
.cx-text li::marker { color: var(--muted); }
.cx-text ol > li::marker { font-family: var(--font-mono); font-size: 0.875rem; }
.cx-text a { text-decoration: underline; text-decoration-color: var(--rule-2); }
.cx-text a:hover { text-decoration-color: currentColor; }
.cx-text code { font-family: var(--font-mono); font-size: .88em; background: var(--paper-3); padding: 1px 5px; border-radius: 3px; }
.cx-text .lbl { color: var(--ink); font-weight: 600; margin-top: 24px; }
.cx-text .fn { font-size: 0.6875rem; line-height: 0; margin-inline-start: 1px; }
.cx-text .fn a { font-family: var(--font-mono); color: var(--muted); padding: 0 2px; text-decoration: none; }
.cx-text .fn a:hover { color: var(--accent); }
.bkref { display: inline-flex; font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.125rem; padding: 1px 7px; border: 1px dashed var(--rule-2); border-radius: 4px; color: var(--ink); white-space: nowrap; vertical-align: 1px; }
.cx-text .ref { font-size: 0.8125rem; }

/* boxes: hairline panels, a label set in the ink of its kind, never a coloured side bar */
.cx-text .box { border: 1px solid var(--rule-2); border-radius: var(--radius-card); padding: 18px 20px; background: var(--paper); font-size: 1.0625rem; line-height: 1.75rem; }
.cx-text .box > * + * { margin-top: 12px; }
.cx-text .box-label, .cx-text .hb-head { font-size: 0.875rem; line-height: 1.25rem; font-weight: 600; color: var(--ink); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cx-text .box-key { background: var(--accent-wash); border-color: var(--accent-soft); }
/* The status dot, one shape wherever it appears in the course */
.cx-text .box-watch .box-label::before, .cx-fb__v::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.cx-text .box-watch .box-label::before { background: var(--status-warn); }
.cx-text .box-handbook { background: var(--paper-2); }
.cx-text .hb-kind { font-weight: 400; color: var(--muted); }
.cx-text .box-example .ex-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.cx-text .ex-kind { font-size: 0.8125rem; color: var(--muted); }
.cx-text .ex-title { color: var(--ink); font-weight: 600; font-size: 1.125rem; }
.cx-text .ex-comment { border-top: 1px solid var(--rule); padding-top: 12px; }
.cx-text .box .ticks { border-top: 0; }
.cx-text .box .ticks li { font-size: 1rem; line-height: 1.625rem; padding-block: 10px; }
.cx-text .box .ticks li::before { top: 18px; }
.cx-text .box .ticks li:last-child { border-bottom: 0; }
.cx-text table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.4375rem; }
.cx-text .table { overflow-x: auto; border-top: 1px solid var(--rule-2); }
.cx-text th, .cx-text td { text-align: start; vertical-align: top; padding-block: 10px; padding-inline: 0 14px; border-bottom: 1px solid var(--rule); }
.cx-text thead th { font-size: 0.8125rem; line-height: 1.25rem; font-weight: 500; color: var(--muted); border-bottom-color: var(--rule-2); }
.cx-text tbody th { color: var(--ink); font-weight: 500; }
.cx-text table.dates th { white-space: nowrap; font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 400; }
.cx-text .dates-who { display: block; color: var(--muted); font-size: 0.875rem; }
.cx-text table.test th { width: 30%; }

.cx-end { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--rule-2); }
.cx-end__mark { display: flex; gap: 12px; align-items: center; font-size: 0.9375rem; line-height: 1.375rem; color: var(--muted); }
.cx-end__mark.is-done { color: var(--ink); }
.cx-end__mark.is-done .cx-mark { animation: cx-stamp .45s var(--ease) both; }
@keyframes cx-stamp { from { transform: scale(.6); } to { transform: none; } }

.cx-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.cx-pager a { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--rule-2); border-radius: var(--radius-card); color: var(--ink); min-height: 72px; align-content: center; transition: border-color .15s var(--ease), background-color .15s var(--ease); text-decoration: none; }
.cx-pager a:hover { border-color: var(--accent-line); background: var(--accent-wash); }
.cx-pager__next { text-align: end; }
.cx-pager__l { font-size: 0.8125rem; line-height: 1.125rem; color: var(--muted); }
.cx-pager__t { font-weight: 600; font-size: 1rem; line-height: 1.4375rem; }

.cx-notes { margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--rule); }
.cx-notes h2 { font-size: 1rem; line-height: 1.5rem; margin-bottom: 12px; }
.cx-notes ol { padding-inline-start: 2em; font-size: 0.875rem; line-height: 1.3125rem; color: var(--ink-2); display: grid; gap: 8px; }
.cx-notes li::marker { font-family: var(--font-mono); color: var(--muted); font-size: 0.75rem; }
.cx-notes li:target { background: var(--accent-wash); }
.cx-notes a { overflow-wrap: anywhere; }
.cx-srcs > summary { display: flex; gap: 12px; align-items: center; cursor: pointer; font-weight: 600; color: var(--ink); min-height: 44px; }
/* Disclosures that draw their own chevron hide the browser's marker */
:is(.cx-srcs, .cx-path, .cx-guide, .cx-rail) > summary { list-style: none; }
:is(.cx-srcs, .cx-path, .cx-guide, .cx-rail) > summary::-webkit-details-marker { display: none; }
.cx-srcs > summary svg { width: 18px; height: 18px; color: var(--muted); transition: transform .2s var(--ease); }
.cx-srcs[open] > summary svg { transform: rotate(180deg); }
.cx-srcs .cx-notes { margin-top: 8px; border-top: 0; padding-top: 0; }
.cx-srcs .cx-notes h2 { position: absolute; clip-path: inset(50%); overflow: hidden; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; white-space: nowrap; }

/* ---- the register: one ruled row per entry, a record column on the right */
.cx-reg { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule-2); container-type: inline-size; }
.cx-reg > li { border-bottom: 1px solid var(--rule); }
.cx-reg > li > a, .cx-reg--plain > li { display: grid; grid-template-columns: 44px minmax(0, 1fr) 150px 210px; gap: 16px; align-items: baseline; padding: 16px 0; color: inherit; text-decoration: none; }
.cx-reg > li > a:hover { background-color: var(--paper-2); }
.cx-reg > li > a:hover .cx-reg__t { color: var(--accent); }
.cx-reg__n { color: var(--muted); font-size: 0.875rem; }
.cx-reg__t { color: var(--ink); font-weight: 600; font-size: 1.0625rem; line-height: 1.5625rem; transition: color .15s var(--ease); }
.cx-reg__s { display: block; margin-top: 2px; font-weight: 400; color: var(--ink-2); font-size: 0.9375rem; line-height: 1.4375rem; max-width: 64ch; }
.cx-reg__m { color: var(--muted); font-size: 0.8125rem; }
.cx-reg__r { text-align: end; font-size: 0.8125rem; color: var(--muted); position: relative; }
.cx-reg__r.is-entry { color: var(--ink); }
.cx-reg__r.is-entry::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-inline-end: 8px; vertical-align: 2px; }
.cx-reg__r.is-new { animation: cx-write .9s var(--ease) both; }
@keyframes cx-write { from { transform: translateX(-0.75rem); } to { transform: none; } }   /* the new entry is written in from the left: transform only, so the text keeps full contrast */
.cx-reg--plain > li { grid-template-columns: 44px minmax(0, 1fr); }
.cx-reg--lessons > li > a { grid-template-columns: 44px minmax(0, 1fr) 80px 120px; }
.cx-part + .cx-part { margin-top: 48px; }
.cx-part h3 { font-size: 1.375rem; line-height: 1.875rem; letter-spacing: -0.01em; display: flex; gap: 12px; align-items: baseline; }
.cx-part h3 .mono { font-size: 0.875rem; font-weight: 400; color: var(--muted); }
.cx-part > p { margin: 4px 0 16px; color: var(--ink-2); max-width: 70ch; }

.cx-outcomes { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule-2); max-width: 960px; }
.cx-outcomes li { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); color: var(--ink); font-size: 1.0625rem; line-height: 1.6875rem; }
.cx-stage { font-size: 0.875rem; line-height: 1.6875rem; color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; }
.cx-stage::before { content: ""; width: 28px; height: 6px; border-radius: 1px; background: var(--rule-2); box-shadow: inset calc(28px * var(--fill, .25)) 0 0 var(--accent); flex: none; }
.cx-stage[data-stage="foundation"] { --fill: .25; }
.cx-stage[data-stage="practitioner"] { --fill: .5; }
.cx-stage[data-stage="senior-practitioner"] { --fill: .75; }
.cx-stage[data-stage="head-of-compliance"] { --fill: 1; }
.cx-stage[data-stage=""] { --fill: 0; }
.cx-check { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule-2); max-width: 900px; }
.cx-check li { position: relative; padding-block: 14px; padding-inline: 34px 0; border-bottom: 1px solid var(--rule); font-size: 1.0625rem; line-height: 1.6875rem; color: var(--ink); }
.cx-check li::before { content: ""; position: absolute; inset-inline-start: 0; top: 19px; width: 16px; height: 16px; border: 1px solid var(--rule-2); border-radius: 3px; }

/* ---- the course map */
.cx-maphead h1 { font-size: clamp(2.25rem, 1.7368rem + 2.1053vw, 3rem); max-width: 14em; }
.cx-mine { padding: 24px; }
.cx-mine h2 { font-size: 1.125rem; line-height: 1.625rem; margin-bottom: 12px; }
.cx-mine__rows { margin: 0 0 16px; border-top: 1px solid var(--rule); }
.cx-mine__rows > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 0.9375rem; line-height: 1.375rem; }
.cx-mine__rows dt { color: var(--ink-2); }
.cx-mine__rows dd { margin: 0; color: var(--ink); font-size: 0.875rem; text-align: end; }
.cx-mine__note { font-size: 0.875rem; line-height: 1.3125rem; color: var(--muted); margin-bottom: 14px; }
.cx-paths { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.cx-paths h3 { font-size: 1.25rem; line-height: 1.75rem; }
.cx-paths > div > p { margin: 4px 0 14px; color: var(--ink-2); font-size: 0.9375rem; line-height: 1.4375rem; }
.cx-path { border-top: 1px solid var(--rule); }
.cx-path:last-child { border-bottom: 1px solid var(--rule); }
.cx-path > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto 18px; gap: 10px; align-items: center; padding: 12px 0; cursor: pointer; color: var(--ink); font-weight: 500; font-size: 0.9375rem; line-height: 1.375rem; min-height: 44px; }
.cx-path > summary .mono { font-size: 0.75rem; color: var(--muted); font-weight: 400; }
.cx-path > summary svg { width: 16px; height: 16px; color: var(--muted); transition: transform .2s var(--ease); }
.cx-path[open] > summary svg { transform: rotate(180deg); }
.cx-path > summary:hover { color: var(--accent); }
.cx-path ol { list-style: none; padding: 0 0 12px; margin: 0; display: grid; gap: 2px; }
.cx-path ol a { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 6px; padding: 5px 0; font-size: 0.875rem; line-height: 1.25rem; color: var(--ink-2); }
.cx-path ol a:hover { color: var(--accent); }
.cx-path ol .mono { color: var(--muted); font-size: 0.75rem; }
.cx-path p { font-size: 0.875rem; line-height: 1.3125rem; color: var(--ink-2); margin-bottom: 10px; }
.cx-path .cx-path__req { color: var(--ink); }
.cx-certs { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: start; }
.cx-certs .btn { margin-top: 20px; }
.cx-specimen { margin: 0; }

/* ---- the quiz (a product frame: status colours live here) */
.cx-quiz { padding: 28px; font-size: 1rem; line-height: 1.5625rem; }
.cx-quiz__intro > * + * { margin-top: 18px; }
.cx-quiz__fine { font-size: 0.875rem; line-height: 1.3125rem; color: var(--muted); }
.cx-stages { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cx-stages legend { font-weight: 600; color: var(--ink); margin-bottom: 10px; padding: 0; }
.cx-choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--rule-2); border-radius: var(--radius-card); cursor: pointer; min-height: 48px; transition: border-color .15s var(--ease), background-color .15s var(--ease); }
.cx-choice:hover { border-color: var(--accent-line); }
.cx-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); }
.cx-choice input { flex: none; width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--accent); }
.cx-choice strong { display: block; color: var(--ink); font-weight: 600; }
.cx-choice__d { display: block; font-size: 0.8125rem; line-height: 1.1875rem; color: var(--muted); }
.cx-q__n { font: inherit; color: inherit; letter-spacing: inherit; margin: 0; }
.cx-q__bar { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 20px; font-size: 0.8125rem; color: var(--muted); }
.cx-ticks { display: flex; gap: 3px; flex: 1; max-width: 360px; }
.cx-ticks i { flex: 1; height: 4px; border-radius: 1px; background: var(--rule-2); }
.cx-ticks i.is-right { background: var(--status-ok); }
.cx-ticks i.is-wrong { background: var(--status-bad); }
.cx-ticks i.is-now { background: var(--accent); }
.cx-q__scn { padding: 14px 16px; background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius-card); color: var(--ink-2); margin-bottom: 16px; font-size: 1rem; line-height: 1.5625rem; }
.cx-q__p { font-size: 1.25rem; line-height: 1.8125rem; font-weight: 600; color: var(--ink); margin-bottom: 18px; letter-spacing: -0.005em; }
.cx-q__how { font-size: 0.875rem; color: var(--muted); margin: -10px 0 14px; }
.cx-opts { display: grid; gap: 10px; border: 0; padding: 0; margin: 0; }
.cx-opt-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 20px; gap: 12px; align-items: start; padding: 13px 16px; border: 1px solid var(--rule-2); border-radius: var(--radius-card); cursor: pointer; min-height: 48px; color: var(--ink); transition: border-color .15s var(--ease), background-color .15s var(--ease); }
.cx-opt-row:hover { border-color: var(--accent-line); }
.cx-opt-row:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); }
.cx-opt-row input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--accent); }
.cx-opt-row:has(input:focus-visible) { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.cx-opt-row.is-right, .cx-opt-row.is-right:has(input:checked) { border-color: var(--status-ok); background: color-mix(in srgb, var(--status-ok) 8%, var(--paper)); }
.cx-opt-row.is-wrong, .cx-opt-row.is-wrong:has(input:checked) { border-color: var(--status-bad); background: color-mix(in srgb, var(--status-bad) 7%, var(--paper)); }
.cx-opt-row .cx-sym { width: 18px; height: 18px; margin-top: 3px; }
.cx-locked .cx-opt-row { cursor: default; }
.cx-order { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.cx-order li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--rule-2); border-radius: var(--radius-card); background: var(--paper); color: var(--ink); }
.cx-order li .mono { color: var(--muted); font-size: 0.8125rem; }
.cx-order li.is-right { border-color: var(--status-ok); }
.cx-order li.is-wrong { border-color: var(--status-bad); }
.cx-order__btns { display: flex; gap: 4px; }
.cx-iconbtn { width: 36px; height: 36px; display: inline-grid; place-items: center; border: 1px solid var(--rule-2); border-radius: var(--radius-control); background: var(--paper); color: var(--ink-2); cursor: pointer; }
.cx-iconbtn:hover { border-color: var(--accent-line); color: var(--ink); }
.cx-iconbtn:disabled { opacity: .4; cursor: default; }
.cx-iconbtn svg { width: 16px; height: 16px; }
.cx-match { display: grid; gap: 10px; }
.cx-match__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--rule-2); border-radius: var(--radius-card); }
.cx-match__row.is-right { border-color: var(--status-ok); }
.cx-match__row.is-wrong { border-color: var(--status-bad); }
.cx-match__row span { color: var(--ink); }
.cx-match select, .cx-num input { font: 0.9375rem/1.375rem var(--font-body); color: var(--ink); background: var(--paper); border: 1px solid var(--rule-2); border-radius: var(--radius-control); padding: 9px 12px; width: 100%; min-height: 44px; }
.cx-num { display: flex; gap: 10px; align-items: center; max-width: 320px; }
.cx-num .mono { color: var(--muted); }
.cx-q__actions { display: flex; gap: 16px; align-items: center; margin-top: 22px; flex-wrap: wrap; }
.cx-fb { margin-top: 20px; padding: 16px 18px; border-radius: var(--radius-card); border: 1px solid var(--rule-2); background: var(--paper-2); }
.cx-fb:focus { outline: none; }
.cx-fb.is-right { border-color: color-mix(in srgb, var(--status-ok) 45%, var(--paper)); }
.cx-fb.is-wrong { border-color: color-mix(in srgb, var(--status-bad) 45%, var(--paper)); }
.cx-fb__v { font-weight: 600; color: var(--ink); display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.cx-fb__v::before { background: var(--status-ok); }
.cx-fb.is-wrong .cx-fb__v::before { background: var(--status-bad); }
.cx-fb p { color: var(--ink-2); }
.cx-fb__a { margin-top: 8px; color: var(--ink); }
.cx-fb__more { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 12px; font-size: 0.875rem; }
.cx-result h2 { font-size: 1.75rem; line-height: 2.25rem; letter-spacing: -0.015em; }
.cx-result__score { display: flex; gap: 28px; flex-wrap: wrap; margin: 18px 0; padding: 16px 0; border-block: 1px solid var(--rule); }
.cx-result__score div { display: grid; gap: 2px; }
.cx-result__score dt { font-size: 0.8125rem; color: var(--muted); }
.cx-result__score dd { margin: 0; font-family: var(--font-mono); font-size: 1.375rem; line-height: 1.875rem; color: var(--ink); }
.cx-result > h3 { font-size: 1.25rem; line-height: 1.75rem; margin-top: 32px; }
.cx-result > ul:not(.cx-review) { margin: 10px 0 0; padding-inline-start: 1.2em; display: grid; gap: 4px; }
.cx-steps { margin: 4px 0 0; padding-inline-start: 1.4em; display: grid; gap: 2px; }
.cx-steps li::marker { font-family: var(--font-mono); font-size: 0.8125rem; }
.cx-review { list-style: none; padding: 0; margin: 18px 0 0; border-top: 1px solid var(--rule); }
.cx-review li { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.cx-review__q { color: var(--ink); font-weight: 600; }
.cx-review__a { margin-top: 6px; display: grid; gap: 4px; font-size: 0.9375rem; line-height: 1.375rem; }
.cx-review__a .yours { color: var(--status-bad); }
.cx-review__a .right { color: var(--ink); }
.cx-entry { margin-top: 16px; padding: 12px 16px; border: 1px solid var(--rule-2); border-radius: var(--radius-card); display: flex; gap: 12px; align-items: center; font-size: 0.9375rem; color: var(--ink); }
.cx-entry .mono { margin-inline-start: auto; font-size: 0.8125rem; color: var(--ink-2); animation: cx-write .9s var(--ease) both; }

/* ---- the exercise */
.cx-ex { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--rule-2); }
.cx-ex h2 { font-size: 1.5rem; line-height: 2rem; margin-bottom: 6px; }
.cx-ex__help { font-size: 0.9375rem; line-height: 1.4375rem; color: var(--ink-2); margin-bottom: 14px; }
.cx-ex__text { min-height: 320px; resize: vertical; }
.cx-ex .field textarea { font: 1rem/1.625rem var(--font-body); padding: 14px 16px; }   /* the rest, and the focus ring, come from .field in site.css */
.cx-ex__saved { min-height: 20px; margin-top: 6px; font-size: 0.75rem; color: var(--muted); }
.cx-guide { margin-top: 24px; border: 1px solid var(--rule-2); border-radius: var(--radius-frame); }
.cx-guide > summary { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 18px 20px; cursor: pointer; }
.cx-guide > summary strong { display: block; color: var(--ink); font-size: 1.0625rem; }
.cx-guide__d { display: block; font-size: 0.875rem; color: var(--muted); }
.cx-guide > summary svg { width: 18px; height: 18px; color: var(--muted); transition: transform .2s var(--ease); flex: none; }
.cx-guide[open] > summary svg { transform: rotate(180deg); }
.cx-guide__body { padding: 4px 20px 24px; border-top: 1px solid var(--rule); }
.cx-guide__body h3 { font-size: 1.0625rem; line-height: 1.5625rem; margin: 24px 0 8px; }
.cx-guide__body .cx-text { font-size: 1rem; line-height: 1.625rem; }
.cx-crits { padding: 0; margin: 0; border: 0; border-top: 1px solid var(--rule); min-inline-size: 0; }   /* a fieldset of checkboxes, drawn as before */
.cx-crits > div { border-bottom: 1px solid var(--rule); }
.cx-crit { display: grid; grid-template-columns: 22px minmax(0, 1fr) 36px; gap: 12px; align-items: start; padding: 12px 0; cursor: pointer; font-size: 0.9375rem; line-height: 1.4375rem; color: var(--ink); }
.cx-crit input, .cx-tick input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--accent); }
.cx-crit__m { text-align: end; color: var(--ink-2); font-size: 0.875rem; }
.cx-total { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--rule-2); font-weight: 600; color: var(--ink); }
.cx-total .mono { font-size: 1.125rem; }
.cx-tick { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: start; margin-top: 16px; cursor: pointer; font-size: 0.9375rem; line-height: 1.4375rem; color: var(--ink); }
.cx-ex__actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 22px; }
.cx-ex__status { margin-top: 12px; font-size: 0.9375rem; color: var(--ink); }

/* ---- the record page */
.cx-recgrid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: start; }
.cx-acct { padding: 24px; }
.cx-acct h2, .cx-certlist h2 { font-size: 1.25rem; line-height: 1.75rem; margin-bottom: 8px; }
.cx-form { display: grid; gap: 16px; }
.cx-form .btn { justify-self: start; }
.cx-acct__who { display: grid; gap: 2px; margin-bottom: 8px; color: var(--ink); font-weight: 600; }
.cx-acct__who .mono { font-weight: 400; font-size: 0.8125rem; color: var(--ink-2); }
.cx-certrow { display: grid; gap: 8px; }
.cx-reqs { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 4px; font-size: 0.875rem; line-height: 1.3125rem; color: var(--ink-2); }
.cx-reqs li { display: flex; gap: 8px; align-items: baseline; }
.cx-reqs .mono { font-size: 0.75rem; color: var(--muted); }
.cx-reqs li.is-done { color: var(--ink); }
.cx-reqs li::before { content: ""; width: 10px; height: 10px; border: 1px solid var(--rule-2); border-radius: 2px; flex: none; transform: translateY(1px); }
.cx-reqs li.is-done::before { background: var(--accent); border-color: var(--accent); }
.cx-tablewrap { overflow-x: auto; }
.cx-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.375rem; border-top: 1px solid var(--rule-2); }
.cx-table th, .cx-table td { text-align: start; vertical-align: top; padding-block: 12px; padding-inline: 0 16px; border-bottom: 1px solid var(--rule); }
.cx-table thead th { font-size: 0.8125rem; font-weight: 500; color: var(--muted); border-bottom-color: var(--rule-2); }
.cx-table tbody th { color: var(--ink); font-weight: 500; }
.cx-table td { color: var(--ink-2); }
.cx-full td { font-family: var(--font-mono); font-size: 0.8125rem; white-space: nowrap; }
.cx-full tbody th a { color: var(--ink); }
.cx-full .mono { color: var(--muted); margin-inline-end: 8px; }
.cx-applies { display: block; font-weight: 400; font-size: 0.8125rem; color: var(--muted); }
.cx-go { display: block; margin-top: 4px; font-size: 0.875rem; }
.cx-gloss { margin: 0; border-top: 1px solid var(--rule-2); max-width: 960px; }
.cx-gloss > div { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.cx-gloss dt { color: var(--ink); font-weight: 600; }
.cx-gloss dd { margin: 0; color: var(--ink-2); }
.cx-gloss dd ul { margin: 0; padding-inline-start: 1.2em; }

/* ---- the certificate: a document, so it stays on white paper in either theme. Sized in container units, so the
   same drawing is a thumbnail on the course map, a page on screen and an A4 landscape sheet in print. */
.cert { --c-ink: #0B1A2B; --c-ink-2: #344054; --c-muted: #667085; --c-rule: #D0D5DD; --c-rule-2: #98A2B3; --c-on: #10243A; --c-off: #E4E7EC;
  container-type: inline-size; width: 100%; aspect-ratio: 297 / 210; background: #FFFFFF; color: var(--c-ink); border-radius: 3px;
  box-shadow: var(--shadow-frame); border: 1px solid var(--rule-2); position: relative; overflow: clip; font-family: var(--font-body); }
.cert ::selection { background: #DCE8F3; color: #0B1A2B; }
.cert__frame { position: absolute; inset: 3cqi; border: 1px solid var(--c-rule-2); padding: 2.8cqi 3.4cqi 1.6cqi; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; }
.cert__frame::before { content: ""; position: absolute; inset: .5cqi; border: 1px solid var(--c-rule); pointer-events: none; }
.cert__top { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 1.4cqi; border-bottom: 1px solid var(--c-rule); position: relative; }
.cert__issuer { font-weight: 600; font-size: 1.9cqi; letter-spacing: -0.01em; color: var(--c-on); }
.cert__issuer .wm-i::after { background: var(--dot); }
.cert__no { font-size: 1.3cqi; color: var(--c-ink-2); }
.cert__main { display: grid; grid-template-columns: minmax(0, 1fr) 27cqi; gap: 3.5cqi; align-items: center; position: relative; min-height: 0; }
.cert__kind { font-size: 1.6cqi; color: var(--c-ink-2); font-weight: 500; }
.cert__name { font-size: 6cqi; line-height: 1.02; font-weight: 650; letter-spacing: -0.038em; color: var(--c-ink); margin: 1.1cqi 0 1.5cqi; padding-bottom: 1.5cqi; border-bottom: 1px solid var(--c-rule); overflow-wrap: anywhere; text-wrap: balance; }
.cert__line { font-size: 1.6cqi; color: var(--c-ink-2); }
.cert__course { font-size: 2.7cqi; line-height: 1.16; font-weight: 600; letter-spacing: -0.02em; color: var(--c-ink); margin-top: .4cqi; max-width: 22em; }
.cert__stage { display: flex; gap: 1.1cqi; align-items: center; margin-top: 1.6cqi; font-size: 1.65cqi; font-weight: 600; color: var(--c-on); }
.cert__wheel { width: 100%; height: auto; display: block; }
.cert__wheel .w-ring { fill: none; stroke: var(--c-rule); stroke-width: .7; }
.cert__wheel line { stroke-width: 2.6; stroke-linecap: butt; }
.cert__wheel .w-on { stroke: var(--c-on); }
.cert__wheel .w-off { stroke: var(--c-off); }
.cert__wheel .w-major { stroke-width: 3; }
.cert__wheel .w-tick { font-family: var(--font-mono); font-size: 8.5px; fill: var(--c-muted); }
.cert__wheel .w-num { font-family: var(--font-mono); font-size: 30px; fill: var(--c-ink); font-weight: 500; }
.cert__wheel .w-lab { font-family: var(--font-body); font-size: 10px; fill: var(--c-muted); }
.cert__cells { display: grid; grid-template-columns: 1fr 1fr 1.25fr 2fr; margin: 1.6cqi 0 0; border-top: 1px solid var(--c-rule); position: relative; }
.cert__cells > div { padding-block: 1.1cqi 0; padding-inline: 0 1.2cqi; min-width: 0; }
.cert__cells > div + div { padding-inline-start: 1.3cqi; border-inline-start: 1px solid var(--c-rule); }
.cert__cells dt { font-size: 1.05cqi; color: var(--c-muted); }
.cert__cells dd { margin: .35cqi 0 0; font-size: 1.3cqi; line-height: 1.35; color: var(--c-ink); }
.cert__sub { display: block; margin-top: .2cqi; font-size: 1.05cqi; color: var(--c-muted); }
.cert__check { display: grid; grid-template-columns: minmax(0, 1fr) 6.4cqi; gap: 1.2cqi; align-items: start; }
.cert__check dt { grid-column: 1; }
.cert__check dd { grid-column: 1; overflow-wrap: anywhere; }
.cert__qr { grid-column: 2; grid-row: 1 / span 2; width: 6.4cqi; height: 6.4cqi; display: block; }
.cert__small { margin-top: 1.2cqi; font-size: .95cqi; line-height: 1.45; color: var(--c-muted); position: relative; }
.cert--specimen .cert__name { color: var(--c-muted); }
.cert__rec { position: absolute; inset: 3cqi; border: 1px solid var(--c-rule-2); padding: 2.6cqi 3.2cqi 1.8cqi; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.cert__rech { display: flex; justify-content: space-between; align-items: baseline; gap: 2cqi; border-bottom: 1px solid var(--c-rule); padding-bottom: 1.1cqi; }
.cert__rech h2 { font-size: 2.1cqi; color: var(--c-ink); letter-spacing: -0.01em; }
.cert__rech span { font-size: 1.2cqi; color: var(--c-ink-2); }
.cert__table { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(15, minmax(0, 1fr)); grid-auto-flow: column; column-gap: 0; padding: .8cqi 0 0; list-style: none; margin: 0; min-height: 0; }
.cert__table li { display: grid; grid-template-columns: 2.4cqi minmax(0, 1fr); column-gap: .6cqi; align-content: center; padding: 0 1.1cqi; border-bottom: 1px solid #F2F4F7; min-height: 0; overflow: hidden; }
.cert__table li:nth-child(-n+15) { padding-inline-start: 0; }
.cert__table li:nth-child(n+16) { border-inline-start: 1px solid var(--c-rule); }
.cert__table li:nth-child(n+31) { padding-inline-end: 0; }
.cert__rn { grid-row: 1 / span 2; font-size: .95cqi; line-height: 1.45; color: var(--c-muted); }
.cert__rt { font-size: .98cqi; line-height: 1.3; color: var(--c-ink); white-space: nowrap; overflow: clip; text-overflow: ellipsis; }
.cert__rm { font-size: .86cqi; line-height: 1.3; white-space: nowrap; overflow: clip; text-overflow: ellipsis; color: var(--c-ink-2); }
.cert__recfoot { font-size: .95cqi; line-height: 1.45; color: var(--c-muted); border-top: 1px solid var(--c-rule); padding-top: .9cqi; margin-top: .6cqi; }
.js .cert--live .cert__wheel line { transform-origin: 120px 120px; transform: scale(.9); transition: transform .5s var(--ease) calc(var(--i) * 14ms); }
.js .cert--live.is-drawn .cert__wheel line { transform: none; }

.cx-verify { padding: 14px 18px; border: 1px solid var(--rule-2); border-radius: var(--radius-card); margin-bottom: 24px; display: flex; gap: 12px; align-items: center; color: var(--ink); }
.cx-verify.is-ok::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; }
.cx-verify.is-bad { border-color: var(--status-bad); }
.cx-certstage { display: grid; gap: 28px; max-width: 1100px; }
.cx-certactions { margin-top: 24px; }
.cx-lookup { max-width: 420px; margin-top: 24px; }

/* ---- small screens */
/* The register is sized by its own width, not the screen's: it sits full width on module pages and in narrower
   columns elsewhere (Modern Web Guidance, size-aware-styling). 64.75em and 38em are where the rows run out of room. */
@container (max-width: 64.75em) {
  .cx-reg > li > a { grid-template-columns: 40px minmax(0, 1fr) 170px; }
  .cx-reg > li > a .cx-reg__m { display: none; }
  .cx-reg--lessons > li > a { grid-template-columns: 40px minmax(0, 1fr) 110px; }
}
@container (max-width: 38em) {
  .cx-reg > li > a, .cx-reg--lessons > li > a { grid-template-columns: 32px minmax(0, 1fr); row-gap: 4px; }
  .cx-reg__r { grid-column: 2; text-align: start; }
}
@media (max-width: 60em) {
  .cx-lesson { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 16px; }
  .cx-rail { position: static; max-height: none; overflow: visible; border: 1px solid var(--rule-2); border-radius: var(--radius-card); padding: 0 14px; }
  .cx-rail > summary { display: flex; justify-content: space-between; align-items: center; min-height: 48px; cursor: pointer; font-weight: 600; color: var(--ink); font-size: 0.9375rem; }
  .cx-rail > summary::after { content: ""; width: 8px; height: 8px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translateY(-3px); transition: transform .2s var(--ease); }
  .cx-rail[open] > summary::after { transform: rotate(-135deg); }
  .cx-rail__mod { padding-top: 4px; }
  .cx-rail__list li:last-child { border-bottom: 0; }
  .cx-paths, .cx-certs, .cx-recgrid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
}
@media (max-width: 40em) {
  .cx-text { font-size: 1.0625rem; line-height: 1.75rem; }
  .cx-outcomes li, .cx-gloss > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .cx-pager { grid-template-columns: minmax(0, 1fr); }
  .cx-pager__next { text-align: start; }
  .cx-quiz { padding: 18px; }
  .cx-stages { grid-template-columns: minmax(0, 1fr); }
  .cx-q__p { font-size: 1.125rem; line-height: 1.6875rem; }
  .cx-match__row { grid-template-columns: minmax(0, 1fr); }
  .cx-table thead { position: absolute; clip-path: inset(50%); overflow: hidden; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; white-space: nowrap; }
  .cx-table, .cx-table tbody, .cx-table tr, .cx-table th, .cx-table td { display: block; }
  .cx-table tr { padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .cx-table th, .cx-table td { padding: 0; border: 0; }
  .cx-table td { margin-top: 4px; white-space: normal; }
  .cx-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-family: var(--font-body); }
}
@media (prefers-reduced-motion: reduce) {
  .cx-reg__r.is-new, .cx-entry .mono, .cx-end__mark.is-done .cx-mark { animation: none; }
  .js .cert--live .cert__wheel line { transform: none; transition: none; }
  .cx-srcs > summary svg, .cx-path > summary svg, .cx-guide > summary svg, .cx-rail > summary::after { transition: none; }
}

/* ---- print: the exercise prints as answer plus marking; the certificate prints on A4 landscape */
@media print {
  .nav, .footer, .crumbs, .cx-rail, .cx-pager, .cx-notes, .skip, .tip, .cx-ex__actions, .cx-certactions, .cx-verify, .cx-certhelp, .cx-lookup, .cx-end { display: none !important; }
  body { background: #FFFFFF; color: #101828; }
  .cx-lesson { display: block; padding: 0; }
  .cx-guide { border: 0; }
  .cx-guide__body { display: block; border: 0; padding: 0; }
  .cx[data-course="certificate"] .section { padding: 0 !important; }
  .cx-certstage { display: block; max-width: none; }
  .cx-certstage .cert { page: cert; width: 277mm; height: 190mm; aspect-ratio: auto; box-shadow: none; border: 0; break-after: page; }
  .cx[data-course="exercise"] .cx-read { max-width: none; }
}
@page cert { size: A4 landscape; margin: 10mm; }

/* Identity transforms for chevrons that rotate when opened (individual-transform-properties) */
.cx-srcs > summary svg, .cx-path > summary svg, .cx-guide > summary svg { transform: rotate(0deg); }

/* Forced colours: status dots, progress ticks and the stage gauge keep a visible system colour */
@media (forced-colors: active) {
  .cx-text .box-watch .box-label::before, .cx-fb__v::before, .cx-reg__r.is-entry::before, .cx-verify.is-ok::before,
  .cx-reqs li.is-done::before, .cx-ticks i:is(.is-right, .is-wrong, .is-now) { background: CanvasText; }
  .cx-stage::before { border: 1px solid CanvasText; }
}
