/* ── Corpus — design tokens ─────────────────────────────────────────── */

:root {
  color-scheme: light;

  --paper:      #FAFBFC;
  --surface:    #FFFFFF;
  --surface-2:  #EFF3F8;
  --ink:        #14181F;
  --ink-soft:   #414A57;
  --muted:      #737E8C;
  --rule:       #DBE2EB;
  --hairline:   #E8EDF3;

  --accent:      #1D4E89;
  --accent-2:    #2E7CC4;
  --accent-ink:  #FFFFFF;
  --accent-wash: #E7EFF9;

  --good:       #1E6B52;
  --good-wash:  #E1F0EA;
  --bad:        #A8382C;
  --bad-wash:   #F8E7E4;
  --pin:        #D2452F;

  --shadow:      0 1px 2px rgba(20,24,31,.05), 0 8px 24px rgba(20,24,31,.06);
  --shadow-lift: 0 2px 4px rgba(20,24,31,.07), 0 16px 40px rgba(20,24,31,.11);

  --bg-opacity: .13;
  --bg-filter: none;

  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, ui-serif, serif;
  --sans:  -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, system-ui, sans-serif;
  --mono:  ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;

  --r-sm: 8px;
  --r:    14px;
  --r-lg: 20px;
  --gutter: 22px;
  --readable: 1000px;
  --wide: 1200px;
}

/* Light only. The palette below is the whole design; there is no dark variant
   and the page must not follow the OS, which would otherwise repaint the
   anatomical figures and plates against a dark ground they were never drawn
   for. */
/* ── reset ──────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.2; }
p { margin: 0 0 .85em; }
p:last-child { margin-bottom: 0; }
ul { margin: 0; padding-left: 1.15em; }
img { max-width: 100%; display: block; }

/* ── the anatomical ground ──────────────────────────────────────────────
   A full-body muscle figure (anterior + posterior) sitting behind
   everything at low opacity. Fixed, so content scrolls over the body.
   ──────────────────────────────────────────────────────────────────── */

.ground {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: url('figures/bg-body.png');
  background-repeat: no-repeat;
  background-position: center 54%;
  background-size: auto 92vh;
  opacity: var(--bg-opacity);
  filter: var(--bg-filter);
}
@media (max-width: 700px) {
  .ground { background-size: auto 78vh; background-position: center 58%; opacity: calc(var(--bg-opacity) * .85); }
}

.masthead, main, .footer { position: relative; z-index: 1; }

.wrap { max-width: var(--readable); margin: 0 auto; padding: 0 var(--gutter); }
main.is-wide { max-width: var(--wide); }

/* ── masthead ───────────────────────────────────────────────────────── */

.masthead {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--hairline);
}
.masthead-inner { padding-top: 16px; padding-bottom: 0; max-width: var(--readable); }
.masthead-inner.is-wide { max-width: var(--wide); }
.wordmark { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.wordmark-name { font-family: var(--serif); font-size: 25px; font-weight: 600; letter-spacing: -.015em; }
.wordmark-sub { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 500; }

.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: none; padding: 8px 2px 12px; margin-right: 20px;
  font-size: 14.5px; color: var(--muted); font-weight: 500;
  border-bottom: 2px solid transparent; transition: color .15s; white-space: nowrap;
}
.nav a:hover { color: var(--ink-soft); }
.nav a.active { color: var(--ink); border-bottom-color: var(--accent); }

/* ── layout primitives ──────────────────────────────────────────────── */

/* main also carries .wrap, whose `padding: 0 var(--gutter)` outranks a bare
   `main` selector and silently zeroed the vertical padding — which is why every
   page's first row sat flush against the sticky masthead. Match the specificity. */
main.wrap { padding: 40px var(--gutter) 88px; min-height: 60vh; }
/* Anything scrolled to should clear the sticky masthead rather than hide behind it. */
html { scroll-padding-top: 120px; }
.loading { color: var(--muted); font-size: 15px; padding: 40px 0; }

.page-title { font-family: var(--serif); font-size: 32px; letter-spacing: -.02em; margin-bottom: 6px; }
.page-sub { color: var(--muted); font-size: 15px; margin-bottom: 30px; max-width: 62ch; }
.eyebrow { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 10px; }

.card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
.section { margin-top: 40px; }
.section > .eyebrow { margin-bottom: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── buttons ────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; font-size: 15px; font-weight: 550;
  background: var(--surface); color: var(--ink); border: 1px solid var(--rule);
  transition: transform .12s ease, background .15s, border-color .15s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(.975); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn-primary:hover { filter: brightness(1.12); border-color: transparent; }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 26px; font-size: 16px; }
.btn-sm { padding: 8px 14px; font-size: 13.5px; }
.btn:disabled { opacity: .4; pointer-events: none; }

/* ── home ───────────────────────────────────────────────────────────── */

.hero { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 26px; box-shadow: var(--shadow); margin-bottom: 26px; }
.hero h1 { font-family: var(--serif); font-size: 30px; letter-spacing: -.02em; margin: 4px 0 8px; }
.hero .meta { color: var(--muted); font-size: 14px; }
.countdown { display: inline-flex; align-items: baseline; gap: 7px; margin-top: 18px; padding: 7px 14px; border-radius: 999px; background: var(--accent-wash); color: var(--accent); font-size: 13.5px; font-weight: 600; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 26px; }
.tile { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r); padding: 16px 14px; text-align: center; box-shadow: var(--shadow); }
.tile-num { font-family: var(--serif); font-size: 27px; font-weight: 600; letter-spacing: -.02em; display: block; line-height: 1.1; }
.tile-label { font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-top: 5px; display: block; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action { display: block; text-align: left; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .18s, border-color .15s; }
.action:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--rule); }
.action:active { transform: translateY(0); }
.action-title { font-family: var(--serif); font-size: 19px; margin-bottom: 3px; }
.action-desc { font-size: 13.5px; color: var(--muted); line-height: 1.4; }
.action-wide { grid-column: 1 / -1; }

.objectives { counter-reset: obj; }
.objectives li { list-style: none; position: relative; padding-left: 30px; margin-bottom: 12px; font-size: 14.5px; color: var(--ink-soft); }
.objectives li::before {
  counter-increment: obj; content: counter(obj);
  position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent-wash); color: var(--accent);
  font-size: 11px; font-weight: 700; font-family: var(--sans); display: grid; place-items: center;
}

