.market-stall-modal { position:fixed; inset:0; z-index:1750; display:grid; place-items:center; padding:12px; background:#33261e66; backdrop-filter:blur(4px); }
.market-stall-modal [hidden], .market-placement-bar[hidden] { display:none !important; }
.market-stall-modal section { box-sizing:border-box; width:min(380px,100%); max-height:calc(100dvh - 24px); overflow:auto; padding:18px; border:1px solid var(--luma-border-soft); border-radius:20px; background:var(--luma-surface-cream); color:var(--luma-text-primary); font-size:13px; }
.market-stall-modal header { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.market-stall-modal h2 { margin:0; font-size:21px; }
.market-stall-modal canvas { display:block; width:180px; height:auto; max-width:100%; margin:-12px auto 0; pointer-events:none; }
.market-stall-modal p { line-height:1.5; }
.market-stall-modal [data-countdown] { font-weight:700; text-align:center; }
.market-stall-modal button, .market-placement-bar button { padding:9px 12px; border:1px solid var(--luma-border-soft); border-radius:11px; background:var(--luma-surface-ivory); color:inherit; font:inherit; cursor:pointer; }
.market-stall-modal button:disabled, .market-placement-bar button:disabled { opacity:.5; cursor:default; }
.market-stall-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.market-stall-modal [data-renew], .market-placement-bar [data-confirm] { background:var(--luma-accent-deep); color:#fffaf5; }
.market-pack-confirm { border-top:1px solid var(--luma-border-soft); margin-top:12px; padding-top:6px; }
.market-pack-confirm button { display:block; width:100%; margin-top:8px; }
.market-placement-bar { z-index:1700; max-width:min(620px,calc(100vw - 24px)); box-sizing:border-box; gap:8px; flex-wrap:wrap; padding:12px; }
.market-placement-bar [data-hint] { flex:1 1 220px; font-size:13px; }
.market-zone-facing-controls,.market-zone-facing-controls [role=group]{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.market-zone-facing-controls{flex:1 1 100%;justify-content:center}
.market-placement-bar [data-zone-facing][aria-pressed=true]{background:var(--luma-accent-deep);color:#fffaf5}
.market-placement-bar button{min-height:44px}
.market-area-placement-bar [data-hint]{flex:1 0 100%;order:0}
.market-area-placement-bar .market-zone-facing-controls{order:1}
.market-area-placement-bar [data-confirm],.market-area-placement-bar [data-cancel]{order:2;flex:1 1 0;white-space:nowrap}
.market-zone-facing-controls button{white-space:nowrap}
.market-area-placement-bar{left:50%;top:auto;bottom:24px;transform:translateX(-50%);width:min(620px,calc(100vw - 24px));border-radius:18px}
.market-facing-choices { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.market-facing-choices button { display:flex; flex-direction:column; align-items:center; padding:8px; }
.market-facing-choices canvas { width:100%; margin:0; }
.market-facing-choices [aria-pressed="true"] { border:2px solid var(--luma-accent-deep); background:#e9dfee; }
.market-facing-modal footer { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:8px; }
.market-facing-modal [data-facing-save] { background:var(--luma-accent-deep); color:#fffaf5; }
@media (max-width:520px) { .market-placement-bar { bottom:72px; } .market-placement-bar button { flex:1; } .market-stall-modal section { padding:14px; } }

/* Stock follows the trade window's tiles and toolbar, with the shared Slab colour splash. */
.market-stock-modal,.market-stock-editor-backdrop{position:fixed;inset:0;z-index:1750;display:grid;place-items:center;padding:12px;background:#33261e66;overflow:auto}
.market-stock-modal [hidden],.market-stock-editor-backdrop [hidden]{display:none!important}
.market-stock-window{width:min(820px,100%);max-height:calc(100dvh - 24px);overflow:auto;box-sizing:border-box;border:1px solid #d9b8a2;border-radius:18px;background:#fff9f1;color:#655047;box-shadow:0 12px 42px #35261d40;font:14px/1.4 var(--luma-font-family)}
.market-stock-window *,.market-stock-editor *{box-sizing:border-box;min-width:0}
.market-stock-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:20px 22px;background:linear-gradient(135deg,#b7a8e8,#c6b9e6 60%,#ead2dd);color:#fffaf8}
.market-stock-header h2{margin:0;font-size:23px;line-height:1.2;text-shadow:0 1px 2px #68517f55}
.market-stock-header p{margin:5px 0 0;font-size:11px;color:#fffaf8;white-space:pre-line;overflow-wrap:anywhere}
.market-stock-body{padding:20px}
.market-stock-window button,.market-stock-window input,.market-stock-editor button,.market-stock-editor input{font:inherit;color:inherit;max-width:100%}
.market-stock-window button,.market-stock-window input,.market-stock-editor button,.market-stock-editor input:not([type=range]){border:1px solid #debda8;background:#fff5e9;border-radius:10px;padding:9px 12px;margin:0}
.market-stock-window button,.market-stock-editor button{cursor:pointer}
.market-stock-window button:focus-visible,.market-stock-editor button:focus-visible,.market-stock-window input:focus-visible,.market-stock-editor input:focus-visible{outline:2px solid #ae83ad;outline-offset:2px}
.market-stock-window button:disabled,.market-stock-editor button:disabled{opacity:.5;cursor:default}
.market-stock-window [data-market-close],.market-stock-editor [data-market-editor-close]{width:36px;height:36px;flex:0 0 36px;padding:0;display:grid;place-items:center;font-size:22px;line-height:1;background:#fff9f1e8;color:#705368}
.market-stock-block{padding:12px;background:#fff2e7;border:1px solid #e6ccba;border-radius:12px}
.market-stock-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.market-stock-heading h3{margin:0;font-size:15px}
.market-stock-heading small,.market-stock-muted,.market-stock-detail{font-size:12px;color:#947465}
.market-stock-muted{margin:6px 0 12px}
.market-stock-grid,.market-stock-bag-grid{display:grid;gap:9px;align-content:start}
.market-stock-grid{grid-template-columns:repeat(4,minmax(0,1fr));max-height:310px;overflow:auto;padding:2px}
.market-stock-bag-grid{grid-template-columns:repeat(4,minmax(0,1fr));height:280px;overflow:auto;padding:3px}
/* Scoped tactile feedback: transforms never change the menu layout. */
:is(.market-stock-window,.market-stock-editor,.market-stall-modal,.market-placement-bar) button{transition:background-color .12s,border-color .12s,box-shadow .12s,transform .08s;box-shadow:inset 0 1px #ffffff80,0 2px #65483820;touch-action:manipulation}
:is(.market-stock-window,.market-stock-editor,.market-stall-modal,.market-placement-bar) button:enabled:is(:hover,:focus-visible){border-color:#ae83ad;box-shadow:inset 0 1px #ffffffa0,0 2px #65483830,0 0 0 2px #c6b9e638;filter:brightness(1.04)}
:is(.market-stock-window,.market-stock-editor,.market-stall-modal,.market-placement-bar) button:focus-visible{outline:2px solid #ae83ad;outline-offset:2px}
:is(.market-stock-window,.market-stock-editor,.market-stall-modal,.market-placement-bar) button:enabled:active{transform:translateY(1px);box-shadow:inset 0 2px 3px #49302724;filter:brightness(.96)}
.market-stock-window [data-market-settings]{background:#8a6653;color:#fff9f1;border-color:#70503f}
@media(prefers-reduced-motion:reduce){:is(.market-stock-window,.market-stock-editor,.market-stall-modal,.market-placement-bar) button{transition:none}:is(.market-stock-window,.market-stock-editor,.market-stall-modal,.market-placement-bar) button:enabled:active{transform:none}}
.market-stock-window button.market-stock-card{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;padding:12px 7px 8px;width:100%;min-height:130px;aspect-ratio:auto;border:1px solid #eadde3;border-radius:13px;background:#fff;color:#6f5361;text-align:center}
.market-stock-window button.market-stock-card:hover,.market-stock-window button.market-stock-card:focus-visible{background:#f3e7ed;border-color:#bba0af;color:#655047}
.market-stock-card .inventory-item-icon{width:64px;max-width:100%;height:64px;display:flex;align-items:center;justify-content:center;font-size:30px}
.market-stock-card .inventory-item-image{width:100%;height:100%;object-fit:contain}
.market-stock-card .inventory-item-name{flex-shrink:0;min-height:1.25em;font-size:12px;line-height:1.25;overflow-wrap:anywhere;white-space:normal;overflow:visible;text-overflow:clip}
.market-stock-card .inventory-quantity{position:absolute;right:4px;top:4px;border-radius:12px;padding:1px 5px;background:#f1e3e9;color:#745363;font-size:11px}
.market-stock-card .market-stock-detail{font-size:10px;line-height:1.25;overflow-wrap:anywhere}
.market-stock-price{display:flex;flex-shrink:0;align-items:center;justify-content:center;gap:4px;flex-wrap:wrap;font-size:12px}
.market-stock-price img{width:16px;height:21px;object-fit:contain}
.market-stock-price span{white-space:nowrap}
.market-stock-window button.market-stock-add{min-height:130px;border-style:dashed;color:#947465}
.market-stock-bag{border-top:1px solid #e6ccba;padding-top:14px;margin-top:14px}
.market-stock-heading input{width:190px;padding:7px 10px}
.market-stock-filters{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0}
.market-stock-filters button{padding:5px 10px;border-radius:18px;font-size:12px}
.market-stock-filters button[aria-pressed=true]{background:#655047;color:#fff;border-color:#655047}
.market-stock-footer{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:16px;font-size:12px}
.market-stock-footer p{flex:1 1 220px;margin:0;color:#947465}
.inventory-slot,.wardrobe-slot{position:relative}
.inventory-market-tag{position:absolute;right:8px;top:34px;width:22px;height:22px;object-fit:contain;pointer-events:none}
.market-stock-card .inventory-market-tag{right:4px;top:28px;width:20px;height:20px}
.market-stock-editor-backdrop{z-index:1760;background:#38251b66}
.market-stock-editor{width:min(400px,100%);max-height:calc(100dvh - 24px);overflow-x:clip;overflow-y:auto;padding:16px;border:1px solid #d9b8a2;border-radius:18px;background:#fff9f1;color:#655047;box-shadow:0 12px 42px #35261d40;font:14px/1.4 var(--luma-font-family)}
.market-stock-editor header{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px}
.market-stock-editor h2{margin:0;font-size:18px}
.market-stock-inspection{width:100%;min-height:430px;display:flex;justify-content:center;position:relative;margin-bottom:14px;overflow:clip}
.market-stock-inspection .world-object-inspection-card{position:relative!important;inset:auto!important;margin:0!important;flex:0 0 332px!important}
.market-stock-inspection .item-context-close,.market-stock-inspection .luma-action__label{display:none!important}
.market-stock-editor label{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:12px;margin-bottom:7px}
.market-stock-editor label small{font-size:11px;color:#947465}
.market-stock-plant-fields{display:grid;gap:8px;margin-bottom:14px}
.market-stock-plant-fields label{display:grid;gap:5px;margin:0}
.market-stock-editor select{font:inherit;color:inherit;min-width:0;width:100%;max-width:100%;border:1px solid #debda8;background:#fff5e9;border-radius:10px;padding:9px 12px}
.market-stock-editor select:focus-visible{outline:2px solid #ae83ad;outline-offset:2px}
.market-stock-editor select:disabled{opacity:.5}
@media(max-width:560px){.market-stock-editor select{font-size:16px;min-height:44px}}
.market-stock-quantity,.market-stock-unit-price{display:flex;gap:10px;align-items:center;margin-bottom:16px}
.market-stock-quantity input[type=range]{padding:0;width:100%;accent-color:#7c4c63;touch-action:none;cursor:ew-resize}
.market-stock-quantity input[type=number]{width:85px;flex:0 0 85px}
.market-stock-unit-price img{width:22px;height:28px;object-fit:contain}
.market-stock-unit-price input{width:100%;font-variant-numeric:tabular-nums}
.market-stock-unit-price span{font-size:12px}
.market-stock-editor p{font-size:12px;line-height:1.4}
.market-stock-editor [role=alert]{color:#9b3c46}
.market-stock-editor footer{display:flex;flex-wrap:wrap;gap:8px;justify-content:space-between;margin-top:16px}
.market-stock-editor .market-stock-primary{background:#7c4c63;border-color:#7c4c63;color:#fff;font-weight:600}
@media(max-width:560px){.market-stock-body{padding:14px}.market-stock-header{padding:16px 14px}.market-stock-header h2{font-size:20px}.market-stock-block{padding:8px}.market-stock-grid{gap:6px}.market-stock-heading{flex-wrap:wrap;gap:8px}.market-stock-heading input{width:160px}.market-stock-window input:not([type=range]),.market-stock-editor input:not([type=range]){font-size:16px}.market-stock-card .inventory-item-icon{width:52px;height:52px}.market-stock-window button.market-stock-card{padding:16px 4px 8px;min-height:125px}.market-stock-grid .inventory-item-name{font-size:11px}.market-stock-price{font-size:11px;gap:2px}.market-stock-price img{width:12px;height:16px}.market-stock-grid .market-stock-detail{display:none}.market-stock-filters button,.market-stock-footer button,.market-stock-editor button{min-height:44px}.market-stock-editor{padding:12px}.market-stock-modal,.market-stock-editor-backdrop{padding:8px}.market-stock-card .inventory-market-tag{width:17px;height:17px;right:3px;top:27px}}
