.activity-root{height:100%;min-height:0;display:flex;flex-direction:column;gap:8px}.lab-stage{flex:1;min-height:0;display:flex;flex-direction:column;justify-content:center;gap:12px;padding:16px;border:1px solid #c5dccb;border-radius:22px;background:#eff7ed;overflow:hidden}.lab-stage>svg{width:100%;flex:1;min-height:0}.lab-controls{display:flex;justify-content:center;gap:8px;flex-wrap:wrap}.lab-status{font-size:14px;min-height:18px;text-align:center;color:#316543}.lab-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;flex:1;min-height:0}.lab-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}.lab-grid>button,.lab-card{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;border:1px solid #accab5;border-radius:16px;background:#fffef8;padding:12px;color:#2d583f;font:inherit;min-height:0}.lab-grid svg{width:100%;flex:1;min-height:0;max-height:230px}.lab-stage button:not(:disabled),[role=button]{cursor:pointer}.lab-stage button:hover:not(:disabled){box-shadow:0 0 0 3px #b5d5bd}.lab-stage [aria-pressed=true],.lab-stage .done{background:#d9edda;border:2px solid #317b49}.lab-controls button{padding:9px 13px}.lab-quiz{display:grid;gap:12px}.lab-quiz fieldset{border:1px solid #a8c4ae;border-radius:12px;padding:12px}.lab-quiz legend{font-weight:650}.lab-quiz button{display:block;width:100%;text-align:left;padding:9px;margin:5px 0}.lab-bank{display:flex;gap:7px;justify-content:center;flex-wrap:wrap}.lab-bank button{padding:8px 12px}.rank-list{display:grid;gap:5px;list-style:none;margin:0;padding:0}.rank-list button{width:100%;padding:8px;background:#fffef8;border:1px dashed #7b9f83;border-radius:7px}.rank-list .done{border-style:solid;animation:rankZoom .6s ease}.lab-note{text-align:center;color:#4c6957;font-size:13px;margin:0}.lab-stage table{border-collapse:collapse;width:100%;font-size:15px}.lab-stage th,.lab-stage td{padding:7px;border:1px solid #b3c9b8;text-align:center}.lab-stage input{font:inherit;max-width:100%;padding:7px}.lab-stage svg text{font-family:Arial,sans-serif;fill:#294e3b;font-size:18px}.lab-stage svg [role=button]{outline:none}.lab-stage svg [role=button]:hover,.lab-stage svg [role=button]:focus{filter:drop-shadow(0 0 5px #d9aa38)}.slide-in{animation:slideIn 1.8s ease both}.strand-up{animation:strandUp 2s ease both}.strand-down{animation:strandDown 2s ease both}.gene-transfer{animation:geneTransfer 2.6s ease both}.branch-draw{stroke-dasharray:1400;stroke-dashoffset:1400;animation:drawBranch 2s ease forwards}.pulse{animation:pulse 1.7s ease-in-out infinite}.lab-stage .control-button{white-space:normal}.lab-stage .split{display:flex;gap:15px;align-items:center;flex:1;min-height:0}.split>div{flex:1;min-width:0}.split svg{width:100%;max-height:260px}button:focus-visible{outline:3px solid #d7a13b;outline-offset:2px}@keyframes rankZoom{from{transform:scale(.85);opacity:.4}to{transform:none;opacity:1}}@keyframes slideIn{from{transform:translateX(-100px);opacity:0}to{transform:none;opacity:1}}@keyframes strandUp{to{transform:translateY(-65px)}}@keyframes strandDown{from{transform:translateY(80px)}to{transform:none}}@keyframes geneTransfer{from{transform:translate(-220px,-80px)}to{transform:none}}@keyframes drawBranch{to{stroke-dashoffset:0}}@keyframes pulse{50%{filter:drop-shadow(0 0 6px #e8bb4d)}}@media(max-width:740px){.lab-stage{padding:8px}.lab-grid.three{grid-template-columns:repeat(3,1fr)}.lab-stage table{font-size:12px}.lab-stage th,.lab-stage td{padding:4px}.lab-controls{gap:4px}.lab-controls button{padding:7px}.lab-quiz button{font-size:13px}}@media(prefers-reduced-motion:reduce){.slide-in,.strand-up,.strand-down,.gene-transfer,.branch-draw,.pulse{animation:none}.strand-up{transform:translateY(-65px)}.branch-draw{stroke-dashoffset:0}}
.grow-bar{transform-origin:220px center;animation:growBar 1.5s ease both}.fragment-dna{animation:fragmentDNA 1.5s ease both}@keyframes growBar{from{transform:scaleX(0)}to{transform:scaleX(1)}}@keyframes fragmentDNA{from{transform:translateY(-60px)}to{transform:none}}@media(prefers-reduced-motion:reduce){.grow-bar,.fragment-dna{animation:none}}

/* Small screens use a flowing instructional panel; desktop layout is unchanged. */
@media(max-width:720px){
 .workspace{display:flex;flex-direction:column;overflow:auto;min-height:0}
 .instruction-popup{position:relative!important;inset:auto!important;transform:none!important;order:-1;width:calc(100% - 24px);max-width:none;max-height:none;flex-shrink:0;margin:12px}
 .lesson-scene.active{position:relative;inset:auto;min-height:600px;height:auto;flex-shrink:0;padding:12px}
 .activity-root{height:auto;min-height:560px}
 .lab-stage{flex:none;min-height:420px;overflow:visible}
 .lab-stage>svg{flex:none;height:270px;min-height:230px}
 .lab-grid{flex:none}.lab-grid svg{min-height:120px;height:150px}
 .lab-grid.three{grid-template-columns:repeat(2,minmax(0,1fr))}
 .lab-stage .split{flex-direction:column;align-items:stretch}
 .lab-stage input{width:100%;min-width:0}
}
