/* Mobile is a layout of the live desktop HUD, not a second set of bindings. */
.mobile-control,.mobile-shortcut-pages,.mobile-menu-label,.mobile-menu-extra,.mobile-chat-toggle,.mobile-chat-close{display:none}
.mobile-target-selection,.mobile-target-marker{display:none}
.mobile-class-label{display:none}
body.mobile-hud .mobile-class-label{display:block;position:absolute;top:calc(var(--mobile-top) + 46px);left:var(--mobile-left);width:92px;height:18px;font:11px/18px Tahoma,sans-serif;color:var(--hud-white);text-align:center;white-space:nowrap;text-shadow:0 1px 3px #000;pointer-events:none;z-index:12}
body.mobile-hud #world-panel .mobile-target-toggle{right:calc(var(--mobile-right) + 80px);bottom:calc(var(--mobile-bottom) + 242px);width:66px;gap:2px}
body.mobile-hud .mobile-target-toggle>span{font-size:20px;line-height:20px}
body.mobile-hud .mobile-target-toggle small{font-size:9px}
body.mobile-hud .mobile-target-toggle:disabled{opacity:.45}
body.mobile-hud .mobile-target-selection{display:block;position:absolute;right:var(--mobile-right);bottom:calc(var(--mobile-bottom) + 292px);max-width:min(230px,60vw);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:5px 8px;border-radius:8px;background:#101923b8;color:#ffe08a;font:11px/16px Tahoma,sans-serif;pointer-events:none;z-index:12}
body.mobile-hud .mobile-target-marker:not([hidden]){display:block;position:absolute;width:48px;height:24px;transform:translate(-50%,-50%);border:2px solid #ffe08a;border-radius:50%;box-shadow:0 0 0 2px #17110999,0 0 10px #ffd86080;pointer-events:none;z-index:7}
body .hud-windows .mobile-menu-extra{display:none}
#world-panel .hud-windows>button>:is(img,svg){width:26px;height:26px;flex:none;object-fit:contain}
/* Named primary actions stay visible; less frequent windows expand below them. */
body:not(.mobile-hud) #world-panel .hud-windows{display:grid;grid-template-columns:repeat(auto-fill,56px);justify-content:end;align-items:start;align-content:start;width:min(calc(var(--hud-menu-columns,6) * 60px + 8px),calc((100% - var(--desktop-center-width)) / 2 - 24px));gap:4px;padding:6px;border:0;border-radius:12px;background:none;backdrop-filter:none;z-index:20}
body:not(.mobile-hud) .hud-windows button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;width:56px;height:56px;padding:5px 2px}
body:not(.mobile-hud) .hud-windows .mobile-menu-label{display:block;max-width:100%;font:10px/14px Tahoma,sans-serif;color:#f4f6f7;text-shadow:0 1px 2px #000;white-space:nowrap}
body:not(.mobile-hud) .hud-windows kbd{top:1px;right:3px;bottom:auto;font-size:8px;color:#bec8ce}
body:not(.mobile-hud) .hud-windows .hud-menu-secondary{display:none;order:10}
body:not(.mobile-hud) .hud-windows.desktop-menu-open .hud-menu-secondary:not(.mobile-menu-extra){display:flex;height:68px;border-top:1px solid #ffffff26}
body:not(.mobile-hud) .hud-windows.desktop-menu-open .hud-menu-secondary .mobile-menu-label{display:grid;place-content:center;min-height:24px;white-space:normal;font-size:9px;line-height:12px;text-align:center}
/* Expanded controls must remain clickable above navigation and content windows. */
/* Keep the same grid width when the expanded tray needs vertical scrolling. */
body:not(.mobile-hud) #world-panel .hud-windows.desktop-menu-open{z-index:60;max-height:min(312px,calc(100dvh - 20px));overflow:auto;scrollbar-width:none}
/* Navigation remains visible beside/below the expanded menu. Reserve a readable
   lane on short narrow screens; the menu itself scrolls when space is limited. */
:root body:has(#world-panel .hud-windows.desktop-menu-open, #world-panel.mobile-menu-open) .guide-nav{max-height:min(140px,30dvh);overflow:auto}
@media(max-width:700px){
 :root body.mobile-hud:has(.guide-nav:not([hidden])) #world-panel.mobile-menu-open .hud-windows{max-height:calc(100dvh - var(--mobile-top) - 88px - min(140px,30dvh))}
 :root body:not(.mobile-hud):has(.guide-nav:not([hidden])) #world-panel .hud-windows.desktop-menu-open{max-height:calc(100dvh - 88px - min(140px,30dvh));overflow:auto}
}
body .hud-windows .ability-icon-symbol{display:none}
body.mobile-hud #world-panel .hud-windows .desktop-menu-toggle{display:none}
body.mobile-hud{--mobile-left:max(12px,env(safe-area-inset-left));--mobile-right:max(12px,env(safe-area-inset-right));--mobile-bottom:max(14px,env(safe-area-inset-bottom));--mobile-top:max(12px,env(safe-area-inset-top));--mobile-slot:48px;--mobile-gap:6px;--mobile-glass:var(--hud-glass);--mobile-edge:var(--hud-line)}
body.mobile-hud #world-panel .mobile-control,body.mobile-hud .mobile-shortcut-pages button{display:grid;place-content:center;box-sizing:border-box;min-width:44px;min-height:44px;padding:6px;border:1px solid var(--mobile-edge);border-radius:12px!important;background:var(--mobile-glass);box-shadow:none;color:var(--hud-white);text-shadow:0 1px 3px #000;font:12px/1.3 Tahoma,sans-serif;touch-action:manipulation;pointer-events:auto}
body.mobile-hud .mobile-control{position:absolute;z-index:12}
body.mobile-hud .mobile-control:focus-visible,body.mobile-hud .mobile-shortcut-pages button:focus-visible{outline:2px solid #fff;outline-offset:2px}
/* Keep hunger and combat reserves; hide HP/MP on mobile. */
body.mobile-hud .resource-hud{inset:var(--mobile-top) auto auto var(--mobile-left);width:min(184px,calc(100vw - 170px));height:24px;padding:0;filter:none;z-index:8}
body.mobile-hud .resource-mana{top:calc(var(--mobile-top) + 28px)}
body.mobile-hud .resource-hud::before,body.mobile-hud .resource-hud::after{display:none}
body.mobile-hud .resource-hud .orb{display:none}
body.mobile-hud .resource-hud .orb>div{inset:0 auto 0 0;width:var(--resource-fill,100%)!important;height:100%!important;background:linear-gradient(90deg,#781c2a,#c4474f);box-shadow:none;transition:width .2s}
body.mobile-hud .resource-hud .orb.mana>div{background:linear-gradient(90deg,#1d4268,#397eb6)}
body.mobile-hud .resource-hud .orb.divine>div{background:linear-gradient(90deg,#20503e,#479269)}
body.mobile-hud .resource-hud .orb::after{border-radius:6px;background:linear-gradient(#ffffff12,transparent 50%);box-shadow:none}
body.mobile-hud .resource-hud .orb>span{inset:0 auto 0 9px;display:flex;align-items:center;font:10px Tahoma;letter-spacing:.5px}
body.mobile-hud .resource-hud .orb strong{inset:0 9px 0 auto;display:flex;align-items:center;font:bold 12px Tahoma}
/* The HP/MP orbs are hidden here; reserves must not offset by their empty frame. */
body.mobile-hud .combat-resources{top:0;left:0;height:24px;width:42px}
/* CP/BP are painted beside the actor; retain live HUD values and visibility state. */
body.mobile-hud .combat-resources{visibility:hidden}
/* Persistent reminders use edge buttons instead of covering the play area. */
:root body.mobile-hud #nation-prompt,:root body.mobile-hud #hunger-notice{inset:calc(var(--mobile-top) + 106px) var(--mobile-right) auto auto;transform:none;width:min(132px,calc(40vw - var(--mobile-right)));max-width:132px;height:44px;box-sizing:border-box;margin:0;padding:0;gap:0;border:0;border-radius:8px;background:#18221fed;box-shadow:none;z-index:18}
:root body.mobile-hud #hunger-notice{top:calc(var(--mobile-top) + 154px);background:#211b16ed}
:root body.mobile-hud #nation-prompt>div,:root body.mobile-hud #hunger-notice>div{display:none}
:root body.mobile-hud #nation-prompt button,:root body.mobile-hud #hunger-notice button{width:100%;height:44px;min-height:44px;padding:4px;font:11px/16px Tahoma,sans-serif;border:1px solid #d5bd8680;border-radius:8px;white-space:nowrap}
@media(orientation:landscape){
 :root body.mobile-hud #nation-prompt,:root body.mobile-hud #hunger-notice{top:var(--mobile-top);right:auto;left:calc(var(--mobile-left) + 110px);width:116px;max-width:116px}
 :root body.mobile-hud #hunger-notice{left:calc(var(--mobile-left) + 230px)}
}
body.mobile-hud .combat-resources :is(#cp-bar,#bp-bar){border-radius:6px;background:var(--mobile-glass)}
body.mobile-hud .combat-resources :is(#cp-text,#bp-text){inset:0;transform:none;display:grid;place-content:center;width:100%;font:9px/10px Tahoma;white-space:normal}
/* Only inventory stays exposed; the rest opens in a labelled menu. */
body.mobile-hud #world-panel .hud-windows{inset:var(--mobile-top) calc(var(--mobile-right) + 52px) auto auto;display:block;width:44px;padding:0;z-index:12}
body.mobile-hud .hud-windows button{display:none;width:44px;height:44px;padding:9px;border:1px solid var(--mobile-edge);border-radius:12px!important;background:var(--mobile-glass)}
body.mobile-hud .hud-windows #bag-button{display:grid;place-content:center}
body.mobile-hud .hud-windows kbd{display:none}
body.mobile-hud #world-panel .mobile-menu-toggle{top:var(--mobile-top);right:var(--mobile-right);font-size:23px}
body.mobile-hud #world-panel.mobile-menu-open .hud-windows{inset:calc(var(--mobile-top) + 54px) var(--mobile-right) auto auto;display:grid;grid-template-columns:repeat(4,56px);width:auto;max-height:calc(100dvh - var(--mobile-top) - 72px);overflow:auto;box-sizing:border-box;gap:8px;padding:12px;border:1px solid var(--mobile-edge);border-radius:16px;background:#10192366;backdrop-filter:blur(12px);box-shadow:none}
body.mobile-hud #world-panel.mobile-menu-open .hud-windows button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;width:56px;height:64px;padding:5px;border-color:#ffffff18;background:#ffffff05}
body.mobile-hud #world-panel.mobile-menu-open .hud-windows button{min-width:0;max-width:56px}
body.mobile-hud #world-panel.mobile-menu-open .hud-windows .desktop-menu-toggle{display:none}
body.mobile-hud .mobile-menu-open .mobile-menu-label{display:block;max-width:100%;overflow:hidden;font:10px Tahoma;white-space:nowrap;text-overflow:ellipsis;color:var(--hud-white);text-shadow:0 1px 3px #000}
body.mobile-hud #world-panel.mobile-menu-open .mobile-map-toggle{display:none}
body.mobile-hud #world-panel.mobile-menu-open .hud-windows{z-index:20}
body.mobile-hud .mobile-menu-open .mobile-menu-label{display:grid;place-content:center;min-height:24px;overflow:visible;font:9px/12px Tahoma;white-space:normal;text-overflow:clip;text-align:center}
body.mobile-hud #map-banner{top:calc(var(--mobile-top) + 60px);left:var(--mobile-left);right:auto;transform:none;flex-direction:column;flex-wrap:nowrap;align-items:flex-start;max-width:calc(100% - 104px);width:calc(100% - 104px);min-height:0;border:0;border-radius:0;background:none;overflow:hidden}
body.mobile-hud #location-place{padding:0;gap:5px;max-width:100%;justify-content:flex-start;font:10px/18px Tahoma}
body.mobile-hud #location-nation{display:none}
body.mobile-hud #location-city{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:160px}
body.mobile-hud #world-clock{flex:none;padding:0;border:0;font:10px/18px Tahoma;background:none}
body.mobile-hud #world-panel .mobile-map-toggle{top:calc(var(--mobile-top) + 54px);right:var(--mobile-right);min-width:44px;min-height:44px;display:flex;gap:4px;align-items:center;font-size:10px}
body.mobile-hud .mobile-map-toggle>span:first-child{font-size:22px}
body.mobile-hud #world-panel .map-widget{top:calc(var(--mobile-top) + 105px);right:var(--mobile-right);z-index:13;max-width:calc(100% - 24px)}
body.mobile-hud .map-widget.parchment canvas{width:min(230px,65vw);max-height:45dvh;object-fit:contain}
/* Right thumb: a primary action, current skill and six full-sized shared slots. */
body.mobile-hud .adventure-dock{inset:auto var(--mobile-right) var(--mobile-bottom) auto;display:block;transform:none;max-width:none;width:156px;padding:0;z-index:9}
body.mobile-hud #spell-bar{--shortcut-size:var(--mobile-slot);display:grid;grid-template-columns:repeat(3,var(--mobile-slot));grid-template-rows:repeat(2,var(--mobile-slot));gap:var(--mobile-gap);width:max-content;padding:0}
body.mobile-hud #spell-bar [data-slot]:not([data-mobile-active]){display:none}
body.mobile-hud #spell-bar [data-slot]{width:48px;height:48px;border:1px solid var(--mobile-edge);border-radius:10px!important;background:var(--mobile-glass);box-shadow:none}
body.mobile-hud #spell-bar [data-slot]:has(.empty-spell){background:#10192318;border-color:#ffffff30}
body.mobile-hud #spell-bar kbd{font:8px Tahoma;top:3px;left:4px;color:var(--hud-white);text-shadow:0 1px 3px #000}
body.mobile-hud #spell-bar :is(img,.shortcut-item-icon){width:34px;height:34px}
body.mobile-hud #spell-bar #shortcut-lock{display:none}
body.mobile-hud #world-panel .hotbar{position:absolute;inset:auto 0 160px auto;display:flex;flex-direction:row-reverse;align-items:flex-end;gap:10px;align-self:auto;border:0;padding:0;z-index:10}
body.mobile-hud .hotbar #attack-button{width:70px;height:70px;border:1px solid #ffffff99;background:#10192320;box-shadow:none}
body.mobile-hud .hotbar #attack-button .weapon-icon img{width:34px;height:34px}
body.mobile-hud .hotbar #skill-button{width:58px;height:58px;border-radius:50%!important;background:var(--mobile-glass);border:1px solid #ffffff66}
body:not(.mobile-hud) .hotbar #pickup-button{display:none}
body.mobile-hud .hotbar #pickup-button{width:48px;height:48px;flex:none;border-radius:50%!important;background:var(--mobile-glass);border:1px solid #ffffff66;touch-action:manipulation}
body.mobile-hud .hotbar #pickup-button>svg{width:23px;height:23px;margin-bottom:10px;filter:drop-shadow(0 1px 2px #0009)}
body.mobile-hud .hotbar .action-button small{display:block;position:absolute;bottom:7px;left:4px;right:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:9px Tahoma}
body.mobile-hud .hotbar #skill-button small{font-size:8px;bottom:5px}
body.mobile-hud .hotbar #skill-button:has(img[hidden])::before{content:'✦';font-size:24px;margin-bottom:8px}
body.mobile-hud .hotbar #skill-button:has(img[hidden]) small{display:none}
body.mobile-hud .hotbar #skill-button:has(img[hidden])::after{content:'เลือกสกิล';position:absolute;bottom:6px;font:8px Tahoma}
body.mobile-hud .hotbar .action-button :is(.weapon-icon,img){margin-bottom:10px}
body.mobile-hud .hotbar kbd{display:none}
body.mobile-hud #world-panel .mobile-mode-toggle{bottom:calc(var(--mobile-bottom) + 242px);right:var(--mobile-right);min-width:70px;min-height:44px;border-radius:22px!important;font-size:11px}
body.mobile-hud .mobile-mode-toggle[data-mode="1"]{color:#fff;border-color:#ffffff99}
body.mobile-hud .mobile-mode-toggle[data-mode="2"]{color:#ffb4b4;border-color:#ffb4b480}
body.mobile-hud .mobile-shortcut-pages{position:absolute;right:var(--mobile-right);bottom:calc(var(--mobile-bottom) + 108px);display:flex;gap:4px;width:188px;z-index:10}
body.mobile-hud .mobile-shortcut-pages button{flex:1;min-width:0;min-height:44px;padding:0;border-color:transparent;background:#10192318;border-radius:9px!important;color:var(--hud-white);text-shadow:0 1px 3px #000;font:11px Tahoma;box-shadow:none}
body.mobile-hud .mobile-shortcut-pages button[aria-current=page]{color:#fff;background:#ffffff20;border-color:#ffffff99}
/* Left thumb stays close to the lower edge in either orientation. */
body.mobile-hud #joystick{display:block;inset:auto auto calc(var(--mobile-bottom) + 24px) var(--mobile-left);width:112px;height:112px;border:1px solid #ffffff60;background:#ffffff08;box-shadow:none;z-index:10}
body.mobile-hud #stick{left:32px;top:32px;width:46px;height:46px;border:1px solid #ffffffb3;background:#ffffff80;box-shadow:0 1px 8px #0002}
body.mobile-hud #joystick i{bottom:9px;font:9px Tahoma;color:white;text-shadow:0 1px 3px #000}
/* Progress is available on demand instead of squeezing three tiny text rows. */
body.mobile-hud #world-panel .mobile-exp-toggle{top:calc(var(--mobile-top) + 106px);left:var(--mobile-left);min-width:50px;min-height:44px;font-size:10px;background:var(--mobile-glass)}
body.mobile-hud .adventure-progress{display:none;inset:calc(var(--mobile-top) + 154px) auto auto var(--mobile-left);transform:none;width:230px;padding:12px;box-sizing:border-box;grid-template-columns:1fr;gap:4px;border:1px solid var(--mobile-edge);border-radius:12px;background:#10192366;backdrop-filter:blur(12px);z-index:11}
body.mobile-hud .mobile-exp-open .adventure-progress{display:grid}
body.mobile-hud .adventure-progress:has(#experience-details:not([hidden])){z-index:16}
body.mobile-hud #world-panel .mobile-exp-toggle{min-width:76px}
body.mobile-hud #world-panel .mobile-exp-toggle{display:flex;flex-direction:column;justify-content:center;gap:3px;width:92px;height:44px;padding:4px 6px}
body.mobile-hud .mobile-exp-track{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:1px 3px;width:100%;font:9px/11px Tahoma,sans-serif;text-align:left}
body.mobile-hud .mobile-exp-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.mobile-hud .mobile-exp-value{font-variant-numeric:tabular-nums;white-space:nowrap}
body.mobile-hud .mobile-exp-bar{grid-column:1/-1;display:block;height:2px;overflow:hidden;background:#ffffff26;border-radius:2px}
body.mobile-hud .mobile-exp-bar>span{display:block;height:100%;background:#d4bd83;transition:width .18s ease-out}
body.mobile-hud .mobile-exp-track[data-kind=tactic] .mobile-exp-bar>span{background:#7ac8bc}
body.mobile-hud .mobile-exp-track[data-kind=magic] .mobile-exp-bar>span{background:#bba0e5}
body.mobile-hud .mobile-exp-track[data-gaining] .mobile-exp-value{color:#ffe08a;font-weight:bold}
@media(prefers-reduced-motion:reduce){body.mobile-hud .mobile-exp-bar>span{transition:none}}
body.mobile-hud .adventure-progress .experience-track{min-height:44px;justify-content:center;gap:7px;font:11px/16px Tahoma}
body.mobile-hud .experience-bar{height:4px}
body.mobile-hud #experience-details{position:fixed;inset:50% auto auto 50%;transform:translate(-50%,-50%);width:min(340px,calc(100vw - 24px));max-height:70dvh;z-index:20}
body.mobile-hud #experience-details>button{width:44px;height:44px;top:0;right:0}
body.mobile-hud #spell-buffs{top:calc(var(--mobile-top) + 110px);left:calc(var(--mobile-left) + 86px);max-width:calc(100% - 170px)}
body.mobile-hud #skill-button #spell-casting{top:1px;bottom:auto;padding:0 4px;border-radius:5px;font:700 10px/13px Tahoma,sans-serif;white-space:nowrap;pointer-events:none}
body.mobile-hud #skill-button #spell-casting:empty{display:none}
body.mobile-hud #toast{top:calc(var(--mobile-top) + 160px);max-width:calc(100% - 40px);z-index:14}
body.mobile-hud .measurement-settings{display:none}
/* A deliberate chat sheet; opening it never steals keyboard focus until tapping input. */
:root body.mobile-hud .online-panel{inset:auto auto calc(var(--mobile-bottom) + 158px) var(--mobile-left);transform:none;width:64px;display:block;z-index:15;font:12px Tahoma}
:root body.mobile-hud .online-panel:not(.mobile-chat-open)>:not(.mobile-chat-toggle):not(.emote-controls){display:none}
:root body.mobile-hud .online-panel .mobile-chat-toggle{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;width:56px;height:52px;padding:4px;pointer-events:auto;border:1px solid var(--mobile-edge);border-radius:12px!important;background:var(--mobile-glass);color:var(--hud-white);text-shadow:0 1px 3px #000;font:10px Tahoma}
body.mobile-hud .mobile-chat-toggle svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.5}
body.mobile-hud .mobile-chat-unread{position:absolute;top:-5px;left:42px;min-width:18px;box-sizing:border-box;padding:3px;border-radius:10px;background:#b94b50;color:white;font:bold 10px Tahoma}
/* The conversation fills the visible screen and only the transcript scrolls. */
:root body.mobile-hud .online-panel.mobile-chat-open{
 inset:var(--chat-view-top,0px) 0 auto;z-index:39;width:auto;height:var(--chat-view-height,100dvh);
 display:grid;grid-template-columns:minmax(0,1fr) 44px;grid-template-rows:auto auto auto auto minmax(0,1fr) auto auto;
 padding:max(4px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(6px,var(--chat-safe-bottom,env(safe-area-inset-bottom))) max(10px,env(safe-area-inset-left));
 gap:0 8px;overflow:hidden;border:0;background:#fafaf8;color:#202b25;text-shadow:none;pointer-events:auto;
}
:root body.mobile-hud .online-panel.mobile-chat-open .mobile-chat-toggle{display:none}
:root body.mobile-hud .mobile-chat-open .chat-header{
 grid-column:1/-1;grid-row:1;display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;border-bottom:1px solid #dce3de;
}
:root body.mobile-hud .mobile-chat-open .chat-title{grid-column:2;grid-row:1;text-align:center;font-size:18px;font-weight:bold}
:root body.mobile-hud .mobile-chat-open :is(.chat-title svg,.online-status){display:none}
:root body.mobile-hud .mobile-chat-open :is(.mobile-chat-close,[data-chat-toggle]){
 display:grid;place-items:center;grid-row:1;width:44px;height:44px;padding:0;border:0;background:transparent;color:#293931;font:26px/1 sans-serif;
}
:root body.mobile-hud .mobile-chat-open .mobile-chat-close{grid-column:1;font-size:36px}
:root body.mobile-hud .mobile-chat-open [data-chat-toggle]{grid-column:3}
:root body.mobile-hud .mobile-chat-open .chat-controls{
 grid-column:1/-1;grid-row:2;display:flex;align-items:center;gap:8px;min-width:0;border-bottom:1px solid #dce3de;
}
:root body.mobile-hud .online-panel.mobile-chat-open :is(.chat-controls select,.chat-target),
:root body.mobile-hud .online-panel.mobile-chat-open>input{
 height:44px;min-height:44px;max-height:44px;border:1px solid #b9c8be;border-radius:10px;
 background:#fff;color:#202b25;font:16px Tahoma,sans-serif;box-shadow:none;backdrop-filter:none;
}
:root body.mobile-hud .online-panel.mobile-chat-open .chat-controls select{
 width:auto;max-width:100%;border:0;background:transparent;color:#24533e;
}
:root body.mobile-hud .online-panel.mobile-chat-open .chat-controls:has(.chat-target:not([hidden])) select{max-width:48%}
:root body.mobile-hud .online-panel.mobile-chat-open .chat-target{min-width:0;flex:1}
:root body.mobile-hud .online-panel.mobile-chat-open :is(input,select):focus-visible{outline:2px solid #236448;outline-offset:-2px}
:root body.mobile-hud .online-panel.mobile-chat-open .online-log{
 position:static;grid-column:1/-1;grid-row:5;display:block;min-height:0;max-height:none;
 padding:10px 2px;margin:0;background:transparent;border:0;border-radius:0;
 color:#202b25;font:16px/1.5 Tahoma,sans-serif;text-shadow:none;
 overscroll-behavior:contain;touch-action:pan-y;overflow-anchor:none;
}
:root body.mobile-hud .online-panel.mobile-chat-open .online-log:empty::before{
 content:'ยังไม่มีข้อความ';display:block;padding:16px;text-align:center;color:#54645a;font-size:14px;
}
:root body.mobile-hud .online-panel.mobile-chat-open .online-log>div{
 width:fit-content;max-width:86%;box-sizing:border-box;margin:0 auto 8px 0;padding:8px 12px;
 border-radius:5px 16px 16px 16px;background:#e9edea;color:#202b25;
}
:root body.mobile-hud .online-panel.mobile-chat-open .online-log>.chat-own{
 margin-left:auto;margin-right:0;border-radius:16px 5px 16px 16px;background:#c5e9cb;
}
:root body.mobile-hud .online-panel.mobile-chat-open .online-log>.chat-notice{
 margin-inline:auto;border-radius:12px;background:transparent;color:#4d5c53;font-size:13px;text-align:center;
}
:root body.mobile-hud .online-panel.mobile-chat-open .chat-speaker{color:#20523d;text-decoration:underline;text-underline-offset:2px}
:root body.mobile-hud .online-panel.mobile-chat-open .chat-admin .chat-speaker{color:#80571b}
:root body.mobile-hud .mobile-chat-open .chat-feedback{display:block;grid-column:1/-1;grid-row:6;padding:4px 0;color:#962e2e;font-size:13px}
:root body.mobile-hud .online-panel.mobile-chat-open>input{grid-column:1;grid-row:7;margin:6px 0 0}
:root body.mobile-hud .online-panel.mobile-chat-open>input::placeholder{color:#59675e}
:root body.mobile-hud .online-panel.mobile-chat-open .chat-send{
 grid-column:2;grid-row:7;width:44px;height:44px;align-self:end;border:0;border-radius:10px;background:#236448;color:#fff;
}
:root body.mobile-hud .online-panel.mobile-chat-open .chat-send svg{width:22px;height:22px}
:root body.mobile-hud .mobile-chat-open :is(.chat-options,.chat-more,.chat-war-menu){
 inset:calc(max(4px,env(safe-area-inset-top)) + 44px) max(10px,env(safe-area-inset-right)) auto auto;
 max-height:calc(100% - max(4px,env(safe-area-inset-top)) - 50px);
}
:root body.mobile-hud .mobile-chat-open .chat-options label{min-height:36px}
:root body.mobile-hud .online-panel.mobile-chat-open .chat-war-menu{left:max(10px,env(safe-area-inset-left));right:auto;top:calc(max(4px,env(safe-area-inset-top)) + 88px);max-height:calc(100% - max(4px,env(safe-area-inset-top)) - 94px)}
:root body.mobile-hud .online-panel.mobile-chat-open :is(.chat-more,.chat-war-menu)>button{min-height:44px;font-size:14px}
:root body.mobile-hud .online-panel.mobile-chat-open>.online-invite{grid-column:1/-1;grid-row:3}
:root body.mobile-hud .online-panel.mobile-chat-open>.online-invite+.online-invite{grid-row:4}
:root body.mobile-hud .online-panel .online-invite:not([hidden]){display:block;position:relative;width:min(280px,calc(100vw - 24px));pointer-events:auto}
:root body.mobile-hud .online-panel [hidden]{display:none!important}
/* Landscape spreads the slots through the centre and leaves the world open. */
@media(orientation:landscape){
 body.mobile-hud .adventure-dock{inset:auto auto var(--mobile-bottom) calc(50% - 159px);transform:none;width:318px}
 body.mobile-hud #spell-bar{grid-template-columns:repeat(6,48px);grid-template-rows:48px}
 body.mobile-hud .mobile-shortcut-pages{right:auto;left:50%;transform:translateX(-50%);bottom:calc(var(--mobile-bottom) + 54px);width:200px;gap:8px}
 body.mobile-hud #world-panel .hotbar{position:fixed;inset:auto var(--mobile-right) calc(var(--mobile-bottom) + 6px) auto;gap:12px}
 body.mobile-hud #world-panel .mobile-mode-toggle{bottom:calc(var(--mobile-bottom) + 88px)}
 body.mobile-hud #world-panel .mobile-target-toggle{bottom:calc(var(--mobile-bottom) + 88px)}
 body.mobile-hud .mobile-target-selection{bottom:calc(var(--mobile-bottom) + 138px);max-width:160px}
 body.mobile-hud #joystick{bottom:var(--mobile-bottom)}
 :root body.mobile-hud .online-panel{left:calc(var(--mobile-left) + 124px);bottom:var(--mobile-bottom)}
 body.mobile-hud #world-panel .mobile-exp-toggle{top:calc(var(--mobile-top) + 100px)}
 body.mobile-hud .adventure-progress{top:calc(var(--mobile-top) + 54px);left:calc(var(--mobile-left) + 60px)}
 body.mobile-hud #world-panel .map-widget{max-height:calc(100dvh - 150px);overflow:auto}
}
@media(orientation:landscape) and (max-width:740px){
 body.mobile-hud .adventure-dock{left:calc(50% - 78px);width:156px}
 body.mobile-hud #spell-bar{grid-template-columns:repeat(3,48px);grid-template-rows:repeat(2,48px)}
 body.mobile-hud .mobile-shortcut-pages{bottom:calc(var(--mobile-bottom) + 108px);width:188px;gap:4px}
}
@media(max-width:360px){body.mobile-hud #joystick{width:100px;height:100px}body.mobile-hud #stick{left:26px;top:26px}}
@media(prefers-reduced-motion:reduce){body.mobile-hud .resource-hud .orb>div{transition:none}}

/* Keep the checklist below location/EXP instead of painting over the map name. */
:root body.mobile-hud .guide-checklist{top:calc(var(--mobile-top) + 156px);left:var(--mobile-left);max-width:calc(100vw - var(--mobile-left) - var(--mobile-right));max-height:calc(100dvh - var(--mobile-top) - 180px);overflow:auto;z-index:17}
:root body.mobile-hud .guide-checklist summary{min-height:32px;align-items:center}
:root body.mobile-hud .guide-checklist .guide-book-link{min-height:44px}
@media(orientation:portrait){
 :root body.mobile-hud:has(#hunger-notice:not([hidden])) .guide-checklist{max-width:calc(60vw - var(--mobile-left) - 8px)}
}
:root body.mobile-hud #world-panel .map-widget{z-index:24}
:root body.mobile-hud .mobile-exp-open .adventure-progress{z-index:24}
:root body.mobile-hud #toast{z-index:90;pointer-events:none}
:root body.mobile-hud #world-panel.mobile-menu-open .hud-windows{z-index:30}
:root body.mobile-hud .emote-controls:has(.emote-picker:not([hidden])){z-index:26}
:root body.mobile-hud:has(.party-hud:not([hidden])) .guide-checklist{top:calc(var(--mobile-top) + 170px);left:var(--mobile-left)}
@media(orientation:portrait){:root body.mobile-hud .emote-picker{max-height:min(50dvh,max(0px,calc(100dvh - var(--mobile-bottom) - 284px)))}}
@media(orientation:portrait) and (max-height:600px){
 :root body.mobile-hud .guide-checklist{left:calc(var(--mobile-left) + 64px);width:144px;max-width:calc(100vw - var(--mobile-left) - var(--mobile-right) - 160px)}
 :root body.mobile-hud:has(.party-hud:not([hidden])) .guide-checklist{left:calc(var(--mobile-left) + 64px)}
 :root body.mobile-hud:has(#hunger-notice:not([hidden])) .guide-checklist{max-width:calc(60vw - var(--mobile-left) - 72px)}
}
@media(orientation:landscape){
 :root body.mobile-hud #map-banner{width:160px;max-width:160px}
 :root body.mobile-hud .guide-checklist{top:calc(var(--mobile-top) + 54px);left:calc(var(--mobile-left) + 176px);max-width:calc(100vw - var(--mobile-left) - var(--mobile-right) - 176px)}
 :root body.mobile-hud:has(.party-hud:not([hidden])) .guide-checklist{top:calc(var(--mobile-top) + 54px);left:calc(var(--mobile-left) + 236px);max-width:calc(100vw - var(--mobile-left) - var(--mobile-right) - 236px)}
}
/* Short landscape screens need separate lanes for the left thumb and shortcuts. */
@media(orientation:landscape) and (max-width:740px){
 body.mobile-hud .adventure-dock{left:calc(50% - 96px)}
 :root body.mobile-hud .online-panel:not(.mobile-chat-open){left:calc(var(--mobile-left) + 116px)}
 :root body.mobile-hud .emote-picker{max-height:calc(100dvh - var(--mobile-bottom) - 190px)}
}

/* Left edge lanes stay independent of party membership and screen orientation. */
:root body.mobile-hud #world-panel .mobile-exp-toggle,:root body.mobile-hud #world-panel:has(.party-hud:not([hidden])) .mobile-exp-toggle{top:var(--mobile-top);left:var(--mobile-left)}
:root body.mobile-hud .resource-mana{top:calc(var(--mobile-top) + 44px);left:calc(var(--mobile-left) + 100px)}
:root body.mobile-hud #map-banner{top:calc(var(--mobile-top) + 68px)}
:root body.mobile-hud .leveling-suggestion{top:var(--mobile-top);left:calc(var(--mobile-left) + 100px);width:calc(100vw - var(--mobile-left) - var(--mobile-right) - 204px);max-width:210px;height:44px}
:root body.mobile-hud .party-hud{top:calc(var(--mobile-top) + 106px);left:var(--mobile-left);max-width:calc(60vw - var(--mobile-left) - 8px);overflow-x:auto;pointer-events:auto}
:root body.mobile-hud .party-hud-member{flex:0 0 var(--party-icon-width)}
:root body.mobile-hud #world-panel #spell-buffs{top:calc(var(--mobile-top) + 108px);left:var(--mobile-left);max-width:calc(60vw - var(--mobile-left) - 8px);max-height:42px}
:root body.mobile-hud #world-panel #spell-buffs img{width:28px;height:28px}
:root body.mobile-hud .party-hud-popover{position:fixed;top:calc(var(--mobile-top) + 166px);left:var(--mobile-left)}
:root body.mobile-hud .guide-checklist,:root body.mobile-hud:has(.party-hud:not([hidden])) .guide-checklist{top:calc(var(--mobile-top) + 182px);max-height:max(46px,calc(100dvh - var(--mobile-top) - 430px))}
@media(orientation:portrait) and (max-height:600px){
 :root body.mobile-hud .guide-checklist,:root body.mobile-hud:has(.party-hud:not([hidden])) .guide-checklist,:root body.mobile-hud:has(#hunger-notice:not([hidden])) .guide-checklist{left:calc(var(--mobile-left) + 64px);width:144px;max-width:calc(100vw - var(--mobile-left) - var(--mobile-right) - 216px)}
}
@media(orientation:landscape){
 :root body.mobile-hud .party-hud{max-width:92px}
 :root body.mobile-hud .leveling-suggestion{top:calc(var(--mobile-top) + 106px);width:156px;height:24px}
 :root body.mobile-hud .guide-checklist,:root body.mobile-hud:has(.party-hud:not([hidden])) .guide-checklist{top:calc(var(--mobile-top) + 54px);left:calc(var(--mobile-left) + 276px);width:188px;max-width:calc(100vw - var(--mobile-left) - var(--mobile-right) - 380px);max-height:max(46px,calc(100dvh - var(--mobile-top) - 228px))}
}

/* War entry shares the upper-right utility lane, clear of combat and shortcuts. */
:root body.mobile-hud .localwar-alert{inset:calc(var(--mobile-top) + 54px) calc(var(--mobile-right) + 52px) auto auto;width:44px;height:44px;min-height:44px;padding:0;display:grid;place-items:center;gap:0;animation:none;box-shadow:none;z-index:12}
:root body.mobile-hud .localwar-alert-emblem{width:32px;height:32px}
:root body.mobile-hud .localwar-alert-copy,:root body.mobile-hud .localwar-alert-spark,:root body.mobile-hud .localwar-alert::after{display:none}
:root body.mobile-hud:has(.localwar-alert:not([hidden])) #map-banner{max-width:calc(100vw - var(--mobile-left) - var(--mobile-right) - 104px)}
:root body.mobile-hud:has(.localwar-alert:not([hidden])) #world-panel .mobile-map-toggle{width:44px;padding:6px;gap:0}
:root body.mobile-hud:has(.localwar-alert:not([hidden])) .mobile-map-toggle>span+span{display:none}
:root body.mobile-hud:has(#world-panel.mobile-menu-open) .localwar-alert,:root body.mobile-hud:has(#npc-war[open]) .localwar-alert{display:none}
/* Emotes stay beside the chat launcher, outside the composer in both states. */
:root body.mobile-hud .online-panel>.emote-controls{position:absolute;left:64px;bottom:0;width:56px;pointer-events:auto}
:root body.mobile-hud .online-panel .emote-toggle{width:56px;height:52px;border:1px solid var(--mobile-edge);border-radius:12px!important;background:var(--mobile-glass);color:var(--hud-white);font-size:28px}

/* Shared edge spacing: 8px between utility rows and 8px around open panels. */
:root body.mobile-hud:has(#spell-buffs:not(:empty)) .party-hud{top:calc(var(--mobile-top) + 158px)}
:root body.mobile-hud:has(#spell-buffs:not(:empty)) .guide-checklist{top:calc(var(--mobile-top) + 158px)}
:root body.mobile-hud:has(#spell-buffs:not(:empty)):has(.party-hud:not([hidden])) .guide-checklist{top:calc(var(--mobile-top) + 216px)}
:root body.mobile-hud:has(.party-hud-popover) .guide-checklist{visibility:hidden}
:root body.mobile-hud .party-hud-popover{top:calc(var(--mobile-top) + 164px);max-width:calc(100vw - var(--mobile-left) - var(--mobile-right) - 164px);min-width:0;white-space:normal;overflow-wrap:anywhere}
:root body.mobile-hud:has(#spell-buffs:not(:empty)) .party-hud-popover{top:calc(var(--mobile-top) + 216px)}
/* A scrolled detail panel occupies the left rail, leaving combat on the right. */
:root body.mobile-hud #world-panel .map-widget,
:root body.mobile-hud .mobile-exp-open .adventure-progress,
:root body.mobile-hud .online-panel .emote-picker{position:fixed;inset:calc(var(--mobile-top) + 106px) auto auto var(--mobile-left);transform:none;width:min(240px,calc(100vw - var(--mobile-left) - var(--mobile-right) - 164px));max-width:none;max-height:max(88px,calc(100dvh - var(--mobile-top) - var(--mobile-bottom) - 324px));overflow:auto;box-sizing:border-box;margin:0;z-index:25}
:root body.mobile-hud #world-panel .map-widget.parchment{padding:8px}
:root body.mobile-hud #world-panel .map-widget.parchment canvas{width:100%;height:auto;max-width:100%}
:root body.mobile-hud .emote-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
:root body.mobile-hud:has(.map-widget:not([hidden]),.mobile-exp-open,.emote-picker:not([hidden])) :is(.guide-checklist,.party-hud,#spell-buffs){visibility:hidden}
:root body.mobile-hud .online-panel.mobile-chat-open>.emote-controls{display:none}
:root body.mobile-hud:has(.online-panel.mobile-chat-open) :is(.map-widget,.adventure-progress,.guide-checklist,.party-hud,#spell-buffs){visibility:hidden}
:root body.mobile-hud:has(.online-panel.mobile-chat-open) :is(.adventure-dock,.mobile-shortcut-pages,.hotbar,#joystick,.mobile-target-toggle,.mobile-target-selection,.mobile-mode-toggle){visibility:hidden}
:root body.mobile-hud:has(#world-panel.mobile-menu-open) :is(#map-banner,#nation-prompt,#hunger-notice,.guide-checklist,.party-hud,#spell-buffs,.leveling-suggestion){visibility:hidden}
:root body.mobile-hud:has(#world-panel.mobile-menu-open) :is(.adventure-dock,.mobile-shortcut-pages,.hotbar,#joystick,.mobile-target-toggle,.mobile-target-selection,.mobile-mode-toggle){visibility:hidden}
@media(orientation:landscape){
 :root body.mobile-hud .online-panel:not(.mobile-chat-open){left:calc(var(--mobile-left) + 124px);bottom:calc(var(--mobile-bottom) + 56px);width:56px}
 :root body.mobile-hud .online-panel:not(.mobile-chat-open)>.emote-controls{left:0;bottom:-56px}
 :root body.mobile-hud #world-panel #spell-buffs{top:calc(var(--mobile-top) + 112px);max-width:160px}
 :root body.mobile-hud .party-hud,:root body.mobile-hud:has(#spell-buffs:not(:empty)) .party-hud{top:calc(var(--mobile-top) + 54px);left:calc(var(--mobile-left) + 176px);max-width:92px}
 :root body.mobile-hud .leveling-suggestion{left:calc(var(--mobile-left) + 176px);width:92px}
 :root body.mobile-hud .party-hud-popover,:root body.mobile-hud:has(#spell-buffs:not(:empty)) .party-hud-popover{top:calc(var(--mobile-top) + 54px);left:calc(var(--mobile-left) + 276px);max-width:calc(100vw - var(--mobile-left) - var(--mobile-right) - 380px)}
 :root body.mobile-hud:has(#spell-buffs:not(:empty)) .guide-checklist{top:calc(var(--mobile-top) + 54px)}
 :root body.mobile-hud:has(#spell-buffs:not(:empty)):has(.party-hud:not([hidden])) .guide-checklist{top:calc(var(--mobile-top) + 54px)}
 :root body.mobile-hud #world-panel .map-widget,
 :root body.mobile-hud .mobile-exp-open .adventure-progress,
 :root body.mobile-hud .online-panel .emote-picker{top:calc(var(--mobile-top) + 54px);left:calc(var(--mobile-left) + 176px);width:min(240px,calc(100vw - var(--mobile-left) - var(--mobile-right) - 348px));max-height:max(64px,calc(100dvh - var(--mobile-top) - var(--mobile-bottom) - 232px))}
 :root body.mobile-hud:has(.map-widget:not([hidden]),.mobile-exp-open,.emote-picker:not([hidden])) .leveling-suggestion{visibility:hidden}
}
@media(orientation:landscape) and (min-width:741px){
 :root body.mobile-hud .mobile-target-selection{top:var(--mobile-top);bottom:auto;right:calc(var(--mobile-right) + 104px);width:min(230px,calc(100vw - var(--mobile-left) - var(--mobile-right) - 458px));max-width:none;height:44px;line-height:32px}
}
@media(orientation:landscape) and (max-width:740px){
 :root body.mobile-hud .online-panel:not(.mobile-chat-open){left:calc(var(--mobile-left) + 120px);bottom:calc(var(--mobile-bottom) + 56px);width:56px}
 :root body.mobile-hud .online-panel:not(.mobile-chat-open)>.emote-controls{left:0;bottom:-56px}
 :root body.mobile-hud .adventure-dock{left:calc(var(--mobile-left) + 184px)}
 :root body.mobile-hud .mobile-shortcut-pages{left:calc(var(--mobile-left) + 184px);top:calc(var(--mobile-top) + 108px);bottom:auto;transform:none}
 :root body.mobile-hud #world-panel .mobile-target-toggle{right:calc(var(--mobile-right) + 74px);width:58px}
 :root body.mobile-hud .mobile-target-selection{max-width:100px}
 :root body.mobile-hud .leveling-suggestion{top:var(--mobile-top);left:calc(var(--mobile-left) + 110px);width:156px}
 :root body.mobile-hud:has(#nation-prompt:not([hidden]),#hunger-notice:not([hidden])) .leveling-suggestion{visibility:hidden}
 :root body.mobile-hud:has(.map-widget:not([hidden]),.mobile-exp-open,.emote-picker:not([hidden])) .mobile-shortcut-pages{visibility:hidden}
 :root body.mobile-hud .guide-checklist,:root body.mobile-hud:has(.party-hud:not([hidden])) .guide-checklist,:root body.mobile-hud:has(#spell-buffs:not(:empty)):has(.party-hud:not([hidden])) .guide-checklist{max-height:46px}
}
@media(orientation:portrait) and (max-height:600px){
 body.mobile-hud .mobile-class-label{left:calc(var(--mobile-left) + 148px);width:min(92px,calc(100vw - var(--mobile-left) - var(--mobile-right) - 252px))}
 :root body.mobile-hud #map-banner{top:calc(var(--mobile-top) + 44px);width:92px;max-width:92px}
 :root body.mobile-hud #nation-prompt,:root body.mobile-hud #hunger-notice{top:calc(var(--mobile-top) + 88px);left:var(--mobile-left);right:auto;width:100px;max-width:100px}
 :root body.mobile-hud #hunger-notice{left:calc(var(--mobile-left) + 108px)}
 :root body.mobile-hud #hunger-notice{width:min(100px,calc(100vw - var(--mobile-left) - var(--mobile-right) - 212px))}
 :root body.mobile-hud #hunger-notice button{font-size:10px}
 :root body.mobile-hud #world-panel :is(.mobile-target-toggle,.mobile-mode-toggle){bottom:calc(var(--mobile-bottom) + 236px);height:44px;min-height:44px;padding:4px}
 :root body.mobile-hud .mobile-target-selection{display:none;top:var(--mobile-top);bottom:auto;right:auto;left:calc(var(--mobile-left) + 100px);width:calc(100vw - var(--mobile-left) - var(--mobile-right) - 204px);max-width:210px;height:44px;line-height:32px}
 :root body.mobile-hud .mobile-target-selection[data-selected=true]{display:block}
 :root body.mobile-hud:has(.mobile-target-selection[data-selected=true]) .leveling-suggestion{visibility:hidden}
 :root body.mobile-hud:has(#nation-prompt:not([hidden]),#hunger-notice:not([hidden])) #world-panel #spell-buffs{top:calc(var(--mobile-top) + 140px)}
 :root body.mobile-hud #world-panel #spell-buffs{top:calc(var(--mobile-top) + 140px);max-width:100px}
 :root body.mobile-hud .party-hud,:root body.mobile-hud:has(#spell-buffs:not(:empty)) .party-hud,:root body.mobile-hud:has(#nation-prompt:not([hidden]),#hunger-notice:not([hidden])) .party-hud,:root body.mobile-hud:has(#spell-buffs:not(:empty)):has(#nation-prompt:not([hidden]),#hunger-notice:not([hidden])) .party-hud{top:calc(var(--mobile-top) + 140px);left:calc(var(--mobile-left) + 108px);max-width:92px}
 :root body.mobile-hud .party-hud-member img{height:35px;width:28px}
 :root body.mobile-hud .guide-checklist,:root body.mobile-hud:has(#hunger-notice:not([hidden])) .guide-checklist,:root body.mobile-hud:has(.party-hud:not([hidden])) .guide-checklist,:root body.mobile-hud:has(#spell-buffs:not(:empty)) .guide-checklist,:root body.mobile-hud:has(#spell-buffs:not(:empty)):has(.party-hud:not([hidden])) .guide-checklist{top:calc(var(--mobile-top) + 192px);left:var(--mobile-left);width:112px;max-width:112px;max-height:max(44px,calc(100dvh - var(--mobile-top) - var(--mobile-bottom) - 422px))}
 :root body.mobile-hud .party-hud-popover,:root body.mobile-hud:has(#spell-buffs:not(:empty)) .party-hud-popover{top:calc(var(--mobile-top) + 192px);left:var(--mobile-left);max-width:112px}
 :root body.mobile-hud .online-panel:not(.mobile-chat-open){left:var(--mobile-left);width:64px}
 :root body.mobile-hud .online-panel:not(.mobile-chat-open)>.emote-controls{left:64px;bottom:0;width:56px}
 :root body.mobile-hud:has(.map-widget:not([hidden]),.mobile-exp-open,.emote-picker:not([hidden])) :is(#nation-prompt,#hunger-notice){visibility:hidden}
}
@media(orientation:portrait) and (max-height:500px){
 :root body.mobile-hud .online-panel:not(.mobile-chat-open){left:calc(var(--mobile-left) + 124px);bottom:calc(var(--mobile-bottom) + 146px);width:44px}
 :root body.mobile-hud .online-panel:not(.mobile-chat-open) .mobile-chat-toggle,:root body.mobile-hud .online-panel:not(.mobile-chat-open) .emote-toggle{width:44px;height:44px}
 :root body.mobile-hud .online-panel:not(.mobile-chat-open)>.emote-controls{left:0;bottom:-52px;width:44px}
 :root body.mobile-hud #world-panel .map-widget,:root body.mobile-hud .mobile-exp-open .adventure-progress,:root body.mobile-hud .online-panel .emote-picker{max-height:max(56px,calc(100dvh - var(--mobile-top) - var(--mobile-bottom) - 316px))}
}

/* Landscape: map at the left edge, combat and quick items within the right thumb's reach. */
@media(orientation:landscape){
 :root body.mobile-hud #world-panel .mobile-map-toggle{
  top:var(--mobile-top);left:calc(var(--mobile-left) + 100px);right:auto;
 }
 :root body.mobile-hud #world-panel .map-widget{
  top:calc(var(--mobile-top) + 52px);left:var(--mobile-left);right:auto;
  width:168px;max-height:max(76px,calc(100dvh - var(--mobile-top) - var(--mobile-bottom) - 172px));
 }
 :root body.mobile-hud:has(.map-widget:not([hidden])) :is(#map-banner,.mobile-class-label,.online-counts){visibility:hidden}
 :root body.mobile-hud .leveling-suggestion{
  top:var(--mobile-top);left:calc(var(--mobile-left) + 176px);
  width:min(190px,calc(100vw - var(--mobile-left) - var(--mobile-right) - 368px));
 }
 :root body.mobile-hud .adventure-dock{
  left:auto;right:calc(var(--mobile-right) + 164px);width:156px;
 }
 :root body.mobile-hud #spell-bar{
  grid-template-columns:repeat(3,var(--mobile-slot));grid-template-rows:repeat(2,var(--mobile-slot));
 }
 :root body.mobile-hud .mobile-shortcut-pages{
  top:auto;left:auto;right:calc(var(--mobile-right) + 164px);
  bottom:calc(var(--mobile-bottom) + 106px);width:156px;transform:none;
 }
 :root body.mobile-hud #world-panel .hotbar{bottom:var(--mobile-bottom);gap:8px;transform:none}
 :root body.mobile-hud .hotbar #attack-button{
  width:74px;height:74px;background:#12232bd9;border-color:#b8d7df;
 }
 :root body.mobile-hud .hotbar #skill-button{margin-bottom:28px;background:#18283ad9}
 :root body.mobile-hud .hotbar #pickup-button{position:absolute;right:0;bottom:132px}
 :root body.mobile-hud #spell-bar [data-slot]:not(:has(.empty-spell)){background:#13232cbd}
 :root body.mobile-hud .hotbar .autoplay-controls{
  position:fixed;top:calc(var(--mobile-top) + 50px);right:var(--mobile-right);bottom:auto;
 }
 :root body.mobile-hud .hotbar .autoplay-settings-button{
  width:44px;height:44px;min-width:44px;min-height:44px;
 }
 :root body.mobile-hud #world-panel .mobile-mode-toggle{bottom:calc(var(--mobile-bottom) + 82px)}
 :root body.mobile-hud #world-panel .mobile-target-toggle{
  right:calc(var(--mobile-right) + 82px);bottom:calc(var(--mobile-bottom) + 94px);
 }
 :root body.mobile-hud .mobile-target-selection{
  display:none;top:auto;bottom:calc(var(--mobile-bottom) + 186px);right:var(--mobile-right);
  width:max-content;max-width:150px;height:auto;line-height:16px;
 }
 :root body.mobile-hud .mobile-target-selection[data-selected=true]{display:block}
 :root body.mobile-hud .life-panel{
  top:calc(var(--mobile-top) + 36px);width:min(420px,calc(100vw - 376px));
  flex-wrap:wrap;justify-content:center;text-align:center;
 }
 :root body.mobile-hud .life-panel button{min-height:44px}
 :root body.mobile-hud .event-badge{max-width:min(156px,24vw)}
}