.lecture-list { display: grid; gap: 1px; background: var(--hairline); border-radius: var(--r); overflow: hidden; border: 1px solid var(--hairline); }
.lecture-row { background: var(--surface); padding: 13px 16px; display: flex; align-items: baseline; gap: 12px; }
.lecture-code { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-wash); padding: 2px 7px; border-radius: 5px; flex: none; }
.lecture-title { font-size: 14.5px; line-height: 1.35; }
.lecture-who { font-size: 12.5px; color: var(--muted); }

/* ── chips ──────────────────────────────────────────────────────────── */

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 500; background: var(--surface); border: 1px solid var(--rule); color: var(--ink-soft); transition: all .14s; }
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.chip-count { opacity: .6; font-size: 12px; margin-left: 3px; }

/* ── quiz runner ────────────────────────────────────────────────────── */

.progressbar { height: 3px; background: var(--hairline); border-radius: 2px; overflow: hidden; margin-bottom: 26px; }
.progressbar > i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width .3s ease; }

.qhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.qcount { font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.qtag { font-size: 11.5px; color: var(--muted); font-family: var(--mono); text-align: right; }

.qstem { font-family: var(--serif); font-size: 21px; line-height: 1.42; letter-spacing: -.01em; margin-bottom: 22px; }

.choices { display: grid; gap: 9px; }
.choice {
  display: flex; gap: 13px; align-items: flex-start; text-align: left;
  padding: 15px 17px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--rule);
  font-size: 15px; line-height: 1.45; transition: border-color .14s, background .14s, transform .1s;
}
.choice:hover:not(:disabled) { border-color: var(--accent); }
.choice:active:not(:disabled) { transform: scale(.99); }
.choice-key { flex: none; width: 23px; height: 23px; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; display: grid; place-items: center; margin-top: 1px; }
.choice.correct { border-color: var(--good); background: var(--good-wash); }
.choice.correct .choice-key { background: var(--good); color: #fff; }
.choice.wrong { border-color: var(--bad); background: var(--bad-wash); }
.choice.wrong .choice-key { background: var(--bad); color: #fff; }
.choice:disabled { cursor: default; opacity: 1; }
.choice.dim { opacity: .5; }

.verdict { margin-top: 20px; padding: 18px; border-radius: var(--r); border-left: 3px solid var(--accent); background: var(--surface); border-top: 1px solid var(--hairline); border-right: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); font-size: 14.5px; line-height: 1.6; }
.verdict.ok { border-left-color: var(--good); }
.verdict.no { border-left-color: var(--bad); }
.verdict-head { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; margin-bottom: 7px; }
.verdict.ok .verdict-head { color: var(--good); }
.verdict.no .verdict-head { color: var(--bad); }

.runner-foot { margin-top: 24px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* ── labelled figure ───────────────────────────────────────────────────
   The lecture artwork sits in the middle; labels live in gutters either side
   and an SVG draws a leader from each label to its structure. Below ~720px
   the rail collapses to a numbered legend under the image.
   ──────────────────────────────────────────────────────────────────── */

.lfig { display: block; margin: 0; }
.lfig-frame { position: relative; display: flex; align-items: center; justify-content: center; }
.lfig-stage {
  position: relative; width: 34%; margin: 0 auto; line-height: 0;
  border-radius: var(--r-sm); overflow: hidden; background: #fff;
  box-shadow: 0 1px 3px rgba(20,24,31,.12);
}
.lfig-stage img { width: 100%; height: auto; display: block; }
.lfig.is-bare .lfig-stage { width: 100%; max-width: 330px; }

.lfig-leaders { position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: visible; }
.lfig-leaders path { fill: none; stroke: var(--ink-soft); stroke-width: 1.2; opacity: .6; }
.lfig-leaders path.tip { fill: var(--accent); stroke: none; opacity: .95; }

.lfig-rail { position: absolute; inset: 0; pointer-events: none; }
.llabel {
  position: absolute; pointer-events: auto; text-align: left;
  display: flex; gap: 8px; align-items: flex-start; max-width: 31%;
  padding: 7px 11px; border-radius: 9px; z-index: 2;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--hairline); box-shadow: var(--shadow);
  font-size: 13.5px; line-height: 1.3; color: var(--ink);
  transition: border-color .14s, transform .12s;
}
.llabel[data-side="left"]  { left: 0; }
.llabel[data-side="right"] { right: 0; flex-direction: row-reverse; text-align: right; }
.llabel[data-side="right"] .llabel-t { text-align: right; }
.llabel:hover { border-color: var(--accent); transform: scale(1.02); }
.llabel-n {
  flex: none; width: 18px; height: 18px; border-radius: 50%; margin-top: 1px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 10.5px; font-weight: 700; display: grid; place-items: center;
}
.llabel-t { font-weight: 600; }
.llabel-t em { display: block; font-style: normal; font-weight: 400; font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; }

/* An arrow, not a ring. The tip lands on the structure; the shaft and the
   number chip stay clear of it, so a wide structure is still named exactly. */
.lpin { position: absolute; width: 0; height: 0; z-index: 2; }
.lpin-arrow {
  position: absolute; left: 0; top: 0; width: 34px; height: 14px; overflow: visible;
  transform-origin: 0 50%;
  /* The resting pose lives in variables so every animation below can start
     from it — one set of keyframes for arrows pointing either way. */
  --ty: -7px; --rot: 0deg;
  transform: translateY(var(--ty)) rotate(var(--rot));
  filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 1.5px #fff) drop-shadow(0 1px 2px rgba(0,0,0,.45));
}
.lpin[data-dir="left"] .lpin-arrow { --rot: 180deg; }
/* A white keyline under the fill so the arrow survives a red muscle or a
   pale radiograph without picking up a colour of its own. */
.lpin-head  { fill: var(--accent); stroke: #fff; stroke-width: 1.6; paint-order: stroke fill; }
.lpin-shaft { stroke: var(--accent); stroke-width: 3.2; stroke-linecap: round; fill: none; }
.lpin > i {
  position: absolute; top: -9px; left: 32px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 9px; background: var(--accent); border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
  font-size: 10.5px; font-weight: 700; font-style: normal; color: #fff;
  display: grid; place-items: center; line-height: 1;
}
.lpin > i:empty { display: none; }
.lpin[data-dir="left"] > i { left: auto; right: 32px; }

/* Crowded plates: a shorter shaft, and no number chip while the leader lines
   are drawn — the leader already ties each arrow to its label. In stacked mode
   the leaders are hidden, so the chip comes back. */
.lfig.is-dense .lpin-arrow { width: 21px; }
.lfig.is-dense .lpin-shaft { stroke-width: 2.8; }
.lfig.is-dense .lpin > i { display: none; left: 20px; }
.lfig.is-dense .lpin[data-dir="left"] > i { left: auto; right: 20px; }
.lfig.is-dense .lfig-frame.is-stacked .lpin > i { display: grid; }

/* Asking: the arrow is the question, so it gets the pin colour and a nudge
   toward its own tip rather than a ring drawn around half the organ. */
.lpin.is-asking .lpin-arrow { width: 46px; height: 19px; }
.lpin.is-asking .lpin-head  { fill: var(--pin); }
.lpin.is-asking .lpin-shaft { stroke: var(--pin); stroke-width: 3.6; }
.lpin.is-asking .lpin-arrow { --ty: -9.5px; animation: pin-nudge 1.9s ease-in-out infinite; }
@keyframes pin-nudge {
  0%, 100% { transform: translateY(var(--ty)) rotate(var(--rot)) translateX(0); }
  50%      { transform: translateY(var(--ty)) rotate(var(--rot)) translateX(6px); }
}

/* Hover. Moving onto a plate makes every arrow hop toward what it marks, one
   after another; resting on one arrow — or on its label in the rail — keeps
   that arrow bouncing and lifts it above its neighbours, so on a crowded film
   you can see exactly which line belongs to which name. */
.lfig .lfig-stage:hover .lpin:not(.is-asking) .lpin-arrow {
  animation: pin-hop .75s cubic-bezier(.3, .7, .4, 1) calc(var(--i, 0) * 55ms) both;
}
@keyframes pin-hop {
  0%   { transform: translateY(var(--ty)) rotate(var(--rot)) translateX(0); }
  30%  { transform: translateY(var(--ty)) rotate(var(--rot)) translateX(12px); }
  55%  { transform: translateY(var(--ty)) rotate(var(--rot)) translateX(0); }
  75%  { transform: translateY(var(--ty)) rotate(var(--rot)) translateX(5px); }
  100% { transform: translateY(var(--ty)) rotate(var(--rot)) translateX(0); }
}
.lfig .lfig-stage .lpin.is-hot, .lfig .lfig-stage .lpin:hover { z-index: 6; }
.lfig .lfig-stage .lpin.is-hot .lpin-arrow,
.lfig .lfig-stage .lpin:hover .lpin-arrow {
  animation: pin-bounce .6s ease-in-out infinite;
  filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 2px #fff) drop-shadow(0 2px 4px rgba(0,0,0,.55));
}
@keyframes pin-bounce {
  0%, 100% { transform: translateY(var(--ty)) rotate(var(--rot)) translateX(0)   scale(1.25); }
  50%      { transform: translateY(var(--ty)) rotate(var(--rot)) translateX(10px) scale(1.25); }
}
.lfig .lfig-stage .lpin.is-hot > i { transform: scale(1.15); }
.llabel.is-hot { border-color: var(--accent); transform: scale(1.02); }
.lpin-arrow { cursor: default; }

@media (prefers-reduced-motion: reduce) {
  .lpin.is-asking .lpin-arrow,
  .lfig .lfig-stage:hover .lpin:not(.is-asking) .lpin-arrow,
  .lfig .lfig-stage .lpin.is-hot .lpin-arrow,
  .lfig .lfig-stage .lpin:hover .lpin-arrow { animation: none; }
}
.lpin.is-answer .lpin-head  { fill: var(--good); }
.lpin.is-answer .lpin-shaft { stroke: var(--good); }
.lpin.is-answer > i { background: var(--good); }

/* stacked: image beside a numbered legend; stacks fully on phones */
.lfig-frame.is-stacked .lfig-stage { width: 100%; max-width: 460px; }
.lfig-frame.is-stacked .lfig-leaders { display: none; }
.lfig-frame.is-stacked { flex-direction: row; align-items: flex-start; gap: 18px; }
.lfig-frame.is-stacked .lfig-rail {
  position: static; display: grid; gap: 6px; flex: 1; min-width: 0;
  /* min(): in a narrow column — the quiz's answer figure — a 210px track would
     overflow the rail and run under the question beside it */
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
}
@media (max-width: 620px) {
  .lfig-frame.is-stacked { flex-direction: column; align-items: center; }
  .lfig-frame.is-stacked .lfig-rail { width: 100%; margin-top: 4px; }
}
.lfig-frame.is-stacked .llabel { position: static; max-width: 100%; flex-direction: row; text-align: left; }
.lfig-frame.is-stacked .llabel[data-side="right"] { flex-direction: row; text-align: left; }
.lfig-frame.is-stacked .llabel[data-side="right"] .llabel-t { text-align: left; }

.figure-cap { font-size: 12.5px; color: var(--muted); padding: 12px 2px 0; line-height: 1.45; text-align: center; }
.figure-cap b { color: var(--ink-soft); font-weight: 600; }
.figure-src { display: block; font-family: var(--mono); font-size: 11px; opacity: .8; margin-top: 3px; }

.fc-fig .lfig-stage, .review-fig .lfig-stage { width: 100%; max-width: 260px; }
.qfig .lfig-stage { max-width: 330px; }
/* the quiz shows one answer label beside a narrow image; give it the full
   column under the image instead of a four-word-deep sliver next to it */
.qfig .lfig-frame.is-stacked { flex-direction: column; align-items: center; }
.qfig .lfig-frame.is-stacked .lfig-rail { width: 100%; margin-top: 10px; }
.fc-fig .lfig-leaders, .review-fig .lfig-leaders { display: none; }
.fc-fig .lfig-rail, .review-fig .lfig-rail { position: static; margin-top: 10px; display: grid; gap: 5px; }
.fc-fig .llabel, .review-fig .llabel { position: static; max-width: none; flex-direction: row; text-align: left; font-size: 12.5px; }

/* ── results ────────────────────────────────────────────────────────── */

.score-ring { text-align: center; padding: 20px 0 30px; }
.score-num { font-family: var(--serif); font-size: 68px; font-weight: 600; letter-spacing: -.035em; line-height: 1; display: block; }
.score-of { color: var(--muted); font-size: 15px; margin-top: 8px; }
.score-verdict { font-family: var(--serif); font-size: 20px; margin-top: 16px; }

.review-item { padding: 18px 0; border-bottom: 1px solid var(--hairline); }
.review-item:last-child { border-bottom: none; }
.review-q { font-family: var(--serif); font-size: 16.5px; line-height: 1.4; margin-bottom: 9px; }
.review-line { font-size: 14px; display: flex; gap: 8px; margin-bottom: 4px; }
.review-label { color: var(--muted); flex: none; width: 62px; font-size: 12.5px; padding-top: 1px; }
.review-you { color: var(--bad); }
.review-ans { color: var(--good); }
.review-why { font-size: 13.5px; color: var(--ink-soft); margin-top: 9px; line-height: 1.55; }
.review-fig { margin-top: 12px; max-width: 340px; }

/* ── flashcards ─────────────────────────────────────────────────────── */

.flashcard {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lift);
  padding: 30px 24px; min-height: 290px;
  display: flex; flex-direction: column; justify-content: center;
  text-align: center; cursor: pointer; transition: transform .12s;
}
.flashcard:active { transform: scale(.99); }
.fc-topic { font-size: 10.5px; letter-spacing: .11em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 16px; }
.fc-front { font-family: var(--serif); font-size: 23px; line-height: 1.35; letter-spacing: -.01em; }
.fc-back { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--hairline); font-size: 16px; line-height: 1.62; text-align: left; color: var(--ink-soft); }
.fc-back strong { color: var(--ink); font-weight: 650; }
.fc-hint { margin-top: 20px; font-size: 12.5px; color: var(--muted); }
.fc-fig { margin: 16px auto 0; max-width: 300px; }
.fc-grade { display: grid; grid-template-columns: auto 1fr 1fr; gap: 10px; margin-top: 16px; align-items: center; }

