/* Release shell uses the same safe rectangle and 48 CSS px control target as the game. */
.title-screen{position:fixed;inset:0;z-index:12;background:linear-gradient(#bdddd5dd 0%,#bdddd51a 49%,#bdddd5f5 88%);color:#2d5260}
.home-layout{height:100dvh;max-width:1000px;margin:auto;padding:var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l);display:grid;grid-template-rows:48px auto minmax(35px,1fr) auto 48px;gap:8px}
.home-header{display:flex;gap:8px;justify-content:flex-end;align-items:center}
.home-header button{display:grid;place-items:center;width:48px;height:48px;min-width:48px;border:2px solid #355c60;border-radius:15px;box-shadow:0 3px 0 #355c60;background:#fff4d9;font-size:27px;font-weight:900}
.home-header svg{width:25px;height:25px}
.home-brand{text-align:center;min-height:0}
.home-brand img{display:block;width:min(620px,100%);height:clamp(105px,21dvh,235px);object-fit:contain;margin:auto;filter:drop-shadow(0 7px 0 #5e805719)}
.home-brand h1{font-size:clamp(15px,2.3vw,23px);font-weight:1000;line-height:1.5;color:#345e59;margin:3px 0 0;text-shadow:0 2px #fff5d5}
.home-brand h1>span{white-space:nowrap}
.home-hero-space{min-height:0;pointer-events:none}
.home-actions{width:min(460px,100%);margin:auto;border:2px solid #648677;border-radius:23px;padding:12px;background:#fff8deee;box-shadow:0 5px 0 #64867766}
.home-actions p{font-size:11px;font-weight:900;text-align:center;line-height:1.5;margin:0 0 8px}
.home-actions>.primary{width:100%;min-height:60px;font-size:22px}
.home-shortcuts{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:9px}
.home-shortcuts button{min-width:48px;min-height:48px;font-size:12px;padding:7px}
.home-actions>#home-retry{width:100%;min-height:48px;margin-top:8px;font-size:12px}
#title-screen[data-failed="true"] #home-play,#title-screen[data-failed="true"] .home-shortcuts{display:none}
.home-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;width:min(460px,100%);margin:auto;min-width:0;align-self:end}
.home-footer button{min-width:100px;min-height:48px;font-size:11px;font-weight:900;border:2px solid #6c8a7a;border-radius:13px;background:#e4eddb;padding:6px 10px}
.home-footer>div{text-align:right;min-width:0}
.home-footer span,.home-footer small{display:block;font-size:9px;line-height:1.7;font-weight:800;color:#567b6c}
body.at-title #game-app>:not(.world-frame){visibility:hidden}
body.at-title #game-app{--play-top:270px;--play-bottom:215px}
body.at-title .play-window{pointer-events:none}
body.at-title #load-veil{display:none}
#panel[data-shell-view]{width:min(630px,calc(100% - var(--safe-l) - var(--safe-r)))}
#panel[data-shell-view] .panel-body{padding:20px 20px 16px}
#panel[data-shell-view] h2{font-size:21px;min-height:48px;line-height:1.5;margin:0 48px 10px 0}
#panel[data-shell-view] button,#panel[data-shell-view] a{min-height:48px;min-width:48px}
#panel[data-shell-view] p{font-size:12px;line-height:1.8;margin:8px 0}
#panel[data-shell-view] .shell-fine{font-size:10px;line-height:1.65;margin:9px 0;color:#6d7f68}
.shell-settings-links{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-top:12px}
.shell-settings-links button{font-size:11px;padding:6px 4px}
.audio-settings{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.audio-settings .setting{min-width:0;gap:8px}
.rescue-route-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.rescue-route-card{min-width:0;min-height:48px;display:flex;flex-direction:column;align-items:center;gap:7px;padding:10px;background:#edf2df;border-color:#668b80;box-shadow:0 4px #668b8055}
.rescue-route-card svg{display:block;width:100%;height:auto;max-height:160px}
.rescue-route-card strong{font-size:clamp(11px,2vw,16px);line-height:1.6}
.rescue-route-card>span{font-size:11px;line-height:1.5}
.rescue-route .route-intro,.rescue-route .route-note{font-size:12px;line-height:1.7;margin:9px 0}
.rescue-pump .lab-tools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.rescue-pump .op-explain{grid-column:1/-1;font-size:13px;line-height:1.6;margin:0}
.rescue-pump .lab-tools button{min-width:48px;min-height:48px;font-size:12px;padding:5px}
@media(max-height:500px) and (min-aspect-ratio:1.2){.rescue-route-card{padding:5px;gap:2px}.rescue-route-card svg{max-height:130px}.rescue-route .route-intro,.rescue-route .route-note{font-size:11px;line-height:1.45;margin:5px 0}.rescue-pump .lab-tools{display:flex;flex-direction:column}.rescue-pump .lab-direction{font-size:12px}.rescue-pump .lab-note{font-size:10px}}
.parent-menu{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.parent-menu button{display:flex;flex-direction:column;align-items:flex-start;min-height:87px;text-align:left;padding:12px;background:#e5edd9;border-color:#718b78;box-shadow:0 3px 0 #718b7855}
.parent-menu strong{font-size:16px;line-height:1.5}
.parent-menu small{font-size:10px;font-weight:700;line-height:1.6}
.parent-hold-wrap{display:flex;justify-content:center;margin:10px 0}
.parent-hold{--hold:0;display:flex;flex-direction:column;align-items:center;justify-content:center;width:108px;height:108px;border-radius:50%;border:5px solid #5b8275;box-shadow:0 4px 0 #5b827555;background:conic-gradient(#ecc16b calc(var(--hold)*1turn),#dbe9d6 0);touch-action:none;user-select:none;-webkit-user-select:none}
.parent-hold span{font-size:25px;font-weight:1000;line-height:1.3}
.parent-hold small{font-size:10px;font-weight:900}
.shell-intro{text-align:center}
.shell-reading-links{display:flex;gap:8px;margin:10px 0}
.shell-reading-links>*{flex:1;font-size:11px;padding:7px}
.shell-data-buttons{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}
.shell-data-buttons button{font-size:12px;padding:8px}
.shell-reading .legacy-link{font-size:11px;padding:6px 0}
.edition-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.edition-grid section{min-width:0;background:#e5edd8;border:2px solid #8da58a;border-radius:15px;padding:12px}
.edition-grid section+section{background:#f4e6bc;border-color:#b6a675}
.edition-grid span{font-size:10px;font-weight:900}
.edition-grid h3{font-size:19px;margin:5px 0;line-height:1.5}
#panel .edition-grid p{font-size:11px;margin:6px 0;line-height:1.8}
.edition-grid small{font-size:9px;line-height:1.5;display:block}
.shell-preview-switch{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.shell-preview-switch button{font-size:11px;padding:7px}
.scope-picture{display:flex;justify-content:center;background:#e2ecd7;border-radius:14px;padding:8px}
.scope-picture svg{width:160px;height:105px}
.backup-summary{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:13px;background:#e3ecd8;border:2px solid #9aaf91;border-radius:14px;font-size:12px;font-weight:900}
.backup-summary b{grid-column:1/-1}
.scope-badge{display:inline-block;background:#e1e9d5;border:1px solid #8ca48b;border-radius:6px;padding:1px 4px}
@media(max-width:600px){
 body.at-title #game-app{--play-top:calc(26dvh + 55px);--play-bottom:235px}
 #panel[data-shell-view] .panel-body{padding:16px 14px 14px}
 #panel[data-shell-view] h2{font-size:18px}
 .home-brand h1{font-size:17px}
 .home-actions{padding:10px}
 .home-actions>.primary{min-height:58px;font-size:20px}
 .home-shortcuts button{font-size:11px}
 .parent-menu{gap:8px}
 .parent-menu button{min-height:90px;padding:9px}
 .parent-menu strong{font-size:14px}
 .parent-menu small{font-size:9px}
 .edition-grid{grid-template-columns:1fr 1fr;gap:7px}
 .edition-grid section{padding:9px 11px}
 .edition-grid h3{font-size:15px;display:block;margin:4px 0}
 .edition-grid span{font-size:9px}
 #panel .edition-grid p{font-size:10px;margin:5px 0;line-height:1.65}
 .edition-grid small{font-size:8px}
}
@media(max-width:360px){
 .home-layout{gap:6px}
 .home-brand h1{font-size:15px}
 .home-brand img{height:110px}
 .home-actions p{font-size:9px;margin-bottom:5px}
 .home-actions{padding:8px;border-radius:18px}
 .home-actions>.primary{min-height:54px;font-size:18px}
 .home-shortcuts{gap:6px;margin-top:7px}
 .home-shortcuts button{font-size:10px}
 .home-footer span,.home-footer small{font-size:8px}
 .home-footer button{min-width:90px;font-size:10px}
 #panel[data-shell-view] p{font-size:11px;line-height:1.7}
 #panel[data-shell-view] .shell-fine{font-size:9px;line-height:1.5}
 .shell-data-buttons button{font-size:10px}
}
@media(max-height:550px) and (orientation:landscape){
 .home-layout{max-width:1000px;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);grid-template-rows:48px minmax(0,1fr) 48px;column-gap:22px;row-gap:7px}
 .home-header{grid-column:2;grid-row:1}
 .home-brand{grid-column:1;grid-row:1/3;align-self:start;padding-top:4px}
 .home-brand img{width:100%;height:clamp(90px,33dvh,160px)}
 .home-brand h1{font-size:clamp(13px,2vw,20px)}
 .home-hero-space{grid-column:1;grid-row:2/4}
 .home-actions{grid-column:2;grid-row:2;padding:8px;max-width:360px}
 .home-actions p{font-size:9px;margin-bottom:5px}
 .home-actions>.primary{min-height:50px;font-size:18px}
 .home-shortcuts{gap:6px;margin-top:7px}
 .home-shortcuts button{font-size:10px;padding:5px 3px}
 .home-footer{grid-column:2;grid-row:3;gap:5px}
 .home-footer button{min-width:88px;font-size:9px;padding:4px}
 .home-footer span,.home-footer small{font-size:7px}
 body.at-title #game-app{--play-top:calc(40dvh + 8px);--play-bottom:12px}
 body.at-title .play-window{right:calc(47% + var(--safe-r))}
 #panel[data-shell-view]{width:min(760px,calc(100% - var(--safe-l) - var(--safe-r)))}
 #panel[data-shell-view] .panel-body{padding:8px 14px}
 #panel[data-shell-view] h2{font-size:18px;min-height:46px;margin-bottom:6px}
 #panel[data-shell-view] p{font-size:11px;line-height:1.6;margin:5px 0}
 #panel[data-shell-view] .shell-fine{font-size:9px;line-height:1.5;margin:6px 0}
 .parent-menu button{min-height:65px;padding:7px 10px}
 .parent-menu strong{font-size:14px}
 .parent-menu small{font-size:9px}
 .parent-menu{gap:7px}
 .parent-hold-wrap{margin:5px 0}
 .parent-hold{width:82px;height:82px}
 .parent-hold span{font-size:21px}
 .edition-grid{grid-template-columns:1fr 1fr;gap:8px}
 .edition-grid section{padding:7px 9px}
 #panel[data-shell-view="parent-product"] .edition-grid section{padding:5px 9px}
 #panel[data-shell-view="parent-product"] .edition-grid h3{margin:2px 0}
 .edition-grid h3{display:block;margin:3px 0;font-size:16px}
 #panel .edition-grid p{font-size:10px;line-height:1.6;margin:4px 0}
 .edition-grid span,.edition-grid small{font-size:8px}
 .shell-settings-links{margin-top:7px}
 .shell-data-buttons{margin-top:6px}
 .shell-settings-links button{font-size:10px}
 .scope-picture{float:left;width:142px;margin:0 12px 6px 0;padding:4px}
 .scope-picture svg{width:125px;height:88px}
 .shell-preview-switch{margin-top:6px}
 .shell-preview-switch button{font-size:10px;padding:5px}
 .shell-reading-links{margin:7px 0}
 #panel[data-shell-view] .shell-reading p{font-size:10px;line-height:1.5}
 #panel[data-shell-view="parent-gate"] .panel-body{display:grid;grid-template-columns:minmax(0,1fr) 120px;column-gap:14px;row-gap:3px}
 #panel[data-shell-view="parent-gate"] h2{grid-column:1/-1}
 #panel[data-shell-view="parent-gate"] .shell-intro{grid-column:1;grid-row:2;text-align:left}
 #panel[data-shell-view="parent-gate"] .parent-hold-wrap{grid-column:2;grid-row:2/4;align-self:center}
 #panel[data-shell-view="parent-gate"] .shell-fine{grid-column:1;grid-row:3}
 #panel[data-shell-view="parent-gate"] .panel-body>.secondary{grid-column:1/-1;margin-top:4px}
 #panel[data-shell-view] .panel-body>.secondary{margin-top:7px}
}
/* Keep the new operations inside a short landscape viewport with full-size taps. */
@media(max-height:500px) and (min-aspect-ratio:1.2){
 #panel.rescue-pump .panel-body{padding:9px 12px}
 #panel.rescue-route .panel-body{padding:12px 14px}
 #panel.rescue-route .panel-body h2{margin-bottom:7px}
}
.route-exit-marker{background:#e2ebd9;border-color:#789483;font-size:8px}

@media(max-height:500px) and (min-aspect-ratio:1.2){#panel.rescue-pump .lab-board:has(.pipe-grid){height:190px}#panel.rescue-route .rescue-route-card svg{max-height:112px}}

@media(max-height:500px) and (min-aspect-ratio:1.2){#panel.rescue-pump .op-explain{font-size:12px;line-height:1.5}#panel.rescue-pump .lab-tools{gap:6px}}

/* Long English labels keep their own space in both orientations. */
.language-setting select{font:inherit;min-height:48px;max-width:58%;border:2px solid #91b9ad;border-radius:12px;padding:6px 10px;background:#fff9ed;color:#365e55}
html[lang=en] .next-chip{font-size:clamp(10px,1.6vw,14px)}
html[lang=en] .mission-heading h1{font-size:clamp(17px,2.5vw,29px)}
html[lang=en] .crew-note,html[lang=en] .lab-note{overflow-wrap:anywhere}
html[lang=en] .station-dock .memory-button{min-width:0}
html[lang=en] .station-dock .memory-button span{min-width:0}
@media(max-width:450px){html[lang=en] .home-shortcuts button{font-size:14px}html[lang=en] .tool-button span{font-size:12px}html[lang=en] .mission-heading h1{font-size:16px}.language-setting{gap:8px}}
