/* PTA Study Lab — page layouts + the design lead's section renderers (OWNER: design lead).
 * (Learning-engine sections — flashcards, quiz, checklist, cases, sequence — live in css/learn.css.)
 */

/* ── Shared page bits ─────────────────────────────────────────────────── */
/* Crumb links get a 44 px tall hit area; negative margins keep the visual spacing unchanged. */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; font-size: .88rem; color: var(--text-muted); margin: -11px 0 calc(var(--space-4) - 11px); }
.crumbs a { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--text-muted); text-decoration: none; font-weight: 600; }
.crumbs a:hover { color: var(--primary); text-decoration: underline; }
.crumbs span[aria-hidden] { opacity: .5; }
.meta-row { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.h-small { font-size: var(--step-2); margin-bottom: var(--space-4); }
.page-head { margin-bottom: var(--space-6); }
.page-head h1 { margin-bottom: var(--space-2); }

.prose > :last-child { margin-bottom: 0; }
.prose p, .prose ul, .prose ol { max-width: var(--measure); }
.prose b, .prose strong {
  font-weight: 750;
  background: linear-gradient(transparent 62%, color-mix(in srgb, var(--accent) 22%, transparent) 62%);
  padding: 0 .08em; border-radius: 2px;
}
.prose ul { padding-left: 1.2em; }
.prose li { padding-left: .15em; }
.prose .num, .prose .val { font-family: var(--font-mono); font-weight: 650; }
.section-intro { margin-bottom: var(--space-5); font-size: var(--step-0); }
/* Phones, second visit on: the intro folds into one line so the picture and the words fit together. */
details.section-intro-fold { margin: calc(-1 * var(--space-2)) 0 var(--space-4); border: 0 !important; }
details.section-intro-fold > summary { min-height: var(--tap); font-size: .95rem; color: var(--text-muted); justify-content: flex-start; gap: var(--space-2); }
details.section-intro-fold > summary::before { content: 'i'; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid currentColor; font: 800 .72rem/1 var(--font-body); }
details.section-intro-fold > .section-intro { margin-bottom: var(--space-3); padding: 0; }

/* ── Home ─────────────────────────────────────────────────────────────── */
.home-hero { margin: var(--space-2) 0 var(--space-5); }
.home-hero h1 { font-size: var(--step-5); font-weight: 600; letter-spacing: -0.025em; margin-bottom: var(--space-2); }
.hero-dot { color: var(--accent); }
.home-hero .lede { margin: 0; }

/* Pinned exam card (home): her next exam, its modules, and the two fastest ways to drill it. Hides itself after exam day. */
.home-hero.has-exam { margin-bottom: var(--space-4); }
.exam-card {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; gap: var(--space-4);
  margin: 0 0 var(--space-5); padding: var(--space-5) var(--space-4) var(--space-4);
  border-radius: var(--radius-lg); background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border));
  box-shadow: 0 18px 40px -26px color-mix(in srgb, var(--accent) 60%, black);
}
.exam-card::before {  /* coral wash in the corner, behind the countdown */
  content: ''; position: absolute; inset: 0 0 auto auto; width: 70%; height: 150px; z-index: -1;
  background: radial-gradient(120% 100% at 100% 0%, var(--accent-soft) 0%, transparent 70%);
}
.ex-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-3); align-items: start; }
.ex-kicker { display: flex; align-items: center; gap: 6px; margin: 0 0 2px; color: var(--accent-text); font-size: .78rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.ex-title { margin: 0; font-size: var(--step-3); font-weight: 600; letter-spacing: -0.015em; line-height: 1.1; }
.ex-topics { margin: var(--space-2) 0 0; font-size: .92rem; line-height: 1.45; color: var(--text-muted); max-width: 52ch; }
.ex-when {
  display: grid; justify-items: center; align-content: center; min-width: 76px; padding: var(--space-2) var(--space-3);
  border-radius: 18px; background: var(--accent); color: var(--accent-contrast); text-align: center;
  box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--accent) 80%, black);
}
.ex-when b { font-family: var(--font-display); font-size: 2.2rem; font-weight: 600; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: lining-nums; }
.ex-when span { font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.ex-when.is-today b { font-size: 1.5rem; }
.ex-overall { display: grid; gap: 6px; }
.ex-bar { height: 8px; }
.ex-bar > span { background: var(--accent); }
.ex-overall-label { font-size: .84rem; font-weight: 650; color: var(--text-muted); }
.ex-actions { display: grid; gap: var(--space-2); }
.ex-resume { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--primary-soft); color: var(--text); text-decoration: none; }
.ex-resume:hover { text-decoration: none; } .ex-resume:hover b { color: var(--primary); }
.ex-resume-text { display: flex; flex-direction: column; min-width: 0; }
.ex-resume-text small { font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--primary-strong); }
.ex-resume-text b { font-weight: 750; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ex-resume-go { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: var(--primary-contrast); }
.ex-when.is-today { max-width: 104px; }
.ex-when.is-today span { white-space: normal; line-height: 1.2; margin-top: 2px; }
.ex-btn { justify-content: flex-start; gap: var(--space-3); min-height: 60px; padding: var(--space-2) var(--space-4); text-align: left; border-radius: var(--radius); }
.ex-btn-icon { display: grid; place-items: center; flex: none; }
.ex-btn-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.ex-btn-text b { font-size: 1rem; }
.ex-btn-text small { font-size: .82rem; font-weight: 600; opacity: .85; }
.ex-mods { list-style: none; margin: 0; padding: 0; max-width: none; display: grid; border-top: 1px solid var(--border); }
.ex-mods li { margin: 0; border-bottom: 1px solid var(--border); }
.ex-mod { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); min-height: 58px; padding: var(--space-2) 0; color: var(--text); text-decoration: none; }
.ex-mod:hover { text-decoration: none; } .ex-mod:hover .ex-mod-title { color: var(--primary); }
.ex-ring { position: relative; display: grid; place-items: center; width: 38px; height: 38px; }
.ex-ring .ring { position: absolute; inset: 0; }
.ex-ring-n { font-size: .7rem; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.ex-done { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--success); color: #fff; }
.ex-mod-text { display: flex; flex-direction: column; min-width: 0; }
.ex-mod-title { font-weight: 750; line-height: 1.25; transition: color var(--dur-fast) var(--ease); }
.ex-mod-sub { font-size: .82rem; color: var(--text-muted); line-height: 1.3; }
.ex-mod-go { color: var(--text-muted); }
.ex-plan { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap); font-weight: 700; font-size: .92rem; }
.ex-plan .icon:first-child { color: var(--accent-text); }
@media (min-width: 720px) {
  .exam-card { padding: var(--space-6) var(--space-6) var(--space-5); }
  .ex-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ex-mods { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-6); border-top: 0; }
  .ex-mods li:nth-child(-n+2) { border-top: 1px solid var(--border); }
  .ex-when { min-width: 96px; padding: var(--space-3) var(--space-4); }
  .ex-when b { font-size: 2.8rem; }
}
@media (min-width: 960px) { .exam-card { max-width: var(--content-max); } }

