/* 2924: 追怪設定三分頁、圖片選取、道具魔法彈窗、補給圖格 — rules taken from Codex's reviewed preview
   (work/ui-cumulative-20261011/root-review-1851/final/preview-shell.css) with the preview stage (#stage.skin-stone)
   mapped to the game stage (.game). Area-magic preview rules are not taken (no game feature yet). */
.hunt-magic{padding:12px;border:1px solid #d2b65f;background:#4e422436;border-radius:5px}
.hunt-magic select{min-width:220px;max-width:100%}
.hunt-magic-mp input{width:70px}
.hunt-settings-tabs{display:grid;grid-template-columns:1fr 1fr;gap:7px;position:sticky;top:0;background:#171814;padding:3px 0 8px;z-index:2}
.hunt-settings-tabs button{min-height:36px}
.hunt-settings-tabs [aria-selected=true]{border-color:#dfc47d;background:#443923;color:#fff0bf}
.hunt-settings-panel{display:flex;flex-direction:column;gap:12px}
.hunt-settings-panel>label{display:flex;align-items:center;gap:9px}
.hunt-settings-panel .hunt-teleport-idle{flex-direction:column;align-items:stretch}
.hunt-magic-order{margin:0;padding:8px 0;color:#c9cfcb;font-size:12px;line-height:1.6}
#hunt-magic-panel{gap:9px}
#hunt-magic-panel .hunt-magic{padding:9px 12px}
#hunt-general-panel>p{margin:0 0 6px;font-size:13px;line-height:1.5}
#hunt-magic-panel .hunt-magic-order{padding:0}
.hunt-settings-tabs{position:static}
.game .hunt-settings-tabs{grid-template-columns:repeat(3,minmax(0,1fr));flex:0 0 auto;background:transparent;padding:0;position:static}
.game .hunt-settings-panel{flex:1 1 auto;min-height:0;overflow:auto;padding:2px 3px;scrollbar-width:thin;scrollbar-color:#87949c transparent}
.game .hunt-settings-panel>*{flex-shrink:0}
.game #dialogbody .hunt-settings-tabs [aria-selected=true]{outline:1px solid #c9b480;outline-offset:-3px;color:#fff0bd!important}
.game .hunt-magic{border:1px solid #657279;border-radius:0;background:#141c218a}
.game .hunt-magic-order{color:#b9c1c5;font-size:12px}
.hunt-general-toggles{display:flex;align-items:flex-start;gap:18px;flex-wrap:wrap}
.game #dialogbody .hunt-general-toggles>label{flex:1 1 240px;min-width:0;gap:8px;font-size:15px}
.game .hunt-settings-panel{overflow-x:hidden}
.game #dialogbody .assist-choice-icon,.game #dialogbody .spell-image-choices button{box-sizing:border-box;min-width:52px;min-height:52px;padding:6px;display:inline-flex;align-items:center;justify-content:center;gap:0}
.game .assist-choice-icon img,.game .spell-image-choices img{width:32px;height:32px;object-fit:contain;image-rendering:pixelated;pointer-events:none}
.spell-image-choices{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.game #dialogbody :is(.assist-choice-icon.selected,.spell-image-choices .selected){outline:2px solid #e5ce94;outline-offset:-3px;box-shadow:inset 0 0 10px #e5ce9433!important}
.hunt-magic:has(.spell-image-choices){align-items:center!important;flex-direction:row!important}
.spell-image-choices{flex:1}
.game .helper-popup-overlay{position:absolute;inset:0;z-index:20;background:#050809bd;display:flex;align-items:center;justify-content:center;padding:14px;box-sizing:border-box}
.game .helper-popup{box-sizing:border-box;display:flex;flex-direction:column;width:min(560px,100%);max-height:100%;min-height:0;padding:12px;border:2px solid #8e999d;border-radius:4px;background:#141b20 var(--raster-window,none) center/100% 100%;box-shadow:0 9px 35px #000c;color:#e0e3df;font-size:16px}
.game .helper-popup-header{flex:0 0 auto;font-size:18px;font-weight:bold;letter-spacing:1px;padding:3px 6px 10px;border-bottom:1px solid #798488}
.game .helper-popup-content{flex:1 1 auto;min-height:0;overflow:auto;padding:6px;scrollbar-width:thin;scrollbar-color:#87949c transparent}
.game .helper-popup .helper-slot-fields{display:block;padding:0;border:0}
.game .helper-popup .helper-slot-title{margin:5px 0 12px;color:#e9d6a6}
.game .helper-popup .helper-choice-grid{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}
.game .helper-popup :is(button,input,select){font:inherit;color:inherit}
.game .helper-popup button{min-height:40px;border:1px solid #7e888c;background:#242b30 var(--raster-button,none) center/100% 100%;padding:6px 12px;cursor:pointer}
.game .helper-popup button:disabled{opacity:.45;cursor:default}
.game .helper-popup :is(button,input,select,summary):focus-visible{outline:2px solid #e5ce94;outline-offset:2px}
.game .helper-popup .selected{outline:2px solid #e5ce94;outline-offset:-3px;color:#fff0bd}
.game .helper-popup .helper-picture-choice{width:58px;height:54px;padding:6px;display:flex;align-items:center;justify-content:center}
.game .helper-popup img{width:32px;height:32px;object-fit:contain;image-rendering:pixelated;pointer-events:none}
.game .helper-picture-choice .helper-picture-caption{display:none}
/* Focused picture names use the existing popup header area, outside the scrolling content.
   Absolute captions do not resize the 18 slots or picture buttons; pointer/touch and title hover stay unchanged. */
.game .helper-popup:has(.helper-picture-choice:focus-visible){position:relative}
.game .helper-popup:has(.helper-picture-choice:focus-visible) :is(.helper-popup-content,.helper-slot-fields,.helper-choice-grid,.helper-picture-choice){position:static}
.game .helper-popup:has(.helper-picture-choice:focus-visible) .helper-popup-header{visibility:hidden}
.game .helper-popup .helper-picture-choice:focus-visible>.helper-picture-caption{display:block;position:absolute;left:12px;right:12px;top:12px;z-index:2;box-sizing:border-box;padding:3px 6px 10px;margin:0;background:#141b20;color:#fff0bd;font-size:16px;font-weight:normal;line-height:20px;white-space:normal;overflow-wrap:anywhere;text-align:left;pointer-events:none}
.game .helper-popup .assist-row{display:flex;gap:12px;align-items:center;margin:8px 0}
.game .helper-popup .assist-row-label{min-width:42px;color:#bfc8cc}
.game .helper-popup .assist-chips{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.game .helper-popup input{width:68px;box-sizing:border-box;background:#0b1116;border:1px solid #6a797e;padding:4px}
.game .helper-popup .helper-advanced{margin-top:12px;border-top:1px solid #57656b;padding-top:8px}
.game .helper-popup .helper-advanced summary{cursor:pointer;padding:4px 0}
.game .helper-popup .helper-message{font-size:13px;color:#e5cf95;min-height:18px;margin:8px 0 2px}
.game .helper-popup-footer{flex:0 0 auto;display:grid;grid-template-columns:1fr 1fr;gap:10px;padding-top:10px;border-top:1px solid #798488}
.game .helper-popup .helper-popup-save{border-color:#d4bb85;color:#ffedb8}
.game .assist-tabs-form[data-active-tab=restock]>.assist-footer,.game .assist-tabs-form[data-active-tab=restock]>.assist-status{display:none}
.restock-preview-intro{margin:0 0 10px;font-size:14px}
.restock-preview-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:8px}
.restock-preview-head label{display:flex;gap:8px;align-items:center}
.restock-preview-head input{width:125px}
.restock-preview-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:7px 0;border-bottom:1px solid #4b555a}
.restock-preview-row>label{display:flex;align-items:center;gap:6px;min-width:160px}
.restock-preview-limits{display:flex;align-items:center;gap:7px}
.restock-preview-limits input{width:64px!important;min-width:0}
.restock-preview-row.unavailable{opacity:.55}
.restock-preview-row small{max-width:360px;font-size:12px}
.restock-preview-status{font-size:13px;color:#daca9d}
.restock-preview-footer{position:sticky;bottom:0;background:#182026;padding:8px 0;display:flex;justify-content:flex-end}
.restock-preview-footer button{min-width:170px}
.game #dialog:has(.assist-tabs-form) #dialogbody{overflow:hidden!important;padding:10px 12px!important}
.game .assist-tabs-form{display:flex!important;flex-direction:column!important;height:100%;min-height:0;overflow:hidden;gap:8px}
.game .assist-tabs-form[data-active-tab=restock]>.assist-footer,.game .assist-tabs-form[data-active-tab=restock]>.assist-status{display:none!important}
.game .assist-tabs-form[data-active-tab=restock] .assist-body{overflow:hidden}
.game .restock-preview-panel:not([hidden]){display:flex!important;flex-direction:column;height:100%;min-height:0;gap:4px}
.game .restock-preview-panel>:not(.restock-preview-list){flex:0 0 auto}
.game .restock-preview-list{flex:1 1 auto;min-height:0;overflow:auto;scrollbar-width:thin}
.game .restock-preview-intro{margin:0;font-size:13px}
.game .restock-preview-head{margin:0}
.game .restock-preview-panel .assist-hint{margin:2px 0;font-size:12px}
.game .restock-preview-status{margin:0;font-size:12px}
.game .restock-preview-footer{position:static;padding:4px 0 0;background:transparent}
.game .restock-preview-row>label{flex:1 1 auto;min-width:0}
.game .restock-preview-limits{flex:0 0 auto;white-space:nowrap}
.game .restock-preview-row input[type=number]{width:70px!important;padding:3px!important}
.game .restock-icon-panel:not([hidden]){gap:8px}
.game .restock-icon-panel>.restock-item-grid{flex:1 1 auto;min-height:0;overflow:auto;display:flex;align-content:flex-start;align-items:flex-start;gap:8px;flex-wrap:wrap;padding:4px}
.game #dialogbody .restock-item-tile{position:relative;width:64px;min-width:64px;height:58px;min-height:58px;box-sizing:border-box;padding:8px;display:flex;align-items:center;justify-content:center}
.game .restock-item-tile img{width:32px;height:32px;image-rendering:pixelated;object-fit:contain;pointer-events:none}
.game #dialogbody .restock-item-tile.selected{outline:2px solid #d9c392;outline-offset:-3px}
.game .restock-check{position:absolute;right:3px;top:2px;font-size:18px;font-weight:bold;color:#17201c;background:#e7ce8b;border-radius:2px;line-height:19px;width:19px;text-align:center}
.game .restock-check[hidden]{display:none!important}
.game .restock-item-tile:disabled{opacity:.3;filter:grayscale(1)}
.game .restock-item-popup .helper-popup-content{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:14px 8px}
.game .restock-item-popup .restock-buy-toggle{display:flex;align-items:center;gap:8px;flex:1 1 calc(100% - 80px)}
.game .restock-item-popup input[type=checkbox]{width:22px;height:22px;accent-color:#d9c392}
.game .restock-item-popup .restock-quantity{display:flex;align-items:center;gap:8px;flex:1 1 45%}
.game .restock-item-popup .assist-hint,.game .restock-item-popup .helper-message{flex:1 1 100%;margin:0}
.game .restock-icon-panel:not([hidden]){gap:5px}
.game .restock-icon-panel .restock-preview-intro{font-size:13px!important;line-height:18px!important;margin:0!important}
.game .restock-icon-panel .restock-preview-head{height:34px;min-height:34px;flex-wrap:nowrap}
.game #dialogbody .restock-preview-head :is(button,input){height:32px!important;min-height:32px!important;padding:3px 8px!important;box-sizing:border-box}
.game .restock-icon-panel .restock-preview-status{line-height:18px!important;font-size:12px!important;margin:0!important}
.game #dialogbody .restock-preview-footer button{height:34px!important;min-height:34px!important;padding:3px 10px!important}
.game #dialogbody .restock-item-tile{width:58px;min-width:58px;height:50px;min-height:50px;padding:6px}
/* hidden pages / parts stay hidden even where the rules above set display (the preview shell had a global [hidden] rule). */
.hunt-settings-panel[hidden],.hunt-magic[hidden],.hunt-magic-mp[hidden],.helper-slot-fields[hidden],.restock-check[hidden],.restock-preview-panel[hidden],.assist-panel[hidden],.spell-image-choices[hidden],.hunt-settings-panel>[hidden]{display:none!important}
/* 2926 常用練功地點（3 組）and 範圍魔法 — preview-shell.css route-slot rules mapped to the game stage. */
#hunt-route-panel>p{margin:0 0 6px;font-size:13px;line-height:1.5}
.hunt-route-slots{display:flex;flex-direction:column;gap:8px;padding-top:10px;border-top:1px solid #637078}
.hunt-route-slots[hidden]{display:none!important}
.hunt-route-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.game #dialogbody .hunt-route-choices button{min-width:0;padding:5px;overflow-wrap:anywhere;font-size:14px}
.game #dialogbody .hunt-route-choices [aria-checked=true]{outline:1px solid #d7c297;outline-offset:-3px;color:#fff0bd!important}
.hunt-route-slots label{display:flex;align-items:center;gap:8px}
.hunt-route-slots label input{flex:1;min-width:0}
.hunt-route-slots small{color:#aebbc1}
.hunt-route-meta{color:#d8c79e;margin:0}
.hunt-magic-area[hidden]{display:none!important}
/* 2947 (REQUEST_20261011_HUNT_SETTINGS_CURRENT「hover/focus 顯示名稱」): the pictured 補血／魔法／補給 choices already name
   themselves on hover (title); keyboard focus now shows the same name (their aria-label) under the picture. Text-only
   fallbacks (picture failed to load) already show the name and get no tip. Display only: no value or handler changes. */
.game #dialogbody :is(.assist-choice-icon,.spell-image-choices button,.restock-item-tile):has(>img){position:relative;overflow:visible}
.game #dialogbody :is(.assist-choice-icon,.spell-image-choices button,.restock-item-tile):has(>img):focus-visible::after{content:attr(aria-label);position:absolute;left:0;top:calc(100% + 3px);z-index:30;width:max-content;max-width:220px;padding:2px 6px;border:1px solid #8b989f;background:#0d1317f2;color:#f0e6c8;font-size:12px;font-weight:normal;line-height:16px;white-space:normal;text-align:left;pointer-events:none}

/* User-requested compact HP range and non-overlapping settings footer. */
#dialog:has(.assist-tabs-form) #dialogbody{display:flex!important;flex-direction:column;min-height:0;box-sizing:border-box}
#dialogbody .assist-tabs-form{flex:1 1 auto;min-height:0;max-height:100%;box-sizing:border-box;gap:5px}
#dialogbody .assist-tabs-form>.assist-body{flex:1 1 0;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;padding-bottom:6px}
#dialogbody .assist-tabs-form>:is(.assist-tabbar,.assist-status,.assist-footer){flex:0 0 auto;position:static!important;inset:auto!important}
#dialogbody .assist-tabs-form>.assist-status{font-size:11px;line-height:15px;margin:0}
#dialogbody .assist-tabs-form>.assist-footer{display:flex;gap:8px;padding:4px 0 0;margin:0}
#dialogbody .assist-footer>button{flex:1;min-width:0;min-height:34px!important;padding:4px 8px!important}
:is(#dialogbody,.game .helper-popup) .assist-percent-row{display:flex;align-items:center;gap:8px;margin:3px 0;min-width:0}
:is(#dialogbody,.game .helper-popup) .assist-percent-control{display:flex;align-items:center;flex:1;min-width:0;gap:10px;flex-wrap:nowrap}
:is(#dialogbody,.game .helper-popup) input.assist-percent-slider{appearance:auto!important;flex:1;min-width:0!important;width:100%!important;height:30px!important;min-height:30px!important;padding:0!important;margin:0;accent-color:#d9c392;touch-action:none;background:transparent!important;border:0!important;box-shadow:none!important}
:is(#dialogbody,.game .helper-popup) .assist-percent-value{flex:0 0 48px;text-align:right;font-variant-numeric:tabular-nums;color:#f0dfab;font-weight:bold}
/* 3035／3037 (十四項 8; Codex v286): PC stage 640×480 — the open 輔助設定 dialog gets its own height so the settings body is not 6 px tall; a closed dialog is untouched. */
.game.pc-layout:not(.android-layout) #dialog[open]:has(.assist-tabs-form){height:456px;display:flex!important;flex-direction:column}
.game.pc-layout:not(.android-layout) #dialog[open]:has(.assist-tabs-form)>#dialogbody{flex:1 1 auto!important;min-height:0!important}

/* Percentage controls share the healing slider, including the slot popup. */
:is(#dialogbody,.game .helper-popup) .assist-percent-row>.assist-row-label{flex:0 0 auto;white-space:nowrap}
.game .helper-popup .assist-percent-row{margin:8px 0}

/* Core timing: native minimum is shown separately from a longer optional interval. */
.game .hunt-magic-every{display:flex;flex-direction:column;gap:7px}
.game .hunt-magic-every>label{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.game .hunt-magic-every input[type=checkbox]{width:auto}
.game .hunt-magic-every small{color:inherit;opacity:.85;line-height:1.5}
