/* On-Track training player. Portal screen rules: DM Sans only, ink and orange, light.
   One radius token. Rules over boxes. Every icon has a word. */
:root {
  --ink: #1f1a17;
  --orange: #f19036;
  --orange-deep: #d77820;
  --orange-text: #a9560f;
  --soft: #feebd3;
  --grey: #6b6760;
  --line: #e7e7e7;
  --line-mid: #d4d3d2;
  --line-strong: #8c877e;
  --canvas: #fafaf7;
  --wash: #f5f5f5;
  --paper: #ffffff;
  --r: 4px;
  --f: "DM Sans", sans-serif;
  --bar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --gut: 16px;
  --max: 1180px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: #ffffff; color: #1f1a17; color-scheme: light; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 var(--f);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--orange-text); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--orange-text); outline-offset: 2px; border-radius: var(--r); }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
main:focus { outline: none; }
.ico { width: 22px; height: 22px; flex: none; }

/* ---------- type ---------- */
.kicker { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--grey); margin: 0; }
.kicker b { color: var(--ink); font-weight: 700; }
.kicker .or { color: var(--orange-text); }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.015em; line-height: 1.12; text-wrap: balance; }
.d1 { font-size: 28px; letter-spacing: -0.02em; line-height: 1.08; }
.d2 { font-size: 24px; }
.d3 { font-size: 20px; }
.lede { font-size: 17px; color: var(--grey); margin: 0; max-width: 60ch; }
.small { font-size: 14px; color: var(--grey); }
.num { font-variant-numeric: tabular-nums; }
@media (min-width: 900px) {
  .d1 { font-size: 52px; }
  .d2 { font-size: 34px; }
  .d3 { font-size: 24px; }
  .lede { font-size: 19px; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 20px; border-radius: var(--r);
  border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink);
  font-weight: 600; font-size: 16px; text-decoration: none; line-height: 1.2;
}
.btn:hover { background: var(--wash); }
.btn-p { background: var(--orange); border-color: var(--orange); color: var(--ink); }
.btn-p:hover { background: var(--orange-deep); border-color: var(--orange-deep); }
.btn-k { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-k:hover { background: #3a3431; }
.btn-xl { min-height: 56px; font-size: 17px; padding: 0 24px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--wash); border-color: var(--line-mid); color: var(--grey); cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 4px 0; color: var(--orange-text); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; }
.linkbtn.quiet { color: var(--ink); font-weight: 500; }

/* ---------- app frame ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; background: var(--paper);
  border-bottom: 1px solid var(--line-mid);
}
.topbar-in { max-width: var(--max); margin: 0 auto; padding: 0 max(var(--gut), env(safe-area-inset-right, 0px)) 0 max(var(--gut), env(safe-area-inset-left, 0px)); height: 56px; display: flex; align-items: center; gap: 14px; }
.logo { display: block; width: 104px; height: 19px; overflow: hidden; flex: none; }
.logo img { width: 110px; max-width: none; height: auto; margin: -8.2px 0 0 -3.4px; }
.tb-sep { width: 1px; height: 22px; background: var(--line-mid); flex: none; }
.tb-client { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tb-sp { flex: 1; }
.tb-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; border: 0; background: none; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; border-radius: var(--r); white-space: nowrap; }
.tb-btn:hover { background: var(--wash); }
.tb-btn .ico { width: 20px; height: 20px; }
.tb-user { font-size: 14px; color: var(--grey); white-space: nowrap; }
@media (max-width: 599px) { .tb-user, .tb-sep.hide-s, .tb-client.hide-s { display: none; } }
.wrap { max-width: var(--max); margin: 0 auto; padding-left: max(var(--gut), env(safe-area-inset-left, 0px)); padding-right: max(var(--gut), env(safe-area-inset-right, 0px)); }
.page { padding-top: 28px; padding-bottom: 96px; }
@media (min-width: 900px) { .page { padding-top: 48px; padding-bottom: 120px; } }
.rule { border: 0; border-top: 1px solid var(--line-mid); margin: 0; }

/* ---------- status marks: orange scale, always with a word ---------- */
.st { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.st i { width: 14px; height: 14px; border: 1.5px solid var(--ink); border-radius: 2px; background: var(--paper); flex: none; }
.st-progress i, .st-partial i { background: linear-gradient(90deg, var(--orange) 50%, var(--paper) 50%); }
.st-done i { background: var(--orange); border-color: var(--orange); position: relative; }
.st-done i::after { content: ""; position: absolute; left: 3.5px; top: 0.5px; width: 4px; height: 8px; border: solid var(--ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.st-pend i { background: var(--soft); border-style: dashed; }

/* ---------- library ---------- */
.lib-head { display: grid; gap: 10px; padding-bottom: 28px; }
.lib-head .meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 15px; color: var(--grey); margin-top: 6px; }
.lib-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.lib-row { display: grid; grid-template-columns: 104px 1fr; gap: 14px 16px; padding: 20px 0; border-bottom: 1px solid var(--line-mid); align-items: start; }
.lib-thumb { width: 104px; aspect-ratio: 16 / 9; background: var(--wash); overflow: hidden; border-radius: var(--r); position: relative; }
.lib-thumb picture, .lib-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lib-thumb .ph-k { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; color: var(--grey); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.lib-main h2 { font-size: 20px; }
.lib-main h2 a { color: var(--ink); text-decoration: none; }
.lib-main h2 a:hover { text-decoration: underline; }
.lib-main .course { font-size: 14px; color: var(--grey); margin: 4px 0 10px; }
.lib-facts { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; color: var(--ink); align-items: center; }
.lib-act { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; }
.lib-act .btn { min-width: 0; flex: 1 1 100%; }
@media (min-width: 720px) {
  .lib-row { grid-template-columns: 200px 1fr auto; gap: 24px; align-items: center; padding: 24px 0; }
  .lib-thumb { width: 200px; }
  .lib-main h2 { font-size: 24px; }
  .lib-act { grid-column: auto; flex-direction: column; align-items: stretch; gap: 4px; min-width: 230px; }
  .lib-act .btn { flex: none; }
  .lib-act .linkbtn { justify-content: center; }
}
.mock-tools { margin-top: 56px; font-size: 14px; color: var(--grey); }
.mock-tools summary { color: var(--ink); font-size: 15px; }
.mock-tools .row { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; margin: 8px 0; }
.mock-tools .routes { columns: 2 220px; margin: 10px 0 0; padding-left: 18px; }
.mock-tools .routes li { margin: 2px 0; break-inside: avoid; }
.mock-tools code { font: 500 13px var(--f); background: var(--wash); padding: 1px 5px; border-radius: 2px; }

/* ---------- landing ---------- */
.land { display: grid; gap: 22px; }
.land-photo { position: relative; aspect-ratio: 16 / 9; background: var(--wash); overflow: hidden; }
.land-photo img { width: 100%; height: 100%; object-fit: cover; }
.land-text { display: grid; gap: 14px; align-content: start; }
.facts { border-top: 1px solid var(--line-mid); border-bottom: 1px solid var(--line-mid); margin: 6px 0 4px; padding: 12px 0; font-size: 15px; font-weight: 600; }
.facts span + span::before { content: "\00B7"; margin: 0 8px; color: var(--grey); font-weight: 700; }
.resume { border-left: 4px solid var(--orange); padding: 2px 0 2px 14px; display: grid; gap: 2px; }
.resume b { font-size: 17px; }
.land-act { display: grid; gap: 6px; }
.objectives { margin: 8px 0 0; padding: 0; list-style: none; counter-reset: ob; border-top: 2px solid var(--ink); }
.objectives li { counter-increment: ob; display: grid; grid-template-columns: 32px 1fr; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.objectives li::before { content: counter(ob, decimal-leading-zero); font-weight: 700; font-size: 13px; color: var(--orange-text); padding-top: 2px; font-variant-numeric: tabular-nums; }
@media (min-width: 900px) {
  .land { grid-template-columns: 7fr 5fr; gap: 48px; align-items: start; }
  .land-photo { margin: 0; border-radius: var(--r); }
  .land-text { padding-top: 6px; }
}

/* ---------- forms ---------- */
.form { display: grid; gap: 18px; max-width: 560px; }
.field { display: grid; gap: 6px; }
.field label, .field .lab { font-weight: 600; font-size: 15px; }
.field .hint { font-size: 14px; color: var(--grey); margin: -2px 0 0; }
.inp { height: 48px; padding: 0 14px; border: 1.5px solid var(--line-strong); border-radius: var(--r); background: var(--paper); width: 100%; font-size: 16px; }
textarea.inp { height: auto; min-height: 96px; padding: 12px 14px; line-height: 1.45; }
.inp:focus { border-color: var(--ink); }
.check { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; font-size: 15px; cursor: pointer; padding: 6px 0; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--orange-deep); }
.start-btns { display: grid; gap: 10px; }
.start-btns .btn { justify-content: flex-start; text-align: left; }
.start-btns .btn small { display: block; font-weight: 500; font-size: 13px; color: inherit; opacity: 0.8; }

/* ---------- player ---------- */
.player { padding-bottom: calc(var(--bar-h) + var(--safe-b) + 24px); }
.prog { display: flex; align-items: center; gap: 12px; padding: 12px 0 10px; }
.prog-label { font-size: 13px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.prog-left { font-size: 13px; color: var(--grey); white-space: nowrap; font-variant-numeric: tabular-nums; }
.segs { display: flex; gap: 3px; flex: 1; min-width: 0; }
.seg { flex: 3 1 0; height: 22px; padding: 8px 0; border: 0; background: none; position: relative; cursor: pointer; }
.seg.ix { flex: 1 1 0; }
.seg.qz { flex: 2 1 0; }
.seg::before { content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 6px; background: var(--line); border-radius: 1px; }
.seg span { position: absolute; left: 0; top: 8px; height: 6px; background: var(--orange); border-radius: 1px; width: 0; transition: width 0.25s linear; }
.seg.done span { width: 100%; }
.seg.cur::before { background: var(--soft); box-shadow: inset 0 0 0 1px var(--orange-deep); }
.seg[disabled] { cursor: default; }
.seg:focus-visible { outline-offset: 0; }

.stagewrap { display: grid; gap: 0; }
.stage {
  position: relative; overflow: hidden; background: var(--ink);
 
  height: min(125vw, 56svh);
}
@supports not (height: 1svh) { .stage { height: min(125vw, 56vh); } }
.stage.is-viz { background: var(--paper); }
.layer { position: absolute; inset: 0; opacity: 0; transition: opacity 0.7s ease; }
.layer.on { opacity: 1; }
.layer.instant { transition: none; }
.layer picture, .layer img { width: 100%; height: 100%; }
.layer img { object-fit: cover; transform-origin: 50% 50%; will-change: transform; }
.layer.viz { background: var(--paper); display: grid; place-items: center; }
.layer.viz svg { width: 100%; height: 100%; }
.kb img { animation-duration: var(--kb, 30s); animation-timing-function: linear; animation-fill-mode: both; animation-play-state: paused; }
.stage.playing .kb img, .pm-stage.playing .kb img { animation-play-state: running; }
.kb0 img { animation-name: kb0; } .kb1 img { animation-name: kb1; } .kb2 img { animation-name: kb2; }
.kb3 img { animation-name: kb3; } .kb4 img { animation-name: kb4; } .kb5 img { animation-name: kb5; }
@keyframes kb0 { from { transform: scale(1.0) translate(0, 0); } to { transform: scale(1.08) translate(-2.2%, -1.2%); } }
@keyframes kb1 { from { transform: scale(1.08) translate(2%, 0); } to { transform: scale(1.0) translate(0, 0); } }
@keyframes kb2 { from { transform: scale(1.0) translate(0, 1.5%); } to { transform: scale(1.08) translate(1.8%, -1%); } }
@keyframes kb3 { from { transform: scale(1.06) translate(-2%, 1%); } to { transform: scale(1.0) translate(1%, 0); } }
@keyframes kb4 { from { transform: scale(1.0) translate(1.5%, -1%); } to { transform: scale(1.08) translate(-1.5%, 1.5%); } }
@keyframes kb5 { from { transform: scale(1.08) translate(0, -2%); } to { transform: scale(1.01) translate(0, 1%); } }

/* placeholder stage: before media exists */
.ph { position: absolute; inset: 0; background: repeating-linear-gradient(135deg, #f5f5f5 0 14px, #efefed 14px 28px); display: grid; align-content: end; padding: 18px; color: var(--ink); }
.ph .ph-tag { justify-self: start; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 5px 8px; border-radius: 2px; }
.ph p { margin: 10px 0 0; font-size: 15px; max-width: 52ch; background: rgba(255, 255, 255, 0.86); padding: 8px 10px; border-left: 3px solid var(--orange); }
.ph.dark { background: var(--ink); color: #fff; }

.capband { background: var(--ink); color: #fff; min-height: 76px; padding: 12px 16px; display: flex; align-items: center; }
.capband p { margin: 0; font-size: 18px; line-height: 1.4; font-weight: 500; }
.capband p span { display: block; }
.capband.off { display: none; }
.timeline-row { display: flex; align-items: center; gap: 12px; padding: 10px 0 0; font-size: 13px; color: var(--grey); font-variant-numeric: tabular-nums; }
.tbar { flex: 1; height: 3px; background: var(--line); position: relative; }
.tbar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); width: 0; }
.status-msg { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; }
.status-msg.err { color: var(--ink); }
.status-msg .btn { min-height: 36px; padding: 0 12px; font-size: 14px; }

.rail { padding: 18px 0 0; display: grid; gap: 14px; align-content: start; }
.rail .scene-title { font-size: 22px; }
.phrases { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line-mid); }
.phrases li { padding: 12px 0 12px 16px; border-bottom: 1px solid var(--line); position: relative; font-size: 17px; line-height: 1.35; opacity: 0; transform: translateY(6px); transition: opacity 0.45s ease, transform 0.45s ease; }
.phrases li.on { opacity: 1; transform: none; }
.phrases li::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; background: var(--line-mid); }
.phrases li.now::before { background: var(--orange); }
.phrases li.head { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; border-top: 2px solid var(--ink); }
.legend li { display: grid; grid-template-columns: 28px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.25; opacity: 0.28; transition: opacity 0.4s; }
.legend li.on { opacity: 1; }
.legend li .n { width: 24px; height: 24px; display: grid; place-items: center; background: var(--orange); font-weight: 700; font-size: 13px; border-radius: 3px; }
.legend li small { display: block; color: var(--grey); font-size: 12.5px; }
.legend-wrap { padding-top: 16px; }
.legend-wrap h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8px; }
.transcript { margin-top: 18px; border-top: 1px solid var(--line-mid); }
.transcript h3 { font-size: 15px; padding: 14px 0 6px; }
.transcript p { margin: 0 0 12px; font-size: 16px; line-height: 1.6; max-width: 66ch; }
.transcript p span { transition: background 0.3s; border-radius: 2px; }
.transcript p span.now { background: var(--soft); box-shadow: 0 0 0 2px var(--soft); }

@media (min-width: 900px) {
  .stagewrap { grid-template-columns: 8fr 4fr; column-gap: 32px; }
  .stage { aspect-ratio: 16 / 9; height: auto; margin: 0; border-radius: var(--r) var(--r) 0 0; }
  .capband { margin: 0; grid-column: 1; border-radius: 0 0 var(--r) var(--r); min-height: 80px; padding: 14px 20px; }
  .capband.off { display: flex; background: var(--wash); color: var(--grey); }
  .capband.off p { font-size: 14px; }
  .timeline-row { grid-column: 1; }
  .rail { grid-column: 2; grid-row: 1 / span 3; padding-top: 0; }
  .rail .scene-title { font-size: 30px; }
  .phrases li { font-size: 18px; padding: 14px 0 14px 18px; }
  .phrases li.head { font-size: 23px; }
  .below { grid-column: 1; }
  .legend { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 899px) {
  .capband.off { display: none; }
  .stage { height: min(125vw, 52svh); }
  .timeline-row { padding: 0; gap: 0; flex-wrap: wrap; }
  .timeline-row #tNow, .timeline-row #tDur { display: none; }
  .timeline-row .tbar { flex: 1 1 100%; height: 3px; }
  .status-msg:not(:empty) { padding: 8px var(--gut); font-size: 14px; flex-wrap: wrap; }
  .rail { padding-top: 12px; gap: 8px; }
  .rail .kicker { display: none; }
  .rail .scene-title { font-size: 20px; }
  .phrases li { font-size: 16px; padding: 9px 0 9px 14px; }
  .phrases li.head { font-size: 18px; }
  .capband { min-height: 68px; padding: 10px var(--gut); }
  .capband p { font-size: 17px; }
}

/* ---------- control bar ---------- */
.cbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--paper); border-top: 1px solid var(--line-mid); padding-bottom: var(--safe-b); }
.cbar-in { max-width: var(--max); margin: 0 auto; height: var(--bar-h); display: flex; align-items: stretch; padding: 0 4px; gap: 2px; }
.cb { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; border-radius: var(--r); font-size: 11.5px; font-weight: 600; padding: 4px 2px; color: var(--ink); white-space: nowrap; }
.cb:hover { background: var(--wash); }
.cb .ico { width: 22px; height: 22px; }
.cb .spd { font-size: 16px; font-weight: 700; line-height: 22px; height: 22px; font-variant-numeric: tabular-nums; }
.cb[aria-pressed="true"] { background: var(--soft); }
.cb[disabled] { color: var(--line-strong); cursor: default; background: none; }
.cb-next { flex: 2 1 0; flex-direction: row; gap: 8px; margin: 8px 4px; border-radius: var(--r); background: var(--orange); font-size: 16px; font-weight: 700; }
.cb-next:hover { background: var(--orange-deep); }
.cb-next .why { display: none; }
.cb-next[aria-disabled="true"] { background: var(--wash); color: var(--grey); flex-direction: column; gap: 0; font-size: 15px; box-shadow: inset 0 0 0 1px var(--line-mid); cursor: not-allowed; }
.cb-next[aria-disabled="true"] .why { display: block; max-width: 100%; overflow: hidden; white-space: normal; text-align: center; line-height: 1.15; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cb-next[aria-disabled="true"] .ico { display: none; }
@media (max-width: 480px) { .cb-next[aria-disabled="true"] { margin: 4px 2px; line-height: 1.1; } .cb-next[aria-disabled="true"] .why { font-size: 10.5px; } }
.cb-next.pulse { animation: pulse 0.9s ease-out 1; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(241, 144, 54, 0.7); } 100% { box-shadow: 0 0 0 14px rgba(241, 144, 54, 0); } }
.cb-back { flex: 1.2 1 0; }
.cb-morewrap { flex: 1 1 0; min-width: 0; display: flex; position: relative; }
.cb-morewrap > .cb { width: 100%; }
.more-menu { position: absolute; right: 0; bottom: calc(100% + 10px); background: var(--paper); border: 1.5px solid var(--ink); border-radius: var(--r); padding: 4px; box-shadow: 0 8px 24px rgba(31, 26, 23, 0.16); z-index: 5; }
.more-menu button { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border: 0; background: none; font-weight: 600; font-size: 15px; white-space: nowrap; border-radius: var(--r); }
.more-menu button:hover { background: var(--wash); }
@media (max-width: 479px) { .cb-tr { display: none; } .cb-next { flex: 1.6 1 0; } }
@media (min-width: 480px) { .cb-morewrap { display: none; } }
.cb-msg { flex: 3 1 0; display: flex; align-items: center; padding: 0 10px; font-size: 14px; color: var(--grey); line-height: 1.3; }
.gate-reason { font-size: 14px; color: var(--grey); margin: 12px 0 0; }
@media (max-width: 379px) {
  .prog-left { display: none; }
  .topbar-in { gap: 4px; padding: 0 10px; }
  .tb-btn { padding: 0 6px; gap: 4px; font-size: 13.5px; }
  .logo { width: 88px; height: 16px; }
  .logo img { width: 93px; margin: -7px 0 0 -2.9px; }
}
@media (max-width: 359px) { .cb { font-size: 10.5px; } .cb-next { flex: 1.6 1 0; font-size: 15px; } }
@media (min-width: 900px) {
  .cb { flex-direction: row; gap: 8px; font-size: 15px; flex: 0 0 auto; padding: 0 16px; }
  .cbar-in { padding: 0 var(--gut); gap: 4px; }
  .cb-sp { flex: 1; }
  .cb-next { flex: 0 0 auto; min-width: 220px; padding: 0 24px; font-size: 17px; }
  .cb-next[aria-disabled="true"] { min-width: 220px; }
  .cb-back { flex: 0 0 auto; }
  .cb-msg { flex: 1; font-size: 15px; }
}

/* contents drawer */
.drawer { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end; background: rgba(31, 26, 23, 0.36); }
.drawer-in { width: min(420px, 100%); height: 100%; background: var(--paper); overflow: auto; padding: 18px var(--gut) 40px; box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12); }
.drawer-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.toc { list-style: none; padding: 0; margin: 0; border-top: 2px solid var(--ink); }
.toc li { border-bottom: 1px solid var(--line); }
.toc a, .toc span.lk { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 12px 0; text-decoration: none; color: var(--ink); min-height: 52px; }
.toc span.lk { color: var(--grey); }
.toc .tn { font-weight: 700; font-size: 13px; color: var(--grey); font-variant-numeric: tabular-nums; }
.toc .tt { font-weight: 600; font-size: 15px; line-height: 1.3; }
.toc .tt small { display: block; font-weight: 500; color: var(--grey); font-size: 12.5px; }
.toc .tw { font-size: 13px; font-weight: 600; }
.toc li.now a { background: var(--soft); padding-left: var(--gut); padding-right: var(--gut); }

/* ---------- diagrams (inline SVG) ---------- */
.viz { font-family: var(--f); }
.viz .ln, .viz .ln-k { fill: none; stroke: var(--ink); stroke-width: 2px; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.viz .ln-thin { fill: none; stroke: var(--ink); stroke-width: 1.25px; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.viz .ln-ground { stroke: var(--line-strong); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.viz .f-w { fill: #fff; }
.viz .f-g { fill: #f2f1ee; }
.viz .f-ink, .viz .f-k { fill: var(--ink); stroke: none; }
.viz .f-or { fill: var(--orange); }
.viz .f-soft { fill: var(--soft); }
.viz .ln-k.f-or, .viz .ln.f-or { fill: var(--orange); }
.viz .ln-k.f-w { fill: #fff; } .viz .ln-k.f-g, .viz .ln.f-g { fill: #f2f1ee; }
.viz .mk-bg { fill: var(--orange); stroke: var(--ink); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.viz .mk-t { fill: var(--ink); font-weight: 700; }
.viz .lk-sh { fill: none; stroke: var(--ink); }
.viz .pill-bg { fill: #fff; stroke: var(--ink); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.viz .pill-t { fill: var(--ink); font-weight: 700; }
.viz .pill-s { fill: var(--grey); font-weight: 500; }
.viz .leader { stroke: var(--ink); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.viz .drive { fill: none; stroke: var(--orange-deep); stroke-width: 3px; stroke-dasharray: 1; vector-effect: non-scaling-stroke; }
.viz .arrow-or { fill: none; stroke: var(--orange-deep); stroke-width: 4px; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.viz .t-rev { fill: #fff; font-weight: 700; }
.viz .lbl { fill: var(--ink); font-weight: 500; }
.viz .lbl-b { fill: var(--ink); font-weight: 700; }
.viz .lbl-k { fill: var(--ink); font-weight: 600; }
.viz .dim { fill: none; stroke: var(--ink); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.viz .hair { fill: #e2ded8; }
.viz .ring-dot { fill: none; stroke: var(--ink); stroke-width: 1.5px; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.viz .lens { fill: #fff; }
.viz .lens-ring { fill: none; stroke: var(--ink); stroke-width: 2.5px; vector-effect: non-scaling-stroke; }
.viz .airway { fill: none; stroke: var(--ink); stroke-width: 7px; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85; }
.viz .airway.thin { stroke-width: 4px; }
.viz .sac-scar { fill: #e2ded8; stroke: var(--ink); vector-effect: none; }
.viz .tl-base { stroke: var(--line-mid); stroke-width: 6px; vector-effect: non-scaling-stroke; }
.viz .tl-fill { stroke: var(--orange); stroke-width: 6px; vector-effect: non-scaling-stroke; stroke-dasharray: 1; }
.viz .gauge-needle { stroke-width: 2px; }
.viz .rule-l { stroke: var(--line-mid); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.viz .hang.on .float { animation: drift 4s ease-in-out infinite alternate; }
.viz .hang.on .f1 { animation-duration: 5s; } .viz .hang.on .f2 { animation-duration: 3.4s; }
@keyframes drift { from { transform: translate(0, 0); } to { transform: translate(14px, -18px); } }

/* reveal states, driven by the narration clock */
.viz [data-rv] { opacity: 0; transition: opacity 0.5s ease, transform 0.6s cubic-bezier(.2, .7, .2, 1); }
.viz [data-rv].on { opacity: 1; }
.viz [data-rv].rv-pop { transform-box: fill-box; transform-origin: center; transform: scale(0.6); }
.viz [data-rv].rv-pop.on { transform: none; }
.viz [data-rv].rv-rise { transform: translateY(18px); }
.viz [data-rv].rv-rise.on { transform: none; }
.viz [data-rv].rv-slide { transform: translateX(-1100px); transition: opacity 0.2s, transform 1.6s cubic-bezier(.2, .7, .2, 1); }
.viz [data-rv].rv-slide.on { transform: none; }
.viz [data-rv] .draw, .viz .draw[data-rv] { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.4s ease; }
.viz [data-rv].on .draw, .viz .draw[data-rv].on { stroke-dashoffset: 0; }
.viz [data-rv] .draw-fill { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.2s ease; }
.viz [data-rv].on .draw-fill { stroke-dashoffset: 0; }
.viz .static [data-rv], .viz.static [data-rv] { opacity: 1; transform: none; }
.viz .marker.now .mk-bg { stroke-width: 3px; }

/* ---------- interactions ---------- */
.ix { max-width: 760px; display: grid; gap: 16px; padding-top: 8px; }
.ix-k { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.ix-situ { font-size: 20px; line-height: 1.4; font-weight: 600; letter-spacing: -0.005em; margin: 0; max-width: 62ch; }
.ix-q { font-size: 17px; font-weight: 700; margin: 0; }
.ix-how { font-size: 14px; color: var(--grey); margin: -6px 0 0; }
@media (min-width: 900px) { .ix-situ { font-size: 24px; } }
.choices { display: grid; gap: 8px; }
.choice { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; text-align: left; min-height: 56px; padding: 14px 16px; border: 1.5px solid var(--line-strong); border-radius: var(--r); background: var(--paper); font-size: 16px; line-height: 1.4; width: 100%; }
.choice:hover { border-color: var(--ink); background: var(--canvas); }
.choice .lt { width: 26px; height: 26px; display: grid; place-items: center; border: 1.5px solid var(--ink); border-radius: 3px; font-weight: 700; font-size: 13px; text-transform: uppercase; }
.choice.picked-right { border-color: var(--ink); border-width: 2px; background: var(--soft); }
.choice.picked-right .lt { background: var(--orange); border-color: var(--orange); }
.choice.picked-wrong { border-color: var(--ink); border-style: dashed; background: var(--wash); color: var(--grey); }
.choice[aria-disabled="true"] { cursor: default; }
.fb { border-left: 4px solid var(--ink); padding: 10px 0 10px 14px; font-size: 16px; line-height: 1.5; }
.fb b { display: block; font-size: 15px; margin-bottom: 2px; }
.fb.ok { border-color: var(--orange); }
.fb.no { border-color: var(--line-strong); border-left-style: dashed; }
.fb.done { border-color: var(--orange); background: var(--soft); padding-right: 14px; }
.timer { height: 8px; background: var(--line); border-radius: 2px; overflow: hidden; position: relative; }
.timer i { position: absolute; inset: 0; background: var(--orange); transform-origin: left; }
.timer-row { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.timer-row .timer { flex: 1; }

/* classify */
.cl-card { border: 2px solid var(--ink); border-radius: var(--r); padding: 16px; display: grid; gap: 12px; background: var(--paper); }
.cl-card .cl-n { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--grey); }
.cl-card .cl-text { font-size: 19px; font-weight: 600; line-height: 1.35; }
.buckets { display: grid; gap: 8px; }
.bucket-btn { min-height: 52px; border: 1.5px solid var(--ink); border-radius: var(--r); background: var(--paper); font-weight: 700; font-size: 16px; padding: 10px 14px; text-align: left; display: flex; align-items: center; gap: 10px; }
.bucket-btn:hover { background: var(--soft); }
@media (min-width: 720px) { .buckets { grid-auto-flow: column; grid-auto-columns: 1fr; } }
.sorted { display: grid; gap: 14px; }
@media (min-width: 720px) { .sorted { grid-template-columns: repeat(var(--cols, 2), 1fr); } }
.sorted h4 { margin: 0 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; border-bottom: 2px solid var(--ink); padding-bottom: 6px; }
.sorted ul { list-style: none; margin: 0; padding: 0; }
.sorted li { font-size: 14.5px; padding: 7px 0; border-bottom: 1px solid var(--line); display: flex; gap: 8px; }
.sorted li::before { content: ""; width: 10px; height: 10px; background: var(--orange); margin-top: 6px; flex: none; border-radius: 1px; }

/* order */
.ord-cols { display: grid; gap: 18px; }
@media (min-width: 900px) { .ord-cols { grid-template-columns: 1fr 1fr; gap: 28px; } }
.ord h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; }
.ord-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; min-height: 56px; }
.ord-pool .ord-item { cursor: pointer; }
.ord-item { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; min-height: 56px; padding: 8px 10px 8px 12px; border: 1.5px solid var(--line-strong); border-radius: var(--r); background: var(--paper); font-size: 15.5px; line-height: 1.35; text-align: left; width: 100%; }
.ord-item:hover { border-color: var(--ink); }
.ord-item .on { width: 28px; height: 28px; display: grid; place-items: center; font-weight: 700; font-size: 14px; border: 1.5px dashed var(--line-strong); border-radius: 3px; color: var(--grey); }
.ord-placed .ord-item .on { border: 0; background: var(--ink); color: #fff; }
.ord-placed .ord-item.inplace .on { background: var(--orange); color: var(--ink); }
.ord-item .tools { display: flex; gap: 2px; }
.ord-item .tools button { min-width: 44px; min-height: 40px; border: 1px solid var(--line-mid); background: var(--paper); border-radius: 3px; font-size: 12.5px; font-weight: 600; padding: 0 6px; }
.ord-item .tools button:hover { border-color: var(--ink); }
.ord-item .why { grid-column: 2 / -1; font-size: 13.5px; color: var(--grey); }
.ord-empty { border: 1.5px dashed var(--line-mid); border-radius: var(--r); padding: 16px; color: var(--grey); font-size: 14px; }
.ord-tag { font-size: 12px; font-weight: 700; color: var(--orange-text); text-transform: uppercase; letter-spacing: 0.06em; }

/* hotspot */
.hs { position: relative; width: 100%; background: var(--paper); border: 1px solid var(--line-mid); border-radius: var(--r); overflow: hidden; touch-action: manipulation; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.hs img, .hs svg { width: 100%; height: 100%; display: block; pointer-events: none; }
.hs:focus-visible { outline-offset: 3px; }
.hs-mark { position: absolute; transform: translate(-50%, -50%); pointer-events: none; }
.hs-mark.found { width: 34px; height: 34px; background: var(--orange); border: 2px solid var(--ink); border-radius: 4px; display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.hs-mark.miss { width: 30px; height: 30px; border: 2px dashed var(--ink); border-radius: 50%; animation: fadeout 1.4s forwards; }
.hs-mark.cross { width: 30px; height: 30px; }
.hs-mark.cross::before, .hs-mark.cross::after { content: ""; position: absolute; background: var(--ink); }
.hs-mark.cross::before { left: 14px; top: 0; width: 2px; height: 30px; }
.hs-mark.cross::after { top: 14px; left: 0; height: 2px; width: 30px; }
@keyframes fadeout { 0% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
.hs-count { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.hs-count .meter { flex: 1; max-width: 240px; height: 8px; background: var(--line); border-radius: 2px; overflow: hidden; }
.hs-count .meter i { display: block; height: 100%; background: var(--orange); transition: width 0.3s; }
.found-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-mid); counter-reset: f; }
.found-list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 30px 1fr; gap: 10px; font-size: 15px; }
.found-list li .n { width: 26px; height: 26px; background: var(--orange); border-radius: 3px; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.found-list li b { display: block; }
.found-list li small { color: var(--grey); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.06em; }
.hs-list { display: grid; gap: 8px; }

/* reveal */
.rv-tabs { display: grid; gap: 8px; }
.rv-tab { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 52px; padding: 10px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--r); background: var(--paper); font-weight: 700; text-align: left; }
.rv-tab[aria-expanded="true"] { border-color: var(--ink); background: var(--soft); }
.rv-body { padding: 6px 2px 10px 16px; border-left: 3px solid var(--orange); }

/* ---------- quiz ---------- */
.qz { max-width: 760px; display: grid; gap: 18px; }
.qdots { display: flex; flex-wrap: wrap; gap: 6px; }
.qdot { width: 36px; height: 36px; border: 1.5px solid var(--line-strong); background: var(--paper); border-radius: 3px; font-size: 13px; font-weight: 700; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.qdot.ans { background: var(--orange); border-color: var(--orange); }
.qdot.cur { outline: 2px solid var(--ink); outline-offset: 1px; }
.qstem { font-size: 21px; line-height: 1.4; font-weight: 600; margin: 0; }
@media (min-width: 900px) { .qstem { font-size: 25px; } }
.opts { display: grid; gap: 8px; }
.opt { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: center; min-height: 56px; padding: 12px 16px; border: 1.5px solid var(--line-strong); border-radius: var(--r); background: var(--paper); text-align: left; width: 100%; font-size: 16.5px; line-height: 1.4; }
.opt:hover { border-color: var(--ink); }
.opt .box { width: 24px; height: 24px; border: 1.5px solid var(--ink); border-radius: 50%; display: grid; place-items: center; }
.opt[aria-checked="true"] { border-color: var(--ink); border-width: 2px; background: var(--soft); }
.opt[aria-checked="true"] .box { background: var(--ink); box-shadow: inset 0 0 0 5px var(--soft); }
.qnav { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.modal { position: fixed; inset: 0; z-index: 90; background: rgba(31, 26, 23, 0.5); display: grid; place-items: center; padding: 16px; }
.modal .dlg { background: #ffffff; color: var(--ink); border-radius: var(--r); max-width: 480px; width: 100%; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25); }
dialog { border: 0; border-radius: var(--r); padding: 0; max-width: min(480px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25); color: var(--ink); }
dialog::backdrop { background: rgba(31, 26, 23, 0.5); }
.dlg { padding: 24px; display: grid; gap: 14px; border-top: 6px solid var(--orange); }
.dlg .row { display: flex; gap: 10px; flex-wrap: wrap; }
.dlg .row .btn { flex: 1 1 140px; }

/* ---------- result ---------- */
.res { max-width: 820px; display: grid; gap: 22px; }
.res-big { font-size: 40px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.05; }
@media (min-width: 900px) { .res-big { font-size: 64px; } }
.res-cells { display: flex; gap: 4px; flex-wrap: wrap; }
.res-cells span { width: 30px; height: 30px; display: grid; place-items: center; font-size: 12px; font-weight: 700; border: 1.5px solid var(--ink); border-radius: 3px; font-variant-numeric: tabular-nums; }
.res-cells span.ok { background: var(--orange); border-color: var(--orange); }
.res-cells span.miss { background: var(--paper); border-style: dashed; color: var(--grey); }
.res-legend { font-size: 13.5px; color: var(--grey); display: flex; gap: 16px; flex-wrap: wrap; }
.res-legend span { display: inline-flex; align-items: center; gap: 6px; }
.res-legend i { width: 14px; height: 14px; border: 1.5px solid var(--ink); border-radius: 2px; display: inline-block; }
.res-legend i.ok { background: var(--orange); border-color: var(--orange); }
.res-legend i.miss { border-style: dashed; }
.another { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.another li { padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.another .q { font-weight: 600; font-size: 16px; }
.another .why { font-size: 15px; color: var(--grey); }
.res-act { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- certificate ---------- */
.cert-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 20px; }
.cert-tools .btn { flex: 1 1 160px; padding: 0 14px; white-space: nowrap; }
@media (min-width: 900px) { .cert-tools .btn { flex: 0 0 auto; } }
.cert-note { border-left: 4px solid var(--orange); padding: 4px 0 4px 14px; margin: 0 0 18px; }
.cert-stage { width: 100%; overflow: hidden; }
.cert-scale { transform-origin: 0 0; width: 816px; }
/* The certificate: one Letter page (816 x 1056 px at 96 dpi). A quiet double rule frames it,
   with the orange tab from the logo's square as the only accent. No ribbons, no seals. */
.cert {
  width: 816px; height: 1056px; background: #fff; color: var(--ink); position: relative; font-family: var(--f);
  box-shadow: 0 1px 0 var(--line-mid), 0 10px 40px rgba(31, 26, 23, 0.12);
}
.cf { position: absolute; inset: 30px; border: 1.5px solid var(--ink); display: flex; flex-direction: column; padding: 38px 48px 30px; }
.cf::before { content: ""; position: absolute; inset: 5px; border: 1px solid var(--line-mid); pointer-events: none; }
.cf-tab { position: absolute; top: -1.5px; left: 48px; width: 72px; height: 8px; background: var(--orange); }
.c-head { display: flex; justify-content: space-between; align-items: flex-start; }
.c-head .logo { width: 178px; height: 33px; }
.c-head .logo img { width: 189px; margin: -14.2px 0 0 -5.8px; }
.c-id { text-align: right; font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--grey); line-height: 1.6; }
.c-id b { display: block; color: var(--ink); font-size: 15px; letter-spacing: 0.06em; font-variant-numeric: tabular-nums; }
.c-main { margin-top: 52px; }
.c-kind { margin: 0; font-size: 12.5px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--orange-text); }
.c-lead { margin: 22px 0 6px; font-size: 15px; color: var(--grey); }
.c-name { margin: 0; font-size: 58px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.0; }
.c-name.long { font-size: 46px; }
.c-co { margin: 10px 0 0; font-size: 18px; font-weight: 500; }
.c-rule { width: 64px; height: 4px; background: var(--orange); margin: 26px 0 0; }
.c-course { margin: 0; font-size: 29px; font-weight: 700; line-height: 1.16; letter-spacing: -0.015em; max-width: 640px; }
.c-topic { margin: 12px 0 0; font-size: 15px; color: var(--grey); }
.c-topic b { color: var(--ink); font-weight: 600; }
.c-parts { margin-top: 28px; border: 1.5px solid var(--ink); border-radius: 3px; }
.c-part { display: grid; grid-template-columns: 26px 1fr; gap: 14px; padding: 12px 16px; font-size: 13.5px; color: var(--grey); align-items: start; }
.c-part + .c-part { border-top: 1px solid var(--line-mid); }
.c-part b { display: block; color: var(--ink); font-size: 15.5px; margin-bottom: 1px; }
.c-part i { width: 22px; height: 22px; border-radius: 3px; border: 1.5px solid var(--ink); position: relative; margin-top: 1px; }
.c-part.ok i { background: var(--orange); border-color: var(--orange); }
.c-part.ok i::after { content: ""; position: absolute; left: 6.5px; top: 2px; width: 5px; height: 11px; border: solid var(--ink); border-width: 0 2.2px 2.2px 0; transform: rotate(45deg); }
.c-part.pend i { background: var(--soft); border-style: dashed; }
.c-status { padding: 9px 16px; font-size: 13.5px; font-weight: 700; background: var(--soft); border-top: 1.5px dashed var(--ink); }
.c-facts { margin: 26px 0 0; display: grid; grid-template-columns: 1.15fr 1fr 1fr; border-top: 1px solid var(--line-mid); }
.c-facts div { padding: 10px 14px 10px 0; border-bottom: 1px solid var(--line-mid); }
.c-facts dt { font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--grey); }
.c-facts dd { margin: 3px 0 0; font-size: 14.5px; font-weight: 600; }
.c-foot { margin-top: auto; display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: end; }
.c-sig { max-width: 360px; }
.c-sig small { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--grey); margin-bottom: 10px; }
.c-sig b { display: block; font-size: 16px; font-weight: 600; padding-top: 10px; border-top: 1.5px solid var(--ink); line-height: 1.35; }
.c-sig span { display: block; margin-top: 10px; font-size: 12px; color: var(--grey); }
.c-qr { display: grid; grid-template-columns: auto 108px; gap: 14px; align-items: end; text-align: right; font-size: 11px; color: var(--grey); line-height: 1.45; }
.c-qr svg { width: 108px; height: 108px; }
.c-qr b { display: block; color: var(--ink); font-size: 12.5px; }
.c-qr .url { display: block; max-width: 220px; word-break: break-all; color: var(--ink); font-weight: 600; margin-top: 3px; }
.cert-table { width: 100%; border-collapse: collapse; font-size: 14px; border-top: 2px solid var(--ink); }
.cert-table th { text-align: left; font-weight: 600; color: var(--grey); width: 188px; padding: 7px 12px 7px 0; vertical-align: top; }
.cert-table td { padding: 7px 0; font-weight: 600; vertical-align: top; }
.cert-table tr { border-bottom: 1px solid var(--line-mid); }

/* ---------- practical ---------- */
.pr { max-width: 760px; display: grid; gap: 18px; }
.pr-who { display: grid; gap: 4px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line-mid); padding: 12px 0; font-size: 15px; }
.pr-who b { font-size: 18px; }
.pr-steps { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.pr-step { padding: 14px 0; border-bottom: 1px solid var(--line-mid); display: grid; grid-template-columns: 34px 1fr; gap: 6px 12px; }
.pr-step .n { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.pr-step .obs { font-size: 15.5px; line-height: 1.45; }
.pr-step .crit { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.pr-step .crit i { width: 10px; height: 10px; background: var(--ink); transform: rotate(45deg); display: inline-block; }
.seg-ctl { grid-column: 2; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.seg-ctl button { min-height: 44px; padding: 0 14px; border: 1.5px solid var(--line-strong); background: var(--paper); border-radius: var(--r); font-weight: 600; font-size: 14.5px; display: inline-flex; align-items: center; gap: 6px; }
.seg-ctl button[aria-pressed="true"].v-done { background: var(--orange); border-color: var(--orange); }
.seg-ctl button[aria-pressed="true"].v-coach { background: var(--soft); border-color: var(--ink); }
.seg-ctl button[aria-pressed="true"].v-miss { background: var(--ink); color: #fff; border-color: var(--ink); }
.pr-sum { position: sticky; bottom: 0; background: var(--paper); border-top: 2px solid var(--ink); padding: 12px var(--gut) calc(12px + var(--safe-b)); display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; z-index: 5; }
.pr-sum .res-w { font-weight: 700; font-size: 17px; }
.pr-sum .res-w small { display: block; font-weight: 500; font-size: 13.5px; color: var(--grey); }
.details { border-top: 1px solid var(--line-mid); border-bottom: 1px solid var(--line-mid); }
.details summary { min-height: 48px; display: flex; align-items: center; font-weight: 700; cursor: pointer; list-style: none; gap: 8px; }
.details summary::-webkit-details-marker { display: none; }
.details summary::after { content: "Show"; margin-left: auto; font-size: 14px; color: var(--orange-text); text-decoration: underline; font-weight: 600; }
.details[open] summary::after { content: "Hide"; }
.details > div { padding: 0 0 14px; font-size: 15px; }

/* ---------- presenter ---------- */
body.present-mode { background: var(--ink); }
body.present-mode .topbar { display: none; }
.pm { position: fixed; inset: 0; background: var(--ink); color: #fff; display: grid; grid-template-rows: 1fr auto; overflow: hidden; }
.pm-main { display: grid; grid-template-columns: 68fr 32fr; min-height: 0; }
.pm-stage { position: relative; overflow: hidden; background: #000; }
.pm-stage .layer.viz { background: #fff; }
.pm-rail { padding: 4vh 3vw; display: grid; align-content: center; gap: 2.2vh; background: var(--paper); color: var(--ink); overflow: hidden; }
.pm-rail .kicker { font-size: 15px; }
.pm-rail h2 { font-size: clamp(28px, 2.6vw, 46px); }
.pm-rail .phrases li { font-size: clamp(24px, 1.9vw, 36px); line-height: 1.25; padding: 1.4vh 0 1.4vh 22px; }
.pm-rail .phrases li.head { font-size: clamp(28px, 2.2vw, 40px); }
.pm-cap { background: var(--ink); color: #fff; min-height: 13vh; display: flex; align-items: center; justify-content: center; padding: 1.5vh 4vw; text-align: center; }
.pm-cap p { margin: 0; font-size: 28px; line-height: 1.35; font-weight: 500; }
.pm-cap p span { display: block; }
@media (min-width: 1600px) { .pm-cap p { font-size: 34px; } }
.pm-cap.off p { visibility: hidden; }
.pm-ctl { position: fixed; left: 50%; top: 2vh; transform: translateX(-50%); display: flex; gap: 6px; background: rgba(31, 26, 23, 0.92); padding: 8px; border-radius: var(--r); transition: opacity 0.35s; z-index: 20; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4); }
.pm-ctl.hide { opacity: 0; pointer-events: none; }
.pm-ctl button, .pm-ctl a { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px; background: none; border: 1px solid rgba(255, 255, 255, 0.28); color: #fff; border-radius: var(--r); font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; }
.pm-ctl button:hover, .pm-ctl a:hover { background: rgba(255, 255, 255, 0.1); }
.pm-ctl button[aria-pressed="true"] { background: var(--orange); color: var(--ink); border-color: var(--orange); }
.pm-ctl .pm-count { white-space: nowrap; color: #fff; align-self: center; padding: 0 10px; font-size: 14px; font-variant-numeric: tabular-nums; }
.pm-ctl kbd { font: 600 11px var(--f); border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 2px; padding: 1px 5px; opacity: 0.8; }
.pm-slide { background: var(--paper); color: var(--ink); padding: 6vh 7vw; display: grid; align-content: center; gap: 3vh; overflow: auto; }
.pm-slide .kicker { font-size: 16px; color: var(--orange-text); }
.pm-slide h2 { font-size: clamp(34px, 3.4vw, 64px); max-width: 26ch; line-height: 1.12; }
.pm-slide .pm-q { font-size: clamp(26px, 2.2vw, 40px); font-weight: 600; max-width: 40ch; line-height: 1.3; }
.pm-slide .pm-ans { font-size: clamp(22px, 1.7vw, 32px); line-height: 1.4; border-left: 6px solid var(--orange); padding-left: 24px; max-width: 56ch; }
.pm-slide .pm-ans ol, .pm-slide .pm-ans ul { margin: 0; padding-left: 1.2em; }
.pm-slide .pm-ans li { margin: 0.25em 0; }
.pm-slide .btn { font-size: 20px; min-height: 64px; padding: 0 28px; justify-self: start; }
.pm-tq { display: grid; gap: 2.4vh; }
.pm-tq > div { border-top: 2px solid var(--ink); padding-top: 2vh; display: grid; gap: 1.4vh; }
.pm-tq .pm-q { font-size: clamp(22px, 1.8vw, 32px); }
.pm-sign { display: grid; grid-template-columns: 1fr auto; gap: 5vw; align-items: center; }
.pm-sign svg { width: min(38vh, 420px); height: min(38vh, 420px); }
.pm-sign .link { font-size: 22px; word-break: break-all; }
.pm-setup { max-width: 640px; }
.pm-hs, .pm-art .pm-hs { position: relative; width: min(100%, 64vh * 1.67); }
.pm-art .pm-hs { width: min(70%, 52vh * 1.67); }
.pm-hs svg { width: 100%; height: auto; }
.pm-hs-wrap { display: grid; grid-template-columns: 3fr 2fr; gap: 3vw; align-items: center; }
.pm-hs-wrap ol { font-size: clamp(18px, 1.3vw, 24px); }
@media (max-width: 899px) {
  .pm-main { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .pm-rail { padding: 16px; }
  .pm-cap p { font-size: 20px; }
  .pm-sign { grid-template-columns: 1fr; }
}

/* ---------- verify ---------- */
.vf { max-width: 760px; display: grid; gap: 18px; }
.vf-banner { border: 2px dashed var(--ink); padding: 14px 16px; background: var(--soft); font-size: 15px; border-radius: var(--r); }

.toast { position: fixed; left: 50%; bottom: calc(var(--bar-h) + var(--safe-b) + 14px); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r); font-weight: 600; font-size: 15px; z-index: 80; max-width: calc(100vw - 32px); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .kb img { animation: none !important; transform: none !important; }
  .layer { transition: none !important; }
  .cb-next.pulse { animation: none !important; }
  .viz [data-rv] { transform: none !important; }
}

/* ---------- print: the certificate only, one Letter page ---------- */
@page { size: letter portrait; margin: 0; }
@media print {
  html, body { background: #fff !important; }
  body * { visibility: hidden; }
  .cert, .cert * { visibility: visible; }
  .topbar, .cbar, .cert-tools, .toast { display: none !important; }
  .page { padding: 0 !important; }
  .cert-stage { overflow: visible !important; height: auto !important; }
  .cert-scale { transform: none !important; height: auto !important; }
  .cert { position: fixed; left: 0; top: 0; width: 8.5in; height: 11in; box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
