
:root{--paper:#EEF1F0;--sheet:#FCFDFC;--ink:#1B2024;--ink-2:#5A646C;--rule:#C7CED2;--focus:#2C6A87;--field:#D9DCD4;--warn:#945322;--material:#849F91;--energy:#5787A0;--labor:#C49F70;--capital:#9290AD;--waste:#B66B63;--heat:#B7795A;--cool:#5787A0;--dehum:#8B86AB;--humid:#79A397;--sterile:#BCA565;--aux:#888D93;color-scheme:light}
@media(prefers-color-scheme:dark){:root:not([data-theme="light"]){--paper:#101315;--sheet:#171B1E;--ink:#E1E5E3;--ink-2:#97A1A9;--rule:#323A40;--focus:#7FB7D2;--field:#1D231F;--warn:#E0AA7D;--material:#91B5A2;--energy:#79ACCA;--labor:#D8B987;--capital:#B0AACF;--waste:#D68C82;--heat:#D49C7C;--cool:#79ACCA;--dehum:#B0AACF;--humid:#92C0AD;--sterile:#D0BD82;--aux:#A0A8AF;color-scheme:dark}}
:root[data-theme="dark"]{--paper:#101315;--sheet:#171B1E;--ink:#E1E5E3;--ink-2:#97A1A9;--rule:#323A40;--focus:#7FB7D2;--field:#1D231F;--warn:#E0AA7D;--material:#91B5A2;--energy:#79ACCA;--labor:#D8B987;--capital:#B0AACF;--waste:#D68C82;--heat:#D49C7C;--cool:#79ACCA;--dehum:#B0AACF;--humid:#92C0AD;--sterile:#D0BD82;--aux:#A0A8AF;color-scheme:dark}
*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font:15px/1.6 Literata,Georgia,serif}.page{max-width:1200px;margin:auto;padding:32px 20px 72px;display:grid;gap:26px}header{max-width:76ch;display:grid;gap:12px}h1{font-size:clamp(28px,5vw,40px);line-height:1.15;margin:0}h2,h3,.eyebrow,.cond,button,label,select,input,summary,.read,dt{font-family:'IBM Plex Sans Condensed','Arial Narrow',sans-serif}h2{font-size:15px;letter-spacing:.1em;text-transform:uppercase;margin:0 0 12px}h3{font-size:18px;margin:0}p{margin:0 0 10px}.eyebrow{letter-spacing:.12em;text-transform:uppercase;font-size:12px;color:var(--ink-2)}.sheet{background:var(--sheet);border:1px solid var(--rule);padding:20px;min-width:0}.toolbar,.row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.toolbar{padding:12px;background:var(--sheet);border:1px solid var(--rule)}button,input,select{font-size:15px;color:var(--ink);background:var(--sheet);border:1px solid var(--rule);padding:8px 10px;max-width:100%}button{cursor:pointer;font-weight:600}button:hover{background:var(--field)}button.primary{background:var(--ink);color:var(--sheet)}button:disabled{opacity:.5;cursor:wait}input[type=range]{padding:0;width:100%;accent-color:var(--focus)}input[type=number]{width:100px}label{display:grid;gap:4px;font-size:14px}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,245px),1fr));gap:16px}.two{display:grid;grid-template-columns:1fr 1fr;gap:20px;min-width:0}.tile{border:1px solid var(--rule);padding:16px;min-width:0}.tile .read{margin-bottom:10px}.read,small{font-size:13px;color:var(--ink-2)}.badge{display:inline-block;background:var(--field);border:1px solid var(--rule);padding:2px 8px;font:600 12px 'IBM Plex Sans Condensed',sans-serif;letter-spacing:.08em;text-transform:uppercase}.big{font-size:26px;font-weight:600}.muted{color:var(--ink-2)}.warning{color:var(--warn)}.bar{height:9px;background:var(--paper);border:1px solid var(--rule);margin:8px 0}.fill{height:100%;background:var(--focus)}.tasks{padding:0;list-style:none;margin:8px 0}.tasks li{padding:8px 0;border-bottom:1px solid var(--rule);display:grid;grid-template-columns:1fr auto;gap:10px;font:15px/1.4 'IBM Plex Sans Condensed',sans-serif}.tasks span{overflow-wrap:anywhere}.tasks b{white-space:nowrap}.alerts{padding-left:20px;margin:8px 0}.alerts li{margin-bottom:5px}.stats{display:flex;flex-wrap:wrap;gap:18px 32px}.stats div{display:grid}.stats span{font:12px 'IBM Plex Sans Condensed',sans-serif;text-transform:uppercase;letter-spacing:.08em;color:var(--ink-2)}dl{margin:10px 0;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 12px}dt{color:var(--ink-2);overflow-wrap:anywhere}dd{margin:0;font-variant-numeric:tabular-nums;text-align:right}details{min-width:0}summary{cursor:pointer;font-weight:600;padding:7px 0}svg{display:block;width:100%;height:auto;overflow:visible}svg text{fill:var(--ink-2);font:12px 'IBM Plex Sans Condensed',sans-serif}.legend{display:flex;flex-wrap:wrap;gap:6px 14px;font:13px 'IBM Plex Sans Condensed',sans-serif}.legend i{display:inline-block;width:10px;height:10px;margin-right:5px}.source{border-bottom:1px solid var(--rule);padding:9px 0;overflow-wrap:anywhere}.source b{display:block;font:600 14px 'IBM Plex Sans Condensed',sans-serif}.source code{font-size:12px;white-space:pre-wrap;overflow-wrap:anywhere}.source a,a{color:var(--focus)}#sources-list{max-height:65vh;overflow:auto}#source-filter{width:100%;margin:12px 0}.titleblock{border-top:1px solid var(--rule);padding-top:12px;margin-top:16px;font:12px 'IBM Plex Sans Condensed',sans-serif;text-transform:uppercase;letter-spacing:.07em}.chartcard{min-width:0}.controls label{margin:10px 0}.costline{display:flex;justify-content:space-between;gap:10px;font-size:13px}#status{min-height:1.5em}.notice{border-left:3px solid var(--warn);padding-left:12px}.tile.add{border-style:dashed;display:grid;align-content:start;gap:12px}:focus-visible{outline:2px solid var(--focus);outline-offset:3px}
@media(max-width:640px){.page{padding:24px 16px 48px;gap:20px}.sheet{padding:14px}.two{grid-template-columns:1fr}.toolbar button{flex:1 1 42%}.tile{padding:12px}.big{font-size:22px}.row{align-items:stretch}h1{font-size:30px}.stats{gap:12px 20px}svg text{font-size:13px}}