.today { display: grid; gap: var(--space-3); margin-bottom: var(--space-7); }
.today.is-fresh { grid-template-columns: minmax(0, 720px) !important; }
.continue {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--space-4);
  padding: var(--space-5) var(--space-4) var(--space-5) var(--space-5);
  border-radius: var(--radius-lg); text-decoration: none;
  background: var(--primary); color: var(--primary-contrast);
  box-shadow: 0 18px 40px -22px color-mix(in srgb, var(--primary) 85%, black);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.continue::after {  /* faint ECG trace motif */
  content: ''; position: absolute; inset: auto -10% -6px auto; width: 70%; height: 70%; z-index: -1; opacity: .13;
  background: no-repeat right bottom / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 90'%3E%3Cpath d='M0 60h70l12-30 18 52 16-70 14 48h40l10-14 10 14h110' fill='none' stroke='white' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.continue:hover { text-decoration: none; transform: translateY(-2px); }
.continue:active { transform: scale(.99); }
.continue-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: color-mix(in srgb, var(--primary-contrast) 16%, transparent); }
.continue-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.continue-kicker { font-size: .76rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; opacity: .85; }
.continue-title { font-family: var(--font-display); font-size: var(--step-2); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
.continue-sub { font-size: .92rem; opacity: .9; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.continue-bar { margin-top: var(--space-2); height: 6px; background: color-mix(in srgb, var(--primary-contrast) 22%, transparent); max-width: 280px; }
.continue-bar > span { background: var(--primary-contrast); }
.continue-go { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--primary-contrast); color: var(--primary); }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
.stat {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
  padding: var(--space-3) var(--space-3) var(--space-3); border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
a.stat:hover { border-color: var(--primary); text-decoration: none; }
a.stat:active { transform: scale(.98); }
.stat-icon { color: var(--text-muted); height: 34px; display: flex; align-items: center; margin-bottom: 2px; }
.stat.is-accent .stat-icon { color: var(--accent); }
.stat.is-flame .stat-icon { color: var(--accent); }
.stat-value { font-family: var(--font-display); font-size: var(--step-3); font-weight: 600; line-height: 1; letter-spacing: -0.02em; }
.stat-label { font-size: .82rem; color: var(--text-muted); font-weight: 600; line-height: 1.2; }
.stat-cta { margin-top: auto; padding-top: var(--space-2); font-size: .78rem; font-weight: 800; color: var(--primary); }
div.stat .stat-cta { color: var(--text-muted); font-weight: 650; }
.stat.is-accent .stat-cta { color: var(--accent); }

.course-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2) var(--space-4); margin-bottom: var(--space-2); }
.course-head h2 { margin: 0; }
.course-head p { margin: 0; font-size: .92rem; }
.hands-inline { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-text); font-weight: 650; }
/* Units: an accordion (details/summary) — the current unit opens by default. */
.unit-block { margin-top: var(--space-4); border-top: 1px solid var(--border); padding-top: var(--space-3); }
.unit-block > summary { list-style: none; cursor: pointer; }
.unit-block > summary::-webkit-details-marker { display: none; }
.unit-block .unit-go { transition: transform var(--dur) var(--ease); align-self: center; }
.unit-block[open] .unit-go { transform: rotate(180deg); }
.unit-block[open] > .unit-head { margin-bottom: var(--space-3); }
.unit-block:not([open]) > .unit-head { margin-bottom: 0; }
.unit-summary { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.unit-link { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); margin-top: var(--space-2); font-weight: 700; font-size: .92rem; }
.module-card.is-soon { background: transparent; border-style: dashed; }
.module-card.is-soon .mc-icon { background: var(--surface-2); color: var(--text-muted); }
.chip-soon { background: var(--surface-2); color: var(--text-muted); font-weight: 750; }
.chip-theory { background: var(--info-soft); color: var(--info); }
:root[data-theme="dark"] .chip-theory { color: var(--text); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip-theory { color: var(--text); } }
/* Device banner (install / backup) and the first-day plan */
.device-banner { display: grid; grid-template-columns: auto 1fr; gap: var(--space-3); padding: var(--space-4); margin-bottom: var(--space-4); border-radius: var(--radius-lg); background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); }
.db-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface); color: var(--primary); }
.db-text b { display: block; margin-bottom: 2px; }
.db-text p { margin: 0 0 var(--space-3); font-size: .93rem; line-height: 1.45; max-width: 60ch; }
.db-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.plan { padding: var(--space-4); }
.plan-title { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-2); font-family: var(--font-body); font-size: var(--step-0); font-weight: 800; }
.plan-title .icon { color: var(--primary); }
.plan-list { list-style: none; margin: 0; padding: 0; display: grid; max-width: none; }
.plan-list li { margin: 0; border-top: 1px solid var(--border); }
.plan-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--space-3); min-height: 60px; padding: var(--space-2) 0; color: var(--text); text-decoration: none; }
.plan-row:hover { text-decoration: none; } .plan-row:hover b { color: var(--primary); }
.plan-n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--primary); color: var(--primary); font-weight: 800; font-size: .9rem; }
.plan-text { display: flex; flex-direction: column; min-width: 0; }
.plan-text span { font-size: .86rem; color: var(--text-muted); }
.plan-go { color: var(--text-muted); }
.unit-head {
  display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: var(--space-3);
  color: var(--text); text-decoration: none; margin-bottom: var(--space-3); padding: var(--space-1) 0;
}
.unit-head:hover { text-decoration: none; }
.unit-head:hover h3 { color: var(--primary); }
.unit-num { font-family: var(--font-display); font-size: var(--step-4); font-weight: 400; color: var(--accent-text); line-height: 1; letter-spacing: -0.03em; min-width: 1.4em; font-variant-numeric: lining-nums; }
.unit-text { display: flex; flex-direction: column; min-width: 0; }
.unit-text h3 { margin: 0; font-size: var(--step-2); transition: color var(--dur-fast) var(--ease); }
.unit-summary { color: var(--text-muted); font-size: .9rem; line-height: 1.35; margin-top: 2px; }
.unit-go { color: var(--text-muted); }

.module-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); max-width: none; }
.module-grid > li { margin: 0; }
.module-card {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--space-3) var(--space-4);
  height: 100%; padding: var(--space-4); border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.module-card:hover { text-decoration: none; border-color: color-mix(in srgb, var(--primary) 55%, var(--border)); box-shadow: var(--shadow); }
.module-card:active { transform: scale(.99); }
.mc-icon { align-self: start; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); }
.module-card.is-complete .mc-icon { background: var(--success-soft); color: var(--success); }
.mc-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mc-title { font-weight: 750; font-size: 1.04rem; line-height: 1.25; }
.mc-summary { font-size: .9rem; color: var(--text-muted); line-height: 1.38; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--space-3); margin-top: 4px; }
.mc-min { display: inline-flex; align-items: center; gap: 4px; font-size: .82rem; font-weight: 650; color: var(--text-muted); }
.mc-progress { align-self: center; }
.mc-ring { position: relative; display: grid; place-items: center; }
.mc-ring-n { position: absolute; font-size: .68rem; font-weight: 800; color: var(--primary); }
.mc-done { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--success); color: #fff; }

@media (min-width: 720px) {
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .today { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: stretch; }
  .continue { padding: var(--space-6); }
}
@media (min-width: 1640px) { .module-grid:not(.is-unit) { grid-template-columns: repeat(3, minmax(0, 1fr)); } .module-grid:not(.is-unit) .module-card { grid-template-columns: auto 1fr; } .module-grid:not(.is-unit) .mc-progress { grid-column: 2; grid-row: 2; justify-self: start; } }
@media (min-width: 960px) {
  .home-hero { margin-top: 0; }
}

