*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:#f8fafc;color:#17202e;font-family:Inter,"Segoe UI",Arial,sans-serif;-webkit-font-smoothing:antialiased}button,input,select{font:inherit}button{cursor:pointer}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #79b5ff;outline-offset:2px}.hidden{display:none!important}.topbar{height:64px;position:sticky;top:0;z-index:5;display:flex;align-items:center;justify-content:space-between;gap:15px;padding:0 clamp(18px,3.2vw,60px);background:#ffffffed;border-bottom:1px solid #e9edf2;backdrop-filter:blur(16px)}.brand{display:flex;align-items:center;text-decoration:none;color:#142137;font-size:24px;letter-spacing:-1.4px}.brand-mark{color:#2e79f7;font-size:28px;margin-right:10px}.dot{color:#387eff}.top-actions{display:flex;align-items:center;gap:12px}.search{display:flex;align-items:center;gap:10px;border:1px solid #e5eaf1;border-radius:12px;background:#f6f8fb;padding:0 14px;color:#8390a1}.search span{font-size:26px}.search input{border:0;background:transparent;min-width:160px;width:240px;height:39px;outline:0}.icon-button{border:0;background:transparent;color:#53627b;font-size:24px;border-radius:11px;width:41px;height:41px}.icon-button:hover,.view:hover{background:#edf3fc}.button{border:1px solid #dce3ec;border-radius:11px;padding:10px 16px;background:#fff;color:#203047;font-weight:600}.button:hover{filter:brightness(.97)}.button.primary{background:#2478f8;color:white;border-color:#2478f8}.button.danger{color:#be3048;border-color:#f4cfd6}main{padding:30px clamp(18px,3.2vw,60px) 90px;max-width:2400px;margin:auto}.heading{display:flex;justify-content:space-between;align-items:flex-end;gap:20px;margin-bottom:22px}.eyebrow{font-size:11px;font-weight:800;letter-spacing:2px;color:#4381d3}.heading h1{font-size:clamp(29px,3vw,38px);letter-spacing:-1.5px;margin:9px 0 5px}.heading h1 span{font-size:14px;vertical-align:middle;font-weight:500;color:#8b97a6;letter-spacing:0}.heading p{margin:0;color:#7f8999;font-size:14px}.view-controls{display:flex;gap:4px;padding:4px;background:#edf1f6;border-radius:12px}.view{border:0;background:transparent;color:#8090a5;padding:7px 11px;border-radius:9px;font-size:20px}.view.selected{background:white;color:#347cf0;box-shadow:0 1px 4px #1d345010}.filters{display:flex;gap:8px;overflow:auto;scrollbar-width:none;margin-bottom:23px;padding-bottom:3px}.chip{border:1px solid #e0e7ef;padding:9px 17px;background:white;border-radius:999px;color:#56657a;white-space:nowrap;font-size:13px;font-weight:600}.chip.active{background:#192a45;color:#fff;border-color:#192a45}.gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:12px;align-items:start}.gallery.justified{display:flex;flex-wrap:wrap;gap:12px}.card{display:block;position:relative;border:0;padding:0;overflow:hidden;background:#e9eef5;border-radius:11px;min-width:0;box-shadow:0 1px 2px #27344a0a;text-align:left}.gallery.justified .card{height:230px;flex:var(--aspect) 1 250px}.gallery:not(.justified) .card{aspect-ratio:4/3}.card img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .32s}.card:hover img{transform:scale(1.035)}.photo-label{position:absolute;bottom:0;left:0;right:0;color:white;font-size:12px;padding:24px 12px 10px;background:linear-gradient(transparent,#0009);opacity:0;transition:opacity .2s;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.card:hover .photo-label,.card:focus-visible .photo-label{opacity:1}.empty{text-align:center;padding:85px 15px;color:#8793a3}.empty h2{color:#26344a;font-size:21px}.empty-icon{font-size:62px;color:#a7b6cb}.modal{width:min(540px,calc(100vw - 28px));padding:0;border:1px solid #e3eaf4;border-radius:20px;box-shadow:0 26px 90px #091c3740;color:#1d2b3e}.modal::backdrop{background:#0d182c8a;backdrop-filter:blur(3px)}.modal-head{display:flex;align-items:center;justify-content:space-between;padding:18px 23px 12px;border-bottom:1px solid #edf0f5}.modal-head h2{font-size:19px;margin:0;letter-spacing:-.5px}#modalBody{padding:22px 24px 25px}.field{display:grid;gap:7px;margin-bottom:15px;font-size:13px;font-weight:600;color:#4c5d71}.field input,.field select{padding:12px 12px;border:1px solid #dbe3ed;border-radius:10px;min-width:0;background:#fff}.form-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}.fine{font-size:12px;color:#8693a4;line-height:1.55}.admin-tabs{display:flex;gap:8px;margin-bottom:18px;flex-wrap:wrap}.admin-tabs button{border:1px solid #e2e8f1;border-radius:10px;background:#f7f9fc;padding:9px 12px;color:#4f6077}.admin-tabs button.active{background:#e7f0ff;border-color:#bdD5fe;color:#1e69d7}.row{display:flex;gap:8px;align-items:center;justify-content:space-between;margin:8px 0}.row .button{padding:6px 10px}.viewer{max-width:none;max-height:none;width:100vw;height:100vh;padding:0;margin:0;background:#0c111c;border:0;color:#fff}.viewer::backdrop{background:#0c111c}.viewer img{display:block;width:100%;height:100%;object-fit:contain;padding:55px 75px 77px}.close-viewer{position:absolute;top:12px;right:20px;background:#ffffff18;border:0;color:#fff;border-radius:50%;width:43px;height:43px;font-size:27px}.nav{position:absolute;top:45%;background:#ffffff14;border:0;color:white;font-size:42px;width:50px;height:65px;border-radius:10px}.prev{left:12px}.next{right:12px}.viewer-bottom{position:absolute;bottom:14px;left:30px;right:30px;display:flex;justify-content:space-between;gap:20px;align-items:center;color:#d1d9e4;font-size:14px}#toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);background:#192a45;color:#fff;border-radius:12px;padding:12px 20px;display:none;z-index:20;max-width:92vw;box-shadow:0 8px 30px #0003}@media(max-width:620px){.topbar{height:58px}.brand{font-size:21px}.brand-mark{font-size:23px}.search{padding:0 7px}.search input{width:95px;min-width:50px;font-size:12px}.heading{align-items:center}.heading p{max-width:230px;font-size:12px}.view-controls{display:none}.gallery,.gallery.justified{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.gallery .card,.gallery.justified .card{height:auto;aspect-ratio:1/1;flex:auto;border-radius:8px}.viewer img{padding:55px 4px 85px}.nav{top:auto;bottom:19px;width:43px;height:44px;font-size:28px}.prev{left:9px}.next{right:9px}.viewer-bottom{bottom:27px;left:62px;right:62px;font-size:11px;text-align:center;justify-content:center}.viewer-bottom .button{padding:5px 7px}}
/* v0.2: álbumes y controles */
.filter-divider{display:inline-flex;align-items:center;padding:0 10px;color:#8896aa;font-size:12px;border-left:1px solid #364051;margin-left:7px}
.album-fieldset{display:flex;flex-wrap:wrap;gap:10px 18px;margin:14px 0;border:1px solid #384558;border-radius:12px;padding:12px}.album-fieldset legend{padding:0 8px}.album-fieldset label{display:flex;align-items:center;gap:7px;font-size:13px;cursor:pointer}

.album-choice{display:inline-flex;align-items:center;gap:.45rem;padding:.45rem .65rem;margin:.3rem;border:1px solid #576174;border-radius:9px}

/* Gestor de carga y editor */
.work-modal{width:min(1000px,96vw);max-height:92vh}.drop-photos{border:2px dashed #637793;border-radius:18px;padding:44px 18px;display:flex;flex-direction:column;align-items:center;gap:10px;text-align:center;cursor:pointer;background:rgba(110,130,170,.08)}.drop-photos.dragover,.drop-photos:focus-visible{border-color:#49a9ff;background:rgba(80,160,240,.15);outline:none}.drop-photos span{font-size:.88rem;color:#9daabd}.upload-toolbar{display:flex;align-items:end;justify-content:space-between;gap:15px;flex-wrap:wrap;margin:18px 0}.upload-toolbar .field{flex:1;min-width:180px}.upload-rows{display:grid;gap:8px;margin-top:10px;max-height:38vh;overflow:auto}.upload-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(100px,190px) 120px auto;align-items:center;gap:10px;border:1px solid rgba(140,160,190,.22);border-radius:10px;padding:8px}.upload-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.upload-row progress{width:100%;accent-color:#43b6ff}.editor-layout{display:grid;grid-template-columns:minmax(0,1fr) 255px;gap:22px;align-items:start}.editor-preview{background:#0b0f15;border-radius:14px;min-height:280px;display:grid;place-items:center;padding:12px;overflow:hidden}.editor-preview canvas{display:block;max-width:100%;max-height:60vh;width:auto;height:auto}.editor-tools{display:grid;gap:14px}.tool-row{display:flex;gap:6px;flex-wrap:wrap}.editor-tools input[type=range]{width:100%}@media(max-width:720px){.editor-layout{grid-template-columns:1fr}.upload-row{grid-template-columns:minmax(0,1fr) auto}.upload-row progress{grid-column:1/-1;grid-row:2}.editor-preview{min-height:160px}.work-modal{width:98vw}}

/* Marca de agua: controles y previsualización */

.wm-layout{display:grid;grid-template-columns:minmax(210px,1fr) minmax(260px,1.35fr);gap:20px;margin-top:15px}.wm-controls{min-width:0}.wm-preview-col{min-width:0}.wm-preview{position:relative;width:100%;aspect-ratio:4/3;background:linear-gradient(145deg,#485361,#243348 55%,#788a94);background-size:contain;background-position:center;background-repeat:no-repeat;border-radius:12px;overflow:hidden;margin:8px 0;container-type:inline-size;touch-action:pan-y}.wm-overlay{position:absolute;top:10px;left:10px;cursor:grab;user-select:none;touch-action:none;text-shadow:0 1px 2px #0008;max-width:100%;overflow:hidden;line-height:1.25;outline-offset:4px}.wm-overlay:active{cursor:grabbing}.wm-overlay img{display:block;max-width:100%;height:auto;pointer-events:none}.wm-controls .form-actions{flex-wrap:wrap}@media(max-width:680px){.wm-layout{grid-template-columns:1fr}.wm-preview{aspect-ratio:4/3}}

/* v0.6: interfaz fotográfica compacta. Preservar la proporción íntegra de cada imagen. */
main{padding-top:14px}
.gallery-toolbar{display:flex;align-items:center;justify-content:flex-end;gap:12px;min-height:36px;margin-bottom:10px}
.gallery-count{margin-right:auto;font-size:12px;color:#7d899a;font-weight:600}
.filters{margin:0 0 12px;padding:0 0 3px;min-height:0}
.view-controls{padding:3px}
.view{padding:5px 10px}
.gallery.justified{display:block;columns:260px;column-gap:12px}
.gallery.justified .card{display:block;break-inside:avoid;-webkit-column-break-inside:avoid;width:100%;height:auto;aspect-ratio:var(--aspect,1);margin:0 0 12px;flex:none;vertical-align:top}
.gallery:not(.justified){display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,260px),1fr));gap:12px;align-items:start}
.gallery:not(.justified) .card{display:block;width:100%;height:auto;aspect-ratio:var(--aspect,1)}
.gallery .card img{width:100%;height:100%;object-fit:contain}
.gallery .card{background:#e9eef5}
@media(max-width:620px){main{padding-top:8px}.gallery-toolbar{margin-bottom:6px;min-height:35px}.gallery.justified{display:block;columns:145px;column-gap:8px}.gallery.justified .card{height:auto;aspect-ratio:var(--aspect,1);margin-bottom:8px;border-radius:8px}.gallery:not(.justified){grid-template-columns:repeat(auto-fill,minmax(min(100%,145px),1fr));gap:8px}.gallery:not(.justified) .card{height:auto;aspect-ratio:var(--aspect,1)}.view-controls{display:flex}.filters{margin-bottom:9px}}
@media(prefers-reduced-motion:reduce){.card img{transition:none}}

/* Fotopix v0.7 — organización y jerarquía visual de administración */
.modal.settings-modal{width:min(1020px,calc(100vw - 32px));max-width:none;max-height:min(88vh,850px);overflow:hidden;display:flex;flex-direction:column}
.modal.settings-modal:not([open]){display:none}
.settings-modal .modal-head{flex:0 0 auto;padding:17px 24px;background:#fff}
.settings-modal #modalBody{padding:0;overflow:auto;min-height:0;flex:1}
.settings-layout{display:grid;grid-template-columns:216px minmax(0,1fr);min-height:440px}
.settings-modal .admin-tabs{display:flex;flex-direction:column;gap:4px;align-content:stretch;flex-wrap:nowrap;background:#f6f8fb;border-right:1px solid #e7ecf2;padding:22px 12px;margin:0}
.settings-nav-label{display:block;padding:16px 12px 6px;color:#8a98a9;font-weight:750;font-size:10px;letter-spacing:1.2px}
.settings-nav-label:first-child{padding-top:2px}
.settings-modal .admin-tabs button{display:flex;align-items:center;gap:11px;text-align:left;width:100%;border:1px solid transparent;background:transparent;color:#485a70;font-size:13px;font-weight:600;padding:11px 12px;border-radius:10px;min-height:42px;transition:background .13s}
.settings-modal .admin-tabs button:hover{background:#e9eef6}
.settings-modal .admin-tabs button.active{background:#e5efff;color:#1c67d9;border-color:#cfe0fc}
.settings-icon{display:inline-grid;place-items:center;width:21px;font-size:17px;flex:0 0 21px}
.settings-main{min-width:0;padding:24px 29px 30px}
.settings-section-header{margin-bottom:24px;border-bottom:1px solid #edf0f5;padding-bottom:19px}
.settings-kicker{font-size:10px;letter-spacing:1.4px;color:#497dc5;font-weight:800;margin-bottom:10px}
.settings-section-header h3{font-size:23px;letter-spacing:-.7px;margin:0 0 6px;color:#15263e}
.settings-section-header p{font-size:13px;color:#7c8a9e;margin:0;line-height:1.55}
.settings-main .field{max-width:640px}.settings-main .row{padding:10px 2px;border-bottom:1px solid #edf0f5}
.settings-main .button{min-height:40px}.settings-main form .button.primary{margin-top:4px}
.settings-main #updaterForm input[type=file]{width:100%;max-width:100%;padding:14px;background:#f8fafd;border:1px dashed #aabbcf}
.operation-modal{width:min(430px,calc(100vw - 28px));max-width:100%;border-radius:18px}
.operation-body{padding:20px 24px 24px}.operation-body p{font-size:14px;line-height:1.6;margin:0 0 24px;color:#52627a;overflow-wrap:anywhere}
.operation-actions{display:flex;justify-content:flex-end;gap:10px}.operation-actions .button{min-width:100px}
.operation-actions .danger{background:#c83348;color:#fff;border-color:#c83348}
@media(max-width:740px){.modal.settings-modal{width:calc(100vw - 16px);max-height:94vh;border-radius:14px}.settings-layout{display:block;min-height:0}.settings-modal .admin-tabs{position:sticky;top:0;z-index:1;display:flex;flex-direction:row;gap:5px;overflow-x:auto;padding:10px 12px;scrollbar-width:thin;white-space:nowrap;border-right:0;border-bottom:1px solid #e7ecf2}.settings-modal .settings-nav-label{display:none}.settings-modal .admin-tabs button{width:auto;flex-shrink:0;padding:9px 11px;font-size:12px}.settings-main{padding:19px 17px 24px}.settings-section-header{margin-bottom:18px}}
@media(prefers-reduced-motion:reduce){.settings-modal .admin-tabs button{transition:none}}

/* v0.8: selección masiva y ordenación accesible */
.gallery-toolbar{flex-wrap:wrap}.select-mode,.order-mode{font-size:12px;padding:8px 13px}.bulk-bar,.order-tip{display:flex;align-items:center;gap:9px;flex-wrap:wrap;padding:11px 12px;margin:5px 0 13px;background:#eef4ff;border:1px solid #cbdcff;border-radius:12px;color:#263b5d;font-size:13px}.bulk-bar strong{margin-right:auto}.bulk-bar .button{padding:8px 11px}.bulk-select{display:flex;align-items:center;gap:6px;font-weight:600}.bulk-select select,.bulk-bar>select{min-height:38px;border-radius:9px;border:1px solid #c7d5e8;background:white;padding:6px 10px;max-width:190px}.gallery .card.is-selected{outline:4px solid #267cff;outline-offset:-4px}.gallery .card.is-selected:after{content:'✓';position:absolute;top:10px;right:10px;display:grid;place-items:center;width:29px;height:29px;background:#2478f8;color:white;border-radius:50%;font-size:16px;font-weight:800;box-shadow:0 2px 7px #0004}.gallery .card.is-ordering{cursor:grab}.gallery .card.is-ordering:active{cursor:grabbing}.order-tip .button:first-of-type{margin-left:auto}@media(max-width:620px){.bulk-bar{align-items:stretch}.bulk-bar strong{flex-basis:100%}.bulk-select{flex:1}.bulk-select select{min-width:120px}.gallery-toolbar{gap:7px}.select-mode,.order-mode{padding:8px}}

/* v0.9.0: controles contextuales, sin capas de navegación innecesarias */
.gallery .card{position:relative;overflow:hidden}.gallery .card .photo-open{display:block;border:0;padding:0;width:100%;height:100%;background:transparent;cursor:zoom-in;text-align:left;aspect-ratio:inherit}.gallery .card .photo-open img{height:100%;width:100%;object-fit:contain;display:block}.photo-actions{position:absolute;right:9px;top:9px;display:flex;gap:6px;z-index:2}.photo-actions button{width:38px;height:38px;display:grid;place-items:center;background:rgba(18,26,40,.80);border:1px solid #fff5;border-radius:10px;color:white;font-size:19px;backdrop-filter:blur(8px);cursor:pointer}.photo-actions .photo-delete:hover{background:#b7293d}.photo-actions .photo-edit:hover{background:#2679e8}.photo-actions .photo-check[aria-pressed=true]{background:#2478f8}.photo-actions button:focus-visible{outline:3px solid #78b7ff}.gallery .card.is-selected:after{display:none}.gallery .card.is-selected{outline:4px solid #2478f8;outline-offset:-4px}.edit-fullscreen{width:calc(100vw - 32px)!important;max-width:none!important;height:calc(100vh - 32px);max-height:none!important;display:flex;flex-direction:column}.edit-fullscreen:not([open]){display:none}.edit-fullscreen #workBody{flex:1;min-height:0;overflow:auto}.quick-edit-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,320px);gap:20px;min-height:100%;padding:15px}.quick-edit-preview{display:grid;place-items:center;background:#111923;border-radius:12px;min-height:300px}.quick-edit-preview img{display:block;max-width:100%;max-height:calc(100vh - 145px);object-fit:contain}.quick-edit-fields{padding:8px;overflow:auto}.quick-albums{max-height:160px;overflow:auto}.edit-fullscreen .editor-layout{grid-template-columns:minmax(0,1fr) 270px;min-height:100%;padding:15px}.edit-fullscreen .editor-preview{height:calc(100vh - 140px)}.edit-fullscreen .editor-preview canvas{max-height:calc(100vh - 175px)}@media(max-width:750px){.photo-actions{top:5px;right:5px;gap:4px}.photo-actions button{width:32px;height:34px;font-size:16px}.quick-edit-layout,.edit-fullscreen .editor-layout{grid-template-columns:1fr}.quick-edit-preview{min-height:180px}.quick-edit-preview img{max-height:52vh}.edit-fullscreen .editor-preview{height:auto}.edit-fullscreen .editor-preview canvas{max-height:52vh}}

/* v1.0: editor integrado y adaptativo */
.unified-fullscreen{width:calc(100vw - 24px)!important;height:calc(100dvh - 24px)!important;max-height:none!important}
.unified-fullscreen #workBody{flex:1;min-height:0;overflow:hidden}
.unified-editor{display:grid;grid-template-columns:minmax(0,1fr) minmax(290px,355px);height:100%;min-height:0}
.unified-stage{position:relative;min-width:0;min-height:0;background:#101722;display:grid;place-items:center;padding:14px;overflow:hidden}
.unified-stage canvas{display:block;width:auto;height:auto;max-width:100%;max-height:100%;object-fit:contain}
.unified-hint{position:absolute;bottom:12px;left:12px;color:#e1e8f5;background:#101722bb;padding:7px 10px;border-radius:8px;font-size:12px;pointer-events:none}
.unified-sidebar{min-width:0;min-height:0;display:flex;flex-direction:column;overflow-y:auto;border-left:1px solid #e5eaf2;background:#fff}
.unified-fields{padding:17px 18px;border-bottom:1px solid #e6eaf1;display:grid;gap:9px}.unified-fields h3{font-size:14px;margin:0 0 4px}.unified-fields details{border:1px solid #e2e9f2;border-radius:9px;padding:9px}.unified-fields summary{cursor:pointer;font-weight:600}.unified-fields .quick-albums{margin-top:9px}.unified-fields .tool-row .button{flex:1;white-space:nowrap}.unified-fields output{float:right;color:#697b94}.unified-fields input[type=range]{width:100%}
.unified-footer{margin-top:auto;padding:14px 18px;display:flex;gap:8px;flex-wrap:wrap;align-items:center;background:white;position:sticky;bottom:0;border-top:1px solid #e6eaf1}.unified-footer .fine{width:100%;margin:0}.unified-footer .button.primary{margin-left:auto}
@media(max-width:790px){.unified-fullscreen{width:calc(100vw - 8px)!important;height:calc(100dvh - 8px)!important}.unified-editor{grid-template-columns:1fr;grid-template-rows:minmax(210px,42%) minmax(0,1fr)}.unified-sidebar{border-left:0;border-top:1px solid #e5eaf2}.unified-stage{padding:8px}.unified-fields{padding:12px}}

/* Editor de recorte libre */
.crop-surface{position:relative;display:inline-grid;place-items:center;max-width:100%;max-height:100%;min-width:0;min-height:0}
.crop-surface canvas{touch-action:none;cursor:crosshair}
.crop-selection{position:absolute;border:2px solid #fff;outline:1px solid #246bff;box-shadow:0 0 0 9999px #0005;pointer-events:none;z-index:2}
.crop-selection.hidden{display:none}

/* v1.2: marquee y ajuste preciso del recorte */
.gallery{position:relative}.gallery-marquee{position:absolute;z-index:8;pointer-events:none;background:rgba(41,122,246,.17);border:1px solid #297af6;border-radius:4px;box-shadow:0 0 0 1px #fff9 inset}
.crop-numeric{border:1px solid #dce5f0;padding:10px;border-radius:10px;display:grid;gap:8px}.crop-numeric.hidden{display:none}.crop-input-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}.crop-input-grid label{font-size:11px;min-width:0}.crop-input-grid input{width:100%;min-width:0;padding:7px 4px;border:1px solid #ccd6e5;border-radius:7px;font-size:13px}.crop-numeric .tool-row{display:flex;gap:5px}.crop-numeric .tool-row button{flex:1}

/* v1.3.0: filas justificadas sin recortar ni deformar */
.gallery.justified{display:flex!important;flex-wrap:wrap;align-content:flex-start;align-items:flex-start;gap:10px;columns:auto!important}
.gallery.justified>.card{margin:0!important;break-inside:auto!important;aspect-ratio:auto!important;min-width:0;max-width:100%;overflow:hidden}
.gallery.justified .card img{width:100%;height:100%;object-fit:contain}
.gallery:not(.justified) .card img{object-fit:contain}
@media(max-width:620px){.gallery.justified{display:flex!important;gap:7px}.gallery.justified>.card{aspect-ratio:auto!important;height:auto}}
/* Tiradores redimensionables y desplazamiento directo en el recorte */
.crop-selection{pointer-events:auto;cursor:move;touch-action:none;box-shadow:0 0 0 9999px #0006;user-select:none}
.crop-handle{position:absolute;width:14px;height:14px;background:#fff;border:2px solid #2878f5;border-radius:4px;box-shadow:0 1px 4px #0006;transform:translate(-50%,-50%);touch-action:none}
.crop-handle-nw{left:0;top:0;cursor:nwse-resize}.crop-handle-n{left:50%;top:0;cursor:ns-resize}.crop-handle-ne{left:100%;top:0;cursor:nesw-resize}
.crop-handle-e{left:100%;top:50%;cursor:ew-resize}.crop-handle-se{left:100%;top:100%;cursor:nwse-resize}.crop-handle-s{left:50%;top:100%;cursor:ns-resize}
.crop-handle-sw{left:0;top:100%;cursor:nesw-resize}.crop-handle-w{left:0;top:50%;cursor:ew-resize}
@media(pointer:coarse){.crop-handle{width:20px;height:20px}}
@media(max-width:520px){.gallery:not(.justified){grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.top-actions{gap:5px}.unified-footer .button{padding:10px 12px}.unified-hint{font-size:11px;max-width:92%}}

/* Fotopix 1.4.0 - Diagnóstico de actualizaciones */
.updater-status{border:1px solid var(--border,#dbe3ec);border-radius:14px;padding:18px;margin-bottom:18px;background:var(--surface,#f8fafc)}
.update-kicker{font-size:11px;font-weight:700;letter-spacing:.09em;color:#64748b}
.update-version{font-size:25px;font-weight:750;letter-spacing:-.03em;margin:6px 0}
.upload-progress{margin:12px 0}.upload-progress progress{width:100%;height:10px;accent-color:#2878ec}.upload-progress #updateProgressText{font-size:13px;margin-bottom:7px}

/* Fotopix v1.4.1 — cabecera compacta, sin controles partidos */
.topbar{height:50px;min-height:50px;gap:12px;padding-inline:clamp(12px,2.2vw,32px)}
.brand{font-size:20px;letter-spacing:-1.05px;flex:0 0 auto;white-space:nowrap}
.brand-mark{font-size:21px;margin-right:6px;line-height:1}
.top-actions{gap:8px;min-width:0;flex:1;justify-content:flex-end}
.top-actions .search{width:clamp(155px,20vw,285px);min-width:0;flex:0 1 285px;border-radius:9px;padding-inline:10px;gap:6px}
.top-actions .search span{font-size:19px;line-height:1}
.top-actions .search input{width:100%;min-width:0;height:32px;font-size:13px;text-overflow:ellipsis}
.topbar .button.primary{display:inline-flex;align-items:center;justify-content:center;gap:4px;white-space:nowrap;padding:7px 11px;min-height:34px;border-radius:9px;line-height:1.1;font-size:13px}
.topbar .button.primary.hidden{display:none!important}
.topbar .upload-symbol{font-size:19px;line-height:0.75;font-weight:500}
.topbar .icon-button{flex:0 0 34px;width:34px;height:34px;font-size:22px}
@media(max-width:620px){
 .topbar{height:46px;min-height:46px;padding-inline:9px;gap:6px}
 .brand{font-size:18px;letter-spacing:-1px}
 .brand-mark{font-size:18px;margin-right:4px}
 .top-actions{gap:5px}
 .top-actions .search{flex:1 1 80px;width:auto;min-width:0;padding-inline:7px;gap:4px}
 .top-actions .search input{height:30px;font-size:12px}
 .top-actions .search span{font-size:17px}
 .topbar .button.primary{padding:6px 8px;min-height:32px;font-size:12px;gap:3px}
 .topbar .icon-button{flex-basis:32px;width:32px;height:32px;font-size:20px}
}
@media(max-width:370px){
 .brand{font-size:16px}.brand-mark{font-size:16px;margin-right:3px}
 .topbar{gap:4px;padding-inline:7px}.top-actions{gap:3px}
 .topbar .button.primary{padding-inline:7px}
 .top-actions .search input{font-size:11px}
}

/* v1.4.2 — mosaico proporcional y administración móvil compacta.
   Sobrescribe las reglas heredadas que forzaban 1:1 en el contenedor interior. */
.gallery.justified{display:flex!important;flex-wrap:wrap!important;align-content:flex-start!important;align-items:flex-start!important;justify-content:flex-start!important;gap:10px!important;columns:auto!important}
.gallery.justified>.card{display:block!important;position:relative!important;aspect-ratio:auto!important;max-width:100%!important;margin:0!important;min-width:0!important;border-radius:8px!important;background:transparent!important;overflow:hidden!important}
.gallery.justified>.card>.photo-open{display:block!important;width:100%!important;height:100%!important;aspect-ratio:auto!important;overflow:hidden!important}
.gallery.justified>.card>.photo-open>img{display:block!important;width:100%!important;height:100%!important;object-fit:fill!important;max-width:none!important}
.gallery:not(.justified)>.card{aspect-ratio:var(--aspect,1)!important;background:transparent!important}
.gallery:not(.justified)>.card>.photo-open{aspect-ratio:inherit!important;width:100%!important;height:100%!important}
.gallery:not(.justified)>.card img{width:100%!important;height:100%!important;object-fit:contain!important}
.gallery-toolbar{gap:7px!important;min-height:32px!important;margin-bottom:7px!important;flex-wrap:nowrap!important}
.gallery-count{font-size:12px!important;white-space:nowrap}
.gallery-toolbar .button{font-size:12px!important;padding:6px 10px!important;min-height:34px}
.view-controls{padding:3px!important;gap:2px!important}.view{font-size:17px!important;padding:6px 8px!important}
.filters{gap:6px!important;margin-bottom:12px!important;padding-bottom:3px!important;scrollbar-width:none}
.filters .chip{padding:7px 12px!important;font-size:12px!important;min-height:32px!important}
.photo-actions{left:5px!important;right:5px!important;top:5px!important;display:flex!important;gap:4px!important;justify-content:flex-end!important;pointer-events:none!important}
.photo-actions button{pointer-events:auto!important;width:30px!important;height:30px!important;min-width:30px!important;font-size:15px!important;line-height:1!important;border-radius:8px!important;padding:0!important;background:rgba(17,29,45,.76)!important;border:1px solid #ffffff45!important;box-shadow:0 1px 3px #0002!important}
.photo-actions button:first-child{margin-right:auto!important}.photo-actions .photo-check[aria-pressed=true]{background:#2679f8!important}
.photo-actions .photo-delete:hover{background:#ae3042!important}
@media(max-width:640px){
 main{padding:8px 10px 60px!important}
 .gallery.justified{gap:7px!important}
 .gallery.justified>.card{border-radius:7px!important}
 .gallery-toolbar{gap:5px!important;margin:0 0 7px!important}
 .gallery-toolbar .button{font-size:11px!important;padding:6px 8px!important;min-height:32px!important}
 .gallery-count{font-size:11px!important}
 .filters{margin-bottom:8px!important}.filters .chip{padding:6px 11px!important;font-size:11px!important;min-height:30px!important}
 .photo-actions{left:4px!important;right:4px!important;top:4px!important;gap:3px!important}
 .photo-actions button{width:28px!important;height:28px!important;min-width:28px!important;font-size:14px!important}
 .view-controls{flex-shrink:0!important}.view{padding:5px 7px!important;font-size:16px!important}
}
@media(max-width:370px){.gallery-count{font-size:10px!important}.gallery-toolbar .button{padding-inline:5px!important}.view{padding-inline:5px!important}}

/* v1.4.4 — Selección contextual: solo las fotos seleccionadas muestran ✓ */
.gallery .card{user-select:none;-webkit-user-select:none}
.gallery .card .photo-open{touch-action:pan-y;-webkit-touch-callout:none}
.gallery .card .photo-open img{user-select:none;-webkit-user-select:none;-webkit-user-drag:none}
.gallery .card.is-selected:after{display:none!important}
.gallery .card.is-selected{outline:0!important;box-shadow:inset 0 0 0 3px #287bfa,0 0 0 2px #287bfa!important}
.gallery .card.is-selected .photo-open{filter:brightness(.94)}
.gallery .photo-actions{opacity:0;visibility:hidden;pointer-events:none!important;transition:opacity .12s ease}
.gallery .photo-actions button{pointer-events:auto!important;display:grid;place-items:center}
.gallery .photo-actions svg{display:block;max-width:18px;max-height:18px}
/* Un checkbox vacío en hover, check blanco únicamente cuando está marcado. */
.gallery .photo-actions .photo-check{background:rgba(17,29,45,.55)!important;border-color:rgba(255,255,255,.85)!important;color:white!important}
.gallery .photo-actions .photo-check svg{opacity:0;transform:scale(.8);transition:opacity .1s,transform .1s}
.gallery .photo-actions .photo-check[aria-pressed="true"]{background:#2679f8!important;border-color:#a9cfff!important}
.gallery .photo-actions .photo-check[aria-pressed="true"] svg{opacity:1;transform:scale(1)}
.gallery .card:focus-within .photo-actions,.gallery .card.is-selected .photo-actions{opacity:1;visibility:visible}
.gallery.selection-active .photo-edit,.gallery.selection-active .photo-delete{opacity:0;pointer-events:none!important}
.gallery.selection-active .card:focus-within .photo-edit,.gallery.selection-active .card:focus-within .photo-delete{opacity:1;pointer-events:auto!important}
@media(hover:hover) and (pointer:fine){
 .gallery .card:hover .photo-actions{opacity:1;visibility:visible}
 .gallery.selection-active .card:hover .photo-edit,.gallery.selection-active .card:hover .photo-delete{opacity:1;pointer-events:auto!important}
}
@media(hover:none),(pointer:coarse){
 .gallery .photo-edit,.gallery .photo-delete{display:none!important}
 .gallery .card:not(.is-selected) .photo-actions{opacity:0!important;visibility:hidden!important;pointer-events:none!important}
 .gallery .card.is-selected .photo-actions{opacity:1!important;visibility:visible!important}
 .gallery .card:not(.is-selected) .photo-check{visibility:hidden!important;pointer-events:none!important}
 .gallery .card.is-selected .photo-check{visibility:visible!important;pointer-events:auto!important}
 .gallery .card:focus-within:not(.is-selected) .photo-actions{opacity:0!important;visibility:hidden!important}
}
@media(prefers-reduced-motion:reduce){.gallery .photo-actions,.gallery .photo-check svg{transition:none}}
/* Barra contextual en escritorio; el recuento queda separado de las operaciones. */
.bulk-bar{position:sticky;top:50px;z-index:4;background:#f2f7ff;border-color:#c9d9f2;box-shadow:0 4px 20px #15243b0a}
.bulk-bar .bulk-select{min-width:0}
.bulk-bar .bulk-select select{min-width:155px}
#stopSelect{flex:0 0 auto}
/* En móvil, las imágenes comienzan inmediatamente tras los filtros.
   Las operaciones aparecen en una barra flotante compacta, sobre la zona segura. */
@media(max-width:640px){
 .has-selection #orderMode{display:none!important}
 .has-selection main{padding-bottom:145px!important}
 .bulk-bar:not(.hidden){position:fixed!important;top:auto!important;bottom:calc(9px + env(safe-area-inset-bottom,0px));left:10px;right:10px;width:auto;max-width:550px;margin:0 auto;z-index:30;display:grid!important;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:7px;padding:9px 11px;background:rgba(249,251,255,.98);border:1px solid #c3d4ec;border-radius:15px;box-shadow:0 12px 32px #13283c3c;backdrop-filter:blur(12px)}
 .bulk-bar strong{grid-column:1;grid-row:1;font-size:13px;line-height:1.3;min-width:0}
 #selectAll{grid-column:2;grid-row:1;padding:7px 9px;white-space:nowrap;font-size:11px;min-height:34px}
 #clearSelection{display:none!important}
 #stopSelect{grid-column:3;grid-row:1;width:34px;height:34px;min-width:34px;font-size:23px}
 .bulk-bar .bulk-select{grid-column:1/3;grid-row:2;display:flex;min-width:0;width:100%;margin:0;gap:0;font-size:0}
 .bulk-bar .bulk-select select{width:100%;flex:1;min-width:0;max-width:none!important;min-height:38px;padding:6px 9px;font-size:13px}
 #bulkApply{grid-column:3;grid-row:2;min-height:38px;padding:7px 11px;font-size:12px}
 #bulkValue:not(.hidden){grid-column:1/-1;grid-row:3;width:100%;max-width:none!important;min-height:36px;font-size:13px}
}
@media(max-width:355px){.bulk-bar:not(.hidden){left:6px;right:6px;padding:7px;gap:5px}#selectAll{font-size:10px;padding-inline:6px}.bulk-bar strong{font-size:12px}}

/* v1.4.4 — casilla moderna de selección, sin marca en fotografías no seleccionadas.
   El área interactiva mide 34px; el icono interior está diseñado como checkbox y no como botón de acción. */
.gallery .photo-actions .photo-check{
  width:36px!important;height:36px!important;min-width:36px!important;
  position:relative;isolation:isolate;display:grid!important;place-items:center!important;
  border:0!important;border-radius:11px!important;
  background:rgba(14,27,45,.36)!important;
  box-shadow:0 2px 8px rgba(0,0,0,.16)!important;
  backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);
  color:#fff!important;cursor:pointer;
  transition:background .15s ease,box-shadow .15s ease!important
}
.gallery .photo-actions .photo-check::before{
  content:"";position:absolute;inset:7px;border-radius:6px;
  border:2px solid rgba(255,255,255,.98);
  background:rgba(255,255,255,.22);
  box-shadow:0 1px 3px rgba(0,0,0,.22);
  transition:background .15s ease,border-color .15s ease,transform .15s ease
}
.gallery .photo-actions .photo-check svg{
  width:18px!important;height:18px!important;position:relative;z-index:1;
  opacity:0!important;transform:scale(.6)!important;
  transition:opacity .12s ease,transform .12s ease
}
.gallery .photo-actions .photo-check[aria-pressed="true"]{
  background:rgba(13,40,82,.45)!important;
  box-shadow:0 2px 10px rgba(0,0,0,.18)!important
}
.gallery .photo-actions .photo-check[aria-pressed="true"]::before{
  border-color:#2175ed;background:#267cf8;
  box-shadow:0 0 0 2px rgba(255,255,255,.96),0 2px 6px rgba(7,56,126,.35)
}
.gallery .photo-actions .photo-check[aria-pressed="true"] svg{
  opacity:1!important;transform:scale(1)!important;
}
.gallery .photo-actions .photo-check:focus-visible{outline:3px solid #78b7ff!important;outline-offset:3px}
.gallery .card.is-selected{box-shadow:inset 0 0 0 2px #267cf8,0 0 0 1px #267cf8!important}
.gallery .card.is-selected .photo-open{filter:brightness(.94)}
@media (hover:hover) and (pointer:fine){
  .gallery .card:not(.is-selected) .photo-check:hover::before{background:rgba(255,255,255,.45);transform:scale(1.07)}
}
@media(hover:none), (pointer:coarse){
  .gallery .card:not(.is-selected) .photo-actions{visibility:hidden!important;opacity:0!important;pointer-events:none!important}
  .gallery .card.is-selected .photo-actions{visibility:visible!important;opacity:1!important}
  .gallery .photo-actions .photo-check{width:36px!important;height:36px!important;min-width:36px!important}
}
@media(prefers-reduced-motion:reduce){
  .gallery .photo-actions .photo-check,.gallery .photo-actions .photo-check::before,.gallery .photo-actions .photo-check svg{transition:none!important}
}
/* Los cambios de estado se ven al instante y las acciones secundarias no invaden el móvil. */
.gallery .photo-actions .photo-check svg{transition:none!important}
.gallery .photo-actions .photo-check::before{transition:none!important}
@media(max-width:640px){
 .gallery .card .photo-actions .photo-edit,
 .gallery .card .photo-actions .photo-delete{display:none!important;visibility:hidden!important;pointer-events:none!important}
}
@media (hover:none), (pointer:coarse){
 .gallery .card .photo-actions .photo-edit,
 .gallery .card .photo-actions .photo-delete{display:none!important;visibility:hidden!important;pointer-events:none!important}
}


.gallery .photo-actions .photo-check svg,.gallery .photo-actions .photo-check::before{transition:none!important}
@media(max-width:640px){.gallery .card .photo-actions .photo-edit,.gallery .card .photo-actions .photo-delete{display:none!important;visibility:hidden!important;pointer-events:none!important}}
@media (hover:none),(pointer:coarse){.gallery .card .photo-actions .photo-edit,.gallery .card .photo-actions .photo-delete{display:none!important;visibility:hidden!important;pointer-events:none!important}}

/* v1.4.5 — Barra de selección compacta; prioridad a la fotografía. */
.selection-short{display:none}
#selectAll{display:inline-flex;align-items:center;justify-content:center;gap:6px}
#selectAll .select-all-icon{display:none;width:19px;height:19px;flex:none}
.gallery .card.is-selected{box-shadow:inset 0 0 0 2px #267cf8!important}
.gallery .card.is-selected .photo-open{filter:none!important}
@media(max-width:640px){
 .has-selection main{padding-bottom:116px!important}
 .bulk-bar:not(.hidden){
  grid-template-columns:auto minmax(78px,1fr) auto auto auto!important;
  grid-template-rows:auto!important;
  column-gap:5px!important;row-gap:6px!important;
  align-items:center!important;
  padding:7px 8px!important;
  bottom:calc(8px + env(safe-area-inset-bottom,0px))!important;
  border-radius:13px!important;
  box-shadow:0 4px 16px #13283c26!important;
 }
 #selectedCount{grid-column:1!important;grid-row:1!important;white-space:nowrap;min-width:0;font-size:12px!important;line-height:1.15!important;margin:0!important}
 #selectedCount .selection-full{display:none}
 #selectedCount .selection-short{display:inline}
 .bulk-bar .bulk-select{grid-column:2!important;grid-row:1!important;min-width:0!important;width:100%!important;margin:0!important;display:flex!important}
 .bulk-bar .bulk-select select{width:100%!important;min-width:0!important;max-width:none!important;min-height:36px!important;height:36px!important;padding:4px 5px!important;font-size:12px!important;line-height:1.2!important}
 #bulkApply{grid-column:3!important;grid-row:1!important;min-height:36px!important;height:36px!important;padding:4px 8px!important;font-size:12px!important;white-space:nowrap}
 #selectAll{grid-column:4!important;grid-row:1!important;width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important;padding:0!important;border-radius:9px!important}
 #selectAll .select-all-label{display:none!important}
 #selectAll .select-all-icon{display:block!important}
 #stopSelect{grid-column:5!important;grid-row:1!important;width:33px!important;height:36px!important;min-width:33px!important;min-height:36px!important;display:grid!important;place-items:center!important;font-size:22px!important}
 #bulkValue:not(.hidden){grid-column:1/-1!important;grid-row:2!important;margin:0!important;height:36px!important;min-height:36px!important}
}
@media(max-width:360px){
 .bulk-bar:not(.hidden){left:5px!important;right:5px!important;column-gap:3px!important;padding-inline:6px!important;grid-template-columns:auto minmax(62px,1fr) auto auto auto!important}
 #selectedCount{font-size:11px!important}
 #bulkApply{padding-inline:6px!important;font-size:11px!important}
 #selectAll{width:33px!important;min-width:33px!important}
 #stopSelect{width:31px!important;min-width:31px!important}
}
