/* ==========================================================
   Class 7 ICT · Section 2 · কম্পিউটার-সংশ্লিষ্ট যন্ত্রপাতি
   Theme: "পিসি-বিল্ড ওয়ার্কবেঞ্চ" — a computer-market repair bench
   where Rafi helps his uncle build a desktop part by part. Pale
   silkscreen page with faint copper PCB traces; PCB-green panels
   (top bar, hero, player); white cards that look like small boards
   with copper corner pads and a part-designator tag (U1, J2 …);
   LED colours mark each lesson group. Top bar: a strip of LEDs that
   light up as tasks are finished. Band কৌতূহলী (12–13).
   ========================================================== */
:root {
  --bg: #f1f4ec;
  --paper: #ffffff;
  --ink: #15261d;
  --ink-2: #4c5e54;
  --line: #cdd8cc;
  --pcb: #0f5d3a;
  --pcb-d: #0a3f27;
  --pcb-l: #1f7c52;
  --copper: #c8792e;
  --copper-d: #8f5119;
  --gold: #e2b23a;
  --solder: #b9c3c9;
  --blue: #2f6fd0;
  --blue-d: #1f4c94;
  --red: #d9413f;
  --red-d: #9b2a29;
  --violet: #7a4fc4;
  --violet-d: #553394;
  --led-g: #39c46a;
  --tab: var(--pcb);
  --ok: #1f8a46;
  --no: #c2373a;
  color-scheme: light;
}
* { box-sizing: border-box; }
body {
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    linear-gradient(90deg, rgba(200, 121, 46, .07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(200, 121, 46, .07) 1px, transparent 1px);
  background-size: 46px 46px;
}
::selection { background: rgba(226, 178, 58, .35); }
a { color: var(--blue-d); }
strong { color: var(--pcb); }
.muted { color: var(--ink-2); }
.small { font-size: var(--fs-sm); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: #111; padding: .5rem 1rem; z-index: 2000; }
.skip:focus { left: 8px; }
main, .wrap, .lesson-part > *, .row-ctrl > *, .grid2 > *, .sc-grid > *, .ms-grid > *, .bins2 > *, .so-bins > *, .pr-cards > * { min-width: 0; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: .4rem 1rem; flex-wrap: wrap; padding: .35rem var(--gutter); background: var(--pcb); color: #eaf6ee; border-bottom: 3px solid var(--copper); font-size: var(--fs-sm); }
.crumbs { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.crumbs a { color: #c9e6d3; text-decoration: none; }
.crumbs a:hover { color: #fff; text-decoration: underline; }
.crumbs [aria-current] { color: var(--gold); font-weight: 700; }
.level { display: flex; align-items: center; gap: .5rem; font-weight: 800; color: #fff; }
.level.pop { animation: bob .6s; }
@keyframes bob { 40% { transform: translateY(-4px) scale(1.06); } }
.leds { display: inline-flex; gap: 3px; padding: 3px 5px; border-radius: 4px; background: var(--pcb-d); }
.leds i { width: 7px; height: 7px; border-radius: 50%; background: #1a4a33; box-shadow: inset 0 0 0 1px #0c2f1f; }
.leds i.on { background: var(--led-g); box-shadow: 0 0 6px var(--led-g); }
.leds i.on:nth-child(3n+2) { background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.leds i.on:nth-child(3n) { background: #ff6b5e; box-shadow: 0 0 6px #ff6b5e; }
@media (max-width: 560px) { .leds { display: none; } }

/* hero */
.hero { padding: clamp(2rem, 5vw, 4rem) 0 2rem; }
.hero-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.05fr 1fr; } }
.eyebrow { display: inline-block; color: #fff; background: var(--pcb); font-weight: 700; padding: .1rem .9rem; border-radius: 4px; font-size: var(--fs-sm); box-shadow: 3px 3px 0 var(--copper); }
h1 { font-size: var(--fs-3xl); line-height: 1.3; margin: .6rem 0 1rem; color: var(--pcb-d); }
.lede { font-size: var(--fs-lg); line-height: 1.75; }
.hint { color: var(--ink-2); border-left: 4px solid var(--copper); padding-left: .8rem; }
.hero-fig { margin: 0; border-radius: 14px; overflow: hidden; border: 3px solid var(--copper); box-shadow: 0 0 0 6px #fff, 0 18px 40px rgba(10, 63, 39, .25); }
.hero-fig > svg { display: block; width: 100%; height: auto; }

/* sections */
.block { padding-block: clamp(1.6rem, 4vw, 3rem); }
.sec-title, .lesson-part h2, #compare h2, #activity h2, #quiz h2 { font-size: var(--fs-2xl); line-height: 1.4; margin: .5rem 0 1rem; color: var(--pcb-d); }
.sub-title { font-size: var(--fs-xl); margin: 2rem 0 .8rem; color: var(--pcb); }
.t-blue { --tab: var(--blue); }
.t-gold { --tab: #b8860b; }
.t-green { --tab: var(--pcb-l); }
.t-red { --tab: var(--red); }
.t-violet { --tab: var(--violet); }
.t-copper { --tab: var(--copper-d); }
.part-tag { display: inline-flex; align-items: center; gap: .5rem; margin: 0; font-weight: 800; color: var(--tab); background: #fff; padding: .1rem .9rem .1rem .2rem; border-radius: 4px; font-size: var(--fs-sm); border: 2px solid var(--tab); }
.part-tag .ref { display: inline-block; background: var(--tab); color: #fff; font-family: ui-monospace, Menlo, monospace; font-size: .85rem; padding: 0 .45rem; border-radius: 2px; letter-spacing: .05em; }
.goals { display: grid; gap: .6rem; padding: 0; list-style: none; grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr)); counter-reset: g; }
.goals li { position: relative; background: #fff; border-radius: 8px; padding: .7rem 1rem .7rem 2.9rem; border: 1px solid var(--line); box-shadow: 0 3px 0 var(--line); }
.goals li::before { counter-increment: g; content: counter(g, bengali); position: absolute; left: .75rem; top: .75rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--gold); color: #2a1c02; font-weight: 800; display: grid; place-items: center; font-size: .9rem; border: 2px solid var(--copper); }

/* card = small circuit board */
.card { position: relative; background: var(--paper); border-radius: 10px; padding: clamp(1rem, 3vw, 1.6rem); border: 1px solid var(--line); border-top: 5px solid var(--tab); box-shadow: 0 10px 24px rgba(15, 93, 58, .1); }
.card::before, .card::after { content: ""; position: absolute; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); border: 2px solid var(--copper); }
.card::before { left: 8px; } .card::after { right: 8px; }
.card h3 { margin: 0 0 .5rem; font-size: var(--fs-lg); display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; color: var(--ink); padding-inline: .6rem; }
.widget { margin: 1.6rem 0; }
.def { margin: 1rem 0; background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--tab); border-radius: 6px; padding: .8rem 1rem; }
.def b:first-child { color: var(--tab); }
.remember { margin: 1.4rem 0 .4rem; background: #fff8e3; border-radius: 8px; padding: .9rem 1rem; border: 2px dashed var(--copper); }
.remember > b:first-child { display: inline-block; background: var(--copper); color: #fff; padding: 0 .6rem; border-radius: 3px; margin-right: .4rem; }
.grid2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr)); align-items: start; }
.grid2 > .widget { margin: .6rem 0; }
.fig { display: block; width: 100%; height: auto; }
.fig-scroll { overflow-x: auto; margin: .4rem 0; -webkit-overflow-scrolling: touch; }
.fig-scroll > svg { min-width: 600px; }

/* controls */
.row-ctrl { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; margin: .7rem 0; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0; }
.chips button, .seg button { border: 2px solid var(--pcb); background: #fff; color: var(--pcb); border-radius: 999px; padding: .05rem .8rem; font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.chips button[aria-pressed="true"], .seg button[aria-selected="true"], .seg button[aria-checked="true"] { background: var(--pcb); color: #fff; }
.chips button.right { background: #e3f5e8; border-color: var(--ok); color: var(--ok); }
.chips button.wrong { background: #fde8e8; border-color: var(--no); color: var(--no); }
.chips button.miss { border-style: dashed; border-color: var(--ok); }
.seg { display: flex; flex-wrap: wrap; gap: .35rem; margin: .4rem 0 .8rem; }
.inp { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; flex-wrap: wrap; }
.inp input, .inp select { font: inherit; width: 10rem; max-width: 100%; padding: .15rem .55rem; border: 2px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); }
.inp select { width: auto; }
.slider { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; flex-wrap: wrap; }
.slider b { min-width: 2.4em; display: inline-block; text-align: center; color: var(--copper-d); }
.slider input { accent-color: var(--pcb); width: 11rem; max-width: 100%; }
.btn { font: inherit; font-weight: 800; border: 0; background: var(--pcb); color: #fff; padding: .3rem 1.05rem; border-radius: 6px; cursor: pointer; box-shadow: 0 4px 0 var(--pcb-d); }
.btn.blue { background: var(--blue); box-shadow: 0 4px 0 var(--blue-d); }
.btn.copper { background: var(--copper); box-shadow: 0 4px 0 var(--copper-d); }
.btn.red { background: var(--red); box-shadow: 0 4px 0 var(--red-d); }
.btn.violet { background: var(--violet); box-shadow: 0 4px 0 var(--violet-d); }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn.ghost { background: #fff; color: var(--ink); border: 2px solid var(--ink-2); box-shadow: none; }
.btn.ghost.right { background: #e3f5e8; border-color: var(--ok); color: var(--ok); }
.btn.ghost.wrong { background: #fde8e8; border-color: var(--no); color: var(--no); }
.btn[disabled] { opacity: .45; cursor: default; }
.msg { min-height: 1.8em; font-weight: 700; margin: .5rem 0; }
.msg.ok { color: var(--ok); } .msg.no { color: var(--no); }

/* story */
.story { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .story { grid-template-columns: 5rem 1fr; } }
.story-ic { width: 4.5rem; height: 4.5rem; }
.story p { margin: .4rem 0; }
.receipt { list-style: none; padding: 1rem 1.2rem; margin: 1rem 0 0; background: #fffdf5; border: 1px dashed #c9b994; border-radius: 4px; font-family: ui-monospace, Menlo, monospace, var(--bn-font); counter-reset: r; max-width: 40rem; box-shadow: 0 8px 18px rgba(0, 0, 0, .06); }
.receipt li { counter-increment: r; border-bottom: 1px dotted #d8cba8; }
.receipt a { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; color: var(--ink); text-decoration: none; font-family: var(--bn-font); }
.receipt a::before { content: counter(r, bengali) "."; color: var(--copper-d); font-weight: 800; min-width: 1.4rem; }
.receipt a span { margin-left: auto; color: var(--ink-2); font-size: var(--fs-sm); white-space: nowrap; }
.receipt a:hover { color: var(--pcb); }

/* keyboard */
.kb-screen { font-family: ui-monospace, Menlo, monospace; background: #0b2a1c; color: #9ff0bd; border-radius: 6px; padding: .5rem .8rem; min-height: 2.6rem; margin: .5rem 0; overflow-wrap: anywhere; white-space: pre-wrap; border: 3px solid #333; }
.kb-screen .caret { display: inline-block; width: .55em; height: 1.1em; background: #9ff0bd; vertical-align: -.15em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.kb-svg [data-key] { cursor: pointer; }
.kb-svg [data-key]:focus { outline: none; }
.kb-svg [data-key]:focus-visible rect { stroke: var(--gold); stroke-width: 3; }
.kb-groups { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.kb-groups span { border: 2px dashed var(--line); border-radius: 6px; padding: .05rem .7rem; font-size: var(--fs-sm); color: var(--ink-2); }
.kb-groups span.found { border-style: solid; color: #fff; }
.kb-groups span.found[data-g="letter"] { background: var(--blue); border-color: var(--blue); }
.kb-groups span.found[data-g="digit"] { background: var(--pcb-l); border-color: var(--pcb-l); }
.kb-groups span.found[data-g="sym"] { background: var(--violet); border-color: var(--violet); }
.kb-groups span.found[data-g="extra"] { background: var(--copper); border-color: var(--copper); }

/* mouse desk */
.ms-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 640px) { .ms-grid { grid-template-columns: 1fr 9rem; } }
.desk { position: relative; height: 15rem; border-radius: 8px; border: 6px solid #2b2f33; background: linear-gradient(160deg, #2a7d5b, #13563a); overflow: hidden; user-select: none; -webkit-user-select: none; }
.desk-icon { position: absolute; width: 5.6rem; display: flex; flex-direction: column; align-items: center; gap: .1rem; border: 2px solid transparent; border-radius: 6px; background: none; color: #fff; font: inherit; font-size: .9rem; padding: .3rem .2rem; cursor: pointer; text-shadow: 0 1px 2px #000; touch-action: manipulation; }
.desk-icon svg { width: 2.6rem; height: 2.6rem; }
.desk-icon.sel { background: rgba(120, 180, 255, .35); border-color: #9cc8ff; }
.win { position: absolute; right: .6rem; top: .6rem; bottom: .6rem; width: min(15rem, 62%); background: #fff; color: var(--ink); border-radius: 6px; box-shadow: 0 8px 18px rgba(0, 0, 0, .4); display: flex; flex-direction: column; animation: pop .3s; }
.win-bar { background: var(--blue); color: #fff; font-size: .85rem; padding: .15rem .5rem; border-radius: 6px 6px 0 0; display: flex; justify-content: space-between; align-items: center; }
.win-bar button { font: inherit; background: none; border: 0; color: #fff; cursor: pointer; font-weight: 800; }
.win-list { overflow-y: auto; flex: 1; padding: .2rem .6rem; font-size: .9rem; margin: 0; }
.win-list li { padding: .15rem 0; border-bottom: 1px solid #eee; }
.ms-mouse { width: 100%; max-width: 8rem; margin: 0 auto; display: block; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
.task-list { list-style: none; padding: 0; margin: .8rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.task-list li { position: relative; padding-left: 1.7rem; }
.task-list li::before { content: ""; position: absolute; left: 0; top: .35rem; width: 1.1rem; height: 1.1rem; border-radius: 3px; border: 2px solid var(--ink-2); }
.task-list li.done::before { background: var(--led-g); border-color: var(--ok); }
.task-list li.done::after { content: "✓"; position: absolute; left: .2rem; top: .05rem; color: #08361b; font-weight: 900; }

/* device chips */
.dv-chips button { padding: .15rem .9rem; }

/* scanner */
.sc-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr)); }
.sc-grid figure { margin: 0; text-align: center; }
.sc-grid canvas { width: 100%; height: auto; border-radius: 6px; border: 2px solid var(--line); background: #fff; image-rendering: pixelated; }
.sc-grid figcaption { font-size: var(--fs-sm); color: var(--ink-2); }
.copies { display: flex; flex-wrap: wrap; gap: .4rem; }

/* omr */
.omr-q { margin: .4rem 0; padding-left: 1.6rem; font-size: var(--fs-sm); }
.omr-q li { margin: .2rem 0; }
.omr-sheet { position: relative; background: #fff7f7; border: 2px solid #e6a3a3; border-radius: 6px; padding: .6rem .8rem; overflow: hidden; }
.omr-row { display: flex; align-items: center; gap: .6rem; padding: .25rem 0; border-bottom: 1px dashed #f0c4c4; }
.omr-row:last-child { border-bottom: 0; }
.omr-row .n { width: 1.6rem; font-weight: 800; color: #b44b4b; }
.omr-b { width: 2.1rem; height: 2.1rem; border-radius: 50%; border: 2px solid #c25b5b; background: #fff; color: #c25b5b; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; display: grid; place-items: center; padding: 0; }
.omr-b.fill { background: #1b1b1b; color: #1b1b1b; border-color: #1b1b1b; }
.omr-row .res { margin-left: auto; font-weight: 800; font-size: var(--fs-sm); }
.omr-row .res.ok { color: var(--ok); } .omr-row .res.no { color: var(--no); }
.omr-beam { position: absolute; left: 0; right: 0; height: 10px; top: -12px; background: linear-gradient(180deg, transparent, rgba(80, 255, 140, .8), transparent); pointer-events: none; }

/* byte ladder */
.ladder { list-style: none; padding: 0; margin: .8rem 0 0; display: grid; gap: .35rem; }
.ladder li { display: grid; grid-template-columns: 6.5rem 1fr; align-items: center; gap: .6rem; background: #fbfaf3; border: 1px solid var(--line); border-radius: 6px; padding: .35rem .7rem; }
.ladder li b { color: var(--copper-d); }
.ladder li span { font-family: ui-monospace, Menlo, monospace, var(--bn-font); overflow-wrap: anywhere; }
.ladder li.cur { background: #fff1c9; border-color: var(--gold); }
.ladder li .step { grid-column: 1 / -1; font-size: .85rem; color: var(--ink-2); margin-top: -.2rem; }

/* sorters */
.so-card { min-height: 3.6rem; display: flex; align-items: center; justify-content: center; text-align: center; font-size: var(--fs-lg); font-weight: 800; padding: .7rem 1rem; border-radius: 8px; background: #f7faf5; border: 2px dashed var(--line); margin: .6rem 0; }
.so-card.pop { animation: pop .35s; }
.so-card.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.bins2, .so-bins { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr)); margin-top: .6rem; }
.bins2 > div, .so-bins > div { background: #f7faf5; border: 1px solid var(--line); border-radius: 8px; padding: .5rem .8rem; min-height: 4rem; }
.bins2 ul, .so-bins ul { margin: .3rem 0 0; padding-left: 1.2rem; font-size: var(--fs-sm); }
.bins2 li, .so-bins li { animation: pop .3s; }
.sc-q { font-size: var(--fs-lg); font-weight: 800; min-height: 3.2em; }

/* chart */
.chart-box { position: relative; height: 320px; }

/* motherboard */
.tray { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.tray button { font: inherit; font-size: var(--fs-sm); font-weight: 700; padding: .25rem .8rem; border-radius: 6px; border: 2px solid var(--copper); background: #fff8ee; color: var(--copper-d); cursor: pointer; }
.tray button[aria-pressed="true"] { background: var(--copper); color: #fff; }
.tray button.used { display: none; }
.mb-slot { cursor: pointer; }
.mb-slot:focus { outline: none; }
.mb-slot:focus-visible .outline { stroke: var(--gold); stroke-width: 4; }
.mb-slot.shake { animation: shake .4s; }

/* cpu parts */
.parts3 { display: grid; gap: .6rem; padding: 0; list-style: none; counter-reset: p; }
.parts3 li { counter-increment: p; position: relative; background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--red); border-radius: 6px; padding: .6rem 1rem .6rem 2.8rem; }
.parts3 li::before { content: counter(p, bengali); position: absolute; left: .8rem; top: .65rem; width: 1.4rem; height: 1.4rem; display: grid; place-items: center; background: var(--red); color: #fff; border-radius: 50%; font-weight: 800; font-size: .85rem; }

/* ascii */
.as-out { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(min(9.5rem, 100%), 1fr)); margin: .6rem 0; }
.as-ch { background: #0b2a1c; color: #d6f5e0; border-radius: 6px; padding: .5rem; text-align: center; animation: pop .3s; }
.as-ch .c { font-size: 1.5rem; font-weight: 800; color: var(--gold); font-family: ui-monospace, Menlo, monospace; }
.as-ch .b { font-family: ui-monospace, Menlo, monospace; letter-spacing: .08em; font-size: 1rem; }
.as-ch > svg { width: 100%; height: 44px; display: block; margin-top: .3rem; }
.as-ch.uni { background: #2c1d4f; }
.as-ch .note { font-size: .8rem; color: #d8c8ff; }
.as-quiz { background: #f7faf5; border: 1px dashed var(--line); border-radius: 8px; padding: .6rem .8rem; }
.as-quiz .code { font-family: ui-monospace, Menlo, monospace; font-weight: 800; color: var(--pcb); letter-spacing: .08em; }

/* graphics & touch */
.gx-svg { max-width: 300px; margin: 0 auto; background: #10161c; border-radius: 8px; }
.phone { width: min(14rem, 100%); margin: .4rem auto; border: 8px solid #222; border-radius: 22px; background: #111; overflow: hidden; }
.ts-head { background: #fff; color: var(--ink); text-align: center; font-weight: 800; padding: .5rem; transition: background .3s, color .3s; }
.ts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; padding: .6rem; }
.ts-grid button { aspect-ratio: 1; border-radius: 10px; border: 0; cursor: pointer; position: relative; overflow: hidden; touch-action: manipulation; }
.ts-grid button::after { content: ""; position: absolute; inset: 0; margin: auto; width: 10%; height: 10%; border-radius: 50%; background: rgba(255, 255, 255, .7); opacity: 0; }
.ts-grid button.rip::after { animation: rip .5s; }
@keyframes rip { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(9); } }
.ts-log { font-size: var(--fs-sm); min-height: 3.4em; }
.ts-log b.in { color: var(--blue); } .ts-log b.out { color: var(--copper-d); }
.oc-list { margin: .4rem 0 0; padding-left: 1.6rem; }
.oc-list li { animation: pop .3s; }

/* printers */
.pr-cards { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr)); margin: 1rem 0; }
.card.mini { padding: 1rem 1rem .6rem; }
.card.mini b { color: var(--copper-d); display: block; padding-left: .8rem; }
.card.mini p { margin: .3rem 0; font-size: var(--fs-sm); }
.pr-bars { display: grid; gap: .45rem; margin-top: .6rem; }
.pr-bar { display: grid; grid-template-columns: 8.5rem 1fr 2.5rem; gap: .5rem; align-items: center; font-size: var(--fs-sm); font-weight: 700; }
.pr-bar .track { height: 1.1rem; background: #eef2ea; border-radius: 3px; overflow: hidden; border: 1px solid var(--line); }
.pr-bar .fillb { height: 100%; background: var(--copper); width: 0; transition: width .5s; }
.pr-bar.best .fillb { background: var(--pcb-l); }
.pr-bar.best { color: var(--pcb); }
@media (max-width: 420px) { .pr-bar { grid-template-columns: 6.5rem 1fr 2rem; } }

/* projector */
.pj-bars { display: grid; gap: .6rem; margin: .8rem 0 .3rem; }
.pj-bar { font-size: var(--fs-sm); }
.pj-bar .track { height: 1.2rem; background: #eef2ea; border-radius: 3px; overflow: hidden; border: 1px solid var(--line); margin-top: .15rem; }
.pj-bar .fillb { height: 100%; transition: width .5s; }

/* player */
.player { border-radius: 14px; background: var(--pcb-d); padding: clamp(.5rem, 2vw, 1rem); color: #fff; border: 3px solid var(--copper); }
.stage { position: relative; border-radius: 8px; overflow: hidden; }
.stage svg:not(.ic) { width: 100%; height: auto; display: block; }
.big-play { position: absolute; inset: 0; margin: auto; width: 5.5rem; height: 5.5rem; border-radius: 50%; border: 4px solid #fff; background: var(--copper); color: #fff; display: grid; place-items: center; cursor: pointer; }
.big-play .ic { width: 2.4rem; height: 2.4rem; }
.big-play.hide { display: none; }
.caption { min-height: 3.6em; margin: .75rem .25rem; font-size: var(--fs-lg); line-height: 1.6; }
.controls { display: flex; align-items: center; gap: .6rem; }
.ctrl { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 0; background: var(--gold); color: #2a1c02; display: grid; place-items: center; cursor: pointer; flex: none; }
.controls input { flex: 1; min-width: 0; accent-color: var(--gold); }
.time { font-variant-numeric: tabular-nums; font-size: var(--fs-sm); white-space: nowrap; }
.chapters { display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; margin: .75rem 0 0; list-style: none; }
.chapters button { border: 1px solid rgba(255, 255, 255, .45); background: transparent; color: #dff2e6; border-radius: 999px; padding: .1rem .7rem; font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.chapters button.on { background: var(--gold); border-color: var(--gold); color: #2a1c02; }

/* table */
.table-wrap { overflow-x: auto; }
.cmp { width: 100%; border-collapse: collapse; background: #fff; min-width: 34rem; }
.cmp th, .cmp td { border: 1px solid var(--line); padding: .5rem .7rem; text-align: left; vertical-align: top; }
.cmp thead th { background: var(--pcb); color: #fff; }
.cmp td:first-child { font-weight: 800; color: var(--pcb-d); }
.tag { display: inline-block; padding: 0 .55rem; border-radius: 3px; font-size: .85rem; font-weight: 700; color: #fff; white-space: nowrap; }
.tag.in { background: var(--blue); } .tag.out { background: var(--copper); } .tag.io { background: var(--violet); }
.tag.mem { background: #b8860b; } .tag.st { background: var(--pcb-l); } .tag.pr { background: var(--red); }

/* quiz */
.score-pill { display: inline-block; background: var(--pcb); color: #fff; padding: .1rem .9rem; border-radius: 999px; font-weight: 700; }
.lk-q { background: #fff; border-radius: 8px; padding: 1rem; margin: .8rem 0; border: 1px solid var(--line); border-left: 5px solid var(--copper); }
.lk-q-stem { font-weight: 700; margin-bottom: .6rem; }
.lk-opts { display: grid; gap: .45rem; grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr)); }
.lk-opt { display: flex; gap: .6rem; align-items: center; text-align: left; font: inherit; padding: .45rem .7rem; border: 2px solid var(--line); border-radius: 8px; background: #fbfcfa; color: var(--ink); cursor: pointer; }
.lk-opt:hover { border-color: var(--pcb); }
.lk-opt-key { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--pcb); color: #fff; flex: none; font-size: .95rem; font-weight: 800; }
.lk-opt.is-right { border-color: var(--ok); background: #e3f5e8; }
.lk-opt.is-wrong { border-color: var(--no); background: #fde8e8; }
.lk-explain { margin: .6rem 0 0; }
.lk-explain.ok { color: var(--ok); } .lk-explain.no { color: var(--no); }
.qa details, .cq-parts details { background: #fff; border-radius: 8px; padding: .6rem .9rem; margin: .5rem 0; border: 1px solid var(--line); border-left: 5px solid var(--gold); }
.cq .cq-parts details { background: #fbfaf3; }
.qa summary, .cq-parts summary { cursor: pointer; font-weight: 700; }
.qa details p, .cq-parts details p { margin: .6rem 0 .2rem; }
.cq { margin: 1rem 0; }
.cq-stem { font-weight: 700; padding-inline: .6rem; }
.cq-parts { list-style: none; padding: 0; }
.summary ul { padding-left: 1.3rem; }
.summary li { margin: .4rem 0; }
.summary h2 { margin-top: 0; padding-inline: .6rem; }

.pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: 2rem 1rem; }
.pager-btn { display: inline-block; padding: .5rem 1.1rem; border-radius: 6px; background: var(--pcb); color: #fff; text-decoration: none; font-weight: 700; box-shadow: 0 4px 0 var(--pcb-d); }
.pager-btn.disabled { background: #dfe6dc; color: #5f6f65; box-shadow: none; }
.credit { color: var(--ink-2); font-size: var(--fs-sm); padding-bottom: 2rem; }

[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .6s, transform .6s; }
[data-reveal].is-in { opacity: 1; transform: none; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.spin { animation: spin 1.2s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
