Skip to content

A spy satellite simulator in your browser, except the data is real. Live open source spatial intelligence on a photorealistic 3D globe.

refactor: compose UI shell with explicit application operations and component owners

Sameh Khamisf5ef9091f0d4
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bc10802f5..f511bf044 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,10 @@ of current runtime behavior, see [`docs/CURRENT-STATE.md`](docs/CURRENT-STATE.md
## [Unreleased]
+- Separate UI assembly from standalone engine wiring, with dedicated panel layout, position, notice and recording owners.
+- Stop pending UI presentation and drag work during disposal; preserve accessible status text when stopping its decoration.
+- Organize component styles behind the same ordered stylesheet entry and include 3D model controls in the current-state snapshot.
+
- Separate Scene controls and text presentation from project/playback operations; revoke replaced row listeners and suppress stale completion feedback.
- Preserve shot-label identity on selection so double-click rename can complete.
diff --git a/docs/CODE-BOUNDARIES.md b/docs/CODE-BOUNDARIES.md
index 2ba08e77b..1fc301747 100644
--- a/docs/CODE-BOUNDARIES.md
+++ b/docs/CODE-BOUNDARIES.md
@@ -327,3 +327,14 @@ original Display groups, independent scroll positions and current focus owner.
presentation. It receives project reads and explicit actions, with no imports of
the director, source modules, camera engine or storage. Replacement and disposal
release listeners; pending action feedback is limited to its current owner.
+
+## UI assembly and styles
+
+`ui/shell` assembles controls from supplied existing layer, navigation, terrain,
+rendering, HUD and share operations. `src/standalone/ui.js` provides the running
+application's instances; `src/ui.js` remains the compatibility entry. The shell
+imports no standalone bootstrap or concrete live layer implementation.
+Panel layout, position/drag, notices, recording and deferred UI work have separate
+owners with synchronous cleanup. Existing scene, share and HUD engines retain
+their entry points. `ui/styles` loads the ordered stylesheet entry; component
+files retain the original cascade, including responsive and dock refinements.
diff --git a/docs/CURRENT-STATE.md b/docs/CURRENT-STATE.md
index 7bf3b3b00..92f38babb 100644
--- a/docs/CURRENT-STATE.md
+++ b/docs/CURRENT-STATE.md
@@ -1,5 +1,19 @@
# God's Eye View Current State
+## UI shell and component ownership
+
+The standalone entry composes the UI with the application's existing layer,
+terrain, navigation and rendering operations. The shell receives those instances
+and assembles the controls. Panel layout scheduling, position preferences and
+active drags, loading notices, recording presentation and DOM lookup have focused
+owners. Disposal revokes queued presentation and listeners before asynchronous
+Context restoration, cancels an unfinished drag without saving it, restores the
+recording HUD and releases status decoration without replacing accessible text.
+The ordinary control snapshot includes the current 3D model toggle and mode.
+
+`style.css` imports component styles in their original cascade order. Scene,
+share, HUD and layer engines retain their existing behavior and entry points.
+
## Scene control ownership
Scene controls own creation/deletion prompts, panel listeners, shot rows, playback/recording presentation
diff --git a/package.json b/package.json
index d0bead40e..e7fa939f5 100644
--- a/package.json
+++ b/package.json
@@ -138,6 +138,8 @@
"./ui/cockpit/math": "./src/cockpitMath.js",
"./ui/cockpit/layout": "./src/cockpitUtilityLayout.js",
"./ui/cockpit/vision": "./src/cockpitVisionPolicy.js",
- "./ui/scenes": "./src/ui/scenes.js"
+ "./ui/scenes": "./src/ui/scenes.js",
+ "./ui/shell": "./src/ui/applicationShell.js",
+ "./ui/styles": "./src/ui/styles.js"
}
}
diff --git a/scripts/package-boundaries.json b/scripts/package-boundaries.json
index 16b60d839..0cc639119 100644
--- a/scripts/package-boundaries.json
+++ b/scripts/package-boundaries.json
@@ -423,5 +423,136 @@
"src/ui/scenePresentation.js"
],
"external": []
+ },
+ "ui-shell": {
+ "exports": [
+ "./ui/shell"
+ ],
+ "modules": [
+ "src/bloom.js",
+ "src/cctvFocusPolicy.js",
+ "src/cctvFocusRequest.js",
+ "src/cockpitMath.js",
+ "src/cockpitTracking.js",
+ "src/cockpitUtilityLayout.js",
+ "src/cockpitVisionPolicy.js",
+ "src/contactsDetectionPolicy.js",
+ "src/contextModePolicy.js",
+ "src/data/detectionPolicy.js",
+ "src/data/installationFeedback.js",
+ "src/data/layerState.js",
+ "src/data/militaryAwarenessEngine.js",
+ "src/keySetupCore.mjs",
+ "src/loadingFeedback.js",
+ "src/locationStatus.js",
+ "src/mapStackChips.js",
+ "src/navigationPolicy.js",
+ "src/panelStackLayout.js",
+ "src/rightRailPolicy.js",
+ "src/splitFlap.js",
+ "src/styles/anime.js",
+ "src/styles/noir.js",
+ "src/styles/retro.js",
+ "src/styles/snow.js",
+ "src/styles/surveillance.js",
+ "src/styles/thermal.js",
+ "src/ui/applicationShell.js",
+ "src/ui/applicationShortcuts.js",
+ "src/ui/cctv.js",
+ "src/ui/cctvBindings.js",
+ "src/ui/cctvCalibration.js",
+ "src/ui/cctvControls.js",
+ "src/ui/cctvFrames.js",
+ "src/ui/cctvPresentation.js",
+ "src/ui/clearLayersControl.js",
+ "src/ui/cockpit.js",
+ "src/ui/cockpitBriefing.js",
+ "src/ui/cockpitCamera.js",
+ "src/ui/cockpitContext.js",
+ "src/ui/cockpitController.js",
+ "src/ui/cockpitDisplayPortal.js",
+ "src/ui/cockpitInput.js",
+ "src/ui/cockpitInstruments.js",
+ "src/ui/cockpitLayout.js",
+ "src/ui/cockpitPresentation.js",
+ "src/ui/cockpitSignals.js",
+ "src/ui/cockpitTrackingController.js",
+ "src/ui/context.js",
+ "src/ui/contextActions.js",
+ "src/ui/contextBindings.js",
+ "src/ui/contextControls.js",
+ "src/ui/contextLayerChanges.js",
+ "src/ui/contextPresentation.js",
+ "src/ui/contextSession.js",
+ "src/ui/contextSubscriptions.js",
+ "src/ui/contextTransactions.js",
+ "src/ui/displayControls.js",
+ "src/ui/effects.js",
+ "src/ui/layerPanel.js",
+ "src/ui/layers.js",
+ "src/ui/leftPanelRail.js",
+ "src/ui/location.js",
+ "src/ui/locationControls.js",
+ "src/ui/locationSearch.js",
+ "src/ui/mapSource.js",
+ "src/ui/mapSourceControls.js",
+ "src/ui/panelDisclosure.js",
+ "src/ui/panelLayoutController.js",
+ "src/ui/panelMeasurement.js",
+ "src/ui/panelPositionControls.js",
+ "src/ui/panelRailGeometry.js",
+ "src/ui/panelRails.js",
+ "src/ui/radio.js",
+ "src/ui/radioBindings.js",
+ "src/ui/radioControls.js",
+ "src/ui/radioPresentation.js",
+ "src/ui/radioTunerModel.js",
+ "src/ui/recordingControls.js",
+ "src/ui/rightPanelRail.js",
+ "src/ui/sceneControls.js",
+ "src/ui/scenePresentation.js",
+ "src/ui/scenes.js",
+ "src/ui/shellElements.js",
+ "src/ui/shellFeedback.js",
+ "src/ui/styleParameters.js",
+ "src/ui/surfaceKeyboard.js",
+ "src/ui/visualEffects.js",
+ "src/ui/visualInput.js",
+ "src/ui/visualPresets.js",
+ "src/worldFocus.js",
+ "src/ui/uiLifetime.js"
+ ],
+ "external": [
+ "cesium"
+ ]
+ },
+ "ui-styles": {
+ "exports": [
+ "./ui/styles"
+ ],
+ "modules": [
+ "src/ui/styles.js",
+ "style.css",
+ "src/ui/styles/foundation.css",
+ "src/ui/styles/controls.css",
+ "src/ui/styles/location.css",
+ "src/ui/styles/status.css",
+ "src/ui/styles/cockpit.css",
+ "src/ui/styles/overlays.css",
+ "src/ui/styles/layers.css",
+ "src/ui/styles/radio.css",
+ "src/ui/styles/cctv.css",
+ "src/ui/styles/scenes.css",
+ "src/ui/styles/recording.css",
+ "src/ui/styles/responsive.css",
+ "src/ui/styles/command-dock.css",
+ "src/ui/styles/command-dock-compact.css",
+ "src/ui/styles/command-dock-trays.css",
+ "src/ui/styles/command-dock-sliding.css",
+ "src/ui/styles/voice-cost.css",
+ "src/ui/styles/first-run.css",
+ "src/ui/styles/provider-settings.css"
+ ],
+ "external": []
}
}
diff --git a/scripts/qa-map-source-tray.mjs b/scripts/qa-map-source-tray.mjs
index 5d5854bc6..149290ce9 100644
--- a/scripts/qa-map-source-tray.mjs
+++ b/scripts/qa-map-source-tray.mjs
@@ -918,15 +918,15 @@ try {
});
const waitForQueuedNotice = async (label, timeoutMs = 1000) => {
const deadline = performance.now() + timeoutMs;
- while (styleManager._globalStatusNotice?.label !== label
+ while (styleManager._feedback._globalStatusNotice?.label !== label
&& performance.now() < deadline) {
await new Promise((resolve) => setTimeout(resolve, 16));
}
- return styleManager._globalStatusNotice?.label === label;
+ return styleManager._feedback._globalStatusNotice?.label === label;
};
const baseNow = performance.now();
try {
- styleManager._loadingFeedbackState = {
+ styleManager._feedback._loadingFeedbackState = {
phase: 'idle', visible: false, startedAt: 0, showAt: 0, hideAt: 0,
activeIds: [], batchOutcome: null, terminal: null, operation: null,
};
diff --git a/scripts/qa-radio.mjs b/scripts/qa-radio.mjs
index 40f34240f..d3c26471c 100644
--- a/scripts/qa-radio.mjs
+++ b/scripts/qa-radio.mjs
@@ -1702,8 +1702,8 @@ async function main() {
dataset: { ...stack.dataset },
}];
})),
- preferredLeftPanelId: manager._leftStackPreferredPanelId,
- preferredRightPanelId: manager._rightStackPreferredPanelId,
+ preferredLeftPanelId: manager._panelLayout._leftStackPreferredPanelId,
+ preferredRightPanelId: manager._panelLayout._rightStackPreferredPanelId,
hudMode: manager.hud.getMode(),
hudVariant: manager.hud.getVariant(),
focusId: document.activeElement?.id || null,
@@ -1767,7 +1767,7 @@ async function main() {
const scenePanel = document.getElementById('scene-panel');
const contextPanel = document.getElementById('global-context-panel');
result.tacticalAutoCollapse = {
- latestOpenedPanel: manager._leftStackPreferredPanelId,
+ latestOpenedPanel: manager._panelLayout._leftStackPreferredPanelId,
scenesExpanded: !scenePanel.classList.contains('collapsed'),
dataCollapsed: dataPanel.classList.contains('layout-auto-collapsed'),
dataHiddenWhileScenesOwnsLane: dataPanel.getBoundingClientRect().height === 0
@@ -1814,13 +1814,13 @@ async function main() {
manager.hud.setMode(prior.hudMode);
manager._updateHudButtonState();
await new Promise((resolve) => setTimeout(resolve, 320));
- if (manager._leftStackLayoutFrame !== null) {
- cancelAnimationFrame(manager._leftStackLayoutFrame);
- manager._leftStackLayoutFrame = null;
+ if (manager._panelLayout._leftStackLayoutFrame !== null) {
+ cancelAnimationFrame(manager._panelLayout._leftStackLayoutFrame);
+ manager._panelLayout._leftStackLayoutFrame = null;
}
- if (manager._rightStackLayoutFrame !== null) {
- cancelAnimationFrame(manager._rightStackLayoutFrame);
- manager._rightStackLayoutFrame = null;
+ if (manager._panelLayout._rightStackLayoutFrame !== null) {
+ cancelAnimationFrame(manager._panelLayout._rightStackLayoutFrame);
+ manager._panelLayout._rightStackLayoutFrame = null;
}
for (const [id, state] of Object.entries(prior.panels)) {
const panel = document.getElementById(id);
@@ -1839,18 +1839,18 @@ async function main() {
for (const key of Object.keys(stack.dataset)) delete stack.dataset[key];
Object.assign(stack.dataset, state.dataset);
}
- manager._leftStackPreferredPanelId = prior.preferredLeftPanelId;
- manager._rightStackPreferredPanelId = prior.preferredRightPanelId;
+ manager._panelLayout._leftStackPreferredPanelId = prior.preferredLeftPanelId;
+ manager._panelLayout._rightStackPreferredPanelId = prior.preferredRightPanelId;
localStorage.clear();
for (const [key, value] of Object.entries(prior.storage)) localStorage.setItem(key, value);
await new Promise((resolve) => requestAnimationFrame(() => requestAnimationFrame(resolve)));
- if (manager._leftStackLayoutFrame !== null) {
- cancelAnimationFrame(manager._leftStackLayoutFrame);
- manager._leftStackLayoutFrame = null;
+ if (manager._panelLayout._leftStackLayoutFrame !== null) {
+ cancelAnimationFrame(manager._panelLayout._leftStackLayoutFrame);
+ manager._panelLayout._leftStackLayoutFrame = null;
}
- if (manager._rightStackLayoutFrame !== null) {
- cancelAnimationFrame(manager._rightStackLayoutFrame);
- manager._rightStackLayoutFrame = null;
+ if (manager._panelLayout._rightStackLayoutFrame !== null) {
+ cancelAnimationFrame(manager._panelLayout._rightStackLayoutFrame);
+ manager._panelLayout._rightStackLayoutFrame = null;
}
// Disclosure restoration can wake the installed layout observers. Let
// those observers settle, then restore the captured stack presentation
@@ -1880,8 +1880,8 @@ async function main() {
result.restoreDetails = {
panelsRestored,
stacksRestored,
- preferredPanelRestored: manager._leftStackPreferredPanelId === prior.preferredLeftPanelId,
- preferredRightPanelRestored: manager._rightStackPreferredPanelId === prior.preferredRightPanelId,
+ preferredPanelRestored: manager._panelLayout._leftStackPreferredPanelId === prior.preferredLeftPanelId,
+ preferredRightPanelRestored: manager._panelLayout._rightStackPreferredPanelId === prior.preferredRightPanelId,
hudModeRestored: manager.hud.getMode() === prior.hudMode,
hudVariantRestored: manager.hud.getVariant() === prior.hudVariant,
storageRestored: JSON.stringify(Object.fromEntries(Object.entries(localStorage))) === JSON.stringify(prior.storage),
@@ -2055,7 +2055,7 @@ async function main() {
detectionMode: manager.getDetectionState().detectionMode,
models3dEnabled: manager._models3dEnabled,
models3dMode: manager._models3dMode,
- preferredLeftPanelId: manager._leftStackPreferredPanelId,
+ preferredLeftPanelId: manager._panelLayout._leftStackPreferredPanelId,
panels: Object.fromEntries([
'data-panel',
'global-context-panel',
@@ -2371,13 +2371,13 @@ async function main() {
if (prior.utilityTop) hud.style.setProperty('--cockpit-utility-top', prior.utilityTop);
else hud.style.removeProperty('--cockpit-utility-top');
await waitForLayout();
- if (manager._leftStackLayoutFrame !== null) {
- cancelAnimationFrame(manager._leftStackLayoutFrame);
- manager._leftStackLayoutFrame = null;
+ if (manager._panelLayout._leftStackLayoutFrame !== null) {
+ cancelAnimationFrame(manager._panelLayout._leftStackLayoutFrame);
+ manager._panelLayout._leftStackLayoutFrame = null;
}
- if (manager._rightStackLayoutFrame !== null) {
- cancelAnimationFrame(manager._rightStackLayoutFrame);
- manager._rightStackLayoutFrame = null;
+ if (manager._panelLayout._rightStackLayoutFrame !== null) {
+ cancelAnimationFrame(manager._panelLayout._rightStackLayoutFrame);
+ manager._panelLayout._rightStackLayoutFrame = null;
}
for (const [id, state] of Object.entries(prior.panels)) {
const panel = document.getElementById(id);
@@ -2388,7 +2388,7 @@ async function main() {
else panel.setAttribute('aria-hidden', state.ariaHidden);
manager._syncPanelCollapseButton(panel);
}
- manager._leftStackPreferredPanelId = prior.preferredLeftPanelId;
+ manager._panelLayout._leftStackPreferredPanelId = prior.preferredLeftPanelId;
localStorage.clear();
for (const [key, value] of Object.entries(prior.storage)) localStorage.setItem(key, value);
await new Promise((resolve) => requestAnimationFrame(() => requestAnimationFrame(resolve)));
@@ -2411,7 +2411,7 @@ async function main() {
&& panel.getAttribute('style') === state.style
&& panel.getAttribute('aria-hidden') === state.ariaHidden;
})
- && manager._leftStackPreferredPanelId === prior.preferredLeftPanelId
+ && manager._panelLayout._leftStackPreferredPanelId === prior.preferredLeftPanelId
&& JSON.stringify(Object.fromEntries(Object.entries(localStorage))) === JSON.stringify(prior.storage)
&& (!prior.focusId || document.activeElement?.id === prior.focusId);
}
diff --git a/scripts/qa-scene-controls.mjs b/scripts/qa-scene-controls.mjs
index 4c82c347f..916561b40 100644
--- a/scripts/qa-scene-controls.mjs
+++ b/scripts/qa-scene-controls.mjs
@@ -208,6 +208,11 @@ try {
!window.__godsEyeView.styleManager.getControlState().recording,
),
);
+ // Escape can also collapse the Scene accordion. Reopen it through its
+ // installed disclosure before testing the next visible user action.
+ if (await page.$eval('#scene-panel', (panel) => panel.classList.contains('collapsed')))
+ await page.click('[data-collapse-target="scene-panel"]');
+ await page.waitForSelector('#scene-download-btn', { visible: true });
await page.click('#scene-download-btn');
const metadata = await page.evaluate(async () =>
JSON.parse(await window.__sceneExports.at(-1)),
diff --git a/scripts/qa-ui-disposal.mjs b/scripts/qa-ui-disposal.mjs
index 2808adfa0..7bf0b7649 100644
--- a/scripts/qa-ui-disposal.mjs
+++ b/scripts/qa-ui-disposal.mjs
@@ -33,7 +33,8 @@ try {
const ui = window.__godsEyeView.styleManager;
const counts = {};
const watchObserver = (name) => {
- const observer = ui[name];
+ const owner = name === '_draggableResizeObserver' ? ui._panelPosition : ui._panelLayout;
+ const observer = owner[name];
if (!observer) return false;
const disconnect = observer.disconnect.bind(observer);
counts[name] = 0;
@@ -113,6 +114,10 @@ try {
const disposal = ui.dispose();
const focusBefore = document.activeElement;
const stoppedBeforeRestoration =
+ ui._panelLayout.destroyed &&
+ ui._panelPosition.destroyed &&
+ ui._feedback.destroyed &&
+ ui._recording.destroyed &&
cockpit.destroyed &&
portal.stopped &&
cockpit._listenerRemovers.length === 0 &&
diff --git a/src/cameraHandoff.test.mjs b/src/cameraHandoff.test.mjs
index 3ef065443..eecd53bbc 100644
--- a/src/cameraHandoff.test.mjs
+++ b/src/cameraHandoff.test.mjs
@@ -7,7 +7,7 @@ import test from 'node:test';
import { fileURLToPath } from 'node:url';
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
-const ui = fs.readFileSync(path.join(ROOT, 'src', 'ui.js'), 'utf8');
+const ui = fs.readFileSync(path.join(ROOT, 'src', 'ui', 'applicationShell.js'), 'utf8');
const firms = fs.readFileSync(path.join(ROOT, 'src', 'data', 'firmsHeatmap.js'), 'utf8');
const vessels = fs.readFileSync(path.join(ROOT, 'src', 'data', 'aisLiveVessels.js'), 'utf8');
const voice = fs.readFileSync(path.join(ROOT, 'src', 'voice', 'gevActions.js'), 'utf8');
diff --git a/src/cctvFocusPolicy.test.mjs b/src/cctvFocusPolicy.test.mjs
index 5f4abd82e..3574bdf78 100644
--- a/src/cctvFocusPolicy.test.mjs
+++ b/src/cctvFocusPolicy.test.mjs
@@ -73,7 +73,7 @@ test('CCTV enable retains a pre-await tracking snapshot when tracking clears dur
assert.match(diagnostics[0][0], /before setEnabled await/);
assert.match(diagnostics[1][0], /after setEnabled await/);
- const uiSource = readFileSync(new URL('./ui.js', import.meta.url), 'utf8');
+ const uiSource = readFileSync(new URL('./ui/applicationShell.js', import.meta.url), 'utf8');
assert.match(uiSource, /await runCctvLayerEnableTransition\(\{/);
});
@@ -114,6 +114,6 @@ test('a disposed UI cannot activate a camera when enabling finishes late', async
release();
await pending;
assert.equal(activations, 0);
- const uiSource = readFileSync(new URL('./ui.js', import.meta.url), 'utf8');
+ const uiSource = readFileSync(new URL('./ui/applicationShell.js', import.meta.url), 'utf8');
assert.match(uiSource, /shouldFocus: \(\) => !this\._disposed && this\._dataManager\.isEnabled\('cctv'\)/);
});
diff --git a/src/cctvFocusRequest.test.mjs b/src/cctvFocusRequest.test.mjs
index fee23eb5e..64b4c20de 100644
--- a/src/cctvFocusRequest.test.mjs
+++ b/src/cctvFocusRequest.test.mjs
@@ -57,7 +57,7 @@ test('UI CCTV focus listener registration disposes the exact added callback once
assert.strictEqual(added[0].callback, listener);
assert.strictEqual(removed[0].callback, added[0].callback);
- const uiSource = readFileSync(new URL('./ui.js', import.meta.url), 'utf8');
+ const uiSource = readFileSync(new URL('./ui/applicationShell.js', import.meta.url), 'utf8');
assert.match(
uiSource,
/_removeCctvRequestFocusListener = registerCctvFocusRequestListener\([\s\S]+this\._cctvRequestFocusHandler/,
diff --git a/src/cockpitMarkup.test.mjs b/src/cockpitMarkup.test.mjs
index e67fae046..aa4b83792 100644
--- a/src/cockpitMarkup.test.mjs
+++ b/src/cockpitMarkup.test.mjs
@@ -1,3 +1,6 @@
+import { PanelLayoutController } from './ui/panelLayoutController.js';
+import { readShellElements } from './ui/shellElements.js';
+import { readStylesheet } from './testSupport/readStylesheet.mjs';
import { SceneControls } from './ui/sceneControls.js';
import { isRenderedOnScreen } from './ui/cockpitPresentation.js';
import { onKeyDown as cockpitKeyDown } from './ui/cockpitInput.js';
@@ -23,8 +26,8 @@ import { fileURLToPath } from 'node:url';
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
const html = fs.readFileSync(path.join(ROOT, 'index.html'), 'utf8');
-const ui = fs.readFileSync(path.join(ROOT, 'src', 'ui.js'), 'utf8');
-const css = fs.readFileSync(path.join(ROOT, 'style.css'), 'utf8');
+const ui = fs.readFileSync(path.join(ROOT, 'src', 'ui', 'applicationShell.js'), 'utf8');
+const css = readStylesheet(path.join(ROOT, 'style.css'));
const sceneDirector = fs.readFileSync(path.join(ROOT, 'src', 'scenes', 'director.js'), 'utf8');
const manager = fs.readFileSync(path.join(ROOT, 'src', 'data', 'manager.js'), 'utf8');
const contextLayer = fs.readFileSync(path.join(ROOT, 'src', 'data', 'militaryAwareness.js'), 'utf8');
@@ -299,7 +302,7 @@ test('Display orders 3D above Celestial, Clean UI below it, and Parameters below
);
assert.equal((html.match(/id="param-slider-panel"/g) || []).length, 1, 'Parameters must have one DOM owner');
assert.match(
- ui,
+ PanelLayoutController.prototype._initRightPanelAdaptiveLayout.toString(),
/const detectionGroup = this\._detectionBtn\?\.closest\('\.pp-toggle-group'\);[\s\S]*?detectionGroup\.after\(this\._sliderPanel\)/,
);
assert.match(
@@ -476,7 +479,7 @@ test('Reset releases Contact camera ownership through its selection-preserving r
assert.ok(resetStart >= 0);
assert.ok(contextRelease > resetStart);
assert.ok(satelliteRelease > contextRelease);
- assert.match(ui, /this\._cockpitResetGlobeBtn = document\.getElementById\('cockpit-reset-globe'\)/);
+ assert.match(readShellElements.toString(), /_cockpitResetGlobeBtn: document\.getElementById\('cockpit-reset-globe'\)/);
const controls = fs.readFileSync(path.join(ROOT, 'src', 'ui', 'locationControls.js'), 'utf8');
assert.match(ui, /resetButtons: \[this\._resetGlobeBtn, this\._cockpitResetGlobeBtn\]/);
assert.match(ui, /onReset: \(\) => this\.resetToGlobeView\(\)/);
@@ -530,8 +533,9 @@ test('Cockpit Radio station changes preserve first-person camera ownership', ()
});
test('Cockpit panel corridors reserve the owned topline readouts', () => {
- const leftObstacles = ui.match(/const LEFT_STACK_OBSTACLE_SELECTOR = \[([\s\S]*?)\]\.join/);
- const rightObstacles = ui.match(/const RIGHT_STACK_OBSTACLE_SELECTOR = \[([\s\S]*?)\]\.join/);
+ const layout = fs.readFileSync(new URL('./ui/panelLayoutController.js', import.meta.url), 'utf8');
+ const leftObstacles = layout.match(/const LEFT_STACK_OBSTACLE_SELECTOR = \[([\s\S]*?)\]\.join/);
+ const rightObstacles = layout.match(/const RIGHT_STACK_OBSTACLE_SELECTOR = \[([\s\S]*?)\]\.join/);
assert.ok(leftObstacles && rightObstacles, 'responsive panel obstacle selectors are missing');
assert.match(leftObstacles[1], /#cockpit-hud \.cockpit-topline/);
assert.match(rightObstacles[1], /#cockpit-hud \.cockpit-topline/);
@@ -569,8 +573,8 @@ test('Cockpit panel corridors reserve the owned topline readouts', () => {
/function isRenderedOnScreen\(element\) \{[\s\S]*?style\.display === 'none'\s*\|\|\s*style\.visibility === 'hidden'\s*\|\|\s*Number\(style\.opacity\) === 0[\s\S]*?rect\.width > 0 && rect\.height > 0;/,
);
assert.match(
- ui,
- /_leftStackHudTransitionHandler = \(event\) => \{[\s\S]*?_scheduleLeftPanelLayout\(\{ reconsiderAutoCollapse: true \}\);[\s\S]*?this\.cockpitView\?\.scheduleContextLayout\(\);/,
+ layout,
+ /_leftStackHudTransitionHandler = \(event\) => \{[\s\S]*?_scheduleLeftPanelLayout\(\{ reconsiderAutoCollapse: true \}\);[\s\S]*?this\.scheduleCockpitLayout\(\);/,
'the strip must remeasure on the same HUD fade the accordion does — the REC '
+ 'readout keeps its rect until the transition ends',
);
diff --git a/src/contactsDetectionPolicy.test.mjs b/src/contactsDetectionPolicy.test.mjs
index 4307cc182..331151f8e 100644
--- a/src/contactsDetectionPolicy.test.mjs
+++ b/src/contactsDetectionPolicy.test.mjs
@@ -28,7 +28,7 @@ import {
import { canonicalizeDensity } from './data/detectionPolicy.js';
// Follow the UI wiring and its extracted preset definitions.
-const uiSource = fs.readFileSync(new URL('./ui.js', import.meta.url), 'utf8')
+const uiSource = fs.readFileSync(new URL('./ui/applicationShell.js', import.meta.url), 'utf8')
+ '\n' + fs.readFileSync(new URL('./ui/visualPresets.js', import.meta.url), 'utf8');
/**
diff --git a/src/contextSessionOrdering.test.mjs b/src/contextSessionOrdering.test.mjs
index 7fe6a8288..af836c793 100644
--- a/src/contextSessionOrdering.test.mjs
+++ b/src/contextSessionOrdering.test.mjs
@@ -23,7 +23,7 @@ import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import { fileURLToPath } from 'node:url';
-const src = readFileSync(fileURLToPath(new URL('./ui.js', import.meta.url)), 'utf8');
+const src = readFileSync(fileURLToPath(new URL('./ui/applicationShell.js', import.meta.url)), 'utf8');
const handler = _handleContextLayerChange.toString();
diff --git a/src/contextTabKeyboard.test.mjs b/src/contextTabKeyboard.test.mjs
index 20b972967..49a640d97 100644
--- a/src/contextTabKeyboard.test.mjs
+++ b/src/contextTabKeyboard.test.mjs
@@ -1,3 +1,4 @@
+import { readStylesheet } from './testSupport/readStylesheet.mjs';
import { _selectContextMode } from './ui/contextTransactions.js';
import { _syncContextModeButtons } from './ui/contextPresentation.js';
import { _initGlobalContextPanel } from './ui/contextBindings.js';
@@ -11,8 +12,8 @@ import { test } from 'node:test';
import assert from 'node:assert/strict';
const html = readFileSync(new URL('../index.html', import.meta.url), 'utf8');
-const ui = readFileSync(new URL('./ui.js', import.meta.url), 'utf8');
-const css = readFileSync(new URL('../style.css', import.meta.url), 'utf8');
+const ui = readFileSync(new URL('./ui/applicationShell.js', import.meta.url), 'utf8');
+const css = readStylesheet(new URL('../style.css', import.meta.url));
test('Contacts and Space Missions both participate in the ordinary Tab sequence', () => {
for (const id of ['global-context-flights-btn', 'global-context-missions-btn']) {
diff --git a/src/creditAttribution.test.mjs b/src/creditAttribution.test.mjs
index dc1c17136..7dd7d0b70 100644
--- a/src/creditAttribution.test.mjs
+++ b/src/creditAttribution.test.mjs
@@ -1,3 +1,4 @@
+import { readStylesheet } from './testSupport/readStylesheet.mjs';
import assert from 'node:assert/strict';
import fs from 'node:fs';
import path from 'node:path';
@@ -5,8 +6,8 @@ import test from 'node:test';
import { fileURLToPath } from 'node:url';
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
-const css = fs.readFileSync(path.join(ROOT, 'style.css'), 'utf8');
-const ui = fs.readFileSync(path.join(ROOT, 'src', 'ui.js'), 'utf8');
+const css = readStylesheet(path.join(ROOT, 'style.css'));
+const ui = fs.readFileSync(path.join(ROOT, 'src', 'ui', 'applicationShell.js'), 'utf8');
/*
* Required-attribution keep-out pin.
@@ -436,9 +437,10 @@ test('custom properties inside modelled offsets are provably non-negative', () =
assert.doesNotMatch(decl.value, /-\s*\d/, `${decl.prop} has a negative CSS default: ${decl.value}`);
assert.match(decl.value, /^(0|0px)$/, `${decl.prop} default is not a vetted shape: ${decl.value}`);
}
- const start = ui.indexOf('_updateCommandDockTrayStack() {');
+ const layout = fs.readFileSync(new URL('./ui/panelLayoutController.js', import.meta.url), 'utf8');
+ const start = layout.indexOf('_updateCommandDockTrayStack() {');
assert.ok(start > 0, '_updateCommandDockTrayStack is missing');
- const writer = ui.slice(start, start + 1800);
+ const writer = layout.slice(start, start + 1800);
// Every value traces back to a rect height, floored at 0 and rounded up.
assert.match(writer, /const locationHeight = [\s\S]{0,120}?getBoundingClientRect\(\)\.height \|\| 0;/);
assert.match(writer, /const presetsHeight = [\s\S]{0,120}?getBoundingClientRect\(\)\.height \|\| 0;/);
diff --git a/src/data/detectionHost.test.mjs b/src/data/detectionHost.test.mjs
index b51776ff5..e76f6a75f 100644
--- a/src/data/detectionHost.test.mjs
+++ b/src/data/detectionHost.test.mjs
@@ -671,7 +671,7 @@ test('pathological detection paint holds alternate frames without freezing share
test('detection cannot resurrect a private canvas, listener, matrix, resize, clear, or UI inventory', () => {
const source = readFileSync(new URL('./detection.js', import.meta.url), 'utf8');
- const uiSource = readFileSync(new URL('../ui.js', import.meta.url), 'utf8')
+ const uiSource = readFileSync(new URL('../ui/applicationShell.js', import.meta.url), 'utf8')
+ '\n' + readFileSync(new URL('../ui/visualPresets.js', import.meta.url), 'utf8');
assert.doesNotMatch(source, /createElement\(\s*['"]canvas['"]\s*\)/);
assert.doesNotMatch(source, /postRender\.addEventListener/);
diff --git a/src/data/layerState.test.mjs b/src/data/layerState.test.mjs
index 2c282e75e..0080ef9ab 100644
--- a/src/data/layerState.test.mjs
+++ b/src/data/layerState.test.mjs
@@ -371,7 +371,7 @@ test('a fresh boot starts 3D aircraft ON in proximity — codec, both layers, an
assert.match(source, /^let _models3dMode = 'proximity';/m,
`${name}: and starts in proximity, matching the codec default`);
}
- const ui = await readFile(new URL('../ui.js', import.meta.url), 'utf8');
+ const ui = await readFile(new URL('../ui/applicationShell.js', import.meta.url), 'utf8');
assert.match(ui, /^\s*this\._models3dEnabled = true;$/m,
'ui.js: the DISPLAY rail believes 3D is on before any layer-state sync arrives');
assert.match(ui, /this\._models3dMode = 'proximity';/,
diff --git a/src/data/tr3bRegistry.test.mjs b/src/data/tr3bRegistry.test.mjs
index f7f00b0bd..1099127fb 100644
--- a/src/data/tr3bRegistry.test.mjs
+++ b/src/data/tr3bRegistry.test.mjs
@@ -270,7 +270,7 @@ test('conversions are session-scoped and no lifecycle path clears them', async (
// personally clicked, and re-tracking the same aircraft after a layer restart
// should still show the triangle. Only a page reload resets it — so no
// production code may clear the registry.
- for (const name of ['flights.js', 'militaryFlights.js', '../ui.js']) {
+ for (const name of ['flights.js', 'militaryFlights.js', '../ui/applicationShell.js']) {
const source = await readFile(new URL(`./${name}`, import.meta.url), 'utf8');
assert.doesNotMatch(source, /clearTr3bRegistry/,
`${name}: teardown must not clear session conversions`);
diff --git a/src/firstRunExperience.test.mjs b/src/firstRunExperience.test.mjs
index b19f082ae..002959ba9 100644
--- a/src/firstRunExperience.test.mjs
+++ b/src/firstRunExperience.test.mjs
@@ -1,3 +1,4 @@
+import { readStylesheet } from './testSupport/readStylesheet.mjs';
import { GEV_REALTIME_TOOLS } from '../server/providers/openai/tools.js';
import test from 'node:test';
import assert from 'node:assert/strict';
@@ -183,7 +184,7 @@ test('no storage is touched from a default parameter position', () => {
test('the JS and CSS lists of screen-claiming surfaces stay in step', () => {
const module = fs.readFileSync(new URL('./firstRunExperience.js', import.meta.url), 'utf8');
- const css = fs.readFileSync(new URL('../style.css', import.meta.url), 'utf8');
+ const css = readStylesheet(new URL('../style.css', import.meta.url));
assert.deepEqual(
[...EXCLUSIVE_SURFACE_CLASSES].sort(),
@@ -233,7 +234,7 @@ test('the key handler refuses to act for a card that is not really on screen', (
test('an overlay with NO class to watch still disarms the launcher', () => {
const module = fs.readFileSync(new URL('./firstRunExperience.js', import.meta.url), 'utf8');
- const css = fs.readFileSync(new URL('../style.css', import.meta.url), 'utf8');
+ const css = readStylesheet(new URL('../style.css', import.meta.url));
// The repro, pinned as the stacking it actually is: the attribution lightbox
// is full-screen ABOVE the card and announces itself with nothing. The card
@@ -345,7 +346,7 @@ test('a surface class that never clears is an ACCEPTED no-show, not a timer', ()
test('the scroll fade only appears when the list really overflows', () => {
const module = fs.readFileSync(new URL('./firstRunExperience.js', import.meta.url), 'utf8');
- const css = fs.readFileSync(new URL('../style.css', import.meta.url), 'utf8');
+ const css = readStylesheet(new URL('../style.css', import.meta.url));
// A fade on a card where all five tiles fit promises a sixth mission that does
// not exist, which is worse than no affordance at all.
assert.match(module, /const overflows = choiceList\.scrollHeight > choiceList\.clientHeight \+ 1;/);
@@ -551,7 +552,7 @@ test('the decision table is written down where the next editor will read it', ()
test('markup, startup ordering and accessibility remain pinned', () => {
const html = fs.readFileSync(new URL('../index.html', import.meta.url), 'utf8');
const startup = fs.readFileSync(new URL('./standalone/startupChrome.js', import.meta.url), 'utf8');
- const css = fs.readFileSync(new URL('../style.css', import.meta.url), 'utf8');
+ const css = readStylesheet(new URL('../style.css', import.meta.url));
assert.match(html, /id="first-run-launcher" role="dialog"[^>]*aria-labelledby="first-run-title"[^>]*hidden/);
assert.equal((html.match(/data-first-run-choice=/g) || []).length, 4);
@@ -631,7 +632,7 @@ test('the launcher keeps focus, restores it, and never disables the focused butt
});
test('the DISPLAY rail starts collapsed on a first run, and a stored choice wins', () => {
- const ui = fs.readFileSync(new URL('./ui.js', import.meta.url), 'utf8');
+ const ui = fs.readFileSync(new URL('./ui/panelPositionControls.js', import.meta.url), 'utf8');
// The rail opened by default to advertise HUD / DETECT / 3D. Those default ON
// now, so it was opening to offer controls for things already happening —
// while competing with the mission card for the one first impression there is.
diff --git a/src/keyboardFocusStyles.test.mjs b/src/keyboardFocusStyles.test.mjs
index 3e6cfa541..5244cffdc 100644
--- a/src/keyboardFocusStyles.test.mjs
+++ b/src/keyboardFocusStyles.test.mjs
@@ -1,8 +1,9 @@
+import { readStylesheet } from './testSupport/readStylesheet.mjs';
import test from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
-const css = readFileSync(new URL('../style.css', import.meta.url), 'utf8');
+const css = readStylesheet(new URL('../style.css', import.meta.url));
function ruleBody(selector) {
const start = css.indexOf(selector);
diff --git a/src/loadingFeedback.test.mjs b/src/loadingFeedback.test.mjs
index 7537efb06..cb26795e6 100644
--- a/src/loadingFeedback.test.mjs
+++ b/src/loadingFeedback.test.mjs
@@ -1,3 +1,4 @@
+import { readStylesheet } from './testSupport/readStylesheet.mjs';
import test from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
@@ -89,15 +90,15 @@ test('deferred terminal notices lose ownership to newer acquisition epochs and d
});
test('share-follow failures use the universal top-center status instead of the bottom toast', () => {
- const ui = readFileSync(new URL('./ui.js', import.meta.url), 'utf8');
+ const ui = readFileSync(new URL('./ui/applicationShell.js', import.meta.url), 'utf8');
const start = ui.indexOf(' _handleShareTrackingRestoreStatus(result) {');
const end = ui.indexOf('\n _initGlobalContextPanel() {', start);
const handler = ui.slice(start, end);
assert.match(handler, /this\._showGlobalStatusNotice\(message\)/);
assert.match(handler, /this\.initialRestorePromise\.then\(showAfterStartupCover\)/);
- assert.match(handler, /requestAnimationFrame\(\(\) => \{/);
- assert.match(handler, /startupCover\.addEventListener\('transitionend', showOnce, \{ once: true \}\)/);
- assert.match(handler, /fallbackTimer = setTimeout\(showOnce, 1000\)/);
+ assert.match(handler, /this\._lifetime\.frame\(\(\) => \{/);
+ assert.match(handler, /this\._lifetime\.listen\(startupCover, 'transitionend', showOnce, \{ once: true \}\)/);
+ assert.match(handler, /fallbackTimer = this\._lifetime\.timeout\(showOnce, 1000\)/);
assert.doesNotMatch(handler, /this\._showToast\(message\)/);
assert.doesNotMatch(handler, /pushCockpitSignal/);
assert.match(handler, /result\.classification === 'pending'/);
@@ -195,13 +196,13 @@ test('replacement, repetition, and hidden-tab elapsed time use the newest fixed
});
test('universal notice lifecycle clears on dispose and uses the one top-center live region', () => {
- const ui = readFileSync(new URL('./ui.js', import.meta.url), 'utf8');
+ const ui = readFileSync(new URL('./ui/applicationShell.js', import.meta.url), 'utf8');
const html = readFileSync(new URL('../index.html', import.meta.url), 'utf8');
const disposeStart = ui.indexOf(' async dispose() {');
const disposeEnd = ui.indexOf('\n }\n', disposeStart);
const dispose = ui.slice(disposeStart, disposeEnd);
- assert.match(dispose, /this\._globalStatusNotice = null;/);
+ assert.match(dispose, /this\._feedback\._globalStatusNotice = null;/);
assert.match(dispose, /this\._shareTrackingNoticeGeneration \+= 1;/);
assert.match(html, /<div id="global-loading-status" role="status" aria-live="polite" aria-atomic="true" hidden>/);
});
@@ -235,7 +236,7 @@ test('reveals sustained loading and then a bounded completion state', () => {
});
test('terminal loading feedback centers its label without an empty detail slot', () => {
- const css = readFileSync(new URL('../style.css', import.meta.url), 'utf8');
+ const css = readStylesheet(new URL('../style.css', import.meta.url));
assert.match(
css,
/#global-loading-status:is\(\[data-state='complete'\], \[data-state='cancelled'\], \[data-state='error'\]\)\s*\{[\s\S]*?justify-content:\s*center;[\s\S]*?text-align:\s*center;/,
@@ -531,8 +532,8 @@ test('the settled traffic chip shows exactly one percentage — the coverage it
});
test('the chip renderer clears the progress slot instead of stranding the last value', () => {
- const ui = readFileSync(new URL('./ui.js', import.meta.url), 'utf8');
- const css = readFileSync(new URL('../style.css', import.meta.url), 'utf8');
+ const ui = readFileSync(new URL('./ui/shellFeedback.js', import.meta.url), 'utf8');
+ const css = readStylesheet(new URL('../style.css', import.meta.url));
const start = ui.indexOf(' _updateTrafficSyncChip(');
assert.ok(start > 0, '_updateTrafficSyncChip is missing');
const body = ui.slice(start, ui.indexOf('\n }', start));
@@ -620,7 +621,7 @@ test('aggregates Mapped Installations refresh beside CCTV without changing eithe
// stack layout contract — the ticker's lifecycle is pinned against ui.js
// source. (perf rebase 2026-08-17)
test('the loading ticker never runs hidden and stops after loading and notices settle', () => {
- const ui = readFileSync(new URL('./ui.js', import.meta.url), 'utf8');
+ const ui = readFileSync(new URL('./ui/shellFeedback.js', import.meta.url), 'utf8');
// Scope every assertion to _armLoadingFeedbackTicker's own body. The
// neighbouring _startTrafficChipTicker is a deliberately PERMANENT 500ms
// safety-net poll, so its `if (document.hidden) return;` is correct there
@@ -667,17 +668,17 @@ test('the loading ticker never runs hidden and stops after loading and notices s
// 4. Returning to visible resamples, so a batch that finished while hidden
// is reconciled and a still-running one re-arms its ticker. The handler
// must live on the class that OWNS _updateGlobalLoadingFeedback
- // (StyleManager) — wiring it into a neighbouring controller instead
+ // (ShellFeedback) — wiring it into a neighbouring controller instead
// throws on every visibilitychange — and must be torn down with the rest.
assert.match(
ui,
- /this\._loadingVisibilityHandler = \(\) => \{\s*if \(!document\.hidden\) this\._updateGlobalLoadingFeedback\(\);\s*\};\s*document\.addEventListener\('visibilitychange', this\._loadingVisibilityHandler\);/,
+ /this\._loadingVisibilityHandler = \(\) => \{\s*if \(!document\.hidden\) this\._updateGlobalLoadingFeedback\(\);\s*else this\._stopLoadingFeedbackTicker\(\);\s*\};\s*document\.addEventListener\('visibilitychange', this\._loadingVisibilityHandler\);/,
'visibilitychange must resample the chip on return',
);
- const styleManager = ui.slice(ui.indexOf('export class StyleManager'));
+ const styleManager = ui.slice(ui.indexOf('export class ShellFeedback'));
assert.ok(
styleManager.includes('this._loadingVisibilityHandler'),
- 'the resample handler must be owned by StyleManager, which defines _updateGlobalLoadingFeedback',
+ 'the resample handler must be owned by ShellFeedback, which defines _updateGlobalLoadingFeedback',
);
assert.match(
ui,
diff --git a/src/locationReadouts.test.mjs b/src/locationReadouts.test.mjs
index 62c11e36f..cfe87640b 100644
--- a/src/locationReadouts.test.mjs
+++ b/src/locationReadouts.test.mjs
@@ -5,7 +5,7 @@ import test from 'node:test';
import { fileURLToPath } from 'node:url';
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
-const ui = fs.readFileSync(path.join(ROOT, 'src', 'ui.js'), 'utf8');
+const ui = fs.readFileSync(path.join(ROOT, 'src', 'ui', 'applicationShell.js'), 'utf8');
const director = fs.readFileSync(path.join(ROOT, 'src', 'scenes', 'director.js'), 'utf8');
/** Source of the free-text LOCATION search handler (Enter on #location-search). */
diff --git a/src/mapSourceFocus.test.mjs b/src/mapSourceFocus.test.mjs
index 985bd5658..dd7b43ea2 100644
--- a/src/mapSourceFocus.test.mjs
+++ b/src/mapSourceFocus.test.mjs
@@ -4,7 +4,7 @@ import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
// Exercise the installed event routes and central close method, without WebGL.
-const source = readFileSync(new URL('./ui.js', import.meta.url), 'utf8');
+const source = readFileSync(new URL('./ui/applicationShell.js', import.meta.url), 'utf8');
const markup = readFileSync(new URL('../index.html', import.meta.url), 'utf8');
const locationMarkup = markup.slice(markup.indexOf('<div id="location-bar"'), markup.indexOf('<div id="left-panel-stack"'));
const locationToggleMarkup = locationMarkup.match(/<button\b([^>]*\bid="location-bar-toggle"[^>]*)>([\s\S]*?)<\/button>/);
@@ -123,6 +123,8 @@ function harness({ hidden = false, selected = true, noChips = false } = {}) {
const claims = [];
let shareSyncs = 0;
const manager = {
+ _lifetime: { frame() {} },
+ _panelLayout: { _leftStackPreferredPanelId: null, _rightStackPreferredPanelId: null },
...methods,
_savePanelCollapsedState(...args) { saves.push(args); },
_scheduleLeftPanelLayout() {}, _scheduleRightPanelLayout() {},
diff --git a/src/mapStackChips.test.mjs b/src/mapStackChips.test.mjs
index 8ede54da1..7bb2dd6e7 100644
--- a/src/mapStackChips.test.mjs
+++ b/src/mapStackChips.test.mjs
@@ -1,3 +1,4 @@
+import { readStylesheet } from './testSupport/readStylesheet.mjs';
// MAP STACK chip row — the dropdown's replacement control surface.
//
// The owner's complaint was two clicks (open panel → open dropdown) to change
@@ -262,7 +263,7 @@ test('a missing row or document is inert rather than throwing during boot', () =
});
test('the active cyan survives hover', () => {
- const css = readFileSync(new URL('../style.css', import.meta.url), 'utf8');
+ const css = readStylesheet(new URL('../style.css', import.meta.url));
const hover = css.indexOf('.map-stack-chip:hover');
const active = css.indexOf('.map-stack-chip.active {');
const unavailable = css.indexOf('.map-stack-chip.unavailable');
@@ -282,7 +283,7 @@ test('the keyboard focus ring survives on the ACTIVE chip', () => {
// `outline: none` — so a focus state built only from those properties is
// INVISIBLE on the active chip. The ring must live on a property no other
// chip-state rule sets.
- const css = readFileSync(new URL('../style.css', import.meta.url), 'utf8');
+ const css = readStylesheet(new URL('../style.css', import.meta.url));
const stripComments = (text) => text.replace(/\/\*[\s\S]*?\*\//g, '');
const chipRules = [...css.matchAll(/([^{}]*\.map-stack-chip[^{}]*)\{([^{}]*)\}/g)]
.map(([, selector, body], order) => ({
@@ -329,7 +330,7 @@ test('the keyboard focus ring survives on the ACTIVE chip', () => {
test('the Visual Presets tray owns Map Source and the retired left panel is absent', () => {
const html = readFileSync(new URL('../index.html', import.meta.url), 'utf8');
- const ui = readFileSync(new URL('./ui.js', import.meta.url), 'utf8');
+ const ui = readFileSync(new URL('./ui/applicationShell.js', import.meta.url), 'utf8');
assert.doesNotMatch(html, /map-stack-select/, 'the SOURCE dropdown is replaced by the chip row');
assert.match(
diff --git a/src/overlays/worldOverlay.test.mjs b/src/overlays/worldOverlay.test.mjs
index e24f4bda3..dac9abdcb 100644
--- a/src/overlays/worldOverlay.test.mjs
+++ b/src/overlays/worldOverlay.test.mjs
@@ -1,3 +1,4 @@
+import { readStylesheet } from '../testSupport/readStylesheet.mjs';
import test from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
@@ -467,7 +468,7 @@ test('lifecycle is idempotent and teardown removes listeners, observers, and DOM
'the surface is runtime host-owned, not static markup',
);
assert.match(
- readFileSync(new URL('../../style.css', import.meta.url), 'utf8'),
+ readStylesheet(new URL('../../style.css', import.meta.url)),
/#world-overlay-detection-surface,\n#world-overlay-canvas \{\n position: absolute;\n inset: 0;[\s\S]*?pointer-events: none;/,
'both host surfaces share absolute positioning and pointer passthrough',
);
@@ -484,7 +485,7 @@ test('lifecycle is idempotent and teardown removes listeners, observers, and DOM
});
/** The shipped stylesheet, read once — fixtures must stack as production does. */
-const SHIPPED_CSS = readFileSync(new URL('../../style.css', import.meta.url), 'utf8');
+const SHIPPED_CSS = readStylesheet(new URL('../../style.css', import.meta.url));
/**
* Position + z-index the SHIPPED stylesheet gives a selector. Fixtures are built
@@ -551,7 +552,7 @@ test('no ancestor isolates the detection surface, so `screen` reaches the scene'
// builds and evaluates each node against the shipped stylesheet.
const env = installMockEnvironment();
initWorldOverlay(env.viewer);
- const css = readFileSync(new URL('../../style.css', import.meta.url), 'utf8');
+ const css = readStylesheet(new URL('../../style.css', import.meta.url));
const surface = env.document.getElementById('world-overlay-detection-surface');
assert.ok(surface, 'the host owns a detection surface');
diff --git a/src/panelEscape.test.mjs b/src/panelEscape.test.mjs
index cbcd4f591..c63e084f7 100644
--- a/src/panelEscape.test.mjs
+++ b/src/panelEscape.test.mjs
@@ -8,7 +8,7 @@ import assert from 'node:assert/strict';
import fs from 'node:fs';
import test from 'node:test';
-const source = fs.readFileSync(new URL('./ui.js', import.meta.url), 'utf8');
+const source = fs.readFileSync(new URL('./ui/applicationShell.js', import.meta.url), 'utf8');
function method(name, nextName) {
const start = source.indexOf(` ${name}(`);
diff --git a/src/panelStackLayout.test.mjs b/src/panelStackLayout.test.mjs
index f6e2b2644..29fa17599 100644
--- a/src/panelStackLayout.test.mjs
+++ b/src/panelStackLayout.test.mjs
@@ -1,3 +1,4 @@
+import { readStylesheet } from './testSupport/readStylesheet.mjs';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import test from 'node:test';
@@ -135,11 +136,11 @@ test('minimum panel corridor expands upward without crossing the lower obstacle
});
test('desktop panel lanes use per-panel allocations and presentation-only auto-collapse', () => {
- const ui = readFileSync(new URL('./ui.js', import.meta.url), 'utf8');
- const css = readFileSync(new URL('../style.css', import.meta.url), 'utf8');
+ const ui = readFileSync(new URL('./ui/applicationShell.js', import.meta.url), 'utf8');
+ const css = readStylesheet(new URL('../style.css', import.meta.url));
assert.doesNotMatch(ui, /_enforce(?:Left|Right)PanelAccordion/);
assert.match(rails, /classList\.add\('collapsed', 'layout-auto-collapsed'\)/);
- assert.match(ui, /classList\.remove\('collapsed', 'layout-auto-collapsed'\)/);
+ assert.match(readFileSync(new URL('./ui/panelLayoutController.js', import.meta.url), 'utf8'), /classList\.remove\('collapsed', 'layout-auto-collapsed'\)/);
assert.match(ui, /reconsiderAutoCollapse/);
assert.match(
ui,
@@ -150,13 +151,13 @@ test('desktop panel lanes use per-panel allocations and presentation-only auto-c
/_scheduleLeftPanelLayout\(\{[\s\S]*?reconsiderAutoCollapse: this\._leftPanelStack\?\.contains\(panelEl\) === true/,
);
assert.match(rails, /collapseLaterPanels: shouldFocus && hud\.variant === 'tactical'/);
- assert.match(ui, /this\._leftStackPreferredPanelId = leftOwnerPanel\.id;/);
+ assert.match(ui, /this\._panelLayout\._leftStackPreferredPanelId = leftOwnerPanel\.id;/);
assert.match(
leftRail,
/preferredExpandedPanel[\s\S]*?\[\s*preferredExpandedPanel,\s*\.\.\.expandedPanelsInDomOrder/,
'the latest explicitly opened left panel must receive primary allocation',
);
- assert.match(ui, /this\._rightStackPreferredPanelId = rightOwnerPanel\.id;/);
+ assert.match(ui, /this\._panelLayout\._rightStackPreferredPanelId = rightOwnerPanel\.id;/);
assert.match(
rightRail,
/panel\.id === preferredPanelId[\s\S]*?\[\s*preferredExpandedPanel,\s*\.\.\.expandedPanelsInDomOrder/,
@@ -189,7 +190,7 @@ test('desktop panel lanes use per-panel allocations and presentation-only auto-c
});
test('share-panel state excludes responsive collapse and preserves recipient preferences', () => {
- const ui = readFileSync(new URL('./ui.js', import.meta.url), 'utf8');
+ const ui = readFileSync(new URL('./ui/applicationShell.js', import.meta.url), 'utf8');
const sharelink = readFileSync(new URL('./sharelink.js', import.meta.url), 'utf8');
assert.match(
@@ -212,8 +213,8 @@ test('share-panel state excludes responsive collapse and preserves recipient pre
});
test('parameterized Display presets keep one stable scroll owner', () => {
- const ui = readFileSync(new URL('./ui.js', import.meta.url), 'utf8');
- const css = readFileSync(new URL('../style.css', import.meta.url), 'utf8');
+ const ui = readFileSync(new URL('./ui/applicationShell.js', import.meta.url), 'utf8');
+ const css = readStylesheet(new URL('../style.css', import.meta.url));
assert.match(css, /#pp-toggles:not\(\.collapsed\) > #param-slider-panel\.active\s*\{[\s\S]*?flex:\s*0 0 auto;[\s\S]*?max-height:\s*none;[\s\S]*?overflow-y:\s*visible;/);
assert.match(ui, /readDisplayScrollTop: \(\) => this\._displayPortalScrollRestoreOwner === 'standard'[\s\S]*?this\._standardDisplayScrollTop[\s\S]*?this\._ppToggles\?\.scrollTop \|\| 0/);
@@ -234,7 +235,7 @@ test('parameterized Display presets keep one stable scroll owner', () => {
});
test('expanded Display uses its container shell instead of a nested header card', () => {
- const css = readFileSync(new URL('../style.css', import.meta.url), 'utf8');
+ const css = readStylesheet(new URL('../style.css', import.meta.url));
assert.match(
css,
@@ -248,7 +249,7 @@ test('expanded Display uses its container shell instead of a nested header card'
});
test('expanded left panels integrate their headers with the container shell', () => {
- const css = readFileSync(new URL('../style.css', import.meta.url), 'utf8');
+ const css = readStylesheet(new URL('../style.css', import.meta.url));
assert.match(
css,
@@ -262,7 +263,7 @@ test('expanded left panels integrate their headers with the container shell', ()
test('Map Source uses five compact tiles in the bottom Visual Presets tray', () => {
const html = readFileSync(new URL('../index.html', import.meta.url), 'utf8');
- const css = readFileSync(new URL('../style.css', import.meta.url), 'utf8');
+ const css = readStylesheet(new URL('../style.css', import.meta.url));
assert.doesNotMatch(html, /id="stack-panel"/);
assert.match(html, /id="control-panel"[\s\S]*?class="map-source-section"[\s\S]*?id="map-stack-chips"/);
@@ -275,7 +276,7 @@ test('Map Source uses five compact tiles in the bottom Visual Presets tray', ()
test('expanded right panels highlight the title divider without changing collapsed launchers', () => {
const html = readFileSync(new URL('../index.html', import.meta.url), 'utf8');
- const css = readFileSync(new URL('../style.css', import.meta.url), 'utf8');
+ const css = readStylesheet(new URL('../style.css', import.meta.url));
assert.match(
html,
diff --git a/src/radioMarkup.test.mjs b/src/radioMarkup.test.mjs
index 303a54246..42e722520 100644
--- a/src/radioMarkup.test.mjs
+++ b/src/radioMarkup.test.mjs
@@ -1,3 +1,4 @@
+import { readStylesheet } from './testSupport/readStylesheet.mjs';
import { readFileSync as readRadioSource } from 'node:fs';
const radioBindings = readRadioSource(new URL('./ui/radioBindings.js', import.meta.url), 'utf8');
const radioPresentation = readRadioSource(new URL('./ui/radioPresentation.js', import.meta.url), 'utf8');
@@ -8,12 +9,12 @@ import { readFileSync } from 'node:fs';
import test from 'node:test';
const html = readFileSync(new URL('../index.html', import.meta.url), 'utf8');
-const ui = readFileSync(new URL('./ui.js', import.meta.url), 'utf8');
+const ui = readFileSync(new URL('./ui/applicationShell.js', import.meta.url), 'utf8');
const radio = readFileSync(new URL('./data/radio.js', import.meta.url), 'utf8');
const rocketLaunches = readFileSync(new URL('./data/rocketLaunches.js', import.meta.url), 'utf8');
const realtime = readFileSync(new URL('./voice/gevRealtime.js', import.meta.url), 'utf8');
const voice = ['tools', 'instructions'].map(name => readFileSync(new URL(`../server/providers/openai/${name}.js`, import.meta.url), 'utf8')).join('\n');
-const css = readFileSync(new URL('../style.css', import.meta.url), 'utf8');
+const css = readStylesheet(new URL('../style.css', import.meta.url));
/** Parse the Realtime tool array out of the Vite config as real data. */
function realtimeTools() {
@@ -302,7 +303,7 @@ test('panel collapse is presentation-only and Radio exposes explicit voice playb
);
assert.doesNotMatch(disclosureBindings, /setPanelCollapsed\('radio-panel', !/);
assert.match(ui, /setAttribute\('aria-expanded', String\(/);
- assert.match(ui, /\.hidden = !/);
+ assert.match(readFileSync(new URL('./ui/shellFeedback.js', import.meta.url), 'utf8'), /\.hidden = !/);
assert.doesNotMatch(method, /panelId === 'global-context-panel'[\s\S]*?this\._radioState\?\.enabled[\s\S]*?setPanelCollapsed\('radio-panel', false\)/);
});
diff --git a/src/reasonableDefaults.test.mjs b/src/reasonableDefaults.test.mjs
index c8ccff310..fa745c1ca 100644
--- a/src/reasonableDefaults.test.mjs
+++ b/src/reasonableDefaults.test.mjs
@@ -42,7 +42,7 @@ import {
import { ShareLinkManager } from './sharelink.js';
// Follow the UI wiring and its extracted preset definitions.
-const uiSource = fs.readFileSync(new URL('./ui.js', import.meta.url), 'utf8')
+const uiSource = fs.readFileSync(new URL('./ui/applicationShell.js', import.meta.url), 'utf8')
+ '\n' + fs.readFileSync(new URL('./ui/visualPresets.js', import.meta.url), 'utf8');
const indexHtml = fs.readFileSync(new URL('../index.html', import.meta.url), 'utf8');
const shareSource = fs.readFileSync(new URL('./sharelink.js', import.meta.url), 'utf8');
diff --git a/src/rightRailPolicy.test.mjs b/src/rightRailPolicy.test.mjs
index 17d07f04c..2254ea24e 100644
--- a/src/rightRailPolicy.test.mjs
+++ b/src/rightRailPolicy.test.mjs
@@ -1,3 +1,4 @@
+import { readStylesheet } from './testSupport/readStylesheet.mjs';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import test from 'node:test';
@@ -33,7 +34,7 @@ test('other HUD layouts keep collapsed right-rail launchers visible', () => {
test('desktop Display participates in Tactical exclusivity without changing mobile Display behavior', () => {
const ui = readFileSync(new URL('./ui/rightPanelRail.js', import.meta.url), 'utf8');
- const css = readFileSync(new URL('../style.css', import.meta.url), 'utf8');
+ const css = readStylesheet(new URL('../style.css', import.meta.url));
assert.match(ui, /const isMobile = windowRef\.matchMedia\('\(max-width: 720px\)'\)\.matches/);
assert.match(
ui,
diff --git a/src/scenes/director.test.mjs b/src/scenes/director.test.mjs
index e7e35ff38..3f2d0c7f4 100644
--- a/src/scenes/director.test.mjs
+++ b/src/scenes/director.test.mjs
@@ -483,7 +483,7 @@ test('applyVisualState gates the map-stack switch on both sides of its await', (
// another setStack() arrives, and a winning state that omits `mapStack`
// never issues one — every normalized scene shot omits it — so a stale
// switch would otherwise stand on the globe.
- const source = fs.readFileSync(new URL('../ui.js', import.meta.url), 'utf8');
+ const source = fs.readFileSync(new URL('../ui/applicationShell.js', import.meta.url), 'utf8');
const method = source.match(/\n {2}async applyVisualState\([\s\S]*?\n {2}\}\n/);
assert.ok(method, 'applyVisualState is missing from ui.js');
assert.match(method[0], /async applyVisualState\(state = \{\}, \{ isCurrent = null \} = \{\}\)/);
diff --git a/src/sharelink.celestial.test.mjs b/src/sharelink.celestial.test.mjs
index 22f29c23b..0a2a3cefa 100644
--- a/src/sharelink.celestial.test.mjs
+++ b/src/sharelink.celestial.test.mjs
@@ -6,7 +6,7 @@ import fs from 'node:fs';
import { ShareLinkManager, decodeShareCreatedAtMs } from './sharelink.js';
import { createDefaultLayerState } from './data/layerState.js';
-const uiSource = fs.readFileSync(new URL('./ui.js', import.meta.url), 'utf8');
+const uiSource = fs.readFileSync(new URL('./ui/applicationShell.js', import.meta.url), 'utf8');
function sourceBlock(start, end) {
const startIndex = uiSource.indexOf(start);
diff --git a/src/splitFlap.js b/src/splitFlap.js
index c57da5f23..cdd84dfae 100644
--- a/src/splitFlap.js
+++ b/src/splitFlap.js
@@ -519,3 +519,13 @@ export function setSplitFlapText(element, text, options = {}) {
});
return true;
}
+
+/** Stop decoration without replacing the label's permanent accessible text. */
+export function disposeSplitFlap(element) {
+ if (!element) return;
+ clearFlapTimer(element);
+ cancelWidthEase(element);
+ clearSizing(element);
+ const cells = element.querySelector?.('.gev-flap-cells');
+ if (cells) rest(element, { cells });
+}
diff --git a/src/standalone/ui.js b/src/standalone/ui.js
new file mode 100644
index 000000000..56f989a69
--- /dev/null
+++ b/src/standalone/ui.js
@@ -0,0 +1,133 @@
+/** Compose UI controls with the application's existing engines and layer instances. */
+import { StyleManager as ApplicationShell } from '../ui/applicationShell.js';
+import { LocationSearch } from '../ui/location.js';
+import { CITY_POIS, GLOBE_VIEW, flyToGlobeView, flyToPresetLocation, flyToPOI, searchAndFlyTo } from '../locations.js';
+import { interruptCameraMotion } from '../cameraVerbs.js';
+import { IntelHUD } from '../hud.js';
+import { ShareLinkManager } from '../sharelink.js';
+import { OrbitController } from '../orbit.js';
+import {
+ CelestialRing,
+ getKeyholeFadeTuning,
+ isCelestialRingStyleSupported,
+ setKeyholeFadeTuning,
+} from '../celestialRing.js';
+import { destroyTrackedReadout, initTrackedReadout } from '../data/trackedReadout.js';
+import { destroyWorldOverlay, initWorldOverlay } from '../overlays/worldOverlay.js';
+import {
+ destroyDetection,
+ initDetection,
+ cycleMode as cycleDetectionMode,
+ getDetectionDiagnostics as readDetectionDiagnostics,
+ getDetectionTuning,
+ getMode as getDetectionMode,
+ setMode as setDetectionModeByLabel,
+ suspendDetection,
+ resumeDetection,
+ setDetectionStyle,
+ setDetectionTuning,
+} from '../data/detection.js';
+import trafficLayer from '../data/traffic.js';
+import flightsLayer from '../data/flights.js';
+import militaryFlightsLayer from '../data/militaryFlights.js';
+import { isTr3b, toggleTr3b } from '../data/tr3bRegistry.js';
+import satellitesLayer from '../data/satellites.js';
+import cctvLayer from '../data/cctv.js';
+import radioLayer from '../data/radio.js';
+import bikeshareLayer from '../data/bikeshare.js';
+import aisLiveVesselsLayer from '../data/aisLiveVessels.js';
+import militaryAwarenessLayer from '../data/militaryAwareness.js';
+import militaryInstallationsLayer from '../data/militaryInstallations.js';
+import rocketLaunchesLayer from '../data/rocketLaunches.js';
+import {
+ cachedGroundFloor,
+ cachedMeshFloor,
+ GROUND_FLOOR_LIFT_M,
+ meshFloorPreferred,
+ warmGroundFloor,
+} from '../data/groundFloor.js';
+import { sampleMeshFloorCells } from '../data/meshFloorSampler.js';
+import { holdContinuousRender, releaseContinuousRender, governorRequestRender } from '../renderGovernor.js';
+import {
+ setScopeMaskEnabled,
+ isScopeMaskEnabled,
+ setScopeMaskFeather,
+ getScopeMaskFeather,
+ setScopeTerminusOverride,
+ getScopeTerminusOverride,
+ clampScopeTerminusPct,
+} from '../scopeMask.js';
+import {
+ fetchRegionalBrief,
+ regionalDistanceM,
+ weatherCodeLabel,
+} from '../data/regionalBrief.js';
+
+export class StyleManager extends ApplicationShell {
+ constructor(viewer, options = {}) {
+ super(viewer, { ...options, services: {
+ CITY_POIS,
+ GLOBE_VIEW,
+ flyToGlobeView,
+ flyToPresetLocation,
+ flyToPOI,
+ searchAndFlyTo,
+ interruptCameraMotion,
+ IntelHUD,
+ ShareLinkManager,
+ OrbitController,
+ CelestialRing,
+ getKeyholeFadeTuning,
+ isCelestialRingStyleSupported,
+ setKeyholeFadeTuning,
+ destroyTrackedReadout,
+ initTrackedReadout,
+ destroyWorldOverlay,
+ initWorldOverlay,
+ destroyDetection,
+ initDetection,
+ cycleDetectionMode,
+ readDetectionDiagnostics,
+ getDetectionTuning,
+ getDetectionMode,
+ setDetectionModeByLabel,
+ suspendDetection,
+ resumeDetection,
+ setDetectionStyle,
+ setDetectionTuning,
+ trafficLayer,
+ flightsLayer,
+ militaryFlightsLayer,
+ isTr3b,
+ toggleTr3b,
+ satellitesLayer,
+ cctvLayer,
+ radioLayer,
+ bikeshareLayer,
+ aisLiveVesselsLayer,
+ militaryAwarenessLayer,
+ militaryInstallationsLayer,
+ rocketLaunchesLayer,
+ cachedGroundFloor,
+ cachedMeshFloor,
+ GROUND_FLOOR_LIFT_M,
+ meshFloorPreferred,
+ warmGroundFloor,
+ sampleMeshFloorCells,
+ holdContinuousRender,
+ releaseContinuousRender,
+ governorRequestRender,
+ setScopeMaskEnabled,
+ isScopeMaskEnabled,
+ setScopeMaskFeather,
+ getScopeMaskFeather,
+ setScopeTerminusOverride,
+ getScopeTerminusOverride,
+ clampScopeTerminusPct,
+ fetchRegionalBrief,
+ regionalDistanceM,
+ weatherCodeLabel,
+ LocationSearch
+ } });
+ }
+}
diff --git a/src/testSupport/readStylesheet.mjs b/src/testSupport/readStylesheet.mjs
new file mode 100644
index 000000000..d826bb30a
--- /dev/null
+++ b/src/testSupport/readStylesheet.mjs
@@ -0,0 +1,11 @@
+/** Resolve the actual ordered local CSS imports used by the application entry. */
+import { readFileSync } from 'node:fs';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
+export function readStylesheet(file, ancestors = new Set()) {
+ const resolved = path.resolve(file instanceof URL ? fileURLToPath(file) : file);
+ if (ancestors.has(resolved)) throw new Error('Circular stylesheet import');
+ const next = new Set(ancestors).add(resolved);
+ return readFileSync(resolved, 'utf8').replace(/@import ['"]([^'"]+)['"];\s*/g,
+ (_, imported) => readStylesheet(path.resolve(path.dirname(resolved), imported), next));
+}
diff --git a/src/ui.js b/src/ui.js
index caae0a196..ada8689fe 100644
--- a/src/ui.js
+++ b/src/ui.js
@@ -1,5270 +1,2 @@
-import { CockpitViewController, CockpitDisplayPortal } from './ui/cockpit.js';
-import { ContextControls } from './ui/context.js';
-import { CctvControls } from './ui/cctv.js';
-import { RadioControls } from './ui/radio.js';
-import { LocationControls, LocationSearch } from './ui/location.js';
-import { bindClearLayersControl } from './ui/layers.js';
-import { createMapSourceControls } from './ui/mapSource.js';
-import { VisualEffects, STYLES, GLOBAL_POST_DEFAULTS, STYLE_PRESET_DEFAULTS, MILITARY_DETECTION_PRESET } from './ui/effects.js';
-import { bindDisplayControls } from './ui/displayControls.js';
-import { bindApplicationShortcuts, createStyleParameters } from './ui/visualInput.js';
-import { layoutLeftPanelRail, layoutRightPanelRail } from './ui/panelRails.js';
-import { bindPanelDisclosure, collapsePanelOnEscape, createHoverDisclosure } from './ui/panelDisclosure.js';
-import * as Cesium from 'cesium';
-import { BLOOM_SCALE_VERSION, clampBloomIntensity, decodeBloomIntensity } from './bloom.js';
-import { CITY_POIS, GLOBE_VIEW, flyToGlobeView, flyToPresetLocation, flyToPOI, searchAndFlyTo } from './locations.js';
-import { interruptCameraMotion } from './cameraVerbs.js';
-import {
- aircraftTrackingTarget,
- enterCockpitWithTracking,
-} from './cockpitTracking.js';
-import { IntelHUD } from './hud.js';
-import { ShareLinkManager } from './sharelink.js';
-import {
- isExplicitLayerStateOrigin,
- LayerStateCoordinator,
-} from './data/layerState.js';
-import { OrbitController } from './orbit.js';
-import {
- CelestialRing,
- getKeyholeFadeTuning,
- isCelestialRingStyleSupported,
- setKeyholeFadeTuning,
-} from './celestialRing.js';
-import { destroyTrackedReadout, initTrackedReadout } from './data/trackedReadout.js';
-import { destroyWorldOverlay, initWorldOverlay } from './overlays/worldOverlay.js';
-import {
- destroyDetection,
- initDetection,
- cycleMode as cycleDetectionMode,
- getDetectionDiagnostics as readDetectionDiagnostics,
- getDetectionTuning,
- getMode as getDetectionMode,
- setMode as setDetectionModeByLabel,
- suspendDetection,
- resumeDetection,
- setDetectionStyle,
- setDetectionTuning,
-} from './data/detection.js';
-import {
- ALLOCATION_STRATEGIES,
- canonicalizeDensity,
- defaultDensityForProfile,
- normalizeAllocationStrategy,
- normalizeProfile,
- profileForDensity,
-} from './data/detectionPolicy.js';
-import trafficLayer from './data/traffic.js';
-import flightsLayer from './data/flights.js';
-import militaryFlightsLayer from './data/militaryFlights.js';
-import { isTr3b, toggleTr3b } from './data/tr3bRegistry.js';
-import satellitesLayer from './data/satellites.js';
-import cctvLayer from './data/cctv.js';
-import radioLayer from './data/radio.js';
-import bikeshareLayer from './data/bikeshare.js';
-import aisLiveVesselsLayer from './data/aisLiveVessels.js';
-import militaryAwarenessLayer from './data/militaryAwareness.js';
-import militaryInstallationsLayer from './data/militaryInstallations.js';
-import rocketLaunchesLayer from './data/rocketLaunches.js';
-import { aggregateLayerLoading, canPresentDeferredStatusNotice, createGlobalStatusNotice, createLoadingFeedbackState, createTrafficSyncFeedbackState, presentGlobalLoadingStatus, reduceLoadingFeedback, reduceTrafficSyncFeedback } from './loadingFeedback.js';
-import { setSplitFlapText } from './splitFlap.js';
-import { cockpitEntryAllowed } from './contextModePolicy.js';
-
-import { applyCockpitVisionStageIntensities, captureCockpitVisionBaseline, normalizeCockpitVisionMode } from './cockpitVisionPolicy.js';
-import {
- applyContactsDetection,
- shareCacheNeedsHeal,
- shareableDetectionState,
-} from './contactsDetectionPolicy.js';
-import { formatAwarenessLabel } from './data/militaryAwarenessEngine.js';
-import { runCctvLayerEnableTransition } from './cctvFocusPolicy.js';
-import {
- registerCctvFocusRequestListener,
- routeCctvFocusRequest,
-} from './cctvFocusRequest.js';
-import {
- flyToWorldTarget,
- registerWorldFocusRequestListener,
- routeWorldFocusRequest,
-} from './worldFocus.js';
-import {
- beginDeferredNavigation,
- reassertNavigationHandoff,
- registerNavigationAuthorityListener,
- runExplicitNavigation,
- stampInitialShareGesture,
-} from './navigationPolicy.js';
-import {
- cachedGroundFloor,
- cachedMeshFloor,
- GROUND_FLOOR_LIFT_M,
- meshFloorPreferred,
- warmGroundFloor,
-} from './data/groundFloor.js';
-import { sampleMeshFloorCells } from './data/meshFloorSampler.js';
-import { holdContinuousRender, releaseContinuousRender, governorRequestRender } from './renderGovernor.js';
-import {
- setScopeMaskEnabled,
- isScopeMaskEnabled,
- setScopeMaskFeather,
- getScopeMaskFeather,
- setScopeTerminusOverride,
- getScopeTerminusOverride,
- clampScopeTerminusPct,
-} from './scopeMask.js';
-import {
- fetchRegionalBrief,
- regionalDistanceM,
- weatherCodeLabel,
-} from './data/regionalBrief.js';
-
-/** Versioned localStorage namespace prefix to invalidate stale panel layouts. */
-const PANEL_LAYOUT_STORAGE_VERSION = 'v6';
-const SHARE_PANEL_STATE_SPECS = Object.freeze([
- { id: 'control-panel', pinnable: true },
- { id: 'location-bar', pinnable: true },
- { id: 'data-panel' },
- { id: 'cctv-panel' },
- { id: 'radio-panel' },
- { id: 'scene-panel' },
- { id: 'global-context-panel' },
- { id: 'pp-toggles' },
- { id: 'param-slider-panel' },
-]);
-/** Standard map-view panels cleared out of the way on a fresh Cockpit entry. */
-const COCKPIT_ENTRY_COLLAPSE_PANEL_IDS = Object.freeze([
- 'data-panel',
- 'cctv-panel',
- 'scene-panel',
- 'pp-toggles',
- 'global-context-panel',
- 'radio-panel',
-]);
-/**
- * Position keys are versioned separately from collapsed-state keys so layout
- * default changes (e.g. right-rail origin) can reset positions without also
- * resetting every panel's open/closed preference.
- */
-const PANEL_POSITION_STORAGE_VERSION = 'v8';
-const DETECTION_ALLOCATION_STORAGE_KEY = 'gev:detection-allocation:v1';
-/** Z ladder: panels promote within [100, 139]; voice pill 150, toast 200, clean-view-exit 300. */
-const PANEL_Z_BASE = 100;
-const PANEL_Z_MAX = 139;
-
-const COCKPIT_LAYOUT_SETTLE_MS = 240;
-
-/**
- * Fixed UI regions that can occupy the left accordion's vertical lane.
- * Rectangles are filtered at runtime for visibility and horizontal overlap,
- * so right-side/center controls do not reduce the lane unless they actually
- * intersect it at the current viewport size.
- */
-const LEFT_STACK_OBSTACLE_SELECTOR = [
- '#cockpit-hud .cockpit-topline',
- '#cockpit-hud .cockpit-topline > div',
- '#title-bar',
- '#style-indicator',
- '#top-center-actions',
- '#traffic-sync-chip',
- '#cctv-sync-chip',
- '#intel-hud .hud-top-left',
- '#intel-hud .hud-top-right',
- '#intel-hud .hud-bottom-left',
- '#intel-hud .hud-bottom-right',
- '#intel-hud .hud-top-bar',
- '#intel-hud .hud-bottom-bar',
- '#intel-hud .hud-left-edge',
- '#intel-hud .hud-right-edge',
- '#cockpit-context',
- '#cesium-credits .cesium-credit-logoContainer',
- '#cesium-credits .cesium-credit-textContainer',
- '#location-bar',
- '#control-panel',
- '#gev-voice-control',
- '#pp-toggles',
- '#param-slider-panel',
-].join(', ');
-/**
- * Fixed UI regions that can occupy the right control lane. Runtime rectangle
- * filtering keeps the rail clear of whichever HUD variant is currently
- * visible without tying the layout to one screen height.
- */
-const RIGHT_STACK_OBSTACLE_SELECTOR = [
- '#cockpit-hud .cockpit-topline',
- '#cockpit-hud .cockpit-topline > div',
- '#title-bar',
- '#style-indicator',
- '#top-center-actions',
- '#traffic-sync-chip',
- '#cctv-sync-chip',
- '#intel-hud .hud-top-left',
- '#intel-hud .hud-top-right',
- '#intel-hud .hud-bottom-left',
- '#intel-hud .hud-bottom-right',
- '#intel-hud .hud-top-bar',
- '#intel-hud .hud-bottom-bar',
- '#intel-hud .hud-left-edge',
- '#intel-hud .hud-right-edge',
- '#cockpit-context',
- '#cockpit-signal-stream',
- '#cesium-credits .cesium-credit-logoContainer',
- '#cesium-credits .cesium-credit-textContainer',
- '#command-dock',
- '#gev-voice-control',
-].join(', ');
-/** Display labels shown in the mini-status readout for each active style. */
-const STYLE_STATUS_LABELS = {
- normal: 'NORMAL',
- retro: 'CRT',
- surveillance: 'NVG',
- thermal: 'FLIR',
- anime: 'ANIME',
- noir: 'NOIR',
- snow: 'SNOW',
-};
-
-/**
- * Central UI orchestrator for the God's Eye View application.
- *
- * Responsibilities:
- * - Visual controls and presets backed by the VisualEffects controller.
- * - Bloom and sharpen post-processing toggle/intensity control.
- * - Draggable/collapsible panel system with localStorage persistence,
- * z-order stacking, and viewport-clamped positioning.
- * - CCTV panel: camera selection, coverage toggle, projection, calibration
- * sliders, auto-hop, and summary typewriter effect.
- * - Location bar with city/POI preset pills, QWERTY key navigation,
- * geocoding search, and inter-city world-jump transitions.
- * - Orbit controller integration for POI fly-around.
- * - Recording mode with safe-frame overlay and HUD mode switching.
- * - Share link encoding/decoding (delegates to ShareLinkManager).
- * - Detection overlay mode cycling and density tuning.
- * - Toast notification system.
- * - Intel HUD lifecycle and variant switching.
- */
-
-export class StyleManager {
- /**
- * @param {Cesium.Viewer} viewer - The CesiumJS viewer instance.
- * @param {object} [options]
- */
- constructor(viewer, { mapStackController = null, placeSearch } = {}) {
- this.viewer = viewer;
- this.mapStackController = mapStackController;
- this.placeSearch = placeSearch;
- this._visualEffects = new VisualEffects({
- viewer,
- requestRender: governorRequestRender,
- holdRender: holdContinuousRender,
- releaseRender: releaseContinuousRender,
- });
- this.activeStyle = 'normal';
- document.documentElement.dataset.gevStyle = this.activeStyle;
-
- // True once the user manually changes detection (button/key/slider/voice).
- // Gates per-style detection defaults so they never stomp an explicit choice.
- this._detectionUserOverridden = false;
-
- // Bloom/sharpen state
- this._recordingMode = false;
- this._recordingConfig = { hidePanels: true, hudMode: 'minimal', safeFrame: '16:9' };
- this._preRecordingHudState = null;
- this._panelZCounter = PANEL_Z_BASE + 10;
- this._lastLoadingFeedbackUpdateAt = 0;
- this._loadingFeedbackState = createLoadingFeedbackState();
- this._loadingFeedbackEvent = null;
- this._loadingFeedbackTicker = null;
- this._globalStatusNotice = null;
- this._shareTrackingAcquiringKey = null;
- this._shareTrackingNoticeGeneration = 0;
- this._globeResetPromise = null;
- this._dataManager = null;
-
- this._leftStackLayoutFrame = null;
- this._leftStackReconsiderAutoCollapse = false;
- this._leftStackResizeObserver = null;
- this._leftStackMutationObserver = null;
- this._leftStackHudTransitionHandler = null;
- this._leftStackCollapsedHeights = new Map();
- this._leftStackPreferredPanelId = null;
- this._rightPanelStack = document.getElementById('right-context-rail');
- this._rightStackLayoutFrame = null;
- this._rightStackReconsiderAutoCollapse = false;
- this._rightStackResizeObserver = null;
- this._rightStackMutationObserver = null;
- this._rightStackHudTransitionHandler = null;
- this._rightStackPreferredPanelId = null;
- this._adaptivePanelSettleTimer = null;
- this._windowResizeHandler = null;
- this._loadingVisibilityHandler = null;
- this._cctvRequestFocusHandler = null;
- this._removeCctvRequestFocusListener = null;
- this._worldRequestFocusHandler = null;
- this._removeWorldRequestFocusListener = null;
- this._removeNavigationAuthorityListener = null;
- this._navigationOwnerChangedRemover = null;
- this._navigationGeneration = 0;
- this._activeLocationSearchGeneration = null;
- this._initialShareState = null;
- this._initialShareNavigationGeneration = null;
- this._initialShareRestoreTimeout = null;
- this._layerStateCoordinator = null;
- this._layerStateRestorePromise = null;
- this._awarenessSelectedHandler = null;
- this._awarenessClearedHandler = null;
- this._disposed = false;
- this._draggableResizeObserver = null;
-
- // DOM refs
- this._styleIndicator = document.getElementById('active-style-name');
- this._sliderPanel = document.getElementById('param-slider-panel');
- this._sliderContainer = document.getElementById('param-sliders');
- this._ppToggles = document.getElementById('pp-toggles');
- this._bloomBtn = document.getElementById('bloom-toggle');
- this._bloomSliderRow = document.getElementById('bloom-slider-row');
- this._bloomSlider = document.getElementById('bloom-intensity-slider');
- this._bloomSliderValue = document.getElementById('bloom-intensity-value');
- this._sharpenBtn = document.getElementById('sharpen-toggle');
- this._sharpenSliderRow = document.getElementById('sharpen-slider-row');
- this._sharpenSlider = document.getElementById('sharpen-intensity-slider');
- this._sharpenSliderValue = document.getElementById('sharpen-intensity-value');
- this._hudBtn = document.getElementById('hud-toggle');
- this._hudLayoutRow = document.getElementById('hud-layout-row');
- this._hudLayoutSelect = document.getElementById('hud-layout-select');
- this._detectionSliderRow = document.getElementById('detection-slider-row');
- this._detectionDensitySlider = document.getElementById('detection-density-slider');
- this._detectionDensityValue = document.getElementById('detection-density-value');
- this._detectionAllocationRow = document.getElementById('detection-allocation-row');
- this._detectionAllocationBtns = [
- document.getElementById('detection-allocation-elastic'),
- document.getElementById('detection-allocation-weighted'),
- ].filter(Boolean);
- this._detectionFadeRow = document.getElementById('detection-fade-row');
- this._detectionFadeSlider = document.getElementById('detection-fade-slider');
- this._detectionFadeValue = document.getElementById('detection-fade-value');
- this._detectionOpacityRow = document.getElementById('detection-opacity-row');
- this._detectionOpacitySlider = document.getElementById('detection-opacity-slider');
- this._detectionOpacityValue = document.getElementById('detection-opacity-value');
- let storedDetectionAllocation = 'ELASTIC';
- try {
- storedDetectionAllocation = localStorage.getItem(DETECTION_ALLOCATION_STORAGE_KEY) || 'ELASTIC';
- } catch { /* storage can be unavailable in privacy/test contexts */ }
- this._detectionAllocationPreference = normalizeAllocationStrategy(storedDetectionAllocation);
- this._celestialBtn = document.getElementById('celestial-toggle');
- this._scopeBtn = document.getElementById('scope-toggle');
- this._scopeFeatherSlider = document.getElementById('scope-feather-slider');
- this._scopeFeatherValue = document.getElementById('scope-feather-value');
- this._mapStackChips = document.getElementById('map-stack-chips');
- this._mapStackStatus = document.getElementById('map-stack-status');
- this._mapStackChangeHandler = null;
- this._cleanViewBtn = document.getElementById('clean-view-toggle');
- this._cleanViewExitBtn = document.getElementById('clean-view-exit');
- this._dataPanel = document.getElementById('data-panel');
- this._scenePanel = document.getElementById('scene-panel');
- this._cctvPanel = document.getElementById('cctv-panel');
- this._radioPanel = document.getElementById('radio-panel');
- this._contextRadioDock = document.getElementById('context-radio-dock');
- this._contextRadioToggleBtn = document.getElementById('context-radio-toggle-btn');
- this._contextRadioMini = document.getElementById('context-radio-mini');
- this._contextRadioMiniEnableBtn = document.getElementById('context-radio-mini-enable-btn');
- this._contextRadioDetailsBtn = document.getElementById('context-radio-details-btn');
- this._contextRadioMiniCloseBtn = document.getElementById('context-radio-mini-close-btn');
- this._contextRadioMiniStation = document.getElementById('context-radio-mini-station');
- this._contextRadioMiniPrevBtn = document.getElementById('context-radio-mini-prev-btn');
- this._contextRadioMiniPlayBtn = document.getElementById('context-radio-mini-play-btn');
- this._contextRadioMiniNextBtn = document.getElementById('context-radio-mini-next-btn');
- this._contextRadioMiniVolume = document.getElementById('context-radio-mini-volume');
- this._contextRadioMiniVolumeValue = document.getElementById('context-radio-mini-volume-value');
- this._cockpitUtilityControls = document.getElementById('cockpit-utility-controls');
- this._cockpitDisplayToggleBtn = document.getElementById('cockpit-display-toggle-btn');
- this._cockpitDisplayPanel = document.getElementById('cockpit-display-panel');
- this._cockpitDisplayPortal = null;
- this._cockpitDisplayModeHandler = null;
- this._cockpitRadioToggleBtn = document.getElementById('cockpit-radio-toggle-btn');
- this._cockpitRadioPanel = document.getElementById('cockpit-radio-panel');
- this._cockpitRadioEnableBtn = document.getElementById('cockpit-radio-enable-btn');
- this._cockpitRadioStation = document.getElementById('cockpit-radio-station');
- this._cockpitRadioPrevBtn = document.getElementById('cockpit-radio-prev-btn');
- this._cockpitRadioPlayBtn = document.getElementById('cockpit-radio-play-btn');
- this._cockpitRadioNextBtn = document.getElementById('cockpit-radio-next-btn');
- this._cockpitRadioVolume = document.getElementById('cockpit-radio-volume');
- this._cockpitRadioVolumeValue = document.getElementById('cockpit-radio-volume-value');
- this._radioLayerState = document.getElementById('radio-layer-state');
- this._radioEnableBtn = document.getElementById('radio-enable-btn');
- this._radioFilter = document.getElementById('radio-filter');
- this._radioStationName = document.getElementById('radio-station-name');
- this._radioStationMeta = document.getElementById('radio-station-meta');
- this._radioStationTags = document.getElementById('radio-station-tags');
- this._radioTuner = document.getElementById('radio-tuner');
- this._radioTunerSlider = document.getElementById('radio-tuner-slider');
- this._radioTunerNeedle = document.getElementById('radio-tuner-needle');
- this._radioTunerBandLabel = document.getElementById('radio-tuner-band-label');
- this._radioTunerValue = document.getElementById('radio-tuner-value');
- this._radioTunerStation = document.getElementById('radio-tuner-station');
- this._radioPrevBtn = document.getElementById('radio-prev-btn');
- this._radioPlayBtn = document.getElementById('radio-play-btn');
- this._radioNextBtn = document.getElementById('radio-next-btn');
- this._radioStopBtn = document.getElementById('radio-stop-btn');
- this._radioVolume = document.getElementById('radio-volume');
- this._radioVolumeValue = document.getElementById('radio-volume-value');
- this._radioPlaybackState = document.getElementById('radio-playback-state');
- this._radioStationHomepage = document.getElementById('radio-station-homepage');
- this._globalContextFlightsBtn = document.getElementById('global-context-flights-btn');
- this._globalContextMissionsBtn = document.getElementById('global-context-missions-btn');
- this._contextModeStandby = document.getElementById('context-mode-standby');
- this._contextFlightsView = document.getElementById('context-flights-view');
- this._contextMissionsView = document.getElementById('context-missions-view');
- this._installationsSearchBtn = document.getElementById('installations-search-btn');
- this._leftPanelStack = document.getElementById('left-panel-stack');
- this._cctvEnableBtn = document.getElementById('cctv-enable-btn');
- this._cctvNearestBtn = document.getElementById('cctv-nearest-btn');
- this._cctvPrevBtn = document.getElementById('cctv-prev-btn');
- this._cctvNextBtn = document.getElementById('cctv-next-btn');
- this._cctvSelect = document.getElementById('cctv-camera-select');
- this._cctvFocusBtn = document.getElementById('cctv-focus-btn');
- this._cctvCoverageBtn = document.getElementById('cctv-coverage-btn');
- this._cctvAutoHopBtn = document.getElementById('cctv-auto-hop-btn');
- this._cctvProjectionBtn = document.getElementById('cctv-projection-btn');
- this._cctvQualityChip = document.getElementById('cctv-quality-chip');
- this._cctvAdjustBtn = document.getElementById('cctv-adjust-btn');
- this._cctvCalReadout = document.getElementById('cctv-cal-readout');
- this._cctvCalibSaveBtn = document.getElementById('cctv-calib-save-btn');
- this._cctvCalibResetBtn = document.getElementById('cctv-calib-reset-btn');
- this._cctvFrame = document.getElementById('cctv-frame');
- this._cctvFrameWrap = document.getElementById('cctv-frame-wrap');
- this._cctvSourceBadge = document.getElementById('cctv-source-badge');
- this._cctvMeta = document.getElementById('cctv-meta');
- this._cctvSummary = document.getElementById('cctv-summary');
- this._shareBtn = document.getElementById('share-btn');
- this._clearSelectedLayersBtn = document.getElementById('clear-selected-layers');
- this._globalLoadingStatus = document.getElementById('global-loading-status');
- this._globalLoadingLabel = document.getElementById('global-loading-label');
- this._globalLoadingDetail = document.getElementById('global-loading-detail');
- this._resetGlobeBtn = document.getElementById('reset-globe-view');
- this._cockpitResetGlobeBtn = document.getElementById('cockpit-reset-globe');
- this._styleButtons = document.getElementById('style-buttons');
- this._trafficSyncChip = document.getElementById('traffic-sync-chip');
- this._trafficSyncLabel = document.getElementById('traffic-sync-label');
- this._trafficSyncProgress = document.getElementById('traffic-sync-progress');
- this._cctvSyncChip = document.getElementById('cctv-sync-chip');
- this._cctvSyncLabel = document.getElementById('cctv-sync-label');
- this._cctvSyncProgress = document.getElementById('cctv-sync-progress');
- this._toast = document.getElementById('toast');
- this._locationSearch = document.getElementById('location-search');
- this._searchToggle = document.getElementById('search-toggle');
- this._locationPills = document.getElementById('location-pills');
- this._poiRow = document.getElementById('poi-row');
- this._locationBarDivider = document.getElementById('location-bar-divider');
- this._styleMiniValue = document.getElementById('style-mini-value');
- this._locationMiniCity = document.getElementById('location-mini-city');
- this._locationMiniPoi = document.getElementById('location-mini-poi');
- this._safeFrameOverlay = document.getElementById('safe-frame-overlay');
- this._safeFrameBox = document.getElementById('safe-frame-box');
- this._activeLocationId = null;
- this._expandedCityId = null;
- this._activePoiIndex = null;
- this._currentTarget = null; // Cesium.Cartesian3 of current POI target
- this._currentPoi = null; // Current POI data object
- // Formatted address of the last free-text geocode search. Preset pills set
- // _activeLocationId instead; a search has no preset record, so this is the
- // only thing the mini-status can report for it.
- this._searchedLocationLabel = null;
- this._trafficSyncFeedbackState = createTrafficSyncFeedbackState();
- this._trafficTransitionTimer = null;
- this._lastTrafficChipUpdateAt = 0;
-
- // Orbit controller
- this.orbitController = new OrbitController(viewer);
- this._orbitIndicator = null;
-
- // Intel HUD
- this.hud = new IntelHUD(viewer);
- this._cockpitVisionMode = 'optical';
- this._cockpitVisionRestore = null;
- this._cockpitPanelRestore = null;
- // True only while the open Data Layers panel is the reason Cockpit's
- // Contact panel is collapsed. A user-collapsed Contact panel must remain
- // collapsed when Data Layers closes.
- this._cockpitContextCollapsedForDataPanel = false;
- /** Pre-Contacts detection state, restored on deactivation (see _syncContactsDetection). */
- this._contactsDetectionRestore = null;
- this.cockpitView = new CockpitViewController(viewer, {
- services: {
- flightsLayer,
- militaryFlightsLayer,
- isTr3b,
- toggleTr3b,
- militaryAwarenessLayer,
- formatAwarenessLabel,
- cachedGroundFloor,
- cachedMeshFloor,
- GROUND_FLOOR_LIFT_M,
- meshFloorPreferred,
- warmGroundFloor,
- sampleMeshFloorCells,
- holdContinuousRender,
- releaseContinuousRender,
- fetchRegionalBrief,
- regionalDistanceM,
- weatherCodeLabel,
- },
- onVisionChange: (mode, active, options) => this._setCockpitVision(mode, active, options),
- onCameraTakeover: () => this._stampNavigation({ cancelPendingSelection: false }),
- getInheritedVisionLabel: () => (
- STYLE_STATUS_LABELS[this.activeStyle]
- || String(this.activeStyle || 'normal').toUpperCase()
- ),
- isEntryAllowed: () => cockpitEntryAllowed({
- contextMode: this._contextMode,
- contextModeChanging: this._contextModeChanging,
- flightsEnabled: !!this._dataManager?.isEnabled('flights'),
- militaryEnabled: !!this._dataManager?.isEnabled('military'),
- }),
- onEntered: () => {
- // A new Cockpit session owns both side rails. Clear standard map-view
- // panels once on entry; NEXT/PREVIOUS never reaches this callback, so
- // panels the operator opens while already inside remain untouched.
- this._cockpitPanelRestore = new Map();
- this._cockpitContextCollapsedForDataPanel = false;
- for (const panelId of COCKPIT_ENTRY_COLLAPSE_PANEL_IDS) {
- const panel = document.getElementById(panelId);
- if (panel) {
- this._cockpitPanelRestore.set(panelId, panel.classList.contains('collapsed'));
- }
- this.setPanelCollapsed(panelId, true, {
- persist: false,
- syncShare: false,
- });
- }
- this.cockpitView?.setContextCollapsed(false);
- this.cockpitView?.setSignalCollapsed(false, { user: true });
- },
- onExited: () => {
- const restore = this._cockpitPanelRestore;
- this._cockpitPanelRestore = null;
- this._cockpitContextCollapsedForDataPanel = false;
- if (!restore) return;
- for (const [panelId, wasCollapsed] of restore) {
- this.setPanelCollapsed(panelId, wasCollapsed, {
- persist: false,
- syncShare: false,
- });
- }
- },
- restoreTrackingFrame: (entity) => {
- const [layerId, ...idParts] = String(entity?.gevTrackedId || '').split(':');
- const trackedId = idParts.join(':');
- if (!trackedId) return false;
- if (layerId === 'flights') return flightsLayer.refocusTrackedById?.(trackedId) === true;
- if (layerId === 'military') return militaryFlightsLayer.refocusTrackedById?.(trackedId) === true;
- return false;
- },
- });
-
- // Full-globe sun/moon ring. It is a crisp screen-space overlay above the
- // Cesium canvas but below the HUD/detection/readout z ladder.
- this.celestialRing = new CelestialRing(viewer, {
- enabled: false,
- onAutoDisable: () => this.setCelestialRingEnabled(false, {
- syncShare: !!this.shareLinkManager,
- focus: false,
- }),
- });
-
- // Share Link Manager
- this.shareLinkManager = new ShareLinkManager(viewer, {
- onRestore: async (state) => {
- const {
- style,
- bloom,
- sharpen,
- bloomIntensity,
- bloomVersion,
- sharpenIntensity,
- hudVariant,
- hudVisible,
- detectionMode,
- detectionDensity,
- detectionAllocation,
- detectionFadePct,
- detectionOutsideOpacityPct,
- celestialRing,
- scopeEnabled,
- scopeFeatherPct,
- scopeTerminusPct,
- mapStack,
- panelState,
- styleParams,
- } = state || {};
- // Ignore the retired 'ai-edit' style from older share links.
- if (style && style !== 'normal' && style !== 'ai-edit') {
- this.setStyle(style, { applyPreset: true, revealParameters: false, restore: true });
- }
- if (styleParams && style && this.stages[style] && STYLES[style]?.uniforms) {
- for (const [uniformName, uniformValue] of Object.entries(styleParams)) {
- if (!Object.hasOwn(STYLES[style].uniforms, uniformName)) continue;
- this.stages[style].uniforms[uniformName] = uniformValue;
- }
- this._updateSliderPanel(style, { reveal: false });
- }
- if (typeof bloomIntensity === 'number' && this._bloomSlider) {
- const intensity = decodeBloomIntensity(bloomIntensity, bloomVersion);
- this._setBloomIntensity(intensity, { syncShare: false });
- }
- if (typeof sharpenIntensity === 'number' && this._sharpenSlider) {
- const pct = Math.max(0, Math.min(100, Math.round(sharpenIntensity)));
- this._sharpenSlider.value = String(pct);
- this._sharpenSliderValue.textContent = `${pct}%`;
- this._applySharpenIntensity(pct / 100);
- }
- if (typeof bloom === 'boolean') this._setBloomEnabled(bloom);
- if (typeof sharpen === 'boolean') this._setSharpenEnabled(sharpen);
- if (hudVariant) this._setHudVariant(hudVariant);
- if (typeof hudVisible === 'boolean') {
- this.hud.setMode(hudVisible ? 'on' : 'off');
- this._updateHudButtonState();
- }
- if (typeof detectionDensity === 'number' && this._detectionDensitySlider) {
- const pct = canonicalizeDensity(detectionDensity);
- this._detectionDensitySlider.value = String(pct);
- this._detectionDensityValue.textContent = `${pct}%`;
- this._applyDetectionDensityFromUi();
- }
- if (detectionAllocation) {
- this._setDetectionAllocation(detectionAllocation, { syncShare: false, persist: false });
- }
- if (typeof detectionFadePct === 'number' && this._detectionFadeSlider) {
- this._detectionFadeSlider.value = String(detectionFadePct);
- }
- if (typeof detectionOutsideOpacityPct === 'number' && this._detectionOpacitySlider) {
- this._detectionOpacitySlider.value = String(detectionOutsideOpacityPct);
- }
- this._applyDetectionFadeFromUi();
- if (detectionMode) this._setDetectionMode(detectionMode);
- if (typeof celestialRing === 'boolean') {
- this.setCelestialRingEnabled(celestialRing, { syncShare: false, focus: false });
- }
- if (typeof scopeEnabled === 'boolean') {
- setScopeMaskEnabled(scopeEnabled);
- this._scopeBtn?.classList.toggle('active', scopeEnabled);
- this._scopeBtn?.setAttribute('aria-pressed', String(scopeEnabled));
- }
- if (typeof scopeFeatherPct === 'number' && this._scopeFeatherSlider) {
- const pct = Math.max(0, Math.min(100, Math.round(scopeFeatherPct)));
- this._scopeFeatherSlider.value = String(pct);
- if (this._scopeFeatherValue) this._scopeFeatherValue.textContent = `${pct}%`;
- setScopeMaskFeather(pct / 100);
- }
- // null restores the altitude-adaptive ramp; a number pins the terminus
- // (clamped to the supported 94..100 band, same as the `sce` hash key).
- if (scopeTerminusPct === null) setScopeTerminusOverride(null);
- else if (typeof scopeTerminusPct === 'number') {
- const pinned = clampScopeTerminusPct(scopeTerminusPct);
- setScopeTerminusOverride(pinned == null ? null : pinned / 100);
- }
- const mapStackRestore = mapStack
- ? this._setMapStack(mapStack, { syncShare: false })
- : Promise.resolve();
- if (panelState) this._restorePanelState(panelState);
- await mapStackRestore;
- this._syncShareState();
- },
- isNavigationCurrent: (generation) => generation === this._navigationGeneration,
- cancelOwnedNavigation: () => this.viewer.camera.cancelFlight(),
- });
- this.shareLinkManager.setPanelStateProvider(() => this._buildSharePanelState());
- this.shareLinkManager.setStyleParamStateProvider((styleName) => {
- const shader = STYLES[styleName];
- const stage = this.stages[styleName];
- if (!shader?.uniforms || !stage) return null;
- return Object.fromEntries(
- Object.keys(shader.uniforms).map((uniformName) => [uniformName, stage.uniforms[uniformName]]),
- );
- });
- // Parse before panel chrome initializes so every valid share URL starts
- // from deterministic markup defaults instead of recipient-local panel
- // preferences. Encoded panel fields are applied after all panels exist.
- this._initialShareState = this.shareLinkManager.parseInitialHash();
-
- this._detectionBtn = document.getElementById('detection-toggle');
- this._models3dBtn = document.getElementById('models3d-toggle');
- this._models3dModeRow = document.getElementById('models3d-mode-row');
- this._models3dModeBtns = [
- document.getElementById('models3d-mode-proximity'),
- document.getElementById('models3d-mode-all'),
- ];
- // DISPLAY-rail 3D-aircraft toggle (flights layer param). DEFAULT-ON in
- // PROXIMITY (owner directive 2026-08-22) — mirrors the `models3d` default in
- // layerState.js and `_models3dEnabled` in both flight layers, and the `active`
- // class the button carries in index.html. A fresh boot skips layer-state
- // restoration, so these initializers are the only thing keeping the lit
- // button and the armed layer in agreement.
- this._models3dEnabled = true;
- this._models3dMode = 'proximity'; // 'proximity' (nearest in view) | 'all' (every in-view plane)
-
- // The shared world-overlay host must own its one postRender lane before
- // detection and tracked-readout initialize. It stays transparent until a
- // production source explicitly registers entries.
- initWorldOverlay(viewer);
-
- // Initialize detection overlay BEFORE style stages so the composite
- // stage is first in the post-process pipeline
- initDetection(viewer, [trafficLayer, flightsLayer, militaryFlightsLayer, satellitesLayer, cctvLayer, bikeshareLayer, aisLiveVesselsLayer], (modeLabel) => {
- this._updateDetectionButton(modeLabel);
- });
- initTrackedReadout(viewer);
- setDetectionStyle(this.activeStyle);
- this._applyDetectionDensityFromUi();
-
- this._initStages();
- this._initBloomSharpen();
- this._initUI();
- this._initMapStackControl();
- this._initPanelChrome();
- this._initLeftPanelAdaptiveLayout();
- this._initRightPanelAdaptiveLayout();
- this._initRadioPanel();
- this._initCctvPanel();
- this._initGlobalContextPanel();
- this._initLocationBar();
- this._initShareButton();
- this._initClearSelectedLayersButton();
- this._initHUDToggle();
- this._initModels3dToggle();
- this._applyGlobalPostDefaults();
- this._initOrbit();
- this._initRecordingOverlay();
- this._startAnimationLoop();
- this._startTrafficChipTicker();
- this._updateStyleMiniStatus();
- this._updateLocationMiniStatus();
-
- // Restore from URL hash if present
- const savedState = this._initialShareState;
- this._initialShareRestorePromise = savedState
- ? new Promise((resolve) => { this._resolveInitialShareRestore = resolve; })
- : Promise.resolve({ status: 'not-requested', share: null, layers: [] });
- if (savedState) {
- this._hasShareState = true;
- // Reserve camera authority now; the delayed mesh-friendly flight may
- // run only if no newer user, voice, or tracking navigation has won.
- this._initialShareNavigationGeneration = this._beginDeferredNavigation(
- 'shared view',
- { cancelPendingSelection: false },
- );
- this._initialShareRestoreTimeout = setTimeout(() => {
- this._initialShareRestoreTimeout = null;
- if (this._disposed) return;
- const generation = this._initialShareNavigationGeneration;
- const applyCamera = Number.isInteger(generation)
- && this._reassertNavigationHandoff(generation);
- void (async () => {
- try {
- const share = await this.shareLinkManager.applyState(savedState, {
- applyCamera,
- navigationToken: generation,
- });
- const layers = await (this._layerStateRestorePromise || Promise.resolve([]));
- const tracking = share.camera === 'applied'
- ? await this._layerStateCoordinator?.restoreShareTrackingSelection?.()
- : {
- status: 'superseded',
- cleared: this._layerStateCoordinator?.cancelPendingShareTracking?.(
- 'shared-camera-superseded',
- { clearSelection: true },
- ) === true,
- };
- this.shareLinkManager.completeInitialRestore();
- this._settleInitialShareRestore({ status: 'settled', share, layers, tracking });
- } catch (error) {
- this.shareLinkManager.completeInitialRestore();
- this._settleInitialShareRestore({
- status: 'failed',
- error: String(error?.message || error),
- share: null,
- layers: [],
- });
- }
- })();
- }, 1500);
- } else {
- this._syncShareState();
- }
- // A recipient can orbit before or during the delayed share flight. That
- // gesture keeps ordinary layer state but revokes the passive base camera
- // and selected-subject Follow so delayed work cannot seize navigation.
- this._initialShareGestureHandler = () => {
- if (
- this._disposed
- || !this._hasShareState
- || !this._resolveInitialShareRestore
- ) return;
- stampInitialShareGesture((options) => this._stampNavigation(options));
- };
- this.viewer?.canvas?.addEventListener('pointerdown', this._initialShareGestureHandler, {
- passive: true,
- });
- this.viewer?.canvas?.addEventListener('wheel', this._initialShareGestureHandler, {
- passive: true,
- });
-
- // Keep the parameter panel from overlapping toggle controls.
- this._layoutRightPanels();
- this._syncCctvPanelViewport();
- this._windowResizeHandler = () => {
- this._scheduleRightPanelLayout({ reconsiderAutoCollapse: true });
- this._syncCctvPanelViewport();
- this._scheduleLeftPanelLayout({ reconsiderAutoCollapse: true });
- };
- window.addEventListener('resize', this._windowResizeHandler);
- // The loading-chip ticker is stopped while the tab is hidden (it can do no
- // useful work off-screen and must not hold a 60ms timer there). Resample on
- // return so the time-driven reducer catches up on real elapsed time — and
- // re-arms its own ticker if the batch is still running.
- this._loadingVisibilityHandler = () => {
- if (!document.hidden) this._updateGlobalLoadingFeedback();
- };
- document.addEventListener('visibilitychange', this._loadingVisibilityHandler);
- this._cctvRequestFocusHandler = (event) => routeCctvFocusRequest(
- event,
- (activate, focus) => this._runExplicitCctvFocus(activate, focus),
- (cameraId, durationSec) => cctvLayer.focusCamera(cameraId, durationSec),
- );
- this._removeCctvRequestFocusListener = registerCctvFocusRequestListener(
- window,
- this._cctvRequestFocusHandler,
- );
- this._worldRequestFocusHandler = (event) => routeWorldFocusRequest(
- event,
- (detail, fly) => this._runExplicitWorldFocus(detail, fly),
- (detail) => flyToWorldTarget(this.viewer, detail),
- );
- this._removeWorldRequestFocusListener = registerWorldFocusRequestListener(
- window,
- this._worldRequestFocusHandler,
- );
- this._navigationOwnerChangedRemover = viewer.trackedEntityChanged.addEventListener((entity) => {
- if (entity && !this._disposed) this._stampNavigation({ cancelPendingSelection: false });
- });
- // Vessel/installation focus flies without ever assigning a tracked entity,
- // so it cannot reach the listener above. It announces instead.
- this._removeNavigationAuthorityListener = registerNavigationAuthorityListener(
- window,
- (event) => {
- if (this._disposed) return;
- this._stampNavigation({
- cancelPendingSelection: event?.detail?.cancelPendingSelection !== false,
- });
- },
- );
- }
-
- // Compatibility reads for existing controls, scene snapshots and Cockpit.
- get stages() { return this._visualEffects.stages; }
- get transitions() { return this._visualEffects.transitions; }
- get bloomEnabled() { return this._visualEffects.bloomEnabled; }
- get sharpenEnabled() { return this._visualEffects.sharpenEnabled; }
- get _bloomStage() { return this._visualEffects.bloomStage; }
- get _sharpenStage() { return this._visualEffects.sharpenStage; }
-
- /** Advance camera authority and settle any older search UI immediately. */
- _stampNavigation({ cancelPendingSelection = true, clearSearchedLocation = true } = {}) {
- this._navigationGeneration += 1;
- // A newer destination owns the camera, so the last free-text search is no
- // longer where we are. DEFERRED navigation opts out here and clears at the
- // reassert seam instead: a geocode that never resolves moves no camera, and
- // a lookup that fails must not blank a readout that is still true.
- if (clearSearchedLocation) this.clearSearchedLocation();
- if (cancelPendingSelection) {
- if (this._hasShareState && this._resolveInitialShareRestore && !this._layerStateCoordinator) {
- this._initialShareSelectionSuperseded = true;
- }
- const passivelyClearedShareSelection = this._layerStateCoordinator
- ?.cancelPendingShareTracking?.(
- 'superseded-by-explicit-navigation',
- { clearSelection: true },
- ) === true;
- try { flightsLayer.cancelPendingTrackingRestore?.(); } catch { /* best effort */ }
- try { militaryFlightsLayer.cancelPendingTrackingRestore?.(); } catch { /* best effort */ }
- try { satellitesLayer.cancelPendingTrackingRestore?.(); } catch { /* best effort */ }
- // A deliberate destination supersedes share-selected entities that have
- // not arrived yet. Active owners publish their clear when released.
- if (!passivelyClearedShareSelection && !flightsLayer.getTrackedInfo?.()) {
- this._dataManager?.setLayerParams('flights', {
- selectedFlightsTrackingId: null,
- }, { origin: 'tool' });
- }
- if (!passivelyClearedShareSelection && !militaryFlightsLayer.getTrackedInfo?.()) {
- this._dataManager?.setLayerParams('military', {
- selectedMilitaryTrackingId: null,
- }, { origin: 'tool' });
- }
- if (!passivelyClearedShareSelection && !satellitesLayer.getTrackedInfo?.()) {
- this._dataManager?.setLayerParams('satellites', {
- selectedSatTrackingId: null,
- }, { origin: 'tool' });
- }
- }
- if (this._activeLocationSearchGeneration !== null) {
- this._settleLocationSearchUi(this._activeLocationSearchGeneration);
- }
- return this._navigationGeneration;
- }
-
- /** Settle only the search generation that still owns the shared input UI. */
- _settleLocationSearchUi(generation) {
- if (this._activeLocationSearchGeneration !== generation) return;
- this._activeLocationSearchGeneration = null;
- this._locationSearch?.classList.remove('searching', 'expanded');
- if (this._locationSearch) this._locationSearch.value = '';
- this._locationSearch?.blur();
- }
-
- /** Release every follow owner while preserving Contact and vessel selection. */
- _releaseFollowCamera({
- preserveVesselSelection = true,
- preserveCameraFlight = false,
- trackingOrigin = 'tool',
- } = {}) {
- let contactSelected = false;
- try {
- contactSelected = Boolean(
- militaryAwarenessLayer.releaseCameraOwnership?.({
- preserveVesselSelection,
- origin: trackingOrigin,
- }),
- );
- } catch {
- try { flightsLayer.stopTracking?.({ origin: trackingOrigin }); } catch { /* best-effort release */ }
- try { militaryFlightsLayer.stopTracking?.({ origin: trackingOrigin }); } catch { /* best-effort release */ }
- if (!preserveVesselSelection) {
- try { aisLiveVesselsLayer.clearSelection?.(); } catch { /* best-effort release */ }
- }
- }
- try { satellitesLayer.stopTracking?.({ origin: trackingOrigin }); } catch { /* best-effort release */ }
- try { rocketLaunchesLayer.releaseCameraOwnership?.(); } catch { /* best-effort release */ }
- this.viewer.trackedEntity = undefined;
- interruptCameraMotion('explicit-navigation');
- this._stopOrbit();
- if (!preserveCameraFlight) this.viewer.camera.cancelFlight();
- try {
- this.viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
- } catch { /* teardown race */ }
- return contactSelected;
- }
-
- /** Run one immediate destination through the shared ownership policy. */
- _runExplicitNavigation(noun, navigate, releaseOptions = undefined) {
- return runExplicitNavigation({
- disposed: this._disposed,
- cockpitActive: !!this.cockpitView?.active,
- noun,
- showToast: (text) => this._showToast(text),
- stamp: () => this._stampNavigation(),
- release: () => this._releaseFollowCamera(releaseOptions),
- navigate,
- });
- }
-
- /** Accept a delayed lookup without releasing its current camera owner. */
- _beginDeferredNavigation(noun = 'location', { cancelPendingSelection = true } = {}) {
- return beginDeferredNavigation({
- disposed: this._disposed,
- cockpitActive: !!this.cockpitView?.active,
- noun,
- showToast: (text) => this._showToast(text),
- // The searched-location readout survives the STAMP; only a flight that
- // actually starts invalidates it (see the release hook below).
- stamp: () => this._stampNavigation({ cancelPendingSelection, clearSearchedLocation: false }),
- });
- }
-
- /** Final authority check and release immediately before a delayed flight. */
- _reassertNavigationHandoff(generation) {
- return reassertNavigationHandoff({
- generation,
- currentGeneration: this._navigationGeneration,
- cockpitActive: !!this.cockpitView?.active,
- disposed: this._disposed,
- showToast: (text) => this._showToast(text),
- // Reached only once the handoff is granted, immediately before the
- // deferred flight starts — so a lookup that failed, was superseded, or
- // was refused by the cockpit leaves the old readout standing.
- release: () => {
- this.clearSearchedLocation();
- return this._releaseFollowCamera();
- },
- });
- }
-
- /** Public lifecycle seam used by voice location navigation. */
- beginDeferredLocationNavigation() {
- return this._beginDeferredNavigation('location');
- }
-
- /** Public final-authority seam used by voice geocoding. */
- reassertDeferredLocationNavigation(generation) {
- return this._reassertNavigationHandoff(generation);
- }
-
- /** Public immediate route used by voice destinations. */
- runImmediateLocationNavigation(navigate) {
- return this.runImmediateNavigation('location', navigate);
- }
-
- /** Public authority facade used by validated voice camera destinations. */
- runImmediateNavigation(noun, navigate, releaseOptions = undefined) {
- return this._runExplicitNavigation(noun, navigate, releaseOptions);
- }
-
- /** Supersede deferred work when an owner-specific route handles release. */
- supersedeDeferredNavigation() {
- return this._stampNavigation();
- }
-
- /** Route a valid vessel/fire request through the shared navigation policy. */
- _runExplicitWorldFocus(detail, fly) {
- return this._runExplicitNavigation(detail?.kind || 'target', fly);
- }
-
- /** Return the aircraft tracker owned before a multi-step Cockpit transaction. */
- getAircraftTrackingTarget() {
- return aircraftTrackingTarget(this.cockpitView?.readAircraftInfo?.());
- }
-
- /**
- * On window resize, keep the draggable panel on-screen — a panel positioned near an edge can fall
- * outside a now-smaller viewport (audit U2). pp-toggles is right-pinned, so re-pin (horizontal) and
- * clamp its top. No-op until the panel has been positioned (explicit inline top).
- * @returns {void}
- */
- _reclampDraggablePanels() {
- const el = this._ppToggles;
- if (!el || !el.style.top || el.style.top === 'auto') return;
- const top = parseInt(el.style.top, 10);
- if (!Number.isFinite(top)) return;
- el.style.top = `${this._clampToViewport(0, top, el).top}px`;
- this._pinPanelToRight(el);
- }
-
- /**
- * Creates one CesiumJS PostProcessStage per visual style and registers
- * it with the scene. Each stage starts with intensity 0 (invisible)
- * so crossfade transitions can animate it in later.
- * @returns {void}
- */
- _initStages() {
- this._visualEffects.initStyles();
- }
-
- /**
- * Single write path for style-stage intensity: keeps `enabled` in
- * lockstep so zero-intensity stages cost nothing (safe now that the
- * scope is explicit — see _initStages). The stage enables on the same
- * frame the first non-zero intensity lands, so crossfades never pop.
- * @param {Cesium.PostProcessStage} stage - Style post-process stage.
- * @param {number} value - Intensity in [0, 1].
- * @returns {void}
- */
- _setStageIntensity(stage, value) {
- this._visualEffects.setStageIntensity(stage, value);
- }
-
- /**
- * Re-sync every stage's `enabled` flag from its CURRENT intensity.
- *
- * The cockpit-vision policy helpers (src/cockpitVisionPolicy.js) are pure
- * intensity math — they write `uniforms.intensity` directly and know
- * nothing about the enabled/intensity lockstep _setStageIntensity owns.
- * Without this sweep a stage the policy raised to 1 would stay DISABLED
- * and cockpit NVG/FLIR/CRT would render nothing at all. (Inert while the
- * chain is permanently enabled; load-bearing again once the explicit
- * scope frees the zero-intensity stages — see _initStages.)
- * @returns {void}
- */
- _syncStagesEnabledFromIntensity() {
- this._visualEffects.syncStagesEnabledFromIntensity();
- }
-
- /**
- * Contacts-scoped detection (owner playtest 2026-08-18: "when you click on
- * Contacts, detections should just turn on, and they should stay on in
- * Cockpit or in third-person tracking inside Contacts").
- *
- * The scope is the CONTACTS SESSION, not Cockpit. Cockpit enter/exit and
- * third-person tracking are moves WITHIN that session and deliberately do not
- * touch detection — an earlier build hooked this to cockpit enter/exit, which
- * is exactly what turned detections off when the owner left the cockpit.
- *
- * Called from `_syncContextModeButtons`, the single funnel every
- * `_contextMode` mutation routes through, and gated on the transaction having
- * SETTLED (`!_contextModeChanging`) so a failed activation can never strand
- * detection on.
- * @returns {void}
- */
- _syncContactsDetection() {
- if (this._contextModeChanging) return;
- const result = applyContactsDetection({
- active: this._contextMode === 'flights',
- restore: this._contactsDetectionRestore,
- // A map style picked DURING the session owns detection on the way out —
- // its auto-enable preset is younger than the entry snapshot.
- styleOwnsDetection: !this._detectionUserOverridden
- && Boolean(STYLE_PRESET_DEFAULTS[this.activeStyle]?.detection),
- // The snapshot must cover everything activation mutates — the preset
- // writes DENSITY as well as mode, so a mode-only snapshot returned
- // OFF @ 25% as OFF @ 75% and the next manual enable came back Dense.
- getState: () => {
- const state = this.getDetectionState();
- return { mode: state.detectionMode, densityPct: state.densityPct };
- },
- // Owner playtest: the force-on lands on the tactical look the military
- // styles apply — the SAME preset object — not on whatever profile the
- // operator last happened to leave detection at.
- applyPreset: () => this._applyDetectionPreset(MILITARY_DETECTION_PRESET),
- // The preset applier IS the state replayer: same density-then-mode order,
- // same slider writes, so a restore round-trips exactly.
- restoreState: (state) => this._applyDetectionPreset(state),
- });
- const hadOwnership = Boolean(this._contactsDetectionRestore);
- this._contactsDetectionRestore = result.restore;
- // Serialization reads that ownership: while Contacts holds it the link
- // carries the SAVED snapshot, and once released it carries live state. The
- // share cache therefore goes stale on any ownership transition, whether or
- // not the detection engine itself moved — and it does not always move.
- // Exiting while a military style owns detection returns changed:false (the
- // style's preset already matches), and returning early there left a copied
- // link claiming the operator's pre-Contacts values while the map showed
- // Dense @ 75%.
- if (!shareCacheNeedsHeal({
- changed: result.changed,
- hadOwnership,
- hasOwnership: Boolean(result.restore),
- })) return;
- if (result.changed) this._syncDetectionUiFromEngine();
- this._syncShareState();
- }
-
- /** Apply a temporary cockpit-only CRT/NVG/FLIR/NOIR post-process override. */
- _setCockpitVision(mode, active, { revealParameters = false } = {}) {
- const next = active ? normalizeCockpitVisionMode(mode) : 'optical';
- if (!this.stages) return;
- if (!active) {
- if (this._cockpitVisionRestore) {
- for (const [name, intensity] of Object.entries(this._cockpitVisionRestore)) {
- if (this.stages[name]) this._setStageIntensity(this.stages[name], intensity);
- }
- }
- this._cockpitVisionRestore = null;
- this._cockpitVisionMode = 'optical';
- this._syncIrBoost(); // Cockpit exit: fall back to the map preset's IR state
- this._updateSliderPanel(this.activeStyle, { reveal: false });
- this._revealCockpitStyleParameters({ openDisplay: revealParameters });
- return;
- }
- if (!this._cockpitVisionRestore) {
- this._cockpitVisionRestore = captureCockpitVisionBaseline(this.stages, this.transitions);
- }
- if (next === 'optical') {
- applyCockpitVisionStageIntensities(this.stages, next, this._cockpitVisionRestore);
- this._syncStagesEnabledFromIntensity();
- this._cockpitVisionMode = next;
- this._syncIrBoost();
- this._updateSliderPanel(this.activeStyle, { reveal: false });
- this._revealCockpitStyleParameters({ openDisplay: revealParameters });
- return;
- }
- const target = applyCockpitVisionStageIntensities(this.stages, next, this._cockpitVisionRestore);
- this._syncStagesEnabledFromIntensity();
- this._cockpitVisionMode = next;
- this._syncIrBoost(); // Cockpit vision override ('nvg'/'thermal' boost; CRT/NOIR clear)
- this._updateSliderPanel(target || null, { reveal: false });
- this._revealCockpitStyleParameters({ openDisplay: revealParameters });
- }
-
- /** IR hot-target boost (owner playtest 2026-08-16): under the luminance-
- * mapped NVG/FLIR looks the 3D fleets flip to flat white so contacts read
- * HOT instead of vanishing mid-gray; restored when the look exits. The
- * EFFECTIVE look is Cockpit's vision override while Cockpit is active
- * ('nvg'/'thermal', which can differ from the map preset in BOTH
- * directions), otherwise the map preset ('surveillance'/'thermal'). */
- _syncIrBoost() {
- const cockpitMode = this.cockpitView?.active ? this._cockpitVisionMode : null;
- const effective = cockpitMode && cockpitMode !== 'optical' ? cockpitMode : this.activeStyle;
- const irBoost = effective === 'surveillance' || effective === 'thermal' || effective === 'nvg';
- this._dataManager?.setLayerParams('flights', { irBoost });
- this._dataManager?.setLayerParams('military', { irBoost });
- // Fog blends distant geometry toward an effectively-BLACK color in this
- // app (the Cesium globe is hidden), so beyond ~100 km every 3D aircraft
- // fogs to a black silhouette — lighting and shaders can't reach past it
- // (owner cockpit-FLIR field rounds, 2026-08-16). IR sensors see through
- // haze, so the boost styles simply turn fog off; the prior state restores
- // on exit. Transition-guarded so repeated syncs don't clobber the saved value.
- const scene = this.viewer?.scene;
- if (scene?.fog && irBoost !== this._irBoostActive) {
- this._irBoostActive = irBoost;
- if (irBoost) {
- this._irFogWasEnabled = scene.fog.enabled;
- scene.fog.enabled = false;
- } else if (this._irFogWasEnabled != null) {
- scene.fog.enabled = this._irFogWasEnabled;
- this._irFogWasEnabled = null;
- }
- scene.requestRender?.();
- }
- }
-
- /** Keep Cockpit's inherited label and restore target aligned with the active map preset. */
- _syncCockpitInheritedStyle() {
- if (!this.cockpitView?.active || !this.stages) return;
- this._cockpitVisionRestore = Object.fromEntries(
- Object.keys(this.stages).map((name) => [name, name === this.activeStyle ? 1 : 0]),
- );
- for (const name of Object.keys(this.stages)) this.transitions.delete(name);
- this.cockpitView.setVisionMode(this.cockpitView.visionMode);
- }
-
- /** Reveal shared style parameters, optionally opening Cockpit Display first. */
- _revealCockpitStyleParameters({ openDisplay = false } = {}) {
- if (!this.cockpitView?.active || !this._sliderPanel?.classList.contains('active')) return;
- if (openDisplay && this._cockpitDisplayToggleBtn?.getAttribute('aria-expanded') !== 'true') {
- this._setCockpitDisclosure?.('display', true);
- return;
- }
- if (this._cockpitDisplayToggleBtn?.getAttribute('aria-expanded') !== 'true') return;
- this._sliderPanel.classList.remove('collapsed');
- this._syncPanelCollapseButton(this._sliderPanel);
- requestAnimationFrame(() => requestAnimationFrame(() => {
- this._sliderPanel?.scrollIntoView?.({ block: 'nearest' });
- }));
- }
-
- /**
- * Configures Cesium's built-in bloom stage and adds a custom unsharp-mask
- * sharpen stage to the post-process pipeline. Both start disabled.
- * @returns {void}
- */
- _initBloomSharpen() {
- this._visualEffects.initPostProcess(this._sharpenSlider ? parseInt(this._sharpenSlider.value, 10) / 100 : 0.6);
- }
-
- /**
- * Reads the current bloom intensity percentage from the effects controller.
- * @returns {number} Clamped bloom intensity (0-200).
- */
- _getBloomIntensity() {
- return this._visualEffects.bloomIntensity;
- }
-
- /**
- * Enables or disables the Cesium bloom stage based on both the user toggle
- * and whether the computed strength exceeds the perceptual threshold (0.06).
- * @returns {void}
- */
- _syncBloomStageEnabled() {
- this._visualEffects.syncBloomEnabled();
- }
-
- /**
- * Sets the bloom intensity, updates the slider UI, and applies the value.
- * @param {number} intensity - Raw intensity percentage.
- * @param {object} [options]
- * @param {boolean} [options.syncShare=true] - Whether to push state to the share link.
- * @returns {void}
- */
- _setBloomIntensity(intensity, { syncShare = true } = {}) {
- governorRequestRender('bloom');
- const clamped = clampBloomIntensity(intensity);
- if (this._bloomSlider) this._bloomSlider.value = String(clamped);
- if (this._bloomSliderValue) this._bloomSliderValue.textContent = `${clamped}%`;
- this._applyBloomIntensity(clamped);
- if (syncShare) this._syncShareState();
- }
-
- /**
- * Maps a bloom intensity percentage to Cesium bloom stage uniforms.
- * Uses smoothstep easing (Hermite interpolation: 3t^2 - 2t^3) to
- * produce a perceptually linear glow ramp from zero to full strength.
- * @param {number} intensity - Bloom intensity percentage (0-200).
- * @returns {void}
- */
- _applyBloomIntensity(intensity) {
- this._visualEffects.applyBloomIntensity(intensity);
- }
-
- /**
- * Toggles bloom on/off, syncs button state, and reveals/hides the intensity slider row.
- * @param {boolean} enabled - Whether bloom should be active.
- * @returns {void}
- */
- _setBloomEnabled(enabled) {
- governorRequestRender('bloom');
- this._visualEffects.setBloomEnabled(enabled);
- this._syncBloomStageEnabled();
- this._bloomBtn.classList.toggle('active', this.bloomEnabled);
- this._bloomSliderRow.classList.toggle('visible', this.bloomEnabled);
- if (this.bloomEnabled) {
- this._applyBloomIntensity(this._getBloomIntensity());
- }
- this._syncShareState();
- this._layoutRightPanels();
- }
-
- /**
- * Maps a normalized sharpen value (0-1) to the unsharp-mask `amount` uniform.
- * Range: 0.1 (subtle) to 2.1 (aggressive edge enhancement).
- * @param {number} val - Normalized sharpen intensity (0.0 to 1.0).
- * @returns {void}
- */
- _applySharpenIntensity(val) {
- this._visualEffects.applySharpenIntensity(val);
- }
-
- /**
- * Toggles sharpening on/off, syncs button state, and reveals/hides the intensity slider row.
- * @param {boolean} enabled - Whether sharpening should be active.
- * @returns {void}
- */
- _setSharpenEnabled(enabled) {
- governorRequestRender('sharpen');
- this._visualEffects.setSharpenEnabled(enabled);
- this._sharpenBtn.classList.toggle('active', this.sharpenEnabled);
- if (this._sharpenSliderRow) {
- this._sharpenSliderRow.classList.toggle('visible', this.sharpenEnabled);
- }
- if (this.sharpenEnabled && this._sharpenSlider) {
- this._applySharpenIntensity(parseInt(this._sharpenSlider.value, 10) / 100);
- }
- this._syncShareState();
- this._layoutRightPanels();
- }
-
- /**
- * Wires up all primary UI event listeners: style buttons, keyboard shortcuts
- * (1-8 style keys, H/O/V/F/D/C hotkeys, Escape), AI prompt input with
- * debounce, bloom/sharpen/HUD toggles, detection density slider, and
- * clean-view toggle.
- * @returns {void}
- */
- _initUI() {
- this._applicationShortcuts?.destroy();
- this._applicationShortcuts = bindApplicationShortcuts({
- documentRef: document,
- searchInput: this._locationSearch,
- actions: {
- setStyle: (style) => this.setStyle(style),
- dismissSearch: () => {
- if (this._locationSearch.classList.contains('expanded')) {
- this._locationSearch.classList.remove('expanded');
- this._locationSearch.value = '';
- this._locationSearch.blur();
- }
- },
- toggleHud: () => {
- this.shareLinkManager?.claimRestoreLane?.('visual');
- this.hud.toggle();
- this._updateHudButtonState();
- this._syncShareState();
- },
- toggleOrbit: () => this._toggleOrbit(),
- toggleCleanView: () => this.toggleCleanView(),
- toggleLayers: () => document.getElementById('data-panel').classList.toggle('active'),
- cycleDetection: () => {
- this.shareLinkManager?.claimRestoreLane?.('visual');
- this._detectionUserOverridden = true;
- cycleDetectionMode();
- this._syncShareState();
- },
- toggleCctv: () => this._toggleCctvEnabled(),
- },
- });
-
- this._displayControls?.destroy();
- this._displayControls = bindDisplayControls({
- elements: {
- styleButtons: document.querySelectorAll('.style-btn'),
- bloomButton: this._bloomBtn, bloomSlider: this._bloomSlider,
- sharpenButton: this._sharpenBtn, sharpenSlider: this._sharpenSlider,
- scopeButton: this._scopeBtn, scopeFeatherSlider: this._scopeFeatherSlider,
- hudLayout: this._hudLayoutSelect, hudButton: this._hudBtn,
- cleanViewButton: this._cleanViewBtn, cleanViewExitButton: this._cleanViewExitBtn,
- densitySlider: this._detectionDensitySlider, detectionButton: this._detectionBtn,
- allocationButtons: this._detectionAllocationBtns,
- fadeSliders: [this._detectionFadeSlider, this._detectionOpacitySlider],
- celestialButton: this._celestialBtn,
- modelsButton: this._models3dBtn,
- modelModeButtons: this._models3dBtn ? this._models3dModeBtns : [],
- },
- actions: {
- setStyle: (style) => this.setStyle(style),
- toggleBloom: () => {
- this.shareLinkManager?.claimRestoreLane?.('visual');
- this._setBloomEnabled(!this.bloomEnabled);
- },
- setBloomIntensity: (value) => {
- this.shareLinkManager?.claimRestoreLane?.('visual');
- this._setBloomIntensity(value);
- },
- toggleSharpen: () => {
- this.shareLinkManager?.claimRestoreLane?.('visual');
- this._setSharpenEnabled(!this.sharpenEnabled);
- },
- toggleScope: () => {
- this.shareLinkManager?.claimRestoreLane?.('visual');
- const next = !isScopeMaskEnabled();
- setScopeMaskEnabled(next);
- this._scopeBtn.classList.toggle('active', next);
- this._scopeBtn.setAttribute('aria-pressed', String(next));
- this._syncShareState();
- },
- setScopeFeather: (value) => {
- this.shareLinkManager?.claimRestoreLane?.('visual');
- const pct = Math.max(0, Math.min(100, value || 0));
- if (this._scopeFeatherValue) this._scopeFeatherValue.textContent = `${pct}%`;
- setScopeMaskFeather(pct / 100);
- this._syncShareState();
- },
- setSharpenIntensity: (pct) => {
- this.shareLinkManager?.claimRestoreLane?.('visual');
- if (this._sharpenSliderValue) this._sharpenSliderValue.textContent = `${pct}%`;
- this._applySharpenIntensity(pct / 100);
- this._syncShareState();
- },
- setHudLayout: (value) => {
- this.shareLinkManager?.claimRestoreLane?.('visual');
- this._setHudVariant(value);
- },
- toggleCleanView: () => this.toggleCleanView(),
- exitCleanView: () => this.toggleCleanView(false),
- setDensity: (value) => {
- this.shareLinkManager?.claimRestoreLane?.('visual');
- this._detectionUserOverridden = true;
- const pct = canonicalizeDensity(value);
- this._detectionDensitySlider.value = String(pct);
- if (this._detectionDensityValue) this._detectionDensityValue.textContent = `${pct}%`;
- this._applyDetectionDensityFromUi();
- this._syncShareState();
- },
- setAllocation: (value) => {
- this.shareLinkManager?.claimRestoreLane?.('visual');
- this._detectionUserOverridden = true;
- this._setDetectionAllocation(value);
- },
- setFade: () => {
- this.shareLinkManager?.claimRestoreLane?.('visual');
- this._applyDetectionFadeFromUi();
- this._syncShareState();
- },
- toggleCelestial: () => {
- const ringIsVisible = !!this.celestialRing?.visible;
- if (!this.celestialRingEnabled || !ringIsVisible) {
- this.setCelestialRingEnabled(true, { focus: true });
- } else {
- this.setCelestialRingEnabled(false);
- }
- },
- toggleHud: () => {
- this.shareLinkManager?.claimRestoreLane?.('visual');
- this.hud.toggle();
- this._updateHudButtonState();
- this._syncShareState();
- },
- cycleDetection: () => {
- this.shareLinkManager?.claimRestoreLane?.('visual');
- this._detectionUserOverridden = true;
- cycleDetectionMode();
- this._syncShareState();
- },
- toggleModels: () => {
- this._setModels3dEnabled(!this._models3dEnabled);
- this._syncModels3dModeRow();
- },
- setModelsMode: (mode) => this._setModels3dMode(mode),
- },
- });
- }
-
- /**
- * Renders the owner-approved map stack chip row from the matching controller
- * entries. Cesium ion/Bing chips remain keyboard-focusable but unavailable,
- * with an accessible explanation, until a CESIUM_ION_TOKEN is configured.
- * @returns {void}
- */
- _initMapStackControl() {
- if (!this.mapStackController) return;
- this._mapSourceControls?.destroy();
- this._mapSourceControls = createMapSourceControls({
- container: this._mapStackChips,
- statusElement: this._mapStackStatus,
- controller: this.mapStackController,
- subscribe: (onChange) => {
- window.addEventListener('gev:map-stack-changed', onChange);
- return () => window.removeEventListener('gev:map-stack-changed', onChange);
- },
- claimSelection: () => this.shareLinkManager?.claimRestoreLane?.('map'),
- onStateChanged: () => this._syncShareState(),
- onError: (message) => this._showToast(message),
- });
- }
-
- /**
- * Switches the active map/globe source stack.
- * @param {string} stackId - Map stack id.
- * @param {object} [options]
- * @param {boolean} [options.syncShare=true] - Whether to update the share link.
- * @returns {Promise<void>}
- */
- async _setMapStack(stackId, { syncShare = true } = {}) {
- if (!this.mapStackController) return;
- return this._mapSourceControls.select(stackId, { syncShare });
- }
-
- /**
- * Syncs the map stack chip row and status chip with controller state. The
- * lit chip always follows `state.activeId`, never the click — a rejected or
- * superseded switch therefore leaves the genuinely active stack lit.
- * @param {object} state - Map stack controller state.
- * @returns {void}
- */
- _renderMapStackState(state) {
- this._mapSourceControls?.render(state);
- }
-
- /**
- * Reads and canonicalizes the five-stop density control. The engine derives
- * Sparse/Balanced/Dense from the same stop.
- * @returns {void}
- */
- _applyDetectionDensityFromUi() {
- if (!this._detectionDensitySlider) return;
- const pct = canonicalizeDensity(this._detectionDensitySlider.value);
- this._detectionDensitySlider.value = String(pct);
- if (this._detectionDensityValue) this._detectionDensityValue.textContent = `${pct}%`;
- setDetectionTuning({ densityPct: pct });
- this._updateDetectionButton(getDetectionMode());
- }
-
- /** Apply responsive keyhole fade controls from normalized UI percentages. */
- _applyDetectionFadeFromUi() {
- const fadePct = Math.max(0, Math.min(40, Math.round(Number(this._detectionFadeSlider?.value) || 0)));
- const outsideOpacityValue = this._detectionOpacitySlider?.value;
- const outsideOpacityPct = Math.max(
- 0,
- Math.min(100, Math.round(outsideOpacityValue == null ? 3 : Number(outsideOpacityValue) || 0)),
- );
- if (this._detectionFadeSlider) this._detectionFadeSlider.value = String(fadePct);
- if (this._detectionFadeValue) this._detectionFadeValue.textContent = `${fadePct}%`;
- if (this._detectionOpacitySlider) this._detectionOpacitySlider.value = String(outsideOpacityPct);
- if (this._detectionOpacityValue) this._detectionOpacityValue.textContent = `${outsideOpacityPct}%`;
- setKeyholeFadeTuning({
- fadeRatio: fadePct / 100,
- outsideOpacity: outsideOpacityPct / 100,
- });
- this.viewer.scene.requestRender?.();
- }
-
- _setDetectionAllocation(strategy, { syncShare = true, persist = true } = {}) {
- const raw = String(strategy || '').trim().toUpperCase();
- if (!ALLOCATION_STRATEGIES.includes(raw)) return false;
- const normalized = normalizeAllocationStrategy(raw);
- this._detectionAllocationPreference = normalized;
- setDetectionTuning({ allocationStrategy: normalized });
- for (const button of this._detectionAllocationBtns) {
- const active = button.dataset.allocation === normalized;
- button.classList.toggle('active', active);
- button.setAttribute('aria-checked', String(active));
- }
- if (persist) {
- try { localStorage.setItem(DETECTION_ALLOCATION_STORAGE_KEY, normalized); } catch { /* best effort */ }
- }
- if (syncShare) this._syncShareState();
- return true;
- }
-
- _syncDetectionUiFromEngine() {
- const tuning = getDetectionTuning();
- if (this._detectionDensitySlider) this._detectionDensitySlider.value = String(tuning.densityPct);
- if (this._detectionDensityValue) this._detectionDensityValue.textContent = `${tuning.densityPct}%`;
- this._setDetectionAllocation(tuning.allocationStrategy, { syncShare: false, persist: false });
- const fadeTuning = getKeyholeFadeTuning();
- if (this._detectionFadeSlider) this._detectionFadeSlider.value = String(Math.round(fadeTuning.fadeRatio * 100));
- if (this._detectionOpacitySlider) {
- this._detectionOpacitySlider.value = String(Math.round(fadeTuning.outsideOpacity * 100));
- }
- this._applyDetectionFadeFromUi();
- this._updateDetectionButton(getDetectionMode());
- }
-
- /**
- * Activates a detection overlay mode by label (e.g. 'OFF', 'SPARSE', 'PANOPTIC').
- * @param {string} modeLabel - Detection mode label to set.
- * @returns {void}
- */
- _setDetectionMode(modeLabel) {
- if (!modeLabel) return;
- setDetectionModeByLabel(modeLabel);
- this._syncDetectionUiFromEngine();
- this._syncShareState();
- }
-
- /**
- * Switches the HUD layout variant (e.g. 'tactical', 'minimal') and syncs
- * the layout dropdown if present.
- * @param {string} variantName - HUD variant identifier.
- * @returns {void}
- */
- _setHudVariant(variantName) {
- if (!variantName) return;
- this.hud.setVariant(variantName);
- if (this._hudLayoutSelect && this._hudLayoutSelect.value !== this.hud.getVariant()) {
- this._hudLayoutSelect.value = this.hud.getVariant();
- }
- this._syncShareState();
- this._scheduleAdaptivePanelLayout({ settle: true });
- }
-
- /**
- * Keeps both responsive panel lanes and Cockpit's utility strip on the same
- * measured layout commit. HUD visibility transitions can outlive the first
- * animation frame, so variant changes receive one bounded settling pass.
- * @param {{settle?: boolean}} [options] Whether to remeasure after transitions.
- * @returns {void}
- */
- _scheduleAdaptivePanelLayout({ settle = false } = {}) {
- this._scheduleLeftPanelLayout({ reconsiderAutoCollapse: true });
- this._scheduleRightPanelLayout({ reconsiderAutoCollapse: true });
- this.cockpitView?.scheduleContextLayout();
- if (!settle) return;
- clearTimeout(this._adaptivePanelSettleTimer);
- this._adaptivePanelSettleTimer = setTimeout(() => {
- this._adaptivePanelSettleTimer = null;
- this._scheduleLeftPanelLayout({ reconsiderAutoCollapse: true });
- this._scheduleRightPanelLayout({ reconsiderAutoCollapse: true });
- this.cockpitView?.scheduleContextLayout();
- }, COCKPIT_LAYOUT_SETTLE_MS);
- }
-
- /**
- * Applies preset defaults (bloom, sharpen, shader uniforms, HUD variant)
- * when a military-class style (CRT, NVG, FLIR) is selected. Does nothing
- * for styles without entries in STYLE_PRESET_DEFAULTS.
- * @param {string} styleName - The style whose defaults to apply.
- * @returns {void}
- */
- _applyStylePresetDefaults(styleName) {
- const preset = STYLE_PRESET_DEFAULTS[styleName];
- if (!preset) return;
-
- if (preset.styleParams && typeof preset.styleParams === 'object') {
- for (const [targetStyle, params] of Object.entries(preset.styleParams)) {
- const stage = this.stages[targetStyle];
- if (!stage || !params || typeof params !== 'object') continue;
- for (const [uniformName, uniformValue] of Object.entries(params)) {
- if (stage.uniforms[uniformName] === undefined) continue;
- stage.uniforms[uniformName] = uniformValue;
- governorRequestRender('style-param');
- }
- }
- }
-
- const bloomInput = preset.bloom || {};
- if (typeof bloomInput.intensity === 'number' && this._bloomSlider) {
- this._setBloomIntensity(clampBloomIntensity(bloomInput.intensity), { syncShare: false });
- }
- if (typeof bloomInput.enabled === 'boolean') {
- this._setBloomEnabled(bloomInput.enabled);
- }
-
- const sharpenInput = preset.sharpen || {};
- if (typeof sharpenInput.intensity === 'number' && this._sharpenSlider) {
- const sharpenPct = Math.max(0, Math.min(100, Math.round(sharpenInput.intensity)));
- this._sharpenSlider.value = String(sharpenPct);
- this._sharpenSliderValue.textContent = `${sharpenPct}%`;
- this._applySharpenIntensity(sharpenPct / 100);
- }
- if (typeof sharpenInput.enabled === 'boolean') {
- this._setSharpenEnabled(sharpenInput.enabled);
- }
-
- if (preset.hudVariant) {
- this._setHudVariant(preset.hudVariant);
- }
- if (typeof preset.hudVisible === 'boolean') {
- this.hud.setMode(preset.hudVisible ? 'on' : 'off');
- this._updateHudButtonState();
- }
-
- // A style may set a detection default (e.g. military styles -> Dense for
- // the "epic" default view), but ONLY if the user hasn't manually changed
- // detection this session. Detection is user-controlled and persists across
- // style switches, so an explicit Sparse/Off choice is never stomped.
- if (preset.detection && !this._detectionUserOverridden) {
- this._applyDetectionPreset(preset.detection);
- }
- }
-
- /**
- * Apply a detection preset's density and mode through the real UI path.
- *
- * Deliberately does NOT consult `_detectionUserOverridden` — the CALLER owns
- * that decision. The style path checks it (an explicit Sparse/Off must
- * survive a style switch); Cockpit entry does not (owner: detection is on in
- * the cockpit "regardless").
- * @param {{mode?: string, densityPct?: number}} det Preset detection config.
- * @returns {void}
- */
- _applyDetectionPreset(det) {
- if (!det) return;
- if (typeof det.densityPct === 'number' && this._detectionDensitySlider) {
- const pct = canonicalizeDensity(det.densityPct);
- this._detectionDensitySlider.value = String(pct);
- if (this._detectionDensityValue) this._detectionDensityValue.textContent = `${pct}%`;
- this._applyDetectionDensityFromUi();
- }
- if (det.mode) this._setDetectionMode(String(det.mode).toUpperCase());
- }
-
- /**
- * Applies the global post-processing baseline (GLOBAL_POST_DEFAULTS) at
- * startup before any share-link restore runs. Sets bloom, sharpen, HUD,
- * and detection to their factory defaults.
- * @returns {void}
- */
- _applyGlobalPostDefaults() {
- const defaults = GLOBAL_POST_DEFAULTS;
- if (typeof defaults.bloom?.intensity === 'number' && this._bloomSlider) {
- this._setBloomIntensity(clampBloomIntensity(defaults.bloom.intensity), { syncShare: false });
- }
- if (typeof defaults.bloom?.enabled === 'boolean') {
- this._setBloomEnabled(defaults.bloom.enabled);
- }
-
- if (typeof defaults.sharpen?.intensity === 'number' && this._sharpenSlider) {
- const sharpenPct = Math.max(0, Math.min(100, Math.round(defaults.sharpen.intensity)));
- this._sharpenSlider.value = String(sharpenPct);
- this._sharpenSliderValue.textContent = `${sharpenPct}%`;
- this._applySharpenIntensity(sharpenPct / 100);
- }
- if (typeof defaults.sharpen?.enabled === 'boolean') {
- this._setSharpenEnabled(defaults.sharpen.enabled);
- }
-
- if (defaults.hudVariant) {
- this._setHudVariant(defaults.hudVariant);
- }
- if (typeof defaults.hudVisible === 'boolean') {
- this.hud.setMode(defaults.hudVisible ? 'on' : 'off');
- this._updateHudButtonState();
- }
-
- if (defaults.detectionMode) {
- this._setDetectionMode(defaults.detectionMode);
- }
- if (typeof defaults.detectionDensity === 'number' && this._detectionDensitySlider) {
- const density = canonicalizeDensity(defaults.detectionDensity);
- this._detectionDensitySlider.value = String(density);
- this._detectionDensityValue.textContent = `${density}%`;
- this._applyDetectionDensityFromUi();
- }
- this._setDetectionAllocation(
- this._detectionAllocationPreference || defaults.detectionAllocation || 'ELASTIC',
- { syncShare: false, persist: false },
- );
- if (this._detectionFadeSlider) {
- this._detectionFadeSlider.value = String(defaults.detectionFadePct ?? 7);
- }
- if (this._detectionOpacitySlider) {
- this._detectionOpacitySlider.value = String(defaults.detectionOutsideOpacityPct ?? 1);
- }
- this._applyDetectionFadeFromUi();
- if (typeof defaults.celestialRing === 'boolean') {
- this.setCelestialRingEnabled(defaults.celestialRing, { syncShare: false, focus: false });
- }
- }
-
- /**
- * Pushes the current visual state (bloom, sharpen, HUD, detection) to
- * the ShareLinkManager so the URL hash stays in sync.
- * @returns {void}
- */
- /**
- * Detection as a DURABLE preference, for serialization into a share link.
- *
- * While Contacts is active it OWNS detection and forces Dense @ 75%. That is
- * a session-scoped override, not something the operator chose: it is undone
- * verbatim on deactivation. Serializing the forced values shipped a link that
- * pinned Dense @ 75% on the recipient — as a durable preference, with no
- * Contacts mode present to explain or undo it — even though the author's own
- * setting was (say) OFF @ 50%. Publish what deactivation would restore.
- *
- * `_contactsDetectionRestore` is exactly that snapshot and is null whenever
- * Contacts does not own detection, so the live values are used normally.
- */
- _shareableDetectionState() {
- return shareableDetectionState({
- owned: this._contactsDetectionRestore,
- liveMode: getDetectionMode(),
- liveDensityPct: parseInt(this._detectionDensitySlider?.value || '50', 10),
- });
- }
-
- _syncShareState() {
- const detection = this._shareableDetectionState();
- this.shareLinkManager.onToggleChange(this.bloomEnabled, this.sharpenEnabled, {
- bloomIntensity: this._getBloomIntensity(),
- bloomVersion: BLOOM_SCALE_VERSION,
- sharpenIntensity: parseInt(this._sharpenSlider?.value || '49', 10),
- hudVariant: this.hud.getVariant(),
- hudVisible: this.hud.visible,
- detectionMode: detection.mode,
- detectionDensity: detection.densityPct,
- detectionAllocation: getDetectionTuning().allocationStrategy,
- detectionFadePct: parseInt(this._detectionFadeSlider?.value || '7', 10),
- detectionOutsideOpacityPct: parseInt(this._detectionOpacitySlider?.value || '1', 10),
- celestialRingEnabled: this.celestialRingEnabled,
- scopeEnabled: isScopeMaskEnabled(),
- scopeFeatherPct: Math.round(getScopeMaskFeather() * 100),
- // null when adaptive — the share layer omits `sce` entirely in that case.
- scopeTerminusPct: getScopeTerminusOverride() == null
- ? null
- : Math.round(getScopeTerminusOverride() * 100),
- mapStack: this.mapStackController?.getActiveId?.() || 'photoreal',
- });
- }
-
- /**
- * Updates the traffic sync status chip with loading phase label and progress.
- * Auto-hides after 1.5s when loading completes; stays visible while busy.
- * @param {boolean} [forceShow=false] - Force the chip visible regardless of busy state.
- * @returns {void}
- */
- _updateTrafficSyncChip(forceShow = false, now = performance.now()) {
- if (!this._trafficSyncChip || !this._trafficSyncLabel || !this._trafficSyncProgress) return;
- const layers = this._dataManager?.getAll?.();
- const traffic = Array.isArray(layers) ? layers.find((layer) => layer.id === 'traffic') : null;
- this._trafficSyncFeedbackState = reduceTrafficSyncFeedback(
- this._trafficSyncFeedbackState,
- { enabled: traffic?.enabled === true, stats: traffic?.stats || {}, forceShow },
- now,
- );
- const presentation = this._trafficSyncFeedbackState;
- // setSplitFlapText carries the same unchanged-text guard internally, and
- // the flap keeps textContent equal to the settled label throughout, so
- // this stays a no-op on the repeat ticks exactly as it did before.
- if (presentation.label) setSplitFlapText(this._trafficSyncLabel, presentation.label);
- // Written on every change INCLUDING the empty settled value — the reducer
- // clears the progress number once the sync lands, and a truthiness guard
- // here would strand the last "..." beside the settled label.
- if (this._trafficSyncProgress.textContent !== presentation.progressText) {
- this._trafficSyncProgress.textContent = presentation.progressText;
- }
- this._trafficSyncChip.classList.toggle('visible', presentation.visible);
- }
-
- /**
- * Initializes panel collapse buttons and restores persisted collapsed state.
- * Also sets up hover-expand behavior for the style presets and location bar panels.
- * @returns {void}
- */
- _initPanelChrome() {
- for (const control of this._panelDisclosureControls || []) control.destroy();
- this._panelDisclosureControls = [];
- const targets = new Map();
- document.querySelectorAll('.panel-collapse-btn[data-collapse-target]').forEach((button) => {
- const targetId = button.dataset.collapseTarget;
- if (!targetId) return;
- if (!targets.has(targetId)) targets.set(targetId, []);
- targets.get(targetId).push(button);
- });
- for (const [targetId, buttons] of targets) {
- const panel = document.getElementById(targetId);
- if (!panel) continue;
- this._panelDisclosureControls.push(bindPanelDisclosure({
- panel,
- buttons,
- onChange: (collapsed, options) => this.setPanelCollapsed(targetId, collapsed, options),
- onEscape: (event) => this._collapsePanelOnEscape(event, targetId),
- }));
- this._restorePanelCollapsedState(targetId, {
- allowStored: !this._initialShareState,
- });
- }
- // The command dock always starts compact; either wing reveals on hover,
- // focus, or click and collapses again after the interaction moves away.
- this.setPanelCollapsed('control-panel', true, { syncShare: false, persist: false });
- this.setPanelCollapsed('location-bar', true, { syncShare: false, persist: false });
- this._initAutoHoverPanel('control-panel', { openDelayMs: 140, closeDelayMs: 420 });
- this._initAutoHoverPanel('location-bar', { openDelayMs: 140, closeDelayMs: 420 });
- this._initCommandDockPins();
- this._initCommandDockTrayMetrics();
- this._maybeNotifyLayoutReset();
- }
-
- /**
- * Collapses the nearest expanded panel that owns keyboard focus on Escape.
- * Nested panels consume the event first, so one key closes one level and
- * returns focus to that level's disclosure. If Escape was pressed on the
- * disclosure itself, remove focus after closing so the collapsed button does
- * not keep a stale keyboard ring.
- * @param {KeyboardEvent} event - Candidate Escape key event.
- * @param {string} panelId - Collapsible panel containing the listener.
- * @returns {boolean} Whether this panel handled the key.
- */
- _collapsePanelOnEscape(event, panelId) {
- return collapsePanelOnEscape(event, {
- panel: document.getElementById(panelId),
- onChange: (collapsed, options) => this.setPanelCollapsed(panelId, collapsed, options),
- beforeCollapse: () => {
- if (panelId !== 'location-bar' || !this._locationSearch) return;
- this._locationSearch.classList.remove('expanded');
- this._locationSearch.value = '';
- this._locationSearch.blur();
- },
- });
- }
-
- /**
- * Allows either command-dock tray to remain open until explicitly unpinned.
- * Both trays may be pinned; transient and error trays stack above them.
- * @returns {void}
- */
- _initCommandDockPins() {
- document.querySelectorAll('.dock-pin-btn[data-pin-target]').forEach((button) => {
- button.addEventListener('click', (event) => {
- event.stopPropagation();
- const panelId = button.dataset.pinTarget;
- this._setCommandDockPanelPinState(panelId);
- });
- });
- }
-
- _setCommandDockPanelPinState(panelId, pin, {
- restore = false,
- persist = true,
- syncShare = true,
- } = {}) {
- const panelEl = document.getElementById(panelId);
- const button = document.querySelector(`.dock-pin-btn[data-pin-target="${panelId}"]`);
- if (!panelEl || !button) return undefined;
- const shouldPin = typeof pin === 'boolean'
- ? pin
- : !panelEl.classList.contains('dock-pinned');
- panelEl.classList.toggle('dock-pinned', shouldPin);
- button.setAttribute('aria-pressed', String(shouldPin));
- document.querySelectorAll('#command-dock .dock-pinned-top').forEach((pinnedPanel) => {
- pinnedPanel.classList.remove('dock-pinned-top');
- });
- if (shouldPin) {
- panelEl.classList.add('dock-pinned-top');
- this.setPanelCollapsed(panelId, false, {
- explicit: !restore,
- restore,
- persist,
- syncShare: false,
- });
- } else {
- const remainingPinnedPanel = document.querySelector('#command-dock .dock-pinned');
- remainingPinnedPanel?.classList.add('dock-pinned-top');
- if (!restore && !panelEl.matches(':hover')) {
- this.setPanelCollapsed(panelId, true, {
- explicit: true,
- persist,
- syncShare: false,
- });
- }
- }
- this._updateCommandDockTrayStack();
- if (syncShare) {
- if (!restore) this.shareLinkManager?.claimRestoreLane?.('panel', panelId);
- this.shareLinkManager?.onPanelStateChange?.();
- }
- return shouldPin;
- }
-
- /**
- * Tracks the live pinned-tray height so a hovered sibling can stack above it
- * without hardcoded content dimensions.
- * @returns {void}
- */
- _initCommandDockTrayMetrics() {
- const dock = document.getElementById('command-dock');
- if (!dock) return;
- this._commandDockTrayObserver?.disconnect?.();
- if (typeof ResizeObserver === 'function') {
- this._commandDockTrayObserver = new ResizeObserver(() => this._updateCommandDockTrayStack());
- dock.querySelectorAll('.dock-popover-content').forEach((tray) => {
- this._commandDockTrayObserver.observe(tray);
- });
- }
- this._updateCommandDockTrayStack();
- }
-
- /**
- * Writes each pinned tray height and their combined stack height as CSS
- * variables. The most recently pinned tray forms the upper level.
- * @returns {void}
- */
- _updateCommandDockTrayStack() {
- const dock = document.getElementById('command-dock');
- if (!dock) return;
- const locationPanel = dock.querySelector('#location-bar.dock-pinned:not(.collapsed)');
- const presetsPanel = dock.querySelector('#control-panel.dock-pinned:not(.collapsed)');
- const locationHeight = locationPanel?.querySelector('.dock-popover-content')?.getBoundingClientRect().height || 0;
- const presetsHeight = presetsPanel?.querySelector('.dock-popover-content')?.getBoundingClientRect().height || 0;
- const pinnedCount = Number(locationHeight > 0) + Number(presetsHeight > 0);
- const locationHeightPx = Math.ceil(locationHeight);
- const presetsHeightPx = Math.ceil(presetsHeight);
- const topPinnedPanel = dock.querySelector('.dock-pinned-top.dock-pinned:not(.collapsed)');
- const lowerPinnedPanel = topPinnedPanel?.id === 'location-bar' ? presetsPanel : locationPanel;
- const lowerPinnedHeight = lowerPinnedPanel
- ?.querySelector('.dock-popover-content')
- ?.getBoundingClientRect().height || 0;
- const stackHeight = pinnedCount > 1
- ? `calc(${locationHeightPx}px + ${presetsHeightPx}px + 1.2rem)`
- : `${locationHeightPx + presetsHeightPx}px`;
- dock.style.setProperty('--dock-location-pinned-height', `${locationHeightPx}px`);
- dock.style.setProperty('--dock-presets-pinned-height', `${presetsHeightPx}px`);
- dock.style.setProperty('--dock-lower-pinned-height', `${Math.ceil(lowerPinnedHeight)}px`);
- dock.style.setProperty('--dock-pinned-stack-height', stackHeight);
- dock.classList.toggle('dock-has-pinned-tray', pinnedCount > 0);
- dock.classList.toggle('dock-has-two-pinned-trays', pinnedCount > 1);
- }
-
- /**
- * One-time toast when stored v6 panel positions are superseded by the v7
- * layout defaults (positions reset; collapsed states are preserved).
- * @returns {void}
- */
- _maybeNotifyLayoutReset() {
- try {
- const marker = `godsEyeView.${PANEL_POSITION_STORAGE_VERSION}.layoutResetNotified`;
- if (localStorage.getItem(marker)) return;
- localStorage.setItem(marker, '1');
- const hadOldPositions = Object.keys(localStorage)
- .some((key) => key.startsWith('godsEyeView.v6.panelPos.'));
- if (hadOldPositions) {
- this._showToast('Panel layout updated — positions reset to new defaults');
- }
- } catch {
- // storage unavailable
- }
- }
-
- /**
- * Configures intentional hover-expand / leave-collapse behavior on a panel.
- * Uses separate open/close timers to prevent accidental flicker from fast
- * mouse passes. Wheel events cancel pending opens to avoid surprise expansion
- * during scroll-through.
- * @param {string} panelId - DOM id of the panel element.
- * @param {object} [options]
- * @param {number} [options.openDelayMs=850] - Hover dwell time before auto-expanding.
- * @param {number} [options.closeDelayMs=1000] - Delay after pointer leaves before collapsing.
- * @returns {void}
- */
- _initAutoHoverPanel(panelId, { openDelayMs = 850, closeDelayMs = 1000 } = {}) {
- const panel = document.getElementById(panelId);
- if (!panel) return;
- this._hoverPanelControls ??= new Map();
- this._hoverPanelControls.get(panelId)?.destroy();
- const controller = createHoverDisclosure({
- panel,
- documentRef: document,
- disclosure: panel.querySelector(`[data-dock-toggle-target="${panelId}"]`),
- openDelayMs,
- closeDelayMs,
- isActive: () => !this._disposed,
- onChange: (collapsed, options) => this.setPanelCollapsed(panelId, collapsed, options),
- onEscape: (event) => this._collapsePanelOnEscape(event, panelId),
- focusTarget: panelId === 'control-panel' ? () => (
- panel.querySelector('.map-stack-chip.active') || panel.querySelector('.map-stack-chip')
- ) : null,
- });
- this._hoverPanelControls.set(panelId, controller);
- if (panelId === 'control-panel') {
- this._cancelMapSourceFocus?.();
- this._cancelMapSourceFocus = controller.cancelPendingFocus;
- }
- }
-
- /**
- * Sets up drag-to-reposition for legacy floating controls. The right rail
- * and left accordion remain fixed so their HUD alignment is deterministic.
- * @returns {void}
- */
- _initPanelDrag() {
- const dragSpecs = [
- {
- id: 'pp-toggles',
- panel: this._ppToggles,
- handle: this._ppToggles?.querySelector('.panel-drag-handle.compact'),
- },
- ].filter(Boolean);
-
- for (const spec of dragSpecs) {
- if (!spec.panel || !spec.handle) continue;
- this._restorePanelPosition(spec.id, spec.panel);
- this._makePanelDraggable(spec.id, spec.panel, spec.handle);
- }
- // Keep a positioned panel on-screen when its HEIGHT changes after restore — it expands to its
- // full row set a frame or two later, so the restore-time clamp used a stale (shorter) height and
- // the panel could still hang off the bottom (audit U2). Re-clamp on every size change.
- if (this._ppToggles && typeof ResizeObserver !== 'undefined') {
- this._draggableResizeObserver = new ResizeObserver(() => this._reclampDraggablePanels());
- this._draggableResizeObserver.observe(this._ppToggles);
- }
- }
-
- _persistAwarenessSelection(event, cleared = false) {
- if (!this._dataManager) return;
- const origin = String(event?.detail?.origin || 'programmatic');
- if (!isExplicitLayerStateOrigin(origin)) return;
- const layerId = String(event?.detail?.layerId || '');
- const config = {
- flights: {
- key: 'selectedFlightsTrackingId',
- normalize: (value) => String(value ?? '').trim().toLowerCase() || null,
- },
- military: {
- key: 'selectedMilitaryTrackingId',
- normalize: (value) => String(value ?? '').trim().toLowerCase() || null,
- },
- satellites: {
- key: 'selectedSatTrackingId',
- normalize: (value) => {
- const candidate = Number(value);
- return Number.isFinite(candidate) && candidate > 0 ? Math.trunc(candidate) : null;
- },
- },
- }[layerId];
- if (!config) return;
- const selectedValue = cleared ? null : config.normalize(event?.detail?.id);
- if (cleared || selectedValue === null) {
- this._dataManager.adoptLayerParams?.(layerId, {
- [config.key]: selectedValue,
- }, { origin });
- return;
- }
- // A direct selection promotes a Context-owned tracker dependency into
- // durable visibility before its selected ID is normalized. Context exit
- // also keeps this adopted layer instead of tearing down the user's track.
- const visibilityAdopted = this._dataManager.adoptLayerVisibility?.(
- layerId,
- true,
- { origin, adoptedFromSelection: true },
- );
- if (visibilityAdopted === false) return;
- // Clear the prior family before publishing the replacement. Otherwise the
- // coordinator briefly sees two IDs and correctly treats them as an
- // ambiguous incoming state, which would discard the new durable target.
- for (const [otherLayerId, otherKey] of [
- ['flights', 'selectedFlightsTrackingId'],
- ['military', 'selectedMilitaryTrackingId'],
- ['satellites', 'selectedSatTrackingId'],
- ]) {
- if (otherLayerId === layerId) continue;
- this._dataManager.setLayerParams(otherLayerId, { [otherKey]: null }, { origin });
- }
- this._dataManager.adoptLayerParams?.(layerId, {
- [config.key]: selectedValue,
- }, { origin });
- }
-
- /**
- * Connects the layer data manager for traffic sync, CCTV state subscription,
- * and layer enable/disable operations.
- * @param {object|null} dataManager - The DataManager instance, or null to detach.
- * @returns {void}
- */
- attachDataManager(dataManager) {
- this._dataManager = dataManager || null;
- this.hud.attachDataManager(this._dataManager);
- this._updateTrafficSyncChip();
- if (this._dataManagerUnsubscribe) {
- this._dataManagerUnsubscribe();
- this._dataManagerUnsubscribe = null;
- }
- this._contextControls.connect(this._dataManager);
- if (typeof this._dataManager?.subscribe === 'function') {
- this._dataManagerUnsubscribe = this._dataManager.subscribe((change) => {
- this._loadingFeedbackEvent = change;
- this._updateGlobalLoadingFeedback(performance.now());
- });
- }
- this._updateGlobalLoadingFeedback(performance.now());
- this._syncContextModeButtons();
- this._cctvControls.connect();
- this._radioControls.connect();
- if (!this._awarenessSelectedHandler) {
- this._awarenessSelectedHandler = (event) => this._persistAwarenessSelection(event, false);
- this._awarenessClearedHandler = (event) => this._persistAwarenessSelection(event, true);
- window.addEventListener('gev:awareness-subject-selected', this._awarenessSelectedHandler);
- window.addEventListener('gev:awareness-subject-cleared', this._awarenessClearedHandler);
- }
- this._layerStateCoordinator?.destroy();
- this._layerStateCoordinator = null;
- this._layerStateRestorePromise = null;
- if (this._dataManager) {
- this._layerStateCoordinator = new LayerStateCoordinator(
- this._dataManager,
- this.shareLinkManager,
- {
- onDurableStateChange: (state) => this._syncModels3dFromLayerState(state),
- onTrackingRestoreStatus: (result) => this._handleShareTrackingRestoreStatus(result),
- },
- );
- this._layerStateRestorePromise = this._layerStateCoordinator.start({
- shareLayerState: this._initialShareState?.layerState || null,
- shareCreatedAtMs: this._initialShareState?.sharedAtMs ?? null,
- // Any valid camera/style share isolates recipient-local preferences,
- // including legacy and malformed-v2 layer payloads.
- allowLocalState: !this._initialShareState,
- });
- if (this._initialShareSelectionSuperseded) {
- this._layerStateCoordinator.cancelPendingShareTracking(
- 'superseded-before-layer-coordinator-start',
- { clearSelection: true },
- );
- }
- void this._layerStateRestorePromise.then(() => {
- this._syncModels3dFromLayerState(this._layerStateCoordinator?.getDurableState());
- });
- }
- }
-
- _handleShareTrackingRestoreStatus(result) {
- if (!result || this._disposed) return;
- const trackingKey = `${result.layerId || ''}:${result.targetId ?? ''}`;
- if (result.classification === 'pending') {
- this._shareTrackingNoticeGeneration += 1;
- this._shareTrackingAcquiringKey = trackingKey;
- this._showGlobalStatusNotice('ACQUIRING', {
- state: 'acquiring',
- detail: `SHARED ${String(result.label || 'SUBJECT').toUpperCase()}`,
- persistent: true,
- });
- return;
- }
- const ownsAcquiringNotice = this._shareTrackingAcquiringKey === trackingKey;
- if (ownsAcquiringNotice) {
- this._shareTrackingNoticeGeneration += 1;
- this._shareTrackingAcquiringKey = null;
- if (this._globalStatusNotice?.state === 'acquiring') {
- this._globalStatusNotice = null;
- this._updateGlobalLoadingFeedback();
- }
- }
- if (result.classification === 'followed' || result.classification === 'cancelled') return;
- // A stale terminal result must never replace a newer target's acquisition.
- if (this._shareTrackingAcquiringKey) return;
- const noticeGeneration = ownsAcquiringNotice
- ? this._shareTrackingNoticeGeneration
- : ++this._shareTrackingNoticeGeneration;
- const subject = result.label || 'entity';
- const message = result.classification === 'expired'
- ? `Shared ${subject} follow expired`
- : result.classification === 'source-unavailable'
- ? `Shared ${subject} could not be restored — feed unavailable`
- : `Shared ${subject} is unavailable`;
- const showAfterStartupCover = () => {
- requestAnimationFrame(() => {
- if (!canPresentDeferredStatusNotice(
- noticeGeneration,
- this._shareTrackingNoticeGeneration,
- this._disposed,
- )) return;
- const startupCover = document.getElementById('loading-screen');
- if (!startupCover || getComputedStyle(startupCover).visibility === 'hidden') {
- this._showGlobalStatusNotice(message);
- return;
- }
- let fallbackTimer = null;
- const showOnce = () => {
- startupCover.removeEventListener('transitionend', showOnce);
- if (fallbackTimer) clearTimeout(fallbackTimer);
- if (canPresentDeferredStatusNotice(
- noticeGeneration,
- this._shareTrackingNoticeGeneration,
- this._disposed,
- )) this._showGlobalStatusNotice(message);
- };
- startupCover.addEventListener('transitionend', showOnce, { once: true });
- fallbackTimer = setTimeout(showOnce, 1000);
- });
- };
- if (this._resolveInitialShareRestore) {
- void this.initialRestorePromise.then(showAfterStartupCover);
- return;
- }
- showAfterStartupCover();
- }
-
- get _contextMode() { return this._contextControls?._contextMode ?? null; }
- get _contextModeChanging() { return this._contextControls?._contextModeChanging ?? false; }
- get _preservePanelStateDuringLayerClear() { return this._contextControls?._preservePanelStateDuringLayerClear ?? false; }
-
- _initGlobalContextPanel() {
- this._contextControls = new ContextControls({
- elements: {
- _globalContextPanel: document.getElementById('global-context-panel'),
- _globalContextFlightsBtn: this._globalContextFlightsBtn,
- _globalContextMissionsBtn: this._globalContextMissionsBtn,
- _contextModeStandby: this._contextModeStandby,
- _contextFlightsView: this._contextFlightsView,
- _contextMissionsView: this._contextMissionsView,
- _installationsSearchBtn: this._installationsSearchBtn,
- },
- installations: militaryInstallationsLayer,
- actions: {
- getCockpit: () => this.cockpitView,
- refreshRadio: () => this._renderRadioState(radioLayer.getUIState()),
- claimVisualAuthority: () => this.shareLinkManager?.claimRestoreLane?.('visual'),
- syncDetection: () => this._syncContactsDetection(),
- scheduleLayout: () => this._scheduleRightPanelLayout(),
- setPanelCollapsed: (...args) => this.setPanelCollapsed(...args),
- showToast: (message) => { if (!this._disposed) this._showToast(message); },
- setClearBusy: (busy) => { if (!this._disposed) this._clearLayersControl?.setBusy(busy); },
- },
- });
- }
-
- _runUserFacingContextAction(...args) { return this._contextControls?._runUserFacingContextAction(...args); }
-
- _waitForContextLayerSettlement(...args) { return this._contextControls?._waitForContextLayerSettlement(...args); }
-
- _syncContextModeButtons(...args) { return this._contextControls?._syncContextModeButtons(...args); }
-
- /** Wire the independent Radio companion controls. */
- _initRadioPanel() {
- this._radioControls?.destroy();
- this._radioControls = new RadioControls({
- elements: {
- _cockpitDisplayPanel: this._cockpitDisplayPanel,
- _cockpitDisplayToggleBtn: this._cockpitDisplayToggleBtn,
- _cockpitRadioEnableBtn: this._cockpitRadioEnableBtn,
- _cockpitRadioNextBtn: this._cockpitRadioNextBtn,
- _cockpitRadioPanel: this._cockpitRadioPanel,
- _cockpitRadioPlayBtn: this._cockpitRadioPlayBtn,
- _cockpitRadioPrevBtn: this._cockpitRadioPrevBtn,
- _cockpitRadioStation: this._cockpitRadioStation,
- _cockpitRadioToggleBtn: this._cockpitRadioToggleBtn,
- _cockpitRadioVolume: this._cockpitRadioVolume,
- _cockpitRadioVolumeValue: this._cockpitRadioVolumeValue,
- _cockpitUtilityControls: this._cockpitUtilityControls,
- _contextRadioDetailsBtn: this._contextRadioDetailsBtn,
- _contextRadioDock: this._contextRadioDock,
- _contextRadioMini: this._contextRadioMini,
- _contextRadioMiniCloseBtn: this._contextRadioMiniCloseBtn,
- _contextRadioMiniEnableBtn: this._contextRadioMiniEnableBtn,
- _contextRadioMiniNextBtn: this._contextRadioMiniNextBtn,
- _contextRadioMiniPlayBtn: this._contextRadioMiniPlayBtn,
- _contextRadioMiniPrevBtn: this._contextRadioMiniPrevBtn,
- _contextRadioMiniStation: this._contextRadioMiniStation,
- _contextRadioMiniVolume: this._contextRadioMiniVolume,
- _contextRadioMiniVolumeValue: this._contextRadioMiniVolumeValue,
- _contextRadioToggleBtn: this._contextRadioToggleBtn,
- _radioEnableBtn: this._radioEnableBtn,
- _radioFilter: this._radioFilter,
- _radioLayerState: this._radioLayerState,
- _radioNextBtn: this._radioNextBtn,
- _radioPanel: this._radioPanel,
- _radioPlayBtn: this._radioPlayBtn,
- _radioPlaybackState: this._radioPlaybackState,
- _radioPrevBtn: this._radioPrevBtn,
- _radioStationHomepage: this._radioStationHomepage,
- _radioStationMeta: this._radioStationMeta,
- _radioStationName: this._radioStationName,
- _radioStationTags: this._radioStationTags,
- _radioStopBtn: this._radioStopBtn,
- _radioTuner: this._radioTuner,
- _radioTunerBandLabel: this._radioTunerBandLabel,
- _radioTunerNeedle: this._radioTunerNeedle,
- _radioTunerSlider: this._radioTunerSlider,
- _radioTunerStation: this._radioTunerStation,
- _radioTunerValue: this._radioTunerValue,
- _radioVolume: this._radioVolume,
- _radioVolumeValue: this._radioVolumeValue,
- },
- radio: radioLayer,
- canvas: this.viewer?.canvas,
- actions: {
- isRegistered: () => this._dataManager?.layers?.has('radio'),
- isEnabled: () => this._dataManager?.isEnabled('radio'),
- setEnabled: (enabled, options) => this._dataManager.setEnabled('radio', enabled, options),
- setParams: (params, options) => this._dataManager?.setLayerParams('radio', params, options),
- getLifecycle: () => this._dataManager?.getLayerLifecycleState?.('radio'),
- runUserAction: (...args) => this._runUserFacingContextAction(...args),
- setPanelCollapsed: (...args) => this.setPanelCollapsed(...args),
- revealStyleParameters: () => this._revealCockpitStyleParameters(),
- setSignalCollapsed: (value) => this.cockpitView?.setSignalCollapsed(value),
- isCockpitActive: () => this.cockpitView?.active,
- signalUserCollapsed: () => this.cockpitView?.signalUserCollapsed,
- layoutCockpit: () => this.cockpitView?.scheduleContextLayout(),
- preservePanelStateDuringClear: () => this._preservePanelStateDuringLayerClear,
- scheduleLayout: () => this._scheduleRightPanelLayout(),
- },
- });
- }
-
- _setCockpitDisclosure(...args) { return this._radioControls?._setCockpitDisclosure?.(...args); }
-
- _setRadioDisclosure(...args) { return this._radioControls?._setRadioDisclosure?.(...args); }
-
- _syncContextRadioLauncherState(...args) { return this._radioControls?._syncContextRadioLauncherState?.(...args); }
-
- _renderRadioState(...args) { return this._radioControls?._renderRadioState?.(...args); }
-
- /**
- * Activates an explicit CCTV target, then releases tracking before its camera
- * flight. Cockpit mode keeps tracking and suppresses only the flight.
- * @param {Function} activate CCTV target activation returning its camera ID.
- * @param {Function} focus CCTV camera flight receiving the activated ID.
- * @returns {*} Focus operation result.
- */
- _runExplicitCctvFocus(activate, focus) {
- if (this._disposed) return false;
- const cameraId = activate();
- if (!cameraId) return false;
- return this._runExplicitNavigation('camera', () => focus(cameraId));
- }
-
- /** Compose camera panel controls from the existing camera port and application actions. */
- _initCctvPanel() {
- this._cctvControls?.destroy();
- this._cctvControls = new CctvControls({
- elements: {
- _cctvAdjustBtn: this._cctvAdjustBtn,
- _cctvAutoHopBtn: this._cctvAutoHopBtn,
- _cctvCalReadout: this._cctvCalReadout,
- _cctvCalibResetBtn: this._cctvCalibResetBtn,
- _cctvCalibSaveBtn: this._cctvCalibSaveBtn,
- _cctvCoverageBtn: this._cctvCoverageBtn,
- _cctvEnableBtn: this._cctvEnableBtn,
- _cctvFocusBtn: this._cctvFocusBtn,
- _cctvFrame: this._cctvFrame,
- _cctvFrameWrap: this._cctvFrameWrap,
- _cctvMeta: this._cctvMeta,
- _cctvNearestBtn: this._cctvNearestBtn,
- _cctvNextBtn: this._cctvNextBtn,
- _cctvPanel: this._cctvPanel,
- _cctvPrevBtn: this._cctvPrevBtn,
- _cctvProjectionBtn: this._cctvProjectionBtn,
- _cctvQualityChip: this._cctvQualityChip,
- _cctvSelect: this._cctvSelect,
- _cctvSourceBadge: this._cctvSourceBadge,
- _cctvSummary: this._cctvSummary,
- _cctvSyncChip: this._cctvSyncChip,
- _cctvSyncLabel: this._cctvSyncLabel,
- _cctvSyncProgress: this._cctvSyncProgress,
- },
- cctv: cctvLayer,
- actions: {
- isEnabled: () => this._dataManager?.isEnabled('cctv'),
- setParams: (params, options) => this._dataManager?.setLayerParams('cctv', params, options),
- toggleEnabled: (...args) => this._toggleCctvEnabled(...args),
- runExplicitFocus: (...args) => this._runExplicitCctvFocus(...args),
- setPanelCollapsed: (...args) => this.setPanelCollapsed(...args),
- showToast: (message) => this._showToast(message),
- syncViewport: () => this._syncCctvPanelViewport(),
- setSplitFlapText,
- },
- });
- }
-
- /**
- * Toggles the CCTV layer enabled state. When enabling and no camera is active,
- * auto-focuses on the nearest camera.
- * @param {boolean} [forceState] - Explicit on/off. Omit to toggle.
- * @returns {Promise<boolean>} True if the layer is now in the requested state.
- */
- async _toggleCctvEnabled(forceState) {
- if (this._disposed) return false;
- if (!this._dataManager || !this._dataManager.layers?.has('cctv')) {
- this._showToast('CCTV layer unavailable');
- return false;
- }
- const enabled = this._dataManager.isEnabled('cctv');
- const target = typeof forceState === 'boolean' ? forceState : !enabled;
- if (target === enabled) return true;
- await runCctvLayerEnableTransition({
- target,
- setEnabled: (next) => this._dataManager.setEnabled('cctv', next, { origin: 'user' }),
- readOwnership: () => ({
- trackedEntity: this.viewer?.trackedEntity,
- cockpitActive: !!this.cockpitView?.active,
- }),
- shouldFocus: () => !this._disposed && this._dataManager.isEnabled('cctv')
- && !this._cctvControls?.getState()?.activeCameraId,
- activate: () => cctvLayer.focusNearest({ focus: false }),
- fly: (cameraId) => this._runExplicitCctvFocus(
- () => cameraId,
- (selectedId) => cctvLayer.focusCamera(selectedId, 1.6),
- ),
- });
- return true;
- }
-
- /**
- * Returns the versioned localStorage key for a panel's saved position.
- * @param {string} panelId - DOM id of the panel.
- * @returns {string} localStorage key.
- */
- _panelStorageKey(panelId) {
- return `godsEyeView.${PANEL_POSITION_STORAGE_VERSION}.panelPos.${panelId}`;
- }
-
- /**
- * Returns the versioned localStorage key for a panel's collapsed state.
- * @param {string} panelId - DOM id of the panel.
- * @returns {string} localStorage key.
- */
- _panelCollapseStorageKey(panelId) {
- return `godsEyeView.${PANEL_LAYOUT_STORAGE_VERSION}.panelCollapsed.${panelId}`;
- }
-
- /**
- * Restores a panel's collapsed/expanded state from localStorage.
- * Falls back to the CSS class default if no saved state exists.
- * @param {string} panelId - DOM id of the panel.
- * @returns {void}
- */
- _restorePanelCollapsedState(panelId, { allowStored = true } = {}) {
- const panelEl = document.getElementById(panelId);
- if (!panelEl) return;
- let collapsed = panelEl.classList.contains('collapsed');
- let stored = null;
- if (allowStored) {
- try {
- stored = localStorage.getItem(this._panelCollapseStorageKey(panelId));
- if (stored === '1') collapsed = true;
- if (stored === '0') collapsed = false;
- } catch {
- // storage unavailable
- }
- }
- // DISPLAY starts COLLAPSED for a first-time visitor, then respects the
- // user's persisted choice like every other panel.
- //
- // It used to start expanded, to advertise the HUD / DETECT / 3D toggles.
- // That reason expired when those became ON by default: the rail now opens
- // to offer controls for things already happening, while competing with the
- // first-run mission card for the one first impression there is. A stored
- // choice still wins in both directions, so anyone who opens it keeps it.
- if (panelId === 'pp-toggles' && stored === null) collapsed = true;
- panelEl.classList.toggle('collapsed', collapsed);
- this._syncPanelCollapseButton(panelEl);
- }
-
- /**
- * Persists a panel's collapsed state ('1' or '0') to localStorage.
- * @param {string} panelId - DOM id of the panel.
- * @param {boolean} collapsed - Whether the panel is collapsed.
- * @returns {void}
- */
- _savePanelCollapsedState(panelId, collapsed) {
- try {
- localStorage.setItem(this._panelCollapseStorageKey(panelId), collapsed ? '1' : '0');
- } catch {
- // storage unavailable
- }
- }
-
- /**
- * Builds one fixed right-side rail from Display, CCTV, its parameter
- * controls, and Global Context (which owns the nested Radio companion).
- * The rail then measures the live HUD chrome at runtime so it can stay
- * aligned and within the available vertical corridor.
- * @returns {void}
- */
- _initRightPanelAdaptiveLayout() {
- const stack = this._rightPanelStack;
- if (!stack || !this._ppToggles) return;
-
- this._ppToggles.style.removeProperty('top');
- this._ppToggles.style.removeProperty('right');
- this._ppToggles.style.removeProperty('bottom');
- this._ppToggles.style.removeProperty('left');
- this._ppToggles.style.removeProperty('z-index');
- this._ppToggles.classList.remove('panel-draggable', 'panel-dragging');
- this._ppToggles.querySelector('.pp-header-row')?.removeAttribute('title');
- stack.prepend(this._ppToggles);
- const globalContextPanel = document.getElementById('global-context-panel');
- if (this._cctvPanel) {
- this._cctvPanel.style.removeProperty('top');
- this._cctvPanel.style.removeProperty('right');
- this._cctvPanel.style.removeProperty('bottom');
- this._cctvPanel.style.removeProperty('left');
- this._cctvPanel.style.removeProperty('z-index');
- this._cctvPanel.classList.remove('panel-draggable', 'panel-dragging');
- stack.insertBefore(this._cctvPanel, globalContextPanel);
- this._syncPanelCollapseButton(this._cctvPanel);
- }
- if (this._sliderPanel) {
- this._sliderPanel.style.removeProperty('top');
- this._sliderPanel.style.removeProperty('right');
- this._sliderPanel.style.removeProperty('bottom');
- this._sliderPanel.style.removeProperty('left');
- this._sliderPanel.style.removeProperty('max-height');
- const detectionGroup = this._detectionBtn?.closest('.pp-toggle-group');
- if (detectionGroup) detectionGroup.after(this._sliderPanel);
- else this._ppToggles.append(this._sliderPanel);
- }
- if (typeof ResizeObserver !== 'undefined') {
- this._rightStackResizeObserver = new ResizeObserver(() => {
- this._scheduleRightPanelLayout();
- });
- this._rightStackResizeObserver.observe(stack);
- for (const panel of [this._ppToggles, this._cctvPanel, globalContextPanel]) {
- if (panel) this._rightStackResizeObserver.observe(panel);
- }
- document.querySelectorAll(RIGHT_STACK_OBSTACLE_SELECTOR).forEach((element) => {
- this._rightStackResizeObserver.observe(element);
- });
- }
-
- if (typeof MutationObserver !== 'undefined') {
- this._rightStackMutationObserver = new MutationObserver(() => {
- this._scheduleRightPanelLayout();
- });
- this._rightStackMutationObserver.observe(stack, {
- subtree: true,
- childList: true,
- characterData: true,
- attributes: true,
- attributeFilter: ['class', 'hidden', 'data-variant'],
- });
- const hud = document.getElementById('intel-hud');
- if (hud) {
- this._rightStackMutationObserver.observe(hud, {
- subtree: true,
- attributes: true,
- attributeFilter: ['class', 'hidden', 'data-variant'],
- });
- }
- }
-
- const transitionHud = document.getElementById('intel-hud');
- if (transitionHud) {
- this._rightStackHudTransitionHandler = (event) => {
- if (event.propertyName === 'opacity' || event.propertyName === 'visibility') {
- this._scheduleRightPanelLayout({ reconsiderAutoCollapse: true });
- }
- };
- transitionHud.addEventListener('transitionend', this._rightStackHudTransitionHandler);
- }
-
- this._scheduleRightPanelLayout();
- }
-
- _scheduleRightPanelLayout({ reconsiderAutoCollapse = false } = {}) {
- if (reconsiderAutoCollapse) this._rightStackReconsiderAutoCollapse = true;
- if (!this._rightPanelStack || this._rightStackLayoutFrame !== null) return;
- this._rightStackLayoutFrame = requestAnimationFrame(() => {
- this._rightStackLayoutFrame = null;
- if (this._rightStackReconsiderAutoCollapse) {
- this._rightStackReconsiderAutoCollapse = false;
- for (const panel of this._rightPanelStack.querySelectorAll('.layout-auto-collapsed')) {
- panel.classList.remove('collapsed', 'layout-auto-collapsed');
- this._syncPanelCollapseButton(panel);
- }
- }
- this._syncRightPanelAdaptiveLayout();
- });
- }
-
- /**
- * Places the right rail inside the visible HUD-safe corridor. When the
- * corridor is too short, the expanded panel receives the remaining height
- * with internal scrolling. Tactical HUD hides collapsed sibling launchers
- * while a panel is expanded; other HUD layouts keep them visible.
- * @returns {void}
- */
- _syncRightPanelAdaptiveLayout() {
- layoutRightPanelRail({
- stack: this._rightPanelStack,
- obstacles: document.querySelectorAll(RIGHT_STACK_OBSTACLE_SELECTOR),
- windowRef: window,
- hud: { visible: this.hud.visible, variant: this.hud.getVariant() },
- preferredPanelId: this._rightStackPreferredPanelId,
- onCollapse: (panel) => this._syncPanelCollapseButton(panel),
- onRetry: () => this._scheduleRightPanelLayout(),
- leftStack: this._leftPanelStack,
- displayPanel: this._ppToggles,
- readDisplayScrollTop: () => this._displayPortalScrollRestoreOwner === 'standard'
- ? this._standardDisplayScrollTop
- : (this._ppToggles?.scrollTop || 0),
- });
- }
-
- /**
- * Initializes the adaptive left accordion. The layout engine measures the
- * actual HUD/chrome rectangles that intersect the left lane, then decides
- * whether collapsed sibling labels can remain visible beside the expanded
- * panel. No decision is keyed to a specific panel or HUD variant.
- * @returns {void}
- */
- _initLeftPanelAdaptiveLayout() {
- const stack = this._leftPanelStack;
- if (!stack) return;
-
- if (typeof ResizeObserver !== 'undefined') {
- this._leftStackResizeObserver = new ResizeObserver(() => {
- this._scheduleLeftPanelLayout();
- });
- this._leftStackResizeObserver.observe(stack);
- stack.querySelectorAll(':scope > [data-panel-id]').forEach((panel) => {
- this._leftStackResizeObserver.observe(panel);
- const inner = [...panel.children].find((child) => !child.classList.contains('panel-glow'));
- if (inner) this._leftStackResizeObserver.observe(inner);
- });
- document.querySelectorAll(LEFT_STACK_OBSTACLE_SELECTOR).forEach((element) => {
- this._leftStackResizeObserver.observe(element);
- });
- }
-
- if (typeof MutationObserver !== 'undefined') {
- this._leftStackMutationObserver = new MutationObserver(() => {
- this._scheduleLeftPanelLayout();
- });
- this._leftStackMutationObserver.observe(stack, {
- subtree: true,
- childList: true,
- characterData: true,
- attributes: true,
- attributeFilter: ['class'],
- });
- const hud = document.getElementById('intel-hud');
- if (hud) {
- this._leftStackMutationObserver.observe(hud, {
- attributes: true,
- attributeFilter: ['class', 'data-variant'],
- });
- }
- const credits = document.getElementById('cesium-credits');
- if (credits) {
- this._leftStackMutationObserver.observe(credits, {
- subtree: true,
- childList: true,
- });
- }
- }
-
- const transitionHud = document.getElementById('intel-hud');
- if (transitionHud) {
- this._leftStackHudTransitionHandler = (event) => {
- if (event.propertyName === 'opacity' || event.propertyName === 'visibility') {
- this._scheduleLeftPanelLayout({ reconsiderAutoCollapse: true });
- // The Cockpit strip hangs off the HUD's REC readout, so it has to
- // remeasure on the same event: the readout keeps its rect through
- // the whole fade and only stops counting once the HUD has retired.
- this.cockpitView?.scheduleContextLayout();
- }
- };
- transitionHud.addEventListener('transitionend', this._leftStackHudTransitionHandler);
- }
-
- this._leftStackCockpitModeHandler = () => {
- // Cockpit mode repositions the peripheral HUD and reveals its own
- // bottom-left context card. Measure after those styles have committed so
- // the accordion remains in the same obstacle-safe lane instead of
- // jumping to a cockpit-specific top anchor.
- this._scheduleLeftPanelLayout();
- requestAnimationFrame(() => this._scheduleLeftPanelLayout());
- setTimeout(() => this._scheduleLeftPanelLayout(), 300);
- };
- window.addEventListener('gev:cockpit-mode-changed', this._leftStackCockpitModeHandler);
-
- this._scheduleLeftPanelLayout();
- }
-
- /**
- * Batches adaptive accordion work into one animation frame.
- * @returns {void}
- */
- _scheduleLeftPanelLayout({ reconsiderAutoCollapse = false } = {}) {
- if (reconsiderAutoCollapse) this._leftStackReconsiderAutoCollapse = true;
- if (!this._leftPanelStack || this._leftStackLayoutFrame !== null) return;
- this._leftStackLayoutFrame = requestAnimationFrame(() => {
- this._leftStackLayoutFrame = null;
- if (this._leftStackReconsiderAutoCollapse) {
- this._leftStackReconsiderAutoCollapse = false;
- for (const panel of this._leftPanelStack.querySelectorAll('.layout-auto-collapsed')) {
- panel.classList.remove('collapsed', 'layout-auto-collapsed');
- this._syncPanelCollapseButton(panel);
- }
- }
- this._syncLeftPanelAdaptiveLayout();
- });
- }
-
- /**
- * Measures a live obstacle-free corridor for the left accordion and toggles
- * focus mode only when the expanded panel plus sibling labels cannot fit.
- * Safe boundaries are written as viewport-relative CSS values.
- * @returns {void}
- */
- _syncLeftPanelAdaptiveLayout() {
- layoutLeftPanelRail({
- stack: this._leftPanelStack,
- obstacles: document.querySelectorAll(LEFT_STACK_OBSTACLE_SELECTOR),
- windowRef: window,
- hud: { visible: this.hud.visible, variant: this.hud.getVariant() },
- preferredPanelId: this._leftStackPreferredPanelId,
- onCollapse: (panel) => this._syncPanelCollapseButton(panel),
- onRetry: () => this._scheduleLeftPanelLayout(),
- collapsedHeights: this._leftStackCollapsedHeights,
- onAligned: () => this._scheduleRightPanelLayout(),
- });
- }
-
- /**
- * Updates collapse button glyphs based on panel state. Right-rail panels
- * use directional arrows; left-stack panels use +/- symbols.
- * @param {HTMLElement} panelEl - The panel DOM element.
- * @returns {void}
- */
- _syncPanelCollapseButton(panelEl) {
- const isRightRail = ['pp-toggles', 'cctv-panel', 'global-context-panel'].includes(panelEl?.id);
- const collapsed = panelEl.classList.contains('collapsed');
- panelEl.querySelectorAll('.panel-collapse-btn[data-collapse-target]').forEach((btn) => {
- const owner = btn.closest('[data-panel-id], #param-slider-panel');
- if (owner !== panelEl) return;
- if (isRightRail) {
- btn.textContent = collapsed ? '◀' : '▶';
- } else {
- btn.textContent = collapsed ? '+' : '−';
- }
- btn.setAttribute('aria-expanded', String(!collapsed));
- const panelName = panelEl.querySelector('.panel-title, .pp-header-label')?.textContent?.trim() || 'panel';
- const action = collapsed ? 'Expand' : 'Collapse';
- btn.title = `${action} ${panelName}`;
- btn.setAttribute('aria-label', `${action} ${panelName}`);
- if (panelEl.id === 'radio-panel') {
- const action = collapsed ? 'Expand' : 'Collapse';
- btn.title = `${action} Radio`;
- btn.setAttribute('aria-label', `${action} Radio section`);
- }
- });
- const dockToggle = panelEl.querySelector(`[data-dock-toggle-target="${panelEl.id}"]`);
- if (dockToggle) {
- const panelName = panelEl.querySelector('.panel-title, .location-toolbar-label')?.textContent?.trim() || 'panel';
- const action = collapsed ? 'Expand' : 'Collapse';
- dockToggle.setAttribute('aria-expanded', String(!collapsed));
- dockToggle.setAttribute('aria-label', `${action} ${panelName}`);
- dockToggle.title = `${action} ${panelName}`;
- }
- if (panelEl.id === 'radio-panel' && this._contextRadioDetailsBtn) {
- this._contextRadioDetailsBtn.setAttribute('aria-expanded', String(!collapsed));
- }
- if (panelEl.id === 'radio-panel' || panelEl.id === 'global-context-panel') {
- this._syncContextRadioLauncherState();
- }
- }
-
- /**
- * Converts a panel from left-positioned to right-anchored so it expands
- * leftward on resize. Used for the right-rail parameter panel.
- * @param {HTMLElement} panelEl - The panel to re-anchor.
- * @returns {void}
- */
- _pinPanelToRight(panelEl) {
- if (!panelEl) return;
- const rect = panelEl.getBoundingClientRect();
- const rightOffset = Math.max(6, Math.round(window.innerWidth - rect.right));
- panelEl.style.right = `${rightOffset}px`;
- panelEl.style.left = 'auto';
- }
-
- /**
- * Restores a panel's top/left position from localStorage.
- * Right-rail panels are additionally pinned to the right edge.
- * @param {string} panelId - DOM id of the panel.
- * @param {HTMLElement} panelEl - The panel DOM element.
- * @returns {void}
- */
- _restorePanelPosition(panelId, panelEl) {
- try {
- const raw = localStorage.getItem(this._panelStorageKey(panelId));
- if (!raw) return;
- const pos = JSON.parse(raw);
- if (!pos || typeof pos.left !== 'number' || typeof pos.top !== 'number') return;
- // Clamp to the viewport: a position saved at one window size would otherwise land off-screen at
- // another (audit U2 — observed a panel at x:-192). The drag handler clamps; restore must too.
- const { left, top } = this._clampToViewport(Math.round(pos.left), Math.round(pos.top), panelEl);
- panelEl.style.left = `${left}px`;
- panelEl.style.top = `${top}px`;
- panelEl.style.right = 'auto';
- panelEl.style.bottom = 'auto';
- if (panelId === 'pp-toggles') {
- this._pinPanelToRight(panelEl);
- }
- } catch {
- // ignore malformed saved panel position
- }
- }
-
- /**
- * Clamp a desired left/top so the panel stays fully on-screen (6px inset), matching the drag
- * clamp (ui.js ~1822). Width/height are position-independent, so reading the rect first is safe.
- * @param {number} left - desired left (px)
- * @param {number} top - desired top (px)
- * @param {HTMLElement} panelEl - the panel element
- * @returns {{left:number, top:number}}
- */
- _clampToViewport(left, top, panelEl) {
- const rect = panelEl.getBoundingClientRect();
- const maxLeft = Math.max(6, window.innerWidth - rect.width - 6);
- const maxTop = Math.max(6, window.innerHeight - rect.height - 6);
- return {
- left: Math.max(6, Math.min(maxLeft, left)),
- top: Math.max(6, Math.min(maxTop, top)),
- };
- }
-
- /**
- * Persists a panel's current bounding-rect position to localStorage.
- * @param {string} panelId - DOM id of the panel.
- * @param {HTMLElement} panelEl - The panel DOM element.
- * @returns {void}
- */
- _savePanelPosition(panelId, panelEl) {
- const rect = panelEl.getBoundingClientRect();
- try {
- localStorage.setItem(this._panelStorageKey(panelId), JSON.stringify({
- left: Math.round(rect.left),
- top: Math.round(rect.top),
- }));
- } catch {
- // storage unavailable
- }
- }
-
- /**
- * Makes a panel draggable via its handle element. Implements:
- * - Z-order promotion: each pointerdown increments the global z-counter
- * so the clicked panel floats above siblings.
- * - Viewport clamping: drag moves are clamped to a 6px inset from all edges.
- * - Right-rail pinning: pp-toggles panel is re-anchored right after drag.
- * - CCTV viewport sync: cctv-panel recalculates scroll height after drag.
- * @param {string} panelId - DOM id of the panel.
- * @param {HTMLElement} panelEl - The panel DOM element.
- * @param {HTMLElement} handleEl - The drag handle element within the panel.
- * @returns {void}
- */
- /**
- * Promotes a panel to the top of the panel z band [PANEL_Z_BASE, PANEL_Z_MAX].
- * Renormalizes all promoted panels when the band is exhausted so panels can
- * never climb above the voice pill (150), toasts (200), or clean-view exit (300).
- * @param {HTMLElement} panelEl - Panel to bring to front.
- * @returns {void}
- */
- _promotePanelZ(panelEl) {
- this._panelZCounter += 1;
- if (this._panelZCounter > PANEL_Z_MAX) {
- const promoted = [...document.querySelectorAll('.panel-draggable')]
- .filter((el) => el.style.zIndex)
- .sort((a, b) => Number(a.style.zIndex) - Number(b.style.zIndex));
- let z = PANEL_Z_BASE + 1;
- for (const el of promoted) {
- el.style.zIndex = String(z);
- z += 1;
- }
- this._panelZCounter = z;
- }
- panelEl.style.zIndex = String(this._panelZCounter);
- }
-
- _makePanelDraggable(panelId, panelEl, handleEl) {
- // Z-order promotion: bring clicked panel to front of the stacking context
- panelEl.addEventListener('pointerdown', () => {
- this._promotePanelZ(panelEl);
- });
-
- handleEl.addEventListener('pointerdown', (event) => {
- if (event.button !== 0) return;
- if (event.target.closest('.panel-collapse-btn')) return;
- if (event.target.closest('input, select, option, button:not(.panel-collapse-btn)')) return;
-
- event.preventDefault();
- const rect = panelEl.getBoundingClientRect();
- const startX = event.clientX;
- const startY = event.clientY;
- const offsetX = startX - rect.left;
- const offsetY = startY - rect.top;
-
- panelEl.style.left = `${rect.left}px`;
- panelEl.style.top = `${rect.top}px`;
- panelEl.style.right = 'auto';
- panelEl.style.bottom = 'auto';
- panelEl.classList.add('panel-dragging');
- this._promotePanelZ(panelEl);
-
- const onMove = (moveEvent) => {
- const nextLeftRaw = moveEvent.clientX - offsetX;
- const nextTopRaw = moveEvent.clientY - offsetY;
- const maxLeft = Math.max(6, window.innerWidth - rect.width - 6);
- const maxTop = Math.max(6, window.innerHeight - rect.height - 6);
- const nextLeft = Math.max(6, Math.min(maxLeft, nextLeftRaw));
- const nextTop = Math.max(6, Math.min(maxTop, nextTopRaw));
- panelEl.style.left = `${nextLeft}px`;
- panelEl.style.top = `${nextTop}px`;
- if (panelId === 'pp-toggles') {
- this._layoutRightPanels();
- }
- if (panelId === 'cctv-panel') {
- this._syncCctvPanelViewport();
- }
- };
-
- const onUp = () => {
- panelEl.classList.remove('panel-dragging');
- window.removeEventListener('pointermove', onMove);
- window.removeEventListener('pointerup', onUp);
- window.removeEventListener('pointercancel', onUp);
- if (panelId === 'pp-toggles') {
- this._pinPanelToRight(panelEl);
- }
- this._savePanelPosition(panelId, panelEl);
- if (panelId === 'cctv-panel') {
- this._syncCctvPanelViewport();
- }
- };
-
- window.addEventListener('pointermove', onMove);
- window.addEventListener('pointerup', onUp);
- window.addEventListener('pointercancel', onUp);
- });
- }
-
- _buildSharePanelState() {
- const specs = [];
- for (const spec of SHARE_PANEL_STATE_SPECS) {
- const panelEl = document.getElementById(spec.id);
- if (!panelEl) continue;
- // Responsive auto-collapse is presentation only; the recipient should
- // restore the user's explicit expanded preference at its own viewport.
- const collapsed = panelEl.classList.contains('layout-auto-collapsed')
- ? false
- : panelEl.classList.contains('collapsed');
- const entry = { id: spec.id, collapsed };
- if (spec.pinnable) entry.pinned = panelEl.classList.contains('dock-pinned');
- specs.push(entry);
- }
- return specs.length ? { specs } : null;
- }
-
- _restorePanelState(panelState) {
- if (!panelState || !Array.isArray(panelState.specs)) return;
- const specsById = new Map(panelState.specs.map((spec) => [spec.id, spec]));
- for (const spec of SHARE_PANEL_STATE_SPECS) {
- const state = specsById.get(spec.id);
- if (!state || typeof state.collapsed !== 'boolean') continue;
- if (spec.pinnable && typeof state.pinned === 'boolean') {
- this._setCommandDockPanelPinState(spec.id, state.pinned, {
- restore: true,
- persist: false,
- syncShare: false,
- });
- }
- const nextCollapsed = state.pinned && spec.pinnable ? false : state.collapsed;
- this.setPanelCollapsed(spec.id, nextCollapsed, {
- restore: true,
- persist: false,
- syncShare: false,
- });
- }
- this.shareLinkManager?.onPanelStateChange?.();
- }
-
- /**
- * Programmatically collapses or expands a panel, persists the state,
- * and triggers layout recalculation for dependent panels.
- * @param {string} panelId - DOM id of the panel.
- * @param {boolean} collapsed - Whether to collapse the panel.
- * @param {object} [options] Disclosure ownership options.
- * @param {boolean} [options.explicit=false] Whether a direct user action owns the panel lane.
- * @returns {void}
- */
- setPanelCollapsed(panelId, collapsed, {
- explicit = false,
- restore = false,
- persist = true,
- syncShare = true,
- } = {}) {
- if (panelId === 'control-panel' && collapsed) this._cancelMapSourceFocus?.();
- const panelEl = document.getElementById(panelId);
- if (!panelEl) return;
- if (explicit && !restore) this.shareLinkManager?.claimRestoreLane?.('panel', panelId);
- const nextCollapsed = Boolean(collapsed);
- const wasAutoCollapsed = panelEl.classList.contains('layout-auto-collapsed');
- const leftOwnerPanel = this._leftPanelStack?.contains(panelEl) ? panelEl : null;
- const rightOwnerPanel = panelId === 'radio-panel'
- ? document.getElementById('global-context-panel')
- : (this._rightPanelStack?.contains(panelEl) ? panelEl : null);
- const priorLeftOwner = this._leftStackPreferredPanelId;
- const priorRightOwner = this._rightStackPreferredPanelId;
- if (explicit && !restore && !nextCollapsed && leftOwnerPanel) {
- this._leftStackPreferredPanelId = leftOwnerPanel.id;
- } else if (explicit && !restore && nextCollapsed && leftOwnerPanel?.id === this._leftStackPreferredPanelId) {
- this._leftStackPreferredPanelId = null;
- }
- if (explicit && !restore && !nextCollapsed && rightOwnerPanel) {
- this._rightStackPreferredPanelId = rightOwnerPanel.id;
- } else if (
- explicit
- && !restore
- && nextCollapsed
- && rightOwnerPanel?.id === this._rightStackPreferredPanelId
- ) {
- this._rightStackPreferredPanelId = null;
- }
- if (panelEl.classList.contains('collapsed') === nextCollapsed && !wasAutoCollapsed) {
- this._syncPanelCollapseButton(panelEl);
- if (priorLeftOwner !== this._leftStackPreferredPanelId) {
- this._scheduleLeftPanelLayout({ reconsiderAutoCollapse: true });
- }
- if (priorRightOwner !== this._rightStackPreferredPanelId) {
- this._scheduleRightPanelLayout({ reconsiderAutoCollapse: true });
- }
- return;
- }
- panelEl.classList.remove('layout-auto-collapsed');
- if (!nextCollapsed && this.cockpitView?.active && panelId === 'data-panel') {
- this._cockpitContextCollapsedForDataPanel = !this.cockpitView.contextCollapsed;
- if (this._cockpitContextCollapsedForDataPanel) {
- this.cockpitView.setContextCollapsed(true);
- }
- }
- if (!nextCollapsed && panelId === 'global-context-panel'
- && this._contextRadioDock?.classList.contains('disclosure-open')) {
- this._setRadioDisclosure?.(false);
- }
- if (!nextCollapsed && panelId === 'radio-panel'
- && document.getElementById('global-context-panel')?.classList.contains('collapsed')) {
- this.setPanelCollapsed('global-context-panel', false, { restore, persist, syncShare });
- }
- if (!nextCollapsed && !restore && panelId === 'location-bar') {
- const otherPanel = document.getElementById('control-panel');
- if (otherPanel && !otherPanel.classList.contains('dock-pinned')) {
- this.setPanelCollapsed('control-panel', true, { restore, persist, syncShare });
- }
- } else if (!nextCollapsed && !restore && panelId === 'control-panel') {
- const otherPanel = document.getElementById('location-bar');
- if (otherPanel && !otherPanel.classList.contains('dock-pinned')) {
- this.setPanelCollapsed('location-bar', true, { restore, persist, syncShare });
- }
- }
- panelEl.classList.toggle('collapsed', nextCollapsed);
- if (nextCollapsed && this.cockpitView?.active && panelId === 'data-panel'
- && this._cockpitContextCollapsedForDataPanel) {
- this._cockpitContextCollapsedForDataPanel = false;
- this.cockpitView.setContextCollapsed(false);
- }
- this._syncPanelCollapseButton(panelEl);
- if (persist !== false) this._savePanelCollapsedState(panelId, nextCollapsed);
- if (panelId === 'pp-toggles') {
- this._layoutRightPanels();
- }
- if (this._rightPanelStack?.contains(panelEl)) {
- this._scheduleRightPanelLayout({ reconsiderAutoCollapse: true });
- }
- if (panelId === 'cctv-panel') {
- this._syncCctvPanelViewport();
- }
- requestAnimationFrame(() => this._updateCommandDockTrayStack());
- this._scheduleLeftPanelLayout({
- reconsiderAutoCollapse: this._leftPanelStack?.contains(panelEl) === true,
- });
- if (syncShare) this.shareLinkManager?.onPanelStateChange?.();
- }
-
- /**
- * Toggles "clean view" mode which hides all UI panels via a CSS body class.
- * @param {boolean} [forceEnabled] - Explicit on/off. Omit to toggle.
- * @returns {void}
- */
- toggleCleanView(forceEnabled) {
- const shouldEnable = typeof forceEnabled === 'boolean'
- ? forceEnabled
- : !document.body.classList.contains('ui-clean-view');
- document.body.classList.toggle('ui-clean-view', shouldEnable);
- if (this._cleanViewBtn) {
- this._cleanViewBtn.classList.toggle('active', shouldEnable);
- }
- this._scheduleLeftPanelLayout();
- }
-
- // ── Public control facade ──────────────────────────────────────────────
- // Deliberate API for voice tools and scripting. Every setter keeps the DOM
- // sliders, share-link state, and scene snapshots in sync, and returns
- // { ok, ...resultingState } so callers confirm only what actually happened.
-
- /**
- * Sets HUD visibility mode. 'auto' restores style-driven show/hide.
- * @param {'on'|'off'|'auto'} mode - Visibility mode.
- * @returns {{ok: boolean, visible?: boolean, layout?: string, error?: string}}
- */
- setHudVisible(mode) {
- const normalized = String(mode ?? '').toLowerCase();
- if (!['on', 'off', 'auto'].includes(normalized)) {
- return { ok: false, error: `Unknown HUD visibility mode: ${mode}` };
- }
- this.shareLinkManager?.claimRestoreLane?.('visual');
- this.hud.setMode(normalized);
- this._updateHudButtonState();
- this._syncShareState();
- return { ok: true, visible: !!this.hud.visible, mode: normalized, layout: this.hud.getVariant() };
- }
-
- /**
- * Switches the HUD layout variant.
- * @param {'tactical'|'operator'|'minimal'} variantName - Layout variant.
- * @returns {{ok: boolean, layout?: string, visible?: boolean, error?: string}}
- */
- setHudLayout(variantName) {
- const variant = String(variantName ?? '').toLowerCase();
- if (!['tactical', 'operator', 'minimal'].includes(variant)) {
- return { ok: false, error: `Unknown HUD layout: ${variantName}` };
- }
- this.shareLinkManager?.claimRestoreLane?.('visual');
- this._setHudVariant(variant);
- return { ok: true, layout: this.hud.getVariant(), visible: !!this.hud.visible };
- }
-
- /**
- * Reads current detection overlay state (engine mode + UI density percent).
- * @returns {{detectionMode: string, densityPct: number|null, allocationStrategy:string, fadePct:number, outsideOpacityPct:number}}
- */
- getDetectionState() {
- const pct = this._detectionDensitySlider
- ? parseInt(this._detectionDensitySlider.value, 10)
- : null;
- return {
- detectionMode: getDetectionMode(),
- densityPct: pct,
- allocationStrategy: getDetectionTuning().allocationStrategy,
- fadePct: parseInt(this._detectionFadeSlider?.value || '7', 10),
- outsideOpacityPct: parseInt(this._detectionOpacitySlider?.value || '0', 10),
- };
- }
-
- /** Read-only overlay diagnostics used by browser QA and regression harnesses. */
- getDetectionDiagnostics() {
- return readDetectionDiagnostics();
- }
-
- /**
- * Controls the detection overlay: on/off, mode, and density percent.
- * Density writes the slider AND the engine so share links and scene
- * snapshots stay truthful.
- * @param {object} [options]
- * @param {boolean} [options.enabled] - false forces OFF; true restores the current density profile.
- * @param {'sparse'|'balanced'|'dense'|'panoptic'} [options.mode] - Profile (legacy aliases accepted).
- * @param {number} [options.densityPct] - 0-100 density percent.
- * @param {'elastic'|'weighted'} [options.allocationStrategy] - Layer-capacity policy.
- * @param {number} [options.fadePct] - Fade distance as 0-40% of the keyhole radius.
- * @param {number} [options.outsideOpacityPct] - Opacity beyond the fade distance, 0-100%.
- * @returns {{ok: boolean, detectionMode?: string, densityPct?: number|null, error?: string}}
- */
- setDetection({ enabled, mode, densityPct, allocationStrategy, fadePct, outsideOpacityPct } = {}) {
- if (enabled !== undefined && typeof enabled !== 'boolean') {
- return { ok: false, error: `Invalid detection enabled value: ${enabled}`, ...this.getDetectionState() };
- }
- let requestedProfile = null;
- if (typeof mode === 'string' && mode.trim()) {
- requestedProfile = normalizeProfile(mode);
- if (!requestedProfile) {
- return { ok: false, error: `Unknown detection mode: ${mode}`, ...this.getDetectionState() };
- }
- }
- let requestedDensity = null;
- if (densityPct != null) {
- if (!Number.isFinite(Number(densityPct))) {
- return { ok: false, error: `Invalid density: ${densityPct}`, ...this.getDetectionState() };
- }
- requestedDensity = canonicalizeDensity(Number(densityPct));
- }
- if (requestedProfile && requestedProfile !== 'OFF' && requestedDensity != null
- && profileForDensity(requestedDensity) !== requestedProfile) {
- return {
- ok: false,
- error: `Detection mode ${requestedProfile} conflicts with density ${requestedDensity}%`,
- ...this.getDetectionState(),
- };
- }
- let requestedAllocation = null;
- if (allocationStrategy != null) {
- requestedAllocation = String(allocationStrategy).trim().toUpperCase();
- if (!ALLOCATION_STRATEGIES.includes(requestedAllocation)) {
- return { ok: false, error: `Unknown allocation strategy: ${allocationStrategy}`, ...this.getDetectionState() };
- }
- }
- if (fadePct != null) {
- if (!Number.isFinite(Number(fadePct))) {
- return { ok: false, error: `Invalid fade distance: ${fadePct}`, ...this.getDetectionState() };
- }
- }
- if (outsideOpacityPct != null) {
- if (!Number.isFinite(Number(outsideOpacityPct))) {
- return { ok: false, error: `Invalid outside opacity: ${outsideOpacityPct}`, ...this.getDetectionState() };
- }
- }
- const hasExplicitVisualChange = typeof enabled === 'boolean'
- || requestedProfile !== null
- || requestedDensity !== null
- || requestedAllocation !== null
- || fadePct != null
- || outsideOpacityPct != null;
- if (hasExplicitVisualChange) {
- // Voice/scripted detection control counts as an explicit user choice, so
- // neither style presets nor a still-pending shared visual restore can
- // overwrite it afterward.
- this.shareLinkManager?.claimRestoreLane?.('visual');
- this._detectionUserOverridden = true;
- }
- if (requestedAllocation) {
- this._setDetectionAllocation(requestedAllocation, { syncShare: false });
- }
- if (fadePct != null && this._detectionFadeSlider) {
- this._detectionFadeSlider.value = String(Math.max(0, Math.min(40, Math.round(Number(fadePct)))));
- }
- if (outsideOpacityPct != null && this._detectionOpacitySlider) {
- this._detectionOpacitySlider.value = String(Math.max(0, Math.min(100, Math.round(Number(outsideOpacityPct)))));
- }
- if (fadePct != null || outsideOpacityPct != null) this._applyDetectionFadeFromUi();
-
- if (requestedProfile && requestedProfile !== 'OFF' && requestedDensity == null) {
- requestedDensity = defaultDensityForProfile(requestedProfile);
- }
- if (requestedDensity != null && this._detectionDensitySlider) {
- this._detectionDensitySlider.value = String(requestedDensity);
- this._applyDetectionDensityFromUi();
- }
-
- if (enabled === false || requestedProfile === 'OFF') {
- setDetectionModeByLabel('OFF');
- } else if (requestedProfile) {
- setDetectionModeByLabel(requestedProfile);
- } else if (enabled === true && getDetectionMode() === 'OFF') {
- setDetectionModeByLabel(profileForDensity(
- requestedDensity ?? this._detectionDensitySlider?.value ?? 50,
- ));
- }
- this._syncDetectionUiFromEngine();
- this._syncShareState();
- return { ok: true, ...this.getDetectionState() };
- }
-
- /**
- * Switches the basemap stack and reports whether the switch landed.
- * @param {string} stackId - One of mapStackController.getStacks() ids.
- * @returns {Promise<{ok: boolean, activeStack?: string, error?: string|null, available?: string[]}>}
- */
- async setMapStack(stackId) {
- if (!this.mapStackController) {
- return { ok: false, error: 'Map stack controller unavailable' };
- }
- const stacks = this.mapStackController.getStacks();
- const target = stacks.find((stack) => stack.id === stackId);
- if (!target) {
- return { ok: false, error: `Unknown map stack: ${stackId}`, available: stacks.map((s) => s.id) };
- }
- if (!target.available) {
- return { ok: false, error: `${target.label} requires a Cesium ion token`, activeStack: this.mapStackController.getActiveId() };
- }
- await this._setMapStack(stackId);
- const state = this.mapStackController.getState();
- const landed = state.activeId === stackId;
- return {
- ok: landed,
- activeStack: state.activeId,
- error: landed ? null : (state.lastError || 'Map stack did not switch'),
- };
- }
-
- /**
- * Controls bloom post-processing. Intensity is the UI percent (0-200).
- * @param {object} [options]
- * @param {boolean} [options.enabled]
- * @param {number} [options.intensityPct] - 0-200.
- * @returns {{ok: boolean, bloom: {enabled: boolean, intensityPct: number|null}}}
- */
- setBloom({ enabled, intensityPct } = {}) {
- const current = () => ({
- enabled: !!this.bloomEnabled,
- intensityPct: this._bloomSlider ? parseInt(this._bloomSlider.value, 10) : null,
- });
- if (enabled !== undefined && typeof enabled !== 'boolean') {
- return { ok: false, error: `Invalid bloom enabled value: ${enabled}`, bloom: current() };
- }
- if (intensityPct !== undefined
- && (typeof intensityPct !== 'number' || !Number.isFinite(intensityPct))) {
- return { ok: false, error: `Invalid bloom intensity: ${intensityPct}`, bloom: current() };
- }
- const hasExplicitVisualChange = intensityPct !== undefined || enabled !== undefined;
- if (hasExplicitVisualChange) this.shareLinkManager?.claimRestoreLane?.('visual');
- if (intensityPct !== undefined) {
- this._setBloomIntensity(Math.round(Math.max(0, Math.min(200, intensityPct))));
- }
- if (enabled !== undefined) this._setBloomEnabled(enabled);
- return {
- ok: true,
- bloom: current(),
- };
- }
-
- /**
- * Controls sharpen post-processing. Intensity is the UI percent (0-100).
- * @param {object} [options]
- * @param {boolean} [options.enabled]
- * @param {number} [options.intensityPct] - 0-100.
- * @returns {{ok: boolean, sharpen: {enabled: boolean, intensityPct: number|null}}}
- */
- setSharpen({ enabled, intensityPct } = {}) {
- const current = () => ({
- enabled: !!this.sharpenEnabled,
- intensityPct: this._sharpenSlider ? parseInt(this._sharpenSlider.value, 10) : null,
- });
- if (enabled !== undefined && typeof enabled !== 'boolean') {
- return { ok: false, error: `Invalid sharpen enabled value: ${enabled}`, sharpen: current() };
- }
- if (intensityPct !== undefined
- && (typeof intensityPct !== 'number' || !Number.isFinite(intensityPct))) {
- return { ok: false, error: `Invalid sharpen intensity: ${intensityPct}`, sharpen: current() };
- }
- const hasExplicitVisualChange = intensityPct !== undefined || enabled !== undefined;
- if (hasExplicitVisualChange) this.shareLinkManager?.claimRestoreLane?.('visual');
- if (intensityPct !== undefined) {
- const pct = Math.round(Math.max(0, Math.min(100, intensityPct)));
- if (this._sharpenSlider) this._sharpenSlider.value = String(pct);
- if (this._sharpenSliderValue) this._sharpenSliderValue.textContent = `${pct}%`;
- this._applySharpenIntensity(pct / 100);
- this._syncShareState();
- }
- if (enabled !== undefined) this._setSharpenEnabled(enabled);
- return {
- ok: true,
- sharpen: current(),
- };
- }
-
- /** Whether the full-globe celestial overlay is enabled by user preference. */
- get celestialRingEnabled() {
- return !!this.celestialRing?.enabled;
- }
-
- /**
- * Controls the celestial ring. The Display button uses `focus=true` when the
- * ring is disabled or unavailable at the current zoom, turning the control
- * into a reveal action instead of requiring a separate globe-navigation step.
- * @param {boolean} enabled
- * @param {object} [options]
- * @param {boolean} [options.syncShare=true]
- * @param {boolean} [options.focus=false]
- * @returns {{ok:boolean, celestialRing:{enabled:boolean,visible:boolean}, cameraFocused:boolean, error?:string}}
- */
- setCelestialRingEnabled(enabled, { syncShare = true, focus = false } = {}) {
- const styleSupported = isCelestialRingStyleSupported(this.activeStyle);
- const current = () => ({
- enabled: this.celestialRingEnabled,
- visible: !!this.celestialRing?.visible,
- });
- if (typeof enabled !== 'boolean') {
- return {
- ok: false,
- celestialRing: current(),
- cameraFocused: false,
- error: `Invalid celestial ring enabled value: ${enabled}`,
- };
- }
- if (typeof syncShare !== 'boolean' || typeof focus !== 'boolean') {
- return {
- ok: false,
- celestialRing: current(),
- cameraFocused: false,
- error: 'Celestial ring options must be boolean',
- };
- }
- if (!styleSupported && enabled) {
- return {
- ok: false,
- celestialRing: current(),
- cameraFocused: false,
- error: 'Celestial ring is available only in Normal style',
- };
- }
- if (syncShare) this.shareLinkManager?.claimRestoreLane?.('visual');
- const nextEnabled = styleSupported && enabled;
- this.celestialRing?.setEnabled(nextEnabled);
- this._celestialBtn?.classList.toggle('active', nextEnabled);
- this._celestialBtn?.setAttribute('aria-pressed', String(nextEnabled));
- if (this._celestialBtn) {
- this._celestialBtn.disabled = !styleSupported;
- this._celestialBtn.setAttribute('aria-disabled', String(!styleSupported));
- this._celestialBtn.title = styleSupported
- ? 'Celestial ring — reveal the full globe'
- : 'Celestial ring — available in Normal style';
- }
- let cameraFocused = false;
- if (nextEnabled && focus) {
- cameraFocused = !!this.celestialRing?.focusFullGlobe();
- }
- if (syncShare) this._syncShareState();
- return {
- ok: styleSupported || !enabled,
- celestialRing: current(),
- cameraFocused,
- };
- }
-
- /**
- * Starts or stops orbiting the active POI.
- * @param {boolean} [enabled] - Omit to toggle.
- * @returns {{ok: boolean, orbiting: boolean, error?: string}}
- */
- setOrbit(enabled) {
- const active = !!this.orbitController?.active;
- if (typeof enabled === 'boolean' && enabled === active) {
- return { ok: true, orbiting: active };
- }
- if (enabled === false) {
- this._stopOrbit();
- return { ok: true, orbiting: false };
- }
- if (!this._currentTarget) {
- return { ok: false, orbiting: false, error: 'No active landmark to orbit — fly to a landmark first' };
- }
- this._toggleOrbit();
- return { ok: true, orbiting: !!this.orbitController?.active };
- }
-
- /**
- * Enables/disables clean view (hides all UI chrome).
- * @param {boolean} [enabled] - Omit to toggle.
- * @returns {{ok: boolean, cleanView: boolean}}
- */
- setCleanView(enabled) {
- this.toggleCleanView(enabled);
- return { ok: true, cleanView: document.body.classList.contains('ui-clean-view') };
- }
-
- /**
- * Reads global context mode state for voice/state-sync consumers.
- * @returns {{mode: 'flights'|'space-missions'|null, active: boolean, changing: boolean, entering: 'flights'|'space-missions'|null, snapshotCaptured: boolean}}
- */
- getContextModeState(...args) { return this._contextControls?.getContextModeState(...args); }
-
- /**
- * Sets global context mode (Contacts / Space Missions / off) for voice.
- * @param {'contacts'|'space-missions'|'off'|null} mode - Requested context target.
- * @param {object} [options]
- * @param {string|Symbol|null} [options.notificationToken]
- * @param {AbortSignal|null} [options.signal]
- * @param {Function|null} [options.isCurrent]
- * @param {boolean} [options.claimVisualAuthority] Whether this request is a
- * genuine operator/voice Context intent that should take the visual restore
- * lane. Cockpit choreography calls this facade INTERNALLY for its own
- * enter/rollback steps; those transitions are not a Context request by the
- * operator and must stay inert, so they pass `false`.
- * @returns {Promise<{ok:boolean, mode:'flights'|'space-missions'|null, active:boolean, action:string, error?:string}>}
- */
- setContextMode(...args) { return this._contextControls?.setContextMode(...args); }
-
- /**
- * Returns cockpit status for voice/state sync and navigation operations.
- * @returns {{active:boolean, entryAllowed:boolean, visionMode:string, subject:{id:string,layerId:string}|null, navigation:{canPrevious:boolean,canNext:boolean,canFocus:boolean}|null, awareness?: object}|null}
- */
- getCockpitState() {
- const snapshot = militaryAwarenessLayer.getContextSnapshot?.();
- const info = this.cockpitView?.readAircraftInfo?.();
- const active = Boolean(this.cockpitView?.active);
- const gateOpen = Boolean(this.cockpitView?.isEntryAllowed?.());
- // "Could Cockpit be ENTERED right now" — so it is false while already
- // inside, unconditionally. Cockpit takes the entity off
- // `viewer.trackedEntity` on entry and NEXT puts one back, which made this
- // flip true/false between calls while `active` stayed true; readers
- // (including the voice model) read that as a broken half-entered state.
- const entryAllowed = !active && Boolean(
- gateOpen
- && info
- && this.viewer?.trackedEntity?.position,
- );
- return {
- active,
- entryAllowed,
- // Why entry is unavailable, so a refusal can be explained rather than
- // guessed at.
- entryBlockedReason: entryAllowed || active
- ? null
- : (!gateOpen
- ? (this._contextModeChanging ? 'contacts-starting' : 'contacts-inactive')
- : 'no-tracked-aircraft'),
- visionMode: this.cockpitView?.visionMode || null,
- subject: info ? {
- id: info.icao24 || info.id || null,
- layerId: info.layerId || null,
- callsign: info.callsign || null,
- } : null,
- navigation: snapshot ? {
- canPrevious: Boolean(snapshot.navigation?.canPrevious),
- canNext: Boolean(snapshot.navigation?.canNext),
- canFocus: Boolean(snapshot.navigation?.canFocus),
- } : null,
- awareness: snapshot ? {
- radiusM: Number.isFinite(snapshot.radiusM) ? snapshot.radiusM : null,
- subject: snapshot.subject ? {
- id: snapshot.subject.id || null,
- layerId: snapshot.subject.layerId || null,
- } : null,
- cohorts: Array.isArray(snapshot.cohorts)
- ? snapshot.cohorts.map((cohort) => ({
- id: cohort?.id || null,
- source: cohort?.source || null,
- count: Number.isFinite(cohort?.count) ? cohort.count : null,
- relationship: cohort?.relationship || null,
- reason: cohort?.reason || null,
- coverage: cohort?.coverage || null,
- }))
- : [],
- navigation: snapshot.navigation ? {
- canPrevious: Boolean(snapshot.navigation.canPrevious),
- canNext: Boolean(snapshot.navigation.canNext),
- canFocus: Boolean(snapshot.navigation.canFocus),
- } : null,
- } : null,
- activeTracked: this.cockpitView?.active ? Boolean(this.cockpitView?.trackedEntity) : false,
- activeMapView: !this.cockpitView?.active && entryAllowed,
- };
- }
-
- /**
- * Point Cockpit entry at a requested contact layer before it enters.
- *
- * Reuses the filtered Context navigation NEXT already uses, so "cockpit in
- * that military helicopter" lands on the same contact "next military
- * helicopter" would. Cockpit flies aircraft only; vessel and installation
- * layers are refused by name rather than silently ignored.
- * @param {object} options Retarget request.
- * @param {string} options.targetLayer Requested contact layer.
- * @param {string|null} options.aircraftClass Optional class filter.
- * @param {{layerId: string}|null} options.currentTarget Current tracker.
- * @param {{layerId: string}|null} options.selectedTarget Pending selection.
- * @returns {{ok: boolean, retargeted?: boolean, error?: string}} Outcome.
- */
- _retargetCockpitEntryLayer({ targetLayer, aircraftClass, currentTarget, selectedTarget }) {
- if (!['flights', 'military'].includes(targetLayer)) {
- return {
- ok: false,
- error: `Cockpit flies aircraft only — ${targetLayer} contacts cannot be entered`,
- };
- }
- const activeLayer = selectedTarget?.layerId || currentTarget?.layerId || null;
- const alreadyOnLayer = activeLayer === targetLayer;
- if (alreadyOnLayer && !aircraftClass) return { ok: true, retargeted: false };
- const moved = militaryAwarenessLayer?.navigateNext
- ? !!militaryAwarenessLayer.navigateNext({
- targetLayer,
- aircraftClass,
- origin: 'voice',
- })
- : false;
- if (moved) return { ok: true, retargeted: true };
- // A filter that matched nothing still enters, as long as the layer is
- // already right — the operator asked for that layer and is on it.
- if (alreadyOnLayer) return { ok: true, retargeted: false };
- const label = targetLayer === 'military' ? 'military' : 'civilian';
- const filtered = aircraftClass ? `${aircraftClass} ` : '';
- return {
- ok: false,
- error: `No ${filtered}${label} contact is available to enter — track one first, or say "next ${label}"`,
- };
- }
-
- /**
- * Controls cockpit entry/exit and context navigation.
- * @param {'enter'|'exit'|'next'|'previous'|'status'} action - Cockpit action.
- * @param {object} [options]
- * @param {string|Symbol|null} [options.notificationToken]
- * @param {'flights'|'military'|'ais-live-vessels'|'military-installations'|null} [options.targetLayer]
- * @param {string|null} [options.aircraftClass]
- * @param {{layerId:'flights'|'military',id:string}|null} [options.selectedTarget]
- * @param {{layerId:'flights'|'military',id:string}|null} [options.rollbackTarget]
- * @returns {{ok:boolean, action:string, error?:string, state?:object}}
- */
- controlCockpit(action, {
- notificationToken = null,
- targetLayer = null,
- aircraftClass = null,
- selectedTarget = null,
- rollbackTarget = undefined,
- } = {}) {
- const normalized = String(action || '').toLowerCase();
- if (!this.cockpitView) {
- return {
- ok: false,
- action: 'control_cockpit',
- error: 'Cockpit controller unavailable',
- state: this.getCockpitState(),
- };
- }
- if (normalized === 'status') {
- return {
- ok: true,
- action: 'control_cockpit',
- state: this.getCockpitState(),
- notificationToken: notificationToken || null,
- };
- }
- if (normalized === 'enter') {
- // Entry is gated exactly as the manual entry chip is. Attempting it while
- // the gate is shut produced the half-entered look the operator reported
- // (a plane anchored under the camera with no cockpit around it), so
- // refuse with the reason instead of trying.
- if (!this.cockpitView.isEntryAllowed?.()) {
- return {
- ok: false,
- action: 'control_cockpit',
- error: this._contextModeChanging
- ? 'Contacts is still starting up — try Cockpit again in a moment'
- : 'Contacts must be active to enter Cockpit — say "open contacts" first',
- state: this.getCockpitState(),
- };
- }
- let currentTarget = this.getAircraftTrackingTarget();
- const layerForTarget = (target) => target?.layerId === 'military'
- ? militaryFlightsLayer
- : target?.layerId === 'flights' ? flightsLayer : null;
- // A requested layer retargets BEFORE entry, through the same filtered
- // navigation NEXT uses. Ignoring it entered on whatever was already
- // tracked and reported success, so "cockpit in that military helicopter"
- // silently put the operator in an airliner.
- if (targetLayer) {
- const requested = this._retargetCockpitEntryLayer({
- targetLayer,
- aircraftClass,
- currentTarget,
- selectedTarget,
- });
- if (!requested.ok) {
- return {
- ok: false,
- action: 'control_cockpit',
- error: requested.error,
- state: this.getCockpitState(),
- };
- }
- if (requested.retargeted) {
- // The retarget is now the authority; a selection sampled before it
- // would drag entry back to the wrong layer.
- selectedTarget = null;
- rollbackTarget = rollbackTarget === undefined ? currentTarget : rollbackTarget;
- currentTarget = this.getAircraftTrackingTarget();
- }
- }
- const selectedLayer = selectedTarget?.layerId === 'military'
- ? militaryFlightsLayer
- : selectedTarget?.layerId === 'flights' ? flightsLayer : null;
- const entry = enterCockpitWithTracking({
- cockpitView: this.cockpitView,
- selectedLayer,
- selectedTarget,
- currentLayer: layerForTarget(currentTarget),
- rollbackLayer: layerForTarget(
- rollbackTarget === undefined ? currentTarget : rollbackTarget,
- ),
- rollbackTarget,
- selectionOrigin: 'voice',
- });
- return {
- ok: entry.entered,
- action: 'control_cockpit',
- state: this.getCockpitState(),
- error: entry.error,
- };
- }
- if (normalized === 'exit') {
- const exited = !!this.cockpitView.exit();
- return {
- ok: exited,
- action: 'control_cockpit',
- state: this.getCockpitState(),
- error: exited ? null : 'Cockpit was already inactive',
- };
- }
- if (normalized === 'next' || normalized === 'previous') {
- const changed = this.cockpitView.navigateContext(
- normalized === 'next' ? 1 : -1,
- {
- targetLayer,
- aircraftClass,
- origin: 'voice',
- },
- );
- return {
- ok: changed,
- action: 'control_cockpit',
- state: this.getCockpitState(),
- error: changed ? null : 'No further context target was available',
- };
- }
- return {
- ok: false,
- action: 'control_cockpit',
- error: `Unknown cockpit action: ${action}`,
- state: this.getCockpitState(),
- };
- }
-
- /**
- * Full control-state snapshot — single source for voice read-back so the
- * agent confirms from the same state it acted on.
- * @returns {object} Current style/stack/HUD/detection/post-processing state.
- */
- getControlState() {
- return {
- style: this.activeStyle || 'normal',
- mapStack: this.mapStackController?.getActiveId?.() || null,
- hud: { visible: !!this.hud?.visible, layout: this.hud?.getVariant?.() || null },
- detection: this.getDetectionState(),
- bloom: {
- enabled: !!this.bloomEnabled,
- intensityPct: this._bloomSlider ? parseInt(this._bloomSlider.value, 10) : null,
- },
- sharpen: {
- enabled: !!this.sharpenEnabled,
- intensityPct: this._sharpenSlider ? parseInt(this._sharpenSlider.value, 10) : null,
- },
- celestialRing: {
- enabled: this.celestialRingEnabled,
- visible: !!this.celestialRing?.visible,
- },
- orbiting: !!this.orbitController?.active,
- recording: !!this._recordingMode,
- cleanView: document.body.classList.contains('ui-clean-view'),
- };
- }
-
- /**
- * Captures the current camera position and orientation as a serializable object.
- * @returns {{lat: number, lon: number, alt: number, heading: number, pitch: number, roll: number}|null}
- */
- getCameraState() {
- const carto = this.viewer.camera.positionCartographic;
- if (!carto) return null;
- return {
- lat: Cesium.Math.toDegrees(carto.latitude),
- lon: Cesium.Math.toDegrees(carto.longitude),
- alt: carto.height,
- heading: Cesium.Math.toDegrees(this.viewer.camera.heading),
- pitch: Cesium.Math.toDegrees(this.viewer.camera.pitch),
- roll: Cesium.Math.toDegrees(this.viewer.camera.roll),
- };
- }
-
- /**
- * Flies the camera to a previously captured camera state using cubic ease-in-out.
- * @param {{lat: number, lon: number, alt: number, heading?: number, pitch?: number, roll?: number}} cameraState
- * @param {number} [duration=2.8] - Flight duration in seconds.
- * @returns {void}
- */
- applyCameraState(cameraState, duration = 2.8) {
- if (!cameraState) return;
- this.viewer.camera.flyTo({
- destination: Cesium.Cartesian3.fromDegrees(
- cameraState.lon,
- cameraState.lat,
- cameraState.alt
- ),
- orientation: {
- heading: Cesium.Math.toRadians(cameraState.heading || 0),
- pitch: Cesium.Math.toRadians(cameraState.pitch || -35),
- roll: Cesium.Math.toRadians(cameraState.roll || 0),
- },
- duration: Math.max(0.2, duration || 0),
- easingFunction: Cesium.EasingFunction.CUBIC_IN_OUT,
- });
- }
-
- /**
- * Snapshots the full visual state (active style, bloom, sharpen, HUD, detection,
- * per-style shader uniform values) for serialization or scene recipe capture.
- * @returns {object} Serializable visual state object.
- */
- getVisualState() {
- const styleParams = {};
- for (const [styleName, stage] of Object.entries(this.stages)) {
- const shader = STYLES[styleName];
- if (!shader?.uniforms) continue;
- styleParams[styleName] = {};
- for (const uniformName of Object.keys(shader.uniforms)) {
- styleParams[styleName][uniformName] = stage.uniforms[uniformName];
- }
- }
-
- return {
- style: this.activeStyle,
- bloom: {
- enabled: this.bloomEnabled,
- intensity: this._getBloomIntensity(),
- version: BLOOM_SCALE_VERSION,
- },
- sharpen: {
- enabled: this.sharpenEnabled,
- intensity: parseInt(this._sharpenSlider?.value || '49', 10),
- },
- hud: {
- visible: this.hud.visible,
- variant: this.hud.getVariant(),
- },
- detection: {
- mode: getDetectionMode(),
- density: parseInt(this._detectionDensitySlider?.value || '50', 10),
- allocation: getDetectionTuning().allocationStrategy,
- fadePct: parseInt(this._detectionFadeSlider?.value || '7', 10),
- outsideOpacityPct: parseInt(this._detectionOpacitySlider?.value || '0', 10),
- },
- scope: {
- enabled: isScopeMaskEnabled(),
- featherPct: Math.round(getScopeMaskFeather() * 100),
- },
- mapStack: this.mapStackController?.getActiveId?.() || 'photoreal',
- styleParams,
- };
- }
-
- /**
- * Restores a full visual state snapshot, applying style, bloom, sharpen,
- * HUD, detection, and per-style shader uniforms. Used by scene recipes
- * and share-link restore. Async so the map-stack switch resolves before
- * the share state is synced; callers may fire-and-forget.
- * @param {object} [state={}] - Visual state object (as returned by getVisualState).
- * @param {object} [options]
- * @param {(() => boolean)|null} [options.isCurrent] Caller liveness predicate.
- * The map-stack switch is this method's ONLY suspension point, and the
- * shader-uniform writes come after it — so a caller superseded while that
- * switch is in flight would otherwise resume and commit the look of a
- * state the operator has already moved past. Scene playback reproduced
- * exactly that: a stale shot's uniforms landing on top of the live run.
- * Omit it and the method behaves as it always has.
- * @returns {Promise<boolean>} Whether the state was committed.
- */
- async applyVisualState(state = {}, { isCurrent = null } = {}) {
- const superseded = () => typeof isCurrent === 'function' && !isCurrent();
- if (superseded()) return false;
-
- if (state.style && state.style !== this.activeStyle) {
- this.setStyle(state.style, { applyPreset: false });
- }
-
- const bloomState = state.bloom || {};
- if (typeof bloomState.intensity === 'number' && this._bloomSlider) {
- const intensity = decodeBloomIntensity(
- bloomState.intensity,
- bloomState.version ?? state.bloomVersion ?? BLOOM_SCALE_VERSION
- );
- this._setBloomIntensity(intensity, { syncShare: false });
- }
- if (typeof bloomState.enabled === 'boolean') {
- this._setBloomEnabled(bloomState.enabled);
- }
-
- const sharpenState = state.sharpen || {};
- if (typeof sharpenState.intensity === 'number' && this._sharpenSlider) {
- const pct = Math.max(0, Math.min(100, Math.round(sharpenState.intensity)));
- this._sharpenSlider.value = String(pct);
- this._sharpenSliderValue.textContent = `${pct}%`;
- this._applySharpenIntensity(pct / 100);
- }
- if (typeof sharpenState.enabled === 'boolean') {
- this._setSharpenEnabled(sharpenState.enabled);
- }
-
- const hudState = state.hud || {};
- if (hudState.variant) {
- this._setHudVariant(hudState.variant);
- }
- if (typeof hudState.visible === 'boolean') {
- this.hud.setMode(hudState.visible ? 'on' : 'off');
- this._updateHudButtonState();
- }
-
- const scopeState = state.scope || {};
- if (typeof scopeState.enabled === 'boolean') {
- setScopeMaskEnabled(scopeState.enabled);
- this._scopeBtn?.classList.toggle('active', scopeState.enabled);
- this._scopeBtn?.setAttribute('aria-pressed', String(scopeState.enabled));
- }
- if (typeof scopeState.featherPct === 'number' && this._scopeFeatherSlider) {
- const pct = Math.max(0, Math.min(100, Math.round(scopeState.featherPct)));
- this._scopeFeatherSlider.value = String(pct);
- if (this._scopeFeatherValue) this._scopeFeatherValue.textContent = `${pct}%`;
- setScopeMaskFeather(pct / 100);
- }
-
- const detectionState = state.detection || {};
- if (typeof detectionState.density === 'number' && this._detectionDensitySlider) {
- const pct = canonicalizeDensity(detectionState.density);
- this._detectionDensitySlider.value = String(pct);
- if (this._detectionDensityValue) this._detectionDensityValue.textContent = `${pct}%`;
- this._applyDetectionDensityFromUi();
- }
- if (detectionState.allocation) {
- this._setDetectionAllocation(detectionState.allocation, { syncShare: false });
- }
- if (typeof detectionState.fadePct === 'number' && this._detectionFadeSlider) {
- this._detectionFadeSlider.value = String(detectionState.fadePct);
- }
- if (typeof detectionState.outsideOpacityPct === 'number' && this._detectionOpacitySlider) {
- this._detectionOpacitySlider.value = String(detectionState.outsideOpacityPct);
- }
- this._applyDetectionFadeFromUi();
- if (detectionState.mode) {
- this._setDetectionMode(detectionState.mode);
- }
-
- if (state.mapStack) {
- // The stack switch is itself a MUTATION, not merely a suspension point,
- // so it needs a gate on BOTH sides of the await.
- if (superseded()) return false;
- const stackBefore = this.mapStackController?.getActiveId?.() ?? null;
- const genBefore = this.mapStackController?.getSwitchGeneration?.() ?? null;
-
- await this._setMapStack(state.mapStack, { syncShare: false });
-
- if (superseded()) {
- // Superseded DURING the switch, which the pre-check above cannot catch
- // and which has already moved the globe. The controller only
- // invalidates a switch when another setStack() arrives, and a winning
- // state that omits `mapStack` never issues one — every normalized scene
- // shot omits it — so this stale globe would simply stand. Put back what
- // the winner inherited.
- const genAfter = this.mapStackController?.getSwitchGeneration?.() ?? null;
- // _setMapStack issues exactly one setStack(), which advances the
- // generation once, or not at all when the stack was unavailable and
- // nothing was mutated. Anything past that is a NEWER switch whose
- // caller owns the globe now, and reverting would stomp a live intent.
- const globeIsStillOurs = genBefore !== null && genAfter !== null
- && genAfter <= genBefore + 1;
- const landed = this.mapStackController?.getActiveId?.() ?? null;
- if (globeIsStillOurs && stackBefore && landed !== stackBefore) {
- await this._setMapStack(stackBefore, { syncShare: false });
- }
- return false;
- }
- // Everything below is the uniform commit, already past its own gate.
- }
-
- if (state.styleParams && typeof state.styleParams === 'object') {
- for (const [styleName, params] of Object.entries(state.styleParams)) {
- const stage = this.stages[styleName];
- if (!stage || !params) continue;
- for (const [uniformName, uniformValue] of Object.entries(params)) {
- if (stage.uniforms[uniformName] === undefined) continue;
- stage.uniforms[uniformName] = uniformValue;
- }
- }
- this._updateSliderPanel(this.activeStyle);
- }
-
- this._syncShareState();
- return true;
- }
-
- /**
- * Resets the safe-frame overlay to its inactive state on init.
- * @returns {void}
- */
- _initRecordingOverlay() {
- if (!this._safeFrameOverlay || !this._safeFrameBox) return;
- this._safeFrameOverlay.classList.remove('active', 'ratio-9-16', 'ratio-16-9');
- }
-
- /**
- * Applies recording-friendly post-processing and shader uniform overrides.
- * @param {object} preset
- */
- applyCinematicPreset(preset = {}) {
- const bloomInput = typeof preset.bloom === 'object' ? preset.bloom : { intensity: preset.bloom };
- let decodedBloomIntensity = null;
- if (typeof bloomInput.intensity === 'number') {
- decodedBloomIntensity = decodeBloomIntensity(
- bloomInput.intensity,
- bloomInput.version ?? preset.bloomVersion ?? BLOOM_SCALE_VERSION
- );
- this._setBloomIntensity(decodedBloomIntensity, { syncShare: false });
- }
- if (typeof bloomInput.enabled === 'boolean') {
- this._setBloomEnabled(bloomInput.enabled);
- } else if (typeof bloomInput.intensity === 'number') {
- this._setBloomEnabled((decodedBloomIntensity ?? this._getBloomIntensity()) > 0);
- }
-
- const sharpenInput = typeof preset.sharpen === 'object' ? preset.sharpen : { enabled: preset.sharpen };
- if (typeof sharpenInput.intensity === 'number' && this._sharpenSlider) {
- const sharpenPct = Math.max(0, Math.min(100, Math.round(sharpenInput.intensity)));
- this._sharpenSlider.value = String(sharpenPct);
- this._sharpenSliderValue.textContent = `${sharpenPct}%`;
- this._applySharpenIntensity(sharpenPct / 100);
- }
- if (typeof sharpenInput.enabled === 'boolean') {
- this._setSharpenEnabled(sharpenInput.enabled);
- } else if (typeof sharpenInput.intensity === 'number') {
- this._setSharpenEnabled(sharpenInput.intensity > 0);
- }
-
- if (preset.hudVariant) {
- this._setHudVariant(preset.hudVariant);
- }
-
- if (preset.detectionMode) {
- this._setDetectionMode(preset.detectionMode);
- }
- if (typeof preset.detectionDensity === 'number' && this._detectionDensitySlider) {
- const density = canonicalizeDensity(preset.detectionDensity);
- this._detectionDensitySlider.value = String(density);
- this._detectionDensityValue.textContent = `${density}%`;
- this._applyDetectionDensityFromUi();
- }
- if (preset.detectionAllocation) {
- this._setDetectionAllocation(preset.detectionAllocation, { syncShare: false });
- }
-
- if (preset.styleParams && typeof preset.styleParams === 'object') {
- for (const [styleName, params] of Object.entries(preset.styleParams)) {
- const stage = this.stages[styleName];
- if (!stage || !params || typeof params !== 'object') continue;
- for (const [uniformName, uniformValue] of Object.entries(params)) {
- if (stage.uniforms[uniformName] === undefined) continue;
- stage.uniforms[uniformName] = uniformValue;
- }
- }
-
- // Keep slider panel values in sync when updating the active style.
- this._updateSliderPanel(this.activeStyle);
- }
-
- this._syncShareState();
- }
-
- /**
- * Enters or exits recording mode. When active, hides UI chrome via a body class,
- * displays a safe-frame composition overlay (16:9 or 9:16), and switches
- * the HUD to the specified mode. Exiting restores the HUD mode and layout
- * variant that were active before recording started.
- * @param {boolean} enabled - Whether to enable recording mode.
- * @param {object} [options]
- * @param {boolean} [options.hidePanels=true] - Hide all panel chrome.
- * @param {string} [options.hudMode='minimal'] - HUD mode while recording ('off'|'minimal'|'full'|'auto').
- * @param {string} [options.safeFrame='16:9'] - Aspect ratio for the safe-frame overlay.
- * @returns {void}
- */
- setRecordingMode(enabled, options = {}) {
- const { hidePanels = true, hudMode = 'minimal', safeFrame = '16:9' } = options;
- this._recordingMode = !!enabled;
- this._recordingConfig = { hidePanels, hudMode, safeFrame };
-
- document.body.classList.toggle('recording-mode', this._recordingMode && hidePanels);
-
- if (this._safeFrameOverlay) {
- this._safeFrameOverlay.classList.remove('ratio-9-16', 'ratio-16-9');
- this._safeFrameOverlay.classList.toggle('active', this._recordingMode);
- this._safeFrameOverlay.classList.add(safeFrame === '9:16' ? 'ratio-9-16' : 'ratio-16-9');
- }
-
- if (this._recordingMode) {
- // Snapshot the user's HUD state once per recording session so exit can
- // restore it (re-entrant calls must not capture mid-recording state).
- if (!this._preRecordingHudState) {
- this._preRecordingHudState = {
- mode: this.hud.getMode(),
- variant: this.hud.getVariant(),
- };
- }
- if (hudMode === 'off') {
- this.hud.setMode('off');
- } else if (hudMode === 'full' || hudMode === 'minimal') {
- this.hud.setMode('on');
- this.hud.setVariant(hudMode === 'minimal' ? 'minimal' : 'tactical');
- if (this._hudLayoutSelect) this._hudLayoutSelect.value = this.hud.getVariant();
- } else {
- this.hud.setMode('auto');
- }
- } else {
- const saved = this._preRecordingHudState;
- this._preRecordingHudState = null;
- if (saved) {
- this.hud.setVariant(saved.variant);
- if (this._hudLayoutSelect) this._hudLayoutSelect.value = this.hud.getVariant();
- }
- this.hud.setMode(saved ? saved.mode : 'auto');
- if (this._safeFrameOverlay) {
- this._safeFrameOverlay.classList.remove('active', 'ratio-9-16', 'ratio-16-9');
- }
- }
- this._hudBtn.classList.toggle('active', this.hud.visible);
- this._syncShareState();
- }
-
- // ── Parameter Sliders ─────────────────────────
-
- /**
- * Rebuilds the parameter slider panel for the given style's shader uniforms.
- * Creates a labeled range input for each tunable uniform. Hides the panel
- * for 'normal' mode which has no shader parameters.
- * @param {string} styleName - Style name whose uniforms to display.
- * @returns {void}
- */
- _updateSliderPanel(styleName, { reveal = false } = {}) {
- this._styleParameters ||= createStyleParameters({ container: this._sliderContainer });
- this._styleParameters.clear();
- const shader = STYLES[styleName];
-
- if (!shader || !shader.uniforms || styleName === 'normal') {
- this._sliderPanel.classList.remove('active');
- this._scheduleRightPanelLayout();
- return;
- }
-
- this._styleParameters.render({
- uniforms: shader.uniforms,
- readValue: (uName) => this.stages[styleName].uniforms[uName],
- writeValue: (uName, val) => {
- this.shareLinkManager?.claimRestoreLane?.('visual');
- this.stages[styleName].uniforms[uName] = val;
- },
- onChange: () => {
- // Uniform writes need an explicit render under the idle governor.
- governorRequestRender('style-param-slider');
- this._syncShareState();
- },
- });
-
- this._sliderPanel.classList.add('active');
- this._scheduleRightPanelLayout();
- if (reveal) this._revealStyleParameters();
- }
-
- /** Reveal the map-only parameter surface in the standard Display scroll owner. */
- _revealStyleParameters() {
- if (!this._sliderPanel?.classList.contains('active')) return;
- if (this._cockpitDisplayPortalActive) return;
- this._sliderPanel.classList.remove('collapsed');
- this._syncPanelCollapseButton(this._sliderPanel);
- this.setPanelCollapsed('pp-toggles', false, { explicit: true });
- requestAnimationFrame(() => requestAnimationFrame(() => {
- const scrollOwner = this._ppToggles;
- if (!scrollOwner) return;
- const ownerRect = scrollOwner.getBoundingClientRect();
- const panelRect = this._sliderPanel.getBoundingClientRect();
- scrollOwner.scrollTop += panelRect.top - ownerRect.top - 8;
- }));
- }
-
- // ── Style switching ───────────────────────────
-
- /**
- * Switches the active visual style. Handles full lifecycle:
- * 1. Crossfades the previous shader stage intensity to 0.
- * 2. Crossfades the new shader stage intensity to 1.
- * 3. Applies style preset defaults (bloom/sharpen/HUD) if applyPreset is true.
- * 4. Updates button highlights, style indicator, slider panel, HUD, and detection overlay.
- * @param {string} styleName - Target style ('normal'|'retro'|'surveillance'|'thermal'|'anime'|'noir'|'snow').
- * @param {object} [options]
- * @param {boolean} [options.applyPreset=true] - Whether to apply STYLE_PRESET_DEFAULTS for the new style.
- * @returns {void}
- */
- setStyle(styleName, {
- applyPreset = true,
- revealParameters = applyPreset,
- restore = false,
- } = {}) {
- if (!restore) this.shareLinkManager?.claimRestoreLane?.('visual');
- if (styleName === this.activeStyle) {
- if (revealParameters && styleName !== 'normal') this._revealStyleParameters();
- return;
- }
-
- const previousStyle = this.activeStyle;
- this.activeStyle = styleName;
- document.documentElement.dataset.gevStyle = styleName;
-
- // The celestial optics treatment belongs to the unfiltered globe only.
- // Leaving Normal turns it off; returning merely re-enables the control.
- this.setCelestialRingEnabled(false, { syncShare: false, focus: false });
-
- // Transition out the previous shader style
- if (previousStyle !== 'normal' && this.stages[previousStyle]) {
- this._startTransition(previousStyle, this.stages[previousStyle].uniforms.intensity, 0.0);
- }
-
- // Transition in the new shader style
- if (styleName !== 'normal' && this.stages[styleName]) {
- this._startTransition(styleName, this.stages[styleName].uniforms.intensity, 1.0);
- }
-
- if (applyPreset) {
- this._applyStylePresetDefaults(styleName);
- }
-
- // Update button UI
- document.querySelectorAll('.style-btn').forEach(btn => {
- btn.classList.toggle('active', btn.dataset.style === styleName);
- });
-
- // Update style indicator
- const displayNames = { surveillance: 'NVG', thermal: 'FLIR', retro: 'CRT' };
- this._styleIndicator.textContent = displayNames[styleName] || styleName.toUpperCase();
- this._updateStyleMiniStatus(styleName);
-
- // Update parameter sliders
- this._updateSliderPanel(styleName, { reveal: revealParameters });
-
- // Notify HUD (color adaptation + auto show/hide)
- this.hud.onStyleChange(styleName);
- this._updateHudButtonState();
-
- // Sync detection overlay tone to active post-process style
- setDetectionStyle(styleName);
- this._syncIrBoost();
- window.dispatchEvent(new CustomEvent('gev:style-change', {
- detail: { style: styleName },
- }));
-
- this._syncCockpitInheritedStyle();
-
- // Notify share link manager
- this.shareLinkManager.onStyleChange(styleName);
- this._syncShareState();
- }
-
- // ── Shader transitions ────────────────────────
-
- /**
- * Enqueues a smooth intensity transition for a shader stage. The animation
- * loop interpolates from `fromValue` to `toValue` over TRANSITION_DURATION_MS.
- * @param {string} styleName - Name of the shader stage to transition.
- * @param {number} fromValue - Starting intensity (typically current value).
- * @param {number} toValue - Target intensity (0.0 to fade out, 1.0 to fade in).
- * @returns {void}
- */
- _startTransition(styleName, fromValue, toValue) {
- this._visualEffects.startTransition(styleName, fromValue, toValue);
- }
-
- /**
- * Sample the manager's layer set and paint the global loading chip.
- * Driven by manager events AND by a ticker, because the underlying state
- * machine is TIME-driven (reveal delay, long-load threshold, terminal
- * dwell) — see _armLoadingFeedbackTicker.
- * @param {number} [now] - performance.now() sample.
- * @returns {void}
- */
- _updateGlobalLoadingFeedback(now = performance.now()) {
- if (!this._globalLoadingStatus) return;
- const summary = aggregateLayerLoading(this._dataManager?.getAll?.() || []);
- this._loadingFeedbackState = reduceLoadingFeedback(
- this._loadingFeedbackState,
- summary,
- now,
- this._loadingFeedbackEvent,
- );
- this._loadingFeedbackEvent = null;
- const presentation = presentGlobalLoadingStatus(
- this._globalStatusNotice,
- this._loadingFeedbackState,
- summary,
- now,
- );
- if (this._globalStatusNotice?.persistent !== true
- && Number.isFinite(this._globalStatusNotice?.hideAt)
- && now >= this._globalStatusNotice.hideAt) {
- this._globalStatusNotice = null;
- }
- // Loading phases and universal notices both have time-driven transitions.
- // Compute this after arbitration: a queued finite notice starts its dwell
- // only on its first visible frame, then keeps the ticker alive to expiry.
- const noticeNeedsTicker = Number.isFinite(this._globalStatusNotice?.hideAt);
- if (this._loadingFeedbackState?.phase !== 'idle' || noticeNeedsTicker) {
- this._armLoadingFeedbackTicker();
- }
- this._globalLoadingStatus.hidden = !presentation;
- if (!presentation) {
- delete this._globalLoadingStatus.dataset.state;
- return;
- }
- this._globalLoadingStatus.dataset.state = presentation.state;
- // Split-flap the LABEL only ("LOADING LIVE DATA" -> "LOAD COMPLETE").
- // setSplitFlapText is a no-op when the text is unchanged, which matters
- // here: this runs on every 60 ms and 500 ms tick. The detail line is the
- // live layer roster inside an ellipsised, width-capped span — flapping a
- // list that churns as layers join would be noise, not delight.
- setSplitFlapText(this._globalLoadingLabel, presentation.label);
- this._globalLoadingDetail.textContent = presentation.detail;
- }
-
- /** Show a message in the universal top-center status banner. */
- _showGlobalStatusNotice(message, options = {}) {
- const now = performance.now();
- this._globalStatusNotice = createGlobalStatusNotice(message, now, options);
- this._updateGlobalLoadingFeedback(now);
- }
-
- /**
- * Style animation loop — self-stopping (perf wave 2). Runs only while a
- * crossfade is in flight or an animated (time-uniform) stage is visible,
- * holding continuous scene render for exactly that long. Re-armed by
- * _startTransition and by _setStageIntensity enabling an animated stage.
- * The traffic sync chip no longer rides this loop — it has its own 500 ms
- * interval (see _startTrafficChipTicker).
- */
- _startAnimationLoop() {
- this._visualEffects.startAnimationLoop();
- }
-
- /**
- * 500 ms DOM ticker for the traffic sync chip (was per-frame). It also
- * polls the loading chip as a safety net: a camera-driven layer can flip
- * its own `stats.loading` without emitting a manager event, and that is
- * the one loading start the event path cannot see.
- */
- _startTrafficChipTicker() {
- if (this._trafficChipTicker) return;
- this._trafficChipTicker = setInterval(() => {
- if (document.hidden) return;
- this._updateTrafficSyncChip();
- this._updateGlobalLoadingFeedback();
- }, 500);
- }
-
- /**
- * Self-stopping 60 ms ticker for the global loading chip.
- *
- * The chip used to ride the style rAF loop, which perf wave 2 made
- * self-stopping — leaving the chip frozen mid-state whenever no crossfade
- * or animated shader was running (it would never reveal, never cross the
- * long-load threshold, and never dwell out). Its reducer
- * (src/loadingFeedback.js) is time-driven, so it needs real ticks; it is
- * also pure DOM, so it takes NO governor hold and requests no render.
- * Armed by _updateGlobalLoadingFeedback whenever loading leaves idle or a
- * universal notice begins, and stops once both have settled.
- * (rebase 2026-08-16: main's loading chip vs wave 2's stopped loop)
- * @returns {void}
- */
- _armLoadingFeedbackTicker() {
- // Never arm behind a hidden tab: the reducer cannot usefully advance a
- // chip nobody can see, and the old `return` INSIDE the interval left the
- // 60ms timer scheduled for the entire hidden period (a batch completing
- // while hidden could never clear it — the idle check sat behind the
- // hidden guard). visibilitychange resamples and re-arms on return.
- if (this._loadingFeedbackTicker || document.hidden) return;
- this._loadingFeedbackTicker = setInterval(() => {
- if (document.hidden) {
- this._stopLoadingFeedbackTicker();
- return;
- }
- const now = performance.now();
- this._lastLoadingFeedbackUpdateAt = now;
- this._updateGlobalLoadingFeedback(now);
- const noticeNeedsTicker = Number.isFinite(this._globalStatusNotice?.hideAt);
- if (this._loadingFeedbackState?.phase === 'idle' && !noticeNeedsTicker) {
- this._stopLoadingFeedbackTicker();
- }
- }, 60);
- }
-
- /** Stop the loading-chip ticker if it is running. Idempotent. */
- _stopLoadingFeedbackTicker() {
- if (!this._loadingFeedbackTicker) return;
- clearInterval(this._loadingFeedbackTicker);
- this._loadingFeedbackTicker = null;
- }
-
- // ── Location Bar ─────────────────────────────
-
- /**
- * Initializes the location bar: renders city pills from CITY_POIS, sets up
- * QWERTY keyboard navigation for POI selection, wires the search toggle
- * and geocoding search input.
- * @returns {void}
- */
- _initLocationBar() {
- this._locationControls?.destroy();
- this._locationLookup?.destroy();
- this._locationLookup = new LocationSearch({
- input: this._locationSearch,
- begin: () => this._beginDeferredNavigation('location'),
- isCurrent: (generation) => !this._disposed && generation === this._navigationGeneration,
- beforeFly: (generation) => this._reassertNavigationHandoff(generation),
- search: (query, options) => searchAndFlyTo(this.viewer, query, {
- placeSearch: this.placeSearch,
- ...options,
- }),
- onStart: (generation) => { this._activeLocationSearchGeneration = generation; },
- onResult: (destination, query) => {
- this._searchedLocationLabel = destination.label || query;
- this._setActiveLocation(null);
- this._currentPoi = null;
- this._collapsePOIRow();
- this._updateLocationMiniStatus();
- },
- onMissing: () => this._showToast('Location not found'),
- onError: (error) => {
- console.error('[Search] Geocoding failed:', error);
- this._showToast('Search failed');
- },
- onSettled: (generation) => this._settleLocationSearchUi(generation),
- });
- this._locationControls = new LocationControls({
- elements: {
- pills: this._locationPills, poiRow: this._poiRow, divider: this._locationBarDivider,
- search: this._locationSearch, searchToggle: this._searchToggle,
- resetButtons: [this._resetGlobeBtn, this._cockpitResetGlobeBtn],
- statusCity: this._locationMiniCity, statusPoi: this._locationMiniPoi,
- },
- cities: CITY_POIS,
- getExpandedCity: () => this._expandedCityId,
- onCity: (id) => this._onCityPillClick(id),
- onPoi: (id, index) => this._onPoiClick(id, index),
- onSearch: (query) => this._locationLookup.run(query),
- onReset: () => this.resetToGlobeView(),
- });
- }
-
- /**
- * Signals the start of an inter-city world jump: notifies the traffic layer
- * to pause tile fetching and suspends detection overlays to prevent stale
- * rendering during the flight.
- * @returns {void}
- */
- _beginWorldJumpTransition() {
- clearTimeout(this._trafficTransitionTimer);
- trafficLayer.beginWorldJump?.();
- suspendDetection('intercity');
- }
-
- /**
- * Signals the end of an inter-city world jump: resumes traffic tile fetching,
- * resumes detection overlays, and forces a traffic sync chip update.
- * @returns {void}
- */
- _endWorldJumpTransition() {
- clearTimeout(this._trafficTransitionTimer);
- trafficLayer.endWorldJump?.();
- resumeDetection();
- this._updateTrafficSyncChip(true);
- }
-
- /**
- * Wraps a fly-to action with world-jump transition hooks when the target
- * city differs from the current one. Applies begin/end transition signals
- * with a 5.2s safety timeout to guarantee cleanup if the flight callback
- * never fires onComplete.
- * @param {boolean} cityChanged - Whether the destination is in a different city.
- * @param {function} flyAction - Callback receiving `{onStart, onComplete}` hooks; should return a result with targetPosition.
- * @returns {*} Return value from flyAction.
- */
- _flyWithTransition(cityChanged, flyAction) {
- return this._runExplicitNavigation('location', () => {
- if (!cityChanged) return flyAction({});
- let completed = false;
- const finalize = () => {
- if (completed) return;
- completed = true;
- this._endWorldJumpTransition();
- };
- const result = flyAction({
- onStart: () => this._beginWorldJumpTransition(),
- onComplete: finalize,
- });
- this._trafficTransitionTimer = window.setTimeout(finalize, 5200);
- return result;
- });
- }
-
- /**
- * Release camera ownership when a resolved Location destination starts.
- * Contact mode and its selected subject remain intact so FOCUS can return to
- * that subject after the user finishes inspecting the destination.
- * @returns {boolean} Whether a Contact subject remains selected.
- */
- beginLocationNavigation() {
- this._stampNavigation();
- this.cockpitView?.exit({ restoreTracking: false });
- return this._releaseFollowCamera({ preserveVesselSelection: false });
- }
-
- /**
- * Handles a city pill click: toggles POI row collapse if same city,
- * otherwise expands the POI row, flies to the city's first POI, and
- * tracks the target position for orbit mode.
- * @param {string} cityId - Identifier of the clicked city.
- * @returns {void}
- */
- _onCityPillClick(cityId) {
- if (this._expandedCityId === cityId) {
- // Same city clicked again — toggle collapse
- this._collapsePOIRow();
- return;
- }
-
- const isCityChanged = this._activeLocationId && this._activeLocationId !== cityId;
- const result = this._flyWithTransition(!!isCityChanged, (hooks) => flyToPresetLocation(this.viewer, cityId, hooks));
- if (result === false) return;
- this._expandPOIRow(cityId);
- this._setActiveLocation(cityId);
- this._activePoiIndex = 0;
- this._updatePoiHighlight();
-
- // Track current target + POI for orbit
- if (result) {
- this._currentTarget = result.targetPosition;
- this._currentPoi = CITY_POIS[cityId].pois[0];
- }
- this._updateLocationMiniStatus();
- }
-
- /**
- * Handles a POI pill click: stops orbit, flies to the POI, highlights it,
- * and saves the target position for future orbit activation.
- * @param {string} cityId - Parent city identifier.
- * @param {number} poiIndex - Index of the POI within the city's pois array.
- * @returns {void}
- */
- _onPoiClick(cityId, poiIndex) {
- const isCityChanged = this._activeLocationId && this._activeLocationId !== cityId;
- const result = this._flyWithTransition(!!isCityChanged, (hooks) => flyToPOI(this.viewer, cityId, poiIndex, hooks));
- if (result === false) return;
- this._setActiveLocation(cityId);
- this._activePoiIndex = poiIndex;
- this._updatePoiHighlight();
-
- // Track current target + POI for orbit
- if (result) {
- this._currentTarget = result.targetPosition;
- this._currentPoi = CITY_POIS[cityId].pois[poiIndex];
- }
- this._updateLocationMiniStatus();
- }
-
- /**
- * Builds and shows the POI pill row for a city. Each pill displays a
- * QWERTY keyboard shortcut key and the POI name.
- * @param {string} cityId - City whose POIs to render.
- * @returns {void}
- */
- _expandPOIRow(cityId) {
- if (!CITY_POIS[cityId]) return;
- this._expandedCityId = cityId;
- this._locationControls.showPois(cityId);
- }
-
- /**
- * Hides the POI pill row and clears the expanded city state.
- * @returns {void}
- */
- _collapsePOIRow() {
- this._expandedCityId = null;
- this._activePoiIndex = null;
- this._locationControls.hidePois();
- }
-
- /**
- * Highlights the active POI pill and removes highlight from all others.
- * @returns {void}
- */
- _updatePoiHighlight() {
- this._locationControls.highlightPoi(this._activePoiIndex);
- }
-
- /**
- * Forget the last free-text search destination and repaint the LOCATION
- * readout. Public so camera owners that fly on their own — scene playback
- * most of all — can invalidate it without reaching into private state.
- * @returns {void}
- */
- clearSearchedLocation() {
- if (this._searchedLocationLabel === null) return;
- this._searchedLocationLabel = null;
- this._updateLocationMiniStatus();
- }
-
- /**
- * Sets the active city location, highlights its pill, and updates the mini-status readout.
- * @param {string|null} locationId - City identifier, or null to clear.
- * @returns {void}
- */
- _setActiveLocation(locationId) {
- this._activeLocationId = locationId;
- // A preset city is now what the camera is framed on, so any earlier
- // free-text destination has been superseded. Clearing only on a real id
- // leaves the search path's own _setActiveLocation(null) untouched.
- if (locationId) this._searchedLocationLabel = null;
- this._locationControls?.highlightCity(locationId);
- this._updateLocationMiniStatus();
- }
-
- /**
- * Updates the collapsed mini-status readout with the current destination:
- * a preset city + POI/landmark, or the last free-text geocode search.
- * @returns {void}
- */
- _updateLocationMiniStatus() {
- this._locationControls?.renderStatus({
- city: this._activeLocationId ? CITY_POIS[this._activeLocationId] : null,
- currentPoi: this._currentPoi,
- searchedLabel: this._searchedLocationLabel,
- });
- }
-
- /**
- * Updates the collapsed mini-status readout with the active style label.
- * @param {string} [styleName=this.activeStyle] - Style name to display.
- * @returns {void}
- */
- _updateStyleMiniStatus(styleName = this.activeStyle) {
- if (!this._styleMiniValue) return;
- this._styleMiniValue.textContent = STYLE_STATUS_LABELS[styleName] || String(styleName || 'normal').toUpperCase();
- }
-
- // ── Orbit Mode ──────────────────────────────
-
- /**
- * Creates the orbit mode indicator DOM element and appends it to the body.
- * @returns {void}
- */
- _initOrbit() {
- this._orbitIndicator = this._locationControls.createOrbitIndicator();
- }
-
- /**
- * Toggles the orbit controller around the current POI target. Shows a toast
- * if no target position has been set (user must fly to a POI first).
- * @returns {void}
- */
- _toggleOrbit() {
- if (!this._currentTarget) {
- this._showToast('Fly to a POI first');
- return;
- }
-
- const isActive = this.orbitController.toggle(this._currentTarget, {
- radius: this._currentPoi?.alt || 500,
- pitch: this._currentPoi?.pitch || -30,
- });
-
- this._orbitIndicator.classList.toggle('active', isActive);
- }
-
- /**
- * Stops orbit mode if active and hides the orbit indicator.
- * @returns {void}
- */
- _stopOrbit() {
- if (this.orbitController.active) {
- this.orbitController.stop();
- this._orbitIndicator.classList.remove('active');
- }
- }
-
- /** Wire the top-center action that clears only manager-owned data layers. */
- _initClearSelectedLayersButton() {
- if (!this._clearSelectedLayersBtn) return;
- this._clearLayersControl?.destroy();
- this._clearLayersControl = bindClearLayersControl(this._clearSelectedLayersBtn, () => this.clearSelectedLayers());
- }
-
- /**
- * Clear every selected data layer without resetting visual, map, HUD, or
- * camera state. A layer may still release camera work it owns as part of its
- * established disable lifecycle.
- * @returns {Promise<object>} Aggregate manager lifecycle truth for the batch.
- */
- clearSelectedLayers(...args) { return this._contextControls?.clearSelectedLayers(...args); }
-
- /**
- * Release every camera owner and return to the canonical full-globe frame.
- * Repeated requests adopt the in-flight reset rather than cancelling it.
- * @returns {Promise<object>} Canonical reset result shared with voice.
- */
- resetToGlobeView() {
- if (this._globeResetPromise) return this._globeResetPromise;
- this._stampNavigation();
- interruptCameraMotion('reset-globe');
- this._stopOrbit();
- this.cockpitView?.exit({ restoreTracking: false });
- try {
- militaryAwarenessLayer.releaseCameraOwnership?.({ origin: 'tool' });
- } catch {
- // Keep reset available if Context has not initialized completely.
- try { flightsLayer.stopTracking?.({ origin: 'tool' }); } catch { /* best-effort release */ }
- try { militaryFlightsLayer.stopTracking?.({ origin: 'tool' }); } catch { /* best-effort release */ }
- try { aisLiveVesselsLayer.clearSelection?.(); } catch { /* best-effort release */ }
- }
- try { satellitesLayer.stopTracking?.({ origin: 'tool' }); } catch { /* best-effort release */ }
- try { rocketLaunchesLayer.releaseCameraOwnership?.(); } catch { /* best-effort release */ }
- this.viewer.trackedEntity = undefined;
- this.viewer.camera.cancelFlight();
- this.viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
- this._beginWorldJumpTransition();
-
- let resolveReset;
- const resetPromise = new Promise((resolve) => { resolveReset = resolve; });
- this._globeResetPromise = resetPromise;
- let settled = false;
- let timer = null;
- const finish = (cancelled = false) => {
- if (settled) return;
- settled = true;
- clearTimeout(timer);
- this._endWorldJumpTransition();
- const carto = this.viewer.camera.positionCartographic;
- const result = {
- ok: !cancelled,
- action: 'zoom_to_globe',
- cancelled,
- heightKm: Math.round(GLOBE_VIEW.heightM / 1000),
- centeredOn: {
- latitude: Number(Cesium.Math.toDegrees(carto.latitude).toFixed(2)),
- longitude: Number(Cesium.Math.toDegrees(carto.longitude).toFixed(2)),
- },
- };
- this._resetGlobeBtn?.setAttribute('aria-label', 'Reset to full globe view');
- this._cockpitResetGlobeBtn?.setAttribute('aria-label', 'Reset cockpit to full globe view');
- this._globeResetPromise = null;
- resolveReset(result);
- };
- timer = window.setTimeout(() => {
- const height = this.viewer.camera.positionCartographic?.height;
- finish(!Number.isFinite(height) || Math.abs(height - GLOBE_VIEW.heightM) > 1000);
- }, 4200);
- this._resetGlobeBtn?.setAttribute('aria-label', 'Resetting to full globe view');
- this._cockpitResetGlobeBtn?.setAttribute('aria-label', 'Resetting cockpit to full globe view');
- const target = flyToGlobeView(this.viewer, {
- onComplete: () => finish(false),
- onCancel: () => finish(true),
- });
- if (!target) finish(true);
- return resetPromise;
- }
-
- // ── Share Button ─────────────────────────────
-
- /**
- * Wires the share button click to copy the current share link to the clipboard.
- * @returns {void}
- */
- _initShareButton() {
- this._shareBtn.addEventListener('click', async () => {
- const success = await this.shareLinkManager.copyLink();
- this._showToast(success ? 'Link copied!' : 'Copy failed');
- });
- }
-
- /**
- * Displays a temporary toast notification for 2 seconds.
- * @param {string} message - Text to show in the toast.
- * @returns {void}
- */
- _showToast(message) {
- this._toast.textContent = message;
- this._toast.classList.add('visible');
- clearTimeout(this._toastTimer);
- this._toastTimer = setTimeout(() => {
- this._toast.classList.remove('visible');
- }, 2000);
- }
-
- // ── HUD Toggle ───────────────────────────────
-
- /**
- * Wires the HUD toggle button, initializes the default HUD variant to 'tactical',
- * and sets up the detection mode cycle button.
- * @returns {void}
- */
- /**
- * Wires the DISPLAY-rail "3D" toggle to the flights layer's `models3d` param.
- * ON by default in `proximity` mode (owner directive 2026-08-22): the fleet
- * renders as 3D glTF models once the camera is zoomed in past the layer's
- * altitude ceiling, and only the nearest MODEL_MAX in view are admitted, so
- * the default costs nothing at globe scale. `all` is the deliberate opt-in;
- * turning the toggle off returns the fleet to flat billboards. The TRACKED
- * contact is independent of this toggle (see trackedModelRegime.js).
- * @returns {void}
- */
- /** One 3D toggle drives BOTH aircraft layers (commercial + military) so all planes flip together. */
- _setModels3dParams(params, { origin = 'user' } = {}) {
- this._dataManager?.setLayerParams('flights', params, { origin });
- this._dataManager?.setLayerParams('military', params, { origin });
- }
-
- _syncModels3dFromLayerState(state) {
- const options = state?.options?.flights;
- if (!options) return;
- this._models3dEnabled = options.models3d === true;
- this._models3dMode = options.models3dMode === 'all' ? 'all' : 'proximity';
- this._syncModels3dButtonState();
- this._models3dModeRow?.classList.toggle('visible', this._models3dEnabled);
- for (const button of this._models3dModeBtns || []) {
- if (!button) continue;
- const active = button.dataset.mode === this._models3dMode;
- button.classList.toggle('active', active);
- button.setAttribute('aria-checked', String(active));
- }
- this._layoutRightPanels();
- }
-
- _syncModels3dModeRow() {
- if (this._models3dModeRow) this._models3dModeRow.classList.toggle('visible', this._models3dEnabled);
- this._layoutRightPanels();
- }
-
- _initModels3dToggle() {
- if (!this._models3dBtn) return;
- this._syncModels3dButtonState();
- this._syncModels3dModeRow();
- }
-
- _setModels3dEnabled(enabled) {
- this._models3dEnabled = !!enabled;
- this._setModels3dParams({ models3d: this._models3dEnabled });
- this._syncModels3dButtonState();
- }
-
- _setModels3dMode(mode) {
- const normalized = mode === 'all' ? 'all' : 'proximity';
- this._models3dMode = normalized;
- this._setModels3dParams({ models3dMode: normalized });
- for (const button of this._models3dModeBtns) {
- if (!button) continue;
- const active = button.dataset.mode === normalized;
- button.classList.toggle('active', active);
- button.setAttribute('aria-checked', String(active));
- }
- this._syncModels3dButtonState();
- }
-
- _syncModels3dButtonState() {
- this._models3dBtn?.classList.toggle('active', this._models3dEnabled);
- // The lit/dark state is a colour to a sighted operator and nothing at all to
- // a screen reader without this. It matters more now that the button ships
- // ACTIVE from markup (default-on, 2026-08-22): the very first thing assistive
- // tech reported was an unpressed-looking control over an armed layer.
- // Mirrors #scope-toggle, which has always carried aria-pressed.
- this._models3dBtn?.setAttribute('aria-pressed', String(this._models3dEnabled));
- }
-
- _initHUDToggle() {
- if (this._hudLayoutSelect) {
- this._hudLayoutSelect.value = 'tactical';
- }
- this._setHudVariant('tactical');
- this.hud.setMode('on');
- this._updateHudButtonState();
-
- this._cockpitDisplayToggleBtn?.addEventListener('click', () => {
- const open = this._cockpitDisplayToggleBtn.getAttribute('aria-expanded') === 'true';
- this._setCockpitDisclosure?.('display', !open);
- });
- this._initCockpitDisplayPortal();
- }
-
- /**
- * Reuses the production Display controls inside Cockpit without cloning
- * stateful inputs or event listeners. Comment anchors preserve each group's
- * exact home in the standard Display panel for exit and teardown.
- * @returns {void}
- */
- _initCockpitDisplayPortal() {
- this._cockpitDisplayPortal?.destroy();
- this._cockpitDisplayPortal = new CockpitDisplayPortal({
- standardPanel: this._ppToggles,
- cockpitPanel: this._cockpitDisplayPanel,
- groups: [
- ['hud', this._hudBtn?.closest('.pp-toggle-group')],
- ['detection', this._detectionBtn?.closest('.pp-toggle-group')],
- ['parameters', this._sliderPanel],
- ['models3d', this._models3dBtn?.closest('.pp-toggle-group')],
- ],
- layout: () => {
- this._layoutRightPanels();
- this.cockpitView?.scheduleContextLayout();
- },
- });
- }
-
- /**
- * Moves the shared HUD, Detection, Parameters, and 3D controls into or out
- * of Cockpit.
- * @param {boolean} active Whether Cockpit owns the Display control groups.
- * @returns {void}
- */
- _setCockpitDisplayPortalActive(active) { this._cockpitDisplayPortal?.setActive(active); }
- get _cockpitDisplayPortalActive() { return this._cockpitDisplayPortal?.active ?? false; }
- get _displayPortalScrollRestoreOwner() { return this._cockpitDisplayPortal?.restoreOwner ?? null; }
- get _standardDisplayScrollTop() { return this._cockpitDisplayPortal?.standardScrollTop ?? 0; }
-
- /**
- * Syncs the HUD toggle button active class and HUD layout row visibility
- * with the current HUD visible state.
- * @returns {void}
- */
- _updateHudButtonState() {
- this._hudBtn.classList.toggle('active', this.hud.visible);
- if (this._hudLayoutRow) {
- this._hudLayoutRow.classList.toggle('visible', this.hud.visible);
- }
- this._scheduleAdaptivePanelLayout({ settle: true });
- }
-
- /**
- * Updates the detection toggle button label and CSS classes to reflect
- * the current density-derived profile. Also toggles the density and
- * allocation controls together.
- * @param {string} modeLabel - Current detection mode label.
- * @returns {void}
- */
- _updateDetectionButton(modeLabel) {
- const btn = this._detectionBtn;
- const enabled = modeLabel !== 'OFF';
- btn.setAttribute('aria-pressed', String(enabled));
- btn.setAttribute('aria-label', enabled
- ? `Detection overlay: ${String(modeLabel).toLowerCase()}`
- : 'Detection overlay: off');
- btn.classList.remove('active', 'god', 'panoptic');
- if (modeLabel === 'SPARSE') {
- btn.querySelector('.pp-label').textContent = 'SPARSE';
- btn.classList.add('active');
- } else if (modeLabel === 'BALANCED') {
- btn.querySelector('.pp-label').textContent = 'BALANCED';
- btn.classList.add('active');
- } else if (modeLabel === 'DENSE') {
- btn.querySelector('.pp-label').textContent = 'DENSE';
- btn.classList.add('active', 'panoptic');
- } else {
- btn.querySelector('.pp-label').textContent = 'DETECT';
- }
-
- if (this._detectionSliderRow) {
- this._detectionSliderRow.classList.toggle('visible', modeLabel !== 'OFF');
- }
- if (this._detectionAllocationRow) {
- this._detectionAllocationRow.classList.toggle('visible', modeLabel !== 'OFF');
- }
- if (this._detectionFadeRow) {
- this._detectionFadeRow.classList.toggle('visible', modeLabel !== 'OFF');
- }
- if (this._detectionOpacityRow) {
- this._detectionOpacityRow.classList.toggle('visible', modeLabel !== 'OFF');
- }
- this._layoutRightPanels();
- }
-
- /**
- * Positions the parameter slider panel directly below the right-rail toggle
- * panel, right-aligned to it. Clamps to viewport bounds to prevent overflow.
- * Runs inside a rAF to batch with other layout reads.
- * @returns {void}
- */
- _layoutRightPanels() {
- this._scheduleRightPanelLayout();
- }
-
- /**
- * Recalculates the CCTV panel max-height based on its current top position
- * and the window height, enabling internal scroll without viewport overflow.
- * @returns {void}
- */
- _syncCctvPanelViewport() {
- if (!this._cctvPanel) return;
- const inner = this._cctvPanel.querySelector('.cctv-panel-inner');
- requestAnimationFrame(() => {
- if (this._cctvPanel.parentElement?.id === 'right-context-rail') {
- this._cctvPanel.style.maxHeight = '';
- if (inner) inner.style.maxHeight = '';
- this._scheduleRightPanelLayout();
- return;
- }
- const rect = this._cctvPanel.getBoundingClientRect();
- const availableHeight = Math.max(190, Math.floor(window.innerHeight - rect.top - 12));
- this._cctvPanel.style.maxHeight = `${availableHeight}px`;
- if (inner) {
- inner.style.maxHeight = `${availableHeight}px`;
- }
- });
- }
-
- /** Whether a share link was used to load the page */
- get hasShareState() {
- return !!this._hasShareState;
- }
-
- /** Terminal result for the complete initial share restoration. */
- get initialRestorePromise() {
- return this._initialShareRestorePromise || Promise.resolve({ status: 'not-requested' });
- }
-
- _settleInitialShareRestore(result) {
- if (!this._resolveInitialShareRestore) return;
- const resolve = this._resolveInitialShareRestore;
- this._resolveInitialShareRestore = null;
- resolve(result);
- window.dispatchEvent(new CustomEvent('gev:initial-share-restore-settled', { detail: result }));
- }
-
- /**
- * Tear down the StyleManager — cancel animation loop, clear intervals,
- * and release resources. Call this before discarding the instance to
- * prevent leaked rAF loops and event listeners.
- * @returns {Promise<void>} Resolves after focused-session state restoration.
- */
- async dispose() {
- if (this._disposed) return;
- this._shareTrackingNoticeGeneration += 1;
- this._shareTrackingAcquiringKey = null;
- this._globalStatusNotice = null;
- if (this._globalLoadingStatus) this._globalLoadingStatus.hidden = true;
- this._disposed = true;
- this._applicationShortcuts?.destroy();
- this._displayControls?.destroy();
- this._mapSourceControls?.destroy();
- this._clearLayersControl?.destroy();
- this._locationControls?.destroy();
- this._cctvControls?.destroy();
- this._radioControls?.destroy();
- this.cockpitView?.stop();
- this._cockpitDisplayPortal?.stop();
- this._visualEffects.stop();
- this._styleParameters?.destroy();
- for (const control of this._panelDisclosureControls || []) control.destroy();
- this._panelDisclosureControls = [];
- this._hoverPanelControls?.forEach((control) => control.destroy());
- this._hoverPanelControls?.clear();
- this._locationLookup?.destroy();
- this._cancelMapSourceFocus?.();
- // Revoke persistence/hash authority before teardown can emit manager changes.
- this._layerStateCoordinator?.destroy();
- this._layerStateCoordinator = null;
- this._layerStateRestorePromise = null;
- clearTimeout(this._initialShareRestoreTimeout);
- this._initialShareRestoreTimeout = null;
- this._settleInitialShareRestore({ status: 'destroyed', share: null, layers: [] });
- if (this._initialShareGestureHandler) {
- this.viewer?.canvas?.removeEventListener('pointerdown', this._initialShareGestureHandler);
- this.viewer?.canvas?.removeEventListener('wheel', this._initialShareGestureHandler);
- this._initialShareGestureHandler = null;
- }
- this.shareLinkManager?.destroy();
- if (this._awarenessSelectedHandler) {
- window.removeEventListener('gev:awareness-subject-selected', this._awarenessSelectedHandler);
- this._awarenessSelectedHandler = null;
- }
- if (this._awarenessClearedHandler) {
- window.removeEventListener('gev:awareness-subject-cleared', this._awarenessClearedHandler);
- this._awarenessClearedHandler = null;
- }
-
- // Invalidate any in-flight Context transaction the same way a newer request
- // would. Without this, a reinstatement already past its awaits could
- // re-enable a mode's entry layer and republish `_contextMode` while the
- // rest of teardown is tearing those very layers down.
- this._contextControls.stop();
- this._stampNavigation();
- // Close camera-entry seams synchronously. Context restoration may await
- // layer work, so leaving these listeners attached until afterward lets a
- // focus event release tracking or start a flight during teardown.
- this._removeCctvRequestFocusListener?.();
- this._removeCctvRequestFocusListener = null;
- this._cctvRequestFocusHandler = null;
- this._removeWorldRequestFocusListener?.();
- this._removeWorldRequestFocusListener = null;
- this._worldRequestFocusHandler = null;
- this._navigationOwnerChangedRemover?.();
- this._navigationOwnerChangedRemover = null;
- this._removeNavigationAuthorityListener?.();
- this._removeNavigationAuthorityListener = null;
- await this._contextControls.restoreForDisposal();
- // IR boost teardown BEFORE detaching the data manager: restore fog and
- // un-boost both aircraft layers so a surviving viewer or replacement
- // manager doesn't inherit sensor state (review P2, 2026-08-16).
- if (this._irBoostActive) {
- if (this._irFogWasEnabled != null && this.viewer?.scene?.fog) {
- this.viewer.scene.fog.enabled = this._irFogWasEnabled;
- }
- this._dataManager?.setLayerParams('flights', { irBoost: false });
- this._dataManager?.setLayerParams('military', { irBoost: false });
- this._irBoostActive = false;
- this._irFogWasEnabled = null;
- }
- this.cockpitView?.dispose();
- this._cockpitDisplayPortal?.destroy();
- this._cockpitDisplayPortal = null;
- this._contextControls.disconnect();
- this._dataManagerUnsubscribe?.();
- this._dataManagerUnsubscribe = null;
-
- this._commandDockTrayObserver?.disconnect?.();
- this._commandDockTrayObserver = null;
- this._draggableResizeObserver?.disconnect();
- this._draggableResizeObserver = null;
- if (this._windowResizeHandler) {
- window.removeEventListener('resize', this._windowResizeHandler);
- this._windowResizeHandler = null;
- }
- if (this._loadingVisibilityHandler) {
- document.removeEventListener('visibilitychange', this._loadingVisibilityHandler);
- this._loadingVisibilityHandler = null;
- }
- this._stopLoadingFeedbackTicker();
-
- // Stop the independently owned traffic and loading feedback tickers.
-
- if (this._trafficChipTicker) {
- clearInterval(this._trafficChipTicker);
- this._trafficChipTicker = null;
- }
- if (this._loadingFeedbackTicker) {
- clearInterval(this._loadingFeedbackTicker);
- this._loadingFeedbackTicker = null;
- }
- if (this._leftStackLayoutFrame !== null) {
- cancelAnimationFrame(this._leftStackLayoutFrame);
- this._leftStackLayoutFrame = null;
- }
- if (this._rightStackLayoutFrame !== null) {
- cancelAnimationFrame(this._rightStackLayoutFrame);
- this._rightStackLayoutFrame = null;
- }
- clearTimeout(this._adaptivePanelSettleTimer);
- this._adaptivePanelSettleTimer = null;
- this._leftStackResizeObserver?.disconnect();
- this._leftStackResizeObserver = null;
- this._leftStackMutationObserver?.disconnect();
- this._leftStackMutationObserver = null;
- this._rightStackResizeObserver?.disconnect();
- this._rightStackResizeObserver = null;
- this._rightStackMutationObserver?.disconnect();
- this._rightStackMutationObserver = null;
- if (this._leftStackHudTransitionHandler) {
- document.getElementById('intel-hud')?.removeEventListener(
- 'transitionend',
- this._leftStackHudTransitionHandler,
- );
- this._leftStackHudTransitionHandler = null;
- }
- if (this._rightStackHudTransitionHandler) {
- document.getElementById('intel-hud')?.removeEventListener(
- 'transitionend',
- this._rightStackHudTransitionHandler,
- );
- this._rightStackHudTransitionHandler = null;
- }
- if (this._leftStackCockpitModeHandler) {
- window.removeEventListener('gev:cockpit-mode-changed', this._leftStackCockpitModeHandler);
- this._leftStackCockpitModeHandler = null;
- }
-
- destroyTrackedReadout();
- destroyDetection();
- destroyWorldOverlay();
- this._visualEffects.destroy();
- }
-}
+/** Compatibility entry for the standalone application's UI composition. */
+export { StyleManager } from './standalone/ui.js';
diff --git a/src/ui/applicationShell.js b/src/ui/applicationShell.js
new file mode 100644
index 000000000..b84da86f2
--- /dev/null
+++ b/src/ui/applicationShell.js
@@ -0,0 +1,4421 @@
+import { UiLifetime } from './uiLifetime.js';
+import { RecordingControls } from './recordingControls.js';
+import { readShellElements } from './shellElements.js';
+import { CockpitViewController, CockpitDisplayPortal } from './cockpit.js';
+import { ContextControls } from './context.js';
+import { CctvControls } from './cctv.js';
+import { RadioControls } from './radio.js';
+import { LocationControls } from './location.js';
+import { bindClearLayersControl } from './layers.js';
+import { createMapSourceControls } from './mapSource.js';
+import { VisualEffects, STYLES, GLOBAL_POST_DEFAULTS, STYLE_PRESET_DEFAULTS, MILITARY_DETECTION_PRESET } from './effects.js';
+import { bindDisplayControls } from './displayControls.js';
+import { bindApplicationShortcuts, createStyleParameters } from './visualInput.js';
+import { PanelLayoutController } from './panelLayoutController.js';
+import { bindPanelDisclosure, collapsePanelOnEscape, createHoverDisclosure } from './panelDisclosure.js';
+import * as Cesium from 'cesium';
+import { BLOOM_SCALE_VERSION, clampBloomIntensity, decodeBloomIntensity } from '../bloom.js';
+
+import {
+ aircraftTrackingTarget,
+ enterCockpitWithTracking,
+} from '../cockpitTracking.js';
+
+import {
+ isExplicitLayerStateOrigin,
+ LayerStateCoordinator,
+} from '../data/layerState.js';
+
+import {
+ ALLOCATION_STRATEGIES,
+ canonicalizeDensity,
+ defaultDensityForProfile,
+ normalizeAllocationStrategy,
+ normalizeProfile,
+ profileForDensity,
+} from '../data/detectionPolicy.js';
+
+import { canPresentDeferredStatusNotice } from '../loadingFeedback.js';
+import { ShellFeedback } from './shellFeedback.js';
+import { PanelPositionControls } from './panelPositionControls.js';
+import { cockpitEntryAllowed } from '../contextModePolicy.js';
+
+import { applyCockpitVisionStageIntensities, captureCockpitVisionBaseline, normalizeCockpitVisionMode } from '../cockpitVisionPolicy.js';
+import {
+ applyContactsDetection,
+ shareCacheNeedsHeal,
+ shareableDetectionState,
+} from '../contactsDetectionPolicy.js';
+import { formatAwarenessLabel } from '../data/militaryAwarenessEngine.js';
+import { runCctvLayerEnableTransition } from '../cctvFocusPolicy.js';
+import {
+ registerCctvFocusRequestListener,
+ routeCctvFocusRequest,
+} from '../cctvFocusRequest.js';
+import {
+ flyToWorldTarget,
+ registerWorldFocusRequestListener,
+ routeWorldFocusRequest,
+} from '../worldFocus.js';
+import {
+ beginDeferredNavigation,
+ reassertNavigationHandoff,
+ registerNavigationAuthorityListener,
+ runExplicitNavigation,
+ stampInitialShareGesture,
+} from '../navigationPolicy.js';
+
+/** Versioned localStorage namespace prefix to invalidate stale panel layouts. */
+
+const SHARE_PANEL_STATE_SPECS = Object.freeze([
+ { id: 'control-panel', pinnable: true },
+ { id: 'location-bar', pinnable: true },
+ { id: 'data-panel' },
+ { id: 'cctv-panel' },
+ { id: 'radio-panel' },
+ { id: 'scene-panel' },
+ { id: 'global-context-panel' },
+ { id: 'pp-toggles' },
+ { id: 'param-slider-panel' },
+]);
+/** Standard map-view panels cleared out of the way on a fresh Cockpit entry. */
+const COCKPIT_ENTRY_COLLAPSE_PANEL_IDS = Object.freeze([
+ 'data-panel',
+ 'cctv-panel',
+ 'scene-panel',
+ 'pp-toggles',
+ 'global-context-panel',
+ 'radio-panel',
+]);
+/**
+ * Position keys are versioned separately from collapsed-state keys so layout
+ * default changes (e.g. right-rail origin) can reset positions without also
+ * resetting every panel's open/closed preference.
+ */
+
+const DETECTION_ALLOCATION_STORAGE_KEY = 'gev:detection-allocation:v1';
+/** Z ladder: panels promote within [100, 139]; voice pill 150, toast 200, clean-view-exit 300. */
+
+/**
+ * Fixed UI regions that can occupy the left accordion's vertical lane.
+ * Rectangles are filtered at runtime for visibility and horizontal overlap,
+ * so right-side/center controls do not reduce the lane unless they actually
+ * intersect it at the current viewport size.
+ */
+
+/**
+ * Fixed UI regions that can occupy the right control lane. Runtime rectangle
+ * filtering keeps the rail clear of whichever HUD variant is currently
+ * visible without tying the layout to one screen height.
+ */
+
+/** Display labels shown in the mini-status readout for each active style. */
+const STYLE_STATUS_LABELS = {
+ normal: 'NORMAL',
+ retro: 'CRT',
+ surveillance: 'NVG',
+ thermal: 'FLIR',
+ anime: 'ANIME',
+ noir: 'NOIR',
+ snow: 'SNOW',
+};
+
+/**
+ * Central UI orchestrator for the God's Eye View application.
+ *
+ * Responsibilities:
+ * - Visual controls and presets backed by the VisualEffects controller.
+ * - Bloom and sharpen post-processing toggle/intensity control.
+ * - Draggable/collapsible panel system with localStorage persistence,
+ * z-order stacking, and viewport-clamped positioning.
+ * - CCTV panel: camera selection, coverage toggle, projection, calibration
+ * sliders, auto-hop, and summary typewriter effect.
+ * - Location bar with city/POI preset pills, QWERTY key navigation,
+ * geocoding search, and inter-city world-jump transitions.
+ * - Orbit controller integration for POI fly-around.
+ * - Recording mode with safe-frame overlay and HUD mode switching.
+ * - Share link encoding/decoding (delegates to ShareLinkManager).
+ * - Detection overlay mode cycling and density tuning.
+ * - Toast notification system.
+ * - Intel HUD lifecycle and variant switching.
+ */
+
+export class StyleManager {
+ /**
+ * @param {Cesium.Viewer} viewer - The CesiumJS viewer instance.
+ * @param {object} [options]
+ */
+ constructor(viewer, { mapStackController = null, placeSearch, services } = {}) {
+ const { IntelHUD, ShareLinkManager, OrbitController, CelestialRing, initTrackedReadout, initWorldOverlay, initDetection, setDetectionStyle, trafficLayer, flightsLayer, militaryFlightsLayer, isTr3b, toggleTr3b, satellitesLayer, cctvLayer, bikeshareLayer, aisLiveVesselsLayer, militaryAwarenessLayer, cachedGroundFloor, cachedMeshFloor, GROUND_FLOOR_LIFT_M, meshFloorPreferred, warmGroundFloor, sampleMeshFloorCells, holdContinuousRender, releaseContinuousRender, governorRequestRender, setScopeMaskEnabled, setScopeMaskFeather, setScopeTerminusOverride, clampScopeTerminusPct, fetchRegionalBrief, regionalDistanceM, weatherCodeLabel } = services;
+ this.services = services;
+ this._lifetime = new UiLifetime();
+ this._recording = new RecordingControls({ syncShareState: () => this._syncShareState() });
+ Object.assign(this, readShellElements());
+ this._panelPosition = new PanelPositionControls({
+ syncPanelCollapseButton: (panel) => this._syncPanelCollapseButton(panel),
+ layoutRightPanels: () => this._layoutRightPanels(),
+ syncCctvPanelViewport: () => this._syncCctvPanelViewport(),
+ showToast: (message) => this._showToast(message),
+ });
+ this._feedback = new ShellFeedback({ readLayers: () => this._dataManager?.getAll?.() || [] });
+ this._panelLayout = new PanelLayoutController({
+ readHud: () => ({ visible: this.hud.visible, variant: this.hud.getVariant() }),
+ scheduleCockpitLayout: () => this.cockpitView?.scheduleContextLayout(),
+ syncPanelCollapseButton: (panel) => this._syncPanelCollapseButton(panel),
+ readDisplayScrollTop: () => this._displayPortalScrollRestoreOwner === 'standard'
+ ? this._standardDisplayScrollTop : (this._ppToggles?.scrollTop || 0),
+ });
+ this.viewer = viewer;
+ this.mapStackController = mapStackController;
+ this.placeSearch = placeSearch;
+ this._visualEffects = new VisualEffects({
+ viewer,
+ requestRender: governorRequestRender,
+ holdRender: holdContinuousRender,
+ releaseRender: releaseContinuousRender,
+ });
+ this.activeStyle = 'normal';
+ document.documentElement.dataset.gevStyle = this.activeStyle;
+
+ // True once the user manually changes detection (button/key/slider/voice).
+ // Gates per-style detection defaults so they never stomp an explicit choice.
+ this._detectionUserOverridden = false;
+
+ // Bloom/sharpen state
+ this._shareTrackingAcquiringKey = null;
+ this._shareTrackingNoticeGeneration = 0;
+ this._globeResetPromise = null;
+ this._dataManager = null;
+
+
+ this._windowResizeHandler = null;
+ this._cctvRequestFocusHandler = null;
+ this._removeCctvRequestFocusListener = null;
+ this._worldRequestFocusHandler = null;
+ this._removeWorldRequestFocusListener = null;
+ this._removeNavigationAuthorityListener = null;
+ this._navigationOwnerChangedRemover = null;
+ this._navigationGeneration = 0;
+ this._activeLocationSearchGeneration = null;
+ this._initialShareState = null;
+ this._initialShareNavigationGeneration = null;
+ this._initialShareRestoreTimeout = null;
+ this._layerStateCoordinator = null;
+ this._layerStateRestorePromise = null;
+ this._awarenessSelectedHandler = null;
+ this._awarenessClearedHandler = null;
+ this._disposed = false;
+
+ // DOM refs
+
+ this._detectionAllocationBtns = [
+ document.getElementById('detection-allocation-elastic'),
+ document.getElementById('detection-allocation-weighted'),
+ ].filter(Boolean);
+
+ let storedDetectionAllocation = 'ELASTIC';
+ try {
+ storedDetectionAllocation = localStorage.getItem(DETECTION_ALLOCATION_STORAGE_KEY) || 'ELASTIC';
+ } catch { /* storage can be unavailable in privacy/test contexts */ }
+ this._detectionAllocationPreference = normalizeAllocationStrategy(storedDetectionAllocation);
+
+ this._mapStackChangeHandler = null;
+
+ this._cockpitDisplayPortal = null;
+ this._cockpitDisplayModeHandler = null;
+
+ this._activeLocationId = null;
+ this._expandedCityId = null;
+ this._activePoiIndex = null;
+ this._currentTarget = null; // Cesium.Cartesian3 of current POI target
+ this._currentPoi = null; // Current POI data object
+ // Formatted address of the last free-text geocode search. Preset pills set
+ // _activeLocationId instead; a search has no preset record, so this is the
+ // only thing the mini-status can report for it.
+ this._searchedLocationLabel = null;
+ this._trafficTransitionTimer = null;
+ this._lastTrafficChipUpdateAt = 0;
+
+ // Orbit controller
+ this.orbitController = new OrbitController(viewer);
+ this._orbitIndicator = null;
+
+ // Intel HUD
+ this.hud = new IntelHUD(viewer);
+ this._recording.hud = this.hud;
+ this._cockpitVisionMode = 'optical';
+ this._cockpitVisionRestore = null;
+ this._cockpitPanelRestore = null;
+ // True only while the open Data Layers panel is the reason Cockpit's
+ // Contact panel is collapsed. A user-collapsed Contact panel must remain
+ // collapsed when Data Layers closes.
+ this._cockpitContextCollapsedForDataPanel = false;
+ /** Pre-Contacts detection state, restored on deactivation (see _syncContactsDetection). */
+ this._contactsDetectionRestore = null;
+ this.cockpitView = new CockpitViewController(viewer, {
+ services: {
+ flightsLayer,
+ militaryFlightsLayer,
+ isTr3b,
+ toggleTr3b,
+ militaryAwarenessLayer,
+ formatAwarenessLabel,
+ cachedGroundFloor,
+ cachedMeshFloor,
+ GROUND_FLOOR_LIFT_M,
+ meshFloorPreferred,
+ warmGroundFloor,
+ sampleMeshFloorCells,
+ holdContinuousRender,
+ releaseContinuousRender,
+ fetchRegionalBrief,
+ regionalDistanceM,
+ weatherCodeLabel,
+ },
+ onVisionChange: (mode, active, options) => this._setCockpitVision(mode, active, options),
+ onCameraTakeover: () => this._stampNavigation({ cancelPendingSelection: false }),
+ getInheritedVisionLabel: () => (
+ STYLE_STATUS_LABELS[this.activeStyle]
+ || String(this.activeStyle || 'normal').toUpperCase()
+ ),
+ isEntryAllowed: () => cockpitEntryAllowed({
+ contextMode: this._contextMode,
+ contextModeChanging: this._contextModeChanging,
+ flightsEnabled: !!this._dataManager?.isEnabled('flights'),
+ militaryEnabled: !!this._dataManager?.isEnabled('military'),
+ }),
+ onEntered: () => {
+ // A new Cockpit session owns both side rails. Clear standard map-view
+ // panels once on entry; NEXT/PREVIOUS never reaches this callback, so
+ // panels the operator opens while already inside remain untouched.
+ this._cockpitPanelRestore = new Map();
+ this._cockpitContextCollapsedForDataPanel = false;
+ for (const panelId of COCKPIT_ENTRY_COLLAPSE_PANEL_IDS) {
+ const panel = document.getElementById(panelId);
+ if (panel) {
+ this._cockpitPanelRestore.set(panelId, panel.classList.contains('collapsed'));
+ }
+ this.setPanelCollapsed(panelId, true, {
+ persist: false,
+ syncShare: false,
+ });
+ }
+ this.cockpitView?.setContextCollapsed(false);
+ this.cockpitView?.setSignalCollapsed(false, { user: true });
+ },
+ onExited: () => {
+ const restore = this._cockpitPanelRestore;
+ this._cockpitPanelRestore = null;
+ this._cockpitContextCollapsedForDataPanel = false;
+ if (!restore) return;
+ for (const [panelId, wasCollapsed] of restore) {
+ this.setPanelCollapsed(panelId, wasCollapsed, {
+ persist: false,
+ syncShare: false,
+ });
+ }
+ },
+ restoreTrackingFrame: (entity) => {
+ const [layerId, ...idParts] = String(entity?.gevTrackedId || '').split(':');
+ const trackedId = idParts.join(':');
+ if (!trackedId) return false;
+ if (layerId === 'flights') return flightsLayer.refocusTrackedById?.(trackedId) === true;
+ if (layerId === 'military') return militaryFlightsLayer.refocusTrackedById?.(trackedId) === true;
+ return false;
+ },
+ });
+
+ // Full-globe sun/moon ring. It is a crisp screen-space overlay above the
+ // Cesium canvas but below the HUD/detection/readout z ladder.
+ this.celestialRing = new CelestialRing(viewer, {
+ enabled: false,
+ onAutoDisable: () => this.setCelestialRingEnabled(false, {
+ syncShare: !!this.shareLinkManager,
+ focus: false,
+ }),
+ });
+
+ // Share Link Manager
+ this.shareLinkManager = new ShareLinkManager(viewer, {
+ onRestore: async (state) => {
+ const {
+ style,
+ bloom,
+ sharpen,
+ bloomIntensity,
+ bloomVersion,
+ sharpenIntensity,
+ hudVariant,
+ hudVisible,
+ detectionMode,
+ detectionDensity,
+ detectionAllocation,
+ detectionFadePct,
+ detectionOutsideOpacityPct,
+ celestialRing,
+ scopeEnabled,
+ scopeFeatherPct,
+ scopeTerminusPct,
+ mapStack,
+ panelState,
+ styleParams,
+ } = state || {};
+ // Ignore the retired 'ai-edit' style from older share links.
+ if (style && style !== 'normal' && style !== 'ai-edit') {
+ this.setStyle(style, { applyPreset: true, revealParameters: false, restore: true });
+ }
+ if (styleParams && style && this.stages[style] && STYLES[style]?.uniforms) {
+ for (const [uniformName, uniformValue] of Object.entries(styleParams)) {
+ if (!Object.hasOwn(STYLES[style].uniforms, uniformName)) continue;
+ this.stages[style].uniforms[uniformName] = uniformValue;
+ }
+ this._updateSliderPanel(style, { reveal: false });
+ }
+ if (typeof bloomIntensity === 'number' && this._bloomSlider) {
+ const intensity = decodeBloomIntensity(bloomIntensity, bloomVersion);
+ this._setBloomIntensity(intensity, { syncShare: false });
+ }
+ if (typeof sharpenIntensity === 'number' && this._sharpenSlider) {
+ const pct = Math.max(0, Math.min(100, Math.round(sharpenIntensity)));
+ this._sharpenSlider.value = String(pct);
+ this._sharpenSliderValue.textContent = `${pct}%`;
+ this._applySharpenIntensity(pct / 100);
+ }
+ if (typeof bloom === 'boolean') this._setBloomEnabled(bloom);
+ if (typeof sharpen === 'boolean') this._setSharpenEnabled(sharpen);
+ if (hudVariant) this._setHudVariant(hudVariant);
+ if (typeof hudVisible === 'boolean') {
+ this.hud.setMode(hudVisible ? 'on' : 'off');
+ this._updateHudButtonState();
+ }
+ if (typeof detectionDensity === 'number' && this._detectionDensitySlider) {
+ const pct = canonicalizeDensity(detectionDensity);
+ this._detectionDensitySlider.value = String(pct);
+ this._detectionDensityValue.textContent = `${pct}%`;
+ this._applyDetectionDensityFromUi();
+ }
+ if (detectionAllocation) {
+ this._setDetectionAllocation(detectionAllocation, { syncShare: false, persist: false });
+ }
+ if (typeof detectionFadePct === 'number' && this._detectionFadeSlider) {
+ this._detectionFadeSlider.value = String(detectionFadePct);
+ }
+ if (typeof detectionOutsideOpacityPct === 'number' && this._detectionOpacitySlider) {
+ this._detectionOpacitySlider.value = String(detectionOutsideOpacityPct);
+ }
+ this._applyDetectionFadeFromUi();
+ if (detectionMode) this._setDetectionMode(detectionMode);
+ if (typeof celestialRing === 'boolean') {
+ this.setCelestialRingEnabled(celestialRing, { syncShare: false, focus: false });
+ }
+ if (typeof scopeEnabled === 'boolean') {
+ setScopeMaskEnabled(scopeEnabled);
+ this._scopeBtn?.classList.toggle('active', scopeEnabled);
+ this._scopeBtn?.setAttribute('aria-pressed', String(scopeEnabled));
+ }
+ if (typeof scopeFeatherPct === 'number' && this._scopeFeatherSlider) {
+ const pct = Math.max(0, Math.min(100, Math.round(scopeFeatherPct)));
+ this._scopeFeatherSlider.value = String(pct);
+ if (this._scopeFeatherValue) this._scopeFeatherValue.textContent = `${pct}%`;
+ setScopeMaskFeather(pct / 100);
+ }
+ // null restores the altitude-adaptive ramp; a number pins the terminus
+ // (clamped to the supported 94..100 band, same as the `sce` hash key).
+ if (scopeTerminusPct === null) setScopeTerminusOverride(null);
+ else if (typeof scopeTerminusPct === 'number') {
+ const pinned = clampScopeTerminusPct(scopeTerminusPct);
+ setScopeTerminusOverride(pinned == null ? null : pinned / 100);
+ }
+ const mapStackRestore = mapStack
+ ? this._setMapStack(mapStack, { syncShare: false })
+ : Promise.resolve();
+ if (panelState) this._restorePanelState(panelState);
+ await mapStackRestore;
+ this._syncShareState();
+ },
+ isNavigationCurrent: (generation) => generation === this._navigationGeneration,
+ cancelOwnedNavigation: () => this.viewer.camera.cancelFlight(),
+ });
+ this.shareLinkManager.setPanelStateProvider(() => this._buildSharePanelState());
+ this.shareLinkManager.setStyleParamStateProvider((styleName) => {
+ const shader = STYLES[styleName];
+ const stage = this.stages[styleName];
+ if (!shader?.uniforms || !stage) return null;
+ return Object.fromEntries(
+ Object.keys(shader.uniforms).map((uniformName) => [uniformName, stage.uniforms[uniformName]]),
+ );
+ });
+ // Parse before panel chrome initializes so every valid share URL starts
+ // from deterministic markup defaults instead of recipient-local panel
+ // preferences. Encoded panel fields are applied after all panels exist.
+ this._initialShareState = this.shareLinkManager.parseInitialHash();
+
+ this._models3dModeBtns = [
+ document.getElementById('models3d-mode-proximity'),
+ document.getElementById('models3d-mode-all'),
+ ];
+ // DISPLAY-rail 3D-aircraft toggle (flights layer param). DEFAULT-ON in
+ // PROXIMITY (owner directive 2026-08-22) — mirrors the `models3d` default in
+ // layerState.js and `_models3dEnabled` in both flight layers, and the `active`
+ // class the button carries in index.html. A fresh boot skips layer-state
+ // restoration, so these initializers are the only thing keeping the lit
+ // button and the armed layer in agreement.
+ this._models3dEnabled = true;
+ this._models3dMode = 'proximity'; // 'proximity' (nearest in view) | 'all' (every in-view plane)
+
+ // The shared world-overlay host must own its one postRender lane before
+ // detection and tracked-readout initialize. It stays transparent until a
+ // production source explicitly registers entries.
+ initWorldOverlay(viewer);
+
+ // Initialize detection overlay BEFORE style stages so the composite
+ // stage is first in the post-process pipeline
+ initDetection(viewer, [trafficLayer, flightsLayer, militaryFlightsLayer, satellitesLayer, cctvLayer, bikeshareLayer, aisLiveVesselsLayer], (modeLabel) => {
+ this._updateDetectionButton(modeLabel);
+ });
+ initTrackedReadout(viewer);
+ setDetectionStyle(this.activeStyle);
+ this._applyDetectionDensityFromUi();
+
+ this._initStages();
+ this._initBloomSharpen();
+ this._initUI();
+ this._initMapStackControl();
+ this._initPanelChrome();
+ this._initLeftPanelAdaptiveLayout();
+ this._initRightPanelAdaptiveLayout();
+ this._initRadioPanel();
+ this._initCctvPanel();
+ this._initGlobalContextPanel();
+ this._initLocationBar();
+ this._initShareButton();
+ this._initClearSelectedLayersButton();
+ this._initHUDToggle();
+ this._initModels3dToggle();
+ this._applyGlobalPostDefaults();
+ this._initOrbit();
+ this._initRecordingOverlay();
+ this._startAnimationLoop();
+ this._startTrafficChipTicker();
+ this._updateStyleMiniStatus();
+ this._updateLocationMiniStatus();
+
+ // Restore from URL hash if present
+ const savedState = this._initialShareState;
+ this._initialShareRestorePromise = savedState
+ ? new Promise((resolve) => { this._resolveInitialShareRestore = resolve; })
+ : Promise.resolve({ status: 'not-requested', share: null, layers: [] });
+ if (savedState) {
+ this._hasShareState = true;
+ // Reserve camera authority now; the delayed mesh-friendly flight may
+ // run only if no newer user, voice, or tracking navigation has won.
+ this._initialShareNavigationGeneration = this._beginDeferredNavigation(
+ 'shared view',
+ { cancelPendingSelection: false },
+ );
+ this._initialShareRestoreTimeout = setTimeout(() => {
+ this._initialShareRestoreTimeout = null;
+ if (this._disposed) return;
+ const generation = this._initialShareNavigationGeneration;
+ const applyCamera = Number.isInteger(generation)
+ && this._reassertNavigationHandoff(generation);
+ void (async () => {
+ try {
+ const share = await this.shareLinkManager.applyState(savedState, {
+ applyCamera,
+ navigationToken: generation,
+ });
+ const layers = await (this._layerStateRestorePromise || Promise.resolve([]));
+ const tracking = share.camera === 'applied'
+ ? await this._layerStateCoordinator?.restoreShareTrackingSelection?.()
+ : {
+ status: 'superseded',
+ cleared: this._layerStateCoordinator?.cancelPendingShareTracking?.(
+ 'shared-camera-superseded',
+ { clearSelection: true },
+ ) === true,
+ };
+ this.shareLinkManager.completeInitialRestore();
+ this._settleInitialShareRestore({ status: 'settled', share, layers, tracking });
+ } catch (error) {
+ this.shareLinkManager.completeInitialRestore();
+ this._settleInitialShareRestore({
+ status: 'failed',
+ error: String(error?.message || error),
+ share: null,
+ layers: [],
+ });
+ }
+ })();
+ }, 1500);
+ } else {
+ this._syncShareState();
+ }
+ // A recipient can orbit before or during the delayed share flight. That
+ // gesture keeps ordinary layer state but revokes the passive base camera
+ // and selected-subject Follow so delayed work cannot seize navigation.
+ this._initialShareGestureHandler = () => {
+ if (
+ this._disposed
+ || !this._hasShareState
+ || !this._resolveInitialShareRestore
+ ) return;
+ stampInitialShareGesture((options) => this._stampNavigation(options));
+ };
+ this.viewer?.canvas?.addEventListener('pointerdown', this._initialShareGestureHandler, {
+ passive: true,
+ });
+ this.viewer?.canvas?.addEventListener('wheel', this._initialShareGestureHandler, {
+ passive: true,
+ });
+
+ // Keep the parameter panel from overlapping toggle controls.
+ this._layoutRightPanels();
+ this._syncCctvPanelViewport();
+ this._windowResizeHandler = () => {
+ this._scheduleRightPanelLayout({ reconsiderAutoCollapse: true });
+ this._syncCctvPanelViewport();
+ this._scheduleLeftPanelLayout({ reconsiderAutoCollapse: true });
+ };
+ window.addEventListener('resize', this._windowResizeHandler);
+ // The loading-chip ticker is stopped while the tab is hidden (it can do no
+ // useful work off-screen and must not hold a 60ms timer there). Resample on
+ // return so the time-driven reducer catches up on real elapsed time — and
+ // re-arms its own ticker if the batch is still running.
+ this._feedback.observeVisibility();
+ this._cctvRequestFocusHandler = (event) => routeCctvFocusRequest(
+ event,
+ (activate, focus) => this._runExplicitCctvFocus(activate, focus),
+ (cameraId, durationSec) => cctvLayer.focusCamera(cameraId, durationSec),
+ );
+ this._removeCctvRequestFocusListener = registerCctvFocusRequestListener(
+ window,
+ this._cctvRequestFocusHandler,
+ );
+ this._worldRequestFocusHandler = (event) => routeWorldFocusRequest(
+ event,
+ (detail, fly) => this._runExplicitWorldFocus(detail, fly),
+ (detail) => flyToWorldTarget(this.viewer, detail),
+ );
+ this._removeWorldRequestFocusListener = registerWorldFocusRequestListener(
+ window,
+ this._worldRequestFocusHandler,
+ );
+ this._navigationOwnerChangedRemover = viewer.trackedEntityChanged.addEventListener((entity) => {
+ if (entity && !this._disposed) this._stampNavigation({ cancelPendingSelection: false });
+ });
+ // Vessel/installation focus flies without ever assigning a tracked entity,
+ // so it cannot reach the listener above. It announces instead.
+ this._removeNavigationAuthorityListener = registerNavigationAuthorityListener(
+ window,
+ (event) => {
+ if (this._disposed) return;
+ this._stampNavigation({
+ cancelPendingSelection: event?.detail?.cancelPendingSelection !== false,
+ });
+ },
+ );
+ }
+
+ // Compatibility reads for existing controls, scene snapshots and Cockpit.
+ get stages() { return this._visualEffects.stages; }
+ get transitions() { return this._visualEffects.transitions; }
+ get bloomEnabled() { return this._visualEffects.bloomEnabled; }
+ get sharpenEnabled() { return this._visualEffects.sharpenEnabled; }
+ get _bloomStage() { return this._visualEffects.bloomStage; }
+ get _sharpenStage() { return this._visualEffects.sharpenStage; }
+
+ /** Advance camera authority and settle any older search UI immediately. */
+ _stampNavigation({ cancelPendingSelection = true, clearSearchedLocation = true } = {}) {
+ const { flightsLayer, militaryFlightsLayer, satellitesLayer } = this.services;
+ this._navigationGeneration += 1;
+ // A newer destination owns the camera, so the last free-text search is no
+ // longer where we are. DEFERRED navigation opts out here and clears at the
+ // reassert seam instead: a geocode that never resolves moves no camera, and
+ // a lookup that fails must not blank a readout that is still true.
+ if (clearSearchedLocation) this.clearSearchedLocation();
+ if (cancelPendingSelection) {
+ if (this._hasShareState && this._resolveInitialShareRestore && !this._layerStateCoordinator) {
+ this._initialShareSelectionSuperseded = true;
+ }
+ const passivelyClearedShareSelection = this._layerStateCoordinator
+ ?.cancelPendingShareTracking?.(
+ 'superseded-by-explicit-navigation',
+ { clearSelection: true },
+ ) === true;
+ try { flightsLayer.cancelPendingTrackingRestore?.(); } catch { /* best effort */ }
+ try { militaryFlightsLayer.cancelPendingTrackingRestore?.(); } catch { /* best effort */ }
+ try { satellitesLayer.cancelPendingTrackingRestore?.(); } catch { /* best effort */ }
+ // A deliberate destination supersedes share-selected entities that have
+ // not arrived yet. Active owners publish their clear when released.
+ if (!passivelyClearedShareSelection && !flightsLayer.getTrackedInfo?.()) {
+ this._dataManager?.setLayerParams('flights', {
+ selectedFlightsTrackingId: null,
+ }, { origin: 'tool' });
+ }
+ if (!passivelyClearedShareSelection && !militaryFlightsLayer.getTrackedInfo?.()) {
+ this._dataManager?.setLayerParams('military', {
+ selectedMilitaryTrackingId: null,
+ }, { origin: 'tool' });
+ }
+ if (!passivelyClearedShareSelection && !satellitesLayer.getTrackedInfo?.()) {
+ this._dataManager?.setLayerParams('satellites', {
+ selectedSatTrackingId: null,
+ }, { origin: 'tool' });
+ }
+ }
+ if (this._activeLocationSearchGeneration !== null) {
+ this._settleLocationSearchUi(this._activeLocationSearchGeneration);
+ }
+ return this._navigationGeneration;
+ }
+
+ /** Settle only the search generation that still owns the shared input UI. */
+ _settleLocationSearchUi(generation) {
+ if (this._activeLocationSearchGeneration !== generation) return;
+ this._activeLocationSearchGeneration = null;
+ this._locationSearch?.classList.remove('searching', 'expanded');
+ if (this._locationSearch) this._locationSearch.value = '';
+ this._locationSearch?.blur();
+ }
+
+ /** Release every follow owner while preserving Contact and vessel selection. */
+ _releaseFollowCamera({
+ preserveVesselSelection = true,
+ preserveCameraFlight = false,
+ trackingOrigin = 'tool',
+ } = {}) {
+ const { interruptCameraMotion, flightsLayer, militaryFlightsLayer, satellitesLayer, aisLiveVesselsLayer, militaryAwarenessLayer, rocketLaunchesLayer } = this.services;
+ let contactSelected = false;
+ try {
+ contactSelected = Boolean(
+ militaryAwarenessLayer.releaseCameraOwnership?.({
+ preserveVesselSelection,
+ origin: trackingOrigin,
+ }),
+ );
+ } catch {
+ try { flightsLayer.stopTracking?.({ origin: trackingOrigin }); } catch { /* best-effort release */ }
+ try { militaryFlightsLayer.stopTracking?.({ origin: trackingOrigin }); } catch { /* best-effort release */ }
+ if (!preserveVesselSelection) {
+ try { aisLiveVesselsLayer.clearSelection?.(); } catch { /* best-effort release */ }
+ }
+ }
+ try { satellitesLayer.stopTracking?.({ origin: trackingOrigin }); } catch { /* best-effort release */ }
+ try { rocketLaunchesLayer.releaseCameraOwnership?.(); } catch { /* best-effort release */ }
+ this.viewer.trackedEntity = undefined;
+ interruptCameraMotion('explicit-navigation');
+ this._stopOrbit();
+ if (!preserveCameraFlight) this.viewer.camera.cancelFlight();
+ try {
+ this.viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
+ } catch { /* teardown race */ }
+ return contactSelected;
+ }
+
+ /** Run one immediate destination through the shared ownership policy. */
+ _runExplicitNavigation(noun, navigate, releaseOptions = undefined) {
+ return runExplicitNavigation({
+ disposed: this._disposed,
+ cockpitActive: !!this.cockpitView?.active,
+ noun,
+ showToast: (text) => this._showToast(text),
+ stamp: () => this._stampNavigation(),
+ release: () => this._releaseFollowCamera(releaseOptions),
+ navigate,
+ });
+ }
+
+ /** Accept a delayed lookup without releasing its current camera owner. */
+ _beginDeferredNavigation(noun = 'location', { cancelPendingSelection = true } = {}) {
+ return beginDeferredNavigation({
+ disposed: this._disposed,
+ cockpitActive: !!this.cockpitView?.active,
+ noun,
+ showToast: (text) => this._showToast(text),
+ // The searched-location readout survives the STAMP; only a flight that
+ // actually starts invalidates it (see the release hook below).
+ stamp: () => this._stampNavigation({ cancelPendingSelection, clearSearchedLocation: false }),
+ });
+ }
+
+ /** Final authority check and release immediately before a delayed flight. */
+ _reassertNavigationHandoff(generation) {
+ return reassertNavigationHandoff({
+ generation,
+ currentGeneration: this._navigationGeneration,
+ cockpitActive: !!this.cockpitView?.active,
+ disposed: this._disposed,
+ showToast: (text) => this._showToast(text),
+ // Reached only once the handoff is granted, immediately before the
+ // deferred flight starts — so a lookup that failed, was superseded, or
+ // was refused by the cockpit leaves the old readout standing.
+ release: () => {
+ this.clearSearchedLocation();
+ return this._releaseFollowCamera();
+ },
+ });
+ }
+
+ /** Public lifecycle seam used by voice location navigation. */
+ beginDeferredLocationNavigation() {
+ return this._beginDeferredNavigation('location');
+ }
+
+ /** Public final-authority seam used by voice geocoding. */
+ reassertDeferredLocationNavigation(generation) {
+ return this._reassertNavigationHandoff(generation);
+ }
+
+ /** Public immediate route used by voice destinations. */
+ runImmediateLocationNavigation(navigate) {
+ return this.runImmediateNavigation('location', navigate);
+ }
+
+ /** Public authority facade used by validated voice camera destinations. */
+ runImmediateNavigation(noun, navigate, releaseOptions = undefined) {
+ return this._runExplicitNavigation(noun, navigate, releaseOptions);
+ }
+
+ /** Supersede deferred work when an owner-specific route handles release. */
+ supersedeDeferredNavigation() {
+ return this._stampNavigation();
+ }
+
+ /** Route a valid vessel/fire request through the shared navigation policy. */
+ _runExplicitWorldFocus(detail, fly) {
+ return this._runExplicitNavigation(detail?.kind || 'target', fly);
+ }
+
+ /** Return the aircraft tracker owned before a multi-step Cockpit transaction. */
+ getAircraftTrackingTarget() {
+ return aircraftTrackingTarget(this.cockpitView?.readAircraftInfo?.());
+ }
+
+ /**
+ * On window resize, keep the draggable panel on-screen — a panel positioned near an edge can fall
+ * outside a now-smaller viewport (audit U2). pp-toggles is right-pinned, so re-pin (horizontal) and
+ * clamp its top. No-op until the panel has been positioned (explicit inline top).
+ * @returns {void}
+ */
+ _reclampDraggablePanels() { return this._panelPosition._reclampDraggablePanels(); }
+
+ /**
+ * Creates one CesiumJS PostProcessStage per visual style and registers
+ * it with the scene. Each stage starts with intensity 0 (invisible)
+ * so crossfade transitions can animate it in later.
+ * @returns {void}
+ */
+ _initStages() {
+ this._visualEffects.initStyles();
+ }
+
+ /**
+ * Single write path for style-stage intensity: keeps `enabled` in
+ * lockstep so zero-intensity stages cost nothing (safe now that the
+ * scope is explicit — see _initStages). The stage enables on the same
+ * frame the first non-zero intensity lands, so crossfades never pop.
+ * @param {Cesium.PostProcessStage} stage - Style post-process stage.
+ * @param {number} value - Intensity in [0, 1].
+ * @returns {void}
+ */
+ _setStageIntensity(stage, value) {
+ this._visualEffects.setStageIntensity(stage, value);
+ }
+
+ /**
+ * Re-sync every stage's `enabled` flag from its CURRENT intensity.
+ *
+ * The cockpit-vision policy helpers (src/cockpitVisionPolicy.js) are pure
+ * intensity math — they write `uniforms.intensity` directly and know
+ * nothing about the enabled/intensity lockstep _setStageIntensity owns.
+ * Without this sweep a stage the policy raised to 1 would stay DISABLED
+ * and cockpit NVG/FLIR/CRT would render nothing at all. (Inert while the
+ * chain is permanently enabled; load-bearing again once the explicit
+ * scope frees the zero-intensity stages — see _initStages.)
+ * @returns {void}
+ */
+ _syncStagesEnabledFromIntensity() {
+ this._visualEffects.syncStagesEnabledFromIntensity();
+ }
+
+ /**
+ * Contacts-scoped detection (owner playtest 2026-08-18: "when you click on
+ * Contacts, detections should just turn on, and they should stay on in
+ * Cockpit or in third-person tracking inside Contacts").
+ *
+ * The scope is the CONTACTS SESSION, not Cockpit. Cockpit enter/exit and
+ * third-person tracking are moves WITHIN that session and deliberately do not
+ * touch detection — an earlier build hooked this to cockpit enter/exit, which
+ * is exactly what turned detections off when the owner left the cockpit.
+ *
+ * Called from `_syncContextModeButtons`, the single funnel every
+ * `_contextMode` mutation routes through, and gated on the transaction having
+ * SETTLED (`!_contextModeChanging`) so a failed activation can never strand
+ * detection on.
+ * @returns {void}
+ */
+ _syncContactsDetection() {
+ if (this._contextModeChanging) return;
+ const result = applyContactsDetection({
+ active: this._contextMode === 'flights',
+ restore: this._contactsDetectionRestore,
+ // A map style picked DURING the session owns detection on the way out —
+ // its auto-enable preset is younger than the entry snapshot.
+ styleOwnsDetection: !this._detectionUserOverridden
+ && Boolean(STYLE_PRESET_DEFAULTS[this.activeStyle]?.detection),
+ // The snapshot must cover everything activation mutates — the preset
+ // writes DENSITY as well as mode, so a mode-only snapshot returned
+ // OFF @ 25% as OFF @ 75% and the next manual enable came back Dense.
+ getState: () => {
+ const state = this.getDetectionState();
+ return { mode: state.detectionMode, densityPct: state.densityPct };
+ },
+ // Owner playtest: the force-on lands on the tactical look the military
+ // styles apply — the SAME preset object — not on whatever profile the
+ // operator last happened to leave detection at.
+ applyPreset: () => this._applyDetectionPreset(MILITARY_DETECTION_PRESET),
+ // The preset applier IS the state replayer: same density-then-mode order,
+ // same slider writes, so a restore round-trips exactly.
+ restoreState: (state) => this._applyDetectionPreset(state),
+ });
+ const hadOwnership = Boolean(this._contactsDetectionRestore);
+ this._contactsDetectionRestore = result.restore;
+ // Serialization reads that ownership: while Contacts holds it the link
+ // carries the SAVED snapshot, and once released it carries live state. The
+ // share cache therefore goes stale on any ownership transition, whether or
+ // not the detection engine itself moved — and it does not always move.
+ // Exiting while a military style owns detection returns changed:false (the
+ // style's preset already matches), and returning early there left a copied
+ // link claiming the operator's pre-Contacts values while the map showed
+ // Dense @ 75%.
+ if (!shareCacheNeedsHeal({
+ changed: result.changed,
+ hadOwnership,
+ hasOwnership: Boolean(result.restore),
+ })) return;
+ if (result.changed) this._syncDetectionUiFromEngine();
+ this._syncShareState();
+ }
+
+ /** Apply a temporary cockpit-only CRT/NVG/FLIR/NOIR post-process override. */
+ _setCockpitVision(mode, active, { revealParameters = false } = {}) {
+ const next = active ? normalizeCockpitVisionMode(mode) : 'optical';
+ if (!this.stages) return;
+ if (!active) {
+ if (this._cockpitVisionRestore) {
+ for (const [name, intensity] of Object.entries(this._cockpitVisionRestore)) {
+ if (this.stages[name]) this._setStageIntensity(this.stages[name], intensity);
+ }
+ }
+ this._cockpitVisionRestore = null;
+ this._cockpitVisionMode = 'optical';
+ this._syncIrBoost(); // Cockpit exit: fall back to the map preset's IR state
+ this._updateSliderPanel(this.activeStyle, { reveal: false });
+ this._revealCockpitStyleParameters({ openDisplay: revealParameters });
+ return;
+ }
+ if (!this._cockpitVisionRestore) {
+ this._cockpitVisionRestore = captureCockpitVisionBaseline(this.stages, this.transitions);
+ }
+ if (next === 'optical') {
+ applyCockpitVisionStageIntensities(this.stages, next, this._cockpitVisionRestore);
+ this._syncStagesEnabledFromIntensity();
+ this._cockpitVisionMode = next;
+ this._syncIrBoost();
+ this._updateSliderPanel(this.activeStyle, { reveal: false });
+ this._revealCockpitStyleParameters({ openDisplay: revealParameters });
+ return;
+ }
+ const target = applyCockpitVisionStageIntensities(this.stages, next, this._cockpitVisionRestore);
+ this._syncStagesEnabledFromIntensity();
+ this._cockpitVisionMode = next;
+ this._syncIrBoost(); // Cockpit vision override ('nvg'/'thermal' boost; CRT/NOIR clear)
+ this._updateSliderPanel(target || null, { reveal: false });
+ this._revealCockpitStyleParameters({ openDisplay: revealParameters });
+ }
+
+ /** IR hot-target boost (owner playtest 2026-08-16): under the luminance-
+ * mapped NVG/FLIR looks the 3D fleets flip to flat white so contacts read
+ * HOT instead of vanishing mid-gray; restored when the look exits. The
+ * EFFECTIVE look is Cockpit's vision override while Cockpit is active
+ * ('nvg'/'thermal', which can differ from the map preset in BOTH
+ * directions), otherwise the map preset ('surveillance'/'thermal'). */
+ _syncIrBoost() {
+ const cockpitMode = this.cockpitView?.active ? this._cockpitVisionMode : null;
+ const effective = cockpitMode && cockpitMode !== 'optical' ? cockpitMode : this.activeStyle;
+ const irBoost = effective === 'surveillance' || effective === 'thermal' || effective === 'nvg';
+ this._dataManager?.setLayerParams('flights', { irBoost });
+ this._dataManager?.setLayerParams('military', { irBoost });
+ // Fog blends distant geometry toward an effectively-BLACK color in this
+ // app (the Cesium globe is hidden), so beyond ~100 km every 3D aircraft
+ // fogs to a black silhouette — lighting and shaders can't reach past it
+ // (owner cockpit-FLIR field rounds, 2026-08-16). IR sensors see through
+ // haze, so the boost styles simply turn fog off; the prior state restores
+ // on exit. Transition-guarded so repeated syncs don't clobber the saved value.
+ const scene = this.viewer?.scene;
+ if (scene?.fog && irBoost !== this._irBoostActive) {
+ this._irBoostActive = irBoost;
+ if (irBoost) {
+ this._irFogWasEnabled = scene.fog.enabled;
+ scene.fog.enabled = false;
+ } else if (this._irFogWasEnabled != null) {
+ scene.fog.enabled = this._irFogWasEnabled;
+ this._irFogWasEnabled = null;
+ }
+ scene.requestRender?.();
+ }
+ }
+
+ /** Keep Cockpit's inherited label and restore target aligned with the active map preset. */
+ _syncCockpitInheritedStyle() {
+ if (!this.cockpitView?.active || !this.stages) return;
+ this._cockpitVisionRestore = Object.fromEntries(
+ Object.keys(this.stages).map((name) => [name, name === this.activeStyle ? 1 : 0]),
+ );
+ for (const name of Object.keys(this.stages)) this.transitions.delete(name);
+ this.cockpitView.setVisionMode(this.cockpitView.visionMode);
+ }
+
+ /** Reveal shared style parameters, optionally opening Cockpit Display first. */
+ _revealCockpitStyleParameters({ openDisplay = false } = {}) {
+ if (!this.cockpitView?.active || !this._sliderPanel?.classList.contains('active')) return;
+ if (openDisplay && this._cockpitDisplayToggleBtn?.getAttribute('aria-expanded') !== 'true') {
+ this._setCockpitDisclosure?.('display', true);
+ return;
+ }
+ if (this._cockpitDisplayToggleBtn?.getAttribute('aria-expanded') !== 'true') return;
+ this._sliderPanel.classList.remove('collapsed');
+ this._syncPanelCollapseButton(this._sliderPanel);
+ this._lifetime.frame(() => this._lifetime.frame(() => {
+ this._sliderPanel?.scrollIntoView?.({ block: 'nearest' });
+ }));
+ }
+
+ /**
+ * Configures Cesium's built-in bloom stage and adds a custom unsharp-mask
+ * sharpen stage to the post-process pipeline. Both start disabled.
+ * @returns {void}
+ */
+ _initBloomSharpen() {
+ this._visualEffects.initPostProcess(this._sharpenSlider ? parseInt(this._sharpenSlider.value, 10) / 100 : 0.6);
+ }
+
+ /**
+ * Reads the current bloom intensity percentage from the effects controller.
+ * @returns {number} Clamped bloom intensity (0-200).
+ */
+ _getBloomIntensity() {
+ return this._visualEffects.bloomIntensity;
+ }
+
+ /**
+ * Enables or disables the Cesium bloom stage based on both the user toggle
+ * and whether the computed strength exceeds the perceptual threshold (0.06).
+ * @returns {void}
+ */
+ _syncBloomStageEnabled() {
+ this._visualEffects.syncBloomEnabled();
+ }
+
+ /**
+ * Sets the bloom intensity, updates the slider UI, and applies the value.
+ * @param {number} intensity - Raw intensity percentage.
+ * @param {object} [options]
+ * @param {boolean} [options.syncShare=true] - Whether to push state to the share link.
+ * @returns {void}
+ */
+ _setBloomIntensity(intensity, { syncShare = true } = {}) {
+ const { governorRequestRender } = this.services;
+ governorRequestRender('bloom');
+ const clamped = clampBloomIntensity(intensity);
+ if (this._bloomSlider) this._bloomSlider.value = String(clamped);
+ if (this._bloomSliderValue) this._bloomSliderValue.textContent = `${clamped}%`;
+ this._applyBloomIntensity(clamped);
+ if (syncShare) this._syncShareState();
+ }
+
+ /**
+ * Maps a bloom intensity percentage to Cesium bloom stage uniforms.
+ * Uses smoothstep easing (Hermite interpolation: 3t^2 - 2t^3) to
+ * produce a perceptually linear glow ramp from zero to full strength.
+ * @param {number} intensity - Bloom intensity percentage (0-200).
+ * @returns {void}
+ */
+ _applyBloomIntensity(intensity) {
+ this._visualEffects.applyBloomIntensity(intensity);
+ }
+
+ /**
+ * Toggles bloom on/off, syncs button state, and reveals/hides the intensity slider row.
+ * @param {boolean} enabled - Whether bloom should be active.
+ * @returns {void}
+ */
+ _setBloomEnabled(enabled) {
+ const { governorRequestRender } = this.services;
+ governorRequestRender('bloom');
+ this._visualEffects.setBloomEnabled(enabled);
+ this._syncBloomStageEnabled();
+ this._bloomBtn.classList.toggle('active', this.bloomEnabled);
+ this._bloomSliderRow.classList.toggle('visible', this.bloomEnabled);
+ if (this.bloomEnabled) {
+ this._applyBloomIntensity(this._getBloomIntensity());
+ }
+ this._syncShareState();
+ this._layoutRightPanels();
+ }
+
+ /**
+ * Maps a normalized sharpen value (0-1) to the unsharp-mask `amount` uniform.
+ * Range: 0.1 (subtle) to 2.1 (aggressive edge enhancement).
+ * @param {number} val - Normalized sharpen intensity (0.0 to 1.0).
+ * @returns {void}
+ */
+ _applySharpenIntensity(val) {
+ this._visualEffects.applySharpenIntensity(val);
+ }
+
+ /**
+ * Toggles sharpening on/off, syncs button state, and reveals/hides the intensity slider row.
+ * @param {boolean} enabled - Whether sharpening should be active.
+ * @returns {void}
+ */
+ _setSharpenEnabled(enabled) {
+ const { governorRequestRender } = this.services;
+ governorRequestRender('sharpen');
+ this._visualEffects.setSharpenEnabled(enabled);
+ this._sharpenBtn.classList.toggle('active', this.sharpenEnabled);
+ if (this._sharpenSliderRow) {
+ this._sharpenSliderRow.classList.toggle('visible', this.sharpenEnabled);
+ }
+ if (this.sharpenEnabled && this._sharpenSlider) {
+ this._applySharpenIntensity(parseInt(this._sharpenSlider.value, 10) / 100);
+ }
+ this._syncShareState();
+ this._layoutRightPanels();
+ }
+
+ /**
+ * Wires up all primary UI event listeners: style buttons, keyboard shortcuts
+ * (1-8 style keys, H/O/V/F/D/C hotkeys, Escape), AI prompt input with
+ * debounce, bloom/sharpen/HUD toggles, detection density slider, and
+ * clean-view toggle.
+ * @returns {void}
+ */
+ _initUI() {
+ const { cycleDetectionMode, setScopeMaskEnabled, isScopeMaskEnabled, setScopeMaskFeather } = this.services;
+ this._applicationShortcuts?.destroy();
+ this._applicationShortcuts = bindApplicationShortcuts({
+ documentRef: document,
+ searchInput: this._locationSearch,
+ actions: {
+ setStyle: (style) => this.setStyle(style),
+ dismissSearch: () => {
+ if (this._locationSearch.classList.contains('expanded')) {
+ this._locationSearch.classList.remove('expanded');
+ this._locationSearch.value = '';
+ this._locationSearch.blur();
+ }
+ },
+ toggleHud: () => {
+ this.shareLinkManager?.claimRestoreLane?.('visual');
+ this.hud.toggle();
+ this._updateHudButtonState();
+ this._syncShareState();
+ },
+ toggleOrbit: () => this._toggleOrbit(),
+ toggleCleanView: () => this.toggleCleanView(),
+ toggleLayers: () => document.getElementById('data-panel').classList.toggle('active'),
+ cycleDetection: () => {
+ this.shareLinkManager?.claimRestoreLane?.('visual');
+ this._detectionUserOverridden = true;
+ cycleDetectionMode();
+ this._syncShareState();
+ },
+ toggleCctv: () => this._toggleCctvEnabled(),
+ },
+ });
+
+ this._displayControls?.destroy();
+ this._displayControls = bindDisplayControls({
+ elements: {
+ styleButtons: document.querySelectorAll('.style-btn'),
+ bloomButton: this._bloomBtn, bloomSlider: this._bloomSlider,
+ sharpenButton: this._sharpenBtn, sharpenSlider: this._sharpenSlider,
+ scopeButton: this._scopeBtn, scopeFeatherSlider: this._scopeFeatherSlider,
+ hudLayout: this._hudLayoutSelect, hudButton: this._hudBtn,
+ cleanViewButton: this._cleanViewBtn, cleanViewExitButton: this._cleanViewExitBtn,
+ densitySlider: this._detectionDensitySlider, detectionButton: this._detectionBtn,
+ allocationButtons: this._detectionAllocationBtns,
+ fadeSliders: [this._detectionFadeSlider, this._detectionOpacitySlider],
+ celestialButton: this._celestialBtn,
+ modelsButton: this._models3dBtn,
+ modelModeButtons: this._models3dBtn ? this._models3dModeBtns : [],
+ },
+ actions: {
+ setStyle: (style) => this.setStyle(style),
+ toggleBloom: () => {
+ this.shareLinkManager?.claimRestoreLane?.('visual');
+ this._setBloomEnabled(!this.bloomEnabled);
+ },
+ setBloomIntensity: (value) => {
+ this.shareLinkManager?.claimRestoreLane?.('visual');
+ this._setBloomIntensity(value);
+ },
+ toggleSharpen: () => {
+ this.shareLinkManager?.claimRestoreLane?.('visual');
+ this._setSharpenEnabled(!this.sharpenEnabled);
+ },
+ toggleScope: () => {
+ this.shareLinkManager?.claimRestoreLane?.('visual');
+ const next = !isScopeMaskEnabled();
+ setScopeMaskEnabled(next);
+ this._scopeBtn.classList.toggle('active', next);
+ this._scopeBtn.setAttribute('aria-pressed', String(next));
+ this._syncShareState();
+ },
+ setScopeFeather: (value) => {
+ this.shareLinkManager?.claimRestoreLane?.('visual');
+ const pct = Math.max(0, Math.min(100, value || 0));
+ if (this._scopeFeatherValue) this._scopeFeatherValue.textContent = `${pct}%`;
+ setScopeMaskFeather(pct / 100);
+ this._syncShareState();
+ },
+ setSharpenIntensity: (pct) => {
+ this.shareLinkManager?.claimRestoreLane?.('visual');
+ if (this._sharpenSliderValue) this._sharpenSliderValue.textContent = `${pct}%`;
+ this._applySharpenIntensity(pct / 100);
+ this._syncShareState();
+ },
+ setHudLayout: (value) => {
+ this.shareLinkManager?.claimRestoreLane?.('visual');
+ this._setHudVariant(value);
+ },
+ toggleCleanView: () => this.toggleCleanView(),
+ exitCleanView: () => this.toggleCleanView(false),
+ setDensity: (value) => {
+ this.shareLinkManager?.claimRestoreLane?.('visual');
+ this._detectionUserOverridden = true;
+ const pct = canonicalizeDensity(value);
+ this._detectionDensitySlider.value = String(pct);
+ if (this._detectionDensityValue) this._detectionDensityValue.textContent = `${pct}%`;
+ this._applyDetectionDensityFromUi();
+ this._syncShareState();
+ },
+ setAllocation: (value) => {
+ this.shareLinkManager?.claimRestoreLane?.('visual');
+ this._detectionUserOverridden = true;
+ this._setDetectionAllocation(value);
+ },
+ setFade: () => {
+ this.shareLinkManager?.claimRestoreLane?.('visual');
+ this._applyDetectionFadeFromUi();
+ this._syncShareState();
+ },
+ toggleCelestial: () => {
+ const ringIsVisible = !!this.celestialRing?.visible;
+ if (!this.celestialRingEnabled || !ringIsVisible) {
+ this.setCelestialRingEnabled(true, { focus: true });
+ } else {
+ this.setCelestialRingEnabled(false);
+ }
+ },
+ toggleHud: () => {
+ this.shareLinkManager?.claimRestoreLane?.('visual');
+ this.hud.toggle();
+ this._updateHudButtonState();
+ this._syncShareState();
+ },
+ cycleDetection: () => {
+ this.shareLinkManager?.claimRestoreLane?.('visual');
+ this._detectionUserOverridden = true;
+ cycleDetectionMode();
+ this._syncShareState();
+ },
+ toggleModels: () => {
+ this._setModels3dEnabled(!this._models3dEnabled);
+ this._syncModels3dModeRow();
+ },
+ setModelsMode: (mode) => this._setModels3dMode(mode),
+ },
+ });
+ }
+
+ /**
+ * Renders the owner-approved map stack chip row from the matching controller
+ * entries. Cesium ion/Bing chips remain keyboard-focusable but unavailable,
+ * with an accessible explanation, until a CESIUM_ION_TOKEN is configured.
+ * @returns {void}
+ */
+ _initMapStackControl() {
+ if (!this.mapStackController) return;
+ this._mapSourceControls?.destroy();
+ this._mapSourceControls = createMapSourceControls({
+ container: this._mapStackChips,
+ statusElement: this._mapStackStatus,
+ controller: this.mapStackController,
+ subscribe: (onChange) => {
+ window.addEventListener('gev:map-stack-changed', onChange);
+ return () => window.removeEventListener('gev:map-stack-changed', onChange);
+ },
+ claimSelection: () => this.shareLinkManager?.claimRestoreLane?.('map'),
+ onStateChanged: () => this._syncShareState(),
+ onError: (message) => this._showToast(message),
+ });
+ }
+
+ /**
+ * Switches the active map/globe source stack.
+ * @param {string} stackId - Map stack id.
+ * @param {object} [options]
+ * @param {boolean} [options.syncShare=true] - Whether to update the share link.
+ * @returns {Promise<void>}
+ */
+ async _setMapStack(stackId, { syncShare = true } = {}) {
+ if (!this.mapStackController) return;
+ return this._mapSourceControls.select(stackId, { syncShare });
+ }
+
+ /**
+ * Syncs the map stack chip row and status chip with controller state. The
+ * lit chip always follows `state.activeId`, never the click — a rejected or
+ * superseded switch therefore leaves the genuinely active stack lit.
+ * @param {object} state - Map stack controller state.
+ * @returns {void}
+ */
+ _renderMapStackState(state) {
+ this._mapSourceControls?.render(state);
+ }
+
+ /**
+ * Reads and canonicalizes the five-stop density control. The engine derives
+ * Sparse/Balanced/Dense from the same stop.
+ * @returns {void}
+ */
+ _applyDetectionDensityFromUi() {
+ const { getDetectionMode, setDetectionTuning } = this.services;
+ if (!this._detectionDensitySlider) return;
+ const pct = canonicalizeDensity(this._detectionDensitySlider.value);
+ this._detectionDensitySlider.value = String(pct);
+ if (this._detectionDensityValue) this._detectionDensityValue.textContent = `${pct}%`;
+ setDetectionTuning({ densityPct: pct });
+ this._updateDetectionButton(getDetectionMode());
+ }
+
+ /** Apply responsive keyhole fade controls from normalized UI percentages. */
+ _applyDetectionFadeFromUi() {
+ const { setKeyholeFadeTuning } = this.services;
+ const fadePct = Math.max(0, Math.min(40, Math.round(Number(this._detectionFadeSlider?.value) || 0)));
+ const outsideOpacityValue = this._detectionOpacitySlider?.value;
+ const outsideOpacityPct = Math.max(
+ 0,
+ Math.min(100, Math.round(outsideOpacityValue == null ? 3 : Number(outsideOpacityValue) || 0)),
+ );
+ if (this._detectionFadeSlider) this._detectionFadeSlider.value = String(fadePct);
+ if (this._detectionFadeValue) this._detectionFadeValue.textContent = `${fadePct}%`;
+ if (this._detectionOpacitySlider) this._detectionOpacitySlider.value = String(outsideOpacityPct);
+ if (this._detectionOpacityValue) this._detectionOpacityValue.textContent = `${outsideOpacityPct}%`;
+ setKeyholeFadeTuning({
+ fadeRatio: fadePct / 100,
+ outsideOpacity: outsideOpacityPct / 100,
+ });
+ this.viewer.scene.requestRender?.();
+ }
+
+ _setDetectionAllocation(strategy, { syncShare = true, persist = true } = {}) {
+ const { setDetectionTuning } = this.services;
+ const raw = String(strategy || '').trim().toUpperCase();
+ if (!ALLOCATION_STRATEGIES.includes(raw)) return false;
+ const normalized = normalizeAllocationStrategy(raw);
+ this._detectionAllocationPreference = normalized;
+ setDetectionTuning({ allocationStrategy: normalized });
+ for (const button of this._detectionAllocationBtns) {
+ const active = button.dataset.allocation === normalized;
+ button.classList.toggle('active', active);
+ button.setAttribute('aria-checked', String(active));
+ }
+ if (persist) {
+ try { localStorage.setItem(DETECTION_ALLOCATION_STORAGE_KEY, normalized); } catch { /* best effort */ }
+ }
+ if (syncShare) this._syncShareState();
+ return true;
+ }
+
+ _syncDetectionUiFromEngine() {
+ const { getKeyholeFadeTuning, getDetectionTuning, getDetectionMode } = this.services;
+ const tuning = getDetectionTuning();
+ if (this._detectionDensitySlider) this._detectionDensitySlider.value = String(tuning.densityPct);
+ if (this._detectionDensityValue) this._detectionDensityValue.textContent = `${tuning.densityPct}%`;
+ this._setDetectionAllocation(tuning.allocationStrategy, { syncShare: false, persist: false });
+ const fadeTuning = getKeyholeFadeTuning();
+ if (this._detectionFadeSlider) this._detectionFadeSlider.value = String(Math.round(fadeTuning.fadeRatio * 100));
+ if (this._detectionOpacitySlider) {
+ this._detectionOpacitySlider.value = String(Math.round(fadeTuning.outsideOpacity * 100));
+ }
+ this._applyDetectionFadeFromUi();
+ this._updateDetectionButton(getDetectionMode());
+ }
+
+ /**
+ * Activates a detection overlay mode by label (e.g. 'OFF', 'SPARSE', 'PANOPTIC').
+ * @param {string} modeLabel - Detection mode label to set.
+ * @returns {void}
+ */
+ _setDetectionMode(modeLabel) {
+ const { setDetectionModeByLabel } = this.services;
+ if (!modeLabel) return;
+ setDetectionModeByLabel(modeLabel);
+ this._syncDetectionUiFromEngine();
+ this._syncShareState();
+ }
+
+ /**
+ * Switches the HUD layout variant (e.g. 'tactical', 'minimal') and syncs
+ * the layout dropdown if present.
+ * @param {string} variantName - HUD variant identifier.
+ * @returns {void}
+ */
+ _setHudVariant(variantName) {
+ if (!variantName) return;
+ this.hud.setVariant(variantName);
+ if (this._hudLayoutSelect && this._hudLayoutSelect.value !== this.hud.getVariant()) {
+ this._hudLayoutSelect.value = this.hud.getVariant();
+ }
+ this._syncShareState();
+ this._scheduleAdaptivePanelLayout({ settle: true });
+ }
+
+ /**
+ * Keeps both responsive panel lanes and Cockpit's utility strip on the same
+ * measured layout commit. HUD visibility transitions can outlive the first
+ * animation frame, so variant changes receive one bounded settling pass.
+ * @param {{settle?: boolean}} [options] Whether to remeasure after transitions.
+ * @returns {void}
+ */
+ _scheduleAdaptivePanelLayout(options0) { return this._panelLayout._scheduleAdaptivePanelLayout(options0); }
+
+ /**
+ * Applies preset defaults (bloom, sharpen, shader uniforms, HUD variant)
+ * when a military-class style (CRT, NVG, FLIR) is selected. Does nothing
+ * for styles without entries in STYLE_PRESET_DEFAULTS.
+ * @param {string} styleName - The style whose defaults to apply.
+ * @returns {void}
+ */
+ _applyStylePresetDefaults(styleName) {
+ const { governorRequestRender } = this.services;
+ const preset = STYLE_PRESET_DEFAULTS[styleName];
+ if (!preset) return;
+
+ if (preset.styleParams && typeof preset.styleParams === 'object') {
+ for (const [targetStyle, params] of Object.entries(preset.styleParams)) {
+ const stage = this.stages[targetStyle];
+ if (!stage || !params || typeof params !== 'object') continue;
+ for (const [uniformName, uniformValue] of Object.entries(params)) {
+ if (stage.uniforms[uniformName] === undefined) continue;
+ stage.uniforms[uniformName] = uniformValue;
+ governorRequestRender('style-param');
+ }
+ }
+ }
+
+ const bloomInput = preset.bloom || {};
+ if (typeof bloomInput.intensity === 'number' && this._bloomSlider) {
+ this._setBloomIntensity(clampBloomIntensity(bloomInput.intensity), { syncShare: false });
+ }
+ if (typeof bloomInput.enabled === 'boolean') {
+ this._setBloomEnabled(bloomInput.enabled);
+ }
+
+ const sharpenInput = preset.sharpen || {};
+ if (typeof sharpenInput.intensity === 'number' && this._sharpenSlider) {
+ const sharpenPct = Math.max(0, Math.min(100, Math.round(sharpenInput.intensity)));
+ this._sharpenSlider.value = String(sharpenPct);
+ this._sharpenSliderValue.textContent = `${sharpenPct}%`;
+ this._applySharpenIntensity(sharpenPct / 100);
+ }
+ if (typeof sharpenInput.enabled === 'boolean') {
+ this._setSharpenEnabled(sharpenInput.enabled);
+ }
+
+ if (preset.hudVariant) {
+ this._setHudVariant(preset.hudVariant);
+ }
+ if (typeof preset.hudVisible === 'boolean') {
+ this.hud.setMode(preset.hudVisible ? 'on' : 'off');
+ this._updateHudButtonState();
+ }
+
+ // A style may set a detection default (e.g. military styles -> Dense for
+ // the "epic" default view), but ONLY if the user hasn't manually changed
+ // detection this session. Detection is user-controlled and persists across
+ // style switches, so an explicit Sparse/Off choice is never stomped.
+ if (preset.detection && !this._detectionUserOverridden) {
+ this._applyDetectionPreset(preset.detection);
+ }
+ }
+
+ /**
+ * Apply a detection preset's density and mode through the real UI path.
+ *
+ * Deliberately does NOT consult `_detectionUserOverridden` — the CALLER owns
+ * that decision. The style path checks it (an explicit Sparse/Off must
+ * survive a style switch); Cockpit entry does not (owner: detection is on in
+ * the cockpit "regardless").
+ * @param {{mode?: string, densityPct?: number}} det Preset detection config.
+ * @returns {void}
+ */
+ _applyDetectionPreset(det) {
+ if (!det) return;
+ if (typeof det.densityPct === 'number' && this._detectionDensitySlider) {
+ const pct = canonicalizeDensity(det.densityPct);
+ this._detectionDensitySlider.value = String(pct);
+ if (this._detectionDensityValue) this._detectionDensityValue.textContent = `${pct}%`;
+ this._applyDetectionDensityFromUi();
+ }
+ if (det.mode) this._setDetectionMode(String(det.mode).toUpperCase());
+ }
+
+ /**
+ * Applies the global post-processing baseline (GLOBAL_POST_DEFAULTS) at
+ * startup before any share-link restore runs. Sets bloom, sharpen, HUD,
+ * and detection to their factory defaults.
+ * @returns {void}
+ */
+ _applyGlobalPostDefaults() {
+ const defaults = GLOBAL_POST_DEFAULTS;
+ if (typeof defaults.bloom?.intensity === 'number' && this._bloomSlider) {
+ this._setBloomIntensity(clampBloomIntensity(defaults.bloom.intensity), { syncShare: false });
+ }
+ if (typeof defaults.bloom?.enabled === 'boolean') {
+ this._setBloomEnabled(defaults.bloom.enabled);
+ }
+
+ if (typeof defaults.sharpen?.intensity === 'number' && this._sharpenSlider) {
+ const sharpenPct = Math.max(0, Math.min(100, Math.round(defaults.sharpen.intensity)));
+ this._sharpenSlider.value = String(sharpenPct);
+ this._sharpenSliderValue.textContent = `${sharpenPct}%`;
+ this._applySharpenIntensity(sharpenPct / 100);
+ }
+ if (typeof defaults.sharpen?.enabled === 'boolean') {
+ this._setSharpenEnabled(defaults.sharpen.enabled);
+ }
+
+ if (defaults.hudVariant) {
+ this._setHudVariant(defaults.hudVariant);
+ }
+ if (typeof defaults.hudVisible === 'boolean') {
+ this.hud.setMode(defaults.hudVisible ? 'on' : 'off');
+ this._updateHudButtonState();
+ }
+
+ if (defaults.detectionMode) {
+ this._setDetectionMode(defaults.detectionMode);
+ }
+ if (typeof defaults.detectionDensity === 'number' && this._detectionDensitySlider) {
+ const density = canonicalizeDensity(defaults.detectionDensity);
+ this._detectionDensitySlider.value = String(density);
+ this._detectionDensityValue.textContent = `${density}%`;
+ this._applyDetectionDensityFromUi();
+ }
+ this._setDetectionAllocation(
+ this._detectionAllocationPreference || defaults.detectionAllocation || 'ELASTIC',
+ { syncShare: false, persist: false },
+ );
+ if (this._detectionFadeSlider) {
+ this._detectionFadeSlider.value = String(defaults.detectionFadePct ?? 7);
+ }
+ if (this._detectionOpacitySlider) {
+ this._detectionOpacitySlider.value = String(defaults.detectionOutsideOpacityPct ?? 1);
+ }
+ this._applyDetectionFadeFromUi();
+ if (typeof defaults.celestialRing === 'boolean') {
+ this.setCelestialRingEnabled(defaults.celestialRing, { syncShare: false, focus: false });
+ }
+ }
+
+ /**
+ * Pushes the current visual state (bloom, sharpen, HUD, detection) to
+ * the ShareLinkManager so the URL hash stays in sync.
+ * @returns {void}
+ */
+ /**
+ * Detection as a DURABLE preference, for serialization into a share link.
+ *
+ * While Contacts is active it OWNS detection and forces Dense @ 75%. That is
+ * a session-scoped override, not something the operator chose: it is undone
+ * verbatim on deactivation. Serializing the forced values shipped a link that
+ * pinned Dense @ 75% on the recipient — as a durable preference, with no
+ * Contacts mode present to explain or undo it — even though the author's own
+ * setting was (say) OFF @ 50%. Publish what deactivation would restore.
+ *
+ * `_contactsDetectionRestore` is exactly that snapshot and is null whenever
+ * Contacts does not own detection, so the live values are used normally.
+ */
+ _shareableDetectionState() {
+ const { getDetectionMode } = this.services;
+ return shareableDetectionState({
+ owned: this._contactsDetectionRestore,
+ liveMode: getDetectionMode(),
+ liveDensityPct: parseInt(this._detectionDensitySlider?.value || '50', 10),
+ });
+ }
+
+ _syncShareState() {
+ if (this._disposed) return;
+ const { getDetectionTuning, isScopeMaskEnabled, getScopeMaskFeather, getScopeTerminusOverride } = this.services;
+ const detection = this._shareableDetectionState();
+ this.shareLinkManager.onToggleChange(this.bloomEnabled, this.sharpenEnabled, {
+ bloomIntensity: this._getBloomIntensity(),
+ bloomVersion: BLOOM_SCALE_VERSION,
+ sharpenIntensity: parseInt(this._sharpenSlider?.value || '49', 10),
+ hudVariant: this.hud.getVariant(),
+ hudVisible: this.hud.visible,
+ detectionMode: detection.mode,
+ detectionDensity: detection.densityPct,
+ detectionAllocation: getDetectionTuning().allocationStrategy,
+ detectionFadePct: parseInt(this._detectionFadeSlider?.value || '7', 10),
+ detectionOutsideOpacityPct: parseInt(this._detectionOpacitySlider?.value || '1', 10),
+ celestialRingEnabled: this.celestialRingEnabled,
+ scopeEnabled: isScopeMaskEnabled(),
+ scopeFeatherPct: Math.round(getScopeMaskFeather() * 100),
+ // null when adaptive — the share layer omits `sce` entirely in that case.
+ scopeTerminusPct: getScopeTerminusOverride() == null
+ ? null
+ : Math.round(getScopeTerminusOverride() * 100),
+ mapStack: this.mapStackController?.getActiveId?.() || 'photoreal',
+ });
+ }
+
+ /**
+ * Updates the traffic sync status chip with loading phase label and progress.
+ * Auto-hides after 1.5s when loading completes; stays visible while busy.
+ * @param {boolean} [forceShow=false] - Force the chip visible regardless of busy state.
+ * @returns {void}
+ */
+ _updateTrafficSyncChip(forceShow, now) { return this._feedback._updateTrafficSyncChip(forceShow, now); }
+
+ /**
+ * Initializes panel collapse buttons and restores persisted collapsed state.
+ * Also sets up hover-expand behavior for the style presets and location bar panels.
+ * @returns {void}
+ */
+ _initPanelChrome() {
+ for (const control of this._panelDisclosureControls || []) control.destroy();
+ this._panelDisclosureControls = [];
+ const targets = new Map();
+ document.querySelectorAll('.panel-collapse-btn[data-collapse-target]').forEach((button) => {
+ const targetId = button.dataset.collapseTarget;
+ if (!targetId) return;
+ if (!targets.has(targetId)) targets.set(targetId, []);
+ targets.get(targetId).push(button);
+ });
+ for (const [targetId, buttons] of targets) {
+ const panel = document.getElementById(targetId);
+ if (!panel) continue;
+ this._panelDisclosureControls.push(bindPanelDisclosure({
+ panel,
+ buttons,
+ onChange: (collapsed, options) => this.setPanelCollapsed(targetId, collapsed, options),
+ onEscape: (event) => this._collapsePanelOnEscape(event, targetId),
+ }));
+ this._restorePanelCollapsedState(targetId, {
+ allowStored: !this._initialShareState,
+ });
+ }
+ // The command dock always starts compact; either wing reveals on hover,
+ // focus, or click and collapses again after the interaction moves away.
+ this.setPanelCollapsed('control-panel', true, { syncShare: false, persist: false });
+ this.setPanelCollapsed('location-bar', true, { syncShare: false, persist: false });
+ this._initAutoHoverPanel('control-panel', { openDelayMs: 140, closeDelayMs: 420 });
+ this._initAutoHoverPanel('location-bar', { openDelayMs: 140, closeDelayMs: 420 });
+ this._initCommandDockPins();
+ this._initCommandDockTrayMetrics();
+ this._maybeNotifyLayoutReset();
+ }
+
+ /**
+ * Collapses the nearest expanded panel that owns keyboard focus on Escape.
+ * Nested panels consume the event first, so one key closes one level and
+ * returns focus to that level's disclosure. If Escape was pressed on the
+ * disclosure itself, remove focus after closing so the collapsed button does
+ * not keep a stale keyboard ring.
+ * @param {KeyboardEvent} event - Candidate Escape key event.
+ * @param {string} panelId - Collapsible panel containing the listener.
+ * @returns {boolean} Whether this panel handled the key.
+ */
+ _collapsePanelOnEscape(event, panelId) {
+ return collapsePanelOnEscape(event, {
+ panel: document.getElementById(panelId),
+ onChange: (collapsed, options) => this.setPanelCollapsed(panelId, collapsed, options),
+ beforeCollapse: () => {
+ if (panelId !== 'location-bar' || !this._locationSearch) return;
+ this._locationSearch.classList.remove('expanded');
+ this._locationSearch.value = '';
+ this._locationSearch.blur();
+ },
+ });
+ }
+
+ /**
+ * Allows either command-dock tray to remain open until explicitly unpinned.
+ * Both trays may be pinned; transient and error trays stack above them.
+ * @returns {void}
+ */
+ _initCommandDockPins() {
+ document.querySelectorAll('.dock-pin-btn[data-pin-target]').forEach((button) => {
+ this._lifetime.listen(button, 'click', (event) => {
+ event.stopPropagation();
+ const panelId = button.dataset.pinTarget;
+ this._setCommandDockPanelPinState(panelId);
+ });
+ });
+ }
+
+ _setCommandDockPanelPinState(panelId, pin, {
+ restore = false,
+ persist = true,
+ syncShare = true,
+ } = {}) {
+ const panelEl = document.getElementById(panelId);
+ const button = document.querySelector(`.dock-pin-btn[data-pin-target="${panelId}"]`);
+ if (!panelEl || !button) return undefined;
+ const shouldPin = typeof pin === 'boolean'
+ ? pin
+ : !panelEl.classList.contains('dock-pinned');
+ panelEl.classList.toggle('dock-pinned', shouldPin);
+ button.setAttribute('aria-pressed', String(shouldPin));
+ document.querySelectorAll('#command-dock .dock-pinned-top').forEach((pinnedPanel) => {
+ pinnedPanel.classList.remove('dock-pinned-top');
+ });
+ if (shouldPin) {
+ panelEl.classList.add('dock-pinned-top');
+ this.setPanelCollapsed(panelId, false, {
+ explicit: !restore,
+ restore,
+ persist,
+ syncShare: false,
+ });
+ } else {
+ const remainingPinnedPanel = document.querySelector('#command-dock .dock-pinned');
+ remainingPinnedPanel?.classList.add('dock-pinned-top');
+ if (!restore && !panelEl.matches(':hover')) {
+ this.setPanelCollapsed(panelId, true, {
+ explicit: true,
+ persist,
+ syncShare: false,
+ });
+ }
+ }
+ this._updateCommandDockTrayStack();
+ if (syncShare) {
+ if (!restore) this.shareLinkManager?.claimRestoreLane?.('panel', panelId);
+ this.shareLinkManager?.onPanelStateChange?.();
+ }
+ return shouldPin;
+ }
+
+ /**
+ * Tracks the live pinned-tray height so a hovered sibling can stack above it
+ * without hardcoded content dimensions.
+ * @returns {void}
+ */
+ _initCommandDockTrayMetrics() { return this._panelLayout._initCommandDockTrayMetrics(); }
+
+ /**
+ * Writes each pinned tray height and their combined stack height as CSS
+ * variables. The most recently pinned tray forms the upper level.
+ * @returns {void}
+ */
+ _updateCommandDockTrayStack() { return this._panelLayout._updateCommandDockTrayStack(); }
+
+ /**
+ * One-time toast when stored v6 panel positions are superseded by the v7
+ * layout defaults (positions reset; collapsed states are preserved).
+ * @returns {void}
+ */
+ _maybeNotifyLayoutReset() { return this._panelPosition._maybeNotifyLayoutReset(); }
+
+ /**
+ * Configures intentional hover-expand / leave-collapse behavior on a panel.
+ * Uses separate open/close timers to prevent accidental flicker from fast
+ * mouse passes. Wheel events cancel pending opens to avoid surprise expansion
+ * during scroll-through.
+ * @param {string} panelId - DOM id of the panel element.
+ * @param {object} [options]
+ * @param {number} [options.openDelayMs=850] - Hover dwell time before auto-expanding.
+ * @param {number} [options.closeDelayMs=1000] - Delay after pointer leaves before collapsing.
+ * @returns {void}
+ */
+ _initAutoHoverPanel(panelId, { openDelayMs = 850, closeDelayMs = 1000 } = {}) {
+ const panel = document.getElementById(panelId);
+ if (!panel) return;
+ this._hoverPanelControls ??= new Map();
+ this._hoverPanelControls.get(panelId)?.destroy();
+ const controller = createHoverDisclosure({
+ panel,
+ documentRef: document,
+ disclosure: panel.querySelector(`[data-dock-toggle-target="${panelId}"]`),
+ openDelayMs,
+ closeDelayMs,
+ isActive: () => !this._disposed,
+ onChange: (collapsed, options) => this.setPanelCollapsed(panelId, collapsed, options),
+ onEscape: (event) => this._collapsePanelOnEscape(event, panelId),
+ focusTarget: panelId === 'control-panel' ? () => (
+ panel.querySelector('.map-stack-chip.active') || panel.querySelector('.map-stack-chip')
+ ) : null,
+ });
+ this._hoverPanelControls.set(panelId, controller);
+ if (panelId === 'control-panel') {
+ this._cancelMapSourceFocus?.();
+ this._cancelMapSourceFocus = controller.cancelPendingFocus;
+ }
+ }
+
+ /**
+ * Sets up drag-to-reposition for legacy floating controls. The right rail
+ * and left accordion remain fixed so their HUD alignment is deterministic.
+ * @returns {void}
+ */
+ _initPanelDrag() { return this._panelPosition._initPanelDrag(); }
+
+ _persistAwarenessSelection(event, cleared = false) {
+ if (!this._dataManager) return;
+ const origin = String(event?.detail?.origin || 'programmatic');
+ if (!isExplicitLayerStateOrigin(origin)) return;
+ const layerId = String(event?.detail?.layerId || '');
+ const config = {
+ flights: {
+ key: 'selectedFlightsTrackingId',
+ normalize: (value) => String(value ?? '').trim().toLowerCase() || null,
+ },
+ military: {
+ key: 'selectedMilitaryTrackingId',
+ normalize: (value) => String(value ?? '').trim().toLowerCase() || null,
+ },
+ satellites: {
+ key: 'selectedSatTrackingId',
+ normalize: (value) => {
+ const candidate = Number(value);
+ return Number.isFinite(candidate) && candidate > 0 ? Math.trunc(candidate) : null;
+ },
+ },
+ }[layerId];
+ if (!config) return;
+ const selectedValue = cleared ? null : config.normalize(event?.detail?.id);
+ if (cleared || selectedValue === null) {
+ this._dataManager.adoptLayerParams?.(layerId, {
+ [config.key]: selectedValue,
+ }, { origin });
+ return;
+ }
+ // A direct selection promotes a Context-owned tracker dependency into
+ // durable visibility before its selected ID is normalized. Context exit
+ // also keeps this adopted layer instead of tearing down the user's track.
+ const visibilityAdopted = this._dataManager.adoptLayerVisibility?.(
+ layerId,
+ true,
+ { origin, adoptedFromSelection: true },
+ );
+ if (visibilityAdopted === false) return;
+ // Clear the prior family before publishing the replacement. Otherwise the
+ // coordinator briefly sees two IDs and correctly treats them as an
+ // ambiguous incoming state, which would discard the new durable target.
+ for (const [otherLayerId, otherKey] of [
+ ['flights', 'selectedFlightsTrackingId'],
+ ['military', 'selectedMilitaryTrackingId'],
+ ['satellites', 'selectedSatTrackingId'],
+ ]) {
+ if (otherLayerId === layerId) continue;
+ this._dataManager.setLayerParams(otherLayerId, { [otherKey]: null }, { origin });
+ }
+ this._dataManager.adoptLayerParams?.(layerId, {
+ [config.key]: selectedValue,
+ }, { origin });
+ }
+
+ /**
+ * Connects the layer data manager for traffic sync, CCTV state subscription,
+ * and layer enable/disable operations.
+ * @param {object|null} dataManager - The DataManager instance, or null to detach.
+ * @returns {void}
+ */
+ attachDataManager(dataManager) {
+ this._dataManager = dataManager || null;
+ this.hud.attachDataManager(this._dataManager);
+ this._updateTrafficSyncChip();
+ if (this._dataManagerUnsubscribe) {
+ this._dataManagerUnsubscribe();
+ this._dataManagerUnsubscribe = null;
+ }
+ this._contextControls.connect(this._dataManager);
+ if (typeof this._dataManager?.subscribe === 'function') {
+ this._dataManagerUnsubscribe = this._dataManager.subscribe((change) => {
+ this._feedback._loadingFeedbackEvent = change;
+ this._updateGlobalLoadingFeedback(performance.now());
+ });
+ }
+ this._updateGlobalLoadingFeedback(performance.now());
+ this._syncContextModeButtons();
+ this._cctvControls.connect();
+ this._radioControls.connect();
+ if (!this._awarenessSelectedHandler) {
+ this._awarenessSelectedHandler = (event) => this._persistAwarenessSelection(event, false);
+ this._awarenessClearedHandler = (event) => this._persistAwarenessSelection(event, true);
+ window.addEventListener('gev:awareness-subject-selected', this._awarenessSelectedHandler);
+ window.addEventListener('gev:awareness-subject-cleared', this._awarenessClearedHandler);
+ }
+ this._layerStateCoordinator?.destroy();
+ this._layerStateCoordinator = null;
+ this._layerStateRestorePromise = null;
+ if (this._dataManager) {
+ this._layerStateCoordinator = new LayerStateCoordinator(
+ this._dataManager,
+ this.shareLinkManager,
+ {
+ onDurableStateChange: (state) => this._syncModels3dFromLayerState(state),
+ onTrackingRestoreStatus: (result) => this._handleShareTrackingRestoreStatus(result),
+ },
+ );
+ this._layerStateRestorePromise = this._layerStateCoordinator.start({
+ shareLayerState: this._initialShareState?.layerState || null,
+ shareCreatedAtMs: this._initialShareState?.sharedAtMs ?? null,
+ // Any valid camera/style share isolates recipient-local preferences,
+ // including legacy and malformed-v2 layer payloads.
+ allowLocalState: !this._initialShareState,
+ });
+ if (this._initialShareSelectionSuperseded) {
+ this._layerStateCoordinator.cancelPendingShareTracking(
+ 'superseded-before-layer-coordinator-start',
+ { clearSelection: true },
+ );
+ }
+ void this._layerStateRestorePromise.then(() => {
+ this._syncModels3dFromLayerState(this._layerStateCoordinator?.getDurableState());
+ });
+ }
+ }
+
+ _handleShareTrackingRestoreStatus(result) {
+ if (!result || this._disposed) return;
+ const trackingKey = `${result.layerId || ''}:${result.targetId ?? ''}`;
+ if (result.classification === 'pending') {
+ this._shareTrackingNoticeGeneration += 1;
+ this._shareTrackingAcquiringKey = trackingKey;
+ this._showGlobalStatusNotice('ACQUIRING', {
+ state: 'acquiring',
+ detail: `SHARED ${String(result.label || 'SUBJECT').toUpperCase()}`,
+ persistent: true,
+ });
+ return;
+ }
+ const ownsAcquiringNotice = this._shareTrackingAcquiringKey === trackingKey;
+ if (ownsAcquiringNotice) {
+ this._shareTrackingNoticeGeneration += 1;
+ this._shareTrackingAcquiringKey = null;
+ if (this._feedback._globalStatusNotice?.state === 'acquiring') {
+ this._feedback._globalStatusNotice = null;
+ this._updateGlobalLoadingFeedback();
+ }
+ }
+ if (result.classification === 'followed' || result.classification === 'cancelled') return;
+ // A stale terminal result must never replace a newer target's acquisition.
+ if (this._shareTrackingAcquiringKey) return;
+ const noticeGeneration = ownsAcquiringNotice
+ ? this._shareTrackingNoticeGeneration
+ : ++this._shareTrackingNoticeGeneration;
+ const subject = result.label || 'entity';
+ const message = result.classification === 'expired'
+ ? `Shared ${subject} follow expired`
+ : result.classification === 'source-unavailable'
+ ? `Shared ${subject} could not be restored — feed unavailable`
+ : `Shared ${subject} is unavailable`;
+ const showAfterStartupCover = () => {
+ this._lifetime.frame(() => {
+ if (!canPresentDeferredStatusNotice(
+ noticeGeneration,
+ this._shareTrackingNoticeGeneration,
+ this._disposed,
+ )) return;
+ const startupCover = document.getElementById('loading-screen');
+ if (!startupCover || getComputedStyle(startupCover).visibility === 'hidden') {
+ this._showGlobalStatusNotice(message);
+ return;
+ }
+ let fallbackTimer = null;
+ let removeStartupListener = () => {};
+ const showOnce = () => {
+ removeStartupListener();
+ if (fallbackTimer) this._lifetime.cancelTimeout(fallbackTimer);
+ if (canPresentDeferredStatusNotice(
+ noticeGeneration,
+ this._shareTrackingNoticeGeneration,
+ this._disposed,
+ )) this._showGlobalStatusNotice(message);
+ };
+ removeStartupListener = this._lifetime.listen(startupCover, 'transitionend', showOnce, { once: true });
+ fallbackTimer = this._lifetime.timeout(showOnce, 1000);
+ });
+ };
+ if (this._resolveInitialShareRestore) {
+ void this.initialRestorePromise.then(showAfterStartupCover);
+ return;
+ }
+ showAfterStartupCover();
+ }
+
+ get _contextMode() { return this._contextControls?._contextMode ?? null; }
+ get _contextModeChanging() { return this._contextControls?._contextModeChanging ?? false; }
+ get _preservePanelStateDuringLayerClear() { return this._contextControls?._preservePanelStateDuringLayerClear ?? false; }
+
+ _initGlobalContextPanel() {
+ const { radioLayer, militaryInstallationsLayer } = this.services;
+ this._contextControls = new ContextControls({
+ elements: {
+ _globalContextPanel: document.getElementById('global-context-panel'),
+ _globalContextFlightsBtn: this._globalContextFlightsBtn,
+ _globalContextMissionsBtn: this._globalContextMissionsBtn,
+ _contextModeStandby: this._contextModeStandby,
+ _contextFlightsView: this._contextFlightsView,
+ _contextMissionsView: this._contextMissionsView,
+ _installationsSearchBtn: this._installationsSearchBtn,
+ },
+ installations: militaryInstallationsLayer,
+ actions: {
+ getCockpit: () => this.cockpitView,
+ refreshRadio: () => this._renderRadioState(radioLayer.getUIState()),
+ claimVisualAuthority: () => this.shareLinkManager?.claimRestoreLane?.('visual'),
+ syncDetection: () => this._syncContactsDetection(),
+ scheduleLayout: () => this._scheduleRightPanelLayout(),
+ setPanelCollapsed: (...args) => this.setPanelCollapsed(...args),
+ showToast: (message) => { if (!this._disposed) this._showToast(message); },
+ setClearBusy: (busy) => { if (!this._disposed) this._clearLayersControl?.setBusy(busy); },
+ },
+ });
+ }
+
+ _runUserFacingContextAction(...args) { return this._contextControls?._runUserFacingContextAction(...args); }
+
+ _waitForContextLayerSettlement(...args) { return this._contextControls?._waitForContextLayerSettlement(...args); }
+
+ _syncContextModeButtons(...args) { return this._contextControls?._syncContextModeButtons(...args); }
+
+ /** Wire the independent Radio companion controls. */
+ _initRadioPanel() {
+ const { radioLayer } = this.services;
+ this._radioControls?.destroy();
+ this._radioControls = new RadioControls({
+ elements: {
+ _cockpitDisplayPanel: this._cockpitDisplayPanel,
+ _cockpitDisplayToggleBtn: this._cockpitDisplayToggleBtn,
+ _cockpitRadioEnableBtn: this._cockpitRadioEnableBtn,
+ _cockpitRadioNextBtn: this._cockpitRadioNextBtn,
+ _cockpitRadioPanel: this._cockpitRadioPanel,
+ _cockpitRadioPlayBtn: this._cockpitRadioPlayBtn,
+ _cockpitRadioPrevBtn: this._cockpitRadioPrevBtn,
+ _cockpitRadioStation: this._cockpitRadioStation,
+ _cockpitRadioToggleBtn: this._cockpitRadioToggleBtn,
+ _cockpitRadioVolume: this._cockpitRadioVolume,
+ _cockpitRadioVolumeValue: this._cockpitRadioVolumeValue,
+ _cockpitUtilityControls: this._cockpitUtilityControls,
+ _contextRadioDetailsBtn: this._contextRadioDetailsBtn,
+ _contextRadioDock: this._contextRadioDock,
+ _contextRadioMini: this._contextRadioMini,
+ _contextRadioMiniCloseBtn: this._contextRadioMiniCloseBtn,
+ _contextRadioMiniEnableBtn: this._contextRadioMiniEnableBtn,
+ _contextRadioMiniNextBtn: this._contextRadioMiniNextBtn,
+ _contextRadioMiniPlayBtn: this._contextRadioMiniPlayBtn,
+ _contextRadioMiniPrevBtn: this._contextRadioMiniPrevBtn,
+ _contextRadioMiniStation: this._contextRadioMiniStation,
+ _contextRadioMiniVolume: this._contextRadioMiniVolume,
+ _contextRadioMiniVolumeValue: this._contextRadioMiniVolumeValue,
+ _contextRadioToggleBtn: this._contextRadioToggleBtn,
+ _radioEnableBtn: this._radioEnableBtn,
+ _radioFilter: this._radioFilter,
+ _radioLayerState: this._radioLayerState,
+ _radioNextBtn: this._radioNextBtn,
+ _radioPanel: this._radioPanel,
+ _radioPlayBtn: this._radioPlayBtn,
+ _radioPlaybackState: this._radioPlaybackState,
+ _radioPrevBtn: this._radioPrevBtn,
+ _radioStationHomepage: this._radioStationHomepage,
+ _radioStationMeta: this._radioStationMeta,
+ _radioStationName: this._radioStationName,
+ _radioStationTags: this._radioStationTags,
+ _radioStopBtn: this._radioStopBtn,
+ _radioTuner: this._radioTuner,
+ _radioTunerBandLabel: this._radioTunerBandLabel,
+ _radioTunerNeedle: this._radioTunerNeedle,
+ _radioTunerSlider: this._radioTunerSlider,
+ _radioTunerStation: this._radioTunerStation,
+ _radioTunerValue: this._radioTunerValue,
+ _radioVolume: this._radioVolume,
+ _radioVolumeValue: this._radioVolumeValue,
+ },
+ radio: radioLayer,
+ canvas: this.viewer?.canvas,
+ actions: {
+ isRegistered: () => this._dataManager?.layers?.has('radio'),
+ isEnabled: () => this._dataManager?.isEnabled('radio'),
+ setEnabled: (enabled, options) => this._dataManager.setEnabled('radio', enabled, options),
+ setParams: (params, options) => this._dataManager?.setLayerParams('radio', params, options),
+ getLifecycle: () => this._dataManager?.getLayerLifecycleState?.('radio'),
+ runUserAction: (...args) => this._runUserFacingContextAction(...args),
+ setPanelCollapsed: (...args) => this.setPanelCollapsed(...args),
+ revealStyleParameters: () => this._revealCockpitStyleParameters(),
+ setSignalCollapsed: (value) => this.cockpitView?.setSignalCollapsed(value),
+ isCockpitActive: () => this.cockpitView?.active,
+ signalUserCollapsed: () => this.cockpitView?.signalUserCollapsed,
+ layoutCockpit: () => this.cockpitView?.scheduleContextLayout(),
+ preservePanelStateDuringClear: () => this._preservePanelStateDuringLayerClear,
+ scheduleLayout: () => this._scheduleRightPanelLayout(),
+ },
+ });
+ }
+
+ _setCockpitDisclosure(...args) { return this._radioControls?._setCockpitDisclosure?.(...args); }
+
+ _setRadioDisclosure(...args) { return this._radioControls?._setRadioDisclosure?.(...args); }
+
+ _syncContextRadioLauncherState(...args) { return this._radioControls?._syncContextRadioLauncherState?.(...args); }
+
+ _renderRadioState(...args) { return this._radioControls?._renderRadioState?.(...args); }
+
+ /**
+ * Activates an explicit CCTV target, then releases tracking before its camera
+ * flight. Cockpit mode keeps tracking and suppresses only the flight.
+ * @param {Function} activate CCTV target activation returning its camera ID.
+ * @param {Function} focus CCTV camera flight receiving the activated ID.
+ * @returns {*} Focus operation result.
+ */
+ _runExplicitCctvFocus(activate, focus) {
+ if (this._disposed) return false;
+ const cameraId = activate();
+ if (!cameraId) return false;
+ return this._runExplicitNavigation('camera', () => focus(cameraId));
+ }
+
+ /** Compose camera panel controls from the existing camera port and application actions. */
+ _initCctvPanel() {
+ const { cctvLayer } = this.services;
+ this._cctvControls?.destroy();
+ this._cctvControls = new CctvControls({
+ elements: {
+ _cctvAdjustBtn: this._cctvAdjustBtn,
+ _cctvAutoHopBtn: this._cctvAutoHopBtn,
+ _cctvCalReadout: this._cctvCalReadout,
+ _cctvCalibResetBtn: this._cctvCalibResetBtn,
+ _cctvCalibSaveBtn: this._cctvCalibSaveBtn,
+ _cctvCoverageBtn: this._cctvCoverageBtn,
+ _cctvEnableBtn: this._cctvEnableBtn,
+ _cctvFocusBtn: this._cctvFocusBtn,
+ _cctvFrame: this._cctvFrame,
+ _cctvFrameWrap: this._cctvFrameWrap,
+ _cctvMeta: this._cctvMeta,
+ _cctvNearestBtn: this._cctvNearestBtn,
+ _cctvNextBtn: this._cctvNextBtn,
+ _cctvPanel: this._cctvPanel,
+ _cctvPrevBtn: this._cctvPrevBtn,
+ _cctvProjectionBtn: this._cctvProjectionBtn,
+ _cctvQualityChip: this._cctvQualityChip,
+ _cctvSelect: this._cctvSelect,
+ _cctvSourceBadge: this._cctvSourceBadge,
+ _cctvSummary: this._cctvSummary,
+ _cctvSyncChip: this._cctvSyncChip,
+ _cctvSyncLabel: this._cctvSyncLabel,
+ _cctvSyncProgress: this._cctvSyncProgress,
+ },
+ cctv: cctvLayer,
+ actions: {
+ isEnabled: () => this._dataManager?.isEnabled('cctv'),
+ setParams: (params, options) => this._dataManager?.setLayerParams('cctv', params, options),
+ toggleEnabled: (...args) => this._toggleCctvEnabled(...args),
+ runExplicitFocus: (...args) => this._runExplicitCctvFocus(...args),
+ setPanelCollapsed: (...args) => this.setPanelCollapsed(...args),
+ showToast: (message) => this._showToast(message),
+ syncViewport: () => this._syncCctvPanelViewport(),
+ setSplitFlapText,
+ },
+ });
+ }
+
+ /**
+ * Toggles the CCTV layer enabled state. When enabling and no camera is active,
+ * auto-focuses on the nearest camera.
+ * @param {boolean} [forceState] - Explicit on/off. Omit to toggle.
+ * @returns {Promise<boolean>} True if the layer is now in the requested state.
+ */
+ async _toggleCctvEnabled(forceState) {
+ const { cctvLayer } = this.services;
+ if (this._disposed) return false;
+ if (!this._dataManager || !this._dataManager.layers?.has('cctv')) {
+ this._showToast('CCTV layer unavailable');
+ return false;
+ }
+ const enabled = this._dataManager.isEnabled('cctv');
+ const target = typeof forceState === 'boolean' ? forceState : !enabled;
+ if (target === enabled) return true;
+ await runCctvLayerEnableTransition({
+ target,
+ setEnabled: (next) => this._dataManager.setEnabled('cctv', next, { origin: 'user' }),
+ readOwnership: () => ({
+ trackedEntity: this.viewer?.trackedEntity,
+ cockpitActive: !!this.cockpitView?.active,
+ }),
+ shouldFocus: () => !this._disposed && this._dataManager.isEnabled('cctv')
+ && !this._cctvControls?.getState()?.activeCameraId,
+ activate: () => cctvLayer.focusNearest({ focus: false }),
+ fly: (cameraId) => this._runExplicitCctvFocus(
+ () => cameraId,
+ (selectedId) => cctvLayer.focusCamera(selectedId, 1.6),
+ ),
+ });
+ return true;
+ }
+
+ /**
+ * Returns the versioned localStorage key for a panel's saved position.
+ * @param {string} panelId - DOM id of the panel.
+ * @returns {string} localStorage key.
+ */
+ _panelStorageKey(panelId) { return this._panelPosition._panelStorageKey(panelId); }
+
+ /**
+ * Returns the versioned localStorage key for a panel's collapsed state.
+ * @param {string} panelId - DOM id of the panel.
+ * @returns {string} localStorage key.
+ */
+ _panelCollapseStorageKey(panelId) { return this._panelPosition._panelCollapseStorageKey(panelId); }
+
+ /**
+ * Restores a panel's collapsed/expanded state from localStorage.
+ * Falls back to the CSS class default if no saved state exists.
+ * @param {string} panelId - DOM id of the panel.
+ * @returns {void}
+ */
+ _restorePanelCollapsedState(panelId, options1) { return this._panelPosition._restorePanelCollapsedState(panelId, options1); }
+
+ /**
+ * Persists a panel's collapsed state ('1' or '0') to localStorage.
+ * @param {string} panelId - DOM id of the panel.
+ * @param {boolean} collapsed - Whether the panel is collapsed.
+ * @returns {void}
+ */
+ _savePanelCollapsedState(panelId, collapsed) { return this._panelPosition._savePanelCollapsedState(panelId, collapsed); }
+
+ /**
+ * Builds one fixed right-side rail from Display, CCTV, its parameter
+ * controls, and Global Context (which owns the nested Radio companion).
+ * The rail then measures the live HUD chrome at runtime so it can stay
+ * aligned and within the available vertical corridor.
+ * @returns {void}
+ */
+ _initRightPanelAdaptiveLayout() { return this._panelLayout._initRightPanelAdaptiveLayout(); }
+
+ _scheduleRightPanelLayout(options0) { return this._panelLayout._scheduleRightPanelLayout(options0); }
+
+ /**
+ * Places the right rail inside the visible HUD-safe corridor. When the
+ * corridor is too short, the expanded panel receives the remaining height
+ * with internal scrolling. Tactical HUD hides collapsed sibling launchers
+ * while a panel is expanded; other HUD layouts keep them visible.
+ * @returns {void}
+ */
+ _syncRightPanelAdaptiveLayout() { return this._panelLayout._syncRightPanelAdaptiveLayout(); }
+
+ /**
+ * Initializes the adaptive left accordion. The layout engine measures the
+ * actual HUD/chrome rectangles that intersect the left lane, then decides
+ * whether collapsed sibling labels can remain visible beside the expanded
+ * panel. No decision is keyed to a specific panel or HUD variant.
+ * @returns {void}
+ */
+ _initLeftPanelAdaptiveLayout() { return this._panelLayout._initLeftPanelAdaptiveLayout(); }
+
+ /**
+ * Batches adaptive accordion work into one animation frame.
+ * @returns {void}
+ */
+ _scheduleLeftPanelLayout(options0) { return this._panelLayout._scheduleLeftPanelLayout(options0); }
+
+ /**
+ * Measures a live obstacle-free corridor for the left accordion and toggles
+ * focus mode only when the expanded panel plus sibling labels cannot fit.
+ * Safe boundaries are written as viewport-relative CSS values.
+ * @returns {void}
+ */
+ _syncLeftPanelAdaptiveLayout() { return this._panelLayout._syncLeftPanelAdaptiveLayout(); }
+
+ /**
+ * Updates collapse button glyphs based on panel state. Right-rail panels
+ * use directional arrows; left-stack panels use +/- symbols.
+ * @param {HTMLElement} panelEl - The panel DOM element.
+ * @returns {void}
+ */
+ _syncPanelCollapseButton(panelEl) {
+ const isRightRail = ['pp-toggles', 'cctv-panel', 'global-context-panel'].includes(panelEl?.id);
+ const collapsed = panelEl.classList.contains('collapsed');
+ panelEl.querySelectorAll('.panel-collapse-btn[data-collapse-target]').forEach((btn) => {
+ const owner = btn.closest('[data-panel-id], #param-slider-panel');
+ if (owner !== panelEl) return;
+ if (isRightRail) {
+ btn.textContent = collapsed ? '◀' : '▶';
+ } else {
+ btn.textContent = collapsed ? '+' : '−';
+ }
+ btn.setAttribute('aria-expanded', String(!collapsed));
+ const panelName = panelEl.querySelector('.panel-title, .pp-header-label')?.textContent?.trim() || 'panel';
+ const action = collapsed ? 'Expand' : 'Collapse';
+ btn.title = `${action} ${panelName}`;
+ btn.setAttribute('aria-label', `${action} ${panelName}`);
+ if (panelEl.id === 'radio-panel') {
+ const action = collapsed ? 'Expand' : 'Collapse';
+ btn.title = `${action} Radio`;
+ btn.setAttribute('aria-label', `${action} Radio section`);
+ }
+ });
+ const dockToggle = panelEl.querySelector(`[data-dock-toggle-target="${panelEl.id}"]`);
+ if (dockToggle) {
+ const panelName = panelEl.querySelector('.panel-title, .location-toolbar-label')?.textContent?.trim() || 'panel';
+ const action = collapsed ? 'Expand' : 'Collapse';
+ dockToggle.setAttribute('aria-expanded', String(!collapsed));
+ dockToggle.setAttribute('aria-label', `${action} ${panelName}`);
+ dockToggle.title = `${action} ${panelName}`;
+ }
+ if (panelEl.id === 'radio-panel' && this._contextRadioDetailsBtn) {
+ this._contextRadioDetailsBtn.setAttribute('aria-expanded', String(!collapsed));
+ }
+ if (panelEl.id === 'radio-panel' || panelEl.id === 'global-context-panel') {
+ this._syncContextRadioLauncherState();
+ }
+ }
+
+ /**
+ * Converts a panel from left-positioned to right-anchored so it expands
+ * leftward on resize. Used for the right-rail parameter panel.
+ * @param {HTMLElement} panelEl - The panel to re-anchor.
+ * @returns {void}
+ */
+ _pinPanelToRight(panelEl) { return this._panelPosition._pinPanelToRight(panelEl); }
+
+ /**
+ * Restores a panel's top/left position from localStorage.
+ * Right-rail panels are additionally pinned to the right edge.
+ * @param {string} panelId - DOM id of the panel.
+ * @param {HTMLElement} panelEl - The panel DOM element.
+ * @returns {void}
+ */
+ _restorePanelPosition(panelId, panelEl) { return this._panelPosition._restorePanelPosition(panelId, panelEl); }
+
+ /**
+ * Clamp a desired left/top so the panel stays fully on-screen (6px inset), matching the drag
+ * clamp (ui.js ~1822). Width/height are position-independent, so reading the rect first is safe.
+ * @param {number} left - desired left (px)
+ * @param {number} top - desired top (px)
+ * @param {HTMLElement} panelEl - the panel element
+ * @returns {{left:number, top:number}}
+ */
+ _clampToViewport(left, top, panelEl) { return this._panelPosition._clampToViewport(left, top, panelEl); }
+
+ /**
+ * Persists a panel's current bounding-rect position to localStorage.
+ * @param {string} panelId - DOM id of the panel.
+ * @param {HTMLElement} panelEl - The panel DOM element.
+ * @returns {void}
+ */
+ _savePanelPosition(panelId, panelEl) { return this._panelPosition._savePanelPosition(panelId, panelEl); }
+
+ /**
+ * Makes a panel draggable via its handle element. Implements:
+ * - Z-order promotion: each pointerdown increments the global z-counter
+ * so the clicked panel floats above siblings.
+ * - Viewport clamping: drag moves are clamped to a 6px inset from all edges.
+ * - Right-rail pinning: pp-toggles panel is re-anchored right after drag.
+ * - CCTV viewport sync: cctv-panel recalculates scroll height after drag.
+ * @param {string} panelId - DOM id of the panel.
+ * @param {HTMLElement} panelEl - The panel DOM element.
+ * @param {HTMLElement} handleEl - The drag handle element within the panel.
+ * @returns {void}
+ */
+ /**
+ * Promotes a panel to the top of the panel z band [PANEL_Z_BASE, PANEL_Z_MAX].
+ * Renormalizes all promoted panels when the band is exhausted so panels can
+ * never climb above the voice pill (150), toasts (200), or clean-view exit (300).
+ * @param {HTMLElement} panelEl - Panel to bring to front.
+ * @returns {void}
+ */
+ _promotePanelZ(panelEl) { return this._panelPosition._promotePanelZ(panelEl); }
+
+ _makePanelDraggable(panelId, panelEl, handleEl) { return this._panelPosition._makePanelDraggable(panelId, panelEl, handleEl); }
+
+ _buildSharePanelState() {
+ const specs = [];
+ for (const spec of SHARE_PANEL_STATE_SPECS) {
+ const panelEl = document.getElementById(spec.id);
+ if (!panelEl) continue;
+ // Responsive auto-collapse is presentation only; the recipient should
+ // restore the user's explicit expanded preference at its own viewport.
+ const collapsed = panelEl.classList.contains('layout-auto-collapsed')
+ ? false
+ : panelEl.classList.contains('collapsed');
+ const entry = { id: spec.id, collapsed };
+ if (spec.pinnable) entry.pinned = panelEl.classList.contains('dock-pinned');
+ specs.push(entry);
+ }
+ return specs.length ? { specs } : null;
+ }
+
+ _restorePanelState(panelState) {
+ if (!panelState || !Array.isArray(panelState.specs)) return;
+ const specsById = new Map(panelState.specs.map((spec) => [spec.id, spec]));
+ for (const spec of SHARE_PANEL_STATE_SPECS) {
+ const state = specsById.get(spec.id);
+ if (!state || typeof state.collapsed !== 'boolean') continue;
+ if (spec.pinnable && typeof state.pinned === 'boolean') {
+ this._setCommandDockPanelPinState(spec.id, state.pinned, {
+ restore: true,
+ persist: false,
+ syncShare: false,
+ });
+ }
+ const nextCollapsed = state.pinned && spec.pinnable ? false : state.collapsed;
+ this.setPanelCollapsed(spec.id, nextCollapsed, {
+ restore: true,
+ persist: false,
+ syncShare: false,
+ });
+ }
+ this.shareLinkManager?.onPanelStateChange?.();
+ }
+
+ /**
+ * Programmatically collapses or expands a panel, persists the state,
+ * and triggers layout recalculation for dependent panels.
+ * @param {string} panelId - DOM id of the panel.
+ * @param {boolean} collapsed - Whether to collapse the panel.
+ * @param {object} [options] Disclosure ownership options.
+ * @param {boolean} [options.explicit=false] Whether a direct user action owns the panel lane.
+ * @returns {void}
+ */
+ setPanelCollapsed(panelId, collapsed, {
+ explicit = false,
+ restore = false,
+ persist = true,
+ syncShare = true,
+ } = {}) {
+ if (panelId === 'control-panel' && collapsed) this._cancelMapSourceFocus?.();
+ const panelEl = document.getElementById(panelId);
+ if (!panelEl) return;
+ if (explicit && !restore) this.shareLinkManager?.claimRestoreLane?.('panel', panelId);
+ const nextCollapsed = Boolean(collapsed);
+ const wasAutoCollapsed = panelEl.classList.contains('layout-auto-collapsed');
+ const leftOwnerPanel = this._leftPanelStack?.contains(panelEl) ? panelEl : null;
+ const rightOwnerPanel = panelId === 'radio-panel'
+ ? document.getElementById('global-context-panel')
+ : (this._rightPanelStack?.contains(panelEl) ? panelEl : null);
+ const priorLeftOwner = this._panelLayout._leftStackPreferredPanelId;
+ const priorRightOwner = this._panelLayout._rightStackPreferredPanelId;
+ if (explicit && !restore && !nextCollapsed && leftOwnerPanel) {
+ this._panelLayout._leftStackPreferredPanelId = leftOwnerPanel.id;
+ } else if (explicit && !restore && nextCollapsed && leftOwnerPanel?.id === this._panelLayout._leftStackPreferredPanelId) {
+ this._panelLayout._leftStackPreferredPanelId = null;
+ }
+ if (explicit && !restore && !nextCollapsed && rightOwnerPanel) {
+ this._panelLayout._rightStackPreferredPanelId = rightOwnerPanel.id;
+ } else if (
+ explicit
+ && !restore
+ && nextCollapsed
+ && rightOwnerPanel?.id === this._panelLayout._rightStackPreferredPanelId
+ ) {
+ this._panelLayout._rightStackPreferredPanelId = null;
+ }
+ if (panelEl.classList.contains('collapsed') === nextCollapsed && !wasAutoCollapsed) {
+ this._syncPanelCollapseButton(panelEl);
+ if (priorLeftOwner !== this._panelLayout._leftStackPreferredPanelId) {
+ this._scheduleLeftPanelLayout({ reconsiderAutoCollapse: true });
+ }
+ if (priorRightOwner !== this._panelLayout._rightStackPreferredPanelId) {
+ this._scheduleRightPanelLayout({ reconsiderAutoCollapse: true });
+ }
+ return;
+ }
+ panelEl.classList.remove('layout-auto-collapsed');
+ if (!nextCollapsed && this.cockpitView?.active && panelId === 'data-panel') {
+ this._cockpitContextCollapsedForDataPanel = !this.cockpitView.contextCollapsed;
+ if (this._cockpitContextCollapsedForDataPanel) {
+ this.cockpitView.setContextCollapsed(true);
+ }
+ }
+ if (!nextCollapsed && panelId === 'global-context-panel'
+ && this._contextRadioDock?.classList.contains('disclosure-open')) {
+ this._setRadioDisclosure?.(false);
+ }
+ if (!nextCollapsed && panelId === 'radio-panel'
+ && document.getElementById('global-context-panel')?.classList.contains('collapsed')) {
+ this.setPanelCollapsed('global-context-panel', false, { restore, persist, syncShare });
+ }
+ if (!nextCollapsed && !restore && panelId === 'location-bar') {
+ const otherPanel = document.getElementById('control-panel');
+ if (otherPanel && !otherPanel.classList.contains('dock-pinned')) {
+ this.setPanelCollapsed('control-panel', true, { restore, persist, syncShare });
+ }
+ } else if (!nextCollapsed && !restore && panelId === 'control-panel') {
+ const otherPanel = document.getElementById('location-bar');
+ if (otherPanel && !otherPanel.classList.contains('dock-pinned')) {
+ this.setPanelCollapsed('location-bar', true, { restore, persist, syncShare });
+ }
+ }
+ panelEl.classList.toggle('collapsed', nextCollapsed);
+ if (nextCollapsed && this.cockpitView?.active && panelId === 'data-panel'
+ && this._cockpitContextCollapsedForDataPanel) {
+ this._cockpitContextCollapsedForDataPanel = false;
+ this.cockpitView.setContextCollapsed(false);
+ }
+ this._syncPanelCollapseButton(panelEl);
+ if (persist !== false) this._savePanelCollapsedState(panelId, nextCollapsed);
+ if (panelId === 'pp-toggles') {
+ this._layoutRightPanels();
+ }
+ if (this._rightPanelStack?.contains(panelEl)) {
+ this._scheduleRightPanelLayout({ reconsiderAutoCollapse: true });
+ }
+ if (panelId === 'cctv-panel') {
+ this._syncCctvPanelViewport();
+ }
+ this._lifetime.frame(() => this._updateCommandDockTrayStack());
+ this._scheduleLeftPanelLayout({
+ reconsiderAutoCollapse: this._leftPanelStack?.contains(panelEl) === true,
+ });
+ if (syncShare) this.shareLinkManager?.onPanelStateChange?.();
+ }
+
+ /**
+ * Toggles "clean view" mode which hides all UI panels via a CSS body class.
+ * @param {boolean} [forceEnabled] - Explicit on/off. Omit to toggle.
+ * @returns {void}
+ */
+ toggleCleanView(forceEnabled) {
+ const shouldEnable = typeof forceEnabled === 'boolean'
+ ? forceEnabled
+ : !document.body.classList.contains('ui-clean-view');
+ document.body.classList.toggle('ui-clean-view', shouldEnable);
+ if (this._cleanViewBtn) {
+ this._cleanViewBtn.classList.toggle('active', shouldEnable);
+ }
+ this._scheduleLeftPanelLayout();
+ }
+
+ // ── Public control facade ──────────────────────────────────────────────
+ // Deliberate API for voice tools and scripting. Every setter keeps the DOM
+ // sliders, share-link state, and scene snapshots in sync, and returns
+ // { ok, ...resultingState } so callers confirm only what actually happened.
+
+ /**
+ * Sets HUD visibility mode. 'auto' restores style-driven show/hide.
+ * @param {'on'|'off'|'auto'} mode - Visibility mode.
+ * @returns {{ok: boolean, visible?: boolean, layout?: string, error?: string}}
+ */
+ setHudVisible(mode) {
+ const normalized = String(mode ?? '').toLowerCase();
+ if (!['on', 'off', 'auto'].includes(normalized)) {
+ return { ok: false, error: `Unknown HUD visibility mode: ${mode}` };
+ }
+ this.shareLinkManager?.claimRestoreLane?.('visual');
+ this.hud.setMode(normalized);
+ this._updateHudButtonState();
+ this._syncShareState();
+ return { ok: true, visible: !!this.hud.visible, mode: normalized, layout: this.hud.getVariant() };
+ }
+
+ /**
+ * Switches the HUD layout variant.
+ * @param {'tactical'|'operator'|'minimal'} variantName - Layout variant.
+ * @returns {{ok: boolean, layout?: string, visible?: boolean, error?: string}}
+ */
+ setHudLayout(variantName) {
+ const variant = String(variantName ?? '').toLowerCase();
+ if (!['tactical', 'operator', 'minimal'].includes(variant)) {
+ return { ok: false, error: `Unknown HUD layout: ${variantName}` };
+ }
+ this.shareLinkManager?.claimRestoreLane?.('visual');
+ this._setHudVariant(variant);
+ return { ok: true, layout: this.hud.getVariant(), visible: !!this.hud.visible };
+ }
+
+ /**
+ * Reads current detection overlay state (engine mode + UI density percent).
+ * @returns {{detectionMode: string, densityPct: number|null, allocationStrategy:string, fadePct:number, outsideOpacityPct:number}}
+ */
+ getDetectionState() {
+ const { getDetectionTuning, getDetectionMode } = this.services;
+ const pct = this._detectionDensitySlider
+ ? parseInt(this._detectionDensitySlider.value, 10)
+ : null;
+ return {
+ detectionMode: getDetectionMode(),
+ densityPct: pct,
+ allocationStrategy: getDetectionTuning().allocationStrategy,
+ fadePct: parseInt(this._detectionFadeSlider?.value || '7', 10),
+ outsideOpacityPct: parseInt(this._detectionOpacitySlider?.value || '0', 10),
+ };
+ }
+
+ /** Read-only overlay diagnostics used by browser QA and regression harnesses. */
+ getDetectionDiagnostics() {
+ const { readDetectionDiagnostics } = this.services;
+ return readDetectionDiagnostics();
+ }
+
+ /**
+ * Controls the detection overlay: on/off, mode, and density percent.
+ * Density writes the slider AND the engine so share links and scene
+ * snapshots stay truthful.
+ * @param {object} [options]
+ * @param {boolean} [options.enabled] - false forces OFF; true restores the current density profile.
+ * @param {'sparse'|'balanced'|'dense'|'panoptic'} [options.mode] - Profile (legacy aliases accepted).
+ * @param {number} [options.densityPct] - 0-100 density percent.
+ * @param {'elastic'|'weighted'} [options.allocationStrategy] - Layer-capacity policy.
+ * @param {number} [options.fadePct] - Fade distance as 0-40% of the keyhole radius.
+ * @param {number} [options.outsideOpacityPct] - Opacity beyond the fade distance, 0-100%.
+ * @returns {{ok: boolean, detectionMode?: string, densityPct?: number|null, error?: string}}
+ */
+ setDetection({ enabled, mode, densityPct, allocationStrategy, fadePct, outsideOpacityPct } = {}) {
+ const { getDetectionMode, setDetectionModeByLabel } = this.services;
+ if (enabled !== undefined && typeof enabled !== 'boolean') {
+ return { ok: false, error: `Invalid detection enabled value: ${enabled}`, ...this.getDetectionState() };
+ }
+ let requestedProfile = null;
+ if (typeof mode === 'string' && mode.trim()) {
+ requestedProfile = normalizeProfile(mode);
+ if (!requestedProfile) {
+ return { ok: false, error: `Unknown detection mode: ${mode}`, ...this.getDetectionState() };
+ }
+ }
+ let requestedDensity = null;
+ if (densityPct != null) {
+ if (!Number.isFinite(Number(densityPct))) {
+ return { ok: false, error: `Invalid density: ${densityPct}`, ...this.getDetectionState() };
+ }
+ requestedDensity = canonicalizeDensity(Number(densityPct));
+ }
+ if (requestedProfile && requestedProfile !== 'OFF' && requestedDensity != null
+ && profileForDensity(requestedDensity) !== requestedProfile) {
+ return {
+ ok: false,
+ error: `Detection mode ${requestedProfile} conflicts with density ${requestedDensity}%`,
+ ...this.getDetectionState(),
+ };
+ }
+ let requestedAllocation = null;
+ if (allocationStrategy != null) {
+ requestedAllocation = String(allocationStrategy).trim().toUpperCase();
+ if (!ALLOCATION_STRATEGIES.includes(requestedAllocation)) {
+ return { ok: false, error: `Unknown allocation strategy: ${allocationStrategy}`, ...this.getDetectionState() };
+ }
+ }
+ if (fadePct != null) {
+ if (!Number.isFinite(Number(fadePct))) {
+ return { ok: false, error: `Invalid fade distance: ${fadePct}`, ...this.getDetectionState() };
+ }
+ }
+ if (outsideOpacityPct != null) {
+ if (!Number.isFinite(Number(outsideOpacityPct))) {
+ return { ok: false, error: `Invalid outside opacity: ${outsideOpacityPct}`, ...this.getDetectionState() };
+ }
+ }
+ const hasExplicitVisualChange = typeof enabled === 'boolean'
+ || requestedProfile !== null
+ || requestedDensity !== null
+ || requestedAllocation !== null
+ || fadePct != null
+ || outsideOpacityPct != null;
+ if (hasExplicitVisualChange) {
+ // Voice/scripted detection control counts as an explicit user choice, so
+ // neither style presets nor a still-pending shared visual restore can
+ // overwrite it afterward.
+ this.shareLinkManager?.claimRestoreLane?.('visual');
+ this._detectionUserOverridden = true;
+ }
+ if (requestedAllocation) {
+ this._setDetectionAllocation(requestedAllocation, { syncShare: false });
+ }
+ if (fadePct != null && this._detectionFadeSlider) {
+ this._detectionFadeSlider.value = String(Math.max(0, Math.min(40, Math.round(Number(fadePct)))));
+ }
+ if (outsideOpacityPct != null && this._detectionOpacitySlider) {
+ this._detectionOpacitySlider.value = String(Math.max(0, Math.min(100, Math.round(Number(outsideOpacityPct)))));
+ }
+ if (fadePct != null || outsideOpacityPct != null) this._applyDetectionFadeFromUi();
+
+ if (requestedProfile && requestedProfile !== 'OFF' && requestedDensity == null) {
+ requestedDensity = defaultDensityForProfile(requestedProfile);
+ }
+ if (requestedDensity != null && this._detectionDensitySlider) {
+ this._detectionDensitySlider.value = String(requestedDensity);
+ this._applyDetectionDensityFromUi();
+ }
+
+ if (enabled === false || requestedProfile === 'OFF') {
+ setDetectionModeByLabel('OFF');
+ } else if (requestedProfile) {
+ setDetectionModeByLabel(requestedProfile);
+ } else if (enabled === true && getDetectionMode() === 'OFF') {
+ setDetectionModeByLabel(profileForDensity(
+ requestedDensity ?? this._detectionDensitySlider?.value ?? 50,
+ ));
+ }
+ this._syncDetectionUiFromEngine();
+ this._syncShareState();
+ return { ok: true, ...this.getDetectionState() };
+ }
+
+ /**
+ * Switches the basemap stack and reports whether the switch landed.
+ * @param {string} stackId - One of mapStackController.getStacks() ids.
+ * @returns {Promise<{ok: boolean, activeStack?: string, error?: string|null, available?: string[]}>}
+ */
+ async setMapStack(stackId) {
+ if (!this.mapStackController) {
+ return { ok: false, error: 'Map stack controller unavailable' };
+ }
+ const stacks = this.mapStackController.getStacks();
+ const target = stacks.find((stack) => stack.id === stackId);
+ if (!target) {
+ return { ok: false, error: `Unknown map stack: ${stackId}`, available: stacks.map((s) => s.id) };
+ }
+ if (!target.available) {
+ return { ok: false, error: `${target.label} requires a Cesium ion token`, activeStack: this.mapStackController.getActiveId() };
+ }
+ await this._setMapStack(stackId);
+ const state = this.mapStackController.getState();
+ const landed = state.activeId === stackId;
+ return {
+ ok: landed,
+ activeStack: state.activeId,
+ error: landed ? null : (state.lastError || 'Map stack did not switch'),
+ };
+ }
+
+ /**
+ * Controls bloom post-processing. Intensity is the UI percent (0-200).
+ * @param {object} [options]
+ * @param {boolean} [options.enabled]
+ * @param {number} [options.intensityPct] - 0-200.
+ * @returns {{ok: boolean, bloom: {enabled: boolean, intensityPct: number|null}}}
+ */
+ setBloom({ enabled, intensityPct } = {}) {
+ const current = () => ({
+ enabled: !!this.bloomEnabled,
+ intensityPct: this._bloomSlider ? parseInt(this._bloomSlider.value, 10) : null,
+ });
+ if (enabled !== undefined && typeof enabled !== 'boolean') {
+ return { ok: false, error: `Invalid bloom enabled value: ${enabled}`, bloom: current() };
+ }
+ if (intensityPct !== undefined
+ && (typeof intensityPct !== 'number' || !Number.isFinite(intensityPct))) {
+ return { ok: false, error: `Invalid bloom intensity: ${intensityPct}`, bloom: current() };
+ }
+ const hasExplicitVisualChange = intensityPct !== undefined || enabled !== undefined;
+ if (hasExplicitVisualChange) this.shareLinkManager?.claimRestoreLane?.('visual');
+ if (intensityPct !== undefined) {
+ this._setBloomIntensity(Math.round(Math.max(0, Math.min(200, intensityPct))));
+ }
+ if (enabled !== undefined) this._setBloomEnabled(enabled);
+ return {
+ ok: true,
+ bloom: current(),
+ };
+ }
+
+ /**
+ * Controls sharpen post-processing. Intensity is the UI percent (0-100).
+ * @param {object} [options]
+ * @param {boolean} [options.enabled]
+ * @param {number} [options.intensityPct] - 0-100.
+ * @returns {{ok: boolean, sharpen: {enabled: boolean, intensityPct: number|null}}}
+ */
+ setSharpen({ enabled, intensityPct } = {}) {
+ const current = () => ({
+ enabled: !!this.sharpenEnabled,
+ intensityPct: this._sharpenSlider ? parseInt(this._sharpenSlider.value, 10) : null,
+ });
+ if (enabled !== undefined && typeof enabled !== 'boolean') {
+ return { ok: false, error: `Invalid sharpen enabled value: ${enabled}`, sharpen: current() };
+ }
+ if (intensityPct !== undefined
+ && (typeof intensityPct !== 'number' || !Number.isFinite(intensityPct))) {
+ return { ok: false, error: `Invalid sharpen intensity: ${intensityPct}`, sharpen: current() };
+ }
+ const hasExplicitVisualChange = intensityPct !== undefined || enabled !== undefined;
+ if (hasExplicitVisualChange) this.shareLinkManager?.claimRestoreLane?.('visual');
+ if (intensityPct !== undefined) {
+ const pct = Math.round(Math.max(0, Math.min(100, intensityPct)));
+ if (this._sharpenSlider) this._sharpenSlider.value = String(pct);
+ if (this._sharpenSliderValue) this._sharpenSliderValue.textContent = `${pct}%`;
+ this._applySharpenIntensity(pct / 100);
+ this._syncShareState();
+ }
+ if (enabled !== undefined) this._setSharpenEnabled(enabled);
+ return {
+ ok: true,
+ sharpen: current(),
+ };
+ }
+
+ /** Whether the full-globe celestial overlay is enabled by user preference. */
+ get celestialRingEnabled() {
+ return !!this.celestialRing?.enabled;
+ }
+
+ /**
+ * Controls the celestial ring. The Display button uses `focus=true` when the
+ * ring is disabled or unavailable at the current zoom, turning the control
+ * into a reveal action instead of requiring a separate globe-navigation step.
+ * @param {boolean} enabled
+ * @param {object} [options]
+ * @param {boolean} [options.syncShare=true]
+ * @param {boolean} [options.focus=false]
+ * @returns {{ok:boolean, celestialRing:{enabled:boolean,visible:boolean}, cameraFocused:boolean, error?:string}}
+ */
+ setCelestialRingEnabled(enabled, { syncShare = true, focus = false } = {}) {
+ const { isCelestialRingStyleSupported } = this.services;
+ const styleSupported = isCelestialRingStyleSupported(this.activeStyle);
+ const current = () => ({
+ enabled: this.celestialRingEnabled,
+ visible: !!this.celestialRing?.visible,
+ });
+ if (typeof enabled !== 'boolean') {
+ return {
+ ok: false,
+ celestialRing: current(),
+ cameraFocused: false,
+ error: `Invalid celestial ring enabled value: ${enabled}`,
+ };
+ }
+ if (typeof syncShare !== 'boolean' || typeof focus !== 'boolean') {
+ return {
+ ok: false,
+ celestialRing: current(),
+ cameraFocused: false,
+ error: 'Celestial ring options must be boolean',
+ };
+ }
+ if (!styleSupported && enabled) {
+ return {
+ ok: false,
+ celestialRing: current(),
+ cameraFocused: false,
+ error: 'Celestial ring is available only in Normal style',
+ };
+ }
+ if (syncShare) this.shareLinkManager?.claimRestoreLane?.('visual');
+ const nextEnabled = styleSupported && enabled;
+ this.celestialRing?.setEnabled(nextEnabled);
+ this._celestialBtn?.classList.toggle('active', nextEnabled);
+ this._celestialBtn?.setAttribute('aria-pressed', String(nextEnabled));
+ if (this._celestialBtn) {
+ this._celestialBtn.disabled = !styleSupported;
+ this._celestialBtn.setAttribute('aria-disabled', String(!styleSupported));
+ this._celestialBtn.title = styleSupported
+ ? 'Celestial ring — reveal the full globe'
+ : 'Celestial ring — available in Normal style';
+ }
+ let cameraFocused = false;
+ if (nextEnabled && focus) {
+ cameraFocused = !!this.celestialRing?.focusFullGlobe();
+ }
+ if (syncShare) this._syncShareState();
+ return {
+ ok: styleSupported || !enabled,
+ celestialRing: current(),
+ cameraFocused,
+ };
+ }
+
+ /**
+ * Starts or stops orbiting the active POI.
+ * @param {boolean} [enabled] - Omit to toggle.
+ * @returns {{ok: boolean, orbiting: boolean, error?: string}}
+ */
+ setOrbit(enabled) {
+ const active = !!this.orbitController?.active;
+ if (typeof enabled === 'boolean' && enabled === active) {
+ return { ok: true, orbiting: active };
+ }
+ if (enabled === false) {
+ this._stopOrbit();
+ return { ok: true, orbiting: false };
+ }
+ if (!this._currentTarget) {
+ return { ok: false, orbiting: false, error: 'No active landmark to orbit — fly to a landmark first' };
+ }
+ this._toggleOrbit();
+ return { ok: true, orbiting: !!this.orbitController?.active };
+ }
+
+ /**
+ * Enables/disables clean view (hides all UI chrome).
+ * @param {boolean} [enabled] - Omit to toggle.
+ * @returns {{ok: boolean, cleanView: boolean}}
+ */
+ setCleanView(enabled) {
+ this.toggleCleanView(enabled);
+ return { ok: true, cleanView: document.body.classList.contains('ui-clean-view') };
+ }
+
+ /**
+ * Reads global context mode state for voice/state-sync consumers.
+ * @returns {{mode: 'flights'|'space-missions'|null, active: boolean, changing: boolean, entering: 'flights'|'space-missions'|null, snapshotCaptured: boolean}}
+ */
+ getContextModeState(...args) { return this._contextControls?.getContextModeState(...args); }
+
+ /**
+ * Sets global context mode (Contacts / Space Missions / off) for voice.
+ * @param {'contacts'|'space-missions'|'off'|null} mode - Requested context target.
+ * @param {object} [options]
+ * @param {string|Symbol|null} [options.notificationToken]
+ * @param {AbortSignal|null} [options.signal]
+ * @param {Function|null} [options.isCurrent]
+ * @param {boolean} [options.claimVisualAuthority] Whether this request is a
+ * genuine operator/voice Context intent that should take the visual restore
+ * lane. Cockpit choreography calls this facade INTERNALLY for its own
+ * enter/rollback steps; those transitions are not a Context request by the
+ * operator and must stay inert, so they pass `false`.
+ * @returns {Promise<{ok:boolean, mode:'flights'|'space-missions'|null, active:boolean, action:string, error?:string}>}
+ */
+ setContextMode(...args) { return this._contextControls?.setContextMode(...args); }
+
+ /**
+ * Returns cockpit status for voice/state sync and navigation operations.
+ * @returns {{active:boolean, entryAllowed:boolean, visionMode:string, subject:{id:string,layerId:string}|null, navigation:{canPrevious:boolean,canNext:boolean,canFocus:boolean}|null, awareness?: object}|null}
+ */
+ getCockpitState() {
+ const { militaryAwarenessLayer } = this.services;
+ const snapshot = militaryAwarenessLayer.getContextSnapshot?.();
+ const info = this.cockpitView?.readAircraftInfo?.();
+ const active = Boolean(this.cockpitView?.active);
+ const gateOpen = Boolean(this.cockpitView?.isEntryAllowed?.());
+ // "Could Cockpit be ENTERED right now" — so it is false while already
+ // inside, unconditionally. Cockpit takes the entity off
+ // `viewer.trackedEntity` on entry and NEXT puts one back, which made this
+ // flip true/false between calls while `active` stayed true; readers
+ // (including the voice model) read that as a broken half-entered state.
+ const entryAllowed = !active && Boolean(
+ gateOpen
+ && info
+ && this.viewer?.trackedEntity?.position,
+ );
+ return {
+ active,
+ entryAllowed,
+ // Why entry is unavailable, so a refusal can be explained rather than
+ // guessed at.
+ entryBlockedReason: entryAllowed || active
+ ? null
+ : (!gateOpen
+ ? (this._contextModeChanging ? 'contacts-starting' : 'contacts-inactive')
+ : 'no-tracked-aircraft'),
+ visionMode: this.cockpitView?.visionMode || null,
+ subject: info ? {
+ id: info.icao24 || info.id || null,
+ layerId: info.layerId || null,
+ callsign: info.callsign || null,
+ } : null,
+ navigation: snapshot ? {
+ canPrevious: Boolean(snapshot.navigation?.canPrevious),
+ canNext: Boolean(snapshot.navigation?.canNext),
+ canFocus: Boolean(snapshot.navigation?.canFocus),
+ } : null,
+ awareness: snapshot ? {
+ radiusM: Number.isFinite(snapshot.radiusM) ? snapshot.radiusM : null,
+ subject: snapshot.subject ? {
+ id: snapshot.subject.id || null,
+ layerId: snapshot.subject.layerId || null,
+ } : null,
+ cohorts: Array.isArray(snapshot.cohorts)
+ ? snapshot.cohorts.map((cohort) => ({
+ id: cohort?.id || null,
+ source: cohort?.source || null,
+ count: Number.isFinite(cohort?.count) ? cohort.count : null,
+ relationship: cohort?.relationship || null,
+ reason: cohort?.reason || null,
+ coverage: cohort?.coverage || null,
+ }))
+ : [],
+ navigation: snapshot.navigation ? {
+ canPrevious: Boolean(snapshot.navigation.canPrevious),
+ canNext: Boolean(snapshot.navigation.canNext),
+ canFocus: Boolean(snapshot.navigation.canFocus),
+ } : null,
+ } : null,
+ activeTracked: this.cockpitView?.active ? Boolean(this.cockpitView?.trackedEntity) : false,
+ activeMapView: !this.cockpitView?.active && entryAllowed,
+ };
+ }
+
+ /**
+ * Point Cockpit entry at a requested contact layer before it enters.
+ *
+ * Reuses the filtered Context navigation NEXT already uses, so "cockpit in
+ * that military helicopter" lands on the same contact "next military
+ * helicopter" would. Cockpit flies aircraft only; vessel and installation
+ * layers are refused by name rather than silently ignored.
+ * @param {object} options Retarget request.
+ * @param {string} options.targetLayer Requested contact layer.
+ * @param {string|null} options.aircraftClass Optional class filter.
+ * @param {{layerId: string}|null} options.currentTarget Current tracker.
+ * @param {{layerId: string}|null} options.selectedTarget Pending selection.
+ * @returns {{ok: boolean, retargeted?: boolean, error?: string}} Outcome.
+ */
+ _retargetCockpitEntryLayer({ targetLayer, aircraftClass, currentTarget, selectedTarget }) {
+ const { militaryAwarenessLayer } = this.services;
+ if (!['flights', 'military'].includes(targetLayer)) {
+ return {
+ ok: false,
+ error: `Cockpit flies aircraft only — ${targetLayer} contacts cannot be entered`,
+ };
+ }
+ const activeLayer = selectedTarget?.layerId || currentTarget?.layerId || null;
+ const alreadyOnLayer = activeLayer === targetLayer;
+ if (alreadyOnLayer && !aircraftClass) return { ok: true, retargeted: false };
+ const moved = militaryAwarenessLayer?.navigateNext
+ ? !!militaryAwarenessLayer.navigateNext({
+ targetLayer,
+ aircraftClass,
+ origin: 'voice',
+ })
+ : false;
+ if (moved) return { ok: true, retargeted: true };
+ // A filter that matched nothing still enters, as long as the layer is
+ // already right — the operator asked for that layer and is on it.
+ if (alreadyOnLayer) return { ok: true, retargeted: false };
+ const label = targetLayer === 'military' ? 'military' : 'civilian';
+ const filtered = aircraftClass ? `${aircraftClass} ` : '';
+ return {
+ ok: false,
+ error: `No ${filtered}${label} contact is available to enter — track one first, or say "next ${label}"`,
+ };
+ }
+
+ /**
+ * Controls cockpit entry/exit and context navigation.
+ * @param {'enter'|'exit'|'next'|'previous'|'status'} action - Cockpit action.
+ * @param {object} [options]
+ * @param {string|Symbol|null} [options.notificationToken]
+ * @param {'flights'|'military'|'ais-live-vessels'|'military-installations'|null} [options.targetLayer]
+ * @param {string|null} [options.aircraftClass]
+ * @param {{layerId:'flights'|'military',id:string}|null} [options.selectedTarget]
+ * @param {{layerId:'flights'|'military',id:string}|null} [options.rollbackTarget]
+ * @returns {{ok:boolean, action:string, error?:string, state?:object}}
+ */
+ controlCockpit(action, {
+ notificationToken = null,
+ targetLayer = null,
+ aircraftClass = null,
+ selectedTarget = null,
+ rollbackTarget = undefined,
+ } = {}) {
+ const { flightsLayer, militaryFlightsLayer } = this.services;
+ const normalized = String(action || '').toLowerCase();
+ if (!this.cockpitView) {
+ return {
+ ok: false,
+ action: 'control_cockpit',
+ error: 'Cockpit controller unavailable',
+ state: this.getCockpitState(),
+ };
+ }
+ if (normalized === 'status') {
+ return {
+ ok: true,
+ action: 'control_cockpit',
+ state: this.getCockpitState(),
+ notificationToken: notificationToken || null,
+ };
+ }
+ if (normalized === 'enter') {
+ // Entry is gated exactly as the manual entry chip is. Attempting it while
+ // the gate is shut produced the half-entered look the operator reported
+ // (a plane anchored under the camera with no cockpit around it), so
+ // refuse with the reason instead of trying.
+ if (!this.cockpitView.isEntryAllowed?.()) {
+ return {
+ ok: false,
+ action: 'control_cockpit',
+ error: this._contextModeChanging
+ ? 'Contacts is still starting up — try Cockpit again in a moment'
+ : 'Contacts must be active to enter Cockpit — say "open contacts" first',
+ state: this.getCockpitState(),
+ };
+ }
+ let currentTarget = this.getAircraftTrackingTarget();
+ const layerForTarget = (target) => target?.layerId === 'military'
+ ? militaryFlightsLayer
+ : target?.layerId === 'flights' ? flightsLayer : null;
+ // A requested layer retargets BEFORE entry, through the same filtered
+ // navigation NEXT uses. Ignoring it entered on whatever was already
+ // tracked and reported success, so "cockpit in that military helicopter"
+ // silently put the operator in an airliner.
+ if (targetLayer) {
+ const requested = this._retargetCockpitEntryLayer({
+ targetLayer,
+ aircraftClass,
+ currentTarget,
+ selectedTarget,
+ });
+ if (!requested.ok) {
+ return {
+ ok: false,
+ action: 'control_cockpit',
+ error: requested.error,
+ state: this.getCockpitState(),
+ };
+ }
+ if (requested.retargeted) {
+ // The retarget is now the authority; a selection sampled before it
+ // would drag entry back to the wrong layer.
+ selectedTarget = null;
+ rollbackTarget = rollbackTarget === undefined ? currentTarget : rollbackTarget;
+ currentTarget = this.getAircraftTrackingTarget();
+ }
+ }
+ const selectedLayer = selectedTarget?.layerId === 'military'
+ ? militaryFlightsLayer
+ : selectedTarget?.layerId === 'flights' ? flightsLayer : null;
+ const entry = enterCockpitWithTracking({
+ cockpitView: this.cockpitView,
+ selectedLayer,
+ selectedTarget,
+ currentLayer: layerForTarget(currentTarget),
+ rollbackLayer: layerForTarget(
+ rollbackTarget === undefined ? currentTarget : rollbackTarget,
+ ),
+ rollbackTarget,
+ selectionOrigin: 'voice',
+ });
+ return {
+ ok: entry.entered,
+ action: 'control_cockpit',
+ state: this.getCockpitState(),
+ error: entry.error,
+ };
+ }
+ if (normalized === 'exit') {
+ const exited = !!this.cockpitView.exit();
+ return {
+ ok: exited,
+ action: 'control_cockpit',
+ state: this.getCockpitState(),
+ error: exited ? null : 'Cockpit was already inactive',
+ };
+ }
+ if (normalized === 'next' || normalized === 'previous') {
+ const changed = this.cockpitView.navigateContext(
+ normalized === 'next' ? 1 : -1,
+ {
+ targetLayer,
+ aircraftClass,
+ origin: 'voice',
+ },
+ );
+ return {
+ ok: changed,
+ action: 'control_cockpit',
+ state: this.getCockpitState(),
+ error: changed ? null : 'No further context target was available',
+ };
+ }
+ return {
+ ok: false,
+ action: 'control_cockpit',
+ error: `Unknown cockpit action: ${action}`,
+ state: this.getCockpitState(),
+ };
+ }
+
+ /**
+ * Full control-state snapshot — single source for voice read-back so the
+ * agent confirms from the same state it acted on.
+ * @returns {object} Current style/stack/HUD/detection/post-processing state.
+ */
+ getControlState() {
+ return {
+ style: this.activeStyle || 'normal',
+ mapStack: this.mapStackController?.getActiveId?.() || null,
+ hud: { visible: !!this.hud?.visible, layout: this.hud?.getVariant?.() || null },
+ detection: this.getDetectionState(),
+ bloom: {
+ enabled: !!this.bloomEnabled,
+ intensityPct: this._bloomSlider ? parseInt(this._bloomSlider.value, 10) : null,
+ },
+ sharpen: {
+ enabled: !!this.sharpenEnabled,
+ intensityPct: this._sharpenSlider ? parseInt(this._sharpenSlider.value, 10) : null,
+ },
+ celestialRing: {
+ enabled: this.celestialRingEnabled,
+ visible: !!this.celestialRing?.visible,
+ },
+ orbiting: !!this.orbitController?.active,
+ models3d: { enabled: !!this._models3dEnabled, mode: this._models3dMode || 'proximity' },
+ recording: !!this._recording._recordingMode,
+ cleanView: document.body.classList.contains('ui-clean-view'),
+ };
+ }
+
+ /**
+ * Captures the current camera position and orientation as a serializable object.
+ * @returns {{lat: number, lon: number, alt: number, heading: number, pitch: number, roll: number}|null}
+ */
+ getCameraState() {
+ const carto = this.viewer.camera.positionCartographic;
+ if (!carto) return null;
+ return {
+ lat: Cesium.Math.toDegrees(carto.latitude),
+ lon: Cesium.Math.toDegrees(carto.longitude),
+ alt: carto.height,
+ heading: Cesium.Math.toDegrees(this.viewer.camera.heading),
+ pitch: Cesium.Math.toDegrees(this.viewer.camera.pitch),
+ roll: Cesium.Math.toDegrees(this.viewer.camera.roll),
+ };
+ }
+
+ /**
+ * Flies the camera to a previously captured camera state using cubic ease-in-out.
+ * @param {{lat: number, lon: number, alt: number, heading?: number, pitch?: number, roll?: number}} cameraState
+ * @param {number} [duration=2.8] - Flight duration in seconds.
+ * @returns {void}
+ */
+ applyCameraState(cameraState, duration = 2.8) {
+ if (!cameraState) return;
+ this.viewer.camera.flyTo({
+ destination: Cesium.Cartesian3.fromDegrees(
+ cameraState.lon,
+ cameraState.lat,
+ cameraState.alt
+ ),
+ orientation: {
+ heading: Cesium.Math.toRadians(cameraState.heading || 0),
+ pitch: Cesium.Math.toRadians(cameraState.pitch || -35),
+ roll: Cesium.Math.toRadians(cameraState.roll || 0),
+ },
+ duration: Math.max(0.2, duration || 0),
+ easingFunction: Cesium.EasingFunction.CUBIC_IN_OUT,
+ });
+ }
+
+ /**
+ * Snapshots the full visual state (active style, bloom, sharpen, HUD, detection,
+ * per-style shader uniform values) for serialization or scene recipe capture.
+ * @returns {object} Serializable visual state object.
+ */
+ getVisualState() {
+ const { getDetectionTuning, getDetectionMode, isScopeMaskEnabled, getScopeMaskFeather } = this.services;
+ const styleParams = {};
+ for (const [styleName, stage] of Object.entries(this.stages)) {
+ const shader = STYLES[styleName];
+ if (!shader?.uniforms) continue;
+ styleParams[styleName] = {};
+ for (const uniformName of Object.keys(shader.uniforms)) {
+ styleParams[styleName][uniformName] = stage.uniforms[uniformName];
+ }
+ }
+
+ return {
+ style: this.activeStyle,
+ bloom: {
+ enabled: this.bloomEnabled,
+ intensity: this._getBloomIntensity(),
+ version: BLOOM_SCALE_VERSION,
+ },
+ sharpen: {
+ enabled: this.sharpenEnabled,
+ intensity: parseInt(this._sharpenSlider?.value || '49', 10),
+ },
+ hud: {
+ visible: this.hud.visible,
+ variant: this.hud.getVariant(),
+ },
+ detection: {
+ mode: getDetectionMode(),
+ density: parseInt(this._detectionDensitySlider?.value || '50', 10),
+ allocation: getDetectionTuning().allocationStrategy,
+ fadePct: parseInt(this._detectionFadeSlider?.value || '7', 10),
+ outsideOpacityPct: parseInt(this._detectionOpacitySlider?.value || '0', 10),
+ },
+ scope: {
+ enabled: isScopeMaskEnabled(),
+ featherPct: Math.round(getScopeMaskFeather() * 100),
+ },
+ mapStack: this.mapStackController?.getActiveId?.() || 'photoreal',
+ styleParams,
+ };
+ }
+
+ /**
+ * Restores a full visual state snapshot, applying style, bloom, sharpen,
+ * HUD, detection, and per-style shader uniforms. Used by scene recipes
+ * and share-link restore. Async so the map-stack switch resolves before
+ * the share state is synced; callers may fire-and-forget.
+ * @param {object} [state={}] - Visual state object (as returned by getVisualState).
+ * @param {object} [options]
+ * @param {(() => boolean)|null} [options.isCurrent] Caller liveness predicate.
+ * The map-stack switch is this method's ONLY suspension point, and the
+ * shader-uniform writes come after it — so a caller superseded while that
+ * switch is in flight would otherwise resume and commit the look of a
+ * state the operator has already moved past. Scene playback reproduced
+ * exactly that: a stale shot's uniforms landing on top of the live run.
+ * Omit it and the method behaves as it always has.
+ * @returns {Promise<boolean>} Whether the state was committed.
+ */
+ async applyVisualState(state = {}, { isCurrent = null } = {}) {
+ const { setScopeMaskEnabled, setScopeMaskFeather } = this.services;
+ const superseded = () => typeof isCurrent === 'function' && !isCurrent();
+ if (superseded()) return false;
+
+ if (state.style && state.style !== this.activeStyle) {
+ this.setStyle(state.style, { applyPreset: false });
+ }
+
+ const bloomState = state.bloom || {};
+ if (typeof bloomState.intensity === 'number' && this._bloomSlider) {
+ const intensity = decodeBloomIntensity(
+ bloomState.intensity,
+ bloomState.version ?? state.bloomVersion ?? BLOOM_SCALE_VERSION
+ );
+ this._setBloomIntensity(intensity, { syncShare: false });
+ }
+ if (typeof bloomState.enabled === 'boolean') {
+ this._setBloomEnabled(bloomState.enabled);
+ }
+
+ const sharpenState = state.sharpen || {};
+ if (typeof sharpenState.intensity === 'number' && this._sharpenSlider) {
+ const pct = Math.max(0, Math.min(100, Math.round(sharpenState.intensity)));
+ this._sharpenSlider.value = String(pct);
+ this._sharpenSliderValue.textContent = `${pct}%`;
+ this._applySharpenIntensity(pct / 100);
+ }
+ if (typeof sharpenState.enabled === 'boolean') {
+ this._setSharpenEnabled(sharpenState.enabled);
+ }
+
+ const hudState = state.hud || {};
+ if (hudState.variant) {
+ this._setHudVariant(hudState.variant);
+ }
+ if (typeof hudState.visible === 'boolean') {
+ this.hud.setMode(hudState.visible ? 'on' : 'off');
+ this._updateHudButtonState();
+ }
+
+ const scopeState = state.scope || {};
+ if (typeof scopeState.enabled === 'boolean') {
+ setScopeMaskEnabled(scopeState.enabled);
+ this._scopeBtn?.classList.toggle('active', scopeState.enabled);
+ this._scopeBtn?.setAttribute('aria-pressed', String(scopeState.enabled));
+ }
+ if (typeof scopeState.featherPct === 'number' && this._scopeFeatherSlider) {
+ const pct = Math.max(0, Math.min(100, Math.round(scopeState.featherPct)));
+ this._scopeFeatherSlider.value = String(pct);
+ if (this._scopeFeatherValue) this._scopeFeatherValue.textContent = `${pct}%`;
+ setScopeMaskFeather(pct / 100);
+ }
+
+ const detectionState = state.detection || {};
+ if (typeof detectionState.density === 'number' && this._detectionDensitySlider) {
+ const pct = canonicalizeDensity(detectionState.density);
+ this._detectionDensitySlider.value = String(pct);
+ if (this._detectionDensityValue) this._detectionDensityValue.textContent = `${pct}%`;
+ this._applyDetectionDensityFromUi();
+ }
+ if (detectionState.allocation) {
+ this._setDetectionAllocation(detectionState.allocation, { syncShare: false });
+ }
+ if (typeof detectionState.fadePct === 'number' && this._detectionFadeSlider) {
+ this._detectionFadeSlider.value = String(detectionState.fadePct);
+ }
+ if (typeof detectionState.outsideOpacityPct === 'number' && this._detectionOpacitySlider) {
+ this._detectionOpacitySlider.value = String(detectionState.outsideOpacityPct);
+ }
+ this._applyDetectionFadeFromUi();
+ if (detectionState.mode) {
+ this._setDetectionMode(detectionState.mode);
+ }
+
+ if (state.mapStack) {
+ // The stack switch is itself a MUTATION, not merely a suspension point,
+ // so it needs a gate on BOTH sides of the await.
+ if (superseded()) return false;
+ const stackBefore = this.mapStackController?.getActiveId?.() ?? null;
+ const genBefore = this.mapStackController?.getSwitchGeneration?.() ?? null;
+
+ await this._setMapStack(state.mapStack, { syncShare: false });
+
+ if (superseded()) {
+ // Superseded DURING the switch, which the pre-check above cannot catch
+ // and which has already moved the globe. The controller only
+ // invalidates a switch when another setStack() arrives, and a winning
+ // state that omits `mapStack` never issues one — every normalized scene
+ // shot omits it — so this stale globe would simply stand. Put back what
+ // the winner inherited.
+ const genAfter = this.mapStackController?.getSwitchGeneration?.() ?? null;
+ // _setMapStack issues exactly one setStack(), which advances the
+ // generation once, or not at all when the stack was unavailable and
+ // nothing was mutated. Anything past that is a NEWER switch whose
+ // caller owns the globe now, and reverting would stomp a live intent.
+ const globeIsStillOurs = genBefore !== null && genAfter !== null
+ && genAfter <= genBefore + 1;
+ const landed = this.mapStackController?.getActiveId?.() ?? null;
+ if (globeIsStillOurs && stackBefore && landed !== stackBefore) {
+ await this._setMapStack(stackBefore, { syncShare: false });
+ }
+ return false;
+ }
+ // Everything below is the uniform commit, already past its own gate.
+ }
+
+ if (state.styleParams && typeof state.styleParams === 'object') {
+ for (const [styleName, params] of Object.entries(state.styleParams)) {
+ const stage = this.stages[styleName];
+ if (!stage || !params) continue;
+ for (const [uniformName, uniformValue] of Object.entries(params)) {
+ if (stage.uniforms[uniformName] === undefined) continue;
+ stage.uniforms[uniformName] = uniformValue;
+ }
+ }
+ this._updateSliderPanel(this.activeStyle);
+ }
+
+ this._syncShareState();
+ return true;
+ }
+
+ /**
+ * Resets the safe-frame overlay to its inactive state on init.
+ * @returns {void}
+ */
+ _initRecordingOverlay() { return this._recording._initRecordingOverlay(); }
+
+ /**
+ * Applies recording-friendly post-processing and shader uniform overrides.
+ * @param {object} preset
+ */
+ applyCinematicPreset(preset = {}) {
+ const bloomInput = typeof preset.bloom === 'object' ? preset.bloom : { intensity: preset.bloom };
+ let decodedBloomIntensity = null;
+ if (typeof bloomInput.intensity === 'number') {
+ decodedBloomIntensity = decodeBloomIntensity(
+ bloomInput.intensity,
+ bloomInput.version ?? preset.bloomVersion ?? BLOOM_SCALE_VERSION
+ );
+ this._setBloomIntensity(decodedBloomIntensity, { syncShare: false });
+ }
+ if (typeof bloomInput.enabled === 'boolean') {
+ this._setBloomEnabled(bloomInput.enabled);
+ } else if (typeof bloomInput.intensity === 'number') {
+ this._setBloomEnabled((decodedBloomIntensity ?? this._getBloomIntensity()) > 0);
+ }
+
+ const sharpenInput = typeof preset.sharpen === 'object' ? preset.sharpen : { enabled: preset.sharpen };
+ if (typeof sharpenInput.intensity === 'number' && this._sharpenSlider) {
+ const sharpenPct = Math.max(0, Math.min(100, Math.round(sharpenInput.intensity)));
+ this._sharpenSlider.value = String(sharpenPct);
+ this._sharpenSliderValue.textContent = `${sharpenPct}%`;
+ this._applySharpenIntensity(sharpenPct / 100);
+ }
+ if (typeof sharpenInput.enabled === 'boolean') {
+ this._setSharpenEnabled(sharpenInput.enabled);
+ } else if (typeof sharpenInput.intensity === 'number') {
+ this._setSharpenEnabled(sharpenInput.intensity > 0);
+ }
+
+ if (preset.hudVariant) {
+ this._setHudVariant(preset.hudVariant);
+ }
+
+ if (preset.detectionMode) {
+ this._setDetectionMode(preset.detectionMode);
+ }
+ if (typeof preset.detectionDensity === 'number' && this._detectionDensitySlider) {
+ const density = canonicalizeDensity(preset.detectionDensity);
+ this._detectionDensitySlider.value = String(density);
+ this._detectionDensityValue.textContent = `${density}%`;
+ this._applyDetectionDensityFromUi();
+ }
+ if (preset.detectionAllocation) {
+ this._setDetectionAllocation(preset.detectionAllocation, { syncShare: false });
+ }
+
+ if (preset.styleParams && typeof preset.styleParams === 'object') {
+ for (const [styleName, params] of Object.entries(preset.styleParams)) {
+ const stage = this.stages[styleName];
+ if (!stage || !params || typeof params !== 'object') continue;
+ for (const [uniformName, uniformValue] of Object.entries(params)) {
+ if (stage.uniforms[uniformName] === undefined) continue;
+ stage.uniforms[uniformName] = uniformValue;
+ }
+ }
+
+ // Keep slider panel values in sync when updating the active style.
+ this._updateSliderPanel(this.activeStyle);
+ }
+
+ this._syncShareState();
+ }
+
+ /**
+ * Enters or exits recording mode. When active, hides UI chrome via a body class,
+ * displays a safe-frame composition overlay (16:9 or 9:16), and switches
+ * the HUD to the specified mode. Exiting restores the HUD mode and layout
+ * variant that were active before recording started.
+ * @param {boolean} enabled - Whether to enable recording mode.
+ * @param {object} [options]
+ * @param {boolean} [options.hidePanels=true] - Hide all panel chrome.
+ * @param {string} [options.hudMode='minimal'] - HUD mode while recording ('off'|'minimal'|'full'|'auto').
+ * @param {string} [options.safeFrame='16:9'] - Aspect ratio for the safe-frame overlay.
+ * @returns {void}
+ */
+ setRecordingMode(enabled, options) { return this._recording.setRecordingMode(enabled, options); }
+
+ // ── Parameter Sliders ─────────────────────────
+
+ /**
+ * Rebuilds the parameter slider panel for the given style's shader uniforms.
+ * Creates a labeled range input for each tunable uniform. Hides the panel
+ * for 'normal' mode which has no shader parameters.
+ * @param {string} styleName - Style name whose uniforms to display.
+ * @returns {void}
+ */
+ _updateSliderPanel(styleName, { reveal = false } = {}) {
+ const { governorRequestRender } = this.services;
+ this._styleParameters ||= createStyleParameters({ container: this._sliderContainer });
+ this._styleParameters.clear();
+ const shader = STYLES[styleName];
+
+ if (!shader || !shader.uniforms || styleName === 'normal') {
+ this._sliderPanel.classList.remove('active');
+ this._scheduleRightPanelLayout();
+ return;
+ }
+
+ this._styleParameters.render({
+ uniforms: shader.uniforms,
+ readValue: (uName) => this.stages[styleName].uniforms[uName],
+ writeValue: (uName, val) => {
+ this.shareLinkManager?.claimRestoreLane?.('visual');
+ this.stages[styleName].uniforms[uName] = val;
+ },
+ onChange: () => {
+ // Uniform writes need an explicit render under the idle governor.
+ governorRequestRender('style-param-slider');
+ this._syncShareState();
+ },
+ });
+
+ this._sliderPanel.classList.add('active');
+ this._scheduleRightPanelLayout();
+ if (reveal) this._revealStyleParameters();
+ }
+
+ /** Reveal the map-only parameter surface in the standard Display scroll owner. */
+ _revealStyleParameters() {
+ if (!this._sliderPanel?.classList.contains('active')) return;
+ if (this._cockpitDisplayPortalActive) return;
+ this._sliderPanel.classList.remove('collapsed');
+ this._syncPanelCollapseButton(this._sliderPanel);
+ this.setPanelCollapsed('pp-toggles', false, { explicit: true });
+ this._lifetime.frame(() => this._lifetime.frame(() => {
+ const scrollOwner = this._ppToggles;
+ if (!scrollOwner) return;
+ const ownerRect = scrollOwner.getBoundingClientRect();
+ const panelRect = this._sliderPanel.getBoundingClientRect();
+ scrollOwner.scrollTop += panelRect.top - ownerRect.top - 8;
+ }));
+ }
+
+ // ── Style switching ───────────────────────────
+
+ /**
+ * Switches the active visual style. Handles full lifecycle:
+ * 1. Crossfades the previous shader stage intensity to 0.
+ * 2. Crossfades the new shader stage intensity to 1.
+ * 3. Applies style preset defaults (bloom/sharpen/HUD) if applyPreset is true.
+ * 4. Updates button highlights, style indicator, slider panel, HUD, and detection overlay.
+ * @param {string} styleName - Target style ('normal'|'retro'|'surveillance'|'thermal'|'anime'|'noir'|'snow').
+ * @param {object} [options]
+ * @param {boolean} [options.applyPreset=true] - Whether to apply STYLE_PRESET_DEFAULTS for the new style.
+ * @returns {void}
+ */
+ setStyle(styleName, {
+ applyPreset = true,
+ revealParameters = applyPreset,
+ restore = false,
+ } = {}) {
+ const { setDetectionStyle } = this.services;
+ if (!restore) this.shareLinkManager?.claimRestoreLane?.('visual');
+ if (styleName === this.activeStyle) {
+ if (revealParameters && styleName !== 'normal') this._revealStyleParameters();
+ return;
+ }
+
+ const previousStyle = this.activeStyle;
+ this.activeStyle = styleName;
+ document.documentElement.dataset.gevStyle = styleName;
+
+ // The celestial optics treatment belongs to the unfiltered globe only.
+ // Leaving Normal turns it off; returning merely re-enables the control.
+ this.setCelestialRingEnabled(false, { syncShare: false, focus: false });
+
+ // Transition out the previous shader style
+ if (previousStyle !== 'normal' && this.stages[previousStyle]) {
+ this._startTransition(previousStyle, this.stages[previousStyle].uniforms.intensity, 0.0);
+ }
+
+ // Transition in the new shader style
+ if (styleName !== 'normal' && this.stages[styleName]) {
+ this._startTransition(styleName, this.stages[styleName].uniforms.intensity, 1.0);
+ }
+
+ if (applyPreset) {
+ this._applyStylePresetDefaults(styleName);
+ }
+
+ // Update button UI
+ document.querySelectorAll('.style-btn').forEach(btn => {
+ btn.classList.toggle('active', btn.dataset.style === styleName);
+ });
+
+ // Update style indicator
+ const displayNames = { surveillance: 'NVG', thermal: 'FLIR', retro: 'CRT' };
+ this._styleIndicator.textContent = displayNames[styleName] || styleName.toUpperCase();
+ this._updateStyleMiniStatus(styleName);
+
+ // Update parameter sliders
+ this._updateSliderPanel(styleName, { reveal: revealParameters });
+
+ // Notify HUD (color adaptation + auto show/hide)
+ this.hud.onStyleChange(styleName);
+ this._updateHudButtonState();
+
+ // Sync detection overlay tone to active post-process style
+ setDetectionStyle(styleName);
+ this._syncIrBoost();
+ window.dispatchEvent(new CustomEvent('gev:style-change', {
+ detail: { style: styleName },
+ }));
+
+ this._syncCockpitInheritedStyle();
+
+ // Notify share link manager
+ this.shareLinkManager.onStyleChange(styleName);
+ this._syncShareState();
+ }
+
+ // ── Shader transitions ────────────────────────
+
+ /**
+ * Enqueues a smooth intensity transition for a shader stage. The animation
+ * loop interpolates from `fromValue` to `toValue` over TRANSITION_DURATION_MS.
+ * @param {string} styleName - Name of the shader stage to transition.
+ * @param {number} fromValue - Starting intensity (typically current value).
+ * @param {number} toValue - Target intensity (0.0 to fade out, 1.0 to fade in).
+ * @returns {void}
+ */
+ _startTransition(styleName, fromValue, toValue) {
+ this._visualEffects.startTransition(styleName, fromValue, toValue);
+ }
+
+ /**
+ * Sample the manager's layer set and paint the global loading chip.
+ * Driven by manager events AND by a ticker, because the underlying state
+ * machine is TIME-driven (reveal delay, long-load threshold, terminal
+ * dwell) — see _armLoadingFeedbackTicker.
+ * @param {number} [now] - performance.now() sample.
+ * @returns {void}
+ */
+ _updateGlobalLoadingFeedback(now) { return this._feedback._updateGlobalLoadingFeedback(now); }
+
+ /** Show a message in the universal top-center status banner. */
+ _showGlobalStatusNotice(message, options) { return this._feedback._showGlobalStatusNotice(message, options); }
+
+ /**
+ * Style animation loop — self-stopping (perf wave 2). Runs only while a
+ * crossfade is in flight or an animated (time-uniform) stage is visible,
+ * holding continuous scene render for exactly that long. Re-armed by
+ * _startTransition and by _setStageIntensity enabling an animated stage.
+ * The traffic sync chip no longer rides this loop — it has its own 500 ms
+ * interval (see _startTrafficChipTicker).
+ */
+ _startAnimationLoop() {
+ this._visualEffects.startAnimationLoop();
+ }
+
+ /**
+ * 500 ms DOM ticker for the traffic sync chip (was per-frame). It also
+ * polls the loading chip as a safety net: a camera-driven layer can flip
+ * its own `stats.loading` without emitting a manager event, and that is
+ * the one loading start the event path cannot see.
+ */
+ _startTrafficChipTicker() { return this._feedback._startTrafficChipTicker(); }
+
+ /**
+ * Self-stopping 60 ms ticker for the global loading chip.
+ *
+ * The chip used to ride the style rAF loop, which perf wave 2 made
+ * self-stopping — leaving the chip frozen mid-state whenever no crossfade
+ * or animated shader was running (it would never reveal, never cross the
+ * long-load threshold, and never dwell out). Its reducer
+ * (src/loadingFeedback.js) is time-driven, so it needs real ticks; it is
+ * also pure DOM, so it takes NO governor hold and requests no render.
+ * Armed by _updateGlobalLoadingFeedback whenever loading leaves idle or a
+ * universal notice begins, and stops once both have settled.
+ * (rebase 2026-08-16: main's loading chip vs wave 2's stopped loop)
+ * @returns {void}
+ */
+ _armLoadingFeedbackTicker() { return this._feedback._armLoadingFeedbackTicker(); }
+
+ /** Stop the loading-chip ticker if it is running. Idempotent. */
+ _stopLoadingFeedbackTicker() { return this._feedback._stopLoadingFeedbackTicker(); }
+
+ // ── Location Bar ─────────────────────────────
+
+ /**
+ * Initializes the location bar: renders city pills from CITY_POIS, sets up
+ * QWERTY keyboard navigation for POI selection, wires the search toggle
+ * and geocoding search input.
+ * @returns {void}
+ */
+ _initLocationBar() {
+ const { CITY_POIS, searchAndFlyTo, LocationSearch } = this.services;
+ this._locationControls?.destroy();
+ this._locationLookup?.destroy();
+ this._locationLookup = new LocationSearch({
+ input: this._locationSearch,
+ begin: () => this._beginDeferredNavigation('location'),
+ isCurrent: (generation) => !this._disposed && generation === this._navigationGeneration,
+ beforeFly: (generation) => this._reassertNavigationHandoff(generation),
+ search: (query, options) => searchAndFlyTo(this.viewer, query, {
+ placeSearch: this.placeSearch,
+ ...options,
+ }),
+ onStart: (generation) => { this._activeLocationSearchGeneration = generation; },
+ onResult: (destination, query) => {
+ this._searchedLocationLabel = destination.label || query;
+ this._setActiveLocation(null);
+ this._currentPoi = null;
+ this._collapsePOIRow();
+ this._updateLocationMiniStatus();
+ },
+ onMissing: () => this._showToast('Location not found'),
+ onError: (error) => {
+ console.error('[Search] Geocoding failed:', error);
+ this._showToast('Search failed');
+ },
+ onSettled: (generation) => this._settleLocationSearchUi(generation),
+ });
+ this._locationControls = new LocationControls({
+ elements: {
+ pills: this._locationPills, poiRow: this._poiRow, divider: this._locationBarDivider,
+ search: this._locationSearch, searchToggle: this._searchToggle,
+ resetButtons: [this._resetGlobeBtn, this._cockpitResetGlobeBtn],
+ statusCity: this._locationMiniCity, statusPoi: this._locationMiniPoi,
+ },
+ cities: CITY_POIS,
+ getExpandedCity: () => this._expandedCityId,
+ onCity: (id) => this._onCityPillClick(id),
+ onPoi: (id, index) => this._onPoiClick(id, index),
+ onSearch: (query) => this._locationLookup.run(query),
+ onReset: () => this.resetToGlobeView(),
+ });
+ }
+
+ /**
+ * Signals the start of an inter-city world jump: notifies the traffic layer
+ * to pause tile fetching and suspends detection overlays to prevent stale
+ * rendering during the flight.
+ * @returns {void}
+ */
+ _beginWorldJumpTransition() {
+ const { suspendDetection, trafficLayer } = this.services;
+ clearTimeout(this._trafficTransitionTimer);
+ trafficLayer.beginWorldJump?.();
+ suspendDetection('intercity');
+ }
+
+ /**
+ * Signals the end of an inter-city world jump: resumes traffic tile fetching,
+ * resumes detection overlays, and forces a traffic sync chip update.
+ * @returns {void}
+ */
+ _endWorldJumpTransition() {
+ const { resumeDetection, trafficLayer } = this.services;
+ clearTimeout(this._trafficTransitionTimer);
+ trafficLayer.endWorldJump?.();
+ resumeDetection();
+ this._updateTrafficSyncChip(true);
+ }
+
+ /**
+ * Wraps a fly-to action with world-jump transition hooks when the target
+ * city differs from the current one. Applies begin/end transition signals
+ * with a 5.2s safety timeout to guarantee cleanup if the flight callback
+ * never fires onComplete.
+ * @param {boolean} cityChanged - Whether the destination is in a different city.
+ * @param {function} flyAction - Callback receiving `{onStart, onComplete}` hooks; should return a result with targetPosition.
+ * @returns {*} Return value from flyAction.
+ */
+ _flyWithTransition(cityChanged, flyAction) {
+ return this._runExplicitNavigation('location', () => {
+ if (!cityChanged) return flyAction({});
+ let completed = false;
+ const finalize = () => {
+ if (completed) return;
+ completed = true;
+ this._endWorldJumpTransition();
+ };
+ const result = flyAction({
+ onStart: () => this._beginWorldJumpTransition(),
+ onComplete: finalize,
+ });
+ this._trafficTransitionTimer = window.setTimeout(finalize, 5200);
+ return result;
+ });
+ }
+
+ /**
+ * Release camera ownership when a resolved Location destination starts.
+ * Contact mode and its selected subject remain intact so FOCUS can return to
+ * that subject after the user finishes inspecting the destination.
+ * @returns {boolean} Whether a Contact subject remains selected.
+ */
+ beginLocationNavigation() {
+ this._stampNavigation();
+ this.cockpitView?.exit({ restoreTracking: false });
+ return this._releaseFollowCamera({ preserveVesselSelection: false });
+ }
+
+ /**
+ * Handles a city pill click: toggles POI row collapse if same city,
+ * otherwise expands the POI row, flies to the city's first POI, and
+ * tracks the target position for orbit mode.
+ * @param {string} cityId - Identifier of the clicked city.
+ * @returns {void}
+ */
+ _onCityPillClick(cityId) {
+ const { CITY_POIS, flyToPresetLocation } = this.services;
+ if (this._expandedCityId === cityId) {
+ // Same city clicked again — toggle collapse
+ this._collapsePOIRow();
+ return;
+ }
+
+ const isCityChanged = this._activeLocationId && this._activeLocationId !== cityId;
+ const result = this._flyWithTransition(!!isCityChanged, (hooks) => flyToPresetLocation(this.viewer, cityId, hooks));
+ if (result === false) return;
+ this._expandPOIRow(cityId);
+ this._setActiveLocation(cityId);
+ this._activePoiIndex = 0;
+ this._updatePoiHighlight();
+
+ // Track current target + POI for orbit
+ if (result) {
+ this._currentTarget = result.targetPosition;
+ this._currentPoi = CITY_POIS[cityId].pois[0];
+ }
+ this._updateLocationMiniStatus();
+ }
+
+ /**
+ * Handles a POI pill click: stops orbit, flies to the POI, highlights it,
+ * and saves the target position for future orbit activation.
+ * @param {string} cityId - Parent city identifier.
+ * @param {number} poiIndex - Index of the POI within the city's pois array.
+ * @returns {void}
+ */
+ _onPoiClick(cityId, poiIndex) {
+ const { CITY_POIS, flyToPOI } = this.services;
+ const isCityChanged = this._activeLocationId && this._activeLocationId !== cityId;
+ const result = this._flyWithTransition(!!isCityChanged, (hooks) => flyToPOI(this.viewer, cityId, poiIndex, hooks));
+ if (result === false) return;
+ this._setActiveLocation(cityId);
+ this._activePoiIndex = poiIndex;
+ this._updatePoiHighlight();
+
+ // Track current target + POI for orbit
+ if (result) {
+ this._currentTarget = result.targetPosition;
+ this._currentPoi = CITY_POIS[cityId].pois[poiIndex];
+ }
+ this._updateLocationMiniStatus();
+ }
+
+ /**
+ * Builds and shows the POI pill row for a city. Each pill displays a
+ * QWERTY keyboard shortcut key and the POI name.
+ * @param {string} cityId - City whose POIs to render.
+ * @returns {void}
+ */
+ _expandPOIRow(cityId) {
+ const { CITY_POIS } = this.services;
+ if (!CITY_POIS[cityId]) return;
+ this._expandedCityId = cityId;
+ this._locationControls.showPois(cityId);
+ }
+
+ /**
+ * Hides the POI pill row and clears the expanded city state.
+ * @returns {void}
+ */
+ _collapsePOIRow() {
+ this._expandedCityId = null;
+ this._activePoiIndex = null;
+ this._locationControls.hidePois();
+ }
+
+ /**
+ * Highlights the active POI pill and removes highlight from all others.
+ * @returns {void}
+ */
+ _updatePoiHighlight() {
+ this._locationControls.highlightPoi(this._activePoiIndex);
+ }
+
+ /**
+ * Forget the last free-text search destination and repaint the LOCATION
+ * readout. Public so camera owners that fly on their own — scene playback
+ * most of all — can invalidate it without reaching into private state.
+ * @returns {void}
+ */
+ clearSearchedLocation() {
+ if (this._searchedLocationLabel === null) return;
+ this._searchedLocationLabel = null;
+ this._updateLocationMiniStatus();
+ }
+
+ /**
+ * Sets the active city location, highlights its pill, and updates the mini-status readout.
+ * @param {string|null} locationId - City identifier, or null to clear.
+ * @returns {void}
+ */
+ _setActiveLocation(locationId) {
+ this._activeLocationId = locationId;
+ // A preset city is now what the camera is framed on, so any earlier
+ // free-text destination has been superseded. Clearing only on a real id
+ // leaves the search path's own _setActiveLocation(null) untouched.
+ if (locationId) this._searchedLocationLabel = null;
+ this._locationControls?.highlightCity(locationId);
+ this._updateLocationMiniStatus();
+ }
+
+ /**
+ * Updates the collapsed mini-status readout with the current destination:
+ * a preset city + POI/landmark, or the last free-text geocode search.
+ * @returns {void}
+ */
+ _updateLocationMiniStatus() {
+ const { CITY_POIS } = this.services;
+ this._locationControls?.renderStatus({
+ city: this._activeLocationId ? CITY_POIS[this._activeLocationId] : null,
+ currentPoi: this._currentPoi,
+ searchedLabel: this._searchedLocationLabel,
+ });
+ }
+
+ /**
+ * Updates the collapsed mini-status readout with the active style label.
+ * @param {string} [styleName=this.activeStyle] - Style name to display.
+ * @returns {void}
+ */
+ _updateStyleMiniStatus(styleName = this.activeStyle) {
+ if (!this._styleMiniValue) return;
+ this._styleMiniValue.textContent = STYLE_STATUS_LABELS[styleName] || String(styleName || 'normal').toUpperCase();
+ }
+
+ // ── Orbit Mode ──────────────────────────────
+
+ /**
+ * Creates the orbit mode indicator DOM element and appends it to the body.
+ * @returns {void}
+ */
+ _initOrbit() {
+ this._orbitIndicator = this._locationControls.createOrbitIndicator();
+ }
+
+ /**
+ * Toggles the orbit controller around the current POI target. Shows a toast
+ * if no target position has been set (user must fly to a POI first).
+ * @returns {void}
+ */
+ _toggleOrbit() {
+ if (!this._currentTarget) {
+ this._showToast('Fly to a POI first');
+ return;
+ }
+
+ const isActive = this.orbitController.toggle(this._currentTarget, {
+ radius: this._currentPoi?.alt || 500,
+ pitch: this._currentPoi?.pitch || -30,
+ });
+
+ this._orbitIndicator.classList.toggle('active', isActive);
+ }
+
+ /**
+ * Stops orbit mode if active and hides the orbit indicator.
+ * @returns {void}
+ */
+ _stopOrbit() {
+ if (this.orbitController.active) {
+ this.orbitController.stop();
+ this._orbitIndicator.classList.remove('active');
+ }
+ }
+
+ /** Wire the top-center action that clears only manager-owned data layers. */
+ _initClearSelectedLayersButton() {
+ if (!this._clearSelectedLayersBtn) return;
+ this._clearLayersControl?.destroy();
+ this._clearLayersControl = bindClearLayersControl(this._clearSelectedLayersBtn, () => this.clearSelectedLayers());
+ }
+
+ /**
+ * Clear every selected data layer without resetting visual, map, HUD, or
+ * camera state. A layer may still release camera work it owns as part of its
+ * established disable lifecycle.
+ * @returns {Promise<object>} Aggregate manager lifecycle truth for the batch.
+ */
+ clearSelectedLayers(...args) { return this._contextControls?.clearSelectedLayers(...args); }
+
+ /**
+ * Release every camera owner and return to the canonical full-globe frame.
+ * Repeated requests adopt the in-flight reset rather than cancelling it.
+ * @returns {Promise<object>} Canonical reset result shared with voice.
+ */
+ resetToGlobeView() {
+ const { GLOBE_VIEW, flyToGlobeView, interruptCameraMotion, flightsLayer, militaryFlightsLayer, satellitesLayer, aisLiveVesselsLayer, militaryAwarenessLayer, rocketLaunchesLayer } = this.services;
+ if (this._globeResetPromise) return this._globeResetPromise;
+ this._stampNavigation();
+ interruptCameraMotion('reset-globe');
+ this._stopOrbit();
+ this.cockpitView?.exit({ restoreTracking: false });
+ try {
+ militaryAwarenessLayer.releaseCameraOwnership?.({ origin: 'tool' });
+ } catch {
+ // Keep reset available if Context has not initialized completely.
+ try { flightsLayer.stopTracking?.({ origin: 'tool' }); } catch { /* best-effort release */ }
+ try { militaryFlightsLayer.stopTracking?.({ origin: 'tool' }); } catch { /* best-effort release */ }
+ try { aisLiveVesselsLayer.clearSelection?.(); } catch { /* best-effort release */ }
+ }
+ try { satellitesLayer.stopTracking?.({ origin: 'tool' }); } catch { /* best-effort release */ }
+ try { rocketLaunchesLayer.releaseCameraOwnership?.(); } catch { /* best-effort release */ }
+ this.viewer.trackedEntity = undefined;
+ this.viewer.camera.cancelFlight();
+ this.viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
+ this._beginWorldJumpTransition();
+
+ let resolveReset;
+ const resetPromise = new Promise((resolve) => { resolveReset = resolve; });
+ this._globeResetPromise = resetPromise;
+ let settled = false;
+ let timer = null;
+ const finish = (cancelled = false) => {
+ if (settled) return;
+ settled = true;
+ clearTimeout(timer);
+ this._endWorldJumpTransition();
+ const carto = this.viewer.camera.positionCartographic;
+ const result = {
+ ok: !cancelled,
+ action: 'zoom_to_globe',
+ cancelled,
+ heightKm: Math.round(GLOBE_VIEW.heightM / 1000),
+ centeredOn: {
+ latitude: Number(Cesium.Math.toDegrees(carto.latitude).toFixed(2)),
+ longitude: Number(Cesium.Math.toDegrees(carto.longitude).toFixed(2)),
+ },
+ };
+ this._resetGlobeBtn?.setAttribute('aria-label', 'Reset to full globe view');
+ this._cockpitResetGlobeBtn?.setAttribute('aria-label', 'Reset cockpit to full globe view');
+ this._globeResetPromise = null;
+ resolveReset(result);
+ };
+ timer = window.setTimeout(() => {
+ const height = this.viewer.camera.positionCartographic?.height;
+ finish(!Number.isFinite(height) || Math.abs(height - GLOBE_VIEW.heightM) > 1000);
+ }, 4200);
+ this._resetGlobeBtn?.setAttribute('aria-label', 'Resetting to full globe view');
+ this._cockpitResetGlobeBtn?.setAttribute('aria-label', 'Resetting cockpit to full globe view');
+ const target = flyToGlobeView(this.viewer, {
+ onComplete: () => finish(false),
+ onCancel: () => finish(true),
+ });
+ if (!target) finish(true);
+ return resetPromise;
+ }
+
+ // ── Share Button ─────────────────────────────
+
+ /**
+ * Wires the share button click to copy the current share link to the clipboard.
+ * @returns {void}
+ */
+ _initShareButton() {
+ this._lifetime.listen(this._shareBtn, 'click', async () => {
+ const success = await this.shareLinkManager.copyLink();
+ this._showToast(success ? 'Link copied!' : 'Copy failed');
+ });
+ }
+
+ /**
+ * Displays a temporary toast notification for 2 seconds.
+ * @param {string} message - Text to show in the toast.
+ * @returns {void}
+ */
+ _showToast(message) { return this._feedback._showToast(message); }
+
+ // ── HUD Toggle ───────────────────────────────
+
+ /**
+ * Wires the HUD toggle button, initializes the default HUD variant to 'tactical',
+ * and sets up the detection mode cycle button.
+ * @returns {void}
+ */
+ /**
+ * Wires the DISPLAY-rail "3D" toggle to the flights layer's `models3d` param.
+ * ON by default in `proximity` mode (owner directive 2026-08-22): the fleet
+ * renders as 3D glTF models once the camera is zoomed in past the layer's
+ * altitude ceiling, and only the nearest MODEL_MAX in view are admitted, so
+ * the default costs nothing at globe scale. `all` is the deliberate opt-in;
+ * turning the toggle off returns the fleet to flat billboards. The TRACKED
+ * contact is independent of this toggle (see trackedModelRegime.js).
+ * @returns {void}
+ */
+ /** One 3D toggle drives BOTH aircraft layers (commercial + military) so all planes flip together. */
+ _setModels3dParams(params, { origin = 'user' } = {}) {
+ this._dataManager?.setLayerParams('flights', params, { origin });
+ this._dataManager?.setLayerParams('military', params, { origin });
+ }
+
+ _syncModels3dFromLayerState(state) {
+ const options = state?.options?.flights;
+ if (!options) return;
+ this._models3dEnabled = options.models3d === true;
+ this._models3dMode = options.models3dMode === 'all' ? 'all' : 'proximity';
+ this._syncModels3dButtonState();
+ this._models3dModeRow?.classList.toggle('visible', this._models3dEnabled);
+ for (const button of this._models3dModeBtns || []) {
+ if (!button) continue;
+ const active = button.dataset.mode === this._models3dMode;
+ button.classList.toggle('active', active);
+ button.setAttribute('aria-checked', String(active));
+ }
+ this._layoutRightPanels();
+ }
+
+ _syncModels3dModeRow() {
+ if (this._models3dModeRow) this._models3dModeRow.classList.toggle('visible', this._models3dEnabled);
+ this._layoutRightPanels();
+ }
+
+ _initModels3dToggle() {
+ if (!this._models3dBtn) return;
+ this._syncModels3dButtonState();
+ this._syncModels3dModeRow();
+ }
+
+ _setModels3dEnabled(enabled) {
+ this._models3dEnabled = !!enabled;
+ this._setModels3dParams({ models3d: this._models3dEnabled });
+ this._syncModels3dButtonState();
+ }
+
+ _setModels3dMode(mode) {
+ const normalized = mode === 'all' ? 'all' : 'proximity';
+ this._models3dMode = normalized;
+ this._setModels3dParams({ models3dMode: normalized });
+ for (const button of this._models3dModeBtns) {
+ if (!button) continue;
+ const active = button.dataset.mode === normalized;
+ button.classList.toggle('active', active);
+ button.setAttribute('aria-checked', String(active));
+ }
+ this._syncModels3dButtonState();
+ }
+
+ _syncModels3dButtonState() {
+ this._models3dBtn?.classList.toggle('active', this._models3dEnabled);
+ // The lit/dark state is a colour to a sighted operator and nothing at all to
+ // a screen reader without this. It matters more now that the button ships
+ // ACTIVE from markup (default-on, 2026-08-22): the very first thing assistive
+ // tech reported was an unpressed-looking control over an armed layer.
+ // Mirrors #scope-toggle, which has always carried aria-pressed.
+ this._models3dBtn?.setAttribute('aria-pressed', String(this._models3dEnabled));
+ }
+
+ _initHUDToggle() {
+ if (this._hudLayoutSelect) {
+ this._hudLayoutSelect.value = 'tactical';
+ }
+ this._setHudVariant('tactical');
+ this.hud.setMode('on');
+ this._updateHudButtonState();
+
+ this._lifetime.listen(this._cockpitDisplayToggleBtn, 'click', () => {
+ const open = this._cockpitDisplayToggleBtn.getAttribute('aria-expanded') === 'true';
+ this._setCockpitDisclosure?.('display', !open);
+ });
+ this._initCockpitDisplayPortal();
+ }
+
+ /**
+ * Reuses the production Display controls inside Cockpit without cloning
+ * stateful inputs or event listeners. Comment anchors preserve each group's
+ * exact home in the standard Display panel for exit and teardown.
+ * @returns {void}
+ */
+ _initCockpitDisplayPortal() {
+ this._cockpitDisplayPortal?.destroy();
+ this._cockpitDisplayPortal = new CockpitDisplayPortal({
+ standardPanel: this._ppToggles,
+ cockpitPanel: this._cockpitDisplayPanel,
+ groups: [
+ ['hud', this._hudBtn?.closest('.pp-toggle-group')],
+ ['detection', this._detectionBtn?.closest('.pp-toggle-group')],
+ ['parameters', this._sliderPanel],
+ ['models3d', this._models3dBtn?.closest('.pp-toggle-group')],
+ ],
+ layout: () => {
+ this._layoutRightPanels();
+ this.cockpitView?.scheduleContextLayout();
+ },
+ });
+ }
+
+ /**
+ * Moves the shared HUD, Detection, Parameters, and 3D controls into or out
+ * of Cockpit.
+ * @param {boolean} active Whether Cockpit owns the Display control groups.
+ * @returns {void}
+ */
+ _setCockpitDisplayPortalActive(active) { this._cockpitDisplayPortal?.setActive(active); }
+ get _cockpitDisplayPortalActive() { return this._cockpitDisplayPortal?.active ?? false; }
+ get _displayPortalScrollRestoreOwner() { return this._cockpitDisplayPortal?.restoreOwner ?? null; }
+ get _standardDisplayScrollTop() { return this._cockpitDisplayPortal?.standardScrollTop ?? 0; }
+
+ /**
+ * Syncs the HUD toggle button active class and HUD layout row visibility
+ * with the current HUD visible state.
+ * @returns {void}
+ */
+ _updateHudButtonState() {
+ this._hudBtn.classList.toggle('active', this.hud.visible);
+ if (this._hudLayoutRow) {
+ this._hudLayoutRow.classList.toggle('visible', this.hud.visible);
+ }
+ this._scheduleAdaptivePanelLayout({ settle: true });
+ }
+
+ /**
+ * Updates the detection toggle button label and CSS classes to reflect
+ * the current density-derived profile. Also toggles the density and
+ * allocation controls together.
+ * @param {string} modeLabel - Current detection mode label.
+ * @returns {void}
+ */
+ _updateDetectionButton(modeLabel) {
+ const btn = this._detectionBtn;
+ const enabled = modeLabel !== 'OFF';
+ btn.setAttribute('aria-pressed', String(enabled));
+ btn.setAttribute('aria-label', enabled
+ ? `Detection overlay: ${String(modeLabel).toLowerCase()}`
+ : 'Detection overlay: off');
+ btn.classList.remove('active', 'god', 'panoptic');
+ if (modeLabel === 'SPARSE') {
+ btn.querySelector('.pp-label').textContent = 'SPARSE';
+ btn.classList.add('active');
+ } else if (modeLabel === 'BALANCED') {
+ btn.querySelector('.pp-label').textContent = 'BALANCED';
+ btn.classList.add('active');
+ } else if (modeLabel === 'DENSE') {
+ btn.querySelector('.pp-label').textContent = 'DENSE';
+ btn.classList.add('active', 'panoptic');
+ } else {
+ btn.querySelector('.pp-label').textContent = 'DETECT';
+ }
+
+ if (this._detectionSliderRow) {
+ this._detectionSliderRow.classList.toggle('visible', modeLabel !== 'OFF');
+ }
+ if (this._detectionAllocationRow) {
+ this._detectionAllocationRow.classList.toggle('visible', modeLabel !== 'OFF');
+ }
+ if (this._detectionFadeRow) {
+ this._detectionFadeRow.classList.toggle('visible', modeLabel !== 'OFF');
+ }
+ if (this._detectionOpacityRow) {
+ this._detectionOpacityRow.classList.toggle('visible', modeLabel !== 'OFF');
+ }
+ this._layoutRightPanels();
+ }
+
+ /**
+ * Positions the parameter slider panel directly below the right-rail toggle
+ * panel, right-aligned to it. Clamps to viewport bounds to prevent overflow.
+ * Runs inside a rAF to batch with other layout reads.
+ * @returns {void}
+ */
+ _layoutRightPanels() {
+ this._scheduleRightPanelLayout();
+ }
+
+ /**
+ * Recalculates the CCTV panel max-height based on its current top position
+ * and the window height, enabling internal scroll without viewport overflow.
+ * @returns {void}
+ */
+ _syncCctvPanelViewport() {
+ if (!this._cctvPanel) return;
+ const inner = this._cctvPanel.querySelector('.cctv-panel-inner');
+ this._lifetime.frame(() => {
+ if (this._cctvPanel.parentElement?.id === 'right-context-rail') {
+ this._cctvPanel.style.maxHeight = '';
+ if (inner) inner.style.maxHeight = '';
+ this._scheduleRightPanelLayout();
+ return;
+ }
+ const rect = this._cctvPanel.getBoundingClientRect();
+ const availableHeight = Math.max(190, Math.floor(window.innerHeight - rect.top - 12));
+ this._cctvPanel.style.maxHeight = `${availableHeight}px`;
+ if (inner) {
+ inner.style.maxHeight = `${availableHeight}px`;
+ }
+ });
+ }
+
+ /** Whether a share link was used to load the page */
+ get hasShareState() {
+ return !!this._hasShareState;
+ }
+
+ /** Terminal result for the complete initial share restoration. */
+ get initialRestorePromise() {
+ return this._initialShareRestorePromise || Promise.resolve({ status: 'not-requested' });
+ }
+
+ _settleInitialShareRestore(result) {
+ if (!this._resolveInitialShareRestore) return;
+ const resolve = this._resolveInitialShareRestore;
+ this._resolveInitialShareRestore = null;
+ resolve(result);
+ window.dispatchEvent(new CustomEvent('gev:initial-share-restore-settled', { detail: result }));
+ }
+
+ /**
+ * Tear down the StyleManager — cancel animation loop, clear intervals,
+ * and release resources. Call this before discarding the instance to
+ * prevent leaked rAF loops and event listeners.
+ * @returns {Promise<void>} Resolves after focused-session state restoration.
+ */
+ async dispose() {
+ const { destroyTrackedReadout, destroyWorldOverlay, destroyDetection } = this.services;
+ if (this._disposed) return;
+ this._shareTrackingNoticeGeneration += 1;
+ this._shareTrackingAcquiringKey = null;
+ this._feedback._globalStatusNotice = null;
+ if (this._globalLoadingStatus) this._globalLoadingStatus.hidden = true;
+ this._disposed = true;
+ this._lifetime.destroy();
+ this._recording.destroy();
+ this._panelPosition.destroy();
+ this._feedback.destroy();
+ this._panelLayout.destroy();
+ this._applicationShortcuts?.destroy();
+ this._displayControls?.destroy();
+ this._mapSourceControls?.destroy();
+ this._clearLayersControl?.destroy();
+ this._locationControls?.destroy();
+ this._cctvControls?.destroy();
+ this._radioControls?.destroy();
+ this.cockpitView?.stop();
+ this._cockpitDisplayPortal?.stop();
+ this._visualEffects.stop();
+ this._styleParameters?.destroy();
+ for (const control of this._panelDisclosureControls || []) control.destroy();
+ this._panelDisclosureControls = [];
+ this._hoverPanelControls?.forEach((control) => control.destroy());
+ this._hoverPanelControls?.clear();
+ this._locationLookup?.destroy();
+ this._cancelMapSourceFocus?.();
+ // Revoke persistence/hash authority before teardown can emit manager changes.
+ this._layerStateCoordinator?.destroy();
+ this._layerStateCoordinator = null;
+ this._layerStateRestorePromise = null;
+ clearTimeout(this._initialShareRestoreTimeout);
+ this._initialShareRestoreTimeout = null;
+ this._settleInitialShareRestore({ status: 'destroyed', share: null, layers: [] });
+ if (this._initialShareGestureHandler) {
+ this.viewer?.canvas?.removeEventListener('pointerdown', this._initialShareGestureHandler);
+ this.viewer?.canvas?.removeEventListener('wheel', this._initialShareGestureHandler);
+ this._initialShareGestureHandler = null;
+ }
+ this.shareLinkManager?.destroy();
+ if (this._awarenessSelectedHandler) {
+ window.removeEventListener('gev:awareness-subject-selected', this._awarenessSelectedHandler);
+ this._awarenessSelectedHandler = null;
+ }
+ if (this._awarenessClearedHandler) {
+ window.removeEventListener('gev:awareness-subject-cleared', this._awarenessClearedHandler);
+ this._awarenessClearedHandler = null;
+ }
+
+ // Invalidate any in-flight Context transaction the same way a newer request
+ // would. Without this, a reinstatement already past its awaits could
+ // re-enable a mode's entry layer and republish `_contextMode` while the
+ // rest of teardown is tearing those very layers down.
+ this._contextControls.stop();
+ this._stampNavigation();
+ // Close camera-entry seams synchronously. Context restoration may await
+ // layer work, so leaving these listeners attached until afterward lets a
+ // focus event release tracking or start a flight during teardown.
+ this._removeCctvRequestFocusListener?.();
+ this._removeCctvRequestFocusListener = null;
+ this._cctvRequestFocusHandler = null;
+ this._removeWorldRequestFocusListener?.();
+ this._removeWorldRequestFocusListener = null;
+ this._worldRequestFocusHandler = null;
+ this._navigationOwnerChangedRemover?.();
+ this._navigationOwnerChangedRemover = null;
+ this._removeNavigationAuthorityListener?.();
+ this._removeNavigationAuthorityListener = null;
+ await this._contextControls.restoreForDisposal();
+ // IR boost teardown BEFORE detaching the data manager: restore fog and
+ // un-boost both aircraft layers so a surviving viewer or replacement
+ // manager doesn't inherit sensor state (review P2, 2026-08-16).
+ if (this._irBoostActive) {
+ if (this._irFogWasEnabled != null && this.viewer?.scene?.fog) {
+ this.viewer.scene.fog.enabled = this._irFogWasEnabled;
+ }
+ this._dataManager?.setLayerParams('flights', { irBoost: false });
+ this._dataManager?.setLayerParams('military', { irBoost: false });
+ this._irBoostActive = false;
+ this._irFogWasEnabled = null;
+ }
+ this.cockpitView?.dispose();
+ this._cockpitDisplayPortal?.destroy();
+ this._cockpitDisplayPortal = null;
+ this._contextControls.disconnect();
+ this._dataManagerUnsubscribe?.();
+ this._dataManagerUnsubscribe = null;
+
+ if (this._windowResizeHandler) {
+ window.removeEventListener('resize', this._windowResizeHandler);
+ this._windowResizeHandler = null;
+ }
+ destroyTrackedReadout();
+ destroyDetection();
+ destroyWorldOverlay();
+ this.celestialRing?.destroy();
+ this._visualEffects.destroy();
+ }
+}
diff --git a/src/ui/panelLayoutController.js b/src/ui/panelLayoutController.js
new file mode 100644
index 000000000..05b78dece
--- /dev/null
+++ b/src/ui/panelLayoutController.js
@@ -0,0 +1,386 @@
+/** Own rail measurement, layout scheduling and dock tray observation. */
+import { layoutLeftPanelRail, layoutRightPanelRail } from './panelRails.js';
+const COCKPIT_LAYOUT_SETTLE_MS = 240;
+const LEFT_STACK_OBSTACLE_SELECTOR = [
+ '#cockpit-hud .cockpit-topline',
+ '#cockpit-hud .cockpit-topline > div',
+ '#title-bar',
+ '#style-indicator',
+ '#top-center-actions',
+ '#traffic-sync-chip',
+ '#cctv-sync-chip',
+ '#intel-hud .hud-top-left',
+ '#intel-hud .hud-top-right',
+ '#intel-hud .hud-bottom-left',
+ '#intel-hud .hud-bottom-right',
+ '#intel-hud .hud-top-bar',
+ '#intel-hud .hud-bottom-bar',
+ '#intel-hud .hud-left-edge',
+ '#intel-hud .hud-right-edge',
+ '#cockpit-context',
+ '#cesium-credits .cesium-credit-logoContainer',
+ '#cesium-credits .cesium-credit-textContainer',
+ '#location-bar',
+ '#control-panel',
+ '#gev-voice-control',
+ '#pp-toggles',
+ '#param-slider-panel',
+].join(', ');
+const RIGHT_STACK_OBSTACLE_SELECTOR = [
+ '#cockpit-hud .cockpit-topline',
+ '#cockpit-hud .cockpit-topline > div',
+ '#title-bar',
+ '#style-indicator',
+ '#top-center-actions',
+ '#traffic-sync-chip',
+ '#cctv-sync-chip',
+ '#intel-hud .hud-top-left',
+ '#intel-hud .hud-top-right',
+ '#intel-hud .hud-bottom-left',
+ '#intel-hud .hud-bottom-right',
+ '#intel-hud .hud-top-bar',
+ '#intel-hud .hud-bottom-bar',
+ '#intel-hud .hud-left-edge',
+ '#intel-hud .hud-right-edge',
+ '#cockpit-context',
+ '#cockpit-signal-stream',
+ '#cesium-credits .cesium-credit-logoContainer',
+ '#cesium-credits .cesium-credit-textContainer',
+ '#command-dock',
+ '#gev-voice-control',
+].join(', ');
+export class PanelLayoutController {
+ constructor({ readHud, scheduleCockpitLayout, syncPanelCollapseButton, readDisplayScrollTop }) {
+ this.readHud = readHud;
+ this.scheduleCockpitLayout = scheduleCockpitLayout;
+ this._syncPanelCollapseButton = syncPanelCollapseButton;
+ this.readDisplayScrollTop = readDisplayScrollTop;
+ this.destroyed = false;
+ this._adaptivePanelSettleTimer = null;
+ this._commandDockTrayObserver = null;
+ this._leftStackCockpitModeHandler = null;
+ this._leftStackCollapsedHeights = new Map();
+ this._leftStackHudTransitionHandler = null;
+ this._leftStackLayoutFrame = null;
+ this._leftStackMutationObserver = null;
+ this._leftStackPreferredPanelId = null;
+ this._leftStackReconsiderAutoCollapse = false;
+ this._leftStackResizeObserver = null;
+ this._rightStackHudTransitionHandler = null;
+ this._rightStackLayoutFrame = null;
+ this._rightStackMutationObserver = null;
+ this._rightStackPreferredPanelId = null;
+ this._rightStackReconsiderAutoCollapse = false;
+ this._rightStackResizeObserver = null;
+ this._cockpitLayoutFrame = null;
+ this._cockpitLayoutTimer = null;
+ this._leftPanelStack = document.getElementById('left-panel-stack');
+ this._rightPanelStack = document.getElementById('right-context-rail');
+ this._ppToggles = document.getElementById('pp-toggles');
+ this._cctvPanel = document.getElementById('cctv-panel');
+ this._sliderPanel = document.getElementById('param-slider-panel');
+ this._detectionBtn = document.getElementById('detection-toggle');
+ }
+ _scheduleAdaptivePanelLayout({ settle = false } = {}) {
+ if (this.destroyed) return;
+ this._scheduleLeftPanelLayout({ reconsiderAutoCollapse: true });
+ this._scheduleRightPanelLayout({ reconsiderAutoCollapse: true });
+ this.scheduleCockpitLayout();
+ if (!settle) return;
+ clearTimeout(this._adaptivePanelSettleTimer);
+ this._adaptivePanelSettleTimer = setTimeout(() => {
+ if (this.destroyed) return;
+ this._adaptivePanelSettleTimer = null;
+ this._scheduleLeftPanelLayout({ reconsiderAutoCollapse: true });
+ this._scheduleRightPanelLayout({ reconsiderAutoCollapse: true });
+ this.scheduleCockpitLayout();
+ }, COCKPIT_LAYOUT_SETTLE_MS);
+ }
+
+ _initCommandDockTrayMetrics() {
+ if (this.destroyed) return;
+ const dock = document.getElementById('command-dock');
+ if (!dock) return;
+ this._commandDockTrayObserver?.disconnect?.();
+ if (typeof ResizeObserver === 'function') {
+ this._commandDockTrayObserver = new ResizeObserver(() => this._updateCommandDockTrayStack());
+ dock.querySelectorAll('.dock-popover-content').forEach((tray) => {
+ this._commandDockTrayObserver.observe(tray);
+ });
+ }
+ this._updateCommandDockTrayStack();
+ }
+
+ _updateCommandDockTrayStack() {
+ if (this.destroyed) return;
+ const dock = document.getElementById('command-dock');
+ if (!dock) return;
+ const locationPanel = dock.querySelector('#location-bar.dock-pinned:not(.collapsed)');
+ const presetsPanel = dock.querySelector('#control-panel.dock-pinned:not(.collapsed)');
+ const locationHeight = locationPanel?.querySelector('.dock-popover-content')?.getBoundingClientRect().height || 0;
+ const presetsHeight = presetsPanel?.querySelector('.dock-popover-content')?.getBoundingClientRect().height || 0;
+ const pinnedCount = Number(locationHeight > 0) + Number(presetsHeight > 0);
+ const locationHeightPx = Math.ceil(locationHeight);
+ const presetsHeightPx = Math.ceil(presetsHeight);
+ const topPinnedPanel = dock.querySelector('.dock-pinned-top.dock-pinned:not(.collapsed)');
+ const lowerPinnedPanel = topPinnedPanel?.id === 'location-bar' ? presetsPanel : locationPanel;
+ const lowerPinnedHeight = lowerPinnedPanel
+ ?.querySelector('.dock-popover-content')
+ ?.getBoundingClientRect().height || 0;
+ const stackHeight = pinnedCount > 1
+ ? `calc(${locationHeightPx}px + ${presetsHeightPx}px + 1.2rem)`
+ : `${locationHeightPx + presetsHeightPx}px`;
+ dock.style.setProperty('--dock-location-pinned-height', `${locationHeightPx}px`);
+ dock.style.setProperty('--dock-presets-pinned-height', `${presetsHeightPx}px`);
+ dock.style.setProperty('--dock-lower-pinned-height', `${Math.ceil(lowerPinnedHeight)}px`);
+ dock.style.setProperty('--dock-pinned-stack-height', stackHeight);
+ dock.classList.toggle('dock-has-pinned-tray', pinnedCount > 0);
+ dock.classList.toggle('dock-has-two-pinned-trays', pinnedCount > 1);
+ }
+
+ _initRightPanelAdaptiveLayout() {
+ if (this.destroyed) return;
+ const stack = this._rightPanelStack;
+ if (!stack || !this._ppToggles) return;
+
+ this._ppToggles.style.removeProperty('top');
+ this._ppToggles.style.removeProperty('right');
+ this._ppToggles.style.removeProperty('bottom');
+ this._ppToggles.style.removeProperty('left');
+ this._ppToggles.style.removeProperty('z-index');
+ this._ppToggles.classList.remove('panel-draggable', 'panel-dragging');
+ this._ppToggles.querySelector('.pp-header-row')?.removeAttribute('title');
+ stack.prepend(this._ppToggles);
+ const globalContextPanel = document.getElementById('global-context-panel');
+ if (this._cctvPanel) {
+ this._cctvPanel.style.removeProperty('top');
+ this._cctvPanel.style.removeProperty('right');
+ this._cctvPanel.style.removeProperty('bottom');
+ this._cctvPanel.style.removeProperty('left');
+ this._cctvPanel.style.removeProperty('z-index');
+ this._cctvPanel.classList.remove('panel-draggable', 'panel-dragging');
+ stack.insertBefore(this._cctvPanel, globalContextPanel);
+ this._syncPanelCollapseButton(this._cctvPanel);
+ }
+ if (this._sliderPanel) {
+ this._sliderPanel.style.removeProperty('top');
+ this._sliderPanel.style.removeProperty('right');
+ this._sliderPanel.style.removeProperty('bottom');
+ this._sliderPanel.style.removeProperty('left');
+ this._sliderPanel.style.removeProperty('max-height');
+ const detectionGroup = this._detectionBtn?.closest('.pp-toggle-group');
+ if (detectionGroup) detectionGroup.after(this._sliderPanel);
+ else this._ppToggles.append(this._sliderPanel);
+ }
+ if (typeof ResizeObserver !== 'undefined') {
+ this._rightStackResizeObserver = new ResizeObserver(() => {
+ this._scheduleRightPanelLayout();
+ });
+ this._rightStackResizeObserver.observe(stack);
+ for (const panel of [this._ppToggles, this._cctvPanel, globalContextPanel]) {
+ if (panel) this._rightStackResizeObserver.observe(panel);
+ }
+ document.querySelectorAll(RIGHT_STACK_OBSTACLE_SELECTOR).forEach((element) => {
+ this._rightStackResizeObserver.observe(element);
+ });
+ }
+
+ if (typeof MutationObserver !== 'undefined') {
+ this._rightStackMutationObserver = new MutationObserver(() => {
+ this._scheduleRightPanelLayout();
+ });
+ this._rightStackMutationObserver.observe(stack, {
+ subtree: true,
+ childList: true,
+ characterData: true,
+ attributes: true,
+ attributeFilter: ['class', 'hidden', 'data-variant'],
+ });
+ const hud = document.getElementById('intel-hud');
+ if (hud) {
+ this._rightStackMutationObserver.observe(hud, {
+ subtree: true,
+ attributes: true,
+ attributeFilter: ['class', 'hidden', 'data-variant'],
+ });
+ }
+ }
+
+ const transitionHud = document.getElementById('intel-hud');
+ if (transitionHud) {
+ this._rightStackHudTransitionHandler = (event) => {
+ if (event.propertyName === 'opacity' || event.propertyName === 'visibility') {
+ this._scheduleRightPanelLayout({ reconsiderAutoCollapse: true });
+ }
+ };
+ transitionHud.addEventListener('transitionend', this._rightStackHudTransitionHandler);
+ }
+
+ this._scheduleRightPanelLayout();
+ }
+
+ _scheduleRightPanelLayout({ reconsiderAutoCollapse = false } = {}) {
+ if (this.destroyed) return;
+ if (reconsiderAutoCollapse) this._rightStackReconsiderAutoCollapse = true;
+ if (!this._rightPanelStack || this._rightStackLayoutFrame !== null) return;
+ this._rightStackLayoutFrame = requestAnimationFrame(() => {
+ if (this.destroyed) return;
+ this._rightStackLayoutFrame = null;
+ if (this._rightStackReconsiderAutoCollapse) {
+ this._rightStackReconsiderAutoCollapse = false;
+ for (const panel of this._rightPanelStack.querySelectorAll('.layout-auto-collapsed')) {
+ panel.classList.remove('collapsed', 'layout-auto-collapsed');
+ this._syncPanelCollapseButton(panel);
+ }
+ }
+ this._syncRightPanelAdaptiveLayout();
+ });
+ }
+
+ _syncRightPanelAdaptiveLayout() {
+ if (this.destroyed) return;
+ layoutRightPanelRail({
+ stack: this._rightPanelStack,
+ obstacles: document.querySelectorAll(RIGHT_STACK_OBSTACLE_SELECTOR),
+ windowRef: window,
+ hud: this.readHud(),
+ preferredPanelId: this._rightStackPreferredPanelId,
+ onCollapse: (panel) => this._syncPanelCollapseButton(panel),
+ onRetry: () => this._scheduleRightPanelLayout(),
+ leftStack: this._leftPanelStack,
+ displayPanel: this._ppToggles,
+ readDisplayScrollTop: this.readDisplayScrollTop,
+ });
+ }
+
+ _initLeftPanelAdaptiveLayout() {
+ if (this.destroyed) return;
+ const stack = this._leftPanelStack;
+ if (!stack) return;
+
+ if (typeof ResizeObserver !== 'undefined') {
+ this._leftStackResizeObserver = new ResizeObserver(() => {
+ this._scheduleLeftPanelLayout();
+ });
+ this._leftStackResizeObserver.observe(stack);
+ stack.querySelectorAll(':scope > [data-panel-id]').forEach((panel) => {
+ this._leftStackResizeObserver.observe(panel);
+ const inner = [...panel.children].find((child) => !child.classList.contains('panel-glow'));
+ if (inner) this._leftStackResizeObserver.observe(inner);
+ });
+ document.querySelectorAll(LEFT_STACK_OBSTACLE_SELECTOR).forEach((element) => {
+ this._leftStackResizeObserver.observe(element);
+ });
+ }
+
+ if (typeof MutationObserver !== 'undefined') {
+ this._leftStackMutationObserver = new MutationObserver(() => {
+ this._scheduleLeftPanelLayout();
+ });
+ this._leftStackMutationObserver.observe(stack, {
+ subtree: true,
+ childList: true,
+ characterData: true,
+ attributes: true,
+ attributeFilter: ['class'],
+ });
+ const hud = document.getElementById('intel-hud');
+ if (hud) {
+ this._leftStackMutationObserver.observe(hud, {
+ attributes: true,
+ attributeFilter: ['class', 'data-variant'],
+ });
+ }
+ const credits = document.getElementById('cesium-credits');
+ if (credits) {
+ this._leftStackMutationObserver.observe(credits, {
+ subtree: true,
+ childList: true,
+ });
+ }
+ }
+
+ const transitionHud = document.getElementById('intel-hud');
+ if (transitionHud) {
+ this._leftStackHudTransitionHandler = (event) => {
+ if (event.propertyName === 'opacity' || event.propertyName === 'visibility') {
+ this._scheduleLeftPanelLayout({ reconsiderAutoCollapse: true });
+ // The Cockpit strip hangs off the HUD's REC readout, so it has to
+ // remeasure on the same event: the readout keeps its rect through
+ // the whole fade and only stops counting once the HUD has retired.
+ this.scheduleCockpitLayout();
+ }
+ };
+ transitionHud.addEventListener('transitionend', this._leftStackHudTransitionHandler);
+ }
+
+ this._leftStackCockpitModeHandler = () => {
+ if (this.destroyed) return;
+ // Cockpit mode repositions the peripheral HUD and reveals its own
+ // bottom-left context card. Measure after those styles have committed so
+ // the accordion remains in the same obstacle-safe lane instead of
+ // jumping to a cockpit-specific top anchor.
+ this._scheduleLeftPanelLayout();
+ if (this._cockpitLayoutFrame !== null) cancelAnimationFrame(this._cockpitLayoutFrame);
+ this._cockpitLayoutFrame = requestAnimationFrame(() => { this._cockpitLayoutFrame = null; this._scheduleLeftPanelLayout(); });
+ clearTimeout(this._cockpitLayoutTimer);
+ this._cockpitLayoutTimer = setTimeout(() => { this._cockpitLayoutTimer = null; this._scheduleLeftPanelLayout(); }, 300);
+ };
+ window.addEventListener('gev:cockpit-mode-changed', this._leftStackCockpitModeHandler);
+
+ this._scheduleLeftPanelLayout();
+ }
+
+ _scheduleLeftPanelLayout({ reconsiderAutoCollapse = false } = {}) {
+ if (this.destroyed) return;
+ if (reconsiderAutoCollapse) this._leftStackReconsiderAutoCollapse = true;
+ if (!this._leftPanelStack || this._leftStackLayoutFrame !== null) return;
+ this._leftStackLayoutFrame = requestAnimationFrame(() => {
+ if (this.destroyed) return;
+ this._leftStackLayoutFrame = null;
+ if (this._leftStackReconsiderAutoCollapse) {
+ this._leftStackReconsiderAutoCollapse = false;
+ for (const panel of this._leftPanelStack.querySelectorAll('.layout-auto-collapsed')) {
+ panel.classList.remove('collapsed', 'layout-auto-collapsed');
+ this._syncPanelCollapseButton(panel);
+ }
+ }
+ this._syncLeftPanelAdaptiveLayout();
+ });
+ }
+
+ _syncLeftPanelAdaptiveLayout() {
+ if (this.destroyed) return;
+ layoutLeftPanelRail({
+ stack: this._leftPanelStack,
+ obstacles: document.querySelectorAll(LEFT_STACK_OBSTACLE_SELECTOR),
+ windowRef: window,
+ hud: this.readHud(),
+ preferredPanelId: this._leftStackPreferredPanelId,
+ onCollapse: (panel) => this._syncPanelCollapseButton(panel),
+ onRetry: () => this._scheduleLeftPanelLayout(),
+ collapsedHeights: this._leftStackCollapsedHeights,
+ onAligned: () => this._scheduleRightPanelLayout(),
+ });
+ }
+ destroy() {
+ if (this.destroyed) return;
+ this.destroyed = true;
+ for (const field of ['_leftStackLayoutFrame', '_rightStackLayoutFrame', '_cockpitLayoutFrame']) {
+ if (this[field] !== null) cancelAnimationFrame(this[field]);
+ this[field] = null;
+ }
+ clearTimeout(this._adaptivePanelSettleTimer);
+ clearTimeout(this._cockpitLayoutTimer);
+ this._adaptivePanelSettleTimer = this._cockpitLayoutTimer = null;
+ for (const field of ['_commandDockTrayObserver', '_leftStackResizeObserver', '_leftStackMutationObserver', '_rightStackResizeObserver', '_rightStackMutationObserver']) {
+ this[field]?.disconnect(); this[field] = null;
+ }
+ for (const field of ['_leftStackHudTransitionHandler', '_rightStackHudTransitionHandler']) {
+ if (this[field]) document.getElementById('intel-hud')?.removeEventListener('transitionend', this[field]);
+ this[field] = null;
+ }
+ if (this._leftStackCockpitModeHandler) window.removeEventListener('gev:cockpit-mode-changed', this._leftStackCockpitModeHandler);
+ this._leftStackCockpitModeHandler = null;
+ }
+}
diff --git a/src/ui/panelPositionControls.js b/src/ui/panelPositionControls.js
new file mode 100644
index 000000000..df15fa99b
--- /dev/null
+++ b/src/ui/panelPositionControls.js
@@ -0,0 +1,260 @@
+/** Own panel position preferences, viewport clamping and drag listeners. */
+const PANEL_LAYOUT_STORAGE_VERSION = 'v6';
+const PANEL_POSITION_STORAGE_VERSION = 'v8';
+const PANEL_Z_BASE = 100;
+const PANEL_Z_MAX = 139;
+export class PanelPositionControls {
+ constructor({ syncPanelCollapseButton, layoutRightPanels, syncCctvPanelViewport, showToast }) {
+ this._syncPanelCollapseButton = syncPanelCollapseButton;
+ this._layoutRightPanels = layoutRightPanels;
+ this._syncCctvPanelViewport = syncCctvPanelViewport;
+ this._showToast = showToast;
+ this._ppToggles = document.getElementById('pp-toggles');
+ this._panelZCounter = PANEL_Z_BASE + 10;
+ this._draggableResizeObserver = null;
+ this._cancelDrag = null;
+ this.removers = [];
+ this.destroyed = false;
+ }
+ listen(target, type, callback) {
+ const listener = (event) => { if (!this.destroyed) callback(event); };
+ target.addEventListener(type, listener);
+ this.removers.push(() => target.removeEventListener(type, listener));
+ }
+ _reclampDraggablePanels() {
+ const el = this._ppToggles;
+ if (!el || !el.style.top || el.style.top === 'auto') return;
+ const top = parseInt(el.style.top, 10);
+ if (!Number.isFinite(top)) return;
+ el.style.top = `${this._clampToViewport(0, top, el).top}px`;
+ this._pinPanelToRight(el);
+ }
+
+ _maybeNotifyLayoutReset() {
+ try {
+ const marker = `godsEyeView.${PANEL_POSITION_STORAGE_VERSION}.layoutResetNotified`;
+ if (localStorage.getItem(marker)) return;
+ localStorage.setItem(marker, '1');
+ const hadOldPositions = Object.keys(localStorage)
+ .some((key) => key.startsWith('godsEyeView.v6.panelPos.'));
+ if (hadOldPositions) {
+ this._showToast('Panel layout updated — positions reset to new defaults');
+ }
+ } catch {
+ // storage unavailable
+ }
+ }
+
+ _initPanelDrag() {
+ const dragSpecs = [
+ {
+ id: 'pp-toggles',
+ panel: this._ppToggles,
+ handle: this._ppToggles?.querySelector('.panel-drag-handle.compact'),
+ },
+ ].filter(Boolean);
+
+ for (const spec of dragSpecs) {
+ if (!spec.panel || !spec.handle) continue;
+ this._restorePanelPosition(spec.id, spec.panel);
+ this._makePanelDraggable(spec.id, spec.panel, spec.handle);
+ }
+ // Keep a positioned panel on-screen when its HEIGHT changes after restore — it expands to its
+ // full row set a frame or two later, so the restore-time clamp used a stale (shorter) height and
+ // the panel could still hang off the bottom (audit U2). Re-clamp on every size change.
+ if (this._ppToggles && typeof ResizeObserver !== 'undefined') {
+ this._draggableResizeObserver = new ResizeObserver(() => this._reclampDraggablePanels());
+ this._draggableResizeObserver.observe(this._ppToggles);
+ }
+ }
+
+ _panelStorageKey(panelId) {
+ return `godsEyeView.${PANEL_POSITION_STORAGE_VERSION}.panelPos.${panelId}`;
+ }
+
+ _panelCollapseStorageKey(panelId) {
+ return `godsEyeView.${PANEL_LAYOUT_STORAGE_VERSION}.panelCollapsed.${panelId}`;
+ }
+
+ _restorePanelCollapsedState(panelId, { allowStored = true } = {}) {
+ const panelEl = document.getElementById(panelId);
+ if (!panelEl) return;
+ let collapsed = panelEl.classList.contains('collapsed');
+ let stored = null;
+ if (allowStored) {
+ try {
+ stored = localStorage.getItem(this._panelCollapseStorageKey(panelId));
+ if (stored === '1') collapsed = true;
+ if (stored === '0') collapsed = false;
+ } catch {
+ // storage unavailable
+ }
+ }
+ // DISPLAY starts COLLAPSED for a first-time visitor, then respects the
+ // user's persisted choice like every other panel.
+ //
+ // It used to start expanded, to advertise the HUD / DETECT / 3D toggles.
+ // That reason expired when those became ON by default: the rail now opens
+ // to offer controls for things already happening, while competing with the
+ // first-run mission card for the one first impression there is. A stored
+ // choice still wins in both directions, so anyone who opens it keeps it.
+ if (panelId === 'pp-toggles' && stored === null) collapsed = true;
+ panelEl.classList.toggle('collapsed', collapsed);
+ this._syncPanelCollapseButton(panelEl);
+ }
+
+ _savePanelCollapsedState(panelId, collapsed) {
+ try {
+ localStorage.setItem(this._panelCollapseStorageKey(panelId), collapsed ? '1' : '0');
+ } catch {
+ // storage unavailable
+ }
+ }
+
+ _pinPanelToRight(panelEl) {
+ if (!panelEl) return;
+ const rect = panelEl.getBoundingClientRect();
+ const rightOffset = Math.max(6, Math.round(window.innerWidth - rect.right));
+ panelEl.style.right = `${rightOffset}px`;
+ panelEl.style.left = 'auto';
+ }
+
+ _restorePanelPosition(panelId, panelEl) {
+ try {
+ const raw = localStorage.getItem(this._panelStorageKey(panelId));
+ if (!raw) return;
+ const pos = JSON.parse(raw);
+ if (!pos || typeof pos.left !== 'number' || typeof pos.top !== 'number') return;
+ // Clamp to the viewport: a position saved at one window size would otherwise land off-screen at
+ // another (audit U2 — observed a panel at x:-192). The drag handler clamps; restore must too.
+ const { left, top } = this._clampToViewport(Math.round(pos.left), Math.round(pos.top), panelEl);
+ panelEl.style.left = `${left}px`;
+ panelEl.style.top = `${top}px`;
+ panelEl.style.right = 'auto';
+ panelEl.style.bottom = 'auto';
+ if (panelId === 'pp-toggles') {
+ this._pinPanelToRight(panelEl);
+ }
+ } catch {
+ // ignore malformed saved panel position
+ }
+ }
+
+ _clampToViewport(left, top, panelEl) {
+ const rect = panelEl.getBoundingClientRect();
+ const maxLeft = Math.max(6, window.innerWidth - rect.width - 6);
+ const maxTop = Math.max(6, window.innerHeight - rect.height - 6);
+ return {
+ left: Math.max(6, Math.min(maxLeft, left)),
+ top: Math.max(6, Math.min(maxTop, top)),
+ };
+ }
+
+ _savePanelPosition(panelId, panelEl) {
+ const rect = panelEl.getBoundingClientRect();
+ try {
+ localStorage.setItem(this._panelStorageKey(panelId), JSON.stringify({
+ left: Math.round(rect.left),
+ top: Math.round(rect.top),
+ }));
+ } catch {
+ // storage unavailable
+ }
+ }
+
+ _promotePanelZ(panelEl) {
+ this._panelZCounter += 1;
+ if (this._panelZCounter > PANEL_Z_MAX) {
+ const promoted = [...document.querySelectorAll('.panel-draggable')]
+ .filter((el) => el.style.zIndex)
+ .sort((a, b) => Number(a.style.zIndex) - Number(b.style.zIndex));
+ let z = PANEL_Z_BASE + 1;
+ for (const el of promoted) {
+ el.style.zIndex = String(z);
+ z += 1;
+ }
+ this._panelZCounter = z;
+ }
+ panelEl.style.zIndex = String(this._panelZCounter);
+ }
+
+ _makePanelDraggable(panelId, panelEl, handleEl) {
+ // Z-order promotion: bring clicked panel to front of the stacking context
+ this.listen(panelEl, 'pointerdown', () => {
+ this._promotePanelZ(panelEl);
+ });
+
+ this.listen(handleEl, 'pointerdown', (event) => {
+ if (event.button !== 0) return;
+ if (event.target.closest('.panel-collapse-btn')) return;
+ if (event.target.closest('input, select, option, button:not(.panel-collapse-btn)')) return;
+
+ this._cancelDrag?.();
+ event.preventDefault();
+ const rect = panelEl.getBoundingClientRect();
+ const startX = event.clientX;
+ const startY = event.clientY;
+ const offsetX = startX - rect.left;
+ const offsetY = startY - rect.top;
+
+ panelEl.style.left = `${rect.left}px`;
+ panelEl.style.top = `${rect.top}px`;
+ panelEl.style.right = 'auto';
+ panelEl.style.bottom = 'auto';
+ panelEl.classList.add('panel-dragging');
+ this._promotePanelZ(panelEl);
+
+ const onMove = (moveEvent) => {
+ const nextLeftRaw = moveEvent.clientX - offsetX;
+ const nextTopRaw = moveEvent.clientY - offsetY;
+ const maxLeft = Math.max(6, window.innerWidth - rect.width - 6);
+ const maxTop = Math.max(6, window.innerHeight - rect.height - 6);
+ const nextLeft = Math.max(6, Math.min(maxLeft, nextLeftRaw));
+ const nextTop = Math.max(6, Math.min(maxTop, nextTopRaw));
+ panelEl.style.left = `${nextLeft}px`;
+ panelEl.style.top = `${nextTop}px`;
+ if (panelId === 'pp-toggles') {
+ this._layoutRightPanels();
+ }
+ if (panelId === 'cctv-panel') {
+ this._syncCctvPanelViewport();
+ }
+ };
+
+ const cancel = () => {
+ panelEl.classList.remove('panel-dragging');
+ window.removeEventListener('pointermove', onMove);
+ window.removeEventListener('pointerup', onUp);
+ window.removeEventListener('pointercancel', onUp);
+ this._cancelDrag = null;
+ };
+ const onUp = () => {
+ cancel();
+ panelEl.classList.remove('panel-dragging');
+ window.removeEventListener('pointermove', onMove);
+ window.removeEventListener('pointerup', onUp);
+ window.removeEventListener('pointercancel', onUp);
+ if (panelId === 'pp-toggles') {
+ this._pinPanelToRight(panelEl);
+ }
+ this._savePanelPosition(panelId, panelEl);
+ if (panelId === 'cctv-panel') {
+ this._syncCctvPanelViewport();
+ }
+ };
+
+ this._cancelDrag = cancel;
+ window.addEventListener('pointermove', onMove);
+ window.addEventListener('pointerup', onUp);
+ window.addEventListener('pointercancel', onUp);
+ });
+ }
+ destroy() {
+ if (this.destroyed) return;
+ this.destroyed = true;
+ this._cancelDrag?.();
+ for (const remove of this.removers.splice(0)) remove();
+ this._draggableResizeObserver?.disconnect();
+ this._draggableResizeObserver = null;
+ }
+}
diff --git a/src/ui/recordingControls.js b/src/ui/recordingControls.js
new file mode 100644
index 000000000..9efbf8189
--- /dev/null
+++ b/src/ui/recordingControls.js
@@ -0,0 +1,74 @@
+/** Own recording chrome, safe frames and the pre-recording HUD snapshot. */
+export class RecordingControls {
+ constructor({ syncShareState }) {
+ this._syncShareState = syncShareState;
+ this.destroyed = false;
+ this._recordingMode = false;
+ this._recordingConfig = { hidePanels: true, hudMode: 'minimal', safeFrame: '16:9' };
+ this._preRecordingHudState = null;
+ this._safeFrameOverlay = document.getElementById('safe-frame-overlay');
+ this._safeFrameBox = document.getElementById('safe-frame-box');
+ this._hudLayoutSelect = document.getElementById('hud-layout-select');
+ this._hudBtn = document.getElementById('hud-toggle');
+ this.hud = null;
+ }
+ _initRecordingOverlay() {
+ if (this.destroyed) return;
+ if (!this._safeFrameOverlay || !this._safeFrameBox) return;
+ this._safeFrameOverlay.classList.remove('active', 'ratio-9-16', 'ratio-16-9');
+ }
+
+ setRecordingMode(enabled, options = {}) {
+ if (this.destroyed) return;
+ const { hidePanels = true, hudMode = 'minimal', safeFrame = '16:9' } = options;
+ this._recordingMode = !!enabled;
+ this._recordingConfig = { hidePanels, hudMode, safeFrame };
+
+ document.body.classList.toggle('recording-mode', this._recordingMode && hidePanels);
+
+ if (this._safeFrameOverlay) {
+ this._safeFrameOverlay.classList.remove('ratio-9-16', 'ratio-16-9');
+ this._safeFrameOverlay.classList.toggle('active', this._recordingMode);
+ this._safeFrameOverlay.classList.add(safeFrame === '9:16' ? 'ratio-9-16' : 'ratio-16-9');
+ }
+
+ if (this._recordingMode) {
+ // Snapshot the user's HUD state once per recording session so exit can
+ // restore it (re-entrant calls must not capture mid-recording state).
+ if (!this._preRecordingHudState) {
+ this._preRecordingHudState = {
+ mode: this.hud.getMode(),
+ variant: this.hud.getVariant(),
+ };
+ }
+ if (hudMode === 'off') {
+ this.hud.setMode('off');
+ } else if (hudMode === 'full' || hudMode === 'minimal') {
+ this.hud.setMode('on');
+ this.hud.setVariant(hudMode === 'minimal' ? 'minimal' : 'tactical');
+ if (this._hudLayoutSelect) this._hudLayoutSelect.value = this.hud.getVariant();
+ } else {
+ this.hud.setMode('auto');
+ }
+ } else {
+ const saved = this._preRecordingHudState;
+ this._preRecordingHudState = null;
+ if (saved) {
+ this.hud.setVariant(saved.variant);
+ if (this._hudLayoutSelect) this._hudLayoutSelect.value = this.hud.getVariant();
+ }
+ this.hud.setMode(saved ? saved.mode : 'auto');
+ if (this._safeFrameOverlay) {
+ this._safeFrameOverlay.classList.remove('active', 'ratio-9-16', 'ratio-16-9');
+ }
+ }
+ this._hudBtn.classList.toggle('active', this.hud.visible);
+ this._syncShareState();
+ }
+ destroy() {
+ if (this.destroyed) return;
+ // Restore an active session while its supplied HUD is still alive.
+ if (this._recordingMode) this.setRecordingMode(false);
+ this.destroyed = true;
+ }
+}
diff --git a/src/ui/shellElements.js b/src/ui/shellElements.js
new file mode 100644
index 000000000..db79cf301
--- /dev/null
+++ b/src/ui/shellElements.js
@@ -0,0 +1,141 @@
+/** Resolve the fixed DOM nodes used to assemble the application controls. */
+export function readShellElements(document = globalThis.document) {
+ return {
+ _rightPanelStack: document.getElementById('right-context-rail'),
+ _styleIndicator: document.getElementById('active-style-name'),
+ _sliderPanel: document.getElementById('param-slider-panel'),
+ _sliderContainer: document.getElementById('param-sliders'),
+ _ppToggles: document.getElementById('pp-toggles'),
+ _bloomBtn: document.getElementById('bloom-toggle'),
+ _bloomSliderRow: document.getElementById('bloom-slider-row'),
+ _bloomSlider: document.getElementById('bloom-intensity-slider'),
+ _bloomSliderValue: document.getElementById('bloom-intensity-value'),
+ _sharpenBtn: document.getElementById('sharpen-toggle'),
+ _sharpenSliderRow: document.getElementById('sharpen-slider-row'),
+ _sharpenSlider: document.getElementById('sharpen-intensity-slider'),
+ _sharpenSliderValue: document.getElementById('sharpen-intensity-value'),
+ _hudBtn: document.getElementById('hud-toggle'),
+ _hudLayoutRow: document.getElementById('hud-layout-row'),
+ _hudLayoutSelect: document.getElementById('hud-layout-select'),
+ _detectionSliderRow: document.getElementById('detection-slider-row'),
+ _detectionDensitySlider: document.getElementById('detection-density-slider'),
+ _detectionDensityValue: document.getElementById('detection-density-value'),
+ _detectionAllocationRow: document.getElementById('detection-allocation-row'),
+ _detectionFadeRow: document.getElementById('detection-fade-row'),
+ _detectionFadeSlider: document.getElementById('detection-fade-slider'),
+ _detectionFadeValue: document.getElementById('detection-fade-value'),
+ _detectionOpacityRow: document.getElementById('detection-opacity-row'),
+ _detectionOpacitySlider: document.getElementById('detection-opacity-slider'),
+ _detectionOpacityValue: document.getElementById('detection-opacity-value'),
+ _celestialBtn: document.getElementById('celestial-toggle'),
+ _scopeBtn: document.getElementById('scope-toggle'),
+ _scopeFeatherSlider: document.getElementById('scope-feather-slider'),
+ _scopeFeatherValue: document.getElementById('scope-feather-value'),
+ _mapStackChips: document.getElementById('map-stack-chips'),
+ _mapStackStatus: document.getElementById('map-stack-status'),
+ _cleanViewBtn: document.getElementById('clean-view-toggle'),
+ _cleanViewExitBtn: document.getElementById('clean-view-exit'),
+ _dataPanel: document.getElementById('data-panel'),
+ _scenePanel: document.getElementById('scene-panel'),
+ _cctvPanel: document.getElementById('cctv-panel'),
+ _radioPanel: document.getElementById('radio-panel'),
+ _contextRadioDock: document.getElementById('context-radio-dock'),
+ _contextRadioToggleBtn: document.getElementById('context-radio-toggle-btn'),
+ _contextRadioMini: document.getElementById('context-radio-mini'),
+ _contextRadioMiniEnableBtn: document.getElementById('context-radio-mini-enable-btn'),
+ _contextRadioDetailsBtn: document.getElementById('context-radio-details-btn'),
+ _contextRadioMiniCloseBtn: document.getElementById('context-radio-mini-close-btn'),
+ _contextRadioMiniStation: document.getElementById('context-radio-mini-station'),
+ _contextRadioMiniPrevBtn: document.getElementById('context-radio-mini-prev-btn'),
+ _contextRadioMiniPlayBtn: document.getElementById('context-radio-mini-play-btn'),
+ _contextRadioMiniNextBtn: document.getElementById('context-radio-mini-next-btn'),
+ _contextRadioMiniVolume: document.getElementById('context-radio-mini-volume'),
+ _contextRadioMiniVolumeValue: document.getElementById('context-radio-mini-volume-value'),
+ _cockpitUtilityControls: document.getElementById('cockpit-utility-controls'),
+ _cockpitDisplayToggleBtn: document.getElementById('cockpit-display-toggle-btn'),
+ _cockpitDisplayPanel: document.getElementById('cockpit-display-panel'),
+ _cockpitRadioToggleBtn: document.getElementById('cockpit-radio-toggle-btn'),
+ _cockpitRadioPanel: document.getElementById('cockpit-radio-panel'),
+ _cockpitRadioEnableBtn: document.getElementById('cockpit-radio-enable-btn'),
+ _cockpitRadioStation: document.getElementById('cockpit-radio-station'),
+ _cockpitRadioPrevBtn: document.getElementById('cockpit-radio-prev-btn'),
+ _cockpitRadioPlayBtn: document.getElementById('cockpit-radio-play-btn'),
+ _cockpitRadioNextBtn: document.getElementById('cockpit-radio-next-btn'),
+ _cockpitRadioVolume: document.getElementById('cockpit-radio-volume'),
+ _cockpitRadioVolumeValue: document.getElementById('cockpit-radio-volume-value'),
+ _radioLayerState: document.getElementById('radio-layer-state'),
+ _radioEnableBtn: document.getElementById('radio-enable-btn'),
+ _radioFilter: document.getElementById('radio-filter'),
+ _radioStationName: document.getElementById('radio-station-name'),
+ _radioStationMeta: document.getElementById('radio-station-meta'),
+ _radioStationTags: document.getElementById('radio-station-tags'),
+ _radioTuner: document.getElementById('radio-tuner'),
+ _radioTunerSlider: document.getElementById('radio-tuner-slider'),
+ _radioTunerNeedle: document.getElementById('radio-tuner-needle'),
+ _radioTunerBandLabel: document.getElementById('radio-tuner-band-label'),
+ _radioTunerValue: document.getElementById('radio-tuner-value'),
+ _radioTunerStation: document.getElementById('radio-tuner-station'),
+ _radioPrevBtn: document.getElementById('radio-prev-btn'),
+ _radioPlayBtn: document.getElementById('radio-play-btn'),
+ _radioNextBtn: document.getElementById('radio-next-btn'),
+ _radioStopBtn: document.getElementById('radio-stop-btn'),
+ _radioVolume: document.getElementById('radio-volume'),
+ _radioVolumeValue: document.getElementById('radio-volume-value'),
+ _radioPlaybackState: document.getElementById('radio-playback-state'),
+ _radioStationHomepage: document.getElementById('radio-station-homepage'),
+ _globalContextFlightsBtn: document.getElementById('global-context-flights-btn'),
+ _globalContextMissionsBtn: document.getElementById('global-context-missions-btn'),
+ _contextModeStandby: document.getElementById('context-mode-standby'),
+ _contextFlightsView: document.getElementById('context-flights-view'),
+ _contextMissionsView: document.getElementById('context-missions-view'),
+ _installationsSearchBtn: document.getElementById('installations-search-btn'),
+ _leftPanelStack: document.getElementById('left-panel-stack'),
+ _cctvEnableBtn: document.getElementById('cctv-enable-btn'),
+ _cctvNearestBtn: document.getElementById('cctv-nearest-btn'),
+ _cctvPrevBtn: document.getElementById('cctv-prev-btn'),
+ _cctvNextBtn: document.getElementById('cctv-next-btn'),
+ _cctvSelect: document.getElementById('cctv-camera-select'),
+ _cctvFocusBtn: document.getElementById('cctv-focus-btn'),
+ _cctvCoverageBtn: document.getElementById('cctv-coverage-btn'),
+ _cctvAutoHopBtn: document.getElementById('cctv-auto-hop-btn'),
+ _cctvProjectionBtn: document.getElementById('cctv-projection-btn'),
+ _cctvQualityChip: document.getElementById('cctv-quality-chip'),
+ _cctvAdjustBtn: document.getElementById('cctv-adjust-btn'),
+ _cctvCalReadout: document.getElementById('cctv-cal-readout'),
+ _cctvCalibSaveBtn: document.getElementById('cctv-calib-save-btn'),
+ _cctvCalibResetBtn: document.getElementById('cctv-calib-reset-btn'),
+ _cctvFrame: document.getElementById('cctv-frame'),
+ _cctvFrameWrap: document.getElementById('cctv-frame-wrap'),
+ _cctvSourceBadge: document.getElementById('cctv-source-badge'),
+ _cctvMeta: document.getElementById('cctv-meta'),
+ _cctvSummary: document.getElementById('cctv-summary'),
+ _shareBtn: document.getElementById('share-btn'),
+ _clearSelectedLayersBtn: document.getElementById('clear-selected-layers'),
+ _globalLoadingStatus: document.getElementById('global-loading-status'),
+ _globalLoadingLabel: document.getElementById('global-loading-label'),
+ _globalLoadingDetail: document.getElementById('global-loading-detail'),
+ _resetGlobeBtn: document.getElementById('reset-globe-view'),
+ _cockpitResetGlobeBtn: document.getElementById('cockpit-reset-globe'),
+ _styleButtons: document.getElementById('style-buttons'),
+ _trafficSyncChip: document.getElementById('traffic-sync-chip'),
+ _trafficSyncLabel: document.getElementById('traffic-sync-label'),
+ _trafficSyncProgress: document.getElementById('traffic-sync-progress'),
+ _cctvSyncChip: document.getElementById('cctv-sync-chip'),
+ _cctvSyncLabel: document.getElementById('cctv-sync-label'),
+ _cctvSyncProgress: document.getElementById('cctv-sync-progress'),
+ _toast: document.getElementById('toast'),
+ _locationSearch: document.getElementById('location-search'),
+ _searchToggle: document.getElementById('search-toggle'),
+ _locationPills: document.getElementById('location-pills'),
+ _poiRow: document.getElementById('poi-row'),
+ _locationBarDivider: document.getElementById('location-bar-divider'),
+ _styleMiniValue: document.getElementById('style-mini-value'),
+ _locationMiniCity: document.getElementById('location-mini-city'),
+ _locationMiniPoi: document.getElementById('location-mini-poi'),
+ _safeFrameOverlay: document.getElementById('safe-frame-overlay'),
+ _safeFrameBox: document.getElementById('safe-frame-box'),
+ _detectionBtn: document.getElementById('detection-toggle'),
+ _models3dBtn: document.getElementById('models3d-toggle'),
+ _models3dModeRow: document.getElementById('models3d-mode-row'),
+ };
+}
diff --git a/src/ui/shellFeedback.js b/src/ui/shellFeedback.js
new file mode 100644
index 000000000..cb36771dd
--- /dev/null
+++ b/src/ui/shellFeedback.js
@@ -0,0 +1,168 @@
+/** Own loading notices, traffic status, toast timing and visibility cleanup. */
+import { aggregateLayerLoading, createGlobalStatusNotice, createLoadingFeedbackState, createTrafficSyncFeedbackState, presentGlobalLoadingStatus, reduceLoadingFeedback, reduceTrafficSyncFeedback } from '../loadingFeedback.js';
+import { setSplitFlapText, disposeSplitFlap } from '../splitFlap.js';
+export class ShellFeedback {
+ constructor({ readLayers }) {
+ this.readLayers = readLayers;
+ this.destroyed = false;
+ this._loadingFeedbackState = createLoadingFeedbackState();
+ this._trafficSyncFeedbackState = createTrafficSyncFeedbackState();
+ this._loadingFeedbackEvent = null;
+ this._globalStatusNotice = null;
+ this._loadingFeedbackTicker = this._trafficChipTicker = this._toastTimer = null;
+ this._loadingVisibilityHandler = null;
+ this._lastLoadingFeedbackUpdateAt = 0;
+ this._globalLoadingStatus = document.getElementById('global-loading-status');
+ this._globalLoadingLabel = document.getElementById('global-loading-label');
+ this._globalLoadingDetail = document.getElementById('global-loading-detail');
+ this._trafficSyncChip = document.getElementById('traffic-sync-chip');
+ this._trafficSyncLabel = document.getElementById('traffic-sync-label');
+ this._trafficSyncProgress = document.getElementById('traffic-sync-progress');
+ this._toast = document.getElementById('toast');
+ }
+ observeVisibility() {
+ if (this.destroyed || this._loadingVisibilityHandler) return;
+ this._loadingVisibilityHandler = () => {
+ if (!document.hidden) this._updateGlobalLoadingFeedback();
+ else this._stopLoadingFeedbackTicker();
+ };
+ document.addEventListener('visibilitychange', this._loadingVisibilityHandler);
+ }
+ _updateTrafficSyncChip(forceShow = false, now = performance.now()) {
+ if (this.destroyed) return;
+ if (!this._trafficSyncChip || !this._trafficSyncLabel || !this._trafficSyncProgress) return;
+ const layers = this.readLayers();
+ const traffic = Array.isArray(layers) ? layers.find((layer) => layer.id === 'traffic') : null;
+ this._trafficSyncFeedbackState = reduceTrafficSyncFeedback(
+ this._trafficSyncFeedbackState,
+ { enabled: traffic?.enabled === true, stats: traffic?.stats || {}, forceShow },
+ now,
+ );
+ const presentation = this._trafficSyncFeedbackState;
+ // setSplitFlapText carries the same unchanged-text guard internally, and
+ // the flap keeps textContent equal to the settled label throughout, so
+ // this stays a no-op on the repeat ticks exactly as it did before.
+ if (presentation.label) setSplitFlapText(this._trafficSyncLabel, presentation.label);
+ // Written on every change INCLUDING the empty settled value — the reducer
+ // clears the progress number once the sync lands, and a truthiness guard
+ // here would strand the last "..." beside the settled label.
+ if (this._trafficSyncProgress.textContent !== presentation.progressText) {
+ this._trafficSyncProgress.textContent = presentation.progressText;
+ }
+ this._trafficSyncChip.classList.toggle('visible', presentation.visible);
+ }
+
+ _updateGlobalLoadingFeedback(now = performance.now()) {
+ if (this.destroyed) return;
+ if (!this._globalLoadingStatus) return;
+ const summary = aggregateLayerLoading(this.readLayers() || []);
+ this._loadingFeedbackState = reduceLoadingFeedback(
+ this._loadingFeedbackState,
+ summary,
+ now,
+ this._loadingFeedbackEvent,
+ );
+ this._loadingFeedbackEvent = null;
+ const presentation = presentGlobalLoadingStatus(
+ this._globalStatusNotice,
+ this._loadingFeedbackState,
+ summary,
+ now,
+ );
+ if (this._globalStatusNotice?.persistent !== true
+ && Number.isFinite(this._globalStatusNotice?.hideAt)
+ && now >= this._globalStatusNotice.hideAt) {
+ this._globalStatusNotice = null;
+ }
+ // Loading phases and universal notices both have time-driven transitions.
+ // Compute this after arbitration: a queued finite notice starts its dwell
+ // only on its first visible frame, then keeps the ticker alive to expiry.
+ const noticeNeedsTicker = Number.isFinite(this._globalStatusNotice?.hideAt);
+ if (this._loadingFeedbackState?.phase !== 'idle' || noticeNeedsTicker) {
+ this._armLoadingFeedbackTicker();
+ }
+ this._globalLoadingStatus.hidden = !presentation;
+ if (!presentation) {
+ delete this._globalLoadingStatus.dataset.state;
+ return;
+ }
+ this._globalLoadingStatus.dataset.state = presentation.state;
+ // Split-flap the LABEL only ("LOADING LIVE DATA" -> "LOAD COMPLETE").
+ // setSplitFlapText is a no-op when the text is unchanged, which matters
+ // here: this runs on every 60 ms and 500 ms tick. The detail line is the
+ // live layer roster inside an ellipsised, width-capped span — flapping a
+ // list that churns as layers join would be noise, not delight.
+ setSplitFlapText(this._globalLoadingLabel, presentation.label);
+ this._globalLoadingDetail.textContent = presentation.detail;
+ }
+
+ _showGlobalStatusNotice(message, options = {}) {
+ if (this.destroyed) return;
+ const now = performance.now();
+ this._globalStatusNotice = createGlobalStatusNotice(message, now, options);
+ this._updateGlobalLoadingFeedback(now);
+ }
+
+ _startTrafficChipTicker() {
+ if (this.destroyed) return;
+ if (this._trafficChipTicker) return;
+ this._trafficChipTicker = setInterval(() => {
+ if (document.hidden) return;
+ this._updateTrafficSyncChip();
+ this._updateGlobalLoadingFeedback();
+ }, 500);
+ }
+
+ _armLoadingFeedbackTicker() {
+ if (this.destroyed) return;
+ // Never arm behind a hidden tab: the reducer cannot usefully advance a
+ // chip nobody can see, and the old `return` INSIDE the interval left the
+ // 60ms timer scheduled for the entire hidden period (a batch completing
+ // while hidden could never clear it — the idle check sat behind the
+ // hidden guard). visibilitychange resamples and re-arms on return.
+ if (this._loadingFeedbackTicker || document.hidden) return;
+ this._loadingFeedbackTicker = setInterval(() => {
+ if (document.hidden) {
+ this._stopLoadingFeedbackTicker();
+ return;
+ }
+ const now = performance.now();
+ this._lastLoadingFeedbackUpdateAt = now;
+ this._updateGlobalLoadingFeedback(now);
+ const noticeNeedsTicker = Number.isFinite(this._globalStatusNotice?.hideAt);
+ if (this._loadingFeedbackState?.phase === 'idle' && !noticeNeedsTicker) {
+ this._stopLoadingFeedbackTicker();
+ }
+ }, 60);
+ }
+
+ _stopLoadingFeedbackTicker() {
+ if (!this._loadingFeedbackTicker) return;
+ clearInterval(this._loadingFeedbackTicker);
+ this._loadingFeedbackTicker = null;
+ }
+
+ _showToast(message) {
+ if (this.destroyed) return;
+ this._toast.textContent = message;
+ this._toast.classList.add('visible');
+ clearTimeout(this._toastTimer);
+ this._toastTimer = setTimeout(() => {
+ this._toast.classList.remove('visible');
+ }, 2000);
+ }
+ destroy() {
+ if (this.destroyed) return;
+ this.destroyed = true;
+ this._stopLoadingFeedbackTicker();
+ clearInterval(this._trafficChipTicker);
+ clearTimeout(this._toastTimer);
+ this._trafficChipTicker = this._toastTimer = null;
+ if (this._loadingVisibilityHandler) document.removeEventListener('visibilitychange', this._loadingVisibilityHandler);
+ this._loadingVisibilityHandler = null;
+ disposeSplitFlap(this._globalLoadingLabel);
+ disposeSplitFlap(this._trafficSyncLabel);
+ this._toast?.classList.remove('visible');
+ if (this._globalLoadingStatus) this._globalLoadingStatus.hidden = true;
+ }
+}
diff --git a/src/ui/shellLifecycle.test.mjs b/src/ui/shellLifecycle.test.mjs
new file mode 100644
index 000000000..8d7f508a3
--- /dev/null
+++ b/src/ui/shellLifecycle.test.mjs
@@ -0,0 +1,139 @@
+import test from 'node:test';
+import assert from 'node:assert/strict';
+import { UiLifetime } from './uiLifetime.js';
+import { PanelLayoutController } from './panelLayoutController.js';
+import { PanelPositionControls } from './panelPositionControls.js';
+import { ShellFeedback } from './shellFeedback.js';
+import { RecordingControls } from './recordingControls.js';
+
+function fixture() {
+ const saved = Object.fromEntries(['document', 'window', 'localStorage', 'requestAnimationFrame', 'cancelAnimationFrame', 'setTimeout', 'clearTimeout', 'setInterval', 'clearInterval'].map((key) => [key, globalThis[key]]));
+ const frames = new Map(), timers = new Map();
+ let next = 0;
+ const element = () => {
+ const classes = new Set();
+ return Object.assign(new EventTarget(), {
+ style: {}, dataset: {}, hidden: false, textContent: '',
+ classList: {
+ add: (...names) => names.forEach((name) => classes.add(name)),
+ remove: (...names) => names.forEach((name) => classes.delete(name)),
+ contains: (name) => classes.has(name),
+ toggle: (name, active) => active ? classes.add(name) : classes.delete(name),
+ },
+ querySelector: () => null, querySelectorAll: () => [], closest: () => null,
+ getBoundingClientRect: () => ({ left: 20, top: 30, width: 100, height: 80 }),
+ });
+ };
+ const nodes = new Map(['left-panel-stack', 'right-context-rail', 'pp-toggles', 'toast', 'global-loading-status', 'global-loading-detail', 'safe-frame-overlay', 'safe-frame-box', 'hud-toggle', 'hud-layout-select'].map((id) => [id, element()]));
+ globalThis.document = Object.assign(new EventTarget(), { hidden: false, getElementById: (id) => nodes.get(id) || null, querySelectorAll: () => [], body: element() });
+ globalThis.window = Object.assign(new EventTarget(), { innerWidth: 600, innerHeight: 400 });
+ const writes = [];
+ globalThis.localStorage = { setItem: (...args) => writes.push(args), getItem: () => null };
+ globalThis.requestAnimationFrame = (callback) => { frames.set(++next, callback); return next; };
+ globalThis.cancelAnimationFrame = (id) => frames.delete(id);
+ globalThis.setTimeout = globalThis.setInterval = (callback) => { timers.set(++next, callback); return next; };
+ globalThis.clearTimeout = globalThis.clearInterval = (id) => timers.delete(id);
+ return { frames, timers, nodes, element, writes, restore() { Object.assign(globalThis, saved); } };
+}
+
+test('UI lifetime revokes listeners and nested presentation work synchronously', () => {
+ const f = fixture();
+ try {
+ const owner = new UiLifetime(), target = new EventTarget();
+ let calls = 0;
+ owner.listen(target, 'change', () => calls++);
+ owner.frame(() => { calls++; owner.frame(() => calls++); });
+ owner.timeout(() => calls++, 100);
+ const retainedFrame = [...f.frames.values()][0];
+ owner.destroy(); owner.destroy();
+ target.dispatchEvent(new Event('change'));
+ retainedFrame();
+ owner.frame(() => calls++); owner.timeout(() => calls++, 1);
+ assert.equal(calls, 0);
+ assert.equal(f.frames.size + f.timers.size + owner.removers.size, 0);
+ } finally { f.restore(); }
+});
+
+test('one-time UI listeners and cancelled notice timers release their registrations', () => {
+ const f = fixture();
+ try {
+ const owner = new UiLifetime(), target = new EventTarget();
+ let calls = 0;
+ owner.listen(target, 'change', () => calls++, { once: true });
+ target.dispatchEvent(new Event('change')); target.dispatchEvent(new Event('change'));
+ owner.cancelTimeout(owner.timeout(() => calls++, 100));
+ assert.equal(calls, 1);
+ assert.equal(owner.removers.size + owner.timers.size + f.timers.size, 0);
+ owner.destroy();
+ } finally { f.restore(); }
+});
+
+test('panel layout coalesces each rail and cannot rearm after destruction', () => {
+ const f = fixture();
+ try {
+ let layouts = 0;
+ const owner = new PanelLayoutController({ readHud: () => ({}), scheduleCockpitLayout() {}, syncPanelCollapseButton() {}, readDisplayScrollTop: () => 0 });
+ owner._syncLeftPanelAdaptiveLayout = () => layouts++;
+ owner._scheduleLeftPanelLayout(); owner._scheduleLeftPanelLayout();
+ assert.equal(f.frames.size, 1);
+ owner._scheduleAdaptivePanelLayout({ settle: true });
+ assert.equal(f.frames.size, 2);
+ assert.equal(f.timers.size, 1);
+ const late = [...f.frames.values(), ...f.timers.values()];
+ owner.destroy(); owner.destroy();
+ late.forEach((callback) => callback());
+ owner._scheduleAdaptivePanelLayout({ settle: true });
+ assert.equal(layouts, 0);
+ assert.equal(f.frames.size + f.timers.size, 0);
+ } finally { f.restore(); }
+});
+
+test('panel disposal cancels a live drag without saving or accepting later pointer movement', () => {
+ const f = fixture();
+ try {
+ const owner = new PanelPositionControls({ syncPanelCollapseButton() {}, layoutRightPanels() {}, syncCctvPanelViewport() {}, showToast() {} });
+ const panel = f.element(), handle = f.element();
+ owner._makePanelDraggable('sample', panel, handle);
+ handle.dispatchEvent(Object.assign(new Event('pointerdown', { cancelable: true }), { button: 0, clientX: 30, clientY: 40 }));
+ assert.equal(panel.classList.contains('panel-dragging'), true);
+ owner.destroy();
+ const before = { ...panel.style };
+ window.dispatchEvent(Object.assign(new Event('pointermove'), { clientX: 500, clientY: 300 }));
+ window.dispatchEvent(new Event('pointerup'));
+ assert.deepEqual(panel.style, before);
+ assert.equal(panel.classList.contains('panel-dragging'), false);
+ assert.equal(owner.removers.length, 0);
+ assert.deepEqual(f.writes, []);
+ } finally { f.restore(); }
+});
+
+test('feedback disposal clears toast and polling work and rejects retained notices', () => {
+ const f = fixture();
+ try {
+ const owner = new ShellFeedback({ readLayers: () => [] });
+ owner.observeVisibility(); owner._startTrafficChipTicker(); owner._showToast('Saved');
+ assert.equal(f.timers.size, 2);
+ owner.destroy();
+ owner._showToast('Late'); owner._showGlobalStatusNotice('Late'); owner._startTrafficChipTicker();
+ document.dispatchEvent(new Event('visibilitychange'));
+ assert.equal(f.timers.size, 0);
+ assert.equal(f.nodes.get('toast').textContent, 'Saved');
+ assert.equal(f.nodes.get('toast').classList.contains('visible'), false);
+ assert.equal(f.nodes.get('global-loading-status').hidden, true);
+ } finally { f.restore(); }
+});
+
+test('recording restores the original HUD after repeated entry and revokes retained controls', () => {
+ const f = fixture();
+ try {
+ let mode = 'auto', variant = 'tactical';
+ const owner = new RecordingControls({ syncShareState() {} });
+ owner.hud = { getMode: () => mode, getVariant: () => variant, setMode: (value) => { mode = value; }, setVariant: (value) => { variant = value; }, visible: true };
+ owner.setRecordingMode(true, { hudMode: 'minimal', safeFrame: '9:16' });
+ owner.setRecordingMode(true, { hudMode: 'off' });
+ owner.destroy(); owner.setRecordingMode(true);
+ assert.equal(mode, 'auto'); assert.equal(variant, 'tactical');
+ assert.equal(document.body.classList.contains('recording-mode'), false);
+ assert.equal(f.nodes.get('safe-frame-overlay').classList.contains('active'), false);
+ } finally { f.restore(); }
+});
diff --git a/src/ui/styles.js b/src/ui/styles.js
new file mode 100644
index 000000000..80461b8de
--- /dev/null
+++ b/src/ui/styles.js
@@ -0,0 +1,2 @@
+/** Load the ordered application control stylesheet. */
+import '../../style.css';
diff --git a/src/ui/styles/cctv.css b/src/ui/styles/cctv.css
new file mode 100644
index 000000000..d786be7d1
--- /dev/null
+++ b/src/ui/styles/cctv.css
@@ -0,0 +1,338 @@
+/* ── CCTV Panel ─────────────────────────────── */
+#cctv-panel {
+ --panel-expanded-width: 360px;
+ position: fixed;
+ top: var(--left-stack-top);
+ left: var(--left-stack-x);
+ right: auto;
+ bottom: auto;
+ z-index: 100;
+ width: var(--panel-expanded-width);
+ max-height: calc(100vh - 24px);
+}
+
+#cctv-panel .panel-glow {
+ position: absolute;
+ inset: -18px;
+ background: radial-gradient(ellipse at center, rgba(0, 212, 255, 0.16) 0%, transparent 65%);
+ filter: blur(16px);
+ opacity: 0.25;
+ pointer-events: none;
+}
+
+.cctv-panel-inner {
+ position: relative;
+ background: var(--glass-bg);
+ border: 1px solid var(--glass-border);
+ border-radius: var(--panel-radius);
+ padding: 14px;
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+ max-height: calc(100vh - 24px);
+ overflow-y: auto;
+ scrollbar-width: thin;
+ scrollbar-color: rgba(0, 212, 255, 0.46) rgba(255, 255, 255, 0.06);
+ backdrop-filter: blur(24px) saturate(1.4);
+ -webkit-backdrop-filter: blur(24px) saturate(1.4);
+ box-shadow:
+ 0 8px 32px rgba(0, 0, 0, 0.5),
+ 0 0 0 1px rgba(255, 255, 255, 0.03) inset,
+ 0 1px 0 rgba(255, 255, 255, 0.06) inset;
+}
+
+.cctv-panel-inner::-webkit-scrollbar {
+ width: 8px;
+}
+
+.cctv-panel-inner::-webkit-scrollbar-track {
+ background: rgba(255, 255, 255, 0.04);
+ border-radius: 999px;
+}
+
+.cctv-panel-inner::-webkit-scrollbar-thumb {
+ background: linear-gradient(180deg, rgba(0, 212, 255, 0.6), rgba(0, 212, 255, 0.28));
+ border: 1px solid rgba(0, 212, 255, 0.4);
+ border-radius: 999px;
+}
+
+.cctv-controls {
+ display: flex;
+ gap: 8px;
+ margin-bottom: 0;
+}
+
+.cctv-calibration-block {
+ border: 1px solid rgba(255, 255, 255, 0.1);
+ border-radius: 9px;
+ padding: 8px 9px;
+ background: rgba(255, 255, 255, 0.02);
+}
+
+.cctv-calibration-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 8px;
+ margin-bottom: 7px;
+}
+
+.cctv-calibration-header .cctv-summary-label {
+ margin: 0;
+}
+
+/* Click-to-edit effective-pose readout (viewshed/gizmo design §3d): compact
+ value chips replace the seven offset sliders. */
+.cctv-cal-readout {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 5px;
+}
+
+.cctv-cal-value {
+ font-family: var(--font-mono);
+ font-size: 9px;
+ letter-spacing: 0.7px;
+ color: #91edff;
+ background: rgba(255, 255, 255, 0.04);
+ border: 1px solid rgba(255, 255, 255, 0.12);
+ border-radius: 7px;
+ padding: 4px 7px;
+ cursor: text;
+ transition: border-color 0.15s ease, background 0.15s ease;
+}
+
+.cctv-cal-value:hover:not(:disabled) {
+ border-color: rgba(0, 212, 255, 0.45);
+ background: rgba(0, 212, 255, 0.08);
+}
+
+.cctv-cal-input {
+ width: 58px;
+ font-family: var(--font-mono);
+ font-size: 9px;
+ letter-spacing: 0.7px;
+ color: var(--text-primary);
+ background: rgba(0, 212, 255, 0.1);
+ border: 1px solid rgba(0, 212, 255, 0.5);
+ border-radius: 4px;
+ padding: 1px 3px;
+ outline: none;
+ -moz-appearance: textfield;
+}
+
+.cctv-cal-input::-webkit-outer-spin-button,
+.cctv-cal-input::-webkit-inner-spin-button {
+ -webkit-appearance: none;
+ margin: 0;
+}
+
+.cctv-calibration-actions {
+ margin-top: 8px;
+}
+
+#cctv-panel input:disabled,
+#cctv-panel button:disabled,
+#cctv-panel select:disabled {
+ opacity: 0.45;
+}
+
+#cctv-camera-select {
+ flex: 1;
+ min-width: 0;
+ background: rgba(255, 255, 255, 0.06);
+ border: 1px solid rgba(255, 255, 255, 0.14);
+ border-radius: 7px;
+ color: var(--text-primary);
+ padding: 6px 8px;
+ font-family: var(--font-sans);
+ font-size: 12px;
+ outline: none;
+}
+
+#cctv-camera-select:focus-visible {
+ outline: 2px solid var(--text-primary);
+ outline-offset: -3px;
+}
+
+#cctv-camera-select:disabled {
+ opacity: 0.45;
+}
+
+#cctv-enable-btn.active,
+#cctv-coverage-btn.active,
+#cctv-auto-hop-btn.active,
+#cctv-projection-btn.active {
+ color: var(--accent);
+ border-color: var(--accent);
+ background: rgba(0, 212, 255, 0.14);
+}
+
+#cctv-quality-chip {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ min-width: 90px;
+ padding: 6px 8px;
+ border: 1px solid rgba(0, 212, 255, 0.2);
+ border-radius: 8px;
+ font-family: var(--font-mono);
+ font-size: 9px;
+ letter-spacing: 1px;
+ color: #8fe7ff;
+ background: rgba(0, 212, 255, 0.08);
+ text-transform: uppercase;
+}
+
+/* CAL badge states (cctv-v2 §3b, amended by LOCKED §9.2 — panel-only, no
+ in-world tint). Three visually distinct states: calibrated / curated /
+ raw-prior. */
+#cctv-quality-chip[data-cal-badge='calibrated'] {
+ color: #adffbf;
+ border-color: rgba(141, 255, 135, 0.42);
+ background: rgba(141, 255, 135, 0.12);
+}
+
+#cctv-quality-chip[data-cal-badge='curated'] {
+ color: #ffe6a2;
+ border-color: rgba(255, 217, 122, 0.35);
+ background: rgba(255, 217, 122, 0.1);
+}
+
+/* Unsaved live edits (save-gated persistence, viewshed design §3e). */
+#cctv-quality-chip[data-cal-badge='edited'] {
+ color: #ffd08a;
+ border-color: rgba(255, 176, 82, 0.5);
+ background: rgba(255, 176, 82, 0.14);
+}
+
+.cctv-frame-wrap {
+ position: relative;
+ border-radius: 10px;
+ overflow: hidden;
+ border: 1px solid rgba(255, 255, 255, 0.12);
+ background:
+ radial-gradient(circle at 20% 20%, rgba(0, 244, 255, 0.09), transparent 44%),
+ linear-gradient(180deg, rgba(8, 14, 19, 0.88), rgba(4, 7, 11, 0.96));
+ min-height: 150px;
+ /* .cctv-panel-inner is a scrolling column flex container, so the default
+ flex-shrink:1 squeezed this wrap down to its 150px floor while the 16:9
+ image inside is taller — and the wrap is overflow:hidden, which clipped
+ the bottom of the frame right back off. Never shrink the preview. */
+ flex-shrink: 0;
+}
+
+/* Lightweight loading shimmer while the active frame is fetching */
+.cctv-frame-wrap::after {
+ content: '';
+ position: absolute;
+ inset: 0;
+ background: linear-gradient(
+ 100deg,
+ transparent 24%,
+ rgba(0, 212, 255, 0.08) 44%,
+ rgba(170, 244, 255, 0.14) 50%,
+ rgba(0, 212, 255, 0.08) 56%,
+ transparent 76%
+ );
+ transform: translateX(-100%);
+ opacity: 0;
+ pointer-events: none;
+ transition: opacity 0.2s ease;
+}
+
+.cctv-frame-wrap.loading::after {
+ opacity: 1;
+ animation: cctv-frame-shimmer 1.4s linear infinite;
+}
+
+/* "Acquiring" caption only when no previous frame is showing underneath */
+.cctv-frame-wrap.loading:not(.has-frame)::before {
+ content: 'ACQUIRING FRAME';
+ position: absolute;
+ inset: 0;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-family: var(--font-mono);
+ font-size: 8px;
+ letter-spacing: 2.2px;
+ color: rgba(145, 237, 255, 0.62);
+ pointer-events: none;
+}
+
+@keyframes cctv-frame-shimmer {
+ to {
+ transform: translateX(100%);
+ }
+}
+
+#cctv-frame {
+ width: 100%;
+ /* A fixed 16:9 box with the frame CONTAINED inside it. Providers burn their
+ timestamp into a corner (TfL top-left, Austin bottom-left) and the old
+ 150px-tall box was ~2.2:1, so object-fit: cover ate ~18px off the top and
+ bottom — exactly where those stamps live (owner field test 2026-07-31).
+ Sources are not all 16:9 either (a TfL frame measures 352x288), so
+ `contain` is what actually guarantees nothing is cut; the ratio just keeps
+ the panel height stable as you switch cameras. */
+ aspect-ratio: 16 / 9;
+ height: auto;
+ object-fit: contain;
+ display: block;
+ opacity: 0;
+ transition: opacity 180ms ease;
+}
+
+#cctv-frame.active {
+ opacity: 1;
+}
+
+#cctv-meta {
+ font-family: var(--font-mono);
+ font-size: 9px;
+ letter-spacing: 1px;
+ color: var(--text-secondary);
+}
+
+#cctv-source-badge {
+ align-self: flex-start;
+ border: 1px solid rgba(0, 212, 255, 0.32);
+ border-radius: 999px;
+ background: rgba(0, 212, 255, 0.09);
+ color: #9defff;
+ font-family: var(--font-mono);
+ font-size: 8px;
+ letter-spacing: 1.3px;
+ padding: 4px 8px;
+}
+
+#cctv-source-badge[data-frame-state='loading'] {
+ color: #ffe59b;
+ border-color: rgba(255, 205, 92, 0.45);
+ background: rgba(255, 205, 92, 0.1);
+}
+
+#cctv-source-badge[data-frame-state='error'] {
+ color: #ffb0b0;
+ border-color: rgba(255, 102, 102, 0.5);
+ background: rgba(255, 72, 72, 0.11);
+}
+
+.cctv-summary-label {
+ font-family: var(--font-mono);
+ font-size: 8px;
+ letter-spacing: 1.7px;
+ color: var(--text-dim);
+}
+
+#cctv-summary {
+ min-height: 38px;
+ font-family: var(--font-mono);
+ font-size: 10px;
+ letter-spacing: 0.8px;
+ line-height: 1.45;
+ color: #a8f7ff;
+ text-shadow: 0 0 10px rgba(0, 212, 255, 0.18);
+}
+
diff --git a/src/ui/styles/cockpit.css b/src/ui/styles/cockpit.css
new file mode 100644
index 000000000..e7e3f5595
--- /dev/null
+++ b/src/ui/styles/cockpit.css
@@ -0,0 +1,1814 @@
+/* ── Aircraft Cockpit View ─────────────────── */
+#cockpit-entry {
+ position: fixed;
+ left: calc(50% + 270px);
+ bottom: 34px;
+ z-index: 151;
+ display: inline-flex;
+ align-items: center;
+ gap: 8px;
+ min-height: 38px;
+ padding: 0 12px;
+ border: 1px solid rgba(0, 220, 255, 0.5);
+ border-radius: 8px;
+ background: rgba(2, 12, 18, 0.9);
+ color: #dceeff;
+ font: 600 10px/1 var(--font-mono);
+ letter-spacing: 0.14em;
+ box-shadow: 0 0 18px rgba(0, 220, 255, 0.14);
+ cursor: pointer;
+}
+
+#cockpit-entry[hidden], #cockpit-hud[hidden] { display: none; }
+#cockpit-entry:hover, #cockpit-entry:focus-visible {
+ border-color: #00dcff;
+ color: #fff;
+ outline: none;
+}
+#cockpit-entry .material-symbols-outlined { color: #00dcff; font-size: 18px; }
+#cockpit-entry kbd {
+ padding: 3px 5px;
+ border: 1px solid rgba(220, 238, 255, 0.25);
+ border-radius: 4px;
+ color: rgba(220, 238, 255, 0.6);
+ font: inherit;
+}
+
+#cockpit-hud {
+ --cockpit-accent: #00dcff;
+ --cockpit-side-panel-width: min(340px, 28vw);
+ /* HUD bottom offset + tallest scaled telemetry block + 20px clear border. */
+ --cockpit-bottom-rail-safe: calc(clamp(84px, 11vh, 118px) + 100px);
+ position: fixed;
+ inset: 0;
+ z-index: 145;
+ overflow: hidden;
+ pointer-events: none;
+ color: #f4fbff;
+ font-family: var(--font-mono);
+ text-shadow: 0 0 10px color-mix(in srgb, var(--cockpit-accent) 60%, transparent), 0 1px 2px #000;
+ perspective: 920px;
+}
+#cockpit-hud[data-layer="military"] { --cockpit-accent: #ffb800; }
+.cockpit-visor-shell {
+ position: absolute;
+ inset: clamp(62px, 9vh, 90px) clamp(18px, 3vw, 48px) clamp(38px, 5vh, 56px);
+ transform-style: preserve-3d;
+ perspective: 880px;
+}
+.cockpit-roll-arc {
+ position: absolute;
+ top: 2px;
+ left: 50%;
+ width: min(620px, 56vw);
+ height: 96px;
+ transform: translateX(-50%) rotateX(-8deg);
+ transform-style: preserve-3d;
+}
+.cockpit-roll-arc::after {
+ content: '';
+ position: absolute;
+ inset: 18px 6% 0;
+ border-top: 1px solid color-mix(in srgb, var(--cockpit-accent) 62%, transparent);
+ border-radius: 50%;
+ opacity: 0.72;
+}
+.cockpit-roll-arc span {
+ position: absolute;
+ left: 50%;
+ top: 0;
+ color: rgba(244, 251, 255, 0.46);
+ font-size: 8px;
+ letter-spacing: 0.1em;
+ transform:
+ translateX(calc(-50% + (var(--slot) * 74px)))
+ translateY(calc(var(--depth) * 9px))
+ rotateZ(calc(var(--slot) * 4deg))
+ rotateY(calc(var(--slot) * -5deg));
+}
+.cockpit-roll-arc span::after {
+ content: '';
+ display: block;
+ width: 1px;
+ height: calc(11px + (3 - var(--depth)) * 2px);
+ margin: 5px auto 0;
+ background: color-mix(in srgb, var(--cockpit-accent) 62%, transparent);
+}
+.cockpit-roll-arc span.active { color: #fff; font-size: 10px; }
+.cockpit-pitch-rail {
+ position: absolute;
+ top: 25%;
+ bottom: 21%;
+ display: grid;
+ grid-template-rows: repeat(5, 1fr);
+ align-items: center;
+ color: rgba(244, 251, 255, 0.38);
+ font-size: 8px;
+ letter-spacing: 0.08em;
+ transform-style: preserve-3d;
+}
+.cockpit-pitch-rail-left {
+ left: clamp(190px, 22vw, 330px);
+ text-align: right;
+ transform: rotateY(24deg) translateZ(-18px);
+}
+.cockpit-pitch-rail-right {
+ right: clamp(190px, 22vw, 330px);
+ text-align: left;
+ transform: rotateY(-24deg) translateZ(-18px);
+}
+body.cockpit-mode:has(#left-panel-stack > .panel-collapsible:not(.collapsed)) .cockpit-pitch-rail-left {
+ opacity: 0;
+ transition: opacity 0.25s;
+}
+.cockpit-pitch-rail span {
+ display: flex;
+ align-items: center;
+ gap: 7px;
+}
+.cockpit-pitch-rail-left span { justify-content: flex-end; }
+.cockpit-pitch-rail span::after {
+ content: '';
+ width: 24px;
+ border-top: 1px solid color-mix(in srgb, var(--cockpit-accent) 46%, transparent);
+}
+.cockpit-pitch-rail-right span::after { order: -1; }
+.cockpit-pitch-rail span.active { color: var(--cockpit-accent); }
+.cockpit-pitch-rail span.active::after { width: 42px; border-color: var(--cockpit-accent); }
+.cockpit-horizon-guide {
+ position: absolute;
+ top: 46%;
+ left: 50%;
+ display: grid;
+ grid-template-columns: minmax(74px, 190px) auto minmax(74px, 190px);
+ align-items: center;
+ gap: 16px;
+ width: min(470px, 42vw);
+ transform: translate(-50%, -50%) translateZ(22px);
+ color: color-mix(in srgb, var(--cockpit-accent) 72%, white);
+}
+.cockpit-horizon-guide span { border-top: 1px solid currentColor; }
+.cockpit-horizon-guide span:first-child { transform: rotateZ(2deg); transform-origin: right; }
+.cockpit-horizon-guide span:last-child { transform: rotateZ(-2deg); transform-origin: left; }
+.cockpit-horizon-guide small { font-size: 7px; letter-spacing: 0.16em; }
+.cockpit-route-direction {
+ --route-angle: 0deg;
+ position: absolute;
+ z-index: 3;
+ /* Keep the cue in one predictable center slot. Its rotation communicates
+ relative destination bearing; lateral movement made it look like a random
+ scene arrow and allowed it to collide with the speed/heading readouts. */
+ top: 62%;
+ left: 50%;
+ display: grid;
+ justify-items: center;
+ gap: 5px;
+ color: color-mix(in srgb, var(--cockpit-accent) 24%, #79b8ff);
+ opacity: 0.84;
+ transform: translate(-50%, -50%) translateZ(24px);
+ transition: opacity 180ms ease;
+ filter: drop-shadow(0 0 8px color-mix(in srgb, var(--cockpit-accent) 34%, transparent));
+}
+.cockpit-route-direction[hidden] { display: none; }
+.cockpit-route-direction .cockpit-route-chevron {
+ display: block;
+ width: clamp(56px, 6vw, 78px);
+ height: clamp(56px, 6vw, 78px);
+ overflow: visible;
+ color: color-mix(in srgb, var(--cockpit-accent) 28%, #79b8ff);
+ fill: currentColor;
+ stroke: color-mix(in srgb, var(--cockpit-accent) 58%, #d8f3ff);
+ stroke-width: 0.7px;
+ stroke-linejoin: round;
+ filter:
+ drop-shadow(0 0 4px rgba(213, 242, 255, 0.68))
+ drop-shadow(0 5px 6px rgba(0, 53, 102, 0.5));
+ /* Present the direction cue on the apparent ground plane while its parent
+ remains locked to the same fixed HUD position. */
+ transform: perspective(220px) rotateX(62deg) rotateZ(var(--route-angle)) scaleY(1.35);
+ transform-origin: center;
+ transition: transform 180ms ease;
+}
+.cockpit-route-direction small {
+ padding: 2px 5px;
+ border: 1px solid color-mix(in srgb, var(--cockpit-accent) 20%, transparent);
+ border-radius: 3px;
+ background: rgba(0, 7, 12, 0.24);
+ font-size: 7px;
+ text-align: center;
+ letter-spacing: 0.14em;
+ white-space: nowrap;
+}
+.cockpit-altitude-rim {
+ --cockpit-keyhole-radius: min(40vw, 52vh);
+ position: absolute;
+ z-index: 2;
+ top: calc(50vh - var(--cockpit-keyhole-radius) + 20px);
+ right: calc(50vw - var(--cockpit-keyhole-radius) + 20px);
+ bottom: auto;
+ width: 230px;
+ height: calc((var(--cockpit-keyhole-radius) - 20px) * 2);
+ overflow: hidden;
+ color: var(--cockpit-accent);
+ opacity: 0.9;
+}
+.cockpit-altitude-rim-label {
+ position: absolute;
+ top: 20%;
+ right: calc(12px + (0.2 * (var(--cockpit-keyhole-radius) - 20px)));
+ color: color-mix(in srgb, var(--cockpit-accent) 82%, white);
+ font-size: 7px;
+ font-weight: 700;
+ letter-spacing: 0.18em;
+ white-space: nowrap;
+}
+.cockpit-altitude-rim-rail {
+ position: absolute;
+ inset: 0;
+ overflow: hidden;
+ -webkit-mask-image: linear-gradient(
+ to bottom,
+ transparent 0%,
+ rgba(0, 0, 0, 0.04) 10%,
+ rgba(0, 0, 0, 0.28) 24%,
+ #000 42%,
+ #000 58%,
+ rgba(0, 0, 0, 0.28) 76%,
+ rgba(0, 0, 0, 0.04) 90%,
+ transparent 100%
+ );
+ mask-image: linear-gradient(
+ to bottom,
+ transparent 0%,
+ rgba(0, 0, 0, 0.04) 10%,
+ rgba(0, 0, 0, 0.28) 24%,
+ #000 42%,
+ #000 58%,
+ rgba(0, 0, 0, 0.28) 76%,
+ rgba(0, 0, 0, 0.04) 90%,
+ transparent 100%
+ );
+}
+.cockpit-altitude-rim-rail::before {
+ content: '';
+ position: absolute;
+ top: 0;
+ right: 0;
+ box-sizing: border-box;
+ width: calc((var(--cockpit-keyhole-radius) - 20px) * 2);
+ height: calc((var(--cockpit-keyhole-radius) - 20px) * 2);
+ border: 2px solid color-mix(in srgb, var(--cockpit-accent) 72%, transparent);
+ border-radius: 50%;
+ box-shadow: 5px 0 18px color-mix(in srgb, var(--cockpit-accent) 18%, transparent);
+}
+.cockpit-altitude-rim-scale {
+ position: absolute;
+ inset: 0;
+ overflow: hidden;
+ -webkit-mask-image: linear-gradient(
+ to bottom,
+ transparent 0%,
+ rgba(0, 0, 0, 0.03) 9%,
+ rgba(0, 0, 0, 0.22) 23%,
+ #000 41%,
+ #000 59%,
+ rgba(0, 0, 0, 0.22) 77%,
+ rgba(0, 0, 0, 0.03) 91%,
+ transparent 100%
+ );
+ mask-image: linear-gradient(
+ to bottom,
+ transparent 0%,
+ rgba(0, 0, 0, 0.03) 9%,
+ rgba(0, 0, 0, 0.22) 23%,
+ #000 41%,
+ #000 59%,
+ rgba(0, 0, 0, 0.22) 77%,
+ rgba(0, 0, 0, 0.03) 91%,
+ transparent 100%
+ );
+}
+.cockpit-altitude-rim-scale > span {
+ position: absolute;
+ top: calc(50% + (var(--slot) * 8%));
+ right: calc(7px + (var(--curve) * (var(--cockpit-keyhole-radius) - 20px)));
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ color: rgba(244, 251, 255, 0.68);
+ transform: translateY(-50%) rotateZ(calc(var(--slot) * -1.7deg));
+ transform-origin: right center;
+ transition: top 120ms linear, right 120ms linear, transform 120ms linear;
+}
+.cockpit-altitude-rim-scale > span i {
+ order: 2;
+ display: block;
+ width: 20px;
+ border-top: 1px solid color-mix(in srgb, var(--cockpit-accent) 58%, transparent);
+}
+.cockpit-altitude-rim-scale > span b {
+ min-width: 46px;
+ padding: 1px 3px;
+ border-radius: 2px;
+ background: rgba(0, 7, 12, 0.28);
+ font-size: 8px;
+ font-weight: 500;
+ letter-spacing: 0.08em;
+ text-align: right;
+}
+.cockpit-altitude-rim-scale > span.major { color: rgba(244, 251, 255, 0.9); }
+.cockpit-altitude-rim-scale > span.major i {
+ width: 32px;
+ border-color: color-mix(in srgb, var(--cockpit-accent) 86%, transparent);
+}
+.cockpit-altitude-rim-pointer {
+ position: absolute;
+ top: 50%;
+ right: 0;
+ display: flex;
+ align-items: center;
+ color: #fff;
+ transform: translateY(-50%);
+ text-shadow: 0 0 12px var(--cockpit-accent);
+}
+.cockpit-altitude-rim-pointer strong {
+ min-width: 48px;
+ font-size: 10px;
+ font-weight: 700;
+ letter-spacing: 0.06em;
+ text-align: right;
+}
+.cockpit-altitude-rim-pointer .material-symbols-outlined {
+ margin-left: 4px;
+ color: var(--cockpit-accent);
+ font-size: 24px;
+ font-variation-settings: 'FILL' 1, 'wght' 600;
+ animation: cockpit-altitude-pointer 1.8s ease-in-out infinite;
+}
+@keyframes cockpit-altitude-pointer {
+ 50% { transform: translateX(-3px); filter: brightness(1.35); }
+}
+.cockpit-altitude-rim.unavailable { opacity: 0.24; }
+.cockpit-speed-rim {
+ --speed-tape-inset: clamp(112px, 9vw, 148px);
+ right: auto;
+ left: calc(50vw - var(--cockpit-keyhole-radius) + 20px);
+ width: 300px;
+}
+.cockpit-speed-rim .cockpit-altitude-rim-label {
+ right: auto;
+ left: var(--speed-tape-inset);
+}
+.cockpit-speed-rim .cockpit-altitude-rim-rail::before {
+ right: auto;
+ left: 0;
+ box-shadow: -5px 0 18px color-mix(in srgb, var(--cockpit-accent) 18%, transparent);
+}
+.cockpit-speed-rim .cockpit-altitude-rim-scale > span {
+ right: auto;
+ left: calc(1px + (var(--curve) * (var(--cockpit-keyhole-radius) - 20px)));
+ flex-direction: row-reverse;
+ /* Speed rises toward the top of the tape; altitude intentionally runs the
+ opposite way on the mirrored right-hand ruler. */
+ top: calc(50% - (var(--slot) * 8%));
+ transform: translateY(-50%) rotateZ(calc(var(--slot) * 1.7deg));
+ transform-origin: left center;
+}
+.cockpit-speed-rim .cockpit-altitude-rim-scale > span b { text-align: left; }
+.cockpit-speed-rim .cockpit-altitude-rim-pointer {
+ right: auto;
+ left: 0;
+}
+.cockpit-speed-rim .cockpit-altitude-rim-pointer strong { text-align: left; }
+.cockpit-speed-rim .cockpit-altitude-rim-pointer .material-symbols-outlined {
+ margin-right: 4px;
+ margin-left: 0;
+ animation-name: cockpit-speed-pointer;
+}
+@keyframes cockpit-speed-pointer {
+ 50% { transform: translateX(3px); filter: brightness(1.35); }
+}
+.cockpit-visor-status {
+ position: absolute;
+ bottom: 3px;
+ color: color-mix(in srgb, var(--cockpit-accent) 54%, transparent);
+ font-size: 7px;
+ letter-spacing: 0.22em;
+}
+.cockpit-visor-status-left { left: clamp(110px, 15vw, 220px); transform: rotateY(22deg); }
+.cockpit-visor-status-right { right: clamp(110px, 15vw, 220px); transform: rotateY(-22deg); }
+.cockpit-topline {
+ position: absolute;
+ z-index: 5;
+ top: clamp(18px, 3vh, 34px);
+ left: clamp(22px, 4vw, 58px);
+ right: clamp(22px, 4vw, 58px);
+ display: grid;
+ grid-template-columns: 1fr auto 1fr;
+ align-items: start;
+ gap: 24px;
+}
+.cockpit-topline > div:first-child { display: flex; flex-direction: column; gap: 4px; }
+.cockpit-kicker, .cockpit-readout-label {
+ color: var(--cockpit-accent);
+ font-size: 9px;
+ font-weight: 600;
+ letter-spacing: 0.22em;
+}
+#cockpit-callsign { font-size: 18px; letter-spacing: 0.12em; }
+.cockpit-aircraft-meta {
+ color: rgba(244, 251, 255, 0.48);
+ font-size: 7px;
+ letter-spacing: 0.16em;
+}
+.cockpit-mode-chip {
+ margin-top: 2px;
+ padding: 7px 11px;
+ border: 1px solid color-mix(in srgb, var(--cockpit-accent) 45%, transparent);
+ border-radius: 20px;
+ background: rgba(0, 7, 12, 0.62);
+ color: var(--cockpit-accent);
+ font-size: 9px;
+ font-weight: 600;
+ letter-spacing: 0.16em;
+}
+.cockpit-live-dot {
+ display: inline-block;
+ width: 5px;
+ height: 5px;
+ margin-right: 6px;
+ border-radius: 50%;
+ background: var(--cockpit-accent);
+ box-shadow: 0 0 8px var(--cockpit-accent);
+ animation: cockpit-live 1.6s ease-in-out infinite;
+}
+@keyframes cockpit-live { 50% { opacity: 0.35; } }
+.cockpit-readout {
+ position: relative;
+ display: grid;
+ min-width: 118px;
+ padding: 6px 10px 7px;
+ border-top: 1px solid color-mix(in srgb, var(--cockpit-accent) 50%, transparent);
+ border-bottom: 1px solid color-mix(in srgb, var(--cockpit-accent) 18%, transparent);
+ background: linear-gradient(90deg, transparent, rgba(0, 7, 12, 0.34), transparent);
+ transform-style: preserve-3d;
+}
+.cockpit-speed {
+ justify-self: end;
+ text-align: right;
+ transform: perspective(760px) rotateY(10deg) translateZ(-5px);
+ transform-origin: right center;
+}
+.cockpit-altitude {
+ justify-self: start;
+ text-align: left;
+ transform: perspective(760px) rotateY(-10deg) translateZ(-5px);
+ transform-origin: left center;
+}
+.cockpit-readout strong {
+ margin-top: 1px;
+ font-size: clamp(30px, 3.6vw, 48px);
+ font-weight: 500;
+ line-height: 0.98;
+ letter-spacing: -0.06em;
+ white-space: nowrap;
+}
+.cockpit-roll-token {
+ position: relative;
+ display: inline-block;
+ min-width: 0.56em;
+ height: 1em;
+ overflow: hidden;
+ line-height: 1;
+ text-align: center;
+ vertical-align: -0.08em;
+}
+.cockpit-roll-token.is-rolling {
+ color: color-mix(in srgb, currentColor 92%, var(--cockpit-accent));
+ text-shadow: 0 0 10px color-mix(in srgb, var(--cockpit-accent) 35%, transparent);
+}
+.cockpit-roll-track {
+ display: flex;
+ flex-direction: column;
+ height: 2em;
+ will-change: transform;
+}
+.cockpit-roll-track > span {
+ display: block;
+ flex: 0 0 1em;
+ height: 1em;
+ line-height: 1;
+}
+.cockpit-roll-token.roll-up .cockpit-roll-track {
+ animation: cockpit-number-roll-up 200ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
+}
+.cockpit-roll-token.roll-down .cockpit-roll-track {
+ animation: cockpit-number-roll-down 200ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
+}
+@keyframes cockpit-number-roll-up {
+ from { transform: translateY(0); }
+ to { transform: translateY(-1em); }
+}
+@keyframes cockpit-number-roll-down {
+ from { transform: translateY(-1em); }
+ to { transform: translateY(0); }
+}
+@media (prefers-reduced-motion: reduce) {
+ .cockpit-roll-token .cockpit-roll-track { animation-duration: 1ms; }
+}
+.cockpit-readout-unit {
+ margin-top: 2px;
+ color: rgba(244, 251, 255, 0.7);
+ font-size: 11px;
+ font-weight: 600;
+ letter-spacing: 0.2em;
+}
+.cockpit-reticle {
+ position: absolute;
+ top: 46%;
+ left: 50%;
+ transform: translate(-50%, -50%) translateZ(34px);
+ color: var(--cockpit-accent);
+ font-size: clamp(30px, 3vw, 44px);
+ font-variation-settings: 'wght' 200;
+ opacity: 0.8;
+}
+.cockpit-compass {
+ position: absolute;
+ left: 50%;
+ bottom: clamp(44px, 7vh, 72px);
+ width: min(760px, 72vw);
+ transform: translateX(-50%) rotateX(7deg) translateZ(18px);
+ transform-style: preserve-3d;
+ perspective: 760px;
+ text-align: center;
+}
+.cockpit-instrument-row {
+ display: grid;
+ grid-template-columns: minmax(118px, 1fr) auto minmax(118px, 1fr);
+ align-items: center;
+ gap: clamp(18px, 3vw, 42px);
+}
+.cockpit-heading-value {
+ min-width: 74px;
+ font-size: 34px;
+ font-weight: 600;
+ line-height: 1;
+ white-space: nowrap;
+}
+.cockpit-heading-value small { color: var(--cockpit-accent); font-size: 12px; }
+.cockpit-heading-caret {
+ display: block;
+ height: 20px;
+ color: var(--cockpit-accent);
+ font-size: 28px;
+ line-height: 20px;
+}
+.cockpit-compass-tape {
+ position: relative;
+ height: 74px;
+ margin-top: -2px;
+ transform-style: preserve-3d;
+}
+.cockpit-compass-tape::before {
+ content: '';
+ position: absolute;
+ inset: 10px 2% 0;
+ border-top: 1px solid color-mix(in srgb, var(--cockpit-accent) 78%, transparent);
+ border-radius: 50%;
+ background: rgba(0, 7, 12, 0.16);
+}
+.cockpit-compass-tape span {
+ position: absolute;
+ top: 8px;
+ left: 50%;
+ color: rgba(244, 251, 255, 0.52);
+ font-size: 12px;
+ letter-spacing: 0.12em;
+ transform:
+ translateX(calc(-50% + (var(--slot) * 86px)))
+ translateY(calc(var(--depth) * 8px))
+ rotateZ(calc(var(--slot) * 3.6deg))
+ rotateY(calc(var(--slot) * -9deg));
+}
+.cockpit-compass-tape span::before {
+ content: '';
+ display: block;
+ width: 1px;
+ height: calc(17px - (var(--depth) * 2px));
+ margin: 0 auto 7px;
+ background: color-mix(in srgb, var(--cockpit-accent) 70%, transparent);
+}
+.cockpit-compass-tape span.active {
+ color: #fff;
+ font-size: 18px;
+ font-weight: 700;
+ text-shadow: 0 0 14px var(--cockpit-accent);
+}
+.cockpit-position-readout {
+ position: absolute;
+ right: clamp(24px, 4vw, 58px);
+ bottom: clamp(22px, 4vh, 42px);
+ display: flex;
+ flex-direction: column;
+ align-items: flex-end;
+ gap: 4px;
+ color: rgba(244, 251, 255, 0.72);
+ font-size: 10px;
+ letter-spacing: 0.1em;
+}
+.cockpit-vision-controls {
+ display: grid;
+ grid-template-columns: 48px 58px 48px;
+ align-items: stretch;
+ gap: 2px;
+ margin-top: 2px;
+ padding: 2px;
+ border: 1px solid color-mix(in srgb, var(--cockpit-accent) 22%, transparent);
+ border-radius: 7px;
+ background: rgba(0, 7, 12, 0.46);
+ box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.28);
+ pointer-events: auto;
+}
+.cockpit-vision-controls button {
+ display: flex;
+ min-width: 0;
+ min-height: 31px;
+ align-items: center;
+ justify-content: center;
+ gap: 1px;
+ padding: 4px 5px;
+ border: 1px solid transparent;
+ border-radius: 5px;
+ background: rgba(0, 7, 12, 0.38);
+ color: rgba(244, 251, 255, 0.64);
+ font: 700 7px/1 var(--font-mono);
+ letter-spacing: 0.08em;
+ cursor: pointer;
+}
+.cockpit-vision-controls button:hover,
+.cockpit-vision-controls button:focus-visible {
+ border-color: color-mix(in srgb, var(--cockpit-accent) 62%, transparent);
+ color: #fff;
+ outline: none;
+}
+.cockpit-vision-controls .material-symbols-outlined {
+ font-size: 14px;
+}
+.cockpit-vision-controls small {
+ font: 700 6px/1 var(--font-mono);
+ letter-spacing: 0.1em;
+}
+.cockpit-vision-current {
+ flex-direction: column;
+}
+.cockpit-vision-current small {
+ color: color-mix(in srgb, var(--cockpit-accent) 70%, #fff);
+}
+.cockpit-vision-current strong {
+ color: #fff;
+ font: 700 9px/1 var(--font-mono);
+ letter-spacing: 0.12em;
+}
+.cockpit-vision-controls .cockpit-vision-current {
+ border-color: var(--cockpit-accent);
+ background: color-mix(in srgb, var(--cockpit-accent) 10%, rgba(0, 7, 12, 0.72));
+ box-shadow: 0 0 10px color-mix(in srgb, var(--cockpit-accent) 30%, transparent);
+}
+.cockpit-route-card {
+ display: grid;
+ gap: 8px;
+ min-width: 0;
+ padding: 2px 6px 10px 8px;
+ border-bottom: 1px solid color-mix(in srgb, var(--cockpit-accent) 22%, transparent);
+ color: rgba(224, 247, 255, 0.9);
+ font: 7px/1.25 var(--font-mono);
+ letter-spacing: 0.09em;
+}
+.cockpit-route-card[hidden] { display: none; }
+.cockpit-route-heading {
+ display: flex;
+ min-width: 0;
+ align-items: center;
+ justify-content: space-between;
+ gap: 8px;
+}
+.cockpit-route-kicker {
+ flex: 0 0 auto;
+ color: var(--cockpit-accent);
+ font-size: 7px;
+ font-weight: 700;
+ letter-spacing: 0.16em;
+}
+.cockpit-route-heading small {
+ overflow: hidden;
+ color: color-mix(in srgb, var(--cockpit-accent) 68%, rgba(244, 251, 255, 0.46));
+ font-size: 5px;
+ letter-spacing: 0.08em;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.cockpit-route-endpoints {
+ display: grid;
+ grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
+ align-items: center;
+ gap: 7px;
+}
+.cockpit-route-airport {
+ display: grid;
+ min-width: 0;
+ gap: 3px;
+ padding: 6px 7px;
+ border-left: 1px solid color-mix(in srgb, var(--cockpit-accent) 52%, transparent);
+ background: rgba(0, 7, 12, 0.3);
+}
+.cockpit-route-airport > span {
+ color: color-mix(in srgb, var(--cockpit-accent) 76%, white);
+ font-size: 6px;
+ font-weight: 700;
+ letter-spacing: 0.14em;
+}
+.cockpit-route-airport strong {
+ overflow: hidden;
+ color: #fff;
+ font-size: 8px;
+ letter-spacing: 0.06em;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.cockpit-route-arrow {
+ color: var(--cockpit-accent);
+ font-size: 15px;
+ text-align: center;
+}
+#view-switcher {
+ position: fixed;
+ z-index: 146;
+ right: 36px;
+ bottom: calc(2vh + 4.5rem);
+ display: grid;
+ gap: 6px;
+}
+#view-switcher button {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ gap: 6px;
+ min-height: 32px;
+ padding: 7px 10px;
+ border: 1px solid rgba(116, 219, 255, 0.38);
+ border-radius: 6px;
+ background: rgba(2, 12, 20, 0.82);
+ color: #bceeff;
+ font: 700 8px/1 var(--font-mono);
+ letter-spacing: 0.12em;
+ cursor: pointer;
+ box-shadow: 0 0 18px rgba(0, 0, 0, 0.24);
+}
+#view-switcher button[hidden] { display: none; }
+#view-switcher button:hover, #view-switcher button:focus-visible { border-color: #fff; color: #fff; outline: none; }
+#view-switcher .material-symbols-outlined { font-size: 16px; }
+body.cockpit-mode #view-switcher {
+ right: auto;
+ bottom: max(clamp(128px, 15vh, 150px), env(safe-area-inset-bottom));
+ display: flex;
+ max-width: calc(100vw - 24px);
+ align-items: center;
+ justify-content: center;
+ margin-bottom: -95px;
+ left: 50%;
+ transform: translateX(-50%);
+}
+body.cockpit-mode #view-switcher button {
+ flex: 0 1 auto;
+ min-width: 0;
+ min-height: 28px;
+ padding: 6px 11px;
+ border-radius: 999px;
+ background: rgba(0, 7, 12, 0.74);
+ white-space: nowrap;
+}
+.cockpit-context-window {
+ position: absolute;
+ z-index: 4;
+ top: auto;
+ left: var(--cockpit-context-left, clamp(24px, 4vw, 58px));
+ bottom: var(--cockpit-bottom-rail-safe);
+ display: grid;
+ gap: 7px;
+ width: var(--cockpit-side-panel-width);
+ max-height: min(42vh, 410px);
+ overflow-x: hidden;
+ overflow-y: auto;
+ box-sizing: border-box;
+ padding: 11px 12px 10px;
+ border: 1px solid color-mix(in srgb, var(--cockpit-accent) 30%, transparent);
+ border-top-color: color-mix(in srgb, var(--cockpit-accent) 64%, transparent);
+ border-radius: 8px 24px 24px 8px;
+ background: rgba(0, 7, 12, 0.68);
+ box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 0 28px rgba(0,0,0,0.26);
+ transform: perspective(900px) rotateY(4deg) translateZ(18px);
+ transform-origin: left center;
+ transform-style: preserve-3d;
+ pointer-events: auto;
+ text-shadow: 0 0 8px color-mix(in srgb, var(--cockpit-accent) 45%, transparent);
+ scrollbar-color: color-mix(in srgb, var(--cockpit-accent) 45%, transparent) transparent;
+ scrollbar-width: thin;
+ transition: width 180ms ease, background-color 180ms ease, border-radius 180ms ease;
+}
+#cockpit-context[hidden] { display: none; }
+.cockpit-context-window[data-state="uncertain"] { border-top-color: rgba(116, 219, 255, 0.72); }
+/* CONTACT LOST reuses the amber the app already spends on unknown/stale inputs
+ (.cockpit-context-cohorts > div.unknown, .cockpit-brief-status[data-state="unavailable"]),
+ so a held last-known readout never reads as a live one. */
+.cockpit-context-window[data-state="lost"] { border-top-color: rgba(213, 168, 99, 0.72); }
+.cockpit-context-header {
+ display: grid;
+ grid-template-columns: minmax(0, 1fr) auto;
+ align-items: center;
+ gap: 5px 10px;
+ padding: 0 5px 7px;
+ border-bottom: 1px solid color-mix(in srgb, var(--cockpit-accent) 22%, transparent);
+}
+.cockpit-context-header > div { display: grid; gap: 2px; }
+.cockpit-context-kicker {
+ color: var(--cockpit-accent);
+ font-size: 8px;
+ font-weight: 700;
+ letter-spacing: 0.2em;
+}
+#cockpit-context-subject {
+ color: #fff;
+ font-size: 10px;
+ font-weight: 600;
+ letter-spacing: 0.12em;
+}
+.cockpit-context-qualifier {
+ grid-column: 1 / -1;
+ justify-self: start;
+ color: rgba(116, 219, 255, 0.82);
+ font-size: 7px;
+ letter-spacing: 0.16em;
+ white-space: nowrap;
+}
+.cockpit-context-weather {
+ display: inline-flex;
+ min-width: 48px;
+ height: 20px;
+ align-items: center;
+ justify-content: center;
+ gap: 5px;
+ padding: 0 7px;
+ border: 1px solid color-mix(in srgb, var(--cockpit-accent) 46%, transparent);
+ border-radius: 999px;
+ background: color-mix(in srgb, var(--cockpit-accent) 8%, rgba(0, 7, 12, 0.78));
+ color: color-mix(in srgb, var(--cockpit-accent) 82%, white);
+ font: 700 6px/1 var(--font-mono);
+ letter-spacing: 0.1em;
+ cursor: pointer;
+}
+.cockpit-context-weather strong {
+ color: #fff;
+ font: inherit;
+}
+.cockpit-context-weather[aria-pressed="false"] {
+ border-color: rgba(244, 251, 255, 0.15);
+ background: rgba(0, 7, 12, 0.54);
+ color: rgba(244, 251, 255, 0.42);
+}
+.cockpit-context-weather[aria-pressed="false"] strong { color: rgba(244, 251, 255, 0.5); }
+.cockpit-context-weather:hover, .cockpit-context-weather:focus-visible {
+ border-color: var(--cockpit-accent);
+ color: #fff;
+ outline: none;
+}
+.cockpit-context-actions { display: flex; gap: 4px; }
+.cockpit-context-actions button {
+ display: grid;
+ width: 28px;
+ height: 24px;
+ place-items: center;
+ padding: 0;
+ border: 1px solid color-mix(in srgb, var(--cockpit-accent) 30%, transparent);
+ border-radius: 5px;
+ background: rgba(0, 7, 12, 0.72);
+ color: color-mix(in srgb, var(--cockpit-accent) 82%, white);
+ cursor: pointer;
+}
+.cockpit-context-actions button:hover, .cockpit-context-actions button:focus-visible {
+ border-color: var(--cockpit-accent);
+ color: #fff;
+ outline: none;
+}
+.cockpit-context-actions button:disabled {
+ border-color: rgba(244, 251, 255, 0.1);
+ color: rgba(244, 251, 255, 0.2);
+ cursor: default;
+}
+.cockpit-context-actions .material-symbols-outlined { font-size: 15px; }
+.cockpit-context-cohorts {
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: 6px;
+}
+.cockpit-context-cohorts > div {
+ display: grid;
+ grid-template-columns: auto 1fr;
+ align-items: baseline;
+ gap: 3px 8px;
+ min-width: 0;
+ padding: 6px 9px;
+ border-left: 1px solid color-mix(in srgb, var(--cockpit-accent) 40%, transparent);
+ background: rgba(0, 7, 12, 0.34);
+}
+.cockpit-context-cohorts span {
+ color: var(--cockpit-accent);
+ font-size: 8px;
+ font-weight: 700;
+ letter-spacing: 0.14em;
+}
+.cockpit-context-cohorts strong {
+ justify-self: end;
+ color: #fff;
+ font-size: 17px;
+ font-weight: 600;
+}
+.cockpit-context-cohorts small {
+ grid-column: 1 / -1;
+ overflow: hidden;
+ color: rgba(244, 251, 255, 0.4);
+ font-size: 6px;
+ letter-spacing: 0.05em;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.cockpit-context-cohorts > div.unknown { border-left-color: rgba(213, 168, 99, 0.58); }
+.cockpit-context-cohorts > div.unknown strong { color: #d5a863; }
+.cockpit-context-nearest {
+ display: grid;
+ grid-template-columns: 22px minmax(0, 1fr) auto;
+ grid-template-rows: auto auto;
+ align-items: center;
+ gap: 2px 8px;
+ padding: 3px 5px 2px;
+}
+#cockpit-context-direction {
+ grid-row: 1 / 3;
+ color: var(--cockpit-accent);
+ font-size: 22px;
+ transform-origin: 50% 50%;
+ transition: transform 180ms ease-out;
+}
+#cockpit-context-direction.unknown { opacity: 0.3; }
+.cockpit-context-nearest > div { grid-column: 2; grid-row: 1; display: grid; gap: 2px; min-width: 0; }
+.cockpit-context-nearest small {
+ color: rgba(244, 251, 255, 0.42);
+ font-size: 6px;
+ letter-spacing: 0.12em;
+}
+#cockpit-context-nearest-label {
+ overflow: hidden;
+ color: #fff;
+ font-size: 9px;
+ letter-spacing: 0.1em;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+#cockpit-context-bearing, #cockpit-context-distance {
+ color: var(--cockpit-accent);
+ font-size: 10px;
+ font-weight: 700;
+ letter-spacing: 0.08em;
+ white-space: nowrap;
+}
+#cockpit-context-bearing { grid-column: 2; grid-row: 2; justify-self: start; }
+#cockpit-context-distance { grid-column: 3; grid-row: 1 / 3; }
+#cockpit-context-distance { color: #fff; }
+.cockpit-context-footer {
+ display: grid;
+ grid-template-columns: minmax(0, 1fr) auto auto;
+ align-items: center;
+ gap: 8px;
+ padding: 6px 8px 0;
+ border-top: 1px solid rgba(244, 251, 255, 0.08);
+ color: rgba(244, 251, 255, 0.4);
+ font-size: 6px;
+ letter-spacing: 0.11em;
+}
+.cockpit-context-window[data-state="uncertain"] #cockpit-context-uncertainty { color: #74dbff; }
+.cockpit-context-window[data-state="lost"] #cockpit-context-uncertainty {
+ color: #d5a863;
+ font-weight: 600;
+}
+/* The held values are last-known, not current — dim them to match the cue. */
+.cockpit-context-window[data-state="lost"] :is(
+ .cockpit-context-cohorts,
+ .cockpit-context-nearest
+) { opacity: 0.55; }
+#cockpit-hud.context-active .cockpit-pitch-rail-left {
+ opacity: 0.16;
+ transition: opacity 180ms ease;
+}
+.cockpit-context-window[data-layout-mode="rail-left-constrained"] {
+ gap: 5px;
+ padding-top: 8px;
+ padding-bottom: 8px;
+}
+.cockpit-context-window[data-collapsed="true"] {
+ width: min(248px, 22vw);
+ max-height: none;
+ gap: 0;
+ padding: 9px 10px;
+ border-radius: 7px 18px 18px 7px;
+ background: rgba(0, 7, 12, 0.54);
+}
+.cockpit-context-window[data-collapsed="true"] .cockpit-context-header {
+ gap: 8px;
+ padding: 0;
+ border-bottom: 0;
+}
+.cockpit-context-window[data-collapsed="true"] :is(
+ .cockpit-context-qualifier,
+ .cockpit-context-cohorts,
+ .cockpit-context-nearest,
+ .cockpit-context-footer,
+ .cockpit-context-actions button:not(#cockpit-context-toggle)
+) { display: none; }
+.cockpit-context-window[data-collapsed="true"] #cockpit-context-subject {
+ font-size: 8px;
+ letter-spacing: 0.08em;
+}
+#cockpit-hud.signals-active .cockpit-pitch-rail-right {
+ opacity: 0.16;
+ transition: opacity 180ms ease;
+}
+.cockpit-signal-window {
+ position: absolute;
+ z-index: 3;
+ top: auto;
+ right: var(--cockpit-signal-right, clamp(24px, 4vw, 58px));
+ bottom: var(--cockpit-bottom-rail-safe);
+ display: grid;
+ gap: 7px;
+ width: var(--cockpit-side-panel-width);
+ max-height: min(42vh, 410px);
+ overflow-x: hidden;
+ overflow-y: auto;
+ box-sizing: border-box;
+ padding: 11px 12px 9px;
+ border: 1px solid color-mix(in srgb, var(--cockpit-accent) 30%, transparent);
+ border-top-color: color-mix(in srgb, var(--cockpit-accent) 64%, transparent);
+ border-radius: 24px 8px 8px 24px;
+ background: rgba(0, 7, 12, 0.68);
+ box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 0 28px rgba(0,0,0,0.26);
+ transform: perspective(900px) rotateY(-4deg) translateZ(18px);
+ transform-origin: right center;
+ pointer-events: auto;
+ text-shadow: 0 0 8px color-mix(in srgb, var(--cockpit-accent) 45%, transparent);
+ scrollbar-color: color-mix(in srgb, var(--cockpit-accent) 45%, transparent) transparent;
+ scrollbar-width: thin;
+ transition: width 180ms ease, background-color 180ms ease, border-radius 180ms ease;
+}
+#cockpit-signal-stream[hidden] { display: none; }
+.cockpit-utility-controls {
+ position: absolute;
+ z-index: 5;
+ top: var(--cockpit-utility-top, var(--left-stack-safe-top, var(--left-stack-top)));
+ right: clamp(24px, 4vw, 58px);
+ bottom: auto;
+ display: flex;
+ flex-direction: column;
+ align-items: flex-end;
+ justify-content: flex-end;
+ gap: 7px;
+ pointer-events: auto;
+}
+.cockpit-utility-control { position: relative; }
+.cockpit-utility-control.is-expanded {
+ width: 272px;
+ box-sizing: border-box;
+ padding: 8px;
+ border: 1px solid var(--glass-border);
+ border-radius: var(--panel-radius);
+ background: var(--glass-bg);
+ box-shadow: 0 8px 32px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .05);
+ backdrop-filter: blur(24px) saturate(1.4);
+ -webkit-backdrop-filter: blur(24px) saturate(1.4);
+ max-height: var(
+ --cockpit-utility-expanded-max-height,
+ var(--cockpit-utility-max-height, min(44vh, 430px))
+ );
+ overflow-y: auto;
+}
+.cockpit-utility-control.is-expanded:has([data-cockpit-launcher="display"]) {
+ width: var(--display-panel-expanded-width);
+ display: flex;
+ flex-direction: column;
+ align-items: flex-end;
+ gap: 7px;
+ box-shadow: 0 8px 32px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .04);
+}
+.cockpit-utility-control.is-expanded:has([data-cockpit-launcher="radio"]) {
+ width: var(--cockpit-radio-expanded-width, 232px);
+}
+.cockpit-utility-controls.layout-primary-only
+ > .cockpit-utility-control:not(.is-expanded) { display: none; }
+.cockpit-utility-launcher {
+ display: grid;
+ grid-template-columns: auto minmax(0, 1fr) auto;
+ align-items: center;
+ gap: 7px;
+ width: var(--left-collapsed-width, 176px);
+ min-height: 50px;
+ padding: 8px 10px 8px 14px;
+ border: 1px solid var(--glass-border);
+ border-radius: var(--panel-radius);
+ background: var(--glass-bg);
+ box-shadow: 0 8px 32px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .04);
+ backdrop-filter: blur(24px) saturate(1.4);
+ -webkit-backdrop-filter: blur(24px) saturate(1.4);
+ color: var(--text-dim);
+ font: 8px/1.1 var(--font-mono);
+ letter-spacing: 1.4px;
+ text-align: left;
+}
+[data-cockpit-launcher="display"] {
+ width: var(--left-collapsed-width, 176px);
+}
+[data-cockpit-launcher="radio"] {
+ width: var(--cockpit-radio-collapsed-width, 148px);
+}
+.cockpit-utility-control.is-expanded .cockpit-utility-launcher {
+ width: 100%;
+ min-height: 42px;
+ padding: 6px 2px 8px 6px;
+ border: 0;
+ border-radius: 0;
+ background: transparent;
+ box-shadow: none;
+ backdrop-filter: none;
+ -webkit-backdrop-filter: none;
+}
+.cockpit-utility-control.is-expanded .cockpit-utility-launcher {
+ width: 100%;
+}
+.cockpit-utility-control.is-expanded:has([data-cockpit-launcher="display"])
+ .cockpit-utility-launcher {
+ min-height: 42px;
+ box-sizing: border-box;
+ margin-left: auto;
+ margin-bottom: 0;
+ padding: 6px 2px 8px 6px;
+ gap: 8px;
+}
+.cockpit-utility-divider {
+ height: 1px;
+ background: linear-gradient(to right, var(--glass-border), transparent);
+ box-shadow: none;
+}
+.cockpit-utility-control.is-expanded .cockpit-utility-divider {
+ background: linear-gradient(90deg, rgb(0 212 255 / 28%), rgba(0, 212, 255, 0.18) 58%, transparent);
+ box-shadow: 0 0 7px rgba(0, 212, 255, .22);
+}
+.cockpit-utility-glyph {
+ display: grid;
+ width: 20px;
+ height: 20px;
+ padding: 0;
+ place-items: center;
+ border: 1px solid var(--glass-border);
+ border-radius: 6px;
+ background: rgba(255, 255, 255, .03);
+ color: var(--text-secondary);
+ font-family: var(--font-mono);
+ font-size: 12px;
+ line-height: 1;
+ cursor: pointer;
+}
+.cockpit-utility-glyph:focus-visible {
+ border-color: var(--glass-border-hover);
+ color: var(--text-primary);
+ outline: 2px solid var(--text-primary);
+ outline-offset: -3px;
+}
+.cockpit-utility-popover {
+ position: static;
+ display: grid;
+ width: 100%;
+ box-sizing: border-box;
+ gap: 7px;
+ padding: 9px;
+ border: 0;
+ border-top: 1px solid var(--glass-border);
+ border-radius: 0;
+ background: transparent;
+ box-shadow: none;
+}
+.cockpit-utility-popover[hidden] { display: none !important; }
+.cockpit-display-slot {
+ display: block;
+ min-width: 0;
+}
+#cockpit-display-panel {
+ display: flex;
+ flex-direction: column;
+ gap: 7px;
+ padding: 0;
+ border-top: 0;
+ max-height: min(52vh, 470px);
+ overflow-y: auto;
+}
+#cockpit-display-panel .pp-toggle-group {
+ width: 100%;
+ min-width: 0;
+}
+#cockpit-display-panel [data-cockpit-display-slot="parameters"] #param-slider-panel.active {
+ width: 100%;
+ max-height: none;
+ overflow-y: visible;
+}
+#cockpit-display-panel .pp-toggle-btn {
+ width: 100%;
+ min-height: 38px;
+ box-sizing: border-box;
+}
+.cockpit-radio-compact { width: 100%; }
+.cockpit-radio-station {
+ overflow: hidden;
+ color: #fff;
+ font: 500 8px/1.2 var(--font-mono);
+ letter-spacing: .08em;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.cockpit-radio-transport {
+ display: grid;
+ grid-template-columns: repeat(3, 1fr);
+ gap: 6px;
+}
+.cockpit-radio-transport button {
+ min-height: 32px;
+ border: 1px solid rgba(65, 220, 231, .24);
+ border-radius: 6px;
+ background: rgba(65, 220, 231, .05);
+ color: #9ceaf1;
+ cursor: pointer;
+}
+.cockpit-radio-transport button:disabled { opacity: .38; cursor: not-allowed; }
+.cockpit-radio-transport button.active { border-color: var(--cockpit-accent); color: #fff; }
+.cockpit-radio-volume {
+ display: grid;
+ grid-template-columns: auto 1fr auto;
+ align-items: center;
+ gap: 8px;
+ color: rgba(244, 251, 255, .58);
+ font: 7px/1 var(--font-mono);
+ letter-spacing: .1em;
+}
+.cockpit-radio-volume input { width: 100%; }
+.cockpit-signal-header {
+ display: grid;
+ grid-template-columns: minmax(0, 1fr) auto;
+ align-items: center;
+ gap: 10px;
+ padding: 0 4px 7px 8px;
+ border-bottom: 1px solid color-mix(in srgb, var(--cockpit-accent) 22%, transparent);
+}
+.cockpit-signal-header > div { display: grid; gap: 2px; }
+.cockpit-signal-header strong {
+ color: #fff;
+ font-size: 8px;
+ letter-spacing: 0.1em;
+}
+.cockpit-signal-kicker {
+ color: var(--cockpit-accent);
+ font-size: 8px;
+ font-weight: 700;
+ letter-spacing: 0.18em;
+}
+.cockpit-signal-kicker i {
+ display: inline-block;
+ width: 5px;
+ height: 5px;
+ margin-right: 5px;
+ border-radius: 50%;
+ background: var(--cockpit-accent);
+ box-shadow: 0 0 7px var(--cockpit-accent);
+ animation: cockpit-live 1.6s ease-in-out infinite;
+}
+.cockpit-brief-actions {
+ display: flex;
+ align-items: center;
+ gap: 3px;
+}
+.cockpit-brief-actions button {
+ display: grid;
+ width: 23px;
+ height: 24px;
+ place-items: center;
+ padding: 0;
+ border: 1px solid color-mix(in srgb, var(--cockpit-accent) 30%, transparent);
+ border-radius: 5px;
+ background: rgba(0, 7, 12, 0.72);
+ color: color-mix(in srgb, var(--cockpit-accent) 82%, white);
+ cursor: pointer;
+}
+.cockpit-brief-actions button:hover, .cockpit-brief-actions button:focus-visible {
+ border-color: var(--cockpit-accent);
+ color: #fff;
+ outline: none;
+}
+.cockpit-brief-actions .material-symbols-outlined { font-size: 14px; }
+#cockpit-brief-auto {
+ width: 50px;
+ color: rgba(244, 251, 255, 0.42);
+ font: 700 6px/1 var(--font-mono);
+ letter-spacing: 0.05em;
+}
+#cockpit-brief-auto[aria-pressed="true"] {
+ border-color: var(--cockpit-accent);
+ background: color-mix(in srgb, var(--cockpit-accent) 14%, rgba(0, 7, 12, 0.72));
+ color: #fff;
+ box-shadow: 0 0 10px color-mix(in srgb, var(--cockpit-accent) 24%, transparent);
+}
+#cockpit-signal-toggle { width: 28px; margin-left: 2px; }
+#cockpit-brief-position {
+ min-width: 25px;
+ color: rgba(244, 251, 255, 0.48);
+ font-size: 6px;
+ letter-spacing: 0.08em;
+ text-align: center;
+}
+.cockpit-brief-stage {
+ min-height: 178px;
+ overflow: hidden;
+}
+[data-cockpit-brief-page] {
+ animation: cockpit-brief-enter 220ms ease-out both;
+}
+[data-cockpit-brief-page][hidden] { display: none; }
+.cockpit-signal-list {
+ display: grid;
+ gap: 3px;
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+.cockpit-signal-list li {
+ display: grid;
+ grid-template-columns: 54px minmax(0, 1fr);
+ gap: 8px;
+ padding: 7px 7px 7px 9px;
+ border-left: 1px solid rgba(244, 251, 255, 0.2);
+ background: rgba(0, 7, 12, 0.3);
+}
+.cockpit-signal-list li.actionable {
+ transition: border-color 160ms ease, background 160ms ease;
+}
+.cockpit-signal-list li.actionable:hover,
+.cockpit-signal-list li.actionable:focus-within {
+ border-left-color: var(--cockpit-accent);
+ background: color-mix(in srgb, var(--cockpit-accent) 10%, rgba(0, 7, 12, 0.4));
+}
+.cockpit-signal-list li.track, .cockpit-signal-list li.current { border-left-color: var(--cockpit-accent); }
+.cockpit-signal-list li.nearby { border-left-color: #fff; }
+.cockpit-signal-list li.military { border-left-color: #d5a863; }
+.cockpit-signal-list li.warning { border-left-color: #d5a863; }
+.cockpit-signal-list time {
+ color: rgba(244, 251, 255, 0.38);
+ font-size: 6px;
+ letter-spacing: 0.06em;
+}
+.cockpit-signal-list li > div { display: grid; gap: 2px; min-width: 0; }
+.cockpit-signal-list strong {
+ color: color-mix(in srgb, var(--cockpit-accent) 78%, white);
+ font-size: 10px;
+ letter-spacing: 0.11em;
+}
+.cockpit-signal-target {
+ display: grid;
+ grid-template-columns: minmax(0, auto) minmax(14px, 1fr) 12px;
+ align-items: center;
+ gap: 7px;
+ width: 100%;
+ padding: 0;
+ border: 0;
+ background: transparent;
+ color: color-mix(in srgb, var(--cockpit-accent) 78%, white);
+ font: inherit;
+ font-size: 11px;
+ font-weight: 700;
+ letter-spacing: 0.11em;
+ text-align: left;
+ cursor: pointer;
+}
+.cockpit-signal-list li.military .cockpit-signal-target { color: #f0c968; }
+.cockpit-signal-target-label {
+ overflow: hidden;
+ color: currentColor !important;
+ font: inherit;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.cockpit-signal-target-rule {
+ height: 1px;
+ overflow: visible !important;
+ background: linear-gradient(90deg, currentColor, transparent);
+ opacity: 0.42;
+ transition: opacity 160ms ease, transform 160ms ease;
+ transform-origin: left center;
+}
+.cockpit-signal-target-chevron {
+ overflow: visible !important;
+ color: currentColor !important;
+ font-size: 12px !important;
+ line-height: 1;
+ transition: transform 160ms ease;
+}
+.cockpit-signal-target:hover,
+.cockpit-signal-target:focus-visible {
+ color: #fff;
+ outline: none;
+ text-shadow: 0 0 8px color-mix(in srgb, var(--cockpit-accent) 72%, transparent);
+}
+.cockpit-signal-target:hover .cockpit-signal-target-rule,
+.cockpit-signal-target:focus-visible .cockpit-signal-target-rule {
+ opacity: 0.82;
+ transform: scaleX(1.04);
+}
+.cockpit-signal-target:hover .cockpit-signal-target-chevron,
+.cockpit-signal-target:focus-visible .cockpit-signal-target-chevron {
+ transform: translateX(2px);
+}
+.cockpit-signal-list li.warning strong { color: #d5a863; }
+.cockpit-signal-list span {
+ overflow: hidden;
+ color: rgba(244, 251, 255, 0.66);
+ font-size: 8px;
+ letter-spacing: 0.06em;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.cockpit-news-list {
+ display: grid;
+ gap: 4px;
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+.cockpit-news-list:empty { display: none; }
+.cockpit-news-list li {
+ border-left: 1px solid color-mix(in srgb, var(--cockpit-accent) 62%, transparent);
+ background: rgba(0, 7, 12, 0.3);
+}
+.cockpit-news-list a {
+ display: grid;
+ gap: 4px;
+ padding: 7px 9px;
+ color: inherit;
+ text-decoration: none;
+}
+.cockpit-news-list a:hover, .cockpit-news-list a:focus-visible {
+ background: color-mix(in srgb, var(--cockpit-accent) 8%, transparent);
+ outline: 1px solid color-mix(in srgb, var(--cockpit-accent) 46%, transparent);
+}
+.cockpit-news-list strong {
+ display: -webkit-box;
+ overflow: hidden;
+ color: rgba(244, 251, 255, 0.88);
+ font-size: 8px;
+ font-weight: 600;
+ line-height: 1.35;
+ letter-spacing: 0.045em;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+}
+.cockpit-news-list span {
+ color: color-mix(in srgb, var(--cockpit-accent) 65%, rgba(244, 251, 255, 0.42));
+ font-size: 6px;
+ letter-spacing: 0.08em;
+ text-transform: uppercase;
+}
+.cockpit-brief-status {
+ display: grid;
+ min-height: 0;
+ place-items: center;
+ padding: 18px 10px;
+ border: 0;
+ color: rgba(244, 251, 255, 0.45);
+ font-size: 7px;
+ letter-spacing: 0.13em;
+ text-align: center;
+}
+.cockpit-brief-status[data-state="unavailable"] { color: #d5a863; }
+.cockpit-local-place {
+ display: grid;
+ gap: 3px;
+ padding: 5px 8px 8px;
+ border-bottom: 1px solid rgba(244, 251, 255, 0.08);
+}
+.cockpit-local-place strong {
+ overflow: hidden;
+ color: #fff;
+ font-size: 9px;
+ letter-spacing: 0.1em;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.cockpit-local-place small {
+ color: rgba(244, 251, 255, 0.44);
+ font-size: 6px;
+ letter-spacing: 0.09em;
+}
+.cockpit-local-grid {
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: 1px;
+ margin-top: 5px;
+ background: rgba(244, 251, 255, 0.07);
+}
+.cockpit-local-grid > div {
+ display: grid;
+ min-height: 60px;
+ align-content: center;
+ gap: 3px;
+ padding: 7px 9px;
+ background: rgba(0, 7, 12, 0.76);
+}
+.cockpit-local-grid span {
+ color: var(--cockpit-accent);
+ font-size: 7px;
+ font-weight: 700;
+ letter-spacing: 0.13em;
+}
+.cockpit-local-grid strong {
+ overflow: hidden;
+ color: #fff;
+ font-size: 13px;
+ font-weight: 500;
+ letter-spacing: 0.06em;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+#cockpit-local-condition {
+ font-size: 10px;
+ line-height: 1.15;
+ letter-spacing: 0.03em;
+ text-overflow: clip;
+ white-space: normal;
+}
+.cockpit-local-grid small {
+ color: rgba(244, 251, 255, 0.35);
+ font-size: 6px;
+ letter-spacing: 0.07em;
+}
+
+.cockpit-weather-credit {
+ display: inline-block;
+ margin-top: 7px;
+ color: rgba(182, 226, 241, 0.72);
+ font: 600 7px/1.2 var(--font-mono);
+ letter-spacing: 0.08em;
+ text-transform: uppercase;
+}
+.cockpit-signal-footer {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 8px;
+ padding: 5px 8px 0;
+ border-top: 1px solid rgba(244, 251, 255, 0.08);
+ color: rgba(244, 251, 255, 0.34);
+ font-size: 6px;
+ letter-spacing: 0.1em;
+}
+.cockpit-signal-footer > span {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.cockpit-brief-tabs { display: flex; gap: 3px; }
+.cockpit-brief-tabs button {
+ padding: 2px 4px;
+ border: 0;
+ border-bottom: 1px solid rgba(244, 251, 255, 0.16);
+ background: transparent;
+ color: rgba(244, 251, 255, 0.34);
+ font: inherit;
+ letter-spacing: 0.08em;
+ cursor: pointer;
+}
+.cockpit-brief-tabs button[aria-current="true"] {
+ border-bottom-color: var(--cockpit-accent);
+ color: color-mix(in srgb, var(--cockpit-accent) 80%, white);
+}
+.cockpit-brief-tabs button:hover, .cockpit-brief-tabs button:focus-visible {
+ color: #fff;
+ outline: none;
+}
+.cockpit-signal-window[data-layout-mode="rail-right-constrained"] { gap: 5px; }
+.cockpit-signal-window[data-collapsed="true"] {
+ width: min(248px, 22vw);
+ max-height: none;
+ gap: 0;
+ padding: 9px 10px;
+ border-radius: 18px 7px 7px 18px;
+ background: rgba(0, 7, 12, 0.54);
+}
+.cockpit-signal-window[data-collapsed="true"] .cockpit-signal-header {
+ padding: 0;
+ border-bottom: 0;
+}
+.cockpit-signal-window[data-collapsed="true"] .cockpit-route-card { display: none; }
+.cockpit-signal-window[data-collapsed="true"] :is(.cockpit-brief-stage, .cockpit-signal-footer) {
+ display: none;
+}
+.cockpit-signal-window[data-collapsed="true"] .cockpit-brief-actions > :not(#cockpit-signal-toggle) {
+ display: none;
+}
+@keyframes cockpit-brief-enter {
+ from { opacity: 0; transform: translateY(8px); }
+ to { opacity: 1; transform: translateY(0); }
+}
+.cockpit-help {
+ position: absolute;
+ left: clamp(24px, 4vw, 58px);
+ bottom: clamp(22px, 4vh, 42px);
+ color: rgba(244, 251, 255, 0.55);
+ font-size: 9px;
+ letter-spacing: 0.14em;
+}
+.cockpit-help span { color: var(--cockpit-accent); }
+body.cockpit-mode :is(
+ #title-bar, #style-indicator, #top-center-actions, #traffic-sync-chip, #cctv-sync-chip,
+ #command-dock,
+ #military-awareness-panel, #military-awareness-direction-overlay,
+ #cockpit-entry
+) { display: none !important; }
+body.cockpit-mode :is(#clear-selected-layers, #share-btn, #reset-globe-view) {
+ display: none !important;
+}
+body.cockpit-mode #left-panel-stack {
+ z-index: 147;
+ display: flex;
+ top: var(--left-stack-safe-top, var(--left-stack-top));
+ bottom: var(--left-stack-safe-bottom, 24px);
+ height: auto;
+ max-height: none;
+ transition: none;
+}
+body.cockpit-mode #left-panel-stack > #scene-panel { display: none !important; }
+body.cockpit-mode #right-context-rail {
+ display: none !important;
+}
+
+/* Keep the user's intelligence HUD text available in first person. It stays
+ subordinate to the visor instruments and occupies the four peripheral
+ corridors, leaving the optical center, context rails, and heading tape free. */
+body.cockpit-mode #intel-hud.active {
+ z-index: 146;
+ opacity: 0.72;
+ visibility: visible;
+}
+body.cockpit-mode #intel-hud .hud-top-left,
+body.cockpit-mode #intel-hud .hud-bottom-left {
+ left: clamp(18px, 3vw, 44px);
+ transform: scale(0.78);
+ transform-origin: left center;
+}
+body.cockpit-mode #intel-hud .hud-top-right,
+body.cockpit-mode #intel-hud .hud-bottom-right {
+ right: clamp(18px, 3vw, 44px);
+ transform: scale(0.78);
+ transform-origin: right center;
+}
+body.cockpit-mode #intel-hud .hud-top-left,
+body.cockpit-mode #intel-hud .hud-top-right {
+ top: clamp(104px, 13vh, 138px);
+}
+body.cockpit-mode #intel-hud .hud-bottom-left,
+body.cockpit-mode #intel-hud .hud-bottom-right {
+ bottom: clamp(84px, 11vh, 118px);
+}
+body.cockpit-mode #intel-hud .hud-summary-wrap { max-width: min(34vw, 380px); }
+body.cockpit-mode #intel-hud .hud-summary { font-size: 9px; }
+body.cockpit-mode #intel-hud .hud-left-edge { left: 22px; }
+body.cockpit-mode #intel-hud .hud-right-edge { right: 22px; }
+
+@media (max-width: 760px) {
+ #view-switcher { right: 16px; bottom: 16px; }
+ body.cockpit-mode #view-switcher {
+ right: auto;
+ bottom: max(76px, env(safe-area-inset-bottom));
+ width: max-content;
+ max-width: calc(100vw - 20px);
+ margin-bottom: 0;
+ }
+ body.cockpit-mode #view-switcher button {
+ padding-inline: 9px;
+ font-size: 7px;
+ }
+ #cockpit-entry { left: auto; right: 16px; bottom: 88px; }
+ body.cockpit-mode #left-panel-stack,
+ body.cockpit-mode #intel-hud,
+ body.cockpit-mode .cockpit-context-window,
+ body.cockpit-mode .cockpit-signal-window {
+ display: none !important;
+ }
+ body.cockpit-mode #right-context-rail {
+ display: none !important;
+ }
+ body.cockpit-mode .cockpit-utility-controls {
+ top: auto;
+ right: 12px;
+ bottom: 152px;
+ max-width: calc(100vw - 24px);
+ }
+ body.cockpit-mode .cockpit-utility-controls {
+ flex-direction: row;
+ }
+ body.cockpit-mode .cockpit-utility-launcher {
+ width: min(150px, calc((100vw - 31px) / 2));
+ min-height: 42px;
+ }
+ body.cockpit-mode .cockpit-utility-control.is-expanded {
+ position: fixed;
+ top: 96px;
+ right: 12px;
+ width: min(272px, calc(100vw - 24px));
+ max-height: calc(100vh - 260px);
+ }
+ body.cockpit-mode .cockpit-utility-controls:has(.cockpit-utility-control.is-expanded)
+ > .cockpit-utility-control:not(.is-expanded) { display: none; }
+ body.cockpit-mode .cockpit-utility-popover {
+ position: static;
+ width: 100%;
+ }
+ .cockpit-topline { grid-template-columns: 1fr auto; }
+ .cockpit-mode-chip { display: none; }
+ .cockpit-readout { min-width: 76px; padding: 4px 6px 5px; }
+ .cockpit-readout strong { font-size: clamp(24px, 8vw, 34px); }
+ .cockpit-readout-label { font-size: 7px; letter-spacing: 0.12em; }
+ .cockpit-readout-unit { font-size: 8px; }
+ .cockpit-speed { transform: perspective(600px) rotateY(7deg); }
+ .cockpit-altitude { transform: perspective(600px) rotateY(-7deg); }
+ .cockpit-compass { width: 92vw; }
+ .cockpit-instrument-row {
+ grid-template-columns: minmax(76px, 1fr) auto minmax(76px, 1fr);
+ gap: 8px;
+ }
+ .cockpit-context-window {
+ top: auto;
+ left: 12px;
+ right: 12px;
+ bottom: 180px;
+ width: auto;
+ max-height: min(38vh, 280px);
+ padding: 10px 12px 8px;
+ border-radius: 20px 20px 10px 10px;
+ transform: translateZ(22px);
+ }
+ .cockpit-context-window[data-collapsed="true"] {
+ right: auto;
+ width: min(248px, calc(100vw - 24px));
+ max-height: none;
+ }
+ .cockpit-signal-window {
+ top: 112px;
+ right: 12px;
+ width: calc(100vw - 24px);
+ max-height: min(28vh, 220px);
+ padding: 10px 12px 8px;
+ border-radius: 20px 10px 10px 20px;
+ transform: translateZ(22px);
+ }
+ .cockpit-signal-window[data-collapsed="true"] {
+ left: auto;
+ width: min(248px, calc(100vw - 24px));
+ max-height: none;
+ }
+ .cockpit-context-header { grid-template-columns: 1fr auto; }
+ .cockpit-context-qualifier { display: none; }
+ .cockpit-context-cohorts small { display: none; }
+ .cockpit-context-cohorts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
+ .cockpit-context-cohorts > div { padding: 4px 6px; }
+ .cockpit-context-nearest { grid-template-columns: 20px minmax(0, 1fr) auto; gap: 6px; }
+ #cockpit-context-bearing { display: none; }
+ .cockpit-context-footer { font-size: 5px; }
+ .cockpit-compass-tape span {
+ transform:
+ translateX(calc(-50% + (var(--slot) * 52px)))
+ translateY(calc(var(--depth) * 7px))
+ rotateZ(calc(var(--slot) * 3deg));
+ }
+ .cockpit-pitch-rail { display: none; }
+ .cockpit-altitude-rim { display: none; }
+ .cockpit-visor-status { display: none; }
+}
+
+@media (prefers-reduced-motion: reduce) {
+ .cockpit-altitude-rim-pointer .material-symbols-outlined { animation: none; }
+ .cockpit-altitude-rim-scale > span { transition: none; }
+ [data-cockpit-brief-page] { animation: none; }
+}
+
diff --git a/src/ui/styles/command-dock-compact.css b/src/ui/styles/command-dock-compact.css
new file mode 100644
index 000000000..1d36825a2
--- /dev/null
+++ b/src/ui/styles/command-dock-compact.css
@@ -0,0 +1,404 @@
+/* ── Compact accordion command dock ──────────── */
+#command-dock {
+ --dock-side-compact: clamp(9.5rem, 12vw, 10.5rem);
+ --dock-location-open: clamp(28rem, 40vw, 33rem);
+ --dock-presets-open: clamp(25rem, 36vw, 29rem);
+ --dock-voice-width: clamp(13.5rem, 17vw, 15rem);
+ display: flex;
+ grid-template-areas: none;
+ grid-template-columns: none;
+ align-items: center;
+ width: fit-content;
+ max-width: calc(100vw - 4vw);
+ min-height: 3.75rem;
+ padding: 0.2rem;
+ border-radius: 0.4rem;
+ transform: translateX(-50%);
+ transition:
+ transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1),
+ opacity var(--transition-smooth),
+ visibility var(--transition-smooth);
+}
+
+#command-dock:has(#location-bar:not(.collapsed)) {
+ transform: translateX(calc(-50% + (var(--dock-location-open) - var(--dock-side-compact)) / 2));
+}
+
+#command-dock:has(#control-panel:not(.collapsed)) {
+ transform: translateX(calc(-50% - (var(--dock-presets-open) - var(--dock-side-compact)) / 2));
+}
+
+#command-dock > #location-bar,
+#command-dock > #control-panel {
+ flex: 0 0 var(--dock-side-compact);
+ align-self: stretch;
+ min-width: 0;
+ height: auto;
+ overflow: hidden;
+ border: 0;
+ transition: flex-basis 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
+}
+
+#command-dock > #location-bar:not(.collapsed) {
+ flex-basis: var(--dock-location-open);
+}
+
+#command-dock > #control-panel:not(.collapsed) {
+ flex-basis: var(--dock-presets-open);
+}
+
+#command-dock > #location-bar {
+ border-right: 1px solid rgba(123, 189, 211, 0.18);
+}
+
+#command-dock > #control-panel {
+ border-left: 1px solid rgba(123, 189, 211, 0.18);
+}
+
+#command-dock .panel-inner,
+#command-dock .location-inner,
+#command-dock #control-panel.collapsed .panel-inner,
+#command-dock #location-bar.collapsed .location-inner {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ min-height: 3.75rem;
+ padding: 0.45rem 0.75rem;
+}
+
+#command-dock .panel-header,
+#command-dock .location-toolbar,
+#command-dock #control-panel.collapsed .panel-header {
+ flex: 0 0 auto;
+ min-width: calc(var(--dock-side-compact) - 1.5rem);
+ min-height: 1rem;
+ margin: 0;
+}
+
+#command-dock .panel-title,
+#command-dock .location-toolbar-label {
+ width: max-content;
+ font-size: 0.45rem;
+ letter-spacing: 0.12rem;
+ white-space: nowrap;
+}
+
+#command-dock .panel-title::after,
+#command-dock .location-toolbar-label::after {
+ content: '›';
+ margin-left: 0.45rem;
+ color: rgba(54, 220, 255, 0.68);
+ font-size: 0.7rem;
+}
+
+#command-dock #control-panel .panel-title::after {
+ content: '‹';
+ margin-right: 0.45rem;
+ margin-left: 0;
+ float: left;
+}
+
+#command-dock #location-bar.collapsed .location-city-row,
+#command-dock #location-bar.collapsed .poi-row-container,
+#command-dock #location-bar.collapsed .location-bar-divider,
+#command-dock #control-panel.collapsed .button-grid {
+ display: none !important;
+}
+
+#command-dock #location-bar:not(.collapsed) .location-toolbar,
+#command-dock #control-panel:not(.collapsed) .panel-header {
+ margin-bottom: 0.35rem;
+}
+
+#command-dock #location-bar:not(.collapsed) .location-city-row,
+#command-dock #control-panel:not(.collapsed) .button-grid {
+ display: flex !important;
+ animation: command-dock-reveal 220ms ease-out both;
+}
+
+#command-dock .location-city-row {
+ flex-wrap: nowrap;
+ gap: 0.35rem;
+ overflow: hidden;
+}
+
+#command-dock .location-search-wrap {
+ flex: 0 0 10.5rem;
+ min-width: 0;
+ padding-right: 0.4rem;
+}
+
+#command-dock .search-toggle-btn {
+ width: 1.75rem;
+ height: 1.75rem;
+}
+
+#command-dock #location-search,
+#command-dock #location-search.expanded {
+ height: 1.75rem;
+ padding: 0.3rem 0.45rem;
+ font-size: 0.62rem;
+}
+
+#command-dock .location-pills {
+ display: flex;
+ gap: 0.3rem;
+ overflow-x: auto;
+ scrollbar-width: none;
+}
+
+#command-dock .location-pills::-webkit-scrollbar {
+ display: none;
+}
+
+#command-dock .location-pill,
+#command-dock .poi-pill {
+ flex: 0 0 auto;
+ min-height: 1.75rem;
+ padding: 0.3rem 0.55rem;
+ border-radius: 0.2rem;
+ font-size: 0.52rem;
+ white-space: nowrap;
+}
+
+#command-dock .poi-row-container.expanded {
+ display: flex;
+ justify-content: flex-start;
+ gap: 0.3rem;
+ max-height: 2.1rem;
+ margin: 0 0 0.35rem;
+ overflow-x: auto;
+ overflow-y: hidden;
+ animation: command-dock-reveal 180ms ease-out both;
+ scrollbar-width: none;
+}
+
+#command-dock .poi-row-container.expanded::-webkit-scrollbar {
+ display: none;
+}
+
+#command-dock .location-bar-divider.visible {
+ display: none;
+}
+
+#command-dock .button-grid {
+ flex-wrap: nowrap;
+ gap: 0.3rem;
+ overflow-x: auto;
+ scrollbar-width: none;
+}
+
+#command-dock .button-grid::-webkit-scrollbar {
+ display: none;
+}
+
+#command-dock .style-btn {
+ flex: 0 0 3.2rem;
+ min-width: 3.2rem;
+ min-height: 2.45rem;
+ gap: 0.1rem;
+ padding: 0.3rem 0.25rem;
+ border-radius: 0.2rem;
+}
+
+#command-dock .btn-icon {
+ font-size: 0.78rem;
+}
+
+#command-dock .btn-label {
+ font-size: 0.43rem;
+ letter-spacing: 0.02rem;
+}
+
+#command-dock .btn-key {
+ display: none;
+}
+
+#command-dock > #gev-voice-control {
+ position: relative;
+ inset: auto;
+ z-index: 3;
+ display: grid;
+ grid-template-columns: 3.2rem 1fr 3.6rem;
+ grid-template-rows: 0.8rem 2.55rem 0.8rem;
+ flex: 0 0 var(--dock-voice-width);
+ width: var(--dock-voice-width);
+ min-width: 0;
+ height: 4.9rem;
+ margin: -0.65rem 0;
+ padding: 0.3rem 0.65rem;
+ gap: 0 0.35rem;
+ overflow: hidden;
+ border-radius: var(--panel-radius);
+ transform: none;
+}
+
+#command-dock .gev-voice-kicker {
+ position: static;
+ grid-column: 2 / 4;
+ grid-row: 1;
+ align-self: center;
+ color: rgba(190, 221, 230, 0.58);
+ font-size: 0.39rem;
+ letter-spacing: 0.07rem;
+ text-align: center;
+}
+
+#command-dock #gev-voice-button {
+ grid-column: 1;
+ grid-row: 1 / 4;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ width: 3rem;
+ height: 3rem;
+ align-self: center;
+ gap: 0.15rem;
+ padding: 0;
+ border-radius: 50%;
+ box-shadow:
+ 0 0 0 0.2rem rgba(0, 212, 255, 0.06),
+ 0 0 1rem rgba(0, 212, 255, 0.12);
+}
+
+#command-dock .gev-mic-orbit {
+ display: grid;
+ place-items: center;
+ width: 1.7rem;
+ height: 1.7rem;
+}
+
+#command-dock .gev-mic-orbit img {
+ width: 1.55rem;
+ height: 1.55rem;
+}
+
+#command-dock .gev-mic-label {
+ font-size: 0.35rem;
+ color: rgba(190, 221, 230, 0.72);
+ letter-spacing: 0.02rem;
+}
+
+#command-dock .gev-voice-visualizer {
+ grid-column: 2;
+ grid-row: 2;
+ display: flex;
+ align-items: end;
+ justify-content: center;
+ gap: 0.12rem;
+ height: 2.2rem;
+ padding: 0.2rem 0.1rem;
+ border-bottom: 1px solid rgba(54, 220, 255, 0.34);
+}
+
+#command-dock .gev-voice-visualizer span {
+ width: 0.18rem;
+ height: 0.55rem;
+ background: linear-gradient(to top, #28b9db, #71eaff);
+ box-shadow: 0 0 0.35rem rgba(54, 220, 255, 0.28);
+ transform-origin: bottom;
+}
+
+#command-dock .gev-voice-visualizer span:nth-child(3n) { height: 1.35rem; }
+#command-dock .gev-voice-visualizer span:nth-child(4n) { height: 0.95rem; }
+#command-dock .gev-voice-visualizer span:nth-child(5n) { height: 1.7rem; }
+#command-dock .gev-voice-visualizer span:nth-child(7n) { height: 0.75rem; }
+
+#command-dock #gev-voice-control[data-status='listening'] .gev-voice-visualizer span,
+#command-dock #gev-voice-control[data-status='executing'] .gev-voice-visualizer span {
+ animation: gev-voice-bar 680ms ease-in-out infinite alternate;
+ animation-delay: calc(var(--bar) * -45ms);
+}
+
+#command-dock .gev-voice-readout {
+ display: contents;
+}
+
+#command-dock #gev-voice-status {
+ grid-column: 3;
+ grid-row: 2;
+ align-self: start;
+ padding-top: 0.2rem;
+ font-size: 0.45rem;
+ text-align: right;
+}
+
+#command-dock #gev-voice-detail {
+ grid-column: 2 / 4;
+ grid-row: 3;
+ align-self: center;
+ max-width: none;
+ margin: 0;
+ font-size: 0.39rem;
+ letter-spacing: 0.08rem;
+ text-align: center;
+}
+
+@keyframes command-dock-reveal {
+ from { opacity: 0; transform: translateY(0.2rem); }
+ to { opacity: 1; transform: translateY(0); }
+}
+
+@keyframes gev-voice-bar {
+ from { transform: scaleY(0.35); opacity: 0.5; }
+ to { transform: scaleY(1); opacity: 1; }
+}
+
+/* Compact dock clearance keeps the reference-like low profile. */
+body:not(.ui-clean-view):not(.recording-mode) #cesium-credits {
+ bottom: calc(2vh + 4.7rem);
+}
+
+#intel-hud[data-variant='minimal'] .hud-bottom-left {
+ bottom: calc(2vh + 5.4rem);
+}
+
+#intel-hud[data-variant='minimal'] .hud-bottom-bar {
+ bottom: calc(2vh + 8.9rem);
+}
+
+@media (max-width: 900px) {
+ #command-dock {
+ --dock-popover-mobile-width: calc(100vw - 1.5rem);
+ }
+
+ #command-dock {
+ --dock-side-compact: 4.25rem;
+ --dock-location-open: calc(100vw - 7rem);
+ --dock-presets-open: calc(100vw - 7rem);
+ --dock-voice-width: 11.5rem;
+ max-width: calc(100vw - 1rem);
+ }
+
+ #command-dock:has(#location-bar:not(.collapsed)),
+ #command-dock:has(#control-panel:not(.collapsed)) {
+ transform: translateX(-50%);
+ }
+
+ #command-dock:has(#location-bar:not(.collapsed)) > #control-panel,
+ #command-dock:has(#control-panel:not(.collapsed)) > #location-bar {
+ flex-basis: 0;
+ border: 0;
+ }
+
+ #command-dock:has(#location-bar:not(.collapsed)) > #gev-voice-control,
+ #command-dock:has(#control-panel:not(.collapsed)) > #gev-voice-control {
+ flex-basis: 4.75rem;
+ width: 4.75rem;
+ }
+
+ #command-dock:has(#location-bar:not(.collapsed)) .gev-voice-visualizer,
+ #command-dock:has(#location-bar:not(.collapsed)) .gev-voice-kicker,
+ #command-dock:has(#location-bar:not(.collapsed)) .gev-voice-readout,
+ #command-dock:has(#control-panel:not(.collapsed)) .gev-voice-visualizer,
+ #command-dock:has(#control-panel:not(.collapsed)) .gev-voice-kicker,
+ #command-dock:has(#control-panel:not(.collapsed)) .gev-voice-readout {
+ visibility: hidden;
+ }
+
+ #command-dock .location-search-wrap {
+ flex-basis: 8.5rem;
+ }
+}
+
diff --git a/src/ui/styles/command-dock-sliding.css b/src/ui/styles/command-dock-sliding.css
new file mode 100644
index 000000000..1b61ffbb1
--- /dev/null
+++ b/src/ui/styles/command-dock-sliding.css
@@ -0,0 +1,631 @@
+/* ── Slide-up command trays ──────────────────── */
+#command-dock,
+#command-dock:has(#location-bar:not(.collapsed)),
+#command-dock:has(#control-panel:not(.collapsed)) {
+ transform: translateX(-50%);
+}
+
+#command-dock > #location-bar,
+#command-dock > #location-bar:not(.collapsed),
+#command-dock > #control-panel,
+#command-dock > #control-panel:not(.collapsed) {
+ position: relative;
+ flex-basis: var(--dock-side-compact);
+ width: var(--dock-side-compact);
+ overflow: visible;
+}
+
+#command-dock .location-inner,
+#command-dock .panel-inner,
+#command-dock #location-bar.collapsed .location-inner,
+#command-dock #control-panel.collapsed .panel-inner {
+ position: relative;
+ overflow: visible;
+}
+
+#command-dock .dock-popover-content {
+ position: absolute;
+ bottom: calc(100% + 0.65rem);
+ z-index: 5;
+ display: flex;
+ flex-direction: column;
+ width: var(--dock-location-open);
+ padding: 1.55rem 0.6rem 0.6rem;
+ visibility: hidden;
+ opacity: 0;
+ background: rgba(8, 20, 30, 0.94);
+ border: 1px solid rgba(123, 189, 211, 0.32);
+ border-radius: 0.42rem;
+ box-shadow:
+ 0 0.9rem 2.4rem rgba(0, 0, 0, 0.58),
+ 0 0 1.5rem rgba(0, 212, 255, 0.08),
+ 0 0 0 1px rgba(255, 255, 255, 0.025) inset;
+ backdrop-filter: blur(28px) saturate(1.3);
+ -webkit-backdrop-filter: blur(28px) saturate(1.3);
+ pointer-events: none;
+ transform: translateY(0.55rem) scale(0.985);
+ transform-origin: bottom left;
+ transition:
+ opacity 180ms ease,
+ visibility 0s linear 180ms,
+ transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
+}
+
+#command-dock #location-bar .dock-popover-content {
+ left: -0.75rem;
+}
+
+#command-dock #control-panel .dock-popover-content {
+ right: -0.75rem;
+ left: auto;
+ width: var(--dock-presets-open);
+ transform-origin: bottom right;
+}
+
+#command-dock #location-bar:not(.collapsed) .dock-popover-content,
+#command-dock #control-panel:not(.collapsed) .dock-popover-content {
+ visibility: visible;
+ opacity: 1;
+ pointer-events: auto;
+ transform: translateY(0) scale(1);
+ margin-bottom: 10px;
+ /* Make newly revealed controls enter the Tab order immediately. The base
+ rule still delays visibility on close so its opacity fade can finish. */
+ transition-delay: 0s;
+}
+
+#command-dock #location-bar.collapsed .dock-popover-content,
+#command-dock #control-panel.collapsed .dock-popover-content {
+ display: flex !important;
+}
+
+#command-dock .dock-popover-content::after {
+ /* content: ''; */
+ position: absolute;
+ bottom: -0.34rem;
+ left: 1.65rem;
+ width: 0.6rem;
+ height: 0.6rem;
+ background: rgba(8, 20, 30, 0.96);
+ border-right: 1px solid rgba(123, 189, 211, 0.28);
+ border-bottom: 1px solid rgba(123, 189, 211, 0.28);
+ transform: rotate(45deg);
+}
+
+#command-dock #control-panel .dock-popover-content::after {
+ right: 1.65rem;
+ left: auto;
+}
+
+#command-dock .dock-popover-content .location-city-row,
+#command-dock .dock-popover-content .button-grid {
+ display: flex !important;
+}
+
+#command-dock .dock-popover-content .poi-row-container:not(.expanded) {
+ display: none !important;
+}
+
+#command-dock .dock-pin-btn {
+ position: absolute;
+ top: 0.4rem;
+ right: 0.5rem;
+ z-index: 2;
+ display: none;
+ flex: 0 0 auto;
+ min-width: 1.65rem;
+ height: 1rem;
+ padding: 0 0.28rem;
+ color: rgba(190, 221, 230, 0.5);
+ background: rgba(255, 255, 255, 0.025);
+ border: 1px solid rgba(123, 189, 211, 0.2);
+ border-radius: 0.2rem;
+ font-family: var(--font-mono);
+ font-size: 0.35rem;
+ letter-spacing: 0.04rem;
+ cursor: pointer;
+}
+
+#command-dock #location-bar:not(.collapsed) .dock-pin-btn,
+#command-dock #control-panel:not(.collapsed) .dock-pin-btn {
+ display: block;
+}
+
+#command-dock .dock-pin-btn:hover,
+#command-dock .dock-pin-btn[aria-pressed='true'] {
+ color: var(--accent);
+ border-color: rgba(0, 212, 255, 0.62);
+ background: rgba(0, 212, 255, 0.1);
+ box-shadow: 0 0 0.55rem rgba(0, 212, 255, 0.12);
+}
+
+#command-dock .panel-divider {
+ min-width: 0.25rem;
+}
+
+@media (max-width: 900px) {
+ #command-dock:has(#location-bar:not(.collapsed)) > #control-panel,
+ #command-dock:has(#control-panel:not(.collapsed)) > #location-bar {
+ flex-basis: var(--dock-side-compact);
+ border: inherit;
+ }
+
+ #command-dock:has(#location-bar:not(.collapsed)) > #gev-voice-control,
+ #command-dock:has(#control-panel:not(.collapsed)) > #gev-voice-control {
+ flex-basis: var(--dock-voice-width);
+ width: var(--dock-voice-width);
+ }
+
+ #command-dock:has(#location-bar:not(.collapsed)) .gev-voice-visualizer,
+ #command-dock:has(#location-bar:not(.collapsed)) .gev-voice-kicker,
+ #command-dock:has(#location-bar:not(.collapsed)) .gev-voice-readout,
+ #command-dock:has(#control-panel:not(.collapsed)) .gev-voice-visualizer,
+ #command-dock:has(#control-panel:not(.collapsed)) .gev-voice-kicker,
+ #command-dock:has(#control-panel:not(.collapsed)) .gev-voice-readout {
+ visibility: visible;
+ }
+
+ #command-dock .dock-popover-content {
+ width: var(--dock-popover-mobile-width);
+ }
+
+ #command-dock #location-bar .dock-popover-content {
+ left: calc((var(--dock-side-compact) + var(--dock-side-compact) + var(--dock-voice-width) - var(--dock-popover-mobile-width)) / 2);
+ }
+
+ #command-dock #control-panel .dock-popover-content {
+ /* NOT a duplicate of the `#command-dock .dock-popover-content` width above:
+ that selector is (1 id, 1 class) and loses to the unconditional
+ `#command-dock #control-panel .dock-popover-content { width:
+ var(--dock-presets-open) }`, which is 34rem here. Without this override
+ the tray renders 544 px wide inside a 480 px viewport and hangs off the
+ left edge — pinned by the 480 px bounds assert in
+ `scripts/qa-map-source-tray.mjs`. */
+ width: var(--dock-popover-mobile-width);
+ right: calc((var(--dock-side-compact) + var(--dock-side-compact) + var(--dock-voice-width) - var(--dock-popover-mobile-width)) / 2);
+ }
+
+ /* ── Required-attribution clearance ─────────────────────────────────
+ At this width the tray widens to nearly the whole viewport (the rule
+ above), and at its stock 0.65rem offset it lands squarely on the
+ Google/Cesium credit line in the bottom-left corner — a notice the
+ Maps Platform and Cesium terms require to stay visible in EVERY state.
+
+ The transient popover yields, not the permanent notice: the credit
+ keeps the position every other state gives it.
+
+ The tray hangs off the dock, so its clearance is
+ dock bottom + dock height 62px + offset − (credit bottom + 28px).
+ Across 721–900px the dock is anchored at 2vh and the credit at
+ calc(2vh + 5rem), so those terms cancel and 3rem + the tray's own 10px
+ margin leaves a flat 12px. That cancellation is NOT universal: at 720px
+ and below the dock re-anchors to a flat 8px while the credit keeps its
+ 2vh base, which is what the max-width:720px override further down
+ repairs. Nothing here may be reasoned about "at every viewport height"
+ without checking the dock anchor that actually applies.
+
+ Keep these in step with the base offsets (0.65rem, and 1.2rem for the
+ pinned variants); src/creditAttribution.test.mjs walks the real cascade
+ over a viewport grid and fails if any of them re-enters the credit
+ band. */
+ #command-dock #location-bar .dock-popover-content,
+ #command-dock #control-panel .dock-popover-content {
+ bottom: calc(100% + 3rem);
+ }
+
+ #command-dock.dock-has-pinned-tray #location-bar:not(.collapsed):not(.dock-pinned) .dock-popover-content,
+ #command-dock.dock-has-pinned-tray #control-panel:not(.collapsed):not(.dock-pinned) .dock-popover-content {
+ bottom: calc(100% + 3rem + var(--dock-pinned-stack-height));
+ }
+
+ /* Written with the panel IDs on purpose. The stock two-pinned selector
+ carries one ID (#command-dock) against five classes, and the ordinary
+ narrow rule above carries two IDs — so the stock form LOSES here and the
+ top tray drops var(--dock-lower-pinned-height), landing on top of its
+ pinned sibling. Naming the panel makes it (2,5,0), ahead of both the
+ ordinary (2,1,0) and single-pinned (2,4,0) rules. */
+ #command-dock.dock-has-two-pinned-trays #location-bar.dock-pinned-top.dock-pinned:not(.collapsed) .dock-popover-content,
+ #command-dock.dock-has-two-pinned-trays #control-panel.dock-pinned-top.dock-pinned:not(.collapsed) .dock-popover-content {
+ bottom: calc(100% + 3rem + var(--dock-lower-pinned-height));
+ }
+}
+
+/* The dock re-anchors from 2vh to a flat 8px at this width (see the
+ max-width:720px block above), while the credit keeps its 2vh base — so the
+ clearance above stops being height-independent and goes negative on tall
+ narrow viewports (0 at 1000px high, −4px at 1200px). Carrying the 2vh back
+ into the tray's own offset restores the same flat 12px the wider band gets.
+ This block must stay AFTER the max-width:900px rules to win the cascade. */
+@media (max-width: 720px) {
+ #command-dock #location-bar .dock-popover-content,
+ #command-dock #control-panel .dock-popover-content {
+ bottom: calc(100% + 2vh + 2.5rem);
+ }
+
+ #command-dock.dock-has-pinned-tray #location-bar:not(.collapsed):not(.dock-pinned) .dock-popover-content,
+ #command-dock.dock-has-pinned-tray #control-panel:not(.collapsed):not(.dock-pinned) .dock-popover-content {
+ bottom: calc(100% + 2vh + 2.5rem + var(--dock-pinned-stack-height));
+ }
+
+ /* Panel IDs for the same specificity reason as the max-width:900px block. */
+ #command-dock.dock-has-two-pinned-trays #location-bar.dock-pinned-top.dock-pinned:not(.collapsed) .dock-popover-content,
+ #command-dock.dock-has-two-pinned-trays #control-panel.dock-pinned-top.dock-pinned:not(.collapsed) .dock-popover-content {
+ bottom: calc(100% + 2vh + 2.5rem + var(--dock-lower-pinned-height));
+ }
+}
+
+/* Final top-right positioning for the floating SVG tray pins. */
+#command-dock .dock-popover-content {
+ padding: 0.7rem;
+}
+
+#command-dock .dock-popover-content .button-grid {
+ align-items: stretch;
+ min-height: 3.7rem;
+}
+
+#command-dock .dock-popover-content .style-btn {
+ flex: 1 1 0;
+ min-width: 3.6rem;
+ min-height: 3.7rem;
+ height: 100%;
+ padding: 0.45rem 0.3rem;
+}
+
+#command-dock .dock-popover-content .btn-icon {
+ font-size: 1.15rem;
+ line-height: 1;
+}
+
+#command-dock .btn-label {
+ padding-top: 10px;
+}
+
+#command-dock .dock-pin-btn {
+ position: absolute;
+ top: -1rem;
+ right: -1rem;
+ z-index: 2;
+ place-items: center;
+ width: 2.05rem;
+ min-width: 2.05rem;
+ height: 2.05rem;
+ margin: 0;
+ padding: 0;
+ border-radius: 50%;
+ background: rgba(8, 24, 34, 0.96);
+ box-shadow: 0 0.35rem 0.9rem rgba(0, 0, 0, 0.5);
+ transform: none;
+}
+
+#command-dock #location-bar .dock-pin-btn {
+ top: -1rem;
+ right: -1rem;
+}
+
+#command-dock #control-panel .dock-pin-btn {
+ top: -1rem;
+ right: -1rem;
+}
+
+#command-dock #location-bar:not(.collapsed) .dock-pin-btn,
+#command-dock #control-panel:not(.collapsed) .dock-pin-btn {
+ display: grid;
+}
+
+#command-dock .dock-pin-btn img {
+ width: 1.15rem;
+ height: 1.15rem;
+}
+
+/* Five-pixel standby baseline; live microphone analysis sets --audio-level. */
+#command-dock .gev-voice-visualizer span,
+#command-dock .gev-voice-visualizer span:nth-child(3n),
+#command-dock .gev-voice-visualizer span:nth-child(4n),
+#command-dock .gev-voice-visualizer span:nth-child(5n),
+#command-dock .gev-voice-visualizer span:nth-child(7n) {
+ height: var(--audio-level, 5px);
+ opacity: var(--audio-opacity, 0.56);
+ animation: none;
+ transition: height 70ms linear, opacity 90ms linear;
+}
+
+#command-dock #gev-voice-control[data-status='listening'] .gev-voice-visualizer span,
+#command-dock #gev-voice-control[data-status='executing'] .gev-voice-visualizer span {
+ animation: none;
+}
+
+#command-dock #gev-voice-control[data-speaker='user'] :is(#gev-voice-status, #gev-voice-detail) {
+ color: #ffbf69;
+}
+
+#command-dock #gev-voice-control[data-speaker='user'] .gev-voice-visualizer span {
+ background: linear-gradient(to top, #d98a35, #ffcf8a);
+ box-shadow: 0 0 0.35rem rgba(255, 191, 105, 0.32);
+}
+
+#command-dock #gev-voice-control[data-speaker='ai'] :is(#gev-voice-status, #gev-voice-detail) {
+ color: var(--accent);
+}
+
+#command-dock #gev-voice-control[data-speaker='ai'] .gev-voice-visualizer span {
+ background: linear-gradient(to top, #28b9db, #71eaff);
+ box-shadow: 0 0 0.35rem rgba(54, 220, 255, 0.28);
+}
+
+/* Center every slide-up tray on the complete unified dock, not its side wing. */
+#command-dock #location-bar .dock-popover-content {
+ left: calc((var(--dock-unified-width) - var(--dock-location-open)) / 2);
+}
+
+#command-dock #control-panel .dock-popover-content {
+ right: calc((var(--dock-unified-width) - var(--dock-presets-open)) / 2);
+}
+
+@media (max-width: 900px) {
+ #command-dock #location-bar .dock-popover-content {
+ left: calc((var(--dock-unified-width) - var(--dock-popover-mobile-width)) / 2);
+ }
+
+ #command-dock #control-panel .dock-popover-content {
+ right: calc((var(--dock-unified-width) - var(--dock-popover-mobile-width)) / 2);
+ }
+}
+
+/* Final joined-dock geometry: only the three controls own visible surfaces. */
+#command-dock {
+ padding: 0;
+ background: none;
+ border: none;
+ box-shadow: none;
+ backdrop-filter: none;
+ -webkit-backdrop-filter: none;
+}
+
+#command-dock > #location-bar {
+ border-top-right-radius: 0;
+ border-bottom-right-radius: 0;
+}
+
+#command-dock > #location-bar > .location-inner {
+ border-top-right-radius: 0;
+ border-bottom-right-radius: 0;
+}
+
+#command-dock > #control-panel {
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 0;
+}
+
+#command-dock > #control-panel > .panel-inner {
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 0;
+}
+
+#command-dock .dock-popover-content .style-btn:hover {
+ transform: none;
+}
+
+#command-dock .dock-popover-content :is(.location-pill, .poi-pill):hover {
+ transform: none;
+}
+
+/* Keep the microphone neutral at rest; cyan signals hover and live states. */
+#command-dock .gev-mic-orbit {
+ background: rgba(232, 234, 237, 0.04);
+ border-color: rgba(232, 234, 237, 0.36);
+ box-shadow:
+ 0 0 0 0.18rem rgba(232, 234, 237, 0.04),
+ 0 0 0.75rem rgba(232, 234, 237, 0.08);
+ transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
+}
+
+#command-dock .gev-mic-orbit img {
+ filter: grayscale(1) saturate(0) brightness(1.65);
+ opacity: 0.68;
+ transition: filter var(--transition-fast), opacity var(--transition-fast);
+}
+
+#command-dock #gev-voice-button:hover .gev-mic-orbit,
+#command-dock #gev-voice-control:is(
+ [data-status='connecting'],
+ [data-status='listening']:not([data-microphone='muted']),
+ [data-status='executing']
+) .gev-mic-orbit {
+ background: rgba(0, 212, 255, 0.06);
+ border-color: rgba(0, 212, 255, 0.48);
+ box-shadow: 0 0 0 0.18rem rgba(0, 212, 255, 0.06), 0 0 0.9rem rgba(0, 212, 255, 0.12);
+}
+
+#command-dock #gev-voice-button:hover .gev-mic-orbit img,
+#command-dock #gev-voice-control:is(
+ [data-status='connecting'],
+ [data-status='listening']:not([data-microphone='muted']),
+ [data-status='executing']
+) .gev-mic-orbit img {
+ filter: none;
+ opacity: 1;
+}
+
+/* Match compact dock wings to the glass treatment used by left-panel buttons. */
+#command-dock > #location-bar,
+#command-dock > #control-panel {
+ box-sizing: border-box;
+ background: var(--glass-bg);
+ border: 1px solid var(--glass-border);
+ border-radius: var(--panel-radius);
+ box-shadow:
+ 0 8px 32px rgba(0, 0, 0, 0.5),
+ 0 0 0 1px rgba(255, 255, 255, 0.03) inset,
+ 0 1px 0 rgba(255, 255, 255, 0.06) inset;
+ backdrop-filter: blur(24px) saturate(1.4);
+ -webkit-backdrop-filter: blur(24px) saturate(1.4);
+ transition:
+ border-color 160ms ease,
+ background-color 160ms ease,
+ box-shadow 160ms ease;
+}
+
+#command-dock > :is(#location-bar, #control-panel):hover {
+ background: var(--glass-bg);
+ border-color: var(--glass-border-hover);
+ color: var(--accent);
+
+}
+
+#command-dock > :is(#location-bar, #control-panel).dock-pinned {
+ border-color: rgba(0, 212, 255, 0.55);
+ box-shadow:
+ 0 8px 32px rgba(0, 0, 0, 0.5),
+ 0 0 0 1px rgba(0, 212, 255, 0.08) inset,
+ 0 0 1rem rgba(0, 212, 255, 0.12);
+}
+
+#command-dock #location-bar .location-toolbar {
+ justify-content: flex-start;
+ width: 100%;
+}
+
+#command-dock #location-bar .location-toolbar-label {
+ justify-content: flex-start;
+ width: 100%;
+ text-align: left;
+}
+
+#command-dock #location-bar .location-toolbar-label::after {
+ content: none;
+}
+
+#command-dock #control-panel .panel-header {
+ justify-content: flex-end;
+ width: 100%;
+}
+
+#command-dock #control-panel .panel-title {
+ justify-content: flex-end;
+ width: 100%;
+ text-align: right;
+}
+
+/* These must follow the shared wing skin so the visible borders stay joined. */
+#command-dock > #location-bar {
+ border-top-right-radius: 0;
+ border-bottom-right-radius: 0;
+}
+
+#command-dock > #control-panel {
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 0;
+}
+
+#command-dock #location-bar .location-toolbar,
+#command-dock #control-panel .panel-header {
+ position: relative;
+}
+
+#command-dock #control-panel .panel-header {
+ flex-direction: row;
+ gap: 0;
+}
+
+#command-dock #control-panel .panel-title {
+ flex: 0 0 auto;
+ width: auto;
+}
+
+#command-dock #control-panel .panel-title::before {
+ content: none;
+}
+
+#command-dock #control-panel .panel-divider {
+ display: none;
+}
+
+#gev-voice-control .gev-voice-help-tray {
+ position: absolute;
+ bottom: calc(100% + 0.7rem);
+ left: 50%;
+ z-index: 7;
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+ gap: 0.22rem;
+ box-sizing: border-box;
+ width: max-content;
+ max-width: min(22rem, calc(100vw - 2rem));
+ padding: 0.62rem 0.72rem;
+ visibility: hidden;
+ opacity: 0;
+ color: rgba(223, 245, 250, 0.92);
+ background: rgba(7, 22, 31, 0.96);
+ border: 1px solid rgba(54, 220, 255, 0.34);
+ border-radius: 0.38rem;
+ box-shadow:
+ 0 0.85rem 2rem rgba(0, 0, 0, 0.58),
+ 0 0 1.2rem rgba(0, 212, 255, 0.08);
+ backdrop-filter: blur(24px) saturate(1.3);
+ -webkit-backdrop-filter: blur(24px) saturate(1.3);
+ pointer-events: none;
+ transform: translate(-50%, 0.65rem) scale(0.985);
+ transform-origin: bottom center;
+ transition:
+ opacity 160ms ease,
+ visibility 160ms ease,
+ transform 210ms cubic-bezier(0.2, 0.8, 0.2, 1);
+}
+
+#gev-voice-control .gev-voice-help-kicker {
+ color: rgba(54, 220, 255, 0.72);
+ font-family: var(--font-mono);
+ font-size: 0.46rem;
+ font-weight: 600;
+ letter-spacing: 0.1rem;
+}
+
+#gev-voice-control .gev-voice-help-detail {
+ font-family: var(--font-sans);
+ font-size: 0.7rem;
+ line-height: 1.35;
+ white-space: nowrap;
+}
+
+#gev-voice-control:not([data-status='error']):hover .gev-voice-help-tray,
+#gev-voice-control:not([data-status='error']) #gev-voice-button:focus-visible ~ .gev-voice-help-tray {
+ visibility: visible;
+ opacity: 1;
+ transform: translate(-50%, 0) scale(1);
+}
+
+#command-dock.dock-has-pinned-tray .gev-voice-help-tray {
+ bottom: calc(100% + 1.7rem + var(--dock-pinned-stack-height));
+}
+
+@media (prefers-reduced-motion: reduce) {
+ #gev-voice-control .gev-voice-help-tray {
+ transition: none;
+ }
+ .radio-tuner-needle,
+ .radio-tuner-tick {
+ transition: none;
+ }
+}
+
+#command-dock #location-bar .location-toolbar::after,
+#command-dock #control-panel .panel-header::after {
+ content: '';
+ position: absolute;
+ right: 0.45rem;
+ bottom: 0.12rem;
+ left: 0.45rem;
+ height: 1px;
+ pointer-events: none;
+}
+
+#command-dock #location-bar .location-toolbar::after {
+ background: linear-gradient(90deg, rgba(232, 234, 237, 0.24), rgba(232, 234, 237, 0));
+}
+
+#command-dock #control-panel .panel-header::after {
+ background: linear-gradient(90deg, rgba(232, 234, 237, 0), rgba(232, 234, 237, 0.24));
+}
+
diff --git a/src/ui/styles/command-dock-trays.css b/src/ui/styles/command-dock-trays.css
new file mode 100644
index 000000000..63130d794
--- /dev/null
+++ b/src/ui/styles/command-dock-trays.css
@@ -0,0 +1,483 @@
+/* ── Command dock refinement: stacked trays + voice states ── */
+#command-dock {
+ --dock-voice-width: 8.75rem;
+ --dock-location-pinned-height: 0px;
+ --dock-presets-pinned-height: 0px;
+ --dock-pinned-stack-height: 0px;
+ --dock-lower-pinned-height: 0px;
+ --dock-unified-width: calc(var(--dock-side-compact) * 2 + var(--dock-voice-width));
+ --dock-location-open: max(34rem, calc(var(--dock-unified-width) + 0.75rem));
+ --dock-presets-open: max(34rem, calc(var(--dock-unified-width) + 0.75rem));
+}
+
+#command-dock .panel-title,
+#command-dock .location-toolbar-label {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.42rem;
+ color: rgba(206, 232, 239, 0.72);
+ font-size: 0.58rem;
+ font-weight: 500;
+ letter-spacing: 0.13rem;
+}
+
+#command-dock .dock-label-icon {
+ display: inline-block;
+ flex: 0 0 1rem;
+ width: 1rem;
+ height: 1rem;
+ background: rgba(232, 234, 237, 0.3);
+ mask-position: center;
+ mask-repeat: no-repeat;
+ mask-size: contain;
+ -webkit-mask-position: center;
+ -webkit-mask-repeat: no-repeat;
+ -webkit-mask-size: contain;
+ transition: background-color 160ms ease, filter 160ms ease;
+}
+
+#command-dock .dock-label-icon-location {
+ mask-image: url('/location.svg');
+ -webkit-mask-image: url('/location.svg');
+}
+
+#command-dock .dock-label-icon-presets {
+ mask-image: url('/visual-presets.svg');
+ -webkit-mask-image: url('/visual-presets.svg');
+}
+
+#command-dock :is(#location-bar, #control-panel):hover .dock-label-icon,
+#command-dock :is(#location-bar, #control-panel).dock-pinned .dock-label-icon {
+ background: var(--accent);
+ filter: drop-shadow(0 0 0.35rem rgba(0, 212, 255, 0.28));
+}
+
+#command-dock :is(#location-bar, #control-panel):hover .location-toolbar-label,
+#command-dock :is(#location-bar, #control-panel):hover .panel-title{
+ color: var(--accent);
+}
+
+
+
+#command-dock #control-panel .panel-header {
+ justify-content: center;
+}
+
+#command-dock #location-bar .dock-tray-toggle {
+ display: flex;
+ box-sizing: border-box;
+ width: 100%;
+ min-width: 0;
+ padding: 0;
+ color: inherit;
+ background: transparent;
+ border: 0;
+ font: inherit;
+ cursor: pointer;
+ outline: none;
+}
+
+#command-dock #location-bar .dock-tray-toggle:focus-visible {
+ outline: 2px solid var(--text-primary);
+ outline-offset: 3px;
+ border-radius: 3px;
+}
+
+#command-dock #control-panel .dock-tray-toggle {
+ box-sizing: border-box;
+ width: 100%;
+ color: inherit;
+ background: transparent;
+ border: 0;
+ font: inherit;
+ cursor: pointer;
+ outline: none;
+}
+
+#command-dock #control-panel .dock-tray-toggle:focus-visible {
+ outline: 1px solid color-mix(in srgb, var(--accent) 80%, transparent);
+ outline-offset: 3px;
+ border-radius: 3px;
+}
+
+#command-dock #control-panel .panel-title {
+ justify-content: center;
+ width: 100%;
+ text-align: center;
+}
+
+#command-dock #control-panel .panel-divider {
+ display: none;
+}
+
+#command-dock .location-toolbar-label,
+#command-dock #control-panel .panel-title {
+ position: relative;
+ padding-bottom: 0.4rem;
+}
+
+#command-dock .location-toolbar-label::after,
+#command-dock #control-panel .panel-title::after {
+ content: '';
+ position: absolute;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ display: block;
+ height: 1px;
+}
+
+#command-dock .location-toolbar-label::after {
+ background: linear-gradient(to right, rgba(232, 234, 237, 0.3), transparent);
+}
+
+#command-dock #control-panel .panel-title::after {
+ background: linear-gradient(to left, rgba(232, 234, 237, 0.3), transparent);
+}
+
+#command-dock .panel-title::after,
+#command-dock .location-toolbar-label::after,
+#command-dock #control-panel .panel-title::after {
+ content: none;
+ display: none;
+}
+
+#command-dock .dock-popover-content {
+ padding: 0.7rem;
+}
+
+#command-dock .dock-pin-btn {
+ position: relative;
+ top: auto;
+ right: auto;
+ align-self: flex-end;
+ display: none;
+ place-items: center;
+ width: 1.65rem;
+ min-width: 1.65rem;
+ height: 1.65rem;
+ margin: -1.48rem -0.22rem 0.25rem 0;
+ padding: 0;
+ border-radius: 50%;
+ background: rgba(8, 24, 34, 0.96);
+ box-shadow: 0 0.35rem 0.9rem rgba(0, 0, 0, 0.5);
+ transform: translateY(-0.12rem);
+}
+
+#command-dock #location-bar:not(.collapsed) .dock-pin-btn,
+#command-dock #control-panel:not(.collapsed) .dock-pin-btn {
+ display: grid;
+}
+
+#command-dock .dock-pin-btn img {
+ width: 0.9rem;
+ height: 0.9rem;
+ opacity: 0.58;
+ transition: opacity 160ms ease, transform 160ms ease;
+}
+
+#command-dock #location-bar .dock-pin-btn {
+ align-self: flex-start;
+ margin-right: 0;
+ margin-left: -0.22rem;
+}
+
+#command-dock .dock-pin-btn:hover img,
+#command-dock .dock-pin-btn[aria-pressed='true'] img {
+ opacity: 1;
+ transform: rotate(-12deg) scale(1.08);
+}
+
+#command-dock.dock-has-pinned-tray #location-bar:not(.collapsed):not(.dock-pinned) .dock-popover-content,
+#command-dock.dock-has-pinned-tray #control-panel:not(.collapsed):not(.dock-pinned) .dock-popover-content {
+ bottom: calc(100% + 1.2rem + var(--dock-pinned-stack-height));
+}
+
+#command-dock.dock-has-two-pinned-trays .dock-pinned-top.dock-pinned:not(.collapsed) .dock-popover-content {
+ bottom: calc(100% + 1.2rem + var(--dock-lower-pinned-height));
+}
+
+#command-dock.dock-has-pinned-tray .gev-voice-error-tray {
+ bottom: calc(100% + 1.7rem + var(--dock-pinned-stack-height));
+}
+
+#command-dock .location-pill,
+#command-dock .poi-pill,
+#command-dock .btn-label {
+ font-size: 0.56rem;
+}
+
+#command-dock #location-search,
+#command-dock #location-search.expanded {
+ font-size: 0.68rem;
+}
+
+#command-dock > #gev-voice-control {
+ grid-template-columns: 3rem minmax(0, 1fr);
+ grid-template-rows: 0.8rem 2.25rem 0.85rem;
+ gap: 0.12rem 0.28rem;
+ width: var(--dock-voice-width);
+ flex-basis: var(--dock-voice-width);
+ height: 5.35rem;
+ margin-top: -0.97rem;
+ margin-bottom: -0.97rem;
+ padding: 0.32rem 0.38rem 0.3rem;
+ overflow: visible;
+}
+
+#command-dock .gev-voice-heading {
+ grid-column: 2;
+ grid-row: 1;
+ display: flex;
+ align-items: center;
+ justify-content: flex-start;
+ gap: 0.35rem;
+ min-width: 0;
+}
+
+#command-dock .gev-voice-kicker {
+ position: static;
+ padding-right: 0;
+ font-size: 0.46rem;
+ font-weight: 500;
+ letter-spacing: 0.08rem;
+}
+
+#command-dock #gev-voice-button {
+ grid-column: 1;
+ grid-row: 1 / 4;
+ align-self: center;
+ width: 2.65rem;
+ height: 4.15rem;
+ background: transparent;
+ border: 0;
+ border-radius: 0;
+ box-shadow: none;
+}
+
+#command-dock .gev-mic-orbit {
+ flex: 0 0 2.45rem;
+ width: 2.45rem;
+ height: 2.45rem;
+ aspect-ratio: 1;
+ box-sizing: border-box;
+ background: rgba(0, 212, 255, 0.06);
+ border: 1px solid rgba(0, 212, 255, 0.48);
+ border-radius: 50%;
+ box-shadow: 0 0 0 0.18rem rgba(0, 212, 255, 0.06), 0 0 0.9rem rgba(0, 212, 255, 0.12);
+}
+
+#command-dock .gev-mic-label {
+ display: block;
+ margin-top: 0.18rem;
+ font-size: 0.42rem;
+ letter-spacing: 0.035rem;
+}
+
+#command-dock .gev-voice-visualizer {
+ grid-column: 2;
+ grid-row: 2;
+ align-self: stretch;
+ box-sizing: border-box;
+ height: 2.25rem;
+ padding: 0.3rem 0.05rem 0.12rem;
+ overflow: hidden;
+ visibility: visible;
+ opacity: 0.54;
+ transform: none;
+ transition: opacity 180ms ease;
+}
+
+#command-dock #gev-voice-control[data-status='connecting'] .gev-voice-visualizer,
+#command-dock #gev-voice-control[data-status='listening'] .gev-voice-visualizer,
+#command-dock #gev-voice-control[data-status='executing'] .gev-voice-visualizer {
+ visibility: visible;
+ opacity: 1;
+ transform: none;
+}
+
+#command-dock #gev-voice-status {
+ position: static;
+ width: auto;
+ padding-top: 0;
+ color: var(--accent);
+ font-size: 0.43rem;
+ text-align: left;
+}
+
+#command-dock #gev-voice-detail {
+ grid-column: 2;
+ grid-row: 3;
+ align-self: start;
+ padding-top: 0.12rem;
+ max-width: 100%;
+ overflow: hidden;
+ font-size: 0.39rem;
+ font-weight: 500;
+ letter-spacing: 0.035rem;
+ text-align: left;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+#command-dock #gev-voice-control[data-status='connecting'] #gev-voice-detail,
+#command-dock #gev-voice-control[data-status='listening'] #gev-voice-detail,
+#command-dock #gev-voice-control[data-status='executing'] #gev-voice-detail {
+ grid-row: 3;
+ font-size: 0.43rem;
+}
+
+#command-dock #gev-voice-control[data-status='error'] {
+ display: grid;
+ align-items: initial;
+ width: var(--dock-voice-width);
+ border-color: rgba(255, 92, 110, 0.58);
+ border-radius: 0.4rem;
+}
+
+#command-dock #gev-voice-control[data-status='error'] .gev-voice-readout {
+ display: contents;
+}
+
+#command-dock #gev-voice-control[data-status='error'] #gev-voice-detail {
+ max-width: none;
+ overflow: hidden;
+ color: #ffb4bd;
+ line-height: 1.2;
+ text-align: center;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+#command-dock .gev-voice-error-tray {
+ position: absolute;
+ bottom: calc(100% + 0.7rem);
+ left: 50%;
+ z-index: 8;
+ width: clamp(19rem, 29vw, 24rem);
+ padding: 0.85rem 0.9rem;
+ visibility: hidden;
+ opacity: 0;
+ color: rgba(255, 220, 224, 0.92);
+ background: rgba(34, 10, 16, 0.96);
+ border: 1px solid rgba(255, 92, 110, 0.5);
+ border-radius: 0.42rem;
+ box-shadow: 0 0.9rem 2.2rem rgba(0, 0, 0, 0.62), 0 0 1.4rem rgba(255, 92, 110, 0.08);
+ backdrop-filter: blur(28px) saturate(1.25);
+ -webkit-backdrop-filter: blur(28px) saturate(1.25);
+ pointer-events: none;
+ transform: translate(-50%, 0.55rem) scale(0.985);
+ transform-origin: bottom center;
+ transition: opacity 180ms ease, visibility 180ms ease, transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
+}
+
+#command-dock #gev-voice-control[data-status='error']:not(.error-dismissed) .gev-voice-error-tray {
+ visibility: visible;
+ opacity: 1;
+ pointer-events: auto;
+ transform: translate(-50%, 0) scale(1);
+}
+
+#command-dock .gev-voice-error-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 0.75rem;
+ color: #ff8f9d;
+ font-family: var(--font-mono);
+ font-size: 0.62rem;
+ font-weight: 600;
+ letter-spacing: 0.1rem;
+}
+
+#command-dock .gev-voice-error-dismiss {
+ padding: 0.25rem 0.42rem;
+ color: rgba(255, 220, 224, 0.72);
+ background: rgba(255, 255, 255, 0.04);
+ border: 1px solid rgba(255, 143, 157, 0.32);
+ border-radius: 0.2rem;
+ font-family: var(--font-mono);
+ font-size: 0.43rem;
+ letter-spacing: 0.06rem;
+ cursor: pointer;
+}
+
+#command-dock #gev-voice-error-detail {
+ margin-top: 0.65rem;
+ color: rgba(255, 232, 235, 0.92);
+ font-family: var(--font-sans);
+ font-size: 0.78rem;
+ line-height: 1.45;
+}
+
+#command-dock .gev-voice-error-hint {
+ margin-top: 0.5rem;
+ color: rgba(255, 196, 203, 0.58);
+ font-family: var(--font-mono);
+ font-size: 0.52rem;
+ line-height: 1.45;
+ letter-spacing: 0.035rem;
+}
+
+/* The compact dock leaves both lower corners free for required attribution and telemetry. */
+body:not(.ui-clean-view):not(.recording-mode) #cesium-credits,
+body:not(.ui-clean-view):not(.recording-mode):has(#intel-hud[data-variant='minimal'].active) #cesium-credits {
+ right: auto;
+ bottom: 0.75rem;
+ left: 1.5rem;
+ width: auto !important;
+ max-width: calc(50vw - 15rem);
+ text-align: left;
+}
+
+#intel-hud[data-variant='tactical'] .hud-bottom-left,
+#intel-hud[data-variant='tactical'] .hud-bottom-right,
+#intel-hud[data-variant='operator'] .hud-bottom-left,
+#intel-hud[data-variant='operator'] .hud-bottom-right {
+ bottom: calc(2vh + 6.5rem);
+}
+
+#intel-hud[data-variant='operator'] .hud-bottom-bar {
+ bottom: calc(2vh + 9.8rem);
+ width: min(48vw, 680px);
+}
+
+#intel-hud[data-variant='minimal'] .hud-bottom-left {
+ bottom: calc(2vh + 5.4rem);
+}
+
+#intel-hud[data-variant='minimal'] .hud-bottom-bar {
+ bottom: calc(2vh + 9rem);
+}
+
+@media (max-width: 900px) {
+ body:not(.ui-clean-view):not(.recording-mode) #cesium-credits,
+ body:not(.ui-clean-view):not(.recording-mode):has(#intel-hud[data-variant='minimal'].active) #cesium-credits {
+ bottom: calc(2vh + 5rem);
+ left: 0.75rem;
+ max-width: calc(100vw - 1.5rem);
+ }
+
+ #command-dock .gev-voice-error-tray {
+ width: min(24rem, calc(100vw - 1.5rem));
+ }
+}
+
+@media (max-width: 620px) {
+ #command-dock {
+ --dock-side-compact: 3.25rem;
+ --dock-voice-width: 8.75rem;
+ }
+
+ #command-dock .panel-title,
+ #command-dock .location-toolbar-label {
+ max-width: 2.3rem;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
+
+ #left-panel-stack {
+ bottom: calc(50vh + 8px);
+ }
+}
+
diff --git a/src/ui/styles/command-dock.css b/src/ui/styles/command-dock.css
new file mode 100644
index 000000000..eb15e2884
--- /dev/null
+++ b/src/ui/styles/command-dock.css
@@ -0,0 +1,301 @@
+/* ── Unified Command Dock ────────────────────── */
+#command-dock {
+ position: fixed;
+ right: auto;
+ bottom: 2vh;
+ left: 50%;
+ z-index: 145;
+ display: grid;
+ grid-template-areas: 'locations voice presets';
+ grid-template-columns: minmax(300px, 1fr) minmax(230px, 270px) minmax(390px, 1.15fr);
+ align-items: stretch;
+ width: min(94vw, 1240px);
+ padding: 6px;
+ overflow: visible;
+ background: rgba(9, 18, 27, 0.84);
+ border: 1px solid rgba(123, 189, 211, 0.28);
+ border-radius: 12px;
+ box-shadow:
+ 0 12px 36px rgba(0, 0, 0, 0.58),
+ 0 0 0 1px rgba(255, 255, 255, 0.03) inset,
+ 0 0 28px rgba(0, 212, 255, 0.06);
+ backdrop-filter: blur(28px) saturate(1.35);
+ -webkit-backdrop-filter: blur(28px) saturate(1.35);
+ transform: translateX(-50%);
+ transition: opacity var(--transition-smooth), visibility var(--transition-smooth);
+}
+
+#command-dock > #location-bar,
+#command-dock > #control-panel,
+#command-dock > #gev-voice-control {
+ position: relative;
+ inset: auto;
+ width: auto;
+ max-width: none;
+ transform: none;
+}
+
+#command-dock > #location-bar {
+ grid-area: locations;
+ min-width: 0;
+ border-right: 1px solid rgba(123, 189, 211, 0.16);
+}
+
+#command-dock > #control-panel {
+ grid-area: presets;
+ min-width: 0;
+ border-left: 1px solid rgba(123, 189, 211, 0.16);
+}
+
+#command-dock > #gev-voice-control {
+ grid-area: voice;
+ z-index: 2;
+ align-self: stretch;
+ justify-content: center;
+ min-width: 0;
+ margin: -14px 0;
+ padding: 19px 14px 12px;
+ border-color: rgba(0, 212, 255, 0.36);
+ border-radius: 12px;
+ background: rgba(8, 31, 42, 0.94);
+ box-shadow:
+ 0 12px 30px rgba(0, 0, 0, 0.56),
+ 0 0 26px rgba(0, 212, 255, 0.12),
+ 0 0 0 1px rgba(0, 212, 255, 0.08) inset;
+}
+
+#command-dock .gev-voice-kicker {
+ position: absolute;
+ top: 6px;
+ right: 14px;
+ left: 14px;
+ overflow: hidden;
+ color: rgba(190, 221, 230, 0.52);
+ font-family: var(--font-mono);
+ font-size: 7px;
+ letter-spacing: 1.5px;
+ text-align: center;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+#command-dock #gev-voice-button {
+ width: 78px;
+ height: 42px;
+}
+
+#command-dock .gev-voice-readout {
+ flex: 1;
+ text-align: left;
+}
+
+#command-dock #gev-voice-detail {
+ max-width: 110px;
+}
+
+#command-dock .panel-glow {
+ display: none;
+}
+
+#command-dock .panel-inner,
+#command-dock .location-inner,
+#command-dock #control-panel.collapsed .panel-inner,
+#command-dock #location-bar.collapsed .location-inner {
+ height: 100%;
+ padding: 8px 14px;
+ background: transparent;
+ border: 0;
+ border-radius: 0;
+ box-shadow: none;
+ backdrop-filter: none;
+ -webkit-backdrop-filter: none;
+}
+
+#command-dock .panel-header,
+#command-dock .location-toolbar,
+#command-dock #control-panel.collapsed .panel-header {
+ min-height: 18px;
+ margin: 0 0 6px;
+ padding: 0;
+}
+
+#command-dock .panel-title,
+#command-dock .location-toolbar-label {
+ font-size: 8px;
+ letter-spacing: 1.6px;
+ color: rgba(190, 221, 230, 0.58);
+}
+
+#command-dock .panel-collapse-btn,
+#command-dock .panel-mini-status,
+#command-dock .location-mini-status {
+ display: none !important;
+}
+
+#command-dock #control-panel.collapsed .button-grid,
+#command-dock #location-bar.collapsed .location-city-row {
+ display: flex !important;
+}
+
+#command-dock .button-grid {
+ gap: 6px;
+}
+
+#command-dock .style-btn {
+ min-width: 52px;
+ gap: 4px;
+ padding: 9px 8px 7px;
+ border-radius: 7px;
+}
+
+#command-dock .btn-icon {
+ font-size: 16px;
+}
+
+#command-dock .btn-label {
+ font-family: var(--font-mono);
+ font-size: 8px;
+ letter-spacing: 0.4px;
+ text-transform: uppercase;
+}
+
+#command-dock .btn-key {
+ top: 3px;
+ right: 4px;
+ font-size: 7px;
+}
+
+#command-dock .location-city-row {
+ min-width: 0;
+ gap: 8px;
+}
+
+#command-dock .location-search-wrap {
+ order: -1;
+ flex: 0 1 190px;
+ min-width: 132px;
+ padding-right: 8px;
+ border-right: 1px solid rgba(123, 189, 211, 0.14);
+}
+
+#command-dock .search-toggle-btn {
+ width: 30px;
+ height: 30px;
+ border-radius: 6px;
+}
+
+#command-dock #location-search,
+#command-dock #location-search.expanded {
+ width: 100%;
+ min-width: 0;
+ padding: 6px 8px;
+ font-size: 11px;
+}
+
+#command-dock .location-pills {
+ flex: 1;
+ min-width: 0;
+}
+
+#command-dock .location-pill {
+ padding: 7px 10px;
+ border-radius: 6px;
+ font-family: var(--font-mono);
+ font-size: 9px;
+ text-transform: uppercase;
+}
+
+#command-dock .poi-row-container.expanded {
+ margin-bottom: 4px;
+}
+
+/* Keep required map attribution clear of the full-width command surface. */
+body:not(.ui-clean-view):not(.recording-mode) #cesium-credits {
+ bottom: calc(2vh + 7rem);
+}
+
+body:not(.ui-clean-view):not(.recording-mode):has(#intel-hud[data-variant='minimal'].active) #cesium-credits {
+ right: 36px;
+ left: auto;
+ width: min(340px, calc(100vw - 72px)) !important;
+ text-align: right;
+}
+
+body.ui-clean-view #command-dock,
+body.recording-mode #command-dock {
+ opacity: 0 !important;
+ visibility: hidden !important;
+ pointer-events: none !important;
+}
+
+body.ui-clean-view #cesium-credits,
+body.recording-mode #cesium-credits {
+ right: auto;
+ bottom: 36px;
+ left: 36px;
+}
+
+#intel-hud[data-variant='minimal'] .hud-bottom-left {
+ bottom: calc(2vh + 7.5rem);
+}
+
+#intel-hud[data-variant='minimal'] .hud-bottom-bar {
+ bottom: calc(2vh + 11.5rem);
+}
+
+@media (max-width: 980px) {
+ #command-dock {
+ grid-template-areas:
+ 'locations voice'
+ 'presets presets';
+ grid-template-columns: minmax(0, 1fr) minmax(170px, 210px);
+ width: calc(100vw - 24px);
+ }
+
+ #command-dock > #location-bar {
+ border-right: 1px solid rgba(123, 189, 211, 0.16);
+ border-bottom: 1px solid rgba(123, 189, 211, 0.16);
+ }
+
+ #command-dock > #control-panel {
+ border-top: 1px solid rgba(123, 189, 211, 0.16);
+ border-left: 0;
+ }
+
+ #command-dock > #gev-voice-control {
+ margin: -10px 0 0;
+ }
+
+ body:not(.ui-clean-view):not(.recording-mode) #cesium-credits {
+ bottom: calc(2vh + 9.5rem);
+ }
+
+ #intel-hud[data-variant='minimal'] .hud-bottom-left {
+ bottom: calc(2vh + 12rem);
+ }
+
+ #intel-hud[data-variant='minimal'] .hud-bottom-bar {
+ bottom: calc(2vh + 16rem);
+ }
+}
+
+@media (max-width: 720px) {
+ #command-dock {
+ bottom: 8px;
+ }
+
+ #command-dock .location-search-wrap {
+ flex-basis: 150px;
+ }
+
+ #command-dock .panel-inner,
+ #command-dock .location-inner,
+ #command-dock #control-panel.collapsed .panel-inner,
+ #command-dock #location-bar.collapsed .location-inner {
+ padding: 7px 9px;
+ }
+
+ #left-panel-stack {
+ bottom: calc(50vh + 8px);
+ }
+}
diff --git a/src/ui/styles/controls.css b/src/ui/styles/controls.css
new file mode 100644
index 000000000..b40a2ee8b
--- /dev/null
+++ b/src/ui/styles/controls.css
@@ -0,0 +1,1061 @@
+/* ── Control Panel ────────────────────────────── */
+#control-panel {
+ position: fixed;
+ bottom: 36px;
+ left: 50%;
+ transform: translateX(-50%);
+ z-index: 100;
+ width: auto;
+ max-width: 680px;
+}
+
+#control-panel .panel-glow {
+ position: absolute;
+ inset: -30px;
+ background: radial-gradient(ellipse at center bottom, var(--accent-dim) 0%, transparent 60%);
+ filter: blur(30px);
+ opacity: 0.4;
+ pointer-events: none;
+}
+
+.panel-inner {
+ position: relative;
+ background: var(--glass-bg);
+ border: 1px solid var(--glass-border);
+ border-radius: var(--panel-radius);
+ padding: 16px 20px 18px;
+ backdrop-filter: blur(24px) saturate(1.4);
+ -webkit-backdrop-filter: blur(24px) saturate(1.4);
+ box-shadow:
+ 0 8px 32px rgba(0, 0, 0, 0.5),
+ 0 0 0 1px rgba(255, 255, 255, 0.03) inset,
+ 0 1px 0 rgba(255, 255, 255, 0.06) inset;
+}
+
+.panel-header {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ margin-bottom: 14px;
+ padding: 0 4px;
+}
+
+.panel-mini-status {
+ display: none;
+ align-items: center;
+ gap: 8px;
+ padding: 0 6px 2px;
+}
+
+#control-panel.collapsed .panel-mini-status {
+ display: flex;
+}
+
+.panel-mini-label {
+ font-family: var(--font-mono);
+ font-size: 8px;
+ letter-spacing: 1.4px;
+ color: var(--text-dim);
+ text-transform: uppercase;
+}
+
+.panel-mini-value {
+ font-family: var(--font-mono);
+ font-size: 9px;
+ letter-spacing: 1.8px;
+ color: var(--accent);
+ text-transform: uppercase;
+ text-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
+}
+
+.panel-drag-handle {
+ cursor: grab;
+ user-select: none;
+}
+
+.panel-drag-handle:active {
+ cursor: grabbing;
+}
+
+.panel-drag-handle.compact {
+ margin-left: auto;
+ margin-bottom: 2px;
+ padding: 2px 8px;
+ border-radius: 999px;
+ border: 1px solid rgba(255, 255, 255, 0.12);
+ background: rgba(255, 255, 255, 0.04);
+ font-family: var(--font-mono);
+ font-size: 8px;
+ letter-spacing: 1.4px;
+ color: var(--text-dim);
+}
+
+.panel-drag-handle.compact:hover {
+ color: var(--text-primary);
+ border-color: var(--glass-border-hover);
+}
+
+.panel-dragging {
+ opacity: 0.96;
+}
+
+.panel-title {
+ font-family: var(--font-mono);
+ font-size: 9px;
+ letter-spacing: 3px;
+ color: var(--text-dim);
+ text-transform: uppercase;
+ white-space: nowrap;
+}
+
+.panel-divider {
+ flex: 1;
+ height: 1px;
+ background: linear-gradient(to right, var(--glass-border), transparent);
+}
+
+.panel-collapse-btn {
+ width: 22px;
+ height: 22px;
+ border-radius: 6px;
+ border: 1px solid rgba(255, 255, 255, 0.12);
+ background: rgba(255, 255, 255, 0.03);
+ color: var(--text-dim);
+ font-family: var(--font-mono);
+ font-size: 13px;
+ line-height: 1;
+ cursor: pointer;
+ transition:
+ background-color var(--transition-fast),
+ border-color var(--transition-fast),
+ color var(--transition-fast);
+}
+
+.panel-collapse-btn:hover {
+ border-color: var(--glass-border-hover);
+ color: var(--text-primary);
+ background: rgba(255, 255, 255, 0.07);
+}
+
+/* ── Button Grid ──────────────────────────────── */
+.button-grid {
+ display: flex;
+ gap: 8px;
+ overflow-x: auto;
+ scroll-behavior: smooth;
+ scrollbar-width: none;
+ -ms-overflow-style: none;
+}
+
+.button-grid::-webkit-scrollbar {
+ display: none;
+}
+
+.style-btn {
+ position: relative;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 6px;
+ padding: 14px 16px 10px;
+ min-width: 78px;
+ flex-shrink: 0;
+ background: rgba(255, 255, 255, 0.03);
+ border: 1px solid rgba(255, 255, 255, 0.06);
+ border-radius: var(--btn-radius);
+ cursor: pointer;
+ /* Keep the keyboard focus outline immediate. */
+ transition:
+ background-color var(--transition-fast),
+ border-color var(--transition-fast),
+ box-shadow var(--transition-fast),
+ color var(--transition-fast),
+ transform var(--transition-fast);
+ overflow: hidden;
+ outline: none;
+}
+
+/* Keep keyboard focus visible inside the scrolling preset row. */
+.style-btn:focus-visible {
+ outline: 2px solid var(--text-primary);
+ outline-offset: -3px;
+}
+
+.style-btn::before {
+ content: '';
+ position: absolute;
+ inset: 0;
+ background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, transparent 100%);
+ opacity: 0;
+ transition: opacity var(--transition-fast);
+}
+
+.style-btn:hover {
+ border-color: var(--glass-border-hover);
+ background: rgba(255, 255, 255, 0.06);
+ transform: translateY(-1px);
+}
+
+.style-btn:hover::before {
+ opacity: 1;
+}
+
+.style-btn:active {
+ transform: translateY(0);
+}
+
+.style-btn.active {
+ border-color: var(--accent);
+ background: var(--accent-dim);
+ box-shadow:
+ 0 0 20px rgba(0, 212, 255, 0.15),
+ 0 0 0 1px rgba(0, 212, 255, 0.1) inset;
+}
+
+.style-btn.active .btn-icon {
+ color: var(--accent);
+ text-shadow: 0 0 12px var(--accent-glow);
+}
+
+.style-btn.active .btn-label {
+ color: var(--text-primary);
+}
+
+.btn-icon {
+ font-size: 20px;
+ line-height: 1;
+ color: var(--text-secondary);
+ transition:
+ color var(--transition-fast),
+ text-shadow var(--transition-fast);
+}
+
+.btn-label {
+ font-family: var(--font-sans);
+ font-size: 11px;
+ font-weight: 500;
+ color: var(--text-secondary);
+ letter-spacing: 0.3px;
+ transition: color var(--transition-fast);
+}
+
+.btn-key {
+ position: absolute;
+ top: 6px;
+ right: 6px;
+ font-family: var(--font-mono);
+ font-size: 8px;
+ color: var(--text-dim);
+ opacity: 0;
+ transition: opacity var(--transition-fast);
+}
+
+.style-btn:hover .btn-key,
+.style-btn.active .btn-key {
+ opacity: 1;
+}
+
+/* ── Loading Screen ───────────────────────────── */
+#loading-screen {
+ position: fixed;
+ inset: 0;
+ z-index: 1000;
+ background: var(--bg-dark);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ transition: opacity 0.8s ease, visibility 0.8s ease;
+}
+
+#loading-screen.hidden {
+ opacity: 0;
+ visibility: hidden;
+ pointer-events: none;
+}
+
+.loader-content {
+ text-align: center;
+}
+
+.loader-logo {
+ display: block;
+ width: 128px;
+ height: auto;
+ margin: 0 auto 24px;
+ filter: drop-shadow(0 0 24px rgba(0, 246, 255, 0.42));
+ animation: logo-pulse 2s ease-in-out infinite;
+}
+
+@keyframes logo-pulse {
+ 0%, 100% { opacity: 0.72; transform: scale(0.98); }
+ 50% { opacity: 1; transform: scale(1.02); }
+}
+
+.loader-content h2 {
+ font-family: var(--font-mono);
+ font-size: 18px;
+ font-weight: 600;
+ letter-spacing: 6px;
+ color: var(--text-primary);
+ margin-bottom: 12px;
+}
+
+.loader-status {
+ font-family: var(--font-mono);
+ font-size: 11px;
+ letter-spacing: 2px;
+ color: var(--text-dim);
+ animation: pulse 2s ease-in-out infinite;
+}
+
+@keyframes pulse {
+ 0%, 100% { opacity: 0.4; }
+ 50% { opacity: 1; }
+}
+
+/* ── Post-Processing Toggles ─────────────────── */
+#pp-toggles {
+ --pp-expanded-width: var(--display-panel-expanded-width);
+ position: relative;
+ z-index: 110;
+ width: var(--pp-expanded-width);
+ max-width: 100%;
+ display: flex;
+ flex-direction: column;
+ align-items: flex-end;
+ gap: 7px;
+}
+
+#pp-toggles:not(.collapsed) {
+ box-sizing: border-box;
+ padding: 8px;
+ border: 1px solid var(--glass-border);
+ border-radius: var(--panel-radius);
+ background: var(--glass-bg);
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.04);
+ backdrop-filter: blur(24px) saturate(1.4);
+ -webkit-backdrop-filter: blur(24px) saturate(1.4);
+}
+
+#pp-toggles:not(.collapsed) > .pp-header-row,
+#pp-toggles:not(.collapsed) > .pp-toggle-group,
+#pp-toggles:not(.collapsed) > #clean-view-toggle {
+ width: 100%;
+}
+
+.pp-toggle-btn {
+ display: flex;
+ align-items: center;
+ gap: 5px;
+ padding: 7px 12px;
+ background: var(--glass-bg);
+ border: 1px solid var(--glass-border);
+ border-radius: 8px;
+ backdrop-filter: blur(16px);
+ -webkit-backdrop-filter: blur(16px);
+ cursor: pointer;
+ transition:
+ background-color var(--transition-fast),
+ border-color var(--transition-fast),
+ box-shadow var(--transition-fast),
+ color var(--transition-fast),
+ border-radius var(--transition-fast);
+ outline: none;
+}
+
+.pp-toggle-group {
+ width: var(--pp-expanded-width);
+ max-width: 100%;
+}
+
+#pp-toggles .pp-toggle-btn {
+ width: 100%;
+ min-height: 38px;
+ box-sizing: border-box;
+}
+
+#pp-toggles .pp-header-row {
+ width: var(--pp-expanded-width);
+ max-width: 100%;
+ min-height: 42px;
+ box-sizing: border-box;
+ margin-left: auto;
+ margin-bottom: 0;
+ padding: 8px 10px 8px 14px;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 8px;
+ border: 1px solid var(--glass-border);
+ border-radius: var(--panel-radius);
+ background: var(--glass-bg);
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.04);
+ backdrop-filter: blur(24px) saturate(1.4);
+ -webkit-backdrop-filter: blur(24px) saturate(1.4);
+ cursor: default;
+}
+
+/* Expanded Display already owns the glass shell. Keep its header visually
+ * integrated with that container, matching the other expanded panel headers;
+ * the collapsed launcher retains the standalone card treatment above. */
+#pp-toggles:not(.collapsed) > .pp-header-row {
+ min-height: 32px;
+ padding: 0 4px;
+ border: 0;
+ border-radius: 0;
+ background: transparent;
+ box-shadow: none;
+ backdrop-filter: none;
+ -webkit-backdrop-filter: none;
+}
+
+#pp-toggles .pp-header-label {
+ font-family: var(--font-mono);
+ font-size: 8px;
+ letter-spacing: 1.4px;
+ color: var(--text-dim);
+}
+
+#pp-toggles > .pp-header-row .pp-collapse-btn {
+ width: 20px;
+ height: 20px;
+ border-radius: 6px;
+ font-size: 12px;
+ padding: 0;
+}
+
+#pp-toggles.collapsed {
+ gap: 0;
+}
+
+#pp-toggles.collapsed .pp-header-row {
+ width: var(--right-collapsed-width, 132px);
+}
+
+#pp-toggles.collapsed .pp-toggle-group,
+#pp-toggles.collapsed #clean-view-toggle,
+#pp-toggles.collapsed #param-slider-panel {
+ display: none;
+}
+
+.pp-toggle-btn:hover {
+ border-color: var(--glass-border-hover);
+ background: rgba(255, 255, 255, 0.06);
+}
+
+.pp-toggle-btn.active {
+ border-color: var(--accent);
+ background: var(--accent-dim);
+ box-shadow: 0 0 12px rgba(0, 212, 255, 0.15);
+}
+
+.pp-icon {
+ font-size: 14px;
+ line-height: 1;
+}
+
+.pp-icon.material-symbols-outlined {
+ width: 14px;
+ overflow: hidden;
+ font-family: 'Material Symbols Outlined';
+ font-size: 14px;
+ font-weight: 400;
+ font-style: normal;
+ font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
+}
+
+.pp-label {
+ font-family: var(--font-mono);
+ font-size: 9px;
+ letter-spacing: 1.5px;
+ color: var(--text-secondary);
+ text-transform: uppercase;
+}
+
+.pp-toggle-btn.active .pp-label {
+ color: var(--accent);
+}
+
+/* ── Bloom Slider (inline with toggle) ───────── */
+.pp-toggle-group {
+ display: flex;
+ flex-direction: column;
+ gap: 0;
+}
+
+.pp-slider-row {
+ display: none;
+ align-items: center;
+ gap: 6px;
+ padding: 5px 10px 6px;
+ background: var(--glass-bg);
+ border: 1px solid var(--glass-border);
+ border-top: none;
+ border-radius: 0 0 8px 8px;
+ backdrop-filter: blur(16px);
+ -webkit-backdrop-filter: blur(16px);
+}
+
+.pp-slider-row.visible {
+ display: flex;
+}
+
+.pp-toggle-group .pp-slider-row.visible ~ .pp-toggle-btn,
+.pp-toggle-group:has(.pp-slider-row.visible) .pp-toggle-btn {
+ border-radius: 8px 8px 0 0;
+}
+
+.pp-slider {
+ flex: 1;
+ -webkit-appearance: none;
+ appearance: none;
+ height: 3px;
+ background: rgba(255, 255, 255, 0.08);
+ border-radius: 2px;
+ outline: none;
+ cursor: pointer;
+ min-width: 60px;
+}
+
+.pp-slider::-webkit-slider-thumb {
+ -webkit-appearance: none;
+ appearance: none;
+ width: 10px;
+ height: 10px;
+ border-radius: 50%;
+ background: var(--accent);
+ box-shadow: 0 0 6px var(--accent-glow);
+ cursor: pointer;
+}
+
+.pp-slider::-moz-range-thumb {
+ width: 10px;
+ height: 10px;
+ border-radius: 50%;
+ background: var(--accent);
+ border: none;
+ box-shadow: 0 0 6px var(--accent-glow);
+ cursor: pointer;
+}
+
+.pp-slider-value {
+ font-family: var(--font-mono);
+ font-size: 9px;
+ letter-spacing: 0.5px;
+ color: var(--accent);
+ min-width: 28px;
+ text-align: right;
+ flex-shrink: 0;
+}
+
+/* Quantitative companion sliders share Display / Sharpen's visible rail,
+ * circular thumb, glow, and value treatment while retaining a taller hit area. */
+.gev-quantitative-slider {
+ width: 100%;
+ min-width: 0;
+ height: 18px;
+ margin: 0;
+ -webkit-appearance: none;
+ appearance: none;
+ background: transparent;
+ outline: none;
+ cursor: pointer;
+}
+.gev-quantitative-slider::-webkit-slider-runnable-track {
+ height: 3px;
+ border-radius: 2px;
+ background: rgba(255, 255, 255, 0.08);
+}
+.gev-quantitative-slider::-webkit-slider-thumb {
+ width: 10px;
+ height: 10px;
+ margin-top: -3.5px;
+ border: 0;
+ border-radius: 50%;
+ -webkit-appearance: none;
+ appearance: none;
+ background: var(--accent);
+ box-shadow: 0 0 6px var(--accent-glow);
+ cursor: pointer;
+}
+.gev-quantitative-slider::-moz-range-track,
+.gev-quantitative-slider::-moz-range-progress {
+ height: 3px;
+ border: 0;
+ border-radius: 2px;
+ background: rgba(255, 255, 255, 0.08);
+}
+.gev-quantitative-slider::-moz-range-thumb {
+ width: 10px;
+ height: 10px;
+ border: 0;
+ border-radius: 50%;
+ background: var(--accent);
+ box-shadow: 0 0 6px var(--accent-glow);
+ cursor: pointer;
+}
+.gev-quantitative-slider:focus-visible {
+ border-radius: 4px;
+ outline: 1px solid color-mix(in srgb, var(--accent) 80%, transparent);
+ outline-offset: 2px;
+}
+.gev-quantitative-slider:disabled {
+ opacity: .42;
+ cursor: not-allowed;
+}
+.gev-slider-value {
+ min-width: 28px;
+ color: var(--accent);
+ font-family: var(--font-mono);
+ font-size: 9px;
+ letter-spacing: .5px;
+ text-align: right;
+ flex-shrink: 0;
+}
+
+.pp-slider-mini-label {
+ font-family: var(--font-mono);
+ font-size: 8px;
+ letter-spacing: 1px;
+ color: var(--text-dim);
+ text-transform: uppercase;
+ white-space: nowrap;
+}
+
+.detection-slider-row {
+ min-width: 170px;
+ padding: 5px 8px 6px;
+}
+
+#detection-slider-row.visible,
+#detection-allocation-row.visible,
+#detection-fade-row.visible {
+ border-radius: 0;
+}
+
+.detection-allocation-row {
+ min-width: 170px;
+ padding: 5px 8px 6px;
+}
+
+.detection-fade-row,
+.detection-opacity-row {
+ min-width: 170px;
+ padding: 5px 8px 6px;
+}
+
+.detection-allocation-seg .pp-mode-btn {
+ font-size: 8px;
+ letter-spacing: 0.35px;
+}
+
+#hud-layout-row {
+ min-width: 200px;
+}
+
+/* Map Source tiles live with Visual Presets in the bottom command tray. */
+.map-source-section {
+ display: grid;
+ gap: 6px;
+ margin-top: 8px;
+ padding-top: 8px;
+ border-top: 1px solid rgba(123, 189, 211, 0.18);
+}
+
+.map-source-heading {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ color: rgba(190, 221, 230, 0.62);
+ font-family: var(--font-mono);
+ font-size: 8px;
+ letter-spacing: 1.35px;
+}
+
+.map-stack-chip-row {
+ display: grid;
+ grid-template-columns: repeat(5, minmax(0, 1fr));
+ gap: 4px;
+}
+
+.map-stack-chip {
+ display: inline-flex;
+ align-items: baseline;
+ justify-content: center;
+ gap: 4px;
+ padding: 4px 7px;
+ font-family: var(--font-mono);
+ font-size: 9px;
+ letter-spacing: 0.6px;
+ text-transform: uppercase;
+ white-space: nowrap;
+ color: var(--text-dim);
+ background: rgba(255, 255, 255, 0.04);
+ border: 1px solid rgba(255, 255, 255, 0.08);
+ border-radius: 4px;
+ cursor: pointer;
+ /* Explicit property list, NOT `transition: all`: `all` animates
+ `outline-width` off the `outline: none` base, and Chrome leaves that
+ transition parked at 0px for chips on a wrapped line — the keyboard ring
+ silently never appeared on rows 2 and 3. A focus indicator should be
+ instant anyway. */
+ transition:
+ color var(--transition-fast),
+ background-color var(--transition-fast),
+ border-color var(--transition-fast),
+ box-shadow var(--transition-fast);
+ outline: none;
+}
+
+#command-dock #control-panel.collapsed .map-source-section {
+ display: none;
+}
+
+@media (max-width: 620px) {
+ .map-stack-chip-row {
+ grid-template-columns: repeat(3, minmax(0, 1fr));
+ }
+}
+
+/* Order matters, and matches `.data-toggle-btn`: hover/focus, then active, then
+ disabled — all at the same specificity, so the later rule wins. Hovering the
+ active chip must not wash the cyan out, and a disabled chip must not light up
+ under the cursor. Do not add `:not(...)` here: it would raise specificity and
+ let hover beat `.active` again. */
+.map-stack-chip:hover,
+.map-stack-chip:focus-visible {
+ border-color: var(--glass-border-hover);
+ background: rgba(255, 255, 255, 0.06);
+ color: var(--text-primary);
+}
+
+/* The keyboard ring is an `outline`, a property NO other chip-state rule sets,
+ so it survives on the active chip — whose `.active` rule legitimately wins
+ the color/border/background/box-shadow it shares with the rule above. Without
+ this, tabbing onto the active chip produced no visible change at all. */
+.map-stack-chip:focus-visible {
+ outline: 1px solid color-mix(in srgb, var(--accent) 80%, transparent);
+ outline-offset: 2px;
+}
+
+.map-stack-chip.active {
+ color: var(--accent);
+ border-color: var(--accent);
+ background: var(--accent-dim);
+ box-shadow: 0 0 10px rgba(0, 212, 255, 0.15);
+}
+
+.map-stack-chip.unavailable,
+.map-stack-chip[aria-disabled='true'] {
+ color: rgba(232, 234, 237, 0.28);
+ border-color: rgba(255, 255, 255, 0.08);
+ background: rgba(255, 255, 255, 0.02);
+ cursor: not-allowed;
+}
+
+.map-stack-chip-req {
+ font-size: 7px;
+ letter-spacing: 0.3px;
+ color: rgba(232, 234, 237, 0.28);
+}
+
+.pp-stack-status {
+ min-width: 42px;
+ max-width: 54px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ font-family: var(--font-mono);
+ font-size: 9px;
+ letter-spacing: 0.8px;
+ color: var(--accent);
+ text-align: center;
+ text-transform: uppercase;
+}
+
+.pp-stack-status.warn {
+ color: #ffb84d;
+}
+
+.pp-select {
+ flex: 1;
+ min-width: 0;
+ height: 24px;
+ background: rgba(255, 255, 255, 0.06);
+ border: 1px solid rgba(255, 255, 255, 0.14);
+ border-radius: 6px;
+ color: var(--text-primary);
+ font-family: var(--font-mono);
+ font-size: 10px;
+ letter-spacing: 0.6px;
+ padding: 2px 6px;
+ outline: none;
+}
+
+/* Proximity / All segmented control under the 3D toggle */
+#models3d-mode-row { min-width: 184px; }
+.pp-mode-seg {
+ display: flex;
+ flex: 1;
+ border: 1px solid rgba(255, 255, 255, 0.14);
+ border-radius: 6px;
+ overflow: hidden;
+}
+.pp-mode-btn {
+ flex: 1;
+ height: 22px;
+ background: rgba(255, 255, 255, 0.04);
+ border: none;
+ color: var(--text-dim);
+ font-family: var(--font-mono);
+ font-size: 9px;
+ letter-spacing: 0.6px;
+ text-transform: uppercase;
+ cursor: pointer;
+ transition: background-color var(--transition-fast), color var(--transition-fast);
+}
+.pp-mode-btn + .pp-mode-btn { border-left: 1px solid rgba(255, 255, 255, 0.14); }
+.pp-mode-btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); }
+.pp-mode-btn.active { background: var(--accent); color: #000; }
+
+/* These controls also move into Cockpit Display; keep focus on the control
+ itself and inside clipped button groups, independent of selection color. */
+.pp-toggle-btn:focus-visible,
+.pp-select:focus-visible,
+.pp-mode-btn:focus-visible {
+ outline: 2px solid var(--text-primary);
+ outline-offset: -3px;
+}
+
+.pp-mode-btn:focus-visible {
+ box-shadow: inset 0 0 0 4px #061014;
+}
+
+.pp-slider:focus-visible,
+.param-slider:focus-visible {
+ outline: 2px solid var(--text-primary);
+ outline-offset: 4px;
+}
+
+#clean-view-toggle {
+ width: var(--pp-expanded-width);
+}
+
+#clean-view-exit {
+ position: fixed;
+ top: 18px;
+ right: 50%;
+ transform: translateX(50%);
+ z-index: 300;
+ border-radius: 999px;
+ border: 1px solid rgba(255, 255, 255, 0.25);
+ background: rgba(8, 10, 14, 0.88);
+ color: #d9f7ff;
+ font-family: var(--font-mono);
+ font-size: 10px;
+ letter-spacing: 1.8px;
+ padding: 8px 14px;
+ cursor: pointer;
+ display: none;
+}
+
+body.ui-clean-view #clean-view-exit {
+ display: inline-flex;
+}
+
+body.ui-clean-view #title-bar,
+body.ui-clean-view #style-indicator,
+body.ui-clean-view #top-center-actions,
+body.ui-clean-view #global-loading-status,
+body.ui-clean-view #traffic-sync-chip,
+body.ui-clean-view #cctv-sync-chip,
+body.ui-clean-view #pp-toggles,
+body.ui-clean-view #param-slider-panel,
+body.ui-clean-view #control-panel,
+body.ui-clean-view #location-bar,
+body.ui-clean-view #data-panel,
+body.ui-clean-view #cctv-panel,
+body.ui-clean-view #radio-panel,
+body.ui-clean-view #global-context-panel,
+body.ui-clean-view #scene-panel {
+ opacity: 0 !important;
+ visibility: hidden !important;
+ pointer-events: none !important;
+}
+
+body.ui-clean-view #scene-runtime.active {
+ opacity: 1;
+ visibility: visible;
+}
+
+/* ── Detection Toggle States ─────────────────── */
+#detection-toggle.active {
+ border-color: rgba(0, 255, 80, 0.6);
+ background: rgba(0, 255, 80, 0.1);
+ box-shadow: 0 0 12px rgba(0, 255, 80, 0.15);
+}
+
+#detection-toggle.active .pp-label {
+ color: rgba(0, 255, 80, 0.9);
+}
+
+#detection-toggle.active .pp-icon {
+ color: rgba(0, 255, 80, 0.9);
+ text-shadow: 0 0 6px rgba(0, 255, 80, 0.5);
+}
+
+#detection-toggle.panoptic,
+#detection-toggle.god {
+ border-color: rgba(0, 255, 80, 0.8);
+ background: rgba(0, 255, 80, 0.18);
+ box-shadow: 0 0 16px rgba(0, 255, 80, 0.25);
+ animation: detection-pulse 2s ease-in-out infinite;
+}
+
+@keyframes detection-pulse {
+ 0%, 100% { box-shadow: 0 0 12px rgba(0, 255, 80, 0.15); }
+ 50% { box-shadow: 0 0 22px rgba(0, 255, 80, 0.35); }
+}
+
+/* ── Parameter Slider Panel ──────────────────── */
+#param-slider-panel {
+ display: none;
+ position: relative;
+ top: auto;
+ right: auto;
+ left: auto;
+ bottom: auto;
+ z-index: 95;
+ width: 100%;
+ max-height: min(38vh, 360px);
+ box-sizing: border-box;
+ overflow-y: auto;
+ scrollbar-width: none;
+ -ms-overflow-style: none;
+ background: var(--glass-bg);
+ border: 1px solid var(--glass-border);
+ border-radius: 12px;
+ padding: 14px 16px;
+ backdrop-filter: blur(24px) saturate(1.4);
+ -webkit-backdrop-filter: blur(24px) saturate(1.4);
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
+ opacity: 0;
+ visibility: hidden;
+ transform: translateY(6px);
+ transition: opacity var(--transition-smooth), visibility var(--transition-smooth), transform var(--transition-smooth);
+}
+
+#param-slider-panel::-webkit-scrollbar {
+ display: none;
+}
+
+#param-slider-panel.active {
+ display: block;
+ opacity: 1;
+ visibility: visible;
+ transform: translateY(0);
+}
+
+/* Display owns the constrained desktop scroll surface. Keeping Parameters as
+ * a second scroll container traps wheel/touch input at its boundary and lets
+ * the flex column compress newly added preset rows below the visible panel. */
+#pp-toggles:not(.collapsed) > #param-slider-panel.active {
+ flex: 0 0 auto;
+ max-height: none;
+ overflow-y: visible;
+}
+
+.param-panel-header {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ margin-bottom: 12px;
+}
+
+.param-panel-title {
+ font-family: var(--font-mono);
+ font-size: 8px;
+ letter-spacing: 2.5px;
+ color: var(--text-dim);
+ text-transform: uppercase;
+ white-space: nowrap;
+}
+
+.param-panel-divider {
+ flex: 1;
+ height: 1px;
+ background: linear-gradient(to right, var(--glass-border), transparent);
+}
+
+#param-slider-panel:not(.collapsed) .param-panel-divider {
+ background: linear-gradient(90deg, rgb(0 212 255 / 28%), rgba(0, 212, 255, 0.18) 58%, transparent);
+}
+
+.param-slider-row {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ margin-bottom: 10px;
+}
+
+.param-slider-row:last-child {
+ margin-bottom: 0;
+}
+
+.param-label {
+ font-family: var(--font-mono);
+ font-size: 9px;
+ letter-spacing: 1px;
+ color: var(--text-secondary);
+ min-width: 72px;
+ flex-shrink: 0;
+}
+
+.param-slider {
+ flex: 1;
+ min-width: 0;
+ -webkit-appearance: none;
+ appearance: none;
+ height: 3px;
+ background: rgba(255, 255, 255, 0.08);
+ border-radius: 2px;
+ outline: none;
+ cursor: pointer;
+}
+
+.param-slider::-webkit-slider-thumb {
+ -webkit-appearance: none;
+ appearance: none;
+ width: 12px;
+ height: 12px;
+ border-radius: 50%;
+ background: var(--accent);
+ box-shadow: 0 0 6px var(--accent-glow);
+ cursor: pointer;
+ transition: box-shadow var(--transition-fast);
+}
+
+.param-slider::-webkit-slider-thumb:hover {
+ box-shadow: 0 0 12px var(--accent-glow);
+}
+
+.param-slider::-moz-range-thumb {
+ width: 12px;
+ height: 12px;
+ border-radius: 50%;
+ background: var(--accent);
+ border: none;
+ box-shadow: 0 0 6px var(--accent-glow);
+ cursor: pointer;
+}
+
+.param-value {
+ font-family: var(--font-mono);
+ font-size: 10px;
+ letter-spacing: 0.5px;
+ color: var(--accent);
+ min-width: 32px;
+ text-align: right;
+ flex-shrink: 0;
+}
+
diff --git a/src/ui/styles/first-run.css b/src/ui/styles/first-run.css
new file mode 100644
index 000000000..d4467f74e
--- /dev/null
+++ b/src/ui/styles/first-run.css
@@ -0,0 +1,315 @@
+/* ── First-run mission launcher ───────────────────────────────────
+ Compact and non-modal: it gives a new visitor a meaningful starting
+ choice without blocking manual map interaction or spending API quota. */
+#first-run-launcher {
+ position: fixed;
+ z-index: 175;
+ top: 50%;
+ left: 50%;
+ width: min(34rem, calc(100vw - 2rem));
+ /* Five tiles do not fit a short landscape phone (667 x 390), where the card
+ would otherwise render past BOTH ends of the viewport. Cap it to the
+ viewport and let the mission list scroll inside — the heading, the checkbox
+ and the status line must stay reachable at every height. */
+ max-height: calc(100vh - 1.5rem);
+ max-height: calc(100dvh - 1.5rem);
+ display: flex;
+ flex-direction: column;
+ padding: 1.15rem;
+ overflow: hidden;
+ color: var(--text-primary);
+ background:
+ linear-gradient(145deg, rgba(10, 27, 37, 0.97), rgba(7, 13, 22, 0.95)),
+ rgba(7, 17, 25, 0.96);
+ border: 1px solid rgba(54, 220, 255, 0.42);
+ border-radius: 0.65rem;
+ box-shadow:
+ 0 1.4rem 4.5rem rgba(0, 0, 0, 0.72),
+ 0 0 2.5rem rgba(0, 212, 255, 0.09),
+ inset 0 0 0 1px rgba(255, 255, 255, 0.025);
+ backdrop-filter: blur(28px) saturate(1.25);
+ -webkit-backdrop-filter: blur(28px) saturate(1.25);
+ opacity: 0;
+ transform: translate(-50%, calc(-50% + 0.8rem)) scale(0.985);
+ transition: opacity 220ms ease, transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
+ /* Inert until revealed AND again while fading out, so a click during the
+ dismiss animation cannot launch a second mission behind the fade. */
+ pointer-events: none;
+}
+
+/* An AUTHOR `display` on this id beats the UA's `[hidden] { display: none }` in
+ the cascade, so the flex above would otherwise leave the card in the
+ accessibility tree from page parse until it is revealed — or, on a share
+ link, until it is removed. Restore the attribute's meaning explicitly. */
+#first-run-launcher[hidden] {
+ display: none;
+}
+
+#first-run-launcher.visible {
+ opacity: 1;
+ transform: translate(-50%, -50%) scale(1);
+ pointer-events: auto;
+}
+
+.first-run-scanline {
+ position: absolute;
+ inset: 0 0 auto;
+ height: 2px;
+ background: linear-gradient(90deg, transparent, rgba(54, 220, 255, 0.8), transparent);
+ box-shadow: 0 0 1rem rgba(54, 220, 255, 0.45);
+ pointer-events: none;
+}
+
+.first-run-header,
+.first-run-footer {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 1rem;
+ color: rgba(171, 210, 220, 0.6);
+ font-family: var(--font-mono);
+ font-size: 0.58rem;
+ letter-spacing: 0.1rem;
+ text-transform: uppercase;
+}
+
+.first-run-kicker { color: rgba(54, 220, 255, 0.86); }
+
+#first-run-launcher h2 {
+ margin-top: 0.6rem;
+ font-family: var(--font-mono);
+ font-size: clamp(1.25rem, 2.4vw, 1.75rem);
+ font-weight: 500;
+ letter-spacing: -0.045rem;
+}
+
+#first-run-description {
+ max-width: 29rem;
+ margin-top: 0.3rem;
+ color: rgba(215, 231, 235, 0.66);
+ font-size: 0.78rem;
+ line-height: 1.5;
+}
+
+.first-run-choices {
+ display: grid;
+ gap: 0.42rem;
+ margin-top: 1rem;
+ /* The one part of the card allowed to scroll when the viewport is too short.
+ min-height:0 is what actually lets this flex child shrink below its content. */
+ min-height: 0;
+ overflow-y: auto;
+ overscroll-behavior: contain;
+ scroll-behavior: smooth;
+ /* A visible, non-overlaying affordance that the list continues. */
+ scrollbar-width: thin;
+ scrollbar-color: rgba(54, 220, 255, 0.45) transparent;
+ scrollbar-gutter: stable;
+}
+
+.first-run-choices::-webkit-scrollbar { width: 6px; }
+.first-run-choices::-webkit-scrollbar-thumb {
+ background: rgba(54, 220, 255, 0.45);
+ border-radius: 3px;
+}
+
+.first-run-choices button {
+ display: grid;
+ grid-template-columns: 1.7rem 1fr 1.3rem;
+ align-items: center;
+ gap: 0.7rem;
+ width: 100%;
+ min-height: 3.55rem;
+ padding: 0.6rem 0.7rem;
+ color: rgba(225, 244, 248, 0.92);
+ text-align: left;
+ background: rgba(29, 69, 81, 0.18);
+ border: 1px solid rgba(100, 200, 220, 0.18);
+ border-radius: 0.42rem;
+ cursor: pointer;
+ transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
+}
+
+.first-run-choices button:hover,
+.first-run-choices button:focus-visible {
+ background: rgba(25, 151, 178, 0.16);
+ border-color: rgba(54, 220, 255, 0.62);
+ outline: none;
+ transform: translateX(2px);
+}
+
+/* aria-disabled, not :disabled — the JS keeps the buttons focusable while a
+ mission runs so the keyboard is never dumped out of the launcher mid-flight. */
+.first-run-choices button[aria-disabled='true'] {
+ cursor: wait;
+ opacity: 0.48;
+ transform: none;
+ pointer-events: none;
+}
+
+.first-run-choices button > .material-symbols-outlined:first-child {
+ color: #55dff5;
+ font-size: 1.35rem;
+}
+
+.first-run-choices button > span:nth-child(2) {
+ display: flex;
+ flex-direction: column;
+ gap: 0.15rem;
+}
+
+.first-run-choices strong {
+ font-family: var(--font-mono);
+ font-size: 0.72rem;
+ font-weight: 600;
+ letter-spacing: 0.08rem;
+}
+
+.first-run-choices small {
+ color: rgba(198, 220, 226, 0.55);
+ font-size: 0.66rem;
+}
+
+.first-run-arrow {
+ color: rgba(54, 220, 255, 0.4);
+ font-size: 1rem;
+ transition: transform var(--transition-fast), color var(--transition-fast);
+}
+
+.first-run-choices button:hover .first-run-arrow,
+.first-run-choices button:focus-visible .first-run-arrow {
+ color: rgba(54, 220, 255, 0.9);
+ transform: translateX(2px);
+}
+
+/* Ordered after the shared button rule rather than shouting !important at it. */
+.first-run-choices button.first-run-explore {
+ background: rgba(255, 255, 255, 0.025);
+}
+
+.first-run-footer {
+ margin-top: 0.85rem;
+ font-size: 0.48rem;
+ letter-spacing: 0.055rem;
+}
+
+.first-run-suppress {
+ display: flex;
+ align-items: center;
+ gap: 0.4rem;
+ color: rgba(199, 225, 231, 0.66);
+ text-transform: none;
+ font-size: 0.62rem;
+ letter-spacing: 0.02rem;
+ cursor: pointer;
+}
+
+.first-run-suppress input {
+ width: 0.82rem;
+ height: 0.82rem;
+ margin: 0;
+ accent-color: #36dcff;
+ cursor: pointer;
+}
+
+.first-run-suppress:hover { color: rgba(225, 244, 248, 0.92); }
+
+/* The live region carries mission progress and failures, so it owns a full row
+ and reserves its height — otherwise the card resizes as it speaks. */
+.first-run-note {
+ min-height: 1.1rem;
+ margin-top: 0.5rem;
+ color: rgba(199, 225, 231, 0.62);
+ font-family: var(--font-mono);
+ font-size: 0.62rem;
+ line-height: 1.35;
+}
+
+#first-run-launcher[data-state='loading'] .first-run-note {
+ color: rgba(54, 220, 255, 0.85);
+}
+
+/* Every surface that claims the screen hides the launcher. This list is the CSS
+ half of the ESC arbitration: src/firstRunExperience.js watches these same
+ classes and makes the launcher step aside, so a hidden card is never left
+ holding a keyboard handler. Keep the two lists in step —
+ EXCLUSIVE_SURFACE_CLASSES pins them together. */
+body.ui-clean-view #first-run-launcher,
+body.recording-mode #first-run-launcher,
+body.cockpit-mode #first-run-launcher,
+body.scene-playback-mode #first-run-launcher {
+ display: none;
+}
+
+@media (max-width: 620px) {
+ #first-run-launcher {
+ top: auto;
+ bottom: 5.8rem;
+ padding: 0.9rem;
+ transform: translate(-50%, 0.8rem) scale(0.985);
+ }
+
+ #first-run-launcher.visible { transform: translate(-50%, 0) scale(1); }
+ /* Five tiles have to clear the dock on a 375 x 812 phone, so the rows tighten
+ and the redundant "ESC to dismiss" hint (no ESC key on a phone) drops. */
+ #first-run-launcher h2 { margin-top: 0.45rem; }
+ #first-run-description { margin-top: 0.25rem; font-size: 0.72rem; }
+ .first-run-choices { margin-top: 0.75rem; }
+ .first-run-choices button { min-height: 3rem; padding: 0.45rem 0.6rem; }
+ .first-run-choices small { font-size: 0.62rem; }
+ .first-run-footer > span:last-child { display: none; }
+}
+
+/* Short viewports — landscape phones, small laptop windows. The chrome tightens
+ so the mission list keeps a usable share of the height. The intro line STAYS:
+ it is the only copy that says what this thing is, and with four tiles it
+ fits. (It was dropped here while there were five; the tile that went is
+ exactly why it can come back.) */
+@media (max-height: 620px) {
+ #first-run-launcher { padding: 0.75rem 0.85rem; }
+ #first-run-launcher h2 { margin-top: 0.3rem; font-size: 1.1rem; }
+ #first-run-description { margin-top: 0.2rem; font-size: 0.7rem; line-height: 1.4; }
+ .first-run-choices { margin-top: 0.55rem; }
+ .first-run-choices button { min-height: 2.7rem; padding: 0.36rem 0.6rem; }
+ .first-run-choices strong { font-size: 0.68rem; }
+ .first-run-choices small { font-size: 0.6rem; }
+ .first-run-footer { margin-top: 0.5rem; }
+ .first-run-note { margin-top: 0.3rem; min-height: 0; }
+}
+
+/* A soft edge on the list, so a tile cut by the fold reads as "more below"
+ rather than as a rendering seam. Gated on `data-scrollable`, which the JS sets
+ only when the list ACTUALLY overflows — a fade on a list that fits would
+ promise content that is not there, which is the opposite of the affordance
+ it is meant to be. Decorative only: the list scrolls under it. */
+.first-run-choices[data-scrollable='true'] {
+ -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.4rem), transparent 100%);
+ mask-image: linear-gradient(to bottom, #000 calc(100% - 1.4rem), transparent 100%);
+}
+
+/* Scrolled to the end, there is nothing left to promise, so the fade lifts.
+ Browsers without scroll-driven animations keep the static fade, which is
+ still honest — there IS more list, it is just above rather than below. */
+@supports (animation-timeline: scroll(self block)) {
+ .first-run-choices[data-scrollable='true'] {
+ animation: first-run-scroll-fade linear both;
+ animation-timeline: scroll(self block);
+ animation-range: contain 80% contain 100%;
+ }
+}
+
+@keyframes first-run-scroll-fade {
+ to {
+ -webkit-mask-image: linear-gradient(to bottom, #000 100%, transparent 100%);
+ mask-image: linear-gradient(to bottom, #000 100%, transparent 100%);
+ }
+}
+
+@media (prefers-reduced-motion: reduce) {
+ #first-run-launcher,
+ .first-run-choices button,
+ .first-run-arrow { transition: none; }
+ /* Scrolling a tile into view must not animate either. */
+ .first-run-choices { scroll-behavior: auto; }
+}
+
diff --git a/src/ui/styles/foundation.css b/src/ui/styles/foundation.css
new file mode 100644
index 000000000..f7de3b17d
--- /dev/null
+++ b/src/ui/styles/foundation.css
@@ -0,0 +1,611 @@
+/* ═══════════════════════════════════════════════
+ GOD'S EYE VIEW — Dark Sci-Fi UI
+ Apple meets Blade Runner
+ ═══════════════════════════════════════════════ */
+
+:root {
+ --bg-dark: #0a0a0f;
+ --glass-bg: rgba(12, 12, 20, 0.72);
+ --glass-border: rgba(255, 255, 255, 0.08);
+ --glass-border-hover: rgba(255, 255, 255, 0.15);
+ --accent: #00d4ff;
+ --accent-dim: rgba(0, 212, 255, 0.15);
+ --accent-glow: rgba(0, 212, 255, 0.4);
+ --text-primary: #e8eaed;
+ --text-secondary: rgba(232, 234, 237, 0.5);
+ --text-dim: rgba(232, 234, 237, 0.3);
+ --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
+ --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
+ --panel-radius: 16px;
+ --btn-radius: 10px;
+ --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
+ --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
+ --left-stack-x: 52px;
+ --right-rail-x: 52px;
+ --left-stack-top: 26vh;
+ --left-stack-gap: 72px;
+ --left-collapsed-width: 176px;
+ --display-panel-expanded-width: 272px;
+ --cockpit-radio-collapsed-width: 148px;
+ --cockpit-radio-expanded-width: 232px;
+}
+
+* {
+ margin: 0;
+ padding: 0;
+ box-sizing: border-box;
+}
+
+/* Keyboard focus is an app-wide state and must survive selected/active button
+ skins. Individual controls can choose an inset/outset offset, but no local
+ `outline: none` rule may erase the ring. */
+:where(
+ button,
+ a[href],
+ input,
+ select,
+ textarea,
+ summary,
+ [tabindex],
+ [role='button'],
+ [role='checkbox'],
+ [role='combobox'],
+ [role='link'],
+ [role='listbox'],
+ [role='menuitem'],
+ [role='menuitemcheckbox'],
+ [role='menuitemradio'],
+ [role='option'],
+ [role='radio'],
+ [role='searchbox'],
+ [role='slider'],
+ [role='spinbutton'],
+ [role='switch'],
+ [role='tab'],
+ [role='textbox'],
+ [role='treeitem']
+):focus-visible {
+ outline: 2px solid var(--text-primary) !important;
+ outline-offset: 2px;
+}
+
+html, body {
+ width: 100%;
+ height: 100%;
+ overflow: hidden;
+ background: var(--bg-dark);
+ font-family: var(--font-sans);
+ color: var(--text-primary);
+ -webkit-font-smoothing: antialiased;
+}
+
+/* ── Cesium Container ─────────────────────────── */
+#cesiumContainer {
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ top: 0;
+ left: 0;
+}
+
+/* Unified world-overlay host: detection uses one host-owned blend surface
+ beneath the shared text/card canvas; both share one frame path. The root
+ holds ONLY the card canvas — it is a stacking context (z-index below), and
+ a canvas that blends against the scene cannot live inside one. */
+#world-overlay-root {
+ position: absolute;
+ inset: 0;
+ z-index: 6;
+ overflow: hidden;
+ pointer-events: none;
+}
+
+#world-overlay-detection-surface,
+#world-overlay-canvas {
+ position: absolute;
+ inset: 0;
+ display: block;
+ width: 100%;
+ height: 100%;
+ pointer-events: none;
+}
+
+/* Scope mask — the explicit circular viewport treatment (see
+ src/scopeMask.js for the emergent-artifact history). z2 keeps it above
+ the WebGL scene but under the z5 detection surface, preserving the old
+ compositing order where detection's blend rode the masked scene. */
+#scope-mask {
+ position: absolute;
+ inset: 0;
+ width: 100%;
+ height: 100%;
+ /* z1 like the celestial ring; the ring is appended LATER so DOM order
+ keeps it ABOVE the mask — matching the old stacking, where the DOM
+ ring rode above the in-scene scope artifact. Detection (z5) and the
+ overlay root (z6) stay above both. */
+ z-index: 1;
+ pointer-events: none;
+}
+
+/* The detection surface is host-owned but parented into #cesiumContainer
+ (position:absolute, z-index:auto — NOT a stacking context) so its
+ `mix-blend-mode: screen` composites against the WebGL scene. z5 keeps it
+ under the z6 root that carries the shared card canvas; do not move this
+ surface inside #world-overlay-root, which would isolate the blend. */
+#world-overlay-detection-surface {
+ z-index: 5;
+}
+
+/* Canvas cards retain their spatial renderer; this parallel focusable list
+ exposes only the currently painted actionable targets to assistive tech. */
+.world-overlay-accessibility {
+ position: fixed;
+ width: 1px;
+ height: 1px;
+ padding: 0;
+ margin: -1px;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ white-space: nowrap;
+ border: 0;
+}
+
+/* ── Source-backed cockpit weather ─────────────
+ Low-resolution GPU cloud pass composited only inside the cockpit keyhole. */
+#cockpit-cloud-effects {
+ position: fixed;
+ inset: 0;
+ z-index: 7;
+ display: none;
+ width: 100vw;
+ height: 100vh;
+ opacity: 0;
+ pointer-events: none;
+ clip-path: circle(min(40vw, 52vh) at 50% 50%);
+ filter: blur(0.7px) saturate(0.72) contrast(1.08);
+ transform: translateZ(0);
+ transition: opacity 900ms ease;
+}
+
+body.cockpit-mode #cockpit-cloud-effects.active {
+ display: block;
+ opacity: 0.86;
+}
+
+/* ── Full-globe celestial keyhole ring ─────── */
+.celestial-ring-overlay {
+ position: absolute;
+ inset: 0;
+ /* Above the z1 scope mask regardless of DOM order (the ring is built by
+ StyleManager before the scope installs) — the ring always rode above
+ the scope treatment. Detection (z5) and the overlay root (z6) stay on
+ top of both. */
+ z-index: 2;
+ overflow: hidden;
+ pointer-events: none;
+ opacity: 0;
+ visibility: hidden;
+ transition: opacity 300ms ease, visibility 300ms ease;
+}
+
+.celestial-ring-overlay.visible {
+ opacity: 1;
+ visibility: visible;
+}
+
+.celestial-ring-overlay.disabled {
+ display: none;
+}
+
+.celestial-ring-canvas {
+ position: absolute;
+ inset: 0;
+ display: block;
+ transform-origin: 50% 50%;
+ will-change: transform, opacity;
+}
+
+.celestial-ring-outline {
+ position: absolute;
+ box-sizing: border-box;
+ border: 0.8px solid rgba(151, 218, 232, 0.095);
+ border-radius: 50%;
+ will-change: width, height;
+}
+
+.celestial-marker {
+ position: absolute;
+ z-index: 2;
+ transform: translate(-50%, -50%);
+ font-family: 'Material Symbols Outlined';
+ font-size: 20px;
+ font-weight: 400;
+ font-style: normal;
+ line-height: 1;
+ font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
+ transition: opacity 120ms linear;
+ user-select: none;
+}
+
+.celestial-sun {
+ color: rgba(231, 194, 72, 0.92);
+ text-shadow: 0 0 7px rgba(231, 194, 72, 0.72), 0 0 18px rgba(231, 194, 72, 0.3);
+}
+
+.celestial-moon {
+ color: rgba(55, 211, 239, 0.84);
+ text-shadow: 0 0 7px rgba(55, 211, 239, 0.65), 0 0 17px rgba(55, 211, 239, 0.25);
+}
+
+#celestial-toggle:disabled {
+ cursor: not-allowed;
+ opacity: 0.42;
+}
+
+/* Hide Cesium default UI elements */
+.cesium-viewer-toolbar,
+.cesium-viewer-animationContainer,
+.cesium-viewer-timelineContainer,
+.cesium-viewer-bottom,
+.cesium-viewer-fullscreenContainer,
+.cesium-viewer-vrContainer,
+.cesium-viewer-geocoderContainer,
+.cesium-viewer-selectionIndicatorContainer,
+.cesium-viewer-infoBoxContainer {
+ display: none !important;
+}
+
+/* Data-source attribution (Google Maps / 3D Tiles, etc.).
+ Required by the Google Maps Platform Terms of Service — keep it visible.
+ Styled to be unobtrusive but legible against the dark UI. */
+#cesium-credits {
+ position: fixed;
+ /* Bottom-LEFT corner, mirrored from the GEV mic pill (right:36/bottom:36) so the two bottom
+ corners are symmetric; sits below the coordinate HUD (.hud-bottom-left, bottom:180). Was
+ dead-center at the bottom, tucked under the LOCATIONS/STYLE panels. Must stay visible (Google
+ /Cesium attribution ToS). */
+ bottom: 36px;
+ left: 36px;
+ z-index: 90;
+ max-width: 90vw;
+ /* Keep the Google logo + "Data attribution" link on ONE line — they were wrapping to a second
+ row (looked like it was falling over). nowrap + a roomy max-width holds them inline. */
+ white-space: nowrap;
+ pointer-events: auto;
+ font-family: var(--font-mono);
+ font-size: 10px;
+ color: rgba(232, 234, 237, 0.55);
+ text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
+}
+#cesium-credits .cesium-credit-logoContainer,
+#cesium-credits .cesium-credit-textContainer,
+#cesium-credits .cesium-credit-expand-link {
+ display: inline-block;
+ vertical-align: middle;
+}
+#cesium-credits a,
+#cesium-credits .cesium-credit-expand-link {
+ color: rgba(232, 234, 237, 0.7);
+}
+
+/* Cesium's stock attribution lightbox grows with every registered data source.
+ Keep the title and close affordance fixed while the complete, unabridged
+ credit list wraps and scrolls inside a compact panel. */
+.cesium-credit-lightbox-overlay {
+ z-index: 200 !important;
+}
+
+.cesium-credit-lightbox {
+ display: flex;
+ flex-direction: column;
+ width: 470px;
+ max-width: calc(100vw - 2rem);
+ max-height: min(70dvh, 36rem);
+ overflow: hidden;
+}
+
+.cesium-credit-lightbox > ul {
+ flex: 1;
+ min-height: 0;
+ margin: 0;
+ padding: 8px 20px 14px 40px;
+ overflow-x: hidden;
+ overflow-y: auto;
+ overscroll-behavior: contain;
+ scrollbar-gutter: stable;
+ font-size: 12px !important;
+ line-height: 1.35;
+ white-space: normal;
+}
+
+.cesium-credit-lightbox > ul > li {
+ padding-bottom: 5px;
+ overflow-wrap: anywhere;
+}
+
+@media (max-width: 575px) {
+ .cesium-credit-lightbox {
+ width: 100% !important;
+ max-width: none !important;
+ height: 100% !important;
+ max-height: 100dvh !important;
+ margin: 0 !important;
+ }
+}
+/* Clean-view / recording: the Google + Cesium attribution MUST stay visible.
+ Google Maps Platform ToS and Cesium's terms require the credit whenever the
+ content is displayed — and these are exactly the modes used to record demos
+ and launch videos, so hiding #cesium-credits here (as it was before) shipped
+ non-compliant footage. The full credit line — Cesium/Ion logo, "Google Maps",
+ and the "Data attribution" link that opens the per-layer license popover —
+ stays on screen; it's already styled small and unobtrusive above. The GEV
+ chrome (panels/HUD) still fades via its own rules; only the required notice
+ is exempt. (Note: Cesium re-applies inline styles on the credit elements each
+ frame, so the on-screen credit content is owned by Cesium's update loop, not
+ CSS overrides — we deliberately don't fight it here.) */
+
+#gev-voice-control {
+ position: fixed;
+ right: 36px;
+ bottom: 36px;
+ /* Z ladder: panels 100-139, voice pill 150, toast 200, clean-view-exit 300 */
+ z-index: 150;
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ min-width: 214px;
+ padding: 9px 14px;
+ color: var(--text-primary);
+ background: var(--glass-bg);
+ border: 1px solid var(--glass-border);
+ border-radius: 999px;
+ box-shadow:
+ 0 8px 32px rgba(0, 0, 0, 0.5),
+ 0 0 0 1px rgba(255, 255, 255, 0.03) inset,
+ 0 1px 0 rgba(255, 255, 255, 0.06) inset,
+ 0 0 20px rgba(0, 212, 255, 0.08);
+ backdrop-filter: blur(24px) saturate(1.4);
+ -webkit-backdrop-filter: blur(24px) saturate(1.4);
+ font-family: var(--font-mono);
+ pointer-events: auto;
+}
+
+#gev-voice-button {
+ width: 72px;
+ height: 34px;
+ flex: 0 0 auto;
+ color: var(--accent);
+ background: rgba(0, 212, 255, 0.06);
+ border: 1px solid rgba(0, 212, 255, 0.28);
+ border-radius: var(--btn-radius);
+ font-family: var(--font-mono);
+ font-size: 10px;
+ letter-spacing: 0;
+ cursor: pointer;
+}
+
+#gev-voice-button:hover {
+ color: #ffffff;
+ border-color: var(--accent);
+ box-shadow: 0 0 12px rgba(0, 212, 255, 0.22);
+}
+
+.gev-voice-readout {
+ min-width: 0;
+ line-height: 1.2;
+ text-align: right;
+}
+
+#gev-voice-status {
+ font-size: 10px;
+ color: var(--accent);
+}
+
+#gev-voice-detail {
+ max-width: 132px;
+ margin-top: 2px;
+ overflow: hidden;
+ color: var(--text-secondary);
+ font-size: 9px;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+#gev-voice-control[data-status='listening'] {
+ border-color: rgba(92, 255, 198, 0.45);
+}
+
+#gev-voice-control[data-status='listening'] #gev-voice-status {
+ color: #5cffc6;
+}
+
+#gev-voice-control[data-status='executing'] {
+ border-color: rgba(255, 220, 120, 0.55);
+}
+
+#gev-voice-control[data-status='executing'] #gev-voice-status {
+ color: #ffdc78;
+}
+
+#gev-voice-control[data-status='error'] {
+ align-items: flex-start;
+ width: min(440px, calc(100vw - 72px));
+ border-color: rgba(255, 92, 110, 0.6);
+ /* Multi-line error block reads as a panel, not a capsule */
+ border-radius: var(--panel-radius);
+}
+
+#gev-voice-control[data-status='error'] #gev-voice-status {
+ color: #ff5c6e;
+}
+
+#gev-voice-control[data-status='error'] .gev-voice-readout {
+ flex: 1;
+ text-align: left;
+}
+
+#gev-voice-control[data-status='error'] #gev-voice-detail {
+ max-width: none;
+ overflow: visible;
+ color: #ffb4bd;
+ line-height: 1.45;
+ text-overflow: clip;
+ white-space: pre-wrap;
+ overflow-wrap: anywhere;
+ user-select: text;
+}
+
+/* ── Title Bar ────────────────────────────────── */
+#title-bar {
+ position: fixed;
+ top: 32px;
+ left: 36px;
+ z-index: 100;
+ pointer-events: none;
+ user-select: none;
+}
+
+#title-bar .title-glow {
+ position: absolute;
+ top: -20px;
+ left: -20px;
+ width: 200px;
+ height: 80px;
+ background: radial-gradient(ellipse, var(--accent-dim) 0%, transparent 70%);
+ filter: blur(20px);
+ opacity: 0.6;
+}
+
+#title-bar h1 {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ font-family: var(--font-mono);
+ font-size: 26px;
+ font-weight: 600;
+ letter-spacing: 8px;
+ color: var(--text-primary);
+ text-shadow: 0 0 30px var(--accent-glow);
+ position: relative;
+}
+
+#title-bar .title-logo {
+ position: relative;
+ display: block;
+ width: 52px;
+ height: auto;
+ filter: drop-shadow(0 0 12px rgba(0, 246, 255, 0.5));
+}
+
+#title-bar .title-logo::before,
+#title-bar .title-logo::after {
+ --radio-broadcast-opacity: .28;
+ content: '';
+ position: absolute;
+ z-index: 1;
+ left: 50%;
+ top: -9px;
+ width: 13px;
+ height: 7px;
+ border: 1px solid var(--accent);
+ border-bottom: 0;
+ border-radius: 999px 999px 0 0;
+ opacity: 0;
+ pointer-events: none;
+ transform: translateX(-50%);
+ transform-origin: 50% 100%;
+}
+
+#title-bar .title-logo::after {
+ --radio-broadcast-opacity: .17;
+ top: -15px;
+ width: 27px;
+ height: 13px;
+}
+
+#title-bar.radio-broadcasting .title-logo::before,
+#title-bar.radio-broadcasting .title-logo::after {
+ opacity: var(--radio-broadcast-opacity);
+ animation: title-radio-broadcast 1.8s ease-in-out infinite;
+}
+
+#title-bar.radio-broadcasting .title-logo::after { animation-delay: .28s; }
+
+@keyframes title-radio-broadcast {
+ 0%, 100% {
+ opacity: calc(var(--radio-broadcast-opacity) * .55);
+ transform: translateX(-50%) scale(.94);
+ }
+ 50% {
+ opacity: var(--radio-broadcast-opacity);
+ transform: translateX(-50%) scale(1);
+ }
+}
+
+@media (prefers-reduced-motion: reduce) {
+ #title-bar.radio-broadcasting .title-logo::before,
+ #title-bar.radio-broadcasting .title-logo::after {
+ animation: none;
+ }
+}
+
+.brand-logo {
+ aspect-ratio: 775 / 520;
+ overflow: visible;
+ pointer-events: none;
+}
+
+.brand-logo > img,
+.brand-logo > svg {
+ display: block;
+ width: 100%;
+ height: 100%;
+}
+
+#title-bar .title-accent,
+.loader-content .title-accent {
+ color: var(--accent);
+ font-weight: 300;
+}
+
+#title-bar .subtitle {
+ font-family: var(--font-mono);
+ font-size: 11px;
+ letter-spacing: 5px;
+ color: var(--text-dim);
+ margin-top: 8px;
+ text-transform: uppercase;
+}
+
+/* ── Style Indicator ──────────────────────────── */
+#style-indicator {
+ position: fixed;
+ top: 32px;
+ right: 36px;
+ z-index: 100;
+ pointer-events: none;
+ user-select: none;
+ text-align: right;
+}
+
+#style-indicator .indicator-label {
+ display: block;
+ font-family: var(--font-mono);
+ font-size: 10px;
+ letter-spacing: 3px;
+ color: var(--text-dim);
+ text-transform: uppercase;
+}
+
+#style-indicator .indicator-value {
+ display: block;
+ font-family: var(--font-mono);
+ font-size: 16px;
+ font-weight: 500;
+ letter-spacing: 5px;
+ color: var(--accent);
+ margin-top: 4px;
+ text-shadow: 0 0 20px var(--accent-glow);
+ transition: var(--transition-smooth);
+}
+
diff --git a/src/ui/styles/layers.css b/src/ui/styles/layers.css
new file mode 100644
index 000000000..f661b1e45
--- /dev/null
+++ b/src/ui/styles/layers.css
@@ -0,0 +1,1067 @@
+/* ── Data Layer Toggle Panel ─────────────────── */
+#left-panel-stack {
+ position: fixed;
+ top: var(--left-stack-safe-top, var(--left-stack-top));
+ bottom: var(--left-stack-safe-bottom, 4vh);
+ left: var(--left-stack-x);
+ z-index: 100;
+ width: 360px;
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+ gap: 8px;
+ pointer-events: none;
+ transition: top var(--transition-fast), bottom var(--transition-fast);
+}
+
+#data-panel {
+ --panel-expanded-width: 280px;
+ position: fixed;
+ top: calc(var(--left-stack-top) + var(--left-stack-gap));
+ left: var(--left-stack-x);
+ right: auto;
+ bottom: auto;
+ z-index: 100;
+ width: var(--panel-expanded-width);
+ opacity: 0;
+ visibility: hidden;
+ transform: translateY(8px);
+ transition: opacity var(--transition-smooth), visibility var(--transition-smooth), transform var(--transition-smooth);
+}
+
+#data-panel.active {
+ opacity: 1;
+ visibility: visible;
+ transform: translateY(0);
+}
+
+#data-panel .panel-glow {
+ position: absolute;
+ inset: -20px;
+ background: radial-gradient(ellipse at center, var(--accent-dim) 0%, transparent 60%);
+ filter: blur(20px);
+ opacity: 0.25;
+ pointer-events: none;
+}
+
+.data-panel-inner {
+ position: relative;
+ background: var(--glass-bg);
+ border: 1px solid var(--glass-border);
+ border-radius: var(--panel-radius);
+ padding: 14px 16px 12px;
+ backdrop-filter: blur(24px) saturate(1.4);
+ -webkit-backdrop-filter: blur(24px) saturate(1.4);
+ box-shadow:
+ 0 8px 32px rgba(0, 0, 0, 0.5),
+ 0 0 0 1px rgba(255, 255, 255, 0.03) inset,
+ 0 1px 0 rgba(255, 255, 255, 0.06) inset;
+ max-height: min(620px, calc(100vh - var(--left-stack-top) - var(--left-stack-gap) - 36px));
+ display: flex;
+ flex-direction: column;
+ min-height: 0;
+}
+
+.data-toggle-list {
+ display: flex;
+ flex-direction: column;
+ gap: 2px;
+ flex: 1 1 auto;
+ min-height: 0;
+ max-height: 100%;
+ overflow-y: auto;
+ overscroll-behavior: contain;
+ padding-right: 4px;
+ scrollbar-width: thin;
+ scrollbar-color: rgba(0, 212, 255, 0.5) rgba(255, 255, 255, 0.04);
+ scrollbar-gutter: stable;
+}
+
+.data-toggle-list::-webkit-scrollbar {
+ width: 6px;
+}
+
+.data-toggle-list::-webkit-scrollbar-track {
+ background: rgba(255, 255, 255, 0.04);
+ border-radius: 999px;
+}
+
+.data-toggle-list::-webkit-scrollbar-thumb {
+ background: linear-gradient(180deg, rgba(0, 212, 255, 0.65), rgba(0, 212, 255, 0.2));
+ border-radius: 999px;
+}
+
+.data-toggle-row {
+ padding: 8px 10px 6px;
+ border-radius: 8px;
+ transition: background var(--transition-fast);
+}
+
+.data-toggle-row:hover {
+ background: rgba(255, 255, 255, 0.03);
+}
+
+/* Selected-only, provenance-first proximity results. This is intentionally a
+ contextual panel, not a radar/engagement display. */
+#global-context-panel {
+ --panel-expanded-width: 330px;
+ width: var(--panel-expanded-width);
+ max-width: 100%;
+ min-height: 0;
+}
+#right-context-rail {
+ --right-display-collapsed-width: var(--left-collapsed-width);
+ --right-context-collapsed-width: var(--left-collapsed-width);
+ position: fixed;
+ z-index: 110;
+ top: var(--right-stack-safe-top, 26vh);
+ right: var(--right-rail-x);
+ width: 330px;
+ max-height: var(--right-stack-max-height, 70vh);
+ display: flex;
+ flex-direction: column;
+ align-items: flex-end;
+ gap: 8px;
+ pointer-events: none;
+ transition: top var(--transition-fast), max-height var(--transition-fast);
+}
+#right-context-rail > #pp-toggles,
+#right-context-rail > #cctv-panel,
+#right-context-rail > #global-context-panel {
+ position: relative;
+ inset: auto;
+ flex: 0 0 auto;
+ pointer-events: auto;
+}
+#right-context-rail #global-context-panel {
+ width: 100%;
+ max-height: 100%;
+ pointer-events: auto;
+}
+#right-context-rail #cctv-panel {
+ width: 100%;
+ max-height: 100%;
+ pointer-events: auto;
+}
+#right-context-rail #cctv-panel.collapsed {
+ width: var(--right-display-collapsed-width);
+ margin-left: auto;
+}
+#right-context-rail > #pp-toggles.collapsed {
+ width: var(--right-display-collapsed-width);
+ margin-left: auto;
+}
+#right-context-rail > #pp-toggles.collapsed .pp-header-row {
+ width: 100%;
+}
+#right-context-rail > #pp-toggles.collapsed .pp-header-row,
+#right-context-rail #cctv-panel.collapsed .cctv-panel-inner,
+#right-context-rail #global-context-panel.collapsed .global-context-panel-inner {
+ height: 50px;
+ min-height: 50px;
+ box-sizing: border-box;
+}
+#right-context-rail #cctv-panel:not(.collapsed) .cctv-panel-inner {
+ max-height: 100%;
+ overflow-y: auto;
+ scrollbar-gutter: stable;
+}
+#right-context-rail .global-context-panel-inner { max-height: 100%; }
+#right-context-rail #global-context-panel:not(.collapsed) .global-context-panel-inner {
+ max-height: 100%;
+ overflow-y: auto;
+ scrollbar-gutter: stable;
+}
+#right-context-rail #global-context-panel.collapsed {
+ width: var(--right-context-collapsed-width);
+ /* Keep the compact Context tab on the rail edge rather than leaving it
+ stranded at the rail's expanded-width origin. */
+ margin-left: auto;
+}
+#right-context-rail #global-context-panel.collapsed .global-context-panel-inner {
+ min-height: 42px;
+ box-sizing: border-box;
+ justify-content: center;
+ overflow: visible;
+ padding: 8px 10px 8px 14px;
+}
+#right-context-rail #global-context-panel.collapsed .panel-header {
+ margin: 0;
+}
+#right-context-rail.layout-focus {
+ height: var(--right-stack-max-height);
+}
+#right-context-rail.layout-exclusive > [data-panel-id].collapsed {
+ display: none;
+}
+#right-context-rail.layout-focus > [data-panel-id].collapsed {
+ display: block;
+ flex: 0 0 auto;
+}
+#right-context-rail.layout-focus.layout-exclusive > [data-panel-id].collapsed {
+ display: none;
+}
+#right-context-rail.layout-focus > #pp-toggles:not(.collapsed),
+#right-context-rail.layout-focus > #cctv-panel:not(.collapsed),
+#right-context-rail.layout-focus > #global-context-panel:not(.collapsed) {
+ flex: 0 1 var(--right-panel-allocated-height);
+ height: var(--right-panel-allocated-height);
+ min-height: 0;
+ max-height: var(--right-panel-allocated-height);
+}
+#right-context-rail.layout-focus > #pp-toggles:not(.collapsed) {
+ overflow-y: auto;
+ overscroll-behavior: contain;
+ scrollbar-width: thin;
+ scrollbar-color: rgba(0, 212, 255, 0.4) transparent;
+}
+#right-context-rail.layout-focus > #cctv-panel:not(.collapsed) .cctv-panel-inner,
+#right-context-rail.layout-focus > #global-context-panel:not(.collapsed) .global-context-panel-inner {
+ height: 100%;
+ box-sizing: border-box;
+}
+#right-context-rail #context-missions-view:not([hidden]),
+#right-context-rail #space-mission-panel-host,
+#right-context-rail .space-mission-roster {
+ min-height: 0;
+}
+#right-context-rail.layout-focus #context-missions-view:not([hidden]),
+#right-context-rail.layout-focus #space-mission-panel-host,
+#right-context-rail.layout-focus .space-mission-roster {
+ display: flex;
+ flex: 1 1 auto;
+ flex-direction: column;
+}
+#right-context-rail.layout-focus .space-mission-roster-list {
+ flex: 1 1 auto;
+ max-height: none;
+}
+#space-mission-panel {
+ width: 100%;
+ margin-top: 8px;
+ pointer-events: auto;
+}
+#space-mission-panel-host:has(#space-mission-panel:not([hidden])) > .context-mode-standby,
+#space-mission-panel-host:has(#space-mission-panel:not([hidden])) > .space-mission-roster {
+ display: none;
+}
+#space-mission-panel-host .space-mission-roster {
+ display: grid;
+ min-height: 0;
+ gap: 8px;
+ padding: 9px;
+ border: 1px solid rgba(98, 181, 255, .2);
+ border-radius: 7px;
+ background: rgba(4, 17, 31, .28);
+}
+#space-mission-panel-host .space-mission-roster-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 10px;
+ padding: 1px 3px 7px;
+ border-bottom: 1px solid rgba(34, 230, 230, .14);
+ font-family: 'JetBrains Mono', monospace;
+}
+#space-mission-panel-host .space-mission-roster-header > div {
+ display: grid;
+ min-width: 0;
+ gap: 3px;
+}
+#space-mission-panel-host .space-mission-roster-header strong {
+ color: #8fcfff;
+ font-size: 9px;
+ letter-spacing: .16em;
+}
+#space-mission-panel-host .space-mission-roster-header span {
+ color: rgba(190, 230, 230, .46);
+ font-size: 7px;
+ letter-spacing: .1em;
+}
+#space-mission-panel-host .space-mission-roster-header output {
+ flex: 0 0 auto;
+ color: #22e6e6;
+ font-size: 9px;
+ letter-spacing: .08em;
+}
+#space-mission-panel-host .space-mission-roster-list {
+ display: grid;
+ max-height: min(43vh, 420px);
+ gap: 4px;
+ overflow-x: hidden;
+ overflow-y: auto;
+ padding-right: 3px;
+ scrollbar-color: rgba(34, 230, 230, .38) transparent;
+ scrollbar-width: thin;
+}
+#space-mission-panel-host .space-mission-roster-item {
+ position: relative;
+ display: grid;
+ grid-template-columns: 10px minmax(0, 1fr) 12px;
+ align-items: center;
+ gap: 7px;
+ width: 100%;
+ min-height: 42px;
+ padding: 7px 7px;
+ border: 1px solid rgba(98, 181, 255, .13);
+ border-radius: 4px;
+ color: #d8ffff;
+ background: rgba(42, 113, 171, .045);
+ font-family: 'JetBrains Mono', monospace;
+ text-align: left;
+ cursor: pointer;
+ transition: border-color .15s ease, background .15s ease, transform .15s ease;
+}
+#space-mission-panel-host .space-mission-roster-item::before {
+ content: '';
+ position: absolute;
+ inset: 3px;
+ z-index: 1;
+ opacity: 0;
+ background:
+ linear-gradient(#22e6e6, #22e6e6) left top / 9px 1px no-repeat,
+ linear-gradient(#22e6e6, #22e6e6) left top / 1px 9px no-repeat,
+ linear-gradient(#22e6e6, #22e6e6) right top / 9px 1px no-repeat,
+ linear-gradient(#22e6e6, #22e6e6) right top / 1px 9px no-repeat,
+ linear-gradient(#22e6e6, #22e6e6) left bottom / 9px 1px no-repeat,
+ linear-gradient(#22e6e6, #22e6e6) left bottom / 1px 9px no-repeat,
+ linear-gradient(#22e6e6, #22e6e6) right bottom / 9px 1px no-repeat,
+ linear-gradient(#22e6e6, #22e6e6) right bottom / 1px 9px no-repeat;
+ filter: drop-shadow(0 0 4px rgba(34, 230, 230, .45));
+ pointer-events: none;
+ transition: opacity .12s ease;
+}
+#space-mission-panel-host .space-mission-roster-item:hover,
+#space-mission-panel-host .space-mission-roster-item:focus-visible {
+ border-color: rgba(34, 230, 230, .58);
+ outline: none;
+ background: rgba(34, 230, 230, .09);
+ transform: translateX(2px);
+}
+#space-mission-panel-host .space-mission-roster-item:hover::before,
+#space-mission-panel-host .space-mission-roster-item:focus-visible::before {
+ opacity: 1;
+}
+#space-mission-panel-host .space-mission-roster-item > * {
+ position: relative;
+ z-index: 2;
+}
+#space-mission-panel-host .space-mission-roster-marker {
+ width: 5px;
+ height: 5px;
+ justify-self: center;
+ border-radius: 50%;
+ background: var(--mission-roster-color, #22e6e6);
+ box-shadow: 0 0 7px color-mix(in srgb, var(--mission-roster-color, #22e6e6) 70%, transparent);
+}
+#space-mission-panel-host .space-mission-roster-copy {
+ display: grid;
+ min-width: 0;
+ gap: 3px;
+}
+#space-mission-panel-host .space-mission-roster-copy strong,
+#space-mission-panel-host .space-mission-roster-copy small {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+#space-mission-panel-host .space-mission-roster-copy strong {
+ color: #d8ffff;
+ font-size: 9px;
+ font-weight: 500;
+ letter-spacing: .07em;
+}
+#space-mission-panel-host .space-mission-roster-copy small {
+ color: rgba(190, 230, 230, .48);
+ font-size: 7px;
+ letter-spacing: .035em;
+}
+#space-mission-panel-host .space-mission-roster-chevron {
+ color: rgba(34, 230, 230, .54);
+ font-size: 16px;
+ line-height: 1;
+}
+#space-mission-panel-host .space-mission-roster-empty {
+ padding: 18px 10px;
+ color: rgba(190, 230, 230, .48);
+ font: 8px/1.5 'JetBrains Mono', monospace;
+ letter-spacing: .09em;
+ text-align: center;
+}
+#space-mission-panel-host .space-mission-roster-focus-continuation {
+ margin: 0;
+ padding: 3px;
+ color: rgba(190, 230, 230, .58);
+ font: 7px/1.4 'JetBrains Mono', monospace;
+ letter-spacing: .08em;
+ text-align: center;
+}
+#space-mission-panel .space-mission-view-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 8px 0 2px;
+ border-top: 1px solid rgba(34, 230, 230, .18);
+ color: rgba(190, 230, 230, .58);
+ font: 8px 'JetBrains Mono', monospace;
+ letter-spacing: .18em;
+}
+#space-mission-panel .space-mission-view-header button {
+ width: 24px;
+ height: 24px;
+ border: 1px solid rgba(98, 181, 255, .24);
+ border-radius: 5px;
+ color: rgba(190, 230, 230, .7);
+ background: rgba(42, 113, 171, .08);
+ cursor: pointer;
+}
+#space-mission-panel .space-mission-view-header button:hover {
+ border-color: #22e6e6;
+ color: #fff;
+}
+#space-mission-panel .space-mission-detail {
+ display: grid;
+ gap: 8px;
+ padding: 12px 0;
+ color: var(--hud-cyan, #22e6e6);
+ font: 11px 'JetBrains Mono', monospace;
+ letter-spacing: .08em;
+}
+#space-mission-panel .space-mission-detail strong { font-size: 14px; }
+#space-mission-panel .space-mission-detail span { color: rgba(190, 230, 230, .7); }
+#space-mission-panel .space-mission-detail b { color: #d8ffff; font-weight: 400; }
+#space-mission-panel .mission-data-section {
+ margin: 0 0 11px;
+ border-top: 1px solid rgba(34, 230, 230, .18);
+ padding-top: 9px;
+}
+#space-mission-panel .mission-data-section h4 {
+ margin: 0 0 6px;
+ color: #22e6e6;
+ font: 10px 'JetBrains Mono', monospace;
+ letter-spacing: .17em;
+}
+#space-mission-panel .mission-table-scroll { overflow-x: auto; }
+#space-mission-panel .mission-data-table {
+ width: 100%;
+ border-collapse: collapse;
+ table-layout: fixed;
+ color: #d8ffff;
+ font: 9px 'JetBrains Mono', monospace;
+ letter-spacing: .025em;
+}
+#space-mission-panel .mission-data-table th {
+ padding: 4px 5px;
+ border-bottom: 1px solid rgba(34, 230, 230, .22);
+ color: rgba(190, 230, 230, .58);
+ font-weight: 400;
+ text-align: left;
+}
+#space-mission-panel .mission-data-table td {
+ overflow-wrap: anywhere;
+ padding: 6px 5px;
+ border-bottom: 1px solid rgba(34, 230, 230, .1);
+ vertical-align: top;
+}
+#space-mission-panel .mission-data-table th:nth-child(1),
+#space-mission-panel .mission-data-table td:nth-child(1) { width: 34%; }
+#space-mission-panel .mission-data-table th:nth-child(2),
+#space-mission-panel .mission-data-table td:nth-child(2) { width: 25%; }
+#space-mission-panel .mission-data-table small {
+ display: block;
+ margin-top: 3px;
+ color: rgba(190, 230, 230, .56);
+ font-size: 8px;
+ line-height: 1.35;
+}
+#space-mission-panel .mission-table-empty {
+ color: rgba(190, 230, 230, .56);
+ text-align: center;
+}
+#space-mission-panel .mission-replay-speed-control {
+ display: grid;
+ gap: 5px;
+ margin: 1px 0 10px;
+ padding: 8px 10px 6px;
+ border: 1px solid rgba(34, 230, 230, .2);
+ border-radius: 5px;
+ background: rgba(3, 21, 31, .36);
+}
+#space-mission-panel .mission-replay-speed-control[hidden] { display: none; }
+#space-mission-panel .mission-replay-speed-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ color: rgba(190, 230, 230, .68);
+ font: 8px 'JetBrains Mono', monospace;
+ letter-spacing: .16em;
+}
+#space-mission-panel .mission-replay-speed-header output {
+ min-width: 42px;
+ text-align: right;
+}
+#space-mission-panel [data-mission-replay-speed] {
+ width: 100%;
+}
+#space-mission-panel .mission-replay-speed-scale {
+ display: flex;
+ justify-content: space-between;
+ color: rgba(190, 230, 230, .42);
+ font: 7px 'JetBrains Mono', monospace;
+ letter-spacing: .08em;
+}
+
+#space-mission-panel .mission-action-row {
+ display: flex;
+ gap: 8px;
+ margin: 1px 0 10px;
+}
+#space-mission-panel .mission-replay-button,
+#space-mission-panel .mission-focus-button {
+ flex: 1;
+ min-width: 0;
+ padding: 9px 12px;
+ border: 1px solid rgba(255, 159, 67, .62);
+ border-radius: 5px;
+ color: #ffc078;
+ background: linear-gradient(90deg, rgba(255, 159, 67, .08), rgba(34, 230, 230, .08));
+ font: 9px 'JetBrains Mono', monospace;
+ letter-spacing: .16em;
+ cursor: pointer;
+ transition: border-color .15s ease, color .15s ease, background .15s ease, box-shadow .15s ease;
+}
+#space-mission-panel .mission-focus-button {
+ border-color: rgba(34, 230, 230, .58);
+ color: #22e6e6;
+ background: rgba(34, 230, 230, .07);
+}
+#space-mission-panel .mission-replay-button:hover,
+#space-mission-panel .mission-replay-button:focus-visible,
+#space-mission-panel .mission-focus-button:hover,
+#space-mission-panel .mission-focus-button:focus-visible {
+ border-color: #ffb45f;
+ color: #fff;
+ outline: none;
+ box-shadow: 0 0 14px rgba(255, 159, 67, .14);
+}
+#space-mission-panel .mission-focus-button:hover,
+#space-mission-panel .mission-focus-button:focus-visible {
+ border-color: #22e6e6;
+ box-shadow: 0 0 14px rgba(34, 230, 230, .14);
+}
+#space-mission-panel .mission-replay-button.active {
+ border-color: #22e6e6;
+ color: #d8ffff;
+ background: rgba(34, 230, 230, .13);
+ box-shadow: inset 0 0 16px rgba(34, 230, 230, .08);
+}
+#space-mission-panel .mission-replay-transport {
+ flex: 1;
+ min-width: 0;
+ display: grid;
+ grid-template-columns: repeat(3, minmax(0, 1fr));
+ gap: 5px;
+}
+#space-mission-panel .mission-replay-transport[hidden] { display: none; }
+#space-mission-panel .mission-replay-transport button {
+ min-width: 0;
+ min-height: 34px;
+ padding: 0;
+ border: 1px solid rgba(34, 230, 230, .5);
+ border-radius: 4px;
+ color: #22e6e6;
+ background: rgba(34, 230, 230, .08);
+ font: 15px/1 'JetBrains Mono', monospace;
+ cursor: pointer;
+ transition: border-color .15s ease, color .15s ease, background .15s ease, box-shadow .15s ease, opacity .15s ease;
+}
+#space-mission-panel .mission-replay-transport button:hover:not(:disabled),
+#space-mission-panel .mission-replay-transport button:focus-visible {
+ border-color: #d8ffff;
+ color: #fff;
+ outline: none;
+ background: rgba(34, 230, 230, .16);
+ box-shadow: 0 0 12px rgba(34, 230, 230, .14);
+}
+#space-mission-panel .mission-replay-transport button:disabled {
+ opacity: .28;
+ cursor: default;
+}
+#space-mission-panel .mission-replay-transport button.cancel {
+ border-color: rgba(255, 159, 67, .58);
+ color: #ffb15c;
+ background: rgba(255, 159, 67, .08);
+}
+#space-mission-panel .mission-replay-transport.is-paused [data-mission-replay-play] {
+ border-color: #22e6e6;
+ color: #d8ffff;
+ background: rgba(34, 230, 230, .18);
+ box-shadow: inset 0 0 12px rgba(34, 230, 230, .1);
+}
+#space-mission-panel .space-mission-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
+#space-mission-panel .mission-nav-button {
+ min-width: 94px;
+ padding: 7px 10px;
+ border: 1px solid rgba(34, 230, 230, .55);
+ background: rgba(8, 34, 42, .72);
+ color: #22e6e6;
+ font: 11px 'JetBrains Mono', monospace;
+ letter-spacing: .12em;
+ cursor: pointer;
+ transition: background .15s ease, border-color .15s ease, opacity .15s ease;
+}
+#space-mission-panel .mission-nav-button:hover:not(:disabled) { background: rgba(34, 230, 230, .18); border-color: #22e6e6; }
+#space-mission-panel .mission-nav-button:disabled { cursor: not-allowed; opacity: .28; }
+#space-mission-panel .mission-nav-button span { font-size: 18px; line-height: 0; vertical-align: -2px; }
+#space-mission-panel .mission-nav-index { min-width: 58px; text-align: center; color: #d8ffff; font: 11px 'JetBrains Mono', monospace; letter-spacing: .1em; }
+#space-mission-panel button { cursor: pointer; }
+
+.mission-replay-vehicle-overlay {
+ --mission-replay-vehicle-scale: .50;
+ position: absolute;
+ top: 0;
+ left: 0;
+ z-index: 86;
+ width: 92px;
+ height: 138px;
+ pointer-events: none;
+ will-change: transform;
+}
+
+.mission-replay-flight-symbol {
+ position: absolute;
+ inset: 0;
+ transform: rotate(var(--mission-replay-rotation, 0deg)) scale(var(--mission-replay-vehicle-scale));
+ transform-origin: 46px 69px;
+ will-change: transform;
+}
+
+.mission-replay-orbit-dot {
+ display: none;
+ position: absolute;
+ top: 65px;
+ left: 42px;
+ width: 8px;
+ height: 8px;
+ border-radius: 50%;
+ background: #22e6e6;
+ box-shadow: 0 0 7px rgba(34, 230, 230, .78);
+}
+
+.mission-replay-vehicle-overlay[data-mode='orbit'] .mission-replay-flight-symbol {
+ display: none;
+}
+
+.mission-replay-vehicle-overlay[data-mode='orbit'] .mission-replay-orbit-dot {
+ display: block;
+}
+
+.mission-replay-rocket {
+ position: absolute;
+ top: 0;
+ left: 22px;
+ width: 48px;
+ height: 72px;
+ overflow: visible;
+ filter: drop-shadow(0 0 6px rgba(34, 230, 230, .66));
+}
+
+.mission-replay-rocket-body {
+ fill: #22e6e6;
+ stroke: #22e6e6;
+ stroke-width: 2;
+ stroke-linejoin: round;
+}
+
+.mission-replay-rocket-port {
+ fill: #22e6e6;
+ stroke: none;
+}
+
+.mission-replay-rocket-flame {
+ display: none;
+}
+
+.mission-replay-thrust {
+ display: none;
+ position: absolute;
+ top: 57px;
+ left: 10px;
+ width: 72px;
+ height: 72px;
+ overflow: visible;
+ filter: drop-shadow(0 0 4px rgba(34, 230, 230, .9));
+}
+
+.mission-replay-vehicle-overlay.is-thrusting .mission-replay-thrust {
+ display: block;
+}
+
+.mission-replay-thrust ellipse {
+ fill: none;
+ stroke: rgba(34, 230, 230, .98);
+ stroke-width: 2;
+ opacity: 0;
+ vector-effect: non-scaling-stroke;
+ animation: mission-thrust-wave .9s ease-in-out infinite;
+ animation-delay: calc(var(--thrust-index) * .15s);
+}
+
+.mission-replay-thrust ellipse:nth-child(2n) {
+ stroke: rgba(216, 255, 255, .78);
+}
+
+.mission-replay-vehicle-overlay.is-paused .mission-replay-thrust ellipse {
+ animation-play-state: paused;
+}
+
+.mission-replay-overlay-callout {
+ position: absolute;
+ top: 18px;
+ left: 70px;
+ min-width: 188px;
+ color: #fff;
+ font: 9px/1.38 'JetBrains Mono', monospace;
+ letter-spacing: .075em;
+ text-shadow: 0 1px 2px #001018, 0 0 6px #001018;
+ white-space: nowrap;
+}
+
+.mission-replay-overlay-callout strong,
+.mission-replay-overlay-callout span {
+ display: block;
+}
+
+.mission-replay-overlay-callout strong {
+ color: #22e6e6;
+ font-size: 10px;
+ font-weight: 500;
+}
+
+.mission-replay-overlay-callout span {
+ color: rgba(255, 255, 255, .92);
+ white-space: pre-line;
+}
+
+.mission-replay-vehicle-overlay[data-mode='orbit'] .mission-replay-overlay-callout {
+ top: 55px;
+ left: 58px;
+}
+
+@keyframes mission-thrust-wave {
+ 0%, 18% { opacity: 0; }
+ 24% { opacity: 1; }
+ 32%, 100% { opacity: 0; }
+}
+
+@media (prefers-reduced-motion: reduce) {
+ .mission-replay-thrust ellipse {
+ animation: none;
+ }
+}
+#global-context-panel .panel-glow {
+ position: absolute;
+ inset: -20px;
+ background: radial-gradient(ellipse at center, rgba(98, 181, 255, 0.2) 0%, transparent 62%);
+ filter: blur(20px);
+ opacity: 0.24;
+ pointer-events: none;
+}
+.global-context-panel-inner {
+ position: relative;
+ display: flex;
+ min-height: 0;
+ flex-direction: column;
+ padding: 14px 16px 12px;
+ border: 1px solid var(--glass-border);
+ border-radius: var(--panel-radius);
+ background: var(--glass-bg);
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
+ backdrop-filter: blur(24px) saturate(1.4);
+ -webkit-backdrop-filter: blur(24px) saturate(1.4);
+}
+.context-radio-dock {
+ position: relative;
+ display: flex;
+ align-items: center;
+}
+.context-radio-toggle {
+ display: grid;
+ width: 28px;
+ height: 28px;
+ place-items: center;
+ padding: 0;
+ border: 1px solid rgba(98, 181, 255, .22);
+ border-radius: 6px;
+ color: rgba(143, 207, 255, .58);
+ background: rgba(42, 113, 171, .08);
+ cursor: pointer;
+ transition: border-color .15s ease, color .15s ease, background .15s ease, box-shadow .15s ease;
+}
+.context-radio-toggle .material-symbols-outlined { font-size: 17px; }
+.context-radio-toggle:hover,
+.context-radio-toggle:focus-visible {
+ border-color: #79c2ff;
+ color: #fff;
+ outline: none;
+}
+.context-radio-toggle.active {
+ border-color: rgba(101, 247, 255, .82);
+ color: #eaffff;
+ background: rgba(0, 212, 255, .16);
+ box-shadow: inset 0 0 12px rgba(0, 212, 255, .1), 0 0 12px rgba(0, 212, 255, .2);
+}
+.context-radio-toggle:disabled { opacity: .5; cursor: wait; }
+.context-radio-mini {
+ position: absolute;
+ z-index: 5;
+ top: calc(100% + 20px);
+ right: -38px;
+ display: none;
+ width: 244px;
+ box-sizing: border-box;
+ gap: 8px;
+ padding: 10px;
+ border: 1px solid rgba(65, 220, 231, .28);
+ border-radius: 8px;
+ background: rgba(2, 15, 20, .96);
+ box-shadow: 0 12px 32px rgba(0, 0, 0, .62), inset 0 1px 0 rgba(255, 255, 255, .04);
+ backdrop-filter: blur(22px) saturate(1.35);
+ -webkit-backdrop-filter: blur(22px) saturate(1.35);
+}
+.context-radio-mini[hidden] { display: none !important; }
+.context-radio-dock.disclosure-open .context-radio-mini {
+ display: grid;
+}
+.context-radio-mini-heading {
+ display: grid;
+ grid-template-columns: auto minmax(0, 1fr) auto;
+ gap: 8px;
+ align-items: center;
+ color: #65f7ff;
+ font: 7px/1.2 var(--font-mono);
+ letter-spacing: .12em;
+}
+.context-radio-mini-heading button {
+ display: grid;
+ width: 26px;
+ height: 26px;
+ place-items: center;
+ padding: 0;
+ border: 1px solid rgba(65, 220, 231, .28);
+ border-radius: 5px;
+ color: #8feaf2;
+ background: rgba(14, 69, 78, .16);
+ cursor: pointer;
+}
+.context-radio-mini-heading button:hover,
+.context-radio-mini-heading button:focus-visible {
+ border-color: #65f7ff;
+ color: #fff;
+ outline: none;
+}
+.context-radio-mini-actions {
+ display: flex;
+ gap: 5px;
+}
+.context-radio-mini-heading .material-symbols-outlined { font-size: 16px; }
+.context-radio-mini > .panel-layer-toggle { width: 100%; }
+.context-radio-mini-heading strong {
+ overflow: hidden;
+ color: #e8feff;
+ font-size: 8px;
+ font-weight: 500;
+ text-align: right;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.context-radio-mini-transport {
+ display: grid;
+ grid-template-columns: repeat(3, minmax(0, 1fr));
+ gap: 5px;
+}
+.context-radio-mini-transport button {
+ min-height: 28px;
+ padding: 5px;
+ border: 1px solid rgba(65, 220, 231, .28);
+ border-radius: 5px;
+ color: #8feaf2;
+ background: rgba(14, 69, 78, .16);
+ font: 8px/1 var(--font-mono);
+ cursor: pointer;
+}
+.context-radio-mini-transport button:hover:not(:disabled),
+.context-radio-mini-transport button:focus-visible:not(:disabled),
+.context-radio-mini-transport button.active {
+ border-color: #65f7ff;
+ color: #fff;
+ outline: none;
+}
+.context-radio-mini-transport button:disabled { opacity: .38; cursor: not-allowed; }
+.context-radio-mini-volume {
+ display: grid;
+ grid-template-columns: auto minmax(0, 1fr) 30px;
+ gap: 7px;
+ align-items: center;
+ color: var(--text-dim);
+ font: 7px/1 var(--font-mono);
+ letter-spacing: .08em;
+}
+.context-radio-mini-volume input { width: 100%; }
+.global-context-actions {
+ display: grid;
+ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
+ gap: 6px;
+ margin: 0 0 8px;
+}
+.global-context-actions:has(#installations-search-btn) { grid-template-columns: minmax(0, 1fr); }
+.global-context-actions:has(#cockpit-entry:not([hidden])) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
+.global-context-actions:has(#cockpit-entry[hidden]) { grid-template-columns: 1fr; }
+/* TR-3B reclassify toggle rides an `auto` trailing column so the chip never
+ resizes the COCKPIT / SEARCH buttons beside it. */
+.global-context-actions:has(#tr3b-toggle:not([hidden])) { grid-template-columns: repeat(2, minmax(0, 1fr)) auto; }
+.global-context-actions:has(#cockpit-entry[hidden]):has(#tr3b-toggle:not([hidden])) { grid-template-columns: minmax(0, 1fr) auto; }
+.tr3b-toggle {
+ width: 26px;
+ min-height: 30px;
+ padding: 0;
+ border: 1px solid rgba(98, 181, 255, 0.22);
+ border-radius: 5px;
+ background: rgba(42, 113, 171, 0.08);
+ /* The saucer is a COLOR-font glyph: `color` and `text-shadow` cannot touch
+ it, so the dim/lit states are carried by `filter` alongside the border and
+ fill. 14px sits inside the 26px chip with breathing room. */
+ font: 14px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
+ filter: grayscale(0.6) opacity(0.62);
+ cursor: pointer;
+ transition: filter 160ms ease, border-color 160ms ease, background 160ms ease;
+}
+.tr3b-toggle[hidden] { display: none; }
+.tr3b-toggle:hover, .tr3b-toggle:focus-visible {
+ border-color: rgba(127, 200, 255, 0.6);
+ background: rgba(66, 148, 211, 0.18);
+ filter: grayscale(0.15) opacity(0.95);
+ outline: none;
+}
+.tr3b-toggle[aria-pressed="true"] {
+ border-color: rgba(190, 220, 255, 0.75);
+ background: rgba(20, 23, 28, 0.9);
+ /* Active: full-colour saucer with a soft halo. drop-shadow works on an emoji
+ where text-shadow does not, so the glyph itself telegraphs the state
+ rather than relying on the chrome alone. */
+ filter: drop-shadow(0 0 5px rgba(150, 210, 255, 0.9));
+}
+.global-context-modes {
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: 7px;
+ margin: 0 0 10px;
+}
+.context-mode-button {
+ display: flex;
+ min-width: 0;
+ min-height: 36px;
+ align-items: center;
+ justify-content: center;
+ gap: 6px;
+ padding: 7px 8px;
+ border: 1px solid rgba(98, 181, 255, .28);
+ border-radius: 6px;
+ color: #8fcfff;
+ background: rgba(42, 113, 171, .09);
+ font: 8px/1.15 var(--font-mono);
+ letter-spacing: .09em;
+ cursor: pointer;
+ transition: border-color .15s ease, color .15s ease, background .15s ease, box-shadow .15s ease;
+}
+.context-mode-button .material-symbols-outlined { font-size: 16px; }
+.context-mode-button:hover,
+.context-mode-button:focus-visible {
+ border-color: #79c2ff;
+ color: #fff;
+ outline: none;
+}
+/* Keep focus distinct when the selected tab owns the accent colors. */
+.context-mode-button:focus-visible {
+ outline: 2px solid var(--text-primary);
+ outline-offset: -3px;
+}
+
+.context-mode-button.active {
+ border-color: rgba(0, 212, 255, .75);
+ color: #eaffff;
+ background: rgba(0, 212, 255, .14);
+ box-shadow: inset 0 0 16px rgba(0, 212, 255, .08), 0 0 12px rgba(0, 212, 255, .12);
+}
+.context-mode-button:disabled { opacity: .55; cursor: wait; }
+.context-mode-view[hidden],
+.context-mode-standby[hidden] { display: none !important; }
+.context-mode-standby {
+ display: grid;
+ min-height: 72px;
+ place-content: center;
+ gap: 6px;
+ padding: 12px;
+ border: 1px dashed rgba(98, 181, 255, .2);
+ border-radius: 7px;
+ color: rgba(190, 230, 230, .5);
+ text-align: center;
+ font: 8px/1.45 var(--font-mono);
+ letter-spacing: .1em;
+}
+.context-mode-standby strong {
+ color: #8fcfff;
+ font-size: 9px;
+ letter-spacing: .16em;
+}
+.context-mode-view { min-height: 0; }
+#right-context-rail #global-context-panel:not(.collapsed) .context-mode-view,
+#right-context-rail #global-context-panel:not(.collapsed) #radio-panel {
+ /* These sections share the Context panel's existing scroller. Keep their
+ natural heights so flexbox cannot compress one section and let its
+ contents paint through the next section. */
+ flex: 0 0 auto;
+}
+.panel-layer-toggle {
+ min-width: 54px;
+ padding: 4px 7px;
+ border: 1px solid rgba(98, 181, 255, 0.3);
+ border-radius: 5px;
+ color: #8fcfff;
+ background: rgba(42, 113, 171, 0.12);
+ font: 7px/1.1 var(--font-mono);
+ letter-spacing: 0.1em;
+ cursor: pointer;
+}
+.panel-layer-toggle:hover, .panel-layer-toggle:focus-visible {
+ border-color: #79c2ff;
+ color: #fff;
+ outline: none;
+}
+.panel-layer-toggle.active {
+ border-color: rgba(0, 212, 255, 0.7);
+ color: #fff;
+ background: rgba(0, 212, 255, 0.14);
+ box-shadow: 0 0 12px rgba(0, 212, 255, 0.14);
+}
+.panel-layer-toggle:disabled { opacity: 0.45; cursor: wait; }
+.global-context-actions .panel-layer-toggle {
+ width: 100%;
+ min-height: 30px;
+ padding: 6px 8px;
+ font-size: 8px;
+}
+#global-context-panel #cockpit-entry {
+ position: static;
+ z-index: auto;
+ width: 100%;
+ min-height: 30px;
+ padding: 5px 8px;
+ border-radius: 5px;
+ justify-content: center;
+ font-size: 8px;
+ box-shadow: none;
+}
+#global-context-panel #cockpit-entry .material-symbols-outlined { font-size: 15px; }
+#global-context-panel #cockpit-entry kbd { padding: 2px 4px; }
+
diff --git a/src/ui/styles/location.css b/src/ui/styles/location.css
new file mode 100644
index 000000000..4a8aa5576
--- /dev/null
+++ b/src/ui/styles/location.css
@@ -0,0 +1,292 @@
+/* ── Location Bar ────────────────────────────── */
+#location-bar {
+ position: fixed;
+ bottom: 130px;
+ left: 50%;
+ transform: translateX(-50%);
+ z-index: 100;
+ width: auto;
+ max-width: 720px;
+}
+
+#location-bar .panel-glow {
+ position: absolute;
+ inset: -20px;
+ background: radial-gradient(ellipse at center, var(--accent-dim) 0%, transparent 60%);
+ filter: blur(20px);
+ opacity: 0.25;
+ pointer-events: none;
+}
+
+.location-inner {
+ position: relative;
+ display: flex;
+ flex-direction: column;
+ background: var(--glass-bg);
+ border: 1px solid var(--glass-border);
+ border-radius: 12px;
+ padding: 8px 12px;
+ backdrop-filter: blur(24px) saturate(1.4);
+ -webkit-backdrop-filter: blur(24px) saturate(1.4);
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
+}
+
+.location-toolbar {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-bottom: 6px;
+ padding: 0 4px;
+}
+
+.location-toolbar-label {
+ font-family: var(--font-mono);
+ font-size: 8px;
+ letter-spacing: 2px;
+ color: var(--text-dim);
+}
+
+.location-mini-status {
+ display: none;
+ gap: 2px;
+ padding: 0 4px 4px;
+}
+
+#location-bar.collapsed .location-mini-status {
+ display: grid;
+}
+
+.location-mini-city {
+ font-family: var(--font-mono);
+ font-size: 9px;
+ letter-spacing: 0.8px;
+ color: #bdefff;
+}
+
+.location-mini-poi {
+ font-family: var(--font-mono);
+ font-size: 8px;
+ letter-spacing: 1px;
+ color: var(--text-secondary);
+ max-width: 190px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.location-pills {
+ display: flex;
+ gap: 6px;
+ overflow-x: auto;
+ scroll-behavior: smooth;
+ scrollbar-width: none;
+ -ms-overflow-style: none;
+}
+
+.location-pills::-webkit-scrollbar {
+ display: none;
+}
+
+.location-pill {
+ padding: 6px 14px;
+ background: rgba(255, 255, 255, 0.04);
+ border: 1px solid rgba(255, 255, 255, 0.08);
+ border-radius: 20px;
+ cursor: pointer;
+ transition:
+ background-color var(--transition-fast),
+ border-color var(--transition-fast),
+ box-shadow var(--transition-fast),
+ color var(--transition-fast),
+ transform var(--transition-fast);
+ outline: none;
+ white-space: nowrap;
+ font-family: var(--font-sans);
+ font-size: 11px;
+ font-weight: 500;
+ color: var(--text-secondary);
+ letter-spacing: 0.3px;
+}
+
+.location-pill:focus-visible,
+.poi-pill:focus-visible,
+.search-toggle-btn:focus-visible,
+#location-search:focus-visible {
+ outline: 2px solid var(--text-primary);
+ outline-offset: -3px;
+}
+
+.location-pill:hover {
+ background: rgba(255, 255, 255, 0.08);
+ border-color: var(--glass-border-hover);
+ transform: translateY(-1px);
+}
+
+.location-pill.active {
+ background: var(--accent-dim);
+ border-color: var(--accent);
+ color: var(--accent);
+ box-shadow: 0 0 12px rgba(0, 212, 255, 0.15);
+}
+
+/* ── Expandable POI Row ──────────────────────── */
+.poi-row-container {
+ display: flex;
+ gap: 6px;
+ justify-content: center;
+ max-height: 0;
+ overflow: hidden;
+ opacity: 0;
+ transition: max-height 250ms cubic-bezier(0.4, 0, 0.2, 1),
+ opacity 200ms ease,
+ padding 250ms cubic-bezier(0.4, 0, 0.2, 1);
+ padding: 0 4px;
+}
+
+.poi-row-container.expanded {
+ max-height: 50px;
+ opacity: 1;
+ padding: 4px 4px 0;
+}
+
+.location-bar-divider {
+ height: 0;
+ border: none;
+ border-top: 1px solid var(--glass-border);
+ margin: 0 4px;
+ opacity: 0;
+ transition: opacity 200ms ease, margin 250ms ease;
+}
+
+.location-bar-divider.visible {
+ opacity: 1;
+ margin: 6px 4px;
+}
+
+.location-city-row {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+}
+
+.poi-pill {
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ padding: 5px 12px;
+ background: rgba(255, 255, 255, 0.04);
+ border: 1px solid rgba(255, 255, 255, 0.08);
+ border-radius: 20px;
+ cursor: pointer;
+ transition:
+ background-color var(--transition-fast),
+ border-color var(--transition-fast),
+ box-shadow var(--transition-fast),
+ color var(--transition-fast),
+ transform var(--transition-fast);
+ outline: none;
+ white-space: nowrap;
+ flex-shrink: 0;
+}
+
+.poi-pill:hover {
+ background: rgba(255, 255, 255, 0.08);
+ border-color: var(--glass-border-hover);
+ transform: translateY(-1px);
+}
+
+.poi-pill.active {
+ background: var(--accent-dim);
+ border-color: var(--accent);
+ box-shadow: 0 0 12px rgba(0, 212, 255, 0.15);
+}
+
+.poi-pill-name {
+ font-family: var(--font-sans);
+ font-size: 10px;
+ font-weight: 500;
+ color: var(--text-secondary);
+ letter-spacing: 0.3px;
+}
+
+.poi-pill.active .poi-pill-name {
+ color: var(--accent);
+}
+
+.poi-pill-key {
+ font-family: var(--font-mono);
+ font-size: 8px;
+ letter-spacing: 1px;
+ color: var(--text-dim);
+ background: rgba(255, 255, 255, 0.06);
+ padding: 2px 5px;
+ border-radius: 3px;
+ flex-shrink: 0;
+}
+
+.poi-pill.active .poi-pill-key {
+ color: var(--accent);
+ background: rgba(0, 212, 255, 0.12);
+}
+
+/* ── Location Search ─────────────────────────── */
+.location-search-wrap {
+ display: flex;
+ align-items: center;
+ gap: 0;
+ flex-shrink: 0;
+}
+
+.search-toggle-btn {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 32px;
+ height: 32px;
+ background: rgba(255, 255, 255, 0.04);
+ border: 1px solid rgba(255, 255, 255, 0.08);
+ border-radius: 50%;
+ cursor: pointer;
+ transition:
+ background-color var(--transition-fast),
+ border-color var(--transition-fast),
+ box-shadow var(--transition-fast),
+ color var(--transition-fast);
+ outline: none;
+ font-size: 14px;
+ flex-shrink: 0;
+}
+
+.search-toggle-btn:hover {
+ background: rgba(255, 255, 255, 0.08);
+ border-color: var(--glass-border-hover);
+}
+
+#location-search {
+ width: 0;
+ padding: 0;
+ border: none;
+ background: none;
+ outline: none;
+ color: var(--text-primary);
+ font-family: var(--font-sans);
+ font-size: 13px;
+ letter-spacing: 0.3px;
+ transition: width var(--transition-smooth), padding var(--transition-smooth);
+ caret-color: var(--accent);
+}
+
+#location-search.expanded {
+ width: 180px;
+ padding: 6px 10px;
+}
+
+#location-search::placeholder {
+ color: var(--text-dim);
+ font-style: italic;
+}
+
+#location-search.searching {
+ opacity: 0.5;
+}
+
diff --git a/src/ui/styles/overlays.css b/src/ui/styles/overlays.css
new file mode 100644
index 000000000..87315b093
--- /dev/null
+++ b/src/ui/styles/overlays.css
@@ -0,0 +1,364 @@
+/* ── Safe Frame Overlay ─────────────────────── */
+#safe-frame-overlay {
+ position: fixed;
+ inset: 0;
+ z-index: 95;
+ pointer-events: none;
+ display: none;
+}
+
+#safe-frame-overlay.active {
+ display: block;
+}
+
+#safe-frame-box {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ width: min(90vw, calc(90vh * (16 / 9)));
+ aspect-ratio: 16 / 9;
+ border: 1px solid rgba(255, 255, 255, 0.28);
+ box-shadow:
+ 0 0 0 1px rgba(0, 0, 0, 0.35),
+ inset 0 0 0 1px rgba(255, 255, 255, 0.06);
+}
+
+#safe-frame-overlay.ratio-9-16 #safe-frame-box {
+ width: min(58vh, 76vw);
+ aspect-ratio: 9 / 16;
+}
+
+/* Rule-of-thirds guides */
+#safe-frame-box::before,
+#safe-frame-box::after {
+ content: '';
+ position: absolute;
+ inset: 0;
+ pointer-events: none;
+}
+
+#safe-frame-box::before {
+ background:
+ linear-gradient(to right,
+ transparent 33.333%,
+ rgba(255, 255, 255, 0.2) 33.333%,
+ rgba(255, 255, 255, 0.2) 33.7%,
+ transparent 33.7%,
+ transparent 66.333%,
+ rgba(255, 255, 255, 0.2) 66.333%,
+ rgba(255, 255, 255, 0.2) 66.7%,
+ transparent 66.7%
+ ),
+ linear-gradient(to bottom,
+ transparent 33.333%,
+ rgba(255, 255, 255, 0.2) 33.333%,
+ rgba(255, 255, 255, 0.2) 33.7%,
+ transparent 33.7%,
+ transparent 66.333%,
+ rgba(255, 255, 255, 0.2) 66.333%,
+ rgba(255, 255, 255, 0.2) 66.7%,
+ transparent 66.7%
+ );
+}
+
+/* ── Orbit Indicator ─────────────────────────── */
+#orbit-indicator {
+ position: fixed;
+ top: 70px;
+ right: 36px;
+ z-index: 100;
+ font-family: var(--font-mono);
+ font-size: 10px;
+ letter-spacing: 2px;
+ color: var(--accent);
+ text-shadow: 0 0 12px var(--accent-glow);
+ pointer-events: none;
+ user-select: none;
+ opacity: 0;
+ visibility: hidden;
+ transition: opacity var(--transition-smooth), visibility var(--transition-smooth);
+}
+
+#orbit-indicator.active {
+ opacity: 1;
+ visibility: visible;
+}
+
+.orbit-icon {
+ font-size: 13px;
+ vertical-align: middle;
+ margin-right: 2px;
+}
+
+/* ── Intelligence HUD Overlay ────────────────── */
+#intel-hud {
+ position: fixed;
+ inset: 0;
+ z-index: 2;
+ pointer-events: none;
+ opacity: 0;
+ visibility: hidden;
+ transition: opacity 0.4s ease, visibility 0.4s ease;
+ --hud-color: rgba(0, 255, 255, 0.6);
+ --hud-glow: rgba(0, 255, 255, 0.4);
+ --hud-border: rgba(0, 255, 255, 0.15);
+}
+
+#intel-hud.active {
+ opacity: 1;
+ visibility: visible;
+}
+
+#intel-hud * {
+ font-family: var(--font-mono);
+ color: var(--hud-color);
+ text-shadow: 0 0 4px var(--hud-glow);
+ text-transform: uppercase;
+ line-height: 1.6;
+}
+
+.hud-top-bar,
+.hud-bottom-bar {
+ display: none;
+ position: absolute;
+ left: 50%;
+ transform: translateX(-50%);
+ width: min(980px, calc(100vw - 120px));
+ border: 1px solid var(--hud-border);
+ background: rgba(0, 0, 0, 0.34);
+ padding: 4px 10px;
+ font-size: 10px;
+ letter-spacing: 1.4px;
+ justify-content: space-between;
+ align-items: center;
+ pointer-events: none;
+}
+
+.hud-top-bar {
+ top: 70px;
+}
+
+.hud-bottom-bar {
+ bottom: 110px;
+ justify-content: center;
+}
+
+.hud-top-bar-center {
+ opacity: 0.84;
+}
+
+.hud-top-bar-left,
+.hud-top-bar-right {
+ opacity: 0.6;
+}
+
+/* Corner blocks */
+.hud-corner {
+ position: absolute;
+ display: flex;
+ align-items: flex-start;
+ gap: 6px;
+ padding: 4px;
+}
+
+.hud-top-left {
+ top: 120px;
+ left: 36px;
+}
+
+.hud-top-right {
+ top: 120px;
+ right: 36px;
+}
+
+.hud-bottom-left {
+ bottom: 180px;
+ left: 36px;
+}
+
+.hud-bottom-right {
+ bottom: 180px;
+ right: 36px;
+}
+
+.hud-bracket {
+ font-size: 22px;
+ line-height: 1;
+ opacity: 0.6;
+}
+
+.hud-content {
+ font-size: 13px;
+ letter-spacing: 2px;
+}
+
+.hud-ais-vessel {
+ margin-top: 6px;
+ max-width: 340px;
+ white-space: pre-line;
+ line-height: 1.35;
+ opacity: 0.64;
+}
+
+.hud-ais-vessel.active {
+ opacity: 0.95;
+}
+
+.hud-classification {
+ font-size: 12px;
+ letter-spacing: 2.5px;
+ font-weight: 600;
+ margin-bottom: 3px;
+}
+
+.hud-system {
+ font-size: 13px;
+ opacity: 0.8;
+}
+
+.hud-mode {
+ font-size: 16px;
+ font-weight: 700;
+ letter-spacing: 4px;
+ margin-top: 3px;
+}
+
+.hud-summary-wrap {
+ margin-top: 6px;
+ max-width: 420px;
+}
+
+.hud-summary-label {
+ font-size: 9px;
+ letter-spacing: 1.8px;
+ opacity: 0.55;
+}
+
+.hud-summary {
+ margin-top: 2px;
+ min-height: 16px;
+ font-size: 11px;
+ letter-spacing: 1.2px;
+ opacity: 0.88;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.hud-rec {
+ font-size: 13px;
+ letter-spacing: 2px;
+}
+
+#hud-rec-dot {
+ color: #ff3333;
+ text-shadow: 0 0 6px rgba(255, 51, 51, 0.8);
+ font-size: 14px;
+ vertical-align: middle;
+}
+
+.hud-orbital {
+ font-size: 12px;
+ opacity: 0.7;
+ letter-spacing: 1.5px;
+}
+
+/* Edge annotations (vertical text) */
+.hud-edge {
+ position: absolute;
+ font-size: 10px;
+ letter-spacing: 1.5px;
+ opacity: 0.5;
+}
+
+.hud-left-edge {
+ left: 36px;
+ top: 50%;
+ transform: translateY(-50%) rotate(-90deg);
+ transform-origin: left center;
+ white-space: nowrap;
+ display: flex;
+ gap: 20px;
+}
+
+.hud-right-edge {
+ right: 36px;
+ top: 50%;
+ transform: translateY(-50%) rotate(90deg);
+ transform-origin: right center;
+ white-space: nowrap;
+ display: flex;
+ gap: 20px;
+}
+
+#intel-hud[data-variant='tactical'] .hud-top-bar,
+#intel-hud[data-variant='tactical'] .hud-bottom-bar {
+ display: none;
+}
+
+#intel-hud[data-variant='operator'] .hud-top-bar,
+#intel-hud[data-variant='operator'] .hud-bottom-bar {
+ display: flex;
+}
+
+#intel-hud[data-variant='operator'] .hud-top-bar {
+ top: max(10vh, 90px);
+ left: 50%;
+ right: auto;
+ width: min(52vw, 720px);
+ transform: translateX(-50%);
+ border-color: rgba(255, 255, 255, 0.24);
+ background: linear-gradient(90deg, rgba(0, 0, 0, 0.56), rgba(8, 26, 34, 0.5));
+ box-shadow: 0 0 24px rgba(0, 255, 255, 0.08);
+}
+
+#intel-hud[data-variant='tactical'] .hud-top-left,
+#intel-hud[data-variant='tactical'] .hud-top-right,
+#intel-hud[data-variant='operator'] .hud-top-left,
+#intel-hud[data-variant='operator'] .hud-top-right {
+ top: max(14vh, 136px);
+}
+
+#intel-hud[data-variant='operator'] .hud-bottom-bar {
+ border-color: rgba(255, 255, 255, 0.2);
+ background: linear-gradient(90deg, rgba(0, 0, 0, 0.52), rgba(8, 22, 18, 0.52));
+}
+
+#intel-hud[data-variant='operator'] .hud-corner {
+ padding: 8px 10px;
+ border: 1px solid rgba(255, 255, 255, 0.16);
+ border-radius: 8px;
+ background: rgba(0, 0, 0, 0.36);
+}
+
+#intel-hud[data-variant='operator'] .hud-bracket {
+ display: none;
+}
+
+#intel-hud[data-variant='minimal'] .hud-top-right,
+#intel-hud[data-variant='minimal'] .hud-bottom-right,
+#intel-hud[data-variant='minimal'] .hud-left-edge,
+#intel-hud[data-variant='minimal'] .hud-right-edge,
+#intel-hud[data-variant='minimal'] .hud-classification,
+#intel-hud[data-variant='minimal'] .hud-system {
+ display: none;
+}
+
+#intel-hud[data-variant='minimal'] .hud-top-left {
+ top: 88px;
+}
+
+#intel-hud[data-variant='minimal'] .hud-bottom-left {
+ bottom: 12vh;
+}
+
+#intel-hud[data-variant='minimal'] .hud-bottom-bar {
+ display: flex;
+ bottom: calc(12vh + 4rem);
+}
+
+#intel-hud[data-variant='minimal'] .hud-summary-wrap {
+ max-width: 280px;
+}
+
diff --git a/src/ui/styles/provider-settings.css b/src/ui/styles/provider-settings.css
new file mode 100644
index 000000000..432512bd0
--- /dev/null
+++ b/src/ui/styles/provider-settings.css
@@ -0,0 +1,355 @@
+/* ============================================================
+ POWER UP — in-app key setup (dev server only, src/keySetup.js)
+ Same voice as the first-run launcher: glass card, cyan trim,
+ mono kickers. The chip retires once every key is configured.
+ ============================================================ */
+
+#key-setup-chip {
+ position: fixed;
+ right: 0.9rem;
+ bottom: 0.9rem;
+ z-index: 60;
+ display: flex;
+ align-items: center;
+ gap: 0.4rem;
+ padding: 0.45rem 0.7rem;
+ color: rgba(225, 244, 248, 0.92);
+ font-family: var(--font-mono);
+ font-size: 0.6rem;
+ letter-spacing: 0.09rem;
+ background: linear-gradient(145deg, rgba(10, 27, 37, 0.92), rgba(7, 13, 22, 0.9));
+ border: 1px solid rgba(54, 220, 255, 0.38);
+ border-radius: 0.42rem;
+ box-shadow:
+ 0 0.4rem 1.6rem rgba(0, 0, 0, 0.5),
+ 0 0 1.2rem rgba(0, 212, 255, 0.07);
+ backdrop-filter: blur(18px) saturate(1.2);
+ -webkit-backdrop-filter: blur(18px) saturate(1.2);
+ cursor: pointer;
+ transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
+}
+
+#key-setup-chip:hover,
+#key-setup-chip:focus-visible {
+ background: linear-gradient(145deg, rgba(14, 38, 51, 0.95), rgba(9, 18, 28, 0.93));
+ border-color: rgba(54, 220, 255, 0.7);
+ outline: none;
+ transform: translateY(-1px);
+}
+
+#key-setup-chip .material-symbols-outlined {
+ color: #55dff5;
+ font-size: 0.95rem;
+}
+
+#key-setup-chip[hidden] { display: none; }
+
+#key-setup {
+ position: fixed;
+ z-index: 190; /* above the first-run launcher (175), below attribution (200) */
+ top: 50%;
+ left: 50%;
+ width: min(36rem, calc(100vw - 2rem));
+ max-height: calc(100vh - 1.5rem);
+ max-height: calc(100dvh - 1.5rem);
+ display: flex;
+ flex-direction: column;
+ padding: 1.15rem;
+ overflow: hidden;
+ color: var(--text-primary);
+ background:
+ linear-gradient(145deg, rgba(10, 27, 37, 0.97), rgba(7, 13, 22, 0.95)),
+ rgba(7, 17, 25, 0.96);
+ border: 1px solid rgba(54, 220, 255, 0.42);
+ border-radius: 0.65rem;
+ box-shadow:
+ 0 1.4rem 4.5rem rgba(0, 0, 0, 0.72),
+ 0 0 2.5rem rgba(0, 212, 255, 0.09),
+ inset 0 0 0 1px rgba(255, 255, 255, 0.025);
+ backdrop-filter: blur(28px) saturate(1.25);
+ -webkit-backdrop-filter: blur(28px) saturate(1.25);
+ opacity: 0;
+ transform: translate(-50%, calc(-50% + 0.8rem)) scale(0.985);
+ transition: opacity 220ms ease, transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
+ pointer-events: none;
+}
+
+/* Same cascade note as the launcher: an author display beats [hidden]. */
+#key-setup[hidden] { display: none; }
+
+#key-setup.visible {
+ opacity: 1;
+ transform: translate(-50%, -50%) scale(1);
+ pointer-events: auto;
+}
+
+.key-setup-scanline {
+ position: absolute;
+ inset: 0 0 auto;
+ height: 2px;
+ background: linear-gradient(90deg, transparent, rgba(54, 220, 255, 0.8), transparent);
+ box-shadow: 0 0 1rem rgba(54, 220, 255, 0.45);
+ pointer-events: none;
+}
+
+.key-setup-header,
+.key-setup-footer {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 1rem;
+ color: rgba(171, 210, 220, 0.6);
+ font-family: var(--font-mono);
+ font-size: 0.58rem;
+ letter-spacing: 0.1rem;
+ text-transform: uppercase;
+}
+
+.key-setup-kicker { color: rgba(54, 220, 255, 0.86); }
+
+.key-setup-close {
+ display: grid;
+ place-items: center;
+ padding: 0.15rem;
+ color: rgba(171, 210, 220, 0.6);
+ background: none;
+ border: 1px solid transparent;
+ border-radius: 0.3rem;
+ cursor: pointer;
+ transition: color var(--transition-fast), border-color var(--transition-fast);
+}
+
+.key-setup-close:hover,
+.key-setup-close:focus-visible {
+ color: rgba(225, 244, 248, 0.95);
+ border-color: rgba(54, 220, 255, 0.5);
+ outline: none;
+}
+
+.key-setup-close .material-symbols-outlined { font-size: 1rem; }
+
+#key-setup h2 {
+ margin-top: 0.6rem;
+ font-family: var(--font-mono);
+ font-size: clamp(1.25rem, 2.4vw, 1.75rem);
+ font-weight: 500;
+ letter-spacing: -0.045rem;
+}
+
+#key-setup-description {
+ max-width: 31rem;
+ margin-top: 0.3rem;
+ color: rgba(215, 231, 235, 0.66);
+ font-size: 0.78rem;
+ line-height: 1.5;
+}
+
+#key-setup-description code {
+ padding: 0.05rem 0.25rem;
+ font-size: 0.92em;
+ background: rgba(54, 220, 255, 0.08);
+ border-radius: 0.2rem;
+}
+
+.key-setup-rows {
+ display: grid;
+ gap: 0.42rem;
+ margin-top: 1rem;
+ min-height: 0;
+ overflow-y: auto;
+ overscroll-behavior: contain;
+ scrollbar-width: thin;
+ scrollbar-color: rgba(54, 220, 255, 0.45) transparent;
+ scrollbar-gutter: stable;
+}
+
+.key-setup-rows::-webkit-scrollbar { width: 6px; }
+.key-setup-rows::-webkit-scrollbar-thumb {
+ background: rgba(54, 220, 255, 0.45);
+ border-radius: 3px;
+}
+
+.key-setup-row {
+ display: grid;
+ gap: 0.35rem;
+ padding: 0.6rem 0.7rem;
+ background: rgba(29, 69, 81, 0.14);
+ border: 1px solid rgba(100, 200, 220, 0.15);
+ border-radius: 0.42rem;
+}
+
+.key-setup-row[data-set='true'] {
+ background: rgba(30, 81, 57, 0.12);
+ border-color: rgba(84, 227, 156, 0.32);
+}
+
+.key-setup-row-head {
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+ font-family: var(--font-mono);
+}
+
+.key-setup-row-head strong {
+ font-size: 0.7rem;
+ font-weight: 600;
+ letter-spacing: 0.08rem;
+}
+
+.key-setup-led {
+ width: 0.5rem;
+ height: 0.5rem;
+ flex: none;
+ background: rgba(148, 178, 188, 0.35);
+ border-radius: 50%;
+}
+
+.key-setup-row[data-set='true'] .key-setup-led {
+ background: #54e39c;
+ box-shadow: 0 0 0.5rem rgba(84, 227, 156, 0.66);
+}
+
+.key-setup-tier { font-size: 0.55rem; }
+
+.key-setup-exposed {
+ padding: 0.05rem 0.3rem;
+ color: rgba(255, 200, 120, 0.75);
+ font-size: 0.5rem;
+ letter-spacing: 0.06rem;
+ text-transform: uppercase;
+ border: 1px solid rgba(255, 200, 120, 0.3);
+ border-radius: 0.3rem;
+}
+
+.key-setup-get {
+ margin-left: auto;
+ color: rgba(54, 220, 255, 0.75);
+ font-size: 0.58rem;
+ letter-spacing: 0.08rem;
+ text-decoration: none;
+ white-space: nowrap;
+}
+
+.key-setup-get:hover,
+.key-setup-get:focus-visible {
+ color: rgba(54, 220, 255, 1);
+ text-decoration: underline;
+ outline: none;
+}
+
+.key-setup-unlocks {
+ margin: 0;
+ color: rgba(198, 220, 226, 0.6);
+ font-size: 0.66rem;
+}
+
+.key-setup-fields {
+ display: grid;
+ gap: 0.3rem;
+}
+
+.key-setup-fields input {
+ width: 100%;
+ padding: 0.42rem 0.55rem;
+ color: rgba(225, 244, 248, 0.92);
+ font-family: var(--font-mono);
+ font-size: 0.66rem;
+ background: rgba(4, 14, 20, 0.72);
+ border: 1px solid rgba(100, 200, 220, 0.22);
+ border-radius: 0.32rem;
+}
+
+.key-setup-fields input:focus {
+ border-color: rgba(54, 220, 255, 0.65);
+ outline: none;
+}
+
+.key-setup-fields input::placeholder { color: rgba(148, 178, 188, 0.42); }
+
+.key-setup-footer { margin-top: 0.85rem; }
+
+.key-setup-apply {
+ padding: 0.5rem 0.95rem;
+ color: #04141c;
+ font-family: var(--font-mono);
+ font-size: 0.66rem;
+ font-weight: 700;
+ letter-spacing: 0.09rem;
+ background: linear-gradient(180deg, #45e0ff, #1fb9dd);
+ border: none;
+ border-radius: 0.38rem;
+ cursor: pointer;
+ transition: filter var(--transition-fast);
+}
+
+.key-setup-apply:hover,
+.key-setup-apply:focus-visible {
+ filter: brightness(1.08);
+ outline: none;
+}
+
+.key-setup-apply[aria-disabled='true'] {
+ cursor: wait;
+ opacity: 0.5;
+ pointer-events: none;
+}
+
+.key-setup-note {
+ min-height: 1.1rem;
+ margin-top: 0.5rem;
+ color: rgba(199, 225, 231, 0.62);
+ font-family: var(--font-mono);
+ font-size: 0.62rem;
+ line-height: 1.35;
+}
+
+/* The same exclusive surfaces that hide the launcher hide this surface —
+ nothing about key setup belongs in a recording, a cockpit, or a scene. */
+body.ui-clean-view #key-setup-chip,
+body.recording-mode #key-setup-chip,
+body.cockpit-mode #key-setup-chip,
+body.scene-playback-mode #key-setup-chip,
+body.ui-clean-view #key-setup,
+body.recording-mode #key-setup,
+body.cockpit-mode #key-setup,
+body.scene-playback-mode #key-setup {
+ display: none;
+}
+
+@media (max-width: 620px) {
+ /* Clear the dock. Desktop-first app; this is a courtesy, not a layout. */
+ #key-setup-chip { bottom: 5.8rem; }
+}
+
+/* Provider Settings additions: externally-managed badge + per-row remove. */
+.key-setup-external {
+ padding: 0.05rem 0.3rem;
+ color: rgba(148, 200, 220, 0.7);
+ font-size: 0.5rem;
+ letter-spacing: 0.06rem;
+ text-transform: uppercase;
+ border: 1px solid rgba(148, 200, 220, 0.28);
+ border-radius: 0.3rem;
+ white-space: nowrap;
+}
+
+.key-setup-remove {
+ justify-self: start;
+ padding: 0.28rem 0.55rem;
+ color: rgba(255, 170, 150, 0.8);
+ font-family: var(--font-mono);
+ font-size: 0.55rem;
+ letter-spacing: 0.08rem;
+ background: none;
+ border: 1px solid rgba(255, 170, 150, 0.3);
+ border-radius: 0.32rem;
+ cursor: pointer;
+ transition: color var(--transition-fast), border-color var(--transition-fast);
+}
+
+.key-setup-remove:hover,
+.key-setup-remove:focus-visible {
+ color: rgba(255, 190, 170, 1);
+ border-color: rgba(255, 170, 150, 0.65);
+ outline: none;
+}
diff --git a/src/ui/styles/radio.css b/src/ui/styles/radio.css
new file mode 100644
index 000000000..c2d16f1b1
--- /dev/null
+++ b/src/ui/styles/radio.css
@@ -0,0 +1,576 @@
+/* ── Radio companion section inside Context ── */
+#radio-panel {
+ position: relative;
+ width: 100%;
+ min-height: 0;
+ margin-top: 10px;
+ padding-top: 10px;
+ border-top: 1px solid rgba(65, 220, 231, .16);
+}
+.radio-panel-inner {
+ position: relative;
+ display: flex;
+ min-height: 0;
+ flex-direction: column;
+ gap: 9px;
+ padding: 10px;
+ border: 1px solid rgba(65, 220, 231, .18);
+ border-radius: 8px;
+ background: rgba(2, 15, 20, .42);
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
+ scrollbar-width: thin;
+ scrollbar-color: rgba(0, 212, 255, .46) rgba(255, 255, 255, .06);
+}
+#radio-panel .panel-header { margin-bottom: 0; }
+.radio-layer-state {
+ color: var(--text-dim);
+ font: 8px/1 var(--font-mono);
+ letter-spacing: .12em;
+}
+.radio-layer-state.active { color: #65f7ff; }
+.radio-directory-row {
+ display: grid;
+ grid-template-columns: auto minmax(0, 1fr);
+ gap: 6px 8px;
+ align-items: end;
+}
+.radio-filter-label {
+ grid-column: 2;
+ color: var(--text-dim);
+ font: 7px/1 var(--font-mono);
+ letter-spacing: .12em;
+}
+#radio-enable-btn { grid-row: 1 / span 2; min-height: 36px; }
+#radio-filter {
+ min-width: 0;
+ padding: 7px 24px 7px 8px;
+ border: 1px solid rgba(65, 220, 231, .28);
+ border-radius: 5px;
+ color: #c5faff;
+ background: rgba(5, 24, 31, .88);
+ font: 9px/1.2 var(--font-mono);
+}
+.radio-station-card {
+ display: grid;
+ gap: 4px;
+ padding: 10px;
+ border: 1px solid rgba(65, 220, 231, .18);
+ border-radius: 7px;
+ background: rgba(2, 15, 20, .48);
+ overflow-wrap: anywhere;
+}
+.radio-station-card strong {
+ color: #e8feff;
+ font: 11px/1.25 var(--font-mono);
+ letter-spacing: .05em;
+}
+.radio-station-card span {
+ color: var(--text-dim);
+ font: 8px/1.35 var(--font-mono);
+}
+#radio-station-tags { color: #72dce6; }
+.radio-tuner {
+ display: grid;
+ width: 100%;
+ min-width: 0;
+ max-width: 100%;
+ gap: 5px;
+ padding: 8px;
+ overflow: hidden;
+ border: 1px solid rgba(65, 220, 231, .22);
+ border-radius: 7px;
+ background: linear-gradient(180deg, rgba(1, 9, 13, .92), rgba(4, 24, 30, .72));
+ box-shadow: inset 0 0 18px rgba(0, 212, 255, .045);
+}
+.radio-tuner[hidden] { display: none; }
+.radio-tuner-header,
+.radio-tuner-readout {
+ display: flex;
+ justify-content: space-between;
+ gap: 8px;
+ color: #6daeb5;
+ font: 7px/1.2 var(--font-mono);
+ letter-spacing: .1em;
+}
+#radio-tuner-value {
+ min-width: 0;
+ color: #a8f7ff;
+ overflow: hidden;
+ text-align: right;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.radio-tuner-dial {
+ position: relative;
+ width: 100%;
+ min-width: 0;
+ max-width: 100%;
+ height: 51px;
+ overflow: hidden;
+ contain: paint;
+ border-block: 1px solid rgba(72, 225, 237, .3);
+ background:
+ linear-gradient(180deg, transparent 23px, rgba(65, 220, 231, .8) 24px, transparent 25px, transparent 28px, rgba(65, 220, 231, .6) 29px, transparent 30px),
+ radial-gradient(ellipse at center, rgba(39, 177, 191, .12), transparent 70%);
+}
+.radio-tuner-scale {
+ position: absolute;
+ inset: 0;
+ overflow: hidden;
+ color: #58cbd6;
+ font: 9px/1 var(--font-mono);
+ text-shadow: 0 0 7px rgba(65, 220, 231, .5);
+ pointer-events: none;
+}
+.radio-tuner-tick {
+ position: absolute;
+ top: 6px;
+ bottom: 0;
+ min-width: 1px;
+ border-left: 1px solid rgba(85, 224, 235, .38);
+ color: #58cbd6;
+ padding-left: 3px;
+ white-space: nowrap;
+ transform: translateX(-50%);
+ transition: left 80ms linear;
+}
+.radio-tuner-tick.is-current {
+ border-left-color: rgba(168, 247, 255, .9);
+ color: #a8f7ff;
+}
+.radio-tuner-needle {
+ position: absolute;
+ z-index: 1;
+ top: 2px;
+ bottom: 2px;
+ left: calc(7px + (100% - 14px) * var(--radio-tuner-ratio, 0));
+ width: 3px;
+ border-radius: 1px;
+ background: #ff6f4f;
+ box-shadow: 0 0 4px #ff6f4f, 0 0 10px rgba(255, 77, 50, .65);
+ pointer-events: none;
+ transform: translateX(-50%);
+ transition: left .18s ease-out;
+}
+.radio-tuner.is-dragging .radio-tuner-needle,
+.radio-tuner.is-dragging .radio-tuner-tick { transition: none; }
+#radio-tuner-slider {
+ position: absolute;
+ z-index: 2;
+ inset: 0;
+ width: 100%;
+ min-width: 0;
+ max-width: 100%;
+ height: 100%;
+ margin: 0;
+ appearance: none;
+ -webkit-appearance: none;
+ cursor: ew-resize;
+ touch-action: none;
+ background: transparent;
+}
+#radio-tuner-slider::-webkit-slider-runnable-track {
+ height: 100%;
+ background: transparent;
+}
+#radio-tuner-slider::-webkit-slider-thumb {
+ width: 14px;
+ height: 47px;
+ margin-top: 2px;
+ border: 0;
+ border-radius: 1px;
+ appearance: none;
+ -webkit-appearance: none;
+ background: transparent;
+ box-shadow: none;
+}
+#radio-tuner-slider::-moz-range-track { height: 100%; background: transparent; }
+#radio-tuner-slider::-moz-range-thumb {
+ width: 14px;
+ height: 47px;
+ border: 0;
+ border-radius: 1px;
+ background: transparent;
+ box-shadow: none;
+}
+.radio-tuner.is-static .radio-tuner-dial {
+ box-shadow: inset 0 0 14px rgba(255, 111, 79, .1);
+}
+.radio-tuner.is-static #radio-tuner-station { color: #ff9b7e; }
+.radio-tuner-readout span:first-child {
+ min-width: 0;
+ color: #7fe6ef;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.radio-tuner-readout span:last-child {
+ flex: 0 0 auto;
+ color: #517f84;
+}
+.radio-transport {
+ display: grid;
+ grid-template-columns: repeat(4, minmax(0, 1fr));
+ gap: 5px;
+}
+.radio-transport button {
+ min-height: 30px;
+ padding: 6px 3px;
+ border: 1px solid rgba(65, 220, 231, .28);
+ border-radius: 5px;
+ color: #8feaf2;
+ background: rgba(14, 69, 78, .14);
+ font: 8px/1 var(--font-mono);
+ letter-spacing: .06em;
+ cursor: pointer;
+}
+.radio-transport button:hover:not(:disabled),
+.radio-transport button:focus-visible:not(:disabled) {
+ border-color: #65f7ff;
+ color: #fff;
+ outline: none;
+}
+.radio-transport button:disabled,
+#radio-filter:disabled { opacity: .42; cursor: not-allowed; }
+#radio-play-btn.active {
+ color: #fff;
+ border-color: rgba(101, 247, 255, .8);
+ background: rgba(65, 220, 231, .18);
+ box-shadow: 0 0 12px rgba(65, 220, 231, .12);
+}
+.radio-volume-row {
+ display: grid;
+ grid-template-columns: auto minmax(0, 1fr) 32px;
+ gap: 8px;
+ align-items: center;
+ color: var(--text-dim);
+ font: 7px/1 var(--font-mono);
+ letter-spacing: .1em;
+}
+.radio-volume-row input { width: 100%; }
+.radio-playback-state {
+ min-height: 12px;
+ color: #79d7df;
+ font: 8px/1.35 var(--font-mono);
+}
+.radio-playback-state.error { color: #ff9d8f; }
+.radio-links {
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-between;
+ gap: 5px 10px;
+}
+.radio-links a {
+ color: #64cbd5;
+ font: 7px/1.3 var(--font-mono);
+ letter-spacing: .06em;
+ text-decoration: none;
+}
+.radio-links a:hover, .radio-links a:focus-visible { color: #fff; }
+.radio-privacy {
+ margin: 0;
+ color: rgba(190, 230, 230, .48);
+ font: 7px/1.4 var(--font-mono);
+}
+#military-awareness-panel {
+ width: 100%;
+ min-height: 0;
+ overflow: auto;
+ box-sizing: border-box;
+ padding: 2px 1px 0;
+ color: #dceeff;
+ background: transparent;
+ border: 0;
+ font: 11px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
+}
+
+#military-awareness-panel[hidden] { display: none; }
+.military-awareness-subject { margin: 0 0 7px; color: #fff; }
+.military-awareness-controls { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px; margin: 0 0 8px; }
+.military-awareness-controls button { border: 1px solid rgba(98,181,255,0.34); border-radius: 4px; padding: 4px 3px; color: #a9d9ff; background: rgba(42,113,171,0.12); font: 9px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.07em; cursor: pointer; }
+.military-awareness-controls button:hover, .military-awareness-controls button:focus-visible { color: #fff; border-color: rgba(127,200,255,0.85); background: rgba(66,148,211,0.24); outline: none; }
+.military-awareness-controls button:disabled { color: #627181; border-color: rgba(98,181,255,0.12); background: transparent; cursor: default; }
+.military-awareness-row { border-top: 1px solid rgba(255,255,255,0.1); padding: 7px 0; }
+.military-awareness-row > div { display: flex; justify-content: space-between; }
+.military-awareness-row b { color: #7fc8ff; }
+.military-awareness-row.unknown b { color: #8fcfff; }
+.military-awareness-row small, .military-awareness-note { color: #a9b7c7; }
+.military-awareness-row ul { margin: 4px 0 0; padding: 0; list-style: none; }
+.military-awareness-row li { display: block; }
+.military-awareness-target { display: flex; justify-content: space-between; gap: 10px; width: 100%; border: 0; padding: 1px 0; color: #dceeff; background: transparent; font: inherit; text-align: left; cursor: pointer; }
+.military-awareness-target.unavailable { color: var(--text-dim); cursor: default; }
+.military-awareness-target:hover, .military-awareness-target:focus-visible { color: #fff; outline: none; text-shadow: 0 0 8px rgba(114, 202, 255, 0.85); }
+.military-awareness-target:focus-visible { box-shadow: inset 0 -1px 0 #7fc8ff; }
+.military-awareness-target span { color: #7fc8ff; white-space: nowrap; }
+.military-awareness-note { margin: 8px 0 0; font-size: 10px; }
+.military-awareness-standby {
+ display: grid;
+ gap: 7px;
+ padding: 12px 4px 4px;
+ border-top: 1px solid rgba(98, 181, 255, 0.16);
+}
+.military-awareness-standby strong { color: #79c2ff; font-size: 10px; letter-spacing: 0.1em; }
+.military-awareness-standby span { color: #8192a6; font-size: 9px; letter-spacing: 0.05em; }
+.military-awareness-standby button {
+ justify-self: start;
+ padding: 4px 12px;
+ border: 1px solid rgba(98, 181, 255, 0.34);
+ border-radius: 4px;
+ color: #a9d9ff;
+ background: rgba(42, 113, 171, 0.12);
+ font: 9px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
+ letter-spacing: 0.08em;
+ cursor: pointer;
+}
+
+#military-awareness-direction-overlay { position: absolute; inset: 0; z-index: 4; overflow: hidden; pointer-events: none; }
+#military-awareness-direction-overlay[hidden] { display: none; }
+.military-awareness-compass-ring {
+ --compass-rotation: 0deg;
+ position: absolute;
+ box-sizing: border-box;
+ border: 1px solid rgba(111,196,255,0.2);
+ outline: 1px dashed rgba(111,196,255,0.28);
+ outline-offset: -5px;
+ border-radius: 50%;
+ box-shadow:
+ inset 0 0 0 5px rgba(34,128,196,0.018),
+ inset 0 0 24px rgba(34,128,196,0.035),
+ 0 0 14px rgba(34,128,196,0.05);
+}
+.military-awareness-compass-ring::before { content: ''; position: absolute; left: 50%; top: -7px; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 8px solid rgba(127,200,255,0.88); transform: translateX(-50%); filter: drop-shadow(0 0 5px rgba(87,184,255,0.7)); }
+.military-awareness-compass-ring::after {
+ content: '';
+ position: absolute;
+ inset: -5px;
+ border-radius: 50%;
+ background: repeating-conic-gradient(
+ from 0deg,
+ rgba(125, 205, 255, 0.38) 0deg 0.7deg,
+ transparent 0.7deg 15deg
+ );
+ -webkit-mask: radial-gradient(circle, transparent calc(100% - 8px), #000 calc(100% - 8px) calc(100% - 4px), transparent calc(100% - 4px));
+ mask: radial-gradient(circle, transparent calc(100% - 8px), #000 calc(100% - 8px) calc(100% - 4px), transparent calc(100% - 4px));
+ transform: rotate(var(--compass-rotation));
+ transition: transform 80ms linear;
+}
+.military-awareness-compass-label, .military-awareness-compass-heading { position: absolute; transform: translate(-50%, -50%); color: rgba(156,213,255,0.7); font: 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.08em; text-shadow: 0 0 7px rgba(53,161,235,0.55); }
+.military-awareness-compass-label.cardinal-n { color: rgba(255,188,87,0.92); }
+.military-awareness-compass-heading { color: rgba(190,225,249,0.76); font-size: 8px; }
+.military-awareness-direction-marker { position: absolute; width: 1px; height: 1px; transform: translate(-50%, -50%); transition: opacity 100ms linear; }
+.military-awareness-direction-marker[hidden] { display: none; }
+.military-awareness-direction-arrow { position: absolute; left: 50%; top: 50%; color: #74dbff; font: 23px/1 sans-serif; transform-origin: 50% 50%; text-shadow: 0 0 5px rgba(87,223,255,0.9), 0 0 13px rgba(87,223,255,0.35); }
+.military-awareness-direction-label { position: absolute; left: 50%; top: 50%; padding: 3px 6px; border: 1px solid rgba(116,219,255,0.24); border-radius: 3px; color: #bceeff; background: rgba(5,12,20,0.68); font: 8px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: center; white-space: pre; text-shadow: 0 0 5px rgba(116,219,255,0.38); }
+
+.data-toggle-row.gev-voice-focus {
+ background: rgba(92, 255, 198, 0.1);
+ box-shadow: inset 0 0 0 1px rgba(92, 255, 198, 0.72), 0 0 18px rgba(92, 255, 198, 0.18);
+}
+
+.data-toggle-top {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 8px;
+}
+
+.data-toggle-left {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+}
+
+.data-icon {
+ font-size: 16px;
+ line-height: 1;
+}
+
+.data-name {
+ font-family: var(--font-sans);
+ font-size: 13px;
+ font-weight: 500;
+ color: var(--text-primary);
+ letter-spacing: 0.3px;
+}
+
+.data-toggle-right {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+}
+
+.data-count {
+ font-family: var(--font-mono);
+ font-size: 11px;
+ letter-spacing: 0.5px;
+ color: var(--text-secondary);
+ min-width: 30px;
+ text-align: right;
+}
+
+.data-toggle-btn {
+ padding: 3px 10px;
+ font-family: var(--font-mono);
+ font-size: 9px;
+ letter-spacing: 1.5px;
+ color: var(--text-dim);
+ background: rgba(255, 255, 255, 0.04);
+ border: 1px solid rgba(255, 255, 255, 0.08);
+ border-radius: 4px;
+ cursor: pointer;
+ transition:
+ background-color var(--transition-fast),
+ border-color var(--transition-fast),
+ box-shadow var(--transition-fast),
+ color var(--transition-fast),
+ min-width var(--transition-fast),
+ letter-spacing var(--transition-fast);
+ outline: none;
+ min-width: 38px;
+ text-align: center;
+}
+
+/* An inset ring stays visible inside the scrolling layer list. */
+.data-toggle-btn:focus-visible {
+ outline: 2px solid var(--text-primary);
+ outline-offset: -3px;
+}
+
+.data-toggle-btn.feed-loading,
+.data-toggle-btn.feed-degraded,
+.data-toggle-btn.feed-stale,
+.data-toggle-btn.feed-fallback,
+.data-toggle-btn.feed-unavailable {
+ min-width: 82px;
+ letter-spacing: 0.8px;
+}
+
+.data-toggle-btn:hover {
+ border-color: var(--glass-border-hover);
+ background: rgba(255, 255, 255, 0.06);
+}
+
+.data-toggle-btn.active {
+ color: var(--accent);
+ border-color: var(--accent);
+ background: var(--accent-dim);
+ box-shadow: 0 0 10px rgba(0, 212, 255, 0.15);
+}
+
+.data-toggle-btn.active.feed-stale,
+.data-toggle-btn.active.feed-fallback {
+ color: #ffd27a;
+ border-color: rgba(255, 190, 82, 0.75);
+ background: rgba(255, 174, 51, 0.1);
+ box-shadow: 0 0 10px rgba(255, 174, 51, 0.12);
+}
+
+.data-toggle-btn.active.feed-degraded {
+ color: #ffad72;
+ border-color: rgba(255, 137, 72, 0.78);
+ background: rgba(255, 112, 48, 0.1);
+ box-shadow: 0 0 10px rgba(255, 112, 48, 0.12);
+}
+
+.data-toggle-btn.active.feed-unavailable {
+ color: #ff8585;
+ border-color: rgba(255, 92, 92, 0.78);
+ background: rgba(255, 60, 60, 0.1);
+ box-shadow: 0 0 10px rgba(255, 60, 60, 0.12);
+}
+
+.data-toggle-meta {
+ font-family: var(--font-mono);
+ font-size: 9px;
+ letter-spacing: 0.5px;
+ color: var(--text-dim);
+ padding-left: 26px;
+ margin-top: 2px;
+}
+
+/* Optional per-layer sub-controls: mode chips plus a color legend. Aligned
+ under the layer name like .data-toggle-meta, and wrapping so a legend can
+ grow without widening the rail. */
+.data-toggle-controls {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ gap: 4px 8px;
+ padding-left: 26px;
+ margin-top: 5px;
+}
+
+.data-toggle-controls[hidden] {
+ display: none;
+}
+
+.data-toggle-chip {
+ padding: 2px 7px;
+ font-family: var(--font-mono);
+ font-size: 8px;
+ letter-spacing: 1.2px;
+ color: var(--text-dim);
+ background: rgba(255, 255, 255, 0.04);
+ border: 1px solid rgba(255, 255, 255, 0.08);
+ border-radius: 3px;
+ cursor: pointer;
+ transition:
+ background-color var(--transition-fast),
+ border-color var(--transition-fast),
+ color var(--transition-fast),
+ opacity var(--transition-fast);
+ outline: none;
+}
+
+.data-toggle-chip:hover,
+.data-toggle-chip:focus-visible {
+ border-color: var(--glass-border-hover);
+ background: rgba(255, 255, 255, 0.06);
+ color: var(--text-secondary);
+}
+
+.data-toggle-chip.active {
+ color: var(--accent);
+ border-color: var(--accent);
+ background: var(--accent-dim);
+}
+
+/* Async sub-controls: a chip must never read ACTIVE before the data it turns
+ on actually exists, so loading and failure are their own visible states. */
+.data-toggle-chip:disabled {
+ cursor: wait;
+ opacity: 0.7;
+}
+
+.data-toggle-chip.chip-loading {
+ color: var(--text-secondary);
+ border-color: rgba(255, 255, 255, 0.18);
+}
+
+.data-toggle-chip.chip-error {
+ color: #ff8585;
+ border-color: rgba(255, 92, 92, 0.6);
+ background: rgba(255, 60, 60, 0.08);
+}
+
+.data-toggle-legend-item {
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+ font-family: var(--font-mono);
+ font-size: 8px;
+ letter-spacing: 0.5px;
+ color: var(--text-dim);
+ cursor: default;
+}
+
+.data-toggle-legend-swatch {
+ width: 6px;
+ height: 6px;
+ border-radius: 50%;
+ /* The swatch IS the datum — keep it exactly the point color, with only a
+ hairline ring so a near-black class still reads on the panel glass. */
+ box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
+ flex: none;
+}
+
diff --git a/src/ui/styles/recording.css b/src/ui/styles/recording.css
new file mode 100644
index 000000000..ebfed290b
--- /dev/null
+++ b/src/ui/styles/recording.css
@@ -0,0 +1,33 @@
+/* ── Recording Mode ─────────────────────────── */
+body.recording-mode #title-bar,
+body.recording-mode #style-indicator,
+body.recording-mode #top-center-actions,
+body.recording-mode #global-loading-status,
+body.recording-mode #traffic-sync-chip,
+body.recording-mode #cctv-sync-chip,
+body.recording-mode #pp-toggles,
+body.recording-mode #clean-view-exit,
+body.recording-mode #param-slider-panel,
+body.recording-mode #control-panel,
+body.recording-mode #location-bar,
+body.recording-mode #data-panel,
+body.recording-mode #cctv-panel,
+body.recording-mode #radio-panel,
+body.recording-mode #global-context-panel,
+body.recording-mode #gev-voice-control,
+body.recording-mode #scene-panel {
+ opacity: 0 !important;
+ visibility: hidden !important;
+ pointer-events: none !important;
+}
+
+body.recording-mode #scene-runtime.active {
+ opacity: 1;
+ visibility: visible;
+}
+
+/* Scene playback owns layer and camera sequencing until Stop or completion. */
+body.scene-playback-mode :is(#clear-selected-layers, #reset-globe-view) {
+ display: none !important;
+}
+
diff --git a/src/ui/styles/responsive.css b/src/ui/styles/responsive.css
new file mode 100644
index 000000000..2c61dc278
--- /dev/null
+++ b/src/ui/styles/responsive.css
@@ -0,0 +1,216 @@
+/* ── Responsive ───────────────────────────────── */
+@media (max-width: 720px) {
+ #pp-toggles {
+ --pp-expanded-width: 176px;
+ position: relative;
+ inset: auto;
+ gap: 6px;
+ }
+
+ .pp-toggle-group,
+ #clean-view-toggle {
+ width: 176px;
+ }
+
+ .button-grid {
+ flex-wrap: nowrap;
+ }
+
+ #control-panel {
+ left: 16px;
+ right: 16px;
+ transform: none;
+ max-width: none;
+ }
+
+ #title-bar {
+ top: 20px;
+ left: 20px;
+ }
+
+ #title-bar h1 {
+ font-size: 16px;
+ letter-spacing: 4px;
+ }
+
+ #title-bar h1 {
+ gap: 8px;
+ }
+
+ #title-bar .title-logo {
+ width: 36px;
+ }
+
+ #location-bar {
+ left: 16px;
+ right: 16px;
+ transform: none;
+ max-width: none;
+ bottom: 120px;
+ }
+
+ #gev-voice-control {
+ right: 16px;
+ bottom: 16px;
+ min-width: 196px;
+ }
+
+ #gev-voice-detail {
+ max-width: 112px;
+ }
+
+ .hud-top-left,
+ .hud-bottom-left {
+ left: 16px;
+ }
+
+ .hud-top-right,
+ .hud-bottom-right {
+ right: 16px;
+ }
+
+ .hud-left-edge,
+ .hud-right-edge {
+ display: none;
+ }
+
+ .hud-top-bar,
+ .hud-bottom-bar {
+ width: calc(100vw - 24px);
+ left: 12px;
+ transform: none;
+ }
+
+ .hud-top-bar {
+ top: 54px;
+ font-size: 9px;
+ }
+
+ #intel-hud[data-variant='operator'] .hud-top-bar {
+ left: 12px;
+ right: auto;
+ width: calc(100vw - 24px);
+ transform: none;
+ }
+
+ .hud-bottom-bar {
+ bottom: 90px;
+ font-size: 9px;
+ }
+
+ #data-panel {
+ top: auto;
+ left: 16px;
+ bottom: 200px;
+ width: 260px;
+ }
+
+ #data-panel.collapsed {
+ width: 260px;
+ }
+
+ #cctv-panel {
+ top: auto;
+ left: 16px;
+ right: 16px;
+ width: auto;
+ bottom: 308px;
+ }
+
+ #cctv-panel.collapsed {
+ width: auto;
+ }
+
+ /* Narrow viewports: cap the preview height to keep the panel compact. Cap
+ the IMAGE, not the wrap — the wrap is overflow:hidden, so capping it would
+ re-crop the very timestamp this is protecting. object-fit: contain then
+ letterboxes inside the shorter box. */
+ #cctv-frame {
+ aspect-ratio: auto;
+ height: 120px;
+ }
+
+ .cctv-frame-wrap {
+ min-height: 0;
+ }
+
+ #scene-panel {
+ top: auto;
+ right: 16px;
+ left: 16px;
+ width: auto;
+ bottom: 12px;
+ }
+
+ #scene-panel.collapsed {
+ width: auto;
+ }
+
+ #left-panel-stack {
+ top: 70px;
+ right: 16px;
+ bottom: calc(50vh + 8px);
+ left: 16px;
+ width: auto;
+ max-height: none;
+ overflow-y: auto;
+ }
+
+ #right-context-rail {
+ top: calc(50vh + 8px);
+ right: 16px;
+ /* The rail goes edge-to-edge at this width, so its floor is what decides
+ whether the required Google/Cesium credit line survives. The credit's
+ top edge sits at calc(2vh + 5rem) plus its own 28px, so a flat 100px
+ floor cut into it at EVERY viewport height — the DISPLAY toggles were
+ drawn straight over the notice. Track the credit's own anchor instead
+ and the 12px of clear air holds regardless of height; the rail already
+ scrolls (overflow-y below), so it loses reach, not content. */
+ bottom: calc(2vh + 7.5rem);
+ left: 16px;
+ width: auto;
+ max-height: none;
+ overflow-y: auto;
+ }
+
+ #right-context-rail > #pp-toggles {
+ width: 100%;
+ }
+
+ #right-context-rail #pp-toggles.collapsed .pp-header-row,
+ #right-context-rail #cctv-panel,
+ #right-context-rail #cctv-panel.collapsed,
+ #right-context-rail #radio-panel,
+ #right-context-rail #radio-panel.collapsed,
+ #right-context-rail #global-context-panel,
+ #right-context-rail #global-context-panel.collapsed {
+ width: 100%;
+ }
+ .context-radio-mini {
+ right: -38px;
+ width: min(244px, calc(100vw - 32px));
+ }
+
+ #left-panel-stack > #data-panel,
+ #left-panel-stack > #cctv-panel,
+ #left-panel-stack > #global-context-panel,
+ #left-panel-stack > #scene-panel,
+ #left-panel-stack > #data-panel.collapsed,
+ #left-panel-stack > #cctv-panel.collapsed,
+ #left-panel-stack > #global-context-panel.collapsed,
+ #left-panel-stack > #scene-panel.collapsed {
+ position: relative;
+ top: auto;
+ right: auto;
+ bottom: auto;
+ left: auto;
+ width: 100%;
+ }
+
+ #scene-runtime {
+ top: 16px;
+ max-width: calc(100vw - 24px);
+ text-align: center;
+ }
+}
+
diff --git a/src/ui/styles/scenes.css b/src/ui/styles/scenes.css
new file mode 100644
index 000000000..cb5e04140
--- /dev/null
+++ b/src/ui/styles/scenes.css
@@ -0,0 +1,412 @@
+/* ── Scene Director Panel ───────────────────── */
+#scene-panel {
+ --panel-expanded-width: 360px;
+ position: fixed;
+ top: calc(var(--left-stack-top) + (var(--left-stack-gap) * 2));
+ left: var(--left-stack-x);
+ right: auto;
+ bottom: auto;
+ z-index: 100;
+ width: var(--panel-expanded-width);
+ max-height: calc(100vh - 24px);
+}
+
+#left-panel-stack > #data-panel,
+#left-panel-stack > #cctv-panel,
+#left-panel-stack > #global-context-panel,
+#left-panel-stack > #scene-panel {
+ position: relative;
+ top: auto;
+ right: auto;
+ bottom: auto;
+ left: auto;
+ z-index: auto;
+ max-height: none;
+ flex: 0 0 auto;
+ min-height: 0;
+ pointer-events: auto;
+}
+
+#left-panel-stack > #data-panel {
+ order: 1;
+}
+
+#left-panel-stack > #cctv-panel {
+ order: 2;
+}
+
+#left-panel-stack > #scene-panel { order: 4; }
+
+/*
+ * Runtime focus mode: the layout engine applies this only when the expanded
+ * panel's measured natural height plus sibling labels cannot fit inside the
+ * live HUD/attribution-safe corridor.
+ */
+#left-panel-stack.layout-focus > [data-panel-id].collapsed {
+ display: none;
+}
+
+#left-panel-stack > #data-panel:not(.collapsed),
+#left-panel-stack > #cctv-panel:not(.collapsed),
+#left-panel-stack > #scene-panel:not(.collapsed) {
+ box-sizing: border-box;
+ flex: 0 1 var(--left-panel-allocated-height, auto);
+ height: var(--left-panel-allocated-height, auto);
+ max-height: var(--left-panel-allocated-height, 100%);
+}
+
+/*
+ * When an expanded panel and its collapsed siblings fit together, preserve
+ * the canonical control order and center their combined stack at 50vh.
+ */
+#left-panel-stack.layout-tail > :is(#data-panel, #cctv-panel, #scene-panel):not(.collapsed) {
+ box-sizing: border-box;
+ flex: 0 0 var(--left-panel-allocated-height);
+ height: var(--left-panel-allocated-height);
+ max-height: var(--left-panel-allocated-height);
+}
+
+#left-panel-stack > #data-panel:not(.collapsed) .data-panel-inner,
+#left-panel-stack > #cctv-panel:not(.collapsed) .cctv-panel-inner,
+#left-panel-stack > #scene-panel:not(.collapsed) .scene-panel-inner {
+ height: 100%;
+ max-height: 100%;
+}
+
+#left-panel-stack > #data-panel:not(.collapsed) .data-panel-inner {
+ overflow: hidden;
+}
+
+#left-panel-stack > #cctv-panel:not(.collapsed) .cctv-panel-inner,
+#left-panel-stack > #scene-panel:not(.collapsed) .scene-panel-inner {
+ overflow-y: auto;
+ scrollbar-gutter: stable;
+}
+
+#left-panel-stack > [data-panel-id]:not(.collapsed) .panel-header {
+ position: sticky;
+ top: 0;
+ z-index: 2;
+ background: transparent;
+}
+
+#left-panel-stack > [data-panel-id]:not(.collapsed) .panel-divider {
+ background: linear-gradient(90deg, rgb(0 212 255 / 28%), rgba(0, 212, 255, 0.18) 58%, transparent);
+ box-shadow: 0 0 7px rgba(0, 212, 255, 0.22);
+}
+
+#right-context-rail [data-panel-id]:not(.collapsed) .panel-divider {
+ background: linear-gradient(90deg, rgb(0 212 255 / 28%), rgba(0, 212, 255, 0.18) 58%, transparent);
+ box-shadow: 0 0 7px rgba(0, 212, 255, 0.22);
+}
+
+#scene-panel .panel-glow {
+ position: absolute;
+ inset: -18px;
+ background: radial-gradient(ellipse at center, rgba(0, 212, 255, 0.16) 0%, transparent 65%);
+ filter: blur(16px);
+ opacity: 0.25;
+ pointer-events: none;
+}
+
+.scene-panel-inner {
+ position: relative;
+ background: var(--glass-bg);
+ border: 1px solid var(--glass-border);
+ border-radius: var(--panel-radius);
+ padding: 14px;
+ display: flex;
+ flex-direction: column;
+ max-height: calc(100vh - 24px);
+ backdrop-filter: blur(24px) saturate(1.4);
+ -webkit-backdrop-filter: blur(24px) saturate(1.4);
+ box-shadow:
+ 0 8px 32px rgba(0, 0, 0, 0.5),
+ 0 0 0 1px rgba(255, 255, 255, 0.03) inset,
+ 0 1px 0 rgba(255, 255, 255, 0.06) inset;
+}
+
+.scene-controls {
+ display: flex;
+ gap: 8px;
+ margin-bottom: 8px;
+ flex-wrap: wrap;
+}
+
+#scene-select {
+ flex: 1;
+ min-width: 0;
+ background: rgba(255, 255, 255, 0.06);
+ border: 1px solid rgba(255, 255, 255, 0.14);
+ border-radius: 7px;
+ color: var(--text-primary);
+ padding: 6px 8px;
+ font-family: var(--font-sans);
+ font-size: 12px;
+ outline: none;
+}
+
+.scene-btn {
+ background: rgba(255, 255, 255, 0.05);
+ border: 1px solid rgba(255, 255, 255, 0.14);
+ border-radius: 7px;
+ color: var(--text-secondary);
+ font-family: var(--font-mono);
+ font-size: 9px;
+ letter-spacing: 1.2px;
+ padding: 6px 9px;
+ cursor: pointer;
+ transition:
+ background-color var(--transition-fast),
+ border-color var(--transition-fast),
+ color var(--transition-fast),
+ opacity var(--transition-fast);
+ white-space: nowrap;
+ flex: 1;
+ min-width: 72px;
+}
+
+#scene-start-btn,
+#scene-stop-btn,
+#scene-next-btn {
+ flex: 1 1 0;
+}
+
+.scene-shot-list {
+ display: flex;
+ flex-direction: column;
+ gap: 6px;
+ max-height: 160px;
+ min-height: 96px;
+ flex: 1;
+ overflow-y: auto;
+ padding: 4px 2px 6px;
+ margin-bottom: 8px;
+}
+
+.scene-shot-list::-webkit-scrollbar {
+ width: 6px;
+}
+
+.scene-shot-list::-webkit-scrollbar-thumb {
+ background: rgba(255, 255, 255, 0.16);
+ border-radius: 999px;
+}
+
+.scene-shot-empty {
+ border: 1px dashed rgba(255, 255, 255, 0.14);
+ border-radius: 8px;
+ padding: 10px 8px;
+ text-align: center;
+ font-family: var(--font-mono);
+ font-size: 9px;
+ letter-spacing: 1px;
+ color: var(--text-dim);
+}
+
+.scene-shot-row {
+ border: 1px solid rgba(255, 255, 255, 0.12);
+ border-radius: 9px;
+ padding: 7px 8px;
+ background: rgba(255, 255, 255, 0.03);
+ transition: border-color var(--transition-fast), background var(--transition-fast);
+}
+
+.scene-shot-row.active {
+ border-color: var(--accent);
+ background: rgba(0, 212, 255, 0.08);
+}
+
+.scene-shot-top {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 8px;
+}
+
+.scene-shot-label {
+ font-family: var(--font-mono);
+ font-size: 10px;
+ letter-spacing: 1px;
+ color: var(--text-primary);
+}
+
+.scene-shot-meta {
+ margin-top: 4px;
+ font-family: var(--font-mono);
+ font-size: 8px;
+ letter-spacing: 0.8px;
+ color: var(--text-dim);
+}
+
+.scene-shot-actions {
+ display: flex;
+ gap: 6px;
+}
+
+.scene-shot-btn {
+ border: 1px solid rgba(255, 255, 255, 0.14);
+ border-radius: 6px;
+ background: rgba(255, 255, 255, 0.05);
+ color: var(--text-secondary);
+ font-family: var(--font-mono);
+ font-size: 8px;
+ letter-spacing: 0.8px;
+ padding: 4px 6px;
+ cursor: pointer;
+ transition:
+ background-color var(--transition-fast),
+ border-color var(--transition-fast),
+ color var(--transition-fast);
+}
+
+.scene-shot-btn:hover {
+ color: var(--text-primary);
+ border-color: var(--glass-border-hover);
+}
+
+.scene-shot-btn.scene-shot-danger:hover {
+ color: #ff7e7e;
+ border-color: #ff7e7e;
+}
+
+.scene-btn:hover:not(:disabled) {
+ color: var(--accent);
+ border-color: var(--accent);
+ background: rgba(0, 212, 255, 0.14);
+}
+
+.scene-btn:disabled {
+ opacity: 0.45;
+ cursor: default;
+}
+
+.scene-btn-danger:hover:not(:disabled) {
+ color: #ff7272;
+ border-color: #ff7272;
+ background: rgba(255, 88, 88, 0.15);
+}
+
+.scene-progress {
+ margin-top: 8px;
+ width: 100%;
+ height: 18px;
+ border-radius: 999px;
+ background: rgba(255, 255, 255, 0.06);
+ border: 1px solid rgba(255, 255, 255, 0.1);
+ overflow: hidden;
+}
+
+#scene-progress-fill {
+ width: 0%;
+ height: 100%;
+ background: linear-gradient(90deg, rgba(0, 212, 255, 0.2), rgba(0, 212, 255, 0.75));
+ color: #d5f7ff;
+ font-family: var(--font-mono);
+ font-size: 8px;
+ letter-spacing: 1px;
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
+ padding-right: 6px;
+ transition: width 100ms linear;
+ text-shadow: 0 0 6px rgba(0, 212, 255, 0.6);
+}
+
+#scene-status {
+ margin-top: 8px;
+ font-family: var(--font-mono);
+ font-size: 10px;
+ letter-spacing: 1px;
+ color: var(--text-secondary);
+}
+
+#scene-runtime {
+ position: fixed;
+ top: 34px;
+ left: 50%;
+ transform: translateX(-50%);
+ z-index: 105;
+ opacity: 0;
+ visibility: hidden;
+ transition: opacity 180ms ease, visibility 180ms ease;
+ font-family: var(--font-mono);
+ font-size: 11px;
+ letter-spacing: 2px;
+ color: #bff4ff;
+ background: rgba(0, 0, 0, 0.45);
+ border: 1px solid rgba(0, 212, 255, 0.36);
+ border-radius: 999px;
+ padding: 6px 14px;
+ text-shadow: 0 0 8px rgba(0, 212, 255, 0.55);
+ pointer-events: none;
+}
+
+#scene-runtime.active {
+ opacity: 1;
+ visibility: visible;
+}
+
+#control-panel.collapsed .button-grid,
+#data-panel.collapsed .data-toggle-list,
+#global-context-panel.collapsed #radio-panel,
+#global-context-panel.collapsed #military-awareness-panel,
+#global-context-panel.collapsed .global-context-actions,
+#global-context-panel.collapsed .global-context-modes,
+#global-context-panel.collapsed .context-mode-view,
+#global-context-panel.collapsed > .global-context-panel-inner > .context-mode-standby,
+#radio-panel.collapsed .radio-panel-inner > :not(.panel-header),
+#cctv-panel.collapsed .cctv-controls,
+#cctv-panel.collapsed .cctv-calibration-block,
+#cctv-panel.collapsed .cctv-frame-wrap,
+#cctv-panel.collapsed #cctv-source-badge,
+#cctv-panel.collapsed #cctv-meta,
+#cctv-panel.collapsed .cctv-summary-label,
+#cctv-panel.collapsed #cctv-summary,
+#scene-panel.collapsed .scene-controls,
+#scene-panel.collapsed .scene-shot-list,
+#scene-panel.collapsed .scene-progress,
+#scene-panel.collapsed #scene-status,
+#param-slider-panel.collapsed #param-sliders,
+#location-bar.collapsed .poi-row-container,
+#location-bar.collapsed .location-bar-divider,
+#location-bar.collapsed .location-city-row {
+ display: none !important;
+}
+
+#data-panel.collapsed,
+#cctv-panel.collapsed,
+#scene-panel.collapsed {
+ width: var(--left-collapsed-width);
+}
+
+#global-context-panel #radio-panel.collapsed { width: 100%; }
+
+#data-panel.collapsed .panel-title,
+#cctv-panel.collapsed .panel-title,
+#radio-panel.collapsed .panel-title,
+#scene-panel.collapsed .panel-title {
+ font-size: 8px;
+ letter-spacing: 1.8px;
+}
+
+#control-panel.collapsed .panel-inner,
+#data-panel.collapsed .data-panel-inner,
+#cctv-panel.collapsed .cctv-panel-inner,
+#radio-panel.collapsed .radio-panel-inner,
+#scene-panel.collapsed .scene-panel-inner,
+#param-slider-panel.collapsed,
+#location-bar.collapsed .location-inner {
+ padding-bottom: 10px;
+}
+
+#control-panel.collapsed .panel-header,
+#data-panel.collapsed .panel-header,
+#cctv-panel.collapsed .panel-header,
+#radio-panel.collapsed .panel-header,
+#global-context-panel.collapsed .panel-header,
+#scene-panel.collapsed .panel-header,
+#param-slider-panel.collapsed .param-panel-header {
+ margin-bottom: 2px;
+}
+
diff --git a/src/ui/styles/status.css b/src/ui/styles/status.css
new file mode 100644
index 000000000..c6aca6c96
--- /dev/null
+++ b/src/ui/styles/status.css
@@ -0,0 +1,334 @@
+/* ── Top-center Globe Actions ────────────────── */
+#top-center-actions {
+ position: fixed;
+ top: 32px;
+ left: 50%;
+ z-index: 100;
+ display: flex;
+ gap: 8px;
+ transform: translateX(-50%);
+}
+
+#top-center-actions button {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 36px;
+ height: 36px;
+ padding: 0;
+ background: var(--glass-bg);
+ border: 1px solid var(--glass-border);
+ border-radius: 50%;
+ color: var(--text-secondary);
+ backdrop-filter: blur(16px);
+ -webkit-backdrop-filter: blur(16px);
+ cursor: pointer;
+ transition:
+ background-color var(--transition-fast),
+ border-color var(--transition-fast),
+ color var(--transition-fast),
+ opacity var(--transition-fast),
+ transform var(--transition-fast);
+ outline: none;
+}
+
+#top-center-actions button:hover,
+#top-center-actions button:focus-visible {
+ border-color: var(--glass-border-hover);
+ background: rgba(255, 255, 255, 0.06);
+ transform: scale(1.1);
+}
+
+#top-center-actions button:active {
+ transform: scale(0.95);
+}
+
+#top-center-actions button:disabled {
+ cursor: wait;
+ opacity: 0.55;
+ transform: none;
+}
+
+#top-center-actions .material-symbols-outlined {
+ font-size: 18px;
+}
+
+#global-loading-status {
+ position: fixed;
+ top: 74px;
+ left: 50%;
+ z-index: 102;
+ display: inline-flex;
+ align-items: center;
+ gap: 10px;
+ max-width: calc(100vw - 32px);
+ padding: 6px 10px;
+ border-radius: 7px;
+ border: 1px solid rgba(0, 212, 255, 0.24);
+ background: rgba(3, 10, 18, 0.78);
+ backdrop-filter: blur(14px);
+ -webkit-backdrop-filter: blur(14px);
+ color: rgba(170, 252, 255, 0.92);
+ font-family: var(--font-mono);
+ font-size: 8px;
+ letter-spacing: 1.35px;
+ text-transform: uppercase;
+ transform: translateX(-50%);
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.34), 0 0 14px rgba(0, 212, 255, 0.08);
+ pointer-events: none;
+}
+#global-loading-status[hidden] { display: none; }
+#global-loading-label {
+ color: rgba(184, 244, 255, 0.92);
+}
+#global-loading-detail {
+ min-width: 34px;
+ max-width: min(220px, 38vw);
+ overflow: hidden;
+ color: #00e1ff;
+ font-weight: 600;
+ letter-spacing: 1.6px;
+ text-align: right;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+#global-loading-status:is([data-state='complete'], [data-state='cancelled'], [data-state='error']) {
+ justify-content: center;
+ text-align: center;
+}
+#global-loading-status:is([data-state='complete'], [data-state='cancelled'], [data-state='error']) #global-loading-detail {
+ display: none;
+}
+#global-loading-status[data-state='error'] { border-color: rgba(255, 98, 82, 0.55); color: #ff9b8e; }
+#global-loading-status[data-state='error'] #global-loading-label,
+#global-loading-status[data-state='error'] #global-loading-detail { color: #ff9b8e; }
+#global-loading-status[data-state='cancelled'] { color: #ffd488; }
+#global-loading-status[data-state='retry'] { border-color: rgba(255, 212, 136, 0.55); }
+#global-loading-status[data-state='retry'] #global-loading-label,
+#global-loading-status[data-state='retry'] #global-loading-detail { color: #ffd488; }
+#global-loading-status[data-state='cancelled'] #global-loading-label,
+#global-loading-status[data-state='cancelled'] #global-loading-detail { color: #ffd488; }
+#global-loading-status[data-state='acquiring'] {
+ border-color: rgba(0, 212, 255, 0.42);
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.34), 0 0 18px rgba(0, 212, 255, 0.12);
+}
+
+.share-icon {
+ font-size: 16px;
+ line-height: 1;
+}
+
+#traffic-sync-chip,
+#cctv-sync-chip {
+ position: fixed;
+ top: 112px;
+ left: 50%;
+ transform: translateX(-50%);
+ z-index: 101;
+ display: inline-flex;
+ align-items: center;
+ gap: 10px;
+ padding: 6px 10px;
+ border-radius: 7px;
+ border: 1px solid rgba(0, 212, 255, 0.24);
+ background: rgba(3, 10, 18, 0.78);
+ backdrop-filter: blur(14px);
+ -webkit-backdrop-filter: blur(14px);
+ color: rgba(170, 252, 255, 0.92);
+ font-family: var(--font-mono);
+ font-size: 8px;
+ letter-spacing: 1.35px;
+ text-transform: uppercase;
+ opacity: 0;
+ pointer-events: none;
+ transition: opacity 0.22s ease, transform 0.22s ease;
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.34), 0 0 14px rgba(0, 212, 255, 0.08);
+}
+
+/* Stacked below the traffic chip so both can show at once */
+#cctv-sync-chip {
+ top: 146px;
+}
+
+#traffic-sync-chip.visible,
+#cctv-sync-chip.visible {
+ opacity: 1;
+ transform: translateX(-50%) translateY(0);
+}
+
+#traffic-sync-label,
+#cctv-sync-label {
+ color: rgba(184, 244, 255, 0.92);
+}
+
+#traffic-sync-progress,
+#cctv-sync-progress {
+ color: #00e1ff;
+ font-weight: 600;
+ letter-spacing: 1.6px;
+ min-width: 34px;
+ text-align: right;
+}
+
+/* The settled traffic chip carries no progress number — the label's coverage
+ figure is the honest one. Collapse the empty slot so the chip closes up
+ instead of trailing a 34px stub and its flex gap. */
+#traffic-sync-progress:empty {
+ display: none;
+}
+
+/* ── Split-flap chip text ─────────────────────────────────────────
+ Per-character departure-board flip when a chip label changes.
+ Driven entirely by src/splitFlap.js, which rebuilds the label as
+ one span per character on the change and strips them again once
+ the cascade lands.
+
+ The DOM text is the truth and its node never moves. A chip label is
+ upgraded once into a permanent shell — a .gev-flap-text span holding
+ one long-lived Text node, plus an aria-hidden .gev-flap-cells
+ sibling — and from then on a label change is only `node.data = next`.
+ During a cascade the host takes .gev-flap-active, which clips the
+ real text out of view and lets the cells stand in for it. The cells
+ carry no text at all: both glyphs are generated content (::before =
+ outgoing, ::after = incoming), and generated content never reaches
+ textContent. That is what keeps QA pins and the traffic chip's own
+ `textContent !==` guard honest, and it lets the cells be rebuilt
+ freely while the aria-live region sees only one characterData
+ change per label update.
+
+ Motion matches the cockpit odometer roll (.cockpit-roll-token):
+ same cubic-bezier, same reduced-motion treatment. Only the
+ left-to-right stagger is new — that cascade is what makes it read
+ as a Solari board rather than a counter.
+ ------------------------------------------------------------------ */
+/* While the flaps play, the real text is clipped out of view but stays in
+ the DOM and in the accessibility tree — same clipped-but-present treatment
+ as .world-overlay-accessibility. It is never removed or reparented. */
+.gev-flap-host.gev-flap-active > .gev-flap-text {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ padding: 0;
+ margin: -1px;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ white-space: nowrap;
+ border: 0;
+}
+/* Permanent sibling: empty (and so zero-width) whenever no cascade is running. */
+.gev-flap-cells {
+ white-space: pre;
+}
+.gev-flap-cell {
+ display: inline-block;
+ /* Chip labels carry real spaces; a collapsed space would drop a column. */
+ white-space: pre;
+}
+/* The incoming glyph is in flow, so it — not any text node — is what gives
+ the column its natural width. EVERY column has one, including a column the
+ new string does not reach: that one carries a blank, so it holds its width
+ and its index for the whole cascade instead of collapsing. Collapsing would
+ stack the absolutely-positioned outgoing glyphs on one x and would let a
+ later glyph slide into an earlier column. */
+.gev-flap-cell::after {
+ content: attr(data-flap-next);
+ display: inline-block;
+ white-space: pre;
+}
+.gev-flap-cell.is-flapping {
+ position: relative;
+ /* Relative to the chip's own font size, so the foreshortening reads the
+ same on the 8px status chips as it would anywhere else. */
+ perspective: 4em;
+}
+.gev-flap-cell.is-flapping::before,
+.gev-flap-cell.is-flapping::after {
+ transform-origin: 50% 50%;
+ backface-visibility: hidden;
+}
+.gev-flap-cell.is-flapping::after {
+ animation: gev-flap-in var(--gev-flap-dur, 190ms)
+ cubic-bezier(0.2, 0.75, 0.25, 1) var(--gev-flap-delay, 0ms) both;
+}
+/* Out of flow, so the outgoing glyph overlays its own column without
+ affecting layout — one per column, each anchored to its own cell box. */
+.gev-flap-cell.is-flapping::before {
+ content: attr(data-flap-prev);
+ position: absolute;
+ top: 0;
+ left: 0;
+ white-space: pre;
+ animation: gev-flap-out var(--gev-flap-dur, 190ms)
+ cubic-bezier(0.2, 0.75, 0.25, 1) var(--gev-flap-delay, 0ms) both;
+}
+/* Length changes are eased, never snapped. A GROWING label reserves its new
+ columns the moment the cells go in, so splitFlap.js eases from the previous
+ on-screen width to the cascade width at the start. A SHRINKING one holds
+ every column for the whole cascade, so its ease runs at SETTLEMENT instead,
+ from the cascade width down to the natural width — one smooth transition
+ after the flaps have landed, rather than columns collapsing underneath
+ them. */
+.gev-flap-sizing {
+ display: inline-block;
+ transition: width var(--gev-flap-total, 500ms) cubic-bezier(0.2, 0.75, 0.25, 1);
+}
+/* The old leaf hinges down and away on the cell's midline. */
+@keyframes gev-flap-out {
+ 0% { transform: rotateX(0deg); opacity: 1; }
+ 48% { transform: rotateX(-88deg); opacity: 0.5; }
+ 100% { transform: rotateX(-90deg); opacity: 0; }
+}
+/* The new leaf waits for the old one to clear, then drops in and settles
+ with a single small overshoot — the mechanical clack. */
+@keyframes gev-flap-in {
+ 0% { transform: rotateX(90deg); opacity: 0; }
+ 46% { transform: rotateX(90deg); opacity: 0; }
+ 78% { transform: rotateX(-7deg); opacity: 1; }
+ 100% { transform: rotateX(0deg); opacity: 1; }
+}
+/* Matches the .cockpit-roll-track treatment: collapse the duration rather
+ than dropping the animation, so the final frame still lands the glyph.
+ src/splitFlap.js also checks the query and takes the instant path, so
+ this is the belt to that braces. */
+@media (prefers-reduced-motion: reduce) {
+ .gev-flap-cell.is-flapping::before,
+ .gev-flap-cell.is-flapping::after {
+ animation-duration: 1ms;
+ animation-delay: 0ms;
+ }
+ .gev-flap-sizing {
+ transition-duration: 1ms;
+ }
+}
+
+/* ── Toast Notification ──────────────────────── */
+#toast {
+ position: fixed;
+ bottom: 100px;
+ left: 50%;
+ transform: translateX(-50%) translateY(20px);
+ z-index: 200;
+ padding: 10px 24px;
+ background: var(--glass-bg);
+ border: 1px solid var(--accent);
+ border-radius: 8px;
+ backdrop-filter: blur(16px);
+ -webkit-backdrop-filter: blur(16px);
+ font-family: var(--font-mono);
+ font-size: 11px;
+ letter-spacing: 2px;
+ color: var(--accent);
+ text-transform: uppercase;
+ opacity: 0;
+ visibility: hidden;
+ pointer-events: none;
+ transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
+ box-shadow: 0 0 20px rgba(0, 212, 255, 0.15);
+}
+
+#toast.visible {
+ opacity: 1;
+ visibility: visible;
+ transform: translateX(-50%) translateY(0);
+}
+
diff --git a/src/ui/styles/voice-cost.css b/src/ui/styles/voice-cost.css
new file mode 100644
index 000000000..57c55e281
--- /dev/null
+++ b/src/ui/styles/voice-cost.css
@@ -0,0 +1,78 @@
+/* ------------------------------------------------------------------ *
+ * Voice cost control — model-tier toggle + running session estimate.
+ * Appended (not woven into the dock passes above) so the three existing
+ * #gev-voice-control cascades stay untouched; these rules only add the
+ * new .gev-voice-cost cluster inside the existing .gev-voice-heading row.
+ * ------------------------------------------------------------------ */
+.gev-voice-cost {
+ display: flex;
+ align-items: center;
+ gap: 0.22rem;
+ margin-left: auto; /* pin right; kicker + status keep their left cluster */
+ flex: 0 0 auto;
+}
+
+.gev-voice-tier-btn {
+ padding: 0 0.24rem;
+ height: 0.72rem;
+ min-width: 1.55rem;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ background: rgba(0, 212, 255, 0.06);
+ border: 1px solid rgba(0, 212, 255, 0.34);
+ border-radius: 0.18rem;
+ color: var(--text-secondary);
+ font-family: var(--font-mono);
+ font-size: 0.4rem;
+ letter-spacing: 0.045rem;
+ line-height: 1;
+ cursor: pointer;
+ transition: color var(--transition-fast), border-color var(--transition-fast),
+ background var(--transition-fast);
+}
+
+.gev-voice-tier-btn:hover {
+ color: var(--text-primary);
+ border-color: rgba(0, 212, 255, 0.6);
+ background: rgba(0, 212, 255, 0.12);
+}
+
+/* MINI engaged — amber, distinct from the cyan default so the cheaper tier
+ is legible at a glance without reading the label. */
+.gev-voice-tier-btn[aria-pressed='true'] {
+ color: #ffc46b;
+ border-color: rgba(255, 196, 107, 0.55);
+ background: rgba(255, 196, 107, 0.12);
+}
+
+.gev-voice-cost-value {
+ color: var(--text-dim);
+ font-family: var(--font-mono);
+ font-size: 0.4rem;
+ letter-spacing: 0.02rem;
+ line-height: 1;
+ font-variant-numeric: tabular-nums;
+ transition: color var(--transition-fast);
+}
+
+.gev-voice-cost-value[data-level='warn'] {
+ color: #ffc46b;
+}
+
+.gev-voice-cost-value[data-level='cap'] {
+ color: #ff6b6b;
+ font-weight: 600;
+}
+
+/* The dock heading row is 0.8rem tall; keep the cluster inside it. */
+#command-dock .gev-voice-cost {
+ max-height: 0.8rem;
+}
+
+/* The dock collapses the kicker/readout when a tray is open — the cost
+ cluster follows the same rule so the row never overflows. */
+#command-dock.tray-open .gev-voice-cost {
+ display: none;
+}
+
diff --git a/src/ui/uiLifetime.js b/src/ui/uiLifetime.js
new file mode 100644
index 000000000..a9cb9c9ed
--- /dev/null
+++ b/src/ui/uiLifetime.js
@@ -0,0 +1,54 @@
+/** Own deferred UI presentation and listeners until synchronous teardown. */
+export class UiLifetime {
+ constructor() {
+ this.destroyed = false;
+ this.removers = new Set();
+ this.frames = new Set();
+ this.timers = new Set();
+ }
+ listen(target, type, callback, options) {
+ if (this.destroyed || !target) return () => {};
+ const remove = () => {
+ target.removeEventListener(type, listener, options);
+ this.removers.delete(remove);
+ };
+ const listener = (event) => {
+ if (options?.once) remove();
+ if (!this.destroyed) return callback(event);
+ };
+ target.addEventListener(type, listener, options);
+ this.removers.add(remove);
+ return remove;
+ }
+ frame(callback) {
+ if (this.destroyed) return null;
+ const frame = requestAnimationFrame((time) => {
+ this.frames.delete(frame);
+ if (!this.destroyed) callback(time);
+ });
+ this.frames.add(frame);
+ return frame;
+ }
+ timeout(callback, delay) {
+ if (this.destroyed) return null;
+ const timer = setTimeout(() => {
+ this.timers.delete(timer);
+ if (!this.destroyed) callback();
+ }, delay);
+ this.timers.add(timer);
+ return timer;
+ }
+ cancelTimeout(timer) {
+ clearTimeout(timer);
+ this.timers.delete(timer);
+ }
+ destroy() {
+ if (this.destroyed) return;
+ this.destroyed = true;
+ for (const remove of this.removers) remove();
+ for (const frame of this.frames) cancelAnimationFrame(frame);
+ for (const timer of this.timers) clearTimeout(timer);
+ this.frames.clear();
+ this.timers.clear();
+ }
+}
diff --git a/style.css b/style.css
index 46a66bf7a..3b9872835 100644
--- a/style.css
+++ b/style.css
@@ -1,9685 +1,20 @@
-/* ═══════════════════════════════════════════════
- GOD'S EYE VIEW — Dark Sci-Fi UI
- Apple meets Blade Runner
- ═══════════════════════════════════════════════ */
-
-:root {
- --bg-dark: #0a0a0f;
- --glass-bg: rgba(12, 12, 20, 0.72);
- --glass-border: rgba(255, 255, 255, 0.08);
- --glass-border-hover: rgba(255, 255, 255, 0.15);
- --accent: #00d4ff;
- --accent-dim: rgba(0, 212, 255, 0.15);
- --accent-glow: rgba(0, 212, 255, 0.4);
- --text-primary: #e8eaed;
- --text-secondary: rgba(232, 234, 237, 0.5);
- --text-dim: rgba(232, 234, 237, 0.3);
- --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
- --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
- --panel-radius: 16px;
- --btn-radius: 10px;
- --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
- --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
- --left-stack-x: 52px;
- --right-rail-x: 52px;
- --left-stack-top: 26vh;
- --left-stack-gap: 72px;
- --left-collapsed-width: 176px;
- --display-panel-expanded-width: 272px;
- --cockpit-radio-collapsed-width: 148px;
- --cockpit-radio-expanded-width: 232px;
-}
-
-* {
- margin: 0;
- padding: 0;
- box-sizing: border-box;
-}
-
-/* Keyboard focus is an app-wide state and must survive selected/active button
- skins. Individual controls can choose an inset/outset offset, but no local
- `outline: none` rule may erase the ring. */
-:where(
- button,
- a[href],
- input,
- select,
- textarea,
- summary,
- [tabindex],
- [role='button'],
- [role='checkbox'],
- [role='combobox'],
- [role='link'],
- [role='listbox'],
- [role='menuitem'],
- [role='menuitemcheckbox'],
- [role='menuitemradio'],
- [role='option'],
- [role='radio'],
- [role='searchbox'],
- [role='slider'],
- [role='spinbutton'],
- [role='switch'],
- [role='tab'],
- [role='textbox'],
- [role='treeitem']
-):focus-visible {
- outline: 2px solid var(--text-primary) !important;
- outline-offset: 2px;
-}
-
-html, body {
- width: 100%;
- height: 100%;
- overflow: hidden;
- background: var(--bg-dark);
- font-family: var(--font-sans);
- color: var(--text-primary);
- -webkit-font-smoothing: antialiased;
-}
-
-/* ── Cesium Container ─────────────────────────── */
-#cesiumContainer {
- width: 100%;
- height: 100%;
- position: absolute;
- top: 0;
- left: 0;
-}
-
-/* Unified world-overlay host: detection uses one host-owned blend surface
- beneath the shared text/card canvas; both share one frame path. The root
- holds ONLY the card canvas — it is a stacking context (z-index below), and
- a canvas that blends against the scene cannot live inside one. */
-#world-overlay-root {
- position: absolute;
- inset: 0;
- z-index: 6;
- overflow: hidden;
- pointer-events: none;
-}
-
-#world-overlay-detection-surface,
-#world-overlay-canvas {
- position: absolute;
- inset: 0;
- display: block;
- width: 100%;
- height: 100%;
- pointer-events: none;
-}
-
-/* Scope mask — the explicit circular viewport treatment (see
- src/scopeMask.js for the emergent-artifact history). z2 keeps it above
- the WebGL scene but under the z5 detection surface, preserving the old
- compositing order where detection's blend rode the masked scene. */
-#scope-mask {
- position: absolute;
- inset: 0;
- width: 100%;
- height: 100%;
- /* z1 like the celestial ring; the ring is appended LATER so DOM order
- keeps it ABOVE the mask — matching the old stacking, where the DOM
- ring rode above the in-scene scope artifact. Detection (z5) and the
- overlay root (z6) stay above both. */
- z-index: 1;
- pointer-events: none;
-}
-
-/* The detection surface is host-owned but parented into #cesiumContainer
- (position:absolute, z-index:auto — NOT a stacking context) so its
- `mix-blend-mode: screen` composites against the WebGL scene. z5 keeps it
- under the z6 root that carries the shared card canvas; do not move this
- surface inside #world-overlay-root, which would isolate the blend. */
-#world-overlay-detection-surface {
- z-index: 5;
-}
-
-/* Canvas cards retain their spatial renderer; this parallel focusable list
- exposes only the currently painted actionable targets to assistive tech. */
-.world-overlay-accessibility {
- position: fixed;
- width: 1px;
- height: 1px;
- padding: 0;
- margin: -1px;
- overflow: hidden;
- clip: rect(0, 0, 0, 0);
- white-space: nowrap;
- border: 0;
-}
-
-/* ── Source-backed cockpit weather ─────────────
- Low-resolution GPU cloud pass composited only inside the cockpit keyhole. */
-#cockpit-cloud-effects {
- position: fixed;
- inset: 0;
- z-index: 7;
- display: none;
- width: 100vw;
- height: 100vh;
- opacity: 0;
- pointer-events: none;
- clip-path: circle(min(40vw, 52vh) at 50% 50%);
- filter: blur(0.7px) saturate(0.72) contrast(1.08);
- transform: translateZ(0);
- transition: opacity 900ms ease;
-}
-
-body.cockpit-mode #cockpit-cloud-effects.active {
- display: block;
- opacity: 0.86;
-}
-
-/* ── Full-globe celestial keyhole ring ─────── */
-.celestial-ring-overlay {
- position: absolute;
- inset: 0;
- /* Above the z1 scope mask regardless of DOM order (the ring is built by
- StyleManager before the scope installs) — the ring always rode above
- the scope treatment. Detection (z5) and the overlay root (z6) stay on
- top of both. */
- z-index: 2;
- overflow: hidden;
- pointer-events: none;
- opacity: 0;
- visibility: hidden;
- transition: opacity 300ms ease, visibility 300ms ease;
-}
-
-.celestial-ring-overlay.visible {
- opacity: 1;
- visibility: visible;
-}
-
-.celestial-ring-overlay.disabled {
- display: none;
-}
-
-.celestial-ring-canvas {
- position: absolute;
- inset: 0;
- display: block;
- transform-origin: 50% 50%;
- will-change: transform, opacity;
-}
-
-.celestial-ring-outline {
- position: absolute;
- box-sizing: border-box;
- border: 0.8px solid rgba(151, 218, 232, 0.095);
- border-radius: 50%;
- will-change: width, height;
-}
-
-.celestial-marker {
- position: absolute;
- z-index: 2;
- transform: translate(-50%, -50%);
- font-family: 'Material Symbols Outlined';
- font-size: 20px;
- font-weight: 400;
- font-style: normal;
- line-height: 1;
- font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
- transition: opacity 120ms linear;
- user-select: none;
-}
-
-.celestial-sun {
- color: rgba(231, 194, 72, 0.92);
- text-shadow: 0 0 7px rgba(231, 194, 72, 0.72), 0 0 18px rgba(231, 194, 72, 0.3);
-}
-
-.celestial-moon {
- color: rgba(55, 211, 239, 0.84);
- text-shadow: 0 0 7px rgba(55, 211, 239, 0.65), 0 0 17px rgba(55, 211, 239, 0.25);
-}
-
-#celestial-toggle:disabled {
- cursor: not-allowed;
- opacity: 0.42;
-}
-
-/* Hide Cesium default UI elements */
-.cesium-viewer-toolbar,
-.cesium-viewer-animationContainer,
-.cesium-viewer-timelineContainer,
-.cesium-viewer-bottom,
-.cesium-viewer-fullscreenContainer,
-.cesium-viewer-vrContainer,
-.cesium-viewer-geocoderContainer,
-.cesium-viewer-selectionIndicatorContainer,
-.cesium-viewer-infoBoxContainer {
- display: none !important;
-}
-
-/* Data-source attribution (Google Maps / 3D Tiles, etc.).
- Required by the Google Maps Platform Terms of Service — keep it visible.
- Styled to be unobtrusive but legible against the dark UI. */
-#cesium-credits {
- position: fixed;
- /* Bottom-LEFT corner, mirrored from the GEV mic pill (right:36/bottom:36) so the two bottom
- corners are symmetric; sits below the coordinate HUD (.hud-bottom-left, bottom:180). Was
- dead-center at the bottom, tucked under the LOCATIONS/STYLE panels. Must stay visible (Google
- /Cesium attribution ToS). */
- bottom: 36px;
- left: 36px;
- z-index: 90;
- max-width: 90vw;
- /* Keep the Google logo + "Data attribution" link on ONE line — they were wrapping to a second
- row (looked like it was falling over). nowrap + a roomy max-width holds them inline. */
- white-space: nowrap;
- pointer-events: auto;
- font-family: var(--font-mono);
- font-size: 10px;
- color: rgba(232, 234, 237, 0.55);
- text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
-}
-#cesium-credits .cesium-credit-logoContainer,
-#cesium-credits .cesium-credit-textContainer,
-#cesium-credits .cesium-credit-expand-link {
- display: inline-block;
- vertical-align: middle;
-}
-#cesium-credits a,
-#cesium-credits .cesium-credit-expand-link {
- color: rgba(232, 234, 237, 0.7);
-}
-
-/* Cesium's stock attribution lightbox grows with every registered data source.
- Keep the title and close affordance fixed while the complete, unabridged
- credit list wraps and scrolls inside a compact panel. */
-.cesium-credit-lightbox-overlay {
- z-index: 200 !important;
-}
-
-.cesium-credit-lightbox {
- display: flex;
- flex-direction: column;
- width: 470px;
- max-width: calc(100vw - 2rem);
- max-height: min(70dvh, 36rem);
- overflow: hidden;
-}
-
-.cesium-credit-lightbox > ul {
- flex: 1;
- min-height: 0;
- margin: 0;
- padding: 8px 20px 14px 40px;
- overflow-x: hidden;
- overflow-y: auto;
- overscroll-behavior: contain;
- scrollbar-gutter: stable;
- font-size: 12px !important;
- line-height: 1.35;
- white-space: normal;
-}
-
-.cesium-credit-lightbox > ul > li {
- padding-bottom: 5px;
- overflow-wrap: anywhere;
-}
-
-@media (max-width: 575px) {
- .cesium-credit-lightbox {
- width: 100% !important;
- max-width: none !important;
- height: 100% !important;
- max-height: 100dvh !important;
- margin: 0 !important;
- }
-}
-/* Clean-view / recording: the Google + Cesium attribution MUST stay visible.
- Google Maps Platform ToS and Cesium's terms require the credit whenever the
- content is displayed — and these are exactly the modes used to record demos
- and launch videos, so hiding #cesium-credits here (as it was before) shipped
- non-compliant footage. The full credit line — Cesium/Ion logo, "Google Maps",
- and the "Data attribution" link that opens the per-layer license popover —
- stays on screen; it's already styled small and unobtrusive above. The GEV
- chrome (panels/HUD) still fades via its own rules; only the required notice
- is exempt. (Note: Cesium re-applies inline styles on the credit elements each
- frame, so the on-screen credit content is owned by Cesium's update loop, not
- CSS overrides — we deliberately don't fight it here.) */
-
-#gev-voice-control {
- position: fixed;
- right: 36px;
- bottom: 36px;
- /* Z ladder: panels 100-139, voice pill 150, toast 200, clean-view-exit 300 */
- z-index: 150;
- display: flex;
- align-items: center;
- gap: 10px;
- min-width: 214px;
- padding: 9px 14px;
- color: var(--text-primary);
- background: var(--glass-bg);
- border: 1px solid var(--glass-border);
- border-radius: 999px;
- box-shadow:
- 0 8px 32px rgba(0, 0, 0, 0.5),
- 0 0 0 1px rgba(255, 255, 255, 0.03) inset,
- 0 1px 0 rgba(255, 255, 255, 0.06) inset,
- 0 0 20px rgba(0, 212, 255, 0.08);
- backdrop-filter: blur(24px) saturate(1.4);
- -webkit-backdrop-filter: blur(24px) saturate(1.4);
- font-family: var(--font-mono);
- pointer-events: auto;
-}
-
-#gev-voice-button {
- width: 72px;
- height: 34px;
- flex: 0 0 auto;
- color: var(--accent);
- background: rgba(0, 212, 255, 0.06);
- border: 1px solid rgba(0, 212, 255, 0.28);
- border-radius: var(--btn-radius);
- font-family: var(--font-mono);
- font-size: 10px;
- letter-spacing: 0;
- cursor: pointer;
-}
-
-#gev-voice-button:hover {
- color: #ffffff;
- border-color: var(--accent);
- box-shadow: 0 0 12px rgba(0, 212, 255, 0.22);
-}
-
-.gev-voice-readout {
- min-width: 0;
- line-height: 1.2;
- text-align: right;
-}
-
-#gev-voice-status {
- font-size: 10px;
- color: var(--accent);
-}
-
-#gev-voice-detail {
- max-width: 132px;
- margin-top: 2px;
- overflow: hidden;
- color: var(--text-secondary);
- font-size: 9px;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-
-#gev-voice-control[data-status='listening'] {
- border-color: rgba(92, 255, 198, 0.45);
-}
-
-#gev-voice-control[data-status='listening'] #gev-voice-status {
- color: #5cffc6;
-}
-
-#gev-voice-control[data-status='executing'] {
- border-color: rgba(255, 220, 120, 0.55);
-}
-
-#gev-voice-control[data-status='executing'] #gev-voice-status {
- color: #ffdc78;
-}
-
-#gev-voice-control[data-status='error'] {
- align-items: flex-start;
- width: min(440px, calc(100vw - 72px));
- border-color: rgba(255, 92, 110, 0.6);
- /* Multi-line error block reads as a panel, not a capsule */
- border-radius: var(--panel-radius);
-}
-
-#gev-voice-control[data-status='error'] #gev-voice-status {
- color: #ff5c6e;
-}
-
-#gev-voice-control[data-status='error'] .gev-voice-readout {
- flex: 1;
- text-align: left;
-}
-
-#gev-voice-control[data-status='error'] #gev-voice-detail {
- max-width: none;
- overflow: visible;
- color: #ffb4bd;
- line-height: 1.45;
- text-overflow: clip;
- white-space: pre-wrap;
- overflow-wrap: anywhere;
- user-select: text;
-}
-
-/* ── Title Bar ────────────────────────────────── */
-#title-bar {
- position: fixed;
- top: 32px;
- left: 36px;
- z-index: 100;
- pointer-events: none;
- user-select: none;
-}
-
-#title-bar .title-glow {
- position: absolute;
- top: -20px;
- left: -20px;
- width: 200px;
- height: 80px;
- background: radial-gradient(ellipse, var(--accent-dim) 0%, transparent 70%);
- filter: blur(20px);
- opacity: 0.6;
-}
-
-#title-bar h1 {
- display: flex;
- align-items: center;
- gap: 12px;
- font-family: var(--font-mono);
- font-size: 26px;
- font-weight: 600;
- letter-spacing: 8px;
- color: var(--text-primary);
- text-shadow: 0 0 30px var(--accent-glow);
- position: relative;
-}
-
-#title-bar .title-logo {
- position: relative;
- display: block;
- width: 52px;
- height: auto;
- filter: drop-shadow(0 0 12px rgba(0, 246, 255, 0.5));
-}
-
-#title-bar .title-logo::before,
-#title-bar .title-logo::after {
- --radio-broadcast-opacity: .28;
- content: '';
- position: absolute;
- z-index: 1;
- left: 50%;
- top: -9px;
- width: 13px;
- height: 7px;
- border: 1px solid var(--accent);
- border-bottom: 0;
- border-radius: 999px 999px 0 0;
- opacity: 0;
- pointer-events: none;
- transform: translateX(-50%);
- transform-origin: 50% 100%;
-}
-
-#title-bar .title-logo::after {
- --radio-broadcast-opacity: .17;
- top: -15px;
- width: 27px;
- height: 13px;
-}
-
-#title-bar.radio-broadcasting .title-logo::before,
-#title-bar.radio-broadcasting .title-logo::after {
- opacity: var(--radio-broadcast-opacity);
- animation: title-radio-broadcast 1.8s ease-in-out infinite;
-}
-
-#title-bar.radio-broadcasting .title-logo::after { animation-delay: .28s; }
-
-@keyframes title-radio-broadcast {
- 0%, 100% {
- opacity: calc(var(--radio-broadcast-opacity) * .55);
- transform: translateX(-50%) scale(.94);
- }
- 50% {
- opacity: var(--radio-broadcast-opacity);
- transform: translateX(-50%) scale(1);
- }
-}
-
-@media (prefers-reduced-motion: reduce) {
- #title-bar.radio-broadcasting .title-logo::before,
- #title-bar.radio-broadcasting .title-logo::after {
- animation: none;
- }
-}
-
-.brand-logo {
- aspect-ratio: 775 / 520;
- overflow: visible;
- pointer-events: none;
-}
-
-.brand-logo > img,
-.brand-logo > svg {
- display: block;
- width: 100%;
- height: 100%;
-}
-
-#title-bar .title-accent,
-.loader-content .title-accent {
- color: var(--accent);
- font-weight: 300;
-}
-
-#title-bar .subtitle {
- font-family: var(--font-mono);
- font-size: 11px;
- letter-spacing: 5px;
- color: var(--text-dim);
- margin-top: 8px;
- text-transform: uppercase;
-}
-
-/* ── Style Indicator ──────────────────────────── */
-#style-indicator {
- position: fixed;
- top: 32px;
- right: 36px;
- z-index: 100;
- pointer-events: none;
- user-select: none;
- text-align: right;
-}
-
-#style-indicator .indicator-label {
- display: block;
- font-family: var(--font-mono);
- font-size: 10px;
- letter-spacing: 3px;
- color: var(--text-dim);
- text-transform: uppercase;
-}
-
-#style-indicator .indicator-value {
- display: block;
- font-family: var(--font-mono);
- font-size: 16px;
- font-weight: 500;
- letter-spacing: 5px;
- color: var(--accent);
- margin-top: 4px;
- text-shadow: 0 0 20px var(--accent-glow);
- transition: var(--transition-smooth);
-}
-
-/* ── Control Panel ────────────────────────────── */
-#control-panel {
- position: fixed;
- bottom: 36px;
- left: 50%;
- transform: translateX(-50%);
- z-index: 100;
- width: auto;
- max-width: 680px;
-}
-
-#control-panel .panel-glow {
- position: absolute;
- inset: -30px;
- background: radial-gradient(ellipse at center bottom, var(--accent-dim) 0%, transparent 60%);
- filter: blur(30px);
- opacity: 0.4;
- pointer-events: none;
-}
-
-.panel-inner {
- position: relative;
- background: var(--glass-bg);
- border: 1px solid var(--glass-border);
- border-radius: var(--panel-radius);
- padding: 16px 20px 18px;
- backdrop-filter: blur(24px) saturate(1.4);
- -webkit-backdrop-filter: blur(24px) saturate(1.4);
- box-shadow:
- 0 8px 32px rgba(0, 0, 0, 0.5),
- 0 0 0 1px rgba(255, 255, 255, 0.03) inset,
- 0 1px 0 rgba(255, 255, 255, 0.06) inset;
-}
-
-.panel-header {
- display: flex;
- align-items: center;
- gap: 12px;
- margin-bottom: 14px;
- padding: 0 4px;
-}
-
-.panel-mini-status {
- display: none;
- align-items: center;
- gap: 8px;
- padding: 0 6px 2px;
-}
-
-#control-panel.collapsed .panel-mini-status {
- display: flex;
-}
-
-.panel-mini-label {
- font-family: var(--font-mono);
- font-size: 8px;
- letter-spacing: 1.4px;
- color: var(--text-dim);
- text-transform: uppercase;
-}
-
-.panel-mini-value {
- font-family: var(--font-mono);
- font-size: 9px;
- letter-spacing: 1.8px;
- color: var(--accent);
- text-transform: uppercase;
- text-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
-}
-
-.panel-drag-handle {
- cursor: grab;
- user-select: none;
-}
-
-.panel-drag-handle:active {
- cursor: grabbing;
-}
-
-.panel-drag-handle.compact {
- margin-left: auto;
- margin-bottom: 2px;
- padding: 2px 8px;
- border-radius: 999px;
- border: 1px solid rgba(255, 255, 255, 0.12);
- background: rgba(255, 255, 255, 0.04);
- font-family: var(--font-mono);
- font-size: 8px;
- letter-spacing: 1.4px;
- color: var(--text-dim);
-}
-
-.panel-drag-handle.compact:hover {
- color: var(--text-primary);
- border-color: var(--glass-border-hover);
-}
-
-.panel-dragging {
- opacity: 0.96;
-}
-
-.panel-title {
- font-family: var(--font-mono);
- font-size: 9px;
- letter-spacing: 3px;
- color: var(--text-dim);
- text-transform: uppercase;
- white-space: nowrap;
-}
-
-.panel-divider {
- flex: 1;
- height: 1px;
- background: linear-gradient(to right, var(--glass-border), transparent);
-}
-
-.panel-collapse-btn {
- width: 22px;
- height: 22px;
- border-radius: 6px;
- border: 1px solid rgba(255, 255, 255, 0.12);
- background: rgba(255, 255, 255, 0.03);
- color: var(--text-dim);
- font-family: var(--font-mono);
- font-size: 13px;
- line-height: 1;
- cursor: pointer;
- transition:
- background-color var(--transition-fast),
- border-color var(--transition-fast),
- color var(--transition-fast);
-}
-
-.panel-collapse-btn:hover {
- border-color: var(--glass-border-hover);
- color: var(--text-primary);
- background: rgba(255, 255, 255, 0.07);
-}
-
-/* ── Button Grid ──────────────────────────────── */
-.button-grid {
- display: flex;
- gap: 8px;
- overflow-x: auto;
- scroll-behavior: smooth;
- scrollbar-width: none;
- -ms-overflow-style: none;
-}
-
-.button-grid::-webkit-scrollbar {
- display: none;
-}
-
-.style-btn {
- position: relative;
- display: flex;
- flex-direction: column;
- align-items: center;
- gap: 6px;
- padding: 14px 16px 10px;
- min-width: 78px;
- flex-shrink: 0;
- background: rgba(255, 255, 255, 0.03);
- border: 1px solid rgba(255, 255, 255, 0.06);
- border-radius: var(--btn-radius);
- cursor: pointer;
- /* Keep the keyboard focus outline immediate. */
- transition:
- background-color var(--transition-fast),
- border-color var(--transition-fast),
- box-shadow var(--transition-fast),
- color var(--transition-fast),
- transform var(--transition-fast);
- overflow: hidden;
- outline: none;
-}
-
-/* Keep keyboard focus visible inside the scrolling preset row. */
-.style-btn:focus-visible {
- outline: 2px solid var(--text-primary);
- outline-offset: -3px;
-}
-
-.style-btn::before {
- content: '';
- position: absolute;
- inset: 0;
- background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, transparent 100%);
- opacity: 0;
- transition: opacity var(--transition-fast);
-}
-
-.style-btn:hover {
- border-color: var(--glass-border-hover);
- background: rgba(255, 255, 255, 0.06);
- transform: translateY(-1px);
-}
-
-.style-btn:hover::before {
- opacity: 1;
-}
-
-.style-btn:active {
- transform: translateY(0);
-}
-
-.style-btn.active {
- border-color: var(--accent);
- background: var(--accent-dim);
- box-shadow:
- 0 0 20px rgba(0, 212, 255, 0.15),
- 0 0 0 1px rgba(0, 212, 255, 0.1) inset;
-}
-
-.style-btn.active .btn-icon {
- color: var(--accent);
- text-shadow: 0 0 12px var(--accent-glow);
-}
-
-.style-btn.active .btn-label {
- color: var(--text-primary);
-}
-
-.btn-icon {
- font-size: 20px;
- line-height: 1;
- color: var(--text-secondary);
- transition:
- color var(--transition-fast),
- text-shadow var(--transition-fast);
-}
-
-.btn-label {
- font-family: var(--font-sans);
- font-size: 11px;
- font-weight: 500;
- color: var(--text-secondary);
- letter-spacing: 0.3px;
- transition: color var(--transition-fast);
-}
-
-.btn-key {
- position: absolute;
- top: 6px;
- right: 6px;
- font-family: var(--font-mono);
- font-size: 8px;
- color: var(--text-dim);
- opacity: 0;
- transition: opacity var(--transition-fast);
-}
-
-.style-btn:hover .btn-key,
-.style-btn.active .btn-key {
- opacity: 1;
-}
-
-/* ── Loading Screen ───────────────────────────── */
-#loading-screen {
- position: fixed;
- inset: 0;
- z-index: 1000;
- background: var(--bg-dark);
- display: flex;
- align-items: center;
- justify-content: center;
- transition: opacity 0.8s ease, visibility 0.8s ease;
-}
-
-#loading-screen.hidden {
- opacity: 0;
- visibility: hidden;
- pointer-events: none;
-}
-
-.loader-content {
- text-align: center;
-}
-
-.loader-logo {
- display: block;
- width: 128px;
- height: auto;
- margin: 0 auto 24px;
- filter: drop-shadow(0 0 24px rgba(0, 246, 255, 0.42));
- animation: logo-pulse 2s ease-in-out infinite;
-}
-
-@keyframes logo-pulse {
- 0%, 100% { opacity: 0.72; transform: scale(0.98); }
- 50% { opacity: 1; transform: scale(1.02); }
-}
-
-.loader-content h2 {
- font-family: var(--font-mono);
- font-size: 18px;
- font-weight: 600;
- letter-spacing: 6px;
- color: var(--text-primary);
- margin-bottom: 12px;
-}
-
-.loader-status {
- font-family: var(--font-mono);
- font-size: 11px;
- letter-spacing: 2px;
- color: var(--text-dim);
- animation: pulse 2s ease-in-out infinite;
-}
-
-@keyframes pulse {
- 0%, 100% { opacity: 0.4; }
- 50% { opacity: 1; }
-}
-
-/* ── Post-Processing Toggles ─────────────────── */
-#pp-toggles {
- --pp-expanded-width: var(--display-panel-expanded-width);
- position: relative;
- z-index: 110;
- width: var(--pp-expanded-width);
- max-width: 100%;
- display: flex;
- flex-direction: column;
- align-items: flex-end;
- gap: 7px;
-}
-
-#pp-toggles:not(.collapsed) {
- box-sizing: border-box;
- padding: 8px;
- border: 1px solid var(--glass-border);
- border-radius: var(--panel-radius);
- background: var(--glass-bg);
- box-shadow: 0 8px 32px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.04);
- backdrop-filter: blur(24px) saturate(1.4);
- -webkit-backdrop-filter: blur(24px) saturate(1.4);
-}
-
-#pp-toggles:not(.collapsed) > .pp-header-row,
-#pp-toggles:not(.collapsed) > .pp-toggle-group,
-#pp-toggles:not(.collapsed) > #clean-view-toggle {
- width: 100%;
-}
-
-.pp-toggle-btn {
- display: flex;
- align-items: center;
- gap: 5px;
- padding: 7px 12px;
- background: var(--glass-bg);
- border: 1px solid var(--glass-border);
- border-radius: 8px;
- backdrop-filter: blur(16px);
- -webkit-backdrop-filter: blur(16px);
- cursor: pointer;
- transition:
- background-color var(--transition-fast),
- border-color var(--transition-fast),
- box-shadow var(--transition-fast),
- color var(--transition-fast),
- border-radius var(--transition-fast);
- outline: none;
-}
-
-.pp-toggle-group {
- width: var(--pp-expanded-width);
- max-width: 100%;
-}
-
-#pp-toggles .pp-toggle-btn {
- width: 100%;
- min-height: 38px;
- box-sizing: border-box;
-}
-
-#pp-toggles .pp-header-row {
- width: var(--pp-expanded-width);
- max-width: 100%;
- min-height: 42px;
- box-sizing: border-box;
- margin-left: auto;
- margin-bottom: 0;
- padding: 8px 10px 8px 14px;
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 8px;
- border: 1px solid var(--glass-border);
- border-radius: var(--panel-radius);
- background: var(--glass-bg);
- box-shadow: 0 8px 32px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.04);
- backdrop-filter: blur(24px) saturate(1.4);
- -webkit-backdrop-filter: blur(24px) saturate(1.4);
- cursor: default;
-}
-
-/* Expanded Display already owns the glass shell. Keep its header visually
- * integrated with that container, matching the other expanded panel headers;
- * the collapsed launcher retains the standalone card treatment above. */
-#pp-toggles:not(.collapsed) > .pp-header-row {
- min-height: 32px;
- padding: 0 4px;
- border: 0;
- border-radius: 0;
- background: transparent;
- box-shadow: none;
- backdrop-filter: none;
- -webkit-backdrop-filter: none;
-}
-
-#pp-toggles .pp-header-label {
- font-family: var(--font-mono);
- font-size: 8px;
- letter-spacing: 1.4px;
- color: var(--text-dim);
-}
-
-#pp-toggles > .pp-header-row .pp-collapse-btn {
- width: 20px;
- height: 20px;
- border-radius: 6px;
- font-size: 12px;
- padding: 0;
-}
-
-#pp-toggles.collapsed {
- gap: 0;
-}
-
-#pp-toggles.collapsed .pp-header-row {
- width: var(--right-collapsed-width, 132px);
-}
-
-#pp-toggles.collapsed .pp-toggle-group,
-#pp-toggles.collapsed #clean-view-toggle,
-#pp-toggles.collapsed #param-slider-panel {
- display: none;
-}
-
-.pp-toggle-btn:hover {
- border-color: var(--glass-border-hover);
- background: rgba(255, 255, 255, 0.06);
-}
-
-.pp-toggle-btn.active {
- border-color: var(--accent);
- background: var(--accent-dim);
- box-shadow: 0 0 12px rgba(0, 212, 255, 0.15);
-}
-
-.pp-icon {
- font-size: 14px;
- line-height: 1;
-}
-
-.pp-icon.material-symbols-outlined {
- width: 14px;
- overflow: hidden;
- font-family: 'Material Symbols Outlined';
- font-size: 14px;
- font-weight: 400;
- font-style: normal;
- font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
-}
-
-.pp-label {
- font-family: var(--font-mono);
- font-size: 9px;
- letter-spacing: 1.5px;
- color: var(--text-secondary);
- text-transform: uppercase;
-}
-
-.pp-toggle-btn.active .pp-label {
- color: var(--accent);
-}
-
-/* ── Bloom Slider (inline with toggle) ───────── */
-.pp-toggle-group {
- display: flex;
- flex-direction: column;
- gap: 0;
-}
-
-.pp-slider-row {
- display: none;
- align-items: center;
- gap: 6px;
- padding: 5px 10px 6px;
- background: var(--glass-bg);
- border: 1px solid var(--glass-border);
- border-top: none;
- border-radius: 0 0 8px 8px;
- backdrop-filter: blur(16px);
- -webkit-backdrop-filter: blur(16px);
-}
-
-.pp-slider-row.visible {
- display: flex;
-}
-
-.pp-toggle-group .pp-slider-row.visible ~ .pp-toggle-btn,
-.pp-toggle-group:has(.pp-slider-row.visible) .pp-toggle-btn {
- border-radius: 8px 8px 0 0;
-}
-
-.pp-slider {
- flex: 1;
- -webkit-appearance: none;
- appearance: none;
- height: 3px;
- background: rgba(255, 255, 255, 0.08);
- border-radius: 2px;
- outline: none;
- cursor: pointer;
- min-width: 60px;
-}
-
-.pp-slider::-webkit-slider-thumb {
- -webkit-appearance: none;
- appearance: none;
- width: 10px;
- height: 10px;
- border-radius: 50%;
- background: var(--accent);
- box-shadow: 0 0 6px var(--accent-glow);
- cursor: pointer;
-}
-
-.pp-slider::-moz-range-thumb {
- width: 10px;
- height: 10px;
- border-radius: 50%;
- background: var(--accent);
- border: none;
- box-shadow: 0 0 6px var(--accent-glow);
- cursor: pointer;
-}
-
-.pp-slider-value {
- font-family: var(--font-mono);
- font-size: 9px;
- letter-spacing: 0.5px;
- color: var(--accent);
- min-width: 28px;
- text-align: right;
- flex-shrink: 0;
-}
-
-/* Quantitative companion sliders share Display / Sharpen's visible rail,
- * circular thumb, glow, and value treatment while retaining a taller hit area. */
-.gev-quantitative-slider {
- width: 100%;
- min-width: 0;
- height: 18px;
- margin: 0;
- -webkit-appearance: none;
- appearance: none;
- background: transparent;
- outline: none;
- cursor: pointer;
-}
-.gev-quantitative-slider::-webkit-slider-runnable-track {
- height: 3px;
- border-radius: 2px;
- background: rgba(255, 255, 255, 0.08);
-}
-.gev-quantitative-slider::-webkit-slider-thumb {
- width: 10px;
- height: 10px;
- margin-top: -3.5px;
- border: 0;
- border-radius: 50%;
- -webkit-appearance: none;
- appearance: none;
- background: var(--accent);
- box-shadow: 0 0 6px var(--accent-glow);
- cursor: pointer;
-}
-.gev-quantitative-slider::-moz-range-track,
-.gev-quantitative-slider::-moz-range-progress {
- height: 3px;
- border: 0;
- border-radius: 2px;
- background: rgba(255, 255, 255, 0.08);
-}
-.gev-quantitative-slider::-moz-range-thumb {
- width: 10px;
- height: 10px;
- border: 0;
- border-radius: 50%;
- background: var(--accent);
- box-shadow: 0 0 6px var(--accent-glow);
- cursor: pointer;
-}
-.gev-quantitative-slider:focus-visible {
- border-radius: 4px;
- outline: 1px solid color-mix(in srgb, var(--accent) 80%, transparent);
- outline-offset: 2px;
-}
-.gev-quantitative-slider:disabled {
- opacity: .42;
- cursor: not-allowed;
-}
-.gev-slider-value {
- min-width: 28px;
- color: var(--accent);
- font-family: var(--font-mono);
- font-size: 9px;
- letter-spacing: .5px;
- text-align: right;
- flex-shrink: 0;
-}
-
-.pp-slider-mini-label {
- font-family: var(--font-mono);
- font-size: 8px;
- letter-spacing: 1px;
- color: var(--text-dim);
- text-transform: uppercase;
- white-space: nowrap;
-}
-
-.detection-slider-row {
- min-width: 170px;
- padding: 5px 8px 6px;
-}
-
-#detection-slider-row.visible,
-#detection-allocation-row.visible,
-#detection-fade-row.visible {
- border-radius: 0;
-}
-
-.detection-allocation-row {
- min-width: 170px;
- padding: 5px 8px 6px;
-}
-
-.detection-fade-row,
-.detection-opacity-row {
- min-width: 170px;
- padding: 5px 8px 6px;
-}
-
-.detection-allocation-seg .pp-mode-btn {
- font-size: 8px;
- letter-spacing: 0.35px;
-}
-
-#hud-layout-row {
- min-width: 200px;
-}
-
-/* Map Source tiles live with Visual Presets in the bottom command tray. */
-.map-source-section {
- display: grid;
- gap: 6px;
- margin-top: 8px;
- padding-top: 8px;
- border-top: 1px solid rgba(123, 189, 211, 0.18);
-}
-
-.map-source-heading {
- display: flex;
- align-items: center;
- justify-content: space-between;
- color: rgba(190, 221, 230, 0.62);
- font-family: var(--font-mono);
- font-size: 8px;
- letter-spacing: 1.35px;
-}
-
-.map-stack-chip-row {
- display: grid;
- grid-template-columns: repeat(5, minmax(0, 1fr));
- gap: 4px;
-}
-
-.map-stack-chip {
- display: inline-flex;
- align-items: baseline;
- justify-content: center;
- gap: 4px;
- padding: 4px 7px;
- font-family: var(--font-mono);
- font-size: 9px;
- letter-spacing: 0.6px;
- text-transform: uppercase;
- white-space: nowrap;
- color: var(--text-dim);
- background: rgba(255, 255, 255, 0.04);
- border: 1px solid rgba(255, 255, 255, 0.08);
- border-radius: 4px;
- cursor: pointer;
- /* Explicit property list, NOT `transition: all`: `all` animates
- `outline-width` off the `outline: none` base, and Chrome leaves that
- transition parked at 0px for chips on a wrapped line — the keyboard ring
- silently never appeared on rows 2 and 3. A focus indicator should be
- instant anyway. */
- transition:
- color var(--transition-fast),
- background-color var(--transition-fast),
- border-color var(--transition-fast),
- box-shadow var(--transition-fast);
- outline: none;
-}
-
-#command-dock #control-panel.collapsed .map-source-section {
- display: none;
-}
-
-@media (max-width: 620px) {
- .map-stack-chip-row {
- grid-template-columns: repeat(3, minmax(0, 1fr));
- }
-}
-
-/* Order matters, and matches `.data-toggle-btn`: hover/focus, then active, then
- disabled — all at the same specificity, so the later rule wins. Hovering the
- active chip must not wash the cyan out, and a disabled chip must not light up
- under the cursor. Do not add `:not(...)` here: it would raise specificity and
- let hover beat `.active` again. */
-.map-stack-chip:hover,
-.map-stack-chip:focus-visible {
- border-color: var(--glass-border-hover);
- background: rgba(255, 255, 255, 0.06);
- color: var(--text-primary);
-}
-
-/* The keyboard ring is an `outline`, a property NO other chip-state rule sets,
- so it survives on the active chip — whose `.active` rule legitimately wins
- the color/border/background/box-shadow it shares with the rule above. Without
- this, tabbing onto the active chip produced no visible change at all. */
-.map-stack-chip:focus-visible {
- outline: 1px solid color-mix(in srgb, var(--accent) 80%, transparent);
- outline-offset: 2px;
-}
-
-.map-stack-chip.active {
- color: var(--accent);
- border-color: var(--accent);
- background: var(--accent-dim);
- box-shadow: 0 0 10px rgba(0, 212, 255, 0.15);
-}
-
-.map-stack-chip.unavailable,
-.map-stack-chip[aria-disabled='true'] {
- color: rgba(232, 234, 237, 0.28);
- border-color: rgba(255, 255, 255, 0.08);
- background: rgba(255, 255, 255, 0.02);
- cursor: not-allowed;
-}
-
-.map-stack-chip-req {
- font-size: 7px;
- letter-spacing: 0.3px;
- color: rgba(232, 234, 237, 0.28);
-}
-
-.pp-stack-status {
- min-width: 42px;
- max-width: 54px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- font-family: var(--font-mono);
- font-size: 9px;
- letter-spacing: 0.8px;
- color: var(--accent);
- text-align: center;
- text-transform: uppercase;
-}
-
-.pp-stack-status.warn {
- color: #ffb84d;
-}
-
-.pp-select {
- flex: 1;
- min-width: 0;
- height: 24px;
- background: rgba(255, 255, 255, 0.06);
- border: 1px solid rgba(255, 255, 255, 0.14);
- border-radius: 6px;
- color: var(--text-primary);
- font-family: var(--font-mono);
- font-size: 10px;
- letter-spacing: 0.6px;
- padding: 2px 6px;
- outline: none;
-}
-
-/* Proximity / All segmented control under the 3D toggle */
-#models3d-mode-row { min-width: 184px; }
-.pp-mode-seg {
- display: flex;
- flex: 1;
- border: 1px solid rgba(255, 255, 255, 0.14);
- border-radius: 6px;
- overflow: hidden;
-}
-.pp-mode-btn {
- flex: 1;
- height: 22px;
- background: rgba(255, 255, 255, 0.04);
- border: none;
- color: var(--text-dim);
- font-family: var(--font-mono);
- font-size: 9px;
- letter-spacing: 0.6px;
- text-transform: uppercase;
- cursor: pointer;
- transition: background-color var(--transition-fast), color var(--transition-fast);
-}
-.pp-mode-btn + .pp-mode-btn { border-left: 1px solid rgba(255, 255, 255, 0.14); }
-.pp-mode-btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); }
-.pp-mode-btn.active { background: var(--accent); color: #000; }
-
-/* These controls also move into Cockpit Display; keep focus on the control
- itself and inside clipped button groups, independent of selection color. */
-.pp-toggle-btn:focus-visible,
-.pp-select:focus-visible,
-.pp-mode-btn:focus-visible {
- outline: 2px solid var(--text-primary);
- outline-offset: -3px;
-}
-
-.pp-mode-btn:focus-visible {
- box-shadow: inset 0 0 0 4px #061014;
-}
-
-.pp-slider:focus-visible,
-.param-slider:focus-visible {
- outline: 2px solid var(--text-primary);
- outline-offset: 4px;
-}
-
-#clean-view-toggle {
- width: var(--pp-expanded-width);
-}
-
-#clean-view-exit {
- position: fixed;
- top: 18px;
- right: 50%;
- transform: translateX(50%);
- z-index: 300;
- border-radius: 999px;
- border: 1px solid rgba(255, 255, 255, 0.25);
- background: rgba(8, 10, 14, 0.88);
- color: #d9f7ff;
- font-family: var(--font-mono);
- font-size: 10px;
- letter-spacing: 1.8px;
- padding: 8px 14px;
- cursor: pointer;
- display: none;
-}
-
-body.ui-clean-view #clean-view-exit {
- display: inline-flex;
-}
-
-body.ui-clean-view #title-bar,
-body.ui-clean-view #style-indicator,
-body.ui-clean-view #top-center-actions,
-body.ui-clean-view #global-loading-status,
-body.ui-clean-view #traffic-sync-chip,
-body.ui-clean-view #cctv-sync-chip,
-body.ui-clean-view #pp-toggles,
-body.ui-clean-view #param-slider-panel,
-body.ui-clean-view #control-panel,
-body.ui-clean-view #location-bar,
-body.ui-clean-view #data-panel,
-body.ui-clean-view #cctv-panel,
-body.ui-clean-view #radio-panel,
-body.ui-clean-view #global-context-panel,
-body.ui-clean-view #scene-panel {
- opacity: 0 !important;
- visibility: hidden !important;
- pointer-events: none !important;
-}
-
-body.ui-clean-view #scene-runtime.active {
- opacity: 1;
- visibility: visible;
-}
-
-/* ── Detection Toggle States ─────────────────── */
-#detection-toggle.active {
- border-color: rgba(0, 255, 80, 0.6);
- background: rgba(0, 255, 80, 0.1);
- box-shadow: 0 0 12px rgba(0, 255, 80, 0.15);
-}
-
-#detection-toggle.active .pp-label {
- color: rgba(0, 255, 80, 0.9);
-}
-
-#detection-toggle.active .pp-icon {
- color: rgba(0, 255, 80, 0.9);
- text-shadow: 0 0 6px rgba(0, 255, 80, 0.5);
-}
-
-#detection-toggle.panoptic,
-#detection-toggle.god {
- border-color: rgba(0, 255, 80, 0.8);
- background: rgba(0, 255, 80, 0.18);
- box-shadow: 0 0 16px rgba(0, 255, 80, 0.25);
- animation: detection-pulse 2s ease-in-out infinite;
-}
-
-@keyframes detection-pulse {
- 0%, 100% { box-shadow: 0 0 12px rgba(0, 255, 80, 0.15); }
- 50% { box-shadow: 0 0 22px rgba(0, 255, 80, 0.35); }
-}
-
-/* ── Parameter Slider Panel ──────────────────── */
-#param-slider-panel {
- display: none;
- position: relative;
- top: auto;
- right: auto;
- left: auto;
- bottom: auto;
- z-index: 95;
- width: 100%;
- max-height: min(38vh, 360px);
- box-sizing: border-box;
- overflow-y: auto;
- scrollbar-width: none;
- -ms-overflow-style: none;
- background: var(--glass-bg);
- border: 1px solid var(--glass-border);
- border-radius: 12px;
- padding: 14px 16px;
- backdrop-filter: blur(24px) saturate(1.4);
- -webkit-backdrop-filter: blur(24px) saturate(1.4);
- box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
- opacity: 0;
- visibility: hidden;
- transform: translateY(6px);
- transition: opacity var(--transition-smooth), visibility var(--transition-smooth), transform var(--transition-smooth);
-}
-
-#param-slider-panel::-webkit-scrollbar {
- display: none;
-}
-
-#param-slider-panel.active {
- display: block;
- opacity: 1;
- visibility: visible;
- transform: translateY(0);
-}
-
-/* Display owns the constrained desktop scroll surface. Keeping Parameters as
- * a second scroll container traps wheel/touch input at its boundary and lets
- * the flex column compress newly added preset rows below the visible panel. */
-#pp-toggles:not(.collapsed) > #param-slider-panel.active {
- flex: 0 0 auto;
- max-height: none;
- overflow-y: visible;
-}
-
-.param-panel-header {
- display: flex;
- align-items: center;
- gap: 10px;
- margin-bottom: 12px;
-}
-
-.param-panel-title {
- font-family: var(--font-mono);
- font-size: 8px;
- letter-spacing: 2.5px;
- color: var(--text-dim);
- text-transform: uppercase;
- white-space: nowrap;
-}
-
-.param-panel-divider {
- flex: 1;
- height: 1px;
- background: linear-gradient(to right, var(--glass-border), transparent);
-}
-
-#param-slider-panel:not(.collapsed) .param-panel-divider {
- background: linear-gradient(90deg, rgb(0 212 255 / 28%), rgba(0, 212, 255, 0.18) 58%, transparent);
-}
-
-.param-slider-row {
- display: flex;
- align-items: center;
- gap: 10px;
- margin-bottom: 10px;
-}
-
-.param-slider-row:last-child {
- margin-bottom: 0;
-}
-
-.param-label {
- font-family: var(--font-mono);
- font-size: 9px;
- letter-spacing: 1px;
- color: var(--text-secondary);
- min-width: 72px;
- flex-shrink: 0;
-}
-
-.param-slider {
- flex: 1;
- min-width: 0;
- -webkit-appearance: none;
- appearance: none;
- height: 3px;
- background: rgba(255, 255, 255, 0.08);
- border-radius: 2px;
- outline: none;
- cursor: pointer;
-}
-
-.param-slider::-webkit-slider-thumb {
- -webkit-appearance: none;
- appearance: none;
- width: 12px;
- height: 12px;
- border-radius: 50%;
- background: var(--accent);
- box-shadow: 0 0 6px var(--accent-glow);
- cursor: pointer;
- transition: box-shadow var(--transition-fast);
-}
-
-.param-slider::-webkit-slider-thumb:hover {
- box-shadow: 0 0 12px var(--accent-glow);
-}
-
-.param-slider::-moz-range-thumb {
- width: 12px;
- height: 12px;
- border-radius: 50%;
- background: var(--accent);
- border: none;
- box-shadow: 0 0 6px var(--accent-glow);
- cursor: pointer;
-}
-
-.param-value {
- font-family: var(--font-mono);
- font-size: 10px;
- letter-spacing: 0.5px;
- color: var(--accent);
- min-width: 32px;
- text-align: right;
- flex-shrink: 0;
-}
-
-/* ── Location Bar ────────────────────────────── */
-#location-bar {
- position: fixed;
- bottom: 130px;
- left: 50%;
- transform: translateX(-50%);
- z-index: 100;
- width: auto;
- max-width: 720px;
-}
-
-#location-bar .panel-glow {
- position: absolute;
- inset: -20px;
- background: radial-gradient(ellipse at center, var(--accent-dim) 0%, transparent 60%);
- filter: blur(20px);
- opacity: 0.25;
- pointer-events: none;
-}
-
-.location-inner {
- position: relative;
- display: flex;
- flex-direction: column;
- background: var(--glass-bg);
- border: 1px solid var(--glass-border);
- border-radius: 12px;
- padding: 8px 12px;
- backdrop-filter: blur(24px) saturate(1.4);
- -webkit-backdrop-filter: blur(24px) saturate(1.4);
- box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
-}
-
-.location-toolbar {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-bottom: 6px;
- padding: 0 4px;
-}
-
-.location-toolbar-label {
- font-family: var(--font-mono);
- font-size: 8px;
- letter-spacing: 2px;
- color: var(--text-dim);
-}
-
-.location-mini-status {
- display: none;
- gap: 2px;
- padding: 0 4px 4px;
-}
-
-#location-bar.collapsed .location-mini-status {
- display: grid;
-}
-
-.location-mini-city {
- font-family: var(--font-mono);
- font-size: 9px;
- letter-spacing: 0.8px;
- color: #bdefff;
-}
-
-.location-mini-poi {
- font-family: var(--font-mono);
- font-size: 8px;
- letter-spacing: 1px;
- color: var(--text-secondary);
- max-width: 190px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-.location-pills {
- display: flex;
- gap: 6px;
- overflow-x: auto;
- scroll-behavior: smooth;
- scrollbar-width: none;
- -ms-overflow-style: none;
-}
-
-.location-pills::-webkit-scrollbar {
- display: none;
-}
-
-.location-pill {
- padding: 6px 14px;
- background: rgba(255, 255, 255, 0.04);
- border: 1px solid rgba(255, 255, 255, 0.08);
- border-radius: 20px;
- cursor: pointer;
- transition:
- background-color var(--transition-fast),
- border-color var(--transition-fast),
- box-shadow var(--transition-fast),
- color var(--transition-fast),
- transform var(--transition-fast);
- outline: none;
- white-space: nowrap;
- font-family: var(--font-sans);
- font-size: 11px;
- font-weight: 500;
- color: var(--text-secondary);
- letter-spacing: 0.3px;
-}
-
-.location-pill:focus-visible,
-.poi-pill:focus-visible,
-.search-toggle-btn:focus-visible,
-#location-search:focus-visible {
- outline: 2px solid var(--text-primary);
- outline-offset: -3px;
-}
-
-.location-pill:hover {
- background: rgba(255, 255, 255, 0.08);
- border-color: var(--glass-border-hover);
- transform: translateY(-1px);
-}
-
-.location-pill.active {
- background: var(--accent-dim);
- border-color: var(--accent);
- color: var(--accent);
- box-shadow: 0 0 12px rgba(0, 212, 255, 0.15);
-}
-
-/* ── Expandable POI Row ──────────────────────── */
-.poi-row-container {
- display: flex;
- gap: 6px;
- justify-content: center;
- max-height: 0;
- overflow: hidden;
- opacity: 0;
- transition: max-height 250ms cubic-bezier(0.4, 0, 0.2, 1),
- opacity 200ms ease,
- padding 250ms cubic-bezier(0.4, 0, 0.2, 1);
- padding: 0 4px;
-}
-
-.poi-row-container.expanded {
- max-height: 50px;
- opacity: 1;
- padding: 4px 4px 0;
-}
-
-.location-bar-divider {
- height: 0;
- border: none;
- border-top: 1px solid var(--glass-border);
- margin: 0 4px;
- opacity: 0;
- transition: opacity 200ms ease, margin 250ms ease;
-}
-
-.location-bar-divider.visible {
- opacity: 1;
- margin: 6px 4px;
-}
-
-.location-city-row {
- display: flex;
- align-items: center;
- gap: 8px;
-}
-
-.poi-pill {
- display: inline-flex;
- align-items: center;
- gap: 6px;
- padding: 5px 12px;
- background: rgba(255, 255, 255, 0.04);
- border: 1px solid rgba(255, 255, 255, 0.08);
- border-radius: 20px;
- cursor: pointer;
- transition:
- background-color var(--transition-fast),
- border-color var(--transition-fast),
- box-shadow var(--transition-fast),
- color var(--transition-fast),
- transform var(--transition-fast);
- outline: none;
- white-space: nowrap;
- flex-shrink: 0;
-}
-
-.poi-pill:hover {
- background: rgba(255, 255, 255, 0.08);
- border-color: var(--glass-border-hover);
- transform: translateY(-1px);
-}
-
-.poi-pill.active {
- background: var(--accent-dim);
- border-color: var(--accent);
- box-shadow: 0 0 12px rgba(0, 212, 255, 0.15);
-}
-
-.poi-pill-name {
- font-family: var(--font-sans);
- font-size: 10px;
- font-weight: 500;
- color: var(--text-secondary);
- letter-spacing: 0.3px;
-}
-
-.poi-pill.active .poi-pill-name {
- color: var(--accent);
-}
-
-.poi-pill-key {
- font-family: var(--font-mono);
- font-size: 8px;
- letter-spacing: 1px;
- color: var(--text-dim);
- background: rgba(255, 255, 255, 0.06);
- padding: 2px 5px;
- border-radius: 3px;
- flex-shrink: 0;
-}
-
-.poi-pill.active .poi-pill-key {
- color: var(--accent);
- background: rgba(0, 212, 255, 0.12);
-}
-
-/* ── Location Search ─────────────────────────── */
-.location-search-wrap {
- display: flex;
- align-items: center;
- gap: 0;
- flex-shrink: 0;
-}
-
-.search-toggle-btn {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 32px;
- height: 32px;
- background: rgba(255, 255, 255, 0.04);
- border: 1px solid rgba(255, 255, 255, 0.08);
- border-radius: 50%;
- cursor: pointer;
- transition:
- background-color var(--transition-fast),
- border-color var(--transition-fast),
- box-shadow var(--transition-fast),
- color var(--transition-fast);
- outline: none;
- font-size: 14px;
- flex-shrink: 0;
-}
-
-.search-toggle-btn:hover {
- background: rgba(255, 255, 255, 0.08);
- border-color: var(--glass-border-hover);
-}
-
-#location-search {
- width: 0;
- padding: 0;
- border: none;
- background: none;
- outline: none;
- color: var(--text-primary);
- font-family: var(--font-sans);
- font-size: 13px;
- letter-spacing: 0.3px;
- transition: width var(--transition-smooth), padding var(--transition-smooth);
- caret-color: var(--accent);
-}
-
-#location-search.expanded {
- width: 180px;
- padding: 6px 10px;
-}
-
-#location-search::placeholder {
- color: var(--text-dim);
- font-style: italic;
-}
-
-#location-search.searching {
- opacity: 0.5;
-}
-
-/* ── Top-center Globe Actions ────────────────── */
-#top-center-actions {
- position: fixed;
- top: 32px;
- left: 50%;
- z-index: 100;
- display: flex;
- gap: 8px;
- transform: translateX(-50%);
-}
-
-#top-center-actions button {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 36px;
- height: 36px;
- padding: 0;
- background: var(--glass-bg);
- border: 1px solid var(--glass-border);
- border-radius: 50%;
- color: var(--text-secondary);
- backdrop-filter: blur(16px);
- -webkit-backdrop-filter: blur(16px);
- cursor: pointer;
- transition:
- background-color var(--transition-fast),
- border-color var(--transition-fast),
- color var(--transition-fast),
- opacity var(--transition-fast),
- transform var(--transition-fast);
- outline: none;
-}
-
-#top-center-actions button:hover,
-#top-center-actions button:focus-visible {
- border-color: var(--glass-border-hover);
- background: rgba(255, 255, 255, 0.06);
- transform: scale(1.1);
-}
-
-#top-center-actions button:active {
- transform: scale(0.95);
-}
-
-#top-center-actions button:disabled {
- cursor: wait;
- opacity: 0.55;
- transform: none;
-}
-
-#top-center-actions .material-symbols-outlined {
- font-size: 18px;
-}
-
-#global-loading-status {
- position: fixed;
- top: 74px;
- left: 50%;
- z-index: 102;
- display: inline-flex;
- align-items: center;
- gap: 10px;
- max-width: calc(100vw - 32px);
- padding: 6px 10px;
- border-radius: 7px;
- border: 1px solid rgba(0, 212, 255, 0.24);
- background: rgba(3, 10, 18, 0.78);
- backdrop-filter: blur(14px);
- -webkit-backdrop-filter: blur(14px);
- color: rgba(170, 252, 255, 0.92);
- font-family: var(--font-mono);
- font-size: 8px;
- letter-spacing: 1.35px;
- text-transform: uppercase;
- transform: translateX(-50%);
- box-shadow: 0 8px 24px rgba(0, 0, 0, 0.34), 0 0 14px rgba(0, 212, 255, 0.08);
- pointer-events: none;
-}
-#global-loading-status[hidden] { display: none; }
-#global-loading-label {
- color: rgba(184, 244, 255, 0.92);
-}
-#global-loading-detail {
- min-width: 34px;
- max-width: min(220px, 38vw);
- overflow: hidden;
- color: #00e1ff;
- font-weight: 600;
- letter-spacing: 1.6px;
- text-align: right;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-#global-loading-status:is([data-state='complete'], [data-state='cancelled'], [data-state='error']) {
- justify-content: center;
- text-align: center;
-}
-#global-loading-status:is([data-state='complete'], [data-state='cancelled'], [data-state='error']) #global-loading-detail {
- display: none;
-}
-#global-loading-status[data-state='error'] { border-color: rgba(255, 98, 82, 0.55); color: #ff9b8e; }
-#global-loading-status[data-state='error'] #global-loading-label,
-#global-loading-status[data-state='error'] #global-loading-detail { color: #ff9b8e; }
-#global-loading-status[data-state='cancelled'] { color: #ffd488; }
-#global-loading-status[data-state='retry'] { border-color: rgba(255, 212, 136, 0.55); }
-#global-loading-status[data-state='retry'] #global-loading-label,
-#global-loading-status[data-state='retry'] #global-loading-detail { color: #ffd488; }
-#global-loading-status[data-state='cancelled'] #global-loading-label,
-#global-loading-status[data-state='cancelled'] #global-loading-detail { color: #ffd488; }
-#global-loading-status[data-state='acquiring'] {
- border-color: rgba(0, 212, 255, 0.42);
- box-shadow: 0 8px 24px rgba(0, 0, 0, 0.34), 0 0 18px rgba(0, 212, 255, 0.12);
-}
-
-.share-icon {
- font-size: 16px;
- line-height: 1;
-}
-
-#traffic-sync-chip,
-#cctv-sync-chip {
- position: fixed;
- top: 112px;
- left: 50%;
- transform: translateX(-50%);
- z-index: 101;
- display: inline-flex;
- align-items: center;
- gap: 10px;
- padding: 6px 10px;
- border-radius: 7px;
- border: 1px solid rgba(0, 212, 255, 0.24);
- background: rgba(3, 10, 18, 0.78);
- backdrop-filter: blur(14px);
- -webkit-backdrop-filter: blur(14px);
- color: rgba(170, 252, 255, 0.92);
- font-family: var(--font-mono);
- font-size: 8px;
- letter-spacing: 1.35px;
- text-transform: uppercase;
- opacity: 0;
- pointer-events: none;
- transition: opacity 0.22s ease, transform 0.22s ease;
- box-shadow: 0 8px 24px rgba(0, 0, 0, 0.34), 0 0 14px rgba(0, 212, 255, 0.08);
-}
-
-/* Stacked below the traffic chip so both can show at once */
-#cctv-sync-chip {
- top: 146px;
-}
-
-#traffic-sync-chip.visible,
-#cctv-sync-chip.visible {
- opacity: 1;
- transform: translateX(-50%) translateY(0);
-}
-
-#traffic-sync-label,
-#cctv-sync-label {
- color: rgba(184, 244, 255, 0.92);
-}
-
-#traffic-sync-progress,
-#cctv-sync-progress {
- color: #00e1ff;
- font-weight: 600;
- letter-spacing: 1.6px;
- min-width: 34px;
- text-align: right;
-}
-
-/* The settled traffic chip carries no progress number — the label's coverage
- figure is the honest one. Collapse the empty slot so the chip closes up
- instead of trailing a 34px stub and its flex gap. */
-#traffic-sync-progress:empty {
- display: none;
-}
-
-/* ── Split-flap chip text ─────────────────────────────────────────
- Per-character departure-board flip when a chip label changes.
- Driven entirely by src/splitFlap.js, which rebuilds the label as
- one span per character on the change and strips them again once
- the cascade lands.
-
- The DOM text is the truth and its node never moves. A chip label is
- upgraded once into a permanent shell — a .gev-flap-text span holding
- one long-lived Text node, plus an aria-hidden .gev-flap-cells
- sibling — and from then on a label change is only `node.data = next`.
- During a cascade the host takes .gev-flap-active, which clips the
- real text out of view and lets the cells stand in for it. The cells
- carry no text at all: both glyphs are generated content (::before =
- outgoing, ::after = incoming), and generated content never reaches
- textContent. That is what keeps QA pins and the traffic chip's own
- `textContent !==` guard honest, and it lets the cells be rebuilt
- freely while the aria-live region sees only one characterData
- change per label update.
-
- Motion matches the cockpit odometer roll (.cockpit-roll-token):
- same cubic-bezier, same reduced-motion treatment. Only the
- left-to-right stagger is new — that cascade is what makes it read
- as a Solari board rather than a counter.
- ------------------------------------------------------------------ */
-/* While the flaps play, the real text is clipped out of view but stays in
- the DOM and in the accessibility tree — same clipped-but-present treatment
- as .world-overlay-accessibility. It is never removed or reparented. */
-.gev-flap-host.gev-flap-active > .gev-flap-text {
- position: absolute;
- width: 1px;
- height: 1px;
- padding: 0;
- margin: -1px;
- overflow: hidden;
- clip: rect(0, 0, 0, 0);
- white-space: nowrap;
- border: 0;
-}
-/* Permanent sibling: empty (and so zero-width) whenever no cascade is running. */
-.gev-flap-cells {
- white-space: pre;
-}
-.gev-flap-cell {
- display: inline-block;
- /* Chip labels carry real spaces; a collapsed space would drop a column. */
- white-space: pre;
-}
-/* The incoming glyph is in flow, so it — not any text node — is what gives
- the column its natural width. EVERY column has one, including a column the
- new string does not reach: that one carries a blank, so it holds its width
- and its index for the whole cascade instead of collapsing. Collapsing would
- stack the absolutely-positioned outgoing glyphs on one x and would let a
- later glyph slide into an earlier column. */
-.gev-flap-cell::after {
- content: attr(data-flap-next);
- display: inline-block;
- white-space: pre;
-}
-.gev-flap-cell.is-flapping {
- position: relative;
- /* Relative to the chip's own font size, so the foreshortening reads the
- same on the 8px status chips as it would anywhere else. */
- perspective: 4em;
-}
-.gev-flap-cell.is-flapping::before,
-.gev-flap-cell.is-flapping::after {
- transform-origin: 50% 50%;
- backface-visibility: hidden;
-}
-.gev-flap-cell.is-flapping::after {
- animation: gev-flap-in var(--gev-flap-dur, 190ms)
- cubic-bezier(0.2, 0.75, 0.25, 1) var(--gev-flap-delay, 0ms) both;
-}
-/* Out of flow, so the outgoing glyph overlays its own column without
- affecting layout — one per column, each anchored to its own cell box. */
-.gev-flap-cell.is-flapping::before {
- content: attr(data-flap-prev);
- position: absolute;
- top: 0;
- left: 0;
- white-space: pre;
- animation: gev-flap-out var(--gev-flap-dur, 190ms)
- cubic-bezier(0.2, 0.75, 0.25, 1) var(--gev-flap-delay, 0ms) both;
-}
-/* Length changes are eased, never snapped. A GROWING label reserves its new
- columns the moment the cells go in, so splitFlap.js eases from the previous
- on-screen width to the cascade width at the start. A SHRINKING one holds
- every column for the whole cascade, so its ease runs at SETTLEMENT instead,
- from the cascade width down to the natural width — one smooth transition
- after the flaps have landed, rather than columns collapsing underneath
- them. */
-.gev-flap-sizing {
- display: inline-block;
- transition: width var(--gev-flap-total, 500ms) cubic-bezier(0.2, 0.75, 0.25, 1);
-}
-/* The old leaf hinges down and away on the cell's midline. */
-@keyframes gev-flap-out {
- 0% { transform: rotateX(0deg); opacity: 1; }
- 48% { transform: rotateX(-88deg); opacity: 0.5; }
- 100% { transform: rotateX(-90deg); opacity: 0; }
-}
-/* The new leaf waits for the old one to clear, then drops in and settles
- with a single small overshoot — the mechanical clack. */
-@keyframes gev-flap-in {
- 0% { transform: rotateX(90deg); opacity: 0; }
- 46% { transform: rotateX(90deg); opacity: 0; }
- 78% { transform: rotateX(-7deg); opacity: 1; }
- 100% { transform: rotateX(0deg); opacity: 1; }
-}
-/* Matches the .cockpit-roll-track treatment: collapse the duration rather
- than dropping the animation, so the final frame still lands the glyph.
- src/splitFlap.js also checks the query and takes the instant path, so
- this is the belt to that braces. */
-@media (prefers-reduced-motion: reduce) {
- .gev-flap-cell.is-flapping::before,
- .gev-flap-cell.is-flapping::after {
- animation-duration: 1ms;
- animation-delay: 0ms;
- }
- .gev-flap-sizing {
- transition-duration: 1ms;
- }
-}
-
-/* ── Toast Notification ──────────────────────── */
-#toast {
- position: fixed;
- bottom: 100px;
- left: 50%;
- transform: translateX(-50%) translateY(20px);
- z-index: 200;
- padding: 10px 24px;
- background: var(--glass-bg);
- border: 1px solid var(--accent);
- border-radius: 8px;
- backdrop-filter: blur(16px);
- -webkit-backdrop-filter: blur(16px);
- font-family: var(--font-mono);
- font-size: 11px;
- letter-spacing: 2px;
- color: var(--accent);
- text-transform: uppercase;
- opacity: 0;
- visibility: hidden;
- pointer-events: none;
- transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
- box-shadow: 0 0 20px rgba(0, 212, 255, 0.15);
-}
-
-#toast.visible {
- opacity: 1;
- visibility: visible;
- transform: translateX(-50%) translateY(0);
-}
-
-/* ── Aircraft Cockpit View ─────────────────── */
-#cockpit-entry {
- position: fixed;
- left: calc(50% + 270px);
- bottom: 34px;
- z-index: 151;
- display: inline-flex;
- align-items: center;
- gap: 8px;
- min-height: 38px;
- padding: 0 12px;
- border: 1px solid rgba(0, 220, 255, 0.5);
- border-radius: 8px;
- background: rgba(2, 12, 18, 0.9);
- color: #dceeff;
- font: 600 10px/1 var(--font-mono);
- letter-spacing: 0.14em;
- box-shadow: 0 0 18px rgba(0, 220, 255, 0.14);
- cursor: pointer;
-}
-
-#cockpit-entry[hidden], #cockpit-hud[hidden] { display: none; }
-#cockpit-entry:hover, #cockpit-entry:focus-visible {
- border-color: #00dcff;
- color: #fff;
- outline: none;
-}
-#cockpit-entry .material-symbols-outlined { color: #00dcff; font-size: 18px; }
-#cockpit-entry kbd {
- padding: 3px 5px;
- border: 1px solid rgba(220, 238, 255, 0.25);
- border-radius: 4px;
- color: rgba(220, 238, 255, 0.6);
- font: inherit;
-}
-
-#cockpit-hud {
- --cockpit-accent: #00dcff;
- --cockpit-side-panel-width: min(340px, 28vw);
- /* HUD bottom offset + tallest scaled telemetry block + 20px clear border. */
- --cockpit-bottom-rail-safe: calc(clamp(84px, 11vh, 118px) + 100px);
- position: fixed;
- inset: 0;
- z-index: 145;
- overflow: hidden;
- pointer-events: none;
- color: #f4fbff;
- font-family: var(--font-mono);
- text-shadow: 0 0 10px color-mix(in srgb, var(--cockpit-accent) 60%, transparent), 0 1px 2px #000;
- perspective: 920px;
-}
-#cockpit-hud[data-layer="military"] { --cockpit-accent: #ffb800; }
-.cockpit-visor-shell {
- position: absolute;
- inset: clamp(62px, 9vh, 90px) clamp(18px, 3vw, 48px) clamp(38px, 5vh, 56px);
- transform-style: preserve-3d;
- perspective: 880px;
-}
-.cockpit-roll-arc {
- position: absolute;
- top: 2px;
- left: 50%;
- width: min(620px, 56vw);
- height: 96px;
- transform: translateX(-50%) rotateX(-8deg);
- transform-style: preserve-3d;
-}
-.cockpit-roll-arc::after {
- content: '';
- position: absolute;
- inset: 18px 6% 0;
- border-top: 1px solid color-mix(in srgb, var(--cockpit-accent) 62%, transparent);
- border-radius: 50%;
- opacity: 0.72;
-}
-.cockpit-roll-arc span {
- position: absolute;
- left: 50%;
- top: 0;
- color: rgba(244, 251, 255, 0.46);
- font-size: 8px;
- letter-spacing: 0.1em;
- transform:
- translateX(calc(-50% + (var(--slot) * 74px)))
- translateY(calc(var(--depth) * 9px))
- rotateZ(calc(var(--slot) * 4deg))
- rotateY(calc(var(--slot) * -5deg));
-}
-.cockpit-roll-arc span::after {
- content: '';
- display: block;
- width: 1px;
- height: calc(11px + (3 - var(--depth)) * 2px);
- margin: 5px auto 0;
- background: color-mix(in srgb, var(--cockpit-accent) 62%, transparent);
-}
-.cockpit-roll-arc span.active { color: #fff; font-size: 10px; }
-.cockpit-pitch-rail {
- position: absolute;
- top: 25%;
- bottom: 21%;
- display: grid;
- grid-template-rows: repeat(5, 1fr);
- align-items: center;
- color: rgba(244, 251, 255, 0.38);
- font-size: 8px;
- letter-spacing: 0.08em;
- transform-style: preserve-3d;
-}
-.cockpit-pitch-rail-left {
- left: clamp(190px, 22vw, 330px);
- text-align: right;
- transform: rotateY(24deg) translateZ(-18px);
-}
-.cockpit-pitch-rail-right {
- right: clamp(190px, 22vw, 330px);
- text-align: left;
- transform: rotateY(-24deg) translateZ(-18px);
-}
-body.cockpit-mode:has(#left-panel-stack > .panel-collapsible:not(.collapsed)) .cockpit-pitch-rail-left {
- opacity: 0;
- transition: opacity 0.25s;
-}
-.cockpit-pitch-rail span {
- display: flex;
- align-items: center;
- gap: 7px;
-}
-.cockpit-pitch-rail-left span { justify-content: flex-end; }
-.cockpit-pitch-rail span::after {
- content: '';
- width: 24px;
- border-top: 1px solid color-mix(in srgb, var(--cockpit-accent) 46%, transparent);
-}
-.cockpit-pitch-rail-right span::after { order: -1; }
-.cockpit-pitch-rail span.active { color: var(--cockpit-accent); }
-.cockpit-pitch-rail span.active::after { width: 42px; border-color: var(--cockpit-accent); }
-.cockpit-horizon-guide {
- position: absolute;
- top: 46%;
- left: 50%;
- display: grid;
- grid-template-columns: minmax(74px, 190px) auto minmax(74px, 190px);
- align-items: center;
- gap: 16px;
- width: min(470px, 42vw);
- transform: translate(-50%, -50%) translateZ(22px);
- color: color-mix(in srgb, var(--cockpit-accent) 72%, white);
-}
-.cockpit-horizon-guide span { border-top: 1px solid currentColor; }
-.cockpit-horizon-guide span:first-child { transform: rotateZ(2deg); transform-origin: right; }
-.cockpit-horizon-guide span:last-child { transform: rotateZ(-2deg); transform-origin: left; }
-.cockpit-horizon-guide small { font-size: 7px; letter-spacing: 0.16em; }
-.cockpit-route-direction {
- --route-angle: 0deg;
- position: absolute;
- z-index: 3;
- /* Keep the cue in one predictable center slot. Its rotation communicates
- relative destination bearing; lateral movement made it look like a random
- scene arrow and allowed it to collide with the speed/heading readouts. */
- top: 62%;
- left: 50%;
- display: grid;
- justify-items: center;
- gap: 5px;
- color: color-mix(in srgb, var(--cockpit-accent) 24%, #79b8ff);
- opacity: 0.84;
- transform: translate(-50%, -50%) translateZ(24px);
- transition: opacity 180ms ease;
- filter: drop-shadow(0 0 8px color-mix(in srgb, var(--cockpit-accent) 34%, transparent));
-}
-.cockpit-route-direction[hidden] { display: none; }
-.cockpit-route-direction .cockpit-route-chevron {
- display: block;
- width: clamp(56px, 6vw, 78px);
- height: clamp(56px, 6vw, 78px);
- overflow: visible;
- color: color-mix(in srgb, var(--cockpit-accent) 28%, #79b8ff);
- fill: currentColor;
- stroke: color-mix(in srgb, var(--cockpit-accent) 58%, #d8f3ff);
- stroke-width: 0.7px;
- stroke-linejoin: round;
- filter:
- drop-shadow(0 0 4px rgba(213, 242, 255, 0.68))
- drop-shadow(0 5px 6px rgba(0, 53, 102, 0.5));
- /* Present the direction cue on the apparent ground plane while its parent
- remains locked to the same fixed HUD position. */
- transform: perspective(220px) rotateX(62deg) rotateZ(var(--route-angle)) scaleY(1.35);
- transform-origin: center;
- transition: transform 180ms ease;
-}
-.cockpit-route-direction small {
- padding: 2px 5px;
- border: 1px solid color-mix(in srgb, var(--cockpit-accent) 20%, transparent);
- border-radius: 3px;
- background: rgba(0, 7, 12, 0.24);
- font-size: 7px;
- text-align: center;
- letter-spacing: 0.14em;
- white-space: nowrap;
-}
-.cockpit-altitude-rim {
- --cockpit-keyhole-radius: min(40vw, 52vh);
- position: absolute;
- z-index: 2;
- top: calc(50vh - var(--cockpit-keyhole-radius) + 20px);
- right: calc(50vw - var(--cockpit-keyhole-radius) + 20px);
- bottom: auto;
- width: 230px;
- height: calc((var(--cockpit-keyhole-radius) - 20px) * 2);
- overflow: hidden;
- color: var(--cockpit-accent);
- opacity: 0.9;
-}
-.cockpit-altitude-rim-label {
- position: absolute;
- top: 20%;
- right: calc(12px + (0.2 * (var(--cockpit-keyhole-radius) - 20px)));
- color: color-mix(in srgb, var(--cockpit-accent) 82%, white);
- font-size: 7px;
- font-weight: 700;
- letter-spacing: 0.18em;
- white-space: nowrap;
-}
-.cockpit-altitude-rim-rail {
- position: absolute;
- inset: 0;
- overflow: hidden;
- -webkit-mask-image: linear-gradient(
- to bottom,
- transparent 0%,
- rgba(0, 0, 0, 0.04) 10%,
- rgba(0, 0, 0, 0.28) 24%,
- #000 42%,
- #000 58%,
- rgba(0, 0, 0, 0.28) 76%,
- rgba(0, 0, 0, 0.04) 90%,
- transparent 100%
- );
- mask-image: linear-gradient(
- to bottom,
- transparent 0%,
- rgba(0, 0, 0, 0.04) 10%,
- rgba(0, 0, 0, 0.28) 24%,
- #000 42%,
- #000 58%,
- rgba(0, 0, 0, 0.28) 76%,
- rgba(0, 0, 0, 0.04) 90%,
- transparent 100%
- );
-}
-.cockpit-altitude-rim-rail::before {
- content: '';
- position: absolute;
- top: 0;
- right: 0;
- box-sizing: border-box;
- width: calc((var(--cockpit-keyhole-radius) - 20px) * 2);
- height: calc((var(--cockpit-keyhole-radius) - 20px) * 2);
- border: 2px solid color-mix(in srgb, var(--cockpit-accent) 72%, transparent);
- border-radius: 50%;
- box-shadow: 5px 0 18px color-mix(in srgb, var(--cockpit-accent) 18%, transparent);
-}
-.cockpit-altitude-rim-scale {
- position: absolute;
- inset: 0;
- overflow: hidden;
- -webkit-mask-image: linear-gradient(
- to bottom,
- transparent 0%,
- rgba(0, 0, 0, 0.03) 9%,
- rgba(0, 0, 0, 0.22) 23%,
- #000 41%,
- #000 59%,
- rgba(0, 0, 0, 0.22) 77%,
- rgba(0, 0, 0, 0.03) 91%,
- transparent 100%
- );
- mask-image: linear-gradient(
- to bottom,
- transparent 0%,
- rgba(0, 0, 0, 0.03) 9%,
- rgba(0, 0, 0, 0.22) 23%,
- #000 41%,
- #000 59%,
- rgba(0, 0, 0, 0.22) 77%,
- rgba(0, 0, 0, 0.03) 91%,
- transparent 100%
- );
-}
-.cockpit-altitude-rim-scale > span {
- position: absolute;
- top: calc(50% + (var(--slot) * 8%));
- right: calc(7px + (var(--curve) * (var(--cockpit-keyhole-radius) - 20px)));
- display: flex;
- align-items: center;
- gap: 6px;
- color: rgba(244, 251, 255, 0.68);
- transform: translateY(-50%) rotateZ(calc(var(--slot) * -1.7deg));
- transform-origin: right center;
- transition: top 120ms linear, right 120ms linear, transform 120ms linear;
-}
-.cockpit-altitude-rim-scale > span i {
- order: 2;
- display: block;
- width: 20px;
- border-top: 1px solid color-mix(in srgb, var(--cockpit-accent) 58%, transparent);
-}
-.cockpit-altitude-rim-scale > span b {
- min-width: 46px;
- padding: 1px 3px;
- border-radius: 2px;
- background: rgba(0, 7, 12, 0.28);
- font-size: 8px;
- font-weight: 500;
- letter-spacing: 0.08em;
- text-align: right;
-}
-.cockpit-altitude-rim-scale > span.major { color: rgba(244, 251, 255, 0.9); }
-.cockpit-altitude-rim-scale > span.major i {
- width: 32px;
- border-color: color-mix(in srgb, var(--cockpit-accent) 86%, transparent);
-}
-.cockpit-altitude-rim-pointer {
- position: absolute;
- top: 50%;
- right: 0;
- display: flex;
- align-items: center;
- color: #fff;
- transform: translateY(-50%);
- text-shadow: 0 0 12px var(--cockpit-accent);
-}
-.cockpit-altitude-rim-pointer strong {
- min-width: 48px;
- font-size: 10px;
- font-weight: 700;
- letter-spacing: 0.06em;
- text-align: right;
-}
-.cockpit-altitude-rim-pointer .material-symbols-outlined {
- margin-left: 4px;
- color: var(--cockpit-accent);
- font-size: 24px;
- font-variation-settings: 'FILL' 1, 'wght' 600;
- animation: cockpit-altitude-pointer 1.8s ease-in-out infinite;
-}
-@keyframes cockpit-altitude-pointer {
- 50% { transform: translateX(-3px); filter: brightness(1.35); }
-}
-.cockpit-altitude-rim.unavailable { opacity: 0.24; }
-.cockpit-speed-rim {
- --speed-tape-inset: clamp(112px, 9vw, 148px);
- right: auto;
- left: calc(50vw - var(--cockpit-keyhole-radius) + 20px);
- width: 300px;
-}
-.cockpit-speed-rim .cockpit-altitude-rim-label {
- right: auto;
- left: var(--speed-tape-inset);
-}
-.cockpit-speed-rim .cockpit-altitude-rim-rail::before {
- right: auto;
- left: 0;
- box-shadow: -5px 0 18px color-mix(in srgb, var(--cockpit-accent) 18%, transparent);
-}
-.cockpit-speed-rim .cockpit-altitude-rim-scale > span {
- right: auto;
- left: calc(1px + (var(--curve) * (var(--cockpit-keyhole-radius) - 20px)));
- flex-direction: row-reverse;
- /* Speed rises toward the top of the tape; altitude intentionally runs the
- opposite way on the mirrored right-hand ruler. */
- top: calc(50% - (var(--slot) * 8%));
- transform: translateY(-50%) rotateZ(calc(var(--slot) * 1.7deg));
- transform-origin: left center;
-}
-.cockpit-speed-rim .cockpit-altitude-rim-scale > span b { text-align: left; }
-.cockpit-speed-rim .cockpit-altitude-rim-pointer {
- right: auto;
- left: 0;
-}
-.cockpit-speed-rim .cockpit-altitude-rim-pointer strong { text-align: left; }
-.cockpit-speed-rim .cockpit-altitude-rim-pointer .material-symbols-outlined {
- margin-right: 4px;
- margin-left: 0;
- animation-name: cockpit-speed-pointer;
-}
-@keyframes cockpit-speed-pointer {
- 50% { transform: translateX(3px); filter: brightness(1.35); }
-}
-.cockpit-visor-status {
- position: absolute;
- bottom: 3px;
- color: color-mix(in srgb, var(--cockpit-accent) 54%, transparent);
- font-size: 7px;
- letter-spacing: 0.22em;
-}
-.cockpit-visor-status-left { left: clamp(110px, 15vw, 220px); transform: rotateY(22deg); }
-.cockpit-visor-status-right { right: clamp(110px, 15vw, 220px); transform: rotateY(-22deg); }
-.cockpit-topline {
- position: absolute;
- z-index: 5;
- top: clamp(18px, 3vh, 34px);
- left: clamp(22px, 4vw, 58px);
- right: clamp(22px, 4vw, 58px);
- display: grid;
- grid-template-columns: 1fr auto 1fr;
- align-items: start;
- gap: 24px;
-}
-.cockpit-topline > div:first-child { display: flex; flex-direction: column; gap: 4px; }
-.cockpit-kicker, .cockpit-readout-label {
- color: var(--cockpit-accent);
- font-size: 9px;
- font-weight: 600;
- letter-spacing: 0.22em;
-}
-#cockpit-callsign { font-size: 18px; letter-spacing: 0.12em; }
-.cockpit-aircraft-meta {
- color: rgba(244, 251, 255, 0.48);
- font-size: 7px;
- letter-spacing: 0.16em;
-}
-.cockpit-mode-chip {
- margin-top: 2px;
- padding: 7px 11px;
- border: 1px solid color-mix(in srgb, var(--cockpit-accent) 45%, transparent);
- border-radius: 20px;
- background: rgba(0, 7, 12, 0.62);
- color: var(--cockpit-accent);
- font-size: 9px;
- font-weight: 600;
- letter-spacing: 0.16em;
-}
-.cockpit-live-dot {
- display: inline-block;
- width: 5px;
- height: 5px;
- margin-right: 6px;
- border-radius: 50%;
- background: var(--cockpit-accent);
- box-shadow: 0 0 8px var(--cockpit-accent);
- animation: cockpit-live 1.6s ease-in-out infinite;
-}
-@keyframes cockpit-live { 50% { opacity: 0.35; } }
-.cockpit-readout {
- position: relative;
- display: grid;
- min-width: 118px;
- padding: 6px 10px 7px;
- border-top: 1px solid color-mix(in srgb, var(--cockpit-accent) 50%, transparent);
- border-bottom: 1px solid color-mix(in srgb, var(--cockpit-accent) 18%, transparent);
- background: linear-gradient(90deg, transparent, rgba(0, 7, 12, 0.34), transparent);
- transform-style: preserve-3d;
-}
-.cockpit-speed {
- justify-self: end;
- text-align: right;
- transform: perspective(760px) rotateY(10deg) translateZ(-5px);
- transform-origin: right center;
-}
-.cockpit-altitude {
- justify-self: start;
- text-align: left;
- transform: perspective(760px) rotateY(-10deg) translateZ(-5px);
- transform-origin: left center;
-}
-.cockpit-readout strong {
- margin-top: 1px;
- font-size: clamp(30px, 3.6vw, 48px);
- font-weight: 500;
- line-height: 0.98;
- letter-spacing: -0.06em;
- white-space: nowrap;
-}
-.cockpit-roll-token {
- position: relative;
- display: inline-block;
- min-width: 0.56em;
- height: 1em;
- overflow: hidden;
- line-height: 1;
- text-align: center;
- vertical-align: -0.08em;
-}
-.cockpit-roll-token.is-rolling {
- color: color-mix(in srgb, currentColor 92%, var(--cockpit-accent));
- text-shadow: 0 0 10px color-mix(in srgb, var(--cockpit-accent) 35%, transparent);
-}
-.cockpit-roll-track {
- display: flex;
- flex-direction: column;
- height: 2em;
- will-change: transform;
-}
-.cockpit-roll-track > span {
- display: block;
- flex: 0 0 1em;
- height: 1em;
- line-height: 1;
-}
-.cockpit-roll-token.roll-up .cockpit-roll-track {
- animation: cockpit-number-roll-up 200ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
-}
-.cockpit-roll-token.roll-down .cockpit-roll-track {
- animation: cockpit-number-roll-down 200ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
-}
-@keyframes cockpit-number-roll-up {
- from { transform: translateY(0); }
- to { transform: translateY(-1em); }
-}
-@keyframes cockpit-number-roll-down {
- from { transform: translateY(-1em); }
- to { transform: translateY(0); }
-}
-@media (prefers-reduced-motion: reduce) {
- .cockpit-roll-token .cockpit-roll-track { animation-duration: 1ms; }
-}
-.cockpit-readout-unit {
- margin-top: 2px;
- color: rgba(244, 251, 255, 0.7);
- font-size: 11px;
- font-weight: 600;
- letter-spacing: 0.2em;
-}
-.cockpit-reticle {
- position: absolute;
- top: 46%;
- left: 50%;
- transform: translate(-50%, -50%) translateZ(34px);
- color: var(--cockpit-accent);
- font-size: clamp(30px, 3vw, 44px);
- font-variation-settings: 'wght' 200;
- opacity: 0.8;
-}
-.cockpit-compass {
- position: absolute;
- left: 50%;
- bottom: clamp(44px, 7vh, 72px);
- width: min(760px, 72vw);
- transform: translateX(-50%) rotateX(7deg) translateZ(18px);
- transform-style: preserve-3d;
- perspective: 760px;
- text-align: center;
-}
-.cockpit-instrument-row {
- display: grid;
- grid-template-columns: minmax(118px, 1fr) auto minmax(118px, 1fr);
- align-items: center;
- gap: clamp(18px, 3vw, 42px);
-}
-.cockpit-heading-value {
- min-width: 74px;
- font-size: 34px;
- font-weight: 600;
- line-height: 1;
- white-space: nowrap;
-}
-.cockpit-heading-value small { color: var(--cockpit-accent); font-size: 12px; }
-.cockpit-heading-caret {
- display: block;
- height: 20px;
- color: var(--cockpit-accent);
- font-size: 28px;
- line-height: 20px;
-}
-.cockpit-compass-tape {
- position: relative;
- height: 74px;
- margin-top: -2px;
- transform-style: preserve-3d;
-}
-.cockpit-compass-tape::before {
- content: '';
- position: absolute;
- inset: 10px 2% 0;
- border-top: 1px solid color-mix(in srgb, var(--cockpit-accent) 78%, transparent);
- border-radius: 50%;
- background: rgba(0, 7, 12, 0.16);
-}
-.cockpit-compass-tape span {
- position: absolute;
- top: 8px;
- left: 50%;
- color: rgba(244, 251, 255, 0.52);
- font-size: 12px;
- letter-spacing: 0.12em;
- transform:
- translateX(calc(-50% + (var(--slot) * 86px)))
- translateY(calc(var(--depth) * 8px))
- rotateZ(calc(var(--slot) * 3.6deg))
- rotateY(calc(var(--slot) * -9deg));
-}
-.cockpit-compass-tape span::before {
- content: '';
- display: block;
- width: 1px;
- height: calc(17px - (var(--depth) * 2px));
- margin: 0 auto 7px;
- background: color-mix(in srgb, var(--cockpit-accent) 70%, transparent);
-}
-.cockpit-compass-tape span.active {
- color: #fff;
- font-size: 18px;
- font-weight: 700;
- text-shadow: 0 0 14px var(--cockpit-accent);
-}
-.cockpit-position-readout {
- position: absolute;
- right: clamp(24px, 4vw, 58px);
- bottom: clamp(22px, 4vh, 42px);
- display: flex;
- flex-direction: column;
- align-items: flex-end;
- gap: 4px;
- color: rgba(244, 251, 255, 0.72);
- font-size: 10px;
- letter-spacing: 0.1em;
-}
-.cockpit-vision-controls {
- display: grid;
- grid-template-columns: 48px 58px 48px;
- align-items: stretch;
- gap: 2px;
- margin-top: 2px;
- padding: 2px;
- border: 1px solid color-mix(in srgb, var(--cockpit-accent) 22%, transparent);
- border-radius: 7px;
- background: rgba(0, 7, 12, 0.46);
- box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.28);
- pointer-events: auto;
-}
-.cockpit-vision-controls button {
- display: flex;
- min-width: 0;
- min-height: 31px;
- align-items: center;
- justify-content: center;
- gap: 1px;
- padding: 4px 5px;
- border: 1px solid transparent;
- border-radius: 5px;
- background: rgba(0, 7, 12, 0.38);
- color: rgba(244, 251, 255, 0.64);
- font: 700 7px/1 var(--font-mono);
- letter-spacing: 0.08em;
- cursor: pointer;
-}
-.cockpit-vision-controls button:hover,
-.cockpit-vision-controls button:focus-visible {
- border-color: color-mix(in srgb, var(--cockpit-accent) 62%, transparent);
- color: #fff;
- outline: none;
-}
-.cockpit-vision-controls .material-symbols-outlined {
- font-size: 14px;
-}
-.cockpit-vision-controls small {
- font: 700 6px/1 var(--font-mono);
- letter-spacing: 0.1em;
-}
-.cockpit-vision-current {
- flex-direction: column;
-}
-.cockpit-vision-current small {
- color: color-mix(in srgb, var(--cockpit-accent) 70%, #fff);
-}
-.cockpit-vision-current strong {
- color: #fff;
- font: 700 9px/1 var(--font-mono);
- letter-spacing: 0.12em;
-}
-.cockpit-vision-controls .cockpit-vision-current {
- border-color: var(--cockpit-accent);
- background: color-mix(in srgb, var(--cockpit-accent) 10%, rgba(0, 7, 12, 0.72));
- box-shadow: 0 0 10px color-mix(in srgb, var(--cockpit-accent) 30%, transparent);
-}
-.cockpit-route-card {
- display: grid;
- gap: 8px;
- min-width: 0;
- padding: 2px 6px 10px 8px;
- border-bottom: 1px solid color-mix(in srgb, var(--cockpit-accent) 22%, transparent);
- color: rgba(224, 247, 255, 0.9);
- font: 7px/1.25 var(--font-mono);
- letter-spacing: 0.09em;
-}
-.cockpit-route-card[hidden] { display: none; }
-.cockpit-route-heading {
- display: flex;
- min-width: 0;
- align-items: center;
- justify-content: space-between;
- gap: 8px;
-}
-.cockpit-route-kicker {
- flex: 0 0 auto;
- color: var(--cockpit-accent);
- font-size: 7px;
- font-weight: 700;
- letter-spacing: 0.16em;
-}
-.cockpit-route-heading small {
- overflow: hidden;
- color: color-mix(in srgb, var(--cockpit-accent) 68%, rgba(244, 251, 255, 0.46));
- font-size: 5px;
- letter-spacing: 0.08em;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-.cockpit-route-endpoints {
- display: grid;
- grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
- align-items: center;
- gap: 7px;
-}
-.cockpit-route-airport {
- display: grid;
- min-width: 0;
- gap: 3px;
- padding: 6px 7px;
- border-left: 1px solid color-mix(in srgb, var(--cockpit-accent) 52%, transparent);
- background: rgba(0, 7, 12, 0.3);
-}
-.cockpit-route-airport > span {
- color: color-mix(in srgb, var(--cockpit-accent) 76%, white);
- font-size: 6px;
- font-weight: 700;
- letter-spacing: 0.14em;
-}
-.cockpit-route-airport strong {
- overflow: hidden;
- color: #fff;
- font-size: 8px;
- letter-spacing: 0.06em;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-.cockpit-route-arrow {
- color: var(--cockpit-accent);
- font-size: 15px;
- text-align: center;
-}
-#view-switcher {
- position: fixed;
- z-index: 146;
- right: 36px;
- bottom: calc(2vh + 4.5rem);
- display: grid;
- gap: 6px;
-}
-#view-switcher button {
- display: inline-flex;
- align-items: center;
- justify-content: center;
- gap: 6px;
- min-height: 32px;
- padding: 7px 10px;
- border: 1px solid rgba(116, 219, 255, 0.38);
- border-radius: 6px;
- background: rgba(2, 12, 20, 0.82);
- color: #bceeff;
- font: 700 8px/1 var(--font-mono);
- letter-spacing: 0.12em;
- cursor: pointer;
- box-shadow: 0 0 18px rgba(0, 0, 0, 0.24);
-}
-#view-switcher button[hidden] { display: none; }
-#view-switcher button:hover, #view-switcher button:focus-visible { border-color: #fff; color: #fff; outline: none; }
-#view-switcher .material-symbols-outlined { font-size: 16px; }
-body.cockpit-mode #view-switcher {
- right: auto;
- bottom: max(clamp(128px, 15vh, 150px), env(safe-area-inset-bottom));
- display: flex;
- max-width: calc(100vw - 24px);
- align-items: center;
- justify-content: center;
- margin-bottom: -95px;
- left: 50%;
- transform: translateX(-50%);
-}
-body.cockpit-mode #view-switcher button {
- flex: 0 1 auto;
- min-width: 0;
- min-height: 28px;
- padding: 6px 11px;
- border-radius: 999px;
- background: rgba(0, 7, 12, 0.74);
- white-space: nowrap;
-}
-.cockpit-context-window {
- position: absolute;
- z-index: 4;
- top: auto;
- left: var(--cockpit-context-left, clamp(24px, 4vw, 58px));
- bottom: var(--cockpit-bottom-rail-safe);
- display: grid;
- gap: 7px;
- width: var(--cockpit-side-panel-width);
- max-height: min(42vh, 410px);
- overflow-x: hidden;
- overflow-y: auto;
- box-sizing: border-box;
- padding: 11px 12px 10px;
- border: 1px solid color-mix(in srgb, var(--cockpit-accent) 30%, transparent);
- border-top-color: color-mix(in srgb, var(--cockpit-accent) 64%, transparent);
- border-radius: 8px 24px 24px 8px;
- background: rgba(0, 7, 12, 0.68);
- box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 0 28px rgba(0,0,0,0.26);
- transform: perspective(900px) rotateY(4deg) translateZ(18px);
- transform-origin: left center;
- transform-style: preserve-3d;
- pointer-events: auto;
- text-shadow: 0 0 8px color-mix(in srgb, var(--cockpit-accent) 45%, transparent);
- scrollbar-color: color-mix(in srgb, var(--cockpit-accent) 45%, transparent) transparent;
- scrollbar-width: thin;
- transition: width 180ms ease, background-color 180ms ease, border-radius 180ms ease;
-}
-#cockpit-context[hidden] { display: none; }
-.cockpit-context-window[data-state="uncertain"] { border-top-color: rgba(116, 219, 255, 0.72); }
-/* CONTACT LOST reuses the amber the app already spends on unknown/stale inputs
- (.cockpit-context-cohorts > div.unknown, .cockpit-brief-status[data-state="unavailable"]),
- so a held last-known readout never reads as a live one. */
-.cockpit-context-window[data-state="lost"] { border-top-color: rgba(213, 168, 99, 0.72); }
-.cockpit-context-header {
- display: grid;
- grid-template-columns: minmax(0, 1fr) auto;
- align-items: center;
- gap: 5px 10px;
- padding: 0 5px 7px;
- border-bottom: 1px solid color-mix(in srgb, var(--cockpit-accent) 22%, transparent);
-}
-.cockpit-context-header > div { display: grid; gap: 2px; }
-.cockpit-context-kicker {
- color: var(--cockpit-accent);
- font-size: 8px;
- font-weight: 700;
- letter-spacing: 0.2em;
-}
-#cockpit-context-subject {
- color: #fff;
- font-size: 10px;
- font-weight: 600;
- letter-spacing: 0.12em;
-}
-.cockpit-context-qualifier {
- grid-column: 1 / -1;
- justify-self: start;
- color: rgba(116, 219, 255, 0.82);
- font-size: 7px;
- letter-spacing: 0.16em;
- white-space: nowrap;
-}
-.cockpit-context-weather {
- display: inline-flex;
- min-width: 48px;
- height: 20px;
- align-items: center;
- justify-content: center;
- gap: 5px;
- padding: 0 7px;
- border: 1px solid color-mix(in srgb, var(--cockpit-accent) 46%, transparent);
- border-radius: 999px;
- background: color-mix(in srgb, var(--cockpit-accent) 8%, rgba(0, 7, 12, 0.78));
- color: color-mix(in srgb, var(--cockpit-accent) 82%, white);
- font: 700 6px/1 var(--font-mono);
- letter-spacing: 0.1em;
- cursor: pointer;
-}
-.cockpit-context-weather strong {
- color: #fff;
- font: inherit;
-}
-.cockpit-context-weather[aria-pressed="false"] {
- border-color: rgba(244, 251, 255, 0.15);
- background: rgba(0, 7, 12, 0.54);
- color: rgba(244, 251, 255, 0.42);
-}
-.cockpit-context-weather[aria-pressed="false"] strong { color: rgba(244, 251, 255, 0.5); }
-.cockpit-context-weather:hover, .cockpit-context-weather:focus-visible {
- border-color: var(--cockpit-accent);
- color: #fff;
- outline: none;
-}
-.cockpit-context-actions { display: flex; gap: 4px; }
-.cockpit-context-actions button {
- display: grid;
- width: 28px;
- height: 24px;
- place-items: center;
- padding: 0;
- border: 1px solid color-mix(in srgb, var(--cockpit-accent) 30%, transparent);
- border-radius: 5px;
- background: rgba(0, 7, 12, 0.72);
- color: color-mix(in srgb, var(--cockpit-accent) 82%, white);
- cursor: pointer;
-}
-.cockpit-context-actions button:hover, .cockpit-context-actions button:focus-visible {
- border-color: var(--cockpit-accent);
- color: #fff;
- outline: none;
-}
-.cockpit-context-actions button:disabled {
- border-color: rgba(244, 251, 255, 0.1);
- color: rgba(244, 251, 255, 0.2);
- cursor: default;
-}
-.cockpit-context-actions .material-symbols-outlined { font-size: 15px; }
-.cockpit-context-cohorts {
- display: grid;
- grid-template-columns: repeat(2, minmax(0, 1fr));
- gap: 6px;
-}
-.cockpit-context-cohorts > div {
- display: grid;
- grid-template-columns: auto 1fr;
- align-items: baseline;
- gap: 3px 8px;
- min-width: 0;
- padding: 6px 9px;
- border-left: 1px solid color-mix(in srgb, var(--cockpit-accent) 40%, transparent);
- background: rgba(0, 7, 12, 0.34);
-}
-.cockpit-context-cohorts span {
- color: var(--cockpit-accent);
- font-size: 8px;
- font-weight: 700;
- letter-spacing: 0.14em;
-}
-.cockpit-context-cohorts strong {
- justify-self: end;
- color: #fff;
- font-size: 17px;
- font-weight: 600;
-}
-.cockpit-context-cohorts small {
- grid-column: 1 / -1;
- overflow: hidden;
- color: rgba(244, 251, 255, 0.4);
- font-size: 6px;
- letter-spacing: 0.05em;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-.cockpit-context-cohorts > div.unknown { border-left-color: rgba(213, 168, 99, 0.58); }
-.cockpit-context-cohorts > div.unknown strong { color: #d5a863; }
-.cockpit-context-nearest {
- display: grid;
- grid-template-columns: 22px minmax(0, 1fr) auto;
- grid-template-rows: auto auto;
- align-items: center;
- gap: 2px 8px;
- padding: 3px 5px 2px;
-}
-#cockpit-context-direction {
- grid-row: 1 / 3;
- color: var(--cockpit-accent);
- font-size: 22px;
- transform-origin: 50% 50%;
- transition: transform 180ms ease-out;
-}
-#cockpit-context-direction.unknown { opacity: 0.3; }
-.cockpit-context-nearest > div { grid-column: 2; grid-row: 1; display: grid; gap: 2px; min-width: 0; }
-.cockpit-context-nearest small {
- color: rgba(244, 251, 255, 0.42);
- font-size: 6px;
- letter-spacing: 0.12em;
-}
-#cockpit-context-nearest-label {
- overflow: hidden;
- color: #fff;
- font-size: 9px;
- letter-spacing: 0.1em;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-#cockpit-context-bearing, #cockpit-context-distance {
- color: var(--cockpit-accent);
- font-size: 10px;
- font-weight: 700;
- letter-spacing: 0.08em;
- white-space: nowrap;
-}
-#cockpit-context-bearing { grid-column: 2; grid-row: 2; justify-self: start; }
-#cockpit-context-distance { grid-column: 3; grid-row: 1 / 3; }
-#cockpit-context-distance { color: #fff; }
-.cockpit-context-footer {
- display: grid;
- grid-template-columns: minmax(0, 1fr) auto auto;
- align-items: center;
- gap: 8px;
- padding: 6px 8px 0;
- border-top: 1px solid rgba(244, 251, 255, 0.08);
- color: rgba(244, 251, 255, 0.4);
- font-size: 6px;
- letter-spacing: 0.11em;
-}
-.cockpit-context-window[data-state="uncertain"] #cockpit-context-uncertainty { color: #74dbff; }
-.cockpit-context-window[data-state="lost"] #cockpit-context-uncertainty {
- color: #d5a863;
- font-weight: 600;
-}
-/* The held values are last-known, not current — dim them to match the cue. */
-.cockpit-context-window[data-state="lost"] :is(
- .cockpit-context-cohorts,
- .cockpit-context-nearest
-) { opacity: 0.55; }
-#cockpit-hud.context-active .cockpit-pitch-rail-left {
- opacity: 0.16;
- transition: opacity 180ms ease;
-}
-.cockpit-context-window[data-layout-mode="rail-left-constrained"] {
- gap: 5px;
- padding-top: 8px;
- padding-bottom: 8px;
-}
-.cockpit-context-window[data-collapsed="true"] {
- width: min(248px, 22vw);
- max-height: none;
- gap: 0;
- padding: 9px 10px;
- border-radius: 7px 18px 18px 7px;
- background: rgba(0, 7, 12, 0.54);
-}
-.cockpit-context-window[data-collapsed="true"] .cockpit-context-header {
- gap: 8px;
- padding: 0;
- border-bottom: 0;
-}
-.cockpit-context-window[data-collapsed="true"] :is(
- .cockpit-context-qualifier,
- .cockpit-context-cohorts,
- .cockpit-context-nearest,
- .cockpit-context-footer,
- .cockpit-context-actions button:not(#cockpit-context-toggle)
-) { display: none; }
-.cockpit-context-window[data-collapsed="true"] #cockpit-context-subject {
- font-size: 8px;
- letter-spacing: 0.08em;
-}
-#cockpit-hud.signals-active .cockpit-pitch-rail-right {
- opacity: 0.16;
- transition: opacity 180ms ease;
-}
-.cockpit-signal-window {
- position: absolute;
- z-index: 3;
- top: auto;
- right: var(--cockpit-signal-right, clamp(24px, 4vw, 58px));
- bottom: var(--cockpit-bottom-rail-safe);
- display: grid;
- gap: 7px;
- width: var(--cockpit-side-panel-width);
- max-height: min(42vh, 410px);
- overflow-x: hidden;
- overflow-y: auto;
- box-sizing: border-box;
- padding: 11px 12px 9px;
- border: 1px solid color-mix(in srgb, var(--cockpit-accent) 30%, transparent);
- border-top-color: color-mix(in srgb, var(--cockpit-accent) 64%, transparent);
- border-radius: 24px 8px 8px 24px;
- background: rgba(0, 7, 12, 0.68);
- box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 0 28px rgba(0,0,0,0.26);
- transform: perspective(900px) rotateY(-4deg) translateZ(18px);
- transform-origin: right center;
- pointer-events: auto;
- text-shadow: 0 0 8px color-mix(in srgb, var(--cockpit-accent) 45%, transparent);
- scrollbar-color: color-mix(in srgb, var(--cockpit-accent) 45%, transparent) transparent;
- scrollbar-width: thin;
- transition: width 180ms ease, background-color 180ms ease, border-radius 180ms ease;
-}
-#cockpit-signal-stream[hidden] { display: none; }
-.cockpit-utility-controls {
- position: absolute;
- z-index: 5;
- top: var(--cockpit-utility-top, var(--left-stack-safe-top, var(--left-stack-top)));
- right: clamp(24px, 4vw, 58px);
- bottom: auto;
- display: flex;
- flex-direction: column;
- align-items: flex-end;
- justify-content: flex-end;
- gap: 7px;
- pointer-events: auto;
-}
-.cockpit-utility-control { position: relative; }
-.cockpit-utility-control.is-expanded {
- width: 272px;
- box-sizing: border-box;
- padding: 8px;
- border: 1px solid var(--glass-border);
- border-radius: var(--panel-radius);
- background: var(--glass-bg);
- box-shadow: 0 8px 32px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .05);
- backdrop-filter: blur(24px) saturate(1.4);
- -webkit-backdrop-filter: blur(24px) saturate(1.4);
- max-height: var(
- --cockpit-utility-expanded-max-height,
- var(--cockpit-utility-max-height, min(44vh, 430px))
- );
- overflow-y: auto;
-}
-.cockpit-utility-control.is-expanded:has([data-cockpit-launcher="display"]) {
- width: var(--display-panel-expanded-width);
- display: flex;
- flex-direction: column;
- align-items: flex-end;
- gap: 7px;
- box-shadow: 0 8px 32px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .04);
-}
-.cockpit-utility-control.is-expanded:has([data-cockpit-launcher="radio"]) {
- width: var(--cockpit-radio-expanded-width, 232px);
-}
-.cockpit-utility-controls.layout-primary-only
- > .cockpit-utility-control:not(.is-expanded) { display: none; }
-.cockpit-utility-launcher {
- display: grid;
- grid-template-columns: auto minmax(0, 1fr) auto;
- align-items: center;
- gap: 7px;
- width: var(--left-collapsed-width, 176px);
- min-height: 50px;
- padding: 8px 10px 8px 14px;
- border: 1px solid var(--glass-border);
- border-radius: var(--panel-radius);
- background: var(--glass-bg);
- box-shadow: 0 8px 32px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .04);
- backdrop-filter: blur(24px) saturate(1.4);
- -webkit-backdrop-filter: blur(24px) saturate(1.4);
- color: var(--text-dim);
- font: 8px/1.1 var(--font-mono);
- letter-spacing: 1.4px;
- text-align: left;
-}
-[data-cockpit-launcher="display"] {
- width: var(--left-collapsed-width, 176px);
-}
-[data-cockpit-launcher="radio"] {
- width: var(--cockpit-radio-collapsed-width, 148px);
-}
-.cockpit-utility-control.is-expanded .cockpit-utility-launcher {
- width: 100%;
- min-height: 42px;
- padding: 6px 2px 8px 6px;
- border: 0;
- border-radius: 0;
- background: transparent;
- box-shadow: none;
- backdrop-filter: none;
- -webkit-backdrop-filter: none;
-}
-.cockpit-utility-control.is-expanded .cockpit-utility-launcher {
- width: 100%;
-}
-.cockpit-utility-control.is-expanded:has([data-cockpit-launcher="display"])
- .cockpit-utility-launcher {
- min-height: 42px;
- box-sizing: border-box;
- margin-left: auto;
- margin-bottom: 0;
- padding: 6px 2px 8px 6px;
- gap: 8px;
-}
-.cockpit-utility-divider {
- height: 1px;
- background: linear-gradient(to right, var(--glass-border), transparent);
- box-shadow: none;
-}
-.cockpit-utility-control.is-expanded .cockpit-utility-divider {
- background: linear-gradient(90deg, rgb(0 212 255 / 28%), rgba(0, 212, 255, 0.18) 58%, transparent);
- box-shadow: 0 0 7px rgba(0, 212, 255, .22);
-}
-.cockpit-utility-glyph {
- display: grid;
- width: 20px;
- height: 20px;
- padding: 0;
- place-items: center;
- border: 1px solid var(--glass-border);
- border-radius: 6px;
- background: rgba(255, 255, 255, .03);
- color: var(--text-secondary);
- font-family: var(--font-mono);
- font-size: 12px;
- line-height: 1;
- cursor: pointer;
-}
-.cockpit-utility-glyph:focus-visible {
- border-color: var(--glass-border-hover);
- color: var(--text-primary);
- outline: 2px solid var(--text-primary);
- outline-offset: -3px;
-}
-.cockpit-utility-popover {
- position: static;
- display: grid;
- width: 100%;
- box-sizing: border-box;
- gap: 7px;
- padding: 9px;
- border: 0;
- border-top: 1px solid var(--glass-border);
- border-radius: 0;
- background: transparent;
- box-shadow: none;
-}
-.cockpit-utility-popover[hidden] { display: none !important; }
-.cockpit-display-slot {
- display: block;
- min-width: 0;
-}
-#cockpit-display-panel {
- display: flex;
- flex-direction: column;
- gap: 7px;
- padding: 0;
- border-top: 0;
- max-height: min(52vh, 470px);
- overflow-y: auto;
-}
-#cockpit-display-panel .pp-toggle-group {
- width: 100%;
- min-width: 0;
-}
-#cockpit-display-panel [data-cockpit-display-slot="parameters"] #param-slider-panel.active {
- width: 100%;
- max-height: none;
- overflow-y: visible;
-}
-#cockpit-display-panel .pp-toggle-btn {
- width: 100%;
- min-height: 38px;
- box-sizing: border-box;
-}
-.cockpit-radio-compact { width: 100%; }
-.cockpit-radio-station {
- overflow: hidden;
- color: #fff;
- font: 500 8px/1.2 var(--font-mono);
- letter-spacing: .08em;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-.cockpit-radio-transport {
- display: grid;
- grid-template-columns: repeat(3, 1fr);
- gap: 6px;
-}
-.cockpit-radio-transport button {
- min-height: 32px;
- border: 1px solid rgba(65, 220, 231, .24);
- border-radius: 6px;
- background: rgba(65, 220, 231, .05);
- color: #9ceaf1;
- cursor: pointer;
-}
-.cockpit-radio-transport button:disabled { opacity: .38; cursor: not-allowed; }
-.cockpit-radio-transport button.active { border-color: var(--cockpit-accent); color: #fff; }
-.cockpit-radio-volume {
- display: grid;
- grid-template-columns: auto 1fr auto;
- align-items: center;
- gap: 8px;
- color: rgba(244, 251, 255, .58);
- font: 7px/1 var(--font-mono);
- letter-spacing: .1em;
-}
-.cockpit-radio-volume input { width: 100%; }
-.cockpit-signal-header {
- display: grid;
- grid-template-columns: minmax(0, 1fr) auto;
- align-items: center;
- gap: 10px;
- padding: 0 4px 7px 8px;
- border-bottom: 1px solid color-mix(in srgb, var(--cockpit-accent) 22%, transparent);
-}
-.cockpit-signal-header > div { display: grid; gap: 2px; }
-.cockpit-signal-header strong {
- color: #fff;
- font-size: 8px;
- letter-spacing: 0.1em;
-}
-.cockpit-signal-kicker {
- color: var(--cockpit-accent);
- font-size: 8px;
- font-weight: 700;
- letter-spacing: 0.18em;
-}
-.cockpit-signal-kicker i {
- display: inline-block;
- width: 5px;
- height: 5px;
- margin-right: 5px;
- border-radius: 50%;
- background: var(--cockpit-accent);
- box-shadow: 0 0 7px var(--cockpit-accent);
- animation: cockpit-live 1.6s ease-in-out infinite;
-}
-.cockpit-brief-actions {
- display: flex;
- align-items: center;
- gap: 3px;
-}
-.cockpit-brief-actions button {
- display: grid;
- width: 23px;
- height: 24px;
- place-items: center;
- padding: 0;
- border: 1px solid color-mix(in srgb, var(--cockpit-accent) 30%, transparent);
- border-radius: 5px;
- background: rgba(0, 7, 12, 0.72);
- color: color-mix(in srgb, var(--cockpit-accent) 82%, white);
- cursor: pointer;
-}
-.cockpit-brief-actions button:hover, .cockpit-brief-actions button:focus-visible {
- border-color: var(--cockpit-accent);
- color: #fff;
- outline: none;
-}
-.cockpit-brief-actions .material-symbols-outlined { font-size: 14px; }
-#cockpit-brief-auto {
- width: 50px;
- color: rgba(244, 251, 255, 0.42);
- font: 700 6px/1 var(--font-mono);
- letter-spacing: 0.05em;
-}
-#cockpit-brief-auto[aria-pressed="true"] {
- border-color: var(--cockpit-accent);
- background: color-mix(in srgb, var(--cockpit-accent) 14%, rgba(0, 7, 12, 0.72));
- color: #fff;
- box-shadow: 0 0 10px color-mix(in srgb, var(--cockpit-accent) 24%, transparent);
-}
-#cockpit-signal-toggle { width: 28px; margin-left: 2px; }
-#cockpit-brief-position {
- min-width: 25px;
- color: rgba(244, 251, 255, 0.48);
- font-size: 6px;
- letter-spacing: 0.08em;
- text-align: center;
-}
-.cockpit-brief-stage {
- min-height: 178px;
- overflow: hidden;
-}
-[data-cockpit-brief-page] {
- animation: cockpit-brief-enter 220ms ease-out both;
-}
-[data-cockpit-brief-page][hidden] { display: none; }
-.cockpit-signal-list {
- display: grid;
- gap: 3px;
- margin: 0;
- padding: 0;
- list-style: none;
-}
-.cockpit-signal-list li {
- display: grid;
- grid-template-columns: 54px minmax(0, 1fr);
- gap: 8px;
- padding: 7px 7px 7px 9px;
- border-left: 1px solid rgba(244, 251, 255, 0.2);
- background: rgba(0, 7, 12, 0.3);
-}
-.cockpit-signal-list li.actionable {
- transition: border-color 160ms ease, background 160ms ease;
-}
-.cockpit-signal-list li.actionable:hover,
-.cockpit-signal-list li.actionable:focus-within {
- border-left-color: var(--cockpit-accent);
- background: color-mix(in srgb, var(--cockpit-accent) 10%, rgba(0, 7, 12, 0.4));
-}
-.cockpit-signal-list li.track, .cockpit-signal-list li.current { border-left-color: var(--cockpit-accent); }
-.cockpit-signal-list li.nearby { border-left-color: #fff; }
-.cockpit-signal-list li.military { border-left-color: #d5a863; }
-.cockpit-signal-list li.warning { border-left-color: #d5a863; }
-.cockpit-signal-list time {
- color: rgba(244, 251, 255, 0.38);
- font-size: 6px;
- letter-spacing: 0.06em;
-}
-.cockpit-signal-list li > div { display: grid; gap: 2px; min-width: 0; }
-.cockpit-signal-list strong {
- color: color-mix(in srgb, var(--cockpit-accent) 78%, white);
- font-size: 10px;
- letter-spacing: 0.11em;
-}
-.cockpit-signal-target {
- display: grid;
- grid-template-columns: minmax(0, auto) minmax(14px, 1fr) 12px;
- align-items: center;
- gap: 7px;
- width: 100%;
- padding: 0;
- border: 0;
- background: transparent;
- color: color-mix(in srgb, var(--cockpit-accent) 78%, white);
- font: inherit;
- font-size: 11px;
- font-weight: 700;
- letter-spacing: 0.11em;
- text-align: left;
- cursor: pointer;
-}
-.cockpit-signal-list li.military .cockpit-signal-target { color: #f0c968; }
-.cockpit-signal-target-label {
- overflow: hidden;
- color: currentColor !important;
- font: inherit;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-.cockpit-signal-target-rule {
- height: 1px;
- overflow: visible !important;
- background: linear-gradient(90deg, currentColor, transparent);
- opacity: 0.42;
- transition: opacity 160ms ease, transform 160ms ease;
- transform-origin: left center;
-}
-.cockpit-signal-target-chevron {
- overflow: visible !important;
- color: currentColor !important;
- font-size: 12px !important;
- line-height: 1;
- transition: transform 160ms ease;
-}
-.cockpit-signal-target:hover,
-.cockpit-signal-target:focus-visible {
- color: #fff;
- outline: none;
- text-shadow: 0 0 8px color-mix(in srgb, var(--cockpit-accent) 72%, transparent);
-}
-.cockpit-signal-target:hover .cockpit-signal-target-rule,
-.cockpit-signal-target:focus-visible .cockpit-signal-target-rule {
- opacity: 0.82;
- transform: scaleX(1.04);
-}
-.cockpit-signal-target:hover .cockpit-signal-target-chevron,
-.cockpit-signal-target:focus-visible .cockpit-signal-target-chevron {
- transform: translateX(2px);
-}
-.cockpit-signal-list li.warning strong { color: #d5a863; }
-.cockpit-signal-list span {
- overflow: hidden;
- color: rgba(244, 251, 255, 0.66);
- font-size: 8px;
- letter-spacing: 0.06em;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-.cockpit-news-list {
- display: grid;
- gap: 4px;
- margin: 0;
- padding: 0;
- list-style: none;
-}
-.cockpit-news-list:empty { display: none; }
-.cockpit-news-list li {
- border-left: 1px solid color-mix(in srgb, var(--cockpit-accent) 62%, transparent);
- background: rgba(0, 7, 12, 0.3);
-}
-.cockpit-news-list a {
- display: grid;
- gap: 4px;
- padding: 7px 9px;
- color: inherit;
- text-decoration: none;
-}
-.cockpit-news-list a:hover, .cockpit-news-list a:focus-visible {
- background: color-mix(in srgb, var(--cockpit-accent) 8%, transparent);
- outline: 1px solid color-mix(in srgb, var(--cockpit-accent) 46%, transparent);
-}
-.cockpit-news-list strong {
- display: -webkit-box;
- overflow: hidden;
- color: rgba(244, 251, 255, 0.88);
- font-size: 8px;
- font-weight: 600;
- line-height: 1.35;
- letter-spacing: 0.045em;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
-}
-.cockpit-news-list span {
- color: color-mix(in srgb, var(--cockpit-accent) 65%, rgba(244, 251, 255, 0.42));
- font-size: 6px;
- letter-spacing: 0.08em;
- text-transform: uppercase;
-}
-.cockpit-brief-status {
- display: grid;
- min-height: 0;
- place-items: center;
- padding: 18px 10px;
- border: 0;
- color: rgba(244, 251, 255, 0.45);
- font-size: 7px;
- letter-spacing: 0.13em;
- text-align: center;
-}
-.cockpit-brief-status[data-state="unavailable"] { color: #d5a863; }
-.cockpit-local-place {
- display: grid;
- gap: 3px;
- padding: 5px 8px 8px;
- border-bottom: 1px solid rgba(244, 251, 255, 0.08);
-}
-.cockpit-local-place strong {
- overflow: hidden;
- color: #fff;
- font-size: 9px;
- letter-spacing: 0.1em;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-.cockpit-local-place small {
- color: rgba(244, 251, 255, 0.44);
- font-size: 6px;
- letter-spacing: 0.09em;
-}
-.cockpit-local-grid {
- display: grid;
- grid-template-columns: repeat(2, minmax(0, 1fr));
- gap: 1px;
- margin-top: 5px;
- background: rgba(244, 251, 255, 0.07);
-}
-.cockpit-local-grid > div {
- display: grid;
- min-height: 60px;
- align-content: center;
- gap: 3px;
- padding: 7px 9px;
- background: rgba(0, 7, 12, 0.76);
-}
-.cockpit-local-grid span {
- color: var(--cockpit-accent);
- font-size: 7px;
- font-weight: 700;
- letter-spacing: 0.13em;
-}
-.cockpit-local-grid strong {
- overflow: hidden;
- color: #fff;
- font-size: 13px;
- font-weight: 500;
- letter-spacing: 0.06em;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-#cockpit-local-condition {
- font-size: 10px;
- line-height: 1.15;
- letter-spacing: 0.03em;
- text-overflow: clip;
- white-space: normal;
-}
-.cockpit-local-grid small {
- color: rgba(244, 251, 255, 0.35);
- font-size: 6px;
- letter-spacing: 0.07em;
-}
-
-.cockpit-weather-credit {
- display: inline-block;
- margin-top: 7px;
- color: rgba(182, 226, 241, 0.72);
- font: 600 7px/1.2 var(--font-mono);
- letter-spacing: 0.08em;
- text-transform: uppercase;
-}
-.cockpit-signal-footer {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 8px;
- padding: 5px 8px 0;
- border-top: 1px solid rgba(244, 251, 255, 0.08);
- color: rgba(244, 251, 255, 0.34);
- font-size: 6px;
- letter-spacing: 0.1em;
-}
-.cockpit-signal-footer > span {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-.cockpit-brief-tabs { display: flex; gap: 3px; }
-.cockpit-brief-tabs button {
- padding: 2px 4px;
- border: 0;
- border-bottom: 1px solid rgba(244, 251, 255, 0.16);
- background: transparent;
- color: rgba(244, 251, 255, 0.34);
- font: inherit;
- letter-spacing: 0.08em;
- cursor: pointer;
-}
-.cockpit-brief-tabs button[aria-current="true"] {
- border-bottom-color: var(--cockpit-accent);
- color: color-mix(in srgb, var(--cockpit-accent) 80%, white);
-}
-.cockpit-brief-tabs button:hover, .cockpit-brief-tabs button:focus-visible {
- color: #fff;
- outline: none;
-}
-.cockpit-signal-window[data-layout-mode="rail-right-constrained"] { gap: 5px; }
-.cockpit-signal-window[data-collapsed="true"] {
- width: min(248px, 22vw);
- max-height: none;
- gap: 0;
- padding: 9px 10px;
- border-radius: 18px 7px 7px 18px;
- background: rgba(0, 7, 12, 0.54);
-}
-.cockpit-signal-window[data-collapsed="true"] .cockpit-signal-header {
- padding: 0;
- border-bottom: 0;
-}
-.cockpit-signal-window[data-collapsed="true"] .cockpit-route-card { display: none; }
-.cockpit-signal-window[data-collapsed="true"] :is(.cockpit-brief-stage, .cockpit-signal-footer) {
- display: none;
-}
-.cockpit-signal-window[data-collapsed="true"] .cockpit-brief-actions > :not(#cockpit-signal-toggle) {
- display: none;
-}
-@keyframes cockpit-brief-enter {
- from { opacity: 0; transform: translateY(8px); }
- to { opacity: 1; transform: translateY(0); }
-}
-.cockpit-help {
- position: absolute;
- left: clamp(24px, 4vw, 58px);
- bottom: clamp(22px, 4vh, 42px);
- color: rgba(244, 251, 255, 0.55);
- font-size: 9px;
- letter-spacing: 0.14em;
-}
-.cockpit-help span { color: var(--cockpit-accent); }
-body.cockpit-mode :is(
- #title-bar, #style-indicator, #top-center-actions, #traffic-sync-chip, #cctv-sync-chip,
- #command-dock,
- #military-awareness-panel, #military-awareness-direction-overlay,
- #cockpit-entry
-) { display: none !important; }
-body.cockpit-mode :is(#clear-selected-layers, #share-btn, #reset-globe-view) {
- display: none !important;
-}
-body.cockpit-mode #left-panel-stack {
- z-index: 147;
- display: flex;
- top: var(--left-stack-safe-top, var(--left-stack-top));
- bottom: var(--left-stack-safe-bottom, 24px);
- height: auto;
- max-height: none;
- transition: none;
-}
-body.cockpit-mode #left-panel-stack > #scene-panel { display: none !important; }
-body.cockpit-mode #right-context-rail {
- display: none !important;
-}
-
-/* Keep the user's intelligence HUD text available in first person. It stays
- subordinate to the visor instruments and occupies the four peripheral
- corridors, leaving the optical center, context rails, and heading tape free. */
-body.cockpit-mode #intel-hud.active {
- z-index: 146;
- opacity: 0.72;
- visibility: visible;
-}
-body.cockpit-mode #intel-hud .hud-top-left,
-body.cockpit-mode #intel-hud .hud-bottom-left {
- left: clamp(18px, 3vw, 44px);
- transform: scale(0.78);
- transform-origin: left center;
-}
-body.cockpit-mode #intel-hud .hud-top-right,
-body.cockpit-mode #intel-hud .hud-bottom-right {
- right: clamp(18px, 3vw, 44px);
- transform: scale(0.78);
- transform-origin: right center;
-}
-body.cockpit-mode #intel-hud .hud-top-left,
-body.cockpit-mode #intel-hud .hud-top-right {
- top: clamp(104px, 13vh, 138px);
-}
-body.cockpit-mode #intel-hud .hud-bottom-left,
-body.cockpit-mode #intel-hud .hud-bottom-right {
- bottom: clamp(84px, 11vh, 118px);
-}
-body.cockpit-mode #intel-hud .hud-summary-wrap { max-width: min(34vw, 380px); }
-body.cockpit-mode #intel-hud .hud-summary { font-size: 9px; }
-body.cockpit-mode #intel-hud .hud-left-edge { left: 22px; }
-body.cockpit-mode #intel-hud .hud-right-edge { right: 22px; }
-
-@media (max-width: 760px) {
- #view-switcher { right: 16px; bottom: 16px; }
- body.cockpit-mode #view-switcher {
- right: auto;
- bottom: max(76px, env(safe-area-inset-bottom));
- width: max-content;
- max-width: calc(100vw - 20px);
- margin-bottom: 0;
- }
- body.cockpit-mode #view-switcher button {
- padding-inline: 9px;
- font-size: 7px;
- }
- #cockpit-entry { left: auto; right: 16px; bottom: 88px; }
- body.cockpit-mode #left-panel-stack,
- body.cockpit-mode #intel-hud,
- body.cockpit-mode .cockpit-context-window,
- body.cockpit-mode .cockpit-signal-window {
- display: none !important;
- }
- body.cockpit-mode #right-context-rail {
- display: none !important;
- }
- body.cockpit-mode .cockpit-utility-controls {
- top: auto;
- right: 12px;
- bottom: 152px;
- max-width: calc(100vw - 24px);
- }
- body.cockpit-mode .cockpit-utility-controls {
- flex-direction: row;
- }
- body.cockpit-mode .cockpit-utility-launcher {
- width: min(150px, calc((100vw - 31px) / 2));
- min-height: 42px;
- }
- body.cockpit-mode .cockpit-utility-control.is-expanded {
- position: fixed;
- top: 96px;
- right: 12px;
- width: min(272px, calc(100vw - 24px));
- max-height: calc(100vh - 260px);
- }
- body.cockpit-mode .cockpit-utility-controls:has(.cockpit-utility-control.is-expanded)
- > .cockpit-utility-control:not(.is-expanded) { display: none; }
- body.cockpit-mode .cockpit-utility-popover {
- position: static;
- width: 100%;
- }
- .cockpit-topline { grid-template-columns: 1fr auto; }
- .cockpit-mode-chip { display: none; }
- .cockpit-readout { min-width: 76px; padding: 4px 6px 5px; }
- .cockpit-readout strong { font-size: clamp(24px, 8vw, 34px); }
- .cockpit-readout-label { font-size: 7px; letter-spacing: 0.12em; }
- .cockpit-readout-unit { font-size: 8px; }
- .cockpit-speed { transform: perspective(600px) rotateY(7deg); }
- .cockpit-altitude { transform: perspective(600px) rotateY(-7deg); }
- .cockpit-compass { width: 92vw; }
- .cockpit-instrument-row {
- grid-template-columns: minmax(76px, 1fr) auto minmax(76px, 1fr);
- gap: 8px;
- }
- .cockpit-context-window {
- top: auto;
- left: 12px;
- right: 12px;
- bottom: 180px;
- width: auto;
- max-height: min(38vh, 280px);
- padding: 10px 12px 8px;
- border-radius: 20px 20px 10px 10px;
- transform: translateZ(22px);
- }
- .cockpit-context-window[data-collapsed="true"] {
- right: auto;
- width: min(248px, calc(100vw - 24px));
- max-height: none;
- }
- .cockpit-signal-window {
- top: 112px;
- right: 12px;
- width: calc(100vw - 24px);
- max-height: min(28vh, 220px);
- padding: 10px 12px 8px;
- border-radius: 20px 10px 10px 20px;
- transform: translateZ(22px);
- }
- .cockpit-signal-window[data-collapsed="true"] {
- left: auto;
- width: min(248px, calc(100vw - 24px));
- max-height: none;
- }
- .cockpit-context-header { grid-template-columns: 1fr auto; }
- .cockpit-context-qualifier { display: none; }
- .cockpit-context-cohorts small { display: none; }
- .cockpit-context-cohorts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
- .cockpit-context-cohorts > div { padding: 4px 6px; }
- .cockpit-context-nearest { grid-template-columns: 20px minmax(0, 1fr) auto; gap: 6px; }
- #cockpit-context-bearing { display: none; }
- .cockpit-context-footer { font-size: 5px; }
- .cockpit-compass-tape span {
- transform:
- translateX(calc(-50% + (var(--slot) * 52px)))
- translateY(calc(var(--depth) * 7px))
- rotateZ(calc(var(--slot) * 3deg));
- }
- .cockpit-pitch-rail { display: none; }
- .cockpit-altitude-rim { display: none; }
- .cockpit-visor-status { display: none; }
-}
-
-@media (prefers-reduced-motion: reduce) {
- .cockpit-altitude-rim-pointer .material-symbols-outlined { animation: none; }
- .cockpit-altitude-rim-scale > span { transition: none; }
- [data-cockpit-brief-page] { animation: none; }
-}
-
-/* ── Safe Frame Overlay ─────────────────────── */
-#safe-frame-overlay {
- position: fixed;
- inset: 0;
- z-index: 95;
- pointer-events: none;
- display: none;
-}
-
-#safe-frame-overlay.active {
- display: block;
-}
-
-#safe-frame-box {
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- width: min(90vw, calc(90vh * (16 / 9)));
- aspect-ratio: 16 / 9;
- border: 1px solid rgba(255, 255, 255, 0.28);
- box-shadow:
- 0 0 0 1px rgba(0, 0, 0, 0.35),
- inset 0 0 0 1px rgba(255, 255, 255, 0.06);
-}
-
-#safe-frame-overlay.ratio-9-16 #safe-frame-box {
- width: min(58vh, 76vw);
- aspect-ratio: 9 / 16;
-}
-
-/* Rule-of-thirds guides */
-#safe-frame-box::before,
-#safe-frame-box::after {
- content: '';
- position: absolute;
- inset: 0;
- pointer-events: none;
-}
-
-#safe-frame-box::before {
- background:
- linear-gradient(to right,
- transparent 33.333%,
- rgba(255, 255, 255, 0.2) 33.333%,
- rgba(255, 255, 255, 0.2) 33.7%,
- transparent 33.7%,
- transparent 66.333%,
- rgba(255, 255, 255, 0.2) 66.333%,
- rgba(255, 255, 255, 0.2) 66.7%,
- transparent 66.7%
- ),
- linear-gradient(to bottom,
- transparent 33.333%,
- rgba(255, 255, 255, 0.2) 33.333%,
- rgba(255, 255, 255, 0.2) 33.7%,
- transparent 33.7%,
- transparent 66.333%,
- rgba(255, 255, 255, 0.2) 66.333%,
- rgba(255, 255, 255, 0.2) 66.7%,
- transparent 66.7%
- );
-}
-
-/* ── Orbit Indicator ─────────────────────────── */
-#orbit-indicator {
- position: fixed;
- top: 70px;
- right: 36px;
- z-index: 100;
- font-family: var(--font-mono);
- font-size: 10px;
- letter-spacing: 2px;
- color: var(--accent);
- text-shadow: 0 0 12px var(--accent-glow);
- pointer-events: none;
- user-select: none;
- opacity: 0;
- visibility: hidden;
- transition: opacity var(--transition-smooth), visibility var(--transition-smooth);
-}
-
-#orbit-indicator.active {
- opacity: 1;
- visibility: visible;
-}
-
-.orbit-icon {
- font-size: 13px;
- vertical-align: middle;
- margin-right: 2px;
-}
-
-/* ── Intelligence HUD Overlay ────────────────── */
-#intel-hud {
- position: fixed;
- inset: 0;
- z-index: 2;
- pointer-events: none;
- opacity: 0;
- visibility: hidden;
- transition: opacity 0.4s ease, visibility 0.4s ease;
- --hud-color: rgba(0, 255, 255, 0.6);
- --hud-glow: rgba(0, 255, 255, 0.4);
- --hud-border: rgba(0, 255, 255, 0.15);
-}
-
-#intel-hud.active {
- opacity: 1;
- visibility: visible;
-}
-
-#intel-hud * {
- font-family: var(--font-mono);
- color: var(--hud-color);
- text-shadow: 0 0 4px var(--hud-glow);
- text-transform: uppercase;
- line-height: 1.6;
-}
-
-.hud-top-bar,
-.hud-bottom-bar {
- display: none;
- position: absolute;
- left: 50%;
- transform: translateX(-50%);
- width: min(980px, calc(100vw - 120px));
- border: 1px solid var(--hud-border);
- background: rgba(0, 0, 0, 0.34);
- padding: 4px 10px;
- font-size: 10px;
- letter-spacing: 1.4px;
- justify-content: space-between;
- align-items: center;
- pointer-events: none;
-}
-
-.hud-top-bar {
- top: 70px;
-}
-
-.hud-bottom-bar {
- bottom: 110px;
- justify-content: center;
-}
-
-.hud-top-bar-center {
- opacity: 0.84;
-}
-
-.hud-top-bar-left,
-.hud-top-bar-right {
- opacity: 0.6;
-}
-
-/* Corner blocks */
-.hud-corner {
- position: absolute;
- display: flex;
- align-items: flex-start;
- gap: 6px;
- padding: 4px;
-}
-
-.hud-top-left {
- top: 120px;
- left: 36px;
-}
-
-.hud-top-right {
- top: 120px;
- right: 36px;
-}
-
-.hud-bottom-left {
- bottom: 180px;
- left: 36px;
-}
-
-.hud-bottom-right {
- bottom: 180px;
- right: 36px;
-}
-
-.hud-bracket {
- font-size: 22px;
- line-height: 1;
- opacity: 0.6;
-}
-
-.hud-content {
- font-size: 13px;
- letter-spacing: 2px;
-}
-
-.hud-ais-vessel {
- margin-top: 6px;
- max-width: 340px;
- white-space: pre-line;
- line-height: 1.35;
- opacity: 0.64;
-}
-
-.hud-ais-vessel.active {
- opacity: 0.95;
-}
-
-.hud-classification {
- font-size: 12px;
- letter-spacing: 2.5px;
- font-weight: 600;
- margin-bottom: 3px;
-}
-
-.hud-system {
- font-size: 13px;
- opacity: 0.8;
-}
-
-.hud-mode {
- font-size: 16px;
- font-weight: 700;
- letter-spacing: 4px;
- margin-top: 3px;
-}
-
-.hud-summary-wrap {
- margin-top: 6px;
- max-width: 420px;
-}
-
-.hud-summary-label {
- font-size: 9px;
- letter-spacing: 1.8px;
- opacity: 0.55;
-}
-
-.hud-summary {
- margin-top: 2px;
- min-height: 16px;
- font-size: 11px;
- letter-spacing: 1.2px;
- opacity: 0.88;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-.hud-rec {
- font-size: 13px;
- letter-spacing: 2px;
-}
-
-#hud-rec-dot {
- color: #ff3333;
- text-shadow: 0 0 6px rgba(255, 51, 51, 0.8);
- font-size: 14px;
- vertical-align: middle;
-}
-
-.hud-orbital {
- font-size: 12px;
- opacity: 0.7;
- letter-spacing: 1.5px;
-}
-
-/* Edge annotations (vertical text) */
-.hud-edge {
- position: absolute;
- font-size: 10px;
- letter-spacing: 1.5px;
- opacity: 0.5;
-}
-
-.hud-left-edge {
- left: 36px;
- top: 50%;
- transform: translateY(-50%) rotate(-90deg);
- transform-origin: left center;
- white-space: nowrap;
- display: flex;
- gap: 20px;
-}
-
-.hud-right-edge {
- right: 36px;
- top: 50%;
- transform: translateY(-50%) rotate(90deg);
- transform-origin: right center;
- white-space: nowrap;
- display: flex;
- gap: 20px;
-}
-
-#intel-hud[data-variant='tactical'] .hud-top-bar,
-#intel-hud[data-variant='tactical'] .hud-bottom-bar {
- display: none;
-}
-
-#intel-hud[data-variant='operator'] .hud-top-bar,
-#intel-hud[data-variant='operator'] .hud-bottom-bar {
- display: flex;
-}
-
-#intel-hud[data-variant='operator'] .hud-top-bar {
- top: max(10vh, 90px);
- left: 50%;
- right: auto;
- width: min(52vw, 720px);
- transform: translateX(-50%);
- border-color: rgba(255, 255, 255, 0.24);
- background: linear-gradient(90deg, rgba(0, 0, 0, 0.56), rgba(8, 26, 34, 0.5));
- box-shadow: 0 0 24px rgba(0, 255, 255, 0.08);
-}
-
-#intel-hud[data-variant='tactical'] .hud-top-left,
-#intel-hud[data-variant='tactical'] .hud-top-right,
-#intel-hud[data-variant='operator'] .hud-top-left,
-#intel-hud[data-variant='operator'] .hud-top-right {
- top: max(14vh, 136px);
-}
-
-#intel-hud[data-variant='operator'] .hud-bottom-bar {
- border-color: rgba(255, 255, 255, 0.2);
- background: linear-gradient(90deg, rgba(0, 0, 0, 0.52), rgba(8, 22, 18, 0.52));
-}
-
-#intel-hud[data-variant='operator'] .hud-corner {
- padding: 8px 10px;
- border: 1px solid rgba(255, 255, 255, 0.16);
- border-radius: 8px;
- background: rgba(0, 0, 0, 0.36);
-}
-
-#intel-hud[data-variant='operator'] .hud-bracket {
- display: none;
-}
-
-#intel-hud[data-variant='minimal'] .hud-top-right,
-#intel-hud[data-variant='minimal'] .hud-bottom-right,
-#intel-hud[data-variant='minimal'] .hud-left-edge,
-#intel-hud[data-variant='minimal'] .hud-right-edge,
-#intel-hud[data-variant='minimal'] .hud-classification,
-#intel-hud[data-variant='minimal'] .hud-system {
- display: none;
-}
-
-#intel-hud[data-variant='minimal'] .hud-top-left {
- top: 88px;
-}
-
-#intel-hud[data-variant='minimal'] .hud-bottom-left {
- bottom: 12vh;
-}
-
-#intel-hud[data-variant='minimal'] .hud-bottom-bar {
- display: flex;
- bottom: calc(12vh + 4rem);
-}
-
-#intel-hud[data-variant='minimal'] .hud-summary-wrap {
- max-width: 280px;
-}
-
-/* ── Data Layer Toggle Panel ─────────────────── */
-#left-panel-stack {
- position: fixed;
- top: var(--left-stack-safe-top, var(--left-stack-top));
- bottom: var(--left-stack-safe-bottom, 4vh);
- left: var(--left-stack-x);
- z-index: 100;
- width: 360px;
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- gap: 8px;
- pointer-events: none;
- transition: top var(--transition-fast), bottom var(--transition-fast);
-}
-
-#data-panel {
- --panel-expanded-width: 280px;
- position: fixed;
- top: calc(var(--left-stack-top) + var(--left-stack-gap));
- left: var(--left-stack-x);
- right: auto;
- bottom: auto;
- z-index: 100;
- width: var(--panel-expanded-width);
- opacity: 0;
- visibility: hidden;
- transform: translateY(8px);
- transition: opacity var(--transition-smooth), visibility var(--transition-smooth), transform var(--transition-smooth);
-}
-
-#data-panel.active {
- opacity: 1;
- visibility: visible;
- transform: translateY(0);
-}
-
-#data-panel .panel-glow {
- position: absolute;
- inset: -20px;
- background: radial-gradient(ellipse at center, var(--accent-dim) 0%, transparent 60%);
- filter: blur(20px);
- opacity: 0.25;
- pointer-events: none;
-}
-
-.data-panel-inner {
- position: relative;
- background: var(--glass-bg);
- border: 1px solid var(--glass-border);
- border-radius: var(--panel-radius);
- padding: 14px 16px 12px;
- backdrop-filter: blur(24px) saturate(1.4);
- -webkit-backdrop-filter: blur(24px) saturate(1.4);
- box-shadow:
- 0 8px 32px rgba(0, 0, 0, 0.5),
- 0 0 0 1px rgba(255, 255, 255, 0.03) inset,
- 0 1px 0 rgba(255, 255, 255, 0.06) inset;
- max-height: min(620px, calc(100vh - var(--left-stack-top) - var(--left-stack-gap) - 36px));
- display: flex;
- flex-direction: column;
- min-height: 0;
-}
-
-.data-toggle-list {
- display: flex;
- flex-direction: column;
- gap: 2px;
- flex: 1 1 auto;
- min-height: 0;
- max-height: 100%;
- overflow-y: auto;
- overscroll-behavior: contain;
- padding-right: 4px;
- scrollbar-width: thin;
- scrollbar-color: rgba(0, 212, 255, 0.5) rgba(255, 255, 255, 0.04);
- scrollbar-gutter: stable;
-}
-
-.data-toggle-list::-webkit-scrollbar {
- width: 6px;
-}
-
-.data-toggle-list::-webkit-scrollbar-track {
- background: rgba(255, 255, 255, 0.04);
- border-radius: 999px;
-}
-
-.data-toggle-list::-webkit-scrollbar-thumb {
- background: linear-gradient(180deg, rgba(0, 212, 255, 0.65), rgba(0, 212, 255, 0.2));
- border-radius: 999px;
-}
-
-.data-toggle-row {
- padding: 8px 10px 6px;
- border-radius: 8px;
- transition: background var(--transition-fast);
-}
-
-.data-toggle-row:hover {
- background: rgba(255, 255, 255, 0.03);
-}
-
-/* Selected-only, provenance-first proximity results. This is intentionally a
- contextual panel, not a radar/engagement display. */
-#global-context-panel {
- --panel-expanded-width: 330px;
- width: var(--panel-expanded-width);
- max-width: 100%;
- min-height: 0;
-}
-#right-context-rail {
- --right-display-collapsed-width: var(--left-collapsed-width);
- --right-context-collapsed-width: var(--left-collapsed-width);
- position: fixed;
- z-index: 110;
- top: var(--right-stack-safe-top, 26vh);
- right: var(--right-rail-x);
- width: 330px;
- max-height: var(--right-stack-max-height, 70vh);
- display: flex;
- flex-direction: column;
- align-items: flex-end;
- gap: 8px;
- pointer-events: none;
- transition: top var(--transition-fast), max-height var(--transition-fast);
-}
-#right-context-rail > #pp-toggles,
-#right-context-rail > #cctv-panel,
-#right-context-rail > #global-context-panel {
- position: relative;
- inset: auto;
- flex: 0 0 auto;
- pointer-events: auto;
-}
-#right-context-rail #global-context-panel {
- width: 100%;
- max-height: 100%;
- pointer-events: auto;
-}
-#right-context-rail #cctv-panel {
- width: 100%;
- max-height: 100%;
- pointer-events: auto;
-}
-#right-context-rail #cctv-panel.collapsed {
- width: var(--right-display-collapsed-width);
- margin-left: auto;
-}
-#right-context-rail > #pp-toggles.collapsed {
- width: var(--right-display-collapsed-width);
- margin-left: auto;
-}
-#right-context-rail > #pp-toggles.collapsed .pp-header-row {
- width: 100%;
-}
-#right-context-rail > #pp-toggles.collapsed .pp-header-row,
-#right-context-rail #cctv-panel.collapsed .cctv-panel-inner,
-#right-context-rail #global-context-panel.collapsed .global-context-panel-inner {
- height: 50px;
- min-height: 50px;
- box-sizing: border-box;
-}
-#right-context-rail #cctv-panel:not(.collapsed) .cctv-panel-inner {
- max-height: 100%;
- overflow-y: auto;
- scrollbar-gutter: stable;
-}
-#right-context-rail .global-context-panel-inner { max-height: 100%; }
-#right-context-rail #global-context-panel:not(.collapsed) .global-context-panel-inner {
- max-height: 100%;
- overflow-y: auto;
- scrollbar-gutter: stable;
-}
-#right-context-rail #global-context-panel.collapsed {
- width: var(--right-context-collapsed-width);
- /* Keep the compact Context tab on the rail edge rather than leaving it
- stranded at the rail's expanded-width origin. */
- margin-left: auto;
-}
-#right-context-rail #global-context-panel.collapsed .global-context-panel-inner {
- min-height: 42px;
- box-sizing: border-box;
- justify-content: center;
- overflow: visible;
- padding: 8px 10px 8px 14px;
-}
-#right-context-rail #global-context-panel.collapsed .panel-header {
- margin: 0;
-}
-#right-context-rail.layout-focus {
- height: var(--right-stack-max-height);
-}
-#right-context-rail.layout-exclusive > [data-panel-id].collapsed {
- display: none;
-}
-#right-context-rail.layout-focus > [data-panel-id].collapsed {
- display: block;
- flex: 0 0 auto;
-}
-#right-context-rail.layout-focus.layout-exclusive > [data-panel-id].collapsed {
- display: none;
-}
-#right-context-rail.layout-focus > #pp-toggles:not(.collapsed),
-#right-context-rail.layout-focus > #cctv-panel:not(.collapsed),
-#right-context-rail.layout-focus > #global-context-panel:not(.collapsed) {
- flex: 0 1 var(--right-panel-allocated-height);
- height: var(--right-panel-allocated-height);
- min-height: 0;
- max-height: var(--right-panel-allocated-height);
-}
-#right-context-rail.layout-focus > #pp-toggles:not(.collapsed) {
- overflow-y: auto;
- overscroll-behavior: contain;
- scrollbar-width: thin;
- scrollbar-color: rgba(0, 212, 255, 0.4) transparent;
-}
-#right-context-rail.layout-focus > #cctv-panel:not(.collapsed) .cctv-panel-inner,
-#right-context-rail.layout-focus > #global-context-panel:not(.collapsed) .global-context-panel-inner {
- height: 100%;
- box-sizing: border-box;
-}
-#right-context-rail #context-missions-view:not([hidden]),
-#right-context-rail #space-mission-panel-host,
-#right-context-rail .space-mission-roster {
- min-height: 0;
-}
-#right-context-rail.layout-focus #context-missions-view:not([hidden]),
-#right-context-rail.layout-focus #space-mission-panel-host,
-#right-context-rail.layout-focus .space-mission-roster {
- display: flex;
- flex: 1 1 auto;
- flex-direction: column;
-}
-#right-context-rail.layout-focus .space-mission-roster-list {
- flex: 1 1 auto;
- max-height: none;
-}
-#space-mission-panel {
- width: 100%;
- margin-top: 8px;
- pointer-events: auto;
-}
-#space-mission-panel-host:has(#space-mission-panel:not([hidden])) > .context-mode-standby,
-#space-mission-panel-host:has(#space-mission-panel:not([hidden])) > .space-mission-roster {
- display: none;
-}
-#space-mission-panel-host .space-mission-roster {
- display: grid;
- min-height: 0;
- gap: 8px;
- padding: 9px;
- border: 1px solid rgba(98, 181, 255, .2);
- border-radius: 7px;
- background: rgba(4, 17, 31, .28);
-}
-#space-mission-panel-host .space-mission-roster-header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 10px;
- padding: 1px 3px 7px;
- border-bottom: 1px solid rgba(34, 230, 230, .14);
- font-family: 'JetBrains Mono', monospace;
-}
-#space-mission-panel-host .space-mission-roster-header > div {
- display: grid;
- min-width: 0;
- gap: 3px;
-}
-#space-mission-panel-host .space-mission-roster-header strong {
- color: #8fcfff;
- font-size: 9px;
- letter-spacing: .16em;
-}
-#space-mission-panel-host .space-mission-roster-header span {
- color: rgba(190, 230, 230, .46);
- font-size: 7px;
- letter-spacing: .1em;
-}
-#space-mission-panel-host .space-mission-roster-header output {
- flex: 0 0 auto;
- color: #22e6e6;
- font-size: 9px;
- letter-spacing: .08em;
-}
-#space-mission-panel-host .space-mission-roster-list {
- display: grid;
- max-height: min(43vh, 420px);
- gap: 4px;
- overflow-x: hidden;
- overflow-y: auto;
- padding-right: 3px;
- scrollbar-color: rgba(34, 230, 230, .38) transparent;
- scrollbar-width: thin;
-}
-#space-mission-panel-host .space-mission-roster-item {
- position: relative;
- display: grid;
- grid-template-columns: 10px minmax(0, 1fr) 12px;
- align-items: center;
- gap: 7px;
- width: 100%;
- min-height: 42px;
- padding: 7px 7px;
- border: 1px solid rgba(98, 181, 255, .13);
- border-radius: 4px;
- color: #d8ffff;
- background: rgba(42, 113, 171, .045);
- font-family: 'JetBrains Mono', monospace;
- text-align: left;
- cursor: pointer;
- transition: border-color .15s ease, background .15s ease, transform .15s ease;
-}
-#space-mission-panel-host .space-mission-roster-item::before {
- content: '';
- position: absolute;
- inset: 3px;
- z-index: 1;
- opacity: 0;
- background:
- linear-gradient(#22e6e6, #22e6e6) left top / 9px 1px no-repeat,
- linear-gradient(#22e6e6, #22e6e6) left top / 1px 9px no-repeat,
- linear-gradient(#22e6e6, #22e6e6) right top / 9px 1px no-repeat,
- linear-gradient(#22e6e6, #22e6e6) right top / 1px 9px no-repeat,
- linear-gradient(#22e6e6, #22e6e6) left bottom / 9px 1px no-repeat,
- linear-gradient(#22e6e6, #22e6e6) left bottom / 1px 9px no-repeat,
- linear-gradient(#22e6e6, #22e6e6) right bottom / 9px 1px no-repeat,
- linear-gradient(#22e6e6, #22e6e6) right bottom / 1px 9px no-repeat;
- filter: drop-shadow(0 0 4px rgba(34, 230, 230, .45));
- pointer-events: none;
- transition: opacity .12s ease;
-}
-#space-mission-panel-host .space-mission-roster-item:hover,
-#space-mission-panel-host .space-mission-roster-item:focus-visible {
- border-color: rgba(34, 230, 230, .58);
- outline: none;
- background: rgba(34, 230, 230, .09);
- transform: translateX(2px);
-}
-#space-mission-panel-host .space-mission-roster-item:hover::before,
-#space-mission-panel-host .space-mission-roster-item:focus-visible::before {
- opacity: 1;
-}
-#space-mission-panel-host .space-mission-roster-item > * {
- position: relative;
- z-index: 2;
-}
-#space-mission-panel-host .space-mission-roster-marker {
- width: 5px;
- height: 5px;
- justify-self: center;
- border-radius: 50%;
- background: var(--mission-roster-color, #22e6e6);
- box-shadow: 0 0 7px color-mix(in srgb, var(--mission-roster-color, #22e6e6) 70%, transparent);
-}
-#space-mission-panel-host .space-mission-roster-copy {
- display: grid;
- min-width: 0;
- gap: 3px;
-}
-#space-mission-panel-host .space-mission-roster-copy strong,
-#space-mission-panel-host .space-mission-roster-copy small {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-#space-mission-panel-host .space-mission-roster-copy strong {
- color: #d8ffff;
- font-size: 9px;
- font-weight: 500;
- letter-spacing: .07em;
-}
-#space-mission-panel-host .space-mission-roster-copy small {
- color: rgba(190, 230, 230, .48);
- font-size: 7px;
- letter-spacing: .035em;
-}
-#space-mission-panel-host .space-mission-roster-chevron {
- color: rgba(34, 230, 230, .54);
- font-size: 16px;
- line-height: 1;
-}
-#space-mission-panel-host .space-mission-roster-empty {
- padding: 18px 10px;
- color: rgba(190, 230, 230, .48);
- font: 8px/1.5 'JetBrains Mono', monospace;
- letter-spacing: .09em;
- text-align: center;
-}
-#space-mission-panel-host .space-mission-roster-focus-continuation {
- margin: 0;
- padding: 3px;
- color: rgba(190, 230, 230, .58);
- font: 7px/1.4 'JetBrains Mono', monospace;
- letter-spacing: .08em;
- text-align: center;
-}
-#space-mission-panel .space-mission-view-header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 8px 0 2px;
- border-top: 1px solid rgba(34, 230, 230, .18);
- color: rgba(190, 230, 230, .58);
- font: 8px 'JetBrains Mono', monospace;
- letter-spacing: .18em;
-}
-#space-mission-panel .space-mission-view-header button {
- width: 24px;
- height: 24px;
- border: 1px solid rgba(98, 181, 255, .24);
- border-radius: 5px;
- color: rgba(190, 230, 230, .7);
- background: rgba(42, 113, 171, .08);
- cursor: pointer;
-}
-#space-mission-panel .space-mission-view-header button:hover {
- border-color: #22e6e6;
- color: #fff;
-}
-#space-mission-panel .space-mission-detail {
- display: grid;
- gap: 8px;
- padding: 12px 0;
- color: var(--hud-cyan, #22e6e6);
- font: 11px 'JetBrains Mono', monospace;
- letter-spacing: .08em;
-}
-#space-mission-panel .space-mission-detail strong { font-size: 14px; }
-#space-mission-panel .space-mission-detail span { color: rgba(190, 230, 230, .7); }
-#space-mission-panel .space-mission-detail b { color: #d8ffff; font-weight: 400; }
-#space-mission-panel .mission-data-section {
- margin: 0 0 11px;
- border-top: 1px solid rgba(34, 230, 230, .18);
- padding-top: 9px;
-}
-#space-mission-panel .mission-data-section h4 {
- margin: 0 0 6px;
- color: #22e6e6;
- font: 10px 'JetBrains Mono', monospace;
- letter-spacing: .17em;
-}
-#space-mission-panel .mission-table-scroll { overflow-x: auto; }
-#space-mission-panel .mission-data-table {
- width: 100%;
- border-collapse: collapse;
- table-layout: fixed;
- color: #d8ffff;
- font: 9px 'JetBrains Mono', monospace;
- letter-spacing: .025em;
-}
-#space-mission-panel .mission-data-table th {
- padding: 4px 5px;
- border-bottom: 1px solid rgba(34, 230, 230, .22);
- color: rgba(190, 230, 230, .58);
- font-weight: 400;
- text-align: left;
-}
-#space-mission-panel .mission-data-table td {
- overflow-wrap: anywhere;
- padding: 6px 5px;
- border-bottom: 1px solid rgba(34, 230, 230, .1);
- vertical-align: top;
-}
-#space-mission-panel .mission-data-table th:nth-child(1),
-#space-mission-panel .mission-data-table td:nth-child(1) { width: 34%; }
-#space-mission-panel .mission-data-table th:nth-child(2),
-#space-mission-panel .mission-data-table td:nth-child(2) { width: 25%; }
-#space-mission-panel .mission-data-table small {
- display: block;
- margin-top: 3px;
- color: rgba(190, 230, 230, .56);
- font-size: 8px;
- line-height: 1.35;
-}
-#space-mission-panel .mission-table-empty {
- color: rgba(190, 230, 230, .56);
- text-align: center;
-}
-#space-mission-panel .mission-replay-speed-control {
- display: grid;
- gap: 5px;
- margin: 1px 0 10px;
- padding: 8px 10px 6px;
- border: 1px solid rgba(34, 230, 230, .2);
- border-radius: 5px;
- background: rgba(3, 21, 31, .36);
-}
-#space-mission-panel .mission-replay-speed-control[hidden] { display: none; }
-#space-mission-panel .mission-replay-speed-header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- color: rgba(190, 230, 230, .68);
- font: 8px 'JetBrains Mono', monospace;
- letter-spacing: .16em;
-}
-#space-mission-panel .mission-replay-speed-header output {
- min-width: 42px;
- text-align: right;
-}
-#space-mission-panel [data-mission-replay-speed] {
- width: 100%;
-}
-#space-mission-panel .mission-replay-speed-scale {
- display: flex;
- justify-content: space-between;
- color: rgba(190, 230, 230, .42);
- font: 7px 'JetBrains Mono', monospace;
- letter-spacing: .08em;
-}
-
-#space-mission-panel .mission-action-row {
- display: flex;
- gap: 8px;
- margin: 1px 0 10px;
-}
-#space-mission-panel .mission-replay-button,
-#space-mission-panel .mission-focus-button {
- flex: 1;
- min-width: 0;
- padding: 9px 12px;
- border: 1px solid rgba(255, 159, 67, .62);
- border-radius: 5px;
- color: #ffc078;
- background: linear-gradient(90deg, rgba(255, 159, 67, .08), rgba(34, 230, 230, .08));
- font: 9px 'JetBrains Mono', monospace;
- letter-spacing: .16em;
- cursor: pointer;
- transition: border-color .15s ease, color .15s ease, background .15s ease, box-shadow .15s ease;
-}
-#space-mission-panel .mission-focus-button {
- border-color: rgba(34, 230, 230, .58);
- color: #22e6e6;
- background: rgba(34, 230, 230, .07);
-}
-#space-mission-panel .mission-replay-button:hover,
-#space-mission-panel .mission-replay-button:focus-visible,
-#space-mission-panel .mission-focus-button:hover,
-#space-mission-panel .mission-focus-button:focus-visible {
- border-color: #ffb45f;
- color: #fff;
- outline: none;
- box-shadow: 0 0 14px rgba(255, 159, 67, .14);
-}
-#space-mission-panel .mission-focus-button:hover,
-#space-mission-panel .mission-focus-button:focus-visible {
- border-color: #22e6e6;
- box-shadow: 0 0 14px rgba(34, 230, 230, .14);
-}
-#space-mission-panel .mission-replay-button.active {
- border-color: #22e6e6;
- color: #d8ffff;
- background: rgba(34, 230, 230, .13);
- box-shadow: inset 0 0 16px rgba(34, 230, 230, .08);
-}
-#space-mission-panel .mission-replay-transport {
- flex: 1;
- min-width: 0;
- display: grid;
- grid-template-columns: repeat(3, minmax(0, 1fr));
- gap: 5px;
-}
-#space-mission-panel .mission-replay-transport[hidden] { display: none; }
-#space-mission-panel .mission-replay-transport button {
- min-width: 0;
- min-height: 34px;
- padding: 0;
- border: 1px solid rgba(34, 230, 230, .5);
- border-radius: 4px;
- color: #22e6e6;
- background: rgba(34, 230, 230, .08);
- font: 15px/1 'JetBrains Mono', monospace;
- cursor: pointer;
- transition: border-color .15s ease, color .15s ease, background .15s ease, box-shadow .15s ease, opacity .15s ease;
-}
-#space-mission-panel .mission-replay-transport button:hover:not(:disabled),
-#space-mission-panel .mission-replay-transport button:focus-visible {
- border-color: #d8ffff;
- color: #fff;
- outline: none;
- background: rgba(34, 230, 230, .16);
- box-shadow: 0 0 12px rgba(34, 230, 230, .14);
-}
-#space-mission-panel .mission-replay-transport button:disabled {
- opacity: .28;
- cursor: default;
-}
-#space-mission-panel .mission-replay-transport button.cancel {
- border-color: rgba(255, 159, 67, .58);
- color: #ffb15c;
- background: rgba(255, 159, 67, .08);
-}
-#space-mission-panel .mission-replay-transport.is-paused [data-mission-replay-play] {
- border-color: #22e6e6;
- color: #d8ffff;
- background: rgba(34, 230, 230, .18);
- box-shadow: inset 0 0 12px rgba(34, 230, 230, .1);
-}
-#space-mission-panel .space-mission-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
-#space-mission-panel .mission-nav-button {
- min-width: 94px;
- padding: 7px 10px;
- border: 1px solid rgba(34, 230, 230, .55);
- background: rgba(8, 34, 42, .72);
- color: #22e6e6;
- font: 11px 'JetBrains Mono', monospace;
- letter-spacing: .12em;
- cursor: pointer;
- transition: background .15s ease, border-color .15s ease, opacity .15s ease;
-}
-#space-mission-panel .mission-nav-button:hover:not(:disabled) { background: rgba(34, 230, 230, .18); border-color: #22e6e6; }
-#space-mission-panel .mission-nav-button:disabled { cursor: not-allowed; opacity: .28; }
-#space-mission-panel .mission-nav-button span { font-size: 18px; line-height: 0; vertical-align: -2px; }
-#space-mission-panel .mission-nav-index { min-width: 58px; text-align: center; color: #d8ffff; font: 11px 'JetBrains Mono', monospace; letter-spacing: .1em; }
-#space-mission-panel button { cursor: pointer; }
-
-.mission-replay-vehicle-overlay {
- --mission-replay-vehicle-scale: .50;
- position: absolute;
- top: 0;
- left: 0;
- z-index: 86;
- width: 92px;
- height: 138px;
- pointer-events: none;
- will-change: transform;
-}
-
-.mission-replay-flight-symbol {
- position: absolute;
- inset: 0;
- transform: rotate(var(--mission-replay-rotation, 0deg)) scale(var(--mission-replay-vehicle-scale));
- transform-origin: 46px 69px;
- will-change: transform;
-}
-
-.mission-replay-orbit-dot {
- display: none;
- position: absolute;
- top: 65px;
- left: 42px;
- width: 8px;
- height: 8px;
- border-radius: 50%;
- background: #22e6e6;
- box-shadow: 0 0 7px rgba(34, 230, 230, .78);
-}
-
-.mission-replay-vehicle-overlay[data-mode='orbit'] .mission-replay-flight-symbol {
- display: none;
-}
-
-.mission-replay-vehicle-overlay[data-mode='orbit'] .mission-replay-orbit-dot {
- display: block;
-}
-
-.mission-replay-rocket {
- position: absolute;
- top: 0;
- left: 22px;
- width: 48px;
- height: 72px;
- overflow: visible;
- filter: drop-shadow(0 0 6px rgba(34, 230, 230, .66));
-}
-
-.mission-replay-rocket-body {
- fill: #22e6e6;
- stroke: #22e6e6;
- stroke-width: 2;
- stroke-linejoin: round;
-}
-
-.mission-replay-rocket-port {
- fill: #22e6e6;
- stroke: none;
-}
-
-.mission-replay-rocket-flame {
- display: none;
-}
-
-.mission-replay-thrust {
- display: none;
- position: absolute;
- top: 57px;
- left: 10px;
- width: 72px;
- height: 72px;
- overflow: visible;
- filter: drop-shadow(0 0 4px rgba(34, 230, 230, .9));
-}
-
-.mission-replay-vehicle-overlay.is-thrusting .mission-replay-thrust {
- display: block;
-}
-
-.mission-replay-thrust ellipse {
- fill: none;
- stroke: rgba(34, 230, 230, .98);
- stroke-width: 2;
- opacity: 0;
- vector-effect: non-scaling-stroke;
- animation: mission-thrust-wave .9s ease-in-out infinite;
- animation-delay: calc(var(--thrust-index) * .15s);
-}
-
-.mission-replay-thrust ellipse:nth-child(2n) {
- stroke: rgba(216, 255, 255, .78);
-}
-
-.mission-replay-vehicle-overlay.is-paused .mission-replay-thrust ellipse {
- animation-play-state: paused;
-}
-
-.mission-replay-overlay-callout {
- position: absolute;
- top: 18px;
- left: 70px;
- min-width: 188px;
- color: #fff;
- font: 9px/1.38 'JetBrains Mono', monospace;
- letter-spacing: .075em;
- text-shadow: 0 1px 2px #001018, 0 0 6px #001018;
- white-space: nowrap;
-}
-
-.mission-replay-overlay-callout strong,
-.mission-replay-overlay-callout span {
- display: block;
-}
-
-.mission-replay-overlay-callout strong {
- color: #22e6e6;
- font-size: 10px;
- font-weight: 500;
-}
-
-.mission-replay-overlay-callout span {
- color: rgba(255, 255, 255, .92);
- white-space: pre-line;
-}
-
-.mission-replay-vehicle-overlay[data-mode='orbit'] .mission-replay-overlay-callout {
- top: 55px;
- left: 58px;
-}
-
-@keyframes mission-thrust-wave {
- 0%, 18% { opacity: 0; }
- 24% { opacity: 1; }
- 32%, 100% { opacity: 0; }
-}
-
-@media (prefers-reduced-motion: reduce) {
- .mission-replay-thrust ellipse {
- animation: none;
- }
-}
-#global-context-panel .panel-glow {
- position: absolute;
- inset: -20px;
- background: radial-gradient(ellipse at center, rgba(98, 181, 255, 0.2) 0%, transparent 62%);
- filter: blur(20px);
- opacity: 0.24;
- pointer-events: none;
-}
-.global-context-panel-inner {
- position: relative;
- display: flex;
- min-height: 0;
- flex-direction: column;
- padding: 14px 16px 12px;
- border: 1px solid var(--glass-border);
- border-radius: var(--panel-radius);
- background: var(--glass-bg);
- box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
- backdrop-filter: blur(24px) saturate(1.4);
- -webkit-backdrop-filter: blur(24px) saturate(1.4);
-}
-.context-radio-dock {
- position: relative;
- display: flex;
- align-items: center;
-}
-.context-radio-toggle {
- display: grid;
- width: 28px;
- height: 28px;
- place-items: center;
- padding: 0;
- border: 1px solid rgba(98, 181, 255, .22);
- border-radius: 6px;
- color: rgba(143, 207, 255, .58);
- background: rgba(42, 113, 171, .08);
- cursor: pointer;
- transition: border-color .15s ease, color .15s ease, background .15s ease, box-shadow .15s ease;
-}
-.context-radio-toggle .material-symbols-outlined { font-size: 17px; }
-.context-radio-toggle:hover,
-.context-radio-toggle:focus-visible {
- border-color: #79c2ff;
- color: #fff;
- outline: none;
-}
-.context-radio-toggle.active {
- border-color: rgba(101, 247, 255, .82);
- color: #eaffff;
- background: rgba(0, 212, 255, .16);
- box-shadow: inset 0 0 12px rgba(0, 212, 255, .1), 0 0 12px rgba(0, 212, 255, .2);
-}
-.context-radio-toggle:disabled { opacity: .5; cursor: wait; }
-.context-radio-mini {
- position: absolute;
- z-index: 5;
- top: calc(100% + 20px);
- right: -38px;
- display: none;
- width: 244px;
- box-sizing: border-box;
- gap: 8px;
- padding: 10px;
- border: 1px solid rgba(65, 220, 231, .28);
- border-radius: 8px;
- background: rgba(2, 15, 20, .96);
- box-shadow: 0 12px 32px rgba(0, 0, 0, .62), inset 0 1px 0 rgba(255, 255, 255, .04);
- backdrop-filter: blur(22px) saturate(1.35);
- -webkit-backdrop-filter: blur(22px) saturate(1.35);
-}
-.context-radio-mini[hidden] { display: none !important; }
-.context-radio-dock.disclosure-open .context-radio-mini {
- display: grid;
-}
-.context-radio-mini-heading {
- display: grid;
- grid-template-columns: auto minmax(0, 1fr) auto;
- gap: 8px;
- align-items: center;
- color: #65f7ff;
- font: 7px/1.2 var(--font-mono);
- letter-spacing: .12em;
-}
-.context-radio-mini-heading button {
- display: grid;
- width: 26px;
- height: 26px;
- place-items: center;
- padding: 0;
- border: 1px solid rgba(65, 220, 231, .28);
- border-radius: 5px;
- color: #8feaf2;
- background: rgba(14, 69, 78, .16);
- cursor: pointer;
-}
-.context-radio-mini-heading button:hover,
-.context-radio-mini-heading button:focus-visible {
- border-color: #65f7ff;
- color: #fff;
- outline: none;
-}
-.context-radio-mini-actions {
- display: flex;
- gap: 5px;
-}
-.context-radio-mini-heading .material-symbols-outlined { font-size: 16px; }
-.context-radio-mini > .panel-layer-toggle { width: 100%; }
-.context-radio-mini-heading strong {
- overflow: hidden;
- color: #e8feff;
- font-size: 8px;
- font-weight: 500;
- text-align: right;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-.context-radio-mini-transport {
- display: grid;
- grid-template-columns: repeat(3, minmax(0, 1fr));
- gap: 5px;
-}
-.context-radio-mini-transport button {
- min-height: 28px;
- padding: 5px;
- border: 1px solid rgba(65, 220, 231, .28);
- border-radius: 5px;
- color: #8feaf2;
- background: rgba(14, 69, 78, .16);
- font: 8px/1 var(--font-mono);
- cursor: pointer;
-}
-.context-radio-mini-transport button:hover:not(:disabled),
-.context-radio-mini-transport button:focus-visible:not(:disabled),
-.context-radio-mini-transport button.active {
- border-color: #65f7ff;
- color: #fff;
- outline: none;
-}
-.context-radio-mini-transport button:disabled { opacity: .38; cursor: not-allowed; }
-.context-radio-mini-volume {
- display: grid;
- grid-template-columns: auto minmax(0, 1fr) 30px;
- gap: 7px;
- align-items: center;
- color: var(--text-dim);
- font: 7px/1 var(--font-mono);
- letter-spacing: .08em;
-}
-.context-radio-mini-volume input { width: 100%; }
-.global-context-actions {
- display: grid;
- grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
- gap: 6px;
- margin: 0 0 8px;
-}
-.global-context-actions:has(#installations-search-btn) { grid-template-columns: minmax(0, 1fr); }
-.global-context-actions:has(#cockpit-entry:not([hidden])) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
-.global-context-actions:has(#cockpit-entry[hidden]) { grid-template-columns: 1fr; }
-/* TR-3B reclassify toggle rides an `auto` trailing column so the chip never
- resizes the COCKPIT / SEARCH buttons beside it. */
-.global-context-actions:has(#tr3b-toggle:not([hidden])) { grid-template-columns: repeat(2, minmax(0, 1fr)) auto; }
-.global-context-actions:has(#cockpit-entry[hidden]):has(#tr3b-toggle:not([hidden])) { grid-template-columns: minmax(0, 1fr) auto; }
-.tr3b-toggle {
- width: 26px;
- min-height: 30px;
- padding: 0;
- border: 1px solid rgba(98, 181, 255, 0.22);
- border-radius: 5px;
- background: rgba(42, 113, 171, 0.08);
- /* The saucer is a COLOR-font glyph: `color` and `text-shadow` cannot touch
- it, so the dim/lit states are carried by `filter` alongside the border and
- fill. 14px sits inside the 26px chip with breathing room. */
- font: 14px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
- filter: grayscale(0.6) opacity(0.62);
- cursor: pointer;
- transition: filter 160ms ease, border-color 160ms ease, background 160ms ease;
-}
-.tr3b-toggle[hidden] { display: none; }
-.tr3b-toggle:hover, .tr3b-toggle:focus-visible {
- border-color: rgba(127, 200, 255, 0.6);
- background: rgba(66, 148, 211, 0.18);
- filter: grayscale(0.15) opacity(0.95);
- outline: none;
-}
-.tr3b-toggle[aria-pressed="true"] {
- border-color: rgba(190, 220, 255, 0.75);
- background: rgba(20, 23, 28, 0.9);
- /* Active: full-colour saucer with a soft halo. drop-shadow works on an emoji
- where text-shadow does not, so the glyph itself telegraphs the state
- rather than relying on the chrome alone. */
- filter: drop-shadow(0 0 5px rgba(150, 210, 255, 0.9));
-}
-.global-context-modes {
- display: grid;
- grid-template-columns: repeat(2, minmax(0, 1fr));
- gap: 7px;
- margin: 0 0 10px;
-}
-.context-mode-button {
- display: flex;
- min-width: 0;
- min-height: 36px;
- align-items: center;
- justify-content: center;
- gap: 6px;
- padding: 7px 8px;
- border: 1px solid rgba(98, 181, 255, .28);
- border-radius: 6px;
- color: #8fcfff;
- background: rgba(42, 113, 171, .09);
- font: 8px/1.15 var(--font-mono);
- letter-spacing: .09em;
- cursor: pointer;
- transition: border-color .15s ease, color .15s ease, background .15s ease, box-shadow .15s ease;
-}
-.context-mode-button .material-symbols-outlined { font-size: 16px; }
-.context-mode-button:hover,
-.context-mode-button:focus-visible {
- border-color: #79c2ff;
- color: #fff;
- outline: none;
-}
-/* Keep focus distinct when the selected tab owns the accent colors. */
-.context-mode-button:focus-visible {
- outline: 2px solid var(--text-primary);
- outline-offset: -3px;
-}
-
-.context-mode-button.active {
- border-color: rgba(0, 212, 255, .75);
- color: #eaffff;
- background: rgba(0, 212, 255, .14);
- box-shadow: inset 0 0 16px rgba(0, 212, 255, .08), 0 0 12px rgba(0, 212, 255, .12);
-}
-.context-mode-button:disabled { opacity: .55; cursor: wait; }
-.context-mode-view[hidden],
-.context-mode-standby[hidden] { display: none !important; }
-.context-mode-standby {
- display: grid;
- min-height: 72px;
- place-content: center;
- gap: 6px;
- padding: 12px;
- border: 1px dashed rgba(98, 181, 255, .2);
- border-radius: 7px;
- color: rgba(190, 230, 230, .5);
- text-align: center;
- font: 8px/1.45 var(--font-mono);
- letter-spacing: .1em;
-}
-.context-mode-standby strong {
- color: #8fcfff;
- font-size: 9px;
- letter-spacing: .16em;
-}
-.context-mode-view { min-height: 0; }
-#right-context-rail #global-context-panel:not(.collapsed) .context-mode-view,
-#right-context-rail #global-context-panel:not(.collapsed) #radio-panel {
- /* These sections share the Context panel's existing scroller. Keep their
- natural heights so flexbox cannot compress one section and let its
- contents paint through the next section. */
- flex: 0 0 auto;
-}
-.panel-layer-toggle {
- min-width: 54px;
- padding: 4px 7px;
- border: 1px solid rgba(98, 181, 255, 0.3);
- border-radius: 5px;
- color: #8fcfff;
- background: rgba(42, 113, 171, 0.12);
- font: 7px/1.1 var(--font-mono);
- letter-spacing: 0.1em;
- cursor: pointer;
-}
-.panel-layer-toggle:hover, .panel-layer-toggle:focus-visible {
- border-color: #79c2ff;
- color: #fff;
- outline: none;
-}
-.panel-layer-toggle.active {
- border-color: rgba(0, 212, 255, 0.7);
- color: #fff;
- background: rgba(0, 212, 255, 0.14);
- box-shadow: 0 0 12px rgba(0, 212, 255, 0.14);
-}
-.panel-layer-toggle:disabled { opacity: 0.45; cursor: wait; }
-.global-context-actions .panel-layer-toggle {
- width: 100%;
- min-height: 30px;
- padding: 6px 8px;
- font-size: 8px;
-}
-#global-context-panel #cockpit-entry {
- position: static;
- z-index: auto;
- width: 100%;
- min-height: 30px;
- padding: 5px 8px;
- border-radius: 5px;
- justify-content: center;
- font-size: 8px;
- box-shadow: none;
-}
-#global-context-panel #cockpit-entry .material-symbols-outlined { font-size: 15px; }
-#global-context-panel #cockpit-entry kbd { padding: 2px 4px; }
-
-/* ── Radio companion section inside Context ── */
-#radio-panel {
- position: relative;
- width: 100%;
- min-height: 0;
- margin-top: 10px;
- padding-top: 10px;
- border-top: 1px solid rgba(65, 220, 231, .16);
-}
-.radio-panel-inner {
- position: relative;
- display: flex;
- min-height: 0;
- flex-direction: column;
- gap: 9px;
- padding: 10px;
- border: 1px solid rgba(65, 220, 231, .18);
- border-radius: 8px;
- background: rgba(2, 15, 20, .42);
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
- scrollbar-width: thin;
- scrollbar-color: rgba(0, 212, 255, .46) rgba(255, 255, 255, .06);
-}
-#radio-panel .panel-header { margin-bottom: 0; }
-.radio-layer-state {
- color: var(--text-dim);
- font: 8px/1 var(--font-mono);
- letter-spacing: .12em;
-}
-.radio-layer-state.active { color: #65f7ff; }
-.radio-directory-row {
- display: grid;
- grid-template-columns: auto minmax(0, 1fr);
- gap: 6px 8px;
- align-items: end;
-}
-.radio-filter-label {
- grid-column: 2;
- color: var(--text-dim);
- font: 7px/1 var(--font-mono);
- letter-spacing: .12em;
-}
-#radio-enable-btn { grid-row: 1 / span 2; min-height: 36px; }
-#radio-filter {
- min-width: 0;
- padding: 7px 24px 7px 8px;
- border: 1px solid rgba(65, 220, 231, .28);
- border-radius: 5px;
- color: #c5faff;
- background: rgba(5, 24, 31, .88);
- font: 9px/1.2 var(--font-mono);
-}
-.radio-station-card {
- display: grid;
- gap: 4px;
- padding: 10px;
- border: 1px solid rgba(65, 220, 231, .18);
- border-radius: 7px;
- background: rgba(2, 15, 20, .48);
- overflow-wrap: anywhere;
-}
-.radio-station-card strong {
- color: #e8feff;
- font: 11px/1.25 var(--font-mono);
- letter-spacing: .05em;
-}
-.radio-station-card span {
- color: var(--text-dim);
- font: 8px/1.35 var(--font-mono);
-}
-#radio-station-tags { color: #72dce6; }
-.radio-tuner {
- display: grid;
- width: 100%;
- min-width: 0;
- max-width: 100%;
- gap: 5px;
- padding: 8px;
- overflow: hidden;
- border: 1px solid rgba(65, 220, 231, .22);
- border-radius: 7px;
- background: linear-gradient(180deg, rgba(1, 9, 13, .92), rgba(4, 24, 30, .72));
- box-shadow: inset 0 0 18px rgba(0, 212, 255, .045);
-}
-.radio-tuner[hidden] { display: none; }
-.radio-tuner-header,
-.radio-tuner-readout {
- display: flex;
- justify-content: space-between;
- gap: 8px;
- color: #6daeb5;
- font: 7px/1.2 var(--font-mono);
- letter-spacing: .1em;
-}
-#radio-tuner-value {
- min-width: 0;
- color: #a8f7ff;
- overflow: hidden;
- text-align: right;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-.radio-tuner-dial {
- position: relative;
- width: 100%;
- min-width: 0;
- max-width: 100%;
- height: 51px;
- overflow: hidden;
- contain: paint;
- border-block: 1px solid rgba(72, 225, 237, .3);
- background:
- linear-gradient(180deg, transparent 23px, rgba(65, 220, 231, .8) 24px, transparent 25px, transparent 28px, rgba(65, 220, 231, .6) 29px, transparent 30px),
- radial-gradient(ellipse at center, rgba(39, 177, 191, .12), transparent 70%);
-}
-.radio-tuner-scale {
- position: absolute;
- inset: 0;
- overflow: hidden;
- color: #58cbd6;
- font: 9px/1 var(--font-mono);
- text-shadow: 0 0 7px rgba(65, 220, 231, .5);
- pointer-events: none;
-}
-.radio-tuner-tick {
- position: absolute;
- top: 6px;
- bottom: 0;
- min-width: 1px;
- border-left: 1px solid rgba(85, 224, 235, .38);
- color: #58cbd6;
- padding-left: 3px;
- white-space: nowrap;
- transform: translateX(-50%);
- transition: left 80ms linear;
-}
-.radio-tuner-tick.is-current {
- border-left-color: rgba(168, 247, 255, .9);
- color: #a8f7ff;
-}
-.radio-tuner-needle {
- position: absolute;
- z-index: 1;
- top: 2px;
- bottom: 2px;
- left: calc(7px + (100% - 14px) * var(--radio-tuner-ratio, 0));
- width: 3px;
- border-radius: 1px;
- background: #ff6f4f;
- box-shadow: 0 0 4px #ff6f4f, 0 0 10px rgba(255, 77, 50, .65);
- pointer-events: none;
- transform: translateX(-50%);
- transition: left .18s ease-out;
-}
-.radio-tuner.is-dragging .radio-tuner-needle,
-.radio-tuner.is-dragging .radio-tuner-tick { transition: none; }
-#radio-tuner-slider {
- position: absolute;
- z-index: 2;
- inset: 0;
- width: 100%;
- min-width: 0;
- max-width: 100%;
- height: 100%;
- margin: 0;
- appearance: none;
- -webkit-appearance: none;
- cursor: ew-resize;
- touch-action: none;
- background: transparent;
-}
-#radio-tuner-slider::-webkit-slider-runnable-track {
- height: 100%;
- background: transparent;
-}
-#radio-tuner-slider::-webkit-slider-thumb {
- width: 14px;
- height: 47px;
- margin-top: 2px;
- border: 0;
- border-radius: 1px;
- appearance: none;
- -webkit-appearance: none;
- background: transparent;
- box-shadow: none;
-}
-#radio-tuner-slider::-moz-range-track { height: 100%; background: transparent; }
-#radio-tuner-slider::-moz-range-thumb {
- width: 14px;
- height: 47px;
- border: 0;
- border-radius: 1px;
- background: transparent;
- box-shadow: none;
-}
-.radio-tuner.is-static .radio-tuner-dial {
- box-shadow: inset 0 0 14px rgba(255, 111, 79, .1);
-}
-.radio-tuner.is-static #radio-tuner-station { color: #ff9b7e; }
-.radio-tuner-readout span:first-child {
- min-width: 0;
- color: #7fe6ef;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-.radio-tuner-readout span:last-child {
- flex: 0 0 auto;
- color: #517f84;
-}
-.radio-transport {
- display: grid;
- grid-template-columns: repeat(4, minmax(0, 1fr));
- gap: 5px;
-}
-.radio-transport button {
- min-height: 30px;
- padding: 6px 3px;
- border: 1px solid rgba(65, 220, 231, .28);
- border-radius: 5px;
- color: #8feaf2;
- background: rgba(14, 69, 78, .14);
- font: 8px/1 var(--font-mono);
- letter-spacing: .06em;
- cursor: pointer;
-}
-.radio-transport button:hover:not(:disabled),
-.radio-transport button:focus-visible:not(:disabled) {
- border-color: #65f7ff;
- color: #fff;
- outline: none;
-}
-.radio-transport button:disabled,
-#radio-filter:disabled { opacity: .42; cursor: not-allowed; }
-#radio-play-btn.active {
- color: #fff;
- border-color: rgba(101, 247, 255, .8);
- background: rgba(65, 220, 231, .18);
- box-shadow: 0 0 12px rgba(65, 220, 231, .12);
-}
-.radio-volume-row {
- display: grid;
- grid-template-columns: auto minmax(0, 1fr) 32px;
- gap: 8px;
- align-items: center;
- color: var(--text-dim);
- font: 7px/1 var(--font-mono);
- letter-spacing: .1em;
-}
-.radio-volume-row input { width: 100%; }
-.radio-playback-state {
- min-height: 12px;
- color: #79d7df;
- font: 8px/1.35 var(--font-mono);
-}
-.radio-playback-state.error { color: #ff9d8f; }
-.radio-links {
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- gap: 5px 10px;
-}
-.radio-links a {
- color: #64cbd5;
- font: 7px/1.3 var(--font-mono);
- letter-spacing: .06em;
- text-decoration: none;
-}
-.radio-links a:hover, .radio-links a:focus-visible { color: #fff; }
-.radio-privacy {
- margin: 0;
- color: rgba(190, 230, 230, .48);
- font: 7px/1.4 var(--font-mono);
-}
-#military-awareness-panel {
- width: 100%;
- min-height: 0;
- overflow: auto;
- box-sizing: border-box;
- padding: 2px 1px 0;
- color: #dceeff;
- background: transparent;
- border: 0;
- font: 11px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
-}
-
-#military-awareness-panel[hidden] { display: none; }
-.military-awareness-subject { margin: 0 0 7px; color: #fff; }
-.military-awareness-controls { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px; margin: 0 0 8px; }
-.military-awareness-controls button { border: 1px solid rgba(98,181,255,0.34); border-radius: 4px; padding: 4px 3px; color: #a9d9ff; background: rgba(42,113,171,0.12); font: 9px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.07em; cursor: pointer; }
-.military-awareness-controls button:hover, .military-awareness-controls button:focus-visible { color: #fff; border-color: rgba(127,200,255,0.85); background: rgba(66,148,211,0.24); outline: none; }
-.military-awareness-controls button:disabled { color: #627181; border-color: rgba(98,181,255,0.12); background: transparent; cursor: default; }
-.military-awareness-row { border-top: 1px solid rgba(255,255,255,0.1); padding: 7px 0; }
-.military-awareness-row > div { display: flex; justify-content: space-between; }
-.military-awareness-row b { color: #7fc8ff; }
-.military-awareness-row.unknown b { color: #8fcfff; }
-.military-awareness-row small, .military-awareness-note { color: #a9b7c7; }
-.military-awareness-row ul { margin: 4px 0 0; padding: 0; list-style: none; }
-.military-awareness-row li { display: block; }
-.military-awareness-target { display: flex; justify-content: space-between; gap: 10px; width: 100%; border: 0; padding: 1px 0; color: #dceeff; background: transparent; font: inherit; text-align: left; cursor: pointer; }
-.military-awareness-target.unavailable { color: var(--text-dim); cursor: default; }
-.military-awareness-target:hover, .military-awareness-target:focus-visible { color: #fff; outline: none; text-shadow: 0 0 8px rgba(114, 202, 255, 0.85); }
-.military-awareness-target:focus-visible { box-shadow: inset 0 -1px 0 #7fc8ff; }
-.military-awareness-target span { color: #7fc8ff; white-space: nowrap; }
-.military-awareness-note { margin: 8px 0 0; font-size: 10px; }
-.military-awareness-standby {
- display: grid;
- gap: 7px;
- padding: 12px 4px 4px;
- border-top: 1px solid rgba(98, 181, 255, 0.16);
-}
-.military-awareness-standby strong { color: #79c2ff; font-size: 10px; letter-spacing: 0.1em; }
-.military-awareness-standby span { color: #8192a6; font-size: 9px; letter-spacing: 0.05em; }
-.military-awareness-standby button {
- justify-self: start;
- padding: 4px 12px;
- border: 1px solid rgba(98, 181, 255, 0.34);
- border-radius: 4px;
- color: #a9d9ff;
- background: rgba(42, 113, 171, 0.12);
- font: 9px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
- letter-spacing: 0.08em;
- cursor: pointer;
-}
-
-#military-awareness-direction-overlay { position: absolute; inset: 0; z-index: 4; overflow: hidden; pointer-events: none; }
-#military-awareness-direction-overlay[hidden] { display: none; }
-.military-awareness-compass-ring {
- --compass-rotation: 0deg;
- position: absolute;
- box-sizing: border-box;
- border: 1px solid rgba(111,196,255,0.2);
- outline: 1px dashed rgba(111,196,255,0.28);
- outline-offset: -5px;
- border-radius: 50%;
- box-shadow:
- inset 0 0 0 5px rgba(34,128,196,0.018),
- inset 0 0 24px rgba(34,128,196,0.035),
- 0 0 14px rgba(34,128,196,0.05);
-}
-.military-awareness-compass-ring::before { content: ''; position: absolute; left: 50%; top: -7px; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 8px solid rgba(127,200,255,0.88); transform: translateX(-50%); filter: drop-shadow(0 0 5px rgba(87,184,255,0.7)); }
-.military-awareness-compass-ring::after {
- content: '';
- position: absolute;
- inset: -5px;
- border-radius: 50%;
- background: repeating-conic-gradient(
- from 0deg,
- rgba(125, 205, 255, 0.38) 0deg 0.7deg,
- transparent 0.7deg 15deg
- );
- -webkit-mask: radial-gradient(circle, transparent calc(100% - 8px), #000 calc(100% - 8px) calc(100% - 4px), transparent calc(100% - 4px));
- mask: radial-gradient(circle, transparent calc(100% - 8px), #000 calc(100% - 8px) calc(100% - 4px), transparent calc(100% - 4px));
- transform: rotate(var(--compass-rotation));
- transition: transform 80ms linear;
-}
-.military-awareness-compass-label, .military-awareness-compass-heading { position: absolute; transform: translate(-50%, -50%); color: rgba(156,213,255,0.7); font: 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.08em; text-shadow: 0 0 7px rgba(53,161,235,0.55); }
-.military-awareness-compass-label.cardinal-n { color: rgba(255,188,87,0.92); }
-.military-awareness-compass-heading { color: rgba(190,225,249,0.76); font-size: 8px; }
-.military-awareness-direction-marker { position: absolute; width: 1px; height: 1px; transform: translate(-50%, -50%); transition: opacity 100ms linear; }
-.military-awareness-direction-marker[hidden] { display: none; }
-.military-awareness-direction-arrow { position: absolute; left: 50%; top: 50%; color: #74dbff; font: 23px/1 sans-serif; transform-origin: 50% 50%; text-shadow: 0 0 5px rgba(87,223,255,0.9), 0 0 13px rgba(87,223,255,0.35); }
-.military-awareness-direction-label { position: absolute; left: 50%; top: 50%; padding: 3px 6px; border: 1px solid rgba(116,219,255,0.24); border-radius: 3px; color: #bceeff; background: rgba(5,12,20,0.68); font: 8px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: center; white-space: pre; text-shadow: 0 0 5px rgba(116,219,255,0.38); }
-
-.data-toggle-row.gev-voice-focus {
- background: rgba(92, 255, 198, 0.1);
- box-shadow: inset 0 0 0 1px rgba(92, 255, 198, 0.72), 0 0 18px rgba(92, 255, 198, 0.18);
-}
-
-.data-toggle-top {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 8px;
-}
-
-.data-toggle-left {
- display: flex;
- align-items: center;
- gap: 8px;
-}
-
-.data-icon {
- font-size: 16px;
- line-height: 1;
-}
-
-.data-name {
- font-family: var(--font-sans);
- font-size: 13px;
- font-weight: 500;
- color: var(--text-primary);
- letter-spacing: 0.3px;
-}
-
-.data-toggle-right {
- display: flex;
- align-items: center;
- gap: 10px;
-}
-
-.data-count {
- font-family: var(--font-mono);
- font-size: 11px;
- letter-spacing: 0.5px;
- color: var(--text-secondary);
- min-width: 30px;
- text-align: right;
-}
-
-.data-toggle-btn {
- padding: 3px 10px;
- font-family: var(--font-mono);
- font-size: 9px;
- letter-spacing: 1.5px;
- color: var(--text-dim);
- background: rgba(255, 255, 255, 0.04);
- border: 1px solid rgba(255, 255, 255, 0.08);
- border-radius: 4px;
- cursor: pointer;
- transition:
- background-color var(--transition-fast),
- border-color var(--transition-fast),
- box-shadow var(--transition-fast),
- color var(--transition-fast),
- min-width var(--transition-fast),
- letter-spacing var(--transition-fast);
- outline: none;
- min-width: 38px;
- text-align: center;
-}
-
-/* An inset ring stays visible inside the scrolling layer list. */
-.data-toggle-btn:focus-visible {
- outline: 2px solid var(--text-primary);
- outline-offset: -3px;
-}
-
-.data-toggle-btn.feed-loading,
-.data-toggle-btn.feed-degraded,
-.data-toggle-btn.feed-stale,
-.data-toggle-btn.feed-fallback,
-.data-toggle-btn.feed-unavailable {
- min-width: 82px;
- letter-spacing: 0.8px;
-}
-
-.data-toggle-btn:hover {
- border-color: var(--glass-border-hover);
- background: rgba(255, 255, 255, 0.06);
-}
-
-.data-toggle-btn.active {
- color: var(--accent);
- border-color: var(--accent);
- background: var(--accent-dim);
- box-shadow: 0 0 10px rgba(0, 212, 255, 0.15);
-}
-
-.data-toggle-btn.active.feed-stale,
-.data-toggle-btn.active.feed-fallback {
- color: #ffd27a;
- border-color: rgba(255, 190, 82, 0.75);
- background: rgba(255, 174, 51, 0.1);
- box-shadow: 0 0 10px rgba(255, 174, 51, 0.12);
-}
-
-.data-toggle-btn.active.feed-degraded {
- color: #ffad72;
- border-color: rgba(255, 137, 72, 0.78);
- background: rgba(255, 112, 48, 0.1);
- box-shadow: 0 0 10px rgba(255, 112, 48, 0.12);
-}
-
-.data-toggle-btn.active.feed-unavailable {
- color: #ff8585;
- border-color: rgba(255, 92, 92, 0.78);
- background: rgba(255, 60, 60, 0.1);
- box-shadow: 0 0 10px rgba(255, 60, 60, 0.12);
-}
-
-.data-toggle-meta {
- font-family: var(--font-mono);
- font-size: 9px;
- letter-spacing: 0.5px;
- color: var(--text-dim);
- padding-left: 26px;
- margin-top: 2px;
-}
-
-/* Optional per-layer sub-controls: mode chips plus a color legend. Aligned
- under the layer name like .data-toggle-meta, and wrapping so a legend can
- grow without widening the rail. */
-.data-toggle-controls {
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- gap: 4px 8px;
- padding-left: 26px;
- margin-top: 5px;
-}
-
-.data-toggle-controls[hidden] {
- display: none;
-}
-
-.data-toggle-chip {
- padding: 2px 7px;
- font-family: var(--font-mono);
- font-size: 8px;
- letter-spacing: 1.2px;
- color: var(--text-dim);
- background: rgba(255, 255, 255, 0.04);
- border: 1px solid rgba(255, 255, 255, 0.08);
- border-radius: 3px;
- cursor: pointer;
- transition:
- background-color var(--transition-fast),
- border-color var(--transition-fast),
- color var(--transition-fast),
- opacity var(--transition-fast);
- outline: none;
-}
-
-.data-toggle-chip:hover,
-.data-toggle-chip:focus-visible {
- border-color: var(--glass-border-hover);
- background: rgba(255, 255, 255, 0.06);
- color: var(--text-secondary);
-}
-
-.data-toggle-chip.active {
- color: var(--accent);
- border-color: var(--accent);
- background: var(--accent-dim);
-}
-
-/* Async sub-controls: a chip must never read ACTIVE before the data it turns
- on actually exists, so loading and failure are their own visible states. */
-.data-toggle-chip:disabled {
- cursor: wait;
- opacity: 0.7;
-}
-
-.data-toggle-chip.chip-loading {
- color: var(--text-secondary);
- border-color: rgba(255, 255, 255, 0.18);
-}
-
-.data-toggle-chip.chip-error {
- color: #ff8585;
- border-color: rgba(255, 92, 92, 0.6);
- background: rgba(255, 60, 60, 0.08);
-}
-
-.data-toggle-legend-item {
- display: inline-flex;
- align-items: center;
- gap: 4px;
- font-family: var(--font-mono);
- font-size: 8px;
- letter-spacing: 0.5px;
- color: var(--text-dim);
- cursor: default;
-}
-
-.data-toggle-legend-swatch {
- width: 6px;
- height: 6px;
- border-radius: 50%;
- /* The swatch IS the datum — keep it exactly the point color, with only a
- hairline ring so a near-black class still reads on the panel glass. */
- box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
- flex: none;
-}
-
-/* ── CCTV Panel ─────────────────────────────── */
-#cctv-panel {
- --panel-expanded-width: 360px;
- position: fixed;
- top: var(--left-stack-top);
- left: var(--left-stack-x);
- right: auto;
- bottom: auto;
- z-index: 100;
- width: var(--panel-expanded-width);
- max-height: calc(100vh - 24px);
-}
-
-#cctv-panel .panel-glow {
- position: absolute;
- inset: -18px;
- background: radial-gradient(ellipse at center, rgba(0, 212, 255, 0.16) 0%, transparent 65%);
- filter: blur(16px);
- opacity: 0.25;
- pointer-events: none;
-}
-
-.cctv-panel-inner {
- position: relative;
- background: var(--glass-bg);
- border: 1px solid var(--glass-border);
- border-radius: var(--panel-radius);
- padding: 14px;
- display: flex;
- flex-direction: column;
- gap: 8px;
- max-height: calc(100vh - 24px);
- overflow-y: auto;
- scrollbar-width: thin;
- scrollbar-color: rgba(0, 212, 255, 0.46) rgba(255, 255, 255, 0.06);
- backdrop-filter: blur(24px) saturate(1.4);
- -webkit-backdrop-filter: blur(24px) saturate(1.4);
- box-shadow:
- 0 8px 32px rgba(0, 0, 0, 0.5),
- 0 0 0 1px rgba(255, 255, 255, 0.03) inset,
- 0 1px 0 rgba(255, 255, 255, 0.06) inset;
-}
-
-.cctv-panel-inner::-webkit-scrollbar {
- width: 8px;
-}
-
-.cctv-panel-inner::-webkit-scrollbar-track {
- background: rgba(255, 255, 255, 0.04);
- border-radius: 999px;
-}
-
-.cctv-panel-inner::-webkit-scrollbar-thumb {
- background: linear-gradient(180deg, rgba(0, 212, 255, 0.6), rgba(0, 212, 255, 0.28));
- border: 1px solid rgba(0, 212, 255, 0.4);
- border-radius: 999px;
-}
-
-.cctv-controls {
- display: flex;
- gap: 8px;
- margin-bottom: 0;
-}
-
-.cctv-calibration-block {
- border: 1px solid rgba(255, 255, 255, 0.1);
- border-radius: 9px;
- padding: 8px 9px;
- background: rgba(255, 255, 255, 0.02);
-}
-
-.cctv-calibration-header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 8px;
- margin-bottom: 7px;
-}
-
-.cctv-calibration-header .cctv-summary-label {
- margin: 0;
-}
-
-/* Click-to-edit effective-pose readout (viewshed/gizmo design §3d): compact
- value chips replace the seven offset sliders. */
-.cctv-cal-readout {
- display: flex;
- flex-wrap: wrap;
- gap: 5px;
-}
-
-.cctv-cal-value {
- font-family: var(--font-mono);
- font-size: 9px;
- letter-spacing: 0.7px;
- color: #91edff;
- background: rgba(255, 255, 255, 0.04);
- border: 1px solid rgba(255, 255, 255, 0.12);
- border-radius: 7px;
- padding: 4px 7px;
- cursor: text;
- transition: border-color 0.15s ease, background 0.15s ease;
-}
-
-.cctv-cal-value:hover:not(:disabled) {
- border-color: rgba(0, 212, 255, 0.45);
- background: rgba(0, 212, 255, 0.08);
-}
-
-.cctv-cal-input {
- width: 58px;
- font-family: var(--font-mono);
- font-size: 9px;
- letter-spacing: 0.7px;
- color: var(--text-primary);
- background: rgba(0, 212, 255, 0.1);
- border: 1px solid rgba(0, 212, 255, 0.5);
- border-radius: 4px;
- padding: 1px 3px;
- outline: none;
- -moz-appearance: textfield;
-}
-
-.cctv-cal-input::-webkit-outer-spin-button,
-.cctv-cal-input::-webkit-inner-spin-button {
- -webkit-appearance: none;
- margin: 0;
-}
-
-.cctv-calibration-actions {
- margin-top: 8px;
-}
-
-#cctv-panel input:disabled,
-#cctv-panel button:disabled,
-#cctv-panel select:disabled {
- opacity: 0.45;
-}
-
-#cctv-camera-select {
- flex: 1;
- min-width: 0;
- background: rgba(255, 255, 255, 0.06);
- border: 1px solid rgba(255, 255, 255, 0.14);
- border-radius: 7px;
- color: var(--text-primary);
- padding: 6px 8px;
- font-family: var(--font-sans);
- font-size: 12px;
- outline: none;
-}
-
-#cctv-camera-select:focus-visible {
- outline: 2px solid var(--text-primary);
- outline-offset: -3px;
-}
-
-#cctv-camera-select:disabled {
- opacity: 0.45;
-}
-
-#cctv-enable-btn.active,
-#cctv-coverage-btn.active,
-#cctv-auto-hop-btn.active,
-#cctv-projection-btn.active {
- color: var(--accent);
- border-color: var(--accent);
- background: rgba(0, 212, 255, 0.14);
-}
-
-#cctv-quality-chip {
- display: inline-flex;
- align-items: center;
- justify-content: center;
- min-width: 90px;
- padding: 6px 8px;
- border: 1px solid rgba(0, 212, 255, 0.2);
- border-radius: 8px;
- font-family: var(--font-mono);
- font-size: 9px;
- letter-spacing: 1px;
- color: #8fe7ff;
- background: rgba(0, 212, 255, 0.08);
- text-transform: uppercase;
-}
-
-/* CAL badge states (cctv-v2 §3b, amended by LOCKED §9.2 — panel-only, no
- in-world tint). Three visually distinct states: calibrated / curated /
- raw-prior. */
-#cctv-quality-chip[data-cal-badge='calibrated'] {
- color: #adffbf;
- border-color: rgba(141, 255, 135, 0.42);
- background: rgba(141, 255, 135, 0.12);
-}
-
-#cctv-quality-chip[data-cal-badge='curated'] {
- color: #ffe6a2;
- border-color: rgba(255, 217, 122, 0.35);
- background: rgba(255, 217, 122, 0.1);
-}
-
-/* Unsaved live edits (save-gated persistence, viewshed design §3e). */
-#cctv-quality-chip[data-cal-badge='edited'] {
- color: #ffd08a;
- border-color: rgba(255, 176, 82, 0.5);
- background: rgba(255, 176, 82, 0.14);
-}
-
-.cctv-frame-wrap {
- position: relative;
- border-radius: 10px;
- overflow: hidden;
- border: 1px solid rgba(255, 255, 255, 0.12);
- background:
- radial-gradient(circle at 20% 20%, rgba(0, 244, 255, 0.09), transparent 44%),
- linear-gradient(180deg, rgba(8, 14, 19, 0.88), rgba(4, 7, 11, 0.96));
- min-height: 150px;
- /* .cctv-panel-inner is a scrolling column flex container, so the default
- flex-shrink:1 squeezed this wrap down to its 150px floor while the 16:9
- image inside is taller — and the wrap is overflow:hidden, which clipped
- the bottom of the frame right back off. Never shrink the preview. */
- flex-shrink: 0;
-}
-
-/* Lightweight loading shimmer while the active frame is fetching */
-.cctv-frame-wrap::after {
- content: '';
- position: absolute;
- inset: 0;
- background: linear-gradient(
- 100deg,
- transparent 24%,
- rgba(0, 212, 255, 0.08) 44%,
- rgba(170, 244, 255, 0.14) 50%,
- rgba(0, 212, 255, 0.08) 56%,
- transparent 76%
- );
- transform: translateX(-100%);
- opacity: 0;
- pointer-events: none;
- transition: opacity 0.2s ease;
-}
-
-.cctv-frame-wrap.loading::after {
- opacity: 1;
- animation: cctv-frame-shimmer 1.4s linear infinite;
-}
-
-/* "Acquiring" caption only when no previous frame is showing underneath */
-.cctv-frame-wrap.loading:not(.has-frame)::before {
- content: 'ACQUIRING FRAME';
- position: absolute;
- inset: 0;
- display: flex;
- align-items: center;
- justify-content: center;
- font-family: var(--font-mono);
- font-size: 8px;
- letter-spacing: 2.2px;
- color: rgba(145, 237, 255, 0.62);
- pointer-events: none;
-}
-
-@keyframes cctv-frame-shimmer {
- to {
- transform: translateX(100%);
- }
-}
-
-#cctv-frame {
- width: 100%;
- /* A fixed 16:9 box with the frame CONTAINED inside it. Providers burn their
- timestamp into a corner (TfL top-left, Austin bottom-left) and the old
- 150px-tall box was ~2.2:1, so object-fit: cover ate ~18px off the top and
- bottom — exactly where those stamps live (owner field test 2026-07-31).
- Sources are not all 16:9 either (a TfL frame measures 352x288), so
- `contain` is what actually guarantees nothing is cut; the ratio just keeps
- the panel height stable as you switch cameras. */
- aspect-ratio: 16 / 9;
- height: auto;
- object-fit: contain;
- display: block;
- opacity: 0;
- transition: opacity 180ms ease;
-}
-
-#cctv-frame.active {
- opacity: 1;
-}
-
-#cctv-meta {
- font-family: var(--font-mono);
- font-size: 9px;
- letter-spacing: 1px;
- color: var(--text-secondary);
-}
-
-#cctv-source-badge {
- align-self: flex-start;
- border: 1px solid rgba(0, 212, 255, 0.32);
- border-radius: 999px;
- background: rgba(0, 212, 255, 0.09);
- color: #9defff;
- font-family: var(--font-mono);
- font-size: 8px;
- letter-spacing: 1.3px;
- padding: 4px 8px;
-}
-
-#cctv-source-badge[data-frame-state='loading'] {
- color: #ffe59b;
- border-color: rgba(255, 205, 92, 0.45);
- background: rgba(255, 205, 92, 0.1);
-}
-
-#cctv-source-badge[data-frame-state='error'] {
- color: #ffb0b0;
- border-color: rgba(255, 102, 102, 0.5);
- background: rgba(255, 72, 72, 0.11);
-}
-
-.cctv-summary-label {
- font-family: var(--font-mono);
- font-size: 8px;
- letter-spacing: 1.7px;
- color: var(--text-dim);
-}
-
-#cctv-summary {
- min-height: 38px;
- font-family: var(--font-mono);
- font-size: 10px;
- letter-spacing: 0.8px;
- line-height: 1.45;
- color: #a8f7ff;
- text-shadow: 0 0 10px rgba(0, 212, 255, 0.18);
-}
-
-/* ── Scene Director Panel ───────────────────── */
-#scene-panel {
- --panel-expanded-width: 360px;
- position: fixed;
- top: calc(var(--left-stack-top) + (var(--left-stack-gap) * 2));
- left: var(--left-stack-x);
- right: auto;
- bottom: auto;
- z-index: 100;
- width: var(--panel-expanded-width);
- max-height: calc(100vh - 24px);
-}
-
-#left-panel-stack > #data-panel,
-#left-panel-stack > #cctv-panel,
-#left-panel-stack > #global-context-panel,
-#left-panel-stack > #scene-panel {
- position: relative;
- top: auto;
- right: auto;
- bottom: auto;
- left: auto;
- z-index: auto;
- max-height: none;
- flex: 0 0 auto;
- min-height: 0;
- pointer-events: auto;
-}
-
-#left-panel-stack > #data-panel {
- order: 1;
-}
-
-#left-panel-stack > #cctv-panel {
- order: 2;
-}
-
-#left-panel-stack > #scene-panel { order: 4; }
-
-/*
- * Runtime focus mode: the layout engine applies this only when the expanded
- * panel's measured natural height plus sibling labels cannot fit inside the
- * live HUD/attribution-safe corridor.
- */
-#left-panel-stack.layout-focus > [data-panel-id].collapsed {
- display: none;
-}
-
-#left-panel-stack > #data-panel:not(.collapsed),
-#left-panel-stack > #cctv-panel:not(.collapsed),
-#left-panel-stack > #scene-panel:not(.collapsed) {
- box-sizing: border-box;
- flex: 0 1 var(--left-panel-allocated-height, auto);
- height: var(--left-panel-allocated-height, auto);
- max-height: var(--left-panel-allocated-height, 100%);
-}
-
-/*
- * When an expanded panel and its collapsed siblings fit together, preserve
- * the canonical control order and center their combined stack at 50vh.
- */
-#left-panel-stack.layout-tail > :is(#data-panel, #cctv-panel, #scene-panel):not(.collapsed) {
- box-sizing: border-box;
- flex: 0 0 var(--left-panel-allocated-height);
- height: var(--left-panel-allocated-height);
- max-height: var(--left-panel-allocated-height);
-}
-
-#left-panel-stack > #data-panel:not(.collapsed) .data-panel-inner,
-#left-panel-stack > #cctv-panel:not(.collapsed) .cctv-panel-inner,
-#left-panel-stack > #scene-panel:not(.collapsed) .scene-panel-inner {
- height: 100%;
- max-height: 100%;
-}
-
-#left-panel-stack > #data-panel:not(.collapsed) .data-panel-inner {
- overflow: hidden;
-}
-
-#left-panel-stack > #cctv-panel:not(.collapsed) .cctv-panel-inner,
-#left-panel-stack > #scene-panel:not(.collapsed) .scene-panel-inner {
- overflow-y: auto;
- scrollbar-gutter: stable;
-}
-
-#left-panel-stack > [data-panel-id]:not(.collapsed) .panel-header {
- position: sticky;
- top: 0;
- z-index: 2;
- background: transparent;
-}
-
-#left-panel-stack > [data-panel-id]:not(.collapsed) .panel-divider {
- background: linear-gradient(90deg, rgb(0 212 255 / 28%), rgba(0, 212, 255, 0.18) 58%, transparent);
- box-shadow: 0 0 7px rgba(0, 212, 255, 0.22);
-}
-
-#right-context-rail [data-panel-id]:not(.collapsed) .panel-divider {
- background: linear-gradient(90deg, rgb(0 212 255 / 28%), rgba(0, 212, 255, 0.18) 58%, transparent);
- box-shadow: 0 0 7px rgba(0, 212, 255, 0.22);
-}
-
-#scene-panel .panel-glow {
- position: absolute;
- inset: -18px;
- background: radial-gradient(ellipse at center, rgba(0, 212, 255, 0.16) 0%, transparent 65%);
- filter: blur(16px);
- opacity: 0.25;
- pointer-events: none;
-}
-
-.scene-panel-inner {
- position: relative;
- background: var(--glass-bg);
- border: 1px solid var(--glass-border);
- border-radius: var(--panel-radius);
- padding: 14px;
- display: flex;
- flex-direction: column;
- max-height: calc(100vh - 24px);
- backdrop-filter: blur(24px) saturate(1.4);
- -webkit-backdrop-filter: blur(24px) saturate(1.4);
- box-shadow:
- 0 8px 32px rgba(0, 0, 0, 0.5),
- 0 0 0 1px rgba(255, 255, 255, 0.03) inset,
- 0 1px 0 rgba(255, 255, 255, 0.06) inset;
-}
-
-.scene-controls {
- display: flex;
- gap: 8px;
- margin-bottom: 8px;
- flex-wrap: wrap;
-}
-
-#scene-select {
- flex: 1;
- min-width: 0;
- background: rgba(255, 255, 255, 0.06);
- border: 1px solid rgba(255, 255, 255, 0.14);
- border-radius: 7px;
- color: var(--text-primary);
- padding: 6px 8px;
- font-family: var(--font-sans);
- font-size: 12px;
- outline: none;
-}
-
-.scene-btn {
- background: rgba(255, 255, 255, 0.05);
- border: 1px solid rgba(255, 255, 255, 0.14);
- border-radius: 7px;
- color: var(--text-secondary);
- font-family: var(--font-mono);
- font-size: 9px;
- letter-spacing: 1.2px;
- padding: 6px 9px;
- cursor: pointer;
- transition:
- background-color var(--transition-fast),
- border-color var(--transition-fast),
- color var(--transition-fast),
- opacity var(--transition-fast);
- white-space: nowrap;
- flex: 1;
- min-width: 72px;
-}
-
-#scene-start-btn,
-#scene-stop-btn,
-#scene-next-btn {
- flex: 1 1 0;
-}
-
-.scene-shot-list {
- display: flex;
- flex-direction: column;
- gap: 6px;
- max-height: 160px;
- min-height: 96px;
- flex: 1;
- overflow-y: auto;
- padding: 4px 2px 6px;
- margin-bottom: 8px;
-}
-
-.scene-shot-list::-webkit-scrollbar {
- width: 6px;
-}
-
-.scene-shot-list::-webkit-scrollbar-thumb {
- background: rgba(255, 255, 255, 0.16);
- border-radius: 999px;
-}
-
-.scene-shot-empty {
- border: 1px dashed rgba(255, 255, 255, 0.14);
- border-radius: 8px;
- padding: 10px 8px;
- text-align: center;
- font-family: var(--font-mono);
- font-size: 9px;
- letter-spacing: 1px;
- color: var(--text-dim);
-}
-
-.scene-shot-row {
- border: 1px solid rgba(255, 255, 255, 0.12);
- border-radius: 9px;
- padding: 7px 8px;
- background: rgba(255, 255, 255, 0.03);
- transition: border-color var(--transition-fast), background var(--transition-fast);
-}
-
-.scene-shot-row.active {
- border-color: var(--accent);
- background: rgba(0, 212, 255, 0.08);
-}
-
-.scene-shot-top {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 8px;
-}
-
-.scene-shot-label {
- font-family: var(--font-mono);
- font-size: 10px;
- letter-spacing: 1px;
- color: var(--text-primary);
-}
-
-.scene-shot-meta {
- margin-top: 4px;
- font-family: var(--font-mono);
- font-size: 8px;
- letter-spacing: 0.8px;
- color: var(--text-dim);
-}
-
-.scene-shot-actions {
- display: flex;
- gap: 6px;
-}
-
-.scene-shot-btn {
- border: 1px solid rgba(255, 255, 255, 0.14);
- border-radius: 6px;
- background: rgba(255, 255, 255, 0.05);
- color: var(--text-secondary);
- font-family: var(--font-mono);
- font-size: 8px;
- letter-spacing: 0.8px;
- padding: 4px 6px;
- cursor: pointer;
- transition:
- background-color var(--transition-fast),
- border-color var(--transition-fast),
- color var(--transition-fast);
-}
-
-.scene-shot-btn:hover {
- color: var(--text-primary);
- border-color: var(--glass-border-hover);
-}
-
-.scene-shot-btn.scene-shot-danger:hover {
- color: #ff7e7e;
- border-color: #ff7e7e;
-}
-
-.scene-btn:hover:not(:disabled) {
- color: var(--accent);
- border-color: var(--accent);
- background: rgba(0, 212, 255, 0.14);
-}
-
-.scene-btn:disabled {
- opacity: 0.45;
- cursor: default;
-}
-
-.scene-btn-danger:hover:not(:disabled) {
- color: #ff7272;
- border-color: #ff7272;
- background: rgba(255, 88, 88, 0.15);
-}
-
-.scene-progress {
- margin-top: 8px;
- width: 100%;
- height: 18px;
- border-radius: 999px;
- background: rgba(255, 255, 255, 0.06);
- border: 1px solid rgba(255, 255, 255, 0.1);
- overflow: hidden;
-}
-
-#scene-progress-fill {
- width: 0%;
- height: 100%;
- background: linear-gradient(90deg, rgba(0, 212, 255, 0.2), rgba(0, 212, 255, 0.75));
- color: #d5f7ff;
- font-family: var(--font-mono);
- font-size: 8px;
- letter-spacing: 1px;
- display: flex;
- align-items: center;
- justify-content: flex-end;
- padding-right: 6px;
- transition: width 100ms linear;
- text-shadow: 0 0 6px rgba(0, 212, 255, 0.6);
-}
-
-#scene-status {
- margin-top: 8px;
- font-family: var(--font-mono);
- font-size: 10px;
- letter-spacing: 1px;
- color: var(--text-secondary);
-}
-
-#scene-runtime {
- position: fixed;
- top: 34px;
- left: 50%;
- transform: translateX(-50%);
- z-index: 105;
- opacity: 0;
- visibility: hidden;
- transition: opacity 180ms ease, visibility 180ms ease;
- font-family: var(--font-mono);
- font-size: 11px;
- letter-spacing: 2px;
- color: #bff4ff;
- background: rgba(0, 0, 0, 0.45);
- border: 1px solid rgba(0, 212, 255, 0.36);
- border-radius: 999px;
- padding: 6px 14px;
- text-shadow: 0 0 8px rgba(0, 212, 255, 0.55);
- pointer-events: none;
-}
-
-#scene-runtime.active {
- opacity: 1;
- visibility: visible;
-}
-
-#control-panel.collapsed .button-grid,
-#data-panel.collapsed .data-toggle-list,
-#global-context-panel.collapsed #radio-panel,
-#global-context-panel.collapsed #military-awareness-panel,
-#global-context-panel.collapsed .global-context-actions,
-#global-context-panel.collapsed .global-context-modes,
-#global-context-panel.collapsed .context-mode-view,
-#global-context-panel.collapsed > .global-context-panel-inner > .context-mode-standby,
-#radio-panel.collapsed .radio-panel-inner > :not(.panel-header),
-#cctv-panel.collapsed .cctv-controls,
-#cctv-panel.collapsed .cctv-calibration-block,
-#cctv-panel.collapsed .cctv-frame-wrap,
-#cctv-panel.collapsed #cctv-source-badge,
-#cctv-panel.collapsed #cctv-meta,
-#cctv-panel.collapsed .cctv-summary-label,
-#cctv-panel.collapsed #cctv-summary,
-#scene-panel.collapsed .scene-controls,
-#scene-panel.collapsed .scene-shot-list,
-#scene-panel.collapsed .scene-progress,
-#scene-panel.collapsed #scene-status,
-#param-slider-panel.collapsed #param-sliders,
-#location-bar.collapsed .poi-row-container,
-#location-bar.collapsed .location-bar-divider,
-#location-bar.collapsed .location-city-row {
- display: none !important;
-}
-
-#data-panel.collapsed,
-#cctv-panel.collapsed,
-#scene-panel.collapsed {
- width: var(--left-collapsed-width);
-}
-
-#global-context-panel #radio-panel.collapsed { width: 100%; }
-
-#data-panel.collapsed .panel-title,
-#cctv-panel.collapsed .panel-title,
-#radio-panel.collapsed .panel-title,
-#scene-panel.collapsed .panel-title {
- font-size: 8px;
- letter-spacing: 1.8px;
-}
-
-#control-panel.collapsed .panel-inner,
-#data-panel.collapsed .data-panel-inner,
-#cctv-panel.collapsed .cctv-panel-inner,
-#radio-panel.collapsed .radio-panel-inner,
-#scene-panel.collapsed .scene-panel-inner,
-#param-slider-panel.collapsed,
-#location-bar.collapsed .location-inner {
- padding-bottom: 10px;
-}
-
-#control-panel.collapsed .panel-header,
-#data-panel.collapsed .panel-header,
-#cctv-panel.collapsed .panel-header,
-#radio-panel.collapsed .panel-header,
-#global-context-panel.collapsed .panel-header,
-#scene-panel.collapsed .panel-header,
-#param-slider-panel.collapsed .param-panel-header {
- margin-bottom: 2px;
-}
-
-/* ── Recording Mode ─────────────────────────── */
-body.recording-mode #title-bar,
-body.recording-mode #style-indicator,
-body.recording-mode #top-center-actions,
-body.recording-mode #global-loading-status,
-body.recording-mode #traffic-sync-chip,
-body.recording-mode #cctv-sync-chip,
-body.recording-mode #pp-toggles,
-body.recording-mode #clean-view-exit,
-body.recording-mode #param-slider-panel,
-body.recording-mode #control-panel,
-body.recording-mode #location-bar,
-body.recording-mode #data-panel,
-body.recording-mode #cctv-panel,
-body.recording-mode #radio-panel,
-body.recording-mode #global-context-panel,
-body.recording-mode #gev-voice-control,
-body.recording-mode #scene-panel {
- opacity: 0 !important;
- visibility: hidden !important;
- pointer-events: none !important;
-}
-
-body.recording-mode #scene-runtime.active {
- opacity: 1;
- visibility: visible;
-}
-
-/* Scene playback owns layer and camera sequencing until Stop or completion. */
-body.scene-playback-mode :is(#clear-selected-layers, #reset-globe-view) {
- display: none !important;
-}
-
-/* ── Responsive ───────────────────────────────── */
-@media (max-width: 720px) {
- #pp-toggles {
- --pp-expanded-width: 176px;
- position: relative;
- inset: auto;
- gap: 6px;
- }
-
- .pp-toggle-group,
- #clean-view-toggle {
- width: 176px;
- }
-
- .button-grid {
- flex-wrap: nowrap;
- }
-
- #control-panel {
- left: 16px;
- right: 16px;
- transform: none;
- max-width: none;
- }
-
- #title-bar {
- top: 20px;
- left: 20px;
- }
-
- #title-bar h1 {
- font-size: 16px;
- letter-spacing: 4px;
- }
-
- #title-bar h1 {
- gap: 8px;
- }
-
- #title-bar .title-logo {
- width: 36px;
- }
-
- #location-bar {
- left: 16px;
- right: 16px;
- transform: none;
- max-width: none;
- bottom: 120px;
- }
-
- #gev-voice-control {
- right: 16px;
- bottom: 16px;
- min-width: 196px;
- }
-
- #gev-voice-detail {
- max-width: 112px;
- }
-
- .hud-top-left,
- .hud-bottom-left {
- left: 16px;
- }
-
- .hud-top-right,
- .hud-bottom-right {
- right: 16px;
- }
-
- .hud-left-edge,
- .hud-right-edge {
- display: none;
- }
-
- .hud-top-bar,
- .hud-bottom-bar {
- width: calc(100vw - 24px);
- left: 12px;
- transform: none;
- }
-
- .hud-top-bar {
- top: 54px;
- font-size: 9px;
- }
-
- #intel-hud[data-variant='operator'] .hud-top-bar {
- left: 12px;
- right: auto;
- width: calc(100vw - 24px);
- transform: none;
- }
-
- .hud-bottom-bar {
- bottom: 90px;
- font-size: 9px;
- }
-
- #data-panel {
- top: auto;
- left: 16px;
- bottom: 200px;
- width: 260px;
- }
-
- #data-panel.collapsed {
- width: 260px;
- }
-
- #cctv-panel {
- top: auto;
- left: 16px;
- right: 16px;
- width: auto;
- bottom: 308px;
- }
-
- #cctv-panel.collapsed {
- width: auto;
- }
-
- /* Narrow viewports: cap the preview height to keep the panel compact. Cap
- the IMAGE, not the wrap — the wrap is overflow:hidden, so capping it would
- re-crop the very timestamp this is protecting. object-fit: contain then
- letterboxes inside the shorter box. */
- #cctv-frame {
- aspect-ratio: auto;
- height: 120px;
- }
-
- .cctv-frame-wrap {
- min-height: 0;
- }
-
- #scene-panel {
- top: auto;
- right: 16px;
- left: 16px;
- width: auto;
- bottom: 12px;
- }
-
- #scene-panel.collapsed {
- width: auto;
- }
-
- #left-panel-stack {
- top: 70px;
- right: 16px;
- bottom: calc(50vh + 8px);
- left: 16px;
- width: auto;
- max-height: none;
- overflow-y: auto;
- }
-
- #right-context-rail {
- top: calc(50vh + 8px);
- right: 16px;
- /* The rail goes edge-to-edge at this width, so its floor is what decides
- whether the required Google/Cesium credit line survives. The credit's
- top edge sits at calc(2vh + 5rem) plus its own 28px, so a flat 100px
- floor cut into it at EVERY viewport height — the DISPLAY toggles were
- drawn straight over the notice. Track the credit's own anchor instead
- and the 12px of clear air holds regardless of height; the rail already
- scrolls (overflow-y below), so it loses reach, not content. */
- bottom: calc(2vh + 7.5rem);
- left: 16px;
- width: auto;
- max-height: none;
- overflow-y: auto;
- }
-
- #right-context-rail > #pp-toggles {
- width: 100%;
- }
-
- #right-context-rail #pp-toggles.collapsed .pp-header-row,
- #right-context-rail #cctv-panel,
- #right-context-rail #cctv-panel.collapsed,
- #right-context-rail #radio-panel,
- #right-context-rail #radio-panel.collapsed,
- #right-context-rail #global-context-panel,
- #right-context-rail #global-context-panel.collapsed {
- width: 100%;
- }
- .context-radio-mini {
- right: -38px;
- width: min(244px, calc(100vw - 32px));
- }
-
- #left-panel-stack > #data-panel,
- #left-panel-stack > #cctv-panel,
- #left-panel-stack > #global-context-panel,
- #left-panel-stack > #scene-panel,
- #left-panel-stack > #data-panel.collapsed,
- #left-panel-stack > #cctv-panel.collapsed,
- #left-panel-stack > #global-context-panel.collapsed,
- #left-panel-stack > #scene-panel.collapsed {
- position: relative;
- top: auto;
- right: auto;
- bottom: auto;
- left: auto;
- width: 100%;
- }
-
- #scene-runtime {
- top: 16px;
- max-width: calc(100vw - 24px);
- text-align: center;
- }
-}
-
-/* ── Unified Command Dock ────────────────────── */
-#command-dock {
- position: fixed;
- right: auto;
- bottom: 2vh;
- left: 50%;
- z-index: 145;
- display: grid;
- grid-template-areas: 'locations voice presets';
- grid-template-columns: minmax(300px, 1fr) minmax(230px, 270px) minmax(390px, 1.15fr);
- align-items: stretch;
- width: min(94vw, 1240px);
- padding: 6px;
- overflow: visible;
- background: rgba(9, 18, 27, 0.84);
- border: 1px solid rgba(123, 189, 211, 0.28);
- border-radius: 12px;
- box-shadow:
- 0 12px 36px rgba(0, 0, 0, 0.58),
- 0 0 0 1px rgba(255, 255, 255, 0.03) inset,
- 0 0 28px rgba(0, 212, 255, 0.06);
- backdrop-filter: blur(28px) saturate(1.35);
- -webkit-backdrop-filter: blur(28px) saturate(1.35);
- transform: translateX(-50%);
- transition: opacity var(--transition-smooth), visibility var(--transition-smooth);
-}
-
-#command-dock > #location-bar,
-#command-dock > #control-panel,
-#command-dock > #gev-voice-control {
- position: relative;
- inset: auto;
- width: auto;
- max-width: none;
- transform: none;
-}
-
-#command-dock > #location-bar {
- grid-area: locations;
- min-width: 0;
- border-right: 1px solid rgba(123, 189, 211, 0.16);
-}
-
-#command-dock > #control-panel {
- grid-area: presets;
- min-width: 0;
- border-left: 1px solid rgba(123, 189, 211, 0.16);
-}
-
-#command-dock > #gev-voice-control {
- grid-area: voice;
- z-index: 2;
- align-self: stretch;
- justify-content: center;
- min-width: 0;
- margin: -14px 0;
- padding: 19px 14px 12px;
- border-color: rgba(0, 212, 255, 0.36);
- border-radius: 12px;
- background: rgba(8, 31, 42, 0.94);
- box-shadow:
- 0 12px 30px rgba(0, 0, 0, 0.56),
- 0 0 26px rgba(0, 212, 255, 0.12),
- 0 0 0 1px rgba(0, 212, 255, 0.08) inset;
-}
-
-#command-dock .gev-voice-kicker {
- position: absolute;
- top: 6px;
- right: 14px;
- left: 14px;
- overflow: hidden;
- color: rgba(190, 221, 230, 0.52);
- font-family: var(--font-mono);
- font-size: 7px;
- letter-spacing: 1.5px;
- text-align: center;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-
-#command-dock #gev-voice-button {
- width: 78px;
- height: 42px;
-}
-
-#command-dock .gev-voice-readout {
- flex: 1;
- text-align: left;
-}
-
-#command-dock #gev-voice-detail {
- max-width: 110px;
-}
-
-#command-dock .panel-glow {
- display: none;
-}
-
-#command-dock .panel-inner,
-#command-dock .location-inner,
-#command-dock #control-panel.collapsed .panel-inner,
-#command-dock #location-bar.collapsed .location-inner {
- height: 100%;
- padding: 8px 14px;
- background: transparent;
- border: 0;
- border-radius: 0;
- box-shadow: none;
- backdrop-filter: none;
- -webkit-backdrop-filter: none;
-}
-
-#command-dock .panel-header,
-#command-dock .location-toolbar,
-#command-dock #control-panel.collapsed .panel-header {
- min-height: 18px;
- margin: 0 0 6px;
- padding: 0;
-}
-
-#command-dock .panel-title,
-#command-dock .location-toolbar-label {
- font-size: 8px;
- letter-spacing: 1.6px;
- color: rgba(190, 221, 230, 0.58);
-}
-
-#command-dock .panel-collapse-btn,
-#command-dock .panel-mini-status,
-#command-dock .location-mini-status {
- display: none !important;
-}
-
-#command-dock #control-panel.collapsed .button-grid,
-#command-dock #location-bar.collapsed .location-city-row {
- display: flex !important;
-}
-
-#command-dock .button-grid {
- gap: 6px;
-}
-
-#command-dock .style-btn {
- min-width: 52px;
- gap: 4px;
- padding: 9px 8px 7px;
- border-radius: 7px;
-}
-
-#command-dock .btn-icon {
- font-size: 16px;
-}
-
-#command-dock .btn-label {
- font-family: var(--font-mono);
- font-size: 8px;
- letter-spacing: 0.4px;
- text-transform: uppercase;
-}
-
-#command-dock .btn-key {
- top: 3px;
- right: 4px;
- font-size: 7px;
-}
-
-#command-dock .location-city-row {
- min-width: 0;
- gap: 8px;
-}
-
-#command-dock .location-search-wrap {
- order: -1;
- flex: 0 1 190px;
- min-width: 132px;
- padding-right: 8px;
- border-right: 1px solid rgba(123, 189, 211, 0.14);
-}
-
-#command-dock .search-toggle-btn {
- width: 30px;
- height: 30px;
- border-radius: 6px;
-}
-
-#command-dock #location-search,
-#command-dock #location-search.expanded {
- width: 100%;
- min-width: 0;
- padding: 6px 8px;
- font-size: 11px;
-}
-
-#command-dock .location-pills {
- flex: 1;
- min-width: 0;
-}
-
-#command-dock .location-pill {
- padding: 7px 10px;
- border-radius: 6px;
- font-family: var(--font-mono);
- font-size: 9px;
- text-transform: uppercase;
-}
-
-#command-dock .poi-row-container.expanded {
- margin-bottom: 4px;
-}
-
-/* Keep required map attribution clear of the full-width command surface. */
-body:not(.ui-clean-view):not(.recording-mode) #cesium-credits {
- bottom: calc(2vh + 7rem);
-}
-
-body:not(.ui-clean-view):not(.recording-mode):has(#intel-hud[data-variant='minimal'].active) #cesium-credits {
- right: 36px;
- left: auto;
- width: min(340px, calc(100vw - 72px)) !important;
- text-align: right;
-}
-
-body.ui-clean-view #command-dock,
-body.recording-mode #command-dock {
- opacity: 0 !important;
- visibility: hidden !important;
- pointer-events: none !important;
-}
-
-body.ui-clean-view #cesium-credits,
-body.recording-mode #cesium-credits {
- right: auto;
- bottom: 36px;
- left: 36px;
-}
-
-#intel-hud[data-variant='minimal'] .hud-bottom-left {
- bottom: calc(2vh + 7.5rem);
-}
-
-#intel-hud[data-variant='minimal'] .hud-bottom-bar {
- bottom: calc(2vh + 11.5rem);
-}
-
-@media (max-width: 980px) {
- #command-dock {
- grid-template-areas:
- 'locations voice'
- 'presets presets';
- grid-template-columns: minmax(0, 1fr) minmax(170px, 210px);
- width: calc(100vw - 24px);
- }
-
- #command-dock > #location-bar {
- border-right: 1px solid rgba(123, 189, 211, 0.16);
- border-bottom: 1px solid rgba(123, 189, 211, 0.16);
- }
-
- #command-dock > #control-panel {
- border-top: 1px solid rgba(123, 189, 211, 0.16);
- border-left: 0;
- }
-
- #command-dock > #gev-voice-control {
- margin: -10px 0 0;
- }
-
- body:not(.ui-clean-view):not(.recording-mode) #cesium-credits {
- bottom: calc(2vh + 9.5rem);
- }
-
- #intel-hud[data-variant='minimal'] .hud-bottom-left {
- bottom: calc(2vh + 12rem);
- }
-
- #intel-hud[data-variant='minimal'] .hud-bottom-bar {
- bottom: calc(2vh + 16rem);
- }
-}
-
-@media (max-width: 720px) {
- #command-dock {
- bottom: 8px;
- }
-
- #command-dock .location-search-wrap {
- flex-basis: 150px;
- }
-
- #command-dock .panel-inner,
- #command-dock .location-inner,
- #command-dock #control-panel.collapsed .panel-inner,
- #command-dock #location-bar.collapsed .location-inner {
- padding: 7px 9px;
- }
-
- #left-panel-stack {
- bottom: calc(50vh + 8px);
- }
-}
-/* ── Compact accordion command dock ──────────── */
-#command-dock {
- --dock-side-compact: clamp(9.5rem, 12vw, 10.5rem);
- --dock-location-open: clamp(28rem, 40vw, 33rem);
- --dock-presets-open: clamp(25rem, 36vw, 29rem);
- --dock-voice-width: clamp(13.5rem, 17vw, 15rem);
- display: flex;
- grid-template-areas: none;
- grid-template-columns: none;
- align-items: center;
- width: fit-content;
- max-width: calc(100vw - 4vw);
- min-height: 3.75rem;
- padding: 0.2rem;
- border-radius: 0.4rem;
- transform: translateX(-50%);
- transition:
- transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1),
- opacity var(--transition-smooth),
- visibility var(--transition-smooth);
-}
-
-#command-dock:has(#location-bar:not(.collapsed)) {
- transform: translateX(calc(-50% + (var(--dock-location-open) - var(--dock-side-compact)) / 2));
-}
-
-#command-dock:has(#control-panel:not(.collapsed)) {
- transform: translateX(calc(-50% - (var(--dock-presets-open) - var(--dock-side-compact)) / 2));
-}
-
-#command-dock > #location-bar,
-#command-dock > #control-panel {
- flex: 0 0 var(--dock-side-compact);
- align-self: stretch;
- min-width: 0;
- height: auto;
- overflow: hidden;
- border: 0;
- transition: flex-basis 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
-}
-
-#command-dock > #location-bar:not(.collapsed) {
- flex-basis: var(--dock-location-open);
-}
-
-#command-dock > #control-panel:not(.collapsed) {
- flex-basis: var(--dock-presets-open);
-}
-
-#command-dock > #location-bar {
- border-right: 1px solid rgba(123, 189, 211, 0.18);
-}
-
-#command-dock > #control-panel {
- border-left: 1px solid rgba(123, 189, 211, 0.18);
-}
-
-#command-dock .panel-inner,
-#command-dock .location-inner,
-#command-dock #control-panel.collapsed .panel-inner,
-#command-dock #location-bar.collapsed .location-inner {
- display: flex;
- flex-direction: column;
- justify-content: center;
- min-height: 3.75rem;
- padding: 0.45rem 0.75rem;
-}
-
-#command-dock .panel-header,
-#command-dock .location-toolbar,
-#command-dock #control-panel.collapsed .panel-header {
- flex: 0 0 auto;
- min-width: calc(var(--dock-side-compact) - 1.5rem);
- min-height: 1rem;
- margin: 0;
-}
-
-#command-dock .panel-title,
-#command-dock .location-toolbar-label {
- width: max-content;
- font-size: 0.45rem;
- letter-spacing: 0.12rem;
- white-space: nowrap;
-}
-
-#command-dock .panel-title::after,
-#command-dock .location-toolbar-label::after {
- content: '›';
- margin-left: 0.45rem;
- color: rgba(54, 220, 255, 0.68);
- font-size: 0.7rem;
-}
-
-#command-dock #control-panel .panel-title::after {
- content: '‹';
- margin-right: 0.45rem;
- margin-left: 0;
- float: left;
-}
-
-#command-dock #location-bar.collapsed .location-city-row,
-#command-dock #location-bar.collapsed .poi-row-container,
-#command-dock #location-bar.collapsed .location-bar-divider,
-#command-dock #control-panel.collapsed .button-grid {
- display: none !important;
-}
-
-#command-dock #location-bar:not(.collapsed) .location-toolbar,
-#command-dock #control-panel:not(.collapsed) .panel-header {
- margin-bottom: 0.35rem;
-}
-
-#command-dock #location-bar:not(.collapsed) .location-city-row,
-#command-dock #control-panel:not(.collapsed) .button-grid {
- display: flex !important;
- animation: command-dock-reveal 220ms ease-out both;
-}
-
-#command-dock .location-city-row {
- flex-wrap: nowrap;
- gap: 0.35rem;
- overflow: hidden;
-}
-
-#command-dock .location-search-wrap {
- flex: 0 0 10.5rem;
- min-width: 0;
- padding-right: 0.4rem;
-}
-
-#command-dock .search-toggle-btn {
- width: 1.75rem;
- height: 1.75rem;
-}
-
-#command-dock #location-search,
-#command-dock #location-search.expanded {
- height: 1.75rem;
- padding: 0.3rem 0.45rem;
- font-size: 0.62rem;
-}
-
-#command-dock .location-pills {
- display: flex;
- gap: 0.3rem;
- overflow-x: auto;
- scrollbar-width: none;
-}
-
-#command-dock .location-pills::-webkit-scrollbar {
- display: none;
-}
-
-#command-dock .location-pill,
-#command-dock .poi-pill {
- flex: 0 0 auto;
- min-height: 1.75rem;
- padding: 0.3rem 0.55rem;
- border-radius: 0.2rem;
- font-size: 0.52rem;
- white-space: nowrap;
-}
-
-#command-dock .poi-row-container.expanded {
- display: flex;
- justify-content: flex-start;
- gap: 0.3rem;
- max-height: 2.1rem;
- margin: 0 0 0.35rem;
- overflow-x: auto;
- overflow-y: hidden;
- animation: command-dock-reveal 180ms ease-out both;
- scrollbar-width: none;
-}
-
-#command-dock .poi-row-container.expanded::-webkit-scrollbar {
- display: none;
-}
-
-#command-dock .location-bar-divider.visible {
- display: none;
-}
-
-#command-dock .button-grid {
- flex-wrap: nowrap;
- gap: 0.3rem;
- overflow-x: auto;
- scrollbar-width: none;
-}
-
-#command-dock .button-grid::-webkit-scrollbar {
- display: none;
-}
-
-#command-dock .style-btn {
- flex: 0 0 3.2rem;
- min-width: 3.2rem;
- min-height: 2.45rem;
- gap: 0.1rem;
- padding: 0.3rem 0.25rem;
- border-radius: 0.2rem;
-}
-
-#command-dock .btn-icon {
- font-size: 0.78rem;
-}
-
-#command-dock .btn-label {
- font-size: 0.43rem;
- letter-spacing: 0.02rem;
-}
-
-#command-dock .btn-key {
- display: none;
-}
-
-#command-dock > #gev-voice-control {
- position: relative;
- inset: auto;
- z-index: 3;
- display: grid;
- grid-template-columns: 3.2rem 1fr 3.6rem;
- grid-template-rows: 0.8rem 2.55rem 0.8rem;
- flex: 0 0 var(--dock-voice-width);
- width: var(--dock-voice-width);
- min-width: 0;
- height: 4.9rem;
- margin: -0.65rem 0;
- padding: 0.3rem 0.65rem;
- gap: 0 0.35rem;
- overflow: hidden;
- border-radius: var(--panel-radius);
- transform: none;
-}
-
-#command-dock .gev-voice-kicker {
- position: static;
- grid-column: 2 / 4;
- grid-row: 1;
- align-self: center;
- color: rgba(190, 221, 230, 0.58);
- font-size: 0.39rem;
- letter-spacing: 0.07rem;
- text-align: center;
-}
-
-#command-dock #gev-voice-button {
- grid-column: 1;
- grid-row: 1 / 4;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- width: 3rem;
- height: 3rem;
- align-self: center;
- gap: 0.15rem;
- padding: 0;
- border-radius: 50%;
- box-shadow:
- 0 0 0 0.2rem rgba(0, 212, 255, 0.06),
- 0 0 1rem rgba(0, 212, 255, 0.12);
-}
-
-#command-dock .gev-mic-orbit {
- display: grid;
- place-items: center;
- width: 1.7rem;
- height: 1.7rem;
-}
-
-#command-dock .gev-mic-orbit img {
- width: 1.55rem;
- height: 1.55rem;
-}
-
-#command-dock .gev-mic-label {
- font-size: 0.35rem;
- color: rgba(190, 221, 230, 0.72);
- letter-spacing: 0.02rem;
-}
-
-#command-dock .gev-voice-visualizer {
- grid-column: 2;
- grid-row: 2;
- display: flex;
- align-items: end;
- justify-content: center;
- gap: 0.12rem;
- height: 2.2rem;
- padding: 0.2rem 0.1rem;
- border-bottom: 1px solid rgba(54, 220, 255, 0.34);
-}
-
-#command-dock .gev-voice-visualizer span {
- width: 0.18rem;
- height: 0.55rem;
- background: linear-gradient(to top, #28b9db, #71eaff);
- box-shadow: 0 0 0.35rem rgba(54, 220, 255, 0.28);
- transform-origin: bottom;
-}
-
-#command-dock .gev-voice-visualizer span:nth-child(3n) { height: 1.35rem; }
-#command-dock .gev-voice-visualizer span:nth-child(4n) { height: 0.95rem; }
-#command-dock .gev-voice-visualizer span:nth-child(5n) { height: 1.7rem; }
-#command-dock .gev-voice-visualizer span:nth-child(7n) { height: 0.75rem; }
-
-#command-dock #gev-voice-control[data-status='listening'] .gev-voice-visualizer span,
-#command-dock #gev-voice-control[data-status='executing'] .gev-voice-visualizer span {
- animation: gev-voice-bar 680ms ease-in-out infinite alternate;
- animation-delay: calc(var(--bar) * -45ms);
-}
-
-#command-dock .gev-voice-readout {
- display: contents;
-}
-
-#command-dock #gev-voice-status {
- grid-column: 3;
- grid-row: 2;
- align-self: start;
- padding-top: 0.2rem;
- font-size: 0.45rem;
- text-align: right;
-}
-
-#command-dock #gev-voice-detail {
- grid-column: 2 / 4;
- grid-row: 3;
- align-self: center;
- max-width: none;
- margin: 0;
- font-size: 0.39rem;
- letter-spacing: 0.08rem;
- text-align: center;
-}
-
-@keyframes command-dock-reveal {
- from { opacity: 0; transform: translateY(0.2rem); }
- to { opacity: 1; transform: translateY(0); }
-}
-
-@keyframes gev-voice-bar {
- from { transform: scaleY(0.35); opacity: 0.5; }
- to { transform: scaleY(1); opacity: 1; }
-}
-
-/* Compact dock clearance keeps the reference-like low profile. */
-body:not(.ui-clean-view):not(.recording-mode) #cesium-credits {
- bottom: calc(2vh + 4.7rem);
-}
-
-#intel-hud[data-variant='minimal'] .hud-bottom-left {
- bottom: calc(2vh + 5.4rem);
-}
-
-#intel-hud[data-variant='minimal'] .hud-bottom-bar {
- bottom: calc(2vh + 8.9rem);
-}
-
-@media (max-width: 900px) {
- #command-dock {
- --dock-popover-mobile-width: calc(100vw - 1.5rem);
- }
-
- #command-dock {
- --dock-side-compact: 4.25rem;
- --dock-location-open: calc(100vw - 7rem);
- --dock-presets-open: calc(100vw - 7rem);
- --dock-voice-width: 11.5rem;
- max-width: calc(100vw - 1rem);
- }
-
- #command-dock:has(#location-bar:not(.collapsed)),
- #command-dock:has(#control-panel:not(.collapsed)) {
- transform: translateX(-50%);
- }
-
- #command-dock:has(#location-bar:not(.collapsed)) > #control-panel,
- #command-dock:has(#control-panel:not(.collapsed)) > #location-bar {
- flex-basis: 0;
- border: 0;
- }
-
- #command-dock:has(#location-bar:not(.collapsed)) > #gev-voice-control,
- #command-dock:has(#control-panel:not(.collapsed)) > #gev-voice-control {
- flex-basis: 4.75rem;
- width: 4.75rem;
- }
-
- #command-dock:has(#location-bar:not(.collapsed)) .gev-voice-visualizer,
- #command-dock:has(#location-bar:not(.collapsed)) .gev-voice-kicker,
- #command-dock:has(#location-bar:not(.collapsed)) .gev-voice-readout,
- #command-dock:has(#control-panel:not(.collapsed)) .gev-voice-visualizer,
- #command-dock:has(#control-panel:not(.collapsed)) .gev-voice-kicker,
- #command-dock:has(#control-panel:not(.collapsed)) .gev-voice-readout {
- visibility: hidden;
- }
-
- #command-dock .location-search-wrap {
- flex-basis: 8.5rem;
- }
-}
-
-/* ── Command dock refinement: stacked trays + voice states ── */
-#command-dock {
- --dock-voice-width: 8.75rem;
- --dock-location-pinned-height: 0px;
- --dock-presets-pinned-height: 0px;
- --dock-pinned-stack-height: 0px;
- --dock-lower-pinned-height: 0px;
- --dock-unified-width: calc(var(--dock-side-compact) * 2 + var(--dock-voice-width));
- --dock-location-open: max(34rem, calc(var(--dock-unified-width) + 0.75rem));
- --dock-presets-open: max(34rem, calc(var(--dock-unified-width) + 0.75rem));
-}
-
-#command-dock .panel-title,
-#command-dock .location-toolbar-label {
- display: inline-flex;
- align-items: center;
- gap: 0.42rem;
- color: rgba(206, 232, 239, 0.72);
- font-size: 0.58rem;
- font-weight: 500;
- letter-spacing: 0.13rem;
-}
-
-#command-dock .dock-label-icon {
- display: inline-block;
- flex: 0 0 1rem;
- width: 1rem;
- height: 1rem;
- background: rgba(232, 234, 237, 0.3);
- mask-position: center;
- mask-repeat: no-repeat;
- mask-size: contain;
- -webkit-mask-position: center;
- -webkit-mask-repeat: no-repeat;
- -webkit-mask-size: contain;
- transition: background-color 160ms ease, filter 160ms ease;
-}
-
-#command-dock .dock-label-icon-location {
- mask-image: url('/location.svg');
- -webkit-mask-image: url('/location.svg');
-}
-
-#command-dock .dock-label-icon-presets {
- mask-image: url('/visual-presets.svg');
- -webkit-mask-image: url('/visual-presets.svg');
-}
-
-#command-dock :is(#location-bar, #control-panel):hover .dock-label-icon,
-#command-dock :is(#location-bar, #control-panel).dock-pinned .dock-label-icon {
- background: var(--accent);
- filter: drop-shadow(0 0 0.35rem rgba(0, 212, 255, 0.28));
-}
-
-#command-dock :is(#location-bar, #control-panel):hover .location-toolbar-label,
-#command-dock :is(#location-bar, #control-panel):hover .panel-title{
- color: var(--accent);
-}
-
-
-
-#command-dock #control-panel .panel-header {
- justify-content: center;
-}
-
-#command-dock #location-bar .dock-tray-toggle {
- display: flex;
- box-sizing: border-box;
- width: 100%;
- min-width: 0;
- padding: 0;
- color: inherit;
- background: transparent;
- border: 0;
- font: inherit;
- cursor: pointer;
- outline: none;
-}
-
-#command-dock #location-bar .dock-tray-toggle:focus-visible {
- outline: 2px solid var(--text-primary);
- outline-offset: 3px;
- border-radius: 3px;
-}
-
-#command-dock #control-panel .dock-tray-toggle {
- box-sizing: border-box;
- width: 100%;
- color: inherit;
- background: transparent;
- border: 0;
- font: inherit;
- cursor: pointer;
- outline: none;
-}
-
-#command-dock #control-panel .dock-tray-toggle:focus-visible {
- outline: 1px solid color-mix(in srgb, var(--accent) 80%, transparent);
- outline-offset: 3px;
- border-radius: 3px;
-}
-
-#command-dock #control-panel .panel-title {
- justify-content: center;
- width: 100%;
- text-align: center;
-}
-
-#command-dock #control-panel .panel-divider {
- display: none;
-}
-
-#command-dock .location-toolbar-label,
-#command-dock #control-panel .panel-title {
- position: relative;
- padding-bottom: 0.4rem;
-}
-
-#command-dock .location-toolbar-label::after,
-#command-dock #control-panel .panel-title::after {
- content: '';
- position: absolute;
- right: 0;
- bottom: 0;
- left: 0;
- display: block;
- height: 1px;
-}
-
-#command-dock .location-toolbar-label::after {
- background: linear-gradient(to right, rgba(232, 234, 237, 0.3), transparent);
-}
-
-#command-dock #control-panel .panel-title::after {
- background: linear-gradient(to left, rgba(232, 234, 237, 0.3), transparent);
-}
-
-#command-dock .panel-title::after,
-#command-dock .location-toolbar-label::after,
-#command-dock #control-panel .panel-title::after {
- content: none;
- display: none;
-}
-
-#command-dock .dock-popover-content {
- padding: 0.7rem;
-}
-
-#command-dock .dock-pin-btn {
- position: relative;
- top: auto;
- right: auto;
- align-self: flex-end;
- display: none;
- place-items: center;
- width: 1.65rem;
- min-width: 1.65rem;
- height: 1.65rem;
- margin: -1.48rem -0.22rem 0.25rem 0;
- padding: 0;
- border-radius: 50%;
- background: rgba(8, 24, 34, 0.96);
- box-shadow: 0 0.35rem 0.9rem rgba(0, 0, 0, 0.5);
- transform: translateY(-0.12rem);
-}
-
-#command-dock #location-bar:not(.collapsed) .dock-pin-btn,
-#command-dock #control-panel:not(.collapsed) .dock-pin-btn {
- display: grid;
-}
-
-#command-dock .dock-pin-btn img {
- width: 0.9rem;
- height: 0.9rem;
- opacity: 0.58;
- transition: opacity 160ms ease, transform 160ms ease;
-}
-
-#command-dock #location-bar .dock-pin-btn {
- align-self: flex-start;
- margin-right: 0;
- margin-left: -0.22rem;
-}
-
-#command-dock .dock-pin-btn:hover img,
-#command-dock .dock-pin-btn[aria-pressed='true'] img {
- opacity: 1;
- transform: rotate(-12deg) scale(1.08);
-}
-
-#command-dock.dock-has-pinned-tray #location-bar:not(.collapsed):not(.dock-pinned) .dock-popover-content,
-#command-dock.dock-has-pinned-tray #control-panel:not(.collapsed):not(.dock-pinned) .dock-popover-content {
- bottom: calc(100% + 1.2rem + var(--dock-pinned-stack-height));
-}
-
-#command-dock.dock-has-two-pinned-trays .dock-pinned-top.dock-pinned:not(.collapsed) .dock-popover-content {
- bottom: calc(100% + 1.2rem + var(--dock-lower-pinned-height));
-}
-
-#command-dock.dock-has-pinned-tray .gev-voice-error-tray {
- bottom: calc(100% + 1.7rem + var(--dock-pinned-stack-height));
-}
-
-#command-dock .location-pill,
-#command-dock .poi-pill,
-#command-dock .btn-label {
- font-size: 0.56rem;
-}
-
-#command-dock #location-search,
-#command-dock #location-search.expanded {
- font-size: 0.68rem;
-}
-
-#command-dock > #gev-voice-control {
- grid-template-columns: 3rem minmax(0, 1fr);
- grid-template-rows: 0.8rem 2.25rem 0.85rem;
- gap: 0.12rem 0.28rem;
- width: var(--dock-voice-width);
- flex-basis: var(--dock-voice-width);
- height: 5.35rem;
- margin-top: -0.97rem;
- margin-bottom: -0.97rem;
- padding: 0.32rem 0.38rem 0.3rem;
- overflow: visible;
-}
-
-#command-dock .gev-voice-heading {
- grid-column: 2;
- grid-row: 1;
- display: flex;
- align-items: center;
- justify-content: flex-start;
- gap: 0.35rem;
- min-width: 0;
-}
-
-#command-dock .gev-voice-kicker {
- position: static;
- padding-right: 0;
- font-size: 0.46rem;
- font-weight: 500;
- letter-spacing: 0.08rem;
-}
-
-#command-dock #gev-voice-button {
- grid-column: 1;
- grid-row: 1 / 4;
- align-self: center;
- width: 2.65rem;
- height: 4.15rem;
- background: transparent;
- border: 0;
- border-radius: 0;
- box-shadow: none;
-}
-
-#command-dock .gev-mic-orbit {
- flex: 0 0 2.45rem;
- width: 2.45rem;
- height: 2.45rem;
- aspect-ratio: 1;
- box-sizing: border-box;
- background: rgba(0, 212, 255, 0.06);
- border: 1px solid rgba(0, 212, 255, 0.48);
- border-radius: 50%;
- box-shadow: 0 0 0 0.18rem rgba(0, 212, 255, 0.06), 0 0 0.9rem rgba(0, 212, 255, 0.12);
-}
-
-#command-dock .gev-mic-label {
- display: block;
- margin-top: 0.18rem;
- font-size: 0.42rem;
- letter-spacing: 0.035rem;
-}
-
-#command-dock .gev-voice-visualizer {
- grid-column: 2;
- grid-row: 2;
- align-self: stretch;
- box-sizing: border-box;
- height: 2.25rem;
- padding: 0.3rem 0.05rem 0.12rem;
- overflow: hidden;
- visibility: visible;
- opacity: 0.54;
- transform: none;
- transition: opacity 180ms ease;
-}
-
-#command-dock #gev-voice-control[data-status='connecting'] .gev-voice-visualizer,
-#command-dock #gev-voice-control[data-status='listening'] .gev-voice-visualizer,
-#command-dock #gev-voice-control[data-status='executing'] .gev-voice-visualizer {
- visibility: visible;
- opacity: 1;
- transform: none;
-}
-
-#command-dock #gev-voice-status {
- position: static;
- width: auto;
- padding-top: 0;
- color: var(--accent);
- font-size: 0.43rem;
- text-align: left;
-}
-
-#command-dock #gev-voice-detail {
- grid-column: 2;
- grid-row: 3;
- align-self: start;
- padding-top: 0.12rem;
- max-width: 100%;
- overflow: hidden;
- font-size: 0.39rem;
- font-weight: 500;
- letter-spacing: 0.035rem;
- text-align: left;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-
-#command-dock #gev-voice-control[data-status='connecting'] #gev-voice-detail,
-#command-dock #gev-voice-control[data-status='listening'] #gev-voice-detail,
-#command-dock #gev-voice-control[data-status='executing'] #gev-voice-detail {
- grid-row: 3;
- font-size: 0.43rem;
-}
-
-#command-dock #gev-voice-control[data-status='error'] {
- display: grid;
- align-items: initial;
- width: var(--dock-voice-width);
- border-color: rgba(255, 92, 110, 0.58);
- border-radius: 0.4rem;
-}
-
-#command-dock #gev-voice-control[data-status='error'] .gev-voice-readout {
- display: contents;
-}
-
-#command-dock #gev-voice-control[data-status='error'] #gev-voice-detail {
- max-width: none;
- overflow: hidden;
- color: #ffb4bd;
- line-height: 1.2;
- text-align: center;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-
-#command-dock .gev-voice-error-tray {
- position: absolute;
- bottom: calc(100% + 0.7rem);
- left: 50%;
- z-index: 8;
- width: clamp(19rem, 29vw, 24rem);
- padding: 0.85rem 0.9rem;
- visibility: hidden;
- opacity: 0;
- color: rgba(255, 220, 224, 0.92);
- background: rgba(34, 10, 16, 0.96);
- border: 1px solid rgba(255, 92, 110, 0.5);
- border-radius: 0.42rem;
- box-shadow: 0 0.9rem 2.2rem rgba(0, 0, 0, 0.62), 0 0 1.4rem rgba(255, 92, 110, 0.08);
- backdrop-filter: blur(28px) saturate(1.25);
- -webkit-backdrop-filter: blur(28px) saturate(1.25);
- pointer-events: none;
- transform: translate(-50%, 0.55rem) scale(0.985);
- transform-origin: bottom center;
- transition: opacity 180ms ease, visibility 180ms ease, transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
-}
-
-#command-dock #gev-voice-control[data-status='error']:not(.error-dismissed) .gev-voice-error-tray {
- visibility: visible;
- opacity: 1;
- pointer-events: auto;
- transform: translate(-50%, 0) scale(1);
-}
-
-#command-dock .gev-voice-error-header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 0.75rem;
- color: #ff8f9d;
- font-family: var(--font-mono);
- font-size: 0.62rem;
- font-weight: 600;
- letter-spacing: 0.1rem;
-}
-
-#command-dock .gev-voice-error-dismiss {
- padding: 0.25rem 0.42rem;
- color: rgba(255, 220, 224, 0.72);
- background: rgba(255, 255, 255, 0.04);
- border: 1px solid rgba(255, 143, 157, 0.32);
- border-radius: 0.2rem;
- font-family: var(--font-mono);
- font-size: 0.43rem;
- letter-spacing: 0.06rem;
- cursor: pointer;
-}
-
-#command-dock #gev-voice-error-detail {
- margin-top: 0.65rem;
- color: rgba(255, 232, 235, 0.92);
- font-family: var(--font-sans);
- font-size: 0.78rem;
- line-height: 1.45;
-}
-
-#command-dock .gev-voice-error-hint {
- margin-top: 0.5rem;
- color: rgba(255, 196, 203, 0.58);
- font-family: var(--font-mono);
- font-size: 0.52rem;
- line-height: 1.45;
- letter-spacing: 0.035rem;
-}
-
-/* The compact dock leaves both lower corners free for required attribution and telemetry. */
-body:not(.ui-clean-view):not(.recording-mode) #cesium-credits,
-body:not(.ui-clean-view):not(.recording-mode):has(#intel-hud[data-variant='minimal'].active) #cesium-credits {
- right: auto;
- bottom: 0.75rem;
- left: 1.5rem;
- width: auto !important;
- max-width: calc(50vw - 15rem);
- text-align: left;
-}
-
-#intel-hud[data-variant='tactical'] .hud-bottom-left,
-#intel-hud[data-variant='tactical'] .hud-bottom-right,
-#intel-hud[data-variant='operator'] .hud-bottom-left,
-#intel-hud[data-variant='operator'] .hud-bottom-right {
- bottom: calc(2vh + 6.5rem);
-}
-
-#intel-hud[data-variant='operator'] .hud-bottom-bar {
- bottom: calc(2vh + 9.8rem);
- width: min(48vw, 680px);
-}
-
-#intel-hud[data-variant='minimal'] .hud-bottom-left {
- bottom: calc(2vh + 5.4rem);
-}
-
-#intel-hud[data-variant='minimal'] .hud-bottom-bar {
- bottom: calc(2vh + 9rem);
-}
-
-@media (max-width: 900px) {
- body:not(.ui-clean-view):not(.recording-mode) #cesium-credits,
- body:not(.ui-clean-view):not(.recording-mode):has(#intel-hud[data-variant='minimal'].active) #cesium-credits {
- bottom: calc(2vh + 5rem);
- left: 0.75rem;
- max-width: calc(100vw - 1.5rem);
- }
-
- #command-dock .gev-voice-error-tray {
- width: min(24rem, calc(100vw - 1.5rem));
- }
-}
-
-@media (max-width: 620px) {
- #command-dock {
- --dock-side-compact: 3.25rem;
- --dock-voice-width: 8.75rem;
- }
-
- #command-dock .panel-title,
- #command-dock .location-toolbar-label {
- max-width: 2.3rem;
- overflow: hidden;
- text-overflow: ellipsis;
- }
-
- #left-panel-stack {
- bottom: calc(50vh + 8px);
- }
-}
-
-/* ── Slide-up command trays ──────────────────── */
-#command-dock,
-#command-dock:has(#location-bar:not(.collapsed)),
-#command-dock:has(#control-panel:not(.collapsed)) {
- transform: translateX(-50%);
-}
-
-#command-dock > #location-bar,
-#command-dock > #location-bar:not(.collapsed),
-#command-dock > #control-panel,
-#command-dock > #control-panel:not(.collapsed) {
- position: relative;
- flex-basis: var(--dock-side-compact);
- width: var(--dock-side-compact);
- overflow: visible;
-}
-
-#command-dock .location-inner,
-#command-dock .panel-inner,
-#command-dock #location-bar.collapsed .location-inner,
-#command-dock #control-panel.collapsed .panel-inner {
- position: relative;
- overflow: visible;
-}
-
-#command-dock .dock-popover-content {
- position: absolute;
- bottom: calc(100% + 0.65rem);
- z-index: 5;
- display: flex;
- flex-direction: column;
- width: var(--dock-location-open);
- padding: 1.55rem 0.6rem 0.6rem;
- visibility: hidden;
- opacity: 0;
- background: rgba(8, 20, 30, 0.94);
- border: 1px solid rgba(123, 189, 211, 0.32);
- border-radius: 0.42rem;
- box-shadow:
- 0 0.9rem 2.4rem rgba(0, 0, 0, 0.58),
- 0 0 1.5rem rgba(0, 212, 255, 0.08),
- 0 0 0 1px rgba(255, 255, 255, 0.025) inset;
- backdrop-filter: blur(28px) saturate(1.3);
- -webkit-backdrop-filter: blur(28px) saturate(1.3);
- pointer-events: none;
- transform: translateY(0.55rem) scale(0.985);
- transform-origin: bottom left;
- transition:
- opacity 180ms ease,
- visibility 0s linear 180ms,
- transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
-}
-
-#command-dock #location-bar .dock-popover-content {
- left: -0.75rem;
-}
-
-#command-dock #control-panel .dock-popover-content {
- right: -0.75rem;
- left: auto;
- width: var(--dock-presets-open);
- transform-origin: bottom right;
-}
-
-#command-dock #location-bar:not(.collapsed) .dock-popover-content,
-#command-dock #control-panel:not(.collapsed) .dock-popover-content {
- visibility: visible;
- opacity: 1;
- pointer-events: auto;
- transform: translateY(0) scale(1);
- margin-bottom: 10px;
- /* Make newly revealed controls enter the Tab order immediately. The base
- rule still delays visibility on close so its opacity fade can finish. */
- transition-delay: 0s;
-}
-
-#command-dock #location-bar.collapsed .dock-popover-content,
-#command-dock #control-panel.collapsed .dock-popover-content {
- display: flex !important;
-}
-
-#command-dock .dock-popover-content::after {
- /* content: ''; */
- position: absolute;
- bottom: -0.34rem;
- left: 1.65rem;
- width: 0.6rem;
- height: 0.6rem;
- background: rgba(8, 20, 30, 0.96);
- border-right: 1px solid rgba(123, 189, 211, 0.28);
- border-bottom: 1px solid rgba(123, 189, 211, 0.28);
- transform: rotate(45deg);
-}
-
-#command-dock #control-panel .dock-popover-content::after {
- right: 1.65rem;
- left: auto;
-}
-
-#command-dock .dock-popover-content .location-city-row,
-#command-dock .dock-popover-content .button-grid {
- display: flex !important;
-}
-
-#command-dock .dock-popover-content .poi-row-container:not(.expanded) {
- display: none !important;
-}
-
-#command-dock .dock-pin-btn {
- position: absolute;
- top: 0.4rem;
- right: 0.5rem;
- z-index: 2;
- display: none;
- flex: 0 0 auto;
- min-width: 1.65rem;
- height: 1rem;
- padding: 0 0.28rem;
- color: rgba(190, 221, 230, 0.5);
- background: rgba(255, 255, 255, 0.025);
- border: 1px solid rgba(123, 189, 211, 0.2);
- border-radius: 0.2rem;
- font-family: var(--font-mono);
- font-size: 0.35rem;
- letter-spacing: 0.04rem;
- cursor: pointer;
-}
-
-#command-dock #location-bar:not(.collapsed) .dock-pin-btn,
-#command-dock #control-panel:not(.collapsed) .dock-pin-btn {
- display: block;
-}
-
-#command-dock .dock-pin-btn:hover,
-#command-dock .dock-pin-btn[aria-pressed='true'] {
- color: var(--accent);
- border-color: rgba(0, 212, 255, 0.62);
- background: rgba(0, 212, 255, 0.1);
- box-shadow: 0 0 0.55rem rgba(0, 212, 255, 0.12);
-}
-
-#command-dock .panel-divider {
- min-width: 0.25rem;
-}
-
-@media (max-width: 900px) {
- #command-dock:has(#location-bar:not(.collapsed)) > #control-panel,
- #command-dock:has(#control-panel:not(.collapsed)) > #location-bar {
- flex-basis: var(--dock-side-compact);
- border: inherit;
- }
-
- #command-dock:has(#location-bar:not(.collapsed)) > #gev-voice-control,
- #command-dock:has(#control-panel:not(.collapsed)) > #gev-voice-control {
- flex-basis: var(--dock-voice-width);
- width: var(--dock-voice-width);
- }
-
- #command-dock:has(#location-bar:not(.collapsed)) .gev-voice-visualizer,
- #command-dock:has(#location-bar:not(.collapsed)) .gev-voice-kicker,
- #command-dock:has(#location-bar:not(.collapsed)) .gev-voice-readout,
- #command-dock:has(#control-panel:not(.collapsed)) .gev-voice-visualizer,
- #command-dock:has(#control-panel:not(.collapsed)) .gev-voice-kicker,
- #command-dock:has(#control-panel:not(.collapsed)) .gev-voice-readout {
- visibility: visible;
- }
-
- #command-dock .dock-popover-content {
- width: var(--dock-popover-mobile-width);
- }
-
- #command-dock #location-bar .dock-popover-content {
- left: calc((var(--dock-side-compact) + var(--dock-side-compact) + var(--dock-voice-width) - var(--dock-popover-mobile-width)) / 2);
- }
-
- #command-dock #control-panel .dock-popover-content {
- /* NOT a duplicate of the `#command-dock .dock-popover-content` width above:
- that selector is (1 id, 1 class) and loses to the unconditional
- `#command-dock #control-panel .dock-popover-content { width:
- var(--dock-presets-open) }`, which is 34rem here. Without this override
- the tray renders 544 px wide inside a 480 px viewport and hangs off the
- left edge — pinned by the 480 px bounds assert in
- `scripts/qa-map-source-tray.mjs`. */
- width: var(--dock-popover-mobile-width);
- right: calc((var(--dock-side-compact) + var(--dock-side-compact) + var(--dock-voice-width) - var(--dock-popover-mobile-width)) / 2);
- }
-
- /* ── Required-attribution clearance ─────────────────────────────────
- At this width the tray widens to nearly the whole viewport (the rule
- above), and at its stock 0.65rem offset it lands squarely on the
- Google/Cesium credit line in the bottom-left corner — a notice the
- Maps Platform and Cesium terms require to stay visible in EVERY state.
-
- The transient popover yields, not the permanent notice: the credit
- keeps the position every other state gives it.
-
- The tray hangs off the dock, so its clearance is
- dock bottom + dock height 62px + offset − (credit bottom + 28px).
- Across 721–900px the dock is anchored at 2vh and the credit at
- calc(2vh + 5rem), so those terms cancel and 3rem + the tray's own 10px
- margin leaves a flat 12px. That cancellation is NOT universal: at 720px
- and below the dock re-anchors to a flat 8px while the credit keeps its
- 2vh base, which is what the max-width:720px override further down
- repairs. Nothing here may be reasoned about "at every viewport height"
- without checking the dock anchor that actually applies.
-
- Keep these in step with the base offsets (0.65rem, and 1.2rem for the
- pinned variants); src/creditAttribution.test.mjs walks the real cascade
- over a viewport grid and fails if any of them re-enters the credit
- band. */
- #command-dock #location-bar .dock-popover-content,
- #command-dock #control-panel .dock-popover-content {
- bottom: calc(100% + 3rem);
- }
-
- #command-dock.dock-has-pinned-tray #location-bar:not(.collapsed):not(.dock-pinned) .dock-popover-content,
- #command-dock.dock-has-pinned-tray #control-panel:not(.collapsed):not(.dock-pinned) .dock-popover-content {
- bottom: calc(100% + 3rem + var(--dock-pinned-stack-height));
- }
-
- /* Written with the panel IDs on purpose. The stock two-pinned selector
- carries one ID (#command-dock) against five classes, and the ordinary
- narrow rule above carries two IDs — so the stock form LOSES here and the
- top tray drops var(--dock-lower-pinned-height), landing on top of its
- pinned sibling. Naming the panel makes it (2,5,0), ahead of both the
- ordinary (2,1,0) and single-pinned (2,4,0) rules. */
- #command-dock.dock-has-two-pinned-trays #location-bar.dock-pinned-top.dock-pinned:not(.collapsed) .dock-popover-content,
- #command-dock.dock-has-two-pinned-trays #control-panel.dock-pinned-top.dock-pinned:not(.collapsed) .dock-popover-content {
- bottom: calc(100% + 3rem + var(--dock-lower-pinned-height));
- }
-}
-
-/* The dock re-anchors from 2vh to a flat 8px at this width (see the
- max-width:720px block above), while the credit keeps its 2vh base — so the
- clearance above stops being height-independent and goes negative on tall
- narrow viewports (0 at 1000px high, −4px at 1200px). Carrying the 2vh back
- into the tray's own offset restores the same flat 12px the wider band gets.
- This block must stay AFTER the max-width:900px rules to win the cascade. */
-@media (max-width: 720px) {
- #command-dock #location-bar .dock-popover-content,
- #command-dock #control-panel .dock-popover-content {
- bottom: calc(100% + 2vh + 2.5rem);
- }
-
- #command-dock.dock-has-pinned-tray #location-bar:not(.collapsed):not(.dock-pinned) .dock-popover-content,
- #command-dock.dock-has-pinned-tray #control-panel:not(.collapsed):not(.dock-pinned) .dock-popover-content {
- bottom: calc(100% + 2vh + 2.5rem + var(--dock-pinned-stack-height));
- }
-
- /* Panel IDs for the same specificity reason as the max-width:900px block. */
- #command-dock.dock-has-two-pinned-trays #location-bar.dock-pinned-top.dock-pinned:not(.collapsed) .dock-popover-content,
- #command-dock.dock-has-two-pinned-trays #control-panel.dock-pinned-top.dock-pinned:not(.collapsed) .dock-popover-content {
- bottom: calc(100% + 2vh + 2.5rem + var(--dock-lower-pinned-height));
- }
-}
-
-/* Final top-right positioning for the floating SVG tray pins. */
-#command-dock .dock-popover-content {
- padding: 0.7rem;
-}
-
-#command-dock .dock-popover-content .button-grid {
- align-items: stretch;
- min-height: 3.7rem;
-}
-
-#command-dock .dock-popover-content .style-btn {
- flex: 1 1 0;
- min-width: 3.6rem;
- min-height: 3.7rem;
- height: 100%;
- padding: 0.45rem 0.3rem;
-}
-
-#command-dock .dock-popover-content .btn-icon {
- font-size: 1.15rem;
- line-height: 1;
-}
-
-#command-dock .btn-label {
- padding-top: 10px;
-}
-
-#command-dock .dock-pin-btn {
- position: absolute;
- top: -1rem;
- right: -1rem;
- z-index: 2;
- place-items: center;
- width: 2.05rem;
- min-width: 2.05rem;
- height: 2.05rem;
- margin: 0;
- padding: 0;
- border-radius: 50%;
- background: rgba(8, 24, 34, 0.96);
- box-shadow: 0 0.35rem 0.9rem rgba(0, 0, 0, 0.5);
- transform: none;
-}
-
-#command-dock #location-bar .dock-pin-btn {
- top: -1rem;
- right: -1rem;
-}
-
-#command-dock #control-panel .dock-pin-btn {
- top: -1rem;
- right: -1rem;
-}
-
-#command-dock #location-bar:not(.collapsed) .dock-pin-btn,
-#command-dock #control-panel:not(.collapsed) .dock-pin-btn {
- display: grid;
-}
-
-#command-dock .dock-pin-btn img {
- width: 1.15rem;
- height: 1.15rem;
-}
-
-/* Five-pixel standby baseline; live microphone analysis sets --audio-level. */
-#command-dock .gev-voice-visualizer span,
-#command-dock .gev-voice-visualizer span:nth-child(3n),
-#command-dock .gev-voice-visualizer span:nth-child(4n),
-#command-dock .gev-voice-visualizer span:nth-child(5n),
-#command-dock .gev-voice-visualizer span:nth-child(7n) {
- height: var(--audio-level, 5px);
- opacity: var(--audio-opacity, 0.56);
- animation: none;
- transition: height 70ms linear, opacity 90ms linear;
-}
-
-#command-dock #gev-voice-control[data-status='listening'] .gev-voice-visualizer span,
-#command-dock #gev-voice-control[data-status='executing'] .gev-voice-visualizer span {
- animation: none;
-}
-
-#command-dock #gev-voice-control[data-speaker='user'] :is(#gev-voice-status, #gev-voice-detail) {
- color: #ffbf69;
-}
-
-#command-dock #gev-voice-control[data-speaker='user'] .gev-voice-visualizer span {
- background: linear-gradient(to top, #d98a35, #ffcf8a);
- box-shadow: 0 0 0.35rem rgba(255, 191, 105, 0.32);
-}
-
-#command-dock #gev-voice-control[data-speaker='ai'] :is(#gev-voice-status, #gev-voice-detail) {
- color: var(--accent);
-}
-
-#command-dock #gev-voice-control[data-speaker='ai'] .gev-voice-visualizer span {
- background: linear-gradient(to top, #28b9db, #71eaff);
- box-shadow: 0 0 0.35rem rgba(54, 220, 255, 0.28);
-}
-
-/* Center every slide-up tray on the complete unified dock, not its side wing. */
-#command-dock #location-bar .dock-popover-content {
- left: calc((var(--dock-unified-width) - var(--dock-location-open)) / 2);
-}
-
-#command-dock #control-panel .dock-popover-content {
- right: calc((var(--dock-unified-width) - var(--dock-presets-open)) / 2);
-}
-
-@media (max-width: 900px) {
- #command-dock #location-bar .dock-popover-content {
- left: calc((var(--dock-unified-width) - var(--dock-popover-mobile-width)) / 2);
- }
-
- #command-dock #control-panel .dock-popover-content {
- right: calc((var(--dock-unified-width) - var(--dock-popover-mobile-width)) / 2);
- }
-}
-
-/* Final joined-dock geometry: only the three controls own visible surfaces. */
-#command-dock {
- padding: 0;
- background: none;
- border: none;
- box-shadow: none;
- backdrop-filter: none;
- -webkit-backdrop-filter: none;
-}
-
-#command-dock > #location-bar {
- border-top-right-radius: 0;
- border-bottom-right-radius: 0;
-}
-
-#command-dock > #location-bar > .location-inner {
- border-top-right-radius: 0;
- border-bottom-right-radius: 0;
-}
-
-#command-dock > #control-panel {
- border-top-left-radius: 0;
- border-bottom-left-radius: 0;
-}
-
-#command-dock > #control-panel > .panel-inner {
- border-top-left-radius: 0;
- border-bottom-left-radius: 0;
-}
-
-#command-dock .dock-popover-content .style-btn:hover {
- transform: none;
-}
-
-#command-dock .dock-popover-content :is(.location-pill, .poi-pill):hover {
- transform: none;
-}
-
-/* Keep the microphone neutral at rest; cyan signals hover and live states. */
-#command-dock .gev-mic-orbit {
- background: rgba(232, 234, 237, 0.04);
- border-color: rgba(232, 234, 237, 0.36);
- box-shadow:
- 0 0 0 0.18rem rgba(232, 234, 237, 0.04),
- 0 0 0.75rem rgba(232, 234, 237, 0.08);
- transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
-}
-
-#command-dock .gev-mic-orbit img {
- filter: grayscale(1) saturate(0) brightness(1.65);
- opacity: 0.68;
- transition: filter var(--transition-fast), opacity var(--transition-fast);
-}
-
-#command-dock #gev-voice-button:hover .gev-mic-orbit,
-#command-dock #gev-voice-control:is(
- [data-status='connecting'],
- [data-status='listening']:not([data-microphone='muted']),
- [data-status='executing']
-) .gev-mic-orbit {
- background: rgba(0, 212, 255, 0.06);
- border-color: rgba(0, 212, 255, 0.48);
- box-shadow: 0 0 0 0.18rem rgba(0, 212, 255, 0.06), 0 0 0.9rem rgba(0, 212, 255, 0.12);
-}
-
-#command-dock #gev-voice-button:hover .gev-mic-orbit img,
-#command-dock #gev-voice-control:is(
- [data-status='connecting'],
- [data-status='listening']:not([data-microphone='muted']),
- [data-status='executing']
-) .gev-mic-orbit img {
- filter: none;
- opacity: 1;
-}
-
-/* Match compact dock wings to the glass treatment used by left-panel buttons. */
-#command-dock > #location-bar,
-#command-dock > #control-panel {
- box-sizing: border-box;
- background: var(--glass-bg);
- border: 1px solid var(--glass-border);
- border-radius: var(--panel-radius);
- box-shadow:
- 0 8px 32px rgba(0, 0, 0, 0.5),
- 0 0 0 1px rgba(255, 255, 255, 0.03) inset,
- 0 1px 0 rgba(255, 255, 255, 0.06) inset;
- backdrop-filter: blur(24px) saturate(1.4);
- -webkit-backdrop-filter: blur(24px) saturate(1.4);
- transition:
- border-color 160ms ease,
- background-color 160ms ease,
- box-shadow 160ms ease;
-}
-
-#command-dock > :is(#location-bar, #control-panel):hover {
- background: var(--glass-bg);
- border-color: var(--glass-border-hover);
- color: var(--accent);
-
-}
-
-#command-dock > :is(#location-bar, #control-panel).dock-pinned {
- border-color: rgba(0, 212, 255, 0.55);
- box-shadow:
- 0 8px 32px rgba(0, 0, 0, 0.5),
- 0 0 0 1px rgba(0, 212, 255, 0.08) inset,
- 0 0 1rem rgba(0, 212, 255, 0.12);
-}
-
-#command-dock #location-bar .location-toolbar {
- justify-content: flex-start;
- width: 100%;
-}
-
-#command-dock #location-bar .location-toolbar-label {
- justify-content: flex-start;
- width: 100%;
- text-align: left;
-}
-
-#command-dock #location-bar .location-toolbar-label::after {
- content: none;
-}
-
-#command-dock #control-panel .panel-header {
- justify-content: flex-end;
- width: 100%;
-}
-
-#command-dock #control-panel .panel-title {
- justify-content: flex-end;
- width: 100%;
- text-align: right;
-}
-
-/* These must follow the shared wing skin so the visible borders stay joined. */
-#command-dock > #location-bar {
- border-top-right-radius: 0;
- border-bottom-right-radius: 0;
-}
-
-#command-dock > #control-panel {
- border-top-left-radius: 0;
- border-bottom-left-radius: 0;
-}
-
-#command-dock #location-bar .location-toolbar,
-#command-dock #control-panel .panel-header {
- position: relative;
-}
-
-#command-dock #control-panel .panel-header {
- flex-direction: row;
- gap: 0;
-}
-
-#command-dock #control-panel .panel-title {
- flex: 0 0 auto;
- width: auto;
-}
-
-#command-dock #control-panel .panel-title::before {
- content: none;
-}
-
-#command-dock #control-panel .panel-divider {
- display: none;
-}
-
-#gev-voice-control .gev-voice-help-tray {
- position: absolute;
- bottom: calc(100% + 0.7rem);
- left: 50%;
- z-index: 7;
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- gap: 0.22rem;
- box-sizing: border-box;
- width: max-content;
- max-width: min(22rem, calc(100vw - 2rem));
- padding: 0.62rem 0.72rem;
- visibility: hidden;
- opacity: 0;
- color: rgba(223, 245, 250, 0.92);
- background: rgba(7, 22, 31, 0.96);
- border: 1px solid rgba(54, 220, 255, 0.34);
- border-radius: 0.38rem;
- box-shadow:
- 0 0.85rem 2rem rgba(0, 0, 0, 0.58),
- 0 0 1.2rem rgba(0, 212, 255, 0.08);
- backdrop-filter: blur(24px) saturate(1.3);
- -webkit-backdrop-filter: blur(24px) saturate(1.3);
- pointer-events: none;
- transform: translate(-50%, 0.65rem) scale(0.985);
- transform-origin: bottom center;
- transition:
- opacity 160ms ease,
- visibility 160ms ease,
- transform 210ms cubic-bezier(0.2, 0.8, 0.2, 1);
-}
-
-#gev-voice-control .gev-voice-help-kicker {
- color: rgba(54, 220, 255, 0.72);
- font-family: var(--font-mono);
- font-size: 0.46rem;
- font-weight: 600;
- letter-spacing: 0.1rem;
-}
-
-#gev-voice-control .gev-voice-help-detail {
- font-family: var(--font-sans);
- font-size: 0.7rem;
- line-height: 1.35;
- white-space: nowrap;
-}
-
-#gev-voice-control:not([data-status='error']):hover .gev-voice-help-tray,
-#gev-voice-control:not([data-status='error']) #gev-voice-button:focus-visible ~ .gev-voice-help-tray {
- visibility: visible;
- opacity: 1;
- transform: translate(-50%, 0) scale(1);
-}
-
-#command-dock.dock-has-pinned-tray .gev-voice-help-tray {
- bottom: calc(100% + 1.7rem + var(--dock-pinned-stack-height));
-}
-
-@media (prefers-reduced-motion: reduce) {
- #gev-voice-control .gev-voice-help-tray {
- transition: none;
- }
- .radio-tuner-needle,
- .radio-tuner-tick {
- transition: none;
- }
-}
-
-#command-dock #location-bar .location-toolbar::after,
-#command-dock #control-panel .panel-header::after {
- content: '';
- position: absolute;
- right: 0.45rem;
- bottom: 0.12rem;
- left: 0.45rem;
- height: 1px;
- pointer-events: none;
-}
-
-#command-dock #location-bar .location-toolbar::after {
- background: linear-gradient(90deg, rgba(232, 234, 237, 0.24), rgba(232, 234, 237, 0));
-}
-
-#command-dock #control-panel .panel-header::after {
- background: linear-gradient(90deg, rgba(232, 234, 237, 0), rgba(232, 234, 237, 0.24));
-}
-
-/* ------------------------------------------------------------------ *
- * Voice cost control — model-tier toggle + running session estimate.
- * Appended (not woven into the dock passes above) so the three existing
- * #gev-voice-control cascades stay untouched; these rules only add the
- * new .gev-voice-cost cluster inside the existing .gev-voice-heading row.
- * ------------------------------------------------------------------ */
-.gev-voice-cost {
- display: flex;
- align-items: center;
- gap: 0.22rem;
- margin-left: auto; /* pin right; kicker + status keep their left cluster */
- flex: 0 0 auto;
-}
-
-.gev-voice-tier-btn {
- padding: 0 0.24rem;
- height: 0.72rem;
- min-width: 1.55rem;
- display: inline-flex;
- align-items: center;
- justify-content: center;
- background: rgba(0, 212, 255, 0.06);
- border: 1px solid rgba(0, 212, 255, 0.34);
- border-radius: 0.18rem;
- color: var(--text-secondary);
- font-family: var(--font-mono);
- font-size: 0.4rem;
- letter-spacing: 0.045rem;
- line-height: 1;
- cursor: pointer;
- transition: color var(--transition-fast), border-color var(--transition-fast),
- background var(--transition-fast);
-}
-
-.gev-voice-tier-btn:hover {
- color: var(--text-primary);
- border-color: rgba(0, 212, 255, 0.6);
- background: rgba(0, 212, 255, 0.12);
-}
-
-/* MINI engaged — amber, distinct from the cyan default so the cheaper tier
- is legible at a glance without reading the label. */
-.gev-voice-tier-btn[aria-pressed='true'] {
- color: #ffc46b;
- border-color: rgba(255, 196, 107, 0.55);
- background: rgba(255, 196, 107, 0.12);
-}
-
-.gev-voice-cost-value {
- color: var(--text-dim);
- font-family: var(--font-mono);
- font-size: 0.4rem;
- letter-spacing: 0.02rem;
- line-height: 1;
- font-variant-numeric: tabular-nums;
- transition: color var(--transition-fast);
-}
-
-.gev-voice-cost-value[data-level='warn'] {
- color: #ffc46b;
-}
-
-.gev-voice-cost-value[data-level='cap'] {
- color: #ff6b6b;
- font-weight: 600;
-}
-
-/* The dock heading row is 0.8rem tall; keep the cluster inside it. */
-#command-dock .gev-voice-cost {
- max-height: 0.8rem;
-}
-
-/* The dock collapses the kicker/readout when a tray is open — the cost
- cluster follows the same rule so the row never overflows. */
-#command-dock.tray-open .gev-voice-cost {
- display: none;
-}
-
-/* ── First-run mission launcher ───────────────────────────────────
- Compact and non-modal: it gives a new visitor a meaningful starting
- choice without blocking manual map interaction or spending API quota. */
-#first-run-launcher {
- position: fixed;
- z-index: 175;
- top: 50%;
- left: 50%;
- width: min(34rem, calc(100vw - 2rem));
- /* Five tiles do not fit a short landscape phone (667 x 390), where the card
- would otherwise render past BOTH ends of the viewport. Cap it to the
- viewport and let the mission list scroll inside — the heading, the checkbox
- and the status line must stay reachable at every height. */
- max-height: calc(100vh - 1.5rem);
- max-height: calc(100dvh - 1.5rem);
- display: flex;
- flex-direction: column;
- padding: 1.15rem;
- overflow: hidden;
- color: var(--text-primary);
- background:
- linear-gradient(145deg, rgba(10, 27, 37, 0.97), rgba(7, 13, 22, 0.95)),
- rgba(7, 17, 25, 0.96);
- border: 1px solid rgba(54, 220, 255, 0.42);
- border-radius: 0.65rem;
- box-shadow:
- 0 1.4rem 4.5rem rgba(0, 0, 0, 0.72),
- 0 0 2.5rem rgba(0, 212, 255, 0.09),
- inset 0 0 0 1px rgba(255, 255, 255, 0.025);
- backdrop-filter: blur(28px) saturate(1.25);
- -webkit-backdrop-filter: blur(28px) saturate(1.25);
- opacity: 0;
- transform: translate(-50%, calc(-50% + 0.8rem)) scale(0.985);
- transition: opacity 220ms ease, transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
- /* Inert until revealed AND again while fading out, so a click during the
- dismiss animation cannot launch a second mission behind the fade. */
- pointer-events: none;
-}
-
-/* An AUTHOR `display` on this id beats the UA's `[hidden] { display: none }` in
- the cascade, so the flex above would otherwise leave the card in the
- accessibility tree from page parse until it is revealed — or, on a share
- link, until it is removed. Restore the attribute's meaning explicitly. */
-#first-run-launcher[hidden] {
- display: none;
-}
-
-#first-run-launcher.visible {
- opacity: 1;
- transform: translate(-50%, -50%) scale(1);
- pointer-events: auto;
-}
-
-.first-run-scanline {
- position: absolute;
- inset: 0 0 auto;
- height: 2px;
- background: linear-gradient(90deg, transparent, rgba(54, 220, 255, 0.8), transparent);
- box-shadow: 0 0 1rem rgba(54, 220, 255, 0.45);
- pointer-events: none;
-}
-
-.first-run-header,
-.first-run-footer {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 1rem;
- color: rgba(171, 210, 220, 0.6);
- font-family: var(--font-mono);
- font-size: 0.58rem;
- letter-spacing: 0.1rem;
- text-transform: uppercase;
-}
-
-.first-run-kicker { color: rgba(54, 220, 255, 0.86); }
-
-#first-run-launcher h2 {
- margin-top: 0.6rem;
- font-family: var(--font-mono);
- font-size: clamp(1.25rem, 2.4vw, 1.75rem);
- font-weight: 500;
- letter-spacing: -0.045rem;
-}
-
-#first-run-description {
- max-width: 29rem;
- margin-top: 0.3rem;
- color: rgba(215, 231, 235, 0.66);
- font-size: 0.78rem;
- line-height: 1.5;
-}
-
-.first-run-choices {
- display: grid;
- gap: 0.42rem;
- margin-top: 1rem;
- /* The one part of the card allowed to scroll when the viewport is too short.
- min-height:0 is what actually lets this flex child shrink below its content. */
- min-height: 0;
- overflow-y: auto;
- overscroll-behavior: contain;
- scroll-behavior: smooth;
- /* A visible, non-overlaying affordance that the list continues. */
- scrollbar-width: thin;
- scrollbar-color: rgba(54, 220, 255, 0.45) transparent;
- scrollbar-gutter: stable;
-}
-
-.first-run-choices::-webkit-scrollbar { width: 6px; }
-.first-run-choices::-webkit-scrollbar-thumb {
- background: rgba(54, 220, 255, 0.45);
- border-radius: 3px;
-}
-
-.first-run-choices button {
- display: grid;
- grid-template-columns: 1.7rem 1fr 1.3rem;
- align-items: center;
- gap: 0.7rem;
- width: 100%;
- min-height: 3.55rem;
- padding: 0.6rem 0.7rem;
- color: rgba(225, 244, 248, 0.92);
- text-align: left;
- background: rgba(29, 69, 81, 0.18);
- border: 1px solid rgba(100, 200, 220, 0.18);
- border-radius: 0.42rem;
- cursor: pointer;
- transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
-}
-
-.first-run-choices button:hover,
-.first-run-choices button:focus-visible {
- background: rgba(25, 151, 178, 0.16);
- border-color: rgba(54, 220, 255, 0.62);
- outline: none;
- transform: translateX(2px);
-}
-
-/* aria-disabled, not :disabled — the JS keeps the buttons focusable while a
- mission runs so the keyboard is never dumped out of the launcher mid-flight. */
-.first-run-choices button[aria-disabled='true'] {
- cursor: wait;
- opacity: 0.48;
- transform: none;
- pointer-events: none;
-}
-
-.first-run-choices button > .material-symbols-outlined:first-child {
- color: #55dff5;
- font-size: 1.35rem;
-}
-
-.first-run-choices button > span:nth-child(2) {
- display: flex;
- flex-direction: column;
- gap: 0.15rem;
-}
-
-.first-run-choices strong {
- font-family: var(--font-mono);
- font-size: 0.72rem;
- font-weight: 600;
- letter-spacing: 0.08rem;
-}
-
-.first-run-choices small {
- color: rgba(198, 220, 226, 0.55);
- font-size: 0.66rem;
-}
-
-.first-run-arrow {
- color: rgba(54, 220, 255, 0.4);
- font-size: 1rem;
- transition: transform var(--transition-fast), color var(--transition-fast);
-}
-
-.first-run-choices button:hover .first-run-arrow,
-.first-run-choices button:focus-visible .first-run-arrow {
- color: rgba(54, 220, 255, 0.9);
- transform: translateX(2px);
-}
-
-/* Ordered after the shared button rule rather than shouting !important at it. */
-.first-run-choices button.first-run-explore {
- background: rgba(255, 255, 255, 0.025);
-}
-
-.first-run-footer {
- margin-top: 0.85rem;
- font-size: 0.48rem;
- letter-spacing: 0.055rem;
-}
-
-.first-run-suppress {
- display: flex;
- align-items: center;
- gap: 0.4rem;
- color: rgba(199, 225, 231, 0.66);
- text-transform: none;
- font-size: 0.62rem;
- letter-spacing: 0.02rem;
- cursor: pointer;
-}
-
-.first-run-suppress input {
- width: 0.82rem;
- height: 0.82rem;
- margin: 0;
- accent-color: #36dcff;
- cursor: pointer;
-}
-
-.first-run-suppress:hover { color: rgba(225, 244, 248, 0.92); }
-
-/* The live region carries mission progress and failures, so it owns a full row
- and reserves its height — otherwise the card resizes as it speaks. */
-.first-run-note {
- min-height: 1.1rem;
- margin-top: 0.5rem;
- color: rgba(199, 225, 231, 0.62);
- font-family: var(--font-mono);
- font-size: 0.62rem;
- line-height: 1.35;
-}
-
-#first-run-launcher[data-state='loading'] .first-run-note {
- color: rgba(54, 220, 255, 0.85);
-}
-
-/* Every surface that claims the screen hides the launcher. This list is the CSS
- half of the ESC arbitration: src/firstRunExperience.js watches these same
- classes and makes the launcher step aside, so a hidden card is never left
- holding a keyboard handler. Keep the two lists in step —
- EXCLUSIVE_SURFACE_CLASSES pins them together. */
-body.ui-clean-view #first-run-launcher,
-body.recording-mode #first-run-launcher,
-body.cockpit-mode #first-run-launcher,
-body.scene-playback-mode #first-run-launcher {
- display: none;
-}
-
-@media (max-width: 620px) {
- #first-run-launcher {
- top: auto;
- bottom: 5.8rem;
- padding: 0.9rem;
- transform: translate(-50%, 0.8rem) scale(0.985);
- }
-
- #first-run-launcher.visible { transform: translate(-50%, 0) scale(1); }
- /* Five tiles have to clear the dock on a 375 x 812 phone, so the rows tighten
- and the redundant "ESC to dismiss" hint (no ESC key on a phone) drops. */
- #first-run-launcher h2 { margin-top: 0.45rem; }
- #first-run-description { margin-top: 0.25rem; font-size: 0.72rem; }
- .first-run-choices { margin-top: 0.75rem; }
- .first-run-choices button { min-height: 3rem; padding: 0.45rem 0.6rem; }
- .first-run-choices small { font-size: 0.62rem; }
- .first-run-footer > span:last-child { display: none; }
-}
-
-/* Short viewports — landscape phones, small laptop windows. The chrome tightens
- so the mission list keeps a usable share of the height. The intro line STAYS:
- it is the only copy that says what this thing is, and with four tiles it
- fits. (It was dropped here while there were five; the tile that went is
- exactly why it can come back.) */
-@media (max-height: 620px) {
- #first-run-launcher { padding: 0.75rem 0.85rem; }
- #first-run-launcher h2 { margin-top: 0.3rem; font-size: 1.1rem; }
- #first-run-description { margin-top: 0.2rem; font-size: 0.7rem; line-height: 1.4; }
- .first-run-choices { margin-top: 0.55rem; }
- .first-run-choices button { min-height: 2.7rem; padding: 0.36rem 0.6rem; }
- .first-run-choices strong { font-size: 0.68rem; }
- .first-run-choices small { font-size: 0.6rem; }
- .first-run-footer { margin-top: 0.5rem; }
- .first-run-note { margin-top: 0.3rem; min-height: 0; }
-}
-
-/* A soft edge on the list, so a tile cut by the fold reads as "more below"
- rather than as a rendering seam. Gated on `data-scrollable`, which the JS sets
- only when the list ACTUALLY overflows — a fade on a list that fits would
- promise content that is not there, which is the opposite of the affordance
- it is meant to be. Decorative only: the list scrolls under it. */
-.first-run-choices[data-scrollable='true'] {
- -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.4rem), transparent 100%);
- mask-image: linear-gradient(to bottom, #000 calc(100% - 1.4rem), transparent 100%);
-}
-
-/* Scrolled to the end, there is nothing left to promise, so the fade lifts.
- Browsers without scroll-driven animations keep the static fade, which is
- still honest — there IS more list, it is just above rather than below. */
-@supports (animation-timeline: scroll(self block)) {
- .first-run-choices[data-scrollable='true'] {
- animation: first-run-scroll-fade linear both;
- animation-timeline: scroll(self block);
- animation-range: contain 80% contain 100%;
- }
-}
-
-@keyframes first-run-scroll-fade {
- to {
- -webkit-mask-image: linear-gradient(to bottom, #000 100%, transparent 100%);
- mask-image: linear-gradient(to bottom, #000 100%, transparent 100%);
- }
-}
-
-@media (prefers-reduced-motion: reduce) {
- #first-run-launcher,
- .first-run-choices button,
- .first-run-arrow { transition: none; }
- /* Scrolling a tile into view must not animate either. */
- .first-run-choices { scroll-behavior: auto; }
-}
-
-/* ============================================================
- POWER UP — in-app key setup (dev server only, src/keySetup.js)
- Same voice as the first-run launcher: glass card, cyan trim,
- mono kickers. The chip retires once every key is configured.
- ============================================================ */
-
-#key-setup-chip {
- position: fixed;
- right: 0.9rem;
- bottom: 0.9rem;
- z-index: 60;
- display: flex;
- align-items: center;
- gap: 0.4rem;
- padding: 0.45rem 0.7rem;
- color: rgba(225, 244, 248, 0.92);
- font-family: var(--font-mono);
- font-size: 0.6rem;
- letter-spacing: 0.09rem;
- background: linear-gradient(145deg, rgba(10, 27, 37, 0.92), rgba(7, 13, 22, 0.9));
- border: 1px solid rgba(54, 220, 255, 0.38);
- border-radius: 0.42rem;
- box-shadow:
- 0 0.4rem 1.6rem rgba(0, 0, 0, 0.5),
- 0 0 1.2rem rgba(0, 212, 255, 0.07);
- backdrop-filter: blur(18px) saturate(1.2);
- -webkit-backdrop-filter: blur(18px) saturate(1.2);
- cursor: pointer;
- transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
-}
-
-#key-setup-chip:hover,
-#key-setup-chip:focus-visible {
- background: linear-gradient(145deg, rgba(14, 38, 51, 0.95), rgba(9, 18, 28, 0.93));
- border-color: rgba(54, 220, 255, 0.7);
- outline: none;
- transform: translateY(-1px);
-}
-
-#key-setup-chip .material-symbols-outlined {
- color: #55dff5;
- font-size: 0.95rem;
-}
-
-#key-setup-chip[hidden] { display: none; }
-
-#key-setup {
- position: fixed;
- z-index: 190; /* above the first-run launcher (175), below attribution (200) */
- top: 50%;
- left: 50%;
- width: min(36rem, calc(100vw - 2rem));
- max-height: calc(100vh - 1.5rem);
- max-height: calc(100dvh - 1.5rem);
- display: flex;
- flex-direction: column;
- padding: 1.15rem;
- overflow: hidden;
- color: var(--text-primary);
- background:
- linear-gradient(145deg, rgba(10, 27, 37, 0.97), rgba(7, 13, 22, 0.95)),
- rgba(7, 17, 25, 0.96);
- border: 1px solid rgba(54, 220, 255, 0.42);
- border-radius: 0.65rem;
- box-shadow:
- 0 1.4rem 4.5rem rgba(0, 0, 0, 0.72),
- 0 0 2.5rem rgba(0, 212, 255, 0.09),
- inset 0 0 0 1px rgba(255, 255, 255, 0.025);
- backdrop-filter: blur(28px) saturate(1.25);
- -webkit-backdrop-filter: blur(28px) saturate(1.25);
- opacity: 0;
- transform: translate(-50%, calc(-50% + 0.8rem)) scale(0.985);
- transition: opacity 220ms ease, transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
- pointer-events: none;
-}
-
-/* Same cascade note as the launcher: an author display beats [hidden]. */
-#key-setup[hidden] { display: none; }
-
-#key-setup.visible {
- opacity: 1;
- transform: translate(-50%, -50%) scale(1);
- pointer-events: auto;
-}
-
-.key-setup-scanline {
- position: absolute;
- inset: 0 0 auto;
- height: 2px;
- background: linear-gradient(90deg, transparent, rgba(54, 220, 255, 0.8), transparent);
- box-shadow: 0 0 1rem rgba(54, 220, 255, 0.45);
- pointer-events: none;
-}
-
-.key-setup-header,
-.key-setup-footer {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 1rem;
- color: rgba(171, 210, 220, 0.6);
- font-family: var(--font-mono);
- font-size: 0.58rem;
- letter-spacing: 0.1rem;
- text-transform: uppercase;
-}
-
-.key-setup-kicker { color: rgba(54, 220, 255, 0.86); }
-
-.key-setup-close {
- display: grid;
- place-items: center;
- padding: 0.15rem;
- color: rgba(171, 210, 220, 0.6);
- background: none;
- border: 1px solid transparent;
- border-radius: 0.3rem;
- cursor: pointer;
- transition: color var(--transition-fast), border-color var(--transition-fast);
-}
-
-.key-setup-close:hover,
-.key-setup-close:focus-visible {
- color: rgba(225, 244, 248, 0.95);
- border-color: rgba(54, 220, 255, 0.5);
- outline: none;
-}
-
-.key-setup-close .material-symbols-outlined { font-size: 1rem; }
-
-#key-setup h2 {
- margin-top: 0.6rem;
- font-family: var(--font-mono);
- font-size: clamp(1.25rem, 2.4vw, 1.75rem);
- font-weight: 500;
- letter-spacing: -0.045rem;
-}
-
-#key-setup-description {
- max-width: 31rem;
- margin-top: 0.3rem;
- color: rgba(215, 231, 235, 0.66);
- font-size: 0.78rem;
- line-height: 1.5;
-}
-
-#key-setup-description code {
- padding: 0.05rem 0.25rem;
- font-size: 0.92em;
- background: rgba(54, 220, 255, 0.08);
- border-radius: 0.2rem;
-}
-
-.key-setup-rows {
- display: grid;
- gap: 0.42rem;
- margin-top: 1rem;
- min-height: 0;
- overflow-y: auto;
- overscroll-behavior: contain;
- scrollbar-width: thin;
- scrollbar-color: rgba(54, 220, 255, 0.45) transparent;
- scrollbar-gutter: stable;
-}
-
-.key-setup-rows::-webkit-scrollbar { width: 6px; }
-.key-setup-rows::-webkit-scrollbar-thumb {
- background: rgba(54, 220, 255, 0.45);
- border-radius: 3px;
-}
-
-.key-setup-row {
- display: grid;
- gap: 0.35rem;
- padding: 0.6rem 0.7rem;
- background: rgba(29, 69, 81, 0.14);
- border: 1px solid rgba(100, 200, 220, 0.15);
- border-radius: 0.42rem;
-}
-
-.key-setup-row[data-set='true'] {
- background: rgba(30, 81, 57, 0.12);
- border-color: rgba(84, 227, 156, 0.32);
-}
-
-.key-setup-row-head {
- display: flex;
- align-items: center;
- gap: 0.5rem;
- font-family: var(--font-mono);
-}
-
-.key-setup-row-head strong {
- font-size: 0.7rem;
- font-weight: 600;
- letter-spacing: 0.08rem;
-}
-
-.key-setup-led {
- width: 0.5rem;
- height: 0.5rem;
- flex: none;
- background: rgba(148, 178, 188, 0.35);
- border-radius: 50%;
-}
-
-.key-setup-row[data-set='true'] .key-setup-led {
- background: #54e39c;
- box-shadow: 0 0 0.5rem rgba(84, 227, 156, 0.66);
-}
-
-.key-setup-tier { font-size: 0.55rem; }
-
-.key-setup-exposed {
- padding: 0.05rem 0.3rem;
- color: rgba(255, 200, 120, 0.75);
- font-size: 0.5rem;
- letter-spacing: 0.06rem;
- text-transform: uppercase;
- border: 1px solid rgba(255, 200, 120, 0.3);
- border-radius: 0.3rem;
-}
-
-.key-setup-get {
- margin-left: auto;
- color: rgba(54, 220, 255, 0.75);
- font-size: 0.58rem;
- letter-spacing: 0.08rem;
- text-decoration: none;
- white-space: nowrap;
-}
-
-.key-setup-get:hover,
-.key-setup-get:focus-visible {
- color: rgba(54, 220, 255, 1);
- text-decoration: underline;
- outline: none;
-}
-
-.key-setup-unlocks {
- margin: 0;
- color: rgba(198, 220, 226, 0.6);
- font-size: 0.66rem;
-}
-
-.key-setup-fields {
- display: grid;
- gap: 0.3rem;
-}
-
-.key-setup-fields input {
- width: 100%;
- padding: 0.42rem 0.55rem;
- color: rgba(225, 244, 248, 0.92);
- font-family: var(--font-mono);
- font-size: 0.66rem;
- background: rgba(4, 14, 20, 0.72);
- border: 1px solid rgba(100, 200, 220, 0.22);
- border-radius: 0.32rem;
-}
-
-.key-setup-fields input:focus {
- border-color: rgba(54, 220, 255, 0.65);
- outline: none;
-}
-
-.key-setup-fields input::placeholder { color: rgba(148, 178, 188, 0.42); }
-
-.key-setup-footer { margin-top: 0.85rem; }
-
-.key-setup-apply {
- padding: 0.5rem 0.95rem;
- color: #04141c;
- font-family: var(--font-mono);
- font-size: 0.66rem;
- font-weight: 700;
- letter-spacing: 0.09rem;
- background: linear-gradient(180deg, #45e0ff, #1fb9dd);
- border: none;
- border-radius: 0.38rem;
- cursor: pointer;
- transition: filter var(--transition-fast);
-}
-
-.key-setup-apply:hover,
-.key-setup-apply:focus-visible {
- filter: brightness(1.08);
- outline: none;
-}
-
-.key-setup-apply[aria-disabled='true'] {
- cursor: wait;
- opacity: 0.5;
- pointer-events: none;
-}
-
-.key-setup-note {
- min-height: 1.1rem;
- margin-top: 0.5rem;
- color: rgba(199, 225, 231, 0.62);
- font-family: var(--font-mono);
- font-size: 0.62rem;
- line-height: 1.35;
-}
-
-/* The same exclusive surfaces that hide the launcher hide this surface —
- nothing about key setup belongs in a recording, a cockpit, or a scene. */
-body.ui-clean-view #key-setup-chip,
-body.recording-mode #key-setup-chip,
-body.cockpit-mode #key-setup-chip,
-body.scene-playback-mode #key-setup-chip,
-body.ui-clean-view #key-setup,
-body.recording-mode #key-setup,
-body.cockpit-mode #key-setup,
-body.scene-playback-mode #key-setup {
- display: none;
-}
-
-@media (max-width: 620px) {
- /* Clear the dock. Desktop-first app; this is a courtesy, not a layout. */
- #key-setup-chip { bottom: 5.8rem; }
-}
-
-/* Provider Settings additions: externally-managed badge + per-row remove. */
-.key-setup-external {
- padding: 0.05rem 0.3rem;
- color: rgba(148, 200, 220, 0.7);
- font-size: 0.5rem;
- letter-spacing: 0.06rem;
- text-transform: uppercase;
- border: 1px solid rgba(148, 200, 220, 0.28);
- border-radius: 0.3rem;
- white-space: nowrap;
-}
-
-.key-setup-remove {
- justify-self: start;
- padding: 0.28rem 0.55rem;
- color: rgba(255, 170, 150, 0.8);
- font-family: var(--font-mono);
- font-size: 0.55rem;
- letter-spacing: 0.08rem;
- background: none;
- border: 1px solid rgba(255, 170, 150, 0.3);
- border-radius: 0.32rem;
- cursor: pointer;
- transition: color var(--transition-fast), border-color var(--transition-fast);
-}
-
-.key-setup-remove:hover,
-.key-setup-remove:focus-visible {
- color: rgba(255, 190, 170, 1);
- border-color: rgba(255, 170, 150, 0.65);
- outline: none;
-}
+/* Preserve component and responsive rule order in one stylesheet entry. */
+@import './src/ui/styles/foundation.css';
+@import './src/ui/styles/controls.css';
+@import './src/ui/styles/location.css';
+@import './src/ui/styles/status.css';
+@import './src/ui/styles/cockpit.css';
+@import './src/ui/styles/overlays.css';
+@import './src/ui/styles/layers.css';
+@import './src/ui/styles/radio.css';
+@import './src/ui/styles/cctv.css';
+@import './src/ui/styles/scenes.css';
+@import './src/ui/styles/recording.css';
+@import './src/ui/styles/responsive.css';
+@import './src/ui/styles/command-dock.css';
+@import './src/ui/styles/command-dock-compact.css';
+@import './src/ui/styles/command-dock-trays.css';
+@import './src/ui/styles/command-dock-sliding.css';
+@import './src/ui/styles/voice-cost.css';
+@import './src/ui/styles/first-run.css';
+@import './src/ui/styles/provider-settings.css';