/* Optional private photos share one editor and viewer across products and customers. */
.photo-name { display:flex; align-items:center; gap:12px; min-width:170px; }
.photo-name > div { min-width:0; }
.photo-placeholder,.photo-thumbnail { flex:none; display:grid; place-items:center; width:48px; height:48px; border:1px solid var(--line); border-radius:6px; overflow:hidden; background:#f4f6f2; color:#87978a; padding:0; }
.photo-placeholder svg { width:25px; height:25px; }
.photo-thumbnail img { display:block; width:100%; height:100%; object-fit:cover; }
.photo-thumbnail-product img { object-fit:contain; background:#fff; }
.photo-thumbnail:hover { border-color:var(--accent); }
.photos-editor { margin-block:20px 6px; padding-block-start:16px; border-top:1px solid var(--line); }
.photos-editor-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; font-size:16px; }
.photos-editor .photos-add { font-size:15px; padding:6px 12px; min-height:44px; }
.photos-editor .hint { font-size:13px; margin:6px 0 10px; }
.photos-editor-cards { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.photos-editor-card { min-width:0; padding:8px; border:1px solid var(--line); border-radius:6px; background:#fafbf9; }
.photos-editor-card > img { display:block; width:100%; height:100px; object-fit:contain; background:#fff; border-radius:3px; }
.photos-editor-actions { display:flex; flex-wrap:wrap; justify-content:space-between; gap:2px; margin-top:4px; }
.photos-editor-actions button { min-height:44px; padding:4px 7px; border:0; background:transparent; font-size:13px; }
.photos-editor-actions button[aria-pressed=true] { color:var(--accent); font-weight:700; }
.photos-editor .photos-remove,.photos-editor .photos-error { color:#97452f; }
.photos-editor .photos-reload { font-size:14px; padding:5px 12px; }
.photo-gallery { width:min(800px,calc(100% - 24px)); }
.photo-gallery .dialog-heading h2 { font-size:22px; overflow-wrap:anywhere; }
.photo-gallery-stage { display:grid; place-items:center; min-height:150px; background:#f7f8f5; border-radius:5px; }
.photo-gallery-stage > img { display:block; max-width:100%; max-height:60dvh; object-fit:contain; }
.photo-gallery-choices { display:flex; justify-content:center; gap:10px; margin-top:12px; }
.photo-gallery-choices:empty { display:none; }
.photo-gallery-choices button { padding:3px; border:2px solid transparent; }
.photo-gallery-choices button[aria-pressed=true] { border-color:var(--accent); }
.photo-gallery-choices img { display:block; width:56px; height:56px; object-fit:contain; border-radius:3px; }
@media(max-width:540px) { .photo-name { gap:8px; }.photo-placeholder,.photo-thumbnail { width:42px; height:42px; }.photos-editor-cards { gap:6px; }.photos-editor-card { padding:4px; }.photos-editor-actions { display:grid; grid-template-columns:minmax(0,1fr); justify-content:stretch; }.photos-editor-card > img { height:80px; }.photos-editor-actions button { font-size:12px; padding-inline:4px; } }

/* The same local crop controls serve customer portraits and product photos. */
.photo-crop { width:min(560px,calc(100% - 24px)); padding:20px; }
.photo-crop .dialog-heading h2 { font-size:23px; }
.photo-crop .hint { margin:8px 0 12px; }
.photo-crop-shapes { display:flex; gap:8px; margin-bottom:12px; }
.photo-crop-shapes button { flex:1; min-width:0; font-size:15px; min-height:44px; padding:5px 10px; }
.photo-crop-shapes [aria-pressed=true] { background:#edf2ee; border-color:var(--accent); color:var(--accent); }
.photo-crop-stage { display:flex; align-items:center; justify-content:center; background:#eef1ed; border:1px solid var(--line); border-radius:6px; padding:8px; }
.photo-crop-canvas { display:block; max-width:100%; max-height:min(40dvh,340px); width:auto; height:auto; background:#fff; box-shadow:0 0 0 1px #ccd5cd; touch-action:none; cursor:grab; }
.photo-crop-canvas:active { cursor:grabbing; }
.photo-crop-canvas:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.photo-crop-controls { display:grid; grid-template-columns:1fr auto; align-items:center; gap:4px 12px; margin-top:12px; }
.photo-crop-controls label { margin:0; font-size:15px; }
.photo-crop-controls output { font-size:15px; font-variant-numeric:tabular-nums; }
.photo-crop-zoom-row { grid-column:1/-1; display:flex; align-items:center; gap:12px; }
.photo-crop-zoom-row button { width:44px; height:44px; padding:0; flex:none; }
.photo-crop input[type=range] { width:100%; min-width:0; height:44px; padding:0; margin:0; border:0; box-shadow:none; accent-color:var(--accent); background:transparent; cursor:pointer; }
.photo-crop-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
.photo-crop-actions button { flex:1; min-height:44px; padding:7px 10px; font-size:16px; margin:0; }
.photo-crop-actions .primary { width:auto; flex:1.4; }
@media(max-width:540px) { .photo-crop { padding:14px; }.photo-crop .dialog-heading h2 { font-size:21px; }.photo-crop-actions { gap:6px; }.photo-crop-actions button { font-size:14px; padding-inline:6px; } }

/* Inventory tabs share a stationary frame and save position; only their content scrolls. */
#stock-dialog { height:min(680px,90dvh); overflow:hidden; }
#stock-dialog[open] { display:flex; flex-direction:column; }
#stock-dialog > .dialog-heading,#stock-editor-tabs { flex:none; }
#stock-product { flex:none; max-height:3.6em; overflow:auto; overflow-wrap:anywhere; margin-block:8px; }
#stock-editor-tabs { margin-block:12px 16px; }
#stock-dialog > form { display:flex; flex-direction:column; flex:1; min-width:0; min-height:0; overflow:hidden; }
#stock-dialog .stock-editor-content { flex:1; min-width:0; min-height:0; overflow:auto; overscroll-behavior:contain; padding:4px; scroll-padding-block:8px; }
#stock-dialog .stock-editor-footer { flex:none; padding:16px 4px 4px; }
#stock-dialog .stock-editor-footer > .primary { margin:0; min-height:48px; }
#stock-dialog,#stock-dialog .stock-editor-content,#stock-product { scrollbar-width:none; scrollbar-gutter:auto; }
#stock-dialog::-webkit-scrollbar,#stock-dialog .stock-editor-content::-webkit-scrollbar,#stock-product::-webkit-scrollbar { display:none; }

@media(max-height:500px) {
  #stock-dialog { padding:12px 20px; }
  #stock-product { margin-block:4px; max-height:1.8em; }
  #stock-editor-tabs { margin-block:6px 8px; }
  #stock-editor-tabs button { padding-block:6px; }
  #stock-dialog .stock-editor-footer { padding-top:8px; }
}
