/* World-first layout. All ordinary controls share one temporary sheet. */
.world-first{--top-height:72px;--dock-height:80px;--sheet-height:calc(var(--app-height,100dvh)*.42)}
.world-first #app{grid-template-rows:calc(var(--top-height) + var(--safe-top)) minmax(0,1fr) calc(var(--dock-height) + var(--safe-bottom))}
.world-first #topbar{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:36px 36px;gap:0;padding:var(--safe-top) 12px 0;background:linear-gradient(120deg,#142b2b,#1d3430);box-shadow:none}
.world-first .wordmark{font-size:16px;min-height:36px;height:36px;gap:9px;letter-spacing:.1em}.world-first .wordmark small{display:none}.world-first .sigil{font-size:19px;margin:0}
.world-first .top-actions{grid-column:2;grid-row:1;gap:2px}.world-first .top-actions .icon-button{height:36px;width:38px;min-height:36px;min-width:38px;background:none;font-size:20px}.world-first #fullscreen-button{display:block}
.world-first #resources{grid-column:1/3;grid-row:2;gap:4px;height:36px}.world-first .resource{min-height:36px;grid-template-columns:18px minmax(0,1fr);grid-template-rows:18px 13px;column-gap:3px;padding:0}.world-first .resource img{width:18px;height:26px}.world-first .resource b{font-size:12px;line-height:18px}.world-first .resource small{font-size:9px;line-height:13px}.world-first .resource.population{grid-template-columns:1fr;padding-left:5px}
.world-first #dock{display:block;padding:0 10px var(--safe-bottom);height:100%;background:linear-gradient(180deg,#1d3432,#142726);border-top:1px solid #b5a47770;box-shadow:0 -3px 12px #05141255}
.world-first #quick-select,.world-first #selection,.world-first #commands,.world-first #selection-controls,.world-first #queue-strip,.world-first #season-strip,.world-first #control-groups,.world-first #world-status,.world-first #build-palette{display:none!important}
#compact-dock{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));height:100%;max-width:640px;margin:0 auto;gap:4px;padding:7px 0}
#compact-dock button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;padding:5px;min-height:44px;border:1px solid transparent;background:none;border-radius:9px;color:#eee7d4;font:600 12px system-ui}
#compact-dock button+button{border-left-color:#b8b7951c}#compact-dock button[aria-expanded=true]{border-color:#c7b48288;background:#c0ae7521;color:#f5daa0}
#compact-dock svg{width:23px;height:23px;fill:none;stroke:#d5c18c;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.world-first #objective{left:9px;top:8px;right:auto;max-width:calc(100% - 68px);width:270px;z-index:2}
.world-first #objective-button{display:flex;align-items:center;gap:7px;min-height:38px;height:38px;padding:0 11px;border:1px solid #c4b28277;border-radius:20px;background:#142b29eb;box-shadow:0 2px 10px #0002}
.world-first .objective-kicker{display:block;margin:0;font:600 10px system-ui;letter-spacing:0;color:#d9c48c;flex:none}.world-first .objective-kicker:after{content:' ·'}
.world-first #objective-title{display:block;min-width:0;margin:0;font:500 12px/1.2 system-ui;color:#f4ebd3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}
.world-first #objective-detail,.world-first #objective-progress{display:none}.world-first .objective-arrow{position:static;display:block;background:none;transform:none;width:auto;height:auto;font:18px system-ui;color:#dac68e}
.world-first #world-tools{right:4px;top:4px;gap:0}.world-first #world-tools button{height:44px;width:44px;min-height:44px;font-size:22px;background:radial-gradient(closest-side,#17322dec 85%,transparent 89%);border:0;box-shadow:none}.world-first #zoom-in,.world-first #zoom-out,.world-first #box-button,.world-first #city-button,.world-first #tactics-button{display:none!important}
#map-tip{position:absolute;left:50%;bottom:10px;transform:translateX(-50%);padding:6px 12px;background:#132a23bc;border:1px solid #bcc1a032;border-radius:20px;color:#e2e6d1;font:11px system-ui;white-space:nowrap;pointer-events:none}
.world-first #command-banner{left:8px;right:8px;bottom:8px;transform:none;width:auto;max-width:620px;margin:0 auto;padding:4px 4px 4px 10px;gap:6px;flex-wrap:nowrap;border-radius:9px;box-shadow:0 3px 12px #0004}
.world-first #command-banner>span{min-width:0;max-width:none;flex:1;flex-basis:auto;font-size:11px;padding:0}.world-first #command-banner .primary{flex:0 0 auto;min-height:44px;padding:6px 12px}.world-first #cancel-command{min-height:44px;width:40px}.world-first #build-again{display:none!important}
.world-first #minimap-wrap{display:none}.world-first #minimap-wrap.map-open{display:flex;position:fixed;top:calc(var(--top-height) + var(--safe-top) + 54px);right:12px;width:min(310px,calc(100vw - 24px));height:min(280px,calc(var(--app-height,100dvh) - 240px));z-index:12;padding:9px;background:#142a26f5;border:1px solid #ceba84;border-radius:12px;box-shadow:0 8px 30px #0008}
.world-first #minimap-wrap.map-open #map-close{display:block;width:44px;height:44px;min-height:44px}.world-first .map-caption{font-size:10px}
#compact-sheet{position:absolute;bottom:0;left:0;right:0;z-index:9;margin:0 auto;max-width:660px;height:var(--sheet-height);max-height:440px;display:flex;flex-direction:column;border:1px solid #acaa7b80;border-bottom:0;border-radius:17px 17px 0 0;background:linear-gradient(155deg,#203b37f9,#122a29fc);box-shadow:0 -8px 32px #00120d55;backdrop-filter:blur(14px);overflow:hidden}
#compact-sheet[hidden]{display:none}#compact-sheet>header{display:flex;align-items:center;justify-content:space-between;flex:none;height:48px;padding:0 8px 0 17px;border-bottom:1px solid #bec09b24}#compact-sheet-title{margin:0;font:600 16px system-ui;letter-spacing:.01em;color:#f0e4c3}#compact-sheet-close{height:44px;width:44px;min-height:44px;padding:0;border:0;background:none;font-size:19px;color:#ddd7c3}
#compact-sheet-body{overflow:auto;overscroll-behavior:contain;padding:10px 12px 14px;scrollbar-width:thin;min-height:0;touch-action:pan-y;font-size:13px}
.sheet-tabs{display:flex;gap:5px;margin-bottom:8px}.sheet-tabs button{flex:1;min-width:0;min-height:38px;padding:4px 6px;border:1px solid #b1bd963c;background:#122a2766;font-size:12px;border-radius:7px}.sheet-tabs button.active{background:#c2ac6c27;border-color:#ceba87;color:#f7dfa3}
.sheet-note{font:12px/1.5 system-ui;color:#b8cec4;margin:0 0 10px}.sheet-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.sheet-card{min-height:82px;display:flex;align-items:center;gap:6px;padding:8px 6px;text-align:left;background:#102b2580;border:1px solid #a4b08b38;border-radius:9px;min-width:0}.sheet-card img{width:49px;height:49px;object-fit:contain;flex:none;filter:drop-shadow(0 3px 3px #0005)}.sheet-card span{min-width:0}.sheet-card b{display:block;font:600 12px/1.35 system-ui;color:#eee5cb}.sheet-card small{display:block;font:10px/1.4 system-ui;color:#a6c2b3;margin-top:4px}.sheet-card.needs-supplies small{color:#d3bc84}
.sheet-menu{display:grid;grid-template-columns:1fr 1fr;gap:5px}.sheet-menu button{display:flex;justify-content:space-between;align-items:center;text-align:left;font-size:12px;min-height:44px;padding:8px 10px;background:#0e25234d;border:1px solid #b3b99530;border-radius:7px}.sheet-menu button span{color:#ceb980;font-size:18px}.sheet-groups{display:grid;grid-template-columns:repeat(4,1fr);gap:5px;margin-bottom:10px}.sheet-groups button{display:flex;flex-direction:column;gap:3px;align-items:center;min-height:52px;padding:5px;border-color:#bcb98644;background:#324b3e50}.sheet-groups b{font-size:16px;color:#e1cc93}.sheet-groups span{font-size:11px}
.sheet-step{display:flex;align-items:center;gap:12px;margin:3px 0 15px}.sheet-step>img{width:66px;height:66px;object-fit:contain;flex:none}.sheet-step h3{font:600 17px/1.3 system-ui;color:#f3e4bd;margin:0 0 6px}.sheet-step p{font:13px/1.5 system-ui;color:#d2ddd0;margin:0 0 6px}.sheet-step small{font:11px/1.5 system-ui;color:#cfbc88}.sheet-main{width:100%;min-height:44px;font-size:13px}.sheet-tasks{font-size:12px;margin-top:15px;color:#cfdfd1}.sheet-tasks summary{min-height:40px;cursor:pointer}.sheet-tasks ul{padding:0;list-style:none;line-height:1.7}.sheet-link{width:100%;background:none;border:0;color:#d7c790;min-height:44px;font-size:12px;margin-top:8px}
.sheet-orders{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}.sheet-orders .action{min-height:76px;border-radius:8px;background:#28473b88}.sheet-orders .action img{width:38px;height:32px}.sheet-orders .action strong{white-space:normal;font-size:11px}.sheet-orders .action-symbol{font-size:23px}.sheet-orders .action-caption{display:none}.sheet-footer{display:flex;gap:7px;margin-top:14px}.sheet-footer button{flex:1;font-size:12px;min-height:44px;background:#122a2455;border-color:#b5ba902b}.sheet-subtitle{font:600 12px system-ui;margin:16px 0 8px;color:#dcc996}.sheet-queue{display:flex;gap:6px;overflow-x:auto}.sheet-queue button{flex:0 0 120px;padding:8px;min-height:52px;text-align:left;background:#102522}.sheet-queue b,.sheet-queue small{display:block;font-size:11px}.sheet-queue small{margin-top:4px;color:#b0c5b4}
.world-first.compact-sheet-open #pause-veil{display:none!important}.world-first.compact-sheet-open #command-banner{display:none}
.world-first #announcements{top:calc(var(--top-height) + var(--safe-top) + 55px);width:max-content;max-width:calc(100% - 100px);z-index:30}.world-first .toast{font-size:12px;padding:8px 12px;border-radius:8px}
@media(min-width:760px){.world-first{--top-height:52px}.world-first #topbar{display:flex;gap:18px;padding-left:17px;padding-right:12px}.world-first .wordmark{font-size:17px}.world-first #resources{max-width:640px;margin:0 auto;gap:12px}.world-first .resource{grid-template-columns:21px minmax(0,1fr)}.world-first .resource img{width:21px}.world-first .resource b{font-size:14px}.world-first .resource small{font-size:10px}.world-first .top-actions .icon-button{height:44px;min-height:44px}.sheet-cards{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:359px){.world-first #topbar{padding-left:8px;padding-right:8px}.world-first .wordmark{font-size:14px}.world-first .top-actions .icon-button{width:34px;min-width:34px}.world-first .resource{grid-template-columns:13px minmax(0,1fr);column-gap:1px}.world-first .resource img{width:13px}.world-first .resource b{font-size:11px}.world-first .resource small{font-size:8px}.sheet-card img{width:38px;height:40px}.sheet-card b{font-size:11px}}
@media(max-height:480px) and (min-width:600px){.world-first{--top-height:38px;--dock-height:78px;--sheet-height:calc(var(--app-height,100dvh)*.44)}.world-first #topbar{display:flex;gap:10px;padding:var(--safe-top) 10px 0}.world-first .wordmark{font-size:12px}.world-first .sigil{font-size:16px}.world-first #resources{margin:0;flex:1;gap:3px}.world-first .resource img{display:none}.world-first .resource{grid-template-columns:1fr}.world-first .top-actions .icon-button{width:34px;min-width:34px;height:36px;min-height:36px}#compact-dock{padding:4px 0}#compact-dock button{gap:2px}#compact-sheet{max-width:640px}#compact-sheet>header{height:42px}.sheet-step{margin:0 0 8px}.sheet-step h3{font-size:14px}.sheet-step p{font-size:12px}.sheet-orders .action{min-height:62px}.sheet-cards{grid-template-columns:repeat(3,1fr)}}
@media(prefers-reduced-motion:reduce){#compact-sheet{scroll-behavior:auto}}

@media(max-height:480px) and (min-width:600px){#compact-sheet>header{height:36px}#compact-sheet-close{height:36px;min-height:36px}#compact-sheet-body{padding:8px}.sheet-tabs{margin-bottom:6px}.sheet-tabs button{min-height:32px}.sheet-tabs+.sheet-note{display:none}.sheet-card{min-height:64px;padding:5px}.sheet-card img{width:40px;height:40px}.sheet-footer{margin-top:8px}.sheet-footer button{min-height:40px}}
