:root{color-scheme:dark;--page:#102534;--card:#16364a;--stroke:#416376;--ink:#f6f7e9;--muted:#b1c9cb;--mint:#bde88f;font:16px system-ui,-apple-system,sans-serif}*{box-sizing:border-box}body{margin:0;min-height:100dvh;background:radial-gradient(ellipse at 50% 30%,#254b5c,#0a1e2d 82%);color:var(--ink)}button{font:inherit;font-weight:800;border:1px solid var(--stroke);border-radius:11px;background:#21465b;color:var(--ink);cursor:pointer;min-height:42px;touch-action:manipulation}button:disabled{opacity:.43;cursor:not-allowed}button:focus-visible{outline:3px solid #fff;outline-offset:2px}button[aria-pressed=true]{box-shadow:inset 0 0 0 2px #e4ffd5}#erase[aria-pressed=true]{background:#a8454c}button.primary{color:#122f30;background:var(--mint);border-color:#c2eba6}.shell{width:min(100%,510px);min-height:100dvh;margin:auto;padding:max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(11px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));display:flex;flex-direction:column;gap:8px}
header{display:flex;align-items:center;justify-content:space-between;min-height:42px;padding:0 3px}.brand{display:flex;align-items:center;gap:10px}.mark{width:42px;height:42px;border-radius:13px;background:#bde88f;display:grid;place-items:center;color:#173f42;font-size:1.5rem;transform:rotate(-6deg);box-shadow:0 3px 0 #101e29}.brand h1{font-size:1.42rem;letter-spacing:-.035em;margin:0;line-height:1.05}.brand h1 em{font-style:normal;color:var(--mint)}.tag{font-weight:870;font-size:.63rem;letter-spacing:.13em;color:#aecbcc;margin-top:4px}#help{width:43px;font-size:1.12rem}
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:5px}.stats div{background:#17384a;border:1px solid #3a5b6b;border-radius:11px;padding:5px 9px;line-height:1.18;min-width:0}.stats span{display:block;font-size:.71rem;color:#c5dbe1;margin-bottom:2px}.stats strong{font-size:1.03rem;font-weight:900;color:#eafbcb;font-variant-numeric:tabular-nums}
.board{min-height:0;display:flex;flex-direction:column;background:#aec5ca;border:2px solid #638793;border-radius:16px;overflow:hidden;box-shadow:0 6px 26px #0b192580}.maphead{height:30px;background:#254b5e;display:flex;justify-content:space-between;align-items:center;font-weight:850;letter-spacing:.09em;font-size:.69rem;padding:0 11px;color:#e0f1e8}.maphead i{display:inline-block;width:7px;height:7px;background:#bde88f;border-radius:50%;vertical-align:.05em;margin-right:3px}.maphead span+span{color:#fde1a6;font-variant-numeric:tabular-nums}
.mapwrap{height:min(56dvh,590px);min-height:328px;display:flex;justify-content:center;align-items:center;background:linear-gradient(#a5bac1,#bacccd)}#map{height:100%;width:100%;display:block;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}#map.draw{cursor:crosshair}#map.erase{cursor:not-allowed}.legend{font:850 7.5px system-ui;letter-spacing:1.1px;fill:#55746f}.node-name{font:850 11px system-ui;fill:#203b43;text-anchor:middle;paint-order:stroke;stroke:#e9e8d9;stroke-width:2.5px;stroke-linejoin:round;pointer-events:none}.node-icon{font:15px system-ui;text-anchor:middle;dominant-baseline:central;pointer-events:none}.node-disc{transform-box:fill-box;transform-origin:center;transition:filter .1s}.node.snap .node-disc{filter:drop-shadow(0 0 5px #6eac35)}.node.snap .ring{fill:#aede7d}.node.on .ring{stroke:#3f8153}.node .ring{stroke:#6d8d91;stroke-width:1.25;fill:#f2f5e7}.node:focus-visible .ring{stroke:#163343;stroke-width:3}.notch{fill:#eff9d7;stroke:#507e76;stroke-width:1.3}.node.on .notch{fill:#639d60}
.toolbar{background:#142f43;border:1px solid #466677;border-radius:14px;box-shadow:0 5px 0 #0d1f2c;padding:7px}.hint{min-height:38px;padding:0 4px 6px}.hint strong,.hint span{display:block}.hint strong{font-size:.81rem;color:#f3fbe1}.hint span{font-size:.71rem;margin-top:2px;color:#bcd3d9}.buttons{display:grid;grid-template-columns:minmax(110px,1.7fr) 1fr 1fr .61fr;gap:5px}.buttons button{font-size:.85rem;white-space:nowrap;padding:4px;min-height:43px}
dialog{border:1px solid #6b929e;border-radius:16px;background:#16384c;color:var(--ink);width:min(91vw,410px);padding:17px 20px;box-shadow:0 15px 60px #142231}dialog::backdrop{background:#081722b9}dialog h2{margin:4px 0 10px}dialog li{margin:6px 0}dialog ol{padding-left:20px}dialog p{font-size:.86rem;color:#d0e3e5}dialog button{padding:0 15px}
@media(min-height:850px){.shell{gap:11px;justify-content:center}.mapwrap{height:min(58dvh,590px)}}@media(max-width:345px){.buttons{gap:4px;grid-template-columns:1.5fr 1fr 1fr .5fr}.buttons button{font-size:.72rem}.stats span{font-size:.62rem}}
.mapwrap{background:radial-gradient(ellipse at 60% 12%,#b7c9bc,#829e99 81%)}.apron-label{font:800 8px system-ui;letter-spacing:1.3px;fill:#cfddd2}.zone-label{fill:#79594d}.inspection-label{font:850 7px system-ui;fill:#263e4a;text-anchor:middle;paint-order:stroke;stroke:#f3ead2;stroke-width:2px;pointer-events:none}.node-name{stroke:#f1e8d2}.node .ring{stroke:#577b80}
#security-red,#security-green{opacity:.23} [data-state=inspect] #security-red,[data-state=clear] #security-green{opacity:1;animation:indicator .37s steps(2,jump-none) infinite alternate;filter:drop-shadow(0 0 2px currentColor)}
@keyframes indicator{from{opacity:.28}to{opacity:1}} @media(prefers-reduced-motion:reduce){[data-state=inspect] #security-red,[data-state=clear] #security-green{animation:none}}
.node-name{font:850 10px system-ui;stroke-width:2.6px}.node .anchor{fill:#f8f3df;stroke:#57747a;stroke-width:1.1}.node.on .anchor{fill:#6f9f78;stroke:#f5f2e2;stroke-width:1.35}.node.snap .anchor{fill:#bfee9f;stroke:#356c64}.node.snap .node-disc{filter:none}.node .snap-halo{opacity:0}.node.snap .snap-halo,.node:focus-visible .snap-halo{opacity:1}.node[data-stop=bag] .anchor{fill:#c7d0b4;stroke:#87937e;stroke-dasharray:1.3 1}
.map-count{font:850 8.2px system-ui;fill:#36575d;text-anchor:middle;paint-order:stroke;stroke:#f2e8cf;stroke-width:2.3;pointer-events:none}.flightInfo{display:inline-flex;align-items:center;gap:7px;white-space:nowrap}.flightInfo b{display:inline-block;padding:2px 5px;border-radius:5px;background:#bad895;color:#173d40;font-size:.69rem;letter-spacing:0}

/* Demo 04: one screen, with a compact instrument bar above and below the map. */
.shell{width:min(100%,1080px);height:100vh;height:100dvh;min-height:370px;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:5px;justify-content:stretch;padding:max(5px,env(safe-area-inset-top)) max(5px,env(safe-area-inset-right)) max(5px,env(safe-area-inset-bottom)) max(5px,env(safe-area-inset-left))}
.topbar{display:grid;gap:5px;padding:0}
.headrow{display:flex;align-items:center;justify-content:space-between;padding-inline:2px}
.mark{width:36px;height:36px;border-radius:10px;font-size:1.25rem}
.brand h1{font-size:1.28rem}
.stats strong{display:block;overflow:hidden;text-overflow:ellipsis}
.board{border-radius:12px}.maphead{flex:0 0 25px}
.mapwrap{height:auto;min-height:0;flex:1;overflow:hidden}
.toolbar{padding:4px 5px 5px;border-radius:12px;box-shadow:none}
.hint{min-height:0;padding:1px 3px 4px}
.hint strong{font-size:.76rem}.hint span{font-size:.68rem}
.buttons{grid-template-columns:minmax(0,1.48fr) minmax(0,.88fr) minmax(0,.95fr) minmax(0,1.08fr) minmax(0,.49fr);gap:4px}
.buttons button{min-width:0;min-height:44px;font-size:clamp(.68rem,2.8vw,.92rem);padding:2px}
#upgrades-open{background:#374939;color:#e4f7bf;border-color:#78996a}
#upgrades{max-height:min(90dvh,640px);width:min(calc(100% - 22px),460px);padding:14px;overflow:auto}
.sheet-head{display:flex;justify-content:space-between;align-items:center;gap:8px}
.sheet-head h2{margin:3px 0 0;font-size:1.2rem}
.sheet-head button{font-size:.83rem;padding-inline:12px}
#upgrades p{margin:8px 0;color:#cfdee0;line-height:1.35}
.upgrade-wallet{display:flex;justify-content:space-between;padding:8px 9px;background:#0e2939;border-radius:8px;color:#d9efbd;font-size:.85rem}
#upgrade-list{display:grid;gap:5px;margin-block:7px}
.upgrade-row{display:flex;align-items:center;justify-content:space-between;gap:7px;padding:4px 5px 4px 9px;border:1px solid #44677a;border-radius:8px;background:#1c3f52}
.upgrade-row strong,.upgrade-row small{display:block}.upgrade-row strong{font-size:.9rem}.upgrade-row small{color:#c4dcdf;margin-top:3px;font-size:.78rem;font-variant-numeric:tabular-nums}
.upgrade-row button{min-width:84px;min-height:42px;padding-inline:6px;font-size:.82rem}
#upgrade-note{min-height:1em;font-size:.78rem;color:var(--mint)}
@media (min-width:600px){.topbar{display:grid;grid-template-columns:minmax(185px,1fr) minmax(0,1.55fr);align-items:center}.headrow{gap:6px}.toolbar .buttons{max-width:620px;margin-inline:auto}.hint{text-align:center}}
@media (orientation:landscape) and (max-height:510px){.shell{min-height:280px}.hint{display:flex;justify-content:center;gap:6px}.hint span{margin:0}.maphead{flex-basis:22px}.buttons button{min-height:38px}.stats div{padding:3px 6px}}
@media (max-width:355px){.buttons button{font-size:.66rem}}

/* Demo 05: direction uses both shape and text, independent of connection colour. */
.port{outline:none}.draw .port{cursor:crosshair}.port-shape{stroke:#173f50;stroke-width:1.35;stroke-linejoin:round}
.port.in .port-shape{fill:#f0ae73}.port.out .port-shape{fill:#79c6ca}.port.linked .port-shape{fill:#fff}
.port-halo{fill:none;stroke:#32576b;stroke-width:2;opacity:0}.port.snap .port-halo,.port:focus-visible .port-halo{opacity:1;stroke:#316553}
.port-label{font:800 7.4px system-ui;text-anchor:middle;fill:#1d3844;stroke:#f4ebd5;stroke-width:2.1;stroke-linejoin:round;paint-order:stroke;pointer-events:none}
.queue-track{stroke:#615850;stroke-width:1;stroke-dasharray:2 3;stroke-opacity:.46}
.map-count{font-size:7.5px}
.mapwrap{position:relative}
#map.zoomed:not(.draw):not(.erase){cursor:grab}
#map.zoomed:not(.draw):not(.erase):active{cursor:grabbing}
.zoom-tools{position:absolute;bottom:6px;right:6px;display:flex;gap:2px;padding:2px;background:#102a38e8;border:1px solid #709195;border-radius:10px;box-shadow:0 1px 4px #18374366}
.zoom-tools button{min-height:36px;min-width:34px;padding:0 5px;font-size:1rem;border-radius:7px;line-height:1}
#zoom-reset{font-size:.72rem;min-width:46px;font-variant-numeric:tabular-nums}
.upgrade-row .yield-info{color:#cef0a8;font-weight:750}
.upgrade-row .yield-info[hidden]{display:none}
