/* Screen layout: header → live bar → separated corner HUDs → railway → journey footer. */
#app{--edge:24px;--left-rail:280px;--right-rail:300px;--header-bottom:76px}
#app header{padding:18px var(--edge);gap:16px;align-items:center;background:linear-gradient(#121925f5,#121925a8,transparent)}
#app .brand{white-space:nowrap;font-size:22px;flex-shrink:0}
#app .edition{display:none}
#app header nav{gap:8px;align-items:center;min-width:0}
#app header nav>button{font-size:13px;padding:9px 13px}
.tools-menu{position:relative;flex-shrink:0;font-size:13px}
.tools-menu summary{list-style:none;cursor:pointer;border:1px solid #ffffff24;background:#171f2ddd;border-radius:8px;padding:9px 15px;user-select:none}
.tools-menu summary::-webkit-details-marker{display:none}.tools-menu summary:after{content:'⌄';margin-left:12px;color:#9bb0cb}
.tools-menu summary:focus-visible{outline:3px solid #edcf83;outline-offset:3px}
.tools-menu[open] summary{background:#2b3e5e;border-color:#719ddd}
.tools-menu-items{position:absolute;right:0;top:calc(100% + 10px);width:220px;display:grid;gap:4px;padding:8px;background:#172131;border:1px solid #52647d;border-radius:12px;box-shadow:0 16px 50px #0007;z-index:20}
#app .tools-menu-items button{width:100%;text-align:left;border:0;background:transparent;padding:12px;font-size:13px}
#app .tools-menu-items button:hover{background:#2b3e5e}
#app .tools-menu-items .fault-active{color:#ffd18a}
#app header:has(.tools-menu[open]){z-index:12}
#app #liveBanner{position:absolute;top:var(--header-bottom);left:var(--edge);right:var(--edge);bottom:auto;max-width:none;min-width:0;padding:10px 14px;border:1px solid #6e96ce44;border-radius:10px;background:#172131ed;display:flex;align-items:center;justify-content:space-between;flex-wrap:nowrap;gap:16px;z-index:3;font-size:12px}
#app #liveBanner[hidden]{display:none}
.live-overview{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:10px;row-gap:4px;align-items:center;min-width:0;flex:1}
#app #liveBanner .live-badge{grid-row:1/3;width:auto;font-size:9px;font-weight:800;letter-spacing:.12em;color:#9dc5ff;background:#317aff24;border:1px solid #609cff55;padding:6px 8px;border-radius:5px}
#app #liveBanner strong{width:auto;font-size:14px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#app #liveBanner #liveState{display:block;width:auto;font-size:11px;color:#b7c5d8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.live-actions{display:flex;gap:6px;flex-shrink:0}#app .live-actions button{padding:8px 11px;font-size:12px;white-space:nowrap}
#app #operationsExchange{top:var(--hud-top);left:var(--edge);right:auto;width:var(--left-rail);max-height:min(235px,var(--hud-room));padding:12px 14px;z-index:3;background:#172131ed;border:1px solid #7b99b338;border-radius:10px}
#app #operationsExchange>.eyebrow{font-size:9px;letter-spacing:.08em;color:#99afca}
#app #operationsExchange h3{font-size:14px;margin:8px 0;line-height:1.35}
#app #operationsExchange .scene-signal{font-size:11px;margin:0 0 8px;line-height:1.5}
#app #operationsExchange .scene-message{padding:8px 0 0;margin-top:6px}
#app #operationsExchange .scene-message strong{font-size:10px;color:#a7c9f7}
#app #operationsExchange .scene-message span{font-size:12px;line-height:1.45}
#app #operationsExchange .scene-tools{justify-content:flex-end;order:5;margin-top:6px}
#app #operationsExchange .scene-tools button{font-size:10px;padding:4px 7px;background:transparent}
#app #operationsExchange .scene-focus{display:none}
#app #operationsExchange.exchanges-expanded{max-height:min(360px,var(--hud-room))}
#app #rightHud{top:var(--hud-top);right:var(--edge);width:var(--right-rail);z-index:4}
#app #rightHud>.instrument{background:#172131ed;border:1px solid #7b99b338;border-radius:10px;padding:12px 14px;max-height:none}
#app #rightHud>.instrument .eyebrow{font-size:9px;color:#99afca}
#app #rightHud>.instrument strong{font-size:32px}
#app .camera-tools{top:var(--hud-bottom);right:var(--edge);padding:3px;background:#172131e8;border-color:#7b99b338;z-index:3}
#app .camera-tools button{padding:7px 10px;font-size:12px}
#app #rightHud>#recoveryPrompt,#app #rightHud>#missionHud,#app #rightHud>#stationMissionHud{max-height:var(--action-room);padding:16px;background:#172131f2;border-radius:10px;box-shadow:0 8px 30px #0003}
#app #rightHud .recovery-prompt-title{font-size:22px;line-height:1.2;margin:10px 0}
#app #rightHud .recovery-prompt-hint{font-size:13px;line-height:1.55}
#app #rightHud .recovery-prompt-action{font-size:14px;padding:12px}
#app footer{padding:0 var(--edge) 12px;gap:10px 16px;grid-template-columns:minmax(0,1fr) auto;z-index:2;background:linear-gradient(transparent,#111925e8 42%,#111925f8)}
#app .journey-card{min-width:0;width:fit-content;max-width:470px;padding:12px 16px;border-radius:10px;background:#172131ed}
#app .journey-card p{font-size:14px;line-height:1.45;margin:7px 0 10px}
#app .ride-actions button{font-size:13px;padding:9px 12px}
#app .playback{grid-column:2;gap:5px}#app .playback button{font-size:12px;padding:8px 11px}
#app .route-strip{height:40px}#app .route-strip svg{height:40px}
#app.live-mode .journey-card,#app.live-mode #pause,#app.live-mode #pace{display:none}
#app #liveAttribution{grid-column:1/-1;display:flex;flex-wrap:wrap;justify-content:center;gap:3px 16px;color:#aebdd1;font-size:10px;line-height:1.5;padding-top:5px;border-top:1px solid #7b99b326}
#app #liveAttribution[hidden]{display:none}
#app #liveAttribution span{display:block}
#app #walkControls{bottom:calc(100dvh - var(--footer-top,80dvh) + 12px)}
#app #walkHint{bottom:calc(100dvh - var(--footer-top,80dvh) + 12px);font-size:11px}
#app #toast{top:calc(var(--header-bottom) + 10px)}
#app .modal{padding:24px;background:#0a1118a8}
#app .panel{border-radius:14px;border-color:#718aa244;background:#192333;max-height:calc(100dvh - 48px)}
@media(min-width:1500px){#app{--edge:32px;--left-rail:300px;--right-rail:320px}}
@media(max-width:900px){#app{--edge:16px;--left-rail:250px;--right-rail:270px}#app header{padding:14px var(--edge)}#app header nav>button{padding:9px 11px}#app .brand{font-size:20px}#app #liveBanner{gap:10px}#app #liveAttribution{gap:2px 12px;font-size:10px}#app #liveAttribution span:first-child{flex-basis:100%;text-align:center}}
@media(max-width:600px){#app{--edge:12px;--left-rail:calc(50% - 18px);--right-rail:calc(50% - 18px)}#app header{padding:12px;gap:8px}#app .brand{font-size:17px;gap:3px}#app .brand-mark{width:25px;height:25px;margin-right:4px}#app header nav{gap:5px}#app header nav>button,#app .tools-menu summary{font-size:11px;padding:8px}#app header nav kbd{display:none}#app .tools-menu summary:after{margin-left:6px}#app #liveBanner{padding:9px 10px;align-items:flex-start;gap:6px;flex-wrap:wrap}.live-overview{flex-basis:100%}#app #liveBanner strong{font-size:13px}#app #liveBanner #liveState{font-size:10px}.live-actions{margin-left:auto}#app .live-actions button{font-size:10px;padding:5px 8px}#app #operationsExchange{padding:9px;max-height:min(185px,var(--hud-room))}#app #operationsExchange>.eyebrow{font-size:8px;letter-spacing:.03em}#app #operationsExchange h3{font-size:12px;margin:6px 0}#app #operationsExchange .scene-message strong{font-size:9px}#app #operationsExchange .scene-message span{font-size:10px}#app #operationsExchange .scene-signal{font-size:10px}#app #rightHud>.instrument{padding:9px}#app #rightHud>.instrument strong{font-size:25px}#app #rightHud>.instrument #limit{font-size:9px}#app #rightHud>.instrument .eyebrow{font-size:8px}#app .camera-tools{width:var(--right-rail);display:flex;justify-content:space-between}#app .camera-tools button{font-size:10px;padding:6px 4px}#app #rightHud .recovery-prompt-title{font-size:17px}#app #rightHud .recovery-prompt-hint{font-size:11px}#app #rightHud>#recoveryPrompt,#app #rightHud>#missionHud,#app #rightHud>#stationMissionHud{padding:10px}#app footer{gap:6px;padding-bottom:8px}#app .journey-card{max-width:calc(100vw - 24px)}#app .journey-card p{font-size:12px}#app .playback{align-self:end;flex-wrap:wrap;justify-content:flex-end;max-width:100px}#app .playback button{padding:6px 8px;font-size:10px}#app .journey-card{grid-column:1/-1}#app .playback{grid-row:2}#app.live-mode .playback{grid-row:auto}#app #walkHint{display:none}#app #liveAttribution{font-size:9px;gap:1px}#app #liveAttribution span{flex-basis:100%;text-align:center}#app .modal{padding:12px}#app .panel{padding:20px;max-height:calc(100dvh - 24px)}}
@media(max-height:700px) and (min-width:601px){#app header{padding-top:10px;padding-bottom:10px}#app #operationsExchange{max-height:160px;padding:9px 12px}#app #operationsExchange h3{margin:4px 0}#app #operationsExchange .scene-tools{margin-top:3px}#app #operationsExchange .scene-messages{max-height:64px}#app #liveBanner{padding:7px 12px}#app .journey-card{padding:9px 12px}#app .journey-card p{font-size:12px}#app #rightHud .recovery-prompt-title{font-size:18px}#app #rightHud .recovery-prompt-hint{max-height:65px;overflow:auto}}

#app .camera-tools{transition:none}
#app #rightHud>.instrument{max-width:none;overflow:hidden;min-width:0}
#app #liveBanner .live-badge{display:inline-block}
@media(max-width:600px){#app .playback{max-width:none;grid-column:1/-1;grid-row:2;flex-wrap:nowrap}#app .route-strip{grid-row:3}#app #liveAttribution{grid-row:4}#app.live-mode .playback{grid-row:1}#app.live-mode .route-strip{grid-row:2}#app.live-mode #liveAttribution{grid-row:3}}

@media(max-width:600px){#app #operationsExchange{max-height:min(225px,var(--hud-room))}#app #operationsExchange .scene-messages{flex-shrink:0;min-height:34px}}
@media(max-height:700px) and (min-width:601px){#app #operationsExchange{max-height:min(200px,var(--hud-room))}}

.tools-menu-items .node-startup-status{display:block;font-size:10px;line-height:1.4;color:#9eafc7;margin-top:4px;overflow-wrap:anywhere}.tools-menu-items .node-attention .node-startup-status{color:#ffd18a}