/* ── fill in the blank ──────────────────────────────────────────────── */

.blank-input {
  width: 100%; padding: 14px 18px; border-radius: var(--r);
  background: var(--surface); border: 1.5px solid var(--rule);
  font-size: 17px; font-family: var(--serif); outline: none; transition: border-color .15s;
}
.blank-input:focus { border-color: var(--accent); }
.blank-input.correct { border-color: var(--good); background: var(--good-wash); }
.blank-input.wrong { border-color: var(--bad); background: var(--bad-wash); }
.blank-hint { font-size: 12.5px; color: var(--muted); margin-top: 8px; }

/* ── checklist ──────────────────────────────────────────────────────── */

.cl-section { margin-bottom: 34px; }
.cl-section h2 { font-family: var(--serif); font-size: 22px; letter-spacing: -.015em; margin-bottom: 4px; }
.cl-instruction { font-size: 13.5px; color: var(--muted); margin-bottom: 16px; line-height: 1.5; max-width: 68ch; }
.cl-group { margin-bottom: 18px; }
.cl-group-name { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.cl-items { display: flex; flex-wrap: wrap; gap: 7px; }
.cl-item { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; font-size: 13.5px; background: var(--surface); border: 1px solid var(--rule); color: var(--ink-soft); transition: all .14s; text-align: left; }
.cl-item:hover { border-color: var(--accent); }
.cl-item.done { background: var(--good-wash); border-color: var(--good); color: var(--good); font-weight: 550; }
/* A group with no parts needs no heading — the pill already names it. */
.cl-parent-note { align-self: center; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 0 2px; }
.cl-item.lvl-group { opacity: .72; font-size: 12.5px; }
.cl-item.lvl-concept { opacity: .72; font-size: 12.5px; font-style: italic; }
.cl-tick { font-size: 11px; }
.cl-legend { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.cl-legend b { color: var(--ink-soft); font-weight: 600; }

/* ── reference ──────────────────────────────────────────────────────── */

.search { width: 100%; padding: 13px 17px; border-radius: 999px; background: var(--surface); border: 1px solid var(--rule); font-size: 15.5px; margin-bottom: 20px; outline: none; transition: border-color .15s; }
.search:focus { border-color: var(--accent); }
.search::placeholder { color: var(--muted); }

.entry { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r); padding: 18px 20px; margin-bottom: 11px; box-shadow: var(--shadow); break-inside: avoid; }
.entry-name { font-family: var(--serif); font-size: 20px; letter-spacing: -.015em; }
.entry-group { font-size: 12px; color: var(--muted); margin-top: 2px; margin-bottom: 13px; }
.entry-field { display: flex; gap: 12px; font-size: 14.3px; line-height: 1.52; margin-bottom: 7px; }
.entry-key { flex: none; width: 92px; color: var(--muted); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; font-weight: 650; padding-top: 3px; }
.entry-val { flex: 1; color: var(--ink-soft); }
.entry-val strong { color: var(--ink); }
.entry-note, .entry-clinical { margin-top: 10px; padding: 11px 13px; border-radius: var(--r-sm); font-size: 13.3px; line-height: 1.55; color: var(--ink-soft); }
.entry-note { background: var(--accent-wash); }
.entry-clinical { background: var(--bad-wash); }
.entry-clinical::before, .entry-note::before { display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; margin-bottom: 4px; opacity: .8; }
.entry-clinical::before { content: 'Clinical'; color: var(--bad); }
.entry-note::before { content: 'Remember'; color: var(--accent); }
.entry-figs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.entry-thumb { width: 82px; border-radius: var(--r-sm); border: 1px solid var(--hairline); background: #fff; cursor: zoom-in; transition: transform .12s, border-color .15s; }
.entry-thumb:hover { transform: scale(1.05); border-color: var(--accent); }

.empty { color: var(--muted); font-size: 15px; padding: 30px 0; text-align: center; }

/* ── atlas ──────────────────────────────────────────────────────────── */

.atlas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.atlas-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); cursor: zoom-in; transition: transform .14s, box-shadow .18s; text-align: left; display: block; width: 100%; }
.atlas-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.atlas-thumb { aspect-ratio: 4/3; background: #fff; display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--hairline); }
.atlas-thumb img { max-height: 100%; width: auto; object-fit: contain; }
.atlas-meta { padding: 12px 14px; }
.atlas-title { font-family: var(--serif); font-size: 15.5px; line-height: 1.3; margin-bottom: 4px; }
.atlas-credit { font-size: 11px; color: var(--muted); font-family: var(--mono); }

/* ── lightbox: pan + zoom ───────────────────────────────────────────── */

.lightbox { position: fixed; inset: 0; z-index: 100; background: color-mix(in srgb, var(--paper) 92%, #000); display: flex; flex-direction: column; }
.lb-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--hairline); background: var(--surface); flex: none; }
.lb-title { font-family: var(--serif); font-size: 16px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.lb-body-labelled { overflow: auto; padding: 26px 20px; display: block; }
.lb-body-labelled .lfig-stage { width: 30%; }
.lb-body-labelled .lfig.is-bare .lfig-stage { width: 100%; max-width: 620px; }
.lb-hint { padding: 8px 16px; font-size: 12px; color: var(--muted); text-align: center; flex: none; }
.lb-stage { flex: 1; overflow: hidden; position: relative; touch-action: none; cursor: grab; display: grid; place-items: center; background: #fff; }
.lb-stage.dragging { cursor: grabbing; }
.lb-stage img { max-width: none; transform-origin: 0 0; will-change: transform; user-select: none; -webkit-user-drag: none; }
.lb-foot { padding: 10px 16px; border-top: 1px solid var(--hairline); background: var(--surface); font-size: 12.5px; color: var(--muted); display: flex; gap: 16px; align-items: center; flex-wrap: wrap; flex: none; justify-content: space-between; }
.lb-zoom { display: flex; gap: 6px; }
.lb-zoom button { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--rule); background: var(--surface); font-size: 17px; line-height: 1; }
.lb-zoom button:hover { border-color: var(--accent); }

/* ── history ────────────────────────────────────────────────────────── */

.hist-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--hairline); font-size: 14px; }
.hist-row:last-child { border-bottom: none; }
.hist-score { font-family: var(--serif); font-size: 17px; font-weight: 600; width: 56px; flex: none; }
.hist-meta { color: var(--muted); font-size: 13px; flex: 1; }
.hist-bar { width: 70px; height: 5px; border-radius: 3px; background: var(--hairline); overflow: hidden; flex: none; }
.hist-bar > i { display: block; height: 100%; background: var(--accent); }

