
.material-gallery{margin-top:18px;min-width:0}
.material-gallery-content{display:flex;flex-direction:column;gap:11px;padding:clamp(9px,2vw,18px);min-width:0;background:var(--well);border:1px solid var(--rule);border-radius:14px}
.material-gallery-header,.material-gallery-meta,.gallery-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.material-gallery-header,.material-gallery-meta{justify-content:space-between}
.material-gallery-header h3{margin:0;font-size:clamp(17px,2.3vw,23px)}
.material-gallery-content [hidden]{display:none!important}
.material-gallery-stage{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:clamp(4px,1vw,12px);align-items:center;background:var(--base);border-radius:9px;min-width:0;padding:clamp(3px,1vw,10px)}
.material-gallery-image{position:relative;min-width:0;text-align:center;touch-action:pan-y pinch-zoom}
.gallery-arrow{width:clamp(34px,5.5vw,48px);height:clamp(42px,5.5vw,48px);padding:0;border:1px solid var(--edge);border-radius:50%;background:var(--surface);color:var(--ink);font-size:clamp(18px,3vw,25px);line-height:1}
.gallery-arrow:hover,.gallery-thumb:hover{border-color:var(--accent);color:var(--accent)}
.gallery-arrow:disabled{opacity:.45;cursor:default}
.gallery-preview{display:flex;align-items:center;justify-content:center;width:100%;height:clamp(160px,43vw,530px);background:transparent;border:0;border-radius:7px;padding:0;cursor:zoom-in}
.gallery-preview img{display:block;width:100%;height:100%;object-fit:contain;user-select:none;-webkit-user-drag:none}
.gallery-preview:disabled{pointer-events:none;opacity:1;cursor:default}
.gallery-unavailable{position:absolute;inset:0;display:grid;place-items:center;margin:0;padding:8px;pointer-events:none}
.gallery-status{display:flex;align-items:baseline;gap:5px 10px;flex-wrap:wrap;margin:0;min-width:0}
.gallery-status strong{overflow-wrap:anywhere}
.gallery-counter{white-space:nowrap;color:var(--mute);font-variant-numeric:tabular-nums}
.gallery-actions .button,.material-gallery-header .button{min-height:40px}
.material-gallery-thumbnails{display:flex;gap:8px;overflow:auto;padding:6px;overscroll-behavior-inline:contain;background:var(--base);border-radius:9px}
.gallery-thumb{display:block;flex:none;width:clamp(70px,14vw,116px);aspect-ratio:1.6;padding:3px;border:2px solid var(--rule);border-radius:7px;background:var(--well)}
.gallery-thumb[aria-current="true"]{border-color:var(--accent)}
.gallery-thumb img{display:block;width:100%;height:100%;object-fit:contain;border-radius:3px}
.gallery-thumb:focus-visible{outline-offset:2px}
.material-lightbox{width:min(1360px,calc(100vw - 24px));height:min(900px,calc(100dvh - 24px));max-width:none;max-height:none;overflow:auto;overscroll-behavior:contain}
.material-lightbox .material-gallery-content{flex:1;border:0;border-radius:0}
.material-lightbox .material-gallery-stage{flex:1;min-height:150px;position:relative}
.material-lightbox .material-gallery-image{height:100%;min-height:0;position:relative}
.material-lightbox .gallery-preview{position:absolute;inset:0;height:100%}
@media(max-width:480px){
  .material-gallery-content{gap:8px}
  .material-gallery-stage{grid-template-columns:1fr 1fr}
  .material-gallery-image{grid-column:1/-1;grid-row:1}
  .material-gallery-stage .gallery-arrow:first-child{grid-column:1;grid-row:2;justify-self:start}
  .material-gallery-stage .gallery-arrow:last-child{grid-column:2;grid-row:2;justify-self:end}
  .gallery-preview{height:clamp(160px,49vw,235px)}
  .material-lightbox .material-gallery-stage{grid-template-rows:minmax(0,1fr) auto}
  .material-gallery-meta{align-items:flex-start;flex-direction:column}
  .material-gallery-thumbnails{gap:6px}
  .material-lightbox{width:calc(100vw - 12px);height:calc(100dvh - 12px)}
}