/* Dark: a deep teal card instead of a bright slab */
:root[data-theme="dark"] .continue { background: color-mix(in srgb, var(--primary) 26%, var(--surface)); color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 40%, transparent); }
:root[data-theme="dark"] .continue-go { background: var(--primary); color: var(--primary-contrast); }
:root[data-theme="dark"] .continue-icon { background: color-mix(in srgb, var(--primary) 25%, transparent); color: var(--primary); }
:root[data-theme="dark"] .continue-bar > span { background: var(--primary); }
:root[data-theme="dark"] .continue::after { filter: invert(1) hue-rotate(180deg); opacity: .08; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .continue { background: color-mix(in srgb, var(--primary) 26%, var(--surface)); color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 40%, transparent); }
  :root:not([data-theme="light"]) .continue-go { background: var(--primary); color: var(--primary-contrast); }
  :root:not([data-theme="light"]) .continue-icon { background: color-mix(in srgb, var(--primary) 25%, transparent); color: var(--primary); }
  :root:not([data-theme="light"]) .continue-bar > span { background: var(--primary); }
}

/* ── Unit ─────────────────────────────────────────────────────────────── */
.unit-hero { display: grid; grid-template-columns: auto 1fr; gap: var(--space-4); align-items: start; margin-bottom: var(--space-6); }
.unit-hero-num { font-family: var(--font-display); font-size: clamp(3.5rem, 2.6rem + 4vw, 6rem); line-height: .85; color: var(--accent); font-weight: 350; letter-spacing: -0.04em; }
.unit-hero h1 { margin-bottom: var(--space-2); }
.chip-progress .ring { width: 18px; height: 18px; }

/* ── Module overview ──────────────────────────────────────────────────── */
.module-hero { display: grid; grid-template-columns: auto 1fr; gap: var(--space-4); align-items: start; margin-bottom: var(--space-5); }
.mh-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: var(--primary-soft); color: var(--primary); margin-top: 4px; }
.module-hero h1 { margin-bottom: var(--space-2); }
.module-hero .lede { margin-bottom: 0; }
@media (max-width: 599px) {
  .module-hero { grid-template-columns: 1fr; gap: var(--space-3); }
  .mh-icon { width: 52px; height: 52px; border-radius: 16px; }
}
.module-cta {
  display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border);
  margin-bottom: var(--space-6);
}
.module-cta .btn { width: 100%; }
.module-cta .btn span { overflow: hidden; text-overflow: ellipsis; }
.mc-progress-line { display: flex; align-items: center; gap: var(--space-3); }
.mc-progress-line .bar { flex: 1; }
.mc-progress-line .muted { font-size: .88rem; font-weight: 650; white-space: nowrap; }
@media (min-width: 720px) {
  .module-cta { flex-direction: row; align-items: center; justify-content: space-between; padding: var(--space-4) var(--space-4) var(--space-4) var(--space-5); }
  .module-cta .btn { width: auto; max-width: 60%; }
  .mc-progress-line { flex: 1; max-width: 360px; }
  .module-cta .module-cram { order: 1; margin-left: auto; }   /* the primary CTA stays rightmost */
  .module-cta > .btn-primary { order: 2; }
}
.module-cols { display: grid; gap: var(--space-6); }
@media (min-width: 1100px) { .module-cols { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: var(--space-7); align-items: start; } .objectives { position: sticky; top: var(--space-5); } }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-3); }
.check-list li { display: grid; grid-template-columns: auto 1fr; gap: var(--space-3); margin: 0; line-height: 1.45; }
.check-list .icon { color: var(--success); margin-top: 3px; }

.path { list-style: none; margin: 0; padding: 0; max-width: none; position: relative; }
.path-item { position: relative; margin: 0; }
.path-item:not(:last-child)::before {
  content: ''; position: absolute; left: 27px; top: 44px; bottom: -8px; width: 2px; background: var(--border);
}
.path-item.is-done:not(:last-child)::before { background: color-mix(in srgb, var(--success) 55%, var(--border)); }
.path-link {
  position: relative; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: var(--space-3);
  min-height: 64px; padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3); margin-bottom: var(--space-1);
  border-radius: var(--radius); color: var(--text); text-decoration: none;
  transition: background var(--dur-fast) var(--ease);
}
.path-link:hover { background: var(--surface); text-decoration: none; }
.path-dot {
  z-index: 1; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--border-strong); color: var(--text-muted); font-weight: 800; font-size: .85rem;
}
.is-done .path-dot { background: var(--success); border-color: var(--success); color: #fff; }
.is-next .path-dot { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.path-text { display: flex; flex-direction: column; min-width: 0; }
.path-type { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); }
.path-title { font-weight: 650; line-height: 1.3; }
.is-done .path-title { color: var(--text-muted); }
.path-next { font-size: .75rem; font-weight: 800; padding: 3px 9px; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent-text); }
.path-go { color: var(--text-muted); }
.module-sources { margin-top: var(--space-7); }
.module-sources ul { font-size: .9rem; }

.page-soon .lede { margin-inline: auto; text-align: center; }

/* ── Section page ─────────────────────────────────────────────────────── */
.section-head { margin-bottom: var(--space-5); }
.section-head .crumbs { margin-bottom: calc(var(--space-3) - 11px); }
@media (max-width: 959px) { .section-head .crumbs, .page-module > .crumbs, .page-unit > .crumbs { display: none; } }   /* phones: the top bar's back link is the breadcrumb */
.section-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-2); }
.section-type { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); }
.section-count { font-size: .84rem; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.section-head .segbar { margin-bottom: var(--space-4); height: 3px; gap: 2px; }   /* section progress = a hairline, so it never reads as the step player's segments */
.section-head h1 { font-size: var(--step-4); margin: 0; }
.section-foot { margin-top: var(--space-7); padding-top: var(--space-5); border-top: 1px solid var(--border); }
.section-done-row { display: flex; justify-content: center; margin-bottom: var(--space-5); }
.is-done-state { color: var(--success) !important; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.pager-link {
  display: flex; flex-direction: column; gap: 4px; min-width: 0; min-height: 76px; justify-content: center;
  padding: var(--space-3) var(--space-4); border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease);
}
.pager-link:hover { border-color: var(--primary); text-decoration: none; }
.pager-link.is-next { text-align: right; align-items: flex-end; background: var(--primary-soft); border-color: transparent; }
.pager-link.is-next:hover { border-color: var(--primary); }
.pager-dir { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); }
.pager-title { font-weight: 650; font-size: .95rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── intro ────────────────────────────────────────────────────────────── */
.intro-body { font-size: var(--step-0); }
.intro-body > p:first-child { font-size: var(--step-1); line-height: 1.5; color: var(--text); }
.intro-visual { margin-bottom: var(--space-5); border-radius: var(--radius-lg); overflow: hidden; background: var(--ill-bg); }
.intro-visual figcaption { padding: 0 var(--space-4) var(--space-3); }   /* overflow:hidden + rounded corner clipped its first letter */
.keypoints { margin-top: var(--space-6); }
.keypoints-title { display: flex; align-items: center; gap: var(--space-2); font-size: var(--step-2); }
.keypoints-title .icon { color: var(--accent); }
.keypoints-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); max-width: none; }
.keypoints-list li {
  display: grid; grid-template-columns: auto 1fr; gap: var(--space-3); align-items: start; margin: 0;
  padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
}
.kp-num { font-family: var(--font-display); font-size: 1.6rem; line-height: 1; color: var(--accent); font-weight: 500; min-width: 1ch; }
.kp-text { font-weight: 600; line-height: 1.45; padding-top: 3px; }

