@import url('../fonts/montserrat.css');
@import url('../fonts/ptserif.css');  /* self-hosted: no external requests */
:root {
  --page: #f5f7f6; --board: #ffffff; --panel: #f5f7f6; --edge: #e3e7e5;
  --chalk: #232629; --dim: #6b7076; --faint: #b9c0bc;
  --task: #ff8040; --quiz: #269e6b; --good: #269e6b; --bad: #c0392b;
  --ui: "Montserrat", "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--page); }
body { color: var(--chalk); font: 26px/1.4 var(--ui); }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--task); outline-offset: 3px; }
button[hidden] { display: none; }

/* One fixed 1600×960 frame (900 stage + 60 controls), scaled to fit the window. */
#frame { position: absolute; left: 50%; top: 50%; width: 1600px; height: 960px; transform: translate(-50%, -50%) scale(var(--k, .5));
  border-radius: 8px; overflow: hidden; background: var(--board); box-shadow: 0 0 0 1px var(--edge), 0 5px 20px rgba(0, 0, 0, .15); }
#stage { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; display: block; }
#ui { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; pointer-events: none; }
#ui > * { pointer-events: auto; }

.cover { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; display: grid; place-items: center; background: rgba(255, 255, 255, .78); border: 0; }
.cover[hidden] { display: none; }
.cover > div { display: flex; flex-direction: column; align-items: center; }
.cover-k { margin: 0 0 10px; text-align: center; font-size: 22px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--quiz); }
.cover-t { margin: 0 0 44px; max-width: 1200px; text-align: center; font: 600 60px/1.15 var(--ui); color: var(--chalk); text-wrap: balance; }
.cover > div > * { animation: rise .7s cubic-bezier(.2, .8, .2, 1) backwards; }
.cover-t { animation-delay: .08s; }
.cover .go { animation-delay: .18s; }
.cover small { animation-delay: .26s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.cover .go { display: inline-flex; align-items: center; gap: 16px; padding: 18px 40px; border-radius: 5px; background: var(--quiz); color: #ffffff; font-weight: 600; font-size: 32px; }
.cover small { display: block; margin-top: 22px; font-size: 22px; text-align: center; color: var(--dim); }
.paused-mark { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; display: none; place-items: center; pointer-events: none; }
.paused .paused-mark { display: grid; }
.paused-mark div { padding: 14px 30px; border-radius: 999px; background: rgba(255, 255, 255, .95); box-shadow: 0 3px 9px rgba(0, 0, 0, .15); color: var(--dim); font-size: 22px; }

/* Question cards inside the picture. */
.card { position: absolute; padding: 20px 26px; border-radius: 6px; background: rgba(255, 255, 255, .98); border: 1px solid var(--edge); border-left: 6px solid var(--quiz); box-shadow: 0 5px 20px rgba(0, 0, 0, .35); }
.card.band { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "pic head body acts" "pic fb body acts"; column-gap: 28px; align-items: center; align-content: center; min-height: 150px; }
.band .mascot { grid-area: pic; }
.band .head { grid-area: head; align-self: end; }
.band .fb { grid-area: fb; align-self: start; }
.band .body { grid-area: body; }
.band .acts { grid-area: acts; }
.side .mascot { float: right; margin: -2px -4px 6px 10px; }
.kicker { margin: 0 0 4px; font-size: 20px; font-weight: 600; color: var(--quiz); }
.prompt { margin: 0; font-size: 28px; line-height: 1.35; }
.side .prompt { font-size: 24px; }
.body:empty { display: none; }
.side .body { margin-top: 14px; }
.opts { display: flex; gap: 12px; flex-wrap: wrap; }
.opt { padding: 8px 24px; border-radius: 6px; border: 2px solid var(--edge); background: transparent; color: var(--chalk); font-size: 24px; min-height: 58px; display: inline-flex; align-items: center; }
.opt:hover:not(:disabled) { border-color: var(--dim); }
.opt[aria-pressed="true"] { background: var(--c, var(--chalk)); border-color: var(--c, var(--chalk)); color: #ffffff; font-weight: 600; }
.opt.good { border-color: var(--good); box-shadow: 0 0 0 3px rgba(38, 158, 107, .2); }
.opt.bad { border-color: var(--bad); color: var(--bad); }
.opt:disabled { cursor: default; }
.fb { margin-top: 8px; font-size: 22px; line-height: 1.4; color: var(--chalk); }
.fb:empty { display: none; }
.fb.ok::before { content: "✓ "; color: var(--good); font-weight: 700; }
.fb.no::before { content: "✗ "; color: var(--bad); font-weight: 700; }
.fb ul { margin: 6px 0 0; padding-left: 22px; }
.side .fb { max-height: 110px; overflow: auto; font-size: 20px; }
.acts { display: flex; gap: 12px; align-items: center; }
.side .acts { margin-top: 16px; }
.side .acts { flex-wrap: wrap; gap: 10px; }
.side .btn { padding: 8px 16px; font-size: 20px; }
.card.side { padding: 18px 22px; }
.btn { padding: 12px 30px; border-radius: 5px; border: 0; background: var(--quiz); color: #ffffff; font-weight: 500; font-size: 22px; white-space: nowrap; }
.btn.quiet { background: #ffffff; color: var(--quiz); border: 1px solid var(--quiz); }
.btn.go { background: var(--quiz); color: #ffffff; }
.btn:disabled { background: var(--edge); color: var(--dim); cursor: default; }

.grid .row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 34px; gap: 16px; align-items: center; padding: 5px 0 5px 12px; border-bottom: 1px solid var(--edge); }
.grid .num { display: flex; justify-content: flex-end; align-items: center; font-size: 26px; }
.grid.text .row { grid-template-columns: minmax(0, 1fr) auto 34px; }
.grid.text .num { justify-content: flex-start; }
.grid .opts { gap: 8px; }
.grid .opt { padding: 3px 16px; min-height: 42px; font-size: 20px; }
.grid .mark { font-weight: 700; text-align: center; }
.grid .mark.good { color: var(--good); }
.grid .mark.bad { color: var(--bad); }
.grid .why { grid-column: 1 / -1; font-size: 19px; color: var(--dim); padding-left: 186px; }
.grid.text .why { padding-left: 0; }
.grid .why:empty { display: none; }

.hit { cursor: pointer; }
.hit .ring { fill: transparent; stroke: var(--chalk); stroke-width: 2.5; stroke-opacity: 0; }
.hit:hover .ring, .hit:focus .ring { stroke-opacity: .7; }
.hit.bad .ring { stroke: var(--bad); stroke-opacity: 1; }
.hit.good .ring { stroke: var(--good); stroke-opacity: 1; stroke-width: 4; }
.tok { cursor: grab; }

/* Controls strip, part of the frame. */
#bar { position: absolute; left: 0; top: 900px; width: 1600px; height: 60px; display: flex; align-items: center; gap: 10px; padding: 0 20px; background: #ffffff; border-top: 1px solid var(--edge); }
.icon { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--edge); background: #ffffff; display: grid; place-items: center; flex: none; padding: 0; }
.icon svg { width: 18px; height: 18px; fill: var(--chalk); }
.icon .i-pause { display: none; }
.is-playing .icon .i-play { display: none; }
.is-playing .icon .i-pause { display: block; }
.segs { flex: 1; display: flex; gap: 4px; height: 30px; align-items: center; min-width: 0; margin: 0 8px; }
.seg { position: relative; display: block; min-width: 0; height: 8px; border-radius: 4px; background: #e4e6e6; border: 0; padding: 0; overflow: hidden; }
.seg:hover { height: 12px; }
.seg i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--chalk); }
.seg.ask { background: #cfe9dc; }
.seg.ask i { background: var(--quiz); }
.step { width: 300px; flex: none; color: var(--dim); font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.volume { display: flex; align-items: center; flex: none; width: 44px; height: 44px; overflow: hidden;
  border: 1px solid var(--edge); border-radius: 999px; background: var(--panel); color: var(--chalk); transition: width .18s ease; }
.volume .icon { width: 42px; height: 42px; border: 0; background: transparent; }
.volume:hover, .volume:focus-within { width: 166px; gap: 10px; padding-right: 12px; }
.volume:hover { background: #e8f5ee; border-color: var(--faint); }
.volume:has(:focus-visible) { outline: 2px solid var(--task); outline-offset: 3px; }
.volume .icon:focus-visible { outline: none; }
.volume input { appearance: none; flex: none; width: 0; height: 42px; margin: 0; opacity: 0; background: transparent; cursor: pointer; }
.volume:hover input, .volume:focus-within input { width: 100px; opacity: 1; }
.volume input:focus-visible { outline: none; }
.volume input::-webkit-slider-runnable-track { height: 4px; border-radius: 999px;
  background: linear-gradient(to right, var(--chalk) var(--volume, 100%), var(--faint) var(--volume, 100%)); }
.volume input::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; margin-top: -4px; border: 0; border-radius: 50%; background: var(--chalk); }
.volume input::-moz-range-track { height: 4px; border-radius: 999px; background: var(--faint); }
.volume input::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--chalk); }
.volume input::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--chalk); }
/* Keep the control strip usable without scaling down its touch targets. */
@media (max-width: 700px) {
  #frame { top: calc(50% - 50px); overflow: visible; }
  #bar { width: calc(1600px * var(--k)); height: auto; flex-wrap: wrap; gap: 6px; padding: 8px;
    transform: scale(calc(1 / var(--k))); transform-origin: left top; border-radius: 0 0 12px 12px; }
  #bar .icon { width: 36px; height: 40px; }
  .step { display: none; }
  .volume { width: 36px; height: 40px; }
  #bar .volume .icon { width: 34px; height: 38px; }
  .volume:hover, .volume:focus-within { width: 158px; }
  .volume input { height: 38px; }
  .segs { order: 1; }
  .segs { min-width: 80px; margin: 0; }
}
.sound-note { position: absolute; left: 24px; top: 20px; margin: 0; padding: 8px 18px; border-radius: 12px; background: rgba(255, 255, 255, .95); color: var(--dim); font-size: 19px; }
.sound-note[hidden] { display: none; }
.blanks .brow { padding: 8px 0; border-bottom: 1px solid var(--edge); }
.blanks .brow:last-child { border-bottom: 0; }
.blanks .bline { line-height: 64px; white-space: nowrap; }
.blanks .mark { display: inline-block; margin-left: 14px; font-weight: 700; }
.blanks .mark.good { color: var(--good); animation: pop .35s ease-out; }
.blanks .mark.bad { color: var(--bad); }
.blanks .why { font-size: 19px; color: var(--dim); line-height: 1.35; }
.blanks .why:empty { display: none; }
.box { height: 52px; margin: 0 6px; padding: 0 6px; border: 0; border-bottom: 3px solid var(--quiz); border-radius: 8px 8px 0 0; background: #f9fafa; color: var(--chalk); font: 32px "STIX Two Text", "Cambria Math", "Iowan Old Style", Palatino, Georgia, serif; text-align: center; vertical-align: -6px; }
.box:focus { outline: none; background: #e8f5ee; }
.box.good { border-color: var(--good); }
.box.bad { border-color: var(--bad); }
.box:disabled { opacity: 1; }
kbd { display: inline-block; min-width: 1.5em; padding: 0 .4em; margin-left: .5em; border: 1.5px solid currentColor; border-radius: 6px; font: 600 .7em/1.5 var(--ui); text-align: center; vertical-align: .12em; opacity: .6; }
.opt kbd { margin: 0 .6em 0 0; }
.keys { margin: 6px 0 0; font-size: 18px; color: var(--dim); }
.keys kbd { margin: 0 .15em; }
.grid .row.cur { background: rgba(38, 158, 107, .06); box-shadow: inset 4px 0 var(--quiz); }
.help { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; display: grid; place-items: center; background: rgba(255, 255, 255, .8); }
.help[hidden] { display: none; }
.help-box { width: 1120px; padding: 40px 50px; border-radius: 6px; background: #ffffff; border: 1px solid var(--edge); box-shadow: 0 5px 20px rgba(0, 0, 0, .15); }
.help h2 { margin: 0 0 22px; font-size: 32px; font-weight: 600; }
.help h3 { margin: 0 0 12px; font-size: 20px; font-weight: 600; color: var(--quiz); }
.help-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; }
.help dl { margin: 0; display: grid; grid-template-columns: 150px 1fr; row-gap: 10px; font-size: 22px; }
.help dt { text-align: right; padding-right: 18px; white-space: nowrap; }
.help dt kbd { margin: 0 0 0 .3em; opacity: .9; }
.help dd { margin: 0; color: var(--dim); }
.help-close { margin: 26px 0 0; font-size: 18px; color: var(--dim); }
.icon.txt { font-size: 20px; font-weight: 700; color: var(--dim); }
/* Optional captions of the narration, one sentence at a time. Off by default: teaching text lives in the picture. */
.caption { position: absolute; left: 50%; bottom: 78px; transform: translateX(-50%); width: max-content; max-width: 1180px; padding: 10px 24px; border-radius: 10px; background: rgba(0, 0, 0, .78); color: #ffffff; font-size: 28px; line-height: 1.35; text-align: center; pointer-events: none; }
.caption[hidden] { display: none; }
.icon.cc { font-size: 15px; font-weight: 700; color: var(--dim); }
.icon.cc[aria-pressed="true"] { background: var(--chalk); border-color: var(--chalk); color: var(--board); }
.card.side { overflow: auto; }
svg.m { display: inline-block; overflow: visible; }
.card { animation: card-in .45s cubic-bezier(.2, .9, .3, 1.15); }
.fb:not(:empty) { animation: fb-in .3s ease-out; }
.opt.bad, .grid .mark.bad { animation: shake .4s; }
.grid .mark.good { animation: pop .35s ease-out; }
@keyframes card-in { from { opacity: 0; transform: translateY(24px) scale(.98); } }
@keyframes fb-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.3); } }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
/* Full-screen chapter practice. */
.card.screen { height: 900px; padding: 50px 70px; border: 0; border-radius: 0; background: transparent; box-shadow: none; animation: screen-in .5s ease-out; max-height: none; overflow: visible; }
.screen .kicker { font-size: 22px; }
.screen .prompt { font-size: 40px; font-weight: 600; }
.screen .body { margin-top: 30px; }
.screen .fb { position: absolute; left: 70px; bottom: 56px; max-width: 1080px; margin: 0; font-size: 24px; }
.screen .acts { position: absolute; right: 70px; bottom: 48px; }
.screen .grid .row { grid-template-columns: 200px minmax(0, 1fr) 40px; padding: 9px 0 9px 12px; }
.screen .grid.text .row { grid-template-columns: minmax(0, 1fr) auto 40px; }
.screen .grid .opt { font-size: 22px; min-height: 50px; padding: 4px 20px; }
.screen .grid .why { padding-left: 216px; font-size: 20px; }
.screen .grid.text .why { padding-left: 0; }
#ui > .screen.sort { pointer-events: none; }
.screen.sort > * { pointer-events: auto; }
.screen.sort .head { position: absolute; right: 34px; top: 40px; width: 330px; }
.screen.sort .prompt { font-size: 28px; }
.screen.sort .fb { left: auto; right: 34px; bottom: 116px; width: 330px; max-height: 240px; overflow: auto; font-size: 20px; }
.screen.sort .acts { right: 34px; }
.fin .finwrap { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; text-align: center; padding-bottom: 60px; }
.fin .mascot { margin-bottom: 28px; }
.fin .fb, .fin .acts { position: static; }
.fin .acts { margin-top: 30px; }
@keyframes screen-in { from { opacity: 0; } }

/* The guide: the GAD-7 mark. Bars rise on entry, breathe one by one while idle, hop on a right answer (.happy)
   and the tile sways on a wrong one (.oops). The shapes are never changed. */
.mascot { display: block; flex: none; overflow: visible; }
.vpalogo g { transform-box: fill-box; transform-origin: 50% 100%; }
.vpalogo .gad-bar { animation: gad-breathe 7s ease-in-out infinite; animation-delay: calc(var(--i) * .7s + 1.6s); }
.gad-enter .gad-bar { animation: gad-rise .5s cubic-bezier(.2, .9, .3, 1.15) both; animation-delay: calc(var(--i) * .07s); }
.mascot.happy .gad-bar { animation: gad-hop .5s ease-out both; animation-delay: calc(var(--i) * .04s); }
.mascot.happy .gad-body { transform-box: view-box; transform-origin: 50% 100%; animation: gad-cheer .6s ease-out; }
.mascot.oops .gad-body { transform-box: view-box; transform-origin: 50% 100%; animation: gad-sway .55s ease-in-out; }
@keyframes gad-rise { from { opacity: 0; transform: scaleY(0); } to { opacity: 1; transform: none; } }
@keyframes gad-breathe { 0%, 88%, 100% { transform: none; } 93% { transform: scaleY(.55); } }
@keyframes gad-hop { 0%, 100% { transform: none; } 45% { transform: translateY(-14%) scaleY(1.08); } 75% { transform: translateY(2%); } }
@keyframes gad-cheer { 0%, 100% { transform: none; } 50% { transform: scale(1.05); } }
@keyframes gad-sway { 0%, 100% { transform: none; } 25% { transform: rotate(-6deg); } 60% { transform: rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .vpalogo g { animation: none !important; } }
/* Entry, once (the class is removed by the engine after it plays). */
@keyframes bob { 50% { transform: translateY(-3px) rotate(-2deg); } }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes hop { 40% { transform: translateY(-12px) rotate(4deg); } }
@keyframes wobble { 25% { transform: rotate(-8deg); } 75% { transform: rotate(6deg); } }
@media (prefers-reduced-motion: reduce) { .volume { transition: none; } .card, .fb, .opt, .grid .mark, .mascot * { animation: none !important; } }

a.icon { text-decoration: none; }
a.btn { text-decoration: none; display: inline-block; }
/* Page-to-page motion: the contents card grows into this frame, and shrinks back on the way out. */
@view-transition { navigation: auto; }
#frame { view-transition-name: lesson; }
::view-transition-group(lesson) { animation-duration: .5s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
::view-transition-old(lesson), ::view-transition-new(lesson) { height: 100%; object-fit: cover; }
::view-transition-old(lesson) { animation-duration: .18s; }
@media (prefers-reduced-motion: reduce) { .cover > div > * { animation: none; } ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } }
/* The finish screen speaks the same type as the chapter cover and the contents page. */
.fin .kicker { font-size: 20px; letter-spacing: .14em; text-transform: uppercase; }
.fin .prompt { margin: 6px 0 14px; font: 600 52px/1.15 var(--ui); }

/* Rights holders: logos and copyright (required by the licence). */
.cover .logos { display: flex; align-items: center; justify-content: center; gap: 48px; margin: 0 0 34px; }
.cover .logos img { display: block; height: 64px; width: auto; }
.cover .logos .lg-mpr { height: 72px; }
.cover .logos .lg-vpa { height: 110px; }
.legal { max-width: 1100px; margin: 26px auto 0; font-size: 15px; line-height: 1.45; color: var(--dim); text-align: center; text-wrap: balance; }
.ver { margin: 8px auto 0; font-size: 13px; color: var(--faint); text-align: center; }
.fin .ver { position: absolute; right: 28px; bottom: 10px; margin: 0; }
.fin .legal { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); width: 1200px; margin: 0; }
.copy { flex: none; font-size: 14px; color: var(--dim); white-space: nowrap; }
@media (max-width: 700px) { .copy { display: none; } }

/* Side cards stay inside the stage: the question list scrolls, the buttons stay visible. */
.card.side { display: flex; flex-direction: column; overflow: hidden; }
.card.side > .head, .card.side > .fb, .card.side > .acts { flex: none; }
.card.side > .body { flex: 1 1 auto; min-height: 0; overflow: auto; }
.card.side > .mascot { position: absolute; right: 18px; top: 14px; float: none; margin: 0; }
.card.side > .head { padding-right: 120px; }

/* Portrait phone: suggest landscape. */
.rotate-tip { display: none; position: fixed; inset: 0; z-index: 50; background: rgba(255, 255, 255, .96); align-items: center; justify-content: center; text-align: center; padding: 24px; }
.rotate-tip.on { display: flex; }
.rotate-tip div { max-width: 300px; color: var(--chalk); }
.rotate-tip svg { color: var(--quiz); animation: rotate-tip 2.4s ease-in-out infinite; }
.rotate-tip p { font-size: 18px; font-weight: 600; margin: 14px 0 18px; line-height: 1.35; }
.rotate-tip button { border: 1px solid var(--quiz); background: #fff; color: var(--quiz); border-radius: 5px; padding: 10px 18px; font-size: 16px; }
@keyframes rotate-tip { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
@media (prefers-reduced-motion: reduce) { .rotate-tip svg { animation: none; } }

/* VPA look (vpa.org.ua): green #269E6B, ink #232629, small radii, uppercase green eyebrows. */
.kicker { color: var(--quiz) !important; letter-spacing: .12em; text-transform: uppercase; }
.cover-k { color: var(--quiz); letter-spacing: .12em; text-transform: uppercase; }
.vpalogo .gad-bar { transform-box: view-box; transform-origin: 60px 96px; }
.vpalogo .vpa-dot { animation: vpa-dot 6s ease-in-out infinite 1.6s; }
@keyframes vpa-dot { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(-18px); } 70% { transform: translateX(16px); } }
@media (prefers-reduced-motion: reduce) { .vpalogo .vpa-dot { animation: none; } }
/* Number inputs (comma decimals) and sliders inside question cards. */
.numrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 0; border-bottom: 1px solid var(--edge); font-size: 26px; }
.numrow:last-child { border-bottom: 0; }
.numrow .lab { min-width: 0; }
.numrow input.num { width: 5.2em; height: 50px; padding: 0 10px; border: 0; border-bottom: 3px solid var(--quiz); border-radius: 6px 6px 0 0; background: var(--panel); color: var(--chalk); font: 600 28px var(--ui); text-align: center; }
.numrow input.num:focus { outline: none; background: #e8f5ee; }
.numrow input.num.good { border-bottom-color: var(--good); background: #e8f5ee; }
.numrow input.num.bad { border-bottom-color: var(--bad); background: #fbeceb; }
.numrow .mark { font-weight: 700; }
.numrow .mark.good { color: var(--good); } .numrow .mark.bad { color: var(--bad); }
.numrow .why { flex-basis: 100%; color: var(--dim); font-size: 20px; }
.sl { display: grid; grid-template-columns: 300px minmax(0, 1fr) 120px; align-items: center; gap: 18px; padding: 10px 0; font-size: 24px; }
.sl b { font-weight: 600; }
.sl output { font: 700 30px var(--ui); color: var(--quiz); text-align: right; font-variant-numeric: tabular-nums; }
.sl input[type=range] { width: 100%; accent-color: var(--quiz); height: 34px; }
.sl input[type=range]:focus-visible { outline: 3px solid var(--task); outline-offset: 4px; }
.sl.cur b { color: var(--quiz); }
.live { margin: 6px 0 4px; font-size: 22px; color: var(--dim); }
.live strong { color: var(--chalk); }

/* «Що далі»: links to the textbook and the practicum. */
.card .links { list-style: none; margin: 10px 0 18px; padding: 0; display: grid; gap: 0; }
.card .links li { padding: 14px 0; border-bottom: 1px solid var(--edge); font-size: 26px; line-height: 1.35; }
.card .links li:last-child { border-bottom: 0; }
.card .links a { color: var(--sky, #1c7a52); font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--quiz); }
.card .links a:hover { color: var(--quiz); }
.card .links .sub { display: block; font-size: 20px; color: var(--dim); margin-top: 4px; }


/* ======================================================================================
   VPA lesson shell (v2): the frame reads like a page of vpa.org.ua — a white site header
   with the logo, breadcrumbs and part tabs; the picture; a charcoal control strip like the
   site footer. Titles and quotations in a book serif, interface in Montserrat.
   ====================================================================================== */
:root { --serif: "PT Serif", Georgia, "Noto Serif", "Times New Roman", serif;
  --green: #269e6b; --deep: #1c7a52; --wash: #e8f5ee; --soft: #f5f7f6; --line: #e3e7e5; --ink: #232629;
  --amber: #9a5b00; --amber-wash: #fff3e0; --char: #2b2e31; --char-2: #3a3e42; --char-t: #c9cdd0; }
html, body { background: #eef1ef; }
#frame { height: 1036px; border-radius: 4px; box-shadow: 0 0 0 1px var(--line), 0 2px 10px rgba(0, 0, 0, .08); }
#stage, #ui, .cover, .paused-mark, .help { top: 72px !important; }
.sound-note { top: 88px; border-radius: 4px; background: var(--amber-wash); color: var(--amber); }
#bar { top: 972px !important; height: 64px; }

/* Site header */
#top { position: absolute; left: 0; top: 0; width: 1600px; height: 72px; display: flex; align-items: center; gap: 26px; padding: 0 34px;
  background: #fff; border-bottom: 1px solid var(--line); font-family: var(--ui); }
.top-logo img { display: block; height: 48px; width: auto; }
.crumbs { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 17px; color: var(--dim); white-space: nowrap; overflow: hidden; padding-left: 26px; border-left: 1px solid var(--line); height: 40px; }
.crumbs a { color: var(--dim); text-decoration: none; }
.crumbs a:hover { color: var(--deep); text-decoration: underline; }
.crumbs a:last-child { color: var(--ink); font-weight: 600; }
.crumbs .sep { color: var(--faint); }
.parts { margin-left: auto; display: flex; gap: 26px; height: 100%; }
.parts a { display: flex; align-items: center; gap: 9px; height: 100%; color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; border-bottom: 3px solid transparent; padding-top: 3px; }
.parts a b { display: grid; place-items: center; width: 26px; height: 26px; border: 1.5px solid var(--line); border-radius: 3px; font-size: 14px; color: var(--dim); }
.parts a:hover { color: var(--deep); border-bottom-color: var(--wash); }
.parts a.on { color: var(--deep); border-bottom-color: var(--task); }
.parts a.on b { background: var(--green); border-color: var(--green); color: #fff; }

/* Part cover: a hero like the home page of vpa.org.ua — text left, a green-wash box with the steps right */
.cover { background: #fff; display: block; text-align: left; padding: 0; cursor: pointer; }
.cover > .hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 70px; align-items: center; height: 100%; padding: 0 110px; }
.cover .hero-main { display: flex; flex-direction: column; align-items: flex-start; }
.cover-k { text-align: left; font-size: 19px; letter-spacing: .14em; color: var(--deep); margin: 0 0 18px; }
.cover-t { text-align: left; margin: 0 0 22px; font: 700 66px/1.1 var(--serif); color: var(--ink); max-width: none; }
.cover-lead { margin: 0 0 36px; font-size: 25px; line-height: 1.5; color: var(--dim); max-width: 760px; }
.cover .go { gap: 14px; padding: 16px 34px; border-radius: 4px; font-size: 25px; font-weight: 600; background: var(--green); }
.cover:hover .go { background: var(--deep); }
.cover small { text-align: left; font-size: 18px; margin-top: 18px; }
.cover .legal { text-align: left; margin: 44px 0 0; max-width: 820px; font-size: 14px; }
.cover .ver { text-align: left; margin: 6px 0 0; }
.hero-side { background: var(--wash); border-radius: 4px; padding: 34px 38px; animation: rise .7s cubic-bezier(.2, .8, .2, 1) .3s backwards; }
.side-k { margin: 0 0 14px; font-size: 16px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--deep); }
.hero-side ol { margin: 0; padding: 0; list-style: none; counter-reset: s; border-left: 3px solid var(--green); }
.hero-side li { counter-increment: s; position: relative; padding: 8px 0 8px 54px; font-size: 22px; line-height: 1.3; color: var(--ink); }
.hero-side li::before { content: counter(s, decimal-leading-zero); position: absolute; left: 16px; top: 10px; font-size: 16px; font-weight: 700; color: var(--deep); font-variant-numeric: tabular-nums; }

/* Control strip: charcoal like the site footer, square controls, thin progress rule */
#bar { background: var(--char); border-top: 0; gap: 6px; padding: 0 22px; color: var(--char-t); }
#bar .icon { width: 44px; height: 44px; border: 0; border-radius: 3px; background: transparent; color: var(--char-t); }
#bar .icon svg { fill: var(--char-t); }
#bar .icon:hover { background: var(--char-2); }
#bar .icon:hover svg { fill: #fff; }
#bar .icon.home { width: auto; padding: 0 14px 0 10px; display: flex; gap: 10px; font-size: 15px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-right: 8px; border-right: 1px solid #44494d; border-radius: 0; }
#bar #bPlay { width: 52px; height: 44px; background: var(--green); margin-right: 4px; }
#bar #bPlay svg { fill: #fff; }
#bar #bPlay:hover { background: var(--deep); }
#bar .txt, #bar .cc { font-size: 15px; font-weight: 700; color: var(--char-t); }
#bar .cc[aria-pressed="true"] { background: var(--char-2); color: #fff; box-shadow: inset 0 -3px var(--task); }
.segs { gap: 3px; height: 30px; margin: 0 14px; }
.seg { height: 4px; border-radius: 0; background: #4a4f53; }
.seg:hover { height: 8px; }
.seg i { background: #e9ecea; }
.seg.ask { background: #5a4a3c; }
.seg.ask i { background: var(--task); }
.step { color: var(--char-t); font-size: 15px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; width: 330px; }
#bar .volume { border: 0; border-radius: 3px; background: transparent; color: var(--char-t); }
#bar .volume:hover { background: var(--char-2); }
#bar .volume input::-webkit-slider-runnable-track { background: linear-gradient(to right, #fff var(--volume, 100%), #6b7076 var(--volume, 100%)); }
#bar .volume input::-webkit-slider-thumb { background: #fff; }

/* Question cards: flat panels with a green rule, like notes in the textbook — no shadow, no guide */
.card { border-radius: 0 4px 4px 0; background: var(--soft); border: 0; border-left: 4px solid var(--green); box-shadow: none; padding: 24px 30px; }
.card.side > .head { padding-right: 0; }
.card .mascot { display: none; }
.kicker { font-size: 16px; font-weight: 700; letter-spacing: .12em; color: var(--deep) !important; margin-bottom: 8px; }
.prompt { font-family: var(--ui); }
.side .prompt { font-size: 25px; line-height: 1.4; color: var(--ink); }
.keys { font-size: 15px !important; color: var(--dim); }
kbd { border-width: 1px; border-radius: 3px; opacity: .55; }
.btn { border-radius: 4px; font-size: 20px; font-weight: 600; padding: 12px 26px; background: var(--green); }
.btn:hover { background: var(--deep); }
.btn.quiet { background: transparent; color: var(--deep); border: 0; box-shadow: inset 0 0 0 1.5px var(--green); }
.btn.quiet:hover { background: var(--wash); }
.btn kbd { opacity: .7; }
/* Answer options as list rows (like registry rows on the site), not chips */
.opts { flex-direction: column; gap: 0; border-top: 1px solid var(--line); }
.opt { width: 100%; justify-content: flex-start; gap: 16px; text-align: left; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent;
  padding: 14px 16px 14px 6px; min-height: 0; font-size: 23px; line-height: 1.35; }
.opt kbd { margin: 0; flex: none; min-width: 32px; padding: 2px 0; opacity: 1; border: 1.5px solid var(--line); color: var(--dim); background: #fff; font-size: 16px; }
.opt:hover:not(:disabled) { background: #fff; }
.opt:hover:not(:disabled) kbd { border-color: var(--green); color: var(--deep); }
.opt.good { background: var(--wash); box-shadow: inset 4px 0 var(--green); color: var(--ink); }
.opt.good kbd { background: var(--green); border-color: var(--green); color: #fff; }
.opt.bad { background: #fbeceb; color: var(--bad); box-shadow: inset 4px 0 var(--bad); }
.opt[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.grid .opt { width: auto; border: 1.5px solid var(--line); border-radius: 3px; padding: 6px 14px; font-size: 19px; justify-content: center; background: #fff; }
.grid .row { border-bottom-color: var(--line); }
.grid .row.cur { background: #fff; box-shadow: inset 3px 0 var(--green); }
.fb { font-size: 21px; padding: 0; }
.fb.ok, .fb.no { padding: 10px 14px; border-radius: 3px; margin-top: 12px; }
.fb.ok { background: var(--wash); color: var(--deep); }
.fb.no { background: var(--amber-wash); color: var(--amber); }
.numrow input.num { border-radius: 3px 3px 0 0; background: #fff; }
.sl input[type=range] { accent-color: var(--green); }
/* Full-screen self-check: a page with a big serif question */
.card.screen { background: #fff; border-left: 0; padding: 60px 110px; }
.screen .prompt { font: 700 40px/1.25 var(--serif); color: var(--ink); max-width: 1300px; }
.screen .body { margin-top: 34px; max-width: 1200px; }
.screen .opt { font-size: 26px; padding: 18px 20px 18px 8px; }
.screen .fb { left: 110px; bottom: 50px; }
.screen .acts { right: 110px; bottom: 44px; }

/* Finish: left-aligned page with the site's stat row */
.fin .finwrap { align-items: flex-start; text-align: left; justify-content: center; padding: 0 0 80px; }
.fin .kicker { font-size: 18px; }
.fin .prompt { font: 700 60px/1.12 var(--serif); margin: 4px 0 34px; }
.fin .stats { display: grid; grid-template-columns: repeat(3, 300px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fin .stat { padding: 22px 24px 22px 0; border-right: 1px solid var(--line); margin-right: 24px; }
.fin .stat:last-child { border-right: 0; }
.fin .stat b { display: block; font-size: 46px; font-weight: 700; line-height: 1.1; color: var(--deep); font-variant-numeric: tabular-nums; }
.fin .stat span { font-size: 17px; color: var(--dim); }
.fin .next-t { margin: 28px 0 0; font-size: 22px; color: var(--dim); }
.fin .next-t b { color: var(--ink); font-weight: 600; }
.fin .acts { margin-top: 22px; display: flex; gap: 14px; align-items: center; }
.fin .acts a.btn.quiet { box-shadow: none; text-decoration: underline; text-underline-offset: 5px; padding-left: 10px; }
.fin .legal { left: 110px; transform: none; text-align: left; width: 1100px; bottom: 30px; }
.fin .ver { right: 40px; }
/* Pause badge and help in the same flat style */
.paused-mark div { border-radius: 3px; box-shadow: none; border: 1px solid var(--line); }
.help { background: rgba(255, 255, 255, .92); }
.help-box { border-radius: 4px; box-shadow: none; border: 0; border-top: 4px solid var(--green); background: var(--soft); }
.help-box h2 { font-family: var(--serif); }
.caption { border-radius: 3px; background: rgba(43, 46, 49, .9); }
.grid .opts { flex-direction: row; gap: 8px; border-top: 0; }
.grid .opt { width: auto; border-bottom: 1.5px solid var(--line); }
.sl input[type=range]:focus-visible { outline: 2px solid var(--green); outline-offset: 6px; }
/* Обрана відповідь у таблиці «Так / Ні»: правило .grid .opt (білий фон) стоїть нижче й перебивало виділення — текст ставав білим на білому */
.grid .opt[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.grid .opt[aria-pressed="true"] kbd { background: transparent; border-color: rgba(255, 255, 255, .75); color: #fff; }