/* App shell; palette and typography inherited from site/farm_template.html. */
html,body{width:100%;height:100%;overflow:hidden}body{font-family:'IBM Plex Sans Condensed',sans-serif}button,input,select,summary{min-height:44px}input[type=checkbox]{min-width:44px}button{border-radius:12px}h1{font-family:Literata,Georgia,serif;font-size:23px}#farm-canvas{position:fixed;inset:0;width:100%;height:100%;touch-action:none}.hud{position:fixed;top:max(16px,env(safe-area-inset-top));left:16px;right:16px;max-width:420px;background:color-mix(in srgb,var(--sheet) 92%,transparent);border:1px solid var(--rule);border-radius:20px;padding:12px 16px;gap:4px;backdrop-filter:blur(14px);z-index:10;box-shadow:0 5px 30px #0001}.hud-title{display:flex;justify-content:space-between;align-items:center}.hud-title button{width:44px;padding:0;font-size:23px}.hud #date{font-size:14px}.hud #weather{font-size:12px}.hud .row{gap:8px}.hud #hud-numbers{line-height:1.2;display:grid;grid-template-columns:1fr 1fr;gap:4px 12px;font-size:13px}.hud #hud-numbers b{display:block;font-size:18px}#labor-label{font-size:12px}#labor-meter{width:100%;height:10px;accent-color:var(--material)}.view-tools{position:fixed;top:255px;left:16px;z-index:8;display:flex;gap:6px}.view-tools button{font-size:13px;background:var(--sheet)}.turn-controls{position:fixed;bottom:calc(32vh + 12px);right:16px;z-index:20;display:flex;align-items:end;gap:8px}.turn-controls button{height:48px;width:44px;padding:0;box-shadow:0 4px 18px #0002}.turn-controls .next-day{width:84px;height:84px;border-radius:50%;background:var(--focus);color:var(--sheet);font-size:19px;line-height:1.05;border:3px solid var(--sheet);position:relative}.next-day span{position:absolute;right:9px;top:12px;font-size:18px}.bottom-sheet{position:fixed;bottom:0;left:0;right:0;height:32vh;z-index:15;background:var(--sheet);border-radius:24px 24px 0 0;border:1px solid var(--rule);box-shadow:0 -6px 35px #0002;display:flex;flex-direction:column;transition:height .22s ease;padding-bottom:env(safe-area-inset-bottom)}.bottom-sheet.expanded{height:72vh}.bottom-sheet #sheet-handle{display:flex;justify-content:center;align-items:center;border:0;border-radius:24px 24px 0 0;background:transparent;width:100%;flex-shrink:0;height:44px}.bottom-sheet #sheet-handle span{width:38px;height:4px;background:var(--rule);border-radius:3px}.tabs{display:flex;flex-wrap:wrap;gap:0;padding:0 16px 8px;flex-shrink:0;border-bottom:1px solid var(--rule)}.tabs button{flex:1 0 auto;font-size:14px;padding:6px 9px;background:none;border:0}.tabs button[aria-selected=true]{background:var(--field);color:var(--focus)}.sheet-content{overflow:auto;overscroll-behavior:contain;padding:16px;min-height:0}.sheet-content [data-panel]{max-width:1050px;margin:auto}.sheet-content [data-panel][hidden]{display:none}.sheet{padding:0;border:0;background:none;margin:0 0 22px}.tile{border-radius:16px;padding:16px;margin-bottom:12px}.two{gap:16px}.tasks li{position:relative;transition:background .3s;padding-left:24px}.tasks li:before{content:'○';position:absolute;left:0;top:8px;color:var(--ink-2)}.tasks li.done:before{content:'✓';color:var(--material)}.tasks li.done{background:var(--field)}.tasks li.done b{color:var(--focus)}.room-card[open]{border-color:var(--focus)}.room-card summary{font-size:18px;color:var(--focus)}#toasts{position:fixed;top:310px;right:16px;z-index:21;max-width:min(310px,calc(100vw - 32px));pointer-events:none;display:grid;gap:6px}.toast{padding:10px 14px;border:1px solid var(--rule);border-radius:14px;background:var(--sheet);box-shadow:0 4px 14px #0002;font-size:14px;animation:toast-in .2s ease-out}#scene-status{position:fixed;top:300px;left:16px;right:16px;font-size:13px;color:var(--ink-2);pointer-events:none;z-index:7}#stats .big{font-size:19px}.grid>*{min-width:0}svg{overflow:hidden}#sources-list{max-height:none}#site-map{max-height:260px;overflow:hidden}#site-map svg{height:230px}p,dd,summary{overflow-wrap:anywhere}dl{grid-template-columns:minmax(0,1fr) minmax(0,auto)}.scene-room-label{pointer-events:auto!important;cursor:pointer;min-height:44px;min-width:44px;display:flex;align-items:center;justify-content:center;z-index:5}.read{line-height:1.4}@keyframes toast-in{from{opacity:0;transform:translateY(8px)}}@media(min-width:800px){.bottom-sheet{left:16px;right:auto;width:440px;height:44vh;border-radius:24px;bottom:16px}.bottom-sheet.expanded{height:66vh}.turn-controls{bottom:32px}.sheet-content .two{grid-template-columns:1fr}.view-tools{top:255px}#toasts{top:16px}#scene-status{top:310px;max-width:380px}}@media(max-width:640px){.two{grid-template-columns:1fr}.tabs button{font-size:13px;padding:6px 7px}.stats{gap:8px 16px}.hud{gap:2px}.room-card .row{display:block}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
@media(prefers-color-scheme:dark){:root:not([data-theme="light"]) #farm-canvas{filter:brightness(.6) saturate(.8)}}:root[data-theme="dark"] #farm-canvas{filter:brightness(.6) saturate(.8)}
/* Round 6: the canvas owns the free rectangle; all information is docked. */
:root{--paper:#edf1df;--sheet:#fffdf2;--ink:#2e4437;--ink-2:#65755f;--rule:#d8dec6;--focus:#426f62;--field:#e3ead3}
.hud{top:10px;left:12px;right:344px;max-width:none;height:48px;border-radius:14px;padding:0 12px;display:flex;align-items:center;gap:20px;box-shadow:0 3px 12px #30462c12}
.hud-title{display:contents}.hud h1{font-size:21px;white-space:nowrap}.hud-title button{order:3;margin-left:auto;height:36px;min-height:36px;width:36px;font-size:20px}.hud .row{white-space:nowrap}.hud #date{font-size:12px}.hud #weather,.hud #hud-numbers,.hud #labor-label,.hud #labor-meter,.hud #season{display:none}
.view-tools{top:66px;left:12px;right:344px;gap:6px}.view-tools button{min-height:34px;padding:5px 12px;font-size:12px;background:#fffdf2ed}.view-tools button[aria-pressed=true]{background:var(--focus);color:white}
.bottom-sheet,.bottom-sheet.expanded{left:auto;right:12px;top:10px;bottom:76px;width:316px;height:auto;border-radius:16px;transition:none;box-shadow:0 3px 16px #30462c18}
.bottom-sheet #sheet-handle{height:48px;min-height:48px;justify-content:space-between;padding:0 16px}.bottom-sheet #sheet-handle span{width:auto;height:auto;background:none;border-radius:0;font-size:14px}.bottom-sheet #sheet-handle b{display:none}
.tabs{padding:0 8px 8px}.tabs button{font-size:12px;min-height:34px;padding:5px 8px}.sheet-content{padding:14px}.sheet-content .two{grid-template-columns:1fr}.sheet-content #stats{display:none}.sheet-content #status{font-size:11px}
.turn-controls{right:12px;bottom:12px;width:316px;gap:6px;align-items:center}.turn-controls button{width:36px;height:48px;min-height:44px;box-shadow:none}.turn-controls .next-day{flex:1;width:auto;height:48px;border:0;border-radius:12px;font-size:16px}.next-day span{position:static;margin-left:8px;font-size:18px}
#scene-status{top:110px;left:16px}#toasts{top:115px;right:350px}
body[data-scene-focus=true] .bottom-sheet{top:116px}
@media(max-width:799px){
.hud{top:8px;left:8px;right:8px;height:44px;padding:0 10px;gap:8px;border-radius:12px}.hud h1{font-size:19px}.hud #date{font-size:11px}.hud-title button{width:30px;min-height:32px;height:32px}.hud .row{margin-left:auto}.hud-title button{margin-left:0}
.view-tools{top:58px;left:8px;right:8px;gap:4px}.view-tools button{flex:1;min-height:34px;padding:4px;font-size:11px;border-radius:9px}
.bottom-sheet{left:0;right:0;top:auto!important;bottom:0;width:auto;height:64px;border-radius:16px 16px 0 0;padding-bottom:env(safe-area-inset-bottom)}
.bottom-sheet.expanded{left:0;right:0;top:auto!important;bottom:0;width:auto;height:65vh;border-radius:16px 16px 0 0;padding-bottom:64px}
.bottom-sheet #sheet-handle{height:64px;min-height:64px;width:calc(100% - 140px);border-radius:16px;padding:0 16px;justify-content:flex-start;gap:12px}.bottom-sheet #sheet-handle span{font-size:14px}.bottom-sheet #sheet-handle b{display:block}.bottom-sheet.expanded #sheet-handle b{transform:rotate(180deg)}
.bottom-sheet:not(.expanded) .tabs,.bottom-sheet:not(.expanded) .sheet-content{display:none}.bottom-sheet .tabs{flex-wrap:nowrap;overflow:auto}.tabs button{flex:0 0 auto}
.turn-controls{bottom:10px;right:10px;width:124px}.turn-controls [data-speed]{display:none}.turn-controls .next-day{height:44px;min-height:44px;font-size:15px}.next-day span{font-size:15px;margin-left:4px}
#toasts{top:104px;right:10px;max-width:250px}.toast{font-size:12px}#scene-status{top:100px}
}

/* Round 7: touch controls and quiet task cards. */
.view-tools button,.tabs button,.hud-title button{min-height:44px;min-width:44px}.view-tools{gap:4px}
.tasks li{display:block;padding:12px 0}.tasks li:before{display:none}.task-heading{display:flex;align-items:center;gap:8px;min-width:0}.task-heading b{margin-left:auto;font-size:12px}.task-icon{font-size:22px;width:25px;color:var(--focus)}.task-badge{border-radius:20px;background:var(--field);padding:1px 7px;font-size:12px}.task-detail{padding:7px 0 0 33px;font-size:13px;color:var(--ink-2)}.task-detail p{margin:0 0 7px}.species-dot{display:inline-block;width:9px;height:9px;margin-right:5px;border-radius:50%;box-shadow:0 0 0 1px #8884}.sheet-content{overflow-x:hidden}.source span{overflow-wrap:anywhere}.hud h1 a{color:inherit;text-decoration:none}.gesture-hint{position:fixed;left:16px;bottom:14px;font-size:12px;color:var(--ink);background:var(--sheet);border-radius:20px;padding:5px 12px;pointer-events:none;z-index:7}
@media(max-width:799px){.hud{height:48px}.view-tools{top:62px}.gesture-hint{bottom:74px;left:50%;transform:translateX(-50%);white-space:nowrap;font-size:11px}.hud h1{font-size:19px}.farm-caption{overflow:auto}.bottom-sheet.expanded{padding-bottom:64px}}

body[data-scene-focus=true] .gesture-hint{display:none}


/* The site's specimen-paper palette and typefaces, with a light-paper companion. */
:root{--ground:#f1ebe2;--raise:#fffaf3;--ink:#302638;--soft:#716775;--hair:#d6cbd9;--spore:#73557e;--spore-dim:#91779e;--disp:'Xanh Mono','Courier New',monospace;--body:'Albert Sans',system-ui,sans-serif;--paper:var(--ground);--sheet:var(--raise);--ink-2:var(--soft);--rule:var(--hair);--focus:var(--spore);--field:#e7dce9;color-scheme:light}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]){--ground:#131015;--raise:#1A161C;--ink:#EAE3D8;--soft:#a99daf;--hair:#403647;--spore:#CBB9D8;--spore-dim:#8E8298;--paper:var(--ground);--sheet:var(--raise);--ink-2:var(--soft);--rule:var(--hair);--focus:var(--spore);--field:#302637;color-scheme:dark}}
:root[data-theme=dark]{--ground:#131015;--raise:#1A161C;--ink:#EAE3D8;--soft:#a99daf;--hair:#403647;--spore:#CBB9D8;--spore-dim:#8E8298;--paper:var(--ground);--sheet:var(--raise);--ink-2:var(--soft);--rule:var(--hair);--focus:var(--spore);--field:#302637;color-scheme:dark}
body,button,input,select,summary,h2,h3,dt,.read,.tasks li,.badge{font-family:var(--body)}h1,.farm-caption b{font-family:var(--disp);font-weight:400}.hud{background:var(--sheet)}.view-tools button{background:var(--sheet)}.hud h1 a{display:flex;align-items:center;gap:8px}.hud h1 a:before{content:'';width:25px;height:25px;border-radius:50%;background:repeating-conic-gradient(from 8deg,var(--spore) 0deg 1.8deg,transparent 1.8deg 7deg);mask-image:radial-gradient(circle,transparent 12%,#000 17%,#000 57%,transparent 72%)}.farm-label-layer .farm-badge,.farm-label-layer .farm-caption{background:var(--sheet);color:var(--ink);border-color:var(--rule);font-family:var(--body)}.turn-controls .next-day{background:var(--spore);color:var(--ground)}.hud h1{font-size:22px}.gesture-hint{color:var(--soft)}
@media(max-width:799px){.hud h1{font-size:19px}.hud #date{font-size:10px}.hud{gap:5px}}
