/* Map-first play: panels overlay the viewport only when requested. */
.map-first .notification{pointer-events:none!important}.map-first dialog.device-review-stage[open]{position:fixed;inset:0;margin:0;width:100vw;height:100dvh;max-width:none;max-height:none;border:0;border-radius:0;padding:0;display:grid;grid-template-rows:auto minmax(0,1fr);overflow:hidden}.review-progress-bar{display:flex;align-items:center;gap:16px;padding:8px 12px;background:var(--paper)}.review-progress-bar p{flex:1;margin:0;font-size:.875rem}.device-review-stage .review-map{height:100%;width:100%;margin:0;border:0}
.map-first .selected-heading h2{display:none}.map-first .selected-emblem{width:30px;height:30px;flex:none;font-size:20px}.preview-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}.map-first .target-preview .preview-actions button{margin:0;min-width:0}.map-first .target-preview p{margin:10px 0 0}
:root{--paper:#fdfcf8;--ink:#27382f;--muted:#52624f;--line:#c6cdbf;--orange:#9d4428;--green:#344e3d;--ui-scale:1;font-size:calc(16px * var(--ui-scale))}
[hidden]{display:none!important}
.map-first{height:100vh;height:100dvh;overflow:hidden;display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;background:#e4eadc;color:var(--ink)}
.map-first button,.map-first select,.map-first input:not([type=checkbox]){min-height:44px;min-width:44px;font-size:.875rem}
.map-first button:focus-visible,.map-first a:focus-visible,.map-first input:focus-visible,.map-first select:focus-visible,.map-first summary:focus-visible,.map-first svg:focus-visible{outline:3px solid #9d4428;outline-offset:3px}
.skip-link{position:fixed;left:12px;top:8px;z-index:100;transform:translateY(-200%);padding:12px;background:var(--paper);border:2px solid var(--green);min-height:44px}.skip-link:focus{transform:none}
.play-bar{display:flex;align-items:center;gap:10px;min-height:56px;padding:6px max(12px,env(safe-area-inset-right)) 6px max(12px,env(safe-area-inset-left));padding-top:max(6px,env(safe-area-inset-top));background:var(--paper);border-bottom:1px solid var(--line);z-index:6}
.hud-button{border:1px solid var(--line);border-radius:6px;padding:8px 12px;white-space:nowrap;background:var(--paper)}
.play-identity{display:grid;gap:3px;min-width:0;flex:1}.play-identity strong{font-family:Georgia,serif;font-weight:400;font-size:1.125rem}.play-identity>span{font-size:.75rem;color:var(--muted)}
.play-bar .save-status{margin-left:0;font-size:.75rem;color:var(--muted);white-space:nowrap}.save-status.error{color:#9b352b}.compact-app-label{display:none}.play-bar #app-button{display:flex;gap:7px;align-items:center}
.map-first main{position:relative;max-width:none;width:100%;height:100%;padding:0;min-height:0;overflow:hidden}
.map-first .map-card{position:absolute;inset:0;width:100%;height:100%;align-self:stretch;border:0;border-radius:0;display:block;overflow:hidden}.map-first .map-viewport{position:absolute;inset:0;width:100%;height:100%;min-height:0;max-height:none;flex:none}.map-first #map{display:block;width:100%;height:100%;touch-action:none;outline-offset:-4px}
.map-first .map-compass{top:14px;left:16px;color:#455c44;font-size:1.5rem}.map-first .map-compass span{font-size:.625rem}
.map-first .zoom-controls{right:max(12px,env(safe-area-inset-right));top:12px;bottom:auto;border-color:#879b7c;background:var(--paper);z-index:2}.map-first .zoom-controls button{width:44px;height:44px;font-size:1.375rem;color:#273f2c}.map-first .zoom-controls button+button{border-color:var(--line)}
.map-first .map-instruction{top:12px;max-width:calc(100% - 160px);white-space:normal;text-align:center;font-size:.8125rem;line-height:1.4;color:#344b32;background:#fdfcf8f2;border-color:#96a588;padding:8px 12px}
.map-first .map-footer{position:absolute;left:12px;bottom:10px;min-height:0;border:0;gap:12px;padding:5px 8px;border-radius:4px;background:#fdfcf8e8;color:#40513c;font-size:.6875rem;pointer-events:none}
.play-dock{display:flex;gap:8px;padding:6px max(12px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));background:var(--paper);border-top:1px solid var(--line);z-index:6}.play-dock>button{flex:1;padding:8px 14px;border:1px solid var(--line);border-radius:6px;line-height:1.3}.play-dock .end-turn{flex:1.4;width:auto;min-height:44px;padding:8px 14px;font-size:.875rem;justify-content:center;gap:12px}
.map-first .context-panel,.roster-panel{position:absolute;z-index:4;right:max(12px,env(safe-area-inset-right));top:12px;width:min(23rem,calc(100% - 24px));max-height:calc(100% - 24px);overflow:auto;overscroll-behavior:contain;background:var(--paper);border:1px solid #a6b39b;border-radius:9px;box-shadow:0 8px 30px #25352130;display:block;padding:0 16px 16px;scroll-padding:12px}
.panel-heading{position:sticky;top:0;display:flex;align-items:center;justify-content:space-between;gap:8px;background:var(--paper);z-index:1;border-bottom:1px solid var(--line);margin-bottom:12px;min-height:52px}.panel-heading h2{font-family:Georgia,serif;font-weight:400;font-size:1.125rem;margin:8px 0;overflow-wrap:anywhere}.panel-heading button{font-size:1.5rem;flex:none}
.map-first .selected-heading{margin:12px 0}.map-first .selected-heading h2{font-size:1.25rem}.map-first .selected-heading p{font-size:.8125rem;color:var(--muted)}.map-first .unit-metrics{font-size:.8125rem;gap:22px}.map-first .unit-metrics span{font-size:.6875rem;color:var(--muted)}.map-first .unit-metrics strong{font-size:.9375rem;color:var(--ink)}
.map-first .command-buttons button{font-size:.875rem;padding:10px;min-height:44px}.map-first .field-note,.map-first .production-caption,.map-first .production-caption strong{font-size:.8125rem;line-height:1.65;color:var(--muted)}.map-first .text-button{font-size:.8125rem;min-height:44px;padding:10px 0;color:#405a37}
.map-first .target-preview{margin:0 0 16px;padding:12px;border-color:#b19b73}.map-first .target-preview h3{font-size:1rem}.map-first .target-preview p{font-size:.875rem;color:#5d4d32}.map-first .target-preview button{font-size:.875rem;min-height:44px}.map-first .target-preview .cancel-preview{min-height:44px;font-size:.8125rem;color:#5d4d32}
.map-first .production-grid button{min-height:64px;font-size:.8125rem}.map-first .production-grid small{font-size:.75rem;color:var(--muted)}.map-first .city-options button,.map-first .base-label,.map-first .cargo-heading{font-size:.8125rem;color:var(--muted)}.map-first .base-label select{font-size:.875rem;min-height:44px;width:100%}
.map-first .roster-row{font-size:.875rem;min-height:52px;padding:10px 8px;gap:9px}.map-first .roster-row small,.map-first .roster-state{font-size:.75rem;color:var(--muted)}.map-first .roster-row .roster-symbol{color:#42623c}.map-first .roster-row.chosen{outline:2px solid #5a7748;outline-offset:-2px;background:#e7eddc}
.map-first .roster-tabs{padding:0;gap:20px}.map-first .roster-tabs button{font-size:.875rem;color:var(--muted)}.map-first .roster-tabs button[aria-selected=true]{color:#273f2c}.map-first .roster-tabs span{font-size:.75rem;color:var(--muted)}.map-first .roster-list{max-height:none;overflow:visible;padding:4px 0}
.map-first dialog{max-width:34rem;width:calc(100% - 24px);max-height:calc(100dvh - 24px);padding:20px;color:var(--ink);overscroll-behavior:contain;scroll-padding:16px}.map-first .dialog-top{align-items:flex-start}.map-first .dialog-top h2{font-size:1.6rem;line-height:1.25;overflow-wrap:anywhere}.map-first .dialog-top button{flex:none}
.map-first .dialog-copy,.map-first .manual p,.map-first .manual li,.map-first .workshop-tutorial p{font-size:.875rem;line-height:1.7;color:var(--muted)}.map-first .manual h3{font-size:1rem}.map-first .manual kbd{font-size:.75rem;color:var(--ink)}
.map-first .dialog-controls button,.map-first .dialog-form input,.map-first .dialog-form select,.map-first .dialog-form button{font-size:.9375rem;min-height:44px}.map-first .dialog-form label,.map-first .rules-choice-label{font-size:.8125rem;color:var(--muted)}.map-first .dialog-form input,.map-first .dialog-form select{border-color:#8d9c83}.map-first .dialog-controls{gap:10px}.map-first .dialog-controls button{border-color:#a0ae96}
.map-first .rules-table{font-size:.8125rem}.map-first .rules-table th small,.map-first .rules-table caption,.map-first .rules-hash{font-size:.6875rem;color:var(--muted)}.map-first #rules-choice{font-size:.875rem}.map-first .save-entry strong{font-size:.9375rem}.map-first .save-entry small{font-size:.8125rem;color:var(--muted)}.map-first .save-entry-actions button{font-size:.8125rem;min-height:44px}.map-first .save-section-title{font-size:1rem}
.map-first .notification{font-size:.875rem;bottom:72px;z-index:20;max-height:40dvh;overflow:auto;pointer-events:auto;background:#304536;color:white}.map-first .notification.error{background:#813b29}
.map-first .session-banner{position:absolute;z-index:5;top:8px;left:8px;max-width:calc(100% - 80px);font-size:.8125rem;color:#4d3f25;background:#fff4d9;padding:8px 12px;gap:12px}.map-first .session-banner button{font-size:.8125rem}
.map-first .tutorial-panel{position:absolute;z-index:3;top:12px;left:12px;width:min(25rem,calc(100% - 84px));margin:0;padding:0 12px;border-color:#93a77d;max-height:45%;overflow:auto;display:block;background:#f4f6eaf2;overscroll-behavior:contain}.tutorial-panel details>summary{cursor:pointer;min-height:48px;padding:8px 0;font-size:.8125rem;line-height:1.5}.tutorial-panel summary strong{display:block;font-size:.9375rem}.map-first .tutorial-panel p{font-size:.875rem;line-height:1.6;margin:8px 0}.map-first .tutorial-actions{min-width:0;display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.map-first .tutorial-actions button{font-size:.8125rem;flex:1;padding:8px;min-width:90px}.map-first .tutorial-actions button:last-child{grid-column:auto}
.menu-stats{font-size:.875rem;line-height:1.6}.menu-version{margin-top:18px!important}.map-first .dispatches{padding:18px 0 0}.map-first .dispatches summary{min-height:44px;cursor:pointer;font-size:.875rem}.map-first .event-list{display:block}.map-first .event-entry{font-size:.8125rem;color:var(--muted);margin:10px 0}
.preferences-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.preferences-grid label{font-size:.8125rem;display:grid;gap:6px}.preferences-grid select{width:100%;padding:8px;border:1px solid #8d9c83;border-radius:5px;background:var(--paper);color:var(--ink)}.preference-toggle{display:flex;gap:10px;align-items:center;font-size:.875rem;min-height:44px;margin:12px 0}.preference-toggle input{width:24px;height:24px;flex:none}
.review-map{display:block;width:100%;height:180px;background:#dce5d3;border:1px solid var(--line);margin:12px 0}.review-results{font-size:.875rem;line-height:1.7}.review-results dt{font-weight:600}.review-results dd{margin:0 0 10px;overflow-wrap:anywhere}.map-first:fullscreen{background:#e4eadc}
@media(max-width:760px){.play-bar{gap:6px;padding-left:max(8px,env(safe-area-inset-left));padding-right:max(8px,env(safe-area-inset-right))}.play-identity strong{font-size:1rem}.play-identity>span{font-size:.6875rem}.play-bar #app-label{display:none}.compact-app-label{display:inline}.play-bar .save-status{max-width:100px;overflow-wrap:anywhere;white-space:normal}.hud-button{padding:6px 9px}.play-dock{gap:6px;padding-left:max(8px,env(safe-area-inset-left));padding-right:max(8px,env(safe-area-inset-right))}.play-dock>button{padding:8px;font-size:.8125rem}.play-dock .end-turn{font-size:.8125rem;padding:8px}.map-first .context-panel,.map-first .roster-panel{top:auto;bottom:8px;left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));width:auto;max-height:48%;padding:0 14px 14px}.map-first .roster-panel{max-height:70%}.map-first .map-instruction{top:10px;font-size:.75rem;max-width:calc(100% - 130px)}.map-first .map-footer{font-size:.625rem;max-width:calc(100% - 70px);gap:6px}.map-first .tutorial-panel{top:8px;left:8px;max-height:38%;width:calc(100% - 76px)}.panel-heading{min-height:48px}.panel-heading h2{font-size:1rem}.map-first .notification{bottom:70px}.preferences-grid{grid-template-columns:1fr}.play-bar #fullscreen-button{font-size:.75rem;padding:6px}.map-first dialog{padding:16px}}
@media(max-width:480px){.play-identity strong{display:none}.play-bar .save-status{display:none}.play-identity>span{font-size:.75rem}.play-bar #fullscreen-button{max-width:72px;white-space:normal}.map-first .command-buttons{grid-template-columns:1fr 1fr}.map-first .production-grid{grid-template-columns:1fr 1fr}.map-first .map-compass{left:10px}.map-first .tutorial-panel summary strong{font-size:.875rem}}
@media(max-height:500px) and (min-width:600px){.play-bar{min-height:48px;padding-top:2px;padding-bottom:2px}.play-dock{padding-top:2px;padding-bottom:2px}.map-first .context-panel,.map-first .roster-panel{left:auto;right:8px;top:8px;bottom:8px;width:min(22rem,46%);max-height:none}.map-first .tutorial-panel{max-height:55%;width:min(23rem,45%)}.map-first dialog{max-height:calc(100dvh - 16px)}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
.map-first{grid-template-rows:auto auto minmax(0,1fr) auto}.map-first #notification{position:static;display:block;transform:none;opacity:0;max-height:0;min-height:0;max-width:none;width:100%;margin:0;padding:0;border-radius:0;overflow:hidden;pointer-events:none!important;box-shadow:none;font-size:.875rem;line-height:1.6}.map-first #notification.show{opacity:1;max-height:20dvh;padding:8px 14px;overflow:auto;pointer-events:auto!important}
.map-first [tabindex]:focus-visible{outline:3px solid #9d4428;outline-offset:3px}
.map-first .app-version,.map-first .app-readiness small{color:var(--muted);font-size:.75rem}
.map-first .tutorial-panel p{color:var(--muted)}
.map-first .dialog-form .preference-toggle{display:flex}
.preview-seed-control{display:grid;gap:6px}
.map-first .expedition-controls label{margin:0}.map-first .expedition-controls .dialog-copy{margin:0;line-height:1.5}.map-first .preview-seed-row input,.map-first .expedition-controls input[type=checkbox]{margin-top:0}
.preview-summary summary{min-height:44px;padding:10px 0;cursor:pointer}.preview-summary details ul{margin-top:0}@media(max-width:760px){.map-first .expedition-layout{display:flex;flex-direction:column}.map-first .expedition-controls{display:contents}.map-first .expedition-controls>*{order:2;width:100%}.map-first .expedition-controls .preview-seed-control{order:0}.map-first .expedition-layout>.world-preview{order:1;width:100%}}
.map-first dialog.expedition-dialog{max-width:68rem}.expedition-layout{display:grid;grid-template-columns:minmax(15rem,.85fr) minmax(0,1.35fr);gap:24px;align-items:start}.expedition-controls{display:grid;gap:14px;min-width:0}.preview-seed-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}.preview-seed-row input{min-width:0}.map-first .preview-seed-row button{padding:8px 12px;border:1px solid #8d9c83;border-radius:5px;background:#edf0e6;white-space:nowrap}.world-preview{position:sticky;top:0;min-width:0;border:1px solid var(--line);padding:14px;border-radius:8px;background:#f4f6ee}.world-preview h3{font:1.2rem Georgia,serif;margin:0 0 8px}.map-first #preview-status{overflow-wrap:anywhere;margin:0 0 10px;font-size:.8125rem}.preview-map{width:100%;min-height:220px;display:grid;place-items:center;background:#e4eadc;border:1px solid #b1bea4;border-radius:5px;overflow:hidden}.preview-map[aria-busy=true]{opacity:.55}.preview-board{display:block;width:100%;height:auto;max-height:400px;pointer-events:none}.preview-summary{font-size:.8125rem;line-height:1.6;overflow-wrap:anywhere}.preview-summary p{margin:10px 0}.preview-summary ul{margin:8px 0;padding-left:18px}.map-first .world-preview .preview-note{font-size:.75rem;margin:12px 0 0}.expedition-actions{display:flex;gap:10px;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:16px}.expedition-actions button{flex:1;padding:12px;border:1px solid #8d9c83;border-radius:5px}.expedition-actions .primary-button{flex:2}.map-first .world-preview .hex-cell{cursor:default}@media(max-width:760px){.expedition-layout{grid-template-columns:1fr;gap:18px}.world-preview{position:static;padding:10px}.preview-map{min-height:180px}.preview-board{max-height:300px}.map-first dialog.expedition-dialog{max-width:34rem}.expedition-actions{flex-direction:column}}@media(min-width:761px) and (max-height:600px){.preview-board{max-height:230px}}
.map-first #map-share-url{display:block;width:100%;min-height:100px;margin:8px 0 16px;padding:10px;font-size:.875rem;color:var(--ink);background:var(--paper);border:1px solid #8d9c83;border-radius:5px;resize:vertical}.map-first .share-link-label{font-size:.8125rem;color:var(--muted)}.map-share-qr{margin:12px 0;overflow-wrap:anywhere;font-size:.875rem;color:var(--muted)}.map-share-qr svg{display:block;width:min(100%,340px);height:auto;margin:auto;background:white}

/* Optional feedback is a separate, non-interactive layer above the map. */
.map-first #effects-overlay{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:1;overflow:hidden}
.feedback-marker{color:#9d4428;pointer-events:none}.feedback-marker>g>path,.feedback-marker>g>circle{fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.feedback-marker text{fill:currentColor;stroke:#fffdf3;stroke-width:3;paint-order:stroke;text-anchor:middle;font-size:13px;font-weight:700}
.feedback-marker .unit-symbol path,.feedback-marker .unit-symbol circle,.feedback-marker .unit-symbol rect,.feedback-marker .unit-symbol ellipse{stroke-width:1.5}.feedback-marker .feedback-unit{color:#344e3d}
.feedback-complete,.feedback-repair{color:#24734b}.feedback-hit,.feedback-loss,.feedback-combat{color:#7e8777}.feedback-wait{color:#46616c}
.effects-preferences{border:1px solid var(--line);border-radius:6px;padding:14px;margin:8px 0 20px;min-width:0}.effects-preferences legend{font-size:1rem;font-weight:700;padding:0 5px}.effects-preferences output{float:right;font-weight:700}.effects-preferences select,.effects-preferences input[type=range]{width:100%;max-width:100%;accent-color:var(--green)}.effects-test{display:flex;align-items:center;gap:12px;margin-top:12px}.effects-test button{flex:1}.effects-test svg{width:64px;height:54px;flex:none;border:1px solid var(--line);border-radius:6px;background:#edf0e3;overflow:visible}.effects-test-status{min-height:1.5em}
@media(prefers-reduced-motion:reduce){#effects-overlay,.effects-test svg{visibility:hidden}}

/* Waypoint editing keeps ordinary map controls and touch targets. */
.waypoint-overlay>path{fill:none;stroke:#9d4428;stroke-width:2.5;stroke-dasharray:6 5;opacity:.85}.waypoint-overlay circle{fill:#fffdf3;stroke:#9d4428;stroke-width:1.5}.waypoint-overlay text{fill:#67351f;font-size:9px;font-weight:700}.waypoint-overlay.paused>path{stroke:#6c6251;stroke-dasharray:2 6}
.waypoint-controls{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:14px 0}.waypoint-controls p{grid-column:1/-1;margin:0}.map-first .waypoint-controls button,.map-first .city-route-button{min-height:44px;padding:10px;border:1px solid var(--line);border-radius:5px;font-size:.875rem}.city-route-button{width:100%;text-align:left;margin:10px 0}
.waypoint-list{list-style:none;padding:0;margin:12px 0;display:grid;gap:8px}.waypoint-list li{display:grid;grid-template-columns:minmax(0,1fr) repeat(3,44px);gap:4px;align-items:center;border-bottom:1px solid var(--line);padding-bottom:8px}.waypoint-list span{font-size:.8125rem;line-height:1.5;overflow-wrap:anywhere}.map-first .waypoint-list button{width:44px;padding:8px}.route-editor-actions{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}.route-editor-actions button{flex:1;padding:10px;border:1px solid var(--line);border-radius:5px;min-width:8rem}.route-editor-map{display:block;width:100%;height:250px;background:#e4eadc;border:1px solid var(--line);border-radius:6px;margin:10px 0}.route-map-details summary{min-height:44px;display:flex;align-items:center;cursor:pointer}#route-error:empty{display:none}
@media(forced-colors:active){.waypoint-overlay>path,.waypoint-overlay circle{stroke:CanvasText}.waypoint-overlay circle{fill:Canvas}.waypoint-overlay text{fill:CanvasText}}

/* The demo has its own controls; campaign orders and saves remain separate. */
.map-first .attract-info{position:absolute;z-index:3;left:12px;top:12px;width:min(24rem,calc(100% - 92px));max-height:42%;overflow:auto;padding:10px 14px;border:1px solid #a3b295;border-radius:6px;background:#fdfcf8f2;overscroll-behavior:contain}
.attract-info h2{font:1.1rem Georgia,serif;margin:0 0 6px}.attract-info h2 span{font:.6875rem system-ui;color:var(--muted)}.attract-info p{margin:6px 0;font-size:.8125rem;line-height:1.5;overflow-wrap:anywhere}.attract-info summary{min-height:44px;display:flex;align-items:center;font-size:.8125rem;cursor:pointer}
.attract-standings{width:100%;border-collapse:collapse;font-size:.75rem;line-height:1.5}.attract-standings caption{text-align:left;font-weight:600;margin-bottom:6px}.attract-standings th,.attract-standings td{padding:6px 4px;text-align:left;border-bottom:1px solid var(--line)}.attract-standings th{font-weight:600}.demo-dispatch{color:var(--muted)}
.map-first .attract-dock{display:grid;grid-template-columns:auto auto minmax(70px,100px) auto minmax(140px,1fr)}.attract-dock label{display:flex;align-items:center;gap:6px;font-size:.75rem;min-width:0}.attract-dock select{min-width:0;width:100%;min-height:44px;background:var(--paper);color:var(--ink);border:1px solid #8d9c83;border-radius:5px;padding:6px}.demo-units{list-style:none;margin:10px 0;padding:0}.demo-units li{display:flex;gap:12px;align-items:center;padding:8px 0;border-top:1px solid var(--line);font-size:.875rem;line-height:1.5}.demo-units small{display:block;color:var(--muted)}
@media(max-width:760px){.map-first .attract-info{left:8px;top:8px;max-height:38%;padding:8px 10px}.map-first .attract-dock{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.attract-dock #demo-return{grid-column:span 2}.attract-dock label{justify-content:center}.attract-info h2{font-size:1rem}.map-first .attract-dock>button{white-space:normal}}
@media(forced-colors:active){.map-first .attract-info{background:Canvas;color:CanvasText;border-color:CanvasText}}
.city-stationed{border-bottom:1px solid var(--line);padding-bottom:10px;margin-bottom:14px}.city-stationed h3{font-size:1rem;margin:10px 0}.city-stationed .roster-row{width:100%}

.last-stand-notice{position:absolute;z-index:3;left:12px;bottom:42px;max-width:min(36rem,calc(100% - 24px));padding:9px 12px;border:1px solid #b69c61;border-radius:6px;background:#fff4d9;color:#4d3f25;font-size:.8125rem;line-height:1.5;pointer-events:none}

.persistent-order{margin:12px 0;padding:12px;border:1px solid var(--line);border-radius:6px;background:#edf0e6;overflow-wrap:anywhere}.persistent-order p{margin:0 0 8px}.persistent-order p:last-child{margin-bottom:0}.order-controls{display:flex;flex-wrap:wrap;gap:8px}.map-first .order-controls button{flex:1 1 9rem;min-height:44px;padding:10px;border:1px solid var(--line);border-radius:5px;font-size:.875rem}

/* Terrain is distinguished by symbols as well as colour. */
.hex-cell.desert polygon{fill:#e2cc96;stroke:#b9a87f}.hex-cell.arctic polygon{fill:#e3edf0;stroke:#aabdc5}.hex-cell.impassable polygon{fill:#958d7c;stroke:#6f685b}
.desert-detail,.arctic-detail,.impassable-detail{fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.desert-detail{stroke:#947135}.arctic-detail{stroke:#547989}.impassable-detail{stroke:#3e392f;stroke-width:2}
.hex-cell.theme-desert.forest polygon{fill:#c6c18c}.hex-cell.theme-desert.hills polygon{fill:#d1b57f}.hex-cell.theme-desert.mountains polygon{fill:#b5a085}.hex-cell.theme-arctic.forest polygon{fill:#b7cccb}.hex-cell.theme-arctic.hills polygon{fill:#c6d6dc}.hex-cell.theme-arctic.mountains polygon{fill:#aabcc7}
.rule-features{border:1px solid var(--line);border-radius:6px;padding:10px;min-width:0}.rule-features summary{min-height:44px;display:flex;align-items:center;cursor:pointer;font-size:.875rem}.rule-features .preference-toggle{min-height:44px;align-items:center;line-height:1.4}.rule-features input[type=checkbox]{width:20px;height:20px;min-height:20px;flex:none}.rule-features input:disabled{opacity:.65}.map-first #roughness-input{padding:0;accent-color:var(--green)}
.river-bank{fill:none;stroke:#d7ded1;stroke-width:7;stroke-linecap:round}.river-water{fill:none;stroke:#398da6;stroke-width:4;stroke-linecap:round}.river-bridge{fill:none;stroke:#5c4531;stroke-width:7;stroke-linecap:butt;paint-order:stroke;stroke-dasharray:2 1}
.map-first .map-editor-dialog{width:min(1240px,96vw);max-width:1240px}.editor-layout{display:grid;grid-template-columns:250px minmax(0,1fr);gap:20px}.editor-controls{min-width:0;align-content:start;gap:10px}.editor-controls label,.editor-start label{display:grid;gap:6px}.editor-controls details{border-top:1px solid var(--line);padding-top:10px}.editor-controls summary{cursor:pointer;min-height:44px;display:flex;align-items:center}.editor-controls details label{margin:10px 0}.editor-controls .dialog-controls{gap:6px}.editor-controls button{min-height:44px}.editor-controls #editor-city-fields[hidden]{display:none}.editor-coordinates{display:grid;grid-template-columns:1fr 1fr;gap:10px}.editor-workspace{min-width:0}.editor-canvas{height:480px;max-height:65vh;border:1px solid var(--line);border-radius:8px;background:#e8e6d8;overflow:hidden}.editor-canvas svg{width:100%;height:100%;touch-action:none;user-select:none;cursor:crosshair}.editor-map-actions{display:flex;gap:8px;align-items:center;margin-bottom:10px}.editor-map-actions button{min-width:44px;min-height:44px}.editor-map-actions span{font-size:.8rem}.editor-city-list{display:flex;gap:6px;flex-wrap:wrap;max-height:160px;overflow:auto}.editor-city-list button{font-size:.75rem;min-height:44px}.editor-city-list small{opacity:.7}.editor-start{border-top:1px solid var(--line);padding-top:16px;margin-top:20px;display:flex;align-items:end;flex-wrap:wrap;gap:16px}.editor-start .preference-toggle{display:flex;align-items:center;min-height:44px}.editor-start p{flex-basis:100%;margin:0}.editor-start input[type=checkbox]{width:20px;min-height:20px}.editor-controls input,.editor-controls select,.editor-start select{width:100%;min-width:0;min-height:44px}.editor-start label:first-child{max-width:340px}
@media(max-width:700px){.editor-layout{display:grid;grid-template-columns:1fr 1fr;gap:14px}.editor-controls{display:contents}.editor-controls>label{order:0}.editor-controls>#editor-city-fields{order:1}.editor-workspace{order:2;grid-column:1/-1}.editor-controls>p{order:3;margin:0}.editor-controls>.dialog-controls{order:4;grid-column:1/-1;display:flex}.editor-controls>details{order:5}.editor-controls>.dialog-controls button{flex:1}.editor-controls>details,.editor-controls>p,.editor-controls>#editor-city-fields{grid-column:1/-1}.editor-controls>#editor-city-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px}.editor-canvas{height:300px;max-height:45vh}.editor-start{display:grid;grid-template-columns:1fr}.editor-start label:first-child{max-width:none}.editor-city-list{max-height:110px}}

.supply-status{border:1px solid var(--line);border-radius:6px;padding:8px 10px}.supply-status.unsupplied{border-color:#b36b4c;background:#fff0df;color:#80371f}.supply-roster{color:#9d4428;font-weight:700}

#convoy-form .preference-toggle{display:flex;align-items:center;gap:10px;min-height:44px;font-size:.875rem;line-height:1.5}#convoy-form input[type=checkbox]{width:20px;height:20px;min-height:20px;flex:none}

.editor-filebar{display:grid;grid-template-columns:auto auto minmax(180px,1fr) auto;gap:8px;margin:14px 0 20px;align-items:center}.editor-filebar button,.editor-filebar select{min-height:44px;min-width:0}.editor-filebar p{grid-column:1/-1;font-size:.8125rem;margin:0;min-height:20px}.editor-image-fields{display:grid;grid-template-columns:1fr 1fr;gap:8px}.editor-image-fields label{font-size:.6875rem}.editor-swatch{display:inline-block;width:30px;height:20px;border:1px solid var(--line);vertical-align:middle}.editor-controls .preference-toggle{display:flex;align-items:center;gap:8px;min-height:44px;line-height:1.4}.editor-controls .preference-toggle input,.editor-detection-review input[type=checkbox]{width:20px;min-height:20px;height:20px;flex:none}.editor-controls input[type=range]{padding:0}.editor-map-grid .hex-cell polygon{fill-opacity:var(--editor-grid-opacity,1)}.editor-uncertain{fill:none;stroke:#c37720;stroke-width:2.5;stroke-dasharray:4 3}.editor-corrected{fill:none;stroke:#23714b;stroke-width:3}.editor-detection-review{padding:12px;border:1px solid #b79755;background:#fff5dd;border-radius:8px;margin-bottom:12px;font-size:.8125rem;line-height:1.5}.editor-detection-review[hidden]{display:none}.editor-detection-review p{margin:7px 0}.editor-detection-review .preference-toggle{display:flex;align-items:center;gap:8px;min-height:44px}.editor-brushes{display:flex;gap:6px;flex-wrap:wrap}.editor-brushes button{min-height:44px;font-size:.75rem}.editor-map-actions{flex-wrap:wrap}.editor-map-actions #editor-location{margin-left:auto}.editor-controls details>button{margin:6px 0}.map-editor-dialog .editor-start[aria-busy=true]{opacity:.7}
@media(max-width:700px){.editor-filebar{grid-template-columns:1fr 1fr}.editor-filebar select{grid-column:1}.editor-controls #editor-image-details{order:5}.editor-detection-review{padding:9px}.editor-detection-review .dialog-controls{display:flex}.editor-detection-review .dialog-controls button{flex:1;min-width:0}.editor-brushes button{flex:1 0 24%}.editor-filebar button,.editor-filebar select{font-size:.8125rem}}

.editor-workspace{position:sticky;top:0;align-self:start;max-height:calc(100dvh - 32px);overflow:auto}.editor-map-actions #editor-preview-tag{font-size:.75rem;color:#80521c}.editor-map-actions #editor-preview-tag[hidden]{display:none}@media(max-width:700px){.editor-workspace{position:static;max-height:none;overflow:visible;display:flex;flex-direction:column}.editor-workspace .editor-map-actions{order:0}.editor-workspace .editor-canvas{order:1;flex:none}.editor-workspace #editor-status{order:2}.editor-workspace #editor-detection-review{order:3}.editor-workspace .editor-city-list{order:4}}

.editor-detection-review .dialog-controls{display:flex;flex-direction:row;gap:8px}.editor-detection-review .dialog-controls button{flex:1;width:auto;min-width:0;margin:0}.editor-workspace:has(#editor-detection-review:not([hidden])) .editor-canvas{height:340px}@media(max-width:700px){.editor-workspace:has(#editor-detection-review:not([hidden])) .editor-canvas{height:300px}}

.supply-area{stroke-width:2;vector-effect:non-scaling-stroke}.supply-visible{fill:#327b6540;stroke:#216b55}.supply-charted{fill:#bd8a2830;stroke:#986913;stroke-dasharray:6 4}.supply-unconnected{fill:#75818a16;stroke:#61717b;stroke-dasharray:1 5}.supply-trace{fill:none;stroke:#174b3e;stroke-width:5;stroke-linecap:round;stroke-linejoin:round}.supply-trace.uncertain{stroke:#986913;stroke-dasharray:9 6}.supply-source rect{fill:#174b3e;stroke:#fff9e9;stroke-width:1.5}.supply-source text{fill:#fff9e9;font-size:11px;font-weight:700}.map-first #supply-button[aria-pressed=true]{background:#d6e9df;border-color:#216b55;color:#174b3e}.supply-legend{position:absolute;left:12px;bottom:40px;z-index:3;width:min(19rem,calc(100% - 24px));border:1px solid #96a588;border-radius:6px;background:#fdfcf8f5;color:#344b32;font-size:.75rem;line-height:1.5;max-height:45%;overflow:auto}.supply-legend summary{cursor:pointer;min-height:44px;padding:12px}.supply-legend>div{padding:0 12px 10px}.supply-legend p{margin:0 0 8px}.supply-key{font-size:1.2rem;font-weight:700}.supply-key.visible{color:#216b55}.supply-key.charted{color:#986913}.supply-key.unconnected{color:#61717b}.supply-report{font-size:.8125rem;line-height:1.6;border-left:3px solid #7b9885;padding:0 0 0 10px;margin:12px 0 16px}.supply-report p{margin:6px 0}.supply-report ul{margin:8px 0;padding-left:18px}.supply-report button{border:1px solid #96a588;border-radius:5px;padding:8px 12px;min-height:44px}.supply-report .field-note{font-size:.75rem}.play-dock #supply-button{flex:.8}@media(max-width:760px){.supply-legend{left:8px;bottom:34px;max-height:38%;font-size:.75rem}.supply-report{font-size:.8125rem}.play-dock #supply-button{flex:.7}}@media(forced-colors:active){.supply-area,.supply-trace{stroke:CanvasText;fill:none}.supply-source rect{fill:Canvas;stroke:CanvasText}.supply-source text{fill:CanvasText}.supply-legend{background:Canvas;color:CanvasText;border-color:CanvasText}}

.supply-report summary{cursor:pointer;min-height:44px;padding:10px 0;font-weight:600}.supply-report:not([open]){margin:8px 0}
