/* Hands-on lessons (2026-10-15): lesson cards, the step player, the live dot plot / box plot, Lola's feedback, the end screen.
   Brand colours from app.css (royal blue, red, teal, pink); playful but calm. Motion is skipped with prefers-reduced-motion. */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- lesson list */
.hl-list { display: grid; gap: 16px; }
.hl-card { display: grid; grid-template-columns: 132px 1fr auto; align-items: center; gap: 18px; padding: 18px 20px; }
.hl-card-art { width: 132px; height: 90px; border-radius: 18px; background: linear-gradient(140deg, #eef3ff, #fdf1ef); display: grid; place-items: center; }
.hl-card-art svg { width: 112px; }
.hl-card h3 { margin: 2px 0 4px; font-size: 1.2rem; }
.hl-card-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.hl-card-bar { margin-top: 10px; height: 8px; max-width: 360px; }
.hl-card-go { white-space: nowrap; }

/* ---- player shell */
.hl-player { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.hl-top { display: flex; align-items: center; gap: 12px; position: sticky; top: 74px; z-index: 5; padding: 6px 0;
  background: linear-gradient(#f7f8fc 70%, rgba(247,248,252,0)); }
.hl-x { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; background: #fff; color: #394056; display: grid; place-items: center;
  cursor: pointer; box-shadow: 0 2px 8px rgba(27,65,145,.1); }
.hl-x:hover { background: #fdf0ee; color: var(--red-dark); }
.hl-bar { flex: 1; height: 14px; border-radius: 99px; background: #e4e9f5; overflow: hidden; }
.hl-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #20ad96, #13a37a);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.08); transition: width .45s cubic-bezier(.2,.8,.2,1); }
.hl-count { font-weight: 700; color: #5b6275; font-size: .9rem; min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.hl-stage { min-height: 300px; }
.hl-step, .hl-end { background: #fff; border-radius: 26px; border: 1px solid #eceff6; padding: 24px 26px 22px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 14px 36px rgba(27,65,145,.08); }
.hl-step.in, .hl-end.in { animation: hlIn .38s cubic-bezier(.2,.8,.2,1) both; }
@keyframes hlIn { from { opacity: .25; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.hl-kicker { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--blue);
  background: #edf1fb; border-radius: 999px; padding: 3px 10px; }
.hl-step h2 { margin: 10px 0 8px; font-size: 1.5rem; }
.app-body .hl-step h2:focus, .app-body .hl-step h2:focus-visible { outline: none; }   /* focused by script for screen readers only */
.hl-body { font-size: 1.06rem; margin: 0 0 12px; color: #2a3148; }
.hl-prompt { font-size: 1.1rem; font-weight: 700; color: #13204a; margin: 6px 0 12px; }
.hl-tip { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 0; padding: 10px 12px; border-radius: 14px; background: #fff8ea; color: #6b4a00; font-size: .95rem; }
.hl-tip .ic { color: #e8590c; margin-top: 3px; }

/* ---- choices and number input */
.hl-opts { display: grid; gap: 10px; margin-top: 8px; }
.hl-opt { font-size: 1.02rem; padding: 12px 14px !important; }
.hl-opt.wrong { animation: hlShake .4s; }
@keyframes hlShake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.hl-num { display: inline-flex; align-items: center; gap: 10px; margin: 8px 0 0; font-weight: 700; }
.hl-num input { width: 150px; font-size: 1.6rem; font-weight: 700; text-align: center; border-radius: 16px; padding: 10px 12px; }
.hl-num input.wrong { border-color: var(--red); animation: hlShake .4s; }
.hl-unit { color: #5b6275; font-size: 1.05rem; }

/* ---- dot plot */
.hl-widget { margin: 6px 0 4px; }
.hl-plot { position: relative; background: linear-gradient(180deg, #f8faff, #fff); border: 1px solid #e3e9f6; border-radius: 20px; padding: 12px 10px 8px; }
.hl-stats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0 0 6px; }
.hl-stat { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 12px; border-radius: 999px; background: #fff; border: 1.5px solid #dfe6f4; font-variant-numeric: tabular-nums; }
.hl-stat small { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #5b6275; }
.hl-stat b { font-size: 1.05rem; color: #13204a; min-width: 1.4em; text-align: center; }
.hl-stat.s-median { border-color: #f6b9b4; background: #fff4f3; } .hl-stat.s-median b { color: #c2352b; }
.hl-stat.s-q1, .hl-stat.s-q3 { border-color: #bfe6dc; background: #f0faf7; } .hl-stat.s-q1 b, .hl-stat.s-q3 b { color: #0f7a66; }
.hl-stat.s-iqr { border-color: #c9d6f0; background: #eef3ff; } .hl-stat.s-iqr b { color: var(--blue); }
.hl-stat.bump { animation: hlBump .35s ease; }
@keyframes hlBump { 40% { transform: scale(1.12); } }
.hl-svg { display: block; width: 100%; touch-action: none; user-select: none; -webkit-user-select: none; overflow: visible; }
.hl-axis { stroke: #8f9ab3; stroke-width: 2; } .hl-tick { stroke: #8f9ab3; stroke-width: 1.5; }
.hl-tlab { font: 600 12px Quicksand, sans-serif; fill: #5b6275; }
.hl-axis-label { text-align: center; margin-top: 2px; }
.hl-half { fill: rgba(32,173,150,.1); stroke: rgba(32,173,150,.35); stroke-dasharray: 5 4; transition: x .25s, width .25s; }
.hl-dot { transition: transform .28s cubic-bezier(.2,.8,.2,1); }
.hl-dot .hl-hit { fill: transparent; }
.hl-dot .hl-c { fill: #1b4191; stroke: #fff; stroke-width: 2.5; transition: fill .2s, r .15s; }
.hl-dot.can-drag { cursor: grab; outline: none; }
.hl-dot.can-drag:hover .hl-c, .hl-dot.can-drag:focus-visible .hl-c { r: 11; }
.hl-dot.can-drag:focus-visible .hl-hit { fill: rgba(246,183,60,.25); }
.hl-dot.drag { transition: none; cursor: grabbing; } .hl-dot.drag .hl-c { r: 12; filter: drop-shadow(0 4px 6px rgba(27,65,145,.35)); }
.hl-dot[data-role="median"] .hl-c { fill: #eb473d; }
.hl-dot[data-role="q1"] .hl-c, .hl-dot[data-role="q3"] .hl-c { fill: #13a37a; }
.hl-dot[data-role="min"] .hl-c, .hl-dot[data-role="max"] .hl-c { fill: #132f6b; stroke: #f2a93b; }
.hl-dot.dim .hl-c { fill: #c3cbe0; } .hl-dot.dim[data-role="median"] .hl-c { fill: #eb473d; }
.hl-dot.lit:not([data-role="median"]) .hl-c { fill: #13a37a; }
.hl-guide { stroke-width: 2; stroke-dasharray: 3 4; }
.g-median { stroke: #eb473d; } .g-q1, .g-q3 { stroke: #13a37a; } .g-min, .g-max { stroke: #132f6b; }
.hl-whisk, .hl-cap { stroke: #1b4191; stroke-width: 2.5; stroke-linecap: round; }
.hl-rect { fill: #dfe7fb; stroke: #1b4191; stroke-width: 2.5; }
.hl-medline { stroke: #eb473d; stroke-width: 4; stroke-linecap: round; }
.hl-box.pop { animation: hlPop .5s cubic-bezier(.2,.8,.2,1) both; transform-origin: center; transform-box: fill-box; }
@keyframes hlPop { from { opacity: 0; transform: scaleX(.6); } to { opacity: 1; transform: none; } }
.hl-marker { cursor: ew-resize; outline: none; transition: transform .12s ease-out; }
.hl-marker.drag { transition: none; }
.hl-mk-line { stroke: #f2a93b; stroke-width: 3; stroke-dasharray: 6 4; }
.hl-mk-head { fill: #f2a93b; stroke: #fff; stroke-width: 2; }
.hl-mk-hit { fill: transparent; }
.hl-mk-txt { font: 700 14px Quicksand, sans-serif; fill: #8a5a00; }
.hl-marker:focus-visible .hl-mk-head { stroke: #1b4191; stroke-width: 3; }
.hl-plot.locked .hl-dot, .hl-plot.locked .hl-marker { pointer-events: none; }
.hl-plot.dragging { border-color: #c9d6f0; }

/* ---- feedback (green check / Lola's hint) and footer */
.hl-fb { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 20px; animation: hlUp .3s cubic-bezier(.2,.8,.2,1) both; }
@keyframes hlUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hl-fb b { font-size: 1.08rem; }
.hl-fb.ok { background: #e6f6f2; border: 1.5px solid #9fdccb; color: #0d4f43; } .hl-fb.ok b { color: #0d6655; }
.hl-fb.no { background: #fff4f3; border: 1.5px solid #f6cdc8; color: #5a2420; } .hl-fb.no b { color: #b8322a; }
.hl-fb.show { background: #f3f6fc; border: 1.5px solid #d5def0; color: #1f2a4d; }
.hl-tick { width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #13a37a; color: #fff;
  box-shadow: 0 0 0 6px rgba(19,163,122,.15); animation: hlTick .45s cubic-bezier(.3,1.6,.5,1) both; }
.hl-tick .ic { width: 26px; height: 26px; stroke-width: 3; }
@keyframes hlTick { from { transform: scale(0); } }
.pip { width: 56px; height: 56px; flex: none; border-radius: 50%; object-fit: cover; }
.hl-fb .pip { animation: hlBob 1.6s ease-in-out infinite; }
@keyframes hlBob { 50% { transform: translateY(-4px) rotate(-3deg); } }
.pip.big { width: 92px; height: 92px; }
.hl-show { margin-top: 6px; padding: 0; }
.hl-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.hl-go { min-width: 160px; padding: 13px 26px; font-size: 1.05rem; box-shadow: 0 8px 18px rgba(27,65,145,.25); }
.is-ok .hl-go { background: #13a37a; } .is-ok .hl-go:hover { background: #0f7a66; }
.hl-reset { margin-right: auto; }

/* ---- end screen */
.hl-end { text-align: center; }
.hl-end-top { display: flex; align-items: center; justify-content: center; gap: 18px; }
.hl-score { --p: 0; width: 128px; height: 128px; border-radius: 50%; display: grid; place-items: center; align-content: center;
  background: radial-gradient(closest-side, #fff 78%, transparent 79% 100%), conic-gradient(#13a37a calc(var(--p) * 1%), #e4e9f5 0); }
.hl-score b { font-size: 2.3rem; color: #13204a; line-height: 1; } .hl-score b small { font-size: 1.1rem; color: #5b6275; }
.hl-score span { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #5b6275; }
.hl-end h2 { margin: 14px 0 2px; font-size: 1.7rem; }
.hl-end h3 { margin: 18px 0 8px; font-size: 1.02rem; }
.hl-concepts { list-style: none; padding: 0; margin: 0 auto; max-width: 420px; display: grid; gap: 8px; text-align: left; }
.hl-concepts li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; font-weight: 600; }
.hl-concepts.ok li { background: #e6f6f2; color: #0d4f43; } .hl-concepts.ok .ic { color: #13a37a; }
.hl-concepts.more li { background: #fff8ea; color: #6b4a00; } .hl-concepts.more .ic { color: #e8590c; }
.hl-end.in .hl-concepts li { animation: hlUp .35s both; }
.hl-end.in .hl-concepts li:nth-child(2) { animation-delay: .08s; } .hl-end.in .hl-concepts li:nth-child(3) { animation-delay: .16s; }
.hl-end.in .hl-concepts li:nth-child(4) { animation-delay: .24s; }

/* ---- teacher report */
.th-table td, .th-table th { vertical-align: middle; }
.th-cell { display: flex; flex-direction: column; gap: 3px; }
.th-sum { display: flex; flex-wrap: wrap; gap: 18px; margin: 4px 0 12px; }

@media (max-width: 800px) {
  .hl-card { grid-template-columns: 1fr; gap: 12px; } .hl-card-art { width: 100%; height: 80px; } .hl-card-go { width: 100%; }
  .hl-top { top: 0; }
  .hl-step, .hl-end { padding: 18px 16px; border-radius: 22px; }
  .hl-step h2 { font-size: 1.25rem; }
  .hl-body { font-size: 1rem; }
  .hl-plot { padding: 10px 4px 6px; margin: 0 -6px; }
  .hl-foot { position: sticky; z-index: 5; bottom: calc(80px + env(safe-area-inset-bottom)); }
  .hl-go { flex: 1; min-width: 0; }
  .hl-fb { padding: 12px; } .pip { width: 46px; height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  .hl-step.in, .hl-end.in, .hl-fb, .hl-tick, .hl-fb .pip, .hl-stat.bump, .hl-opt.wrong, .hl-num input.wrong, .hl-box.pop, .hl-end.in .hl-concepts li { animation: none !important; }
  .hl-dot, .hl-bar i, .hl-marker, .hl-half { transition: none !important; }
}

/* nav buttons marked hidden (e.g. a section the course does not have) must stay hidden: .side button.nav sets display:flex */
.side button.nav[hidden] { display: none; }
