:root {
  color-scheme: dark;
  --bg: #101513;
  --panel: rgba(18, 24, 23, .94);
  --panel-raised: #202725;
  --line: rgba(205, 224, 215, .12);
  --line-strong: rgba(205, 224, 215, .22);
  --text: #edf1eb;
  --muted: #929e97;
  --accent: #d2f58a;
  --cyan: #82d4d4;
  --pink: #ec92c8;
  --amber: #e5c57d;
  --error: #ef9a8d;
  --edge: 20px;
  --sidebar: 296px;
  --camera: 316px;
  --map-left: calc(var(--edge) + var(--sidebar) + 20px);
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; min-height: 100%; }
body[data-view] { height: 100%; overflow: hidden; }
body { margin: 0; color: var(--text); background: var(--bg); }
button, input, select { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; border: 0; border-radius: 5px; }
button:disabled { cursor: not-allowed; opacity: .38; }
button, a, summary, input, select { transition: background .15s ease, color .15s ease, border-color .15s ease; }
button:focus-visible, a:focus-visible, input:focus-visible, canvas:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: var(--cyan); }
input { min-width: 0; }
input[type=number] { appearance: textfield; }
input::-webkit-inner-spin-button { appearance: none; }
input[type=checkbox] { accent-color: var(--accent); }
h1, h2, h3, p { margin: 0; }
svg { display: block; }
button svg, .text-button svg, .brand svg, .model-settings summary svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.glass-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 8px 32px #0003, 0 1px 3px #0003; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.eyebrow { font-size: 9px; font-weight: 600; letter-spacing: 1.55px; line-height: 1.5; color: var(--muted); }
.icon-button { width: 34px; height: 34px; display: inline-flex; justify-content: center; align-items: center; background: transparent; color: var(--muted); border: 1px solid transparent; flex: 0 0 auto; }
.icon-button:hover { color: var(--text); background: #ffffff0b; }
.icon-button[aria-expanded=true] { background: #d2f58a0b; color: var(--accent); border-color: #d2f58a15; }
.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 4px 0; color: var(--cyan); background: transparent; font-size: 11px; line-height: 1.4; white-space: nowrap; }
.text-button svg { width: 14px; height: 14px; }
.text-button:hover { color: #c5f3ed; }
.button { display: inline-flex; align-items: center; justify-content: center; padding: 10px 13px; gap: 7px; border: 1px solid var(--line-strong); background: #ffffff07; font-size: 12px; font-weight: 500; }
.button:hover:not(:disabled) { background: #ffffff10; }
.button.primary { background: var(--accent); border-color: var(--accent); color: #1c2613; font-weight: 650; }
.button.primary:hover:not(:disabled) { background: #e1ffab; }
.button.quiet { color: var(--muted); background: transparent; }
.button.square { width: 34px; height: 34px; padding: 0; font-size: 24px; font-weight: 300; }

/* The map is the workspace. Every control floats over it. */
.workspace, .map-column, .map-card { position: static; }
.map-stage { position: fixed; inset: 0; background: #17251d; overflow: hidden; isolation: isolate; }
.map-stage > canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.map-stage > canvas.placing { cursor: crosshair; }
.topbar { position: fixed; z-index: 20; top: var(--edge); left: var(--edge); right: var(--edge); height: 66px; padding: 0 17px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; gap: 11px; align-items: center; text-decoration: none; color: var(--text); min-width: 260px; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; color: var(--accent); }
.brand svg { width: 32px; height: 32px; stroke-width: 1.4; }
.brand strong { font-size: 17px; font-weight: 750; letter-spacing: 3.4px; line-height: 1; }
.brand-sub { display: block; font: 8px var(--mono); letter-spacing: 2px; color: var(--muted); margin-top: 7px; }
.version { color: #617063; margin-left: 7px; letter-spacing: .4px; }
.mode-tabs { display: flex; align-items: center; gap: 4px; padding: 4px; background: #0a0f0d80; border: 1px solid var(--line); border-radius: 6px; }
.mode-tabs > button { height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 16px; color: var(--muted); background: transparent; font-size: 12px; white-space: nowrap; }
.mode-tabs > button.active { color: var(--accent); background: #d2f58a0e; box-shadow: inset 0 0 0 1px #d2f58a21; }
.mode-tabs > button:hover:not(.active) { color: var(--text); background: #ffffff05; }
.mode-tabs svg { width: 16px; height: 16px; }
.mode-tabs button > i { width: 6px; height: 6px; border: 1px solid currentColor; border-radius: 50%; }
.mode-tabs button.active > i { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 9px #d2f58a33; }
.header-right { display: flex; align-items: center; justify-content: flex-end; gap: 18px; min-width: 260px; }
.header-actions { display: flex; gap: 3px; }
.local-badge { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.local-badge i { width: 5px; height: 5px; flex: 0 0 auto; background: var(--accent); border-radius: 50%; }

/* Mission setup */
.control-column { position: fixed; z-index: 12; top: 106px; left: var(--edge); width: var(--sidebar); max-height: calc(100dvh - 126px); display: flex; flex-direction: column; padding: 19px; overflow: auto; scrollbar-width: thin; scrollbar-color: #56605655 transparent; overscroll-behavior: contain; transition: opacity .15s ease, transform .18s ease; }
.control-column::-webkit-scrollbar { width: 4px; }
.control-column::-webkit-scrollbar-thumb { background: #56605655; border-radius: 8px; }
.controls-collapsed { --map-left: var(--edge); }
.controls-collapsed .control-column { opacity: 0; transform: translateX(calc(-100% - 30px)); pointer-events: none; visibility: hidden; }
.control-title { display: flex; align-items: center; justify-content: space-between; gap: 5px; padding-bottom: 18px; }
.control-title .eyebrow { color: var(--accent); font-size: 8px; letter-spacing: 1.5px; }
.panel-index { font: 8px var(--mono); color: #65736b; letter-spacing: .6px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.panel-heading h1 { font-size: 22px; font-weight: 540; letter-spacing: -.65px; }
.weapon-tag { font: 9px var(--mono); line-height: 1.4; background: #d2f58a09; color: var(--accent); border: 1px solid #d2f58a24; border-radius: 4px; padding: 4px 6px; white-space: nowrap; }
.mission-description { font-size: 11px; line-height: 1.65; color: var(--muted); max-width: 240px; margin-bottom: 19px; }
.loadout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.map-select-label { display: block; font-size: 10px; color: var(--muted); }
select { display: block; width: 100%; padding: 9px 8px; margin-top: 7px; border: 1px solid var(--line-strong); border-radius: 5px; background: #0c1210; font-size: 11px; }
select:hover, input:hover { border-color: #a3b7a744; }
.field-hint { color: var(--muted); font-size: 10px; line-height: 1.65; margin-top: 9px; }
.weapon-detected { color: #6f8176; font-size: 9px; margin: 9px 0 21px; }
.position-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.field-label { display: inline-flex; align-items: center; gap: 7px; font-size: 9px; font-weight: 550; letter-spacing: 1.05px; color: #bdc8bf; }
.position-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; flex: 0 0 auto; }
.position-dot.cyan { background: var(--cyan); box-shadow: 0 0 0 3px #82d4d40b; }
.position-dot.amber { background: var(--amber); }
.position-dot.pink { background: var(--pink); }
.coordinate-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.coordinate-fields label { padding: 8px 10px 7px; border: 1px solid var(--line-strong); border-radius: 5px; background: #0c1210; min-width: 0; }
.coordinate-fields label:focus-within { border-color: #82d4d47a; }
.coordinate-fields label > span { display: flex; align-items: center; gap: 6px; color: var(--cyan); font: 9px var(--mono); }
.coordinate-fields label small { color: #64766a; font-size: 8px; letter-spacing: .7px; }
.coordinate-fields input { display: block; width: 100%; padding: 5px 0 0; border: 0; border-radius: 0; background: transparent; color: var(--text); font: 18px var(--mono); outline-offset: 2px; }
.coordinate-fields input::placeholder { color: #5b6c60; }
input[aria-invalid=true] { color: var(--error); border-color: var(--error); }
.position-help { margin-top: 9px; color: #819085; }
.platform-note { font-size: 9px; line-height: 1.6; color: #b2a68a; margin-top: 12px; padding: 8px 9px; background: #e5c57d06; border-left: 2px solid #e5c57d46; border-radius: 0 4px 4px 0; }
.input-errors { font-size: 11px; line-height: 1.6; color: var(--error); background: #e57d5c0a; border: 1px solid #e57d5c22; padding: 9px; border-radius: 4px; margin-top: 12px; }
.target-panel { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 18px; }
summary { cursor: pointer; line-height: 1.7; }
summary::marker { color: #677b6c; font-size: 9px; }
.target-coordinates { color: var(--muted); font-size: 10px; }
.target-coordinates .coordinate-fields { margin-top: 10px; }
.target-coordinates input { color: var(--amber); }
.target-coordinates label > span { color: var(--amber); }
.aim-card { padding: 12px; margin-top: 14px; border: 1px solid #d2f58a25; border-radius: 5px; background: linear-gradient(115deg, #d2f58a0c, #d2f58a02); }
.aim-card > span { display: block; font: 8px var(--mono); color: #97a77e; letter-spacing: 1px; }
.aim-card strong { display: block; font: 17px var(--mono); line-height: 1.5; letter-spacing: -.7px; color: var(--accent); margin: 7px 0 4px; overflow-wrap: anywhere; }
.aim-card small { display: block; font-size: 9px; line-height: 1.6; color: #94a48a; }
.aim-card p { border-top: 1px solid var(--line); margin-top: 9px; padding-top: 9px; font-size: 11px; line-height: 1.6; color: var(--cyan); }
.model-settings { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 18px; color: var(--muted); font-size: 10px; }
.model-settings > summary { display: flex; align-items: center; gap: 8px; list-style: none; }
.model-settings > summary::-webkit-details-marker { display: none; }
.model-settings > summary::after { content: '+'; margin-left: auto; color: #9aa997; font: 15px var(--mono); }
.model-settings[open] > summary::after { content: '−'; }
.model-settings summary svg { width: 13px; height: 13px; }
.model-settings label { display: block; margin-top: 14px; line-height: 1.6; }
.model-settings input[type=number] { display: block; width: 100%; padding: 9px; margin-top: 5px; border: 1px solid var(--line-strong); border-radius: 5px; background: #0c1210; font: 12px var(--mono); }
.model-settings p { margin-top: 13px; font-size: 10px; line-height: 1.65; }
.model-settings small { display: block; margin-top: 10px; font: 10px var(--mono); line-height: 1.6; }
.model-settings .text-button { margin-top: 10px; }
.check-label { display: flex !important; align-items: center; gap: 7px; }
.check-label input { margin: 0; }
.panel-footer { display: flex; justify-content: space-between; gap: 10px; color: #617365; border-top: 1px solid var(--line); margin-top: 17px; padding-top: 13px; font-size: 8px; }
.panel-footer .local-badge { font-size: 8px; color: #7a8d7f; }
.panel-footer .local-badge i { width: 4px; height: 4px; }

/* SPH-2 sight guide: the ladder moves; the cyan middle bar stays fixed. */
.mil-guide { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
.mil-guide-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; color: var(--muted); font: 8px var(--mono); letter-spacing: 1px; }
.mil-guide-heading strong { color: var(--cyan); font-size: 11px; font-weight: 500; letter-spacing: 0; }
.compass-guide-window { position: relative; height: 84px; margin-top: 9px; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: #0b120f; }
.compass-axis { position: absolute; left: 8px; right: 8px; top: 67px; height: 1px; background: #b7c1b752; }
.compass-mark { position: absolute; top: 48px; width: 36px; display: flex; flex-direction: column; align-items: center; gap: 5px; transform: translateX(-50%); transition: left .18s ease; }
.compass-mark b { color: #aeb9af; font: 8px var(--mono); font-weight: 400; }
.compass-mark i { width: 1px; height: 13px; background: #b7c1b780; }
.compass-center { position: absolute; z-index: 2; top: 4px; left: 50%; min-width: 62px; padding: 5px 8px 4px; transform: translateX(-50%); display: flex; align-items: baseline; justify-content: center; gap: 5px; border: 1px solid var(--cyan); border-radius: 3px; background: #101a16; color: var(--cyan); box-shadow: 0 0 12px #82d4d422; }
.compass-center::after { content: ''; position: absolute; left: 50%; top: 100%; width: 1px; height: 39px; background: var(--cyan); }
.compass-center strong { font: 11px var(--mono); font-weight: 500; }
.compass-center small { font: 7px var(--mono); color: #b9d5d0; }
.mil-guide-window { position: relative; height: 144px; margin-top: 9px; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: linear-gradient(90deg,#0a100d 0 46%,#111a16 46% 100%); }
.mil-guide-window::before { content: ''; position: absolute; top: 0; bottom: 0; left: 46%; width: 1px; background: #ffffff0d; }
.mil-mark { position: absolute; left: 0; right: 14px; height: 18px; display: flex; align-items: center; gap: 9px; transform: translateY(-50%); transition: top .18s ease; }
.mil-mark b { width: 43%; color: #c8d2c7; font: 10px var(--mono); font-weight: 400; text-align: right; }
.mil-mark i { display: block; width: 43%; height: 1px; background: #b7c1b780; }
.mil-mark i::after { content: ''; display: block; width: 1px; height: 9px; margin-left: auto; transform: translateY(-4px); background: #b7c1b780; }
.mil-center { position: absolute; z-index: 2; top: 72px; left: 46%; right: 0; height: 0; color: var(--cyan); pointer-events: none; }
.mil-center i { display: block; width: 48%; height: 2px; background: currentColor; box-shadow: 0 0 10px #82d4d455; }
.mil-center i::before { content: ''; display: block; width: 2px; height: 13px; transform: translateY(-5px); background: currentColor; }
.mil-center span { position: absolute; right: 7px; top: -16px; font: 7px var(--mono); letter-spacing: .8px; }

/* Map identity and on-map tools */
.map-top { position: fixed; z-index: 4; top: 110px; left: var(--map-left); display: flex; align-items: flex-start; gap: 22px; pointer-events: none; }
.map-identity { color: #f1f2e8; text-shadow: 0 2px 6px #000b; }
.map-label { display: block; font: 8px var(--mono); letter-spacing: 1.8px; color: #d0d6c3; }
.map-identity h2 { font-size: 27px; font-weight: 550; letter-spacing: -.5px; margin-top: 6px; line-height: 1.1; }
#model-label { font-size: 8px; letter-spacing: .65px; text-transform: uppercase; margin-top: 8px; color: #c3cdb5; max-width: 210px; }
#model-label.flat { color: var(--muted); }
.view-tabs { display: flex; gap: 2px; padding: 3px; margin-top: 16px; background: #141c17e8; border: 1px solid var(--line-strong); border-radius: 5px; backdrop-filter: blur(10px); pointer-events: auto; }
.view-tabs button { background: transparent; color: #a8b4a0; font: 10px var(--mono); padding: 7px 9px; border-radius: 3px; }
.view-tabs button.active { color: var(--accent); background: #d2f58a16; }
.view-tabs button:hover { color: #fff; }
.map-status { position: absolute; z-index: 3; left: var(--map-left); top: 205px; max-width: calc(100% - var(--map-left) - var(--camera) - 58px); display: flex; align-items: center; gap: 7px; padding: 7px 9px; border: 1px solid #d2f58a25; border-radius: 4px; background: #111b16df; color: #d4e5c8; font: 8px var(--mono); letter-spacing: .7px; pointer-events: none; }
.map-status i { width: 4px; height: 4px; flex: 0 0 auto; border-radius: 50%; background: var(--accent); }
.map-status.waiting { color: #bec6b3; border-color: #c8d5b722; }
.map-status.waiting i { background: #bfc89f; }
.map-status.invalid { color: var(--error); border-color: #ef9a8d33; }
.map-status.invalid i { background: var(--error); }
.north-mark { position: absolute; top: 108px; right: calc(var(--camera) + var(--edge) + 24px); color: #d6e0cf; display: flex; flex-direction: column; align-items: center; gap: 7px; font: 9px var(--mono); text-shadow: 0 2px 5px #000; pointer-events: none; }
.north-mark svg { width: 14px; height: 20px; fill: #d4e0c8; filter: drop-shadow(0 1px 4px #0008); }
.map-controls { position: absolute; right: var(--edge); bottom: 204px; display: flex; flex-direction: column; padding: 4px; gap: 2px; background: #121a16eb; border: 1px solid var(--line-strong); border-radius: 6px; backdrop-filter: blur(10px); }
.map-controls button { width: 31px; height: 31px; display: grid; place-items: center; background: transparent; color: #bdcdb8; }
.map-controls button:hover { color: var(--accent); background: #d2f58a10; }
.map-controls button svg { width: 16px; height: 16px; }
@media (min-width: 761px) and (max-height: 800px) {
  .map-controls { flex-direction: row; }
}
.north-letter { font: 11px var(--mono); }
.tool-separator { height: 1px; background: var(--line); margin: 2px 4px; }
.map-caption { position: absolute; left: var(--map-left); bottom: 181px; color: #d1dac8; font-size: 9px; line-height: 1.4; text-shadow: 0 1px 4px #000; pointer-events: none; max-width: calc(100% - var(--map-left) - 80px); }
.map-bottom { position: fixed; left: var(--map-left); bottom: 209px; z-index: 3; pointer-events: none; }
.legend { display: flex; align-items: center; gap: 16px; padding: 7px 9px; border: 1px solid #adbc9b1a; border-radius: 4px; background: #111b16bf; backdrop-filter: blur(8px); }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 8px; color: #c2cdb8; white-space: nowrap; }
.legend i { width: 5px; height: 5px; border-radius: 50%; }
.legend .cyan { background: var(--cyan); }
.legend .amber { background: var(--amber); }
.legend .pink { background: var(--pink); }
.legend .ring { width: 8px; height: 8px; border: 1px dashed #a1b785; }
.place-instruction { position: fixed; z-index: 24; left: 50%; top: 103px; transform: translateX(-50%); max-width: calc(100% - 30px); display: flex; align-items: center; gap: 11px; padding: 11px 14px; color: var(--text); font-size: 12px; border-color: #82d4d475; }
.instruction-crosshair { font: 20px var(--mono); color: var(--cyan); }
.place-instruction button { color: var(--cyan); background: #82d4d40d; padding: 6px 8px; font-size: 10px; }

/* Impact detail camera */
.impact-panel { position: fixed; z-index: 9; width: var(--camera); right: var(--edge); top: 106px; padding: 15px; transition: opacity .15s ease, transform .18s ease; }
.camera-collapsed .impact-panel { visibility: hidden; opacity: 0; transform: translateX(calc(100% + 30px)); pointer-events: none; }
.camera-collapsed .north-mark { right: calc(var(--edge) + 14px); }
.camera-collapsed .map-status { max-width: calc(100% - var(--map-left) - 70px); }
.camera-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.camera-heading .eyebrow { display: flex; align-items: center; gap: 6px; font-size: 8px; color: #c087ad; letter-spacing: 1.4px; }
.camera-heading h2 { font-size: 15px; font-weight: 520; letter-spacing: -.2px; margin-top: 5px; }
.camera-heading .icon-button { width: 31px; height: 31px; border-color: var(--line); }
.impact-camera-frame { position: relative; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; background: #0b1310; border: 1px solid #d5e3d61c; border-radius: 4px; }
#impact-canvas { display: block; width: 100%; height: 100%; }
.camera-corner { position: absolute; width: 10px; height: 10px; border-color: #c8d3c566; border-style: solid; pointer-events: none; }
.corner-tl { top: 9px; left: 9px; border-width: 1px 0 0 1px; }
.corner-tr { top: 9px; right: 9px; border-width: 1px 1px 0 0; }
.corner-bl { bottom: 9px; left: 9px; border-width: 0 0 1px 1px; }
.corner-br { bottom: 9px; right: 9px; border-width: 0 1px 1px 0; }
.camera-model-label { position: absolute; top: 12px; left: 17px; color: #c4d0c0; opacity: .7; font: 6px var(--mono); letter-spacing: 1.1px; pointer-events: none; text-shadow: 0 1px 3px #000; }
.camera-state { display: flex; align-items: baseline; gap: 6px; padding-top: 10px; color: #929e91; font-size: 9px; line-height: 1.5; }
.camera-state > i { width: 4px; height: 4px; border-radius: 50%; background: #bc93aa; flex: 0 0 auto; }
.live-output { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 11px; }
.live-output > span:first-child { font: 7px var(--mono); letter-spacing: 1.15px; color: #858f85; }
.live-output strong { font: 12px var(--mono); letter-spacing: -.1px; color: #e9b3d6; line-height: 1.5; }
#reading-age { color: #718575; font: 8px var(--mono); line-height: 1.5; }
#reading-age:empty { display: none; }

/* A single dock keeps all firing telemetry in the same place. */
.telemetry-dock { position: fixed; z-index: 10; left: var(--map-left); right: var(--edge); bottom: var(--edge); padding: 12px 20px 0; }
.telemetry-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.telemetry-heading .eyebrow { display: flex; align-items: center; gap: 7px; font-size: 8px; letter-spacing: 1.25px; }
.telemetry-pulse { width: 4px; height: 4px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 3px #d2f58a08; }
.telemetry-heading .text-button { color: #acb8a5; font-size: 9px; padding: 0; gap: 6px; }
.telemetry-heading .text-button:hover { color: var(--accent); }
.telemetry-heading .text-button > svg:first-child { width: 15px; height: 15px; }
.telemetry-heading .chevron { width: 12px; height: 12px; transition: transform .2s ease; }
#toggle-profile[aria-expanded=true] .chevron { transform: rotate(180deg); }
.metrics { display: grid; grid-template-columns: 1fr 1fr 1fr 1.1fr 1fr; padding-bottom: 14px; }
.metrics > div { min-width: 0; padding: 0 18px; border-left: 1px solid var(--line); }
.metrics > div:first-child { padding-left: 0; border-left: 0; }
.metrics > div:last-child { padding-right: 0; }
.metrics span { display: flex; align-items: center; gap: 5px; font-size: 8px; letter-spacing: .9px; color: var(--muted); margin-bottom: 8px; white-space: nowrap; }
.metrics strong { display: block; font: 28px var(--mono); font-weight: 400; letter-spacing: -1.6px; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metrics > div:nth-child(-n+2) strong { color: var(--accent); }
.metrics .flight-metric strong { color: #e8b9d7; }
.metrics .flight-metric svg { width: 12px; height: 12px; fill: none; stroke: #b79cac; stroke-width: 1.25; margin-top: -2px; margin-bottom: -2px; }
.metrics small { display: block; font-size: 8px; color: #7e8f7f; margin-top: 6px; line-height: 1.5; }
.result-description { border-top: 1px solid var(--line); padding: 8px 0; margin: 0; color: #9ba992; font-size: 9px; line-height: 1.5; min-height: 30px; }
.terrain-profile-panel { position: absolute; left: 0; width: min(520px, 100%); bottom: calc(100% + 10px); padding: 15px 20px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); backdrop-filter: blur(20px); box-shadow: 0 8px 32px #0002; }
.profile-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.profile-heading > span { color: #9aa28e; font-size: 8px; }
#terrain-profile svg { display: block; width: 100%; max-height: 130px; }
#terrain-profile .field-hint { font-size: 9px; margin-top: 8px; color: #9eaa8f; }

/* Existing 3D scene helpers remain available outside the main overlays. */
.scene-structure-panel { z-index: 4; left: auto !important; right: 74px !important; top: auto !important; bottom: 244px !important; max-width: 230px !important; padding: 8px 10px !important; border: 1px solid var(--line); border-radius: 5px !important; color: #bcc9b4 !important; background: #111b16dd !important; font-size: 8px !important; line-height: 1.6 !important; backdrop-filter: blur(8px); }
.scene-structure-panel .text-button { font-size: 9px !important; }
.scene-structure-panel > a { color: #93a38e !important; font-size: 8px; }
.scene-terrain-note { top: auto !important; right: 75px !important; bottom: 211px !important; max-width: min(45%, 340px) !important; padding: 5px 7px !important; color: #bdcbb5 !important; background: #111b16cc !important; font-size: 8px !important; }
.map-stage > canvas[aria-hidden=true] { right: 76px !important; bottom: 339px !important; width: 58px !important; height: 58px !important; }
body[data-view='2d'] .scene-structure-panel, body[data-view='2d'] .scene-terrain-note, body[data-view='2d'] .map-stage > canvas[aria-hidden=true] { display: none !important; }
body[data-view='3d'] #north-up { color: var(--accent); }

/* Local live capture and its diagnostics */
#live-section { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 18px; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.section-title .eyebrow { font-size: 8px; letter-spacing: 1px; }
.section-title h2 { font-size: 15px; font-weight: 500; margin-top: 5px; }
.section-title .local-badge { font-size: 8px; }
.hud-values { display: flex; gap: 24px; border-top: 1px solid var(--line); padding-top: 13px; margin-top: 14px; }
.hud-values small { display: block; font-size: 9px; color: var(--muted); }
.hud-values strong { display: block; margin-top: 5px; font: 18px var(--mono); color: var(--cyan); }
#live-status { font-size: 9px; }
.tool-panel p { font-size: 10px; line-height: 1.6; color: var(--muted); }
.live-calculator > h3, .live-calculator > p { display: none; }
.tool-form { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 9px; }
.tool-form > .button { flex: 1; font-size: 9px; padding: 9px 5px; }
.tool-form > .primary { flex-basis: 100%; font-size: 12px; padding: 12px; }
.ocr-progress { font-size: 10px; color: var(--muted); line-height: 1.6; }
.live-calculator > output { display: block; font-size: 9px; margin: 7px 0; }
.live-diagnostics { border-top: 1px solid var(--line); margin-top: 13px; padding-top: 11px; font-size: 10px; color: var(--muted); }
.live-diagnostics > p { margin-top: 9px; }
.ocr-grid { display: grid; grid-template-columns: 1fr; gap: 13px; margin-top: 12px; }
.ocr-image-area { position: relative; min-height: 100px; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: #090e0b; }
.ocr-image-area canvas { width: 100%; display: block; touch-action: none; cursor: crosshair; }
.ocr-empty { padding: 14px; font-size: 10px; line-height: 1.65; color: var(--muted); }
.ocr-options { display: flex; flex-direction: column; gap: 11px; }
.ocr-options > label { display: flex; align-items: center; gap: 6px; font-size: 10px; }
.ocr-options label input[type=checkbox] { margin: 0; }
.ocr-options p { margin: 0; }
.ocr-options details { font-size: 10px; }
.ocr-options details > p { margin-top: 8px; }
.ocr-region-buttons { display: flex; gap: 6px; margin-top: 9px; }
.ocr-region-buttons button { padding: 8px 5px; font-size: 9px; flex: 1; }
.ocr-region-buttons button.active { border-color: #82d4d455; color: var(--cyan); background: #82d4d40a; }
.crop-editor { margin-top: 10px; }
.crop-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 9px; }
.crop-fields input { display: block; width: 100%; padding: 7px; border: 1px solid var(--line-strong); border-radius: 4px; margin-top: 5px; background: #0c1210; font: 11px var(--mono); }
.ocr-options > small { font-size: 9px; margin: 0; }
.tool-error { color: var(--error) !important; }

/* Standalone local diagnostic pages share the same controls. */
body:not([data-view]) > main { max-width: 1440px; margin: auto; padding: 28px; }
body:not([data-view]) > main > h1 { font-size: 26px; margin: 12px 0; }
body:not([data-view]) > main > p { font-size: 12px; line-height: 1.7; margin-bottom: 14px; }
body:not([data-view]) .panel { padding: 20px; margin-top: 20px; border: 1px solid var(--line); border-radius: 8px; }

/* Model notes */
dialog { width: calc(100% - 32px); max-width: 640px; max-height: 84dvh; padding: 25px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--text); background: #141c17; box-shadow: 0 30px 120px #0008; }
dialog::backdrop { background: #050b08ad; backdrop-filter: blur(6px); }
.dialog-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
dialog h2 { font-size: 23px; font-weight: 500; letter-spacing: -.5px; line-height: 1.3; margin-bottom: 20px; }
dialog p { color: #b1bfa9; font-size: 12px; line-height: 1.75; margin-bottom: 16px; }
dialog p strong { color: var(--text); font-weight: 550; }
dialog .muted { color: #7f947b; font-size: 11px; margin: 0; }

@media (min-width: 1550px) {
  :root { --edge: 24px; --sidebar: 310px; --camera: 342px; --map-left: calc(var(--edge) + var(--sidebar) + 26px); }
  .topbar { height: 70px; padding: 0 21px; }
  .control-column, .impact-panel { top: 118px; }
  .control-column { padding: 22px; max-height: calc(100dvh - 142px); }
  .map-top { top: 122px; }
  .map-status { top: 219px; }
  .north-mark { top: 122px; }
  .metrics strong { font-size: 33px; }
  .metrics span { font-size: 9px; }
  .metrics small { font-size: 9px; }
  .telemetry-dock { padding: 15px 24px 0; }
  .map-caption { bottom: 196px; }
  .map-bottom { bottom: 224px; }
  .map-controls { bottom: 217px; }
  .mission-description, .position-help { font-size: 11px; }
}
@media (max-width: 1200px) {
  :root { --edge: 16px; --sidebar: 272px; --camera: 272px; --map-left: calc(var(--edge) + var(--sidebar) + 16px); }
  .topbar { top: 16px; height: 62px; padding: 0 13px; gap: 12px; }
  .brand, .header-right { min-width: 210px; }
  .header-right { gap: 10px; }
  .header-right > .local-badge { display: none; }
  .mode-tabs > button { padding: 0 12px; font-size: 11px; }
  .control-column, .impact-panel { top: 94px; }
  .control-column { padding: 16px; max-height: calc(100dvh - 110px); }
  .map-top { top: 101px; gap: 15px; }
  .map-status { top: 192px; }
  .north-mark { top: 100px; right: calc(var(--camera) + 29px); }
  .metrics > div { padding: 0 12px; }
  .metrics strong { font-size: 24px; letter-spacing: -1px; }
  .metrics span { font-size: 7px; letter-spacing: .5px; }
  .metrics small { font-size: 7px; }
  .telemetry-dock { padding: 12px 16px 0; }
  .telemetry-heading { margin-bottom: 12px; }
  .legend { gap: 12px; }
  .map-caption { bottom: 169px; }
  .map-bottom { bottom: 196px; }
  .map-controls { bottom: 189px; }
  .scene-structure-panel { bottom: 232px !important; }
  .scene-terrain-note { bottom: 198px !important; }
  .map-stage > canvas[aria-hidden=true] { bottom: 329px !important; }
}
@media (max-width: 1000px) {
  :root { --sidebar: 260px; --camera: 242px; }
  .brand { min-width: 185px; }
  .brand strong { font-size: 14px; letter-spacing: 2.4px; }
  .brand-sub { font-size: 7px; letter-spacing: 1.5px; }
  .brand-mark, .brand svg { width: 28px; }
  .header-right { min-width: auto; }
  .header-actions { gap: 1px; }
  .icon-button { width: 30px; height: 32px; }
  .mode-tabs { padding: 3px; }
  .mode-tabs > button { height: 32px; padding: 0 10px; gap: 6px; font-size: 10px; }
  .map-top { gap: 12px; }
  .map-identity h2 { font-size: 24px; }
  .map-label { font-size: 7px; }
  #model-label { font-size: 7px; max-width: 165px; }
  .map-status { max-width: calc(100% - var(--map-left) - var(--camera) - 35px); font-size: 7px; line-height: 1.6; }
  .north-mark { display: none; }
  .impact-panel { padding: 12px; }
  .camera-heading h2 { font-size: 14px; }
  .metrics > div { padding: 0 9px; }
  .metrics strong { font-size: 21px; }
  .metrics small { font-size: 6.5px; }
  .metrics span { font-size: 6.5px; letter-spacing: .2px; }
  .metrics .flight-metric svg { display: none; }
  .scene-structure-panel { max-width: 180px !important; }
  .legend { gap: 9px; }
  .legend span { font-size: 7px; }
}
@media (max-height: 740px) and (min-width: 761px) {
  .control-column { padding: 14px 16px; }
  .control-title { padding-bottom: 11px; }
  .panel-heading h1 { font-size: 20px; }
  .mission-description { margin-bottom: 12px; }
  .weapon-detected { margin-bottom: 14px; }
  .target-panel { margin-top: 13px; padding-top: 13px; }
  .platform-note { margin-top: 9px; padding-top: 6px; padding-bottom: 6px; }
  .model-settings { margin-top: 13px; padding-top: 12px; }
  .impact-camera-frame { aspect-ratio: 16 / 9; }
  .camera-heading { margin-bottom: 9px; }
  .impact-panel { padding: 12px; }
  .camera-state { padding-top: 7px; }
  .live-output { margin-top: 9px; padding-top: 9px; }
  .scene-structure-panel { right: 72px !important; bottom: 235px !important; max-width: 172px !important; }
  .scene-terrain-note { bottom: 196px !important; max-width: 260px !important; }
  .map-stage > canvas[aria-hidden=true] { right: 75px !important; bottom: 329px !important; }
}
@media (max-width: 760px) {
  :root { --edge: 12px; --sidebar: 276px; --camera: 248px; --map-left: 12px; }
  .topbar { top: 12px; left: 12px; right: 12px; height: 99px; padding: 11px 12px 49px; gap: 10px; align-items: center; }
  .brand { min-width: 0; gap: 8px; }
  .brand-mark, .brand svg { width: 26px; height: 26px; }
  .brand strong { font-size: 13px; letter-spacing: 2px; }
  .brand-sub { font-size: 6px; letter-spacing: 1.25px; margin-top: 5px; }
  .version { display: none; }
  .header-right { min-width: 0; }
  .header-actions { gap: 1px; }
  .header-actions .icon-button { width: 29px; height: 29px; }
  .header-actions svg { width: 16px; height: 16px; }
  #fullscreen-button { display: none; }
  .mode-tabs { position: absolute; left: 10px; right: 10px; bottom: 9px; padding: 3px; gap: 4px; }
  .mode-tabs > button { flex: 1; height: 28px; font-size: 10px; gap: 7px; }
  .mode-tabs svg { width: 14px; height: 14px; }
  .control-column { top: 123px; z-index: 15; max-height: calc(100dvh - 366px); width: min(310px, calc(100vw - 24px)); padding: 16px; background: #121a17f5; }
  .control-title { padding-bottom: 11px; }
  .panel-heading h1 { font-size: 21px; }
  .mission-description { margin-bottom: 13px; }
  .weapon-detected { margin-bottom: 14px; }
  .map-top { top: 130px; left: 17px; gap: 16px; }
  .map-label { font-size: 7px; }
  .map-identity h2 { font-size: 24px; margin-top: 5px; }
  #model-label { max-width: 160px; margin-top: 6px; font-size: 6px; }
  .view-tabs { margin-top: 13px; padding: 2px; }
  .view-tabs button { padding: 6px 7px; font-size: 9px; }
  .map-status { top: 212px; left: 17px; max-width: 215px; font-size: 7px; padding: 6px 8px; }
  .north-mark { display: none; }
  .impact-panel { top: 123px; right: 12px; width: min(248px, calc(100vw - 24px)); padding: 11px; z-index: 13; background: #121a17f5; }
  .camera-heading { margin-bottom: 9px; }
  .camera-heading .eyebrow { font-size: 7px; }
  .camera-heading h2 { font-size: 13px; }
  .impact-camera-frame { aspect-ratio: 16 / 9; }
  .camera-state { font-size: 8px; padding-top: 8px; }
  .live-output { gap: 5px; padding-top: 8px; margin-top: 8px; }
  .live-output strong { font-size: 10px; }
  .live-output > span:first-child { font-size: 6px; }
  .telemetry-dock { left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); padding: 11px 13px 0; }
  .telemetry-heading { margin-bottom: 12px; }
  .telemetry-heading .eyebrow { font-size: 7px; }
  .telemetry-heading .text-button { font-size: 8px; }
  .metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); row-gap: 12px; padding-bottom: 11px; }
  .metrics > div { grid-column: span 2; padding: 0 12px; }
  .metrics > div:nth-child(n+4) { grid-column: span 3; padding-top: 11px; border-top: 1px solid var(--line); }
  .metrics > div:nth-child(4) { border-left: 0; padding-left: 0; }
  .metrics span { font-size: 8px; line-height: 1.4; letter-spacing: .5px; margin-bottom: 7px; }
  .metrics strong { font-size: 22px; letter-spacing: -1px; }
  .metrics small { font-size: 7px; line-height: 1.4; margin-top: 4px; }
  .result-description { font-size: 8px; padding: 7px 0; line-height: 1.5; min-height: 28px; }
  .map-bottom { left: 13px; bottom: 262px; }
  .legend { gap: 10px; padding: 6px 8px; }
  .legend span { font-size: 7px; gap: 5px; }
  .map-caption { left: 14px; bottom: 241px; max-width: calc(100% - 27px); font-size: 7px; }
  .map-controls { right: 12px; bottom: 288px; padding: 3px; gap: 1px; }
  .map-controls button { width: 28px; height: 28px; }
  .map-controls button svg { width: 15px; height: 15px; }
  .place-instruction { top: 120px; left: 12px; right: 12px; max-width: none; transform: none; font-size: 11px; gap: 8px; padding: 9px 11px; }
  .place-instruction button { margin-left: auto; flex: 0 0 auto; font-size: 9px; }
  .terrain-profile-panel { padding: 12px; }
  #terrain-profile svg { max-height: 110px; }
  .profile-heading > span { font-size: 7px; }
  .scene-structure-panel { right: 55px !important; bottom: 231px !important; max-width: 168px !important; font-size: 7px !important; }
  .scene-structure-panel .text-button { font-size: 8px !important; }
  .scene-structure-panel > a { font-size: 7px; }
  .scene-terrain-note { right: 56px !important; bottom: 208px !important; max-width: 245px !important; font-size: 7px !important; }
  .map-stage > canvas[aria-hidden=true] { right: 59px !important; bottom: 320px !important; width: 46px !important; height: 46px !important; }
}
@media (max-width: 500px) {
  .metrics > div { padding-left: 10px; padding-right: 10px; }
  .metrics strong { font-size: 22px; }
  .metrics small { font-size: 7px; }
  .metrics span { font-size: 7px; }
  .telemetry-dock { padding: 10px 13px 0; }
  .impact-panel { width: 220px; }
  .legend { gap: 9px; }
  .legend span { font-size: 6.5px; }
  .control-column { max-height: calc(100dvh - 366px); }
}
@media (max-width: 380px) {
  .brand strong { font-size: 11px; letter-spacing: 1.7px; }
  .brand-sub { font-size: 5px; }
  .brand svg { width: 22px; }
  .header-actions .icon-button { width: 26px; }
  .metrics strong { font-size: 20px; }
  .metrics > div { padding-left: 8px; padding-right: 8px; }
  .metrics span { font-size: 6.5px; }
  .control-column { width: calc(100vw - 24px); }
}
@media (max-height: 600px) and (min-width: 761px) {
  .impact-panel { width: 232px; padding: 10px; }
  .impact-camera-frame { aspect-ratio: 2 / 1; }
  .camera-heading h2 { font-size: 13px; }
  .camera-state { font-size: 8px; }
  .live-output { gap: 4px; }
  .live-output strong { font-size: 10px; }
  .scene-structure-panel { bottom: 208px !important; }
  .scene-terrain-note { display: none; }
  .map-stage > canvas[aria-hidden=true] { bottom: 301px !important; }
}
.scene-structure-panel { left: var(--map-left) !important; right: auto !important; top: 250px !important; bottom: auto !important; max-width: 215px !important; }
@media (max-width: 760px) { .scene-structure-panel { top: 160px !important; max-width: 168px !important; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* User-traced control zones stay a compact optional layer in the setup overlay. */
.control-zone-settings{border-top:1px solid var(--line);padding:15px 0;color:var(--muted);font-size:11px}
.control-zone-settings summary{cursor:pointer;color:var(--text);font-size:11px;list-style:none;display:flex;justify-content:space-between;gap:12px}
.control-zone-settings summary::-webkit-details-marker{display:none}
.control-zone-settings summary::before{content:'◯';color:#a7d8fa}
.control-zone-settings summary span{margin-left:auto;color:#a7d8fa}
.control-zone-settings[open] summary{margin-bottom:12px}
.zone-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:12px 0}
.zone-fields label{min-width:0;font-size:10px}
.zone-fields input{display:block;width:100%;padding:9px;margin-top:5px;border:1px solid var(--line-strong);border-radius:5px;background:#0c1210;font:12px var(--mono)}
.zone-actions{display:flex;flex-wrap:wrap;gap:12px}
.zone-actions button{font-size:10px}
#zone-status[data-error=true]{color:var(--error)}

/* Compact HUD: core inputs and firing values first, supporting tools on demand. */
.topbar { height: 54px; }
.brand-sub, .mission-description, .map-label, .map-caption, .map-bottom { display: none; }
.control-column, .impact-panel { top: 88px; }
.control-column { padding: 16px; max-height: calc(100dvh - 108px); }
.panel-heading { margin-bottom: 14px; }
.panel-heading h1 { font-size: 18px; }
.loadout-grid { margin-bottom: 18px; }
.target-panel { margin-top: 14px; padding-top: 14px; }
.aim-card { background: none; border: 0; padding: 0; margin-top: 12px; }
.aim-card > small { font-size: 10px; }
.sight-details { color: var(--cyan); font-size: 11px; }
.mil-guide { margin-top: 9px; }
.control-zone-settings, .model-settings { padding: 12px 0 0; margin-top: 14px; }
.control-zone-settings > summary { justify-content: flex-start; gap: 8px; }
.control-zone-settings > summary::before { content: none; }
.control-zone-settings > summary::after { content: '+'; margin-left: auto; }
.control-zone-settings[open] > summary::after { content: '−'; }
.model-settings > summary { color: var(--text); font-size: 11px; }
.platform-note { border: 0; background: none; padding: 0; margin-top: 8px; }
.map-top { top: 90px; align-items: center; }
.map-identity h2 { font-size: 21px; margin: 0; }
.view-tabs { margin-top: 0; }
.map-status { top: 138px; }
.scene-structure-panel { top: 178px !important; padding: 7px 10px !important; font-size: 10px !important; }
.scene-structure-panel > summary { color: var(--muted); cursor: pointer; }
.scene-structure-panel[open] > summary { margin-bottom: 8px; }
.telemetry-dock { padding: 10px 16px 0; }
.telemetry-heading { margin-bottom: 10px; }
.metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); padding-bottom: 12px; }
.metrics > div { grid-column: auto; padding: 0 12px; }
.metrics span { font-size: 8px; margin-bottom: 6px; }
.metrics strong { font-size: 25px; }
.metrics small { font-size: 8px; }
.flight-metric small { display: none; }
.profile-height { padding-bottom: 12px; font-size: 10px; color: var(--muted); }
.profile-height strong { margin: 0 10px; font: 14px var(--mono); color: var(--text); }
.map-controls { bottom: 157px; }
.camera-heading h2 { margin-top: 0; }
.live-output > span:first-child { font: inherit; letter-spacing: normal; }
@media (max-width: 1000px) {
  .metrics strong { font-size: 21px; }
  .metrics > div { padding: 0 8px; }
  .metrics span, .metrics small { font-size: 7px; }
}
@media (max-width: 760px) {
  .topbar { height: 87px; padding-bottom: 46px; }
  .control-column, .impact-panel { top: 111px; }
  .control-column { max-height: calc(100dvh - 265px); }
  .map-top { top: 115px; }
  .map-status { top: 156px; }
  .scene-structure-panel { top: 195px !important; }
  .metrics > div:nth-child(n) { grid-column: auto; border-top: 0; padding: 0 8px; }
  .metrics > div:first-child { border-left: 0; padding-left: 0; }
  .metrics > div:nth-child(4) { border-left: 1px solid var(--line); }
  .metrics strong { font-size: 20px; }
  .map-controls { bottom: 160px; }
}

.camera-state:has(#impact-camera-status:empty) { display: none; }

.target-panel > .arc-control { margin: 14px 0 0; padding: 0; border: 0; min-width: 0; }
.arc-control legend { padding: 0; color: var(--muted); font-size: 10px; }
.arc-options { display: flex; gap: 18px; margin-top: 7px; }
.arc-options label { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; cursor: pointer; font-size: 11px; color: var(--muted); }
.arc-options input { margin: 0; accent-color: var(--accent); width: 14px; height: 14px; }
.arc-options label:has(:checked) { color: var(--accent); }
.model-settings > .control-zone-settings { margin-top: 12px; padding-top: 0; border-top: 0; }

.asl-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; color: var(--muted); font-size: 10px; }
.asl-field small { display: block; margin-top: 4px; font-size: 9px; color: #819085; }
.asl-field input { width: 80px; padding: 8px; border: 1px solid var(--line-strong); border-radius: 5px; background: #0c1210; color: var(--text); font: 13px var(--mono); }

.calibration-panel { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.calibration-panel > summary { cursor: pointer; font-size: 12px; color: var(--accent); }
.calibration-panel > summary > span { display: block; margin: 5px 0 10px; font-size: 10px; color: var(--muted); }
.calibration-panel .field-hint { line-height: 1.6; margin: 9px 0; }
.calibration-manual, #calibration-estimate { margin-top: 12px; }
.calibration-manual > summary, #calibration-estimate > summary { cursor: pointer; color: var(--muted); font-size: 10px; line-height: 1.6; }
.telemetry-heading { flex-wrap: wrap; gap: 8px; }
.telemetry-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.telemetry-actions .button { padding: 7px 10px; font-size: 10px; }
.calibration-feedback { padding: 0 16px 10px; margin-bottom: 0; overflow-wrap: anywhere; }
.calibration-panel .button { width: 100%; margin-top: 8px; }
.calibration-panel .position-heading { flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.calibration-options { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 10px; }
.calibration-options label { min-width: 0; font-size: 10px; color: var(--muted); }
.calibration-options small { font-size: 9px; }
.calibration-options input, .calibration-options select { width: 100%; margin-top: 5px; }
.calibration-options input { display: block; padding: 9px 8px; border: 1px solid var(--line-strong); border-radius: 5px; background: #0c1210; color: var(--text); font: 11px var(--mono); }
.calibration-options input::placeholder { color: #64766a; }
.calibration-options input:disabled { opacity: .55; }
.calibration-estimate { margin: 10px 0; font-size: 11px; }
.calibration-estimate > div { display: flex; justify-content: space-between; gap: 12px; margin: 8px 0; }
.calibration-estimate dt { color: var(--muted); }
.calibration-estimate dd { margin: 0; text-align: right; font-family: var(--mono); overflow-wrap: anywhere; }

.map-controls { bottom: calc(var(--telemetry-height, 160px) + max(var(--edge), env(safe-area-inset-bottom)) + 12px); }

.impact-paste-field { display: block; margin-top: 12px; color: var(--muted); font-size: 11px; }
.impact-paste-field input { display: block; width: 100%; margin-top: 7px; padding: 10px; border: 1px solid var(--line-strong); border-radius: 5px; background: #0c1210; color: var(--text); font: 13px var(--mono); }
.impact-paste-field input[aria-invalid=true] { border-color: var(--error); }
.impact-axes { margin-top: 10px; }
.impact-axes > summary { cursor: pointer; color: var(--muted); font-size: 10px; }

@media (max-width: 760px) {
  .control-column { max-height: calc(100dvh - 111px - var(--telemetry-height, 160px) - max(var(--edge), env(safe-area-inset-bottom)) - 12px); }
}
