/* Learning experience: My learning, course pages, the player, certificates.
   Each course carries --hue (from its category); everything themed derives from it. */

:root {
  --radius-lg: 16px;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lift: 0 12px 28px -8px rgba(16, 24, 40, .18), 0 4px 10px -4px rgba(16, 24, 40, .08);
  --hero-ink: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --shadow-card: none; --shadow-lift: 0 12px 30px -10px rgba(0, 0, 0, .6); }
}
/* Chosen in the app: the same tokens whatever the device says. */
:root[data-theme="dark"] { --shadow-card: none; --shadow-lift: 0 12px 30px -10px rgba(0, 0, 0, .6); }

.ic { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; vertical-align: -0.125em; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 700; color: var(--muted); }
.spacer { flex: 1; }
.section-title { margin: 26px 0 12px; font-size: 1.05rem; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tone-bad { color: var(--bad); }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 99px; font-size: .74rem; font-weight: 650; white-space: nowrap; }
.chip-neutral { background: var(--surface-2); color: var(--muted); }
.chip-info { background: var(--info-soft); color: var(--info); }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-bad { background: var(--bad-soft); color: var(--bad); }

/* ── covers ─────────────────────────────────────────────────────────────── */
.cover {
  position: relative; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(120% 90% at 100% 0%, hsl(calc(var(--hue) + 25) 90% 70% / .55), transparent 55%),
    radial-gradient(80% 80% at 0% 100%, hsl(calc(var(--hue) - 20) 80% 30% / .7), transparent 60%),
    linear-gradient(135deg, hsl(var(--hue) 72% 50%), hsl(calc(var(--hue) + 18) 68% 36%));
}
.cover::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .16;
  background-image: radial-gradient(circle at 1px 1px, #fff 1px, transparent 1.4px);
  background-size: 16px 16px;
  mask-image: linear-gradient(90deg, transparent 20%, #000 90%);
}
.cover-card { height: 128px; }
.cover-art { position: absolute; right: -18px; top: -14px; color: #fff; opacity: .2; transform: rotate(-12deg); }
.cover-glyph { width: 150px; height: 150px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.cover-badge {
  position: absolute; left: 18px; bottom: 16px; width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; color: #fff; font-size: 22px;
  background: rgba(255, 255, 255, .18); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, .35);
}
.mini-cover {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: #fff; flex-shrink: 0;
  background: linear-gradient(135deg, hsl(var(--hue) 72% 50%), hsl(calc(var(--hue) + 18) 68% 36%));
}
.row-course { display: inline-flex; gap: 10px; align-items: flex-start; }

/* With the heading hidden, crumbs sit directly above the hero. */
.crumbs + .course-hero, .crumbs + .learn-hero { margin-top: 8px; }

/* ── My learning ────────────────────────────────────────────────────────── */
.learn-hero {
  display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center;
  padding: 30px 34px; border-radius: var(--radius-lg); margin-bottom: 28px; color: var(--hero-ink);
  background:
    radial-gradient(90% 140% at 100% 0%, hsl(205 95% 60% / .45), transparent 55%),
    radial-gradient(60% 100% at 0% 100%, hsl(250 70% 45% / .5), transparent 60%),
    linear-gradient(120deg, hsl(222 60% 18%), hsl(218 70% 32%));
  box-shadow: var(--shadow-lift);
}
.learn-hero .eyebrow { color: rgba(255, 255, 255, .7); }
.learn-hero h1 { font-size: 1.85rem; margin: 6px 0 8px; color: #fff; letter-spacing: -.02em; }
.learn-hero p { color: rgba(255, 255, 255, .86); max-width: 62ch; margin: 0 0 18px; }
.learn-hero p strong { color: #fff; }
.learn-hero-stats { display: flex; gap: 26px; align-items: center; }
.learn-hero-stats dl { margin: 0; display: grid; gap: 10px; }
.learn-hero-stats dl div { display: flex; justify-content: space-between; gap: 28px; border-bottom: 1px solid rgba(255, 255, 255, .14); padding-bottom: 6px; }
.learn-hero-stats dt { color: rgba(255, 255, 255, .72); font-size: .85rem; }
.learn-hero-stats dd { margin: 0; font-weight: 750; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.learn-hero .tone-bad { color: #ffb4ab; }
.learn-hero .ring-track { stroke: rgba(255, 255, 255, .16); }
.learn-hero .ring-label strong { color: #fff; }
.learn-hero .ring-label span { color: rgba(255, 255, 255, .7); }
.learn-hero .ring-ok .ring-fill { stroke: #6ee7a8; }
.learn-hero .ring-warn .ring-fill { stroke: #fbbf62; }

.btn-hero, .btn-hero-ghost { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 10px; font-weight: 650; font-size: .95rem; text-decoration: none; border: 1px solid transparent; transition: transform .15s, box-shadow .15s, background .15s; }
.btn-hero { background: #fff; color: hsl(var(--hue, 220) 70% 30%); box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .35); }
.btn-hero:hover { transform: translateY(-1px); text-decoration: none; box-shadow: 0 10px 20px -8px rgba(0, 0, 0, .45); }
.btn-hero-ghost { color: #fff; border-color: rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .06); }
.btn-hero-ghost:hover { background: rgba(255, 255, 255, .14); text-decoration: none; }

.shelf { margin-bottom: 30px; }
.shelf > h2 { font-size: 1.1rem; margin-bottom: 14px; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.course-card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; color: var(--text); text-decoration: none; box-shadow: var(--shadow-card);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); text-decoration: none; border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.course-card.is-overdue { border-color: color-mix(in srgb, var(--bad) 45%, var(--border)); }
.course-card-body { padding: 16px 18px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.course-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.course-card h3 { margin: 0; font-size: 1.05rem; line-height: 1.35; letter-spacing: -.01em; }
.course-card p { margin: 0; color: var(--muted); font-size: .9rem; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: .82rem; }
.meta-row span { display: inline-flex; align-items: center; gap: 5px; }
.card-progress { display: flex; align-items: center; gap: 10px; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.card-progress .pbar { flex: 1; }
.course-card-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .83rem; }
.course-card-foot .due { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); white-space: nowrap; }
.course-card-foot .cta { white-space: nowrap; }
.course-card-foot .due-bad { color: var(--bad); font-weight: 600; }
.course-card-foot .cta { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; color: var(--accent); }
.course-card:hover .cta .ic { transform: translateX(3px); }
.cta .ic { transition: transform .15s; }

.pbar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.pbar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, hsl(var(--hue, 216) 75% 52%), hsl(calc(var(--hue, 216) + 25) 75% 48%)); transition: width .4s ease; }

/* ── rings ──────────────────────────────────────────────────────────────── */
.ring { position: relative; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring-track { stroke: var(--surface-2); }
.ring-fill { stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.ring-accent .ring-fill { stroke: hsl(var(--hue, 216) 75% 52%); }
.ring-ok .ring-fill { stroke: var(--ok); }
.ring-warn .ring-fill { stroke: var(--warn); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.ring-label strong { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ring-label span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }

/* ── course landing ─────────────────────────────────────────────────────── */
.course-hero {
  position: relative; overflow: hidden; isolation: isolate; color: var(--hero-ink);
  border-radius: var(--radius-lg); margin-bottom: 22px; padding: 38px 40px; box-shadow: var(--shadow-lift);
  background:
    radial-gradient(70% 120% at 100% 0%, hsl(calc(var(--hue) + 30) 90% 65% / .5), transparent 55%),
    radial-gradient(60% 90% at 0% 100%, hsl(calc(var(--hue) - 25) 80% 25% / .7), transparent 60%),
    linear-gradient(125deg, hsl(var(--hue) 70% 40%), hsl(calc(var(--hue) + 15) 72% 26%));
}
.course-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .12; background-image: radial-gradient(circle at 1px 1px, #fff 1px, transparent 1.4px); background-size: 18px 18px; mask-image: linear-gradient(90deg, transparent 35%, #000 95%); }
.course-hero-art { position: absolute; right: 30px; top: 50%; transform: translateY(-50%) rotate(-10deg); color: #fff; opacity: .16; z-index: -1; }
.hero-glyph { width: 260px; height: 260px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.course-hero-inner { max-width: min(760px, 60%); }
@media (max-width: 1000px) { .course-hero-inner { max-width: none; } }
.hero-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 99px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28); font-size: .8rem; font-weight: 650; }
.course-hero h1 { font-size: 2.2rem; line-height: 1.15; letter-spacing: -.025em; margin: 14px 0 10px; color: #fff; }
.course-hero .lede { font-size: 1.08rem; color: rgba(255, 255, 255, .88); margin: 0 0 18px; max-width: 64ch; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .88rem; color: rgba(255, 255, 255, .9); margin-bottom: 22px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.course-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .course-layout { grid-template-columns: 1fr; } }
.course-layout .card { border-radius: var(--radius-lg); padding: 22px 24px; }

.check-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px 22px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; }
.check-list .ic { color: var(--ok); background: var(--ok-soft); border-radius: 50%; padding: 4px; width: 22px; height: 22px; margin-top: 1px; }

.progress-card { display: flex; gap: 18px; align-items: center; }
.progress-facts dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 10px 0 0; font-size: .86rem; }
.progress-facts dt { color: var(--muted); }
.progress-facts dd { margin: 0; font-weight: 600; white-space: nowrap; }
.attempt-list { list-style: none; padding: 0; margin: 0; }
.attempt-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.attempt-list li:last-child { border-bottom: 0; }
.attempt-list a { margin-left: auto; }
.attempt-score { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 52px; text-align: center; padding: 4px 0; border-radius: 8px; }
.attempt-score.ok { background: var(--ok-soft); color: var(--ok); }
.attempt-score.bad { background: var(--warn-soft); color: var(--warn); }
.status-strip { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ── outline ────────────────────────────────────────────────────────────── */
.outline { list-style: none; margin: 0; padding: 0; position: relative; }
.outline li { position: relative; }
.outline li + li::before { content: ""; position: absolute; left: 17px; top: -10px; height: 20px; width: 2px; background: var(--border); }
.outline a, .outline li > div { display: flex; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 10px; color: var(--text); text-decoration: none; }
.outline a:hover { background: var(--surface-2); text-decoration: none; }
.outline li.current > a, .outline li.current > div { background: color-mix(in srgb, hsl(var(--hue, 216) 75% 52%) 12%, transparent); }
.outline li.current .ol-title { color: hsl(var(--hue, 216) 70% 42%); font-weight: 700; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .outline li.current .ol-title { color: hsl(var(--hue, 216) 85% 72%); } }
:root[data-theme="dark"] .outline li.current .ol-title { color: hsl(var(--hue, 216) 85% 72%); }
.outline li.locked { opacity: .6; }
.ol-mark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 700; flex-shrink: 0; border: 2px solid var(--border); background: var(--surface); color: var(--muted); position: relative; z-index: 1; }
.ol-mark.done { background: hsl(var(--hue, 216) 70% 48%); border-color: transparent; color: #fff; }
.ol-mark.ol-quiz { border-style: dashed; }
.ol-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.ol-title { font-size: .92rem; }
.ol-sub { font-size: .76rem; color: var(--muted); }

/* ── player (focus mode) ────────────────────────────────────────────────── */
body.focus { background: var(--bg); }
.flash-float { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 50; box-shadow: var(--shadow-lift); max-width: 90vw; }
.player { min-height: 100vh; display: flex; flex-direction: column; }
.player-bar {
  position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: auto 1fr minmax(180px, 320px); gap: 18px; align-items: center;
  padding: 10px 22px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.player-exit { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--border); font-size: 18px; }
.player-exit:hover { background: var(--surface-2); color: var(--text); }
.player-title { display: flex; gap: 12px; align-items: center; min-width: 0; }
.player-title > div { min-width: 0; }
.player-badge { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 18px; flex-shrink: 0; background: linear-gradient(135deg, hsl(var(--hue) 72% 50%), hsl(calc(var(--hue) + 18) 68% 36%)); }
.player-course { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-step { font-size: .8rem; color: var(--muted); }
.player-progress { display: flex; align-items: center; gap: 10px; font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.player-progress .pbar { flex: 1; height: 8px; }
.player-body { display: grid; grid-template-columns: 300px minmax(0, 1fr); flex: 1; }
.player-outline { border-right: 1px solid var(--border); background: var(--surface); padding: 22px 14px; position: sticky; top: 57px; height: calc(100vh - 57px); overflow-y: auto; }
.outline-head { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--muted); padding: 0 10px 10px; }
.player-main { padding: 48px 56px 80px; display: flex; flex-direction: column; align-items: center; }
.player-main > * { width: 100%; max-width: 760px; }
@media (max-width: 900px) {
  .player-body { grid-template-columns: 1fr; }
  /* On phones the bar already says "Lesson 4 of 6"; the outline would bury the lesson. */
  .player-outline { display: none; }
  .player-main { padding: 28px 18px 60px; }
  .player-bar { grid-template-columns: auto 1fr; }
  .player-progress { grid-column: 1 / -1; }
}
.lesson-eyebrow { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: hsl(var(--hue, 216) 65% 45%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lesson-eyebrow { color: hsl(var(--hue, 216) 80% 70%); } }
:root[data-theme="dark"] .lesson-eyebrow { color: hsl(var(--hue, 216) 80% 70%); }
.lesson-title { font-size: 2.1rem; line-height: 1.15; letter-spacing: -.025em; margin: 8px 0 22px; }
.lesson-prose { font-size: 1.06rem; line-height: 1.75; max-width: none; }
.lesson-prose p { margin: 0 0 1.1em; }
.lesson-prose h3 { font-size: 1.2rem; margin: 1.8em 0 .5em; }
.lesson-prose ul, .lesson-prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.lesson-prose li { margin: .35em 0; }
.lesson-prose li::marker { color: hsl(var(--hue, 216) 65% 50%); font-weight: 700; }
.lesson-prose strong { font-weight: 700; }
.lesson-prose code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }
.lesson-prose table { margin: 1em 0 1.4em; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.lesson-prose th { background: var(--surface-2); text-transform: none; letter-spacing: 0; font-size: .88rem; color: var(--text); }
.lesson-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.lesson-nav form { margin: 0; }
.btn-lg, button.btn-lg { padding: 11px 20px; font-size: .98rem; border-radius: 10px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.player .btn-primary { background: hsl(var(--hue) 70% 45%); border-color: hsl(var(--hue) 70% 45%); color: #fff; }

/* ── callouts in lesson content ─────────────────────────────────────────── */
.co { --c: var(--info); --cs: var(--info-soft); margin: 1.6em 0; border-radius: 12px; padding: 16px 20px 6px; background: var(--cs); border: 1px solid color-mix(in srgb, var(--c) 22%, transparent); }
.co-head { display: flex; align-items: center; gap: 8px; font-weight: 750; color: var(--c); font-size: .86rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.co-head svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.co-title { text-transform: none; letter-spacing: 0; color: var(--text); font-size: 1rem; font-weight: 700; margin-left: 4px; }
.co-title::before { content: "·"; margin-right: 8px; color: var(--muted); }
.co-body { font-size: 1rem; }
.co-body > *:last-child { margin-bottom: 12px; }
.co-tip { --c: var(--ok); --cs: var(--ok-soft); }
.co-warning, .co-important { --c: var(--warn); --cs: var(--warn-soft); }
.co-important { --c: var(--bad); --cs: var(--bad-soft); }
.co-scenario { --c: hsl(var(--hue, 216) 65% 45%); --cs: color-mix(in srgb, hsl(var(--hue, 216) 70% 50%) 8%, var(--surface)); border-left: 4px solid var(--c); background: var(--cs); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .co-scenario { --c: hsl(var(--hue, 216) 80% 70%); } }
:root[data-theme="dark"] .co-scenario { --c: hsl(var(--hue, 216) 80% 70%); }
.co-key { --c: var(--text); --cs: var(--surface); border: 2px solid hsl(var(--hue, 216) 65% 50%); box-shadow: var(--shadow-card); }
.co-key .co-head { color: hsl(var(--hue, 216) 65% 45%); }
.co-key ul { list-style: none; padding: 0; }
.co-key li { position: relative; padding-left: 30px; }
.co-key li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 800; background: var(--ok-soft); color: var(--ok); }
.callout-stat { display: grid; grid-template-columns: fit-content(45%) 1fr; gap: 22px; align-items: center; margin: 1.6em 0; padding: 22px 24px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card); }
.stat-figure { font-size: 2rem; white-space: normal !important; font-weight: 850; letter-spacing: -.03em; line-height: 1; background: linear-gradient(135deg, hsl(var(--hue, 216) 75% 50%), hsl(calc(var(--hue, 216) + 40) 75% 45%)); -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap; }
.stat-text p { margin: 0; color: var(--muted); }

/* ── assessment ─────────────────────────────────────────────────────────── */
.assessment fieldset { border: 0; padding: 0; margin: 0 0 34px; }
.assessment legend { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; padding: 0; }
.q-count { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.q-prompt { font-size: 1.3rem; font-weight: 700; line-height: 1.35; letter-spacing: -.01em; }
.options { display: grid; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 14px; margin: 0; padding: 14px 16px; border-radius: 12px; cursor: pointer; font-weight: 500; font-size: 1rem;
  background: var(--surface); border: 2px solid var(--border); transition: border-color .12s, background .12s, transform .12s;
}
.option:hover { border-color: color-mix(in srgb, hsl(var(--hue, 216) 70% 50%) 50%, var(--border)); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option-key { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 750; font-size: .85rem; background: var(--surface-2); color: var(--muted); flex-shrink: 0; transition: background .12s, color .12s; }
.option-text { flex: 1; line-height: 1.4; }
.option-tick { opacity: 0; color: hsl(var(--hue, 216) 70% 45%); font-size: 20px; transition: opacity .12s; }
.option:has(input:checked) { border-color: hsl(var(--hue, 216) 70% 48%); background: color-mix(in srgb, hsl(var(--hue, 216) 70% 50%) 13%, var(--surface)); }
.option:has(input:checked) .option-key { background: hsl(var(--hue, 216) 70% 48%); color: #fff; }
.option:has(input:checked) .option-tick { opacity: 1; }
.option:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, hsl(var(--hue, 216) 70% 50%) 40%, transparent); outline-offset: 2px; }
.attest { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: 12px; border: 2px solid var(--border); background: var(--surface); font-weight: 500; font-size: 1rem; cursor: pointer; margin: 0; }
.attest input { width: 20px; height: 20px; margin-top: 2px; accent-color: hsl(var(--hue, 216) 70% 45%); }
.attest:has(input:checked) { border-color: hsl(var(--hue, 216) 70% 48%); }
.assess-intro { margin-bottom: 28px; }
.step-dots { display: none; gap: 6px; margin-top: 16px; }
.step-dots span { height: 6px; flex: 1; max-width: 48px; border-radius: 99px; background: var(--surface-2); transition: background .2s; }
.step-dots span.on { background: hsl(var(--hue, 216) 70% 50%); }
.assess-nav { display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding-top: 22px; border-top: 1px solid var(--border); }
.assess-nav [data-prev] { margin-right: auto; }
/* Enhanced by training.js: one question at a time. Without JS, everything shows. */
.assessment.stepped .step-dots { display: flex; }
.assessment.stepped .q-step { display: none; }
.assessment.stepped .q-step.active { display: block; animation: rise .25s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .assessment.stepped .q-step.active { animation: none; } .course-card, .pbar span, .ring-fill { transition: none; } }

/* ── results ────────────────────────────────────────────────────────────── */
.result { display: flex; gap: 32px; align-items: center; padding: 30px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card); margin-bottom: 26px; }
.result-pass { background: linear-gradient(135deg, var(--ok-soft), var(--surface) 70%); }
.result-fail { background: linear-gradient(135deg, var(--warn-soft), var(--surface) 70%); }
.result .lesson-title { margin-bottom: 10px; }
.result p { margin: 0 0 18px; }
.result .hero-actions .btn-ghost { color: var(--text); }
@media (max-width: 700px) { .result { flex-direction: column; text-align: center; } .result .hero-actions { justify-content: center; } }
.review h2 { font-size: 1.1rem; }
.review-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.review-mark { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-size: 15px; }
.review-item.ok .review-mark { background: var(--ok-soft); color: var(--ok); }
.review-item.bad .review-mark { background: var(--bad-soft); color: var(--bad); }
.review-q { font-weight: 650; margin-bottom: 4px; }
.review-a, .review-c { font-size: .92rem; color: var(--muted); }
.review-c { color: var(--ok); font-weight: 600; }
.review-x { font-size: .9rem; margin-top: 6px; padding: 8px 12px; background: var(--surface-2); border-radius: 8px; }

/* ── insights ───────────────────────────────────────────────────────────── */
.qperf td { vertical-align: middle; }
.qbar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.qbar span { display: block; height: 100%; border-radius: 99px; }
.qbar.ok span { background: var(--ok); }
.qbar.warn span { background: var(--warn); }
.qbar.bad span { background: var(--bad); }

/* ── matrix ─────────────────────────────────────────────────────────────── */
.matrix th.mx-col { vertical-align: bottom; height: 170px; padding: 6px 4px; white-space: nowrap; }
.matrix th.mx-col span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); text-transform: none; letter-spacing: 0; font-size: .82rem; color: var(--text); font-weight: 600; border-left: 3px solid hsl(var(--hue) 70% 50%); padding-top: 6px; }
.matrix td.mx-cell { text-align: center; padding: 6px 4px; vertical-align: middle; }
.mx { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; font-style: normal; font-weight: 800; font-size: .85rem; text-decoration: none !important; }
.mx-completed { background: var(--ok); color: #fff; }
.mx-in_progress { background: var(--info-soft); color: var(--info); }
.mx-due { background: var(--surface-2); border: 2px solid var(--border); }
.mx-overdue { background: var(--bad); color: #fff; }
.mx-none { background: transparent; border: 2px dashed var(--border); width: 20px; height: 20px; }
.matrix-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; font-size: .85rem; color: var(--muted); }
.matrix-legend span { display: inline-flex; align-items: center; gap: 8px; }
.matrix-legend .mx { width: 20px; height: 20px; font-size: .7rem; }

/* ── editor ─────────────────────────────────────────────────────────────── */
.editor .card { border-radius: var(--radius-lg); }
.guide { white-space: pre-wrap; font-size: .8rem; background: var(--surface-2); padding: 12px; border-radius: 8px; max-width: 560px; }

/* ── certificate ────────────────────────────────────────────────────────── */
.cert-toolbar { display: flex; justify-content: space-between; padding: 16px 22px; max-width: 1180px; margin: 0 auto; }
.cert-sheet {
  page: cert; width: 297mm; height: 210mm; max-width: calc(100vw - 32px); aspect-ratio: 297 / 210; height: auto;
  margin: 0 auto 40px; background: #fffdf8; color: #1b2330; box-shadow: var(--shadow-lift); padding: 14mm; position: relative;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
}
.cert-frame { position: relative; height: 100%; border: 2px solid hsl(var(--hue) 45% 35%); outline: 1px solid hsl(var(--hue) 45% 35% / .4); outline-offset: 5px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 10mm 18mm; }
.cert-corner { position: absolute; width: 34px; height: 34px; border: 3px solid hsl(var(--hue) 55% 42%); }
.cert-corner.tl { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.cert-corner.tr { top: 8px; right: 8px; border-left: 0; border-bottom: 0; }
.cert-corner.bl { bottom: 8px; left: 8px; border-right: 0; border-top: 0; }
.cert-corner.br { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }
.cert-brand { display: inline-flex; gap: 8px; align-items: center; font-family: ui-sans-serif, system-ui, sans-serif; font-weight: 700; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: hsl(var(--hue) 50% 32%); }
.cert-kicker { font-size: 34px; letter-spacing: .04em; margin: 14px 0 12px; color: hsl(var(--hue) 45% 26%); }
.cert-small { margin: 4px 0; font-style: italic; color: #5b6472; font-size: 15px; }
.cert-name { font-size: 44px; margin: 6px 0 4px; padding: 0 30px 6px; border-bottom: 1px solid #c9b88a; font-weight: 600; }
.cert-course { font-size: 26px; font-weight: 600; margin: 8px 0 18px; color: hsl(var(--hue) 45% 26%); }
.cert-facts { display: flex; gap: 34px; font-family: ui-sans-serif, system-ui, sans-serif; }
.cert-facts div { display: flex; flex-direction: column; gap: 2px; }
.cert-facts span { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: #7a8291; }
.cert-facts strong { font-size: 14px; }
.cert-seal { position: absolute; right: 26mm; bottom: 20mm; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 40px; background: radial-gradient(circle at 35% 30%, hsl(42 85% 62%), hsl(36 80% 42%)); box-shadow: 0 0 0 4px #fffdf8, 0 0 0 6px hsl(38 70% 50%); }
.cert-foot { position: absolute; bottom: 9mm; left: 0; right: 0; display: flex; justify-content: center; gap: 24px; font-family: ui-sans-serif, system-ui, sans-serif; font-size: 9.5px; color: #8a919c; }
/* Company branding: the logo leads, the frame and headings take the brand's dark shade. */
.cert-logo { max-height: 64px; max-width: 260px; object-fit: contain; }
.cert-sheet.branded .cert-frame { border-color: var(--brand-ink); outline-color: color-mix(in srgb, var(--brand-ink) 40%, transparent); }
.cert-sheet.branded .cert-corner { border-color: var(--brand); }
.cert-sheet.branded .cert-brand, .cert-sheet.branded .cert-kicker, .cert-sheet.branded .cert-course { color: var(--brand-ink); }
.cert-issuer { display: inline-flex; align-items: center; gap: 5px; }
.cert-issuer .brand-mark { width: 12px; height: 12px; }
@page cert { size: A4 landscape; margin: 0; }
@media print {
  body.focus { background: #fff; }
  .cert-sheet { box-shadow: none; margin: 0; max-width: none; width: 297mm; height: 210mm; aspect-ratio: auto; }
  .player-bar, .player-outline, .lesson-nav, .assess-nav { display: none !important; }
}
@media (max-width: 900px) { .cert-sheet { padding: 4vw; } .cert-name { font-size: 6vw; } .cert-kicker { font-size: 5vw; } .cert-course { font-size: 4vw; } .cert-facts { gap: 14px; flex-wrap: wrap; justify-content: center; } .cert-seal { display: none; } }

@media (max-width: 800px) {
  .learn-hero { grid-template-columns: 1fr; padding: 24px; }
  .course-hero { padding: 28px 22px; }
  .course-hero h1 { font-size: 1.7rem; }
}

/* ── illustrations ──────────────────────────────────────────────────────── */
.figure { margin: 2em 0; }
.figure-scroll { overflow-x: auto; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); padding: 18px; box-shadow: var(--shadow-card); }
.figure svg.ill { display: block; width: 100%; height: auto; min-width: 560px; }
.figure figcaption { font-size: .88rem; color: var(--muted); margin-top: 10px; text-align: center; }
.ill { --h: hsl(var(--hue, 216) 70% 50%); font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.ill .paper { fill: var(--surface); }
.ill .panel { fill: var(--surface-2); }
.ill .ghost { fill: var(--border); }
.ill .stroke { stroke: var(--border); stroke-width: 1.5; }
.ill .stroke-ink { stroke: var(--text); stroke-width: 2.5; }
.ill .stroke-bad { stroke: var(--bad); stroke-width: 2; }
.ill .acc { fill: var(--h); }
.ill .acc-soft { fill: color-mix(in srgb, var(--h) 13%, var(--surface)); }
.ill .bad { fill: var(--bad); } .ill .bad-soft { fill: var(--bad-soft); }
.ill .ok { fill: var(--ok); } .ill .ok-soft { fill: var(--ok-soft); }
.ill .warn { fill: var(--warn); } .ill .warn-soft { fill: var(--warn-soft); }
.ill .ics, .ill .arw, .ill .bracket { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ill .s-acc { stroke: var(--h); } .ill .s-bad { stroke: var(--bad); } .ill .s-ok { stroke: var(--ok); } .ill .s-warn { stroke: var(--warn); }
.ill .s-muted { stroke: var(--muted); } .ill .s-ink { stroke: var(--text); } .ill .s-white { stroke: #fff; } .ill .s-line { stroke: var(--border); stroke-width: 1.5; }
.ill .arw { stroke-width: 2.2; }
.ill .dash { stroke-dasharray: 5 5; }
.ill .thick { stroke-width: 4; }
.ill .track { stroke: var(--border); stroke-width: 6; stroke-linecap: round; }
.ill .cursor { fill: var(--text); stroke: var(--surface); stroke-width: 1.5; }
.ill text { fill: var(--text); font-size: 15px; }
.ill .t-b { font-weight: 700; }
.ill .t-sm { font-size: 13.5px; } .ill .t-xs { font-size: 12.5px; } .ill .t-xxs { font-size: 10.5px; }
.ill .t-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ill .t-url { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 22px; font-weight: 600; }
.ill .t-muted { fill: var(--muted); } .ill .t-bad { fill: var(--bad); } .ill .t-acc { fill: var(--h); } .ill .t-white { fill: #fff; }
.ill .t-pin { fill: #fff; font-size: 12.5px; font-weight: 800; }
.ill .t-num { fill: var(--border); font-size: 26px; font-weight: 800; }

/* cover scenes: white UI cards on the category gradient */
.cover-art { position: absolute; inset: 0; opacity: 1; transform: none; right: 0; top: 0; display: flex; justify-content: flex-end; align-items: center; }
.cover-card .cover-art .scene { height: 100%; width: auto; margin-right: -6px; }
.course-hero-art { right: 24px; opacity: 1; transform: translateY(-50%); }
.course-hero-art .scene { height: 240px; width: auto; max-width: 36vw; }
.scene .sc-w { fill: #fff; }
.scene .sc-g { fill: rgba(255, 255, 255, .24); }
.scene .sc-h { stroke: hsl(var(--hue) 70% 45%); }
.scene .sc-hs { fill: hsl(var(--hue) 70% 50% / .18); }
.scene .sc-h-fill { fill: hsl(var(--hue) 70% 48%); }
.scene .sc-wl { stroke: #fff; }
.scene .sc-red { fill: #ef4444; } .scene .sc-red-soft { fill: rgba(239, 68, 68, .3); } .scene .sc-red-s { stroke: #ef4444; }
.scene .ics { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.scene .fat { stroke-width: 5; }
.scene { filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .18)); }
@media (max-width: 1000px) { .course-hero-art { display: none; } }

/* learning path card */
.path-card { border: 2px solid hsl(var(--hue) 70% 50% / .5); border-radius: 16px; }
.path-head { display: flex; gap: 14px; align-items: flex-start; }
.path-head h2 { margin: 2px 0 2px; }
.path-steps { list-style: none; padding: 0; margin: 14px 0 6px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.path-steps li { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, hsl(var(--hue) 70% 50%) 8%, var(--surface)); }
.path-q { font-size: .72rem; font-weight: 800; letter-spacing: .1em; color: hsl(var(--hue) 65% 45%); }

/* ── interactive lessons ─────────────────────────────────────────────────── */
.linklike { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 2px; }
.linklike.small { font-size: .84rem; }

/* Steps: training.js-free pages show every step, so only [hidden] hides one. */
.step[hidden] { display: none; }
.step:focus { outline: none; }
.step-in { animation: step-in .45s ease both; }
@keyframes step-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.step-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 8px; padding: 18px 0 4px; border-top: 1px dashed var(--border); }
.step-bar[hidden] { display: none; }
.step-bar .linklike { margin-left: auto; }
.step-bar .btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.step-bar .pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 50% { box-shadow: 0 0 0 8px transparent; } }
.lesson-nav.is-locked .btn-primary, .lesson-nav.is-locked form { display: none; }
.is-reading { background: color-mix(in srgb, hsl(var(--hue, 216) 75% 55%) 7%, transparent); box-shadow: -14px 0 0 color-mix(in srgb, hsl(var(--hue, 216) 75% 55%) 7%, transparent), 14px 0 0 color-mix(in srgb, hsl(var(--hue, 216) 75% 55%) 7%, transparent); border-radius: 6px; transition: background .3s; }
@media (prefers-reduced-motion: reduce) { .step-in, .step-bar .pulse { animation: none; } }

/* Read-aloud bar */
.narrator { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin: -8px 0 22px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.narrator[hidden] { display: none; }
.narr-play.is-on { background: hsl(var(--hue, 216) 70% 45%); color: #fff; border-color: transparent; }
.narr-opt { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); }
.narr-opt select { height: 30px; padding: 0 8px; font-size: .82rem; max-width: 220px; }
.narr-note { flex-basis: 100%; }
.narr-note:empty { display: none; }

/* Quick check (practice question) */
.co-quiz { --c: hsl(var(--hue, 216) 65% 45%); --cs: color-mix(in srgb, hsl(var(--hue, 216) 70% 50%) 6%, var(--surface)); padding-bottom: 16px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .co-quiz, :root:not([data-theme="light"]) .co-reveal, :root:not([data-theme="light"]) .co-spot { --c: hsl(var(--hue, 216) 80% 70%); } }
:root[data-theme="dark"] .co-quiz, :root[data-theme="dark"] .co-reveal, :root[data-theme="dark"] .co-spot { --c: hsl(var(--hue, 216) 80% 70%); }
.quiz-q { font-weight: 650; margin: 0 0 12px !important; }
.quiz-opts { display: grid; gap: 8px; }
.quiz-opt { display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .98rem; line-height: 1.5; cursor: pointer; transition: border-color .15s, background .15s, transform .1s; }
.quiz-opt:not(:disabled):hover { border-color: var(--c); transform: translateY(-1px); }
.quiz-opt:disabled { cursor: default; opacity: 1; color: var(--text); }
.quiz-key { flex-shrink: 0; width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-weight: 750; font-size: .8rem; background: var(--surface-2); color: var(--muted); }
.quiz-opt.is-right { border-color: var(--ok); background: var(--ok-soft); }
.quiz-opt.is-right .quiz-key { background: var(--ok); color: #fff; }
.quiz-opt.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.quiz-opt.is-wrong .quiz-key { background: var(--bad); color: #fff; }
.quiz-answer { margin-top: 12px; font-size: .95rem; }
.quiz-answer summary { cursor: pointer; color: var(--c); font-weight: 650; }
.quiz-fb { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-size: .97rem; animation: step-in .3s ease both; }
.quiz-fb > *:last-child { margin-bottom: 0; }
.quiz-verdict { font-weight: 750; margin: 0 0 6px !important; }
.got-it .quiz-verdict { color: var(--ok); }
.missed-it .quiz-verdict { color: var(--bad); }

/* Reveal */
.co-reveal { --c: hsl(var(--hue, 216) 65% 45%); --cs: var(--surface); border: 1px dashed color-mix(in srgb, var(--c) 55%, transparent); padding-bottom: 12px; }
.co-reveal > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.co-reveal > summary::-webkit-details-marker { display: none; }
.co-reveal > summary .co-head { margin-bottom: 0; }
.reveal-hint { font-size: .8rem; font-weight: 650; color: var(--surface); background: var(--c); padding: 4px 12px; border-radius: 99px; }
.co-reveal[open] { border-style: solid; }
.co-reveal[open] .reveal-hint { display: none; }
.co-reveal[open] > .co-body { margin-top: 10px; animation: step-in .3s ease both; }

/* Spot the signs */
.co-spot { --c: hsl(var(--hue, 216) 65% 45%); --cs: color-mix(in srgb, hsl(var(--hue, 216) 70% 50%) 6%, var(--surface)); padding-bottom: 14px; }
.spot-msg { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; font-size: .97rem; line-height: 1.6; box-shadow: var(--shadow-card); }
.spot-msg > *:last-child { margin-bottom: 0; }
.spot-msg p { margin: 0 0 .6em; }
.spot-mark { background: var(--warn-soft); color: inherit; border-radius: 4px; padding: 0 3px; box-shadow: inset 0 -2px 0 var(--warn); }
.spot-num { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 4px; border-radius: 50%; background: var(--warn); color: #fff; font-size: .68rem; font-weight: 800; vertical-align: 1px; }
.is-live .spot-mark:not(.found) { background: none; box-shadow: none; padding: 0; cursor: pointer; }
.is-live .spot-mark:not(.found) .spot-num { display: none; }
.is-live .spot-mark:not(.found):hover, .is-live .spot-mark:not(.found):focus-visible { background: var(--surface-2); outline: none; }
.is-live .spot-msg { cursor: crosshair; }
.spot-mark.found { animation: step-in .3s ease both; }
.spot-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 0 6px; }
.spot-tally { font-weight: 650; font-size: .9rem; color: var(--c); }
.spot-list { margin: 0 !important; }
.spot-list li { animation: step-in .3s ease both; }
.spot-list li::marker { color: var(--warn) !important; }

/* Screenshots of Latra in the "Using Latra" courses ([!SHOT]). Numbered orange markers are in the image. */
.figure.shot .figure-scroll, .figure.shot > a { display: block; }
.figure.shot img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lift); background: #fff; }
.figure.shot a:hover img { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