/* ── steps (the step player) ──────────────────────────────────────────── */
.sp { position: relative; }
.sp-stage {
  position: relative; aspect-ratio: 4 / 3; width: 100%;
  border-radius: var(--radius-lg); overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--surface) 70%, transparent), transparent 70%),
    var(--ill-bg);
  border: 1px solid var(--border);
  touch-action: pan-y;
  box-shadow: inset 0 -30px 60px -50px rgba(0,0,0,.25);
  transition: box-shadow var(--dur) var(--ease);
}
.sp-stage-inner { position: absolute; inset: 0; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; padding: var(--space-3); container-type: size; }
/* A visual with hotspots shrinks to the picture's own box (so % markers stay on target) and centres in the stage. */
.sp-visual.has-hotspots { display: grid; place-items: center; }
.sp-visual.has-hotspots .visual-stage { width: min(100cqw, 100cqh * var(--ar, 1.3333)); height: auto; }   /* definite track → visuals' 100% height resolves */
.sp-visual, .sp-visual .visual-stage { width: 100%; height: 100%; }
/* QA: `.visual.is-svg … > svg { height: auto }` (components.css) out-ranked this, so visuals that aren't 4:3
   (figure-library figures, parts) sat at the top of the stage. Fill the stage; preserveAspectRatio centres them. */
.sp-visual .visual-stage > svg, .sp-visual .visual-stage > img,
.sp-visual.is-svg .visual-stage > svg, .sp-visual.is-img .visual-stage > img { width: 100%; height: 100%; object-fit: contain; }
.sp-visual.is-html .visual-stage { display: grid; place-items: center; }
.sp-caption { position: absolute; left: var(--space-3); right: var(--space-3); bottom: var(--space-2); margin: 0; font-size: .8rem; color: var(--text-muted); text-align: center; }
.sp-badge {
  position: absolute; top: var(--space-3); left: var(--space-3); z-index: 2;
  display: inline-flex; align-items: baseline; gap: 4px;
  padding: 4px 10px; border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border); font-size: .8rem; font-weight: 700; color: var(--text-muted);
}
.sp-badge b { color: var(--text); font-size: .95rem; }
/* The text column's kicker already says "Step x of y": the badge only appears during "Walk me through it" (live dot),
   so it no longer covers the top-left of every picture on desktop (module QA). */
.sp:not(.is-auto) .sp-badge { display: none; }
/* Animation controls (pause/play · replay · ½×) — top-right of the stage. */
.sp-mc {
  position: absolute; top: var(--space-2); right: var(--space-2); z-index: 3;
  display: flex; gap: 2px; padding: 2px; border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.sp-mc[hidden] { display: none; }
.sp-mc-btn { display: grid; place-items: center; width: var(--tap); height: 40px; border-radius: var(--radius-pill); color: var(--text); font: 800 .9rem/1 var(--font-body); }
.sp-mc-btn:hover { background: var(--surface-2); }
.sp-mc-btn[aria-pressed="true"] { background: var(--primary); color: var(--primary-contrast); }
.sp-mc.is-held .sp-mc-btn:first-child { background: var(--primary-soft); color: var(--primary-strong); }
@media (pointer: coarse) { .sp-mc-btn { height: var(--tap); } }
.sp.is-auto .sp-stage { box-shadow: 0 0 0 3px var(--primary), inset 0 -30px 60px -50px rgba(0,0,0,.25); }
.sp.is-auto .sp-badge::before { content: ''; align-self: center; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 2px; animation: live 1.2s var(--ease-in-out) infinite alternate; }
@keyframes live { from { opacity: .3; } to { opacity: 1; } }
.sp-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: var(--space-5); gap: var(--space-2); }
.sp-ph-num { font-family: var(--font-display); font-size: clamp(5rem, 4rem + 6vw, 8.5rem); line-height: .9; font-weight: 300; color: color-mix(in srgb, var(--accent) 60%, var(--ill-bg)); letter-spacing: -0.04em; }
.sp-ph-title { font-family: var(--font-display); font-size: var(--step-2); max-width: 18ch; color: var(--text-muted); line-height: 1.2; }

.sp-text { padding-top: var(--space-5); }
.sp-kicker { font-size: .76rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--primary); margin: 0 0 var(--space-1); }
.sp-title { font-size: var(--step-3); margin-bottom: var(--space-3); }
.sp-do { font-size: var(--step-1); line-height: 1.5; font-weight: 450; margin-bottom: var(--space-4); max-width: 60ch; }
.sp-do > :last-child { margin-bottom: 0; }
.sp-do b, .sp-do strong { font-weight: 750; background: linear-gradient(transparent 62%, color-mix(in srgb, var(--accent) 24%, transparent) 62%); }
.sp-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.sp-walk.is-on { --btn-bg: var(--primary); --btn-fg: var(--primary-contrast); --btn-bd: var(--primary); }
.sp-notes { display: grid; gap: var(--space-2); }
.sp-notes .note { padding: var(--space-3) var(--space-4) var(--space-3) var(--space-3); gap: 2px var(--space-3); font-size: .98rem; line-height: 1.5; }
.sp-notes .note > .note-icon { padding-top: 1px; }
.sp-notes .note-safety { padding-left: calc(var(--space-3) + 6px); font-weight: 550; }
.note-feel { --note: var(--primary); --note-bg: var(--primary-soft); }
.note-why { --note: var(--info); --note-bg: var(--info-soft); }
.note-mistake { --note: var(--warning); --note-bg: var(--warning-soft); }
.sp-notes .note:not(.note-safety) { background: var(--surface); border-color: var(--border); box-shadow: inset 3px 0 0 var(--note); }

.sp-nav {
  position: sticky; bottom: 0; z-index: 6;
  display: flex; align-items: center; gap: var(--space-3);
  margin: var(--space-5) calc(-1 * var(--space-4)) 0; padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -10px 24px -18px rgba(0,0,0,.35);
}
.sp-segs { flex: 1; display: flex; gap: 3px; min-width: 0; }
.sp-seg { flex: 1; min-width: 0; height: var(--tap); display: flex; align-items: center; padding: 0 1px; }
.sp-seg > span { display: block; width: 100%; height: 6px; border-radius: 3px; background: var(--ui-line); transition: background var(--dur) var(--ease), height var(--dur) var(--ease); }
.sp-seg.is-seen > span { background: color-mix(in srgb, var(--primary) 55%, var(--ui-line)); }
.sp-seg.is-current > span { background: var(--primary); height: 10px; }
.sp-seg:hover > span { background: color-mix(in srgb, var(--primary) 70%, transparent); }
.sp-next { min-width: 118px; padding: 0 var(--space-4); }
.sp-prev[disabled] { opacity: .3; }

