.material-photo-label-wrap { display:block; min-width:0; }
.material-photo-label-wrap.has-photo-status {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:6px;}
#moduleView .has-photo-status .material-photo-name {display:block;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.material-photo-status-badge {display:inline-flex;align-items:center;gap:3px;border-radius:5px;padding:3px 5px;font-size:10px;font-weight:600;white-space:nowrap;}
.material-photo-status-badge::after {content:attr(data-photo-status);}
.material-photo-status-badge svg {width:12px;height:12px;flex:0 0 12px;}
.material-photo-status-badge.has-photo {color:#156c4b;background:#e4f5ed;border:1px solid #b7dfca;}
.material-photo-status-badge.no-photo {color:#7e641b;background:#fff6df;border:1px dashed #d9bd75;}
.material-photo-name.is-clickable { cursor:pointer; color:#1463a6; text-decoration:underline; text-decoration-color:#a8c5e4; text-underline-offset:3px; }
.material-photo-name.is-clickable:hover { color:#084681; text-decoration-color:currentColor; }
.material-photo-name:focus-visible { outline:2px solid #4a8de5; outline-offset:3px; border-radius:3px; }
.material-photo-mobile-button { display:none; }
dialog.material-photo-dialog { width:min(900px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); padding:0; color:#23415d; background:#fff; border:1px solid #d4e1ef; border-radius:14px; overflow:auto; }
.material-photo-dialog > header { display:flex; justify-content:space-between; align-items:center; gap:14px; padding:16px 20px; background:#153e62; color:#fff; }
.material-photo-dialog header small { font-size:10px; color:#b2d4f4; letter-spacing:.08em; }
.material-photo-dialog header h2 { margin:4px 0; font-size:18px; color:#fff; overflow-wrap:anywhere; }
.material-photo-dialog header p { margin:0; font-size:12px; color:#d2e4f5; }
.material-photo-dialog header button { flex:0 0 34px; height:34px; border:1px solid #ffffff55; background:#ffffff10; border-radius:8px; color:#fff; font-size:23px; }
.material-photo-stage { margin:16px 20px 0; min-height:220px; height:min(50dvh,480px); display:flex; justify-content:center; align-items:center; background:#f2f6fa; border:1px solid #dce6f0; border-radius:10px; overflow:auto; }
.material-photo-stage img { max-width:100%; max-height:100%; object-fit:contain; display:block; }
.material-photo-stage p { padding:24px; color:#637c95; text-align:center; line-height:1.7; }
.material-photo-status { min-height:20px; margin:10px 20px; font-size:13px; color:#257652; overflow-wrap:anywhere; }
.material-photo-status.is-error { color:#bf3543; }
.material-photo-upload { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; padding:0 20px 14px; }
.material-photo-upload > div { display:flex; gap:8px; }
.material-photo-upload > small { font-size:11px; color:#60758b; }
.material-photo-paste-hint {margin:0 20px 14px;padding:10px 12px;border:1px dashed #aac5e0;border-radius:8px;background:#f0f6fd;color:#294c70;font-size:12px;line-height:1.7;}
.material-photo-paste-hint kbd {padding:2px 5px;border:1px solid #c1d2e4;border-radius:4px;background:#fff;color:#183d60;font:inherit;font-weight:600;}
.material-photo-dialog > footer { display:flex; justify-content:flex-end; align-items:center; gap:8px; padding:14px 20px; background:#f6f9fc; border-top:1px solid #e0e9f2; }
.material-photo-dialog footer span { margin-right:auto; color:#577089; font-size:12px; }
.material-photo-dialog button { white-space:nowrap; cursor:pointer; }
.material-photo-dialog button:disabled { cursor:wait; }
.material-photo-dialog svg,.material-photo-mobile-button svg { width:16px; height:16px; vertical-align:middle; margin-right:5px; }
.material-photo-camera { display:none; }
.material-photo-dialog [hidden] { display:none !important; }
@media (max-width:850px), (pointer:coarse) {
  .material-photo-camera { display:inline-flex; align-items:center; }
}
@media (max-width:850px) {
  .material-photo-paste-hint {display:none;}
  #moduleView .material-photo-label-wrap {display:grid;grid-template-columns:minmax(0,1fr) 44px;align-items:center;gap:4px;}
  #moduleView .material-photo-status-badge {display:none;}
  #moduleView .material-photo-label-wrap .material-photo-name {min-width:0;white-space:normal;overflow-wrap:anywhere;text-overflow:clip;}
  #moduleView .material-photo-mobile-button {grid-column:2;grid-row:1;justify-self:end;display:inline-flex;align-items:center;justify-content:center;width:44px !important;min-width:44px !important;height:44px !important;min-height:44px !important;margin:0 !important;padding:6px !important;border:0 !important;border-radius:8px;background:transparent !important;color:#195f9c;font-size:12px;cursor:pointer;box-shadow:none !important;}
  #moduleView .material-photo-mobile-button svg {width:18px;height:18px;margin:0;}
  #moduleView .material-photo-icon-bubble {display:inline-flex;align-items:center;justify-content:center;flex:0 0 32px;width:32px;height:32px;border:1px solid #a4c7e8;border-radius:8px;background:#eaf3ff;}
  #moduleView .material-photo-mobile-button.no-photo {color:#6c8196;}
  #moduleView .material-photo-mobile-button.no-photo .material-photo-icon-bubble {border:1px dashed #9bafc1;background:#f3f6f9;}
  #moduleView .material-photo-mobile-button:disabled {opacity:1 !important;color:#8b9bad;cursor:default;}
  .material-photo-name.is-clickable { text-decoration:none; pointer-events:none; color:inherit; }
  .material-photo-dialog > header { padding:14px; }
  .material-photo-dialog header h2 { font-size:16px; }
  .material-photo-stage { margin:12px 12px 0; min-height:180px; height:42dvh; }
  .material-photo-upload { padding:0 12px 12px; }
  .material-photo-dialog > footer { padding:12px; flex-wrap:wrap; }
  .material-photo-dialog footer span { flex:1 1 100%; }
  /* Mobile card lists already flow naturally; do not constrain them to desktop table heights. */
  [data-erp-design] .vendor-mobile-list[data-vendor-mobile-mode="card"] .rs-table-height-resizable {
    height:auto !important; min-height:0 !important; margin-bottom:0 !important;
  }
}

#moduleView .material-photo-gallery-button {display:inline-flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap;}
#moduleView .material-photo-gallery-button svg {width:17px;height:17px;flex:0 0 17px;}
dialog.material-photo-gallery-dialog {width:min(980px,calc(100vw - 32px));max-width:none;max-height:calc(100dvh - 32px);padding:0;border:1px solid #d4e1ef;border-radius:14px;background:#fff;color:#23415d;overflow:hidden;box-sizing:border-box;}
dialog.material-photo-gallery-dialog[open] {display:flex;flex-direction:column;}
.material-photo-gallery-dialog::backdrop {background:rgba(12,34,53,.48);}
.material-photo-gallery-dialog > header {display:flex;align-items:center;justify-content:space-between;gap:14px;padding:17px 20px;background:linear-gradient(110deg,#10395f,#176493);color:#fff;flex-shrink:0;}
.material-photo-gallery-dialog header > div {min-width:0;}
.material-photo-gallery-dialog header small {font-size:10px;color:#b2d4f4;letter-spacing:.08em;}
.material-photo-gallery-dialog header h2 {margin:4px 0;font-size:19px;color:#fff;}
.material-photo-gallery-dialog header p {margin:0;color:#d2e4f5;font-size:12px;overflow-wrap:anywhere;}
.material-photo-gallery-dialog header button {flex:0 0 36px;width:36px;height:36px;padding:0;border:1px solid #ffffff55;border-radius:50%;background:#ffffff10;color:#fff;font-size:23px;}
.material-photo-gallery-meta {display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;padding:13px 20px 0;flex-shrink:0;font-size:12px;color:#57728c;}
.material-photo-gallery-meta strong {color:#23415d;font-size:13px;}
.material-photo-gallery-scroll {min-height:120px;max-height:calc(100dvh - 248px);overflow:auto;overscroll-behavior:contain;padding:14px 20px 20px;}
.material-photo-gallery-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;}
.material-photo-gallery-dialog .material-photo-gallery-card {display:block;min-width:0;width:100%;padding:0;border:1px solid #d3e0ed;border-radius:10px;background:#fff;color:#193f62;text-align:left;white-space:normal;overflow:hidden;box-shadow:none;}
.material-photo-gallery-card:hover {border-color:#4389c7;box-shadow:0 3px 12px #164b7020;}
.material-photo-gallery-preview {position:relative;display:flex;align-items:center;justify-content:center;aspect-ratio:1;background:#f1f4f7;border-bottom:1px solid #dce6f0;}
.material-photo-gallery-preview img {display:block;width:100%;height:100%;object-fit:contain;position:absolute;inset:0;}
.material-photo-gallery-placeholder {font-size:12px;color:#6d8296;text-align:center;padding:18px;}
.material-photo-gallery-caption {display:block;padding:12px;}
.material-photo-gallery-caption strong {display:block;font-size:14px;line-height:1.5;min-height:42px;overflow-wrap:anywhere;}
.material-photo-gallery-caption small {display:block;margin-top:4px;font-size:12px;color:#56728e;overflow-wrap:anywhere;}
.material-photo-gallery-empty {padding:45px 15px;text-align:center;color:#617d96;font-size:14px;}
.material-photo-gallery-dialog > footer {display:flex;align-items:center;justify-content:space-between;gap:12px;flex-shrink:0;padding:12px 20px;border-top:1px solid #dce6f0;background:#f6f9fc;}
.material-photo-gallery-dialog footer > span {font-size:12px;color:#57728c;}
.material-photo-gallery-dialog footer > div {display:flex;gap:8px;flex-wrap:wrap;}
.material-photo-gallery-dialog button {cursor:pointer;font-family:inherit;}
.material-photo-gallery-dialog button:disabled {cursor:default;opacity:.5;}
.material-photo-gallery-dialog [hidden] {display:none !important;}
@media(max-width:850px) {
  #moduleView .material-photo-gallery-button {display:inline-flex;min-height:40px;}
  .material-photo-gallery-scroll {padding:12px;max-height:calc(100dvh - 280px);}
  .material-photo-gallery-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
  .material-photo-gallery-dialog > footer {padding:12px;flex-wrap:wrap;}
  .material-photo-gallery-caption {padding:9px;}
  .material-photo-gallery-caption strong {font-size:13px;}
}
