/* PF Concepts brand colors (from the official logo, see brand/brand-colors.md) */
:root {
  --green: #00843D;        /* PANTONE 7725 C */
  --green-dark: #006B31;
  --green-tint: #E6F3EC;
  --orange: #F68D2E;       /* PANTONE 715 C */
  --orange-tint: #FEF1E4;
  --gray: #97999B;         /* PANTONE Cool Gray 7 C */
  --gray-light: #C7C9C7;   /* PANTONE 420 C */
  --ink: #2B2D2F;
  --ink-soft: #5C5F62;
  --line: #E3E4E3;
  --bg: #F6F7F6;
  --card: #FFFFFF;
  --red: #C0392B;
  --red-tint: #FBEAE8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
  font-family: "Century Gothic", "Futura", "Avenir Next", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.55; }
a { color: var(--green); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8rem; }
ul, ol { margin: 0 0 .8rem; padding-left: 1.3rem; }
li { margin-bottom: .25rem; }
.muted { color: var(--ink-soft); }
.small { font-size: .875rem; }

/* Header */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1.5rem; background: var(--card); border-bottom: 4px solid var(--green); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--ink); }
.brand-logo { height: 40px; width: auto; }
.brand-divider { width: 1px; height: 28px; background: var(--gray-light); }
.brand-title { font-weight: 700; color: var(--ink-soft); letter-spacing: .02em; }
.topnav { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.topnav a { padding: .4rem .75rem; border-radius: 6px; text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: .95rem; }
.topnav a.active, .topnav a:hover { background: var(--green-tint); color: var(--green-dark); }
.topnav .who { color: var(--ink-soft); font-size: .875rem; padding-left: .5rem; }
.topnav a.signout { border: 1px solid var(--line); margin-left: .25rem; font-size: .875rem; }
.topnav a.signout:hover { border-color: var(--green); }

.container { max-width: 1040px; margin: 0 auto; padding: 1.75rem 1.25rem 3rem; min-height: 70vh; }
.footer { text-align: center; color: var(--ink-soft); font-size: .8rem; padding: 1rem; border-top: 1px solid var(--line); }

/* Cards and layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.4rem; box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack > * + * { margin-top: .75rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid transparent; border-radius: 6px; padding: .55rem 1rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; background: var(--green); color: #fff; }
.btn:hover { background: var(--green-dark); }
.btn:disabled { background: var(--gray-light); color: #fff; cursor: not-allowed; }
.btn.secondary { background: var(--card); color: var(--green-dark); border-color: var(--green); }
.btn.secondary:hover { background: var(--green-tint); }
.btn.ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.btn.ghost:hover { background: var(--bg); }
.btn.small { padding: .3rem .65rem; font-size: .85rem; }
.btn.danger { background: transparent; color: var(--red); border-color: var(--red); }

/* Chips and progress */
.chip { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.chip.passed { background: var(--green-tint); color: var(--green-dark); }
.chip.in_progress { background: var(--orange-tint); color: #9A4F0B; }
.chip.failed_attempt { background: var(--red-tint); color: var(--red); }
.chip.not_started { background: var(--bg); color: var(--ink-soft); border: 1px solid var(--line); }
.chip.cleared { background: var(--green); color: #fff; }
.progress { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--green); }

/* Hero / Rob */
.hero { display: flex; gap: 1.25rem; align-items: center; background: linear-gradient(120deg, var(--green-tint), #fff 70%); border-left: 6px solid var(--orange); }
.coach-avatar { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: #fff; font-weight: 800; font-size: 1.25rem; box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--orange); }
.coach-avatar.small { width: 34px; height: 34px; font-size: .85rem; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--orange); }
.hero-body { flex: 1; min-width: 0; }
.narration { width: 100%; max-width: 460px; height: 40px; }
.notice { background: var(--orange-tint); border: 1px solid #F8C89A; border-radius: var(--radius); padding: .8rem 1rem; }
.notice.danger { background: var(--red-tint); border-color: #EBB3AC; }

/* Track page */
.module-list { list-style: none; padding: 0; margin: 0; }
.module-list li { display: flex; align-items: center; gap: .9rem; padding: .85rem 0; border-bottom: 1px solid var(--line); margin: 0; }
.module-list li:last-child { border-bottom: 0; }
.step-dot { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; border: 2px solid var(--gray-light); color: var(--ink-soft); }
.step-dot.done { background: var(--green); border-color: var(--green); color: #fff; }
.module-list .title { flex: 1; }

/* Lesson page */
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1.25rem; align-items: start; }
.lesson-section h3 { color: var(--green-dark); }
.lesson-section + .lesson-section { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; }
.video-wrap { position: relative; padding-top: 56.25%; border-radius: var(--radius); overflow: hidden; background: #000; margin-bottom: 1rem; }
.video-wrap iframe, .video-wrap video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.check { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: .9rem; }
.option { display: block; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: .6rem .8rem; margin-bottom: .45rem; font: inherit; cursor: pointer; color: var(--ink); }
.option:hover { border-color: var(--green); }
.option.selected { border-color: var(--green); background: var(--green-tint); }
.option.right { border-color: var(--green); background: var(--green-tint); }
.option.wrong { border-color: var(--red); background: var(--red-tint); }
.feedback { font-size: .925rem; margin-top: .3rem; }
.feedback.ok { color: var(--green-dark); }
.feedback.bad { color: var(--red); }

/* Rob chat */
.chat { position: sticky; top: 1rem; display: flex; flex-direction: column; max-height: calc(100vh - 2rem); padding: 0; overflow: hidden; }
.chat-head { padding: .9rem 1rem; border-bottom: 1px solid var(--line); background: var(--green-tint); }
.chat-log { flex: 1; overflow-y: auto; padding: 1rem; min-height: 260px; }
.msg { margin-bottom: .8rem; display: flex; gap: .5rem; align-items: flex-start; }
.msg .bubble { padding: .6rem .8rem; border-radius: 10px; max-width: 100%; font-size: .95rem; }
.msg.assistant .bubble { background: var(--bg); border: 1px solid var(--line); }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { background: var(--green); color: #fff; }
.msg .bubble p:last-child, .msg .bubble ul:last-child { margin-bottom: 0; }
.chat-form { display: flex; gap: .5rem; padding: .75rem; border-top: 1px solid var(--line); }
.chat-form textarea { flex: 1; resize: none; font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 6px; min-height: 44px; }
.chat-form textarea:focus, input:focus { outline: 2px solid var(--green); outline-offset: 0; border-color: var(--green); }
.typing { color: var(--ink-soft); font-style: italic; font-size: .9rem; }

/* Forms and tables */
label { font-weight: 600; font-size: .9rem; }
input[type=text], input[type=email] { font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 6px; width: 100%; }
.check-label { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; margin-right: 1rem; }
table { width: 100%; border-collapse: collapse; font-size: .925rem; }
th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); border-bottom: 2px solid var(--line); padding: .5rem; }
td { border-bottom: 1px solid var(--line); padding: .6rem .5rem; vertical-align: top; }
.table-wrap { overflow-x: auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; border-top: 4px solid var(--green); }
.stat.orange { border-top-color: var(--orange); }
.stat.gray { border-top-color: var(--gray); }
.stat b { display: block; font-size: 1.8rem; }

/* Certificate */
.certificate { background: #fff; max-width: 900px; margin: 0 auto; aspect-ratio: 11 / 8.5; padding: 3.2rem 3.5rem; border: 10px solid var(--green); outline: 3px solid var(--orange); outline-offset: -22px; text-align: center; display: flex; flex-direction: column; justify-content: space-between; }
.certificate img { height: 70px; margin: 0 auto; }
.certificate .kicker { letter-spacing: .25em; text-transform: uppercase; color: var(--gray); font-weight: 700; font-size: .9rem; }
.certificate .who { font-size: 2.4rem; color: var(--green-dark); font-weight: 700; border-bottom: 2px solid var(--gray-light); display: inline-block; padding: 0 2rem .3rem; }
.certificate .course { font-size: 1.35rem; font-weight: 700; }
.certificate .meta { display: flex; justify-content: space-around; color: var(--ink-soft); font-size: .9rem; }
.certificate .meta b { display: block; color: var(--ink); font-size: 1rem; }

@media (max-width: 860px) {
  .lesson-layout { grid-template-columns: 1fr; }
  .chat { position: static; max-height: none; }
  .certificate { aspect-ratio: auto; padding: 2rem 1.25rem; }
  .certificate .who { font-size: 1.7rem; }
}
@media (max-width: 520px) {
  .topbar { padding: .6rem 1rem; }
  .brand-logo { height: 32px; }
  .container { padding: 1.25rem 1rem 2.5rem; }
  .hero { flex-direction: column; align-items: flex-start; }
}
@media print {
  @page { size: letter landscape; margin: 0.4in; }
  body { background: #fff; }
  .no-print, .topbar, .footer { display: none !important; }
  .container { padding: 0; max-width: none; }
  .certificate { border-width: 8px; box-shadow: none; max-width: none; height: 7.6in; aspect-ratio: auto; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Animated demonstrations */
.demo-stage { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: .8rem; background: #EEF0EF; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; min-height: 380px; }
.demo-window { background: #fff; border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; height: 340px; overflow: hidden; box-shadow: var(--shadow); }
.demo-stage.has-sheet .demo-window { height: 300px; }
.demo-titlebar { display: flex; align-items: center; gap: .6rem; padding: .45rem .75rem; border-bottom: 1px solid var(--line); font-size: .8rem; color: var(--ink-soft); font-weight: 600; background: #FAFAFA; }
.demo-dots { display: inline-flex; gap: 4px; }
.demo-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--gray-light); display: block; }
.demo-chat { flex: 1; overflow-y: auto; padding: .9rem; font-size: .9rem; scroll-behavior: smooth; }
.demo-msg { display: flex; gap: .5rem; margin-bottom: .7rem; align-items: flex-start; }
.demo-msg.user { justify-content: flex-end; }
.demo-msg.user .demo-bubble { background: #EDEFEE; border-radius: 14px; padding: .55rem .8rem; max-width: 88%; }
.demo-msg.ai .demo-bubble { padding: .1rem 0; max-width: 92%; }
.demo-msg.ai .demo-bubble p:last-child, .demo-msg.ai .demo-bubble ul:last-child { margin-bottom: 0; }
.demo-ai-icon { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font-size: .8rem; }
.demo-typing { color: var(--gray); letter-spacing: 2px; animation: demo-blink 1s infinite; }
@keyframes demo-blink { 50% { opacity: .3; } }
.demo-inputbar { display: flex; align-items: center; gap: .5rem; margin: .6rem; padding: .55rem .75rem; border: 1px solid var(--line); border-radius: 18px; font-size: .9rem; min-height: 42px; }
.demo-input { flex: 1; }
.demo-input.placeholder { color: var(--gray); }
.demo-send { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: .8rem; flex: 0 0 auto; }

/* Highlights appear when a "flag" step reveals them */
.hl { border-radius: 3px; transition: background .4s, box-shadow .4s; }
.hl.revealed { padding: 0 2px; }
.hl-bad.revealed { background: #FBD5D0; box-shadow: inset 0 -2px 0 var(--red); }
.hl-ok.revealed { background: #CDEBD9; box-shadow: inset 0 -2px 0 var(--green); }
.hl-role.revealed { background: #FDE2C8; box-shadow: inset 0 -2px 0 var(--orange); }
.hl-context.revealed { background: #D9E8F7; box-shadow: inset 0 -2px 0 #3B7DC4; }
.hl-task.revealed { background: #CDEBD9; box-shadow: inset 0 -2px 0 var(--green); }
.hl-format.revealed { background: #E5E0F3; box-shadow: inset 0 -2px 0 #7357B5; }

.demo-callout { padding: .7rem .9rem; border-radius: 8px; font-weight: 600; font-size: .925rem; box-shadow: 0 2px 10px rgba(0,0,0,.08); animation: demo-pop .3s ease-out; }
.demo-callout.warn { background: var(--red-tint); border: 1px solid #EBB3AC; color: #8E2A1F; }
.demo-callout.ok { background: var(--green-tint); border: 1px solid #A9D5BC; color: var(--green-dark); }
.demo-callout.info { background: var(--orange-tint); border: 1px solid #F8C89A; color: #8A4A0C; }
@keyframes demo-pop { from { transform: translateY(8px); opacity: 0; } }

.demo-cover { position: absolute; inset: 0; border: 0; border-radius: var(--radius); background: rgba(0, 107, 49, .82); color: #fff; font: inherit; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; cursor: pointer; z-index: 3; }
.demo-cover:hover { background: rgba(0, 107, 49, .9); }
.demo-play-icon { width: 64px; height: 64px; border-radius: 50%; background: #fff; color: var(--green); display: grid; place-items: center; font-size: 1.6rem; padding-left: 5px; box-shadow: 0 0 0 5px var(--orange); }
.demo-controls { margin-top: .75rem; }
.demo-progress { flex: 1; min-width: 120px; }
.demo-caption { margin: .6rem 0 0; min-height: 1.5em; color: var(--ink-soft); font-style: italic; }

.demo-sheet { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .6rem; box-shadow: var(--shadow); align-self: start; overflow-x: auto; }
.demo-sheet table { font-size: .82rem; border-collapse: collapse; width: 100%; }
.demo-sheet th { background: #F1F2F1; color: var(--ink-soft); font-weight: 600; text-align: center; border: 1px solid var(--line); padding: .25rem .4rem; text-transform: none; letter-spacing: 0; font-size: .75rem; }
.demo-sheet td { border: 1px solid var(--line); padding: .25rem .45rem; white-space: nowrap; transition: background .4s; }
.demo-sheet td.hdr { font-weight: 700; background: #FAFAFA; }
.demo-sheet td.filled { background: var(--green-tint); font-weight: 700; color: var(--green-dark); }
.demo-formula { display: flex; gap: .5rem; align-items: center; border: 1px solid var(--line); border-radius: 4px; padding: .3rem .5rem; margin-bottom: .5rem; font-family: ui-monospace, Menlo, monospace; font-size: .8rem; min-height: 30px; }
.demo-formula b { color: var(--gray); font-style: italic; }

@media (max-width: 520px) {
  .demo-window, .demo-stage.has-sheet .demo-window { height: 320px; }
  .demo-sheet table { font-size: .72rem; }
}

/* Quiz screen protection */
body.quiz-protected #app { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.quiz-protected #app .check { transition: filter .15s; }
body.quiz-veiled #app .check { filter: blur(9px); }
body.quiz-veiled #app::before { content: "Questions are hidden while this window isn't active. Click here to continue."; display: block; position: sticky; top: 1rem; z-index: 5; background: #2B2D2F; color: #fff; padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
#quiz-watermark { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; display: flex; flex-wrap: wrap; gap: 3rem 4rem; padding: 2rem; transform: rotate(-20deg) scale(1.4); opacity: .07; font-size: .85rem; color: var(--ink); }
.guard-notice { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: #2B2D2F; color: #fff; padding: .6rem 1rem; border-radius: 6px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 60; }
.guard-notice.show { opacity: 1; }
.flag-warn { color: var(--red); }
@media print { body.quiz-protected * { visibility: hidden !important; } }

/* Required practice panel */
.chat.required { border: 2px solid var(--orange); }
.ok-text { color: var(--green-dark); }

/* Welcome (signed-out) page */
.welcome { display: flex; justify-content: center; padding-top: 1.5rem; }
.welcome-card { max-width: 560px; text-align: center; padding: 2.25rem 2rem; border-top: 6px solid var(--orange); }
.welcome-logo { height: 56px; margin-bottom: 1rem; }
.welcome-card .lead { font-size: 1.1rem; color: var(--ink-soft); }
.welcome-list { text-align: left; margin: 1.25rem auto 1.5rem; max-width: 440px; padding-left: 1.2rem; }
.welcome-list li { margin-bottom: .45rem; }
.signin-btn { font-size: 1.02rem; padding: .75rem 1.25rem; margin-bottom: .75rem; justify-content: center; gap: .6rem; }
.signin-btn svg { flex-shrink: 0; }

/* ---------- Patient Access & Eligibility course ---------- */
.grow { flex: 1; min-width: 160px; }
.course-card { border-top: 4px solid var(--orange); }
.week { margin-bottom: 1.5rem; }
.week h2 { margin-bottom: .25rem; }
.day-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .9rem; margin: .9rem 0 1rem; }
.day-tile { display: flex; flex-direction: column; gap: .35rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .95rem 1rem; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; min-height: 170px; }
a.day-tile:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.day-tile.current { border: 2px solid var(--green); background: linear-gradient(160deg, var(--green-tint), #fff 60%); }
.day-tile.done { border-color: #A9D5BC; }
.day-tile.locked, .day-tile.soon { opacity: .6; background: var(--bg); }
.day-num { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; color: var(--orange); }
.day-title { font-weight: 700; line-height: 1.25; }
.day-foot { margin-top: auto; }
.day-state { font-size: .8rem; font-weight: 700; color: var(--ink-soft); }
.day-state.done { color: var(--green-dark); }
.day-state.current { color: var(--green-dark); }
.skill-dots { display: inline-flex; gap: 4px; }
.skill-dots i, .streak i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); display: inline-block; }
.skill-dots i.on { background: var(--green); }
.streak { display: inline-flex; gap: 5px; }
.streak i { width: 14px; height: 14px; border: 2px solid var(--gray-light); background: #fff; }
.streak i.on { background: var(--orange); border-color: var(--orange); }
.exam-card { border-left: 6px solid var(--orange); }
.exam-card h3 { margin: 0; }

.steps { list-style: none; display: flex; gap: .5rem; padding: 0; margin: .5rem 0 1.25rem; flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: .45rem; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .85rem .3rem .3rem; font-weight: 600; font-size: .9rem; color: var(--ink-soft); }
.steps li span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line); font-size: .8rem; }
.steps li.ok { color: var(--green-dark); border-color: #A9D5BC; background: var(--green-tint); }
.steps li.ok span { background: var(--green); color: #fff; border-color: var(--green); }
.done-banner { border: 2px solid var(--green); background: linear-gradient(120deg, var(--green-tint), #fff 70%); }
.locked-note { background: var(--bg); border: 1px dashed var(--gray-light); border-radius: var(--radius); padding: .9rem 1rem; margin: 0; }

/* Narrated video */
.vid-stage { position: relative; background: linear-gradient(135deg, #0B4F2C, #00843D 60%, #2E9A5C); border-radius: var(--radius); min-height: 360px; padding: 2rem 2.25rem; color: #fff; overflow: hidden; overflow: clip; }
.vid-stage::after { content: ""; position: absolute; right: -60px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%; border: 18px solid rgba(246,141,46,.55); }
.vid-scene { position: relative; z-index: 1; }
.vid-scene.in { animation: vid-in .45s ease-out; }
@keyframes vid-in { from { opacity: 0; transform: translateX(14px); } }
.vid-scene h2 { color: #fff; font-size: 1.6rem; margin: .3rem 0 1rem; }
.vid-scene ul { list-style: none; padding: 0; margin: 0; max-width: 680px; }
.vid-scene li { opacity: 0; transform: translateY(6px); transition: opacity .4s, transform .4s; background: rgba(255,255,255,.1); border-left: 4px solid var(--orange); border-radius: 6px; padding: .5rem .75rem; margin-bottom: .45rem; }
.vid-scene li.show { opacity: 1; transform: none; }
.vid-scene li strong { color: #FFE2C4; }
.vid-kicker { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; color: var(--orange); }
.vid-stage .vid-kicker { color: #FDBA74; }
.vid-cover { position: absolute; inset: 0; border: 0; background: rgba(11,79,44,.88); color: #fff; font: inherit; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; cursor: pointer; z-index: 3; }
.vid-cover:hover { background: rgba(11,79,44,.94); }
.vid-check { position: absolute; inset: 0; z-index: 4; background: rgba(11,79,44,.92); display: flex; align-items: safe center; justify-content: center; padding: 1rem; overflow-y: auto; }
.vid-check-box .option { padding: .45rem .7rem; margin-bottom: .35rem; }
.vid-check-box { background: #fff; color: var(--ink); border-radius: var(--radius); padding: 1.1rem 1.25rem; max-width: 560px; width: 100%; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: demo-pop .3s ease-out; }
.vid-end { text-align: center; padding-top: 2.5rem; position: relative; z-index: 1; }
.vid-end .big, .sort-done .big { font-size: 3rem; font-weight: 800; }
.transcript { margin-top: .5rem; }
.transcript summary { cursor: pointer; color: var(--green-dark); font-weight: 600; font-size: .9rem; }
.transcript h4 { margin: .8rem 0 .2rem; color: var(--green-dark); }

/* Activities */
.activity + .activity { border-top: 1px solid var(--line); margin-top: 1.25rem; padding-top: 1rem; }
.activity h3 { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.match { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: .75rem; margin: .5rem 0 .75rem; }
.match-col { display: flex; flex-direction: column; gap: .4rem; }
.match-item { text-align: left; font: inherit; font-size: .92rem; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: .5rem .7rem; cursor: pointer; color: var(--ink); transition: background .2s, border-color .2s; }
.match-item.term { font-weight: 700; }
.match-item:hover { border-color: var(--green); }
.match-item.picked { border-color: var(--orange); background: var(--orange-tint); box-shadow: 0 0 0 2px var(--orange) inset; }
.match-item.matched { border-color: #A9D5BC; background: var(--green-tint); color: var(--green-dark); cursor: default; }
.match-item.nope { border-color: var(--red); background: var(--red-tint); animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.sort-card { background: var(--bg); border: 1px solid var(--line); border-left: 5px solid var(--orange); border-radius: var(--radius); padding: 1rem 1.1rem; margin: .5rem 0 .8rem; font-size: 1.05rem; animation: vid-in .35s ease-out; }
.sort-card p { margin: .3rem 0 0; }
.sort-buckets { display: flex; flex-wrap: wrap; gap: .5rem; }
.sort-buckets .btn.right-btn { background: var(--green); color: #fff; }
.sort-buckets .btn.wrong-btn { border-color: var(--red); color: var(--red); background: var(--red-tint); }
.sort-done { text-align: center; padding: 1rem; }
.chat-log.mini { min-height: 140px; max-height: 380px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-top: .5rem; }
.coach-chat .chat-form { padding: .6rem 0 0; border: 0; }

/* Mastery */
.skill { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-top: .9rem; }
.skill-head { margin-bottom: .75rem; }
.case { border-top: 1px solid var(--line); padding-top: .75rem; }
.case > p:first-of-type { font-size: 1.02rem; }
.why-box { background: var(--red-tint); border: 1px solid #EBB3AC; border-radius: 8px; padding: .75rem .9rem; margin: .6rem 0; }
.why-box p { margin: .25rem 0; }
.mastered-pop { display: inline-block; margin-top: .6rem; background: var(--orange); color: #fff; font-weight: 800; padding: .35rem .8rem; border-radius: 999px; animation: demo-pop .3s ease-out; }
.rob-explain { margin-top: .75rem; }

/* Trainer view */
.heat { display: flex; gap: 6px; flex-wrap: wrap; }
.heat-day { display: inline-flex; gap: 2px; padding: 2px; border-radius: 4px; background: var(--bg); }
.heat i, i.key { width: 14px; height: 14px; border-radius: 3px; background: #fff; border: 1px solid var(--line); display: inline-block; vertical-align: middle; }
.m-ok { background: var(--green) !important; border-color: var(--green) !important; }
.m-hard { background: #7CC49A !important; border-color: #7CC49A !important; }
.m-work { background: #FDD9B5 !important; border-color: #F8C89A !important; }
.m-stuck { background: var(--red) !important; border-color: var(--red) !important; }
.bars { display: grid; gap: .45rem; }
.bar-row { display: grid; grid-template-columns: minmax(180px, 1.4fr) 2fr auto; gap: .75rem; align-items: center; font-size: .9rem; }
.bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--green); }
.bar > span.mid { background: var(--orange); }
.bar > span.low { background: var(--red); }

.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 10px); background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 6px; opacity: 0; transition: opacity .25s, transform .25s; z-index: 70; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation-name: confetti-fall; animation-timing-function: cubic-bezier(.2,.6,.4,1); animation-fill-mode: forwards; }
@keyframes confetti-fall { to { top: 105%; transform: rotate(720deg) translateX(40px); opacity: .7; } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } .vid-scene.in, .sort-card { animation: none; } }

@media (max-width: 640px) {
  .vid-stage { padding: 1.25rem; min-height: 420px; }
  .vid-scene h2 { font-size: 1.25rem; }
  .match { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 1fr; gap: .25rem; }
}

/* Forced lesson replay after a second miss */
.replay-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 1rem; background: rgba(17, 24, 39, .6); animation: fade-in .2s ease; }
.replay-box { width: min(720px, 100%); max-height: calc(100vh - 2rem); overflow-y: auto; background: var(--card); border-radius: var(--radius); border-top: 6px solid var(--orange); padding: 1.4rem 1.5rem; box-shadow: 0 20px 50px rgba(0,0,0,.3); text-align: center; animation: pop-in .25s ease; }
.replay-box h2 { margin: .2rem 0 .3rem; }
.replay-box .row { justify-content: center; margin-top: .6rem; }
.replay-icon { width: 52px; height: 52px; margin: 0 auto .3rem; border-radius: 50%; display: grid; place-items: center; background: var(--orange-tint); color: var(--orange); font-size: 1.7rem; font-weight: 800; }
.replay-stage { text-align: left; margin-top: .8rem; min-height: 0; }
.replay-progress { margin-top: .6rem; }
.replay-progress > span { transition: width .15s linear; }
.replay-note { margin: .5rem 0 0; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.replay-box .btn:disabled { opacity: .45; cursor: not-allowed; }

/* Third strike: Rob walkthrough + trainer flag */
.walkthrough { border: 1px solid var(--orange); background: var(--orange-tint); border-radius: var(--radius); padding: .9rem 1rem; margin-top: .6rem; }
.walkthrough > .row { align-items: flex-start; flex-wrap: nowrap; }
.walk-meter { margin: .6rem 0 .3rem; font-weight: 600; }
.walkthrough .rob-explain { background: var(--card); border-radius: 8px; padding: .5rem; }
.walk-next { margin-top: .6rem; }
.help-flag { margin-bottom: .35rem; }
.help-notice { margin-bottom: 1rem; }

/* Multi-part days */
.part .part-body > * + * { margin-top: 1rem; }
h3.sub { margin: 1.4rem 0 .5rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: 1.05rem; text-transform: uppercase; letter-spacing: .04em; color: var(--green-dark); }
.task { border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; margin-top: .8rem; }
.task.done { background: var(--green-tint); border-color: transparent; }
.task h3 { margin: 0 0 .3rem; font-size: 1.05rem; }
.task-form { display: flex; gap: .6rem; align-items: flex-end; margin-top: .5rem; }
.task-form textarea { flex: 1; font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 6px; }
.trainer-notes p { margin: .4rem 0; max-width: 28rem; }

/* Full-screen lesson video: the slide fills the screen, controls and captions stay below it. */
.vid:fullscreen, .vid:-webkit-full-screen { background: #0B2A19; padding: 1.5rem 2rem; display: flex; flex-direction: column; gap: .5rem; overflow: auto; }
.vid:fullscreen .vid-stage, .vid:-webkit-full-screen .vid-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; padding: clamp(1.25rem, 4vh, 3rem) clamp(1.25rem, 5vw, 4.5rem); }
.vid:fullscreen .vid-scene, .vid:-webkit-full-screen .vid-scene { margin: auto 0; }
.vid:fullscreen .vid-scene h2, .vid:-webkit-full-screen .vid-scene h2 { font-size: clamp(1.6rem, min(3.4vw, 5.5vh), 3.2rem); }
.vid:fullscreen .vid-scene ul, .vid:-webkit-full-screen .vid-scene ul { max-width: 1200px; font-size: clamp(1rem, min(1.9vw, 3.2vh), 1.8rem); }
.vid:fullscreen .vid-scene li, .vid:-webkit-full-screen .vid-scene li { padding: .7rem 1rem; margin-bottom: .6rem; }
.vid:fullscreen .vid-check-box, .vid:-webkit-full-screen .vid-check-box { font-size: 1.25rem; }
.vid:fullscreen .demo-controls, .vid:-webkit-full-screen .demo-controls { color: #fff; }
.vid:fullscreen .demo-controls .muted, .vid:-webkit-full-screen .demo-controls .muted { color: #cfe3d6; }
.vid:fullscreen .btn.ghost, .vid:-webkit-full-screen .btn.ghost { color: #fff; border-color: rgba(255,255,255,.5); }
.vid:fullscreen .vid-caption, .vid:-webkit-full-screen .vid-caption { color: #fff; font-size: clamp(1rem, 1.6vw, 1.5rem); background: rgba(0,0,0,.35); margin: 0; }
.vid:fullscreen .transcript, .vid:-webkit-full-screen .transcript { display: none; }

/* Presenter mode */
.live-banner { display: flex; gap: .75rem; align-items: center; border-left: 5px solid var(--orange); }
.live-dot { width: .7rem; height: .7rem; border-radius: 50%; background: #E5484D; box-shadow: 0 0 0 4px rgba(229,72,77,.2); flex: none; animation: live-pulse 1.6s infinite; }
@keyframes live-pulse { 50% { box-shadow: 0 0 0 8px rgba(229,72,77,.05); } }
.presented-note { background: var(--bg); border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: 1rem; }
.attendee-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .35rem .75rem; max-height: 260px; overflow: auto; padding: .5rem; border: 1px solid var(--line, #DDE3DF); border-radius: var(--radius); }
.present-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 1rem; }
.present-tabs button { border-radius: 999px; }
.present-tabs .played { background: #E5F4E4; }
.cell-dot { display: inline-block; min-width: 2.2rem; text-align: center; border-radius: 6px; padding: .1rem .35rem; font-size: .85rem; background: #F0EFEC; }
.cell-dot.done { background: #E5F4E4; color: #006B31; font-weight: 700; }
.cell-dot.open { background: #F9EEDA; }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.start-day { display: block; margin-top: .3rem; } .start-day select { font-size: .8rem; padding: .1rem .3rem; }
.vid-speed select { font-size: .8rem; padding: .1rem .3rem; }
.start-day input[type=checkbox] { width: auto; margin: 0 .25rem 0 0; vertical-align: middle; }

/* ---------- course extras ---------- */
.chip.review { background: #FFF4E5; color: #9A4B00; }
.heat i.m-review { background: #fff; outline: 2px solid var(--orange, #F68D2E); outline-offset: -2px; }
.key.m-review { background: #fff; outline: 2px solid var(--orange, #F68D2E); outline-offset: -2px; }
.req-list { list-style: none; padding: 0; margin: .5rem 0; }
.req-list li { padding: .2rem 0; color: #555; }
.req-list li.ok { color: var(--green-dark, #006B31); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .15rem; padding: .8rem .5rem; border-radius: 12px; background: #f4f5f5; opacity: .65; }
.badge.earned { background: var(--green-tint, #E6F4EC); opacity: 1; }
.badge-icon { font-size: 1.8rem; }
.badge-row span { font-size: 1.1rem; }
.call-log { max-height: 420px; overflow-y: auto; }
.call-face { font-size: 1.6rem; line-height: 1; flex: none; }
.call-fb { margin: -.2rem 0 .6rem auto; max-width: 85%; padding: .35rem .6rem; border-radius: 8px; }
.call-fb.ok { background: var(--green-tint, #E6F4EC); color: var(--green-dark, #006B31); }
.call-fb.bad { background: #FDECEC; color: #9B1C1C; }
.call-end { padding: .7rem .9rem; border-radius: 10px; margin: .6rem 0; }
.call-end.ok { background: var(--green-tint, #E6F4EC); }
.call-end.bad { background: #FFF4E5; }
.mock-log { min-height: 160px; max-height: 460px; overflow-y: auto; margin: .8rem 0; }
.mock-attempt { border-top: 1px solid #eee; padding: .6rem 0; }
.mock-attempt summary { cursor: pointer; }
.transcript-box { background: #f7f7f7; border-radius: 8px; padding: .5rem .8rem; max-height: 320px; overflow-y: auto; }
.clarity { gap: .35rem; margin: .4rem 0 .6rem; }
.quiz-panel:not(:empty) { margin-top: 1rem; padding: 1rem; border: 2px solid var(--green, #00843D); border-radius: 12px; }
.quiz-q { margin-bottom: .8rem; }
.option.selected { outline: 3px solid var(--green, #00843D); }
.linkish { background: none; border: 0; padding: 0; color: var(--green-dark, #006B31); text-decoration: underline; cursor: pointer; font: inherit; }
.say-this { width: 100%; }
.say-this td:first-child { color: #9B1C1C; }
.say-this td:last-child { color: var(--green-dark, #006B31); }
.ref-card ul { margin: .3rem 0 .8rem; }
@media print {
  .no-print, header, nav, .site-header { display: none !important; }
  .ref-card, .card { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
}

/* trainer afternoon guide */
.trainer-guide h3 { margin: 1rem 0 .3rem; }
.trainer-guide h4 { margin: .6rem 0 .2rem; }
.guide-block { border-top: 1px solid var(--line); padding-top: .6rem; margin-top: .8rem; }
.guide-say { background: var(--green-tint); border-radius: 8px; padding: .3rem .8rem; }
.guide-say p { margin: .3rem 0; }
.guide-q { margin: .25rem 0; }
.guide-q summary { cursor: pointer; }
.guide-q p { margin: .3rem 0 .3rem 1.2rem; color: var(--green-dark); }
.guide-room { background: var(--green-tint); border-radius: 8px; padding: .3rem .9rem .6rem; margin: .6rem 0; }

/* Dashboard: what a learner still has to do in their current part */
.stuck-box { margin-top: .4rem; }
.stuck-box summary { cursor: pointer; font-weight: 600; }
.stuck-box ul { margin: .3rem 0 0 1rem; padding: 0; }
.stuck-box li { margin-bottom: .2rem; }
