/* Phone skin for the shared <dialog id="dialog"> and the other small PC
   surfaces in the Android layout (.game.pc-layout.android-layout).
   Every #dialog use (modal(), shops, party/clan/social, board, letter, map
   paper, NPC/option pages, quick-slot and automation settings) becomes ONE
   large centred black-gold window, the same 680x406 stage-unit box as the
   mobile-ui.js kit (MOBILE_WINDOW left 60, top 22): 48px header with the title
   and a 48px close key, a touch-scrolled body with 16px text and >=48px
   controls. The Android lobby (.android-lobby-dialog) and the PC
   login/create/roster planes are excluded. Load AFTER android-layout.css and
   mobile-ui.css. Colours: MobileBlackGoldSkin400 (see mobile-ui.css). */

/* ---------- 1. Window geometry -------------------------------------------
   A modal dialog lives in the top layer and is positioned against the
   viewport, so it uses the --pc-stage-* vars that pc-stage.js writes on
   .game (inherited through the DOM). A show() dialog is not in the top layer:
   the transformed .game stage is its containing block, so it is placed in
   plain stage pixels. */
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog){
  box-sizing:border-box;width:680px!important;height:406px!important;max-width:none!important;max-height:none!important;min-width:0;min-height:0;
  right:auto!important;bottom:auto!important;margin:0!important;padding:0!important;border:0!important;border-radius:6px!important;overflow:hidden!important;
  background:rgba(23,21,18,.97)!important;background-image:none!important;
  box-shadow:inset 0 0 0 2px #735938,inset 0 0 0 4px rgba(0,0,0,.6),inset 0 0 0 5px #b18d53,0 8px 28px rgba(0,0,0,.6)!important;
  color:#eee8dc;font:16px/1.5 "Microsoft JhengHei","PingFang TC",sans-serif;image-rendering:auto;touch-action:manipulation}
.game.pc-layout.android-layout #dialog[open]:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog){display:flex!important;flex-direction:column}
.game.pc-layout.android-layout #dialog:modal:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog){
  position:fixed!important;left:calc(var(--pc-stage-left,0px) + 60px * var(--pc-stage-scale,1))!important;top:calc(var(--pc-stage-top,0px) + 22px * var(--pc-stage-scale,1))!important;
  transform:scale(var(--pc-stage-scale,1))!important;transform-origin:0 0!important}
.game.pc-layout.android-layout #dialog:not(:modal):not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog){
  position:absolute!important;left:60px!important;top:22px!important;transform:none!important;transform-origin:0 0!important;z-index:55!important}
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog)::backdrop{background:rgba(0,0,0,.45)}
/* Sprite footers painted by pseudo elements (NPC 600.png strip). */
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog)::after{display:none!important}

/* ---------- 2. Header: title + 48px close -------------------------------- */
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog) .dialoghead{
  display:flex!important;flex:0 0 48px;height:48px;align-items:center;gap:8px;position:relative;margin:6px 6px 0;padding:0 0 0 18px;border:0;border-radius:3px;background:#302820;text-align:left}
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog) #dialogtitle{
  position:static!important;flex:1;min-width:0;width:auto!important;height:auto!important;clip-path:none!important;overflow:hidden!important;margin:0;padding:0;
  font:600 18px/48px "Microsoft JhengHei","PingFang TC",sans-serif!important;color:#ffe2a2!important;white-space:nowrap;text-overflow:ellipsis;text-align:left}
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog) #close{
  display:block!important;position:static!important;flex:0 0 48px;width:48px!important;height:48px!important;min-width:48px!important;min-height:48px!important;
  margin:0!important;padding:0!important;border:0!important;border-radius:3px!important;clip-path:none!important;overflow:visible!important;
  background:transparent!important;background-image:none!important;box-shadow:none!important;color:#ead5ac!important;font:30px/48px sans-serif!important;text-align:center;cursor:pointer}
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog) #close:active{color:#fff!important;background:#59472c!important}