.sp-practice {
  display: flex; flex-direction: column; gap: var(--space-3);
  margin-top: var(--space-6); padding: var(--space-5); border-radius: var(--radius-lg);
  background: var(--surface); border: 1px dashed var(--border-strong);
}
.sp-practice-title { font-family: var(--font-display); font-size: var(--step-2); font-weight: 600; margin: 0; line-height: 1.2; }
.sp-practice .muted { margin: 4px 0 0; font-size: .95rem; }
.sp-practice-btn { align-self: stretch; }
.sp-practice-panel { margin-top: var(--space-4); padding: var(--space-4); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); scroll-margin-top: calc(var(--topbar-h) + 12px); }
.sp-practice-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-3); }
.sp-practice-head h3 { margin: 0; font-size: var(--step-2); }
@media (min-width: 720px) {
  .sp-practice { flex-direction: row; align-items: center; justify-content: space-between; }
  .sp-practice-btn { align-self: center; }
}
/* Phones: cap the stage so kicker, title, instruction and picture fit one screen; the kicker already says
   "Step x of y", so the stage badge is dropped (one progress indicator, not four). */
@media (max-width: 959px) {
  .sp-stage { aspect-ratio: auto; height: min(42svh, calc((100vw - 2 * var(--space-4)) * .75)); min-height: 190px; }
  .sp-badge { display: none; }
  .sp-text { padding-top: var(--space-4); }
  .sp-title { font-size: var(--step-2); margin-bottom: var(--space-2); }
  .sp-do { margin-bottom: var(--space-3); }
  .sp-actions { margin-bottom: var(--space-3); }
  .sp-actions .btn { min-height: var(--tap); padding-inline: var(--space-3); font-size: .95rem; }
  .sp-notes .note { padding: var(--space-2) var(--space-3); font-size: .96rem; }
}
@media (min-width: 960px) {
  .sp { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); grid-template-areas: "stage text" "nav text"; column-gap: var(--space-6); align-items: start; }
  .sp-stage-col { grid-area: stage; position: sticky; top: var(--space-5); }
  .sp-nav { grid-area: nav; position: sticky; top: calc(var(--space-5) + 10px); margin: var(--space-3) 0 0; padding: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; border: 0; align-self: start; }
  .sp-text { grid-area: text; padding-top: 0; }
  .sp-title { font-size: var(--step-3); }
}
@media (min-width: 960px) and (min-height: 700px) {
  .sp-stage-col { top: var(--space-5); }
  .sp-nav { position: relative; top: auto; }
}

/* ── landmarks (palpation map) ────────────────────────────────────────── */
.lm-modes { margin-bottom: var(--space-4); max-width: 520px; }
.lm-modes button { flex: 1; }
.lm-views { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-3); }   /* 6 view chips made a 390 px page 574 px wide */
.lm-view { cursor: pointer; min-height: 36px; border: 1.5px solid transparent; }
.lm-view[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary-strong); border-color: var(--primary); }
.lm[data-mode="find"] .lm-view, .lm[data-mode="name"] .lm-view { pointer-events: none; opacity: .7; }
.lm-prompt { margin-bottom: var(--space-3); }
.lm-prompt[hidden] { display: none; }
.lm-prompt-text {
  display: flex; align-items: center; gap: var(--space-2); margin: 0; max-width: none;
  padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--text); color: var(--bg);
  font-size: var(--step-1); font-weight: 600;
}
.lm-prompt-text b { color: var(--bg); background: none; font-weight: 800; }
.lm-prompt-text .icon { color: var(--ill-highlight); flex: none; }
.lm-canvas {
  --zoom: 1; --fig-h: 70dvh;
  position: relative; border-radius: var(--radius-lg); background: var(--ill-bg); border: 1px solid var(--border);
  overflow: hidden;
}
/* The scroll box: zooming makes the figure wider/taller than it; one finger pans, two fingers pinch. */
.lm-zoom { padding: var(--space-3); overflow: hidden; overscroll-behavior: contain; }
.lm-canvas.is-zoomed .lm-zoom { overflow: auto; max-height: min(78dvh, 760px); touch-action: pan-x pan-y; cursor: grab; }
.lm-visual { width: 100%; }
.lm-visual .visual-stage { position: relative; width: calc(min(100%, var(--fig-h) * var(--ar, .75)) * var(--zoom)); max-width: none; margin-inline: auto; }
.lm-canvas.is-zoomed .lm-visual .visual-stage { margin-inline: 0; }
/* Phones with the detail sheet / question panel open: the zoom window is only the part above the sheet. */
@media (max-width: 959px) { .lm.panel-open .lm-canvas.is-zoomed .lm-zoom { max-height: calc(50dvh - var(--topbar-h) - 12px); } }
.lm[data-mode="find"] .lm-canvas, .lm[data-mode="name"] .lm-canvas { --fig-h: 60dvh; }
.lm-tools { position: absolute; top: var(--space-2); right: var(--space-2); z-index: 5; display: flex; gap: 4px; }
.lm-ztool {
  display: inline-grid; grid-auto-flow: column; place-items: center; gap: 4px; min-width: var(--tap); height: var(--tap); padding: 0 6px;
  border-radius: var(--radius-pill); background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--border);
  box-shadow: var(--shadow); color: var(--text); font-weight: 750; font-size: .85rem;
}
.lm-ztool[hidden] { display: none; }
.lm-ztool:hover:not([disabled]) { border-color: var(--primary); }
.lm-ztool[disabled] { opacity: .45; }
.lm-ztool[aria-pressed="true"] { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); }
.lm-reftool { padding: 0 12px 0 10px; }
.lm-canvas.is-crowded:not(.is-zoomed) .lm-ztool[aria-label^="Zoom in"] { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); }
.lm-crowd { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-2) 0 0; font-size: .88rem; color: var(--text-muted); max-width: none; }
.lm-crowd[hidden] { display: none; }
.lm-crowd .icon { flex: none; color: var(--primary); }
.lm-crowd b { background: none; }
/* Under the skin: the selected landmark's bone/tendon, and the optional Gray's plate. */
.lm-under { animation: lm-under-in var(--dur-slow) var(--ease) both; pointer-events: none; }
@keyframes lm-under-in { from { opacity: 0; } to { opacity: 1; } }
.lm-ref { opacity: .5; mix-blend-mode: multiply; pointer-events: none; }
:root[data-theme="dark"] .lm-ref { mix-blend-mode: screen; opacity: .35; filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lm-ref { mix-blend-mode: screen; opacity: .35; filter: invert(1); } }
/* Finger-pad route: dashed path from the start landmark, a fingertip that walks it. */
.lm-route-wrap { position: absolute; inset: 0; pointer-events: none; }
.lm-route { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.lm-route polyline { fill: none; stroke: var(--primary); stroke-width: 3; stroke-dasharray: 2 7; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.lm-route-start { position: absolute; transform: translate(-50%, -50%); width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--primary); background: var(--surface); }
.lm-route-start > span { position: absolute; left: 50%; top: calc(100% + 3px); transform: translateX(-50%); padding: 1px 6px; border-radius: 6px; background: var(--primary); color: var(--primary-contrast); font-size: .7rem; font-weight: 800; white-space: nowrap; }
.lm-finger {
  position: absolute; transform: translate(-50%, -50%); width: 30px; height: 36px; border-radius: 50% 50% 46% 46%;
  background: color-mix(in srgb, var(--ill-hand) 72%, transparent); border: 2px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,.35);
}
@media (max-width: 959px) {
  .lm[data-mode="find"] .lm-canvas, .lm[data-mode="name"] .lm-canvas { --fig-h: calc(100dvh - var(--topbar-h) - 300px); }
  .lm[data-mode="find"] .lm-prompt, .lm[data-mode="name"] .lm-prompt { position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top) + 6px); z-index: 7; }
  .lm[data-mode="find"] .lm-canvas, .lm[data-mode="name"] .lm-canvas { padding: var(--space-2); }
  .lm[data-mode="find"] .lm-panel, .lm[data-mode="name"] .lm-panel { max-height: 36dvh; }
}
.lm-visual .visual-stage > svg, .lm-visual .visual-stage > img { width: 100%; height: auto; overflow: hidden; }   /* library silhouettes run past the viewBox; never paint over the caption */
.lm-visual figcaption { text-align: center; }
.lm[data-mode="find"] .visual-stage { cursor: crosshair; }
.lm-spots { position: absolute; inset: 0; pointer-events: none; }
.lm-spot {
  position: absolute; width: var(--tap); height: var(--tap); transform: translate(-50%, -50%);
  display: grid; place-items: center; pointer-events: auto; border-radius: 50%;
}
.lm-spot-dot {
  position: relative; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: var(--primary-contrast); font-size: .8rem; font-weight: 800;
  border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35);
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.lm-spot-dot::before {
  content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--ill-highlight);
  animation: lm-pulse 2.2s var(--ease) infinite; pointer-events: none;
}
@keyframes lm-pulse { 0% { transform: scale(1); opacity: .9; } 70%, 100% { transform: scale(2.1); opacity: 0; } }
.lm-spot:hover .lm-spot-dot { transform: scale(1.12); }
.lm-spot.is-active .lm-spot-dot { background: var(--ill-highlight); transform: scale(1.22); color: var(--on-highlight); }
.lm-spot.is-ghost .lm-spot-dot { opacity: 0; }
.lm-spot.is-ghost:focus-visible .lm-spot-dot { opacity: 1; background: transparent; border-color: var(--focus); }
.lm-spot.is-ghost:focus-visible { outline: none; }
.lm-spot.is-target .lm-spot-dot { background: var(--ill-highlight); width: 32px; height: 32px; color: var(--on-highlight); font-size: 1rem; }
.lm-spot.is-target .lm-spot-dot::before { border-width: 3px; }
.lm-spot.is-dim .lm-spot-dot { width: 10px; height: 10px; border-width: 1.5px; background: var(--text-muted); opacity: .55; box-shadow: none; }
.lm-spot.is-dim .lm-spot-dot::before, .lm-spot.is-ghost .lm-spot-dot::before { display: none; }
.lm-reveal {
  position: absolute; width: 40px; height: 40px; transform: translate(-50%, -50%); border-radius: 50%;
  border: 3px solid var(--ill-highlight); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ill-highlight) 30%, transparent);
  animation: lm-reveal .5s var(--ease) both;
}
.lm-reveal-label {
  position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); white-space: nowrap; z-index: 2;
  padding: 3px 8px; border-radius: 6px; background: var(--text); color: var(--bg); font-size: .8rem; font-weight: 800;
}
.lm-reveal.is-below .lm-reveal-label { bottom: auto; top: calc(100% + 6px); }
@keyframes lm-reveal { from { transform: translate(-50%, -50%) scale(2); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.lm-tap { position: absolute; z-index: 1; transform: translate(-50%, -50%); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.lm-tap.is-correct { background: var(--success); }
.lm-tap.is-wrong { background: var(--danger); }

.lm-legend { list-style: none; padding: 0; margin: var(--space-3) 0 0; display: flex; flex-wrap: wrap; gap: var(--space-2); max-width: none; }
.lm-legend[hidden] { display: none; }
.lm-legend li { margin: 0; }
.lm-chip {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap); padding: 0 var(--space-3) 0 6px;
  border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--border); font-weight: 650; font-size: .9rem;
}
.lm-chip:hover { border-color: var(--primary); }
.lm-chip.is-active { border-color: var(--ill-highlight); background: var(--accent-soft); }
.lm-chip-num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: var(--primary-contrast); font-size: .76rem; font-weight: 800; }
.lm-chip.is-active .lm-chip-num { background: var(--ill-highlight); color: var(--on-highlight); }

