/* v5.4: one viewport, separate map and touch controls. Loaded after legacy styles. */
@media(max-width:900px),(max-width:1100px) and (max-height:540px){
html{overflow-x:hidden;scroll-padding-top:56px}body{overflow-x:hidden;min-width:0}*,*::before,*::after{box-sizing:border-box}button{touch-action:manipulation}input,select,textarea{font-size:16px!important}button:focus-visible{outline-offset:-3px}
#app{padding:env(safe-area-inset-top) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));width:100%;min-width:0}.main{min-width:0}.top{min-height:52px;flex-wrap:nowrap;margin-bottom:6px;padding:4px 0}.top .ttl{font-size:19px}.top .sub{font-size:10px;margin-left:8px}.top .tr{flex-wrap:nowrap}.top .tr>span{display:none}.top button{min-width:44px;min-height:44px}.top .tr .mini{font-size:12px;padding:5px 8px}
.titleHero{min-height:calc(var(--phone-height,100dvh) - 64px)!important;padding:24px 18px 18px!important;justify-content:flex-end;background-position:62% center}.titleMark{font-size:72px!important;line-height:1.1}.titleKorean{display:none!important}.titleLead{font-size:15px!important;line-height:1.7!important;margin:18px 0}.titleLead p{margin:0}.titleContent{width:100%!important}.titleActions{margin-top:14px!important}.titleActions .btn{min-height:52px;font-size:17px}.titleActions .mini{min-height:44px;font-size:12px}.titleFine{position:static!important;max-width:none!important;margin-top:12px}.diffrow{gap:5px}.diffrow button{min-width:0;padding:8px 3px;min-height:56px;font-size:13px}.diffrow span{font-size:10px!important}
/* Fullscreen tactical layout: header / scrollable map / roster or orders / controls. */
html:has(#app.battleMode),body:has(#app.battleMode){overflow:hidden;height:100%}
#app.battleMode{position:fixed!important;inset:0!important;width:100%!important;height:var(--phone-height,100dvh)!important;max-height:none!important;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)!important;display:block!important;overflow:hidden!important}
#app.battleMode>.body,#app.battleMode #main{display:block!important;height:100%!important;border:0!important;padding:0!important;overflow:hidden!important}
#app.battleMode #bt.mapFirst421{position:relative!important;inset:auto!important;display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:60px minmax(0,1fr) auto 52px!important;gap:0!important;height:100%!important;width:100%!important;max-height:none!important;min-height:0!important;border:0!important;padding:0!important;overflow:hidden!important}
#bt.mapFirst421 .warHeader.hud4221{position:relative!important;inset:auto!important;grid-row:1!important;grid-column:1!important;max-width:none!important;width:100%!important;height:60px!important;min-height:60px!important;max-height:60px!important;margin:0!important;padding:6px 54px 6px 10px!important;gap:7px!important;border:0!important;border-bottom:1px solid #70633f!important;cursor:pointer}
.hudMain4221{display:flex!important;flex-direction:column!important;justify-content:center!important;align-items:flex-start!important;gap:4px!important}.hudTitle4221{font-size:16px!important}.hudEra4221{display:none!important}.hudGoal4221{display:block!important;font-size:11px!important;font-weight:400!important;padding:0!important;border:0!important;width:100%;max-width:100%;line-height:1.2!important}.hudTurn4221{min-width:81px!important;max-width:100px;height:38px!important}.hudTurn4221 strong{font-size:26px!important}.hudTurn4221 small{font-size:10px!important}.hudTurn4221 em{font-size:9px!important}
#bt.mapFirst421 .mapMenu421{top:8px!important;right:6px!important;width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important}
#bt.mapFirst421 .stageShell{position:relative!important;inset:auto!important;grid-column:1!important;grid-row:2!important;display:block!important;width:100%!important;height:100%!important;min-height:0!important;max-height:none!important;border:0!important;overflow:hidden!important;box-shadow:none!important}
#bt.mapFirst421 .stageShell .gridwrap{display:flex!important;align-items:flex-start!important;position:absolute!important;inset:0!important;width:100%!important;height:100%!important;min-height:0!important;max-height:none!important;padding:12px 8px 64px!important;overflow:auto!important;overscroll-behavior:contain;touch-action:pan-x pan-y!important;scrollbar-width:none;background:#111c1a!important}
#bt.mapFirst421 .stageShell #battleGrid{display:block!important;flex:0 0 auto!important;margin:auto!important;max-width:none!important;max-height:none!important}
#bt.mapFirst421 .battleRoster{position:relative!important;inset:auto!important;grid-column:1!important;grid-row:3!important;display:flex!important;flex-wrap:nowrap!important;width:100%!important;max-width:100%!important;height:62px!important;min-height:62px!important;max-height:62px!important;margin:0!important;padding:5px 8px!important;gap:5px!important;border:0!important;border-top:1px solid #52614d!important;overflow-x:auto!important;overflow-y:hidden!important;background:#12231f!important;scroll-snap-type:x proximity}
#bt.mapFirst421 .battleRoster .rosterUnit{flex:0 0 114px!important;width:114px!important;min-width:114px!important;max-width:114px!important;height:50px!important;min-height:50px!important;grid-template-columns:30px minmax(0,1fr)!important;padding:4px!important;scroll-snap-align:start}
#bt.mapFirst421 .battleRoster .rosterUnit .portrait,#bt.mapFirst421 .battleRoster .rosterUnit img{width:30px!important;height:38px!important}#bt.mapFirst421 .battleRoster .rosterUnit b{font-size:12px!important;line-height:16px!important}#bt.mapFirst421 .battleRoster .rosterUnit small{font-size:10px!important;line-height:13px!important}
#bt.mapFirst421 .warTools{position:relative!important;inset:auto!important;grid-column:1!important;grid-row:4!important;display:grid!important;grid-template-columns:1fr 1fr 1fr .7fr 1.4fr!important;width:100%!important;height:52px!important;max-width:100%!important;margin:0!important;padding:4px 6px!important;gap:4px!important;border:0!important;background:#0b1615!important}
#bt.mapFirst421 .warTools .mini{min-width:0!important;min-height:44px!important;font-size:12px!important;padding:4px 2px!important;white-space:nowrap!important}.warTools #bEnd{background:#dcc48c!important;color:#18251e!important;border:1px solid #ead69d!important;font-weight:700!important}.warTools #bEnd:disabled{opacity:.45}
#bt.mapFirst421 .dockNav422,#bt .mapMsg421,#bt .battleStatusline{display:none!important}
#bt .camera423{bottom:8px!important;right:8px!important;top:auto!important;padding:2px!important;gap:3px!important;background:#101d1ded!important;border-radius:8px}.camera423 span{display:none!important}#bt .camera423 button{width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;font-size:19px!important;border-radius:5px}#bt .camera423 button.phoneMap54{font-size:12px!important}
#bt .mini415{display:none!important;top:8px!important;right:8px!important;bottom:auto!important;width:136px!important;max-width:40%!important;height:auto!important;min-height:44px!important;z-index:81!important}#bt.phoneMapOpen54 .mini415{display:block!important}
#deadline532{top:8px!important;left:8px!important;max-width:calc(100% - 24px)!important;font-size:11px!important;border-radius:4px;z-index:75!important}#bt.phoneMapOpen54 #deadline532{max-width:calc(100% - 160px)!important}
#bt>.selectionActions{position:relative!important;inset:auto!important;grid-column:1!important;grid-row:3!important;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;height:62px!important;width:100%!important;margin:0!important;padding:6px!important;gap:6px!important;background:#14251f;border-top:1px solid #887349;z-index:86}
#bt>.selectionActions button{min-height:48px!important;font-size:14px!important}#bt:has(>.selectionActions)>.battleRoster,#bt:has(>.commandPopup)>.battleRoster{display:none!important}
#bt>.commandPopup,#bt>.commandPopup.mobileDock,#bt>.commandPopup.hfSkillPopup429{position:relative!important;inset:auto!important;grid-column:1!important;grid-row:3!important;display:block!important;width:100%!important;max-width:none!important;height:auto!important;min-height:0!important;max-height:min(46dvh,350px)!important;margin:0!important;border:0!important;border-top:2px solid #ad9255!important;border-radius:0!important;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain;box-shadow:none!important;z-index:86!important;background:#17251f!important}
.commandPopup .popupHead{min-height:44px!important;flex-shrink:0;padding:3px 10px!important;font-size:14px!important}.commandPopup .popupHead button{width:44px!important;min-height:40px!important}.commandPopup .popupBody{min-height:0!important;max-height:none!important;overflow:visible!important;padding:8px!important}.commandPopup .popupBody:empty{display:none!important}.commandPopup .commandPinnedActions{position:static!important}.commandPopup .popupActions{gap:5px!important;grid-template-columns:repeat(3,minmax(0,1fr))!important}.commandPopup .popupActions button{min-height:44px!important;font-size:13px!important;padding:6px 4px!important}.commandPinnedActions{flex:none;padding:5px 8px!important;background:#18231d!important}.commandPopup .confirmPinned .popupActions{grid-template-columns:1fr 1fr!important}.commandPopup kbd,.commandPopup .popupFoot,.selectionActions kbd{display:none!important}.commandPopup .hfSkillGrid429{grid-template-columns:repeat(4,minmax(0,1fr))!important;max-height:none!important}.hfSkillGrid429 .popupSkill{min-height:76px!important}.hfSkillPopup429 .skillList{max-height:none!important}.hfSkillInfo429{min-height:0!important}.hfSkillIcon429{width:36px!important;height:36px!important}.commandPopup .popupSkill small{font-size:11px!important}
.unitInspect432{left:8px!important;right:8px!important;top:auto!important;bottom:calc(120px + env(safe-area-inset-bottom))!important;width:auto!important;max-height:40dvh;overflow:auto}.hoverChip{display:none!important}.tipbox{box-sizing:border-box;width:min(340px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:45dvh;overflow:hidden;font-size:12px;line-height:1.4}.tipbox p{margin:5px 0}
/* Dialogue always owns its own bounded panel, with tappable 44px controls. */
.fieldTalk432,.hfBattleTalk429,.intro431{position:fixed!important;inset:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)!important;z-index:220!important}
.fieldTalk432 .fieldDialog432,.hfBattleTalk429 .hfBattleDialog429{left:6px!important;right:6px!important;bottom:6px!important;grid-template-columns:60px minmax(0,1fr)!important;min-height:124px!important;max-height:46dvh!important;overflow:auto!important;border-radius:4px;padding:0!important;background:#112451f7!important}
.fieldTalk432 .fieldFace432{padding:5px!important}.fieldTalk432 .fieldFace432 .portrait{width:50px!important;height:68px!important}.fieldTalk432 .fieldCopy432{padding:8px!important}.fieldTalk432 .fieldCopy432 b{font-size:16px!important}.fieldTalk432 .fieldCopy432 p{font-size:15px!important;line-height:1.65!important;margin-top:6px!important;overflow-wrap:anywhere}.fieldTalk432 .fieldCopy432 em{font-size:10px!important;padding-top:5px}
.v5-story{display:flex!important;flex-direction:column!important;min-height:calc(var(--phone-height,100dvh) - 66px)!important;overflow:hidden!important}.v5-story .vista{min-height:0!important;height:100%!important}.v5-story .sceneHeading{top:12px!important;bottom:auto!important;left:10px!important;max-width:calc(100% - 20px)!important;padding:7px 10px!important}.v5-story .sceneHeading h1{font-size:17px!important}.v5-story .sceneHeading p{font-size:11px!important;max-width:none!important}.v5-story .dialogue{top:auto!important;bottom:auto!important;margin:auto 7px 8px!important;width:calc(100% - 14px)!important;max-height:54dvh!important;min-height:0!important;display:grid!important;grid-template-columns:58px minmax(0,1fr)!important;gap:10px!important;padding:10px!important;overflow:auto!important;border-width:3px!important}.v5-story .dialogue>.portrait{width:58px!important;height:76px!important;margin:0!important;float:none!important}.v5-story .speaker{margin:0!important;min-height:0!important;font-size:17px!important;line-height:1.3!important}.v5-story .speaker small{font-size:10px!important}.v5-story .dialogText{font-size:16px!important;line-height:1.7!important;padding:5px 0!important;overflow-wrap:anywhere!important}.v5-story .dialogControls{margin-top:8px!important;gap:4px!important}.v5-story .dialogControls button{font-size:13px!important;min-height:44px!important;padding:5px 10px!important}.v5-story .storyChoice{padding:8px!important;min-height:48px!important}.v5-story .storyChoice .choiceBody{font-size:14px!important}.v5-story .v51-actors{bottom:30%!important}
.v5-camp header{padding:12px 14px!important}.v5-camp h1{font-size:24px!important}.v5-camp p{font-size:12px!important}.v5-hall,.v5-hall:has(.v51-person:nth-child(10)),.v5-hall:has(.v51-person:nth-child(11)){height:var(--phone-camp-height,390px)!important;background-position:center!important}.v5-hall-cast.camp532{inset:36px 8px 8px!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important;align-content:end}.camp532 .v51-person{height:108px!important}.camp532 .v51-person>img,.camp532 .v51-person>.spr{width:72px!important;height:82px!important}.camp532 .v51-person>span{height:24px!important;font-size:12px!important;padding:2px 6px!important}.v5-camp nav{padding:8px!important}.v5-camp nav button{width:100%;min-height:48px;padding:8px 12px!important}.v5-camp nav button b{font-size:15px}.v5-camp nav button span{font-size:11px}.campBody{padding:10px!important}.campFoot{position:sticky;bottom:0;z-index:31;padding:8px!important;background:#12221ff2!important}.campFoot .btn{margin:0!important;min-height:48px!important}
.modal{padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))!important}.mbox{max-height:calc(var(--phone-height,100dvh) - 20px)!important;width:100%!important;min-width:0!important;padding:10px!important;border-radius:8px!important}.mh{flex-shrink:0;min-height:44px!important;margin-bottom:6px;font-size:17px!important}.mh button{min-height:44px!important;min-width:44px!important}.mb{min-height:0;overflow:auto!important;overscroll-behavior:contain;overflow-wrap:anywhere}.briefLayout{grid-template-columns:52px minmax(0,1fr)!important;gap:10px!important}.briefLayout .portrait{width:52px!important;height:70px!important}.briefLayout h2{font-size:22px!important}.briefGoal{font-size:14px!important}.briefHint{font-size:13px!important;line-height:1.65!important}.formationList{display:grid!important;grid-template-columns:1fr!important;gap:6px!important;margin:12px 0!important}.formation{display:grid!important;grid-template-columns:90px 1fr;gap:3px 8px;padding:9px!important;min-height:56px!important;text-align:left!important}.formation b{grid-row:1/3;font-size:16px!important;align-self:center}.formation span{font-size:12px!important}.formation span:last-child{font-size:11px!important}.v5-camp-talk{grid-template-columns:64px minmax(0,1fr)!important;gap:10px!important;padding:8px!important}.v5-talk-face .portrait{width:64px!important;height:84px!important}.v5-camp-talk p{font-size:16px!important;line-height:1.7!important}.v5-camp-talk b{font-size:18px!important}.v5-camp-talk small{font-size:11px!important}.v5-conversation .mbox{max-height:65dvh!important}.v5-conversation{align-items:flex-end!important}.v5-council{display:grid;gap:8px}.v5-council button{width:100%;min-height:66px}
#cinemaRoot{height:var(--phone-height,100dvh)!important}.cinText{font-size:17px!important;line-height:1.65!important}.cinWords{min-height:0!important;max-height:35dvh;overflow:auto!important;padding:10px 14px!important}.cinControls button,.cinHead button{min-height:44px!important}.cinHead h2{font-size:16px!important}
#labLauncher{bottom:auto!important;left:auto!important;right:8px!important;top:calc(68px + env(safe-area-inset-top))!important;transform:none!important;font-size:11px!important;padding:5px 8px!important;min-height:36px!important;opacity:.88}#labPanel{padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)!important;height:var(--phone-height,100dvh)}.labShell{height:100%!important;max-height:none!important;border:0!important;border-radius:0!important}.labHeader{padding:8px 12px!important;gap:6px;flex-shrink:0}.labHeader h1{font-size:18px!important}.labHeader small{font-size:10px!important}.labHeader button{min-width:44px;padding:6px!important;font-size:12px!important}.labTabs{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px!important;padding:6px!important;flex-shrink:0}.labTabs button{padding:5px 2px!important;min-width:0;min-height:44px;font-size:12px!important;white-space:nowrap}.labBody{padding:12px!important}.labBody h2{font-size:17px!important}.labCards{grid-template-columns:1fr!important}.labCard{padding:12px!important}.labControls{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important}.labControls label{display:flex;flex-direction:column;align-items:stretch!important;min-width:0}.labControls input,.labControls select{max-width:100%;min-width:0!important}.labGallery{grid-template-columns:repeat(2,minmax(0,1fr))!important}.labBody button{min-height:44px;min-width:0}.labToolbar{gap:5px!important}
}
@media(max-width:1100px) and (max-height:540px) and (orientation:landscape){
#app.battleMode #bt.mapFirst421{grid-template-columns:minmax(0,1fr) 248px!important;grid-template-rows:52px minmax(0,1fr) 100px!important}
#bt.mapFirst421 .warHeader.hud4221{grid-column:1/-1!important;height:52px!important;min-height:52px!important;max-height:52px!important}.hudMain4221{flex-direction:row!important;align-items:center!important}.hudGoal4221{width:auto!important}.hudTitle4221{font-size:15px!important}
#bt.mapFirst421 .stageShell{grid-column:1!important;grid-row:2/4!important}
#bt.mapFirst421 .battleRoster{grid-column:2!important;grid-row:2!important;display:grid!important;grid-template-columns:1fr 1fr!important;align-content:start!important;height:100%!important;max-height:none!important;min-height:0!important;overflow-y:auto!important;overflow-x:hidden!important;padding:5px!important}
#bt.mapFirst421 .battleRoster .rosterUnit{width:100%!important;min-width:0!important;max-width:none!important}
#bt.mapFirst421 .warTools{grid-column:2!important;grid-row:3!important;height:100px!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;align-content:end!important}.warTools #bEnd{grid-column:2/4}
#bt>.commandPopup,#bt>.commandPopup.mobileDock,#bt>.commandPopup.hfSkillPopup429{grid-column:2!important;grid-row:2!important;height:100%!important;max-height:100%!important;border-left:1px solid #807047!important;border-top:0!important}.commandPopup .popupHead{font-size:12px!important}.commandPopup .popupBody{padding:5px!important}.commandPopup .popupActions{grid-template-columns:1fr 1fr!important}.commandPopup .hfSkillGrid429{grid-template-columns:1fr 1fr!important}.commandPopup .confirmBody{display:block!important}.commandPopup .matchupIcons{display:none!important}.commandPopup .forecastLuck{display:none!important}.commandPopup .damageForecast{margin:3px!important}.commandPopup .counterForecast{font-size:11px!important}.commandPopup .attackSummary .portrait{width:28px!important;height:34px!important}
#bt>.selectionActions{grid-column:2!important;grid-row:2!important;grid-template-columns:1fr!important;height:auto!important;align-content:center!important;padding:10px!important}#bt:has(>.selectionActions)>.battleRoster,#bt:has(>.commandPopup)>.battleRoster{display:none!important}
#bt .camera423{bottom:5px!important;right:5px!important}.fieldTalk432 .fieldDialog432{max-width:620px;margin:0 auto;min-height:110px!important;max-height:65dvh!important}.unitInspect432{left:auto!important;right:8px!important;top:60px!important;bottom:auto!important;width:236px!important;max-height:calc(100dvh - 70px)}
.titleHero{min-height:480px!important}.v5-story{min-height:calc(var(--phone-height,100dvh) - 62px)!important}.v5-story .dialogue{max-height:67dvh!important;width:55%!important;margin:10px 8px 8px auto!important}.v5-story .sceneHeading{max-width:40%!important}.v5-story .v51-actors{width:45%}.v5-conversation .mbox{max-height:90dvh!important}.v5-hall-cast.camp532{grid-template-columns:repeat(5,minmax(0,1fr))!important}.v5-hall{height:310px!important}.labCards{grid-template-columns:repeat(2,minmax(0,1fr))!important}.labHeader small{display:none}.labHeader{padding:4px 12px!important}
}

@media(max-width:900px),(max-width:1100px) and (max-height:540px){
#bt .commandPopup .hfCommandHead430{display:none!important}.commandPopup .v5-role{display:none!important}.commandPopup .mpGauge416{padding:4px 7px!important;margin:0 0 4px!important;background:#233a33!important;color:#e4dbbe!important;display:flex!important;align-items:center;gap:8px;min-height:28px}.commandPopup .mpGauge416>div{display:flex;gap:8px;min-width:98px}.commandPopup .mpGauge416>em{flex:1}.commandPopup .mpGauge416>small{display:none!important}.commandPopup .quickStats{color:#dbdcc9!important;margin:4px 0!important}.commandPopup .popupHead{background:#233c31!important}.formation b{letter-spacing:0!important;white-space:nowrap!important;font-family:inherit!important;font-size:14px!important}.formation{grid-template-columns:100px minmax(0,1fr)!important}
body:has(.fieldTalk432) .unitInspect432,body:has(.modal) .unitInspect432{display:none!important}
}
@media(max-width:900px),(max-width:1100px) and (max-height:540px){
#bt .commandPopup .skillList{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:8px!important;width:100%!important;min-width:0!important;overflow:visible!important}#bt .commandPopup .hfSkillGrid429{width:100%!important;min-width:0!important;gap:5px!important}#bt .commandPopup .hfSkillInfo429{width:100%!important;min-width:0!important;padding:8px!important}#bt .commandPopup .popupSkill{min-width:0!important;width:100%!important;padding:5px!important}#bt .commandPopup .mpGauge416 span,#bt .commandPopup .mpGauge416 b{color:#e2e9d7!important}.hfSkillInfo429 h3{font-size:18px!important}.hfSkillInfo429 .hfSkillDesc429{font-size:13px!important}
}
@media(max-width:900px),(max-width:1100px) and (max-height:540px){
.top .ttl{white-space:nowrap;flex-shrink:0}.top .sub{display:none!important}.top>div:first-child{min-width:0;flex:1}.top .tr{flex:0 0 auto;gap:4px!important}.top:has(#btnMenu) #btnRel,.top:has(#btnMenu) #btnCodex,.top:has(#btnMenu) #btnRecord,.top:has(#btnMenu) #btnHelp{display:none!important}.top:has(#btnMenu) .mini{white-space:nowrap!important;font-size:11px!important;padding:4px 7px!important}.v5-hall{background-size:auto 180%!important;background-position:center bottom!important}
}
@media(max-width:900px),(max-width:1100px) and (max-height:540px){
.v5-story .dialogue{flex:0 0 auto!important;align-self:stretch!important}.v5-camp-talk p{min-height:0!important;margin:8px 0!important}.v5-camp-talk small{display:block!important;margin-top:12px!important}body:has(.v5-conversation) #labLauncher,body:has(.fieldTalk432) #labLauncher{display:none!important}
}
@media(max-width:900px),(max-width:1100px) and (max-height:540px){
#app.battleMode{height:100dvh!important}.commandPinnedActions .popupActions{width:100%!important}.commandPopup .popupActions .wide{grid-column:1/-1!important;width:100%!important}.commandPopup #menuBack{white-space:nowrap!important}body:has(#bt) #labLauncher{left:8px!important;right:auto!important}body:has(.modal) #labLauncher{display:none!important}.approachGrid{grid-template-columns:1fr!important;gap:8px!important}.approachIntro{gap:10px!important;margin-bottom:10px!important}.approachIntro p{font-size:15px!important}.approachIntro .portrait{width:56px!important;height:76px!important}.approachCard{padding:12px!important}.approachCard b{font-size:20px!important}.approachCard strong{font-size:15px!important;margin:6px 0!important}.approachCard p{font-size:13px!important;margin:4px 0!important}.approachCard small{font-size:11px!important}
}
@media(max-width:900px),(max-width:1100px) and (max-height:540px){
.unitInspect432:not(.hidden){display:block!important}.unitInspect432.hidden{display:none!important}#bt .camera423 .phoneInfo54{font-size:12px!important}.phoneUnitInfo54{display:flex;gap:12px;align-items:center}.phoneUnitInfo54 .portrait{flex:none;width:64px!important;height:78px!important}.phoneUnitInfo54 p{font-size:13px;line-height:1.7}.commandPopup .quickStats strong,.commandPopup .quickStats span{color:#dfdfc9!important}
}
@media(max-width:900px),(max-width:1100px) and (max-height:540px){
#bt .commandPopup .popupBody,#bt .commandPopup .attackSummary strong,#bt .commandPopup .attackSummary small,#bt .commandPopup .damageForecast small,#bt .commandPopup .killChance,#bt .commandPopup .counterForecast,#bt .commandPopup .counterForecast span,#bt .commandPopup .forecastLuck,#bt .commandPopup .matchupIcons,#bt .commandPopup .matchupIcons span,#bt .commandPopup .matchupIcons b{color:#e8e1cc!important}#bt .commandPopup .damageForecast .number{color:#ffbd91!important}#bt .commandPopup .popupActions button{background:#2a4035!important;color:#f6ebd0!important;border:1px solid #879078!important}#bt .commandPopup .popupActions button.attack{background:#854431!important;border-color:#bc8b68!important}#bt .commandPopup .popupActions button.primary{background:#365d46!important}
#bt .commandPopup .confirmBody .mpGauge416{grid-column:1/-1!important;grid-row:1!important}#bt .commandPopup .confirmBody .matchupIcons{grid-column:1!important;grid-row:2!important}#bt .commandPopup .confirmBody .attackSummary{grid-column:2!important;grid-row:2!important}#bt .commandPopup .confirmBody .damageForecast{grid-column:1!important;grid-row:3!important}#bt .commandPopup .confirmBody .counterForecast{grid-column:2!important;grid-row:3!important}#bt .commandPopup .confirmBody .hpbig{grid-column:1/-1!important;grid-row:4!important}
}

/* v5.5.1: explicit touch orders and consistent text controls. */
@media(max-width:900px),(max-width:1100px) and (max-height:540px){
#bt .camera423 .phoneMap54,#bt .camera423 .phoneInfo54{font-size:12px!important;line-height:1.2!important}
#bt>.selectionActions{grid-template-columns:repeat(4,minmax(0,1fr))!important;height:88px!important;gap:4px!important;align-content:center}
#bt>.selectionActions>button{min-width:0;min-height:44px;padding:5px!important;font-size:13px!important}
#bt>.selectionActions>.phoneOrderHint551{grid-column:1/-1;font-size:11px;line-height:1.4;text-align:center;color:#eee2c6;white-space:normal}
}
@media(max-width:1100px) and (max-height:540px) and (orientation:landscape){
#bt>.selectionActions{grid-template-columns:1fr 1fr!important;height:100%!important}
}

/* Keep attack confirmation reachable while only its details scroll. */
@media(max-width:1050px){
#bt>.commandPopup,#bt>.commandPopup.mobileDock{display:flex!important;flex-direction:column!important;overflow:hidden!important}
#bt>.commandPopup .popupBody{overflow-y:auto!important;min-height:0!important;flex:1 1 auto!important}
#bt>.commandPopup .commandPinnedActions{flex:0 0 auto!important}
#bt .commandPopup .confirmBody .forecastRemain58{grid-column:1/-1!important;grid-row:5!important;margin:3px 0!important;padding:4px 7px!important}
#bt .commandPopup .confirmBody .forecastRemain58 small{display:none}
}
