/* Result panel for BitsizeCheck.render(). Set --bsc-accent on a parent to use the
   subject colour (defaults to the hub plum). Calm, no confetti. */
.bsc {
  --bsc-accent: var(--bsc-subject, #5B2E63);
  --bsc-ink: #23271F; --bsc-soft: #585E50; --bsc-line: #E4E5DD; --bsc-amber: #9A6A12;
  box-sizing: border-box; margin: 18px 0; padding: 20px 20px 18px; border-radius: 16px;
  background: #fff; border: 1.5px solid var(--bsc-line); color: var(--bsc-ink);
  animation: bsc-in .28s ease both;
}
.bsc * { box-sizing: border-box; }
.bsc--pass { border-color: color-mix(in srgb, var(--bsc-accent) 45%, var(--bsc-line)); }
.bsc--miss { border-color: color-mix(in srgb, var(--bsc-amber) 40%, var(--bsc-line)); }
.bsc--error { border-style: dashed; }
.bsc__head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.bsc__score { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bsc__title { font-size: 17px; font-weight: 600; color: var(--bsc-soft); }
.bsc--pass .bsc__title { color: var(--bsc-accent); }
.bsc--miss .bsc__title { color: var(--bsc-amber); }
.bsc__unlock {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 7px 12px;
  border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--bsc-accent);
  background: color-mix(in srgb, var(--bsc-accent) 9%, #fff);
  animation: bsc-unlock .5s .15s ease both;
}
.bsc__note { margin: 10px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--bsc-soft); }
.bsc__note a { color: var(--bsc-accent); font-weight: 600; }
.bsc__review { margin-top: 14px; }
.bsc__review summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--bsc-soft); }
.bsc__missed { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.bsc__missed li { display: grid; gap: 3px; padding: 10px 12px; border-radius: 10px; background: #FAF8F3; font-size: 14px; line-height: 1.45; }
.bsc__q { color: var(--bsc-ink); }
.bsc__a { font-weight: 600; color: var(--bsc-accent); }
.bsc__why { color: var(--bsc-soft); font-size: 13px; }
.bsc__row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.bsc__btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1.5px solid var(--bsc-line); background: #fff; color: var(--bsc-ink);
  font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.bsc__btn--solid { background: var(--bsc-accent); border-color: var(--bsc-accent); color: #fff; }
/* Beat host pages' `.x a { color: inherit }` rules (specificity 0,2,1). */
.bsc a.bsc__btn { color: var(--bsc-ink); }
.bsc a.bsc__btn--solid, .bsc button.bsc__btn--solid { color: #fff; }
.bsc__btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--bsc-accent) 45%, #fff); outline-offset: 2px; }
.bsc__first { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 14px; line-height: 1.5;
               color: var(--bsc-ink); background: color-mix(in srgb, var(--bsc-amber) 10%, #fff); }
.bsc__memory { margin: 12px 0 0; font-size: 14px; line-height: 1.5; color: var(--bsc-soft); }
.bsc__memory a { color: var(--bsc-accent); font-weight: 600; white-space: nowrap; }
/* Stage-up: the one moment a lesson climbs the ladder (BitsizeCheck.stageUp — check panel + review). */
.bsc-up {
  --bsc-accent: var(--bsc-subject, var(--lp-accent, #5B2E63));
  display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px; border-radius: 14px;
  background: color-mix(in srgb, var(--bsc-accent) 8%, #fff);
  border: 1.5px solid color-mix(in srgb, var(--bsc-accent) 30%, #fff);
  animation: bsc-unlock .5s .1s ease both;
}
.bsc-up--mastered { background: #FBF5E6; border-color: #E3C36A; }
.bsc-up__ladder { flex: none; display: flex; align-items: flex-end; gap: 3px; height: 30px; }
.bsc-up__ladder i { width: 7px; border-radius: 2px; background: color-mix(in srgb, var(--bsc-accent) 15%, #fff); }
.bsc-up__ladder i:nth-child(1) { height: 10px; } .bsc-up__ladder i:nth-child(2) { height: 15px; }
.bsc-up__ladder i:nth-child(3) { height: 20px; } .bsc-up__ladder i:nth-child(4) { height: 25px; }
.bsc-up__ladder i:nth-child(5) { height: 30px; }
.bsc-up__ladder i.on { background: var(--bsc-accent); }
.bsc-up--mastered .bsc-up__ladder i.on { background: #C9971C; }
.bsc-up__ladder i.new { animation: bsc-rung .7s .45s ease both; }
.bsc-up__text { display: grid; gap: 2px; font-size: 13.5px; line-height: 1.4; color: var(--bsc-soft, #585E50); }
.bsc-up__text b { font-size: 15.5px; color: var(--bsc-ink, #23271F); }
@keyframes bsc-rung { 0% { transform: scaleY(.2); opacity: .3; } 60% { transform: scaleY(1.15); } 100% { transform: none; opacity: 1; } }
.bsc-up__ladder i { transform-origin: bottom; }
@keyframes bsc-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes bsc-unlock { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .bsc, .bsc__unlock, .bsc-up, .bsc-up__ladder i.new { animation: none; } }
/* A quiz that holds still (BitsizeCheck.steady / [data-steady]): the next question fades in where the
   last one stood — no slide — and the box never shrinks between questions (check.js). */
@keyframes bsc-swap { from { opacity: 0; } to { opacity: 1; } }
/* Chrome's scroll anchoring would pin the page to something BELOW a quiz that grew and push the
   question up; with it off the page behaves as on iPhone (Safari has none): what's above stays put. */
html:has([data-steady]) { overflow-anchor: none; }
