/* A small command deck leaves the ship and sector as the main surface. */
.crew-hud-actions{display:flex;flex-direction:column;align-items:flex-end;gap:6px;flex-shrink:0}
#crewHUD #crewFly{pointer-events:auto;min-height:44px;font-size:14px;background:#102236d9}
#crewHUD>div:first-child{min-width:0}
.crew-flight-strip button{overflow-wrap:anywhere;min-width:0}
#crewHUD,#crewDeck,#crewSheet,.crew-return{display:none}
.crew-mode #sim{height:100dvh;min-height:0;overflow:hidden}
.crew-mode #sim>header,.crew-mode .mission,.crew-mode .sensors,.crew-mode .target-console,.crew-mode .touch-helm,.crew-mode #flightConsole,.crew-mode .alert-banner,.crew-mode #reticle,.crew-mode #labels,.crew-mode #routeMarker{display:none!important}
.crew-mode .crew-return{display:none!important}
.crew-mode #space canvas{touch-action:none}
.crew-mode #crewHUD{display:flex;position:absolute;z-index:5;top:0;left:0;right:0;padding:calc(12px + env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) 22px max(16px,env(safe-area-inset-left));align-items:flex-start;justify-content:space-between;gap:12px;background:linear-gradient(#020812ed,transparent);pointer-events:none}
#crewHUD p{margin:3px 0;font-size:14px;color:#b8d9ec}#crewHUD strong{font-size:19px;font-weight:500;letter-spacing:.3px}#crewHUD #crewMore{pointer-events:auto;min-height:44px;font-size:14px;background:#102236d9}
.crew-mode #crewDeck{display:block;position:absolute;z-index:5;bottom:0;left:0;right:0;padding:24px max(12px,env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));background:linear-gradient(transparent,#030b17f5 25%)}
#crewIntent{font-size:15px;color:#a6ddf7;margin:0 0 4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#crewMessage{font-size:14px;line-height:1.35;margin:0 0 10px;color:#c4d0e0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.crew-flight-strip{display:grid;grid-template-columns:minmax(0,.75fr) minmax(0,.85fr) minmax(0,1fr) minmax(0,1.2fr);gap:7px;margin:8px 0 0}
.crew-flight-strip button{min-height:48px;padding:6px 8px;border-radius:11px;font-size:14px;line-height:1.05}
#crewTurbo{display:flex;align-items:center;justify-content:center;touch-action:none;user-select:none;border-color:#d98b70;background:#38251fdd;color:#ffe8dc}
#crewQuickAction{border-top-color:#7ed7bd}
.crew-target-strip{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:6px;margin-bottom:8px}
.crew-target-strip button{font-size:14px;min-height:44px;padding:5px 9px;border-radius:10px;background:#102638}
.crew-target-strip #crewSelected{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin:0;line-height:1.2}
.crew-flight-strip .crew-weapon{min-height:56px;background:#a65b29;color:#fff9ef;border-color:#ffbe75;touch-action:none;user-select:none;font-size:15px;padding:6px 4px}
.crew-flight-strip #crewTorpedo{background:#91473d;border-color:#ef9984}
.crew-weapon span{display:block;font-size:12px;line-height:1.25;margin-top:3px;color:#fff1d9;font-variant-numeric:tabular-nums}
.crew-weapon:active{filter:brightness(1.35)}
#crewNextTarget{border-color:#7dafcb55;background:#081625dc;color:#d9edff}
#crewHUD #crewImpulseReadout{color:#f2ec75;font-size:14px;font-weight:600;font-variant-numeric:tabular-nums;margin-top:5px}
#crewSelected{font-size:13px;color:#91cedf;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0 0 7px}
#crewTurbo[aria-pressed=true]{background:#963f31;border-color:#ffab8a;color:#fff}
#crewQuickStop{border-color:#b8a9e966;background:#24213ae0}
.crew-primary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
.crew-primary button{min-height:46px;padding:6px 3px;font-size:14px;line-height:1.2;border-radius:11px;background:#17263ce8;border:1px solid #88b3d050;border-top:3px solid #afc0e6}
#crewExplore{border-top-color:#81c9e2}#crewEngage{border-top-color:#efa86f}#crewHome{border-top-color:#bca2dd}#crewQuickApproach{border-top-color:#7ed7bd}
.crew-mode button[aria-pressed=true]{background:#294961;border-color:#9ddfff;color:#effbff}
.crew-mode #crewSheet{display:block;position:absolute;z-index:7;bottom:calc(var(--crew-deck-height,224px) + 6px);left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));max-height:calc(100dvh - var(--crew-deck-height,224px) - 90px - env(safe-area-inset-top) - env(safe-area-inset-bottom));overflow-y:auto;overscroll-behavior:contain;padding:15px;background:#0b192bf5;border:1px solid #6f9bbc;border-top:3px solid #a7b9e7;border-radius:16px;box-shadow:0 12px 35px #0009}
.crew-sheet-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}.crew-sheet-heading h2{font-size:20px;margin:0}.crew-sheet-heading button{min-height:44px;font-size:14px}
#crewSheet p{font-size:14px;line-height:1.45;margin:8px 0;color:#bed0e3}#crewSheet label{display:block;font-size:14px;margin:12px 0 6px}
#crewSheet button,#crewSheet select{font-size:16px;min-height:46px;white-space:normal}#crewSheet select{width:100%;max-width:100%}.crew-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.crew-full{width:100%;margin-top:8px}
.crew-contact-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}.crew-contact-actions button{margin:0}#crewTargetRange{font-variant-numeric:tabular-nums;color:#e2f4ff!important}#crewContactHint{font-size:13px!important;color:#9fb6c9!important}
.crew-mode dialog{max-height:calc(100dvh - 30px);padding:16px}.crew-mode dialog button,.crew-mode dialog select{min-height:44px;font-size:16px}
.crew-mode #transportPanel{top:85px;max-height:calc(100dvh - 260px);overflow:hidden;opacity:.9}.crew-mode #transportView{display:none}
@media (max-width:760px), (pointer:coarse) and (max-width:1100px){
 html:not(.crew-mode) .crew-return{display:block;position:fixed;z-index:9;top:max(8px,env(safe-area-inset-top));left:max(10px,env(safe-area-inset-left));min-height:44px;padding:8px 14px;border:1px solid #9bdcff;background:#173c58ef;color:#effaff;border-radius:12px;box-shadow:0 7px 22px #0008;font-weight:600}
 html:not(.crew-mode) header .identity{visibility:hidden}
}
@media(orientation:landscape) and (max-height:600px){
 .crew-mode #crewHUD{padding-top:max(8px,env(safe-area-inset-top));padding-bottom:8px}
 #crewHUD strong{font-size:17px}#crewCondition{display:none}
 .crew-mode #crewDeck{padding-top:10px;display:grid;grid-template-columns:minmax(120px,.7fr) minmax(380px,2fr);gap:5px 10px;align-items:center}
 #crewIntent{grid-column:1;grid-row:1;margin:0}#crewMessage{display:none}.crew-target-strip{grid-column:1;grid-row:2;margin:0;grid-template-columns:1fr 1fr}.crew-target-strip #crewSelected{display:none}.crew-flight-strip{grid-column:2;grid-row:2;margin:0;gap:5px}.crew-flight-strip button{min-height:48px;padding:5px;font-size:14px}.crew-primary{grid-column:2;grid-row:1}.crew-primary button{min-height:44px}
 .crew-mode #crewSheet{bottom:calc(var(--crew-deck-height,76px) + 6px);left:auto;width:min(470px,70vw);max-height:calc(100dvh - 145px - env(safe-area-inset-bottom))}
}

@media(max-width:360px){.crew-flight-strip .crew-weapon{font-size:14px}.crew-weapon span{font-size:12px}.crew-flight-strip{gap:5px}}

#crewHUD #crewCombatFocus{color:#ffc18e;font-size:13px;line-height:1.25;max-width:250px}
.crew-flight-strip .crew-weapon{height:56px;overflow:hidden}
#crewPhaserLabel{font-weight:inherit}
#crewPower[aria-pressed=true]{border-color:#ffbd7b;background:#493321;color:#ffe2a8}