/* ---------- 3. Body: scrolling column, 16px text ------------------------- */
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog) #dialogbody{
  position:relative!important;inset:auto!important;left:auto!important;top:auto!important;flex:1 1 auto;min-height:0;width:auto!important;height:auto!important;max-width:none!important;max-height:none!important;
  display:flex!important;flex-direction:column;gap:8px;margin:0 6px 6px!important;padding:12px 10px 16px!important;
  overflow-x:hidden!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:thin;scrollbar-color:#8d7248 transparent;
  font:16px/1.5 "Microsoft JhengHei","PingFang TC",sans-serif!important;color:#eee8dc;text-align:left}
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog) #dialogbody :is(p,h3,h4,dl,dd){margin:0;max-width:none;font-family:inherit;line-height:1.5;overflow-wrap:anywhere}
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog) #dialogbody p{font-size:16px}
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog) #dialogbody :is(h3,h4,legend){padding:0;margin:6px 0 0;font:600 16px "Microsoft JhengHei",sans-serif;color:#ffd78a;text-align:left;border:0}

/* Plain buttons and links become big keys. Sprite-positioned controls (inline
   absolute geometry, the PC item list, trade art, board/letter native keys)
   and the mobile-ui.js kit (.mw-*) keep their own look. */
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog) #dialogbody :is(button,a[href],summary):where(:not([class*="mw-"],[style*="absolute"],.pc-trade-action,.pc-board-button,.pc-letter-button,:is(.pc-item-list,.pc-bookmark-list) *)){
  display:inline-flex;align-items:center;justify-content:center;gap:6px;box-sizing:border-box;min-width:48px;min-height:48px;height:auto;width:auto;max-width:100%;margin:0;padding:6px 16px;
  border:1px solid #8d7248;border-radius:6px;background:#302820;background-image:none;box-shadow:none;color:#eee8dc;
  font:16px/1.3 "Microsoft JhengHei","PingFang TC",sans-serif;text-align:center;text-decoration:none;white-space:normal;overflow-wrap:anywhere;cursor:pointer;touch-action:manipulation;opacity:1;vertical-align:middle}
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog) #dialogbody :is(button,a[href],summary):where(:not([class*="mw-"],[style*="absolute"],.pc-trade-action,.pc-board-button,.pc-letter-button,:is(.pc-item-list,.pc-bookmark-list) *)):active:not(:disabled){background:#59472c;color:#fff}
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog) #dialogbody :is(button,a[href],summary):where(:not([class*="mw-"],[style*="absolute"],.pc-trade-action,.pc-board-button,.pc-letter-button,:is(.pc-item-list,.pc-bookmark-list) *)):disabled{opacity:.45;color:#b7ada0;cursor:default}
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog) #dialogbody button[type=submit]:where(:not([class*="mw-"])){background:#6b5226;border-color:#d0a95c;color:#fff4d6}
/* Body children never shrink: the body scrolls instead. */
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog) #dialogbody>*{flex-shrink:0}
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog) #dialogbody summary{display:flex;list-style:none}
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog) #dialogbody details{display:flex;flex-direction:column;gap:8px}
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog) #dialogbody details>button{width:100%;justify-content:flex-start;text-align:left}
/* A long plain menu (quick-slot setup, repair/spell lists): 3 keys per row. */
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog):not([class*="pc-"]) #dialogbody:has(>button:nth-of-type(7)){display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));align-content:start}
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog):not([class*="pc-"]) #dialogbody:has(>button:nth-of-type(7))>:not(button){grid-column:1/-1}

/* Inputs, selects, text areas, check boxes, labels, forms. 16px text also
   stops iOS from zooming the page on focus. */
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog) #dialogbody :is(input,select,textarea):where(:not([type=checkbox],[type=radio],[type=range],[type=hidden],[style*="absolute"])){
  box-sizing:border-box;min-width:0;max-width:100%;min-height:48px;height:auto;margin:0;padding:0 12px;border:1px solid #8d7248;border-radius:6px;background:#000;color:#fff;
  font:16px "Microsoft JhengHei","PingFang TC",sans-serif;box-shadow:none;user-select:text;-webkit-user-select:text}
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog) #dialogbody input[type=number]{width:120px;flex:0 0 auto}
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog) #dialogbody textarea{min-height:140px;padding:10px 12px;line-height:1.5;resize:vertical}
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog) #dialogbody :is(input,select,textarea):focus{outline:2px solid #d0a95c;outline-offset:0}
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog) #dialogbody :is(input[type=checkbox],input[type=radio]){flex:0 0 28px;width:28px;height:28px;margin:0;accent-color:#b18d53}
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog) #dialogbody label{display:flex;align-items:center;flex-wrap:wrap;gap:10px;min-height:48px;font-size:16px;color:#eee8dc}
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog) #dialogbody label:has(>input[type=checkbox],>input[type=radio]){justify-content:flex-start!important;flex-wrap:nowrap;cursor:pointer}
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog) #dialogbody form{display:flex;flex-direction:column;gap:10px;margin:0}
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog) #dialogbody fieldset{display:flex;flex-wrap:wrap;gap:10px;min-width:0;margin:0;padding:10px 12px;border:1px solid #5d4a2f;border-radius:6px}

