:root{--bg:#16171a;--panel:#202226;--text:#f3efe6;--muted:#b8b2a6;--accent:#ff9f4a;--accent-ink:#1a1a1d;--line:#454448;--paper:#f6efe3;--grid:#d7dfe7;--ok:#5fd39a;--bad:#ff8a80;--focus:#ffd579;color-scheme:dark;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Naskh Arabic","Geeza Pro",sans-serif;color:var(--text);background:var(--bg);font-size:16px;line-height:1.55}
html[data-lab=torque-workbench]{--bg:#eef2f6;--panel:#fff;--text:#15202b;--muted:#4a5866;--accent:#1d4ed8;--accent-ink:#fff;--line:#bac8d6;--paper:#f8fafc;--ok:#0f6e56;--bad:#a32d2d;--focus:#0f6bdc;color-scheme:light}
html[data-lab=punnett-garden]{--bg:#f3f7ee;--panel:#fff;--text:#1c221a;--muted:#4f5d4b;--accent:#2f6b3a;--accent-ink:#fff;--line:#becdb6;--paper:#e9dfcf;--ok:#0f6e56;--bad:#a32d2d;--focus:#0f6bdc;color-scheme:light}
html[data-lab=limit-probe]{--bg:#0f172a;--panel:#1e293b;--text:#e2e8f0;--muted:#a5b4c8;--accent:#38bdf8;--accent-ink:#0f172a;--line:#46556a;--paper:#1e293b}
*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit;color:inherit}button,a,select,input{touch-action:manipulation}button,select{min-height:44px;max-width:100%;border:1px solid var(--line);border-radius:12px;background:var(--panel);padding:10px 15px}button{cursor:pointer;line-height:1.4}button:disabled{opacity:.55;cursor:default}button:not(:disabled):active{transform:translateY(2px)}button:hover:not(:disabled){border-color:var(--accent)}a{color:var(--accent)}:focus-visible{outline:3px solid var(--focus);outline-offset:3px}h1,h2,h3,p{margin:0 0 16px}h1{font-size:clamp(28px,5vw,42px);line-height:1.2;letter-spacing:-.035em}h2{font-size:22px;line-height:1.3}h3{font-size:16px}html[lang=ckb]{line-height:1.9}html[lang=ckb] h1{letter-spacing:0;line-height:1.5}bdi,[dir=ltr]{unicode-bidi:isolate}bdi,output,svg text{font-family:ui-sans-serif,system-ui,sans-serif;font-variant-numeric:tabular-nums}main{max-width:1180px;margin:auto;padding:32px 24px 60px}small{font-size:13px;color:var(--muted)}.bar{position:sticky;top:0;z-index:5;display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap;padding:12px max(16px,calc((100vw - 1180px)/2));background:var(--bg);border-bottom:1px solid var(--line)}.bar-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.bar-actions button{width:44px;padding:8px;font-size:22px}.bar select{max-width:110px;padding:8px;font-size:14px}.wallet{color:var(--accent);white-space:nowrap;padding:8px}.return{border:0;background:transparent;padding-inline:0}.primary{background:var(--accent);color:var(--accent-ink);border-color:var(--accent);font-weight:700;min-height:48px;box-shadow:0 3px 0 color-mix(in srgb,var(--accent) 55%,black)}.eyebrow{font-size:12px;color:var(--accent);font-weight:700;margin-bottom:12px}.tagline{font-size:21px;color:var(--muted)}.chips{display:flex;flex-wrap:wrap;gap:8px;margin-block:24px}.chips span,.chip{border:1px solid var(--line);border-radius:99px;padding:6px 12px;font-size:13px}.rule{max-width:780px;font-size:17px;border-inline-start:3px solid var(--accent);padding-inline-start:20px}.map-heading{margin-bottom:32px}.mission-map{display:grid;gap:12px;margin:32px 0}.station{display:flex;align-items:center;text-align:start;gap:20px;padding:22px;border-radius:4px;border-width:0 0 1px;background:transparent}.station b{font-size:19px;display:block}.station small{display:block;margin-top:5px}.station-number{font-size:26px;color:var(--accent);width:48px;flex-shrink:0}.station-enter{margin-inline-start:auto;color:var(--accent);font-size:25px}.station.current{background:var(--panel);border:1px solid var(--accent);border-radius:12px}.station.done .station-number{color:var(--ok)}[data-lab=punnett-garden] .mission-map{grid-template-columns:1fr 1fr;gap:16px}[data-lab=punnett-garden] .station{border:1px solid var(--line);border-radius:24px;background:var(--paper);flex-wrap:wrap}[data-lab=torque-workbench] .mission-map{border-inline-start:6px solid #64748b;margin-inline-start:22px;padding-inline-start:20px}[data-lab=limit-probe] .mission-map{border-top:2px solid var(--line);padding-top:12px;grid-template-columns:1fr 1fr}.map-actions{display:flex;gap:12px;flex-wrap:wrap;margin-block:24px}.note{color:var(--muted);font-size:14px;line-height:1.7}.foot{border-top:1px solid var(--line);padding:24px;text-align:center;color:var(--muted);font-size:13px}.foot p{margin:4px}.mission-layout{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);gap:32px;align-items:start}.narrative,.workspace,.stage{min-width:0}.mission-top{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:24px}.mission-top button{padding-inline:0;background:transparent;border:0}.mission-top span{margin:0}.task{font-size:17px}.coach{padding:12px 16px;background:var(--panel);border-inline-start:3px solid var(--accent);font-size:14px}.actions{display:flex;gap:10px;flex-wrap:wrap;margin-block:20px}.actions .primary{flex-basis:100%}.feedback,.guidance{padding:20px;border:1px solid var(--line);border-radius:16px;margin:16px 0;background:var(--panel)}.feedback[data-kind=correct]{border-color:var(--ok)}.feedback[data-kind=wrong]{border-color:var(--bad)}.feedback[data-kind=correct] h2,.reward{color:var(--ok)}.feedback[data-kind=wrong] h2{color:var(--bad)}.feedback p:last-child,.guidance p:last-child{margin:0}.rules{margin-block:20px}.rules p{margin-top:16px}summary{cursor:pointer;min-height:44px;padding:10px 0;color:var(--accent)}.stage{background:var(--panel);border:1px solid var(--line);border-radius:20px;padding:20px}.stage .note:last-child{margin-bottom:0}.equation{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px}.equation-side{min-width:0;flex:1;text-align:center}.equation-side h2{color:var(--muted);font-size:13px}.terms{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:8px}.formula-card{border:1px solid var(--line);padding:14px 6px;border-radius:12px}.formula{display:block;font-size:27px;font-weight:500;margin-bottom:12px;color:var(--accent)}.stepper{display:flex;gap:2px;align-items:center}.stepper button{width:44px;padding:8px}.stepper output{min-width:30px;font-size:20px}.operator{font-size:20px}.reaction-arrow{font-size:30px;padding:16px 0}.equation-result{font-size:18px;text-align:center;padding:18px 0;margin:0}.ledger{background:#f6efe3;color:#1d1b17;border-radius:12px;border-collapse:separate;border-spacing:0;width:100%;margin-bottom:20px;padding:12px}.ledger caption{background:var(--panel);color:var(--text);text-align:start;padding:16px 0 8px;font-size:14px}.ledger th,.ledger td{padding:10px 6px;text-align:center;border-bottom:1px solid #d8cfbf;font-size:14px}.ledger th:first-child{font-size:19px}.ledger tr:last-child td,.ledger tr:last-child th{border-bottom:0}.ledger b{font-size:21px}.ledger th{max-width:100px;overflow-wrap:anywhere}.parity{font-weight:700;font-size:22px!important}.dots{display:flex;gap:3px;flex-wrap:wrap;width:87px;margin:6px auto}.dots i{width:6px;height:6px;border-radius:100%;background:#855224}.diagram svg{display:block;width:100%;height:auto}.diagram{margin-bottom:20px;border-radius:16px;overflow:hidden}.readouts{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:16px 0}.readouts div{padding:10px;border-bottom:1px solid var(--line)}dt{font-size:13px;color:var(--muted)}dd{margin:5px 0 0;font-size:20px;font-weight:700}.target-readout{display:flex;gap:8px;flex-wrap:wrap;align-items:center;border:1px solid var(--line);border-radius:12px;padding:16px;margin-bottom:20px}.target-readout strong{font-size:27px;flex-basis:100%;color:var(--accent)}.target-readout small{margin-inline-start:auto}.range-control{border-inline-start:3px solid var(--accent);padding-inline-start:12px;display:grid;grid-template-columns:1fr auto;gap:8px;margin:18px 0}.range-control label{font-size:14px}.range-row{grid-column:1/-1;display:flex;align-items:center;gap:10px}.range-row button{width:44px;padding:8px;flex-shrink:0}.range-row input{min-width:0;flex:1;height:44px;accent-color:var(--accent)}.range-control output{font-weight:700;color:var(--accent)}fieldset{border:0;margin:18px 0;padding:0;min-width:0}legend{font-size:14px;margin-bottom:8px}.choices{display:flex;gap:8px;flex-wrap:wrap}.choice{display:flex;cursor:pointer;min-height:48px;align-items:center;padding:10px 12px;border:1px solid var(--line);border-radius:12px;gap:8px}.choice:has(input:checked){border-color:var(--accent);background:color-mix(in srgb,var(--accent) 12%,var(--panel))}.choice:has(input:focus-visible){outline:3px solid var(--focus);outline-offset:3px}.choice input{width:18px;height:18px;flex-shrink:0;accent-color:var(--accent);margin:0}.choice span{font-size:14px}.punnett{border-spacing:6px;margin:auto;width:100%;max-width:340px;table-layout:fixed}.punnett caption{font-size:13px;color:var(--muted);margin-bottom:14px}.punnett th{font-size:22px;font-weight:800;text-align:center}.punnett thead td,.punnett tbody th{width:36px}.punnett td{padding:0}.bed{display:flex;flex-direction:column;justify-content:center;align-items:center;background:var(--paper);width:100%;min-height:110px;padding:6px;border:2px solid transparent;border-radius:16px;gap:2px}.bed.active{border-color:var(--accent)}.bed b{font-size:20px}.bed small{font-size:12px}.empty-cell{font-size:30px;color:#6d6a63}.flower{width:38px;height:38px}.sample-flowers{display:flex;justify-content:center;gap:20px;margin:24px 0}.sample-table{width:100%;border-collapse:collapse;margin:20px 0}.sample-table caption{color:var(--muted);text-align:start;margin-bottom:8px}.sample-table th,.sample-table td{padding:12px 6px;border-bottom:1px solid var(--line);font-size:14px;text-align:center}.sample-table th:first-child{font-weight:400;text-align:start}.answers{display:grid;grid-template-columns:1fr 1fr;gap:14px}.answers label{font-size:14px}.answers select{display:block;width:100%;margin-top:8px;padding:10px 6px;min-height:48px;font-size:16px}.modal{overflow-y:auto;overscroll-behavior:contain;color:var(--text);background:var(--panel);border:1px solid var(--line);border-radius:20px;width:min(740px,calc(100vw - 24px));max-height:90dvh;padding:24px}.modal::backdrop{background:#000b}.modal-head{display:flex;justify-content:space-between;align-items:start;gap:15px;margin-bottom:20px}.modal-head button{min-width:44px;font-size:22px}.source-body img{width:100%;height:auto;background:#fff}.source-body figure{margin:24px 0}.source-body figcaption{font-size:13px}.source-type{border-inline-start:3px solid var(--accent);padding-inline-start:12px}.shop-row{display:flex;align-items:center;gap:14px;border-top:1px solid var(--line);padding:18px 0;flex-wrap:wrap}.shop-row button{margin-inline-start:auto}.swatch{width:38px;height:38px;border-radius:100%;background:var(--accent);border:2px solid var(--line)}.swatch-mint{background:#7fe0c0}.swatch-sunset{background:#ffb070}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.skip{position:absolute;top:-80px;padding:12px;background:var(--panel);z-index:10}.skip:focus{top:10px}button,select,input{scroll-margin-block:140px}
@media(max-width:1023px){.mission-layout{display:flex;flex-direction:column;gap:0}.narrative,.workspace{display:contents}.mission-head{order:1;width:100%}.stage{order:2;width:100%}.guidance{order:3;width:100%}.feedback{order:4;width:100%}.actions{order:5;width:100%}.rules{order:6}.mission-head h1{font-size:29px}.mission-top{margin-bottom:18px}.equation{flex-direction:column}.equation-side{width:100%}.reaction-arrow{padding:0;line-height:1;transform:rotate(90deg)}.stage{padding:14px}.mission-head .coach{margin-bottom:18px}}
@media(max-width:599px){main{padding:22px 16px 40px}.bar{gap:2px;padding:8px 16px}.return{font-size:13px}.bar-actions{gap:4px}.bar select{max-width:93px;font-size:12px}.wallet{padding:4px}.bar-actions button{width:44px}.station{gap:12px;padding:17px 10px}.station b{font-size:17px}.station-number{width:33px;font-size:23px}.station-enter{font-size:20px}.rule{font-size:15px}[data-lab=punnett-garden] .station{gap:8px;padding:14px}[data-lab=punnett-garden] .station-enter{display:none}[data-lab=limit-probe] .mission-map{grid-template-columns:1fr}.dots{width:69px;gap:2px}.dots i{width:5px;height:5px}.ledger{padding:6px}.ledger th,.ledger td{padding:8px 3px}.ledger th{font-size:12px}.actions button{flex-grow:1}.answers{gap:10px}.choices .choice{padding:10px}.modal{padding:16px}.readouts{gap:6px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}button:not(:disabled):active{transform:none}}
@media(forced-colors:active){.choice:has(input:checked),.bed.active{outline:3px solid CanvasText}.dots i{background:CanvasText}}

/* Keep physical columns aligned with the diagrams in both reading directions. */
.spatial-readouts,.answers{direction:ltr}html[dir=rtl] .spatial-readouts>div,html[dir=rtl] .answers>label{direction:rtl;text-align:start}
.math-compact{white-space:nowrap}
.equation{flex-direction:column}.equation-side{width:100%}.reaction-arrow{padding:0;line-height:1;transform:rotate(90deg)}
.bed.static{border-radius:4px;border:1px solid var(--line);background:transparent}
@media(max-width:599px){.choice-group:has([name=sample]) .choice,.choice-group:has([name=reason]) .choice{width:100%}}

.closer-caption{text-align:right}.sample-flowers{border-top:1px solid var(--line);padding-top:16px}

/* Mission brief: goal, first control, finish condition — readable in one glance. */
.brief{list-style:none;counter-reset:brief;display:grid;gap:10px;margin:0 0 20px;padding:0}
.brief li{counter-increment:brief;display:grid;grid-template-columns:auto minmax(0,1fr);gap:2px 12px;padding:14px 16px;background:var(--panel);border-inline-start:3px solid var(--accent);border-start-end-radius:12px;border-end-end-radius:12px}
.brief li::before{content:counter(brief);grid-column:1;grid-row:1/span 2;align-self:start;font-size:20px;font-weight:700;line-height:1.2;color:var(--accent);font-variant-numeric:tabular-nums}
.brief b{grid-column:2;grid-row:1;font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--accent)}
.brief span{grid-column:2;grid-row:2;font-size:15px}
.brief li:first-child span{font-size:17px}
html[lang=ckb] .brief b{letter-spacing:0}

/* Wrong-answer feedback: the named fault first, the place to look after it. */
.diagnosis{font-size:17px}
.feedback .note,.guidance .note{font-size:14px}
.feedback .nudge{margin-top:4px}
.done-actions{margin:16px 0 0}
.guidance[data-kind=consent]{border-color:var(--accent)}
.guidance .actions{margin:16px 0 0}
.guidance-cost{flex-basis:100%;margin:0;font-size:13px}
.stage-status{margin:0 0 20px;padding:12px 0 0;border-top:1px solid var(--line);font-size:14px;color:var(--muted)}
.stage-status[data-done=true]{color:var(--ok);font-weight:700}
.ledger tbody tr:not([data-match]) td,.ledger tbody tr:not([data-match]) th{background:#f7e2dc}
.ledger tbody tr:not([data-match]) .parity{color:#8c2b1f}
.bed[data-flag]{border-color:var(--bad);border-style:dashed}
.shop-message{border-inline-start:3px solid var(--bad);padding-inline-start:12px;font-size:14px}
@media(forced-colors:active){.bed[data-flag]{outline:2px dashed CanvasText}.ledger tbody tr:not([data-match]) .parity{text-decoration:underline}}

/* Phone experiments: reach the controls first; keep the check action at thumb level. */
.mission-help{margin:0 0 16px;border-bottom:1px solid var(--line)}
.mission-help summary{font-size:14px;font-weight:700}
.mission-help .brief{margin:0 0 12px}
.mission-goal{margin-bottom:6px}
.mission-goal li{padding:12px 14px}
.check-dock .primary{width:100%}
html[data-embedded=true] .bar>.return{display:none}
html[data-embedded=true] .bar{justify-content:flex-end}
html[data-embedded=true] .bar-actions{width:100%;justify-content:flex-end}
html[data-embedded=true] .bar-actions .wallet{margin-inline-end:auto}
@media(max-width:1023px){
  .mission-head h1{font-size:27px;margin-bottom:14px}
  .mission-top{margin-bottom:10px}
  .mission-head>.eyebrow{margin-bottom:8px}
  .check-dock{position:fixed;inset-inline:0;bottom:0;z-index:7;padding:10px 16px max(10px,env(safe-area-inset-bottom));background:var(--bg);border-top:1px solid var(--line)}
  .check-dock .primary{min-height:50px;max-width:650px;display:block;margin-inline:auto}
  body:has(.check-dock) .foot{padding-bottom:100px}
  body:has(.check-dock) main{padding-bottom:36px}
  .mission-actions{order:5}
  .mission-help .brief li{background:transparent;padding:8px 10px}
  .mission-help .brief span{font-size:14px}
  button,select,input{scroll-margin-bottom:100px}
}
@media(max-width:599px){
  main{padding:14px 16px 40px}
  .bar{padding:6px 16px}
  .bar select{font-size:14px;max-width:100px}
  .bar-actions{gap:6px}
  .bar-actions button{font-size:20px}
  .mission-top button{font-size:14px}
  .mission-top .eyebrow{font-size:12px}
  .brief li::before{display:none}
  .brief li{display:block;padding:12px}
  .brief b{display:block;font-size:11px;margin-bottom:3px}
  .brief li:first-child span{font-size:15px}
  html[lang=ckb] .mission-head h1{font-size:25px;line-height:1.6}
  .formula-card{padding:10px 6px}
  .formula{margin-bottom:8px;font-size:25px}
  .stage{border-radius:16px}
}

.mission-goal{padding:12px 14px;margin:0;border-inline-start:3px solid var(--accent);background:var(--panel);font-size:16px;line-height:1.6;border-radius:0 12px 12px 0}
html[dir=rtl] .mission-goal{border-radius:12px 0 0 12px}

.mission-goal>b{display:block;font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--accent);margin-bottom:2px}
html[lang=ckb] .mission-goal>b{letter-spacing:0}
@media(max-width:359px){
 .terms{gap:4px}
 .formula-card{padding:10px 2px}
 .stepper{gap:0}
 .stepper output{min-width:20px;font-size:18px}
 .terms .operator{font-size:18px}
}

/* The site's own strip above the lab: brand and the one way back to the course. */
.lab-site{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:calc(6px + env(safe-area-inset-top)) 16px 6px;background:var(--panel);border-bottom:1px solid var(--line);color:var(--text);font-family:inherit}
.lab-site a{min-height:44px;display:inline-flex;align-items:center;color:inherit;text-decoration:none;font-weight:800}
.lab-back{padding:0 14px;border:1px solid var(--line);border-radius:999px;font-size:14px}
.lab-loading{padding:24px 16px;color:var(--muted)}
.formula .state{font-size:.62em;font-weight:600;opacity:.75;margin-inline-start:1px}
.ledger .unknown{opacity:.55}
.source-links{display:grid;gap:8px;margin-top:6px}
.source-link{display:flex;align-items:center;min-height:48px;padding:10px 14px;border:1px solid var(--line);border-radius:12px;color:var(--accent);font-weight:700;text-decoration:none}
.skip:not(:focus){position:absolute;inset-inline-start:-9999px;width:1px;height:1px;overflow:hidden}
[hidden]{display:none!important}
