/* Activity pages: investigation, mini lab, challenge, check, project, connect. Light paper surfaces, one
   primary action per card, big tap targets. */
.step-body:not(.step-journey) { padding: clamp(20px, 4vw, 40px) var(--gutter) 40px; max-width: 1180px; margin: 0 auto; }
.activity-head { margin-bottom: 20px; }
.activity-head h1 { font-size: var(--step-2); max-width: 24ch; }
.eyebrow-plain { color: #1b6f8c; font-weight: 700; margin-bottom: .3em; }
.lead { font-size: var(--step-1); line-height: 1.4; color: var(--ink-soft); max-width: 46ch; }
.lead-sm { font-weight: 700; }
.muted { color: var(--ink-soft); }

.activity-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); align-items: start; }
.card { background: #fff; border-radius: var(--radius-l); padding: clamp(18px, 3vw, 28px); box-shadow: 0 1px 0 var(--line), 0 8px 24px #14304a12; }
.card h2 { font-size: var(--step-1); display: flex; align-items: center; gap: 10px; }
.card h3 { font-size: var(--step-0); margin-top: 1.2em; }
.num { width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--stage); color: var(--on-stage); display: grid; place-items: center; font-size: 1rem; }

.choice-row { display: flex; flex-wrap: wrap; gap: 10px; }
.choice-col { display: grid; gap: 10px; margin-bottom: 12px; }
.choice { color: var(--ink); }
.choice.wide { justify-content: flex-start; text-align: left; border-radius: var(--radius-s); }
.choice[aria-pressed="true"] { background: var(--stage); color: var(--on-stage); border-color: var(--stage); }
.btn.right, .project-option.right { border-color: var(--good); background: #e2f4ea; color: #134d33; opacity: 1; }
.btn.wrong { border-color: var(--try); background: #fbe6dc; color: #7a2c10; opacity: 1; }
.feedback { margin-top: 12px; }
.feedback .btn { margin-top: 8px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 4px; }

/* Investigation */
.counter { display: flex; justify-content: space-between; align-items: end; background: var(--paper); border-radius: var(--radius-s); padding: 12px 16px; margin: 10px 0 14px; }
.big-count { font-size: var(--step-3); font-weight: 700; line-height: 1; margin: 0; font-variant-numeric: tabular-nums; }
.unit { margin: 0; color: var(--ink-soft); font-size: var(--step--1); }
.clock { font-size: var(--step-1); font-weight: 700; margin: 0; font-variant-numeric: tabular-nums; }
.counter-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.tap-btn { flex: 1 1 220px; min-height: 64px; font-size: var(--step-1); }
.safety { background: #fff4dc; border-left: 4px solid var(--co2); padding: 8px 12px; border-radius: 6px; }
.bars { display: grid; gap: 8px; margin: 10px 0 16px; }
.bars h3 { margin: 0; }
.bar-row { display: grid; grid-template-columns: 7.5em 1fr auto; gap: 10px; align-items: center; font-size: var(--step--1); }
.bar-track { height: 18px; background: var(--paper); border-radius: 9px; overflow: hidden; }
.bar { display: block; height: 100%; border-radius: 9px; transition: width .6s var(--ease); }
.bar.rest { background: var(--o2); } .bar.after { background: var(--blood-rich); } .bar.guess { background: #8a9aaa; }

/* Mini lab */
.lab-layout { display: grid; gap: 20px; }
@media (min-width: 900px) { .lab-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; } .lab-model { position: sticky; top: calc(var(--topbar-h) + 60px); } }
.lab-model { border-radius: var(--radius-l); overflow: hidden; background: radial-gradient(110% 80% at 50% 35%, var(--stage-glow) 0%, var(--stage) 55%, var(--stage-deep) 100%); }
.lab-view { position: relative; height: clamp(320px, 52svh, 520px); padding: 10px; }
.lab-view > .sim { inset: 10px; }
.safety-box { background: #fff4dc; border: 2px solid var(--co2); border-radius: var(--radius-s); padding: 4px 16px; }
.safety-box h3 { margin-top: .6em; }
.method li, .materials li { margin-bottom: .45em; }

/* Challenge */
.seq-path { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 6px; }
.seq-slot { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 10px; border-radius: var(--radius-s); background: var(--paper); border: 2px dashed var(--line); }
.seq-slot:not(.empty) { border-style: solid; background: #fff; }
.seq-slot.right { border-color: var(--good); background: #e2f4ea; }
.seq-slot.wrong { border-color: var(--try); background: #fbe6dc; }
.slot-num { width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--stage); color: var(--on-stage); display: grid; place-items: center; font-size: .8rem; font-weight: 700; }
.seq-placed { flex: 1; text-align: left; background: none; border: 0; min-height: 40px; cursor: pointer; font-weight: 700; }
.seq-fixed { flex: 1; font-weight: 700; }
.mark { font-weight: 700; font-size: 1.2rem; }
.seq-pool { display: flex; flex-wrap: wrap; gap: 8px; }
.seq-chip { min-height: 48px; padding: 8px 16px; border-radius: 999px; border: 2px solid var(--stage); background: #fff; font-weight: 700; cursor: pointer; }
.seq-chip:hover { background: #e3edf2; }
.traffic-svg { width: 100%; max-width: 420px; border-radius: var(--radius-s); margin: 8px 0; }
.t-air { fill: #24557b; } .t-wall { fill: #eeaaa1; } .t-blood { fill: #56203a; }
.t-label { fill: #fff; font-size: 12px; font-weight: 700; }
.t-mol circle { stroke: #fff; stroke-width: 2; }
.t-mol.o2 circle { fill: var(--o2); } .t-mol.co2 circle { fill: var(--co2); } .t-mol.n2 circle { fill: #b9c4cf; }
.t-mol-text { font-size: 11px; font-weight: 700; fill: #0d2236; }
.traffic-prompt { font-size: var(--step-0); min-height: 2.6em; }

/* Check */
.spot-svg { width: 100%; max-width: 300px; margin: 0 auto 8px; background: var(--stage); border-radius: var(--radius-s); }
.spot-lung { fill: #eba49d; stroke: #fde3df; stroke-width: 1.4; }
.spot-airway { fill: none; stroke: #f7ece4; stroke-linecap: round; }
.spot-diaphragm { fill: none; stroke: #e48a6f; stroke-width: 6; stroke-linecap: round; }
.spot-hit { fill: transparent; cursor: pointer; outline: none; }
.spot-hit:hover, .spot-hit:focus-visible { fill: #ffc94d33; stroke: var(--focus); stroke-width: 2; }
.spot-hit.right { fill: #1f8a5b66; stroke: #7be0ad; stroke-width: 2; }
.spot-hit.wrong { fill: #b4471f66; stroke: #ffb08f; stroke-width: 2; }
.card .range { margin: 10px 0; font-weight: 400; }
.card .range input { accent-color: var(--stage); width: 100%; }

/* Project */
.project-options { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); margin-bottom: 18px; }
.project-option { display: grid; gap: 4px; text-align: left; padding: 18px 20px; border-radius: var(--radius-l); border: 2px solid var(--line); background: #fff; cursor: pointer; }
.project-option strong { font-size: var(--step-1); }
.project-option[aria-pressed="true"] { border-color: var(--stage); box-shadow: inset 0 0 0 2px var(--stage); background: #eef4f8; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; padding: 8px 4px; }
.checklist input { width: 26px; height: 26px; flex: none; accent-color: var(--good); margin-top: 1px; }
.checklist label { cursor: pointer; }

/* Connect */
.connect-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.connect-item { padding: 20px; border-radius: var(--radius-l); background: #fff; border-top: 6px solid var(--o2); }
.connect-item h2 { font-size: var(--step-1); }
.tone-1 { border-top-color: var(--blood-rich); } .tone-2 { border-top-color: #5e6fd6; } .tone-3 { border-top-color: var(--co2); }
.next-journey { margin-top: 24px; font-size: var(--step-1); }

.step-footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }

@media print {
  .topbar, .stepper, .step-footer, .project-options, .row-actions, .skip { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #999; }
}

/* Jump-in map (lesson cover): every part one tap away */
.jump-map { display: grid; gap: 22px; }
.jump-group h3 { font-size: var(--step-0); color: var(--ink-soft); margin: 0 0 8px; }
.jump-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.jump-card { display: flex; gap: 12px; align-items: center; min-height: 60px; padding: 10px 14px; border-radius: var(--radius-s); background: #fff; border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.jump-card:hover { border-color: var(--stage); box-shadow: 0 4px 14px #14304a1a; }
.jump-num { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--stage); color: var(--on-stage); display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.jump-text { display: grid; gap: 2px; }
.jump-text span { font-size: var(--step--1); color: var(--ink-soft); }

/* Lab hub */
.lab-hub { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.lab-card { display: grid; gap: 8px; height: 100%; padding: 20px; border-radius: var(--radius-l); background: #fff; color: var(--ink); text-decoration: none; box-shadow: 0 1px 0 var(--line), 0 8px 24px #14304a12; border-top: 6px solid var(--o2); }
.lab-card:hover { box-shadow: 0 1px 0 var(--line), 0 12px 30px #14304a26; }
.lab-card strong { font-size: var(--step-1); }
.lab-short { color: var(--ink-soft); }
.lab-kind { justify-self: start; font-size: .8rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: #d9ecf5; color: #164c66; }
.lab-kind.kind-investigation { background: #fbe3cc; color: #7a3a0c; }
.lab-go { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: #1b6f8c; margin-top: auto; }
.lab-go svg { width: 20px; height: 20px; flex: none; }
.lab-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.lab-switch ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lab-switch .chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; font-weight: 700; }
.lab-switch .chip.on { background: var(--stage); border-color: var(--stage); color: var(--on-stage); }
.lab-next { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.lab-view.tall { height: clamp(380px, 60svh, 600px); }
.lab-shows { font-size: var(--step-0); line-height: 1.5; }

/* Gas lab */
.lab-view:has(.gaslab-wrap) { height: auto; }
.gaslab-wrap { position: relative; width: 100%; aspect-ratio: var(--ar, 420 / 470); max-height: 72svh; background: radial-gradient(120% 90% at 50% 35%, #1d4466 0%, var(--stage) 55%, var(--stage-deep) 100%); border-radius: var(--radius-s); overflow: hidden; }
.gaslab-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.gaslab-controls { width: 100%; display: grid; gap: 10px; color: var(--on-stage); }
.gaslab-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.gaslab-row .row-label { width: 100%; font-size: var(--step--1); font-weight: 700; color: var(--on-stage-soft); }
.gaslab-row .seg-group { display: flex; flex-wrap: wrap; gap: 4px; border: 1px solid rgba(238,246,251,.3); border-radius: 999px; padding: 3px; }
.gaslab-row .seg { border-radius: 999px; min-height: 44px; }
.gas-btns { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; width: 100%; }
.lab-model .gas-btn { justify-content: flex-start; gap: 8px; background: rgba(238,246,251,.08); border: 1px solid rgba(238,246,251,.25); color: var(--on-stage); text-align: left; line-height: 1.15; }
.lab-model .gas-btn:hover { background: rgba(238,246,251,.16); }
.gas-btn small { opacity: .75; font-weight: 400; }
.gas-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.gaslab-status { margin: 0; padding: 10px 12px; min-height: 3.2em; background: rgba(0,0,0,.22); border-left: 4px solid var(--focus); border-radius: 6px; font-size: var(--step-0); line-height: 1.4; }
.gas-gauges { display: grid; gap: 4px; }
.gas-gauge { display: grid; grid-template-columns: 7.5em 1fr 3.4em; gap: 8px; align-items: center; font-size: var(--step--1); }
.gauge-track { position: relative; height: 10px; border-radius: 5px; background: rgba(238,246,251,.12); overflow: hidden; }
.gauge-bar { position: absolute; inset: 0 auto 0 0; border-radius: 5px; transition: width .2s linear; }
.gauge-mark { position: absolute; top: 0; bottom: 0; left: 15.5%; width: 2px; background: var(--focus); }
.gauge-val { text-align: right; font-variant-numeric: tabular-nums; }
.body-readout { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: var(--step--1); }
.body-readout strong { font-size: var(--step-1); margin-right: 2px; }
.gaslab-note { margin: 0; font-size: .82rem; color: var(--on-stage-soft); }
@media (prefers-reduced-motion: reduce) { .gauge-bar { transition: none; } }
.gaslab-controls [hidden] { display: none !important; }

/* Lab game layer: discoveries counter and the "new discovery" card over the canvas */
.lab-hud { position: absolute; top: 8px; left: 8px; display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: rgba(4, 18, 30, .62); color: var(--on-stage); font-size: .78rem; backdrop-filter: blur(4px); pointer-events: none; }
.lab-hud .hud-title { color: var(--on-stage-soft); font-weight: 700; letter-spacing: .02em; }
.lab-hud .hud-dots { display: inline-flex; gap: 4px; }
.lab-hud .hud-dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid rgba(255, 224, 138, .55); }
.lab-hud .hud-dot.on { background: #ffe08a; border-color: #ffe08a; box-shadow: 0 0 8px rgba(255, 224, 138, .8); }
.lab-hud .hud-dot.pulse { animation: hud-pulse .9s ease-out 2; }
@keyframes hud-pulse { 50% { transform: scale(1.8); } }
.lab-toast { position: absolute; left: 50%; top: 42px; transform: translateX(-50%); width: min(88%, 340px); display: grid; gap: 2px; padding: 10px 14px; border-radius: 12px; text-align: center;
  background: linear-gradient(180deg, rgba(40, 30, 6, .88), rgba(20, 14, 2, .88)); border: 1.5px solid #ffe08a; color: #fff7dc; box-shadow: 0 6px 30px rgba(255, 200, 80, .35); pointer-events: none; }
.lab-toast[hidden] { display: none; }
.lab-toast .toast-kicker { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #ffe08a; }
.lab-toast strong { font-size: 1.05rem; }
.lab-toast span:last-child { font-size: .86rem; color: #f3e6bf; }
.lab-toast.show { animation: toast-in .45s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(-10px) scale(.9); } }
@media (prefers-reduced-motion: reduce) { .lab-toast.show, .lab-hud .hud-dot.pulse { animation: none; } }
.lab-toast.danger { background: linear-gradient(180deg, rgba(90, 8, 4, .92), rgba(50, 4, 2, .92)); border-color: #ff6a4a; color: #fff1ec; box-shadow: 0 6px 34px rgba(255, 60, 30, .55); }
.lab-toast.danger .toast-kicker { color: #ffd23f; font-size: .8rem; }
.lab-toast.danger .toast-kicker::before { content: "⚠ "; }
.lab-toast.danger span:last-child { color: #ffd9cf; }
.lab-toast.danger.show { animation: toast-in .45s cubic-bezier(.2, 1.4, .4, 1) both, danger-blink .5s steps(2) 3; }
@keyframes danger-blink { 50% { border-color: #ffd23f; } }
.lab-credit { margin: 10px 0 0; font-size: .78rem; line-height: 1.4; color: var(--ink-soft, #5b6b78); }
.lab-credit a { color: inherit; }
.lab-toast.good { background: linear-gradient(180deg, rgba(8, 70, 40, .92), rgba(4, 44, 26, .92)); border-color: #48e08a; color: #eafff2; box-shadow: 0 6px 30px rgba(60, 220, 130, .4); }
.lab-toast.good .toast-kicker { color: #9dffc6; }
.lab-toast.good .toast-kicker::before { content: "\2713  "; }
.lab-toast.good span:last-child { color: #d3f7e2; }
.gaslab-credit { font-size: .72rem; opacity: .75; }