/* ── footer ─────────────────────────────────────────────────────────── */

.footer { border-top: 1px solid var(--hairline); padding: 26px 0 40px; }
.footer p { font-size: 12.5px; color: var(--muted); }
.footer a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ── desktop ────────────────────────────────────────────────────────── */

@media (min-width: 1000px) {
  main { padding-top: 44px; }
  .page-title { font-size: 38px; }
  .hero { padding: 34px; }
  .hero h1 { font-size: 36px; }
  .tiles { gap: 14px; }
  .tile { padding: 20px 16px; }
  .tile-num { font-size: 32px; }
  .actions { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .qstem { font-size: 24px; }

  /* the question and its figure sit side by side once there's room */
  .qsplit { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 32px; align-items: start; }
  .qsplit > .qfig { position: sticky; top: 120px; }

  /* reference becomes two columns of cards */
  .ref-cols { columns: 2; column-gap: 14px; }
  .flashcard { min-height: 340px; padding: 40px 34px; }
  .fc-front { font-size: 26px; }
  .fc-split { display: grid; grid-template-columns: 1fr minmax(0,320px); gap: 26px; align-items: center; text-align: left; }
  .fc-split .fc-fig { margin: 0; max-width: 100%; }
}

@media (min-width: 1300px) {
  .ref-cols { columns: 3; }
}

/* ── mobile ─────────────────────────────────────────────────────────── */

@media (max-width: 560px) {
  :root { --gutter: 18px; }
  .page-title, .hero h1 { font-size: 26px; }
  .qstem { font-size: 19px; }
  .actions { grid-template-columns: 1fr; }
  .tile { padding: 13px 8px; }
  .tile-num { font-size: 23px; }
  .tile-label { font-size: 9.5px; letter-spacing: .06em; }
  .flashcard { padding: 26px 18px; min-height: 250px; }
  .fc-front { font-size: 20px; }
  .entry-field { flex-direction: column; gap: 2px; }
  .entry-key { width: auto; }
  .score-num { font-size: 56px; }
  .atlas-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .pin::before { left: -8px; top: -8px; width: 16px; height: 16px; }
  .pin-tag { font-size: 11px; padding: 3px 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── translucency pass ──────────────────────────────────────────────────
   Applied last so it wins over the component rules above. Surfaces sit at
   90% so the anatomical ground ghosts through the whole page rather than
   only showing in the gutters. Figures and the lightbox stay opaque white —
   a plate has to be read against a true white ground.
   ──────────────────────────────────────────────────────────────────── */

.card, .hero, .tile, .action, .lecture-row, .entry,
.flashcard, .verdict, .atlas-card, .chip, .btn {
  background-color: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.chip.on { background-color: var(--accent); }
.btn-primary { background-color: var(--accent); }
.choice { background-color: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.choice.correct { background-color: var(--good-wash); }
.choice.wrong { background-color: var(--bad-wash); }
.lfig-stage, .lfig-stage img, .atlas-thumb, .lb-stage { background-color: #fff; backdrop-filter: none; }


/* ── practice exams ─────────────────────────────────────────────────── */

.exam-list { display: grid; gap: 10px; }
.exam-row {
  display: flex; align-items: center; gap: 16px; text-align: left; width: 100%;
  padding: 16px 20px; border-radius: var(--r);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  border: 1px solid var(--hairline); box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .18s, border-color .15s;
}
.exam-row:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--accent); }
.exam-row:active { transform: translateY(0); }
.exam-main { flex: 1; min-width: 0; }
.exam-name { font-family: var(--serif); font-size: 19px; display: block; letter-spacing: -.01em; }
.exam-blurb { font-size: 13px; color: var(--muted); display: block; margin-top: 3px; line-height: 1.4; }
.exam-score { flex: none; text-align: right; }
.exam-score b { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--accent); display: block; line-height: 1.1; }
.exam-score em { font-style: normal; font-size: 11px; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
@media (max-width: 520px) {
  .exam-row { padding: 14px 16px; gap: 10px; }
  .exam-name { font-size: 17px; }
  .exam-blurb { font-size: 12.5px; }
}

/* ── cover art ──────────────────────────────────────────────────────────
   A picture of the thing the card names, cropped to a band. Always drawn
   from the lecture figures, never decorative stock.
   ──────────────────────────────────────────────────────────────────── */

.hero.has-cover { display: flex; gap: 24px; align-items: stretch; overflow: hidden; padding: 0; }
.hero-cover {
  flex: none; width: 34%; max-width: 260px; overflow: hidden; background: #fff;
  border-right: 1px solid var(--hairline);
}
.hero-cover img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.hero-body { padding: 26px 26px 26px 2px; flex: 1; min-width: 0; }

.action { position: relative; overflow: hidden; padding-top: 0; }
.action-cover {
  display: block; height: 108px; margin: 0 -18px 14px; overflow: hidden;
  background: #fff; border-bottom: 1px solid var(--hairline);
}
.action-cover img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }

.row-cover {
  flex: none; width: 46px; height: 46px; border-radius: 10px; overflow: hidden;
  background: #fff; border: 1px solid var(--hairline);
}
.row-cover img { width: 100%; height: 100%; object-fit: cover; }
.lecture-row { align-items: center; gap: 14px; }
.exam-row .row-cover { width: 54px; height: 54px; }

@media (max-width: 560px) {
  .hero.has-cover { flex-direction: column; }
  .hero-cover { width: 100%; max-width: none; height: 140px; border-right: none; border-bottom: 1px solid var(--hairline); }
  .hero-body { padding: 20px; }
  .action-cover { height: 90px; }
}

/* ── pomodoro ───────────────────────────────────────────────────────── */

.masthead-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.masthead-top .wordmark { margin-bottom: 0; }

.pom-ring {
  --progress: 0; --ring: var(--accent);
  width: min(260px, 68vw); aspect-ratio: 1; margin: 0 auto; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--ring) calc(var(--progress) * 360deg), var(--hairline) 0);
  transition: background .9s linear;
}
.pom-ring.kind-break, .pom-ring.kind-longBreak { --ring: var(--good); }
.pom-inner {
  width: calc(100% - 22px); aspect-ratio: 1; border-radius: 50%;
  background: var(--surface); display: grid; place-items: center; align-content: center;
  box-shadow: var(--shadow);
}
.pom-clock {
  font-family: var(--serif); font-size: clamp(38px, 11vw, 54px); font-weight: 600;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1;
}
.pom-label { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-top: 8px; }
.pom-cycle { font-size: 13px; color: var(--muted); margin-top: 14px; }

.pom-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.pom-field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); }
.pom-field input {
  padding: 9px 12px; border-radius: 9px; border: 1px solid var(--rule);
  background: var(--surface); font-size: 15px; color: var(--ink); width: 100%;
}
.pom-field input:focus { outline: none; border-color: var(--accent); }

