.shop-window{width:650px;height:700px;overflow:hidden;display:flex;flex-direction:column}
#shop-window{max-height:calc(100dvh - 16px)}
.shop-window[hidden]{display:none}
.shop-window>.window-title{flex-shrink:0;margin-bottom:10px}
.shop-window>.shop-tabs{flex-shrink:0;margin-bottom:10px}
.shop-window>.shop-toolbar{flex-shrink:0;margin-bottom:10px}
.shop-window>.section-title{flex-shrink:0;margin-bottom:8px}
#shop-buyback-note{flex-shrink:0;margin:0 0 8px;font-size:10px;line-height:1.5}
.shop-body{display:flex;flex-direction:column;flex:1;min-height:0;gap:10px}
.shop-body[hidden],.shop-data-error[hidden]{display:none}
.shop-data-error{padding:12px 0;line-height:1.6}
.shop-results{display:flex;flex-direction:column;flex-shrink:0;min-height:0}
.shop-list-frame{position:relative;min-height:0}
#shop-items{height:314px;max-height:none;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(5,58px);gap:6px;overflow:hidden;align-content:start}
.shop-window .shop-item{position:relative;height:58px;box-sizing:border-box;gap:7px;padding:7px;overflow:hidden}
.shop-window .shop-item .shop-item-body{flex:1;min-width:0}
.shop-window .shop-item b{font-size:12px}
.shop-window .shop-item small{font-size:10px;line-height:1.3;margin-top:4px}
.shop-window .shop-item.shop-active{outline:1px solid var(--gold);outline-offset:-1px}
.shop-check{width:16px;height:16px;border:1px solid var(--line);border-radius:3px;display:grid;place-items:center;color:var(--gold);flex-shrink:0;font-size:12px}
.shop-check[hidden],.shop-selected-quantity[hidden]{display:none}
.shop-selected-quantity{position:absolute;right:5px;top:3px;font-size:9px;color:var(--gold);background:var(--field);padding:1px 3px;border-radius:3px}
#shop-empty{position:absolute;inset:0;margin:0;display:grid;place-items:center;border:1px dashed var(--line);padding:14px}
#shop-empty[hidden]{display:none}
.shop-pagination{display:flex;align-items:center;justify-content:center;gap:18px;margin-top:10px;height:34px;flex-shrink:0}
.shop-pagination button{width:42px;height:32px;padding:0;font-size:20px}
#shop-page-label{min-width:68px;text-align:center;font-size:11px;font-variant-numeric:tabular-nums;color:var(--muted)}
.shop-window .shop-purchase{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 14px;margin:0;padding-top:10px;margin-top:auto;flex-shrink:0}
.shop-selection{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:18px}
#shop-selected-name{font-size:12px;color:var(--gold);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
#shop-clear-selection{padding:2px 5px;font-size:10px;background:transparent;color:var(--muted);border-color:var(--line);white-space:nowrap}
#shop-clear-selection[hidden]{display:none}
.shop-quantity-controls{grid-column:1/-1;display:flex;align-items:center;gap:9px;min-width:0}
.shop-quantity-controls label{font-size:11px;white-space:nowrap}
.shop-window .shop-purchase input[type=range]{flex:1;min-width:0;width:auto;padding:0;margin:0;accent-color:var(--gold);height:26px;touch-action:pan-x}
.shop-window .shop-purchase input[type=number]{width:66px;margin:0;text-align:center;box-sizing:border-box}
#shop-quantity-limit{font-size:10px;white-space:nowrap;color:var(--muted)}
.shop-order-summary{display:flex;align-items:center;flex-wrap:wrap;gap:5px 14px;min-width:0}
#shop-selection-count{font-size:10px;color:var(--muted);font-variant-numeric:tabular-nums}
.shop-window #shop-buy{min-width:94px;min-height:36px;margin:0}