.lm-panel { margin-top: var(--space-4); }
.lm-panel:focus { outline: none; }
.lm-panel-empty { display: grid; grid-template-columns: auto 1fr; gap: 0 var(--space-3); padding: var(--space-4); border-radius: var(--radius); background: var(--surface); border: 1px dashed var(--border-strong); }
.lm-panel-empty-icon { grid-row: span 2; color: var(--accent); }
.lm-panel-empty p { margin: 0; }
.lm-detail-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--space-3); }
.lm-detail-num { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ill-highlight); color: var(--on-highlight); font-weight: 800; }
.lm-detail-name { margin: 0; font-size: var(--step-2); }
.lm-detail-tools { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin: var(--space-3) 0 var(--space-2); }
.lm-detail-pager { display: inline-flex; align-items: center; gap: 2px; font-size: .85rem; font-weight: 700; }
.lm-detail-body { display: grid; gap: var(--space-4); padding-top: var(--space-2); }
.lm-block h4 { display: flex; align-items: center; gap: var(--space-2); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); margin-bottom: var(--space-1); }
.lm-block-find { padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--primary-soft); }
.lm-block-clinical h4 { color: var(--info); }
.lm-block-selfPractice h4 { color: var(--accent-text); }
.lm-block .prose { font-size: .98rem; line-height: 1.5; }

.lm-q-head { display: flex; align-items: center; gap: var(--space-4); min-height: 40px; margin-bottom: var(--space-3); font-weight: 800; }
.lm-next { margin-left: auto; }
.lm[data-mode="name"] .lm-feedback { margin: 0 0 var(--space-3); }
.lm-q-count { font-variant-numeric: tabular-nums; color: var(--text-muted); }
.lm-q-score { display: inline-flex; align-items: center; gap: 4px; color: var(--success); }
.lm-q-help { margin: 0; }
.lm-choices { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.lm-choice {
  min-height: 52px; padding: var(--space-2) var(--space-3); border-radius: var(--radius); text-align: left;
  background: var(--surface); border: 1.5px solid var(--border-strong); font-weight: 700; line-height: 1.25;
}
.lm-choice:hover:not([disabled]) { border-color: var(--primary); }
.lm-choice[disabled] { cursor: default; opacity: .6; }
.lm-choice.is-correct { border-color: var(--success); background: var(--success-soft); opacity: 1; }
.lm-choice.is-wrong { border-color: var(--danger); background: var(--danger-soft); opacity: 1; }
.lm-feedback { margin-top: var(--space-3); display: grid; gap: var(--space-2); }
.lm-feedback p { margin: 0; font-weight: 700; }
.lm-feedback.is-correct > p:first-child { color: var(--success); }
.lm-feedback.is-wrong > p:first-child { color: var(--danger); }
.lm-feedback .lm-feedback-tip { font-weight: 450; font-size: .95rem; }
.lm-feedback .btn { justify-self: start; }
.lm-result { display: grid; gap: var(--space-3); justify-items: start; }
.lm-result-score { display: flex; align-items: baseline; gap: var(--space-3); }
.lm-result-score b { font-family: var(--font-display); font-size: var(--step-5); line-height: 1; font-weight: 600; color: var(--warning); }
.lm-result-score.is-pass b { color: var(--success); }
.lm-result-msg { margin: 0; font-weight: 650; }
.lm-misses .eyebrow { margin-bottom: var(--space-1); }
.lm-miss { cursor: pointer; border: 1px solid var(--border); }

@media (max-width: 959px) {
  .lm.has-selection .lm-panel, .lm[data-mode="find"] .lm-panel, .lm[data-mode="name"] .lm-panel {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0;
    max-height: 50dvh; overflow-y: auto; overscroll-behavior: contain;
    padding: var(--space-3) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: 0 -12px 40px -12px rgba(0,0,0,.3);
    animation: sheet-up var(--dur) var(--ease) both;
  }
  .lm.has-selection .lm-panel::before { content: ''; display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 0 auto var(--space-3); }
  .lm.panel-open { padding-bottom: 46dvh; }
}
@media (min-width: 960px) {
  .lm-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); gap: var(--space-6); align-items: start; }
  .lm-panel { margin-top: 0; position: sticky; top: var(--space-5); max-height: calc(100dvh - var(--space-7)); overflow-y: auto;
    padding: var(--space-5); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
  .lm-panel:has(.lm-panel-empty) { background: none; border: 0; box-shadow: none; padding: 0; }
  .lm-close { display: none; }
}

