/* One control deck: two corner docks and a fixed bottom-centre View panel.
   The fill alpha affects glass only; command labels keep their full contrast. */
:root{--deck-width:min(312px,calc(25vw - 16px));--deck-edge:12px;--deck-glass:rgba(6,19,32,.17)}
.deck-glass{background:var(--deck-glass);border:1px solid #89b8ce70;border-radius:10px 4px 6px 4px;box-shadow:inset 0 1px 0 #d3f4ff26,0 4px 14px #0002;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);text-shadow:0 1px 2px #000,0 0 4px #000}
.control-deck{position:absolute;bottom:max(var(--deck-edge),env(safe-area-inset-bottom));left:var(--deck-edge);right:var(--deck-edge);height:0;z-index:4;pointer-events:none}
.deck-port{position:absolute;left:0;bottom:0;width:var(--deck-width);display:flex;flex-direction:column;gap:8px;pointer-events:auto}
.deck-helm,.deck-navigate{width:var(--deck-width);padding:4px 6px 3px;border-top:3px solid var(--lilac);min-height:56px}
.deck-heading{display:flex;align-items:center;justify-content:space-between;gap:5px;height:12px;line-height:12px;margin:0 0 3px;color:#afc8d7;font-size:10px;white-space:nowrap}
[data-deck-header]{cursor:pointer;margin-left:-6px;margin-right:-6px;padding-left:6px;padding-right:6px}
.deck-heading-toggle{display:inline-flex;align-items:center;gap:3px;height:12px;min-height:0;line-height:12px;margin:0;padding:0;border:0;background:transparent;color:var(--lilac);font-weight:600;font-size:9px;letter-spacing:1px;box-shadow:none}
.deck-heading-toggle:hover:not(:disabled){background:transparent;box-shadow:none}
.deck-heading output{font-size:10px;line-height:12px;letter-spacing:0;overflow:hidden;text-overflow:ellipsis;font-variant-numeric:tabular-nums;color:#e4f1f9}
.deck-chevron{margin-left:2px;transition:transform .15s ease}
[data-expanded="true"]>.deck-heading .deck-chevron,[data-expanded="true"]>.deck-heading-toggle .deck-chevron,[data-expanded="true"]>.deck-tactical-toggle .deck-chevron{transform:rotate(180deg)}
.control-deck button,.control-deck select,.deck-view button{height:30px;min-height:28px;padding:0 6px;font-size:11px;line-height:1.15;border-radius:4px;min-width:0;text-shadow:none}
.control-deck button,.deck-view button{background:rgba(18,35,51,.78)}
.control-deck select{background:rgba(27,51,72,.78);color:#e8f4ff;padding:0 4px}
.control-deck option,.control-deck optgroup{background:#102333;color:#e8f4ff}
.control-deck option:disabled{color:#9caebb}
.control-deck kbd,.deck-view kbd{font-size:8px;margin-left:3px;padding:0 2px}
.control-deck button:hover:not(:disabled),.deck-view button:hover:not(:disabled){background:rgba(41,66,84,.88)}
.control-deck button:focus-visible,.control-deck select:focus-visible,.deck-view button:focus-visible{outline:2px solid #d2fbff;outline-offset:2px}
.control-deck button:disabled,.control-deck select:disabled{opacity:.45}
.control-deck .deck-heading-toggle{height:12px;min-height:0;line-height:12px;padding:0;border:0;border-radius:0;background:transparent;font-size:9px;box-shadow:none}
.control-deck .deck-heading-toggle:hover:not(:disabled){background:transparent;box-shadow:none}
.deck-helm-row{display:grid;grid-template-columns:74px minmax(0,1fr) 90px;gap:4px}
.control-deck #stop{background:#b9a8e5;color:#171a2e;border-color:#d9cef6;white-space:nowrap}
.control-deck #stop:hover:not(:disabled){background:#cec0ef}
.deck-throttle{position:relative;display:grid;grid-template-columns:23px minmax(0,1fr) 23px;gap:0}
.deck-throttle button{padding:0;border-radius:0}
.deck-throttle #speedDown{border-radius:4px 0 0 4px}
.deck-throttle #speedUp{border-radius:0 4px 4px 0}
.deck-throttle #throttle{width:100%;border-left:0;border-right:0;border-radius:0;padding:0 2px;text-align:center}
.deck-throttle #throttle::after{content:' ▾';font-size:8px;color:#c5dfed}
.deck-throttle-menu{position:absolute;z-index:1;bottom:calc(100% + 4px);left:23px;right:23px;min-width:74px;padding:3px}
.control-deck .deck-throttle-menu #throttleAuto{width:100%;height:30px;padding:0 6px;border-radius:4px;text-align:left}
.deck-turbo-group{display:grid;grid-template-columns:minmax(0,1fr) 33px;gap:0}
.control-deck #turbo{touch-action:none;user-select:none;-webkit-user-select:none;white-space:nowrap;font-weight:600;border-color:#bc9275;color:#ffd2a7;border-radius:4px 0 0 4px;padding:0 4px}
.control-deck #turboFactor{width:100%;border-color:#bc9275;border-left:0;border-radius:0 4px 4px 0;padding:0 1px;color:#ffd2a7;font-size:10px}
.control-deck #turbo[aria-pressed="true"]{background:#78392eee;color:#fff1e8;border-color:#ffa887}
.deck-helm-details{margin-top:6px;padding-top:5px;border-top:1px solid #83b3ca40}
.deck-radar{display:flex;align-items:center;gap:8px;min-height:44px;pointer-events:none}
.deck-radar #radar{width:42px;height:42px;flex:none}
.deck-radar>div{display:flex;flex-direction:column;gap:1px;min-width:0;flex:1}
.deck-radar span{font-size:10px;line-height:13px;color:#d6e6ee;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.deck-radar b{font-weight:500}
.deck-radar small{display:block;font-size:9px;line-height:12px;color:#abc5d4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.deck-tactical{border-top:2px solid var(--amber);padding:3px 5px 4px;min-width:0}
.control-deck .deck-tactical-toggle{display:flex;align-items:center;gap:6px;width:100%;height:18px;min-height:18px;border:0;background:transparent;padding:0;color:var(--amber);font-size:9px;letter-spacing:.6px;margin:0;box-shadow:none;text-align:left}
.deck-tactical-toggle #tacticalCount{margin-left:auto;font-size:9px;letter-spacing:0;font-variant-numeric:tabular-nums}
.deck-tactical-toggle .deck-chevron{font-size:11px}
.deck-tactical-details{display:grid;gap:4px;margin-top:4px}
.control-deck #tacticalPower{width:100%;height:28px;padding:0 6px;font-size:11px;color:#ffe2a8;border-color:#ffbd7b;background:#493321b8}
.deck-weapons{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,2fr);gap:4px}
.deck-weapons button{height:32px;touch-action:none;text-align:left;overflow:hidden;font-size:11px;font-weight:600;padding:3px 5px;color:#ffe0bf;border-color:#b98c686b;background:#654423b8;white-space:nowrap}
.deck-weapons button>span{display:block;font-size:8px;line-height:10px;font-weight:400;letter-spacing:.2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-variant-numeric:tabular-nums}
.deck-weapons #phaser:hover:not(:disabled){background:#866037dd}
.deck-launchers{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}
.deck-launchers button{position:relative;background:#543032b8;color:#ffccbf;border-color:#be9a8a75}
.deck-launchers button:hover:not(:disabled){background:#77484ade}
.deck-launchers button::after{content:'';position:absolute;left:0;bottom:0;height:2px;width:calc(var(--tube-ready,1)*100%);background:#ffd9ad;opacity:.9;transition:width .14s linear;pointer-events:none}
.deck-launchers button[data-state="recharging"]::after,.deck-launchers button[data-state="queued"]::after{background:#ffae6b}
.deck-launchers button[data-flash="launched"]{animation:tube-launch .2s ease-out}
.deck-launchers button[data-flash="queued"]{animation:tube-queue .25s ease-out}
.deck-combat-actions{display:grid;grid-template-columns:44px 52px minmax(0,1fr) minmax(0,1fr);gap:3px}
.deck-combat-actions button{font-size:9px;white-space:nowrap;padding:0 4px;height:28px}
.deck-combat-actions strong{font-size:8px;font-weight:500}
.deck-combat-actions button[aria-pressed="true"]{background:#214b43c7;color:#d4f9ee;border-color:#87caba80}
.deck-cargo-actions{display:flex;justify-content:flex-end}
.control-deck #refine{height:28px;font-size:9px;white-space:nowrap;min-width:85px;padding:0 5px}
.control-deck .deck-cargo-open{width:100%;height:28px;padding:0 6px;margin-top:3px;color:#a4efdc;border-color:#82e4c950;background:#081c2778;text-align:left;font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-variant-numeric:tabular-nums}
.deck-tactical[data-expanded="false"]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);gap:4px;align-items:center}
.control-deck .deck-tactical[data-expanded="false"] .deck-tactical-toggle{height:28px;min-height:28px;gap:4px;letter-spacing:0}
.deck-tactical[data-expanded="false"] .deck-tactical-toggle #tacticalCount{font-size:8px}
.control-deck .deck-tactical[data-expanded="false"] .deck-cargo-open{margin:0;font-size:9px}
.control-deck #tacticalDock[data-expanded="true"] .deck-cargo-open{width:calc(100% - 89px);position:absolute;bottom:4px;left:5px}
.deck-tactical{position:relative}
.deck-navigate{position:absolute;right:0;bottom:0;border-top-color:var(--blue);pointer-events:auto}
.deck-navigate .deck-heading-toggle{color:var(--blue)}
.control-deck #patrol{height:12px;min-height:0;font-size:9px;line-height:12px;padding:0;border:0;background:transparent;color:#aad5ca;box-shadow:none;white-space:nowrap}
.control-deck #patrol[aria-pressed="true"]{color:#c8ffe9}
.control-deck #patrol::before{content:'';display:inline-block;width:13px;height:6px;margin-right:4px;vertical-align:1px;background:#516a6d;border-radius:5px;box-shadow:inset 7px 0 #afc7ce}
.control-deck #patrol[aria-pressed="true"]::before{background:#5fa693;box-shadow:inset -7px 0 #dcffed}
.deck-navigation-controls{display:grid;grid-template-columns:minmax(0,1fr) 39px minmax(48px,auto);gap:4px;align-items:center}
.control-deck #destination{width:100%;height:30px;font-size:11px;line-height:28px}
.deck-warp-factor{display:block;min-width:0;height:30px}
.control-deck #warpFactor{width:100%;height:30px;padding:0 1px;font-size:11px}
.control-deck #engage{background:#9edaff;color:#0c2b42;border-color:#bfe9ff;font-weight:600;white-space:nowrap;font-size:11px;padding:0 6px}
.control-deck #engage:hover:not(:disabled){background:#c0e9ff}
.control-deck #engage kbd{display:none}
.deck-navigate[data-local="true"] .deck-navigation-controls{grid-template-columns:minmax(0,1fr) minmax(48px,auto)}
.deck-navigation-details{grid-column:1/-1;min-width:0}
.deck-navigation-details #routeInfo{margin:1px 0;font-size:10px;line-height:13px;color:#c5dfed;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-variant-numeric:tabular-nums}
.deck-navigate[data-expanded="true"] #destination{grid-column:1/-1;height:140px;border-radius:4px;background:transparent;padding:0;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#81a8be #102333}
.deck-navigate[data-expanded="true"] #destination optgroup{background:transparent;color:#a0d7ec;font-size:10px;letter-spacing:.6px}
.deck-navigate[data-expanded="true"] #destination option{min-height:28px;line-height:28px;padding:6px 7px;color:#edf8ff;background:transparent;font-size:11px;letter-spacing:0}
.deck-navigate[data-expanded="true"] #destination option:checked{background:linear-gradient(#284d6390,#284d6390);color:#fff}
.deck-navigate[data-expanded="true"] .deck-navigation-controls{grid-template-columns:minmax(0,1fr) auto;gap:4px}
.deck-navigate[data-expanded="true"] .deck-warp-factor{grid-column:1;justify-self:end;width:39px}
.deck-navigate[data-expanded="true"] #engage{grid-column:2;min-width:105px}
.deck-navigate[data-expanded="true"][data-local="true"] #engage{grid-column:1/-1;justify-self:end;min-width:105px}
.deck-navigate[data-expanded="true"] .deck-navigation-details{grid-row:2}
.deck-view{position:absolute;z-index:4;left:50%;bottom:max(var(--deck-edge),env(safe-area-inset-bottom));transform:translateX(-50%);padding:4px;pointer-events:auto;max-width:calc(50vw - 24px)}
.deck-view .deck-view-toggle{display:flex;gap:5px;align-items:center;justify-content:center;min-width:32px;font-size:15px;padding:0 6px;height:30px;color:#c4ebfa}
.deck-view-label{font-size:10px}
.deck-view-heading{width:100%}
.deck-view-heading .deck-view-toggle{width:100%}
.deck-view[data-expanded="true"]{width:254px;display:flex;flex-direction:column;gap:4px}
.deck-view[data-expanded="true"] .deck-view-toggle{height:24px;min-height:24px;justify-content:flex-end;padding:0 4px;border:0;background:transparent;box-shadow:none;font-size:0}
.deck-view[data-expanded="true"] .deck-view-toggle::before{content:'VIEW';margin-right:auto;font-size:9px;letter-spacing:1px;color:#b4d7e8}
.deck-view[data-expanded="true"] .deck-view-toggle::after{content:'−';font-size:13px;color:#b4d7e8}
.deck-view[data-expanded="true"] .deck-view-label{display:none}
.deck-view-details{display:grid;gap:4px}
.deck-camera-modes{display:grid;grid-template-columns:1.12fr .85fr 1fr;gap:3px}
.deck-camera-tools{display:grid;grid-template-columns:27px minmax(0,1fr) 27px minmax(0,1fr);gap:3px}
.deck-view .deck-camera-modes button,.deck-view .deck-camera-tools button{height:28px;padding:0 4px;font-size:10px;white-space:nowrap}
.deck-view .deck-camera-modes button.active{background:#79c7e5;color:#0e2a3e;border-color:#d0f2ff}
.deck-view #wideView[aria-pressed="true"],.deck-view #tourView[aria-pressed="true"]{background:#17493fe0;color:#d6fff2;border-color:#92e8d1}
.deck-sr-only{position:absolute!important;width:1px!important;height:1px!important;margin:-1px!important;padding:0!important;border:0!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;clip-path:inset(50%)!important;white-space:nowrap!important}

/* Condition is the single home for shields and hull; its fill matches the docks. */
#alertBanner{height:72px;gap:4px;padding:6px 8px;background:var(--deck-glass);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);box-shadow:inset 3px 0 #89cadb;text-shadow:0 1px 3px #000}
.red-alert #alertBanner{background:rgba(63,17,24,.17);box-shadow:inset 3px 0 #ff9a80,0 0 20px #eb5a371c}
#alertBanner #enterpriseStatus{position:relative;pointer-events:none;width:100%;color:#d4efff;transition:opacity .6s ease}
#alertBanner #enterpriseStatus[data-quiet="true"]{opacity:.8}
#alertBanner #enterpriseStatus .ship-status{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:2px 0 0;padding:0;border:0;background:transparent;box-shadow:none}
#alertBanner #enterpriseStatus label{display:flex;justify-content:space-between;gap:4px;font-size:10px;line-height:12px;margin:0 0 3px;letter-spacing:0}
#alertBanner #enterpriseStatus .meter{height:2px;margin:0;background:#31516388}
#alertBanner #enterpriseStatus .meter i{transition:width .2s ease}
#bridgePanel{top:194px}
/* Status reaches the measured compact dock stack; expansion covers it.
   The existing deck stacking context remains above every Status control. */
#bridgePanel{z-index:1}
#bridgePanel .mission-brief{overflow-anchor:none}
#bridgePanel .bridge-updates{flex:1 1 0;max-height:none;overflow-anchor:none}
#transport,#commsTransport,#crewTransport,#towOutpost,#resumeFleet,#rockPractice,#crewQuickAction,#crewFire{white-space:nowrap}
#observeEcho,#investigateSignal{width:min(180px,100%);white-space:nowrap}
#encounterCourse,#cargoTorpedoes,#cargoRepair{white-space:nowrap}
#pauseButton{min-width:58px}
#shieldRouting{color:#edf4ff;background:#1b3348;border-color:#8db6d2;opacity:1}
#shieldRouting:disabled{color:#a5b2bf;background:#142333;border-color:#586f81;opacity:.55}
#shieldRoutingStatus{margin:7px 0 0;font-size:12px;line-height:1.5;color:#b5e5ed}
#shieldRoutingStatus[data-available="false"]{color:#d6bb9d}
.hud-restore-left{top:193px}
.crew-mode #viewDock{display:none!important}
@keyframes tube-launch{from{filter:brightness(1.6)}to{filter:none}}
@keyframes tube-queue{from{box-shadow:inset 0 0 0 3px #ffd9ad}to{box-shadow:inset 0 0 0 0 #ffd9ad}}
@media(max-width:1150px){
 .deck-helm-row{grid-template-columns:64px minmax(0,1fr) 77px;gap:3px}
 .deck-helm,.deck-navigate{padding-left:5px;padding-right:5px}
 .control-deck #stop{font-size:10px;padding:0 3px}
 .control-deck #stop kbd,.deck-weapons kbd{display:none}
 .deck-throttle{grid-template-columns:19px minmax(0,1fr) 19px}
 .deck-throttle-menu{left:19px;right:19px}
 .deck-turbo-group{grid-template-columns:minmax(0,1fr) 31px}
 .control-deck #turbo{font-size:10px;padding:0 3px}
 .deck-heading output{font-size:9px}
 .deck-combat-actions{grid-template-columns:39px 43px minmax(0,1fr) minmax(0,1fr);gap:3px}
 .deck-combat-actions button{font-size:8px;padding:0 2px}
 .deck-weapons button{font-size:10px;padding:3px 4px}
 .control-deck #engage{font-size:10px;padding:0 4px}
}
@media(max-width:850px) and (min-width:701px){
 :root{--deck-width:calc(29vw - 16px)}
 .deck-view[data-expanded="true"]{width:220px;max-width:calc(42vw - 16px)}
 .deck-view kbd{display:none}
 .deck-radar small{font-size:8px}
}
@media(max-width:700px){
 :root{--deck-width:calc(50vw - 14px);--deck-edge:8px}
 #viewDock{bottom:74px;max-width:calc(100vw - 16px)}
 .deck-view[data-expanded="true"]{width:254px}
 .deck-helm-row{grid-template-columns:58px minmax(0,1fr);gap:3px}
 .deck-turbo-group{grid-column:1/-1;grid-template-columns:minmax(0,1fr) 40px}
 .deck-helm{min-height:88px}
 .deck-heading output{font-size:8px}
 .deck-navigation-controls{grid-template-columns:minmax(0,1fr) 34px}
 .control-deck #destination{grid-column:1/-1}
 .control-deck #engage{grid-column:1;grid-row:2}
 .deck-warp-factor{grid-column:2;grid-row:2}
 .deck-navigate{min-height:88px}
 .deck-navigate[data-local="true"] .deck-navigation-controls{grid-template-columns:1fr}
 .deck-navigate[data-local="true"] #engage{grid-column:1;grid-row:2}
 .deck-weapons{grid-template-columns:1fr}
 .deck-combat-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
 .deck-combat-actions button{font-size:9px}
 .deck-cargo-actions #refine{min-width:70px;font-size:8px}
 .control-deck #tacticalDock[data-expanded="true"] .deck-cargo-open{width:calc(100% - 75px);font-size:8px;padding:0 3px}
 #alertBanner{height:65px;top:306px}
 #bridgePanel{top:382px}
 .hud-restore-left{top:380px}
}
@media(prefers-reduced-motion:reduce){.deck-chevron,#alertBanner #enterpriseStatus,#alertBanner #enterpriseStatus .meter i,.deck-launchers button::after{transition:none}.deck-launchers button[data-flash]{animation:none}}
