/* World NPCs/chests stay below player sprites (2), effects (3) and HUD (5). */
.storage-world-actor{position:absolute;z-index:1;background:transparent!important;border:0!important;padding:0!important;margin:0!important;min-width:0!important;min-height:0!important;cursor:pointer}.storage-world-actor[hidden]{display:none}.storage-world-actor span{position:absolute;left:50%;top:-8px;transform:translate(-50%,-100%);white-space:nowrap;color:#fff;font:12px 'Phong Than PC v1.1';text-shadow:1px 1px #000,-1px -1px #000}
.character-storage{box-sizing:border-box;position:fixed;inset:0;margin:auto;width:min(720px,calc(100vw - 12px));max-height:calc(100dvh - 12px);padding:6px;color:#e4d5a4;background:#070906;border:1px solid #bd9a45;border-radius:3px;box-shadow:inset 0 0 0 3px #3d2c13,0 4px 15px #0009;font:12px/1.4 'Phong Than PC v1.1';text-align:center;text-shadow:1px 1px #000,-1px -1px #000}.character-storage[hidden]{display:none}.character-storage>header{display:flex;align-items:center;justify-content:center;position:relative;min-height:30px;padding:0 30px;border-bottom:1px solid #a8873e;background:linear-gradient(100deg,#20180d,#2a2114,#16130b);color:#e8d399}.character-storage>header .ui-close{position:absolute;right:0;top:0;width:28px;height:28px;margin:0;display:grid;place-items:center;font:inherit;color:#e4d5a4;background:#13140c;border:1px solid #68532e}.storage-pair{display:grid;grid-template-columns:minmax(0,1.08fr) minmax(0,1fr);gap:8px;max-height:calc(100dvh - 56px);overflow:auto;align-items:start;padding-top:6px}.character-storage:not(.storage-paired) .storage-pair{display:block}.storage-pane{min-width:0}.storage-section-title{margin:0 0 5px;padding:3px;font-size:13px;color:#e8d399;border-bottom:1px solid #a8873e;background:linear-gradient(100deg,#20180d,#2a2114,#16130b)}.storage-pane button,.storage-pane input{box-sizing:border-box;font:inherit;text-align:center;background:#13140c;color:#e4d5a4;border:1px solid #68532e;border-radius:0;padding:3px;min-height:24px;text-shadow:1px 1px #000;min-width:0}.storage-pane nav{display:grid;grid-template-columns:repeat(5,1fr);gap:3px;margin-bottom:6px}.storage-pane button[aria-pressed=true]{outline:1px solid #ffe080;outline-offset:-2px;background:#55421a}.character-storage-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:0}.storage-money{border-top:1px solid #68532e;margin-top:6px;padding-top:6px;display:grid;grid-template-columns:1fr 1fr;gap:4px}.storage-money output{grid-column:1/-1;display:block;padding:4px;min-width:0;border:1px solid #68532e;background:#0b0d08;color:#e4d5a4;text-align:center}.storage-pane label{display:flex;align-items:center;justify-content:center;gap:4px;min-width:0}.storage-pane input{width:54px}.storage-pane p{width:100%;margin:3px 0;overflow-wrap:anywhere}.storage-pane button:disabled{opacity:.45}[data-storage-inventory]{min-width:0;position:relative}[data-storage-inventory][hidden]{display:none}[data-storage-inventory] .inventory-in-upgrade{position:relative!important;left:0!important;right:auto!important;top:0!important;max-width:none;margin:0;z-index:auto}[data-storage-inventory] .inventory-window,[data-storage-inventory] .inventory-window button,[data-storage-inventory] .inventory-window output,[data-storage-inventory] .inventory-window h2{font-family:'Phong Than PC v1.1'!important}
@media(max-width:430px){.character-storage{font-size:11px}.storage-pair{gap:6px;grid-template-columns:minmax(0,1.08fr) minmax(0,1fr)}.storage-pane button,.storage-pane input{font-size:11px}.storage-section-title{font-size:12px}}

.storage-slot-surface{position:relative;margin:0 auto}.storage-slot-surface .character-storage-grid{position:absolute;left:0;top:0;gap:0;transform-origin:top left}

.storage-slot-surface button.inventory-cell{color:#e6d6a6;font-family:'Phong Than PC v1.1'!important;font-size:12px;line-height:1.25;margin:0;min-width:0;min-height:0;box-shadow:none;border-radius:0;text-shadow:0 1px #000}

/* The chest is a compact inventory extension, with its own close control. */
.character-storage.storage-paired>header{display:none}.character-storage.storage-paired{padding:5px}.storage-paired .storage-pair{padding-top:0;max-height:calc(100dvh - 24px)}.storage-paired .storage-pane{border:1px solid #a8873e;padding:3px;box-sizing:border-box}.storage-section-title{position:relative;display:grid;place-items:center;min-height:24px;padding:0 25px;box-sizing:border-box}.storage-section-title .ui-close{position:absolute;right:0;top:0;width:23px;height:23px;min-height:0;padding:0;display:grid;place-items:center;font-size:18px}.storage-money{margin-bottom:0}
/* Only large desktop windows with a mouse get the larger paired panel. */
@media(min-width:1000px) and (min-height:700px) and (hover:hover) and (pointer:fine){.character-storage.storage-paired{width:min(calc(100vw - 32px),calc((100dvh - 40px)*var(--storage-aspect,1)*2 + 36px));font-size:clamp(15px,1.5vmin,28px)}.storage-paired .storage-pane button:not(.inventory-cell){min-height:clamp(32px,3.6vmin,60px);font-size:inherit}.storage-paired .storage-section-title{font-size:clamp(17px,1.8vmin,32px);min-height:clamp(32px,3.6vmin,60px)}.storage-paired .storage-section-title .ui-close{min-height:0;height:100%;width:clamp(30px,3.4vmin,58px)}.storage-paired .storage-pair{gap:12px;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}

/* Both panels use native inventory units, then the exact same outer scale. */
.storage-paired .storage-pane{position:relative;padding:0;border:0;justify-self:center}
.storage-native{position:absolute;left:0;top:0;transform-origin:top left;box-sizing:border-box;padding:3px 12px 6px;border:1px solid #bd9a45;background:#070906;box-shadow:inset 0 0 0 3px #3d2c13;font:12px/1.4 'Phong Than PC v1.1'}
.storage-paired .storage-native .storage-section-title{height:26px;min-height:26px;margin:0 -9px 4px;padding:0 25px;font:600 17px/25px 'Phong Than PC v1.1';border:0;border-bottom:1px solid #a8873e;background:linear-gradient(100deg,#20180d,#2a2114,#16130b);color:#e8d399}
.storage-paired .storage-native nav{display:flex;justify-content:center;gap:5px;height:22px;margin:0 0 4px}
.storage-paired .storage-native nav button{width:27px;height:20px;min-height:0;padding:0;font:12px/1.25 'Phong Than PC v1.1';border:1px solid #68532e;background:#13140c;color:#e4d5a4}
.storage-paired .storage-native .storage-money{gap:7px;margin-top:6px;padding-top:6px}
.storage-paired .storage-native .storage-money button{height:28px;min-height:0;padding:0;border:1px solid #a8873e;border-radius:1px;background:linear-gradient(#2e2415,#17130a);color:#e4d5a4;font:14px/1.2 'Phong Than PC v1.1'}
.storage-paired .storage-native .storage-money output{box-sizing:border-box;display:flex;align-items:center;justify-content:center;height:26px;min-height:0;padding:0;border:1px solid #9d8748;background:#050904;color:#e8d8a4;font:14px/1.2 'Phong Than PC v1.1'}
.storage-paired .storage-native .storage-section-title .ui-close{top:1px;right:0;width:23px;height:23px;min-height:0;padding:0;border:1px solid #a8873e;border-radius:2px;background:#1b170d;color:#e6d6a6;font:23px/20px Georgia,serif!important}

/* Shared controls: dimensions are native units before either panel is scaled. */
.storage-paired .storage-native .storage-section-title,.storage-paired .inventory-heading{box-sizing:border-box;height:26px;min-height:26px;font-size:17px!important;line-height:1.2;font-weight:600;color:var(--ui-title,#ead392);background:linear-gradient(100deg,#20180d,#2a2114,#16130b);border-bottom:1px solid #a8873e;display:flex;align-items:center;justify-content:center}
.storage-paired .storage-native nav button,.storage-paired .inventory-page-tabs button{box-sizing:border-box;width:27px;height:20px;min-height:0;font:12px/1.3 'Phong Than PC v1.1';color:var(--ui-text,#e4d5a4);border:1px solid var(--ui-border,#a8873e);border-radius:2px;background:var(--ui-control,#211a0f)}
.storage-paired .storage-native .storage-money{grid-template-columns:repeat(2,var(--storage-button-width,98px));justify-content:center}
.storage-paired .storage-native .storage-money button,.storage-paired .inventory-actions button{box-sizing:border-box;height:28px;min-height:0;font:14px/1.3 'Phong Than PC v1.1';color:var(--ui-text,#e4d5a4);border:1px solid var(--ui-border,#a8873e);border-radius:2px;background:var(--ui-control,#211a0f)}
.storage-paired .storage-native .storage-money output{width:var(--storage-money-width,98px);justify-self:center}
.storage-paired .storage-native .storage-money output,.storage-paired .inventory-money output{box-sizing:border-box;height:26px;padding:0;font:14px/1.2 'Phong Than PC v1.1';color:#e8d8a4;border:1px solid #9d8748;border-radius:0;background:#050904;display:flex;align-items:center;justify-content:center}

.storage-paired .storage-pane .storage-native nav button{min-height:0;height:20px}.storage-paired .storage-pane .storage-native .storage-money button{min-height:0;height:28px}.storage-paired .storage-pane .storage-native .storage-section-title .ui-close{min-height:0;height:23px;width:23px}


/* Storage summons the existing inventory beside it; no shared visual window. */
.character-storage.storage-paired{background:transparent;border:0;border-radius:0;box-shadow:none;padding:0;overflow:visible;max-height:calc(100dvh - 12px)}
.character-storage.storage-paired::backdrop{background:transparent}
.storage-paired .storage-pair{padding:0;gap:12px;overflow:visible;max-height:none;align-items:start;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.storage-paired .storage-pane{justify-self:center}
@media(max-width:430px){.storage-paired .storage-pair{gap:8px}}

/* app.css gives generic dialogs a330px cap; paired inventory owns its viewport fit. */
.character-storage.storage-paired{max-width:calc(100vw - 12px)}


/* Shared ui-close already draws one SVG cross; never also render the × text. */
body.ingame .storage-paired .storage-native .storage-section-title button.ui-close{font-size:0!important;line-height:0!important}