/* Generic list rows (背包／附近物件／自動刪物 .nearby-row). */
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog) #dialogbody .nearby-row{
  display:flex;align-items:center;flex-wrap:wrap;gap:8px;min-height:56px;padding:4px 4px 4px 12px;border:1px solid #5d4a2f;border-radius:6px;background:#141210}
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog) #dialogbody .nearby-row>span{flex:1 1 200px;min-width:0;overflow-wrap:anywhere}

/* ---------- 4. PC bitmap text inside #dialog → readable 16px text --------
   applyPcGlyphText (npc-rich-body.js) masks each glyph from a bitmap atlas and
   keeps the real text in a clipped .pc-glyph-readable span: show that one. */
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog) :is(.pc-glyph,.pc-glyph-word){display:none!important}
.game.pc-layout.android-layout #dialog:not(.android-lobby-dialog,.pc-login-dialog,.pc-create-dialog,.pc-roster-dialog) .pc-glyph-readable{
  position:static!important;width:auto!important;height:auto!important;overflow:visible!important;clip-path:none!important;white-space:inherit!important}

/* ---------- 5. NPC talk / option (設定) / command pages (.pc-npc-dialog) -- */
.game.pc-layout.android-layout #dialog.pc-npc-dialog .pc-npc-scroll-controls{display:none!important}
.game.pc-layout.android-layout #dialog.pc-npc-dialog .pc-npc-body{font:16px/1.6 "Microsoft JhengHei","PingFang TC",sans-serif!important;color:#eee8dc;min-height:0}
.game.pc-layout.android-layout #dialog.pc-npc-dialog .pc-npc-body p{margin:0 0 8px}
.game.pc-layout.android-layout #dialog.pc-npc-dialog .pc-npc-action-slot{display:flex;margin:8px 0}
.game.pc-layout.android-layout #dialog.pc-npc-dialog #dialogbody .pc-npc-action-slot>button,.game.pc-layout.android-layout #dialog.pc-npc-dialog #dialogbody>button{width:100%;justify-content:flex-start;text-align:left;color:#ffe9a8}
.game.pc-layout.android-layout #dialog.pc-npc-dialog #dialogbody button.pc-npc-image-action img{display:none!important}
.game.pc-layout.android-layout #dialog.pc-npc-dialog #dialogbody button.pc-npc-image-action::after{content:attr(aria-label);font-size:16px;line-height:1.3}
.game.pc-layout.android-layout #dialog.pc-npc-dialog #dialogbody input{flex:1 1 auto}

/* ---------- 6. Party / clan / social (plain DOM in the 562 frame) -------- */
.game.pc-layout.android-layout #dialog :is(.pc-party-root,.pc-clan-root,.pc-social-root){
  position:relative;display:flex!important;flex-direction:column;flex:0 0 auto;gap:10px;height:auto!important;min-height:100%;overflow:visible!important;padding:0;font:16px/1.5 "Microsoft JhengHei",sans-serif!important;color:#eee8dc}
