/* All decorative panels/icons are extracted client sprites; native nine-slice exports. */
#npc-interaction{position:absolute;inset:0;z-index:90;--npc-scale:1;pointer-events:auto;font-family:TSClient,sans-serif}
#npc-interaction[hidden]{display:none}
#npc-interaction.npc-item-confirm-overlay{z-index:210}
/* UI_Check/Image_Mask serialized black alpha. */
.npc-dialog-overlay{background:rgba(0,0,0,0.1568627506494522)}
.npc-shop-overlay{background:#0006}
.npc-dialog{position:absolute;left:calc(50% + 60px * var(--npc-scale));bottom:44px;width:800px;height:136px;margin-left:0;transform:translateX(-50%) scale(var(--npc-scale));transform-origin:50% 100%;background:url('ui/npc/dialog.png') center/100% 100% no-repeat;color:#285469;box-sizing:border-box;padding:28px 30px 12px 48px;font-weight:700}
.npc-dialog h2{position:absolute;top:-13px;left:42px;margin:0;font-size:20px;color:white;text-shadow:-1.5px -1.5px #111,1.5px -1.5px #111,-1.5px 1.5px #111,1.5px 1.5px #111,0 -1.5px #111,0 1.5px #111,-1.5px 0 #111,1.5px 0 #111} /* official: white with a black outline */
.npc-dialog p{margin:0 0 18px;font-size:18px}
.npc-close{position:absolute;right:10px;top:8px;width:30px;height:30px;border:0;background:url('ui/npc/common0_but002D.png') center/contain no-repeat;font-size:0;cursor:pointer;z-index:1}
.npc-choices{display:flex;gap:8px}
.npc-choices button{height:42px;flex:1;border:0;background:url('ui/npc/choice.png') center/100% 100% no-repeat;font:700 18px TSClient,sans-serif;color:#285469;cursor:pointer}
.npc-portrait{position:absolute;right:calc(100% + 36px);bottom:22px;width:57.6px;height:134.4px;background-size:230.4px 134.4px;background-repeat:no-repeat;image-rendering:pixelated;animation:npc-portrait-idle 1s steps(4) infinite;pointer-events:none}
@keyframes npc-portrait-idle{to{background-position:-230.4px 0}}
.npc-shop{position:absolute;left:50%;top:50%;width:800px;height:500px;transform:translate(-50%,-50%) scale(var(--npc-scale));background:url('ui/status-frame.png') center/100% 100% no-repeat;box-sizing:border-box;padding:70px 32px 28px;color:#111;font-weight:700}
.npc-shop:before{content:'';position:absolute;inset:57px 14px 5px;background:url('ui/npc/shop-content.png') center/100% 100% no-repeat;pointer-events:none}
.npc-shop h2{position:absolute;left:9px;right:9px;top:8px;height:45px;margin:0;background:url('ui/status-title.png') center/100% 100% no-repeat;padding:6px 16px;box-sizing:border-box;font-size:23px;color:white}
.npc-shop .npc-close{top:12px;right:15px;width:36px;height:36px}
.npc-shop-grid{position:relative;display:grid;grid-template-columns:1fr 1fr;grid-auto-rows:90px;gap:2px;padding:5px 4px 29px;height:402px;box-sizing:border-box;background:url('ui/npc/shop-list.png') center/100% 100% no-repeat}
.npc-shop-item{position:relative;background:url('ui/npc/shop-row.png') center/100% 100% no-repeat;box-sizing:border-box;padding:16px 8px 8px 80px;min-width:0}
.npc-shop-item:before{content:'';position:absolute;left:12px;top:13px;width:64px;height:64px;background:url('ui/npc/item-slot.png') center/100% 100% no-repeat}
.npc-shop-item img{position:absolute;left:20px;top:21px;width:48px;height:48px;object-fit:contain}
.npc-shop-item strong{display:block;font-size:19px;line-height:25px;white-space:nowrap}
.npc-shop-item span{display:block;color:#6755af;font-size:15px;line-height:23px;white-space:nowrap}
.npc-shop-item .npc-price{position:absolute;left:250px;bottom:14px;padding-left:42px;color:#111;font-size:18px;line-height:36px}
.npc-price:before{content:'';position:absolute;left:0;top:0;width:39px;height:36px;background:url('ui/npc/common0_icon018.png') center/contain no-repeat}

/* Verified UI_Check close: native plus sprite, serialized tint, 45-degree rotation. */
.npc-dialog .npc-close{background:none;width:40px;height:40px;right:4px;top:0}
.npc-dialog .npc-close:before{content:'';position:absolute;left:9.5px;top:9.5px;width:21px;height:21px;background:url('ui/npc/dialog-close.png') center/contain no-repeat;transform:rotate(45deg)}
/* UI_Alert native purchase controls; modal floats over the unchanged shop. */
.npc-shop-item[role=button]{cursor:pointer}
.purchase-overlay{position:absolute;inset:0;background:rgba(0,0,0,.384);z-index:2;display:flex;align-items:center;justify-content:center}
.purchase-window{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) scale(var(--use-scale,1));width:360px;height:350px;box-sizing:border-box;margin:0;padding:32px 25px 18px;background:url('ui/shop/frame.png') center/100% 100% no-repeat;font:700 20px TSClient,sans-serif;color:#397e7c;text-align:center}
.purchase-window:before{content:'';position:absolute;inset:10px;background:url('ui/shop/content.png') center/100% 100% no-repeat;z-index:-2}
.purchase-window:after{content:'';position:absolute;left:24px;right:24px;top:25px;height:238px;background:url('ui/shop/shade.png') center/100% 100% no-repeat;z-index:-1}
.purchase-item{display:flex;align-items:center;justify-content:center;gap:10px;height:66px}
.purchase-item>img{width:65px;height:65px;box-sizing:border-box;padding:8px;background:url('ui/npc/item-slot.png') center/100% 100%;object-fit:contain}
.purchase-money{display:inline-flex;align-items:center;gap:6px;color:#111;white-space:nowrap;font-size:21px}
.purchase-money:before{content:'';width:40px;height:40px;display:block;background:url('ui/npc/common0_icon018.png') center/contain no-repeat}
.purchase-hint{margin:20px 0 16px}
.purchase-controls{display:flex;gap:8px;align-items:center;justify-content:center}
.purchase-controls button{width:60px;height:43px;flex-shrink:0;background:url('ui/shop/minmax.png') center/100% 100% no-repeat;border:0;color:#397e7c;font:700 21px TSClient,sans-serif;cursor:pointer}
.purchase-controls input{width:158px;height:43px;border:0;padding:0 8px;box-sizing:border-box;background:url('ui/shop/input.png') center/100% 100% no-repeat;color:#397e7c;text-align:center;font:700 17px TSClient,sans-serif;user-select:text;touch-action:manipulation}
.purchase-controls input::placeholder{color:#397e7c;opacity:1}
.purchase-total{display:flex;justify-content:center;align-items:center;gap:5px;margin:17px 0 8px}
.purchase-confirm{width:124px;height:50px;border:0;background:url('ui/shop/confirm.png') center/100% 100% no-repeat;color:#fff19b;font:700 23px TSClient,sans-serif;text-shadow:1px 1px #59519e;cursor:pointer}
.purchase-confirm:disabled{cursor:default}
.purchase-error{position:absolute;left:16px;right:16px;top:100%;margin:5px 0;color:white;background:#382f2fe6;font-size:17px;line-height:24px}.purchase-error:empty{display:none}
#chat-log .chat-system{color:#fff}
.currencies #hud-gold{font:inherit}
.bag-cell.is-new:after,[data-feature=bag].has-new-items:after,[data-status-tab=bag].has-new-items:after{content:'';position:absolute;width:12px;height:12px;background:url('ui/shop/new-dot.png') center/contain no-repeat;pointer-events:none}
.bag-cell.is-new:after{width:10px;height:10px;right:6px;top:6px}
[data-feature=bag].has-new-items:after{right:0;bottom:7px}
[data-status-tab=bag]{position:relative}[data-status-tab=bag].has-new-items:after{right:12px;top:16px}
/* Preserve native artwork colors; no browser hover whitening or disabled fade. */
#npc-interaction button:hover:not(:disabled){filter:none}
#npc-interaction .purchase-window button:disabled{opacity:1;filter:none}

/* Longer shop lists (打鐵舖 10, 防具 12 items) scroll inside the native list frame, like the official
   client; drag or wheel to scroll, no visible scrollbar. */
.npc-shop-grid{overflow-y:auto;overflow-x:hidden;scrollbar-width:none;overscroll-behavior:contain;touch-action:pan-y}
.npc-shop-grid::-webkit-scrollbar{display:none}
/* Yes/no confirm (openNpcConfirm): 否 left, 是 right, as in the official 放逐 dialogue. */
.npc-confirm{justify-content:space-between}
.npc-confirm button{flex:0 0 110px}
.npc-confirm-portrait{position:absolute;right:calc(100% + 4px);bottom:12px;width:128px;height:150px;pointer-events:none;image-rendering:pixelated}
.npc-player-dialog{left:calc(50% + 98px * var(--npc-scale))}
.npc-confirm-portrait.furnace-confirm-hero,.npc-confirm-portrait.npc-release-portrait{width:192px;height:220px}
.npc-confirm-portrait.npc-release-portrait{bottom:22px}
