/* ==========================================================
   Class 7 Science · Section 2 · উদ্ভিদ ও প্রাণীর কোষীয় সংগঠন
   Theme: "কোষ নগরী" — light toy-city map, chunky cards, hard shadows (age ~12)
   ========================================================== */
:root {
  --paper: #fffaf0;
  --paper-2: #fff3dc;
  --ink: #1d2433;
  --ink-2: #4a5468;
  --mint: #3ddc97;
  --tangerine: #ff8a3d;
  --grape: #7b5cff;
  --sky: #38bdf8;
  --lemon: #ffd23f;
  --rose: #ff5d8f;
  --line: #1d2433;
  --hard: 4px 4px 0 var(--ink);
  --hard-lg: 7px 7px 0 var(--ink);
}

body {
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(29, 36, 51, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 36, 51, .045) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--ink);
}
::selection { background: var(--lemon); }
strong { color: #b4237a; }
a { color: var(--grape); }
.muted { color: var(--ink-2); }
.small { font-size: var(--fs-sm); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--lemon); color: var(--ink); padding: .5rem 1rem; border: 2.5px solid var(--ink); border-radius: var(--r-sm); z-index: 2000; }
.skip:focus { left: 8px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .5rem var(--gutter); background: #fff; border-bottom: 3px solid var(--ink); font-size: var(--fs-sm); }
.crumbs { display: flex; gap: .5rem; color: var(--ink-2); }
.crumbs [aria-current] { color: var(--grape); font-weight: 700; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--grape); text-decoration: underline; }
.passport { display: flex; align-items: center; gap: .6rem; }
.passport-label { font-weight: 600; }
.passport ol { display: flex; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.passport li { width: 2.1rem; height: 2.1rem; display: grid; place-items: center; border-radius: 8px; border: 2px dashed #b9bfcc; background: #f4f5f8; transform: rotate(-4deg); filter: grayscale(1) opacity(.45); transition: all .4s; }
.passport li:nth-child(even) { transform: rotate(5deg); }
.passport li .ic { width: 1.3rem; height: 1.3rem; vertical-align: 0; }
.passport li.earned { filter: none; border: 2.5px solid var(--ink); background: var(--lemon); box-shadow: 2px 2px 0 var(--ink); animation: stamp .5s; }
@keyframes stamp { 0% { transform: scale(2) rotate(-20deg); opacity: 0; } 70% { transform: scale(.9) rotate(3deg); opacity: 1; } }
@media (max-width: 560px) { .passport-label { display: none; } .passport li { width: 1.8rem; height: 1.8rem; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: .45rem; padding: .7rem 1.3rem; border-radius: 14px; border: 2.5px solid var(--ink); background: #fff; color: var(--ink); font-weight: 700; text-decoration: none; box-shadow: var(--hard); transition: transform .15s, box-shadow .15s; }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn-primary { background: var(--lemon); }
.btn-small { padding: .45rem 1rem; font-size: var(--fs-sm); background: var(--mint); }
.seg { display: inline-flex; border: 2.5px solid var(--ink); border-radius: 14px; overflow: hidden; box-shadow: var(--hard); background: #fff; }
.seg-btn { border: 0; background: transparent; padding: .5rem 1rem; font-weight: 600; font-size: var(--fs-sm); }
.seg-btn + .seg-btn { border-left: 2.5px solid var(--ink); }
.seg-btn[aria-pressed="true"], .seg-btn[aria-selected="true"] { background: var(--mint); }

/* ---------- hero ---------- */
.hero { position: relative; padding-block: var(--sp-8) var(--sp-9); overflow: hidden; }
.hero-grid { display: grid; gap: var(--sp-6); align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1fr 1.05fr; } }
.eyebrow { display: inline-block; background: #fff; border: 2.5px solid var(--ink); border-radius: 999px; padding: .1rem .9rem; font-weight: 600; box-shadow: 3px 3px 0 var(--ink); }
.hero h1 { font-size: var(--fs-3xl); line-height: 1.25; margin-top: var(--sp-5); }
.hero h1 span { display: inline-block; background: var(--mint); padding: 0 .3em; border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--hard-lg); transform: rotate(-1.5deg); margin-top: .2em; }
.hero-sub { font-size: var(--fs-lg); color: var(--ink-2); max-width: 34rem; }
.hero-sub b { color: var(--ink); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: var(--sp-5); }
.hero-cell { position: relative; margin: 0; }
#hero-cell svg:not(.ic) { width: 100%; height: auto; filter: drop-shadow(8px 8px 0 rgba(29, 36, 51, .9)); }
.tag { position: absolute; background: #fff; border: 2.5px solid var(--ink); border-radius: 12px; padding: .1rem .7rem; font-weight: 700; font-size: .9rem; box-shadow: 3px 3px 0 var(--ink); animation: bob 3.5s ease-in-out infinite; white-space: nowrap; }
.tag.t1 { top: -6%; left: 18%; background: #ffe0c7; }
.tag.t2 { bottom: -7%; right: 4%; background: #e8e0ff; animation-delay: -1.2s; }
.tag.t3 { bottom: -7%; left: 6%; background: #ffd9e6; animation-delay: -2.2s; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.hero-road { position: absolute; left: 0; right: 0; bottom: 18px; height: 22px; background: #6f7d86; border-block: 3px solid var(--ink);
  background-image: linear-gradient(90deg, var(--lemon) 0 40px, transparent 40px 80px); background-size: 80px 4px; background-repeat: repeat-x; background-position: 0 center; animation: road 3s linear infinite; }
@keyframes road { to { background-position: -80px center; } }

/* organelle wobble inside SVG cells */
.cellsvg [data-o] { cursor: pointer; transition: filter .2s; }
.cellsvg .wob { animation: wob 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.cellsvg .wob:nth-of-type(2n) { animation-delay: -1.3s; } .cellsvg .wob:nth-of-type(3n) { animation-delay: -2.6s; }
@keyframes wob { 50% { transform: translate(2px, -3px) rotate(3deg); } }
.cellsvg [data-o].hl { filter: drop-shadow(0 0 0 #000) drop-shadow(0 0 6px #ff8a3d) drop-shadow(0 0 3px #ff8a3d); }
.cellsvg .pin { animation: bob 3.2s ease-in-out infinite; pointer-events: none; }
.cellsvg [data-o]:hover { filter: drop-shadow(0 0 5px rgba(123, 92, 255, .8)); }

/* ---------- generic ---------- */
.block { padding-block: var(--sp-8); }
.lesson-part.alt { background: rgba(255, 243, 220, .7); border-block: 3px solid var(--ink); }
.block h2 { font-size: var(--fs-2xl); }
.part-tag { display: inline-block; background: var(--grape); color: #fff; font-weight: 700; padding: .1rem .9rem; border-radius: 10px; border: 2.5px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); font-size: var(--fs-sm); margin-bottom: var(--sp-3); }
.sec-title { font-size: var(--fs-xl) !important; }
.chip { display: inline-block; border: 2.5px solid var(--ink); border-radius: 10px; padding: 0 .6rem; box-shadow: 3px 3px 0 var(--ink); margin-inline-end: .4rem; transform: rotate(-3deg); }
.chip-lemon { background: var(--lemon); }
.sub-title { font-size: var(--fs-xl); margin-top: var(--sp-7); }
.grid-2 { display: grid; gap: var(--sp-5); margin-top: var(--sp-5); align-items: start; }
@media (min-width: 860px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.card { background: #fff; border: 2.5px solid var(--ink); border-radius: var(--r-lg); padding: 1.2rem 1.4rem; box-shadow: var(--hard); }
.card h3 { font-size: var(--fs-lg); }
.card h4 { margin-bottom: .4rem; }
.card ul { margin: 0; padding-inline-start: 1.2rem; }
.card li { margin-bottom: .35rem; }
.job { background: var(--paper-2); border-radius: var(--r-md); padding: .6rem .9rem; margin: 0; }
.def { background: #e8e0ff; border: 2.5px solid var(--ink); border-radius: var(--r-md); padding: .9rem 1.1rem; margin-bottom: 1rem; box-shadow: var(--hard); }
.remember { margin-top: var(--sp-5); background: #dcfce9; border: 2.5px solid var(--ink); border-radius: var(--r-md); padding: 1rem 1.2rem; box-shadow: var(--hard); }
.remember b:first-child { display: inline-block; background: var(--mint); border: 2px solid var(--ink); border-radius: 8px; padding: 0 .5rem; margin-inline-end: .5rem; font-size: var(--fs-sm); }
.new-words { margin-top: var(--sp-5); }
.new-words b { background: var(--lemon); padding: 0 .4rem; border-radius: 6px; }
.analogy { display: inline-block; font-size: .9rem; background: var(--paper-2); border: 2px dashed var(--ink-2); border-radius: 10px; padding: .05rem .6rem; color: var(--ink-2); }

[data-reveal] { opacity: 0; transform: translateY(26px) scale(.98); transition: opacity .6s ease, transform .6s cubic-bezier(.3, 1.4, .5, 1); }
[data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- outcomes: metro route ---------- */
.route { list-style: none; padding: 0; margin: var(--sp-5) 0 0; display: grid; gap: .8rem; counter-reset: r; position: relative; }
@media (min-width: 900px) { .route { grid-template-columns: repeat(5, 1fr); } .route::before { content: ""; position: absolute; top: 1.15rem; left: 5%; right: 5%; height: 6px; background: var(--grape); border: 2px solid var(--ink); border-radius: 6px; } }
.route li { position: relative; counter-increment: r; background: #fff; border: 2.5px solid var(--ink); border-radius: var(--r-md); padding: 2.6rem .9rem .9rem; box-shadow: var(--hard); line-height: 1.6; }
.route li::before { content: counter(r, bengali); position: absolute; top: -.2rem; left: .9rem; width: 2.4rem; height: 2.4rem; display: grid; place-items: center; background: var(--lemon); border: 2.5px solid var(--ink); border-radius: 50%; font-weight: 800; }

/* ---------- story ---------- */
.story { display: grid; gap: 1.5rem; align-items: center; background: #fff; border: 3px solid var(--ink); border-radius: var(--r-xl); padding: clamp(1.2rem, 4vw, 2.4rem); box-shadow: var(--hard-lg); }
@media (min-width: 820px) { .story { grid-template-columns: 220px 1fr; } }
.bricks { width: 100%; max-width: 220px; margin-inline: auto; }
.bricks rect.b { transform-box: fill-box; transform-origin: center; animation: drop .5s cubic-bezier(.3, 1.6, .5, 1) both; }

@keyframes drop { from { transform: translateY(-60px); opacity: 0; } }

/* ---------- tree diagrams ---------- */
.tree { margin-top: var(--sp-5); text-align: center; overflow-x: auto; padding-bottom: .5rem; }
.t-node { display: inline-block; background: #fff; border: 2.5px solid var(--ink); border-radius: 12px; padding: .35rem .9rem; font-weight: 700; box-shadow: 3px 3px 0 var(--ink); line-height: 1.4; }
.t-node small { display: block; font-weight: 400; font-size: .8rem; color: var(--ink-2); }
.t-root { background: var(--lemon); }
.t-wall { background: #c9f2b8; }
.t-proto { background: #e8e0ff; }
.t-kids { display: flex; justify-content: center; gap: .8rem; margin-top: 1.4rem; position: relative; }
.t-branch { position: relative; padding-top: 1rem; }
.t-branch::before { content: ""; position: absolute; top: -1rem; left: 50%; height: 2rem; border-left: 2.5px solid var(--ink); }
.t-kids::before { content: ""; position: absolute; top: -1rem; left: 25%; right: 25%; border-top: 2.5px solid var(--ink); }
.t-branch .t-kids { margin-top: 1.4rem; }

/* ---------- water chart ---------- */
.water { display: grid; gap: 1rem; align-items: center; margin-top: var(--sp-5); }
@media (min-width: 760px) { .water { grid-template-columns: 1.3fr .7fr; } }
.water-chart { max-width: 240px; margin-inline: auto; width: 100%; }
.slider-row { display: grid; gap: .3rem; margin: .6rem 0; }
.slider-row input { width: 100%; accent-color: var(--grape); }

/* ---------- explorer ---------- */
.explorer { margin-top: var(--sp-7); background: #fff; border: 3px solid var(--ink); border-radius: var(--r-xl); padding: clamp(1rem, 3vw, 1.8rem); box-shadow: var(--hard-lg); }
.explorer-head, .three-head { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.explorer-head h3, .three-head h3 { margin: 0; font-size: var(--fs-lg); }
.explorer-body { display: grid; gap: 1.2rem; align-items: start; }
@media (min-width: 900px) { .explorer-body { grid-template-columns: 1.35fr .65fr; } }
.cell-map svg:not(.ic) { width: 100%; height: auto; }
.o-info { background: var(--paper-2); border: 2.5px solid var(--ink); border-radius: var(--r-lg); padding: 1rem 1.1rem; min-height: 14rem; box-shadow: var(--hard); }
.o-info h4 { display: flex; align-items: center; gap: .5rem; font-size: var(--fs-lg); margin-bottom: .4rem; }
.o-info .ic { width: 2.2rem; height: 2.2rem; }
.o-info p { margin-bottom: .6rem; }
.o-info .where { font-size: .9rem; color: var(--ink-2); }
.o-chips { display: flex; flex-wrap: wrap; gap: .45rem; margin: 1rem 0 .5rem; }
.o-chips button { border: 2px solid var(--ink); background: #fff; border-radius: 999px; padding: .15rem .8rem; font-size: .92rem; box-shadow: 2px 2px 0 var(--ink); }
.o-chips button.on { background: var(--tangerine); color: #fff; }

/* ---------- 3D ---------- */
.three-box { margin-top: var(--sp-6); background: #fff; border: 3px solid var(--ink); border-radius: var(--r-xl); padding: clamp(1rem, 3vw, 1.8rem); box-shadow: var(--hard-lg); }
.cell3d { position: relative; height: 420px; border: 2.5px solid var(--ink); border-radius: var(--r-lg); background: radial-gradient(circle at 50% 40%, #fff, #e9f3ff 70%); overflow: hidden; touch-action: none; }
.cell3d canvas { width: 100% !important; height: 100% !important; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-2); }
.three-info { margin: .8rem 0 0; background: var(--paper-2); border-radius: var(--r-md); padding: .6rem .9rem; min-height: 3.2em; }

/* ---------- organelle departments ---------- */
.dept { background: #fff; border: 3px solid var(--ink); border-radius: var(--r-xl); padding: clamp(1rem, 3vw, 1.8rem); box-shadow: var(--hard-lg); margin-bottom: var(--sp-6); }
.dept-head { display: flex; gap: .9rem; align-items: center; margin: calc(-1 * clamp(1rem, 3vw, 1.8rem)) calc(-1 * clamp(1rem, 3vw, 1.8rem)) 1rem; padding: .9rem clamp(1rem, 3vw, 1.8rem); background: var(--c); border-bottom: 3px solid var(--ink); border-radius: calc(var(--r-xl) - 3px) calc(var(--r-xl) - 3px) 0 0; }
.dept-head h3 { margin: 0; font-size: var(--fs-xl); }
.dept-head .analogy { background: rgba(255, 255, 255, .7); }
.ptree { margin: 1.2rem 0; display: grid; justify-items: center; gap: .9rem; }
.pt { background: #fff; border: 2.5px solid var(--ink); border-radius: 12px; padding: .35rem .9rem; font-weight: 700; text-align: center; box-shadow: 3px 3px 0 var(--ink); line-height: 1.4; }
.pt small { display: block; font-weight: 400; font-size: .8rem; color: var(--ink-2); }
.pt-root { background: var(--lemon); }
.pt-color { background: #ffe0c7; }
.pt-green { background: #c9f2b8; }
.pt-red { background: #ffc9c4; }
.pt-white { background: #f4f5f8; }
.pt-row { display: flex; gap: .8rem; flex-wrap: wrap; justify-content: center; align-items: flex-start; }
.pt-col { display: grid; justify-items: center; gap: .7rem; }
.chloro-fig, .mito-fig { margin: 0; }
.chloro-fig figcaption, .mito-fig figcaption, .nucleus-fig figcaption, .root-fig figcaption, .neuron-fig figcaption { font-size: .9rem; color: var(--ink-2); margin-top: .4rem; text-align: center; }
.grana g { animation: wob 5s ease-in-out infinite; transform-box: fill-box; }
.mito-fig .sparks { animation: flash 1.2s steps(2) infinite; }
@keyframes flash { 50% { opacity: .1; } }
.mito-fig .cristae { animation: breathe 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes breathe { 50% { transform: scaleY(.94); } }

.labs2 { display: grid; gap: 1rem; margin-top: 1.4rem; }
@media (min-width: 860px) { .labs2 { grid-template-columns: 1fr 1fr; } }
.mini-lab { background: var(--paper-2); border: 2.5px solid var(--ink); border-radius: var(--r-lg); padding: 1rem 1.2rem; box-shadow: var(--hard); }
.mini-lab h4 { font-size: var(--fs-lg); margin-bottom: .3rem; }
.tomato-stage { display: flex; gap: 1rem; align-items: center; justify-content: center; }
#tomato-svg { width: 150px; }
.zoom-cell { text-align: center; }
.zoom-cell svg { width: 110px; }
.grass-stage svg:not(.ic) { width: 100%; max-width: 360px; display: block; margin: .4rem auto; background: linear-gradient(#e6f6ff, #fffaf0); border: 2.5px solid var(--ink); border-radius: var(--r-md); }
.brick-g { transition: transform .8s cubic-bezier(.3, 1.4, .5, 1), opacity .5s; }
.brick-g.off { transform: translate(110px, -70px) rotate(25deg); opacity: 0; }
.grass-blade { transition: fill 1.6s ease; }
.row-btns { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.status-pill { background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: .1rem .8rem; font-size: .9rem; }

.dept-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.mini-dept { background: #fff; border: 2.5px solid var(--ink); border-radius: var(--r-lg); padding: 1.1rem 1.2rem; box-shadow: var(--hard); border-top: 12px solid var(--c); transition: transform .2s; }
.mini-dept:hover { transform: translateY(-4px) rotate(-.6deg); }
.mini-dept h3 { margin: .4rem 0 .3rem; font-size: var(--fs-lg); }
.mini-dept p { line-height: 1.7; }

/* ---------- nucleus ---------- */
.n-parts { display: grid; gap: .5rem; margin: 1rem 0; }
.n-parts button { text-align: start; background: #fff; border: 2.5px solid var(--ink); border-radius: var(--r-md); padding: .55rem .9rem; font-weight: 600; box-shadow: 3px 3px 0 var(--ink); display: flex; gap: .6rem; align-items: center; }
.n-parts button span { width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center; background: #e8e0ff; border: 2px solid var(--ink); font-size: .85rem; font-family: serif; }
.n-parts button[aria-selected="true"] { background: var(--grape); color: #fff; }
.n-info { background: #e8e0ff; border: 2.5px solid var(--ink); border-radius: var(--r-md); padding: .9rem 1.1rem; min-height: 6.5em; box-shadow: var(--hard); }
.nucleus-fig { margin: 0; }
#nucleus-svg { width: 100%; max-width: 340px; display: block; margin-inline: auto; }
.np { transition: opacity .3s, filter .3s; cursor: pointer; }
#nucleus-svg.focus .np { opacity: .25; }
#nucleus-svg.focus .np.on { opacity: 1; filter: drop-shadow(0 0 6px #ff8a3d); }
.np-chromatin path { stroke-dasharray: 6 4; animation: drift 6s linear infinite; }
@keyframes drift { to { stroke-dashoffset: -60; } }

/* ---------- sorter ---------- */
.sorter { margin-top: var(--sp-7); background: linear-gradient(135deg, #e8e0ff, #dcfce9); border: 3px solid var(--ink); border-radius: var(--r-xl); padding: clamp(1rem, 3vw, 2rem); box-shadow: var(--hard-lg); }
.sorter h3 { font-size: var(--fs-lg); }
.sort-card { min-height: 6rem; display: grid; place-items: center; text-align: center; background: #fff; border: 3px solid var(--ink); border-radius: var(--r-lg); padding: 1rem; font-size: var(--fs-lg); font-weight: 700; margin: 1rem auto; max-width: 34rem; box-shadow: var(--hard); }
.sort-card.pop { animation: popin .4s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes popin { from { transform: scale(.7); opacity: 0; } }
.sort-btns { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; }
.b-plant { background: #c9f2b8; } .b-animal { background: #ffd9e6; } .b-both { background: var(--lemon); }
.sort-fb { text-align: center; min-height: 3em; margin-top: .8rem; }
.poster { margin-top: 1rem; background: #fff; border: 3px solid var(--ink); border-radius: var(--r-lg); padding: 1rem 1.2rem; box-shadow: var(--hard); }
.poster-cols { display: grid; gap: .8rem; }
@media (min-width: 760px) { .poster-cols { grid-template-columns: repeat(3, 1fr); } }
.poster h5 { margin: 0 0 .3rem; font-size: 1rem; background: var(--paper-2); border-radius: 8px; padding: .1rem .6rem; }
.poster ul { margin: 0; padding-inline-start: 1.1rem; font-size: .95rem; }

.table-scroll { overflow-x: auto; margin-top: var(--sp-6); border: 3px solid var(--ink); border-radius: var(--r-lg); background: #fff; box-shadow: var(--hard); }
.cmp { border-collapse: collapse; width: 100%; min-width: 560px; line-height: 1.55; }
.cmp caption { text-align: start; padding: .9rem 1.1rem; font-weight: 800; font-size: var(--fs-lg); }
.cmp th, .cmp td { padding: .65rem .9rem; border-top: 2px solid var(--ink); text-align: start; vertical-align: top; }
.cmp thead th { background: var(--lemon); }
.cmp thead th:nth-child(2) { background: #c9f2b8; } .cmp thead th:nth-child(3) { background: #ffd9e6; }
.cmp tbody th { background: var(--paper-2); }

/* ---------- plant tissue ---------- */
.root-fig { margin: 0; text-align: center; }
#root-svg { width: 100%; max-width: 270px; display: block; margin-inline: auto; }
.root-fig .btn { margin-top: .6rem; }
.t-card h3 { display: inline-block; padding: 0 .6rem; border: 2.5px solid var(--ink); border-radius: 10px; box-shadow: 3px 3px 0 var(--ink); }
.t-card.meri h3 { background: #ffe0c7; } .t-card.perm h3 { background: #c9f2b8; }
.cells-strip { max-width: 240px; margin-top: .8rem; }
.perm-tree { margin-top: var(--sp-6); display: grid; justify-items: center; gap: .9rem; }
.pt-row.three { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr)); width: 100%; max-width: 52rem; }
.perm-tree > *, .ptree > * { max-width: 100%; }
.pt { min-width: 0; overflow-wrap: anywhere; }

/* ---------- animal tissue ---------- */
.four { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; margin: var(--sp-5) 0 1rem; }
.four-btn { display: grid; justify-items: center; gap: .3rem; background: #fff; border: 2.5px solid var(--ink); border-radius: var(--r-lg); padding: .8rem .4rem; font-weight: 700; box-shadow: var(--hard); transition: transform .15s; }
.four-btn[aria-selected="true"] { background: var(--c); transform: translateY(-4px); box-shadow: 6px 8px 0 var(--ink); }
@media (max-width: 560px) { .four-btn { font-size: .85rem; } .four-btn .ic-lg { width: 2rem; height: 2rem; } }
.t-panel { background: #fff; border: 3px solid var(--ink); border-radius: var(--r-xl); padding: clamp(1rem, 3vw, 1.8rem); box-shadow: var(--hard-lg); animation: popin .35s ease; }
.t-panel h3 { font-size: var(--fs-xl); }
.t-panel .card { box-shadow: 3px 3px 0 var(--ink); }
.epi-svg { margin-top: .8rem; width: 100%; max-width: 300px; }
.elbow { display: grid; gap: 1rem; align-items: center; background: var(--paper-2); border: 2.5px solid var(--ink); border-radius: var(--r-lg); padding: 1rem; margin: 1rem 0; }
@media (min-width: 760px) { .elbow { grid-template-columns: 1.1fr .9fr; } }
#elbow-svg { width: 100%; max-width: 360px; }
#biceps { transition: rx .25s, ry .25s; }
.muscles { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin: 1rem 0; }
.m-card, .c-card { background: var(--paper-2); border: 2.5px solid var(--ink); border-radius: var(--r-lg); padding: 1rem; box-shadow: 3px 3px 0 var(--ink); }
.m-card h4, .c-card h4 { margin: .3rem 0; }
.m-card p, .c-card p { margin: 0; line-height: 1.7; }
.beat { animation: beat 1s ease-in-out infinite; transform-origin: center; }
@keyframes beat { 15% { transform: scale(1.18); } 30% { transform: scale(1); } 45% { transform: scale(1.1); } }
.cols-2 { columns: 2 16rem; }
.conn-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin-top: 1rem; }

/* ---------- nerve + video ---------- */
.video-block { background: #241b4d; color: #fff; border-block: 3px solid var(--ink); background-image: radial-gradient(rgba(255, 255, 255, .08) 1.5px, transparent 1.5px); background-size: 26px 26px; }
.video-block h2 { color: #fff; }
.video-block .part-tag { background: var(--lemon); color: var(--ink); }
.video-block .card { color: var(--ink); }
.neuron-row { margin-bottom: var(--sp-6); align-items: center; }
.neuron-fig { margin: 0; background: #fff; border: 3px solid var(--ink); border-radius: var(--r-lg); padding: .8rem; box-shadow: 6px 6px 0 #000; }
.player { background: #fff; border: 3px solid var(--ink); border-radius: var(--r-xl); overflow: hidden; box-shadow: 8px 8px 0 #000; color: var(--ink); }
.stage { position: relative; aspect-ratio: 16 / 9; background: #fff8e8; border-bottom: 3px solid var(--ink); }
#scene { width: 100%; height: 100%; font-family: var(--bn-font); }
.big-play { position: absolute; inset: 0; margin: auto; width: 5.2rem; height: 5.2rem; border-radius: 50%; border: 3px solid var(--ink); background: var(--lemon); box-shadow: var(--hard); display: grid; place-items: center; transition: transform .15s, opacity .3s; }
.big-play:hover { transform: scale(1.06); }
.big-play.hide { opacity: 0; pointer-events: none; }
.big-play .ic { width: 2.2rem; height: 2.2rem; margin-left: .2rem; vertical-align: 0; color: var(--ink); }
.caption { margin: 0; padding: .9rem 1.2rem; font-size: var(--fs-lg); min-height: 4.4em; line-height: 1.6; border-bottom: 2.5px solid var(--ink); background: #fffaf0; }
.controls { display: flex; align-items: center; gap: .6rem; padding: .6rem 1rem; }
.ctrl { width: 2.6rem; height: 2.6rem; border-radius: 12px; border: 2.5px solid var(--ink); background: var(--mint); box-shadow: 2px 2px 0 var(--ink); display: grid; place-items: center; flex: none; }
.ctrl .ic { width: 1.1rem; height: 1.1rem; vertical-align: 0; }
#scrub { flex: 1; accent-color: var(--grape); min-width: 0; }
.time { font-size: var(--fs-sm); min-width: 4.5em; text-align: end; }
.chapters { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0; padding: .2rem 1rem 1rem; }
.chapters button { background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: .1rem .8rem; font-size: .9rem; }
.chapters button.on { background: var(--grape); color: #fff; }

/* ---------- activities ---------- */
.acts { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.act { background: #fff; border: 2.5px solid var(--ink); border-radius: var(--r-lg); padding: 1.1rem 1.2rem; box-shadow: var(--hard); }
.act h3 { margin: .4rem 0 .3rem; font-size: var(--fs-lg); }
.act details { background: var(--paper-2); border-radius: var(--r-md); padding: .5rem .8rem; }
.act summary { cursor: pointer; font-weight: 700; }
.checklist { margin-top: var(--sp-6); }
.organs { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0; }
.organs button { border: 2.5px solid var(--ink); background: #fff; border-radius: 12px; padding: .35rem .9rem; font-weight: 600; box-shadow: 3px 3px 0 var(--ink); }
.organs button.yes { background: #c9f2b8; } .organs button.no { background: #ffd9e6; }
.organ-fb { min-height: 2em; }

/* ---------- quiz ---------- */
.score-pill { position: sticky; top: 4.2rem; z-index: 5; float: right; background: var(--lemon); border: 2.5px solid var(--ink); border-radius: 999px; padding: .2rem 1rem; font-weight: 800; box-shadow: 3px 3px 0 var(--ink); }
.mcq { display: grid; gap: 1rem; clear: both; }
.lk-q { background: #fff; border: 2.5px solid var(--ink); border-radius: var(--r-lg); padding: 1rem 1.2rem 1.2rem; box-shadow: var(--hard); }
.lk-q-stem { font-weight: 700; line-height: 1.7; }
.lk-q-num { color: var(--grape); }
.mcq-stem-list { margin: .3rem 0; padding-inline-start: 2.2rem; font-weight: 400; }
.lk-opts { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); margin-top: .6rem; }
.lk-opt { display: flex; gap: .6rem; align-items: center; text-align: start; background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r-md); padding: .5rem .8rem; line-height: 1.5; transition: transform .12s; }
.lk-opt:hover:not([aria-disabled]) { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.lk-opt-key { width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center; background: #e8e0ff; border: 2px solid var(--ink); flex: none; font-weight: 700; }
.lk-opt.is-right { background: #c9f2b8; } .lk-opt.is-wrong { background: #ffc9c4; }
.lk-opt[aria-disabled] { cursor: default; }
.lk-explain { margin: .8rem 0 0; padding: .6rem .9rem; border-radius: var(--r-md); background: var(--paper-2); line-height: 1.6; }
.lk-explain .ic { width: 1.35em; height: 1.35em; }
.qa details, .cq-parts details { background: #fff; border: 2.5px solid var(--ink); border-radius: var(--r-md); padding: .7rem 1rem; margin-bottom: .6rem; box-shadow: 3px 3px 0 var(--ink); }
.qa summary, .cq-parts summary { cursor: pointer; font-weight: 700; line-height: 1.6; }
.qa details[open], .cq-parts details[open] { background: var(--paper-2); }
.qa details p, .cq-parts details p { margin: .6rem 0 0; }
.cq { background: #fff; border: 3px solid var(--ink); border-radius: var(--r-xl); padding: 1.2rem 1.4rem; margin-bottom: 1.2rem; box-shadow: var(--hard-lg); }
.cq-stem b { background: var(--lemon); padding: 0 .3rem; border-radius: 6px; }
.cq-figs { display: flex; gap: 1.2rem; flex-wrap: wrap; margin: .6rem 0; }
.cq-figs figure { margin: 0; text-align: center; background: var(--paper-2); border: 2px solid var(--ink); border-radius: var(--r-md); padding: .6rem 1rem; }
.cq-figs .ic-xl { width: 5rem; height: 5rem; display: block; margin-inline: auto; }
.cq-parts { list-style: none; padding: 0; margin: 0; }

/* ---------- summary / footer ---------- */
.summary { background: var(--mint); border: 3px solid var(--ink); border-radius: var(--r-xl); padding: clamp(1.5rem, 4vw, 3rem); box-shadow: var(--hard-lg); }
.summary h2 { font-size: var(--fs-xl); }
.summary ul { margin: 0; padding-inline-start: 1.3rem; columns: 2 22rem; column-gap: 2.5rem; }
.summary li { margin-bottom: .5rem; break-inside: avoid; font-weight: 500; }
.pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: var(--sp-6) var(--sp-4); }
.pager-btn { border: 2.5px solid var(--ink); border-radius: 14px; padding: .6rem 1.2rem; color: var(--ink); background: #fff; text-decoration: none; font-weight: 600; box-shadow: var(--hard); }
.pager-btn.disabled { opacity: .6; box-shadow: none; }
.credit { font-size: .9rem; color: var(--ink-2); padding-bottom: var(--sp-6); }

@media (max-width: 640px) {
  .score-pill { float: none; display: inline-block; }
  .cell3d { height: 340px; }
  .big-play { width: 3.6rem; height: 3.6rem; }
  .big-play .ic { width: 1.5rem; height: 1.5rem; }
  .caption { font-size: var(--fs-base); }
  .tag { font-size: .75rem; }
  .four { grid-template-columns: repeat(2, 1fr); }
  .t-node { padding: .25rem .5rem; font-size: .88rem; }
  .t-node small { font-size: .72rem; }
  .t-kids { gap: .35rem; }
}
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1; transform: none; } .hero-road { animation: none; } }
