/* Attached read-only stock; the existing depot remains the action surface. */
:root{--stock-rail-h:126px}
body.has-stock-module .depot-window{width:820px;max-width:calc(100% - 280px);margin-block:0;flex-shrink:1}
#stockModule{width:280px;flex:0 0 280px;position:sticky;top:0;align-self:flex-start;height:calc(100dvh - var(--app-top) - 32px);max-height:820px;display:flex;flex-direction:column;background:#0c0c0cf7;border:1px solid #fafae555;border-left:3px solid #ff2800;box-shadow:12px 15px 35px #0006;min-width:0;box-sizing:border-box;color:#fafae5;z-index:5}
#stockModule[hidden],#actionReceipt[hidden]{display:none!important}
.stock-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px;border-bottom:1px solid #fafae533;font:10px monospace;letter-spacing:.05em}.stock-header>b{font-size:12px}.stock-header span{white-space:nowrap}.stock-header strong{color:#fafae5}
.stock-columns{display:grid;grid-template-columns:1fr 58px 69px;padding:8px 8px 6px;gap:4px;font:8px monospace;color:#bdbdae;text-align:right}.stock-columns>span:first-child{text-align:left}
.stock-list{min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scroll-padding:8px;flex:1;outline-offset:-3px!important}
.stock-entry{display:grid;grid-template-columns:22px minmax(0,1fr)58px 69px;gap:4px;align-items:center;padding:7px 8px;border-bottom:1px solid #fafae51c;min-height:47px;box-sizing:border-box;font:10px monospace}.stock-entry .item-icon{width:22px;height:22px}.stock-name{font:10px/1.35 sans-serif;overflow-wrap:anywhere}.stock-entry>b{font:11px monospace;position:relative;text-align:right;white-space:nowrap;min-width:0;padding:5px 0}.stock-entry.stock-empty{color:#aaa99e}.stock-entry.stock-empty img{opacity:.55}.stock-entry>[data-stock-ready]{color:#d9dbc7}
.stock-delta{position:absolute;right:0;bottom:85%;font:10px monospace;font-style:normal;background:#050505;border:1px solid currentColor;padding:2px 3px;z-index:2;pointer-events:none}.stock-delta.gain{color:#a4e9b4}.stock-delta.spent{color:#ffd394}
#stockModule.stock-compact{position:fixed;left:8px;right:8px;bottom:8px;top:auto;width:auto;height:var(--stock-rail-h);max-height:none;flex:none;border-left:1px solid #fafae555;border-top:3px solid #ff2800;box-shadow:0 -8px 22px #000a}
.stock-compact .stock-header{padding:5px 10px;font-size:9px}.stock-compact .stock-header>b{font-size:10px}.stock-compact .stock-columns{display:none}.stock-compact .stock-list{display:flex;overflow-x:auto;overflow-y:hidden}.stock-compact .stock-entry{flex:0 0 175px;grid-template-columns:22px 1fr 1fr;grid-template-rows:1fr 1fr;gap:1px 5px;padding:5px 8px;min-height:0;border-bottom:0;border-right:1px solid #fafae52c}.stock-compact .item-icon{grid-row:1/3}.stock-compact .stock-name{grid-column:2/4;font-size:10px}.stock-compact .stock-entry>b{font-size:10px;text-align:left;padding:0}.stock-compact [data-stock-total]:before,.stock-compact [data-stock-ready]:before{display:block;font:8px monospace;color:#bdbdae;margin-bottom:2px}.stock-compact [data-stock-total]:before{content:'TOTAL'}.stock-compact [data-stock-ready]:before{content:'AVAILABLE'}.stock-compact .stock-delta{right:0;bottom:40%;font-size:9px}
body.has-stock-module dialog.stock-modal{max-height:calc(100dvh - var(--app-top) - var(--stock-rail-h) - 32px);margin-top:calc(var(--app-top) + 8px);margin-bottom:auto;box-sizing:border-box;scroll-padding-block:15px}
#actionReceipt{position:fixed;left:18px;bottom:20px;z-index:10000;width:min(460px,calc(100vw - 36px));box-sizing:border-box;display:flex;align-items:center;gap:12px;padding:13px;background:#10110ff5;border:1px solid #b4caaa;box-shadow:0 8px 32px #000a;pointer-events:none;color:#fafae5;max-height:220px;overflow:hidden}
#actionReceipt .action-state{display:block;font:10px monospace;color:#b4dfba;letter-spacing:.12em}#actionReceipt .action-result{font:13px/1.35 sans-serif;color:#fafae5;margin:5px 0;overflow-wrap:anywhere}#actionReceipt .action-deltas{font:10px/1.4 monospace;color:#d5d3bd;display:block;margin:0}.action-machine{position:relative;flex:0 0 54px;width:54px;height:54px;overflow:hidden;border:1px solid #fafae54d;background:repeating-linear-gradient(0deg,transparent 0 8px,#fafae511 9px 10px),repeating-linear-gradient(90deg,transparent 0 8px,#fafae511 9px 10px)}.action-machine span{display:grid;place-items:center;height:100%}.action-machine img{width:40px;height:40px;object-fit:contain}.action-machine i{position:absolute;left:0;right:0;top:50%;height:2px;background:#fafae5;opacity:0;z-index:1}.action-machine>b{position:absolute;bottom:0;right:0;font:16px monospace;color:#bbefb7;background:#050505;padding:1px 3px}
#actionReceipt.action-warning{border-color:#e6b96c}#actionReceipt.action-warning .action-state,#actionReceipt.action-warning .action-machine>b{color:#ffd394}
body.has-stock-module dialog #actionReceipt{bottom:calc(var(--stock-rail-h) + 22px)}
@media(max-width:999px){body.has-stock-module .depot-window{width:820px;max-width:100%;margin:0}body.has-stock-module .overlay{padding-bottom:calc(var(--stock-rail-h) + 24px)}body.has-stock-module #actionReceipt{bottom:calc(var(--stock-rail-h) + 22px);left:12px;width:calc(100vw - 24px);padding:10px;gap:9px}#actionReceipt .action-result{font-size:12px}.action-machine{width:44px;height:44px;flex-basis:44px}.action-machine img{width:34px;height:34px}}
@media(max-height:500px){:root{--stock-rail-h:94px}.stock-compact .stock-entry{flex-basis:190px;padding:2px 8px}.stock-compact .stock-name{font-size:9px}.stock-compact .stock-header{padding-block:3px}#actionReceipt{max-height:115px;padding:8px}#actionReceipt .action-deltas{font-size:9px}}
@media(prefers-reduced-motion:reduce){#actionReceipt *,.stock-entry *{animation:none!important;transition:none!important}}
.stock-entry>.stock-name{grid-column:2}.stock-entry>[data-stock-total]{grid-column:3}.stock-entry>[data-stock-ready]{grid-column:4}
.stock-compact .stock-entry>.stock-name{grid-column:2/4}.stock-compact .stock-entry>[data-stock-total]{grid-column:2}.stock-compact .stock-entry>[data-stock-ready]{grid-column:3}