.game.pc-layout.android-layout #dialog :is(.pc-party-root,.pc-clan-root,.pc-social-root) :is(p,span,label){font-size:16px!important;color:#eee8dc}
.game.pc-layout.android-layout #dialog :is(.pc-party-root,.pc-clan-root) h3{text-align:left!important;padding:0!important;font-size:17px!important}
.game.pc-layout.android-layout #dialog :is(.pc-party-root,.pc-clan-root,.pc-social-root)>*{flex-shrink:0}
.game.pc-layout.android-layout #dialog .pc-party-invitations{display:flex;flex-direction:column;gap:8px;overflow:visible}
.game.pc-layout.android-layout #dialog #dialogbody .pc-party-invitations button{width:100%;justify-content:flex-start!important;margin:0!important}
.game.pc-layout.android-layout #dialog .pc-party-commands{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.game.pc-layout.android-layout #dialog .pc-party-commands p{grid-column:1/-1;max-height:none;overflow:visible}
.game.pc-layout.android-layout #dialog :is(.pc-party-root,.pc-social-root) form{display:grid!important;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto;gap:10px;align-items:center}
.game.pc-layout.android-layout #dialog .pc-party-root form label{grid-column:1/-1;min-height:0}
.game.pc-layout.android-layout #dialog .pc-social-root form input{grid-column:1/-1}
.game.pc-layout.android-layout #dialog .pc-social-root form select{width:100%}
.game.pc-layout.android-layout #dialog #dialogbody .pc-social-root form button{min-width:120px}
.game.pc-layout.android-layout #dialog .pc-social-root>p{white-space:normal;overflow:visible}
.game.pc-layout.android-layout #dialog .pc-social-root>button,.game.pc-layout.android-layout #dialog .pc-clan-root>button{align-self:stretch;height:auto}
.game.pc-layout.android-layout #dialog .pc-social-list{display:flex;flex-direction:column;gap:8px;overflow:visible}
.game.pc-layout.android-layout #dialog .pc-social-list h3{border:0;margin:8px 0 0}
.game.pc-layout.android-layout #dialog .pc-social-list>div{display:flex;flex-wrap:wrap;align-items:center;gap:8px;min-height:56px;padding:4px 4px 4px 12px;border:1px solid #5d4a2f;border-radius:6px;background:#141210}
.game.pc-layout.android-layout #dialog .pc-social-list>div span{flex:1 1 200px;min-width:0;white-space:normal}
.game.pc-layout.android-layout #dialog .pc-clan-root>input,.game.pc-layout.android-layout #dialog .pc-clan-title-form input{width:100%;height:auto}
/* Confirmations stay pinned at the bottom of the scrolling body. */
.game.pc-layout.android-layout #dialog :is(.pc-party-confirm,.pc-clan-confirm){position:sticky!important;inset:auto 0 0 0!important;z-index:2;min-height:0;margin-top:auto;padding:12px;border:1px solid #d0a95c;border-radius:6px;background:#1d1812;box-shadow:0 -6px 16px rgba(0,0,0,.6)}
.game.pc-layout.android-layout #dialog .pc-party-confirm[hidden]{display:none!important}
.game.pc-layout.android-layout #dialog :is(.pc-party-confirm,.pc-clan-confirm) div{display:flex;gap:10px;justify-content:stretch}
.game.pc-layout.android-layout #dialog :is(.pc-party-confirm,.pc-clan-confirm) div>button{flex:1}

/* ---------- 7. Polymorph list (plain DOM) ------------------------------- */
.game.pc-layout.android-layout #dialog .pc-poly-shell{display:flex!important;flex-direction:column;gap:10px;height:auto;font:16px "Microsoft JhengHei",sans-serif}
.game.pc-layout.android-layout #dialog .pc-poly-shell h3{text-align:left}
.game.pc-layout.android-layout #dialog .pc-poly-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;overflow:visible}
.game.pc-layout.android-layout #dialog #dialogbody button.pc-poly-row{justify-content:space-between!important;min-height:56px;border-color:#5d4a2f;background:#141210}
.game.pc-layout.android-layout #dialog .pc-poly-row small{font-size:13px;color:#c8b58c}
.game.pc-layout.android-layout #dialog .pc-poly-pager{display:flex;align-items:center;gap:10px;font-size:16px;color:#c8b58c}
.game.pc-layout.android-layout #dialog .pc-poly-pager button{flex:1}

/* ---------- 8. Sprite-only content kept at native size, centred ---------
   Map paper (257x336 canvas), bookmark canvas, PC item list and trade art
   are drawn in source pixels; the frame is the big window, the art sits in
   the middle. Dedicated mobile modules (mobile-item-list/-trade/-bookmark)
   replace these where integrated. */