/* ── masthead focus clock ───────────────────────────────────────────────
   A real clock face when idle; it fills into a progress ring while a block
   runs. Lives in the masthead so the timer is always one tap away without
   taking a slot in the nav.
   ──────────────────────────────────────────────────────────────────── */

.masthead-tools { display: flex; align-items: center; gap: 6px; flex: none; }

.pom-clock-btn {
  display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto;
  align-items: center; justify-items: center; gap: 0 8px;
  padding: 4px 8px 3px; border-radius: 12px; color: var(--muted);
  border: 1px solid transparent; transition: color .15s, background .15s;
}
.pom-clock-btn:hover { color: var(--ink); background: var(--surface-2); }
.pc-face { grid-row: 1; grid-column: 1; display: block; line-height: 0; }
.pc-face svg { width: 30px; height: 30px; display: block; }
.pc-caption {
  grid-row: 2; grid-column: 1;
  font-size: 7.5px; letter-spacing: .16em; font-weight: 700;
  color: var(--muted); margin-top: 1px;
}
.pc-time {
  grid-row: 1 / span 2; grid-column: 2; display: none;
  font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.pc-bezel   { fill: none; stroke: var(--rule); stroke-width: 1.6; }
.pc-dial    { fill: var(--surface); }
.pc-ticks line { stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; opacity: .85; }
.pc-ticks-minor line { stroke-width: 1.1; opacity: .38; }
.pc-hands line { stroke: currentColor; stroke-linecap: round; }
.pc-hour   { stroke-width: 2.3; }
.pc-minute { stroke-width: 1.7; }
.pc-pivot  { fill: currentColor; }
.pc-progress {
  fill: none; stroke: transparent; stroke-width: 3.2; stroke-linecap: round;
  transition: stroke-dashoffset .9s linear;
}

.pom-clock-btn.is-running { color: var(--accent); }
.pom-clock-btn.is-running .pc-hands,
.pom-clock-btn.is-running .pc-pivot,
.pom-clock-btn.is-running .pc-ticks-minor { display: none; }
.pom-clock-btn.is-running .pc-bezel { stroke: var(--hairline); }
.pom-clock-btn.is-running .pc-progress { stroke: currentColor; }
.pom-clock-btn.is-running .pc-time { display: block; }
.pom-clock-btn.is-running .pc-caption { color: currentColor; }
.pom-clock-btn.is-running.kind-break,
.pom-clock-btn.is-running.kind-longBreak { color: var(--good); }
.pom-clock-btn.is-running.kind-break .pc-time,
.pom-clock-btn.is-running.kind-longBreak .pc-time { color: var(--good); }
.pom-clock-btn.is-paused .pc-progress { opacity: .4; }

/* ── account ────────────────────────────────────────────────────────── */

.account-btn { padding: 4px; border-radius: 999px; border: 1px solid transparent; transition: background .15s; }
.account-btn:hover { background: var(--surface-2); }
.account-avatar {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  overflow: hidden; background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--hairline);
}
.account-avatar svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.account-avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-btn.is-in .account-avatar { border-color: var(--accent); color: var(--accent); }