/* ── listen ───────────────────────────────────────────────────────────── */
.listen-hint { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--info-soft); max-width: none; font-size: .95rem; }
.listen-hint-icon { color: var(--info); flex: none; }
.listen-hint b { background: none; }
.listen-status { margin: 0; font-weight: 650; }
.listen-status:empty { display: none; }
.listen-status.is-error { padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--warning-soft); color: var(--text); margin-top: var(--space-3); }
.listen-list { display: grid; gap: var(--space-4); margin-top: var(--space-4); }
@media (min-width: 1100px) { .listen-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lc { padding: var(--space-4); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.lc.is-playing { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.lc-top { display: flex; align-items: center; gap: var(--space-4); }
.lc-play {
  position: relative; flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: var(--primary); color: var(--primary-contrast); box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--primary) 80%, transparent);
  transition: transform var(--dur-fast) var(--ease), background var(--dur) var(--ease);
}
.lc-play:hover { background: var(--primary-strong); }
.lc-play:active { transform: scale(.94); }
.lc-play .icon { margin-left: 3px; }
.lc.is-playing .lc-play { background: var(--accent); }
.lc.is-playing .lc-play .icon { margin-left: 0; }
.lc.is-playing .lc-play::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--accent); animation: lm-pulse 1.6s var(--ease) infinite; }
.lc-head { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.lc-save { align-self: flex-start; color: var(--text-muted); margin: -4px -6px 0 0; }
.lc-save:hover { color: var(--primary); }
.lc-save[aria-busy="true"] { opacity: .5; }
.lc-title { margin: 0; font-size: var(--step-1); font-family: var(--font-body); font-weight: 750; letter-spacing: 0; }
.lc-time { font-size: .86rem; color: var(--text-muted); font-weight: 650; font-variant-numeric: tabular-nums; }
.lc-scope { position: relative; height: 92px; margin: var(--space-4) 0 var(--space-3); border-radius: var(--radius); background: var(--ill-bg); border: 1px solid var(--border); overflow: hidden; }
.lc-canvas { width: 100%; height: 100%; }
.lc-heard { position: absolute; top: 10px; right: 10px; width: 12px; height: 12px; border-radius: 50%; background: var(--border-strong); }
.lc-heard.is-on { animation: heard .45s var(--ease) both; }
@keyframes heard { 0% { background: var(--ill-highlight); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ill-highlight) 60%, transparent); } 100% { background: var(--border-strong); box-shadow: 0 0 0 10px transparent; } }
.lc-readout { position: absolute; left: 10px; top: 6px; display: flex; align-items: baseline; gap: 5px; padding: 2px 8px; border-radius: 8px; background: color-mix(in srgb, var(--surface) 85%, transparent); }
.lc-readout[hidden] { display: none; }
.lc-readout-label { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.lc-readout-val { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; min-width: 2.2ch; }
.lc-readout.is-audible .lc-readout-val { color: var(--accent); }
.lc-readout-unit { font-size: .74rem; color: var(--text-muted); font-weight: 700; }
.lc-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.lc-progress > span { display: block; height: 100%; width: 0; background: var(--primary); }
/* Korotkoff teaching layer: gauge + trace side by side, legend, phase bar, moment replays, flash labels. */
.lc.is-k .lc-scope { margin: 0; height: auto; min-height: 112px; }
.lc-kgrid { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: var(--space-3); align-items: stretch; margin: var(--space-4) 0 var(--space-2); }
.lc-gauge { --bp-gauge-size: 112px; align-self: center; }
.lc-legend { margin: 0 0 var(--space-2); font-size: .84rem; color: var(--text-muted); line-height: 1.4; max-width: none; }
.lc-key { display: inline-block; width: 4px; height: 12px; border-radius: 2px; background: var(--border-strong); vertical-align: -1px; }
.lc-key.is-hit { height: 16px; background: var(--accent); vertical-align: -3px; }
.lc-timeline { margin: 0 0 var(--space-3); }
.lc-moments { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-3); }
.lc-flash {
  position: absolute; left: 50%; bottom: 10px; transform: translate(-50%, 6px); z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 12px; border-radius: 12px;
  background: var(--text); color: var(--bg); text-align: center; line-height: 1.15; width: max-content; max-width: calc(100% - 16px);
  opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.lc-flash b { font-size: 1rem; font-weight: 850; letter-spacing: .02em; }
.lc-flash span { font-size: .76rem; font-weight: 650; opacity: .9; }
.lc-flash.is-on { opacity: 1; transform: translate(-50%, 0); }
.lc-flash.is-sys { background: var(--accent-text); color: #fff; }
.lc-flash.is-dia { background: var(--primary); color: var(--primary-contrast); }
.lc-flash.is-gap { background: var(--danger); color: #fff; }
@media (max-width: 380px) { .lc-kgrid { grid-template-columns: 96px minmax(0, 1fr); } .lc-gauge { --bp-gauge-size: 96px; } }
.lc-desc { font-size: .98rem; }
.lc-visual { margin-top: var(--space-3); }

/* ── table ────────────────────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); -webkit-overflow-scrolling: touch; }
.table-scroll:focus-visible { outline-offset: 2px; }
.data-table { width: 100%; border-collapse: collapse; font-size: .96rem; line-height: 1.4; }
.data-table caption { text-align: left; padding: var(--space-3) var(--space-4); color: var(--text-muted); font-size: .88rem; }
.data-table th, .data-table td { padding: var(--space-3) var(--space-4); text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.data-table thead th { background: var(--surface-2); font-size: .76rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table tbody th { font-weight: 750; }
.data-table tbody tr:hover > * { background: color-mix(in srgb, var(--primary) 4%, transparent); }
@media (max-width: 599px) {
  .table-scroll:has(.is-stack) { border: 0; background: none; overflow: visible; }
  .data-table.is-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .data-table.is-stack, .data-table.is-stack tbody { display: block; }
  .data-table.is-stack tr { display: block; margin-bottom: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
  .data-table.is-stack tbody th { display: block; background: var(--surface-2); border-bottom: 1px solid var(--border); }
  .data-table.is-stack td { display: grid; grid-template-columns: minmax(90px, 38%) 1fr; gap: var(--space-3); border-bottom: 1px solid var(--border); padding: var(--space-2) var(--space-4); }
  .data-table.is-stack td::before { content: attr(data-label); font-size: .74rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); padding-top: 2px; }
  .data-table.is-stack tr > :last-child { border-bottom: 0; }
}
.tbl-note { margin-top: var(--space-3); font-size: .9rem; color: var(--text-muted); }

/* ── mnemonics ────────────────────────────────────────────────────────── */
.mn-tools { display: flex; justify-content: flex-end; margin-bottom: var(--space-3); }
.mn-grid { display: grid; gap: var(--space-3); }
@media (min-width: 720px) { .mn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mn-card { position: relative; padding: var(--space-5); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.mn-title { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: var(--space-2); }
.mn-word { font-family: var(--font-display); font-size: var(--step-4); font-weight: 600; line-height: 1.05; letter-spacing: .01em; color: var(--accent); margin-bottom: var(--space-3); overflow-wrap: anywhere; }
.mn-card.is-hidden .mn-meaning { display: none; }
.mn-reveal { margin-top: var(--space-1); }
.mn-meaning b, .mn-meaning strong { background: none; color: color-mix(in srgb, var(--accent) 85%, var(--text)); font-weight: 800; padding: 0; }

/* ── callout ──────────────────────────────────────────────────────────── */
.callout-note { padding: var(--space-4) var(--space-5); gap: var(--space-2) var(--space-4); }
.callout-note .note-body { font-size: var(--step-1); line-height: 1.5; }
.callout-safety .callout-note { padding-left: calc(var(--space-5) + 6px); }

/* ── html ─────────────────────────────────────────────────────────────── */
.html-mount { min-width: 0; }

/* ── Progress page ────────────────────────────────────────────────────── */
.prog-hero { display: grid; gap: var(--space-5); align-items: center; padding: var(--space-5); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); margin-bottom: var(--space-5); }
.prog-ring { position: relative; display: grid; place-items: center; justify-self: center; }
.prog-ring-val { position: absolute; display: flex; flex-direction: column; align-items: center; }
.prog-ring-val b { font-family: var(--font-display); font-size: var(--step-4); line-height: 1; font-weight: 600; }
.prog-ring-val span { font-size: .78rem; color: var(--text-muted); font-weight: 700; }
.prog-stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin: 0; }
.prog-stat dd { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0 var(--space-2); align-items: center; }
.prog-stat-icon { grid-row: span 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); color: var(--primary); }
.prog-stat b { font-family: var(--font-display); font-size: var(--step-2); line-height: 1; font-weight: 600; }
.prog-stat .muted { font-size: .82rem; font-weight: 650; line-height: 1.2; }
@media (min-width: 720px) { .prog-hero { grid-template-columns: auto 1fr; gap: var(--space-7); padding: var(--space-6); } .prog-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); } }
.heatmap { margin-bottom: var(--space-6); }
.hm-head { display: flex; justify-content: space-between; align-items: baseline; }
.hm-head .muted { font-size: .88rem; font-weight: 650; }
.hm-wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 6px; max-width: 600px; }
.hm-months { display: grid; grid-template-columns: repeat(var(--cols, 12), 1fr); gap: 3px; font-size: .72rem; font-weight: 700; color: var(--text-muted); white-space: nowrap; }
.hm-days { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; font-size: .7rem; font-weight: 700; color: var(--text-muted); align-items: center; }
.hm-grid { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; }
.hm-cell.is-future { background: none; box-shadow: inset 0 0 0 1px var(--border); }
.hm-cell.is-today { outline: 2px solid var(--text); outline-offset: 1px; }
.hm-cell { aspect-ratio: 1; border-radius: 3px; background: color-mix(in srgb, var(--text) 8%, transparent); }
.hm-cell.l1 { background: color-mix(in srgb, var(--primary) 35%, transparent); }
.hm-cell.l2 { background: color-mix(in srgb, var(--primary) 65%, transparent); }
.hm-cell.l3 { background: var(--primary); }
.prog-modules { margin-bottom: var(--space-6); }
.pm-unit { margin-bottom: var(--space-4); }
.pm-unit-title { font-family: var(--font-body); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: var(--space-1); }
.pm-list { list-style: none; padding: 0; margin: 0; max-width: none; border-top: 1px solid var(--border); }
.pm-list li { margin: 0; border-bottom: 1px solid var(--border); }
.pm-row { display: grid; grid-template-columns: auto 1fr; gap: 2px var(--space-3); align-items: center; padding: var(--space-3) var(--space-2); color: var(--text); text-decoration: none; min-height: 56px; }
.pm-row:hover { background: var(--surface); text-decoration: none; }
.pm-ring { grid-row: span 2; display: grid; place-items: center; width: 28px; }
.pm-title { font-weight: 650; line-height: 1.3; }
.pm-meta { font-size: .84rem; }
.pm-row.is-idle .pm-title { color: var(--text-muted); font-weight: 550; }
@media (min-width: 720px) { .pm-row { grid-template-columns: auto 1fr auto; } .pm-ring { grid-row: auto; } }
.prog-backup { margin-bottom: var(--space-6); padding: var(--space-5); }
.prog-backup h2, .prog-offline h2 { margin-bottom: var(--space-2); }
.prog-offline { margin-bottom: var(--space-6); padding: var(--space-5); }
.prog-reset h2 { margin-bottom: var(--space-3); }
.reset-confirm { padding: var(--space-4); border-radius: var(--radius); background: var(--danger-soft); border: 1.5px solid var(--danger); }
.reset-confirm[hidden] { display: none; }

