[hidden]{display:none!important}
/* Original canvas windows cut through this one HUD layer, in both painting
   and hit testing. Keep editors/pickers outside it. Coordinates are viewport CSS px. */
body[data-mobile-presentation=desktop-controls] #mobile-game{position:fixed;inset:0}
/* Desktop baseline on touch devices: only invisible keyboard adapters remain.
   These guards also prevent stale legacy form/workspace snapshots flashing. */
body[data-mobile-presentation=desktop] #mobile-ui>:not(#classic-login-inputs):not(#classic-account-inputs){display:none!important}
/* Selected archived references02–13 complement native Desktop windows. */
body[data-mobile-presentation=desktop-controls] #mobile-game>:not(#mobile-combat):not(#mobile-stick):not(#mobile-sit):not(#mobile-chat):not(#mobile-emote-palette):not(#mobile-shortcuts):not(#mobile-actions):not(#mobile-menu-group):not(#mobile-extra-menu):not(#mobile-minimap-toggle):not(#mobile-npcs):not(#mobile-utilities):not(#mobile-restore-ui){display:none!important}
#native-mobile-inputs{position:fixed;inset:0;z-index:24;pointer-events:none}
#native-mobile-inputs input{position:fixed;box-sizing:border-box;pointer-events:auto;touch-action:manipulation;
 background:transparent;border:0;border-radius:0;box-shadow:none;padding:0;min-height:0;font:16px Tahoma;
 color:transparent;-webkit-text-fill-color:transparent;caret-color:transparent;outline:none;user-select:text;-webkit-user-select:text}