.sync-chip {
  display: inline-block; font-size: 11px; letter-spacing: .05em; padding: 3px 9px;
  border-radius: 999px; background: var(--surface-2); color: var(--muted);
}
.sync-chip.is-syncing { background: var(--accent-wash); color: var(--accent); }
.sync-chip.is-synced  { background: var(--good-wash); color: var(--good); }
.sync-chip.is-error   { background: var(--bad-wash); color: var(--bad); }

.auth-field { display: block; text-align: left; margin-bottom: 12px; }
.auth-field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.auth-field input {
  width: 100%; padding: 11px 14px; border-radius: 10px;
  border: 1px solid var(--rule); background: var(--surface); font-size: 15.5px; color: var(--ink);
}
.auth-field input:focus { outline: none; border-color: var(--accent); }
.auth-error { color: var(--bad); font-size: 13px; margin-top: 10px; text-align: left; }
.auth-switch { font-size: 13px; color: var(--muted); margin-top: 16px; }
.auth-switch button { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

.profile-head { display: flex; align-items: center; gap: 14px; text-align: left; margin-bottom: 18px; }
.profile-pic {
  width: 56px; height: 56px; border-radius: 50%; overflow: hidden; flex: none;
  background: var(--surface-2); border: 1px solid var(--hairline); display: grid; place-items: center;
}
.profile-pic img { width: 100%; height: 100%; object-fit: cover; }
.profile-name { font-family: var(--serif); font-size: 19px; }
.profile-email { font-size: 12.5px; color: var(--muted); }

/* ── sheet ──────────────────────────────────────────────────────────── */

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: color-mix(in srgb, var(--ink) 34%, transparent);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px;
  animation: sheetIn .16s ease-out;
}
@keyframes sheetIn { from { opacity: 0 } to { opacity: 1 } }
.sheet {
  width: min(440px, 100%); max-height: min(88vh, 760px); overflow: auto;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lift);
}
.sheet-head {
  position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 18px 20px 12px;
  background: var(--surface); border-bottom: 1px solid var(--hairline);
}
.sheet-title { font-family: var(--serif); font-size: 22px; letter-spacing: -.015em; }
.sheet-body { padding: 22px 20px 24px; text-align: center; }

