/* Responsive workspace: navigation rail, side drawers, and mobile sheets. */
body.workspace-ui #workspaceDrawer [data-workspace-section="simulation"] :is(.ring-switch-item > span, .sim-speed-title) { display:flex !important; align-items:baseline; gap:8px; }
body.workspace-ui #workspaceDrawer [data-workspace-section="simulation"] .sim-option-tooltip { flex:0 0 14px; width:14px; margin:0; text-align:center; }
body.workspace-ui #workspaceDrawer [data-workspace-section="simulation"] .sim-option-label { flex:1; min-width:0; }
body.workspace-ui #workspaceDrawer .workspace-cleanup { display:flow-root; }
body.workspace-ui #workspaceDrawer .workspace-cleanup .workspace-section-title { margin-bottom:8px; }
body.workspace-ui #workspaceDrawer .workspace-cleanup .workspace-description { margin:0 0 12px; font-size:12px; }
body.workspace-ui #workspaceDrawer #workspaceMapControls { border:0; padding:0; background:transparent; }
body.workspace-ui #workspaceDrawer #workspaceMapControls .map-controls { background:transparent !important; }
body.workspace-ui #workspaceDrawer #workspaceMapControls .clear-buttons { margin:0; padding:0; width:100%; }
body.workspace-ui .leaflet-tooltip.map-entity-tooltip { width:280px; max-width:calc(100vw - 40px); box-sizing:border-box; padding:12px 14px; white-space:normal; border:1px solid var(--line); border-radius:12px; background:var(--panel); color:var(--ink); box-shadow:0 8px 28px #0003; }
body.workspace-ui .map-entity-tooltip .map-entity-kind { font:10px/1.4 Consolas,monospace; color:var(--accent); text-transform:uppercase; letter-spacing:.07em; }
body.workspace-ui .map-entity-tooltip .map-entity-name { display:block; margin:4px 0 10px; font-size:15px; line-height:1.3; overflow-wrap:anywhere; }
body.workspace-ui .map-entity-tooltip dl { margin:0; }
body.workspace-ui .map-entity-tooltip dl > div { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.2fr); gap:12px; padding:4px 0; border-top:1px solid var(--line); font-size:11px; line-height:1.4; }
body.workspace-ui .map-entity-tooltip dt { margin:0; font-weight:400; color:var(--muted); }
body.workspace-ui .map-entity-tooltip dd { margin:0; text-align:right; font-weight:600; overflow-wrap:anywhere; }
body.workspace-ui .leaflet-tooltip.airdefense-detail-tooltip { width:620px; max-width:calc(100vw - 40px); max-height:none; overflow:visible; }
body.workspace-ui .leaflet-tooltip.offense-detail-tooltip { width:620px; max-width:calc(100vw - 40px); max-height:none; overflow:visible; }
body.workspace-ui .map-entity-header { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:4px 12px; }
body.workspace-ui .map-entity-country { color:var(--muted); font-size:11px; }
body.workspace-ui .map-country-flag { width:22px; height:16px; object-fit:contain; vertical-align:middle; margin-right:4px; }
body.workspace-ui .platform-country-flag { display:inline-block; width:22px; height:16px; object-fit:contain; vertical-align:middle; margin-right:4px; }
body.workspace-ui :is(.airdefense-detail-tooltip,.offense-detail-tooltip) dl { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:20px; }
body.workspace-ui :is(.airdefense-detail-tooltip,.offense-detail-tooltip) dl > div { grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:8px; }
@media(max-width:600px) { body.workspace-ui :is(.airdefense-detail-tooltip,.offense-detail-tooltip) dl { grid-template-columns:1fr; } }
body.workspace-ui .map-entity-hint { margin-top:8px; color:var(--muted); font-size:10px; }
body.workspace-ui .map-entity-tooltip.leaflet-tooltip-top::before { border-top-color:var(--panel); }
body.workspace-ui #workspaceDrawer .workspace-deployment-picker .bootstrap-select { width:100% !important; }
body.workspace-ui #workspaceDrawer .workspace-deployment-buttons { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
body.workspace-ui #workspaceDrawer [data-workspace-section="saved"] .workspace-group { padding:12px; margin-bottom:10px; }
body.workspace-ui #workspaceDrawer [data-workspace-section="saved"] .workspace-section-title { margin-bottom:8px; }
body.workspace-ui #workspaceDrawer [data-workspace-section="saved"] .workspace-description { margin-bottom:12px; }
body.workspace-ui #workspaceDrawer [data-workspace-section="saved"] .summary-working-copy { margin:6px 0; }
body.workspace-ui #workspaceDrawer [data-workspace-section="saved"] .workspace-counts { margin:8px 0 12px; }
body.workspace-ui #workspaceDrawer [data-workspace-section="saved"] .workspace-counts .summary-row { padding:8px 10px; gap:0; }
body.workspace-ui #workspaceDrawer [data-workspace-section="saved"] .form-check { padding-top:6px; padding-bottom:6px; }
body.workspace-ui #workspaceDrawer [data-workspace-section="saved"] #defenseBudgetPanel { margin-top:10px; padding-top:12px; }
body.workspace-ui #workspaceDrawer [data-workspace-section="saved"] .workspace-offense-budget { margin-top:12px; padding-top:12px; }
body.workspace-ui #workspaceDrawer [data-workspace-section="saved"] .summary-status:empty { display:none; }
body.workspace-ui #workspaceDrawer .workspace-deployment-picker .bootstrap-select > .dropdown-menu { max-height:none !important; overflow:visible; }
body.workspace-ui #workspaceDrawer .workspace-deployment-picker .bootstrap-select > .dropdown-menu > .inner { max-height:var(--picker-list-height, min(220px,28dvh)) !important; }
body.workspace-ui #autoTargetModal .modal-header { display:grid; grid-template-columns:44px minmax(0,1fr) auto 44px; align-items:center; gap:12px; padding:18px; }
body.workspace-ui #autoTargetModal .workspace-back { grid-column:1; grid-row:1; }
body.workspace-ui #autoTargetModal .modal-title { grid-column:2; grid-row:1; padding:0; margin:0; font-size:20px; line-height:1.3; }
body.workspace-ui #autoTargetModal .workspace-map-toggle { grid-column:3; grid-row:1; margin:0; min-height:44px; }
body.workspace-ui #autoTargetModal .close { grid-column:4; grid-row:1; }
body.workspace-ui #autoTargetModal :is(.workspace-back,.close) { display:grid; place-items:center; width:44px; height:44px; min-height:44px; padding:0; margin:0; align-self:center; border:1px solid var(--line); border-radius:12px; background:var(--field); color:var(--accent); }
@media (max-width:700px) {
    body.workspace-ui #autoTargetModal .modal-header { grid-template-columns:44px minmax(0,1fr) 44px; gap:10px; padding:14px 18px; }
    body.workspace-ui #autoTargetModal .close { grid-column:3; }
    body.workspace-ui #autoTargetModal .workspace-map-toggle { grid-row:2; grid-column:2 / 4; justify-self:end; }
    body.workspace-ui #autoTargetSelectAreaBtn { display:none !important; }
    body.workspace-ui #autoTargetDrawAreaBtn { flex:1 1 auto; }
}
body.workspace-ui #workspaceDrawer .workspace-counts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:16px 0 24px; }
body.workspace-ui #workspaceDrawer .workspace-counts .summary-row { display:flex; flex-direction:column; align-items:flex-start; gap:4px; padding:12px; margin:0; background:var(--field); border:0; border-radius:10px; font-size:12px; }
body.workspace-ui #workspaceDrawer .workspace-counts strong { font-size:22px; color:var(--ink); }
body.workspace-ui #workspaceDrawer .summary-deployment-actions .workspace-section-title { margin-bottom:14px; }
body.workspace-ui #workspaceDrawer .summary-deployment-actions .summary-inline-controls { align-items:stretch; gap:10px; }
body.workspace-ui #workspaceDrawer .summary-deployment-actions .form-check { padding:10px 0 10px 26px; }
body.workspace-ui #workspaceDrawer .summary-deployment-actions .form-check-label { display:block; cursor:pointer; }
body.workspace-ui #workspaceDrawer .summary-deployment-actions .bootstrap-select { min-width:0; }
body.workspace-ui #workspaceDrawer .summary-deployment-actions .btn { white-space:normal; }
body.workspace-ui #workspaceDrawer #deleteDeploymentBtn { background:transparent; color:#b94550; border-color:currentColor; }
body.workspace-ui.dark-mode #workspaceDrawer #deleteDeploymentBtn { color:#f29aa3; }
body.workspace-ui #workspaceDrawer .workspace-offense-budget { margin-top:20px; padding-top:20px; border-top:1px solid var(--line); }
body.workspace-ui #workspaceDrawer .defense-budget-value { font-size:clamp(20px,5vw,28px); overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
@media (max-width:700px) {
    body.workspace-ui #workspaceDrawer .summary-deployment-actions .summary-inline-controls { flex-direction:column; }
    body.workspace-ui #workspaceDrawer .summary-deployment-actions .summary-inline-controls > :is(.btn,.form-control,.bootstrap-select),
    body.workspace-ui #workspaceDrawer #updateDeploymentBtn { width:100% !important; }
    body.workspace-ui #workspaceDrawer .summary-deployment-actions .summary-share-controls { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
}
body.workspace-ui { --drawer-width:440px; --rail-width:82px; }
body.workspace-ui .app-shell { padding-left:var(--rail-width); }
body.workspace-ui .theater-header { padding-left:24px; }
body.workspace-ui .theater-intro { left:110px; top:106px; transition:opacity .18s; }
body.workspace-ui .theater-intro h1 { font-size:30px; }
body.workspace-ui.workspace-drawer-open .theater-intro { opacity:0; }
.workspace-rail { position:fixed; top:76px; bottom:0; left:0; width:var(--rail-width); z-index:1060; display:flex; flex-direction:column; gap:10px; padding:22px 9px; border-right:1px solid var(--line); background:var(--surface); }
.workspace-rail button { display:flex; flex-direction:column; justify-content:center; align-items:center; gap:8px; width:100%; min-height:66px; padding:10px 3px; background:transparent; border:1px solid transparent; border-radius:12px; color:var(--muted); font-size:11px; cursor:pointer; transition:background .15s,color .15s; }
.workspace-rail button i { font-size:18px; }
.workspace-rail button:hover { background:var(--field); color:var(--ink); }
.workspace-rail button.is-active { background:var(--field); color:var(--accent); border-color:var(--line); }
.workspace-rail button:last-child { margin-top:auto; }
body.workspace-ui .top-left-session-links { z-index:1060; border-radius:8px; }
body.workspace-ui .top-left-user { min-height:38px; }
body.workspace-ui #mobileActionPanel,body.workspace-ui #bottomDrawerToggle,body.workspace-ui #desktopQuickShareBtn,body.workspace-ui #mobileDeploymentBackdrop { display:none !important; }
body.workspace-ui .leaflet-bottom .google-btn-login,body.workspace-ui .leaflet-bottom .google-btn-logout { display:none !important; }
body.workspace-ui .leaflet-top .leaflet-control-layers { display:none !important; }
body.workspace-ui .leaflet-bottom.leaflet-right { bottom:4px; right:8px; }
.workspace-map-tools { position:fixed; top:98px; right:22px; z-index:900; display:flex; flex-direction:column; border:1px solid var(--line); border-radius:12px; overflow:hidden; box-shadow:0 8px 24px #0002; }
.workspace-map-tools button { width:44px; height:44px; border:0; border-bottom:1px solid var(--line); background:var(--panel); color:var(--ink); font-size:22px; cursor:pointer; }
.workspace-map-tools button:last-child { border-bottom:0; font-size:16px; }
.workspace-map-tools button:hover { background:var(--field); color:var(--accent); }
body.workspace-ui .workspace-drawer { pointer-events:none; padding:0 !important; overflow:hidden; }
body.workspace-ui .workspace-drawer .modal-dialog { pointer-events:auto; position:absolute; top:92px; bottom:18px; left:98px; right:auto; width:min(var(--drawer-width),calc(100vw - 122px)) !important; max-width:none !important; min-height:0 !important; height:auto; margin:0 !important; transform:none !important; display:flex; }
body.workspace-ui .workspace-drawer .modal-content { width:100%; height:100%; max-height:none !important; border:1px solid var(--line); border-radius:18px; overflow:hidden; background:var(--panel); box-shadow:0 24px 80px #0005; display:flex; flex-direction:column; }
body.workspace-ui .workspace-drawer.show .modal-dialog { animation:drawer-in .2s ease-out; }
@keyframes drawer-in { from {opacity:0;translate:-12px 0;} to {opacity:1;translate:0 0;} }
body.workspace-ui .workspace-drawer .modal-header { align-items:center; gap:12px; padding:22px 24px; background:var(--panel); border-bottom:1px solid var(--line); min-height:84px; }
body.workspace-ui .workspace-drawer .modal-title { font-size:22px; line-height:1.25; letter-spacing:-.035em; margin:0; padding-right:36px; }
body.workspace-ui .workspace-drawer .close { position:static; margin:0 0 0 auto; align-self:flex-start; padding:0; flex:0 0 38px; width:38px; height:38px; border-radius:10px; color:var(--muted); font-size:28px; line-height:1; background:var(--field); opacity:1; }
body.workspace-ui .workspace-drawer .close:hover { color:var(--ink); }
body.workspace-ui .workspace-drawer .modal-body { flex:1 1 auto; min-height:0; max-height:none !important; overflow-y:auto; overflow-x:hidden; padding:24px; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:var(--line) transparent; }
body.workspace-ui .workspace-drawer .modal-footer { flex-shrink:0; gap:6px; padding:16px 24px; background:var(--panel); border-top:1px solid var(--line); }
body.workspace-ui .workspace-drawer .modal-footer .btn { margin:0; flex:1 1 auto; }
body.workspace-ui .workspace-drawer .modal-body .row > [class*="col-md"] { flex:0 0 100%; max-width:100%; }
body.workspace-ui .workspace-drawer .container-fluid { padding:0; }
body.workspace-ui .workspace-drawer .btn,body.workspace-ui .workspace-drawer .form-control,body.workspace-ui .workspace-drawer .dropdown-toggle { min-height:44px; border-radius:8px; font-size:14px; }
body.workspace-ui .workspace-drawer textarea.form-control { min-height:90px; }
body.workspace-ui .workspace-drawer input,body.workspace-ui .workspace-drawer select { font-size:16px; }
body.workspace-ui .workspace-drawer input[type=checkbox],body.workspace-ui .workspace-drawer input[type=radio] { width:18px; height:18px; flex-shrink:0; }
body.workspace-ui .workspace-drawer .form-check-input { margin-top:4px; }
body.workspace-ui .workspace-drawer label { font-size:13px; line-height:1.5; }
body.workspace-ui .workspace-drawer .form-group { margin-bottom:20px; }
body.workspace-ui .workspace-drawer .country-filter-btn { min-height:36px; border-radius:6px; }
body.workspace-ui .workspace-drawer .selection-actions-list { display:grid !important; grid-template-columns:1fr; }
.workspace-eyebrow { display:block; color:var(--accent); font:9px/1.5 Consolas,monospace; letter-spacing:.16em; margin-bottom:6px; }
.workspace-description { color:var(--muted); font-size:14px; line-height:1.6; margin:0 0 22px; }
.workspace-action-cards { display:grid; gap:12px; }
.workspace-action-cards button { display:flex; align-items:center; gap:16px; padding:18px; border:1px solid var(--line); border-radius:12px; background:var(--field); color:var(--ink); text-align:left; cursor:pointer; min-height:86px; }
.workspace-action-cards button:hover { border-color:var(--accent); background:var(--surface); }
.workspace-action-cards button > span:nth-child(2) { flex:1; }
.workspace-action-cards strong { display:block; font-size:16px; font-weight:600; }
.workspace-action-cards small { display:block; color:var(--muted); font-size:12px; margin-top:4px; line-height:1.5; }
.workspace-card-icon { width:40px; height:40px; display:grid; place-items:center; border-radius:10px; background:var(--panel); color:var(--accent); font-size:18px; flex-shrink:0; }
.workspace-action-cards button.workspace-card-purple { border-color:#8052b8; background:linear-gradient(135deg,#6f3da4,#8957bd); color:#fff; }
.workspace-action-cards button.workspace-card-purple:hover { border-color:#b894df; background:linear-gradient(135deg,#7b46b2,#9868c8); }
.workspace-action-cards button.workspace-card-purple small { color:#eadff5; }
.workspace-action-cards button.workspace-card-purple .workspace-card-icon { background:#ffffff1f; color:#fff; }
.workspace-tip { display:flex; gap:12px; padding:22px 0 0; color:var(--muted); font-size:12px; }
.workspace-tip i { color:var(--accent); margin-top:4px; }
.workspace-tip p { margin:0; }
.workspace-drawer-foot { flex-shrink:0; border-top:1px solid var(--line); padding:14px 24px; color:var(--muted); font-size:11px; background:var(--surface); }
.workspace-status-dot { display:inline-block; width:5px; height:5px; border-radius:50%; background:var(--accent); margin-right:6px; }
.workspace-group { border:1px solid var(--line); border-radius:10px; margin-bottom:16px; padding:16px; background:var(--surface); }
.workspace-group summary { font-size:14px; color:var(--ink); font-weight:600; cursor:pointer; min-height:28px; }
.workspace-group[open] > summary { margin-bottom:16px; }
.workspace-section-title { font-size:14px; margin:0 0 18px; }
.workspace-link { display:flex; justify-content:space-between; gap:12px; width:100%; background:var(--field); border:1px solid var(--line); border-radius:10px; color:var(--ink); text-align:left; min-height:48px; padding:12px 16px; margin-bottom:16px; cursor:pointer; }
.workspace-empty { text-align:center; padding:34px 12px; border:1px dashed var(--line); border-radius:12px; }
.workspace-empty > i { font-size:32px; color:var(--accent); margin-bottom:24px; }
.workspace-empty h3 { font-size:22px; }
.workspace-empty p { font-size:14px; color:var(--muted); }
.workspace-placement { position:fixed; top:94px; left:50%; transform:translateX(-50%); z-index:1030; width:max-content; max-width:calc(100vw - 220px); display:flex; align-items:center; gap:24px; padding:14px 18px; background:var(--panel); border:1px solid var(--accent); border-radius:12px; box-shadow:0 8px 32px #0004; }
.workspace-placement strong,.workspace-placement small { display:block; }
.workspace-placement strong { font-size:14px; }
.workspace-placement small { font-size:12px; color:var(--muted); }
.workspace-placement button,.workspace-back,.workspace-map-toggle { background:var(--field); border:1px solid var(--line); border-radius:8px; color:var(--accent); padding:8px 12px; min-height:40px; cursor:pointer; }
.workspace-back { font-size:20px; flex-shrink:0; }
.workspace-map-toggle { font-size:11px; white-space:nowrap; margin-left:auto; }
body.workspace-placing #map { cursor:crosshair; }
body.workspace-ui [hidden] { display:none !important; }
/* Reset legacy floating positions only after the actual nodes have moved into the shell. */
body.workspace-ui #workspaceDrawer #simulationBottomPanel,
body.workspace-ui #workspaceDrawer #deploymentSummaryPanel,
body.workspace-ui #workspaceDrawer #simulationLivePanel,
body.workspace-ui #workspaceDrawer #defenseBudgetPanel,
body.workspace-ui #workspaceDrawer #topLeftSessionDropdown,
body.workspace-ui #workspaceDrawer .map-controls {
position:static !important; inset:auto !important; display:block !important; width:100% !important; max-width:none !important; min-width:0; height:auto; max-height:none !important; padding:0; margin:0; border:0; border-radius:0; box-shadow:none; background:transparent !important; transform:none; opacity:1; pointer-events:auto; overflow:visible;
}
body.workspace-ui #workspaceDrawer #simulationLivePanel:not(.open) { display:none !important; }
body.workspace-ui #workspaceDrawer #simulationLivePanel { margin-bottom:24px; }
body.workspace-ui #workspaceDrawer #defenseBudgetPanel { border-top:1px solid var(--line); padding-top:18px; margin-top:20px; }
body.workspace-ui #workspaceDrawer .map-controls::before { display:none; }
body.workspace-ui #workspaceDrawer .bottom-sim-row,body.workspace-ui #workspaceDrawer .bottom-sim-secondary-row,body.workspace-ui #workspaceDrawer .bottom-sim-switches { display:grid; grid-template-columns:1fr; gap:16px; }
body.workspace-ui #workspaceDrawer .bottom-sim-secondary-row { margin-top:24px; }
body.workspace-ui #workspaceDrawer .ring-switch-item { padding:12px 0; min-height:44px; border-bottom:1px solid var(--line); gap:12px; font-size:13px; white-space:normal; align-items:flex-start; }
body.workspace-ui #workspaceDrawer .ring-switch-item input { margin-top:3px; }
body.workspace-ui #workspaceDrawer .bottom-sim-switches { gap:0; }
body.workspace-ui #workspaceDrawer .sim-speed-title { font-size:13px; }
body.workspace-ui #workspaceDrawer #simulationSpeedRange { min-height:36px; }
body.workspace-ui #workspaceDrawer .workspace-explanation { margin-top:20px; }
body.workspace-ui #workspaceDrawer .bottom-sim-help { border:0; padding:0; font-size:12px; line-height:1.6; }
body.workspace-ui #workspaceDrawer .workspace-run { position:sticky; bottom:-24px; background:var(--panel); padding:18px 0 8px; margin-top:18px; z-index:2; }
body.workspace-ui #workspaceDrawer .workspace-run button { width:100%; min-height:48px; font-weight:600; }
body.workspace-ui #workspaceDrawer .workspace-run i { margin-right:8px; }
body.workspace-ui #workspaceDrawer .summary-inline-controls { flex-wrap:wrap; gap:10px; }
body.workspace-ui #workspaceDrawer .summary-inline-controls > .form-control { flex:1 1 180px; }
body.workspace-ui #workspaceDrawer .summary-help { font-size:12px; margin-top:8px; line-height:1.5; }
body.workspace-ui #workspaceDrawer .summary-row { padding:10px 0; border-bottom:1px solid var(--line); }
body.workspace-ui #workspaceDrawer .summary-working-copy { margin:12px 0; overflow-wrap:anywhere; }
body.workspace-ui #workspaceDrawer .leaflet-control-layers { display:block; float:none; background:transparent; border:0; box-shadow:none; padding:0; margin:0; width:100%; color:var(--ink); }
body.workspace-ui #workspaceDrawer .leaflet-control-layers-toggle { display:none; }
body.workspace-ui #workspaceDrawer .leaflet-control-layers-list { display:block; height:auto !important; max-height:none; padding:0; overflow:visible; }
body.workspace-ui #workspaceDrawer .leaflet-control-layers label { min-height:44px; display:flex; align-items:center; margin:0; border-bottom:1px solid var(--line); }
body.workspace-ui #workspaceDrawer .leaflet-control-layers label > div { display:flex; gap:10px; align-items:center; width:100%; }
body.workspace-ui #workspaceDrawer .leaflet-control-layers-selector { position:static; margin:0; }
/* Shared switch rows for map visibility, range rings, and appearance. */
body.workspace-ui #workspaceDrawer :is([data-workspace-section="layers"], [data-workspace-section="more"], [data-workspace-section="simulation"]) :is(.ring-switch-item, .leaflet-control-layers label > div, .custom-switch) {
    display:flex; align-items:center; justify-content:space-between; gap:16px;
    width:100%; min-height:48px; padding:10px 0; margin:0; box-sizing:border-box;
}
body.workspace-ui #workspaceDrawer :is([data-workspace-section="layers"], [data-workspace-section="more"], [data-workspace-section="simulation"]) :is(.ring-switch-item > span, .leaflet-control-layers label > div > span, .custom-control-label) {
    flex:1; min-width:0; margin:0; color:var(--ink); font-size:13px; line-height:1.5; cursor:pointer;
}
body.workspace-ui #workspaceDrawer :is([data-workspace-section="layers"], [data-workspace-section="more"], [data-workspace-section="simulation"]) .ring-switches {
    display:flex; flex-direction:column; gap:0; padding:0; border:0;
}
body.workspace-ui #workspaceDrawer #workspaceAppearance .custom-switch { margin:0 !important; }
body.workspace-ui #workspaceDrawer #workspaceAppearance .custom-control-label::before,
body.workspace-ui #workspaceDrawer #workspaceAppearance .custom-control-label::after { display:none; }
body.workspace-ui #workspaceDrawer :is([data-workspace-section="layers"], [data-workspace-section="more"], [data-workspace-section="simulation"]) input[type="checkbox"] {
    appearance:none; -webkit-appearance:none; position:relative; inset:auto; z-index:auto; opacity:1;
    order:2; flex:0 0 42px; width:42px; height:24px; margin:0; padding:0;
    border:1px solid var(--muted); border-radius:999px; background:var(--field);
    cursor:pointer; box-shadow:inset 0 1px 3px #0002; transition:background-color .18s, border-color .18s;
}
body.workspace-ui #workspaceDrawer :is([data-workspace-section="layers"], [data-workspace-section="more"], [data-workspace-section="simulation"]) input[type="checkbox"]::before {
    content:""; position:absolute; top:3px; left:3px; width:16px; height:16px;
    border-radius:50%; background:var(--muted); box-shadow:0 1px 3px #0003;
    transition:transform .18s, background-color .18s;
}
body.workspace-ui #workspaceDrawer :is([data-workspace-section="layers"], [data-workspace-section="more"], [data-workspace-section="simulation"]) input[type="checkbox"]:checked { background:var(--accent); border-color:var(--accent); }
body.workspace-ui #workspaceDrawer :is([data-workspace-section="layers"], [data-workspace-section="more"], [data-workspace-section="simulation"]) input[type="checkbox"]:checked::before { transform:translateX(18px); background:var(--surface); }
body.workspace-ui #workspaceDrawer :is([data-workspace-section="layers"], [data-workspace-section="more"], [data-workspace-section="simulation"]) input[type="checkbox"]:focus-visible { outline:2px solid var(--accent); outline-offset:4px; }
body.workspace-ui #workspaceDrawer :is([data-workspace-section="layers"], [data-workspace-section="more"], [data-workspace-section="simulation"]) input[type="checkbox"]:disabled { opacity:.45; cursor:not-allowed; }
@media (prefers-reduced-motion:reduce) {
    body.workspace-ui #workspaceDrawer input[type="checkbox"],
    body.workspace-ui #workspaceDrawer input[type="checkbox"]::before { transition:none; }
}
body.workspace-ui #workspaceDrawer .top-left-dropdown-item { min-height:44px; white-space:normal; border-bottom:1px solid var(--line); padding:12px 0; }
body.workspace-ui #workspaceDrawer .clear-buttons button { min-height:44px; font-size:13px; }
body.workspace-ui #workspaceDrawer #btn-auto-targets { display:flex !important; }
body.workspace-ui #addCampBtn { display:block !important; }
body.workspace-ui .workspace-drawer .bs-container { z-index:1080; }
body.workspace-ui .bootstrap-select .dropdown-menu { max-width:calc(100vw - 32px); }
body.workspace-ui .bootstrap-select .dropdown-item { white-space:normal; overflow-wrap:anywhere; }
body.workspace-ui .modal-backdrop { background:#020908; }
body.workspace-ui .modal-backdrop.show { opacity:.24; }
body.workspace-ui #simulationReportModal .modal-dialog { width:min(920px,calc(100vw - 122px)) !important; }
body.workspace-ui .workspace-drawer.workspace-map-compact .modal-dialog { bottom:auto; height:84px; }
body.workspace-ui .workspace-drawer.workspace-map-compact .modal-body,
body.workspace-ui .workspace-drawer.workspace-map-compact .modal-footer { display:none; }
@media (max-width:1100px) {
body.workspace-ui { --drawer-width:410px; }
body.workspace-ui .theater-nav { display:none; }
}
@media (max-width:700px) {
body.workspace-ui { --rail-width:0px; --drawer-width:100%; }
body.workspace-ui .app-shell { padding-top:64px; padding-bottom:calc(76px + env(safe-area-inset-bottom)); }
body.workspace-ui .theater-header { height:64px; padding:0 16px; }
body.workspace-ui .theater-intro { display:none; }
body.workspace-ui .workspace-rail { top:auto; right:0; bottom:0; width:100%; min-height:76px; flex-direction:row; gap:4px; padding:8px 8px calc(8px + env(safe-area-inset-bottom)); border-right:0; border-top:1px solid var(--line); }
.workspace-rail button { flex:1; min-height:58px; padding:6px 2px; gap:6px; font-size:10px; border-radius:10px; }
.workspace-rail button:last-child { margin-top:0; }
.workspace-rail button i { font-size:17px; }
body.workspace-ui .workspace-drawer .modal-dialog,
body.workspace-ui #simulationReportModal .modal-dialog { left:8px; right:8px; top:auto; bottom:calc(84px + env(safe-area-inset-bottom)); width:calc(100% - 16px) !important; height:min(78dvh,calc(100dvh - 156px)); max-height:calc(100dvh - 156px); }
body.workspace-ui .workspace-drawer .modal-content { border-radius:20px 20px 14px 14px; }
body.workspace-ui .workspace-drawer .modal-header { padding:18px; min-height:78px; }
body.workspace-ui .workspace-drawer .modal-title { font-size:20px; padding-right:0; }
body.workspace-ui .workspace-drawer .modal-body { padding:18px; }
body.workspace-ui .workspace-drawer .modal-footer { padding:12px 18px; }
body.workspace-ui .workspace-drawer.show .modal-dialog { animation:sheet-in .2s ease-out; }
@keyframes sheet-in { from {opacity:0;translate:0 16px;} to {opacity:1;translate:0 0;} }
.workspace-drawer-foot { padding:12px 18px; font-size:10px; }
.workspace-action-cards button { min-height:78px; padding:14px; gap:12px; }
.workspace-map-tools { top:86px; right:14px; }
.workspace-placement { top:80px; max-width:calc(100vw - 28px); width:calc(100vw - 28px); gap:12px; padding:12px; }
.workspace-placement > span { flex:1; }
body.workspace-ui #workspaceDrawer .workspace-run { bottom:-18px; }
body.workspace-ui .workspace-drawer.workspace-map-compact .modal-dialog { top:auto; bottom:calc(84px + env(safe-area-inset-bottom)); height:78px; }
body.workspace-ui .leaflet-control-attribution { max-width:calc(100vw - 20px); }
}
@media (max-height:550px) and (orientation:landscape) {
body.workspace-ui .workspace-drawer .modal-dialog { top:76px; bottom:8px; height:auto; max-height:none; }
body.workspace-ui .workspace-drawer .modal-header { min-height:60px; padding:10px 18px; }
body.workspace-ui .workspace-drawer .modal-title { font-size:18px; }
.workspace-drawer-foot { display:none; }
}
@media (prefers-reduced-motion:reduce) {
body.workspace-ui .workspace-drawer.show .modal-dialog { animation:none; }
.workspace-rail button,body.workspace-ui .theater-intro { transition:none; }
}
body.workspace-ui .workspace-drawer > .bs-container { pointer-events:auto; z-index:1080; }
body.workspace-ui .app-shell > #simulationBottomPanel,
body.workspace-ui .app-shell > #deploymentSummaryPanel,
body.workspace-ui .app-shell > #defenseBudgetPanel { display:none !important; }
/* Compact live telemetry stays above the map, independent of drawer visibility. */
body.workspace-ui > #simulationLivePanel {
    position:fixed; inset:auto auto 24px 110px; z-index:1000; display:none;
    width:340px; max-width:calc(100vw - 140px); padding:10px 12px;
    margin:0; border:1px solid var(--line); border-radius:12px;
    background:var(--panel); color:var(--ink); box-shadow:0 6px 24px #0002;
    pointer-events:none;
}
body.workspace-ui > #simulationLivePanel.open { display:block !important; }
body.workspace-ui > #simulationLivePanel .sim-live-title { font:10px/1.4 Consolas,monospace; letter-spacing:.08em; color:var(--accent); margin:0 0 6px; }
body.workspace-ui > #simulationLivePanel .sim-live-title::before { content:""; display:inline-block; width:6px; height:6px; border-radius:50%; background:var(--accent); margin-right:6px; }
body.workspace-ui > #simulationLivePanel .sim-live-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:4px; }
body.workspace-ui > #simulationLivePanel .sim-live-item { display:flex; flex-direction:column; gap:2px; padding:0; border:0; border-radius:0; background:transparent; font-size:10px; line-height:1.4; color:var(--muted); }
body.workspace-ui > #simulationLivePanel .sim-live-item strong { font-size:17px; line-height:1.2; font-variant-numeric:tabular-nums; color:var(--ink); }
@media (max-width:700px) {
    body.workspace-ui > #simulationLivePanel { inset:auto 12px calc(88px + env(safe-area-inset-bottom)) 12px; width:auto; max-width:none; padding:8px 10px; }
    body.workspace-ui > #simulationLivePanel .sim-live-item { font-size:9px; }
    body.workspace-ui > #simulationLivePanel .sim-live-item strong { font-size:16px; }
}
@media (max-width:700px) {
    body.workspace-ui .workspace-drawer .modal-header { touch-action:none; }
    body.workspace-ui .workspace-drawer .modal-content::before { content:''; flex:0 0 4px; width:32px; height:4px; border-radius:4px; background:var(--line); margin:8px auto -4px; }
}
/* Header resources and always-visible cleanup actions. */
body.workspace-ui #topLeftSessionDropdown { width:280px; max-width:calc(100vw - 24px); max-height:calc(100dvh - 90px); overflow-y:auto; padding:18px; border-radius:12px; }
body.workspace-ui #topLeftSessionDropdown .top-left-dropdown-item { min-height:44px; display:flex; align-items:center; padding:10px; }
body.workspace-ui #topLeftSessionDropdown .google-btn-logout { float:none; margin:12px 0 0; }
body.workspace-ui #workspaceMapControls .clear-buttons { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
body.workspace-ui #workspaceMapControls .clear-buttons button { min-height:48px; border:1px solid var(--line); border-radius:8px; background:var(--field); padding:10px; white-space:normal; text-align:center; }
body.workspace-ui #workspaceMapControls .clear-buttons button:hover { border-color:var(--accent); color:var(--accent); }

body.workspace-ui #workspaceMapControls #location-btn { display:none; }
/* Template menus participate in the drawer scroll area, never overflow the viewport. */
body.workspace-ui .workspace-drawer .bootstrap-select > .dropdown-menu {
    position:static !important;
    transform:none !important;
    float:none;
    width:100%;
    min-width:0 !important;
    max-width:100%;
    margin:8px 0 0;
    max-height:min(320px, 40dvh) !important;
    overflow:hidden;
}
body.workspace-ui .workspace-drawer .bootstrap-select > .dropdown-menu > .inner {
    max-height:min(250px, 29dvh) !important;
    overflow-y:auto !important;
    overscroll-behavior:contain;
}
body.workspace-ui .workspace-drawer .bootstrap-select .bs-searchbox input { width:100%; min-width:0; }
body.workspace-ui .workspace-drawer .bootstrap-select.show { height:auto; }
/* Only the options viewport scrolls; the nested list must retain its natural height. */
body.workspace-ui :is(#workspaceDrawer,#launcherModal,#airDefenseModal) .bootstrap-select > .dropdown-menu {
    max-height:none !important; min-height:0 !important; overflow:visible !important;
}
body.workspace-ui :is(#workspaceDrawer,#launcherModal,#airDefenseModal) .bootstrap-select > .dropdown-menu > div.inner {
    max-height:var(--picker-list-height, min(220px,28dvh)) !important;
    min-height:0 !important; overflow-y:auto !important; overflow-x:hidden !important;
}
body.workspace-ui :is(#workspaceDrawer,#launcherModal,#airDefenseModal) .bootstrap-select > .dropdown-menu > div.inner > ul.inner {
    max-height:none !important; overflow:visible !important; margin:0; border:0;
}
/* In-workspace reference articles. */
body.workspace-ui #workspaceDocsModal .modal-dialog { width:min(740px,calc(100vw - 122px)) !important; }
body.workspace-ui #workspaceDocsArticle { user-select:text; font-size:15px; line-height:1.8; overflow-wrap:anywhere; }
body.workspace-ui #workspaceDocsArticle h2 { font-size:21px; line-height:1.4; margin:28px 0 12px; color:var(--ink); }
body.workspace-ui #workspaceDocsArticle h3 { font-size:18px; margin-top:24px; }
body.workspace-ui #workspaceDocsArticle a { color:var(--accent); }
body.workspace-ui #workspaceDocsArticle .seo-doc-links { display:flex; flex-wrap:wrap; gap:10px; margin-top:26px; }
body.workspace-ui #workspaceDocsArticle .seo-doc-links a { padding:10px 14px; border:1px solid var(--line); border-radius:8px; background:var(--field); }
@media (max-width:700px) {
    body.workspace-ui #workspaceDocsModal .modal-dialog { width:calc(100% - 16px) !important; }
}
body.workspace-ui #workspaceAdminModal .modal-dialog { width:calc(100vw - 122px) !important; }
body.workspace-ui #workspaceAdminModal .modal-body { padding:0; overflow:hidden; display:flex; flex-direction:column; }
body.workspace-ui #workspaceAdminFrame { border:0; width:100%; flex:1; min-height:0; background:var(--panel); }
body.workspace-ui #workspaceAdminStatus { padding:16px 24px; margin:0; color:var(--muted); }
@media(max-width:700px) { body.workspace-ui #workspaceAdminModal .modal-dialog { width:calc(100% - 16px) !important; } }

/* Shared state shortcuts, kept clear of navigation and map zoom controls. */
.workspace-shortcuts { position:fixed; top:88px; left:50%; transform:translateX(-50%); z-index:950; display:flex; gap:4px; padding:5px; border:1px solid var(--line); border-radius:12px; background:var(--panel); box-shadow:0 3px 12px #0002; }
.workspace-shortcuts button { display:flex; align-items:center; justify-content:center; gap:7px; min-height:40px; padding:8px 10px; border:1px solid transparent; border-radius:8px; background:transparent; color:var(--muted); font-size:12px; cursor:pointer; }
.workspace-shortcuts button[aria-pressed=true] { background:var(--field); border-color:var(--line); color:var(--accent); }
.workspace-shortcuts #quickSimulate { background:var(--accent); color:var(--surface); }
.workspace-shortcuts #workspaceClearMap { background:#b91c1c; border-color:#b91c1c; color:#fff; font-weight:600; }
.workspace-shortcuts #workspaceClearMap:hover:not(:disabled) { background:#991b1b; border-color:#991b1b; color:#fff; }
.workspace-shortcuts button:disabled { opacity:.45; cursor:default; }
.workspace-shortcuts button:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
@media(max-width:1100px) { body.workspace-ui .theater-intro { display:none; } }
@media(max-width:700px) {
 .workspace-shortcuts { top:74px; left:12px; right:66px; transform:none; gap:2px; padding:4px; }
 .workspace-shortcuts button { flex:1; min-width:0; min-height:44px; flex-direction:column; gap:3px; padding:4px 2px; font-size:9px; }
 body.workspace-ui .workspace-map-tools { top:74px; right:12px; }
}
