/* v343 · the same tactile workbook frame across all eight 3D lessons.
   Model, stage dimensions, projection and motion sources are intentionally not changed. */
:root {
  --lc-edge: color-mix(in srgb, var(--c-ink) 22%, transparent);
  --lc-line: color-mix(in srgb, var(--c-ink) 36%, transparent);
  --lc-yellow: #f8e9b6;
  --lc-mint: #ddecda;
  --bar: 68px;
  --r-md: 14px;
  --r-lg: 22px;
}
:root[data-theme="dark"] { --lc-yellow: #423c26; --lc-mint: #283e32; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --lc-yellow: #423c26; --lc-mint: #283e32; }
}
body { letter-spacing: .005em; }
:is(button, a, input, summary):focus-visible { outline: 3px solid var(--c-action); outline-offset: 4px; }
.appbar { min-height: var(--bar); border-bottom: 2px solid var(--lc-line); gap: 12px; }
.icon-btn { border: 2px solid var(--lc-line); border-radius: 14px; background: var(--c-surface); box-shadow: 0 3px 0 var(--lc-edge); }
.ttl h1 { font-family: var(--font-display); font-size: 20px; font-weight: 800; letter-spacing: -.035em; }
.overline { font-size: 12px; letter-spacing: .08em; }
.stance { padding: 4px; border: 2px solid var(--lc-line); border-radius: 15px; background: var(--c-surface); }
.stance button { min-height: 44px; height: auto; min-width: 56px; border-radius: 9px; padding: 8px 10px; font-size: 13px; }
.stage { border-radius: 24px; box-shadow: 0 4px 0 var(--lc-edge), inset 0 0 0 2px var(--lc-line); }
.views { border: 2px solid #203d364d; border-radius: 15px; padding: 4px; background: #fffdf6f2; box-shadow: 0 3px 0 #203d3626; }
.views button { border-radius: 9px; min-height: 44px; font-size: 13px; }
.views button:focus-visible { outline-color: var(--c-on-stage); }
.status { border: 1px solid #203d364d; border-radius: 12px; }
.body { gap: 34px; }
.goal { font-size: 17px; line-height: 1.85; }
h2 { font-family: var(--font-display); font-size: 23px; font-weight: 800; letter-spacing: -.035em; line-height: 1.55; }
.lede { margin-top: 7px; line-height: 1.85; }
.chip { border: 1px solid var(--lc-line); border-radius: 8px; padding: 5px 10px; }
.list { gap: 15px; }
.card { border: 2px solid var(--lc-line); border-radius: 20px; padding: 20px; box-shadow: 0 4px 0 var(--lc-edge); }
.card[aria-pressed="true"] { border-color: var(--c-ink); background: var(--lc-mint); box-shadow: 0 4px 0 var(--c-ink); }
.check { grid-template-columns: 34px minmax(0, 1fr); column-gap: 14px; row-gap: 6px; }
.check .n { display: grid; place-items: center; width: 34px; height: 36px; border: 1px solid var(--lc-line); border-radius: 11px; font-size: 20px; background: var(--lc-yellow); }
.check .t { font-size: 18px; font-weight: 800; }
.check .c { line-height: 1.8; }
.check .d { border: 1px solid var(--lc-line); border-radius: 12px; padding: 13px; }
.mistake { gap: 8px; }
.mistake .t { line-height: 1.6; font-weight: 800; }
.mistake .c { font-size: 13px; line-height: 1.75; }
.mistake[aria-pressed="true"] { background: var(--c-rear-tint); border-color: var(--c-rear); box-shadow: 0 4px 0 var(--c-rear); }
.fix { border: 2px solid var(--lc-line); border-radius: 20px; padding: 20px; }
.fix .ghost { min-height: 44px; line-height: 1.7; }
.btn { height: auto; min-height: 54px; padding: 12px 20px; border: 2px solid var(--lc-line); border-radius: 14px; box-shadow: 0 4px 0 var(--lc-edge); line-height: 1.6; }
.btn.primary { border-color: var(--c-action); }
.btn.small { min-height: 48px; height: auto; }
.steps { gap: 17px; margin-top: 18px; }
.steps li { grid-template-columns: 32px minmax(0, 1fr); gap: 13px; }
.steps li::before { width: 32px; height: 32px; border: 1px solid var(--lc-line); border-radius: 10px; background: var(--lc-yellow); color: var(--c-ink); }
.timer { min-height: 60px; padding-block: 10px; }
.timer .clock { font-size: 28px; font-weight: 800; }
.next { padding: 22px; border: 2px solid var(--c-ink); border-radius: 22px; background: var(--lc-yellow); box-shadow: 0 4px 0 var(--lc-edge); }
.next .t { margin-top: 6px; font-weight: 800; line-height: 1.7; }
.next .c { line-height: 1.8; }
.caption { line-height: 1.8; }
details.ref { border: 2px solid var(--lc-line); border-radius: 17px; padding: 4px 16px; background: var(--c-surface); }
details.ref summary { min-height: 52px; line-height: 1.7; gap: 12px; }
details.ref p { padding-bottom: 8px; line-height: 1.85; }
.player { gap: 11px; margin-top: 12px; }
.play { border: 2px solid var(--c-action); border-radius: 13px; box-shadow: 0 3px 0 var(--lc-edge); }
.speeds { padding: 3px; border: 1px solid var(--lc-line); border-radius: 13px; }
.speeds button { min-width: 44px; min-height: 44px; height: auto; border-radius: 9px; }
.moments { gap: 10px; }
.moments button { min-height: 48px; height: auto; padding: 9px 6px; border: 2px solid var(--lc-line); border-radius: 12px; font-size: 13px; line-height: 1.5; white-space: normal; box-shadow: 0 3px 0 var(--lc-edge); }
.moments button[aria-pressed="true"] { box-shadow: 0 3px 0 var(--c-lead); }
.phasebar { min-height: 44px; border: 1px solid var(--lc-line); border-radius: 11px; }
.phasebar .seg { font-size: 12px; }
.phasebar .seg.narrow { font-size: 0; }
.tools .toggle { height: auto; min-height: 44px; padding: 9px 13px; border: 2px solid var(--lc-line); border-radius: 12px; line-height: 1.5; }
.tools .toggle[aria-pressed="true"] { border-color: var(--c-action); }
.readout { font-size: 12px; line-height: 1.7; }
@media (hover: hover) and (pointer: fine) {
  :is(.btn, .card, .icon-btn, .next, .play, .moments button):not(:disabled):hover { transform: translateY(-2px); }
}
:is(.btn, .card, .icon-btn, .next, .play, .moments button):not(:disabled):active { transform: translateY(3px); box-shadow: 0 1px 0 var(--lc-edge); }
:is(.btn, .card, .icon-btn, .next, .play, .moments button) { transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease; }
@media (max-width: 390px) {
  .appbar { gap: 8px; padding-right: 8px; }
  .ttl h1 { font-size: 17px; }
  .ttl .overline { font-size: 12px; }
  .stance { gap: 0; padding: 3px; }
  .stance button { min-width: 48px; padding-inline: 7px; font-size: 12px; }
  .rail { padding-inline: 12px; }
  .body { padding-inline: 16px; }
  .card { padding: 16px; }
  .check { column-gap: 10px; }
  .check .t { font-size: 16px; }
  .check .c { font-size: 14px; }
  .mistakes { grid-template-columns: 1fr; }
  .views { gap: 0; }
  .views button { font-size: 12px; padding-inline: 3px; }
  .speeds button { min-width: 44px; padding-inline: 4px; }
  .moments { gap: 7px; }
  .moments button { font-size: 12px; }
}
@media (min-width: 900px) {
  .appbar { max-width: 1208px; margin-inline: auto; }
  .body { padding-top: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  :is(.btn, .card, .icon-btn, .next, .play, .moments button) { transition: none; }
  :is(.btn, .card, .icon-btn, .next, .play, .moments button):not(:disabled):is(:hover, :active) { transform: none; }
}
/* Native range inputs have an intrinsic width. Bound both grid and row before
   they can push the entire rail past the viewport at 320px. */
.rail, .player, .prow { min-width: 0; }
.player { grid-template-columns: minmax(0, 1fr); }
.scrub { width: 100%; min-width: 0; }
@media (max-width: 599px) {
  .prow { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; }
  .prow .play { grid-column: 1; grid-row: 1; }
  .prow .scrub { grid-column: 2; grid-row: 1; }
  .prow .speeds { grid-column: 1 / -1; grid-row: 2; justify-self: end; }
}
/* In a single column, the player must not cover centered scroll/focus targets
   in the lesson below it. Keep the sticky rail only beside the desktop body. */
@media (max-width: 899px) {
  .lesson { padding-top: env(safe-area-inset-top, 0px); }
  .rail { position: static; }
  .stage { scroll-margin-top: calc(var(--bar) + env(safe-area-inset-top, 0px) + 8px); }
}