.pom-say { font-size: 13.5px; color: var(--muted); margin: 16px auto 0; max-width: 34ch; line-height: 1.5; }
.pom-actions { justify-content: center; margin-top: 18px; }
.pom-tiles { margin-top: 22px; }
.pom-more { margin-top: 20px; text-align: left; border-top: 1px solid var(--hairline); padding-top: 14px; }
.pom-more summary {
  cursor: pointer; font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; list-style: none;
}
.pom-more summary::-webkit-details-marker { display: none; }
.pom-more summary::after { content: ' ▾'; }
.pom-more[open] summary::after { content: ' ▴'; }
.pom-more .pom-settings { margin-top: 12px; }

@media (max-width: 520px) {
  .sheet-backdrop { padding: 0; place-items: end stretch; }
  .sheet { max-height: 92vh; border-radius: var(--r-lg) var(--r-lg) 0 0; width: 100%; }
  .pom-clock-btn svg { width: 27px; height: 27px; }
}

/* ── source attribution ─────────────────────────────────────────────────
   Shown under every revealed answer. It has to read as a citation, not as
   more of the answer, so it sits on a wash with a rule above it. */
.src { margin-top: 14px; padding: 12px 14px; border-radius: 10px;
       background: var(--accent-wash); border: 1px solid color-mix(in srgb, var(--accent) 14%, transparent); }
.src-compact { margin-top: 11px; padding: 10px 12px; }
.src-head { font-size: 10px; letter-spacing: .11em; text-transform: uppercase;
            font-weight: 700; color: var(--accent); margin-bottom: 7px; }
.src-head em { font-style: normal; font-weight: 500; opacity: .72; text-transform: none; letter-spacing: .02em; }
.src-row { display: flex; gap: 12px; align-items: flex-start; }
.src-thumb { width: 62px; height: 62px; object-fit: cover; border-radius: 7px; flex: none;
             background: var(--surface); border: 1px solid var(--hairline); }
.src-body { min-width: 0; flex: 1; }
.src-cite { font-size: 13.5px; color: var(--ink); line-height: 1.4; }
.src-slide { font-size: 13.5px; color: var(--ink-soft); margin-top: 2px; font-weight: 500; }
.src-quote { margin: 7px 0 0; padding-left: 10px; border-left: 2px solid color-mix(in srgb, var(--accent) 30%, transparent);
             font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; font-style: italic; }
.src-deck { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 7px;
            overflow-wrap: anywhere; }

/* ── exam clock ─────────────────────────────────────────────────────── */
.qhead-right { display: flex; align-items: center; gap: 12px; }
.exam-clock { font-family: var(--mono); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums;
              padding: 4px 11px; border-radius: 999px; background: var(--accent-wash); color: var(--accent);
              border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); }
.exam-clock.warn { background: #FEF3E2; color: #9A6212; border-color: #F0D3A2; }
.exam-clock.crit { background: var(--bad-wash); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent);
                   animation: clockpulse 1s ease-in-out infinite; }
@keyframes clockpulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .exam-clock.crit { animation: none; } }

