/* Match the source character panel; keep allocation reachable on either layout. */
.desktop-client #window-character .native-stat-add{
 position:absolute;left:281px;width:21px;height:14px;min-height:14px;padding:0;
 border:1px solid #82744d;border-radius:2px;background:linear-gradient(#514832,#29261c);
 color:#eddbaa;font:600 11px/12px var(--font);text-shadow:0 1px #14120d;
}
.desktop-client #window-character .native-stat-add:disabled{opacity:.4;cursor:default}
.desktop-client #window-character .native-stat-points{
 position:absolute;left:154px;top:260px;color:#edcf87;font:600 9px/12px var(--font);
}
.desktop-client #window-character .stat-allocation{display:grid;gap:5px;margin:0 0 10px;padding:6px 0;border-bottom:1px solid #aa8a5866}
.desktop-client #window-character .stat-allocation label{display:flex;justify-content:space-between;align-items:center;gap:12px}
.desktop-client #window-character .stat-allocation button{min-width:40px;min-height:30px}
.desktop-client.touch-client #window-character .stat-allocation button{min-width:64px;min-height:44px;font-size:16px;touch-action:manipulation}
.desktop-client #window-character .native-stat-add{display:none}
.desktop-client #window-character .mobile-stat-entry{
 display:block;position:absolute;left:min(270px,calc(347px - 56px / var(--native-board-scale,1)));top:194px;z-index:3;
 width:calc(56px / var(--native-board-scale,1));height:calc(48px / var(--native-board-scale,1));
 max-width:none;padding:2px;border:1px solid #9b8759;border-radius:4px;
 background:linear-gradient(#514832,#29261c);color:#eddbad;
 font:600 calc(12px / var(--native-board-scale,1))/1.4 var(--font);white-space:normal;touch-action:manipulation;
}
.desktop-client #window-character .native-context-popover{width:min(300px,calc(100vw - 24px));max-height:calc(100dvh - 24px)}
.desktop-client.touch-client #window-character .stat-allocation label{min-height:48px;font-size:16px}
.desktop-client #window-character .stat-allocation small{font-size:11px;line-height:1.5}

/* 分配素質: a wooden plaque like the panel's own boards, not a dark modern button. */
.desktop-client #window-character .mobile-stat-entry{
 border:1px solid #2b1c0f;border-radius:3px;box-shadow:inset 0 1px #c49a62,inset 0 -1px #2b1c0f,0 1px 2px #0008;
 background:linear-gradient(#8a6a42,#5e4228 55%,#4a321d);color:#f6e6bd;text-shadow:0 1px #1d1309,0 0 2px #1d1309;
}
.desktop-client #window-character .mobile-stat-entry:hover{background:linear-gradient(#9a7a4f,#6b4c2f 55%,#523822)}

/* 2026-10-12 重置素質 (1000 金): in the popover title bar, left of the close button; 配置 pill style.
   The header's close-button rules (30x30, icon) are overridden. */
.native-popover-header button.stat-respec{position:static!important;margin:0 8px 0 auto!important;flex:0 0 auto!important;width:auto!important;min-width:0!important;height:24px!important;min-height:0!important;padding:0 10px!important;border:1px solid #2b1c0f!important;border-radius:12px!important;background:linear-gradient(#8a6a42,#4a321d)!important;color:#f6e6bd!important;font:600 12px/22px var(--font)!important;writing-mode:horizontal-tb!important;white-space:nowrap!important;text-indent:0!important;text-shadow:0 1px #1d1309;box-shadow:0 1px 2px #0008!important}
.native-popover-header button.stat-respec::before,.native-popover-header button.stat-respec::after{content:none!important;display:none!important}
.native-popover-header button.stat-respec:disabled{opacity:.45}
/* 2026-10-12 (使用者：分配素質融入背景): drawn into the wooden board — no plaque, the board's dark text,
   a faint carved outline; a light wash on hover. */
body.desktop-client #window-character .mobile-stat-entry{background:transparent!important;border:1px solid #3a2510bb!important;border-radius:3px!important;box-shadow:inset 0 1px #f3dfb055,0 1px #f3dfb033!important;color:#fff!important;text-shadow:0 1px 2px #000,0 0 2px #000!important;font-weight:800!important}
body.desktop-client #window-character .mobile-stat-entry:hover,body.desktop-client #window-character .mobile-stat-entry:focus-visible{background:#fff3d022!important;border-color:#4a321d99!important}
/* 2026-10-22（使用者：分配素質版面又跑掉了）：彈出框限高會把「重設／確認分配」捲到下面看不到。按鈕列固定在框底，觸控版列高縮小。 */
.desktop-client #window-character .native-context-popover .stat-allocation-actions{position:sticky;bottom:-12px;z-index:3;display:flex;justify-content:flex-end;gap:6px;margin:4px -12px -12px;padding:6px 12px 8px;background:linear-gradient(#3a2d20e6,#3a2d20e6),url('/assets/ui/native-detail-wood.png');box-shadow:0 -4px 8px #0007}
.desktop-client #window-character .native-context-popover .stat-allocation-actions .stat-respec{display:none}
.desktop-client.touch-client #window-character .native-context-popover .stat-allocation label{min-height:38px;font-size:15px}
.desktop-client.touch-client #window-character .native-context-popover .stat-allocation button{min-height:36px}
.desktop-client.touch-client #window-character .native-context-popover .stat-allocation-actions button{min-height:40px;padding:4px 14px;font-size:15px}
/* 手機放大模式（bag-fit）：框放在角色視窗右邊、原本不限高也不捲動，超出視窗的部分（確認按鈕）被切掉。改成最高與角色視窗同高、框內捲動，按鈕列固定在底部。 */
/* 2026-10-22（使用者：還是重疊啊，拉寬拉長）：橫拿放在角色視窗右邊、加寬、不限高（bag-fit.js 把兩個一起縮放到塞進畫面）。 */
body #window-character[data-bag-fit] .native-context-popover{width:300px!important;max-height:none!important;overflow:visible!important;box-sizing:border-box;font-size:15px}
/* 直拿：角色視窗旁邊沒有空間，素質框改成佔滿整個角色視窗（按 ✕ 回角色資料），不再疊在資料上。 */
body.touch-client #window-character:not([data-bag-fit]) .native-context-popover{position:absolute!important;inset:0!important;width:auto!important;height:auto!important;max-height:none!important;overflow-x:hidden!important;overflow-y:auto!important;scale:1!important;z-index:40;box-sizing:border-box;padding:12px 16px 14px;font-size:16px}
body.touch-client #window-character .native-context-popover .stat-allocation label{min-height:44px;font-size:17px}
body.touch-client #window-character .native-context-popover .stat-allocation-note{font-size:14px}
