*{ box-sizing:border-box; }
/* Ensure the HTML hidden attribute always hides elements, even if other rules set display */
[hidden]{ display:none !important; }

html,body{ height:100%; }
body{
  margin:0;
  display:flex;
  flex-direction:column;
  min-height:100dvh;
  font-family: var(--font-sans);
  background: var(--app-body-bg);
  color:var(--text);
}
.topbar{
  display:flex; gap:16px; align-items:center; justify-content:space-between;
  padding: calc(14px + env(safe-area-inset-top)) calc(18px + env(safe-area-inset-right)) 14px calc(18px + env(safe-area-inset-left)); flex-wrap:wrap;
  background: var(--topbar-bg);
  border-bottom:1px solid var(--border);
  position:sticky; top:0;
  z-index:10;
}

/* Topbar blur opcional (puede causar parpadeos en algunos navegadores/GPU) */
html:not([data-topbar-blur="0"]) .topbar{
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
html[data-topbar-blur="0"] .topbar{
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.brand{ display:flex; gap:12px; align-items:center; }
.dot{ width:12px; height:12px; border-radius:50%; background:var(--accent); box-shadow: 0 0 18px var(--accent-glow); }
.brandLogo{ width:40px; height:40px; object-fit:contain; display:block; border-radius:10px; }
.title{ font-weight:700; }
.subtitle{ font-size:12px; color: var(--text); margin-top:2px; }


/* Slots para recolocar el bloque de subida (configurable desde Admin) */
.uploadBlock{ display:inline-flex; flex-direction:column; max-width:100%; }
.uploadSlot{ display:flex; width:100%; min-width:0; }
.uploadSlot.align-left{ justify-content:flex-start; }
.uploadSlot.align-center{ justify-content:center; }
.uploadSlot.align-right{ justify-content:flex-end; }
.uploadSlot:empty{ display:none; }

/* Slot especial en el header (derecha). Hereda .uploadSlot pero NO ocupa el 100% del ancho. */
.uploadSlotHeaderRight{
  width:auto;
  flex: 0 1 auto;
  min-width: 0;
  justify-content:flex-end;
}

/* Modo flotante: el bloque de subida se superpone al mosaico */
.uploadSlotOverlay{
  position:absolute; left:0; right:0; top:0; bottom:0;
  display:flex;
  padding:12px;
  pointer-events:none;
  z-index:6;
}
.uploadSlotOverlay.overlay-top{ align-items:flex-start; }
.uploadSlotOverlay.overlay-bottom{ align-items:flex-end; }
.uploadSlotOverlay > *{ pointer-events:auto; }

.uploadBlock.is-floating{  background: var(--ua-float-panel-bg, var(--card));
  border: 1px solid var(--ua-float-border-color, var(--border));
  border-radius: var(--ua-float-radius, 14px);
  padding:10px 10px;
  box-shadow: var(--ua-float-shadow, var(--shadow-sm));
  max-width: min(560px, calc(100vw - 44px));
}

/* Modo flotante: permitir mover el bloque (drag) - tirador tipo "pestaña" fuera del panel */
.uaFloatingWrap{
  display:flex;
  align-items:stretch;
  gap:0;
}
.uaFloatingWrap.ua-handle-left{ flex-direction:row-reverse; }

/* El panel se une visualmente al tirador */
.uaFloatingWrap .uploadBlock.is-floating{
  border-top-right-radius:0;
  border-bottom-right-radius:0;
}
.uaFloatingWrap.ua-handle-left .uploadBlock.is-floating{
  border-top-left-radius:0;
  border-bottom-left-radius:0;
}

/* Tirador (pestaña) */
.uaFloatingWrap .uaDragHandle{
  width:34px;
  min-width:34px;
  align-self:stretch;
  border: 1px solid var(--ua-float-border-color, var(--border));
  border-left:none;
  background: var(--ua-float-handle-bg, var(--card));
  color: var(--text);
  box-shadow: var(--ua-float-shadow, var(--shadow-sm));
  border-radius:0 14px 14px 0;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:grab;
  padding:0;
  line-height:1;
  user-select:none;
  touch-action:none;
}
.uaFloatingWrap .uaDragHandle:active{ cursor:grabbing; }

.uaFloatingWrap.ua-handle-left .uaDragHandle{
  border-left:1px solid var(--ua-float-border-color, var(--border));
  border-right:none;
  border-radius:14px 0 0 14px;
}


@media (max-width: 520px){
  .uploadSlotOverlay{ padding:10px; }
  .uploadBlock.is-floating{ border-radius:var(--ua-float-radius, 12px); padding:8px 8px; }
  .uaFloatingWrap .uaDragHandle{ width:30px; min-width:30px; border-radius:0 12px 12px 0; }
  .uaFloatingWrap.ua-handle-left .uaDragHandle{ border-radius:12px 0 0 12px; }
}

.upload{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:6px;
}

.upload.ua-left{ align-items:flex-start; }
.upload.ua-center{ align-items:center; }
.upload.ua-right{ align-items:flex-end; }
.uploadRow{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.upload.ua-left .uploadRow{ justify-content:flex-start; }
.upload.ua-center .uploadRow{ justify-content:center; }
.upload.ua-right .uploadRow{ justify-content:flex-end; }
.uploadControls{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; min-width:0; }
/* Phase 0: wrappers para poder recolocar/ocultar controles de subida desde Admin (sin cambiar el layout actual) */
.uploadActions{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; min-width:0; }
.uaPart[data-ua-part="file"]{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; min-width:0; }
.uaPart[data-ua-part="camera"]{ display:block; }
.uploadResult{
  display:flex;
  align-items:center;
  justify-content:center;
  align-self:center;
  gap:10px;
  min-height:36px;
  flex-wrap:wrap;
}
.uploadResult.is-empty{
  visibility:hidden;
  pointer-events:none;
}

.uploadControls input[type=file]{ flex: 1 1 220px; min-width: 160px; width:auto; max-width:44vw; color: var(--text); font-size:13px; }
.upload button{
  background: var(--accent);
  border:0; color:#fff;
  padding:10px 14px;
  border-radius:10px;
  font-weight:700;
  cursor:pointer;
}
.upload button:disabled{ opacity:0.6; cursor:not-allowed; }
.upload button.ghost{
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.status{
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(420px, 55vw);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status.is-empty{ display:none; }
.tilePos{
  display:inline-flex;
  align-items:center;
  padding:8px 10px;
  border-radius:999px;
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
  font-size: 12px;
}

.main{ display:flex; flex-direction:column; gap:14px; padding:18px; padding-bottom: calc(18px + env(safe-area-inset-bottom)); flex:1 1 auto; min-height:0; }

.badge{
  display:inline-block;
  margin-left:8px;
  font-size:11px;
  padding:3px 8px;
  border-radius:999px;
  border: 1px solid var(--border);
  color: var(--muted);
  vertical-align: middle;
}
.badge.on{ color:#fff; border-color: var(--accent-glow-2); background: var(--accent-weak); }

.cameraPanel{
  border:1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  padding: 14px;
}
.cameraHeader{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.cameraTitle{ font-weight: 800; }
.cameraNote{ color: var(--muted); font-size: 12px; }
.cameraGrid{
  display:grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
}
@media (max-width: 860px){
  .cameraGrid{ grid-template-columns: 1fr; }
}
.cameraPreview{
  border:1px solid var(--border);
  border-radius: var(--cam-btn-radius, 14px);
  overflow:hidden;
  background:#000;
  min-height: 220px;
}
#camVideo{
  width:100%;
  height:100%;
  display:block;
  object-fit: cover;
}
.cameraControls{
  display:flex;
  flex-direction:column;
  gap: 10px;
}
.field{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--panel);
}
.field span{ color: var(--muted); font-size: 12px; }
.field select{
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
}

/* Cámara: mejorar botones y asegurar visibilidad del selector en modo móvil fullscreen */
html[data-cam-autocrop="1"] #uploadPhotoBtn{ display:none; }

.cameraControls button{
  background: var(--cam-btn-primary-bg, var(--accent));
  border: 0;
  color: var(--cam-btn-primary-text, #fff);
  padding: 12px 14px;
  border-radius: var(--cam-btn-radius, 14px);
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--cam-btn-shadow, 0 10px 24px rgba(0,0,0,0.22));
  transition: transform 0.06s ease, filter 0.12s ease, opacity 0.12s ease;
}
.cameraControls button:hover{ filter: brightness(1.03); }
.cameraControls button:active{ transform: translateY(1px); }
.cameraControls button:disabled{ opacity:0.6; cursor:not-allowed; box-shadow:none; }
.cameraControls button.ghost{
  background: var(--cam-btn-ghost-bg, transparent);
  border: 1px solid var(--cam-btn-ghost-border, var(--border));
  color: var(--cam-btn-ghost-text, var(--text));
  box-shadow:none;
}
.cameraControls .field{ border-color: var(--cam-field-border, var(--panel)); }
.cameraControls .field span{ font-weight:800; letter-spacing:0.2px; }
.cameraControls .field select{
  border-radius: 12px;
  padding: 9px 12px;
}

/* Modo cámara fullscreen (móvil): forzar colores legibles en el selector */
@media (max-width: 720px){
  body.camOpen #cameraPanel{ color-scheme: dark; }
  body.camOpen #cameraPanel .field{ border-color: var(--cam-controls-border, rgba(255,255,255,0.14)); }
  body.camOpen #cameraPanel .field span{ color: rgba(255,255,255,0.78); }
  body.camOpen #cameraPanel .field select{
    color: var(--cam-select-text, var(--cam-text-color, #fff));
    border-color: var(--cam-select-border, var(--cam-controls-border, rgba(255,255,255,0.18)));
    background: var(--cam-select-bg, rgba(255,255,255,0.08));
  }
  body.camOpen #cameraPanel .cameraControls button.ghost{
    border-color: rgba(255,255,255,0.22);
    color: var(--cam-select-text, var(--cam-text-color, #fff));
  }
}
.cameraControls button{ width: 100%; }
.tiny{ font-size: 12px; color: var(--muted); min-height: 18px; }

.canvasWrap{
  position:relative;
  border:1px solid var(--border);
  background: var(--card);
  border-radius: 16px;
  overflow:hidden;
  overscroll-behavior: contain;
  flex: 1 1 auto;
  min-height: clamp(220px, 52dvh, 820px);
  /* Allow the mosaic to use the remaining viewport height without forcing scroll */
}


/* Texto opcional arriba/abajo del mosaico.
   Importante: va FUERA del canvas, para que nunca pueda taparlo. */
.mosaicText{
  margin: 10px 0;
  padding: 12px 14px;
  text-align: center;
  font-size: clamp(14px, 2.4vw, 18px);
  line-height: 1.25;
  font-weight: 800;
  color: var(--text);
  white-space: pre-line;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--cam-btn-radius, 14px);
  box-shadow: var(--shadow-sm);
}
@media (max-width: 520px){
  .mosaicText{ font-size: 14px; }
}
canvas{
  display:block;
  width:100%;
  height:100%;
  touch-action:none;
  user-select:none;
  -webkit-user-select:none;
  background: var(--card);
}

.hint{
  position:absolute; left:12px; bottom:10px;
  display:flex; gap:10px; flex-wrap:wrap;
  font-size:12px; color: var(--text);
  background: var(--topbar-bg);
  border:1px solid var(--border);
  padding:8px 10px;
  border-radius: 12px;
  backdrop-filter: blur(8px);
}


/* Ir a fila/columna (zoom a una tesela concreta) */
.gotoRowCol{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--cam-btn-radius, 14px);
  box-shadow: var(--shadow-sm);
}
.gotoRowCol.align-left{ justify-content:flex-start; }
.gotoRowCol.align-center{ justify-content:center; }
.gotoRowCol.align-right{ justify-content:flex-end; }
.gotoField{
  display:flex;
  align-items:center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.gotoField input{
  width: var(--goto-input-width, 64px);
  flex: 0 0 auto;
  padding: 8px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--goto-input-bg, transparent);
  color: var(--goto-input-color, var(--text));
  font-size: var(--goto-input-font, 14px);
}
.gotoRowCol button{
  padding: 10px 14px;
  border-radius: 10px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.gotoRowCol button:disabled{ opacity:0.6; cursor:not-allowed; }

@media (max-width: 480px){
  .gotoRowCol{ gap:8px; padding:10px 12px; }
  .gotoField{ flex-direction:column; align-items:flex-start; gap:4px; }
  .gotoField input{ width: var(--goto-input-width-mobile, 52px); flex: 0 0 auto; padding: 7px 7px; }
  .gotoRowCol button{ padding: 9px 12px; }
}

.legend{
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:14px;
  color: var(--text);
  font-size:14px;
}
.legend b{ color:var(--text); }
.small{ font-size:12px; }

.pageFooter{
  border-top: 1px solid var(--border);
  background: var(--topbar-bg);
  padding: 12px calc(18px + env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) calc(18px + env(safe-area-inset-left));
  color: var(--muted);
  font-size: 13px;
  white-space: pre-line;
}


/* ------------------------------------------------------------------
   Modales (crop / tile preview)
   - Estilos centralizados y theme-aware (light/dark/custom).
   - Layout responsive (móvil/tablet/desktop).
------------------------------------------------------------------- */
.modalOverlay{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  padding-top: calc(18px + env(safe-area-inset-top));
  padding-left: calc(18px + env(safe-area-inset-left));
  padding-right: calc(18px + env(safe-area-inset-right));
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
  background: var(--overlay, rgba(0,0,0,0.62));
  z-index: 10000;
}
.modalOverlay.isOpen{ display:flex; }

.modalCard{
  width: min(92vw, 860px);
  max-height: min(92dvh, 900px);
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-lg, 0 20px 60px rgba(0,0,0,0.35));
  display:flex;
  flex-direction: column;
}

.modalCard.cropCard{
  width: min(94vw, 980px);
}

.modalHeader{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--topbar-bg);
}
.modalTitle{
  font-weight: 800;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modalBody{
  padding: 14px;
  background: var(--panel);
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.modalFooter{
  display:flex;
  align-items:center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--topbar-bg);
}

.modalBtn{
  -webkit-appearance:none;
  appearance:none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
}
.modalBtn.primary{
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}
.modalBtn:disabled{ opacity: 0.6; cursor: not-allowed; }

.cropCanvas{
  /* El tamaño visual lo calcula JS para encajar el formato real (ej: 2:3, 3:2, 1:1) */
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  background: var(--crop-bg, var(--card));
  display:block;
  touch-action: none;
}

.modalHint{ font-size: 12px; color: var(--muted); margin-top: 10px; }

.tileBody{ display:flex; align-items:center; justify-content:center; overflow:hidden; padding: 10px; }
.tileImg{
  max-width: 100%;
  /* Fit inside modal without scroll (accounts for header + paddings) */
  max-height: min(calc(92dvh - 140px), 740px);
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--text) 6%, transparent);
  display:block;
}


/* Crop modal layout */
.modalBody.cropBody{ overflow-x: hidden; }
.cropBody{
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 14px;
  align-items: start;
}
.cropBody.noFields{
  grid-template-columns: 1fr;
}
.cropLeft{
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}
.cropRight{
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}
.cropCanvasWrap{
  position: relative;
  display:flex;
  height: clamp(260px, 52dvh, 520px);
  width: 100%;
  box-sizing: border-box;

  align-items:center;
  justify-content:center;
  border: 1px solid var(--border);
  border-radius: var(--cam-btn-radius, 14px);
  background: color-mix(in srgb, var(--text) 4%, transparent);
  padding: 12px;
}

.cropBadge{
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #fff;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
}
.cropControls{ display:flex; flex-direction:column; gap:10px; width:100%; }
.zoomRow{ display:flex; align-items:center; gap: 12px; flex-wrap: nowrap; }
.zoomRow input[type=range]{ flex: 1 1 auto; min-width: 0; }
.zoomLbl{ color: var(--muted); font-size: 13px; min-width: 46px; }

.zoomQuick{
  display:flex;
  gap: 10px;
  justify-content: flex-end;
}
.modalBtn.cropMiniBtn{
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
}

@media (max-width: 520px){
  .zoomQuick{ justify-content: stretch; }
  .modalBtn.cropMiniBtn{ flex: 1 1 auto; }
}


@media (max-width: 860px){
  .cropBody{ grid-template-columns: 1fr; }
}

@media (max-width: 420px){
  .zoomRow{ gap: 8px; }
  .zoomLbl{ min-width: 38px; }
}

@media (max-width: 520px){
  .modalOverlay{ padding: 14px; padding-top: calc(14px + env(safe-area-inset-top)); }
  .modalBody{ padding: 12px; }
  .cropCanvasWrap{ padding: 10px; height: clamp(220px, 46dvh, 380px); }
}


/* Responsive */
@media (max-width: 900px){
  .topbar{ gap:12px; }
}
@media (max-width: 720px){
  .topbar{
    flex-direction:column;
    align-items:stretch;
  }
  .brand{ width:100%; }

  /* En móvil el bloque de subida suele ir a ancho completo.
     La alineación (izq/centro/der) se gestiona con clases .ua-left/.ua-center/.ua-right */
  .upload{ width:100%; gap:10px; }
  #fileInput{ width:100%; max-width:100%; }
  .uploadControls button{ width:100%; }
  .uploadResult{ justify-content:center; }

  /* Estado: en móvil puede ocupar la línea completa */
  .status{ max-width:100%; width:100%; }

  .hint{ display:none; }
  .main{ padding:14px; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }


  /* Cámara móvil: mostrar panel como pantalla dedicada para que siempre se vean los controles */
  body.camOpen{ overflow:hidden; }
  body.camOpen #cameraPanel{
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--cam-panel-bg, rgba(12,12,14,0.96));
    color: var(--cam-select-text, var(--cam-text-color, #fff));
    isolation: isolate;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    border-bottom: 0;
    margin: 0;
    overflow: auto;
    padding: 14px;
    padding-top: calc(14px + env(safe-area-inset-top));
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }
  body.camOpen #cameraPanel .cameraGrid{ grid-template-columns: 1fr; }
  body.camOpen #cameraPanel .cameraPreview{
    /* Proporción de tesela (definida por meta.mosaic.tile_aspect) */
    aspect-ratio: var(--cam-preview-ar, 1 / 1);
    height: auto;
    /* Mantén un límite ajustable desde Admin (preview_height_vh) */
    max-height: var(--cam-preview-height, 52vh);
    min-height: 240px;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
  body.camOpen #cameraPanel .cameraControls button{ width:100%; }
  body.camOpen #cameraPanel .cameraControls{
    background: var(--cam-controls-bg, rgba(0,0,0,0.35));
    border: 1px solid var(--cam-controls-border, rgba(255,255,255,0.10));
    border-radius: var(--cam-controls-radius, 14px);
    padding: 12px;
    position: sticky;
    bottom: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  body.camOpen #cameraPanel .cameraHeader{
    position: sticky;
    top: 0;
    background: var(--cam-panel-bg, rgba(12,12,14,0.96));
    padding-top: calc(env(safe-area-inset-top));
    margin-top: calc(-1 * env(safe-area-inset-top));
    z-index: 1;
  }

}
@media (max-width: 420px){
  .title{ font-size: 14px; }
  .subtitle{ font-size: 12px; }
}


/* Short viewport (mobile landscape): keep controls usable without forcing scroll */
@media (max-height: 520px){
  .cropCanvasWrap{ height: clamp(200px, 48dvh, 360px); }
  .topbar{ padding-top: calc(10px + env(safe-area-inset-top)); padding-bottom:10px; }
  .subtitle{ display:none; }
  .main{ padding:12px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .canvasWrap{ min-height: 220px; }
  .mosaicText{ padding: 8px 10px; margin: 8px 0; }
}


/* Crop modal: campos opcionales (email / texto) */
.cropFields{
  margin-top: 12px;
  display:flex;
  flex-direction: column;
  gap: 10px;
}
.cropField{
  display:flex;
  flex-direction: column;
  gap: 6px;
}
.cropLabel{
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
}
.cropInput,
.cropTextarea{
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  outline: none;
}
.cropTextarea{
  resize: vertical;
  min-height: 78px;
  max-height: 180px;
}
.cropInput:focus,
.cropTextarea:focus{
  border-color: rgba(255,255,255,0.20);
}
.cropInput:disabled,
.cropTextarea:disabled{
  opacity: 0.65;
}
.cropError{
  margin-top: 2px;
  font-size: 13px;
  color: var(--danger);
}


#uploadSlotTop .uploadControls input[type=file],
#uploadSlotBottom .uploadControls input[type=file]{ max-width:min(520px, 70vw); }


/* Auto-crop (Fase 3): al elegir archivo se abre directamente el recorte; ocultamos el botón submit para evitar confusión. */
html[data-ua-autocrop="1"] #uploadBtn { display: none !important; }

html[data-cam-autocrop="1"] #uploadPhotoBtn { display: none !important; }