/* ── review list ────────────────────────────────────────────────────── */
.review-n { font-family: var(--mono); font-size: 12px; font-weight: 700; margin-right: 7px; }
.review-n.ok { color: var(--good); }
.review-n.no { color: var(--bad); }
.review-item.is-right .review-q { color: var(--ink-soft); }
.fc-tally { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

@media (max-width: 620px) {
  .fc-grade { grid-template-columns: 1fr 1fr; }
  .fc-tally { grid-column: 1 / -1; order: -1; }
  .src-thumb { width: 48px; height: 48px; }
  .qhead-right { gap: 8px; }
  .exam-clock { font-size: 13.5px; padding: 3px 9px; }
}

/* ── skipping, and crossing out ─────────────────────────────────────────
   A paper you cannot move around in is not a practice paper. The strip is the
   map: every question reachable, answered ones filled, open ones hollow. */
.qstrip { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 26px;
          padding-top: 20px; border-top: 1px solid var(--hairline); }
.qdot { width: 29px; height: 29px; border-radius: 8px; font-size: 11.5px; font-weight: 700;
        font-variant-numeric: tabular-nums; border: 1px solid var(--rule);
        background: var(--surface); color: var(--muted); transition: all .12s; }
.qdot:hover { border-color: var(--accent); color: var(--accent); }
.qdot.is-ok { background: var(--good-wash); border-color: color-mix(in srgb, var(--good) 34%, transparent); color: var(--good); }
.qdot.is-no { background: var(--bad-wash); border-color: color-mix(in srgb, var(--bad) 34%, transparent); color: var(--bad); }
.qdot.is-open { border-style: dashed; }
.qdot.is-here { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.qnav { margin-top: 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qnav-mid { font-size: 12.5px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.qnav-finish { margin-top: 12px; display: flex; justify-content: center; }
.btn-sm { padding: 8px 14px; font-size: 13.5px; }

/* Crossing out is process of elimination, so a struck choice stops being
   selectable — but the ✕ stays live, because ruling a thing out is reversible. */
.choice-row { display: flex; align-items: stretch; gap: 7px; }
.choice-row .choice { flex: 1; min-width: 0; }
/* Reserve the ✕ gutter even once the question is answered and the buttons are
   gone, so the choices do not resize under her the moment she picks one. */
.choice-row.is-done { padding-right: 47px; }
.strike-btn { flex: none; width: 40px; border-radius: var(--r); border: 1px solid var(--rule);
              background: var(--surface); color: var(--muted); font-size: 13px; line-height: 1;
              transition: all .12s; }
.strike-btn:hover { border-color: var(--bad); color: var(--bad); background: var(--bad-wash); }
.choice-row.is-struck .choice { opacity: .42; }
.choice-row.is-struck .choice span:last-child { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.choice-row.is-struck .strike-btn { border-color: var(--bad); color: var(--bad); background: var(--bad-wash); }
.strike-hint { margin-top: 12px; }

@media (max-width: 620px) {
  .qdot { width: 26px; height: 26px; font-size: 10.5px; }
  .strike-btn { width: 34px; }
  .choice-row.is-done { padding-right: 41px; }
  .choice { padding: 13px 13px; font-size: 14.5px; }
  .qnav-mid { font-size: 11.5px; }
  .qnav { gap: 8px; }
  .qnav .btn-sm { padding: 8px 11px; font-size: 12.5px; }
}

/* ── week switcher ──────────────────────────────────────────────────── */
.weekbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; }
.weekbar .chip { padding: 9px 15px; }
.weekbar .chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.weekbar .chip.on .chip-count { background: rgba(255,255,255,.22); color: var(--accent-ink); }
.weekbar .chip-count { margin-left: 8px; }
@media (max-width: 620px) { .weekbar .chip-count { display: none; } }

/* ── library ────────────────────────────────────────────────────────── */
.lib-group { margin-bottom: 22px; }
.lib-kind { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.lib-card { padding: 6px 8px; }
.lib-row { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
           padding: 12px 10px; border-radius: 10px; background: transparent; border: none;
           transition: background .12s; }
.lib-row:hover { background: var(--accent-wash); }
.lib-row + .lib-row { border-top: 1px solid var(--hairline); }
.lib-icon { flex: none; width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center;
            background: var(--bad-wash); color: var(--bad); font-family: var(--mono);
            font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.lib-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lib-title { font-size: 14.5px; color: var(--ink); line-height: 1.35; }
.lib-meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lib-open { flex: none; font-size: 12.5px; font-weight: 600; color: var(--accent);
            padding: 5px 12px; border-radius: 999px; background: var(--accent-wash); }
@media (max-width: 620px) {
  .lib-icon { width: 34px; height: 34px; font-size: 9px; }
  .lib-title { font-size: 13.5px; }
}

/* ── per-week history ───────────────────────────────────────────────── */
.hist-week { display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
             font-size: 14px; font-weight: 600; color: var(--ink);
             padding-bottom: 10px; margin-bottom: 6px; border-bottom: 1px solid var(--hairline); }
.hist-week-avg { font-size: 12.5px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Keep a fifty-question review scannable. Narrowing the figure scales the
   image and its pins together — capping the height would crop the plate and
   could hide the marker the question is asking about. */
@media (min-width: 621px) { .review-fig { max-width: 260px; } }

/* ── lecture summaries ── */
.sum-index { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; }
.sum-index .chip { text-align: left; }
.sum-index .chip b { color: var(--accent); margin-right: 4px; font-weight: 700; }
.sum { padding: 30px 34px; scroll-margin-top: 130px; }
.sum + .sum { margin-top: 22px; }
.sum-title { font-family: var(--serif); font-size: 27px; letter-spacing: -.015em; line-height: 1.2; margin-bottom: 12px; }
.sum-overview { font-size: 16px; line-height: 1.65; color: var(--ink-soft); max-width: 72ch; }
.sum-take { margin: 22px 0 6px; padding: 16px 20px; border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--hairline)); }
.sum-take-h { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.sum-sec { margin-top: 24px; }
.sum-sec h3 { font-family: var(--serif); font-size: 19px; letter-spacing: -.01em; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--hairline); }
.sum ul { margin: 0; padding-left: 20px; }
.sum li { font-size: 15px; line-height: 1.65; color: var(--ink); margin: 6px 0; max-width: 78ch; }
.sum li::marker { color: var(--muted); }
.sum-cite { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 999px; vertical-align: 1px;
  font: 600 11px/1.6 var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace); color: var(--muted);
  background: var(--surface); border: 1px solid var(--hairline); cursor: pointer; white-space: nowrap; transition: color .14s, border-color .14s; }
.sum-cite:hover { color: var(--accent); border-color: var(--accent); }
.sum-deck { margin-top: 22px; font-size: 12.5px; color: var(--muted); }
.sum-note { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 50; max-width: min(92vw, 520px);
  padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--surface); font-size: 13.5px; box-shadow: var(--shadow); }
@media (max-width: 620px) {
  .sum { padding: 20px 18px; }
  .sum-title { font-size: 22px; }
  .sum-take { padding: 14px 14px 14px 12px; margin-inline: -4px; }
  .sum ul { padding-left: 18px; }
  .sum li { font-size: 14.5px; }
}

/* ── lecture recordings ── */
.tr-search { position: sticky; top: 104px; z-index: 6; display: flex; align-items: center; gap: 12px;
  margin: 0 0 22px; padding: 10px 0; background: linear-gradient(var(--paper) 72%, transparent); }
.tr-search input { flex: 1; min-width: 0; padding: 11px 16px; font: inherit; font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 999px; box-shadow: var(--shadow); }
.tr-search input:focus { outline: none; border-color: var(--accent); }
.tr-hits { flex: none; font-size: 12.5px; color: var(--muted); }
.tr { padding: 30px 34px; scroll-margin-top: 150px; }
.tr + .tr { margin-top: 22px; }
.tr-title { font-family: var(--serif); font-size: 26px; letter-spacing: -.015em; line-height: 1.2; margin-bottom: 14px; }
.tr-tells { margin: 0 0 20px; padding: 16px 20px; border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--hairline)); }
.tr-tells-h { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.tr-tells ul { margin: 0; padding-left: 18px; }
.tr-tells li { font-size: 14.5px; line-height: 1.6; color: var(--ink); margin: 5px 0; font-style: italic; }
.tr-count { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.tr-body p { font-size: 15.5px; line-height: 1.75; color: var(--ink-soft); margin: 0 0 14px; max-width: 74ch; }
.tr-body mark { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--ink); border-radius: 3px; padding: 0 2px; }
.tr-more { margin-top: 6px; }
.linkish { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.linkish:hover { text-decoration: underline; }
@media (max-width: 620px) {
  .tr { padding: 20px 18px; }
  .tr-title { font-size: 21px; }
  .tr-search { top: 96px; }
  .tr-body p { font-size: 15px; }
}
.tr-tell { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 0;
  font: inherit; font-style: italic; color: inherit; cursor: pointer; }
.tr-tell:hover { color: var(--accent); }
.tr-body p.is-flash { background: color-mix(in srgb, var(--accent) 10%, transparent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 4px;
  transition: background .3s, box-shadow .3s; }
