:root {
  font-family: system-ui, -apple-system, sans-serif;
  color: #dcebf1; background: #030b14; color-scheme: dark;
  --cyan: #66bdd1; --line: #255268;
  --hud-bottom-height: 110px;
  --safe-top: max(env(safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --safe-left: max(env(safe-area-inset-left, 0px), var(--tg-content-safe-area-inset-left, 0px), var(--tg-safe-area-inset-left, 0px));
  --safe-right: max(env(safe-area-inset-right, 0px), var(--tg-content-safe-area-inset-right, 0px), var(--tg-safe-area-inset-right, 0px));
}
* { box-sizing: border-box; }
body { margin: 0; overflow: hidden; }
main { position: relative; height: var(--app-height, 100svh); height: var(--app-height, 100dvh); overflow: hidden; }
[hidden] { display: none !important; }
button, select { font: inherit; color: #d1e5ed; background: #071723; border: 1px solid var(--line); border-radius: 4px; }
button { min-width: 44px; min-height: 44px; padding: 8px 12px; cursor: pointer; }
button:disabled { color: #66808f; background: #07131d; border-color: #243b49; cursor: default; }
button:focus-visible, select:focus-visible { outline: 2px solid #a8dce8; outline-offset: 2px; }
button img { width: 21px; height: 21px; pointer-events: none; }
.scene, #map { position: absolute; inset: 0; width: 100%; height: 100%; }
#map { display: block; touch-action: none; }
#galaxy-map { position:absolute; inset:0; width:100%; height:100%; touch-action:none; }
.map-switch { flex:none; display:flex; }
.map-switch button { width:48px; min-height:44px; padding:3px 0; font-size:9px; background:#04101be8; }
.map-switch button[aria-pressed="true"] { color:#72d6e9; border-color:#5691a2; }
#jump-mode { min-height:44px; max-width:136px; font-size:11px; }
#route-hyperfuel { display:block; }
#plot-jump { grid-column:1 / -1; }
.selection-card[data-compact="true"] #plot-jump { position:absolute;right:44px;top:2px;width:44px;height:44px;padding:0;font-size:0; }
.selection-card[data-compact="true"] #plot-jump::before { content:"↗";font-size:20px; }
.system-hud { position: absolute; top: calc(var(--safe-top) + 8px); left: calc(var(--safe-left) + 8px); right: calc(var(--safe-right) + 8px); height: 68px; display: flex; align-items: center; gap: 10px; padding: 2px 8px; border: 8px solid transparent; border-image: url("assets/ui/frame_panel.svg?v=bp472-art-v1") 18 fill / 8px stretch; }
.ship-badge { width: 29px; height: 43px; object-fit: contain; flex: none; }
.identity { min-width: 0; flex: 1; }
.eyebrow { font-size: 8px; letter-spacing: .13em; color: #85a8ba; }
.system-hud h1 { margin: 1px 0; font-size: 21px; line-height: 23px; font-weight: 600; letter-spacing: .02em; -webkit-line-clamp: 1; }
.system-hud p { margin: 0; font-size: 12px; line-height: 15px; color: #99bfcc; }
.system-hud h1, .system-hud p, .selection-card h2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.system-hud h1, .system-hud p { -webkit-line-clamp: 1; }
.status { flex: none; max-width: 34%; font-size: 12px; text-align: right; }
#navigation { display: inline-block; padding: 7px 8px; border: 1px solid #345161; border-radius: 4px; color: #c7d5da; }
#navigation::before { content: ""; display: inline-block; width: 5px; height: 5px; margin-right: 6px; vertical-align: 1px; border-radius: 50%; background: #c4a75c; }
#connection { display: block; margin-top: 5px; color: #c8b58e; overflow-wrap: anywhere; }
#connection:empty { display: none; }
.resource-hud { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 calc(var(--safe-right) + 8px) calc(var(--safe-bottom) + 4px) calc(var(--safe-left) + 8px); }
.resource-strip { display: flex; align-items: center; gap: 14px; height: 60px; padding: 1px 8px; border: 8px solid transparent; border-image: url("assets/ui/frame_panel.svg?v=bp472-art-v1") 18 fill / 8px stretch; }
.resource { display: grid; grid-template-columns: 15px auto; gap: 2px 5px; min-width: 0; }
.resource + .resource { padding-left: 12px; background: url("assets/ui/divider_metal.svg?v=bp472-art-v1") no-repeat left center / 8px 36px; }
.resource img { width: 15px; height: 19px; opacity: .9; align-self: center; }
.resource span { font-size: 9px; color: #8bbed0; white-space: nowrap; }
.resource strong { grid-column: 1 / -1; font-size: 17px; font-weight: 550; font-variant-numeric: tabular-nums; }
#stop { margin-left: auto; min-width: 64px; height: 44px; padding: 4px 8px; font-size: 12px; }
#stop:not(:disabled) { color: #edb5ab; border-color: #915350; background: #33191c; }
.screen-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; margin-top: 4px; }
.screen-tabs button, .active-tab { min-width: 0; height: 46px; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 1px 0; font-size: 9px; letter-spacing: .05em; border: 6px solid transparent; border-image: url("assets/ui/frame_tab_disabled.svg?v=bp472-art-v1") 18 fill / 6px stretch; border-radius: 0; background: transparent; }
.screen-tabs img { width: 13px; height: 13px; }
.screen-tabs button img { opacity: .35; }
.active-tab { color: #93dbe6; border-image-source: url("assets/ui/frame_tab_active.svg?v=bp472-art-v1"); }
.map-controls { position: absolute; right: calc(var(--safe-right) + 12px); bottom: calc(var(--safe-bottom) + var(--hud-bottom-height) + 16px); display: flex; flex-direction: column; gap: 8px; }
.map-controls button, .objects-toggle { border: 6px solid transparent; border-image: url("assets/ui/frame_button.svg?v=bp472-art-v1") 18 fill / 6px stretch; border-radius: 0; background: transparent; }
.map-controls button { width: 44px; height: 44px; padding: 5px; }
.objects-toggle { position: absolute; left: calc(var(--safe-left) + 12px); bottom: calc(var(--safe-bottom) + var(--hud-bottom-height) + 16px); display: flex; align-items: center; gap: 6px; padding: 4px 7px; font-size: 11px; }
.objects-panel, .selection-card { position: absolute; left: calc(var(--safe-left) + 12px); right: calc(var(--safe-right) + 68px); bottom: calc(var(--safe-bottom) + var(--hud-bottom-height) + 72px); max-width: 350px; border: 8px solid transparent; border-image: url("assets/ui/frame_card.svg?v=bp472-art-v1") 18 fill / 8px stretch; border-radius: 0; overflow: hidden; }
.objects-panel { display: flex; flex-direction: column; padding: 2px 5px 5px; max-block-size: min(33dvh, 200px); overflow: clip; }
/* The header never shrinks or scrolls; only the bounded list owns scrolling. */
.objects-panel h2 { flex: none; font-size: 11px; font-weight: 500; color: #9ac9d7; height: 44px; padding-right: 40px; margin: 0; }
#object-select { display: grid; flex: 0 1 auto; min-height: 0; gap: 3px; max-height: 132px; overflow-y: auto; overflow-x: hidden; }
#object-select button { width: 100%; text-align: left; font-size: 12px; min-height: 44px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selection-card { height: 116px; max-block-size: min(35dvh, 15rem); padding: 1px 36px 4px 72px; }
.selection-art { position: absolute; width: 60px; height: 68px; object-fit: contain; left: 5px; top: 16px; }
.selection-card h2 { margin: 3px 0 4px; font-size: 17px; line-height: 20px; font-weight: 500; }
.selection-card p { margin: 4px 0 0; font-size: 10px; line-height: 1.5; color: #a9c1cf; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#selection-close, #objects-close { position: absolute; right: 0; top: 0; width: 44px; height: 44px; padding: 6px; border: 5px solid transparent; border-image: url("assets/ui/frame_button.svg?v=bp472-art-v1") 18 fill / 5px stretch; background: transparent; }
/* Measure resolved host/env insets, not the unresolved CSS max() expression. */
#selection-safe-viewport { position: fixed; top: calc(var(--safe-top) + 8px); bottom: calc(var(--safe-bottom) + 8px); left: calc(var(--safe-left) + 8px); right: calc(var(--safe-right) + 8px); visibility: hidden; pointer-events: none; }
.selection-card[data-compact="true"] { position: fixed; top: calc(var(--safe-top) + 8px); bottom: auto; left: calc(var(--safe-left) + 8px); right: calc(var(--safe-right) + 8px); height: 48px; max-block-size: 48px; padding: 12px 48px 12px 8px; z-index: 1; }
.selection-card[data-compact="true"] h2 { display: block; margin: 0; line-height: 22px; white-space: nowrap; text-overflow: ellipsis; }
.selection-card[data-compact="true"] p, .selection-card[data-compact="true"] .eyebrow, .selection-card[data-compact="true"] .selection-art { display: none; }
.selection-card[data-compact="true"] { border-width: 0; }
.selection-card[data-compact="true"] #selection-close { width: 44px; height: 44px; min-height: 44px; padding: 10px; }
.transit { position: absolute; left: 25px; right: 25px; top: 43%; text-align: center; }
.transit h2 { font-size: 20px; font-weight: 400; }
.transit p { font-size: 12px; color: #8e9ca9; }
.welcome { position: absolute; top: 34%; left: 16px; right: 16px; text-align: center; }
.welcome h1 { font-size: 25px; font-weight: 500; letter-spacing: .18em; }
.welcome p { font-size: 12px; color: #8595a4; }
#message { position: absolute; left: 20px; right: 20px; top: 53%; margin: 0; text-align: center; font-size: 13px; line-height: 1.5; color: #b6c4cf; pointer-events: none; }
#message:empty { display: none; }
#ship-state:not([hidden]) ~ #message { top: calc(var(--safe-top) + 110px); font-size: 10px; background: #04101ce0; }
.retry { position: absolute; left: 50%; top: 62%; transform: translateX(-50%); font-size: 12px; }
.layout-warning { position: absolute; left: 16px; right: 16px; top: 43%; margin: 0; padding: 10px; text-align: center; font-size: 12px; line-height: 1.5; color: #b6c4cf; background: #080f19ed; pointer-events: none; }
#map[aria-disabled="true"] { pointer-events: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (min-width: 700px) { .system-hud { max-width: 660px; } .resource-strip { gap: 26px; } }
@media (max-height: 450px) { .system-hud .eyebrow { display: none; } :root { --hud-bottom-height: 96px; } .system-hud { height: 58px; padding: 1px 7px; gap: 8px; } .system-hud h1 { font-size: 18px; line-height: 20px; } .system-hud p { font-size: 10px; line-height: 12px; } .ship-badge { height: 30px; width: 26px; } .resource-strip { height: 48px; padding: 0 8px; } .resource strong { font-size: 13px; } .screen-tabs button, .active-tab { height: 44px; } .screen-tabs img { display: none; } }
@media (max-width: 340px) { .system-hud { gap: 7px; padding: 1px 5px; } .ship-badge { width: 23px; } .system-hud h1 { font-size: 20px; } .eyebrow { font-size: 7px; } .status { max-width: 34%; font-size: 12px; } .resource-strip { gap: 10px; padding-inline: 5px; } .screen-tabs img { display: none; } .selection-card { padding-left: 56px; } .selection-art { width: 45px; } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; } }
/* Temporary planning overlay: the measured scene/camera remains unchanged. */
.selection-card:has(#plot-route:not([hidden])) { height: 160px; max-block-size: min(45dvh, 160px); }
#plot-route { font-size: 11px; min-height: 44px; padding: 4px 7px; }
.selection-card[data-compact="true"]:has(#plot-route:not([hidden])) { padding-right: 92px; height: 48px; max-block-size: 48px; }
.selection-card[data-compact="true"] #plot-route { position: absolute; right: 44px; top: 2px; width: 44px; height: 44px; min-height: 44px; padding: 0; font-size: 0; }
.selection-card[data-compact="true"] #plot-route::before { content: "↗"; font-size: 20px; }
.route-panel { position: fixed; z-index: 2; left: calc(var(--safe-left) + 12px); bottom: calc(var(--safe-bottom) + var(--hud-bottom-height) + 72px); width: min(340px, calc(100vw - var(--safe-left) - var(--safe-right) - 80px)); max-height: min(42dvh, 280px); display: flex; flex-direction: column; padding: 5px 8px; background: #06121ef5; border: 1px solid #456477; border-radius: 5px; font-size: 11px; }
.route-panel header { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; flex: none; }
#route-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#route-close { padding: 2px; font-size: 22px; flex: none; }
.route-content { overflow-y: auto; overflow-x: hidden; min-height: 0; touch-action: pan-y; overscroll-behavior: contain; }
.route-content p { margin: 5px 0; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-line; }
#route-warning { color: #d8b77c; flex: none; margin: 5px 0; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-line; }
#route-warning:empty { display: none; }
#route-facts { flex: none; margin: 2px 0; line-height: 1.3; overflow-wrap: anywhere; }
#route-destination { display: block; }
.route-panel[data-warning-compact="true"] .route-content { display: none; }
.estimate-note { color: #859ca9; font-size: 10px; }
#waypoint-form { display: flex; align-items: center; gap: 4px; }
#waypoint-form label { min-width: 0; flex: 1; }
#waypoint-form input { width: 100%; min-height: 44px; background: #061521; border: 1px solid #345365; color: #dcebf1; padding: 3px; font: inherit; }
#waypoint-preview { font-size: 10px; padding: 3px; }
.route-buttons { display: flex; gap: 4px; flex: none; flex-wrap: wrap; }
.route-buttons button { flex: 1; padding: 4px; font-size: 11px; }
#route-confirm:not(:disabled) { border-color: #71adbb; color: #b0f0f3; }
#course[aria-pressed="true"] { color: #dfbd7b; }
.course-control { flex: none; display: flex; flex-direction: column; justify-content: center; align-items: center; width: 44px; height: 44px; padding: 1px; font-size: 18px; line-height: 17px; border: 5px solid transparent; border-image: url("assets/ui/frame_button.svg?v=bp472-art-v1") 18 fill / 5px stretch; background: transparent; }
.course-label { font-size: 8px; line-height: 10px; }
#route-eta { display: block; color: #91afbd; margin-top: 2px; font-size: 10px; }
#route-eta:empty { display: none; }
@media (max-width: 340px) and (min-height: 451px) { .route-panel { max-height: 170px; } }
@media (max-height: 450px) { .route-panel { left: calc(var(--safe-left) + 124px); bottom: calc(var(--safe-bottom) + 100px); max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 174px); width: min(220px, calc(100vw - var(--safe-left) - var(--safe-right) - 192px)); } }
.route-panel[data-jump="true"] { max-height:min(55dvh,320px); }
.route-panel[data-jump="true"][data-warning-compact="true"] { padding:3px 6px; }
.route-panel[data-jump="true"][data-warning-compact="true"] #route-facts { display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:1px 4px;line-height:1.25;margin:1px 0; }
.route-panel[data-jump="true"][data-warning-compact="true"] .quote-separator { display:none; }
.route-panel[data-jump="true"][data-warning-compact="true"] #route-warning { font-size:10px;line-height:1.25;margin:3px 0; }
#route-eta { overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.selection-card:has(#plot-jump:not([hidden])) { height:160px;max-block-size:min(45dvh,160px);padding-left:12px; }
.selection-card[data-compact="true"]:has(#plot-jump:not([hidden])) { height:48px;max-block-size:48px;padding-right:92px; }
@media (max-height:450px) {
 .route-panel[data-jump="true"] { width:min(340px,calc(100vw - var(--safe-left) - var(--safe-right) - 192px));max-height:calc(100dvh - var(--safe-top) - var(--safe-bottom) - 154px); }
}


/* UX-B: map-first bottom sheet. Accessible contact chooser remains keyboard focusable. */
.contacts-toggle.sr-only { position:absolute; left:calc(var(--safe-left) + 2px);
  bottom:calc(var(--safe-bottom) + var(--hud-bottom-height) + 6px);
  width:1px; height:1px; min-width:1px; min-height:1px; overflow:hidden;
  clip-path:inset(50%); padding:0; border:0; white-space:nowrap; }
.contacts-toggle.sr-only:focus-visible { width:160px; height:44px; min-height:44px;
  clip-path:none; overflow:visible; z-index:5; padding:8px;
  background:#061724; border:1px solid #7ad4e7; }
#contacts-access { flex:none; padding:3px 0; }
#contacts-access summary { cursor:pointer; min-height:44px; display:flex; align-items:center;
  color:#9fc7d4; font-size:12px; }
#contacts-access:not([open]) #contacts-list { display:none; }
.contacts-panel { left:calc(var(--safe-left) + 8px) !important;
  right:calc(var(--safe-right) + 8px) !important; width:auto !important;
  max-width:640px; margin:0 auto; bottom:calc(var(--safe-bottom) + var(--hud-bottom-height) + 8px) !important;
  max-height:min(64dvh,560px) !important; }
.contacts-panel:has(#contacts-deep:not(:empty)) { max-height:min(70dvh,620px) !important; }
#contacts-detail { flex:1 1 auto; overflow-y:auto; overscroll-behavior:contain; }
#contacts-title { font-size:15px !important; }

/* BP-5.3 contact overlay: no simulation or authoritative coordinates in CSS. */
.contacts-toggle { position:absolute; left:calc(var(--safe-left) + 12px);
  bottom:calc(var(--safe-bottom) + var(--hud-bottom-height) + 68px); padding:4px 9px;
  min-height:44px; font-size:11px; border:1px solid #4a8091; background:#061724eb; z-index:1; }
.contacts-toggle[aria-expanded="true"] { border-color:#7ad4e7; }
.contacts-panel { position:absolute; z-index:3;
  left:calc(var(--safe-left) + 12px);
  bottom:calc(var(--safe-bottom) + var(--hud-bottom-height) + 123px);
  width:min(340px,calc(100vw - var(--safe-left) - var(--safe-right) - 24px));
  max-height:min(48dvh,360px); display:flex; flex-direction:column;
  padding:8px; border:1px solid #4c7283; border-radius:5px; background:#051420f5;
  font-size:11px; overflow:hidden; }
.contacts-panel h2 { margin:0 44px 5px 0; height:34px; flex:none; font-size:13px; color:#9acee0; }
#contacts-close { position:absolute; top:0; right:0; min-width:44px; min-height:44px; }
#contacts-list { display:grid; gap:3px; overflow-y:auto; min-height:0;
  max-height:110px; flex:0 1 auto; }
#contacts-list button { min-height:44px; width:100%; padding:5px 8px; text-align:left; font-size:11px; }
#contacts-list button[aria-pressed="true"] { border-color:#85d9ea; color:#e3f9fd; }
#contacts-detail { flex:0 1 auto; min-height:0; overflow-y:auto; margin-top:6px; border-top:1px solid #33505c;
  padding-top:6px; overscroll-behavior:contain; }
#contacts-detail strong { font-size:12px; }
#contacts-detail p { white-space:pre-line; line-height:1.45; color:#b9d0da; margin:4px 0;
  overflow-wrap:anywhere; }
/* Gate 5: scan evidence uses short, labeled, independently stale groups. */
#contacts-deep { border-top:1px solid #345264; padding-top:8px; margin:7px 0; }
#contacts-deep h3 { margin:0 0 6px; color:#bde8f0; font-size:12px; font-weight:650; }
#contacts-deep .deep-note { color:#e0bd83; margin:0 0 7px; }
#contacts-deep .deep-group { padding:6px 8px; margin:6px 0; background:#0a2231a8; border-left:2px solid #386b83; border-radius:3px; }
#contacts-deep .deep-group h4 { margin:0 0 4px; font-size:11px; color:#92d7e6; }
#contacts-deep .deep-group ul { padding-left:16px; margin:0; color:#c6dce4; overflow-wrap:anywhere; }
#contacts-deep .deep-group li { margin:3px 0; line-height:1.4; }
#contacts-deep .deep-stale { opacity:.82; border-left-style:dashed; border-left-color:#c3a575; }
#contacts-deep .deep-stale-note { color:#dec18a; font-size:10px; margin:0 0 4px; }
#contacts-feedback { color:#ddb77e !important; }
.contacts-buttons { display:flex; gap:6px; flex-wrap:wrap; }
.contacts-buttons button { flex:1 1 120px; font-size:11px; min-height:44px; padding:5px; }
[hidden] { display:none !important; }

/* UX-B Deep Scan: a neutral schematic, never real equipment placement. */
.deep-ship-schematic { display:flex; min-height:118px; flex-direction:column; align-items:center;
  justify-content:center; gap:6px; padding:8px; margin:7px 0;
  border:1px solid #355a6d; background:linear-gradient(155deg,#0d2837,#07121d); }
.deep-ship-hull { display:block; width:76px; height:72px; background:linear-gradient(#a7bac2,#546c7d);
  clip-path:polygon(50% 0%,67% 38%,90% 80%,66% 72%,50% 98%,34% 72%,10% 80%,33% 38%);
  filter:drop-shadow(0 0 5px #559daf); }
.deep-ship-schematic small { color:#93b3c1; text-align:center; font-size:10px; }
.deep-inspector-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
.deep-inspector-tabs button { min-height:44px; padding:8px 4px; font-size:12px; overflow-wrap:anywhere; }
.deep-inspector-tabs button[aria-pressed="true"] { border-color:#89d7e6; background:#16425a; }
.deep-inspector-section { padding:4px 0; min-height:44px; }
.deep-inspector-section>p { color:#a9c5d2; font-size:12px; }
#contacts-detail { min-height:0; overflow:auto; }
.contacts-panel:has(#contacts-deep:not([hidden])) { max-height:min(70dvh,620px) !important; }

/* UX-A01/A02: single-line object card plus mandatory server confirmation. */
.selection-card:has(#plot-route:not([hidden])) { height:78px; max-block-size:78px;
  padding:8px 76px 5px 49px; }
.selection-card:has(#plot-route:not([hidden])) .selection-art { left:4px; top:13px; width:40px; height:44px; }
.selection-card:has(#plot-route:not([hidden])) h2 { font-size:14px; line-height:22px; margin:10px 0 0; }
.selection-card:has(#plot-route:not([hidden])) #plot-route {
  position:absolute; right:44px; top:12px; width:44px; height:44px;
  min-height:44px; padding:2px; font-size:0; }
.selection-card:has(#plot-route:not([hidden])) #plot-route::before {
  content:"↗"; font-size:20px; }
.selection-card[data-compact="true"]:has(#plot-route:not([hidden])) {
  height:48px; max-block-size:48px; padding:7px 92px 7px 8px; }
.selection-card[data-compact="true"]:has(#plot-route:not([hidden])) #plot-route { top:2px; }

/* UX-A04: coordinate entry is accessible only through the Objects fallback. */
.objects-panel:has(.accessible-waypoint) { max-block-size:min(54dvh,350px); overflow-y:auto; }
.accessible-waypoint summary { min-height:44px; display:flex; align-items:center; padding:6px; font-size:12px; }
.accessible-waypoint #waypoint-form { display:flex; flex-wrap:wrap; padding:6px; gap:6px; }
.accessible-waypoint #waypoint-form input { min-width:68px; }


/* UX-A compact direct-flight quote: object/waypoint -> one server-confirmed card. */
/* The previous object detail popup is not part of the flight flow. */
#selection-card { display: none !important; }

.route-panel {
  width: min(364px, calc(100vw - var(--safe-left) - var(--safe-right) - 80px));
  max-height: min(45dvh, 220px);
  padding: 11px 12px 10px;
  gap: 6px;
  font-size: 12px;
}
.route-panel header { min-height: 0; }
.route-panel header:has(#route-title[hidden]):has(#jump-mode[hidden]) { display: none; }
#route-title { font-size: 15px; }
#route-close { display: none !important; }
.route-content { overflow-y: auto; min-height: 0; }
.route-content p { margin: 2px 0; }
#route-facts {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 5px 10px;
  line-height: 1.35;
  font-size: 12px;
}
#route-destination {
  display: block;
  grid-column: 1 / -1;
  font-size: 16px;
  font-weight: 600;
  color: #dcebf1;
}
#route-duration, #route-fuel {
  display: block;
  font-size: 12px;
  color: #acc8d4;
  font-variant-numeric: tabular-nums;
}
#route-hyperfuel { display: block; grid-column: 1 / -1; color: #acc8d4; }
.route-panel .quote-separator, .route-panel .estimate-note { display: none; }
#route-warning { font-size: 11px; line-height: 1.35; margin: 0; }
.route-buttons { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px; }
.route-buttons button { min-height: 44px; font-size: 12px; }
.route-panel[data-jump="true"] { max-height: min(50dvh, 240px); }
.route-panel[data-jump="true"][data-warning-compact="true"] #route-facts {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 5px 10px;
  line-height: 1.35;
  margin: 0;
}
@media (max-width: 340px) {
  .route-panel { padding: 8px; font-size: 11px; }
  #route-facts { gap: 4px; }
  #route-destination { font-size: 14px; }
  #route-duration, #route-fuel { font-size: 11px; }
}
@media (max-height: 450px) {
  .route-panel { max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 165px); }
}


/* UX-B contact cockpit: compact, readable on 320px/Telegram safe-area screens. */
.contacts-panel { max-height:min(71dvh,620px) !important; }
#contacts-info:empty, #contacts-intelligence:empty, #contacts-feedback:empty {display:none;}
.contacts-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; margin-top:8px; }
.contacts-actions>button, .contacts-scan-options button { min-height:44px; padding:6px; font-size:12px; }
#contacts-scan-toggle, #contacts-invite, .contacts-scan-options { grid-column:1/-1; }
.contacts-scan-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
.contacts-actions button:disabled { opacity:.38; cursor:not-allowed; }
.scan-progress { display:grid; gap:6px; padding:8px 0; font-size:12px; color:#a9dfe9; }
.scan-progress progress { width:100%; height:9px; accent-color:#64c6db; border-radius:9px; }
#contacts-deep .deep-ship-schematic {
  min-height:242px; position:relative; margin:7px 0;
  background:radial-gradient(ellipse at 50% 44%,#17405288,#061725 70%);
}
#contacts-deep .deep-ship-hull {
  width:104px; height:162px; position:absolute; left:50%; top:28px;
  transform:translateX(-50%);
  background:linear-gradient(115deg,#6e93a5,#2c5065 48%,#88adbc);
  opacity:.78; box-shadow:0 0 18px #356c91;
}
.deep-ship-schematic .deep-system-hotspot {
  position:absolute; z-index:1; min-width:58px; min-height:40px;
  padding:4px 6px; border-radius:18px; font-size:10px;
  color:#d6f2fc; background:#0c3344ee; border:1px solid #5b95ab;
}
.deep-system-hotspot[aria-pressed="true"] { background:#206887; border-color:#a9f0f5; box-shadow:0 0 8px #57bfe5; }
.deep-hotspot-sensor {top:5px;left:50%;transform:translateX(-50%);}
.deep-hotspot-weapons {top:46px;left:5%;}
.deep-hotspot-shield {top:46px;right:5%;}
.deep-hotspot-cargo {top:94px;left:5%;}
.deep-hotspot-extras {top:94px;right:5%;}
.deep-hotspot-engine {bottom:40px;left:5%;}
.deep-hotspot-fuel {bottom:40px;right:5%;}
.deep-hotspot-navigation {bottom:80px;left:50%;transform:translateX(-50%);}
#contacts-deep .deep-ship-schematic small {
 position:absolute; bottom:4px; left:8px; right:8px;
 font-size:9px; z-index:1;
}
.deep-inspector-section h4 { font-size:12px; color:#a6e5f3; margin:5px 0; }
.deep-inspector-section .deep-group { margin:4px 0; }

/* Gate 6 — actions integrated with the UX-B radar card */
.contacts-combat {
  margin-top: 8px;
  padding: 8px 0;
  border-top: 1px solid #375569;
}
#contacts-combat-title {
  font-size: 11px;
  color: #e4be8d;
  line-height: 1.4;
}
.contacts-combat .contacts-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.contacts-combat .contacts-buttons button {
  min-height: 44px;
  padding: 6px;
  font-size: 11px;
}
#contacts-betray, #contacts-betray-confirm {
  grid-column: 1 / -1;
  color: #f0ad9b;
  border-color: #985148;
}

#contacts-attack-confirm { color:#f0ad9b; border-color:#985148; }
