/* Chest dialogs reuse the existing Treasure Pavilion parchment and button assets. */
html body .inv-chest-choice,
html body .inv-chest-choice.inv-chest-choice-art{
 box-sizing:border-box!important;position:fixed!important;inset:0!important;margin:auto!important;
 width:min(560px,calc(100vw - 24px))!important;max-height:min(80vh,720px)!important;
 padding:30px 32px 28px!important;overflow:auto!important;
 border:0!important;border-radius:0!important;
 background:transparent url('/assets/rustic-v1045/shop-dialog.webp') center/100% 100% no-repeat!important;
 box-shadow:0 14px 38px #0009!important;color:#392819!important;
 font-family:"DFKai-SB","標楷體",serif!important;text-align:center!important;
}
html body .inv-chest-choice h3,
html body .inv-chest-choice.inv-chest-choice-art h3{
 margin:0 0 14px!important;padding:0!important;background:none!important;
 color:#392819!important;text-align:center!important;font-size:19px!important;
 font-weight:normal!important;letter-spacing:2px!important;text-shadow:none!important;
}
html body .inv-chest-choice p{margin:0 0 18px!important;line-height:1.7!important;color:#392819!important}
html body .inv-chest-choice .inv-chest-options{
 margin:12px 4px 16px!important;max-height:48vh!important;overflow:auto!important;text-align:left!important;
}
html body .inv-chest-choice .inv-chest-options label{color:#392819!important}
html body .inv-chest-choice .inv-chest-actions{
 display:flex!important;align-items:center!important;justify-content:center!important;
 gap:12px!important;margin:12px 0 0!important;
}
html body .inv-chest-choice button{
 box-sizing:border-box!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;
 width:100px!important;min-width:100px!important;height:36px!important;min-height:36px!important;
 margin:0 6px!important;padding:4px 12px!important;border:0!important;border-radius:0!important;
 background:transparent url('/assets/rustic-v1045/button.webp') center/100% 100% no-repeat!important;
 color:#f2dfbd!important;font:15px "DFKai-SB","標楷體",serif!important;cursor:pointer!important;
}
html body .inv-chest-choice button:hover{background-image:url('/assets/rustic-v1045/button-hover.webp')!important}
html body .inv-chest-choice:not(.inv-chest-choice-art){text-align:center!important}
html body .inv-chest-choice::backdrop{background:#0009!important}
@media(max-width:480px){html body .inv-chest-choice,html body .inv-chest-choice.inv-chest-choice-art{padding:26px 20px!important}html body .inv-chest-choice button{width:92px!important;min-width:92px!important}}

/* Compact general-bag chest rows to match the shop bag's visual rhythm. */
#playerInventoryDialog .inv-general-list .inv-general-item.inv-chest-item{
 display:grid!important;grid-template-columns:56px minmax(0,1fr) auto auto!important;
 grid-template-rows:auto auto!important;column-gap:10px!important;row-gap:2px!important;
 min-height:58px!important;padding:6px 8px!important;align-items:center!important;
}
#playerInventoryDialog .inv-chest-item>img{grid-column:1!important;grid-row:1/3!important;width:48px!important;height:48px!important}
#playerInventoryDialog .inv-chest-item>span:first-of-type{grid-column:2!important;grid-row:1!important;align-self:end!important;font-weight:normal!important}
#playerInventoryDialog .inv-chest-item>span:nth-of-type(2){grid-column:3!important;grid-row:1!important;align-self:end!important}
#playerInventoryDialog .inv-chest-item>.inv-chest-details{display:contents!important}
#playerInventoryDialog .inv-chest-item .inv-chest-description{grid-column:2/4!important;grid-row:2!important;align-self:start!important;line-height:1.35!important;font-size:12px!important}
#playerInventoryDialog .inv-chest-item .inv-chest-open{grid-column:4!important;grid-row:1/3!important;justify-self:end!important;align-self:center!important;margin:0!important}
@media(max-width:520px){
 #playerInventoryDialog .inv-general-list .inv-general-item.inv-chest-item{grid-template-columns:48px minmax(0,1fr) auto auto!important;column-gap:6px!important;padding:6px 3px!important}
 #playerInventoryDialog .inv-chest-item>img{width:42px!important;height:42px!important}
}
/* Unified chest dialogs: one source of truth for layout, artwork and positioning. */
html body dialog.inv-chest-choice{padding-top:96px!important;padding-bottom:48px!important;max-height:min(90vh,860px)!important;overflow-y:auto!important;scroll-padding-top:62px!important}
html body dialog.inv-chest-choice h3{position:relative!important;z-index:2!important;line-height:1.5!important;margin-bottom:12px!important;color:#382312!important}
html body dialog.inv-chest-choice p{position:relative!important;z-index:2!important}
html body dialog.inv-chest-choice .inv-chest-options{max-height:45vh!important}
html body dialog.inv-chest-choice .inv-chest-preview-row{display:flex!important;align-items:center!important;justify-content:center!important;text-align:center!important;gap:18px!important;min-height:70px!important;padding:5px 10px!important;border-bottom:1px solid #c7a77e!important;color:#392819!important;font-size:17px!important}
html body dialog.inv-chest-choice .inv-chest-preview-row img{width:62px!important;height:62px!important;object-fit:contain!important;flex:0 0 62px!important}
html body dialog.inv-chest-choice .inv-chest-preview-row span{display:inline-block!important;text-align:left!important;min-width:170px!important}
html body dialog.inv-chest-choice .inv-package-heading{display:flex!important;align-items:center!important;justify-content:center!important;gap:16px!important;padding:0 12px 4px!important;min-height:112px!important;font-size:21px!important}
html body dialog.inv-chest-choice .inv-package-heading-image{width:108px!important;height:108px!important;flex:0 0 108px!important;object-fit:contain!important}
html body .inv-chest-choice.inv-chest-choice-art[popover]{inset:0!important;margin:auto!important;transform:none!important}
html body .inv-chest-choice-art .inv-chest-options label{display:flex;align-items:center;gap:12px;padding:9px 12px;min-height:58px;border:1px solid #c5a47b;border-radius:5px;background:#f3e3c6;cursor:pointer;font-size:14px}
html body .inv-chest-choice-art .inv-chest-options label:has(input:checked){background:#ead1a3;border-color:#9d6530;box-shadow:inset 0 0 0 1px #b98a50}
html body .inv-chest-choice-art .inv-chest-options input{accent-color:#8c482f;width:17px;height:17px;flex-shrink:0}
html body .inv-chest-choice-art .inv-chest-options img{width:56px;height:56px;object-fit:contain;flex-shrink:0}