#native-mobile-inputs input::selection{background:transparent;color:transparent}
#native-mobile-inputs input[data-docked=true]{background:#e9edf1b8;border:1px solid #93a5b88c;padding:6px 8px;color:#21344b;-webkit-text-fill-color:#21344b;caret-color:#21344b;box-shadow:0 2px 8px #0005}
#native-mobile-inputs input[data-docked=true]::selection{background:#b9d4f1;color:#21344b}
/* Classic windows remain, with compact touch chat and shortcut replacements. */
#mobile-ui{--mobile-basic-width:clamp(164px,25vw,212px);--stick-target:152px;--stick-size:var(--stick-target);position:fixed;inset:0;z-index:5;pointer-events:none;font:13px Tahoma,Arial,sans-serif;color:#172133;user-select:none;-webkit-user-select:none;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);box-sizing:border-box}
#mobile-ui[data-ui-hidden=true] #mobile-game>:not(#mobile-restore-ui),#mobile-ui[data-ui-hidden=true] #mobile-shortcut-picker,body[data-mobile-ui-hidden=true] :is(#debug-finger,#debug-finger-second,#debug-phone-keyboard){display:none!important}
#mobile-ui #mobile-restore-ui{position:absolute;top:calc(8px + env(safe-area-inset-top));right:calc(10px + env(safe-area-inset-right));min-height:30px;padding:3px 8px;font-size:11px;background:#e9edf1c9}
#mobile-ui button{font:inherit;color:#182236;background:#eef1f5;border:1px solid #8290a0;border-radius:6px;box-shadow:inset 0 1px 0 white;cursor:pointer;touch-action:none;min-height:40px;padding:6px;pointer-events:auto}
#mobile-ui button:active,#mobile-pointer[aria-pressed=true]{background:#b9cee6}#mobile-ui button:disabled{opacity:.45;cursor:default}
/* Shared mobile forms use the same pale panels and blue-gray borders as Basic. */
#mobile-forms{position:fixed;inset:calc(8px + env(safe-area-inset-top)) calc(8px + env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom) + var(--keyboard-bottom,0px)) calc(8px + env(safe-area-inset-left));z-index:25;display:flex;flex-direction:column;min-height:0;background:#18253482;border:1px solid #73869e;border-radius:3px;padding:5px;box-sizing:border-box;pointer-events:auto;touch-action:none}
#mobile-ui[data-forms=true] :is(#mobile-basic,#mobile-utilities,#mobile-menu-group,#mobile-minimap-toggle,#mobile-stick,#mobile-sit,#mobile-chat,#mobile-shortcuts,#mobile-actions,#mobile-workspace-layer,#mobile-shortcut-picker){display:none!important}
#mobile-form-tabs{display:flex;gap:3px;flex-shrink:0;min-height:32px;overflow:auto;touch-action:pan-x}
#mobile-ui #mobile-form-tabs button{min-height:30px;padding:2px 10px;border-radius:2px;font-size:11px;white-space:nowrap;background:#dce6ef}
#mobile-form-panels{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;flex:1;min-height:0;overflow:hidden}
#mobile-forms[data-columns="1"] #mobile-form-panels{grid-template-columns:minmax(0,1fr);max-width:760px;width:100%;align-self:center}
#mobile-forms[data-columns="3"] #mobile-form-panels{grid-template-columns:repeat(3,minmax(0,1fr))}
.mobile-form-shell{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden;background:#e9edf1f7;color:#21344b;border:1px solid #798ca2;border-radius:3px;box-shadow:inset 1px 1px #fff,inset -1px -1px #c1c9d3;font:12px/18px Tahoma,Arial,sans-serif}
.mobile-form-header{display:flex;align-items:center;gap:6px;padding-left:9px;flex-shrink:0;min-height:38px;background:#d9e4f1;border-bottom:1px solid #aab8c7;flex-wrap:wrap}
.mobile-form-header>strong{flex:1;min-width:0;overflow-wrap:anywhere;font-size:12px}
#mobile-ui .mobile-form-header>button{min-height:38px;min-width:45px;align-self:stretch;border-radius:0;border-width:0 0 0 1px;background:#e8edf4;font-size:11px}
#mobile-ui .mobile-form-search{flex:1 1 100%;width:calc(100% - 8px);margin:0 8px 6px 0;min-height:34px;height:34px;padding:4px 7px;box-sizing:border-box;font:16px Tahoma;color:#21344b;background:#f7f9fb;border:1px solid #93a5b8;border-radius:3px;user-select:text;-webkit-user-select:text;touch-action:manipulation}
.mobile-form-body{flex:1;min-height:0;min-width:0;padding:9px;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:thin;box-sizing:border-box}
.mobile-form-reading{white-space:pre-wrap;overflow-wrap:anywhere;user-select:text;-webkit-user-select:text;margin-bottom:7px}
.mobile-form-reading p{margin:0 0 4px;min-height:15px}
.mobile-form-fields{display:flex;flex-direction:column;gap:5px;min-width:0}
.mobile-form-fields[data-grid=true]{display:grid;grid-template-columns:repeat(auto-fit,minmax(104px,1fr));gap:5px}
.mobile-form-control{min-width:0;max-width:100%}
#mobile-ui .mobile-form-control button{min-height:42px;border-radius:3px;font-size:12px;line-height:16px;padding:5px 8px;overflow-wrap:anywhere}
#mobile-ui .mobile-form-choice{display:flex;align-items:center;gap:6px;width:100%;text-align:left;background:#eef1f5}
.mobile-form-choice img{width:28px;height:28px;object-fit:contain;flex-shrink:0}
.mobile-form-control[data-selected=true]>.mobile-form-choice{background:#c3d9f1!important;border-color:#7498c5!important}
.mobile-form-control[data-kind=row]{background:#dce5ee;border:1px solid #b7c5d3;border-radius:3px;padding:2px}
.mobile-form-row-actions{display:flex;gap:3px;margin-top:3px}
#mobile-ui .mobile-form-row-actions button{flex:1;min-width:0;min-height:34px;padding:2px;font-size:10px;background:#e6edf3}
.mobile-form-control[data-kind=input],.mobile-form-control[data-kind=scroll],.mobile-form-control[data-kind=range],.mobile-form-control[data-kind=drop]{grid-column:1/-1}
#mobile-ui .mobile-form-input{box-sizing:border-box;width:100%;min-width:0;min-height:44px;padding:6px 8px;background:#f7f9fb;color:#21344b;border:1px solid #93a5b8;border-radius:3px;font:16px Tahoma;user-select:text;-webkit-user-select:text;touch-action:manipulation}
.mobile-form-number{display:grid;grid-template-columns:minmax(70px,1fr) 42px 42px auto;gap:4px;align-items:center}
#mobile-ui .mobile-form-number button{min-height:44px;padding:3px;font-size:16px}
#mobile-ui .mobile-form-number .mobile-form-all{font-size:11px;padding:3px 7px}
.mobile-form-scroll{display:flex;gap:5px}
#mobile-ui .mobile-form-scroll button{flex:1;min-height:35px;font-size:11px;background:#dce5ee}
.mobile-form-range{width:calc(100% - 55px);min-height:40px;vertical-align:middle;touch-action:pan-x}
.mobile-form-footer{display:flex;gap:5px;padding:6px;background:#dce5ee;border-top:1px solid #b4c0ce;flex-wrap:wrap;flex-shrink:0}
.mobile-form-footer .mobile-form-control{flex:1 1 65px}
#mobile-ui .mobile-form-footer button{width:100%;min-height:42px;background:#d4e4f5}
#mobile-form-notice{min-height:16px;max-height:32px;overflow:auto;font:10px/14px Tahoma;color:#fff;padding:2px 4px;flex-shrink:0}
#mobile-forms[data-floating=true]{inset:auto;left:50%;top:50%;transform:translate(-50%,-50%);width:min(320px,60vw);max-height:65vh;background:transparent;padding:0;border:0;pointer-events:none}
#mobile-forms[data-floating=true] #mobile-form-tabs,#mobile-forms[data-floating=true] #mobile-form-notice{display:none}
#mobile-forms[data-floating=true] .mobile-form-shell{pointer-events:auto}
#mobile-form-toasts{position:absolute;left:50%;top:calc(46px + env(safe-area-inset-top));transform:translateX(-50%);max-width:65%;padding:5px 10px;white-space:pre-wrap;overflow-wrap:anywhere;background:#e9edf1e8;border:1px solid #798ca2;border-radius:3px;font:11px/16px Tahoma;color:#21344b;pointer-events:none;z-index:26}
#mobile-buffs{position:absolute;right:calc(10px + env(safe-area-inset-right));top:calc(135px + env(safe-area-inset-top));display:flex;flex-direction:column;align-items:flex-end;gap:3px;max-height:35%;max-width:35%;overflow:auto;touch-action:pan-y;pointer-events:auto}
#mobile-ui #mobile-buffs button{min-height:28px;padding:2px 5px;border-radius:3px;font:9px/12px Tahoma;text-align:left;max-width:100%;background:#dce5e8c9}
#mobile-more-menus{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin-top:12px}
#mobile-ui #mobile-more-menus button{min-height:42px;font-size:11px;border-radius:3px}
@media(max-width:700px) and (orientation:landscape){#mobile-form-panels{gap:4px}.mobile-form-body{padding:6px}.mobile-form-fields[data-grid=true]{grid-template-columns:repeat(auto-fit,minmax(90px,1fr))}.mobile-form-number{grid-template-columns:minmax(55px,1fr) 34px 34px;gap:3px}.mobile-form-all{grid-column:1/-1}.mobile-form-header{padding-left:6px}.mobile-form-header>strong{font-size:11px}#mobile-ui .mobile-form-control button{font-size:11px}.mobile-form-reading{font-size:11px;line-height:16px}}
@media(max-height:350px){#mobile-form-tabs{min-height:27px}#mobile-ui #mobile-form-tabs button{min-height:26px}.mobile-form-header{min-height:32px}#mobile-ui .mobile-form-header>button{min-height:32px}.mobile-form-footer{padding:4px}#mobile-ui .mobile-form-footer button{min-height:36px}#mobile-form-notice{min-height:12px}.mobile-form-reading p{margin-bottom:2px}}
.hud-control{pointer-events:auto;touch-action:none}
/* Scale only the visible additions, preserving their screen-edge anchors.
   Login input rectangles already come from the scaled Rust canvas geometry. */
body[data-hud=mobile] #mobile-stick{transform:scale(1.1);transform-origin:left bottom}
body[data-hud=mobile] #mobile-actions{transform:scale(1.08);transform-origin:right bottom}
/* Core controls occupy opposite bottom corners, away from the centered chat. */
#mobile-stick{position:absolute;width:var(--stick-size);height:var(--stick-size);left:calc(16px + env(safe-area-inset-left));bottom:calc(16px + env(safe-area-inset-bottom));border:1px solid #b8c9d8;border-radius:50%;background:#cad4dd45;color:#e2ecff;box-shadow:0 0 0 2px #fff4;text-shadow:0 1px 2px #000}
#mobile-stick span{position:absolute}#mobile-stick .stick-up{top:7px;left:50%;transform:translateX(-50%)}#mobile-stick .stick-down{bottom:7px;left:50%;transform:translateX(-50%)}#mobile-stick .stick-left{left:9px;top:50%;transform:translateY(-50%)}#mobile-stick .stick-right{right:9px;top:50%;transform:translateY(-50%)}
#mobile-stick-knob{left:50%;top:50%;margin:-25px 0 0 -25px;width:48px;height:48px;border-radius:50%;background:#e8eef5da;border:1px solid #8e9dae;box-shadow:0 1px 3px #0005}
#mobile-stick[data-disabled=true]{opacity:.35;pointer-events:none}
/* Esc and trade amounts preserve the HUD; modal input guards remain active. */
#mobile-ui[data-keep-hud=true] #mobile-stick[data-disabled=true],
#mobile-ui[data-keep-hud=true] #mobile-combat button:disabled,
#mobile-ui[data-keep-hud=true] #mobile-sit:disabled{opacity:1}
#mobile-ui[data-keep-hud=true] #mobile-menu-group button:disabled,
#mobile-ui[data-keep-hud=true] #mobile-utilities button:disabled,
#mobile-ui[data-keep-hud=true] #mobile-chat button:disabled,
#mobile-ui[data-keep-hud=true] #mobile-chat-form input:disabled{opacity:1}
#mobile-ui[data-keep-hud=true][data-pickup-available=false] #mobile-pickup:disabled{opacity:.45}
#mobile-ui[data-keep-hud=true] #mobile-chat-form input:disabled{-webkit-text-fill-color:#111}
#mobile-utilities{position:absolute;left:calc(16px + var(--mobile-basic-width) + env(safe-area-inset-left));top:calc(8px + env(safe-area-inset-top));display:flex;gap:4px;pointer-events:auto}
#mobile-ui #mobile-utilities button{width:32px;height:30px;min-height:0;padding:2px 0;border-radius:3px;font-size:9px;white-space:nowrap}
#mobile-ui #mobile-sit{position:absolute;left:calc(27px + var(--stick-size)*.96 + env(safe-area-inset-left));bottom:calc(16px + env(safe-area-inset-bottom));width:40px;height:40px;min-height:0;padding:0;border-radius:50%;font-size:0;background:linear-gradient(#fbfdff,#d9e5f3);border:1px solid #8398b2;box-shadow:inset 0 1px #fff,inset 0 -1px #b9c7d7,0 1px 2px #0004}
.mobile-sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#mobile-actions{--attack-size:110px;--tool-size:50px;--tool-gap:6px;position:absolute;right:calc(16px + env(safe-area-inset-right));bottom:calc(16px + env(safe-area-inset-bottom));width:calc(var(--tool-size)*2 + var(--tool-gap));display:flex;flex-direction:column;align-items:center;gap:6px}
#mobile-action-tools{display:flex;gap:var(--tool-gap)}
#mobile-ui #mobile-action-tools button{width:var(--tool-size);height:var(--tool-size);min-height:0;padding:3px;font-size:10px;line-height:12px}
#mobile-next-target span{display:block}
#mobile-attack{width:var(--attack-size);height:var(--attack-size);border-radius:50%!important;font-size:18px!important}
#mobile-ui #mobile-cancel-attack{position:absolute;right:calc(100% + 16px);bottom:0;width:40px;height:40px;min-height:0;padding:2px;border-radius:50%;font-size:10px;background:#f0e4e2ed;border-color:#a98e88}
body[data-hud=mobile] #status{display:none}body[data-hud=mobile] #game{touch-action:none;cursor:none}
#status[data-error=true]{display:block!important;z-index:40;bottom:25%;left:10%;right:10%;max-width:none;font-size:14px;background:#321d1df2;padding:15px;overflow-wrap:anywhere}
@media(max-height:390px){#mobile-ui{--stick-target:130px}#mobile-actions{--attack-size:100px;--tool-size:46px}}
@media(max-height:340px){#mobile-ui{--stick-target:106px}}
@media(max-width:700px) and (orientation:landscape){#mobile-actions{--attack-size:80px;--tool-size:34px;--tool-gap:4px}#mobile-ui #mobile-action-tools button{font-size:9px}}
/* Mobile-only replacement. The original GRF input artwork retains its painted
   wells; history keeps the classic translucent panel, thin border and tabs. */
#mobile-chat{position:absolute;left:calc(43% + (env(safe-area-inset-left) - env(safe-area-inset-right))/2);bottom:calc(10px + env(safe-area-inset-bottom));transform:translateX(-50%);width:calc(38% - env(safe-area-inset-left) - env(safe-area-inset-right));max-width:40vw;pointer-events:auto;font:11px/13px Tahoma,Arial,sans-serif;color:white}
#mobile-chat-tabs{display:flex;align-items:flex-end;height:19px;gap:1px;padding-left:3px}
#mobile-ui #mobile-chat-tabs button{min-height:0;height:19px;font:10px/16px Tahoma,Arial,sans-serif;padding:0 4px;color:white;text-shadow:1px 1px #000;border:1px solid transparent;border-radius:2px 2px 0 0;background:#0003;box-shadow:none;touch-action:manipulation;white-space:nowrap}
#mobile-ui #mobile-chat-tabs button[aria-selected=true]{border-color:#eee;border-bottom-color:transparent;background:#0005;position:relative;top:1px}
#mobile-ui #mobile-chat-minimize{margin-left:auto;width:25px;font:16px/18px Tahoma,sans-serif;padding:0;border:0;background:none;color:#d3e8ff}
#mobile-chat-history{height:58px;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;background:#0006;border:1px solid #eee;padding:3px 6px;box-sizing:border-box;text-shadow:1px 1px #000;scrollbar-width:thin;scrollbar-color:#9c9c9c #171717;user-select:text;-webkit-user-select:text;overflow-wrap:anywhere}
#mobile-chat-form{height:24px;display:grid;grid-template-columns:16% 2% minmax(0,1fr) 18px 20px;align-items:center;background:#eee center/100% 100%;margin:0;box-sizing:border-box;padding:1px 2px;gap:0;border-radius:1px;overflow:hidden}
#mobile-chat-recipient-well,#mobile-chat-message-well{position:relative;height:20px;overflow:hidden}
/* Keep the keyboard font at16px to avoid iOS focus zoom, then render its field
   at the classic11px size. The interactive box still fills the original well. */
#mobile-chat-form input{position:absolute;inset:0;width:145.4545%;height:145.4545%;transform:scale(.6875);transform-origin:top left;box-sizing:border-box;background:transparent;border:0;border-radius:0;outline:none;box-shadow:none;padding:0 3px;font:16px/26px Tahoma,Arial,sans-serif;color:#111;user-select:text;-webkit-user-select:text;touch-action:manipulation;min-width:0}
#mobile-ui #mobile-chat-form button{min-height:0;height:22px;padding:0;border:0;background:none;box-shadow:none;border-radius:0;touch-action:manipulation;display:grid;place-items:center}
#mobile-ui #mobile-chat-channel{color:#6993da}
#mobile-chat-channel span{width:6px;height:6px;display:block;position:relative;top:1px;border-radius:50%;background:radial-gradient(circle at 35% 25%,#fff 0,currentColor 48%,#466699 100%);box-shadow:0 0 0 1px #9cadd0}
#mobile-ui #mobile-chat-channel[data-channel=party]{color:#2c93db}#mobile-ui #mobile-chat-channel[data-channel=guild]{color:#6dfe03}
#mobile-ui #mobile-chat-send{color:#456aa4}#mobile-chat-send svg{position:relative;top:1px}
#mobile-ui #mobile-chat-send:active,#mobile-ui #mobile-chat-channel:active{background:#c5d7ee80}
/* Native button bevel, with the same inset corner trim as MENU02. */
#mobile-ui #mobile-emotion-shortcuts,#mobile-ui #mobile-extra-options button{
 position:absolute;left:calc(100% + 6px);bottom:0;width:36px;height:22px;min-height:0;
 box-sizing:border-box;border:0;border-radius:5px;padding:0;overflow:hidden;
 display:grid;place-items:center;clip-path:inset(1px round 4px);opacity:.9;
 font:10px/20px Tahoma,Arial,sans-serif;color:#191919;touch-action:manipulation;
 background-image:url('./mobile-assets/shortcut-mesbtn_left.png'),url('./mobile-assets/shortcut-mesbtn_right.png'),url('./mobile-assets/shortcut-mesbtn_mid.png');
 background-position:left center,right center,center;background-size:7px 100%,7px 100%,calc(100% - 14px) 100%;background-repeat:no-repeat;
 box-shadow:none;
}
#mobile-ui #mobile-emotion-shortcuts:hover{filter:brightness(1.06)}
#mobile-ui #mobile-emotion-shortcuts:active{filter:brightness(.9);transform:translateY(1px)}
#mobile-ui #mobile-extra-options button{position:relative;left:auto;bottom:auto;display:block;width:36px;height:20px;min-width:0;padding:0 3px;font:9px/20px Tahoma,Arial,sans-serif;white-space:nowrap;text-overflow:ellipsis}
#mobile-chat[data-emote-open=true]{z-index:8}
/* Clear the24px chat input plus a3px gap, even when history is minimized. */
#mobile-emote-palette{position:absolute;left:0;bottom:27px;width:100%;height:calc(100% + 8px);min-height:109px;z-index:8;display:flex;flex-direction:column;pointer-events:auto;box-sizing:border-box;color:#191919;font:11px/15px Tahoma,Arial,sans-serif;text-shadow:none}
#mobile-emote-palette[hidden]{display:none}
#mobile-emote-palette>header{display:flex;flex:0 0 17px;align-items:center;justify-content:space-between;height:17px;box-sizing:border-box;padding-left:7px;background-image:url('./mobile-assets/shortcut-titlebar_left.png'),url('./mobile-assets/shortcut-titlebar_right.png'),url('./mobile-assets/shortcut-titlebar_mid.png');background-size:7px 17px,7px 17px,calc(100% - 14px) 17px;background-position:left top,right top,center top;background-repeat:no-repeat}
#mobile-ui #mobile-emote-close{width:24px;height:17px;min-height:0;padding:0;border:0;border-radius:0;box-shadow:none;background:transparent url('./mobile-assets/shortcut-sys_close_off.png') center/11px 11px no-repeat}
#mobile-ui #mobile-emote-close:active{background-image:url('./mobile-assets/shortcut-sys_close_on.png')}
#mobile-emote-body{position:relative;isolation:isolate;display:flex;flex:1;min-height:0;padding:6px 3px;overflow:hidden;box-sizing:border-box}
#mobile-emote-body::before{content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;border:14px solid transparent;border-image:url('./mobile-assets/shortcut-body-frame.png') 14 fill stretch}
#mobile-emote-grid{display:grid;flex:1;min-width:0;min-height:0;grid-template-columns:repeat(auto-fill,40px);grid-auto-rows:40px;align-content:start;justify-content:space-between;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:none!important}
#mobile-emote-grid::-webkit-scrollbar{display:none!important}
#mobile-emote-grid[hidden]{display:none}
#mobile-ui #mobile-emote-grid button{display:grid;place-items:center;box-sizing:border-box;width:40px;height:40px;min-height:0;padding:0;border:1px solid transparent;border-radius:0;background:transparent;box-shadow:none;touch-action:manipulation}
#mobile-ui #mobile-emote-grid button:active,#mobile-ui #mobile-emote-grid button:focus-visible{border-color:#b5b5b5;outline:none;background:#e4eaf455}
@media(hover:hover){#mobile-ui #mobile-emote-grid button:hover{border-color:#cecece}}
.mobile-emote-icon{display:block;width:40px;height:40px;pointer-events:none;background-image:url('./mobile-assets/emote-atlas.png');background-size:360px 240px;background-repeat:no-repeat;image-rendering:pixelated}
#mobile-emote-status{position:absolute;inset:12px 18px 6px 6px;margin:0;min-height:28px;text-align:center;font:11px/15px Tahoma}
#mobile-emote-status[hidden]{display:none}
#mobile-emote-scroll{display:flex;flex-direction:column;width:13px;flex:0 0 13px;align-items:center;margin-left:2px;margin-right:1px;background:transparent;box-sizing:border-box}
#mobile-emote-scroll[hidden]{display:none}
#mobile-ui #mobile-emote-scroll button{position:relative;flex:0 0 13px;width:13px;min-height:13px;height:13px;padding:0;border:0;border-radius:0;box-shadow:none;background:transparent center/13px 13px no-repeat;touch-action:manipulation}
#mobile-emote-scroll button::after{content:'';position:absolute;inset:0 -4px}
#mobile-ui #mobile-emote-scroll #mobile-emote-scroll-up{background-image:url('./mobile-assets/shortcut-scroll0up.png')}
#mobile-ui #mobile-emote-scroll #mobile-emote-scroll-down{background-image:url('./mobile-assets/shortcut-scroll0down.png')}
#mobile-emote-scroll-track{position:relative;flex:1;width:13px;min-height:0;touch-action:none;background:linear-gradient(90deg,#d9d9d9,#eee 2px,#eee 11px,#d9d9d9)}
#mobile-emote-scroll-thumb{position:absolute;left:0;width:13px;min-height:18px;touch-action:none;background-image:url('./mobile-assets/shortcut-scroll0bar_up.png'),url('./mobile-assets/shortcut-scroll0bar_down.png'),url('./mobile-assets/shortcut-scroll0bar_mid.png');background-size:13px 4px,13px 4px,13px calc(100% - 8px);background-position:center top,center bottom,center;background-repeat:no-repeat}
#mobile-emote-scroll-thumb::after{content:'';position:absolute;inset:0 -5px}
@media(max-width:700px) and (orientation:landscape){#mobile-ui #mobile-emotion-shortcuts{left:calc(100% - 30px);bottom:-22px;width:30px;height:20px;font-size:9px;line-height:20px}}
/* Four touch slots share the original banks: 1-4 / 5-8, repeated for3 banks. */
#mobile-shortcuts{position:absolute;left:calc(62% + 20px - env(safe-area-inset-right));bottom:calc(10px + env(safe-area-inset-bottom));width:98px;pointer-events:auto;color:white;font:11px Tahoma,Arial,sans-serif}
#mobile-shortcuts header{height:25px;display:flex;align-items:center;justify-content:space-between;gap:4px;text-shadow:1px 1px #000;margin-bottom:4px}
#mobile-ui #mobile-shortcuts header button{min-height:0;width:27px;height:25px;padding:0;font-size:20px;line-height:20px;border-radius:3px;background:#e5eaf0dc}
#mobile-shortcut-grid{display:grid;grid-template-columns:repeat(2,46px);gap:6px}
#mobile-ui .mobile-slot{width:46px;height:46px;min-height:0;position:relative;overflow:hidden;border:1px solid #798ca2;border-radius:3px;background:#e9edf1e8;box-shadow:inset 1px 1px white,inset -1px -1px #c1c9d3;padding:3px;touch-action:none}
.mobile-slot .slot-key{position:absolute;top:2px;left:3px;font:9px Tahoma,sans-serif;color:#3f526c;z-index:1}
.mobile-slot img{width:30px;height:30px;object-fit:contain;image-rendering:pixelated;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}
.mobile-slot .slot-name{display:block;font:10px/12px Tahoma,sans-serif;overflow:hidden;max-height:25px;margin-top:7px;overflow-wrap:anywhere}
.mobile-slot img:not([hidden])~.slot-name{display:none}
.mobile-slot .slot-detail{position:absolute;bottom:1px;right:2px;font:9px Tahoma,sans-serif;color:#21344b;text-shadow:0 1px white}
.mobile-slot[data-unavailable=true] img,.mobile-slot[data-unavailable=true] .slot-name{opacity:.4}
.mobile-slot[data-pressing=true]{outline:2px solid #a4d8ff;outline-offset:1px}
#mobile-shortcut-picker{position:fixed;inset:0;pointer-events:auto;background:#0005;display:grid;place-items:center}
#mobile-shortcut-picker-panel{width:min(330px,80vw);max-height:85vh;display:flex;flex-direction:column;overflow:hidden;border:1px solid #899aab;border-radius:3px;background:#eee;box-shadow:inset 1px 1px white,0 2px 8px #0006;color:#182236;font:12px Tahoma,Arial,sans-serif}
#mobile-shortcut-picker-panel header{height:25px;display:flex;align-items:center;justify-content:space-between;padding-left:8px;background:linear-gradient(#d8eaff,#abc9ed 45%,#d9e9fb 50%,#eef5ff);border-bottom:1px solid #7895b6}
#mobile-ui #mobile-shortcut-picker-close{width:30px;height:25px;min-height:0;padding:0;border:0;background:none;font-size:20px}
#mobile-shortcut-picker-panel p{margin:7px 9px;font-size:11px}
#mobile-shortcut-choices{overflow:auto;overscroll-behavior:contain;touch-action:pan-y;max-height:160px;border-block:1px solid #bdc5cf;background:white;padding:3px}
#mobile-ui #mobile-shortcut-choices button{display:flex;align-items:center;gap:8px;width:100%;min-height:44px;text-align:left;border:0;border-radius:0;background:white;box-shadow:none;touch-action:manipulation;font-size:12px}
#mobile-ui #mobile-shortcut-choices button:active{background:#c8daf5}
#mobile-shortcut-choices img{width:24px;height:24px;object-fit:contain;image-rendering:pixelated}
#mobile-shortcut-picker-panel footer{display:flex;align-items:center;gap:8px;padding:6px;font-size:10px;color:#526273}
#mobile-ui #mobile-shortcut-clear{min-height:30px;padding:3px 9px;border-radius:2px;font-size:11px}
@media(max-width:700px) and (orientation:landscape){#mobile-chat{bottom:calc(52px + env(safe-area-inset-bottom));left:calc(39% + (env(safe-area-inset-left) - env(safe-area-inset-right))/2);width:calc(34% - env(safe-area-inset-left) - env(safe-area-inset-right))}#mobile-shortcuts{left:calc(56% + 6px - env(safe-area-inset-right));width:76px}#mobile-shortcut-grid{grid-template-columns:repeat(2,36px);gap:4px}#mobile-ui .mobile-slot{width:36px;height:36px} .mobile-slot img{width:26px;height:26px}.mobile-slot .slot-detail{font-size:8px}.mobile-slot .slot-name{font-size:9px;line-height:10px;max-height:21px}#mobile-shortcuts header{height:22px}#mobile-ui #mobile-shortcuts header button{width:23px;height:22px}#mobile-shortcut-choices{max-height:125px}}
/* Invisible keyboard surfaces over the original canvas login fields. */
#classic-login-inputs input,#classic-account-inputs input{position:fixed;box-sizing:border-box;pointer-events:auto;touch-action:manipulation;background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;padding:0!important;min-height:0!important;font:16px Tahoma,sans-serif;color:transparent!important;-webkit-text-fill-color:transparent!important;caret-color:transparent;outline:none;user-select:text;-webkit-user-select:text}
#classic-login-inputs input::selection,#classic-account-inputs input::selection{background:transparent;color:transparent}
#classic-account-inputs[data-docked=true] input{background:#e9edf1b8!important;border:1px solid #93a5b88c!important;padding:6px 8px!important;color:#21344b!important;-webkit-text-fill-color:#21344b!important;caret-color:#21344b;box-shadow:0 2px 8px #0005!important}
#classic-account-inputs[data-docked=true] input::selection{background:#b9d4f1;color:#21344b}
/* Local phone preview only: simulated touch indicators. */
body[data-touch-debug=true],body[data-touch-debug=true] *{cursor:none!important}
#debug-finger,#debug-finger-second{position:fixed;width:32px;height:32px;margin:-18px 0 0 -18px;border:2px solid #effcff;border-radius:50%;box-shadow:0 0 0 1px #173b50,0 1px 6px #0008;pointer-events:none;z-index:100;background:#70cfff30}
#debug-finger[data-down=true]{background:#70cfff85;border-color:#70d8ff;transform:scale(.85)}#debug-finger-second{border-style:dashed;background:#ffc55a60}
#debug-phone-keyboard{position:fixed;bottom:0;left:0;right:0;z-index:80;background:repeating-linear-gradient(0deg,#c0c6cf 0,#c0c6cf 30px,#abb3c0 31px,#abb3c0 33px);border-top:1px solid #8290a0;color:#233044;font:13px Tahoma,Arial,sans-serif;box-sizing:border-box;padding:18px;text-align:center}
#debug-phone-keyboard strong,#debug-phone-keyboard span{display:block;background:#e8edf3df;padding:5px}
body[data-touch-debug=false] #debug-finger,body[data-touch-debug=false] #debug-finger-second,body[data-touch-debug=false] #debug-phone-keyboard{display:none!important}
/* Mobile workspace v1: text and boxes share the shortcut palette. */
#mobile-basic{position:absolute;left:calc(10px + env(safe-area-inset-left));top:calc(8px + env(safe-area-inset-top));width:var(--mobile-basic-width);box-sizing:border-box;padding:4px 5px;background:#e9edf1ed;border:1px solid #798ca2;border-radius:3px;box-shadow:inset 1px 1px white,inset -1px -1px #c1c9d3;color:#21344b;font:11px/13px Tahoma,Arial,sans-serif;pointer-events:auto;cursor:pointer}
#mobile-ui #mobile-basic-name{display:block;position:relative;min-height:19px;width:100%;padding:0 16px 0 1px;text-align:left;font-size:11px;border:0;background:none;box-shadow:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#mobile-basic-name:after{content:'−';position:absolute;right:1px;top:0;font-size:14px}#mobile-basic[data-minimized=true] #mobile-basic-name:after{content:'+'}
#mobile-basic[data-minimized=true]>:not(#mobile-basic-name,#mobile-basic-compact){display:none}
#mobile-basic[data-minimized=true]{height:30px;padding:2px 16px 2px 5px;display:grid;grid-template-columns:minmax(0,1fr) auto auto;grid-template-rows:14px 10px;column-gap:5px;align-items:center}
#mobile-ui #mobile-basic[data-minimized=true] #mobile-basic-name{position:static;grid-column:1;grid-row:1;min-width:0;min-height:14px;height:14px;padding:0;font:10px/14px Tahoma}
#mobile-basic[data-minimized=true] #mobile-basic-name:after{top:2px;right:3px;font:12px/14px Tahoma}
#mobile-basic-compact{display:contents;font:9px/14px Tahoma}
#mobile-basic-compact-hp,#mobile-basic-compact-sp{grid-row:1;white-space:nowrap}
#mobile-basic-compact-hp{grid-column:2}#mobile-basic-compact-sp{grid-column:3}
#mobile-basic-compact-job{grid-column:1;grid-row:2;text-align:left;font:8px/10px Tahoma;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#mobile-basic-job{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mobile-vital{display:flex;gap:4px;align-items:center;height:17px}.mobile-vital>span{width:16px}
.mobile-meter{position:relative;flex:1;height:16px;background:#d6dce4;border:1px solid #8c9aa8;overflow:hidden;box-sizing:border-box;border-radius:2px}.mobile-meter>span{position:absolute;inset:0 auto 0 0;background:#8ed698}.mobile-meter.sp>span{background:#93bee9}.mobile-meter>b{position:absolute;inset:0;text-align:center;font:10px/14px Tahoma;color:#172b3c;text-shadow:0 1px #ffffff80}
#mobile-basic-exp,#mobile-basic-weight{font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#mobile-menu-group{position:absolute;left:calc(var(--mobile-map-left,100vw - 126px) - 150px);top:var(--mobile-map-top,10.8px);width:144px;box-sizing:border-box;padding:2px;background:#0007;border:1px solid #c5cedb;border-radius:2px;pointer-events:auto}
#mobile-ui[data-map-hidden=true] #mobile-menu-group{left:calc(var(--mobile-map-left,100vw - 126px) + var(--mobile-map-width,115.2px) - 144px)}
#mobile-menu-group>header{display:flex;align-items:center;gap:4px;height:16px;color:#fff;font:10px/14px Tahoma;text-shadow:1px 1px black}
#mobile-menu-group>header>span{flex:1}
#mobile-ui #mobile-menu-group>header button{min-height:0;height:16px;padding:0 3px;font:11px/14px Tahoma;color:#fff;border:0;border-radius:1px;background:#0004;box-shadow:none}
#mobile-ui #mobile-menu-minimize{width:24px;font-size:15px!important}
#mobile-navigation{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;pointer-events:auto}
#mobile-ui #mobile-navigation button{min-width:0;min-height:26px;height:26px;padding:2px 1px;border-radius:3px;font-size:10px;white-space:nowrap;background:#e9edf1ed;box-shadow:inset 1px 1px white,inset -1px -1px #c1c9d3}
#mobile-ui #mobile-minimap-toggle{position:absolute;left:var(--mobile-map-left,calc(100vw - 126px));top:var(--mobile-map-top,10.8px);width:var(--mobile-map-width,115.2px);height:var(--mobile-map-height,115.2px);min-height:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none}
@media(max-height:350px){#mobile-ui #mobile-navigation button{height:22px;min-height:22px;font-size:9px}#mobile-actions{bottom:calc(8px + env(safe-area-inset-bottom));--attack-size:78px;--tool-size:32px}}
#mobile-workspace-layer{position:fixed;inset:0;pointer-events:auto;background:#0002;z-index:10;touch-action:none}
#mobile-workspace{position:absolute;top:calc(12px + env(safe-area-inset-top));left:calc(12px + env(safe-area-inset-left));right:calc(154px + env(safe-area-inset-right));bottom:calc(12px + env(safe-area-inset-bottom) + var(--keyboard-bottom,0px));display:flex;flex-direction:column;overflow:hidden;background:#e9edf1fa;border:1px solid #798ca2;border-radius:3px;box-shadow:inset 1px 1px white,0 2px 6px #0005;color:#21344b;font:13px/18px Tahoma,Arial,sans-serif}
#mobile-workspace>header{display:flex;align-items:center;justify-content:space-between;min-height:44px;padding-left:10px;border-bottom:1px solid #aab8c7;background:#d9e4f1}
#mobile-ui #mobile-workspace-close{height:44px;min-width:56px;border-radius:0;border-width:0 0 0 1px;background:#e8edf4}
#mobile-workspace-tabs{display:flex;flex-shrink:0;overflow-x:auto;overscroll-behavior:contain;touch-action:pan-x;border-bottom:1px solid #aab8c7;scrollbar-width:thin}
#mobile-ui #mobile-workspace-tabs button{min-height:44px;min-width:65px;flex:0 0 auto;border-radius:0;border-width:0 1px 0 0;padding:4px}
#mobile-ui #mobile-workspace-tabs button[aria-pressed=true]{background:#bdd3eb;box-shadow:inset 0 -3px #6b92c1}
#mobile-workspace-body{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;padding:8px;box-sizing:border-box}
#mobile-workspace-body p{margin:4px 0 8px}
#mobile-workspace-notice{flex-shrink:0;min-height:22px;max-height:42px;font-size:11px;line-height:15px;padding:3px 8px;background:#dce5ee;border-top:1px solid #b4c0ce}
#mobile-workspace-split{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;height:100%;min-height:0}
#mobile-workspace-browser,#mobile-workspace-detail{display:flex;flex-direction:column;min-width:0;min-height:0}
#mobile-workspace-detail{border-left:1px solid #b2c0d0;padding-left:8px;overflow:auto;touch-action:pan-y}
#mobile-workspace-filters{display:flex;gap:4px;flex-shrink:0}
#mobile-workspace input,#mobile-workspace select{box-sizing:border-box;min-height:44px;min-width:0;font:16px Tahoma,sans-serif;color:#21344b;background:#f7f9fb;border:1px solid #93a5b8;border-radius:3px;padding:4px;max-width:100%;user-select:text;-webkit-user-select:text;touch-action:manipulation}
#mobile-workspace-search{width:100%}#mobile-workspace-filter{width:90px}
#mobile-workspace-list{flex:1;min-height:0;overflow:auto;touch-action:pan-y;overscroll-behavior:contain;padding:4px 0}
#mobile-workspace-list[data-empty=true]:after{content:'ยังไม่มีรายการ';display:block;padding:8px}
.mobile-record-row{display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:3px;margin-bottom:4px}
.mobile-record-choice{display:flex;align-items:center;gap:7px;min-width:0}
.mobile-record-choice img{width:32px;height:32px;object-fit:contain;flex-shrink:0}
.mobile-record-choice span{min-width:0;overflow-wrap:anywhere}
#mobile-workspace-record-icon{width:64px;height:64px;object-fit:contain;align-self:flex-start;margin:2px 0 6px}
.mobile-item-toast{display:flex;align-items:center;gap:6px}
.mobile-item-toast img{width:24px;height:24px;object-fit:contain;flex-shrink:0}
#mobile-form-notice,#mobile-workspace-drag{display:flex;align-items:center;gap:6px}
#mobile-form-drag-icon,#mobile-workspace-drag-icon{width:24px;height:24px;object-fit:contain;flex-shrink:0}
.mobile-form-gallery .mobile-form-art[data-size=icon]{width:32px;height:32px;object-fit:contain;border:0;background:transparent}
#mobile-ui .mobile-record-row button{border-radius:3px;min-height:48px;font-size:12px;line-height:16px;text-align:left;overflow-wrap:anywhere}
#mobile-ui .mobile-record-row button:last-child{padding:2px;text-align:center;touch-action:none}
#mobile-ui .mobile-record-row[data-selected=true]>button:first-child{background:#c3d9f1;border-color:#7498c5}
#mobile-workspace-record-name{font-size:14px;line-height:19px}
#mobile-workspace-record-info{font-size:11px;color:#526778}
#mobile-workspace-description{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;line-height:18px;min-height:32px;margin-bottom:8px}
#mobile-workspace-record-actions{display:flex;flex-wrap:wrap;gap:4px}
#mobile-ui #mobile-workspace-record-actions button{min-height:44px;flex:1 1 42%;font-size:12px;border-radius:3px}
#mobile-workspace-level,#mobile-workspace-drop-row{display:flex;align-items:center;gap:4px;flex:1 1 100%}
#mobile-workspace-level button{flex:0 0 44px!important}
#mobile-workspace-amount{width:75px}
#mobile-ui #mobile-workspace-drop{color:#8a3030}
#mobile-ui[data-workspace]:not([data-workspace=""]) #mobile-shortcuts{left:auto;right:calc(16px + env(safe-area-inset-right));z-index:12}
#mobile-ui[data-workspace]:not([data-workspace=""]) :is(#mobile-chat,#mobile-stick,#mobile-sit,#mobile-actions,#mobile-utilities){display:none}
#mobile-ui[data-workspace]:not([data-workspace=""]) #mobile-shortcut-picker{z-index:20}
#mobile-ui .mobile-slot[data-drop=true]{outline:3px solid #a4d8ff;outline-offset:2px;background:#bed9f4}
#mobile-workspace-drag{position:fixed;transform:translate(-50%,-120%);padding:8px 12px;max-width:180px;background:#d9e9fa;color:#21344b;border:2px solid #7ba6d4;border-radius:3px;z-index:30;pointer-events:none;box-shadow:0 2px 6px #0005}
#mobile-workspace-confirm{position:absolute;inset:0;background:#e9edf1fa;z-index:2;padding:20px;display:flex;align-content:center;align-items:center;justify-content:center;flex-wrap:wrap;gap:10px}
#mobile-workspace-confirm p{flex:1 1 100%;text-align:center;white-space:pre-wrap}
#mobile-ui #mobile-workspace-confirm button{min-width:90px;min-height:44px;border-radius:3px}
#mobile-workspace-status-columns{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:10px}
.mobile-stat-row{display:flex;justify-content:space-between;align-items:center;gap:4px;border-bottom:1px solid #c8d2dc;min-height:48px}
#mobile-ui .mobile-stat-row button{min-width:44px;border-radius:3px}
#mobile-workspace-combat{white-space:pre-wrap;font-size:13px;line-height:29px;background:#f4f7fa;padding:6px}
.mobile-setting-row{display:grid;grid-template-columns:120px 44px minmax(60px,1fr) 48px;align-items:center;gap:6px;margin-bottom:10px}
#mobile-workspace input[type=checkbox]{width:32px;height:32px;min-height:32px}
#mobile-workspace input[type=range]{width:100%;padding:0;touch-action:pan-x}
#mobile-workspace-map{position:relative;width:min(200px,100%);height:200px;background:#18232f;margin:0 auto;overflow:hidden}
#mobile-workspace-map-image{width:100%;height:100%;object-fit:fill;image-rendering:pixelated}
#mobile-workspace-map-player{position:absolute;color:#7bff87;font-size:18px;line-height:18px;transform:translate(-50%,-50%);text-shadow:0 1px black}
#mobile-workspace-social-form{display:flex;gap:6px;flex-wrap:wrap}
#mobile-social-tabs{display:flex;gap:4px;margin-bottom:8px}#mobile-ui #mobile-social-tabs button{min-height:36px;min-width:80px;border-radius:3px}#mobile-social-tabs button[aria-pressed=true]{background:#bdd3eb}
#mobile-workspace-social-name{flex:1;min-width:100px}
.mobile-social-list{margin:8px 0}.mobile-social-row{display:flex;gap:4px;align-items:center;padding:4px 0;border-bottom:1px solid #bdc9d5}
.mobile-social-row>span{flex:1;min-width:0;overflow-wrap:anywhere;font-size:12px}
#mobile-ui .mobile-social-row button{font-size:11px;min-height:44px;padding:4px;border-radius:3px}
@media(max-width:700px) and (orientation:landscape){
 #mobile-basic-job{font-size:9px}
 #mobile-ui #mobile-utilities button{width:30px}
 #mobile-ui{--stick-size:min(var(--stick-target),calc((22vw - 8px)/1.08 - 2px))}
 #mobile-stick{left:calc(4px + env(safe-area-inset-left))}
 #mobile-ui #mobile-sit{width:38px;height:38px;bottom:calc(12px + env(safe-area-inset-bottom))}
 #mobile-ui #mobile-cancel-attack{width:34px;height:34px;font-size:9px}
 #mobile-workspace{right:calc(126px + env(safe-area-inset-right));font-size:12px}
 #mobile-workspace-body{padding:5px}#mobile-workspace-split{gap:5px;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 #mobile-workspace-filters{flex-wrap:wrap}#mobile-workspace-filter{width:100%}
 #mobile-workspace-status-columns{grid-template-columns:1fr}
 .mobile-setting-row{grid-template-columns:80px 32px minmax(50px,1fr) 38px;gap:4px}
 #mobile-workspace-notice{font-size:10px}
}

/* Transaction panes keep both parties visible without narrow native grids. */
.mobile-trade-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;min-width:0}
.mobile-trade-side{min-width:0;padding:5px;border:1px solid #b4c1cf;background:#f3f6f9}
.mobile-trade-title{display:block;font-size:11px;margin-bottom:5px;color:#486382}
.mobile-form-gallery{display:flex;flex-wrap:wrap;gap:6px;justify-content:center}
.mobile-form-art{display:block;max-width:100%;max-height:200px;object-fit:contain;image-rendering:pixelated;border:1px solid #b3c0cf;background:#18232f}
#mobile-ui .mobile-form-shell[data-layout=trade] .mobile-form-input{min-width:45px}
@media(max-width:700px){.mobile-trade-columns{gap:4px}.mobile-trade-side{padding:3px}.mobile-trade-side .mobile-form-number{grid-template-columns:minmax(45px,1fr) 28px 28px}}

.mobile-form-field-label{display:block;grid-column:1/-1;font:11px/16px Tahoma;color:#486382;margin:1px 0 3px}
#mobile-ui .mobile-form-control[data-kind=tab] button{text-align:center;min-height:34px;background:#d4e2ef}

#mobile-ui textarea.mobile-form-input{min-height:90px;resize:vertical;line-height:22px}.mobile-form-control[data-kind=textarea]{grid-column:1/-1}

.mobile-form-filters{display:flex;gap:3px;padding:4px 6px;background:#dce5ee;border-bottom:1px solid #b4c0ce;overflow:auto;touch-action:pan-x;flex-shrink:0}
.mobile-form-filters>.mobile-form-control{flex:1 0 auto;min-width:48px}
#mobile-ui .mobile-form-filters button{width:100%;min-height:34px;font-size:11px;padding:3px 7px}
.mobile-form-shell[data-id="3500"] .mobile-form-fields{grid-template-columns:repeat(auto-fit,minmax(64px,1fr))}

/* Nearby NPCs sit between Basic and the analog; only this compact panel catches touches. */
#mobile-npcs{position:absolute;left:calc(10px + env(safe-area-inset-left));top:var(--mobile-npc-top,118px);bottom:calc(30px + var(--stick-size)*1.08 + env(safe-area-inset-bottom));width:min(var(--mobile-basic-width),148px);max-height:128px;min-height:0;display:flex;flex-direction:column;box-sizing:border-box;overflow:hidden;background:#e9edf14d;border:1px solid #798ca26b;border-radius:3px;box-shadow:none;color:#172b43;pointer-events:auto;font:10px/14px Tahoma,Arial,sans-serif}
#mobile-npcs>header{display:flex;align-items:center;justify-content:space-between;gap:3px;padding:0 1px 0 5px;height:26px;min-height:26px;box-sizing:border-box;background:#d9e4f18a;border-bottom:1px solid #aab8c766;flex-shrink:0;text-shadow:0 1px #fff8}
#mobile-npc-count{color:#344f70;font-size:9px}
#mobile-ui #mobile-npc-minimize{width:26px;height:24px;min-height:24px;min-width:26px;padding:0;border-radius:2px;border-color:#798ca255;background:#e8eef54d;color:#21344b;font:16px/20px Tahoma;box-shadow:none}
#mobile-npcs[data-minimized=true]{bottom:auto;height:28px;max-height:none}
#mobile-npcs[data-minimized=true]>header{border-bottom:0}
#mobile-npc-list{min-height:0;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;padding:2px;scrollbar-width:thin}
#mobile-ui .mobile-npc-name{display:block;width:100%;min-height:28px;margin:0 0 2px;padding:3px 5px;border-radius:2px;border-color:#798ca25c;background:#eef1f566;color:#172b43;text-align:left;font:10px/14px Tahoma,Arial,sans-serif;text-shadow:0 1px #fff8;box-shadow:none;overflow-wrap:anywhere;touch-action:pan-y}
#mobile-ui .mobile-npc-name:last-child{margin-bottom:0}
#mobile-ui .mobile-npc-name:active{background:#c3d9f1b3;border-color:#7498c5b3}
#mobile-ui[data-forms=true] #mobile-npcs{display:none!important}
/* Short phones reserve the adjacent chat lane instead of covering its history. */
@media(max-width:700px) and (orientation:landscape){#mobile-npcs{width:clamp(96px,17vw,116px)}}

/* Native sysbox skin: one decorative layer per panel, using all nine tiles.
   The existing one-pixel layout border stays transparent, so touch geometry,
   scrolling, minimize sizes, and keyboard docking do not change. Controls keep
   their existing skin. Only this background layer has opacity. */
body[data-hud=mobile] #mobile-ui :is(#mobile-basic,#mobile-menu-group,#mobile-workspace,
 #mobile-shortcut-picker-panel,#mobile-form-toasts,#mobile-npcs,#mobile-workspace-confirm,
 .mobile-form-shell,.mobile-trade-side){
 --sysbox-edge:14px;--sysbox-opacity:.94;
 isolation:isolate;background:transparent;border-color:transparent;border-radius:0;box-shadow:none;
}
body[data-hud=mobile] #mobile-ui :is(.mobile-form-shell,.mobile-trade-side,#mobile-shortcut-picker-panel){position:relative}
body[data-hud=mobile] #mobile-ui :is(#mobile-basic,#mobile-menu-group,#mobile-workspace,
 #mobile-shortcut-picker-panel,#mobile-form-toasts,#mobile-npcs,#mobile-workspace-confirm,
 .mobile-form-shell,.mobile-trade-side)::before{
 content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;
 opacity:var(--sysbox-opacity);background-repeat:no-repeat;
 background-image:url('./mobile-assets/sysbox_lu.png'),url('./mobile-assets/sysbox_ru.png'),
  url('./mobile-assets/sysbox_ld.png'),url('./mobile-assets/sysbox_rd.png'),
  url('./mobile-assets/sysbox_mu.png'),url('./mobile-assets/sysbox_md.png'),
  url('./mobile-assets/sysbox_lm.png'),url('./mobile-assets/sysbox_rm.png'),url('./mobile-assets/sysbox_bg.png');
 background-position:left top,right top,left bottom,right bottom,center top,center bottom,left center,right center,center;
 background-size:var(--sysbox-edge) var(--sysbox-edge),var(--sysbox-edge) var(--sysbox-edge),
  var(--sysbox-edge) var(--sysbox-edge),var(--sysbox-edge) var(--sysbox-edge),
  calc(100% - 2*var(--sysbox-edge)) var(--sysbox-edge),calc(100% - 2*var(--sysbox-edge)) var(--sysbox-edge),
  var(--sysbox-edge) calc(100% - 2*var(--sysbox-edge)),var(--sysbox-edge) calc(100% - 2*var(--sysbox-edge)),
  calc(100% - 2*var(--sysbox-edge)) calc(100% - 2*var(--sysbox-edge));
}
body[data-hud=mobile] #mobile-ui #mobile-menu-group{--sysbox-edge:10px}
body[data-hud=mobile] #mobile-menu-group>header{color:#21344b;text-shadow:none}
/* Clear old panel fills so they cannot cover the native frame. Button fills,
   focus/selection states and input wells remain independent. */
body[data-hud=mobile] #mobile-ui :is(.mobile-form-header,.mobile-form-footer,.mobile-form-filters,
 #mobile-workspace>header,#mobile-workspace-notice,#mobile-shortcut-picker-panel>header){background:transparent}
body[data-hud=mobile] #mobile-ui #mobile-npcs{--sysbox-opacity:.30}
body[data-hud=mobile] #mobile-npcs>header{background:transparent}

/* Native radio art marks the current choice in single-selection tab groups.
   It is decorative: aria-pressed, labels and the full-size button retain the
   existing selection behavior and touch target. Checkboxes keep square marks. */
body[data-hud=mobile] #mobile-ui :is(#mobile-workspace-tabs,#mobile-social-tabs)>button{
 display:inline-flex;align-items:center;justify-content:center;gap:5px;
}
body[data-hud=mobile] #mobile-ui :is(#mobile-workspace-tabs,#mobile-social-tabs)>button::before{
 content:"";width:12px;height:12px;flex:0 0 12px;pointer-events:none;
 background:url('./mobile-assets/radiobtn_off.png') center/12px 12px no-repeat;
}
body[data-hud=mobile] #mobile-ui :is(#mobile-workspace-tabs,#mobile-social-tabs)>button[aria-pressed=true]::before{
 background-image:url('./mobile-assets/radiobtn_on.png');
}
body[data-hud=mobile] #mobile-ui :is(#mobile-workspace-tabs,#mobile-social-tabs)>button[aria-pressed=true]:active::before{
 background-image:url('./mobile-assets/radiobtn_on1.png');
}

/* Progressive skin for native scrollbars. Never replace touch scrolling with
   JS, hide an unsupported platform scrollbar, or change scroll actions. Using
   auto standard properties lets Chromium honor its image-based pseudo-parts.
   Safari/iOS may retain overlay system scrollbars; all gestures still work. */
@supports selector(::-webkit-scrollbar){
 body[data-hud=mobile] #mobile-ui :not(#mobile-chat-history){scrollbar-width:auto;scrollbar-color:auto}
 body[data-hud=mobile] #mobile-ui :not(#mobile-chat-history)::-webkit-scrollbar{width:16px;height:16px;background:transparent}
 body[data-hud=mobile] #mobile-ui :not(#mobile-chat-history)::-webkit-scrollbar-corner{background:transparent}
 body[data-hud=mobile] #mobile-ui :not(#mobile-chat-history)::-webkit-scrollbar-track:vertical{
  background:url('./mobile-assets/scroll0mid.png') center/13px 13px repeat-y;
 }
 body[data-hud=mobile] #mobile-ui :not(#mobile-chat-history)::-webkit-scrollbar-track:horizontal{
  background:url('./mobile-assets/scroll1mid.png') center/13px 13px repeat-x;
 }
 body[data-hud=mobile] #mobile-ui :not(#mobile-chat-history)::-webkit-scrollbar-thumb:vertical{
  min-height:24px;
  background-image:url('./mobile-assets/scroll0bar_up.png'),url('./mobile-assets/scroll0bar_down.png'),url('./mobile-assets/scroll0bar_mid.png');
  background-position:center top,center bottom,center;
  background-size:13px 4px,13px 4px,13px calc(100% - 8px);background-repeat:no-repeat;
 }
 body[data-hud=mobile] #mobile-ui :not(#mobile-chat-history)::-webkit-scrollbar-thumb:horizontal{
  min-width:24px;
  background-image:url('./mobile-assets/scroll1bar_left.png'),url('./mobile-assets/scroll1bar_right.png'),url('./mobile-assets/scroll1bar_mid.png');
  background-position:left center,right center,center;
  background-size:4px 13px,4px 13px,calc(100% - 8px) 13px;background-repeat:no-repeat;
 }
 body[data-hud=mobile] #mobile-ui :not(#mobile-chat-history)::-webkit-scrollbar-button{display:none;background-repeat:no-repeat;background-position:center;background-size:13px 13px}
 body[data-hud=mobile] #mobile-ui :not(#mobile-chat-history)::-webkit-scrollbar-button:vertical:decrement:start{
  display:block;height:18px;background-image:url('./mobile-assets/scroll0up.png');
 }
 body[data-hud=mobile] #mobile-ui :not(#mobile-chat-history)::-webkit-scrollbar-button:vertical:increment:end{
  display:block;height:18px;background-image:url('./mobile-assets/scroll0down.png');
 }
 body[data-hud=mobile] #mobile-ui :not(#mobile-chat-history)::-webkit-scrollbar-button:horizontal:decrement:start{
  display:block;width:18px;background-image:url('./mobile-assets/scroll1left.png');
 }
 body[data-hud=mobile] #mobile-ui :not(#mobile-chat-history)::-webkit-scrollbar-button:horizontal:increment:end{
  display:block;width:18px;background-image:url('./mobile-assets/scroll1right.png');
 }
}

/* The chevron depicts the next action, after the server confirms the pose. */
#mobile-ui #mobile-sit::before{content:"";position:absolute;left:50%;top:50%;width:12px;height:12px;border:solid currentColor;border-width:0 2px 2px 0;transform:translate(-50%,-70%) rotate(45deg);pointer-events:none}
#mobile-ui #mobile-sit[aria-pressed=true]::before{transform:translate(-50%,-25%) rotate(225deg)}
#mobile-ui #mobile-sit{left:calc(29px + var(--stick-size)*1.1 + env(safe-area-inset-left));width:40px;height:40px;transform:scale(.9);transform-origin:center;bottom:calc(22px + env(safe-area-inset-bottom));background:#dce8f01c;border-color:#f0f7ff73;color:#f7fbff;box-shadow:0 1px 3px #0002}
#mobile-ui #mobile-sit:active{background:#dce8f04d;border-color:#fff}
#mobile-stick{background:#dce8f01c;border-color:#f0f7ff73;color:#f7fbff;box-shadow:inset 0 0 0 1px #ffffff0c,0 1px 3px #0002}
#mobile-stick-knob{background:#dce8f052;border-color:#f0f7ff73;box-shadow:0 1px 3px #0002}
#mobile-stick[data-camera-held=true] #mobile-stick-knob{background:#a9dfff70;border-color:#fff;box-shadow:inset 0 0 0 2px #ffffff40,0 0 7px #b4e9ff80}
#mobile-chat{left:calc(43% + 34px + (env(safe-area-inset-left) - env(safe-area-inset-right))/2)}
@media(max-width:700px) and (orientation:landscape){#mobile-chat{left:calc(39% + 34px + (env(safe-area-inset-left) - env(safe-area-inset-right))/2)}#mobile-ui #mobile-sit{width:38px;height:38px;bottom:calc(15px + env(safe-area-inset-bottom))}}

/* References09–13: thumb cluster. Skill centers share a 90px radius around
   attack (198,154), with 38-degree spacing. Tools sit above, cancel below-right. */
#mobile-combat{--combat-scale:1.28;--combat-tool-size:32px;--combat-cancel-size:30px;position:absolute;right:calc(16px + env(safe-area-inset-right));bottom:calc(12px + env(safe-area-inset-bottom));width:280px;height:252px;transform:scale(var(--combat-scale));transform-origin:right bottom;pointer-events:none}
#mobile-combat #mobile-shortcuts{position:absolute;inset:0;width:auto;max-width:none;transform:none;pointer-events:none}
#mobile-combat #mobile-shortcuts>header{display:none}
#mobile-combat #mobile-shortcut-grid{position:absolute;inset:0;display:block;transform:translate(-8px,-10px);pointer-events:none}
#mobile-ui #mobile-combat .mobile-slot{position:absolute;width:52px;height:52px;min-height:0;padding:3px;box-sizing:border-box;border:1px solid #f3f8ff80;border-radius:50%;background:#dce8f01c;box-shadow:inset 0 0 0 1px #ffffff0c,0 1px 3px #0002;color:white;pointer-events:auto}
#mobile-combat #mobile-slot-0{left:114.15px;top:59.06px}
#mobile-combat #mobile-slot-1{left:83.97px;top:109.29px}
#mobile-combat #mobile-slot-2{left:91.11px;top:167.45px}
#mobile-combat #mobile-slot-3{left:132.55px;top:208.89px}
#mobile-combat .mobile-slot img{width:32px;height:32px}
#mobile-combat .slot-key{top:3px;left:50%;transform:translateX(-50%);color:#fff9;font-size:8px;text-shadow:0 1px 2px #000}
#mobile-combat .slot-detail{bottom:3px;right:7px;color:#fff;font-size:9px;text-shadow:0 1px 2px #000}
#mobile-combat .slot-name{color:#fff;font-size:11px;line-height:12px;text-shadow:0 1px 2px #000;margin-top:10px}
#mobile-combat .mobile-slot[data-has-icon=false] .slot-name{font-size:24px;line-height:27px;margin-top:5px}
#mobile-shortcut-pages{position:absolute;right:0;top:84px;display:flex;flex-direction:column-reverse;gap:0;pointer-events:none}
#mobile-ui #mobile-shortcut-pages button{width:28px;height:28px;min-height:0;padding:0;border:0;border-radius:14px;background:transparent;box-shadow:none;color:#fffc;font:bold 11px Tahoma;text-shadow:0 1px 3px #000;pointer-events:auto}
#mobile-ui #mobile-shortcut-pages button[aria-pressed=true]{background:#e7efff52;color:white;box-shadow:inset 0 0 0 1px #fff5}
#mobile-combat #mobile-actions{position:absolute;inset:0;display:block;width:auto;transform:none;pointer-events:none}
#mobile-combat #mobile-action-tools{display:contents}
#mobile-ui #mobile-combat #mobile-actions button{position:absolute;min-height:0;padding:0;box-sizing:border-box;border:1px solid #f0f7ff73;border-radius:50%;background:#dce8f01c;box-shadow:0 1px 3px #0002;color:#f7fbff;display:grid;place-items:center;pointer-events:auto}
#mobile-combat #mobile-attack{left:154px;top:110px;width:88px;height:88px;font-size:0!important;background:#dce8f025!important;box-shadow:0 0 0 4px #e8f4ff12,inset 0 0 0 2px #ffffff12!important}
#mobile-ui #mobile-combat #mobile-next-target{left:calc(189px - var(--combat-tool-size)/2);top:calc(82px - var(--combat-tool-size)/2);width:var(--combat-tool-size);height:var(--combat-tool-size)}
#mobile-ui #mobile-combat #mobile-pickup{left:calc(231px - var(--combat-tool-size)/2);top:calc(82px - var(--combat-tool-size)/2);width:var(--combat-tool-size);height:var(--combat-tool-size)}
#mobile-combat #mobile-cancel-attack{left:calc(225px - var(--combat-cancel-size)/2);top:calc(220px - var(--combat-cancel-size)/2);right:auto;bottom:auto;width:var(--combat-cancel-size);height:var(--combat-cancel-size);border-color:#f3e5e47a!important;background:#e8d4d425!important}
#mobile-combat #mobile-actions svg{display:block;width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;pointer-events:none;filter:drop-shadow(0 1px 1px #0005)}
#mobile-combat #mobile-attack svg{width:38px;height:38px;stroke-width:2.1}
#mobile-ui #mobile-combat button:active,#mobile-ui #mobile-combat .mobile-slot[data-pressing=true]{background:#dce8f04d!important;border-color:#fff;box-shadow:0 0 0 2px #d7efff33}
@media(max-height:390px){#mobile-combat{--combat-scale:1.14}}
@media(max-width:700px) and (orientation:landscape),(max-height:340px){#mobile-combat{--combat-scale:.94;right:calc(12px + env(safe-area-inset-right))}}

@media(max-width:700px) and (orientation:landscape),(max-height:340px){
 #mobile-combat{--combat-tool-size:40px;--combat-cancel-size:38px}
}

/* References02/04: native Basic button art on the former transparent menu. */
body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-menu-group{
 left:calc(var(--mobile-map-left,100vw - 126px) - 143px);width:137px;padding:3px;
 background:#dce8f01c;border-color:#e8f2ff66;border-radius:2px;box-shadow:none;
}
body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-menu-group::before{content:none}
body[data-mobile-presentation=desktop-controls] #mobile-menu-group>header{color:#fff;text-shadow:0 1px #000}
body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-navigation button{
 position:relative;width:30px;height:20px;min-height:20px;padding:0;border:0;border-radius:3px;
 background:transparent;box-shadow:none;overflow:hidden;color:#fff;
}
#mobile-navigation .mobile-nav-normal,#mobile-navigation .mobile-nav-pressed{
 width:30px;height:20px;object-fit:contain;image-rendering:pixelated;pointer-events:none;
}
#mobile-navigation .mobile-nav-normal{display:none}
#mobile-navigation .mobile-nav-pressed{display:none;position:absolute;inset:0}
body[data-mobile-presentation=desktop-controls] #mobile-navigation .mobile-nav-normal:not([hidden]){display:block;opacity:.9}
body[data-mobile-presentation=desktop-controls] #mobile-navigation .mobile-nav-normal:not([hidden])~span{display:none}
body[data-mobile-presentation=desktop-controls] #mobile-navigation button:active .mobile-nav-pressed:not([hidden]){display:block;opacity:.9}
/* On mobile the entire map is the zoom/hold gesture surface. */
body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-minimap-toggle{width:var(--mobile-map-width,128px)}

/* Original-size eight-button grid: breathing room inside/outside its frame. */
body[data-mobile-presentation=desktop-controls] #mobile-ui[data-map-hidden=true] #mobile-menu-group{
 left:calc(var(--mobile-map-left,100vw - 126px) + var(--mobile-map-width,128px) - 137px);
}
body[data-mobile-presentation=desktop-controls] #mobile-navigation{grid-template-columns:repeat(4,30px);gap:3px;justify-content:center;margin-top:3px}
body[data-mobile-presentation=desktop-controls] #mobile-menu-group>header{gap:2px;padding-left:3px}
body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-menu-group>header button{padding:0 2px;font-size:10px}

/* Trim the bright outer bitmap rim while retaining original button dimensions. */
body[data-mobile-presentation=desktop-controls] #mobile-navigation :is(.mobile-nav-normal,.mobile-nav-pressed){
 clip-path:inset(1px round 4px);
}

/* Native minimap artwork now operates the menu group; no visible header text. */
body[data-mobile-presentation=desktop-controls] #mobile-menu-group>header{justify-content:flex-end;height:14px;padding-left:3px}
body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-menu-group>header button{
 position:relative;width:16px;height:14px;min-height:0;padding:1px 2px;background:transparent;
 display:grid;place-items:center;
}
.mobile-menu-control-art,.mobile-menu-control-pressed{width:12px;height:12px;image-rendering:pixelated;pointer-events:none}
.mobile-menu-control-pressed{display:none;position:absolute;left:2px;top:1px}
body[data-mobile-presentation=desktop-controls] .mobile-menu-control-art:not([hidden])~span{display:none}
body[data-mobile-presentation=desktop-controls] button:active>.mobile-menu-control-pressed:not([hidden]){display:block}

/* Reference05: NPC list shares the quick-menu's transparent frame and image toggle. */
body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-npcs{
 width:137px;padding:3px;background:#dce8f01c;border:1px solid #e8f2ff66;border-radius:2px;
 color:#fff;box-shadow:none;
}
body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-npcs::before{content:none}
body[data-mobile-presentation=desktop-controls] #mobile-npcs>header{
 height:18px;min-height:18px;padding:0 1px 0 3px;background:transparent;
 border-bottom:1px solid #e8f2ff33;text-shadow:0 1px #000;
}
body[data-mobile-presentation=desktop-controls] #mobile-npc-count{color:#d6e2ec}
body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-npc-minimize{
 position:relative;display:grid;place-items:center;width:16px;min-width:16px;height:14px;
 min-height:14px;padding:1px 2px;border:0;background:transparent;box-shadow:none;
}
body[data-mobile-presentation=desktop-controls] #mobile-npcs[data-minimized=true]{height:26px}
body[data-mobile-presentation=desktop-controls] #mobile-npc-list{padding:3px 1px 0}
body[data-mobile-presentation=desktop-controls] #mobile-ui .mobile-npc-name{
 min-height:24px;padding:3px;background:transparent;border:0;color:#fff;text-shadow:0 1px #000;
}
body[data-mobile-presentation=desktop-controls] #mobile-ui .mobile-npc-name:active{background:#dce8f033}
body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-npc-list{scrollbar-width:thin;scrollbar-color:#dce8f080 #dce8f014}
body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-npc-list::-webkit-scrollbar{width:6px;height:6px;background:transparent!important}
body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-npc-list::-webkit-scrollbar-track{background:#dce8f014!important;border:0!important}
body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-npc-list::-webkit-scrollbar-thumb{background:#dce8f080!important;border:1px solid #dce8f020!important;border-radius:2px}
body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-npc-list::-webkit-scrollbar-button{display:none!important}
@media(max-width:700px) and (orientation:landscape){body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-npcs{width:120px}}

/* Reference03: compact icon row below HUD02, with matching right edges. */
body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-utilities{
 left:var(--mobile-utilities-left);top:var(--mobile-utilities-top);width:84px;padding:3px;
 display:grid;grid-template-columns:repeat(3,24px);gap:2px;box-sizing:border-box;
 background:#dce8f01c;border:1px solid #e8f2ff66;border-radius:2px;box-shadow:none;
}
/* User artwork is drawn at its original22×23px, including its own frame/colors. */
body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-utilities button,
body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-restore-ui{
 display:grid;place-items:start;width:28px;height:28px;min-height:0;padding:2px 3px 3px;
 border-radius:3px;border:0;background:transparent;box-shadow:none;font-size:0;
 filter:none;transition:transform 100ms ease,filter 100ms ease;
}
body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-utilities button{width:24px;height:25px;padding:1px}
body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-utilities button::before,
body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-restore-ui::before{
 content:'';display:block;width:22px;height:23px;background-position:center;background-repeat:no-repeat;background-size:22px 23px;
}
body[data-mobile-presentation=desktop-controls] #mobile-pointer::before{background-image:url('./mobile-assets/utility-v2-cursor.png')}
body[data-mobile-presentation=desktop-controls] #mobile-hide-ui::before{background-image:url('./mobile-assets/utility-v2-hide.png')}
body[data-mobile-presentation=desktop-controls] #mobile-screenshot::before{background-image:url('./mobile-assets/utility-v2-snap.png')}
body[data-mobile-presentation=desktop-controls] #mobile-restore-ui::before{background-image:url('./mobile-assets/utility-v2-show.png')}
@media(hover:hover) and (pointer:fine){
 body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-utilities button:hover,
 body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-restore-ui:hover{background:transparent;filter:brightness(1.08);transform:translateY(-1px)}
}
body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-utilities button:focus-visible,
body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-restore-ui:focus-visible{outline:1px solid white;outline-offset:1px}
body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-pointer[aria-pressed=true]{background:transparent;box-shadow:none;filter:brightness(1.08) drop-shadow(0 0 2px #72abf7)}
body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-utilities button:active,
body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-restore-ui:active{
 background:transparent;box-shadow:none;filter:brightness(.86);transform:scale(.9);
}
@media(prefers-reduced-motion:reduce){
 body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-utilities button,
 body[data-mobile-presentation=desktop-controls] #mobile-ui #mobile-restore-ui{transition:none}
}
body[data-mobile-presentation=desktop-controls] #mobile-ui,body[data-mobile-presentation=desktop-controls] #mobile-ui *{cursor:none!important}

/* Mobile shortcut setup: native title, message buttons and g4 frame. Keep the
   artwork's edges intact; larger touch targets sit around the native icons. */
#mobile-shortcut-picker{display:flex;align-items:center;justify-content:center;background:#0006;z-index:22}
body[data-hud=mobile] #mobile-ui #mobile-shortcut-picker-panel{
 width:min(360px,calc(100% - 24px));height:min(284px,calc(100% - 24px));max-height:none;
 padding:0;border:0;border-radius:0;background:transparent;box-shadow:0 3px 10px #0005;
 font:12px/17px Tahoma,Arial,sans-serif;color:#171717;overflow:visible;
}
body[data-hud=mobile] #mobile-ui #mobile-shortcut-picker-panel::before{content:none}
body[data-hud=mobile] #mobile-ui #mobile-shortcut-picker-panel>header{
 position:relative;width:calc(100% - 2px);margin-inline:1px;height:17px;min-height:17px;flex-shrink:0;box-sizing:border-box;border:0;padding:0 26px 0 17px;
 background-image:url('./mobile-assets/shortcut-titlebar_left.png'),url('./mobile-assets/shortcut-titlebar_right.png'),url('./mobile-assets/shortcut-titlebar_mid.png');
 background-position:left top,right top,center top;background-size:12px 100%,12px 100%,calc(100% - 24px) 100%;background-repeat:no-repeat;
}
#mobile-shortcut-picker-title{font-weight:normal;font-size:12px;line-height:17px}
body[data-hud=mobile] #mobile-ui #mobile-shortcut-picker-panel>header::before{content:'';position:absolute;left:3px;top:3px;width:11px;height:11px;background:url('./mobile-assets/shortcut-sys_base_off.png') center/11px 11px no-repeat;pointer-events:none}
#mobile-ui #mobile-shortcut-picker-close{position:absolute;right:0;top:0;width:24px;height:17px;min-height:17px;padding:0;border:0;border-radius:0;box-shadow:none;background:transparent}
#mobile-shortcut-picker-close::before{content:'';position:absolute;right:3px;top:3px;width:11px;height:11px;background:url('./mobile-assets/shortcut-sys_close_off.png') center/11px 11px no-repeat}
#mobile-shortcut-picker-close:hover::before,#mobile-shortcut-picker-close:active::before{background-image:url('./mobile-assets/shortcut-sys_close_on.png')}
#mobile-ui #mobile-shortcut-picker-close:active{background:transparent}
#mobile-ui #mobile-shortcut-picker-close:focus-visible{outline:none}
#mobile-shortcut-picker-close:focus-visible::before{outline:none}
#mobile-ui #mobile-shortcut-picker button:focus-visible{outline:none}
#mobile-shortcut-picker-body{position:relative;isolation:isolate;display:flex;flex-direction:column;gap:4px;padding:6px;flex:1;min-height:0}
#mobile-shortcut-picker-body::before{content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;border:14px solid transparent;border-image:url('./mobile-assets/shortcut-body-frame.png') 14 fill stretch}
#mobile-shortcut-banks{display:flex;align-items:center;gap:4px;flex-shrink:0;min-height:20px;font-size:11px;padding-inline:2px}
#mobile-shortcut-destination-label{margin-left:auto;white-space:nowrap;color:#294769}
#mobile-ui #mobile-shortcut-picker .shortcut-native-button{
 min-height:20px;height:20px;box-sizing:border-box;border:0;border-radius:0;padding:0 9px;box-shadow:none;
 font:12px/20px Tahoma,Arial,sans-serif;color:#191919;touch-action:manipulation;
 background-image:url('./mobile-assets/shortcut-mesbtn_left.png'),url('./mobile-assets/shortcut-mesbtn_right.png'),url('./mobile-assets/shortcut-mesbtn_mid.png');
 background-size:7px 100%,7px 100%,calc(100% - 14px) 100%;background-position:left top,right top,center top;background-repeat:no-repeat;background-color:transparent;
}
#mobile-ui #mobile-shortcut-picker .shortcut-native-button[aria-pressed=true]{color:#17477c;box-shadow:none;background-color:#d4e4fa}
#mobile-ui #mobile-shortcut-picker .shortcut-native-button:active{filter:brightness(.9);transform:translateY(1px)}
#mobile-shortcut-destinations{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:3px;flex-shrink:0;padding:0 2px}
#mobile-ui #mobile-shortcut-picker .shortcut-destination{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;min-width:0;height:38px;min-height:38px;padding:0;border:1px solid #b5bcc6;border-radius:0;background:#f1f1f3;box-shadow:inset 1px 1px #fff;color:#555;font:10px/12px Tahoma}
#mobile-ui #mobile-shortcut-picker .shortcut-destination[aria-pressed=true]{outline:none;background:#dfe9f8;color:#1a4476}
#mobile-shortcut-destinations .shortcut-destination[data-unavailable=true] img{opacity:.4}
#mobile-shortcut-destinations img{width:24px;height:24px;object-fit:contain;image-rendering:pixelated;pointer-events:none}
#mobile-shortcut-destinations button>span:last-child{font:13px/24px Tahoma;max-width:100%;overflow:hidden;white-space:nowrap}
#mobile-shortcut-filters{display:flex;align-items:center;gap:3px;flex-shrink:0;padding:0 2px}
#mobile-shortcut-filters button{min-width:56px}
#mobile-shortcut-choice-count{margin-left:auto;font-size:11px;color:#66717f;padding-right:3px}
#mobile-shortcut-list-well{position:relative;display:flex;min-height:30px;flex:1;margin:0 2px;border:1px solid #9fa5ae;border-color:#9298a0 #e0e1e4 #e0e1e4 #9298a0;background:white;overflow:hidden}
#mobile-shortcut-choices{flex:1;min-width:0;max-height:none!important;overflow-y:auto;border:0;padding:0;scrollbar-width:none;touch-action:pan-y;overscroll-behavior:contain}
#mobile-shortcut-choices::-webkit-scrollbar{display:none}
#mobile-shortcut-choices .shortcut-choice{position:relative;display:flex;align-items:center;gap:4px;border-bottom:1px solid #eee}
#mobile-shortcut-choices .shortcut-choice[hidden]{display:none}
#mobile-ui #mobile-shortcut-choices button{flex:1;min-width:0;gap:6px;min-height:32px;padding:3px 5px;border:0;box-sizing:border-box;line-height:17px;color:#141414;background:white;overflow-wrap:anywhere}
#mobile-ui #mobile-shortcut-choices .shortcut-choice[data-level-selectable=true]>button{min-height:44px;align-items:flex-start}
#mobile-shortcut-choices .shortcut-choice[data-level-selectable=true]>button>img{margin-top:7px}
#mobile-shortcut-choices .shortcut-skill-level{position:absolute;left:35px;bottom:1px;display:flex;align-items:center;gap:2px;height:24px;color:#505050;font:11px/14px Tahoma}
#mobile-shortcut-choices .shortcut-skill-level[hidden]{display:none}
#mobile-shortcut-choices .shortcut-level-text{min-width:65px;white-space:nowrap;text-align:center;pointer-events:none}
#mobile-ui #mobile-shortcut-choices .shortcut-skill-level button{flex:0 0 24px;width:24px;height:24px;min-height:24px;padding:0;border:0;border-radius:0;box-shadow:none;background:transparent center/11px 11px no-repeat;touch-action:manipulation}
#mobile-ui #mobile-shortcut-choices .shortcut-skill-level .shortcut-level-down{background-image:url('./mobile-assets/shortcut-arw_left.png')}
#mobile-ui #mobile-shortcut-choices .shortcut-skill-level .shortcut-level-up{background-image:url('./mobile-assets/shortcut-arw_right.png')}
#mobile-ui #mobile-shortcut-choices .shortcut-skill-level button:disabled{opacity:.35}
#mobile-ui #mobile-shortcut-choices .shortcut-skill-level button:active{filter:brightness(.8);transform:translateY(1px)}
#mobile-ui #mobile-shortcut-choices button:active,#mobile-ui #mobile-shortcut-choices button:focus-visible{background:#d7e2f4}
#mobile-ui #mobile-shortcut-choices .shortcut-skill-level button:active,#mobile-ui #mobile-shortcut-choices .shortcut-skill-level button:focus-visible{background-color:transparent}
#mobile-shortcut-choices img{width:24px;height:24px;flex:0 0 24px;object-fit:contain;image-rendering:pixelated}
#mobile-shortcut-empty{position:absolute;left:10px;right:20px;top:10px;margin:0!important;color:#666;font-size:11px!important;pointer-events:none}
#mobile-shortcut-scroll{display:flex;flex-direction:column;width:13px;flex:0 0 13px;align-items:center;margin-left:2px;margin-right:1px;background:transparent;box-sizing:border-box}
#mobile-ui #mobile-shortcut-scroll button{position:relative;flex:0 0 13px;width:13px;min-height:13px;height:13px;padding:0;border:0;border-radius:0;box-shadow:none;background-color:transparent;background-position:center;background-size:13px 13px;background-repeat:no-repeat;touch-action:manipulation}
#mobile-shortcut-scroll button::after{content:'';position:absolute;inset:0 -4px}
#mobile-shortcut-scroll-up{background-image:url('./mobile-assets/shortcut-scroll0up.png')!important}
#mobile-shortcut-scroll-down{background-image:url('./mobile-assets/shortcut-scroll0down.png')!important}
#mobile-shortcut-scroll-track{position:relative;flex:1;width:13px;min-height:0;touch-action:none;background:linear-gradient(90deg,#d9d9d9,#eee 2px,#eee 11px,#d9d9d9)}
#mobile-shortcut-scroll-thumb{position:absolute;left:0;width:13px;min-height:18px;touch-action:none;
 background-image:url('./mobile-assets/shortcut-scroll0bar_up.png'),url('./mobile-assets/shortcut-scroll0bar_down.png'),url('./mobile-assets/shortcut-scroll0bar_mid.png');
 background-size:13px 4px,13px 4px,13px calc(100% - 8px);background-position:center top,center bottom,center center;background-repeat:no-repeat;
}
#mobile-shortcut-scroll-thumb::after{content:'';position:absolute;inset:0 -5px}
#mobile-shortcut-picker-body>footer{display:flex;align-items:center;gap:5px;padding:0 2px;flex-shrink:0;min-height:24px;border:0;font-size:11px;color:#555}
#mobile-shortcut-picker-hint{flex:1;min-width:0}
#mobile-ui #mobile-shortcut-picker #mobile-shortcut-done{width:42px;min-width:42px;padding:0}
/* Two-row native button frame beside Basic Info, matching MENU02 and utilities. */
body[data-mobile-presentation=desktop-controls] #mobile-extra-menu{position:absolute;left:var(--mobile-extra-left);top:var(--mobile-extra-top);width:var(--mobile-extra-width,161px);padding:3px;box-sizing:border-box;background:#dce8f01c;border:1px solid #e8f2ff66;border-radius:2px;box-shadow:none;pointer-events:auto;z-index:2}
#mobile-extra-options{display:grid;grid-template-columns:repeat(var(--mobile-extra-columns,4),36px);grid-auto-rows:20px;gap:3px;align-items:start}
#mobile-extra-menu[hidden],#mobile-extra-options button[hidden]{display:none!important}

/* Mobile Settings: medium scales the whole thumb cluster, with its original
   bottom/right anchor and native pointer/drop-target geometry. Large is today’s
   layout. Tone affects surfaces only; never fade icon artwork or text. */
body[data-mobile-presentation=desktop-controls] #mobile-ui[data-combat-size=medium] #mobile-combat{
 transform:scale(calc(var(--combat-scale)*.85));
}
body[data-mobile-presentation=desktop-controls] #mobile-ui[data-combat-size=medium] #mobile-stick{transform:scale(.935)}
body[data-mobile-presentation=desktop-controls] #mobile-ui[data-combat-size=medium] #mobile-sit{transform:scale(.765);left:calc(29px + var(--stick-size)*.935 + env(safe-area-inset-left))}
#mobile-stick{touch-action:none}
#mobile-ui[data-hud-tone=light]{--hud-surface:220 232 240;--hud-fill:.05;--hud-border:.24;--hud-attack:.07;--hud-knob:.18}
#mobile-ui[data-hud-tone=dark]{--hud-surface:18 27 40;--hud-fill:.55;--hud-border:.8;--hud-attack:.62;--hud-knob:.68}
body[data-mobile-presentation=desktop-controls] #mobile-ui:is([data-hud-tone=light],[data-hud-tone=dark]) :is(#mobile-menu-group,#mobile-extra-menu,#mobile-utilities,#mobile-npcs,#mobile-stick,#mobile-sit),
body[data-mobile-presentation=desktop-controls] #mobile-ui:is([data-hud-tone=light],[data-hud-tone=dark]) #mobile-combat :is(.mobile-slot,#mobile-actions button){
 background:rgb(var(--hud-surface) / var(--hud-fill));border-color:rgb(240 247 255 / var(--hud-border));
}
body[data-mobile-presentation=desktop-controls] #mobile-ui:is([data-hud-tone=light],[data-hud-tone=dark]) #mobile-stick-knob{
 background:rgb(var(--hud-surface) / var(--hud-knob));border-color:rgb(240 247 255 / var(--hud-border));
}
body[data-mobile-presentation=desktop-controls] #mobile-ui:is([data-hud-tone=light],[data-hud-tone=dark]) #mobile-combat :is(#mobile-attack,#mobile-cancel-attack){
 background:rgb(var(--hud-surface) / var(--hud-attack))!important;border-color:rgb(240 247 255 / var(--hud-border))!important;
}
body[data-mobile-presentation=desktop-controls] #mobile-ui:is([data-hud-tone=light],[data-hud-tone=dark]) #mobile-shortcut-pages button[aria-pressed=true]{
 background:rgb(var(--hud-surface) / var(--hud-knob));
}
body[data-mobile-presentation=desktop-controls] #mobile-ui:is([data-hud-tone=light],[data-hud-tone=dark]) #mobile-npcs>header{
 border-color:rgb(240 247 255 / var(--hud-border));
}
#mobile-extra-menu button:active{filter:brightness(.88)}
@media(hover:hover){#mobile-extra-menu button:hover{filter:brightness(1.08)}}

/* Chat editing lifts only the existing native-art input strip. Preserve the
   history/tab layout behind the keyboard, without painting its black panel. */
#mobile-chat-input-home{height:24px;pointer-events:none}
#mobile-chat-editor-layer{position:fixed;inset:0;z-index:30;pointer-events:none;font:11px/13px Tahoma,Arial,sans-serif;color:white}
#mobile-chat-editor-layer #mobile-chat-form{position:absolute;pointer-events:auto}
#mobile-chat-form{grid-template-columns:16% 14px minmax(0,1fr) 18px 20px}
#mobile-chat-recipient-menu{position:absolute;z-index:2;pointer-events:auto;box-sizing:border-box;overflow-x:hidden;overflow-y:auto;padding:0;background:#fff;border:0;box-shadow:none;color:#000;scrollbar-width:thin;scrollbar-color:#aaa #fff;font:11px/16px Tahoma,Arial,sans-serif}
#mobile-chat-recipient-menu button{position:relative;isolation:isolate;display:block;width:100%;height:16px;min-height:16px;min-width:0;border:0;border-radius:0;background:transparent;box-shadow:none;color:#000;text-align:left;font:11px/16px Tahoma,Arial,sans-serif;padding:0 3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;touch-action:manipulation;cursor:default}
#mobile-chat-recipient-menu button::before{content:"";position:absolute;inset:1px 3px;z-index:-1;background:#739cef;opacity:0;pointer-events:none}
#mobile-chat-recipient-menu button:hover,#mobile-chat-recipient-menu button:focus-visible{background:transparent;outline:none}
#mobile-chat-recipient-menu button:hover::before,#mobile-chat-recipient-menu button:focus-visible::before{opacity:1}
#mobile-chat-recipient-menu .mobile-whisper-empty{height:16px}
#mobile-chat-divider{position:relative;cursor:default}
#mobile-chat-divider img{position:absolute;inset:0;margin:auto;width:8px;height:18px;image-rendering:pixelated;pointer-events:none}
#mobile-chat-list-hover,#mobile-chat-list-down{display:none}
#mobile-chat-divider:hover #mobile-chat-list-hover:not([hidden]),#mobile-chat-divider:active #mobile-chat-list-down:not([hidden]){display:block}
#mobile-chat-list-normal:not([hidden])~svg{display:none}
#mobile-chat[data-input-docked=true]{pointer-events:none}
#mobile-chat[data-input-docked=true] :is(#mobile-chat-tabs,#mobile-chat-history,#mobile-emotion-shortcuts){visibility:hidden;pointer-events:none}
#mobile-chat[data-input-docked=true] #mobile-chat-form{z-index:1}
#mobile-ground-line {position:fixed;height:2px;background:#fff8b8;border:1px solid #fff9;box-shadow:0 0 4px #000b;transform-origin:0 50%;pointer-events:none;z-index:60;display:none;}
#mobile-ground-line[data-valid="false"] {background:#ff9b9b;}
#mobile-ground-target {position:fixed;display:none;width:32px;height:32px;transform:translate(-50%,calc(-100% - 12px));pointer-events:none;z-index:61;}
#mobile-ground-target[data-valid="false"] {opacity:.5;filter:grayscale(1);}
#mobile-ground-icon,#mobile-ground-name {position:absolute;inset:0;width:32px;height:32px;filter:drop-shadow(0 1px 2px #000c);}
#mobile-ground-icon {object-fit:contain;image-rendering:pixelated;}
#mobile-ground-name {font:10px/32px Tahoma;text-align:center;color:#fff;text-shadow:0 1px #000;background:#283e5580;border-radius:4px;overflow:hidden;}
#mobile-ground-icon:not([hidden]) + #mobile-ground-name {display:none;}
