/* V1.10: galería contenida en cada ficha. Miniaturas y originales se cargan por separado. */
.professional-unit{min-width:0;width:100%;container-type:inline-size;align-self:start}
.professional-unit>.professional-card{width:100%;box-sizing:border-box}
.professional-gallery{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;width:100%;min-width:0;margin:16px 0 0}
.gallery-item{min-width:0;width:100%;margin:0}
.gallery-image{display:block;width:100%;aspect-ratio:1;overflow:hidden;border:1px solid var(--line);border-radius:15px;background:var(--field);color:var(--text)}
.gallery-image img{display:block;width:100%;height:100%;object-fit:cover;transition:filter .12s}
.gallery-image:hover img{filter:brightness(1.06)}
.gallery-image:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
.gallery-item figcaption{font-size:12px;line-height:1.4;margin:7px 2px 0;color:var(--muted);overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.gallery-compact{gap:8px;margin-top:12px}.gallery-compact .gallery-image{border-radius:12px}
.app-content .public-profile{max-width:880px;width:100%;margin-inline:auto;box-sizing:border-box;border-radius:22px;padding:clamp(16px,3vw,28px)}
.public-profile .professional-card{--portrait:clamp(74px,9vw,92px);gap:12px 16px;box-shadow:none;border:0;padding:0}
.public-profile .professional-summary h3{font-size:25px}
.public-profile .professional-skill{font-size:15px}
.public-profile .availability{font-size:12px}
.profile-gallery{width:100%;min-width:0;container-type:inline-size;margin:25px 0}
.profile-gallery h2{margin-bottom:14px}
.gallery-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;flex-wrap:wrap}
.gallery-heading h2{margin:0 0 8px}.gallery-heading p{margin:0;line-height:1.5}
.gallery-quota{display:flex;align-items:center;gap:12px;padding:9px 13px;border-radius:12px;border:1px solid var(--line);color:var(--text);background:var(--field);font-size:13px}
.gallery-quota strong{font-size:18px;white-space:nowrap}
.gallery-manager{scroll-margin-top:20px}
.picture-heading{display:flex;align-items:center;gap:16px;min-width:0}
.picture-heading>div{min-width:0;overflow-wrap:anywhere}
.picture-heading .professional-avatar{flex:none}
.picture-heading h2,.picture-heading p{margin:0 0 4px}.picture-heading small,.picture-form>small{color:var(--muted)}
.professional-avatar.has-preview>:not(canvas){display:none}
.picture-form{display:flex;align-items:end;flex-wrap:wrap;gap:8px 15px;margin-block-start:15px}
.picture-form .picture-framing{display:flex;align-items:center;gap:5px;width:auto;max-width:100%;margin:0;padding:0;border:0}
.picture-framing legend,.picture-form .file-select{font-size:13px;margin:0}
.picture-framing legend{margin-block-end:6px}
.picture-form .picture-framing label{display:inline-flex;flex-direction:row;align-items:center;gap:6px;margin:0;padding:6px 11px;min-height:44px;box-sizing:border-box;border:1px solid var(--line);border-radius:12px;cursor:pointer}
.picture-form .picture-framing input{margin:0;width:16px;min-height:0;height:16px;accent-color:var(--accent)}
.picture-framing label:has(:checked){border-color:var(--accent);background:var(--rose)}
.picture-form .file-select{flex:1 1 200px;max-width:340px}.picture-form>small{flex-basis:100%;font-size:12px}
.picture-form button,.picture-remove button{min-height:44px}
.picture-remove{margin-block-start:10px}
@media(max-width:480px){
 .picture-form .file-select{flex:1 0 100%;max-width:100%}.picture-form>small{flex:1 1 125px}
}
.gallery-upload{display:grid;grid-template-columns:minmax(180px,1fr) minmax(180px,1fr) auto;gap:14px;align-items:end;padding:18px;border:1px solid var(--line-soft);background:var(--surface-raised);border-radius:15px;margin:18px 0}
.gallery-upload>p{grid-column:1/-1;margin:0;font-size:12px;line-height:1.5;color:var(--muted)}
.gallery-upload label{margin:0}.gallery-upload button{min-height:46px}
.gallery-upload input[type=file],.gallery-replace input[type=file]{font-size:13px;padding:9px;max-width:100%}
.file-select{position:relative;display:block;min-width:0}
.file-picker{display:flex;align-items:center;gap:10px;min-height:46px;margin-top:6px;padding:7px;border:1px solid var(--line);border-radius:8px;background:var(--field);font-size:12px;color:var(--muted);min-width:0}
.file-picker-button{padding:7px 9px;background:var(--rose);border-radius:6px;color:var(--accent);flex-shrink:0}
.file-picker>[data-file-name]{overflow-wrap:anywhere;min-width:0}
.file-select .native-upload{position:absolute!important;inset-inline:0;bottom:0;top:auto;z-index:1;height:46px;opacity:0;margin:0;cursor:pointer}
.file-select:focus-within .file-picker{outline:3px solid var(--accent);outline-offset:2px}
.file-select:has(input:disabled) .file-picker{opacity:.55}
.gallery-feedback:not(:empty){padding:9px;border-radius:8px;background:var(--rose);color:var(--text);overflow-wrap:anywhere}
.gallery-retained{background:var(--rose);padding:12px;border-radius:12px;line-height:1.6}
.gallery-owner-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;align-items:start}
.gallery-owner-item{border:1px solid var(--line);border-radius:16px;padding:12px;min-width:0;background:var(--surface)}
.gallery-owner-item .professional-gallery{grid-template-columns:1fr;margin-top:0}
.gallery-owner-item.image-retained{border-style:dashed}
.gallery-retained-label{font-size:12px;color:var(--muted)}
.gallery-image-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.gallery-image-actions form{margin:0;flex:1;min-width:100px}
.gallery-image-actions button{font-size:12px!important;width:100%;padding:8px!important}
.gallery-replace{margin-top:12px;font-size:13px}.gallery-replace summary{font-size:13px;cursor:pointer;min-height:32px;padding:5px}
.gallery-replace input{font-size:13px!important}.gallery-replace label{margin-top:10px}
.image-viewer{width:min(1120px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:94svh;padding:18px;border-radius:18px;border:1px solid var(--line);background:var(--surface);color:var(--text);box-shadow:0 25px 100px #0007;overflow:auto}
.image-viewer::backdrop{background:#080306d9;backdrop-filter:blur(5px)}
.viewer-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.viewer-heading h2{font:700 18px/1.3 YSQDejaVu,sans-serif;margin:0;color:var(--text)}
.viewer-actions{display:flex;gap:8px;flex-wrap:wrap}
.image-viewer button{min-height:44px;padding:8px 12px;border:1px solid var(--line);border-radius:10px;background:var(--field);color:var(--text);font:inherit;cursor:pointer}
.viewer-media{margin:14px 0;background:var(--field);border:1px solid var(--line-soft);border-radius:12px;min-height:120px;max-height:calc(94svh - 170px);overflow:auto;display:grid;place-items:center}
.viewer-media img{display:block;width:auto;height:auto;max-width:100%;max-height:calc(94svh - 174px);object-fit:contain}
.image-viewer[data-zoom=true] .viewer-media{place-items:start}
.image-viewer[data-zoom=true] .viewer-media img{max-width:none;max-height:none}
.viewer-footer{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap;font-size:13px}
.viewer-caption{margin:0;flex-basis:100%;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere}
.viewer-status{font-size:13px;color:var(--muted)}
.work .sound-settings{margin-bottom:18px}
.work .sound-settings h2{margin-top:0}
.work .sound-toggle[aria-checked=true]{background:var(--available-bg);color:var(--available);border-color:var(--available)}
.work .sound-toggle[aria-checked=false]{background:var(--field);color:var(--muted)}
.sound-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.sound-hint{font-size:12px}
@container (min-width:700px){.professional-gallery.gallery-many{grid-template-columns:repeat(5,minmax(0,1fr))}}
@media(max-width:850px){.gallery-upload{grid-template-columns:1fr 1fr}.gallery-upload button{grid-column:1/-1}.gallery-owner-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.professional-gallery{gap:7px}.gallery-image{border-radius:10px}.public-profile .professional-summary h3{font-size:21px}.public-profile .professional-skill{font-size:13px}.gallery-upload{grid-template-columns:1fr;padding:13px}.gallery-owner-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.gallery-owner-item{padding:8px}.gallery-image-actions{gap:6px}.gallery-heading{gap:12px}.image-viewer{padding:12px;border-radius:14px}.viewer-heading h2{font-size:16px}.image-viewer button{font-size:12px;padding:8px}.viewer-actions{gap:6px}.viewer-media{max-height:65svh}.viewer-media img{max-height:65svh}.viewer-footer{font-size:12px}.gallery-compact .gallery-item figcaption{font-size:10px}}
@media(prefers-reduced-motion:reduce){.gallery-image img{transition:none}}
.profile-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}
.profile-shortcuts .button { margin: 0; max-width: 100%; }
/* La miniatura admite arrastre; el resto de la tarjeta permite desplazar la página. */
.gallery-owner-grid.can-reorder .gallery-image {cursor:grab;touch-action:none;user-select:none;-webkit-touch-callout:none}
.gallery-owner-item.gallery-dragging .gallery-image {cursor:grabbing;opacity:.65}
.gallery-owner-item.gallery-drop-target {outline:3px solid var(--accent, #dc1e49);outline-offset:-3px}
.gallery-position:not([hidden]) {display:flex;align-items:center;gap:.6rem}
.gallery-position select {width:auto;min-height:44px}
#gallery-order-status:empty {display:none}
