/* Keep small selections together; use a full four-column row for larger sets. */
#photo-grid,#basket-grid{--photo-columns:4;display:grid;grid-template-columns:repeat(var(--photo-columns),minmax(0,1fr));gap:16px;margin-left:auto;margin-right:auto}
#photo-grid:has(>:only-child),#basket-grid:has(>:only-child){--photo-columns:1;max-width:300px}
#photo-grid:has(>:nth-child(2):last-child),#basket-grid:has(>:nth-child(2):last-child){--photo-columns:2;max-width:616px}
#photo-grid:has(>:nth-child(3):last-child),#basket-grid:has(>:nth-child(3):last-child){--photo-columns:3;max-width:932px}
#step-1:has(#photo-grid>:nth-child(-n+3):last-child) .photo-tools p{text-align:center}
#step-1:has(#photo-grid>:only-child) #upload-actions{max-width:560px}
#step-1:has(#photo-grid>:nth-child(2):last-child) #upload-actions{max-width:616px}
#step-1:has(#photo-grid>:nth-child(3):last-child) #upload-actions{max-width:932px}
@media(max-width:900px){#photo-grid,#basket-grid{--photo-columns:3}}
@media(max-width:680px){#photo-grid,#basket-grid,#photo-grid:has(>:nth-child(3):last-child),#basket-grid:has(>:nth-child(3):last-child){--photo-columns:2;gap:12px}#photo-grid:has(>:only-child),#basket-grid:has(>:only-child){--photo-columns:1}}