/* ── About page ───────────────────────────────────────────────────────── */
.about-disclaimer { margin-bottom: var(--space-6); }
.about-disclaimer .note-label::after { content: none; }
.about-grid { display: grid; gap: var(--space-3); margin-bottom: var(--space-6); }
@media (min-width: 720px) { .about-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.feature { padding: var(--space-4) var(--space-5); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.feature-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--primary-soft); color: var(--primary); margin-bottom: var(--space-3); }
.feature-title { font-family: var(--font-body); font-size: var(--step-0); font-weight: 800; letter-spacing: 0; margin-bottom: var(--space-1); }
.feature .muted { margin: 0; font-size: .94rem; }
.about-how { margin-bottom: var(--space-6); }
.how-list li { margin-bottom: var(--space-2); }
.about-sources { margin-bottom: var(--space-6); }
.ref-list { font-size: .92rem; padding-left: 1.1em; max-width: none; }
.ref-list li { margin-bottom: var(--space-2); overflow-wrap: anywhere; }
.ref-mods { font-size: .84rem; }
.ref-link { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; font-size: .84rem; padding-block: 10px; margin-block: -10px; }   /* bigger hit area, same layout */
.about-foot { font-size: .88rem; }

/* ── how-to-use module (html section) ─────────────────────────────────── */
.htu-install { display: grid; gap: var(--space-3); }
.htu-install .panel ol { margin: 0; }
.htu-install .h-small { font-size: var(--step-1); margin-bottom: var(--space-2); }
@media (min-width: 720px) { .htu-install { grid-template-columns: 1fr 1fr; } .htu-install > p { grid-column: 1 / -1; } }

@media (max-width: 519px) {
  .continue { grid-template-columns: 1fr auto; padding: var(--space-5) var(--space-4) var(--space-5) var(--space-5); }
  .continue-icon { display: none; }
}
/* Highlighter on <b> is for short key terms in running text; inside notes it gets too heavy. */
.note .prose b, .note .prose strong, .note-body b, .note-body strong { background: none; padding: 0; }
.module-sources li, .module-sources a { overflow-wrap: anywhere; }   /* long unbroken citation titles ("AHA/ACC/AANP/…") were cut off on phones */
