/* Shared catalogue geometry; section-specific actions keep their own handlers. */
html {--model-card-min:190px;--model-card-gap:17px;--model-card-padding:9px;--model-card-radius:28px;--model-card-image-radius:22px;--model-card-photo-ratio:1.3;--model-card-body:160px;--model-card-title:22px}
html body :is(#catalogBody.product-grid:not(.table-mode),#systemPage .product-grid:has(>[data-candidate]),#partsList>.product-grid,#legacyGrid.legacy-grid,#unassignedGrid.unassigned-grid){display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--model-card-min),1fr));gap:var(--model-card-gap);align-items:start}
html body :is(#catalogBody:not(.table-mode)>.product-card,#systemPage .product-card[data-candidate],#partsList .product-card,#legacyGrid>.legacy-card,#unassignedGrid>.unassigned-card){position:relative;display:flex;flex-direction:column;gap:0;min-width:0;min-height:0;height:auto;padding:var(--model-card-padding);border-radius:var(--model-card-radius);overflow:hidden;align-self:start;box-sizing:border-box}
html[data-interface="modern"] body :is(#catalogBody:not(.table-mode)>.product-card,#systemPage .product-card[data-candidate],#partsList .product-card,#legacyGrid>.legacy-card,#unassignedGrid>.unassigned-card){border:0;background:linear-gradient(145deg,#ffffffd1,var(--cabinet-faint,#f7faf8));box-shadow:inset 0 1px #fff,inset 1px 0 #ffffffb0,0 5px 22px var(--cabinet-shadow,#3d655014),0 13px 34px -7px var(--redesign-photo-glow,transparent),0 9px 29px -8px var(--redesign-status-glow,transparent);transition:transform 240ms ease-out,outline-color 240ms ease-out;outline:2px solid transparent}
html body :is(#catalogBody:not(.table-mode),#systemPage .product-card[data-candidate],#partsList) .product-image,
html body :is(#legacyGrid,#unassignedGrid) .model-card-image{position:relative;flex:0 0 auto;display:grid;place-items:center;width:100%;height:auto!important;min-height:0;aspect-ratio:var(--model-card-photo-ratio);border:0;border-radius:var(--model-card-image-radius);overflow:hidden;box-sizing:border-box}
html body :is(#legacyGrid,#unassignedGrid) .model-card-image{background:#ffffff91}
html body :is(#catalogBody:not(.table-mode),#systemPage .product-card[data-candidate],#partsList) .product-image>img,
html body :is(#legacyGrid,#unassignedGrid) .model-card-image>img{position:absolute;inset:0;display:block;width:100%;height:100%;max-width:100%;max-height:100%;padding:15px;object-fit:contain;border:0;border-radius:var(--model-card-image-radius);background:#fff;mix-blend-mode:normal;box-sizing:border-box}
html body :is(#catalogBody:not(.table-mode),#systemPage .product-card[data-candidate],#partsList) .product-info,
html body :is(#legacyGrid,#unassignedGrid) .model-card-info{height:var(--model-card-body);min-height:var(--model-card-body);flex:0 0 var(--model-card-body);padding:15px 10px 9px;overflow:hidden;box-sizing:border-box;text-align:left}
html body :is(#legacyGrid>.legacy-card,#unassignedGrid>.unassigned-card)>:is(.legacy-card-open,.unassigned-card-open){display:block;width:100%;padding:0;border:0;border-radius:0;margin:0;background:transparent;box-shadow:none;color:inherit;font:inherit;text-align:left;cursor:pointer}
html body :is(#legacyGrid,#unassignedGrid) .model-card-info h2,
html body :is(#catalogBody:not(.table-mode),#systemPage .product-card[data-candidate],#partsList) .product-info>:is(.article,strong){display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere;font-family:inherit;font-size:var(--model-card-title);font-weight:500;letter-spacing:-.03em;line-height:1.2;margin:0 0 8px}
html body :is(#legacyGrid,#unassignedGrid) .model-card-info :is(small,.muted),
html body :is(#systemPage .product-card[data-candidate],#partsList) .product-info :is(p,small){display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere;font-size:11px;line-height:1.5;color:var(--muted,#596e60);margin:0 0 8px}
html body #unassignedGrid .unassigned-status{position:absolute;left:19px;right:19px;bottom:18px;margin:0;font-size:11px;line-height:1.5}
html body #unassignedGrid .unassigned-no-photo{width:100%;height:100%;border-radius:var(--model-card-image-radius);font-size:11px}
html body #unassignedGrid .unassigned-card-remove{top:15px;right:15px}
html body #legacyGrid .model-card-info{padding-bottom:70px}
html body #legacyGrid .model-card-info h2{-webkit-line-clamp:1;margin-bottom:5px}
html body #legacyGrid .legacy-card-open .model-card-info p{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;overflow:hidden;min-height:0;margin:6px 0 0;font-size:11px;line-height:16px;overflow-wrap:anywhere}
html body #legacyGrid .legacy-card-footer{position:absolute;left:19px;right:19px;bottom:18px}
html body #legacyGrid .legacy-card-footer>:is(.legacy-status,.legacy-warning){display:block;padding:0;border:0;background:none;border-radius:0;font-size:10px;line-height:15px;margin:0;overflow-wrap:anywhere}
html body #legacyGrid .legacy-card-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin-top:5px}
html body #legacyGrid .legacy-card-actions:empty{display:none}
html body #legacyGrid .legacy-card-actions .button{width:100%;min-height:34px;margin:0;padding:5px;font-size:10px;line-height:12px;white-space:normal;border-radius:16px;box-sizing:border-box}
html body #legacyGrid .legacy-card-actions .button:only-child{grid-column:1/-1}
@media(min-width:851px) and (max-width:1220px){html{--model-card-min:180px;--model-card-gap:14px}}
@media(max-width:850px){html{--model-card-gap:12px;--model-card-padding:7px;--model-card-radius:25px;--model-card-image-radius:21px;--model-card-photo-ratio:1;--model-card-title:21px}html body :is(#catalogBody.product-grid:not(.table-mode),#systemPage .product-grid:has(>[data-candidate]),#partsList>.product-grid,#legacyGrid.legacy-grid,#unassignedGrid.unassigned-grid){grid-template-columns:repeat(2,minmax(0,1fr))}html body :is(#catalogBody:not(.table-mode),#systemPage .product-card[data-candidate],#partsList) .product-info,html body :is(#legacyGrid,#unassignedGrid) .model-card-info{padding:13px 8px 8px}html body #legacyGrid .model-card-info{padding-bottom:70px}html body :is(#legacyGrid .legacy-card-footer,#unassignedGrid .unassigned-status){left:15px;right:15px;bottom:15px}}
@media(max-width:380px){html{--model-card-title:18px}}
@media(hover:hover) and (pointer:fine){html[data-interface="modern"] body :is(#systemPage .product-card[data-candidate],#partsList .product-card,#legacyGrid>.legacy-card,#unassignedGrid>.unassigned-card):hover{outline-color:var(--accent,#286a51)}}
@media(hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){html[data-interface="modern"] body :is(#systemPage .product-card[data-candidate],#partsList .product-card,#legacyGrid>.legacy-card,#unassignedGrid>.unassigned-card):hover{transform:scale(1.05)!important;z-index:2}}
@media(prefers-reduced-motion:reduce){html body :is(#catalogBody:not(.table-mode)>.product-card,#systemPage .product-card[data-candidate],#partsList .product-card,#legacyGrid>.legacy-card,#unassignedGrid>.unassigned-card){transition:none}}
@media(prefers-contrast:more),(prefers-reduced-transparency:reduce){html[data-interface="modern"] body :is(#catalogBody:not(.table-mode)>.product-card,#systemPage .product-card[data-candidate],#partsList .product-card,#legacyGrid>.legacy-card,#unassignedGrid>.unassigned-card){background:#fff;border:1px solid #8a9e90;box-shadow:none}}

/* Draw the cross around the button centre, independent of font metrics. */
html body #unassignedGrid .unassigned-card-remove{font-size:0;line-height:0;padding:0}
html body #unassignedGrid .unassigned-card-remove::before,
html body #unassignedGrid .unassigned-card-remove::after{content:"";position:absolute;left:50%;top:50%;width:14px;height:2px;border-radius:1px;background:currentColor;pointer-events:none;transform:translate(-50%,-50%) rotate(45deg)}
html body #unassignedGrid .unassigned-card-remove::after{transform:translate(-50%,-50%) rotate(-45deg)}