.game.pc-layout.android-layout #dialog.pc-map-paper-dialog #dialogbody{align-items:center;padding:8px!important;overflow:hidden!important}
.game.pc-layout.android-layout #dialog.pc-map-paper-dialog #dialogbody p{margin:16px;color:#eee8dc;font-size:16px}
.game.pc-layout.android-layout #dialog:has(.pc-item-list) #dialogbody,.game.pc-layout.android-layout #dialog:has(section[aria-label="交易雙方物品"]) #dialogbody{padding:4px 12px!important}
.game.pc-layout.android-layout #dialog:has(.pc-item-list) #dialogbody>p{max-width:none;font:16px "Microsoft JhengHei",sans-serif;margin:0}
/* Merchant frame: the 257x336 list on the left, total and big keys on the right. */
.game.pc-layout.android-layout #dialog.pc-shop-dialog #dialogbody{display:grid!important;grid-template-columns:257px minmax(0,1fr);grid-auto-rows:min-content;column-gap:20px;row-gap:12px;padding:4px 16px 4px 4px!important}
.game.pc-layout.android-layout #dialog.pc-shop-dialog #dialogbody>.pc-item-list-shell{grid-column:1;grid-row:1/span 4;margin:0}
.game.pc-layout.android-layout #dialog.pc-shop-dialog #dialogbody>:not(.pc-item-list-shell){grid-column:2}
.game.pc-layout.android-layout #dialog.pc-shop-dialog :is(.pc-shop-checkout,.pc-shop-cancel){
  position:static!important;display:flex!important;align-items:center;justify-content:center;width:100%!important;height:56px!important;min-height:56px!important;
  border:1px solid #8d7248!important;border-radius:6px!important;background:#302820 none!important;font-size:0!important;color:#eee8dc!important}
.game.pc-layout.android-layout #dialog.pc-shop-dialog .pc-shop-checkout{background-color:#6b5226!important;border-color:#d0a95c!important}
.game.pc-layout.android-layout #dialog.pc-shop-dialog :is(.pc-shop-checkout,.pc-shop-cancel)::after{content:attr(aria-label);font:18px "Microsoft JhengHei",sans-serif;color:#fff4d6}
.game.pc-layout.android-layout #dialog.pc-shop-dialog :is(.pc-shop-checkout,.pc-shop-cancel):disabled{opacity:.45}
.game.pc-layout.android-layout #dialog.pc-shop-dialog .pc-shop-total{position:static!important;width:auto!important;height:auto!important;min-height:48px;display:flex;align-items:center;order:-1;
  padding:0 12px;border:1px solid #5d4a2f;border-radius:6px;background:#0f0d0b;font:18px "Microsoft JhengHei",sans-serif!important;color:#ffe2a2!important;white-space:normal!important}
.game.pc-layout.android-layout #dialog.pc-shop-dialog .pc-shop-total::before{content:'合計：';color:#c8b58c;font-size:16px}

/* ---------- 9. Automation settings (練功／輔助／刪物) and helper editor --- */
.game.pc-layout.android-layout #dialog .assist-settings{display:flex!important;flex-direction:column;gap:12px}
.game.pc-layout.android-layout #dialog .assist-settings label{flex:1 1 220px;justify-content:space-between}
.game.pc-layout.android-layout #dialog .assist-settings select{flex:1 1 160px}
.game.pc-layout.android-layout #dialog #dialogbody .assist-settings>button{width:100%}
.game.pc-layout.android-layout #dialog #dialogbody .helper-slot-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;width:100%}
.game.pc-layout.android-layout #dialog #dialogbody .helper-slot-grid button{flex-direction:column;min-height:76px;padding:4px;background:#141210;border-color:#5d4a2f;font-size:12px!important;line-height:1.25}
.game.pc-layout.android-layout #dialog #dialogbody .helper-slot-grid button img{width:36px;height:36px;image-rendering:pixelated}
.game.pc-layout.android-layout #dialog #dialogbody .helper-slot-grid button[aria-pressed=true]{border-color:#ffd78a;background:#2c2416;box-shadow:0 0 0 1px #ffd78a inset}
.game.pc-layout.android-layout #dialog .helper-slot-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;width:100%}
.game.pc-layout.android-layout #dialog .helper-slot-fields>:is(p,select,button){grid-column:auto}
.game.pc-layout.android-layout #dialog .helper-slot-fields>p{grid-column:1/-1}