.touch-ui #shop-window{position:fixed;left:calc(env(safe-area-inset-left) + 8px);right:calc(env(safe-area-inset-right) + 8px);top:calc(env(safe-area-inset-top) + 8px);bottom:calc(env(safe-area-inset-bottom) + 8px);width:auto;height:auto;max-width:none;max-height:none;padding:10px;overflow:hidden;overscroll-behavior:contain}
.touch-ui #shop-window>.window-title{margin-bottom:8px;min-height:22px}
.touch-ui #shop-window>.shop-tabs{gap:5px;margin-bottom:8px}
.touch-ui #shop-window>.shop-tabs button{min-height:32px;padding:5px}
.touch-ui #shop-window>.shop-toolbar{gap:6px;margin-bottom:8px}
.touch-ui #shop-window>.shop-toolbar input,.touch-ui #shop-window>.shop-toolbar select{height:32px;box-sizing:border-box;padding:5px;font-size:11px}
.touch-ui #shop-window>.shop-toolbar select{max-width:108px}
.touch-ui #shop-window>.section-title{margin-bottom:6px;min-height:18px}
.touch-ui .shop-body{gap:8px}
.touch-ui .shop-results{flex:1;min-height:0}
.touch-ui .shop-list-frame{flex:1;min-height:0;overflow:hidden}
.touch-ui #shop-items{height:100%;min-height:0;grid-template-columns:1fr;grid-template-rows:none;grid-auto-rows:58px;gap:5px;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;-webkit-overflow-scrolling:touch;scrollbar-gutter:stable}
.touch-ui .shop-pagination{margin-top:7px;height:32px}
.touch-ui .shop-window .shop-purchase{gap:6px 8px;padding-top:8px}
.touch-ui .shop-quantity-controls{gap:7px}
.touch-ui .shop-window .shop-purchase input[type=number]{width:58px;padding:5px}
.touch-ui #shop-quantity-limit{display:none}
.touch-ui #shop-buyback-note{margin-bottom:6px;font-size:9px;line-height:1.4}

@media(orientation:landscape) and (min-width:560px){
 .touch-ui .shop-body{display:grid;grid-template-columns:minmax(0,1fr) 210px;gap:12px}
 .touch-ui .shop-results{min-width:0;height:100%}
 .touch-ui #shop-items{grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:58px;scrollbar-gutter:auto}
 .touch-ui .shop-window .shop-purchase{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;border-top:0;border-left:1px solid var(--line);margin:0;padding:0 0 0 12px;gap:6px;min-height:0}
 .touch-ui .shop-selection{min-height:18px}
 .touch-ui #shop-clear-selection{border:0;font-size:9px;padding:0}
 .touch-ui .shop-order-summary{flex:1;align-content:center;gap:4px;flex-direction:column;align-items:flex-start;justify-content:center}
 .touch-ui .shop-window #shop-buy{min-height:32px;padding:5px}
 .touch-ui .shop-window .shop-item .item-icon{width:30px;height:30px}
 .touch-ui .shop-window .shop-item{gap:5px;padding:5px}
 .touch-ui .shop-window .shop-item b{font-size:11px}
 .touch-ui .shop-window .shop-item small{font-size:9px}
}
.touch-ui #workshop-window{position:fixed;left:calc(env(safe-area-inset-left) + 8px);right:calc(env(safe-area-inset-right) + 8px);top:calc(env(safe-area-inset-top) + 8px);bottom:calc(env(safe-area-inset-bottom) + 8px);width:auto;height:auto;max-height:none;overflow:hidden;display:flex;flex-direction:column;padding:10px}
.touch-ui #workshop-window[hidden]{display:none}
.touch-ui #workshop-window>.window-title,.touch-ui #workshop-window>.shop-tabs,.touch-ui #workshop-window>.section-title{flex-shrink:0;margin-bottom:8px}
.touch-ui .workshop-columns{flex:1;min-height:0;grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) minmax(170px,auto);gap:8px;margin-top:0}
.touch-ui #workshop-items{min-height:0;max-height:none;overscroll-behavior:contain;touch-action:pan-y}
.touch-ui .workshop-details{min-height:0;padding:9px;gap:6px}
.touch-ui #workshop-quote{min-height:0;overflow-y:auto;overscroll-behavior:contain;flex:1}
.touch-ui #workshop-reason{min-height:0;max-height:34px;overflow-y:auto}
.touch-ui #workshop-action{flex-shrink:0;min-height:34px;padding:6px}
@media(orientation:landscape) and (min-width:560px){.touch-ui .workshop-columns{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:minmax(0,1fr)}}
@media(orientation:landscape) and (max-height:360px){
 .touch-ui #shop-window>.window-title,.touch-ui #shop-window>.shop-tabs,.touch-ui #shop-window>.shop-toolbar{margin-bottom:5px}
 .touch-ui #shop-window>.shop-tabs button{min-height:28px;padding:4px}
 .touch-ui #shop-window>.shop-toolbar input,.touch-ui #shop-window>.shop-toolbar select{height:28px}
 .touch-ui #shop-buyback-note{font-size:8px;margin-bottom:4px}
}
@media(orientation:landscape) and (min-width:560px) and (max-width:759px){.touch-ui #shop-items{grid-template-columns:1fr}}
