/* Navigation has its own full-screen surface; the tactical map stays separate. */
.sw48-system-controls {display:flex;flex-direction:row;align-items:stretch;flex-shrink:0;}
#status #sw48-hyperspace-toggle {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;max-width:8rem;font-size:13px;text-align:center;white-space:normal;}
#sw48-hyperspace-toggle img {width:32px;height:32px;object-fit:contain;pointer-events:none;}
#sw48-hyperspace-toggle:focus-visible {outline:1px solid #94dbe9;outline-offset:-2px;}

#sw48-hyperspace-map {position:fixed;inset:0;z-index:10020;box-sizing:border-box;width:100%;height:100dvh;display:flex;flex-direction:column;overflow:hidden;outline:none;background:radial-gradient(ellipse at 65% 40%,#122430 0%,#080e18 70%);color:#c4d2dd;font:14px/1.5 Arial,sans-serif;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);animation:hyperspace-enter .18s ease-out;}
#sw48-hyperspace-map * {box-sizing:border-box;}
#sw48-hyperspace-map header {display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 28px;border-bottom:1px solid #344652;flex-shrink:0;}
#sw48-hyperspace-map header>div {display:flex;align-items:center;gap:18px;}
#sw48-hyperspace-map h1 {margin:0;font-size:22px;font-weight:500;letter-spacing:2px;color:#e0eef4;}
#sw48-hyperspace-map .hyperspace-preview {font-size:12px;color:#8cabb9;border-left:1px solid #45606d;padding-left:18px;}
#sw48-hyperspace-map button {border:1px solid #3d5665;border-radius:2px;box-shadow:none;background:#172632;color:#cce3ee;font:inherit;cursor:pointer;}
#sw48-hyperspace-map button:hover {background:#223d4c;border-color:#82b6c6;}
#sw48-hyperspace-map button:focus-visible {outline:2px solid #8fd3df;outline-offset:2px;}
#sw48-hyperspace-map .hyperspace-close {border:0;background:transparent;font-size:30px;line-height:1;width:44px;height:44px;flex-shrink:0;}
#sw48-hyperspace-map .hyperspace-body {display:flex;flex:1;min-height:0;}
#sw48-hyperspace-map .hyperspace-information {width:290px;flex-shrink:0;overflow:auto;overscroll-behavior:contain;padding:24px;border-right:1px solid #293a47;background:#09121bc9;scrollbar-width:thin;scrollbar-color:#567586 transparent;}
#sw48-hyperspace-map .hyperspace-current-ship {display:flex;align-items:center;gap:14px;margin-bottom:24px;}
#sw48-hyperspace-map .hyperspace-current-ship img {width:80px;height:60px;object-fit:contain;}
#sw48-hyperspace-map .hyperspace-current-ship strong {display:block;font-size:16px;line-height:1.3;color:#e4edf2;}
#sw48-hyperspace-map .hyperspace-current-ship span {display:block;font-size:12px;color:#849ba9;margin-top:5px;}
#sw48-hyperspace-map .hyperspace-destination {display:flex;flex-direction:column;gap:6px;font-size:13px;min-height:140px;}
#sw48-hyperspace-map .within-range {color:#8ee0d1;}
#sw48-hyperspace-map .outside-range {color:#e7b09e;}
#sw48-hyperspace-map .hyperspace-map-area {min-width:0;min-height:0;flex:1;display:flex;flex-direction:column;padding:16px 24px;}
#sw48-hyperspace-map .hyperspace-chart {position:relative;container-type:size;flex:1;min-height:0;}
#sw48-hyperspace-map .hyperspace-surface {position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:min(100cqw,100cqh);height:min(100cqw,100cqh);touch-action:none;cursor:crosshair;}
#sw48-hyperspace-map svg {display:block;width:100%;height:100%;overflow:visible;user-select:none;}
#sw48-hyperspace-map .hyperspace-world {fill:#0a1924;}
#sw48-hyperspace-map .hyperspace-world-border {fill:none;stroke:#607d8c;stroke-width:.35;pointer-events:none;}
#sw48-hyperspace-map .hyperspace-envelope {fill:#69dce2;fill-opacity:.065;stroke:#83dfe6;stroke-width:.5;stroke-dasharray:1.4 1;pointer-events:none;}
#sw48-hyperspace-map .hyperspace-station {stroke:#a7bbca;stroke-width:.35;pointer-events:none;}
#sw48-hyperspace-map .hyperspace-route {fill:none;stroke-width:.4;pointer-events:none;}
#sw48-hyperspace-map .hyperspace-route.reachable {stroke:#9ae9de;}
#sw48-hyperspace-map .hyperspace-route.unreachable {stroke:#e3a58f;stroke-dasharray:1.4 .8;}
#sw48-hyperspace-map #hyperspace-player {fill:#eefcff;stroke:#0c2639;stroke-width:.35;pointer-events:none;}
#sw48-hyperspace-map .hyperspace-cardinals {fill:#7f9ba9;font:3px Arial;text-anchor:middle;pointer-events:none;}
#sw48-hyperspace-map .hyperspace-legend {display:flex;flex-wrap:wrap;justify-content:center;gap:4px 24px;color:#7893a3;font-size:12px;flex-shrink:0;}
#sw48-hyperspace-map .hyperspace-legend>span:first-child {color:#8bd4dc;}
#sw48-hyperspace-map footer {flex-shrink:0;border-top:1px solid #2d3e4b;padding:10px 24px;text-align:center;color:#859bab;font-size:12px;}
@keyframes hyperspace-enter {from {opacity:0;}to {opacity:1;}}
@media(max-width:700px), (max-width:1100px) and (max-height:600px) and (pointer:coarse) {
 body.sw48-ui #status .sw48-system-controls {width:min(160px,45vw);max-width:100%;}
 body.sw48-ui #status .sw48-system-controls>.sw48-system-button {min-width:0;min-height:44px;flex:1;max-width:50%;padding:5px !important;font-size:11px;line-height:1.2;overflow-wrap:anywhere;}
 body.sw48-ui #status .sw48-system-controls.sw48-single-system {width:auto;}
 body.sw48-ui #status .sw48-single-system>.sw48-system-button {max-width:100%;min-width:5rem;}
 #status #sw48-hyperspace-toggle img {width:26px;height:26px;}
 #sw48-hyperspace-map header {padding:5px 12px;gap:8px;}
 #sw48-hyperspace-map h1 {font-size:17px;letter-spacing:1px;}
 #sw48-hyperspace-map .hyperspace-preview {font-size:10px;padding-left:10px;}
 #sw48-hyperspace-map header>div {gap:10px;}
 #sw48-hyperspace-map .hyperspace-information {width:210px;padding:12px;}
 #sw48-hyperspace-map .hyperspace-current-ship {gap:8px;margin-bottom:10px;}
 #sw48-hyperspace-map .hyperspace-current-ship img {width:54px;height:40px;}
 #sw48-hyperspace-map .hyperspace-current-ship strong {font-size:13px;}
 #sw48-hyperspace-map .hyperspace-current-ship span {font-size:10px;}
 #sw48-hyperspace-map .hyperspace-destination {font-size:12px;min-height:90px;gap:2px;}
 #sw48-hyperspace-map .hyperspace-map-area {padding:6px 10px;}
 #sw48-hyperspace-map .hyperspace-legend {font-size:10px;gap:0 12px;}
 #sw48-hyperspace-map .map-sector text {font-size:7px;}
 #sw48-hyperspace-map .hyperspace-cardinals {font-size:5px;}
 #sw48-hyperspace-map footer {padding:5px 10px;font-size:10px;}
}
@media(max-width:700px) and (orientation:portrait) {
 #sw48-hyperspace-map .hyperspace-body {flex-direction:column;}
 #sw48-hyperspace-map .hyperspace-information {width:100%;max-height:43%;display:grid;grid-template-columns:1fr 1fr;gap:8px 12px;flex-shrink:0;border-right:0;border-bottom:1px solid #293a47;padding:10px 12px;}
 #sw48-hyperspace-map .hyperspace-current-ship {margin:0;grid-column:1;}
 #sw48-hyperspace-map .hyperspace-destination {min-height:0;grid-column:1/-1;}
 #sw48-hyperspace-map .hyperspace-map-area {padding:5px 10px;}
 #sw48-hyperspace-map .hyperspace-legend {flex-direction:column;text-align:center;}
}
@media(prefers-reduced-motion:reduce) {#sw48-hyperspace-map {animation:none;}}

#sw48-hyperspace-map footer {display:flex;align-items:center;justify-content:space-between;gap:16px;text-align:left;}
#sw48-hyperspace-map #hyperspace-engage {flex-shrink:0;padding:12px 26px;min-height:44px;color:#d9f5ff;background:#173c4b;border-color:#6bafc2;font-size:15px;}
#sw48-hyperspace-map #hyperspace-engage:disabled {opacity:.4;cursor:default;background:#18232c;}
#sw48-hyperspace-flight {position:fixed;inset:0;z-index:20000;touch-action:none;user-select:none;cursor:default;isolation:isolate;}
body:has(#sw48-hyperspace-flight) #sw48-match-chat {z-index:20001;}
#hyperspace-countdown {position:absolute;left:max(12px,env(safe-area-inset-left));top:200px;width:238px;max-width:calc(100vw - 24px);box-sizing:border-box;display:grid;grid-template-columns:1fr auto;gap:6px 12px;padding:13px 16px;border-left:2px solid #a1dbe8;color:#d8ebf7;background:linear-gradient(105deg,#081a29e8,#08101bd4);font:14px/1.4 'Segoe UI','Microsoft YaHei',sans-serif;box-shadow:0 0 28px #172f5022;}
.hyperspace-phase {align-self:center;letter-spacing:.05em;}
#hyperspace-seconds {font:500 29px/1 'Bahnschrift',monospace;color:#ecfaff;font-variant-numeric:tabular-nums;}
#hyperspace-seconds small {font-size:12px;color:#8babbc;margin-left:4px;}
.hyperspace-progress {grid-column:1/-1;height:2px;background:#39516480;margin-top:4px;overflow:hidden;}
.hyperspace-progress i {display:block;height:100%;background:#a4e6ff;transition:width .12s linear;}
.hyperspace-flight-detail {grid-column:1/-1;color:#89a7bc;font-size:11px;}
.hyperspace-clearance {position:absolute;bottom:max(24px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);color:#b6cadc;font:13px/1.5 Arial,sans-serif;text-align:center;}
body:has(#sw48-hyperspace-flight) #sw48-settings-toggle,body:has(#sw48-hyperspace-flight) #rebuild-hover-hint {visibility:hidden !important;}
/* The vessel and tunnel share WebGL. Only the preparation phase keeps the HUD. */
body:has(#sw48-hyperspace-flight:not([data-phase="charging"])) :is(#sw48-minimap,#sw48-faction-hud,#status,#upgrade,.sw48-faction-details-toggle,#sw48-credits,#sw48-faction-entry) {visibility:hidden !important;}
@media(max-width:700px) {
 #hyperspace-countdown {width:190px;padding:9px 11px;font-size:12px;}
 #hyperspace-seconds {font-size:24px;}
 #sw48-hyperspace-map footer {gap:10px;padding:8px 12px;}
 #sw48-hyperspace-map #hyperspace-engage {padding:9px 14px;font-size:13px;}
 .hyperspace-message {font-size:11px;}
}
@media(prefers-reduced-motion:reduce) {
 #sw48-hyperspace-flight {animation:none !important;}
}
#sw48-hyperspace-toggle:not([data-cooldown="0"]) {color:#91a8b7;}
#sw48-hyperspace-toggle:not([data-cooldown="0"]) img {opacity:.5;filter:grayscale(.6);}

#sw48-hyperspace-map .hyperspace-arrival-area {fill:#98dce550;stroke-width:1.5px;vector-effect:non-scaling-stroke;}
#sw48-hyperspace-map :is(.hyperspace-message,.hyperspace-destination,.hyperspace-current-ship>div) {min-width:0;overflow-wrap:anywhere;}
#sw48-hyperspace-map footer {flex-shrink:0;}
#sw48-hyperspace-map footer>span {flex:1;}
#sw48-hyperspace-map #hyperspace-engage {white-space:normal;overflow-wrap:anywhere;max-width:52%;}
.hyperlane-modes {flex-wrap:wrap;}
.hyperlane-modes button {flex:1;min-width:0;white-space:normal;overflow-wrap:anywhere;}