/* ---------- 10. Board / letter phone renderers (mobile-board.js, mobile-letter.js) */
.game.pc-layout.android-layout #dialog :is(.mobile-board,.mobile-letter){position:relative;display:flex;flex-direction:column;flex:0 0 auto;gap:12px;width:auto!important;height:auto!important;min-height:100%;overflow:visible;image-rendering:auto;color:#eee8dc}
.game.pc-layout.android-layout #dialog :is(.mobile-board,.mobile-letter)[hidden]{display:flex!important;visibility:hidden}
.mobile-board-view,.mobile-letter-view{flex:1 0 auto;min-height:0;display:flex;flex-direction:column;gap:10px}
.mobile-board-list .mw-row-main.selected{border-color:#ffd78a;background:#2c2416}
.mobile-board-subject{margin:0;font:600 18px "Microsoft JhengHei",sans-serif;color:#ffe2a2;overflow-wrap:anywhere}
.mobile-board-body,.mobile-letter-body{padding:10px 12px;border:1px solid #5d4a2f;border-radius:6px;background:#0f0d0b;min-height:120px}
.mobile-board-field,.mobile-letter-field{display:flex!important;flex-direction:column;align-items:stretch!important;gap:4px!important;min-height:0!important;color:#c8b58c!important;font-size:14px!important}
.mobile-board-field>span,.mobile-letter-field>span{font-size:14px;color:#c8b58c}
.mobile-board-field .mw-input,.mobile-letter-field .mw-input{width:100%}
.mobile-board-textarea{min-height:150px;padding:10px 12px!important;line-height:1.5;resize:vertical}
.mobile-letter-self{display:flex;align-items:center;min-height:48px;padding:0 12px;border:1px dashed #5d4a2f;border-radius:6px;color:#eee8dc;font-size:16px}
.mobile-letter-meta{display:grid;grid-template-columns:auto 1fr;gap:6px 14px;margin:0}
.mobile-letter-meta dt{color:#c8b58c}.mobile-letter-meta dd{margin:0;color:#eee8dc;overflow-wrap:anywhere}
.mobile-board-actions{position:sticky;bottom:-16px;z-index:2;display:flex;gap:10px;margin:0 -10px -16px;padding:10px 10px 12px;border-top:1px solid rgba(177,141,83,.35);background:rgba(23,21,18,.98)}
.mobile-board-actions .mw-button{flex:1}

/* ---------- 11. Restart / system window and 更多 (android-windows.js) ---- */
.android-restart-window{z-index:61}
.android-restart-window[hidden]{display:none}
.android-restart-window .android-restart-status{margin:4px 0;font-size:17px}
.android-restart-window .mw-footer .mw-button{min-height:56px;font-size:18px}
.android-restart-window .mw-button[hidden]{display:none}
.android-restart-key{position:absolute;z-index:62;font-size:20px!important;box-shadow:0 4px 16px rgba(0,0,0,.6)}
.android-restart-key[hidden]{display:none}
.android-more-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));gap:10px;height:100%;min-height:300px}
.android-more-cell{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:92px;font-size:20px}
.android-more-note{font-size:13px;color:#c8b58c}

/* ---------- 12. Chat input bar: 44px field, 34px channel strip ----------
   MobileChatRenderer182 box keeps its top (86) and bottom (220 < the magic
   countdown ring at 242-22): 3 log rows, a 44px input, a 34px tab strip. */
.game.pc-layout.android-layout .pc-hud .world-chat{height:52px}
.game.pc-layout.android-layout .pc-hud #chat-history{max-height:52px}
.game.pc-layout.android-layout .pc-hud #chat-form{top:140px;height:44px;align-items:stretch;gap:2px}
.game.pc-layout.android-layout .pc-hud #chat-form :is(input#chat-text,input#chat-recipient){height:44px;min-height:44px;padding:0 10px;font-size:16px;border-radius:0}
.game.pc-layout.android-layout .pc-hud #chat-form input#chat-recipient:not([hidden]){flex:0 0 70px;width:70px;background:rgba(0,0,0,.5);color:#ffe2a2;border:0}
.game.pc-layout.android-layout .pc-hud .android-chat-tabs{top:186px;height:34px}
.game.pc-layout.android-layout .pc-hud .android-chat-tabs button{height:34px;font-size:13px}
.game.pc-layout.android-layout .pc-hud .android-chat-tabs button.android-chat-collapse{font-size:20px}
.game.pc-layout.android-layout.android-chat-collapsed .pc-hud .android-chat-tabs{top:90px}
