/* The expedition is a game screen: CSS allocates the viewport, not JS offsets. */
body[data-expedition-mode=route],body[data-expedition-mode=battle]{display:flex;flex-direction:column;height:100vh;height:100dvh;overflow:hidden}
body:is([data-expedition-mode=route],[data-expedition-mode=battle])>.site-header{flex:none;width:100%;padding-block:8px;min-height:48px}
body:is([data-expedition-mode=route],[data-expedition-mode=battle]) .brand{font-size:17px;gap:8px}
body:is([data-expedition-mode=route],[data-expedition-mode=battle]) .brand small{display:none}
body:is([data-expedition-mode=route],[data-expedition-mode=battle]) .brand-seal{width:29px;height:29px;font-size:24px;line-height:27px}
body:is([data-expedition-mode=route],[data-expedition-mode=battle]) .header-right{gap:6px}
body:is([data-expedition-mode=route],[data-expedition-mode=battle]) .icon-button{min-height:32px;padding:5px 8px}
body:is([data-expedition-mode=route],[data-expedition-mode=battle])>.tabs{flex:none;width:calc(100% - 32px);margin-inline:auto;gap:12px}
body:is([data-expedition-mode=route],[data-expedition-mode=battle])>.tabs button{min-height:38px;padding:7px 10px;font-size:13px}
body:is([data-expedition-mode=route],[data-expedition-mode=battle])>#app{flex:1;min-height:0;width:100%;padding:8px 16px 10px;margin:0 auto;overflow-anchor:none}
.dungeon-stage{height:100%;min-height:0;display:flex;flex-direction:column;gap:8px;max-width:1124px;margin:0 auto}
.dungeon-stage .dungeon-heading,.dungeon-stage .battle-heading{flex:none;min-height:44px;padding:0;display:flex;justify-content:space-between;align-items:center;gap:10px}
.dungeon-stage .dungeon-heading>div,.dungeon-stage .battle-heading>div{min-width:0}
.dungeon-stage .dungeon-heading h1,.dungeon-stage .battle-heading h1{font:700 clamp(20px,3vw,29px)/1.3 var(--serif);margin:1px 0 0;overflow-wrap:anywhere}
.dungeon-stage .dungeon-heading .eyebrow,.dungeon-stage .battle-heading .eyebrow{font-size:10px;line-height:1.4;letter-spacing:.08em}
.dungeon-stage .dungeon-heading button,.dungeon-stage .battle-heading button{min-height:36px;padding:5px 10px;font-size:13px;white-space:nowrap}
.dungeon-stage .round-label{font-size:11px;white-space:nowrap;flex:none}.dungeon-stage .round-label b{font-size:22px}
.dungeon-stage>.challenge-guide,.dungeon-stage>.strategy-panel{display:none}
.dungeon-stage .route-map{flex:none;width:100%;max-width:none;margin:0;grid-template-columns:repeat(4,minmax(0,1fr))}
.dungeon-stage .route-node>span{width:25px;height:25px;font-size:12px}
.dungeon-stage .route-node small{font-size:11px;margin-top:2px;line-height:1.3}
.dungeon-stage .route-node:not(:last-child):after{top:12px}
.dungeon-stage .route-room-stage{flex:1;min-height:35px;position:relative;display:flex;align-items:center;justify-content:center;border:1px solid #a4c5b32b;border-radius:12px;background:linear-gradient(140deg,#1b3635,#101f2a);overflow:hidden;isolation:isolate}
.dungeon-stage .route-room-art{position:absolute;inset:0;z-index:-1;opacity:.7;display:flex;align-items:center;justify-content:center}
.dungeon-stage .route-room-art svg{width:100%;height:100%;object-fit:cover;opacity:.8}
.dungeon-stage .route-room-stage:after{content:'';position:absolute;inset:0;background:linear-gradient(90deg,#07171cb0,#07171c33,#07171cb0);z-index:-1;pointer-events:none}
.dungeon-stage .route-room-title{text-align:center;padding:8px 16px;min-width:0}
.dungeon-stage .route-room-title h2{font:700 clamp(21px,3vw,31px)/1.4 var(--serif);margin:0;color:#f5e2b4;overflow-wrap:anywhere}
.dungeon-stage .route-room-title p{font-size:13px;line-height:1.5;margin:4px 0 0;color:#d2ddcb}
.dungeon-stage .room-choices{flex:none;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0}
.dungeon-stage .room-choice{padding:12px 15px;gap:10px;min-height:75px;border-radius:9px}
.dungeon-stage .room-choice>span{font-size:26px;flex:none}
.dungeon-stage .room-choice>div{min-width:0}
.dungeon-stage .room-choice h3{font-size:19px;line-height:1.4;margin:0 0 3px}
.dungeon-stage .room-choice p{font-size:12px;line-height:1.5;margin:0}
.dungeon-stage .room-choice>b{font-size:12px}
.dungeon-stage .route-party-mini{flex:none;min-height:0;padding:9px 10px;border:1px solid #b2c7ac26;border-radius:10px;background:#14282b}
.dungeon-stage .route-party-mini .section-heading{margin:0 0 5px;min-height:16px}
.dungeon-stage .route-party-mini .section-heading h2{font-size:13px;margin:0}.dungeon-stage .route-party-mini .section-heading>span{font-size:11px}
.dungeon-stage .battle-team{flex:none;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px;margin:0}
.dungeon-stage .team-member{padding:5px 4px;border-radius:7px;display:flex;align-items:center;flex-direction:column;min-height:0}
.dungeon-stage .team-member>small{font-size:10px;line-height:1.3}
.dungeon-stage .team-member .face{width:43px;height:49px;flex:none}
.dungeon-stage .team-member .face>span{width:15px;height:15px;font-size:10px;line-height:14px}
.dungeon-stage .team-member>b{font-size:12px;min-height:0;margin:1px 0 3px;line-height:1.3;max-width:100%;overflow-wrap:anywhere}
.dungeon-stage .team-member .hpbar{width:100%;height:4px;margin:0 0 2px;flex:none}
.dungeon-stage .team-member .resource{font-size:10px;line-height:1.35}
.dungeon-stage .team-member .resource small{font-size:9px}
.dungeon-stage .team-member em{right:3px;top:4px;font-size:10px}
.dungeon-stage .legacy-party-note{flex:none;font-size:11px;line-height:1.4;margin:0;text-align:center;color:var(--muted)}
/* Combat keeps target, actor and all four commands visible at once. */
.dungeon-stage .battle-layout{flex:1;min-height:0;display:flex;align-items:stretch;gap:0}
.dungeon-stage .battle-main{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;gap:7px}
.dungeon-stage .combat-log{display:none}
.dungeon-stage .enemy-stage{flex:1;min-height:80px;max-height:none;gap:10px;padding:9px 12px;border-radius:11px}
.dungeon-stage .enemy{padding:4px 6px;gap:0;max-width:300px;min-height:0;overflow:hidden}
.dungeon-stage .enemy svg{flex:1;min-height:0;width:100%;height:0;max-height:245px;margin:0;object-fit:contain}
.dungeon-stage .enemy-intent{flex:none;font-size:11px;line-height:1.3;min-height:18px;padding:1px 3px;max-width:100%;overflow-wrap:anywhere}
.dungeon-stage .enemy>strong{flex:none;font-size:14px;line-height:1.35;min-height:0;margin-top:2px;max-width:100%;overflow-wrap:anywhere}
.dungeon-stage .enemy>.hpbar{flex:none;height:5px;margin:4px 0 1px}
.dungeon-stage .enemy>small{flex:none;font-size:10px;line-height:1.4}
.dungeon-stage .enemy-status{flex:none;font-size:10px;line-height:1.4;margin-top:2px}
.dungeon-stage .boss-stage .enemy{max-width:600px}.dungeon-stage .boss-stage .enemy>strong{font-size:18px}
.dungeon-stage .battle-instruction{flex:none;display:flex;align-items:center;justify-content:space-between;gap:7px;margin:0;min-height:36px}
.dungeon-stage .battle-instruction>span{font-size:12px;line-height:1.4;min-width:0;overflow-wrap:anywhere}
.dungeon-stage .auto-controls{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:none;width:auto}
.dungeon-stage .battle-speed{gap:3px}.dungeon-stage .battle-speed small{font-size:11px;margin-right:2px}
.dungeon-stage .battle-speed button{min-height:36px;padding:5px 9px;font-size:12px}
.dungeon-stage .auto-button{min-height:36px;padding:5px 12px;font-size:13px;white-space:nowrap}
.dungeon-stage .command-panel{flex:none;margin:0;padding:9px 11px;border-radius:10px}
.dungeon-stage .command-actor{margin:0 0 6px;gap:9px;line-height:1.35}
.dungeon-stage .command-actor b{font-size:14px;overflow-wrap:anywhere}.dungeon-stage .command-actor span{font-size:11px}
.dungeon-stage .battle-help{display:none}
.dungeon-stage .commands{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.dungeon-stage .commands>button{min-height:53px;padding:6px 10px;border-radius:7px}
.dungeon-stage .commands strong{font-size:14px;line-height:1.3}
.dungeon-stage .commands small{font-size:11px;line-height:1.3;margin:2px 0 0 4px}
.dungeon-stage .commands span{font-size:11px;line-height:1.35;margin-top:3px}
.dungeon-stage .battle-outcome{flex:none;margin:0;padding:15px;text-align:center}
.dungeon-stage .battle-outcome h2{font-size:22px;line-height:1.4;margin:5px 0}
.dungeon-stage .battle-outcome p{font-size:12px;line-height:1.5;margin:5px 0 12px}
.dungeon-stage .battle-outcome .defeat-advice{display:none}
.dungeon-stage .battle-outcome button{min-height:44px;padding:9px 12px}
/* The result can retain a long loot list, while reducing empty space. */
body[data-expedition-mode=result] .expedition-result{margin:20px auto 28px}
body[data-expedition-mode=result] .result-seal{font-size:43px;margin:8px}
body[data-expedition-mode=result] .expedition-result h1{font-size:27px;line-height:1.5;margin:8px 0}
body[data-expedition-mode=result] .result-rewards{margin:16px 0;padding:13px}
body[data-expedition-mode=result] .result-actions{margin-top:16px}
#dungeon-details{width:min(760px,calc(100% - 24px));max-height:85dvh;overflow:auto;padding:20px;border:1px solid #dac18266;border-radius:12px;background:#14272d;color:var(--text)}
#dungeon-details::backdrop{background:#020b11cf}
#dungeon-details .combat-log{display:block;margin-top:16px}#dungeon-details .battle-team{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(max-width:700px){
 body:is([data-expedition-mode=route],[data-expedition-mode=battle])>.site-header{padding:6px 12px;min-height:43px}
 body:is([data-expedition-mode=route],[data-expedition-mode=battle]) .brand{font-size:15px}
 body:is([data-expedition-mode=route],[data-expedition-mode=battle])>.tabs{width:calc(100% - 24px);gap:0;justify-content:space-between}
 body:is([data-expedition-mode=route],[data-expedition-mode=battle])>.tabs button{padding-inline:8px;min-height:36px;font-size:12px}
 body:is([data-expedition-mode=route],[data-expedition-mode=battle])>#app{padding:7px 10px 9px}
 .dungeon-stage{gap:6px}.dungeon-stage .dungeon-heading,.dungeon-stage .battle-heading{min-height:38px;gap:6px}
 .dungeon-stage .dungeon-heading h1,.dungeon-stage .battle-heading h1{font-size:21px}.dungeon-stage .dungeon-heading .eyebrow,.dungeon-stage .battle-heading .eyebrow{font-size:9px}
 .dungeon-stage .dungeon-heading button,.dungeon-stage .battle-heading button{font-size:12px;padding-inline:8px}
 .dungeon-stage .room-choices{grid-template-columns:1fr;gap:7px}.dungeon-stage .room-choice{padding:9px 12px;min-height:65px;gap:10px}.dungeon-stage .room-choice h3{font-size:18px}.dungeon-stage .room-choice p{font-size:12px}.dungeon-stage .room-choice>span{font-size:25px}
 .dungeon-stage .route-room-title h2{font-size:22px}.dungeon-stage .route-room-title p{font-size:12px}
 .dungeon-stage .route-party-mini{padding:7px}.dungeon-stage .route-party-mini .section-heading{margin-bottom:4px}
 .dungeon-stage .battle-team{grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
 .dungeon-stage .team-member{display:grid;grid-template-columns:30px minmax(0,1fr);grid-template-rows:auto auto auto auto;align-items:center;padding:4px;column-gap:4px;text-align:left;min-height:64px}
 .dungeon-stage .team-member>small{grid-column:2;grid-row:1;font-size:9px;line-height:1.2}
 .dungeon-stage .team-member .face{grid-column:1;grid-row:1/5;width:30px;height:43px;margin:0}
 .dungeon-stage .team-member>b{grid-column:2;grid-row:2;font-size:11px;margin:0;line-height:1.2}
 .dungeon-stage .team-member .hpbar{grid-column:1/-1;grid-row:5;margin:2px 0 0}
 .dungeon-stage .team-member .resource{grid-column:2;grid-row:3;font-size:9px;line-height:1.2}.dungeon-stage .team-member .resource.mp{grid-row:4}
 .dungeon-stage .team-member .resource small{display:none}
 .dungeon-stage .enemy-stage{min-height:75px;padding:5px;gap:3px}.dungeon-stage .enemy{padding:3px;max-width:none}.dungeon-stage .enemy-intent{font-size:10px;min-height:23px}.dungeon-stage .enemy>strong{font-size:12px;line-height:1.25}.dungeon-stage .enemy>small{font-size:9px}.dungeon-stage .enemy-status{font-size:9px;line-height:1.25}.dungeon-stage .boss-stage .enemy>strong{font-size:16px}
 .dungeon-stage .battle-main{gap:5px}.dungeon-stage .battle-instruction{align-items:stretch;flex-direction:column;gap:3px;min-height:52px}.dungeon-stage .battle-instruction>span{font-size:11px;line-height:1.3}.dungeon-stage .auto-controls{width:100%;gap:5px}.dungeon-stage .battle-speed button{padding:4px 8px;min-height:34px}.dungeon-stage .battle-speed small{display:none}.dungeon-stage .auto-button{padding:4px 10px;min-height:34px;font-size:12px}
 .dungeon-stage .command-panel{padding:7px 8px}.dungeon-stage .command-actor{margin-bottom:4px;gap:7px}.dungeon-stage .command-actor b{font-size:12px}.dungeon-stage .command-actor span{font-size:10px}.dungeon-stage .commands{gap:5px}.dungeon-stage .commands>button{min-height:48px;padding:6px 8px}.dungeon-stage .commands strong{font-size:13px}.dungeon-stage .commands small{font-size:10px}.dungeon-stage .commands span{font-size:10px;line-height:1.25}
}
/* Short phones trade decorative height for reliable action targets. */
@media(max-height:670px) and (max-width:700px){
 .dungeon-stage .team-member{min-height:54px;grid-template-columns:24px minmax(0,1fr);padding:3px;column-gap:3px}.dungeon-stage .team-member .face{width:24px;height:34px}.dungeon-stage .team-member>small{font-size:8px}.dungeon-stage .team-member>b{font-size:10px}.dungeon-stage .team-member .resource{font-size:9px}
 .dungeon-stage .command-actor span{display:none}.dungeon-stage .commands>button{min-height:43px;padding:5px 7px}.dungeon-stage .commands span{display:none}.dungeon-stage .command-panel{padding:6px}.dungeon-stage .commands strong{font-size:13px}
 .dungeon-stage .enemy-status{margin-top:0}.dungeon-stage .enemy>.hpbar{margin-top:2px}.dungeon-stage .enemy-intent{font-size:9px;min-height:20px}
 .dungeon-stage .route-room-title h2{font-size:20px}.dungeon-stage .route-room-title p{font-size:11px}.dungeon-stage .route-room-title{padding:6px 12px}.dungeon-stage .route-room-stage{min-height:32px}
 .dungeon-stage .room-choice{min-height:60px;padding:7px 10px}.dungeon-stage .room-choice h3{font-size:17px}.dungeon-stage .room-choice p{font-size:11px;line-height:1.4}
 .dungeon-stage .battle-outcome{padding:10px}.dungeon-stage .battle-outcome h2{font-size:18px}.dungeon-stage .battle-outcome p{font-size:11px;margin-bottom:8px}
}
/* Landscape uses both axes: targets left, actor/commands right. */
@media(max-height:480px) and (min-width:561px){
 body:is([data-expedition-mode=route],[data-expedition-mode=battle])>.site-header{min-height:34px;padding:3px 12px}
 body:is([data-expedition-mode=route],[data-expedition-mode=battle]) .brand-seal{width:24px;height:24px;font-size:21px;line-height:22px}
 body:is([data-expedition-mode=route],[data-expedition-mode=battle]) .brand{font-size:14px}
 body:is([data-expedition-mode=route],[data-expedition-mode=battle]) .icon-button{min-height:27px;padding:3px 6px}
 body:is([data-expedition-mode=route],[data-expedition-mode=battle])>.tabs button{min-height:30px;padding-block:4px;font-size:12px}
 body:is([data-expedition-mode=route],[data-expedition-mode=battle])>#app{padding:5px 10px 7px}
 .dungeon-stage{gap:4px}.dungeon-stage .dungeon-heading,.dungeon-stage .battle-heading{min-height:32px}.dungeon-stage .dungeon-heading h1,.dungeon-stage .battle-heading h1{font-size:19px}.dungeon-stage .dungeon-heading .eyebrow,.dungeon-stage .battle-heading .eyebrow{display:none}.dungeon-stage .dungeon-heading button,.dungeon-stage .battle-heading button{min-height:30px;padding:3px 8px}
 .dungeon-stage .battle-main{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);grid-template-rows:minmax(0,1fr) auto;gap:5px 9px}
 .dungeon-stage .enemy-stage{grid-column:1;grid-row:1;min-height:0;padding:4px;gap:2px}
 .dungeon-stage .battle-instruction{grid-column:1;grid-row:2;display:flex;flex-direction:column;align-items:stretch;gap:2px;min-height:45px}
 .dungeon-stage .battle-instruction>span{font-size:10px;line-height:1.2}
 .dungeon-stage .auto-controls{width:100%;gap:4px}.dungeon-stage .battle-speed small{display:none}.dungeon-stage .battle-speed button{min-height:30px;padding:3px 6px;font-size:11px}.dungeon-stage .auto-button{min-height:30px;padding:3px 7px;font-size:11px}
 .dungeon-stage .battle-team{grid-column:2;grid-row:1;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;align-content:stretch}
 .dungeon-stage .team-member{display:flex;min-height:0;padding:3px 2px;text-align:center}.dungeon-stage .team-member>small{font-size:8px}.dungeon-stage .team-member .face{width:28px;height:31px}.dungeon-stage .team-member>b{font-size:10px;line-height:1.2;margin:0}.dungeon-stage .team-member .resource{font-size:9px;line-height:1.2}.dungeon-stage .team-member .resource small{display:none}.dungeon-stage .team-member .hpbar{margin:1px 0;height:3px}.dungeon-stage .team-member .face>span{display:none}
 .dungeon-stage .command-panel{grid-column:2;grid-row:2;padding:5px 6px}.dungeon-stage .command-actor{margin-bottom:3px}.dungeon-stage .command-actor b{font-size:11px}.dungeon-stage .command-actor span{display:none}.dungeon-stage .commands{gap:4px}.dungeon-stage .commands>button{min-height:35px;padding:4px 6px}.dungeon-stage .commands strong{font-size:12px}.dungeon-stage .commands small{font-size:9px;margin-top:1px}.dungeon-stage .commands span{display:none}
 .dungeon-stage .enemy-intent{font-size:9px;min-height:18px}.dungeon-stage .enemy>strong{font-size:11px}.dungeon-stage .enemy>small{font-size:9px}.dungeon-stage .enemy-status{font-size:9px;margin:0}.dungeon-stage .boss-stage .enemy>strong{font-size:15px}.dungeon-stage .enemy svg{max-height:none}
 .dungeon-stage .battle-outcome{grid-column:2;grid-row:1/-1;align-self:center;padding:12px}.dungeon-stage .battle-outcome h2{font-size:18px}.dungeon-stage .battle-outcome p{font-size:11px}.dungeon-stage .battle-outcome>span{font-size:10px}.dungeon-stage .battle-outcome button{min-height:38px}
 body[data-expedition-mode=route] .dungeon-stage{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);grid-template-rows:auto auto minmax(0,1fr)}
 .dungeon-stage .dungeon-heading{grid-column:1/-1;grid-row:1}.dungeon-stage .route-map{grid-column:1;grid-row:2}.dungeon-stage .route-room-stage{grid-column:1;grid-row:3;min-height:0}.dungeon-stage .route-room-title h2{font-size:20px}.dungeon-stage .route-room-title p{font-size:11px}
 .dungeon-stage .room-choices{grid-column:2;grid-row:2;grid-template-columns:1fr;gap:5px}.dungeon-stage .room-choice{min-height:50px;padding:5px 8px;gap:7px}.dungeon-stage .room-choice h3{font-size:16px}.dungeon-stage .room-choice p{font-size:10px}.dungeon-stage .room-choice>span{font-size:23px}.dungeon-stage .room-choice>b{font-size:10px}
 .dungeon-stage .route-party-mini{grid-column:2;grid-row:3;align-self:end;padding:5px}.dungeon-stage .route-party-mini .battle-team{grid-template-columns:repeat(6,minmax(0,1fr));gap:3px}.dungeon-stage .route-party-mini .section-heading{margin-bottom:3px}.dungeon-stage .route-party-mini .section-heading h2{font-size:11px}.dungeon-stage .route-party-mini .team-member .face{display:none}.dungeon-stage .route-party-mini .team-member{padding:3px 2px}.dungeon-stage .route-party-mini .team-member>b{font-size:9px}.dungeon-stage .route-party-mini .team-member .resource{font-size:8px}
 .dungeon-stage .legacy-party-note{display:none}
}
@media(max-height:350px) and (min-width:561px){
 .dungeon-stage .team-member .face{display:none}.dungeon-stage .team-member>small{display:none}.dungeon-stage .enemy-status{display:none}.dungeon-stage .commands>button{min-height:34px}.dungeon-stage .route-node>span{width:20px;height:20px}.dungeon-stage .route-node small{font-size:9px}.dungeon-stage .room-choice{min-height:43px}.dungeon-stage .room-choice p{display:none}
}
@media(max-height:600px) and (max-width:700px){
 .dungeon-stage .team-member>small{display:none}
 .dungeon-stage .battle-instruction>span{display:none}.dungeon-stage .battle-instruction{min-height:34px}
 .dungeon-stage .commands>button{min-height:40px}.dungeon-stage .command-actor{margin-bottom:2px}
 .dungeon-stage .enemy svg{min-height:22px}
}
