:root{--bg:#f5f2e9;--paper:#fffcf5;--ink:#273d35;--muted:#5c7065;--line:#dcded1;--orange:#b84a25;--green:#397150;--purple:#74558d;--teal:#26777b;--gold:#926a20;font-family:'Segoe UI',sans-serif;color:var(--ink);background:var(--bg)}*{box-sizing:border-box}body{margin:0}button,a{touch-action:manipulation}button{font:inherit;cursor:pointer;border:1px solid var(--line);border-radius:11px;padding:10px 15px;color:var(--ink);background:var(--paper);font-weight:600}button:hover{border-color:var(--ink)}button:disabled{opacity:.4;cursor:default}button:focus-visible,a:focus-visible{outline:3px solid #26777b;outline-offset:3px}a{color:inherit}header,main,.about,footer{max-width:1120px;margin:auto;padding:20px 24px}header{display:flex;align-items:center;justify-content:space-between;gap:20px}header img,footer img{width:137px;height:40px;object-fit:contain}.home{border:1px solid var(--ink);border-radius:30px;text-decoration:none;padding:10px 17px;font-size:14px;font-weight:600}.title{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:5px 0 24px}.eyebrow{font-size:11px;letter-spacing:2px;font-weight:700;color:var(--muted);margin:0 0 9px}h1{font:clamp(29px,4vw,47px)/1.13 Georgia,serif;margin:0}h1 em{color:var(--orange)}.subtitle{color:var(--muted);margin-bottom:0}.tools{display:flex;gap:8px;flex-wrap:wrap}h2{font:26px/1.2 Georgia,serif;margin:0 0 14px}p{line-height:1.55}.dashboard{display:grid;grid-template-columns:repeat(4,1fr);border-block:1px solid var(--line);margin-bottom:22px}.dashboard>span{padding:14px 16px;font-size:10px;letter-spacing:1px;border-right:1px solid var(--line)}.dashboard>span:last-child{border:0}.dashboard b{display:block;font:26px Georgia,serif;letter-spacing:0;margin-top:6px}.intro,.results{background:var(--paper);border:1px solid var(--line);border-radius:22px;padding:40px;max-width:760px;margin:30px auto}.intro h2,.results h2{font-size:37px}.primary{background:var(--orange);color:white;border-color:var(--orange);padding:13px 23px;white-space:nowrap}.lab-top{display:grid;grid-template-columns:1.1fr 1fr;gap:24px}.plant-panel{background:#e6edde;border:1px solid #d3dfc7;border-radius:22px;overflow:hidden;display:flex;flex-direction:column}.plant-panel svg{width:100%;display:block;flex:1}.plant-caption{display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px;padding:13px 18px;font-size:11px;color:#355344;border-top:1px solid #ccdac0}.plant-caption span:first-child{font-weight:700}.challenge{padding:12px 0}.weather{display:inline-block;background:#eee4cd;padding:7px 12px;border-radius:9px;font-size:13px;margin:0}.challenge>p:not(.eyebrow){font-size:14px}.budget{display:flex;gap:15px}.budget>div{flex:1;padding:13px;background:var(--paper);border:1px solid var(--line);border-radius:12px}.budget span,.budget small{display:block;font-size:11px;color:var(--muted)}.budget b{font:34px Georgia,serif;display:block;margin:3px 0}.next{color:var(--muted);font-size:12px!important}.allocation-heading{display:flex;justify-content:space-between;gap:12px;align-items:center;margin:24px 0 14px}.allocation-heading h2{font-size:24px;margin:0}.allocation-heading span{font-size:11px;color:var(--muted)}.branches{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.branch{--branch:var(--green);border:1px solid var(--line);border-top:4px solid var(--branch);border-radius:13px;padding:16px;background:var(--paper)}.branch:nth-child(2){--branch:var(--purple)}.branch:nth-child(3){--branch:var(--teal)}.branch:nth-child(4){--branch:var(--gold)}.branch .index{font-size:11px;color:var(--branch);font-weight:700}.branch h3{font:21px Georgia,serif;margin:8px 0}.branch p{font-size:12px;min-height:38px;color:var(--muted);margin:8px 0}.branch .cost{font-size:11px;min-height:28px}.counter{display:flex;align-items:center;justify-content:space-between;margin:13px 0}.counter button{width:42px;height:42px;padding:0;font-size:23px}.counter b{font:31px Georgia,serif}.target{font-size:12px;border-top:1px solid var(--line);padding-top:10px;color:var(--muted)}.target.met{color:var(--green);font-weight:700}.run-row{display:flex;justify-content:space-between;align-items:center;gap:15px;margin:18px 0}.run-row p{font-size:13px;max-width:650px}.last-result{font-size:12px;padding:12px 16px;border-left:3px solid var(--green);background:#e5ecdf;line-height:1.5}.science-note{font-size:12px;color:var(--muted);margin-top:26px}.about,footer{border-top:1px solid var(--line);margin-top:24px;font-size:14px}footer{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px}footer em{font-family:Georgia,serif;color:var(--muted)}footer p{width:100%;font-size:12px}dialog{border:1px solid var(--line);border-radius:18px;padding:26px;max-width:min(660px,92vw);max-height:85dvh;background:var(--paper);color:var(--ink);overflow:auto}dialog::backdrop{background:#17231bb0}dialog li{margin:10px 0;line-height:1.55}dialog p{font-size:14px}.report-row{padding:12px 0;border-bottom:1px solid var(--line);font-size:13px}.report-row b{display:block;margin-bottom:4px}[hidden]{display:none!important}@media(max-width:820px){.title{display:block}.tools{margin-top:18px}.branches{grid-template-columns:repeat(2,1fr)}.allocation-heading{display:block}.allocation-heading span{display:block;margin-top:8px}.lab-top{gap:16px}}@media(max-width:540px){header,main,.about,footer{padding:16px}.home{font-size:12px;padding:9px 12px}header img{width:112px}.dashboard{grid-template-columns:repeat(2,1fr)}.dashboard>span:nth-child(2){border-right:0}.dashboard>span:nth-child(-n+2){border-bottom:1px solid var(--line)}.lab-top{grid-template-columns:1fr}.plant-panel svg{max-height:240px}.plant-caption{font-size:10px}.challenge{padding-top:5px}.branch{padding:12px}.branch h3{font-size:19px}.counter button{width:38px;height:42px}.run-row{align-items:stretch;flex-direction:column}.intro,.results{padding:25px}.intro h2,.results h2{font-size:30px}.tools button{font-size:12px;padding:10px}.results p{font-size:14px}}@media(prefers-reduced-motion:no-preference){button:active{transform:translateY(1px)}}
/* Sprout's pocket-money lab: the scene and instructions stay beside the work. */
.intro{background:radial-gradient(circle at 100% 0,#ffe2a1,transparent 50%),var(--paper);border:2px solid var(--ink);box-shadow:7px 7px 0 #d7dfc9}.intro-tip{font-size:13px;color:var(--muted)}#practice{margin-top:10px}.speech{background:#fff8d8;border:2px solid #b4882f;border-radius:16px;padding:12px 16px;margin:12px 12px 0;font-weight:700;font-size:14px;line-height:1.4;position:relative;z-index:1}.crew{display:block;font-size:12px;font-weight:700;color:var(--branch);margin-top:8px}.target-track{height:7px;background:#e8e9df;border-radius:8px;margin:8px 0;overflow:hidden}.target-track span{display:block;height:100%;background:var(--branch);transition:width .16s}.fill{width:100%;padding:8px;font-size:12px;border-color:var(--branch);color:var(--branch)}.guidance{border:2px solid #be8a22;background:#fff3bd;border-radius:12px;padding:10px 14px;flex:1;min-width:0}.guidance>b{font-size:10px;letter-spacing:1px;color:#694a12}.guidance p{margin:4px 0 0;line-height:1.4;font-weight:650}.branch{box-shadow:2px 3px 0 #dfe2d2}.branch .index{font-size:9px}.branch h3{font-weight:700}.plant-panel svg{min-height:0}.allocation-panel{min-height:0}.playing{height:100dvh;display:flex;flex-direction:column;overflow:hidden}.playing>header{width:100%;padding:8px 20px;flex-shrink:0}.playing header img{height:30px}.playing main{padding:5px 20px;min-height:0;flex:1;width:100%;display:flex;flex-direction:column}.playing .title{margin:0 0 6px;gap:10px;display:flex;align-items:center}.playing .title h1{font-size:24px}.playing .title .eyebrow,.playing .subtitle,.playing .about,.playing .science-note{display:none}.playing .tools{margin:0;gap:5px}.playing .tools button{font-size:11px;padding:7px 9px}.playing .dashboard{margin:0 0 8px;flex-shrink:0;grid-template-columns:repeat(4,1fr)}.playing .dashboard>span{padding:5px 10px;font-size:9px;border-bottom:0}.playing .dashboard b{font-size:20px;margin:2px 0}.playing #experiment{display:grid;grid-template-columns:minmax(0,.95fr) minmax(0,1.35fr);grid-template-rows:minmax(0,1fr) auto;gap:10px 18px;min-height:0;flex:1}.playing .lab-top{display:flex;flex-direction:column;gap:8px;min-height:0}.playing .plant-panel{flex:1;min-height:90px}.playing .plant-panel svg{width:100%;flex:1;height:0}.playing .plant-caption{padding:5px 10px;font-size:10px}.playing .challenge{padding:0;flex-shrink:0}.playing .challenge .eyebrow,.playing .next{display:none}.playing .challenge h2{font-size:20px;margin:0 0 5px}.playing .challenge>p{margin:5px 0;font-size:12px}.playing .budget{gap:8px}.playing .budget>div{padding:6px 10px;display:flex;align-items:center;justify-content:space-between;gap:8px}.playing .budget b{font-size:25px;margin:0}.playing .budget small{display:none}.playing .allocation-panel{overflow:auto;overscroll-behavior:contain;padding:0 5px 4px 0}.playing .allocation-heading{margin:0 0 8px;display:block}.playing .allocation-heading h2{font-size:19px}.playing .allocation-heading span{display:block;font-size:10px;margin:4px 0}.playing .branches{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.playing .branch{padding:10px}.playing .branch h3{font-size:20px;margin:5px 0}.playing .branch p{min-height:0;margin:5px 0}.playing .branch .cost{min-height:0}.playing .counter{margin:8px 0}.playing .counter button{height:44px;width:44px}.playing .run-row{grid-column:1/-1;margin:0;display:flex;flex-direction:row;align-items:stretch;gap:10px}.playing .run-row p{font-size:12px}.playing .last-result{display:none}.playing>footer{width:100%;margin:6px auto 0;padding:5px 20px;gap:4px;flex-shrink:0}.playing footer img{height:24px;width:92px}.playing footer em{font-size:12px}.playing footer p{margin:0;font-size:10px}
@media(max-width:600px){.playing>header{padding:5px 10px}.playing main{padding:3px 10px}.playing .title{flex-direction:column;align-items:stretch;gap:5px}.playing .title h1{font-size:20px}.playing .tools{flex-wrap:nowrap;overflow-x:auto;padding-bottom:3px;flex-shrink:0}.playing .tools button{flex-shrink:0}.playing #experiment{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(100px,.85fr) minmax(80px,1.3fr) auto;gap:7px}.playing .lab-top{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:7px}.playing .speech{font-size:10px;padding:5px 7px;margin:5px 5px 0;border-radius:8px;line-height:1.25}.playing .plant-caption{padding:3px 5px;font-size:9px}.playing .plant-caption span:last-child{display:none}.playing .challenge{overflow:auto;overscroll-behavior:contain}.playing .challenge h2{font-size:16px}.playing .challenge>p{font-size:10px;line-height:1.3;margin:4px 0}.playing .weather{padding:3px 5px}.playing .budget{gap:4px}.playing .budget>div{padding:3px 5px;gap:2px;display:block}.playing .budget span{font-size:9px}.playing .budget b{font-size:21px}.playing .branch h3{font-size:17px}.playing .branch{padding:7px}.playing .branch .index{display:none}.playing .crew{margin:0;font-size:10px}.playing .allocation-heading h2{font-size:16px}.playing .allocation-heading span{font-size:9px}.playing .run-row{grid-column:1;gap:6px}.playing .guidance{padding:5px 7px}.playing .run-row p{font-size:11px;max-height:57px;overflow:auto}.playing #commit{font-size:12px;padding:8px}.playing>footer{padding:4px 10px}.playing footer img{height:19px}.playing footer em{font-size:10px}.playing footer p{font-size:9px}}
@media(max-height:620px) and (min-width:601px){.playing .title h1{font-size:20px}.playing .challenge #brief{display:none}.playing .speech{font-size:11px;padding:5px 8px;margin:5px 5px 0}.playing .challenge h2{font-size:16px}.playing .challenge>p{margin:3px 0}.playing .plant-caption{display:none}.playing .guidance{padding:4px 8px}.playing .run-row p{font-size:11px;max-height:32px;overflow:auto}.playing #commit{padding:7px 14px}.playing .dashboard>span{padding:3px 8px}.playing .dashboard b{font-size:17px}.playing .allocation-heading h2{font-size:16px}.playing .branch h3{font-size:17px}.playing .branch .index{display:none}}
@media(prefers-reduced-motion:no-preference){#plant.boop{animation:boop .25s ease-out}@keyframes boop{50%{transform:rotate(-2deg) scale(1.025)}}#scene-prop{animation:bob 3s ease-in-out infinite}@keyframes bob{50%{transform:translateY(-7px)}}}
/* Reserve space for budgets even when the available height is very small. */
.playing .challenge{min-height:0}.playing .allocation-panel{scroll-padding-top:8px}
@media(max-width:600px){.playing .dashboard b{font-size:17px;white-space:nowrap}.playing .run-row p{max-height:42px}.playing #experiment{grid-template-rows:minmax(125px,.85fr) minmax(75px,1.3fr) auto}.playing .challenge{display:flex;flex-direction:column}.playing .challenge .budget{order:-1;flex-shrink:0;margin-bottom:4px}.playing .challenge h2{flex-shrink:0}.playing .challenge #brief{margin-bottom:0}}
@media(max-height:620px) and (min-width:601px){.playing .lab-top{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:stretch;gap:8px}.playing .challenge{overflow:auto;overscroll-behavior:contain;display:flex;flex-direction:column}.playing .challenge .budget{order:-1;flex-shrink:0;margin-bottom:5px}.playing .budget>div{padding:4px;display:block}.playing .budget span{font-size:9px}.playing .budget b{font-size:20px}.playing .weather{font-size:10px!important;padding:4px}.playing .challenge h2{font-size:14px}.playing .plant-panel{min-height:0}.playing .speech{font-size:10px}.playing .run-row p{max-height:29px}}
@media(max-height:700px){.playing .branch .crew,.playing .branch>p:not(.cost){display:none}.playing .branch{padding:6px}.playing .branch h3{font-size:14px;margin:0 0 3px}.playing .branch .cost{font-size:10px;margin:2px 0}.playing .counter{margin:4px 0}.playing .counter b{font-size:23px}.playing .target{padding-top:4px;font-size:10px}.playing .allocation-heading{margin-bottom:5px}.playing .allocation-heading span{margin:2px 0}.playing .target-track{margin:4px 0}.playing .guidance p{max-height:32px}.playing .guidance>b{font-size:9px}}
/* Wider seedling inset and a compact, fully visible allocation board. */
.playing #experiment{grid-template-columns:minmax(0,1.2fr) minmax(0,1fr)}
.playing .allocation-panel{overflow:visible;padding:0;display:flex;flex-direction:column}
.playing .branches{gap:10px;flex:1;grid-template-rows:repeat(2,minmax(0,1fr))}
.playing .branch{padding:10px;display:flex;flex-direction:column;justify-content:center;min-height:0}
.playing .branch .index,.playing .branch .crew,.playing .branch>p:not(.cost){display:none}
.playing .branch h3{font-size:19px;margin:0 0 5px}
.playing .branch .cost{margin:3px 0;font-size:11px}
.playing .counter{margin:6px 0}
.playing .target{padding-top:6px;font-size:11px}
.playing .target-track{margin:6px 0}
.playing .fill{padding:7px}
.playing .plant-panel svg{max-height:none}
.playing .challenge #brief{font-size:11px;line-height:1.35}
/* Short displays use the document's natural flow, never an inner control scrollbar. */
@media(max-width:600px),(max-height:650px){
 .playing{height:auto;min-height:100dvh;overflow:visible}
 .playing main{flex:none;display:block}
 .playing #experiment{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);grid-template-rows:auto auto;align-items:start}
 .playing .lab-top{display:flex;flex-direction:column}
 .playing .plant-panel{min-height:0;flex:none}
 .playing .plant-panel svg{height:auto;flex:none;max-height:none}
 .playing .speech{font-size:12px;padding:8px;margin:8px 8px 0}
 .playing .challenge{overflow:visible;display:block}
 .playing .challenge #brief{display:block}
 .playing .branches{grid-template-rows:auto auto;flex:none}
 .playing .branch{padding:8px}
 .playing .branch h3{font-size:16px}
 .playing .guidance p,.playing .run-row p{max-height:none;overflow:visible}
 .playing .tools{overflow:visible;flex-wrap:wrap}
 .playing footer{margin-top:12px}
}
@media(max-width:600px){
 .playing #experiment{grid-template-columns:minmax(0,1fr);gap:12px}
 .playing .lab-top{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);align-items:center}
 .playing .run-row{grid-column:1}
 .playing .challenge h2{font-size:16px}
 .playing .speech{font-size:10px;padding:6px;margin:5px 5px 0}
 .playing .branch h3{font-size:17px}
 .playing .branches{gap:8px}
 .playing .run-row{align-items:center}
 .playing #commit{align-self:stretch}
}
@media(min-width:601px) and (min-height:651px) and (max-height:800px){
 .playing .branch{padding:6px}
 .playing .branch h3{font-size:17px;margin:0 0 3px}
 .playing .branch .cost{margin:2px 0;font-size:10px}
 .playing .counter{margin:3px 0}
 .playing .counter b{font-size:25px}
 .playing .target{padding-top:3px;font-size:10px}
 .playing .target-track{height:5px;margin:3px 0}
 .playing .fill{padding:5px;font-size:11px}
}
