/* Wide tables scroll inside their panel, never resize the whole workspace. */
.workspace,.workspace main,.overview-grid,.overview-grid>*,.panel,.table-wrap,.stats>*,.quick-grid>*,.products>*,.sale-workspace>*{min-width:0}
.overview-grid>*,.panel>.table-wrap{max-width:100%;box-sizing:border-box}
.table-wrap{width:100%;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
.panel-title,.panel-title>div,.attention-row>span,.quick-grid>button>span{min-width:0}.panel-title h3,.attention-row b,.quick-grid b{overflow-wrap:anywhere}
/* Product previews fill the card. Detail and query images retain the full frame. */
.product .product-image{padding:0;overflow:hidden}
.product .product-image>.p-photo{display:block;width:100%;height:100%;margin:0;mix-blend-mode:normal;object-position:center}
html[data-ui-photo=cover] .product>.p-photo{object-fit:cover;object-position:center}
.product>.p-photo{display:block;width:100%;height:166px;flex:0 0 166px;margin:0;mix-blend-mode:normal}
.detail-photo{display:block;object-fit:contain;max-width:100%}
@media(max-width:820px){.workspace main{width:100%;max-width:100%;box-sizing:border-box}.overview-grid{grid-template-columns:minmax(0,1fr)}.overview-grid>.panel{width:100%}.stats,.quick-grid,.products{max-width:100%}.product>.p-photo{height:142px;flex-basis:142px}.table-wrap{touch-action:pan-x pan-y pinch-zoom}}

/* Match Repair's six-card desktop catalog; fill every product photo frame without distortion. */
.workspace .products,
.workspace .featured .products {
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:16px;
  align-items:stretch;
}
.workspace .products>.product {
  display:flex;
  flex-direction:column;
  padding:0;
  min-width:0;
  height:100%;
  border-radius:12px;
  overflow:hidden;
}
.workspace .products .product-image,
html[data-ui-density] .workspace .products .product-image {
  position:relative;
  box-sizing:border-box;
  flex:none;
  width:100%;
  height:auto;
  aspect-ratio:4/3;
  min-height:0;
  padding:0;
  background:#f6f7f9;
  overflow:hidden;
}
.workspace .products .product-image>.p-photo,
html[data-ui-photo] .workspace .products .product-image>.p-photo {
  display:block;
  box-sizing:border-box;
  width:100%;
  height:100%;
  max-width:100%;
  max-height:100%;
  margin:0;
  object-fit:cover;
  object-position:center;
  mix-blend-mode:normal;
  background:transparent;
  border-radius:0;
}
.workspace .products .p-info,
html[data-ui-density] .workspace .products .p-info {
  display:flex;
  flex:1;
  flex-direction:column;
  gap:9px;
  min-width:0;
  padding:14px;
}
.workspace .products .p-name {
  font-size:calc(12px * var(--ui-text-scale,1));
  font-weight:700;
  line-height:1.6;
  min-height:calc(57.6px * var(--ui-text-scale,1));
  display:-webkit-box;
  -webkit-line-clamp:3;
  -webkit-box-orient:vertical;
  overflow:hidden;
  overflow-wrap:anywhere;
}
.workspace .products .p-meta {font-size:calc(10px * var(--ui-text-scale,1));line-height:1.6;gap:7px;min-width:0}
.workspace .products .p-meta.sku {display:flex;justify-content:space-between;align-items:start}
.workspace .products .p-meta.sku span {text-align:right;overflow-wrap:anywhere}
.workspace .products .bin-meta {min-height:24px;overflow-wrap:anywhere}
.workspace .products .p-bottom {margin-top:auto;padding-top:12px;min-height:48px;gap:8px}
.workspace .products .p-bottom>div {display:flex;align-items:baseline;gap:4px;flex-wrap:wrap;min-width:0}
.workspace .products .p-count {font-size:calc(22px * var(--ui-text-scale,1));font-weight:750;line-height:1.3;color:var(--teal)}
.workspace .products .product-brand {top:9px;left:9px;font-size:calc(9px * var(--ui-text-scale,1));max-width:calc(100% - 18px)}
.workspace .products .qr-mini {right:8px;bottom:8px}
@media(max-width:1499px){.workspace .products,.workspace .featured .products{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:1199px){.workspace .products,.workspace .featured .products{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:820px){
 .workspace .products,.workspace .featured .products{grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}
 .workspace .products .p-info,html[data-ui-density] .workspace .products .p-info{padding:11px;gap:7px}
 .workspace .products .product-image,html[data-ui-density] .workspace .products .product-image{padding:0}
 .workspace .products .p-name{font-size:calc(11px * var(--ui-text-scale,1));min-height:calc(52.8px * var(--ui-text-scale,1))}
 .workspace .products .p-meta{font-size:calc(9px * var(--ui-text-scale,1))}
 .workspace .products .p-count{font-size:calc(20px * var(--ui-text-scale,1))}
}

/* Large, uncropped inspection photo in the product drawer. */
.modal-panel .detail-photo{display:block;width:100%;height:clamp(300px,58vh,560px);max-width:100%;object-fit:contain;object-position:center;border-radius:12px;cursor:zoom-in;margin:14px 0 0;background:#f1f3f6}
.wh-photo-open{display:flex;gap:7px;align-items:center;justify-content:center;width:100%;min-height:40px;padding:8px 12px;margin:8px 0 15px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--ink);font:inherit;font-size:12px;cursor:zoom-in}
.wh-image-viewer{position:fixed;inset:0;width:100%;height:100vh;height:100dvh;max-width:none;max-height:none;margin:0;box-sizing:border-box;border:0;padding:14px;display:grid;grid-template-rows:auto minmax(0,1fr);gap:12px;background:#07101f;color:#edf6ff;overflow:hidden}
.wh-image-viewer:not([open]){display:none}.wh-image-viewer::backdrop{background:#02050bef}
.wh-image-viewer header{display:flex;align-items:center;gap:12px;min-width:0}.wh-image-viewer h2{font:600 14px/1.6 system-ui;flex:1;min-width:0;overflow-wrap:anywhere;margin:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.wh-image-viewer button{flex-shrink:0;padding:9px 13px;min-height:42px;border:1px solid #42617c;border-radius:8px;background:#162941;color:#eef7ff;font:600 13px system-ui;cursor:pointer}
.wh-image-stage{display:grid;grid-template-rows:minmax(0,1fr);grid-template-columns:minmax(0,1fr);place-items:center;overflow:auto;min-width:0;min-height:0;overscroll-behavior:contain}
.wh-image-stage img{display:block;width:100%;height:100%;object-fit:contain;max-width:100%;max-height:100%}
.wh-image-stage.is-zoomed{display:block}.wh-image-stage.is-zoomed img{width:200%;height:auto;max-width:none;max-height:none}
.wh-image-stage p{font:14px/1.7 system-ui;color:#f6b8a7;text-align:center}.wh-image-stage [hidden]{display:none!important}
.wh-image-viewer button:focus-visible,.wh-photo-open:focus-visible,.modal-panel .detail-photo:focus-visible{outline:2px solid #55d8ee;outline-offset:3px}
@media(max-width:600px){.modal-panel .detail-photo{height:clamp(290px,55vh,480px)}.wh-image-viewer{padding:10px;gap:10px}.wh-image-viewer header{flex-wrap:wrap;gap:8px}.wh-image-viewer h2{flex-basis:100%;font-size:12px}.wh-image-viewer header button{min-height:40px;font-size:12px}.wh-image-stage{touch-action:pan-x pan-y pinch-zoom}}
