/* Plain text category controls keep the approved labels readable on small screens. */
#shop-panel .shop-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;flex:0 0 auto;}
#shop-panel .shop-tabs button,#shop-panel .shop-furniture-sections button{min-width:0;min-height:44px;padding:5px;font-size:11px;line-height:1.2;white-space:normal;}
#shop-panel .shop-furniture-sections{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;margin:0 0 6px;flex:0 0 auto;}
#shop-panel .shop-furniture-sections button{flex:1;border:1px solid #d7c493;background:#fff7df;border-radius:6px;color:inherit;}
#shop-panel .shop-furniture-sections [aria-pressed=true]{background:#dfe9ce;border-color:#99ae83;}
#shop-panel .shop-section-note{font-size:11px;line-height:1.4;margin:5px 3px 9px;color:#69553c;}
#shop-panel [hidden]{display:none!important;}

/* Shared store/inventory: soft timber surround, open cream shelves, minimal rules. */
#drawer:is([data-panel=shop],[data-panel=inventory]){left:50%;right:auto;top:50%;bottom:auto;transform:translate(-50%,-50%);width:min(760px,calc(100% - 20px));max-width:760px;height:min(680px,calc(100% - 28px));max-height:calc(100% - 28px);padding:8px;display:flex;flex-direction:column;border:2px solid #895a32;border-radius:14px;background:linear-gradient(110deg,#e7aa61,#dd994d);box-shadow:0 5px 18px #50301430;overflow:hidden;z-index:300100;color:#3e2415;}
#drawer:is([data-panel=shop],[data-panel=inventory]) .drawer-header{flex:0 0 auto;min-height:48px;margin:0;padding:0 4px 6px 10px;border:0;background:none;}
#drawer:is([data-panel=shop],[data-panel=inventory]) .drawer-header h2{color:#3e2415;font-size:24px;line-height:1.2;text-shadow:none;letter-spacing:.02em;}
#drawer:is([data-panel=shop],[data-panel=inventory]) #close-drawer{background:#fff3da;border:1px solid #895a32;border-radius:50%;width:44px;min-width:44px;height:44px;min-height:44px;position:relative;}
#drawer:is([data-panel=shop],[data-panel=inventory]) #close-drawer:before{content:'×';position:static;display:block;background:none;color:#71451f;font:30px/38px system-ui;}
#drawer:is([data-panel=shop],[data-panel=inventory]) #close-drawer:after{content:none;}
#shop-panel,#inventory-panel{min-height:0;flex:1;display:flex;flex-direction:column;overflow:hidden;padding:8px;border-radius:9px;background:#fff8eb;}
#shop-panel .shop-tabs,#inventory-panel .inventory-tabs{display:flex;flex:0 0 auto;overflow-x:auto;gap:3px;margin:0 0 8px;padding:0 0 3px;scrollbar-width:thin;overscroll-behavior:contain;}
#shop-panel .shop-tabs button,#inventory-panel .inventory-tabs button{flex:1 0 auto;min-width:80px;min-height:44px;padding:7px 10px;border:0;border-radius:7px;background:#f6e4c5;color:#654022;font:600 12px/1.2 system-ui;white-space:nowrap;}
#shop-panel .shop-tabs [aria-pressed=true],#inventory-panel .inventory-tabs [aria-pressed=true]{background:#71451f;color:#fff8eb;}
#shop-panel .shop-furniture-sections,#inventory-panel .shop-furniture-sections{display:flex;gap:4px;overflow-x:auto;flex:0 0 auto;padding:0 0 6px;margin:0 0 5px;scrollbar-width:thin;}
#shop-panel .shop-furniture-sections button,#inventory-panel .shop-furniture-sections button{flex:1 0 auto;min-width:85px;min-height:44px;padding:6px 8px;border:0;border-radius:5px;background:transparent;color:#71451f;font:500 11px/1.25 system-ui;white-space:nowrap;}
#shop-panel .shop-furniture-sections [aria-pressed=true],#inventory-panel .shop-furniture-sections [aria-pressed=true]{background:#f0dbb4;color:#3e2415;}
#shop-catalog-scroll,#inventory-content{flex:1;min-height:0;max-height:none!important;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;padding:2px 3px 8px;scrollbar-gutter:stable;}
#shop-tray,#item-tray{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;overflow:visible;padding:0;align-items:stretch;}
#shop-tray .shop-card,#item-tray .inventory-card{display:flex!important;flex-direction:column;align-items:center;gap:7px;min-width:0;flex-basis:auto;margin:0;padding:10px 7px;background:#fffdf7;border:1px solid #e3d4b8;border-radius:9px;box-shadow:none;text-align:center;}
#shop-tray .shop-card>strong{font:600 13px/1.3 system-ui;min-height:34px;color:#3e2415;}
#shop-tray .shop-card>.shop-preview{height:110px!important;width:100%!important;object-fit:contain;}
#shop-tray .shop-price{color:#71451f;font:700 13px/1.3 system-ui;}
#shop-tray .shop-purchase{margin-top:auto;width:100%;}
#shop-tray .shop-purchase button,#item-tray .inventory-toggle{min-height:44px;width:100%;padding:7px;border:0;border-radius:6px;background:#e7aa61;color:#3e2415;font:700 12px/1.2 system-ui;}
#shop-tray .shop-owned,#item-tray .inventory-count{display:block!important;font:11px/1.4 system-ui;color:#765e41;min-height:30px;margin:5px 0 0;padding:0;white-space:normal;}
#item-tray .inventory-select{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:8px;width:100%;height:auto;min-height:150px;margin:0;padding:0;background:none;border:0;color:#3e2415;}
#item-tray .inventory-select>img{display:block;width:100%;height:110px;object-fit:contain;}
#item-tray .inventory-select>span:not(.hybrid-preview){font:600 12px/1.3 system-ui;min-height:31px;}
#item-tray .inventory-toggle{margin-top:auto;background:#e1e9cd;}
#item-tray button:disabled{opacity:.6;}
#inventory-summary{font:11px/1.45 system-ui;margin:12px 2px 2px;color:#765e41;}
#drawer:is([data-panel=shop],[data-panel=inventory]) button:focus-visible{outline:3px solid #376476;outline-offset:2px;}
#shop-finishes .finish-row,#inventory-decorations .finish-row{display:block;margin:12px 0;}
#shop-finishes .finish-row>span,#inventory-decorations .finish-row>span{display:block;margin:0 0 7px;font:600 14px/1.3 system-ui;}
#shop-finishes .swatches,#inventory-decorations .swatches{display:flex;flex-wrap:wrap;gap:7px;}
#shop-finishes .swatches button,#inventory-decorations .swatches button{min-height:44px;min-width:90px;padding:6px 10px;border:1px solid #ddcaab;border-radius:6px;background:#fffdf7;color:#654022;font:12px/1.3 system-ui;}
#shop-finishes .swatches [aria-pressed=true],#inventory-decorations .swatches [aria-pressed=true]{background:#e1e9cd;border-color:#9aaa7b;}
#inventory-panel [hidden],#shop-panel [hidden]{display:none!important;}
@media(max-width:460px){#shop-tray,#item-tray{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;}#drawer:is([data-panel=shop],[data-panel=inventory]){width:calc(100% - 12px);padding:5px;border-radius:10px;}#shop-panel,#inventory-panel{padding:6px;}#shop-tray .shop-card>.shop-preview,#item-tray .inventory-select>img{height:96px!important;}#item-tray .inventory-select{min-height:136px;}}
@media(max-height:500px){#drawer:is([data-panel=shop],[data-panel=inventory]){height:calc(100% - 12px);max-height:calc(100% - 12px);}#drawer:is([data-panel=shop],[data-panel=inventory]) .drawer-header{min-height:44px;padding-bottom:3px;}#shop-panel .shop-tabs,#inventory-panel .inventory-tabs{margin-bottom:3px;}#shop-panel .shop-furniture-sections,#inventory-panel .shop-furniture-sections{margin-bottom:0;padding-bottom:2px;}}
/* Override legacy illustrated action-button resets only inside the two new shelves. */
#shop-tray button[data-buy],#item-tray button[data-place]{background:#e7aa61!important;border-radius:6px!important;border:0!important;}
#item-tray button[data-place]{background:#e1e9cd!important;}
#shop-tray button[data-buy]::before,#item-tray button[data-place]::before{content:none;}
#drawer:is([data-panel=shop],[data-panel=inventory]) #close-drawer{background:#fff3da!important;border:1px solid #895a32!important;border-radius:50%!important;}
