/* Landscape phone UI: density belongs to the layout, never a page-wide zoom. */
.world-tools{display:contents}
.battle-tools-menu{display:contents}
[data-battle-tools],.battle-tools-context{display:none}
[data-world-toggle],.creation-class-summary{display:none}
.creation-page-body{min-width:0}
.creation-actions{display:flex;align-items:center;gap:10px}
.creation-actions>button{flex:none}
.creation-progress{flex:1;font-size:12px;color:#b9c6c5}
.sp-delete-actions{display:flex;justify-content:center;gap:8px}
/* A completed wish needs a receipt, while its full entry stays in the journal. */
body[data-chronicle] #game #toast.milestone-receipt{top:var(--milestone-top,82px);bottom:auto;left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100% - 24px);padding:5px 10px;font:12px/1.5 "Microsoft YaHei",sans-serif;letter-spacing:0;pointer-events:none}
body[data-chronicle] #game[data-mobile=true][data-orientation=landscape] #toast.milestone-receipt{font-size:11px}
/* Strategies sit above desktop attacks; phone options open between thumb lanes. */
body[data-chronicle] #game:not([data-mobile=true]) #chronicle-tactics{bottom:150px;left:50%;right:auto;transform:translateX(-50%)}
#tactics-toggle{display:none}
#tactics-options{display:contents}
body[data-chronicle] #game[data-mobile=true] #chronicle-tactics{left:50%;right:auto;top:auto;bottom:var(--edge-bottom);transform:translateX(-50%);width:44px;max-width:none;z-index:35}
body[data-chronicle] #game[data-mobile=true] #tactics-toggle{display:block;width:44px;height:44px;padding:0;flex:none}
body[data-chronicle] #game[data-mobile=true] #tactics-toggle[aria-expanded=true]{border-color:#e3c887;background:#3a4846}
#game[data-mobile=true] #tactics-options{display:none}
#game[data-mobile=true] #chronicle-tactics.expanded #tactics-options{position:absolute;display:grid;grid-template-columns:repeat(2,44px);gap:4px;bottom:52px;left:50%;transform:translateX(-50%);padding:6px;background:#1c303df7;border:1px solid #9a956b;border-radius:5px}
body[data-chronicle] #game[data-mobile=true] #tactics-options button{width:44px;height:44px;min-height:44px;min-width:44px;padding:0;border-radius:4px}

#game[data-mobile=true]{--phone-font:12px;--edge-left:max(10px,env(safe-area-inset-left));--edge-right:max(10px,env(safe-area-inset-right));--edge-top:max(6px,env(safe-area-inset-top));--edge-bottom:max(12px,env(safe-area-inset-bottom));font-size:12px}
#game[data-mobile=true] #chronicle-interface{font:12px/1.5 "Microsoft YaHei","PingFang SC",sans-serif}
/* Keep the thumb lanes empty. Secondary actions share the upper-left menu row. */
#game[data-mobile=true][data-orientation=landscape] .hud-top{grid-template-columns:172px minmax(0,1fr) 142px;gap:5px 10px}
body[data-chronicle] #game[data-mobile=true] .vitals{padding:5px 7px;gap:6px;min-height:0}
#game[data-mobile=true] .hero-name{margin-bottom:3px;font-size:12px}
#game[data-mobile=true] .portrait{width:28px;height:34px}
#game[data-mobile=true] .discipline-resource{font-size:10px;line-height:1.3;margin-top:3px}
#game[data-mobile=true] #martial-rhythm{position:absolute;left:7px;right:7px;bottom:3px;height:3px;padding:0;margin:0;border:0;background:none}
#game[data-mobile=true] #martial-rhythm>span,#game[data-mobile=true] #martial-rhythm .flow-pips{display:none}
#game[data-mobile=true] #chronicle-shortcuts button{font-size:12px;min-width:44px;padding:6px 9px}
#game[data-mobile=true] .world-shell{top:var(--shortcut-top,74px);left:calc(var(--edge-left) + 56px);bottom:auto;max-width:none;display:block;z-index:36}
#game[data-mobile=true] .world-shell>[data-world-toggle]{display:block;font:12px/1.3 "Microsoft YaHei",sans-serif;min-width:44px;min-height:44px;padding:6px 9px}
#game[data-mobile=true] .world-shell .world-tools{display:none}
#game[data-mobile=true] .world-shell.expanded .world-tools{position:absolute;display:grid;grid-template-columns:repeat(4,1fr);gap:6px;top:0;left:52px;width:284px;padding:8px;background:#1c303df7;border:1px solid #9a956b;border-radius:5px;box-shadow:0 6px 20px #07151b80}
#game[data-mobile=true] .world-shell .world-tools small{grid-column:1/-1;padding:0;background:none;font-size:10px;line-height:1.4}
#game[data-mobile=true] .world-shell .world-tools button{font:12px/1.35 "Microsoft YaHei",sans-serif;padding:5px 8px;min-height:44px}
#game[data-mobile=true] .world-shell .world-invites{grid-column:1/-1}
#game[data-mobile=true] .world-shell .world-invites:empty{display:none}
#game[data-mobile=true] .world-shell .world-invites button{width:100%;text-align:left}
#game[data-mobile=true] #joystick{left:max(18px,env(safe-area-inset-left));bottom:calc(var(--edge-bottom) + 14px);width:88px;height:88px}
#game[data-mobile=true] #joystick span{font-size:10px;bottom:-17px}
#game[data-mobile=true] .skillbar{bottom:calc(var(--edge-bottom) + 8px);right:max(14px,env(safe-area-inset-right))}
#game[data-mobile=true] .skill span{font-size:10px;line-height:12px;top:calc(100% + 3px)}
#game[data-mobile=true] .interact{font:12px/1.35 "Microsoft YaHei",sans-serif;max-width:160px;min-height:44px;padding:6px 9px}
#game[data-mobile=true] #chronicle-save{font-size:10px;left:132px;bottom:var(--edge-bottom);padding:3px 6px;max-width:130px}
#game[data-mobile=true] #action-track{min-height:44px;width:44px;padding:4px;font-size:10px}
#game[data-mobile=true] #action-track svg{width:20px;height:20px}
/* Share a row above the skills; tracking must never cover interaction text. */
#game[data-mobile=true][data-orientation=landscape]{--interact-lift:169px}
#game[data-mobile=true][data-orientation=landscape][data-short=true]{--interact-lift:145px}
body[data-chronicle] #game[data-mobile=true][data-orientation=landscape] #interact{right:var(--edge-right);bottom:calc(var(--edge-bottom) + var(--interact-lift));max-width:168px;height:44px;min-height:44px;font-size:12px;padding:6px 9px}
#game[data-mobile=true][data-orientation=landscape] #interact span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body[data-chronicle] #game[data-mobile=true][data-orientation=landscape] #action-track{left:auto;top:auto;right:calc(var(--edge-right) + 176px);bottom:calc(var(--edge-bottom) + var(--interact-lift));transform:none;height:44px}
#game[data-mobile=true] #cultivation-track>span{font-size:10px}
/* One compact sheet shell for every personal panel, with real scroll space. */
body[data-chronicle] #game[data-mobile=true] #chronicle-panel{padding:6px var(--edge-right) 6px var(--edge-left)}
body[data-chronicle] #game[data-mobile=true] #chronicle-panel .chronicle-sheet{height:100%;max-height:100%;grid-template-rows:44px minmax(0,1fr) auto}
body[data-chronicle] #game[data-mobile=true] #chronicle-panel .chronicle-sheet>header{padding:0 8px;gap:6px;min-height:44px}
body[data-chronicle] #game[data-mobile=true] .chronicle-sheet>header:before{height:18px;width:2px;margin-right:2px}
body[data-chronicle] #game[data-mobile=true] #chronicle-title{font-size:18px;line-height:1.2;margin:0;letter-spacing:1px}
#game[data-mobile=true] #chronicle-interface button{font-size:12px;line-height:1.4;min-height:44px;padding:6px 10px}
#game[data-mobile=true] #chronicle-close{width:44px;height:44px;font-size:22px!important}
#game[data-mobile=true] #chronicle-body{font-size:12px;line-height:1.5;padding:10px 14px;scroll-padding-block:10px}
#game .sp-dungeon-more{text-align:left;border-top:1px solid #d1bb8355;margin-top:8px}
#game .sp-dungeon-more>summary{min-height:44px;box-sizing:border-box;align-content:center;cursor:pointer;color:#263d3e}
#game .sp-dungeon-more>summary:focus-visible{outline:2px solid #263d3e;outline-offset:-2px}
#game .sp-dungeon-sheet>.sp-actions>button{width:100%;min-height:44px}
@media (orientation:landscape) and (max-height:520px){
 #game[data-mobile=true] #chronicle-body .sp-dungeons{min-height:0;height:100%;grid-template-columns:minmax(0,1fr) minmax(180px,38%);gap:8px;padding:6px;overflow:hidden}
 #game[data-mobile=true] .sp-dungeons .sp-portals{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;align-content:start;min-width:0;min-height:0;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y}
 #game[data-mobile=true] .sp-dungeons .sp-portal{min-width:0;min-height:44px;padding:5px}
 #game[data-mobile=true] .sp-dungeons .sp-portal>i{width:30px;height:32px;margin-bottom:2px}
 #game[data-mobile=true] #chronicle-body .sp-dungeon-sheet{min-height:0;max-height:100%;padding:6px 8px;overscroll-behavior:contain;touch-action:pan-y}
 #game[data-mobile=true] #chronicle-body .sp-dungeon-sheet>h3{font-size:14px;margin:0 0 4px!important}
 #game[data-mobile=true] #chronicle-body .sp-dungeon-cost{font-size:11px;margin:0 0 5px}
 #game[data-mobile=true] .sp-dungeon-more{margin-top:4px}
}
#game[data-mobile=true] #chronicle-body p{font-size:12px;line-height:1.55;margin:4px 0 10px}
#game[data-mobile=true] #chronicle-body h3{font-size:16px;line-height:1.35}
#game[data-mobile=true] #chronicle-body h2,#game[data-mobile=true] #chronicle-body h4{font-size:15px}
#game[data-mobile=true] #chronicle-body small{font-size:11px;line-height:1.45}
#game[data-mobile=true] #chronicle-body button>b{font-size:13px;margin-bottom:1px}
#game[data-mobile=true] #chronicle-body button>span{font-size:11px;line-height:1.4}
#game[data-mobile=true] #chronicle-body section{margin-bottom:12px}
#game[data-mobile=true] #chronicle-body article{padding:10px 0}
#game[data-mobile=true] #chronicle-body form{gap:10px}
#game[data-mobile=true] #chronicle-body fieldset{padding:8px 0}
#game[data-mobile=true] #chronicle-body input:not([type=radio]),#game[data-mobile=true] #chronicle-body select{font-size:16px;min-height:44px;padding:6px 8px;margin-top:3px}
#game[data-mobile=true] #chronicle-body .form-actions,#game[data-mobile=true] #chronicle-body .detail-shortcuts{gap:6px;margin:8px 0}
#game[data-mobile=true] #chronicle-body .creation-options{gap:8px}
#game[data-mobile=true] #chronicle-body .creation-options>label{padding:8px;gap:7px;min-height:44px}
#game[data-mobile=true] #chronicle-body .creation-options small{margin-top:3px}
#game[data-mobile=true] #chronicle-body .creation-options b{font-size:13px}
#game[data-mobile=true] #chronicle-footer{font-size:10px;padding:3px 12px;max-height:48px;overflow:auto}
#game[data-mobile=true] #chronicle-panel[data-panel=create] #chronicle-footer,#game[data-mobile=true] #chronicle-panel[data-panel=delete] #chronicle-footer,#game[data-mobile=true] #chronicle-panel[data-panel=auth] #chronicle-footer{display:none}
/* Seven steps remain editable; only the content scrolls, never the next button. */
#game[data-mobile=true] #chronicle-panel[data-panel=create] #chronicle-body{overflow:hidden;padding:6px 12px}
#game[data-mobile=true] #chronicle-create{height:100%;min-height:0;display:grid;grid-template-rows:44px minmax(0,1fr) auto auto;gap:6px}
#game[data-mobile=true] #chronicle-create .creation-stepbar{flex-wrap:nowrap;gap:4px;min-width:0}
#game[data-mobile=true] #chronicle-create .creation-stepbar button{flex:1;min-width:44px;padding:4px 2px;white-space:nowrap;font-size:11px!important}
#game[data-mobile=true] #chronicle-create .creation-stepbar button span{display:inline;font-size:10px;opacity:.6}
#game[data-mobile=true] .creation-page-body{min-height:0;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:thin}
#game[data-mobile=true] #chronicle-create .creation-actions{grid-row:4;border-top:1px solid #a29a7055;padding-top:4px;gap:8px;background:#24363f}
#game[data-mobile=true] #chronicle-create .chronicle-error{grid-row:3;font-size:11px;margin:0}
#game[data-mobile=true] #chronicle-create .chronicle-error:empty{display:none}
#game[data-mobile=true] #chronicle-create .creation-progress{font-size:10px}
#game[data-mobile=true] #chronicle-create .creation-fields{grid-template-columns:1.4fr 1fr 1fr;padding:10px 0;gap:12px}
#game[data-mobile=true] #chronicle-create .creation-stats{grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}
#game[data-mobile=true] #chronicle-create .discipline-choice{padding:5px 0;margin:0}
#game[data-mobile=true] #chronicle-create .discipline-cards{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
#game[data-mobile=true] #chronicle-create .discipline-cards>label{padding:4px 6px 6px;min-height:92px;display:flex;align-items:center}
#game[data-mobile=true] #chronicle-create .discipline-cards>label:has(input:checked){padding:3px 5px 5px}
#game[data-mobile=true] #chronicle-create .discipline-portrait{height:64px;width:64px}
#game[data-mobile=true] #chronicle-create .discipline-cards input{width:18px;height:18px;top:8px;right:8px;margin:0}
#game[data-mobile=true] #chronicle-create .discipline-cards b{font-size:13px;line-height:1.3;text-align:center}
#game[data-mobile=true] #chronicle-create .discipline-cards small,#game[data-mobile=true] #chronicle-create .discipline-choice>p:not(.creation-class-summary){display:none}
#game[data-mobile=true] #chronicle-create .creation-class-summary{display:block;font-size:11px;line-height:1.5;margin:5px 0 0;padding:5px 8px;background:#152a325e;border-left:2px solid #c8b27b}
/* A destructive confirmation is a compact dialog, not another full-screen page. */
body[data-chronicle] #game[data-mobile=true] #chronicle-panel[data-panel=delete] .chronicle-sheet{width:min(480px,100%);height:auto;max-height:100%;grid-template-rows:44px minmax(0,1fr)}
#game[data-mobile=true] #chronicle-panel[data-panel=delete] .chronicle-index{display:none}
#game[data-mobile=true] .sp-delete-confirm{margin:0;max-width:none;text-align:left}
#game[data-mobile=true] .sp-delete-confirm>.sp-character-portrait,#game[data-mobile=true] .sp-delete-confirm>h3{display:none}
#game[data-mobile=true] .sp-delete-confirm>label{display:grid;grid-template-columns:64px 1fr;align-items:center;gap:8px}
#game[data-mobile=true] .sp-delete-actions{position:sticky;bottom:-10px;padding:6px 0 0;background:#23353e;justify-content:flex-end}
#game[data-mobile=true] .sp-delete-confirm .sp-delete-actions button{margin:0;min-width:96px}
#game[data-mobile=true] .sp-roster{grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:10px}
#game[data-mobile=true] .sp-character-portrait{width:60px;height:78px}
#game[data-mobile=true] .sp-character-card{padding:8px!important;display:grid;grid-template-columns:64px 1fr;align-items:center;gap:4px}
#game[data-mobile=true] .sp-character-card>button{margin:0;text-align:left;padding:6px}
#game[data-mobile=true] .sp-character-card>.sp-delete{grid-column:2;min-height:44px;text-align:center}
/* Online menus use the same density and an independent content scroll. */
#game[data-mobile=true] #social-town{font-size:12px}
#game[data-mobile=true] #social-town button{font-size:12px;line-height:1.4;min-height:44px;padding:6px 9px}
#game[data-mobile=true] .social-header{top:var(--edge-top);left:var(--edge-left);right:var(--edge-right);gap:8px}
#game[data-mobile=true] .social-header>div{padding:5px 8px;gap:2px}
#game[data-mobile=true] .social-header strong{font-size:16px;letter-spacing:1px}
#game[data-mobile=true] .social-header small,#game[data-mobile=true] .social-header span{font-size:10px;letter-spacing:0}
#game[data-mobile=true] #social-town .social-header nav{gap:4px;max-width:70%;flex-wrap:nowrap}
#game[data-mobile=true] .social-pane{top:60px;bottom:8px;width:min(360px,calc(100% - 24px))}
#game[data-mobile=true] .social-pane-heading{padding:0 8px;min-height:44px}
#game[data-mobile=true] .social-pane-body{padding:8px 12px;font-size:12px;line-height:1.5}
#game[data-mobile=true] .social-pane-body p{font-size:12px;line-height:1.5}
#game[data-mobile=true] .automation-panel{top:6px;max-height:calc(100% - 12px);font-size:12px;padding:10px 12px;scroll-padding-block:52px}
#game[data-mobile=true] .automation-panel header{position:sticky;top:-10px;background:#22333d;z-index:2;min-height:44px}
#game[data-mobile=true] .automation-panel p,#game[data-mobile=true] .automation-panel small{font-size:12px;line-height:1.5}
#game[data-mobile=true] .automation-panel h3{font-size:13px;margin:12px 0 6px}
#game[data-mobile=true] .automation-panel button{font-size:12px;line-height:1.4;padding:6px 10px}
#game[data-mobile=true] .world-agenda{padding:6px 9px;max-width:36%}
#game[data-mobile=true] .world-agenda strong{font-size:12px}
#game[data-mobile=true] .world-agenda p{display:none}
#game[data-mobile=true] .world-agenda button{font-size:12px;padding:5px 8px}
@media(max-height:340px){
 #game[data-mobile=true] .creation-stepbar button span{display:none!important}
 #game[data-mobile=true] #chronicle-body .sp-compass{gap:6px;padding:6px 3%;grid-template-columns:repeat(4,minmax(0,1fr))}
 #game[data-mobile=true] #chronicle-body .sp-compass .sp-tile{min-height:62px;padding:5px;gap:4px}
 #game[data-mobile=true] .sp-compass .sp-icon{width:30px;height:30px}
 #game[data-mobile=true] .world-shell.expanded .world-tools{grid-template-columns:repeat(4,1fr);width:268px}
 #game[data-mobile=true] .world-shell .world-tools button{padding:4px 5px;font-size:11px}
 #game[data-mobile=true] .world-shell .world-tools small{grid-column:1/-1}
 #game[data-mobile=true] #chronicle-create .discipline-portrait{height:54px;width:54px}
 #game[data-mobile=true] #chronicle-create .discipline-cards>label{min-height:80px}
}

#game[data-mobile=true] .world-shell .world-tools{max-height:160px;overflow:auto}
#game[data-mobile=true] [data-world-toggle].has-notice{border-color:#e3c887;color:#f5df9e}
body[data-chronicle] #game[data-mobile=true] #chronicle-body .ref-codex{display:grid;grid-template-columns:1fr 1fr;align-content:start;gap:8px;padding:8px 12px}
body[data-chronicle] #game[data-mobile=true] #chronicle-body .ref-codex-summary{grid-column:1/-1;padding:0;gap:8px}
body[data-chronicle] #game[data-mobile=true] #chronicle-body .ref-codex-summary b{font-size:13px;letter-spacing:0}
body[data-chronicle] #game[data-mobile=true] #chronicle-body .ref-codex>.social-menu-entry{width:100%;margin:0;padding:5px 8px;gap:4px}
body[data-chronicle] #game[data-mobile=true] #chronicle-body .ref-codex>.social-menu-entry small{display:none}
body[data-chronicle] #game[data-mobile=true] #chronicle-body .ref-codex-groups{grid-column:1/-1;gap:12px;padding:0}
body[data-chronicle] #game[data-mobile=true] #chronicle-body .ref-codex-groups h3{font-size:11px;padding-bottom:4px;margin-bottom:5px}
body[data-chronicle] #game[data-mobile=true] #chronicle-body .ref-codex-groups .sp-tile{min-height:54px;padding:4px;gap:3px}
body[data-chronicle] #game[data-mobile=true] #chronicle-body .ref-codex-groups .sp-icon{width:24px;height:24px}
body[data-chronicle] #game[data-mobile=true] #chronicle-body .ref-codex>.sp-bottom{grid-column:1/-1;padding:5px 0;gap:6px}

#game[data-mobile=true]{-webkit-text-size-adjust:100%;text-size-adjust:100%}
#game[data-mobile=true] #chronicle-body #chronicle-create{gap:4px}
#game[data-mobile=true] #chronicle-body .sp-book{min-height:92px;padding:6px 4px;display:flex;flex-direction:column;align-items:center;gap:4px}
#game[data-mobile=true] #chronicle-body .sp-book .sp-icon{width:34px;height:34px;margin:0;flex:none}
#game[data-mobile=true] #chronicle-body .bag-slot{min-height:90px;padding:5px 4px 20px}
#game[data-mobile=true] #chronicle-panel[data-panel=discipline] .discipline-cards{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
#game[data-mobile=true] #chronicle-panel[data-panel=discipline] .discipline-cards>button{min-height:100px;padding:6px;text-align:center;align-items:center}
#game[data-mobile=true] #chronicle-panel[data-panel=discipline] .discipline-portrait{height:62px;width:62px}
#game[data-mobile=true] #chronicle-panel[data-panel=discipline] .discipline-cards small{display:none}
#game[data-mobile=true] #chronicle-panel[data-panel=discipline] .creation-class-summary{display:block;padding:6px 8px;border-left:2px solid #c8b27b;background:#152a325e}
#game[data-mobile=true][data-keyboard=true] #chronicle-panel[data-panel=create] .chronicle-sheet{grid-template-rows:minmax(0,1fr)}
#game[data-mobile=true][data-keyboard=true] #chronicle-panel[data-panel=create] .chronicle-sheet>header,#game[data-mobile=true][data-keyboard=true] #chronicle-create .creation-stepbar{display:none}
#game[data-mobile=true][data-keyboard=true] #chronicle-body #chronicle-create{grid-template-rows:0 minmax(0,1fr) auto auto}
#game[data-mobile=true][data-keyboard=true] .sp-delete-confirm>p{display:none}

#game[data-mobile=true] #chronicle-create .creation-page-body{grid-row:2}
#game[data-mobile=true] #social-town:has(.online-workshop:not([hidden]),.online-market:not([hidden]),.online-sect:not([hidden]),.social-pane:not([hidden])) .world-agenda{display:none!important}
#game[data-mobile=true] .ws-content{grid-template-rows:minmax(0,1fr)}
#game[data-mobile=true] .ws-patterns{min-height:0;max-height:100%;overflow:auto;align-self:stretch;overscroll-behavior:contain}
#game[data-mobile=true] .ws-scene,#game[data-mobile=true] .ws-details{min-height:0}
#game[data-mobile=true] .market-empty{margin:10px 4px;font-size:12px;line-height:1.5}
@media(max-height:340px){
 #game[data-mobile=true] .coop-focus{top:70px;bottom:auto;right:164px;width:138px}
 #game[data-mobile=true] .sect-content aside canvas,#game[data-mobile=true] .market-stall canvas{height:72px}
}

/* Structured item rooms own their rows; prose section spacing must not shrink them. */
#game[data-mobile=true] #chronicle-body .bag-room>section,#game[data-mobile=true] #chronicle-body .eq-room>section{margin-bottom:0}
#game[data-mobile=true] #chronicle-body .bag-slot{min-height:84px;padding:4px 4px 16px;gap:3px}
#game[data-mobile=true] #chronicle-body .bag-slot b{font-size:11px;line-height:15px}
#game[data-mobile=true] #chronicle-body .bag-slot .sp-icon,#game[data-mobile=true] #chronicle-body .bag-slot .bag-art{width:28px;height:28px}

#entry-fullscreen{position:absolute;z-index:2;top:max(8px,env(safe-area-inset-top));right:max(10px,env(safe-area-inset-right));display:flex;align-items:center;gap:6px;min-height:44px;padding:6px 10px;font:13px sans-serif;color:#efddb0;background:#20343fea;border:1px solid #b9a573;border-radius:5px}
#entry-fullscreen svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.6}
#entry-fullscreen{pointer-events:auto}
#game:has(#menu:not([hidden]))>.top-tools{display:none}
#screen-message:not([hidden]){position:absolute;z-index:150;left:50%;top:58px;transform:translateX(-50%);max-width:70%;padding:8px 12px;background:#20343f;color:#f1e1bb;font:12px/1.5 sans-serif}
#game[data-mobile=true] .world-menu{right:max(6px,env(safe-area-inset-right));width:min(450px,calc(100% - 12px))}
#game[data-mobile=true] .world-menu>header{padding:2px 8px;min-height:44px}
#game[data-mobile=true] .world-menu-body{padding:0 8px 10px}
#game[data-mobile=true] .world-menu-grid button{padding:6px;gap:4px}
#game[data-mobile=true] .world-menu-grid svg{width:18px;height:18px}
#game[data-mobile=true] .world-agenda{max-width:40%;padding:2px 8px}
#game[data-mobile=true] .coop-controls button small{visibility:hidden}
#game[data-mobile=true] .coop-controls button:disabled small{visibility:visible}
#game[data-mobile=true] .coop-story-note{max-height:35%;overflow:auto;pointer-events:auto;touch-action:pan-y}
#game[data-mobile=true] #social-town .world-agenda{height:44px;width:max-content;max-width:40%;padding:0 8px}
#game[data-mobile=true] #social-town .world-agenda strong{position:static;min-width:0;max-width:180px;line-height:16px}
#game[data-mobile=true] #social-town .world-agenda button{height:44px;min-height:44px;display:flex;gap:6px;align-items:center}
/* Drag/hold controls retain pointer capture; ordinary menu tiles allow swipes. */
.coop-battle.is-compact-scene .coop-focus:disabled{display:none}
#social-town .coop-objective:empty{display:none}
#game .skill,#game [data-coop-control],#game [data-build-hold],#game [data-life-hold],#game .life-pattern,#game .coop-focus,#game [data-signal-toggle],#game [data-signal],#game #sp-work-tool,#game #sp-work-finish,#game [data-work-node]{touch-action:none}

/* Phone field HUD: actions on the edge, optional detail behind one button. */
#game[data-mobile=true] .coop-header{top:var(--edge-top);left:var(--edge-left);right:var(--edge-right);z-index:3;align-items:start}
#game[data-mobile=true] .coop-header>div{width:132px;min-width:0;min-height:44px;padding:5px 7px;align-content:center}
#game[data-mobile=true] .coop-header>div>small{display:none}
#game[data-mobile=true] .coop-header [data-coop-wave]{font-size:12px;line-height:16px;max-height:32px;overflow:hidden}
#game[data-mobile=true] .coop-header nav{position:relative;gap:4px;max-width:none}
#game[data-mobile=true] #social-town [data-battle-tools]{display:grid;place-items:center;gap:0;width:44px;height:44px;padding:2px;font-size:10px}
#game[data-mobile=true] [data-battle-tools] svg{width:22px;height:18px;fill:currentColor}
#game[data-mobile=true] .battle-tools-menu{display:none}
#game[data-mobile=true] .coop-header:has(.battle-tools-menu.is-open){z-index:80}
#game[data-mobile=true] .battle-tools-menu.is-open{display:grid;position:absolute;right:0;top:50px;width:min(300px,calc(var(--game-width,100vw) - 20px));max-height:calc(var(--game-height,100dvh) - 66px);box-sizing:border-box;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;align-content:start;padding:8px;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;background:#1b303cf5;border:1px solid #bba878;border-radius:5px;box-shadow:0 5px 20px #101e2b66;pointer-events:auto}
#game[data-mobile=true] .battle-tools-context{display:block;grid-column:1/-1;white-space:pre-line;font:11px/1.55 sans-serif;color:#d6ddcf;margin:0 0 3px}
#game[data-mobile=true] #social-town .battle-tools-menu>button{position:static;left:auto;right:auto;top:auto;bottom:auto;transform:none;width:auto;max-width:none;min-width:44px;min-height:44px;margin:0;padding:6px;font-size:12px;touch-action:pan-y}
#game[data-mobile=true] .battle-tools-menu>button[hidden]{display:none!important}
#game[data-mobile=true] .coop-team{left:var(--edge-left);width:132px;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px}
#game[data-mobile=true] .coop-team .is-self{grid-column:1/-1}
#game[data-mobile=true] .coop-member{min-width:0;padding:3px 5px;gap:2px}
#game[data-mobile=true] .coop-member b{font-size:10px;line-height:12px;min-width:0}
#game[data-mobile=true] .coop-member meter{height:4px}
#game[data-mobile=true] .coop-member small{display:none}
#game[data-mobile=true] .coop-member.is-downed small{display:block;font-size:9px;line-height:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#game[data-mobile=true] .coop-resource{box-sizing:border-box;padding:3px 6px;gap:3px}
#game[data-mobile=true] .coop-resource strong{font-size:10px;line-height:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#game[data-mobile=true] .coop-resource meter{height:4px}
#game[data-mobile=true] .coop-resource>small{display:none}
#game[data-mobile=true] .coop-objective{font-size:11px;line-height:15px;padding:5px 7px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
#game[data-mobile=true] .coop-focus{right:var(--edge-right);top:58px;bottom:auto;width:132px;box-sizing:border-box}
#game[data-mobile=true] .coop-mechanic{padding:5px 7px;gap:3px}
#game[data-mobile=true] .coop-mechanic strong{font-size:11px}
#game[data-mobile=true] .coop-mechanic small{font-size:10px;line-height:13px}
/* Trial mode hides the scene title and class resource; keep useful vitals. */
#game[data-mobile=true] .has-breakthrough .coop-header>div{visibility:hidden;background:none;border-color:transparent}
#game[data-mobile=true] .has-breakthrough .coop-resource>small{display:block;font-size:10px;line-height:13px}

/* Field dialogue stays in the menu row; reading it uses the paused sheet. */
body[data-chronicle] #game #action-dialogue.mobile-folded{display:none!important}
body[data-chronicle] #game #chronicle-shortcuts #story-dialogue-toggle:not([hidden]){position:relative;display:grid;place-content:center;gap:1px;width:44px;height:44px;min-width:44px;min-height:44px;margin-left:56px;padding:2px!important;font:10px/12px "Microsoft YaHei",sans-serif}
#story-dialogue-toggle svg{width:20px;height:18px;fill:none;stroke:currentColor;stroke-width:1.5;justify-self:center}
#story-dialogue-toggle.unread::after{content:"";position:absolute;right:4px;top:4px;width:5px;height:5px;border-radius:50%;background:#ead29a;box-shadow:0 0 0 2px #263b41}
#story-dialogue-toggle[hidden]{display:none!important}
.story-dialogue-copy{max-width:42em;margin:0 auto 12px;white-space:pre-wrap;font-size:14px;line-height:1.8}
#game:has(.world-shell.expanded) #story-dialogue-toggle{visibility:hidden}

/* In the quiet courtyard, dialogue occupies the free first menu position. */
body[data-chronicle] #game.finale-active #chronicle-shortcuts #story-dialogue-toggle:not([hidden]){margin-left:0}
