:root{font-family:-apple-system,BlinkMacSystemFont,"Avenir Next",system-ui,sans-serif;background:#e9eadc;color:#2d473b;font-synthesis:none}
*{box-sizing:border-box}html,body{margin:0}body{min-height:100vh;background:radial-gradient(ellipse at 8% 0%,#fffaf0,#eae8d8 66%,#e2e4d8)}
button{font:inherit;min-height:48px;touch-action:manipulation;cursor:pointer;border:2px solid #c8cdbb;border-radius:13px;background:#fffaf0;color:#29493c;padding:10px 13px;font-weight:850;box-shadow:0 3px 0 #c2bfa8;transition:transform .12s,background .12s}
button:active{transform:translateY(2px);box-shadow:0 1px 0 #a59b81}button:focus-visible,a:focus-visible{outline:3px solid #efa942;outline-offset:3px}
button.selected{color:#fff;background:#327059;border-color:#327059;box-shadow:0 3px 0 #20523f}
button.machine-primary{background:#e5b653;border-color:#ca9742;color:#403b2e;box-shadow:0 3px 0 #a67a3c}
button.primary{background:#e3ac46;border:2px solid #bd8734;color:#483b22;font-size:17px;box-shadow:0 4px 0 #ac792d}
.app{max-width:1510px;margin:auto;padding:16px clamp(12px,2vw,30px) 35px}
.header{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:15px}
.branding{display:flex;gap:12px;align-items:center}.mark{width:58px;height:58px;flex-shrink:0;display:grid;place-items:center;border-radius:16px;background:#397b5e;font-size:35px;box-shadow:0 3px 0 #255742}
h1{font-family:Georgia,serif;font-size:clamp(23px,3.2vw,39px);line-height:1.06;margin:0 0 3px}
.branding p{font-size:15px;font-weight:800;color:#6b785b;margin:0}
.saved{font-weight:800;font-size:13px;color:#1f7654;background:#d8edda;border-radius:24px;padding:10px 14px;white-space:nowrap}
.chooser{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.house-lots,.view-tabs{display:flex;gap:8px;flex-wrap:wrap}
.house-lots button{font-size:14px}.view-tabs button{font-size:15px;min-width:117px}
.message{border-radius:16px;padding:13px 18px;margin-bottom:12px;font-size:18px;font-weight:850;line-height:1.3;min-height:57px}
.message.good{background:#deeddf;color:#265e43;border:2px solid #bbd5bd}
.message.bad{background:#fff0da;color:#963c30;border:2px solid #e8b28b}
.layout{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(300px,.75fr);gap:17px;align-items:start}
.drawing,.workshop{min-width:0;background:#fffdf5;border:2px solid #d8d5bb;border-radius:22px;box-shadow:0 17px 36px #3f4f3a13;overflow:hidden}
.drawing-heading{display:flex;justify-content:space-between;align-items:center;gap:13px;padding:10px 17px;background:#f5f0dc}
.drawing-heading h2{margin:0;font:800 clamp(15px,2.5vw,21px) system-ui}
.drawing-heading small{font-size:13px;color:#64765e;font-weight:800}
#world{display:block;width:100%;height:auto;aspect-ratio:960/580;touch-action:none;user-select:none;-webkit-user-select:none;background:#d8e4d8}
.toolbar{padding:12px;display:flex;gap:8px;justify-content:center;flex-wrap:wrap}
.brush{min-width:122px;flex:1;display:flex;justify-content:center;align-items:center;gap:10px;font-size:18px;line-height:1.15}
.brush span{font-size:28px;line-height:1}
.advance{background:#f7f0df;padding:12px 17px 14px;border-top:1px solid #e0d8c3;display:flex;flex-direction:column;gap:7px}
.advance strong{font-size:17px;font-weight:850;line-height:1.25}
.meter{height:15px;border-radius:15px;background:#d4d5bc;overflow:hidden;border:1px solid #bdbea5}
.meter span{display:block;height:100%;background:linear-gradient(90deg,#e2b55d,#6fa87f);transition:width .23s ease}
#progress-text{font-size:13px;font-weight:750;color:#62735e}
.quick-actions{padding:12px;display:flex;gap:10px}.quick-actions button{flex:1}
.workshop-title{padding:14px 17px 10px;background:#f3efdf}
.workshop-title h2{font-size:20px;margin:0 0 4px}.workshop-title p{margin:0;color:#657362;font-weight:650;font-size:14px}
#controls{padding:13px}
.machine{background:#f8f3e7;border:1px solid #e3d6bb;border-radius:14px;padding:11px 13px;margin:0 0 12px}
.machine h2{font-size:18px;margin:0 0 4px}.machine p{font-size:14px;line-height:1.4;margin:0 0 10px;color:#5e6b59}
.machine small{display:block;font-size:13px;margin:9px 0 0;font-weight:850;color:#597158}
.machine>button{width:100%}.buttonrow{display:flex;gap:7px;flex-wrap:wrap;align-items:stretch}
.buttonrow button{min-width:0;flex:1;padding:9px 6px;font-size:14px}
#controls>h2{font:750 24px Georgia,serif;margin:6px 2px 12px}
#controls>p{font-size:16px;line-height:1.45;color:#566958}
#controls>.buttonrow{margin:12px 0}
.footer-help{font-size:15px;line-height:1.5;padding:12px 15px;color:#466a59;background:#dae8da;border-radius:13px;font-weight:750;margin:17px 0 0}
.footnote{text-align:center;margin:16px auto 0;max-width:900px;font-size:12px;color:#79816f;line-height:1.6}
a{color:#306b65}
@media(max-width:1050px){
 .layout{grid-template-columns:1fr}.workshop{max-width:none}
 #controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .machine{margin:0}.chooser{justify-content:flex-start}
}
@media(max-width:640px){
 .app{padding:9px 10px 28px}.header{gap:8px;margin-bottom:10px}
 .branding{gap:8px}.mark{width:43px;height:43px;border-radius:11px;font-size:26px}
 h1{font-size:21px}.branding p{font-size:11px}
 .saved{font-size:9px;padding:7px 8px}
 .chooser{gap:6px;margin-bottom:8px}
 .house-lots,.view-tabs{width:100%;gap:5px}
 .house-lots button,.view-tabs button{flex:1;min-width:0;min-height:45px;padding:7px 4px;font-size:12px;border-radius:10px}
 .view-tabs button{font-size:13px;min-height:49px}
 .message{min-height:50px;margin-bottom:8px;padding:9px 12px;font-size:14px;border-radius:12px}
 .drawing,.workshop{border-radius:14px}
 .drawing-heading{padding:7px 10px}.drawing-heading h2{font-size:16px}
 .drawing-heading small{font-size:10px}
 .toolbar{padding:7px;gap:5px}
 .brush{min-width:86px;gap:3px;padding:5px;min-height:49px;font-size:13px;flex-direction:column}
 .brush span{font-size:22px}
 .advance{padding:9px 11px}.advance strong{font-size:14px}
 #progress-text{font-size:11px}
 .quick-actions{padding:9px;gap:7px}
 .quick-actions button{font-size:13px;padding:8px 5px}
 #controls{grid-template-columns:1fr}
 .machine{padding:10px}.machine h2{font-size:17px}.machine p{font-size:13px}
 .workshop-title{padding:10px}.workshop-title h2{font-size:18px}
 .footer-help{font-size:13px}
}
@media(prefers-reduced-motion:reduce){button,.meter span{transition:none}}

/* Keep the child’s next machine action visible immediately beside the scene. */
.site-ops{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;padding:9px 11px;background:#e3ead7;border-top:1px solid #d4dbc6}
.site-ops button{min-width:0;min-height:57px;padding:7px 5px;font-size:16px;line-height:1.13;border-radius:12px}
.site-ops button.focus-job{background:#e7b755;color:#4a3d24;border-color:#c59338;box-shadow:0 3px 0 #a8772f}
@media(max-width:640px){.site-ops{gap:5px;padding:6px}.site-ops button{min-height:49px;padding:5px 3px;font-size:12px;font-weight:900;border-radius:10px}}

.site-ops button:only-child{grid-column:1/-1}
