/* ============================================================
   EffectPic Web — Modern Social Photo Suite
   Design System & Premium Dark Theme
   ============================================================ */

:root {
  --bg-app: #0c0d12;
  --bg-surface: #14161f;
  --bg-card: #1b1e2a;
  --bg-card-hover: #232737;
  --bg-input: #11131b;

  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-primary-glow: rgba(99, 102, 241, 0.35);

  --accent-secondary: #06b6d4;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  --border-active: rgba(99, 102, 241, 0.5);

  --shadow-card: 0 8px 24px -4px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 20px -2px var(--accent-primary-glow);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  --transition-fast: 140ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* Editor a pantalla completa; el footer queda debajo (scroll) */
.app-shell {
  flex-shrink: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ============================================================
   Barra Superior (Top Nav)
   ============================================================ */

.top-nav {
  height: 60px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 50;
  backdrop-filter: blur(16px);
  flex-shrink: 0;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 24px;
  filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.4));
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-web {
  font-size: 10px;
  font-weight: 800;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 6px;
  padding: 2px 6px;
  letter-spacing: 0.5px;
}

.brand-tag {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 1.2px;
}

.ai-status-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.28);
  color: #34d399;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  margin-left: 10px;
}

.ai-status-pill.busy {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.actions-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.history-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  padding: 3px 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

/* ============================================================
   Botones Universales
   ============================================================ */

button {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all var(--transition-fast);
}

button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
}

.btn-ghost:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.btn-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-md);
}

.btn-toggle:hover, .btn-toggle.active {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-hover);
}

.btn-toggle.active {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.15);
  color: #c7d2fe;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-hover));
  color: #ffffff;
  padding: 7px 16px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45);
  transform: translateY(-1px);
}

.btn-accent {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 7px 14px;
  border-radius: var(--radius-md);
}

.btn-accent:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-hover);
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

.btn-secondary:hover {
  color: var(--text-main);
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.btn-sm {
  font-size: 12px;
  padding: 5px 10px;
}

.btn-xs {
  font-size: 11px;
  padding: 3px 7px;
}

.export-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Autenticación en Navbar */
.auth-area {
  display: flex;
  align-items: center;
  margin-left: 6px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  padding: 4px 10px 4px 5px;
  border-radius: var(--radius-pill);
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--accent-primary);
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   Workspace (Lienzo Central + Barra Lateral)
   ============================================================ */

.app-workspace {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
  min-height: 0;
}

/* Lienzo Viewport */
.canvas-viewport {
  flex: 1;
  background-color: var(--bg-app);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 20px;
  overflow: hidden;
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.03) 0%, transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px, 32px 32px;
}

/* Dropzone Vacía */
.empty-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  border: 2px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  background: rgba(20, 22, 31, 0.4);
  backdrop-filter: blur(8px);
  max-width: 480px;
  transition: all var(--transition-normal);
}

.empty-dropzone.dragover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.08);
  transform: scale(1.02);
}

.drop-illustration {
  color: var(--accent-primary);
  margin-bottom: 14px;
  opacity: 0.85;
}

.empty-dropzone h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #ffffff;
}

.empty-dropzone p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.file-picker-label {
  cursor: pointer;
  display: inline-flex;
}

.dropzone-hints {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 11px;
  color: var(--text-dim);
}

/* Contenedor del Lienzo con Aspect Ratio */
.canvas-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
  animation: fadeIn 200ms ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.canvas-aspect-box {
  position: relative;
  background: #000000;
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

.canvas-aspect-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* Vista instantánea del encuadre mientras se arrastra / hace zoom */
.canvas-aspect-box img.live-preview-image {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  object-fit: fill;
  transform-origin: 0 0;
  will-change: transform;
}

.canvas-interactive-overlay {
  position: absolute;
  inset: 0;
  cursor: default;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 14px;
  pointer-events: all;
}

.canvas-interactive-overlay.draggable {
  cursor: grab;
}

.canvas-interactive-overlay.dragging {
  cursor: grabbing;
}

.pan-hint {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  opacity: 0;
  transform: translateY(6px);
  transition: all var(--transition-fast);
  pointer-events: none;
}

.canvas-interactive-overlay.draggable:hover .pan-hint {
  opacity: 1;
  transform: translateY(0);
}

.render-spinner {
  position: absolute;
  inset: 0;
  background: rgba(12, 13, 18, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.spinner-circle {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 600ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.canvas-footer-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.canvas-badge, .canvas-zoom-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: 6px;
}

/* Barra Lateral */
.sidebar-controls {
  width: 360px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.control-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-card);
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: #e2e8f0;
}

.formats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.btn-choice {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 9px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-muted);
}

.btn-choice:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  color: var(--text-main);
}

.btn-choice.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
}

.btn-choice-wide {
  grid-column: 1 / -1;
  flex-direction: row;
  justify-content: center;
  gap: 8px;
}

.choice-icon { font-size: 14px; }
.choice-label { font-size: 12px; font-weight: 700; }
.choice-sub { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-dim); }
.btn-choice.active .choice-sub { color: #c7d2fe; }

.segmented-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: var(--bg-input);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.btn-mode {
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 7px 4px;
  font-size: 11px;
  flex-direction: column;
  gap: 3px;
}

.btn-mode:hover { color: var(--text-main); }
.btn-mode.active {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.mode-icon { font-size: 14px; }

.param-slider-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 3px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.slider-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #a5b4fc;
}

.slider-with-btn {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: 4px;
  outline: none;
  border: 1px solid var(--border-subtle);
}

.app-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--accent-primary);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  transition: transform var(--transition-fast);
}

.app-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }

.presets-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.preset-chip {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-size: 11px;
  white-space: nowrap;
  color: var(--text-muted);
}

.preset-chip:hover { border-color: var(--border-hover); color: var(--text-main); }
.preset-chip.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent-primary);
  color: #e0e7ff;
}

.sliders-stack {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 3px;
}

/* ============================================================
   Carrusel Publicitario Cross-Promo XChamba (Compacto y Fijo)
   ============================================================ */

.promo-carousel {
  background: #11131b;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 6px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  z-index: 35;
  height: 86px;
}

.promo-carousel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  line-height: 1;
}

.promo-badge-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.promo-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  padding: 2px 6px;
  border-radius: 4px;
}

.promo-sublabel {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
}

.promo-cta {
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.promo-cta:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

.promo-carousel-viewport {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 28px;
  height: 54px;
}

.promo-carousel-clip {
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.promo-carousel-track {
  display: flex;
  gap: 10px;
  will-change: transform;
  transition: transform 400ms cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
  align-items: center;
}

.promo-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(24, 27, 38, 0.95);
  border: 1px solid var(--border-hover);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  backdrop-filter: blur(8px);
  transition: all var(--transition-fast);
}

.promo-arrow:hover {
  background: var(--accent-primary);
  color: #ffffff;
  transform: translateY(-50%) scale(1.1);
}

.promo-arrow-prev { left: 0; }
.promo-arrow-next { right: 0; }

.promo-card {
  flex: 0 0 210px;
  height: 48px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding-right: 8px;
  transition: all var(--transition-fast);
}

.promo-card:hover {
  border-color: #38bdf8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.promo-card-img-wrap {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  background: #000000;
}

.promo-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.promo-card-badge { display: none; }

.promo-card-discount {
  position: absolute;
  top: 2px;
  left: 2px;
  font-size: 8px;
  font-weight: 800;
  padding: 1px 3px;
  border-radius: 2px;
  background: var(--accent-rose);
  color: #ffffff;
}

.promo-card-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
}

.promo-card-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.promo-card-price-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.promo-card-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-emerald);
}

.promo-card-price-original {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--text-dim);
  text-decoration: line-through;
}

.promo-loading-text {
  font-size: 11px;
  color: var(--text-dim);
}

/* ============================================================
   Tira Inferior de Carrusel de Fotos
   ============================================================ */

.carousel-strip {
  height: 125px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 8px 20px;
  gap: 6px;
  z-index: 40;
  flex-shrink: 0;
}

.carousel-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.carousel-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.carousel-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.carousel-counter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  background: var(--bg-card);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

.carousel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.carousel-track-wrapper {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  align-items: center;
}

.carousel-track {
  display: flex;
  gap: 10px;
  height: 65px;
}

.thumb-card {
  width: 65px;
  height: 65px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 2px solid transparent;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.thumb-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
}

.thumb-card.active {
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.thumb-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-delete-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  font-size: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  border: none;
}

.thumb-card:hover .thumb-delete-btn { display: flex; }

.thumb-index {
  position: absolute;
  bottom: 3px;
  left: 3px;
  background: rgba(0, 0, 0, 0.65);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: #cbd5e1;
  padding: 1px 4px;
  border-radius: 3px;
}

/* ============================================================
   Modal de Login Requerido
   ============================================================ */

.login-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 180ms ease;
}

.login-modal-box {
  background: #171924;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  max-width: 440px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(99, 102, 241, 0.2);
  animation: modalScale 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: none;
  font-size: 14px;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.login-modal-icon {
  font-size: 38px;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.4));
}

.login-modal-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: #ffffff;
  margin-bottom: 8px;
}

.login-modal-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

.modal-google-btn-wrapper {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  min-height: 44px;
}

.login-modal-perks {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
  width: 100%;
  justify-content: center;
}

/* Diálogo de encaje (autorecorte / relleno desenfocado) */
.fit-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 160ms ease;
}

.fit-dialog-box {
  width: 100%;
  max-width: 420px;
  background: #171924;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  padding: 22px 18px 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: modalScale 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.fit-dialog-title {
  font-size: 17px;
  font-weight: 800;
  text-align: center;
}

.fit-dialog-sub {
  margin-top: -8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
}

.fit-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fit-option {
  justify-content: flex-start;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
}

.fit-option:hover,
.fit-option:focus-visible {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.12);
}

.fit-option-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
}

.fit-option-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.fit-option-text strong {
  font-size: 14px;
}

.fit-option-text span {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-muted);
}

.fit-dialog-cancel {
  align-self: center;
}

/* En móvil el diálogo sale desde abajo */
@media (max-width: 640px) {
  .fit-dialog-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .fit-dialog-box {
    max-width: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 220px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: slideToast 200ms ease;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: all;
}

.toast.success { border-color: rgba(16, 185, 129, 0.4); color: #6ee7b7; }
.toast.info { border-color: rgba(99, 102, 241, 0.4); color: #c7d2fe; }
.toast.error { border-color: rgba(244, 63, 94, 0.4); color: #fda4af; }

@keyframes slideToast {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.hidden { display: none !important; }

/* Logo SVG y Contenedor */
.logo-box {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(6, 182, 212, 0.25));
  border: 1px solid rgba(99, 102, 241, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a5b4fc;
}

.choice-icon-svg, .mode-icon-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.btn-choice.active .choice-icon-svg {
  color: #ffffff;
}

.btn-mode.active .mode-icon-svg {
  color: #ffffff;
}

/* ============================================================
   Cropper Box Interactivo (Handles & Tercios)
   ============================================================ */

.cropper-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.cropper-darkness {
  position: absolute;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(2px);
  pointer-events: auto;
}

.cropper-box {
  position: absolute;
  border: 1.5px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 8px 30px rgba(0, 0, 0, 0.6);
  cursor: move;
  pointer-events: auto;
  user-select: none;
  touch-action: none;
}

/* Cuadrícula de Tercios */
.cropper-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cropper-grid .grid-line {
  position: absolute;
  background: rgba(255, 255, 255, 0.35);
}

.cropper-grid .grid-line.h {
  left: 0;
  right: 0;
  height: 1px;
}

.cropper-grid .grid-line.h1 { top: 33.333%; }
.cropper-grid .grid-line.h2 { top: 66.666%; }

.cropper-grid .grid-line.v {
  top: 0;
  bottom: 0;
  width: 1px;
}

.cropper-grid .grid-line.v1 { left: 33.333%; }
.cropper-grid .grid-line.v2 { left: 66.666%; }

/* Tiradores (Handles) */
.cropper-handle {
  position: absolute;
  background: #ffffff;
  border: 1.5px solid #0f172a;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  z-index: 15;
  touch-action: none;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.cropper-handle:hover {
  background: var(--accent-primary);
  border-color: #ffffff;
  transform: scale(1.15);
}

/* Esquinas */
.cropper-handle.handle-nw {
  top: -1px;
  left: -1px;
  width: 13px;
  height: 13px;
  cursor: nwse-resize;
}

.cropper-handle.handle-ne {
  top: -1px;
  right: -1px;
  width: 13px;
  height: 13px;
  cursor: nesw-resize;
}

.cropper-handle.handle-se {
  bottom: -1px;
  right: -1px;
  width: 13px;
  height: 13px;
  cursor: nwse-resize;
}

.cropper-handle.handle-sw {
  bottom: -1px;
  left: -1px;
  width: 13px;
  height: 13px;
  cursor: nesw-resize;
}

/* Bordes */
.cropper-handle.handle-n {
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 8px;
  border-radius: 4px;
  cursor: ns-resize;
}
.cropper-handle.handle-n:hover {
  transform: translateX(-50%) scale(1.15);
}

.cropper-handle.handle-s {
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 8px;
  border-radius: 4px;
  cursor: ns-resize;
}
.cropper-handle.handle-s:hover {
  transform: translateX(-50%) scale(1.15);
}

.cropper-handle.handle-w {
  top: 50%;
  left: -1px;
  transform: translateY(-50%);
  width: 8px;
  height: 22px;
  border-radius: 4px;
  cursor: ew-resize;
}
.cropper-handle.handle-w:hover {
  transform: translateY(-50%) scale(1.15);
}

.cropper-handle.handle-e {
  top: 50%;
  right: -1px;
  transform: translateY(-50%);
  width: 8px;
  height: 22px;
  border-radius: 4px;
  cursor: ew-resize;
}
.cropper-handle.handle-e:hover {
  transform: translateY(-50%) scale(1.15);
}

.cropper-done-badge {
  position: absolute;
  top: 22px;
  right: 22px;
  background: var(--accent-primary);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 20;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}
.cropper-done-badge:hover {
  background: var(--accent-primary-hover);
  transform: scale(1.05);
}

.cropper-view-toggle {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 25;
  pointer-events: auto;
  background: rgba(12, 13, 18, 0.82);
  backdrop-filter: blur(6px);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.cropper-view-toggle:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.btn-crop-apply {
  padding: 5px 12px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
  border: none;
  border-radius: var(--radius-sm);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
}
.btn-crop-apply.is-editing {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-hover) !important;
  color: var(--text-main) !important;
}
.btn-crop-apply:hover {
  box-shadow: 0 0 12px var(--accent-primary-glow);
}

/* Controles de aspecto del Cropper */
.cropper-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.btn-toggle-aspect {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-toggle-aspect:hover {
  border-color: var(--border-hover);
  color: var(--text-main);
}

.btn-toggle-aspect.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-primary);
  color: #a5b4fc;
}

/* ============================================================
   Desenfoque Selectivo (Pincel & Zonas)
   ============================================================ */

.selective-blur-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 12;
  cursor: crosshair;
  touch-action: none;
  pointer-events: auto;
}

.brush-cursor-indicator {
  position: fixed;
  border: 1.5px dashed rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 100;
  background: rgba(99, 102, 241, 0.12);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
  transition: width 60ms ease, height 60ms ease;
}

.sel-blur-done-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 20;
  background: var(--accent-primary);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.btn-frame-edit {
  width: 100%;
  margin-top: 8px;
}

.sel-blur-done-badge:hover {
  background: var(--accent-primary-hover);
}

.title-with-pill {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-mini {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 2px 6px;
  border-radius: var(--radius-pill);
}

/* Switch Toggle Button */
.btn-toggle-switch {
  width: 38px;
  height: 22px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  position: relative;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
  padding: 0;
}

.btn-toggle-switch:hover {
  border-color: var(--border-hover);
}

.btn-toggle-switch.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px var(--accent-primary-glow);
}

.switch-ball {
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform var(--transition-fast);
}

.btn-toggle-switch.active .switch-ball {
  transform: translateX(16px);
}

/* Herramientas de Desenfoque Selectivo */
.selective-blur-body {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeIn 180ms ease;
}

.tool-selector-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--bg-surface);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.btn-tool {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-tool:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.btn-tool.active {
  background: var(--bg-card);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.btn-tool.active svg {
  color: var(--accent-primary);
}

.tool-actions-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}

.btn-danger-ghost {
  color: var(--accent-rose) !important;
}

.btn-danger-ghost:hover {
  background: rgba(244, 63, 94, 0.15) !important;
}


/* ============================================================
   Barra de formatos de uso rápido
   ============================================================ */

.format-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  z-index: 45;
}

.format-bar-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-dim);
  flex-shrink: 0;
}

.format-bar-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}

.format-bar-chips::-webkit-scrollbar {
  display: none;
}

.format-chip {
  flex-shrink: 0;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  padding: 6px 12px;
  gap: 6px;
  white-space: nowrap;
}

.format-chip:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  color: var(--text-main);
}

.format-chip.active {
  background: rgba(99, 102, 241, 0.18);
  border-color: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
}

.format-chip-label {
  font-size: 12px;
  font-weight: 700;
}

.format-chip-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-dim);
}

.format-chip.active .format-chip-sub {
  color: #c7d2fe;
}

/* ============================================================
   Footer (mismo que LocutorPro)
   ============================================================ */

.app-footer {
  flex-shrink: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  padding: 1.5rem 16px calc(1.5rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  font-size: 0.82rem;
  color: var(--text-muted);
  user-select: text;
}

.app-footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.app-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.app-footer a:hover {
  color: var(--text-main);
  text-decoration: underline;
}

.app-footer-credit {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.85;
}

.app-footer-credit img {
  height: 34px;
  width: auto;
}

.app-footer-credit:hover {
  opacity: 1;
}

/* ============================================================
   Panel de efectos desplegable (pestaña + drawer)
   ============================================================ */

.sidebar-tab,
.sidebar-backdrop,
.sidebar-header {
  display: none;
}

/* ============================================================
   Responsive: tablet y móvil
   ============================================================ */

@media (max-width: 1024px) {
  .app-shell {
    flex: 1 0 auto;
    height: auto;
    overflow: visible;
  }

  /* Header en dos filas: marca + sesión arriba, acciones abajo */
  .top-nav {
    height: auto;
    flex-wrap: wrap;
    row-gap: 8px;
    column-gap: 8px;
    padding: 8px 12px;
  }

  .actions-group {
    display: contents;
  }

  .brand-group {
    order: 1;
    min-width: 0;
  }

  .auth-area {
    order: 2;
    margin-left: auto;
  }

  /* Salto de línea forzado entre la fila de marca y la de acciones */
  .top-nav::after {
    content: "";
    order: 3;
    flex-basis: 100%;
  }

  .history-controls {
    order: 4;
  }

  .preview-mode-switch {
    order: 5;
    margin-left: auto;
  }

  .export-actions {
    order: 6;
    gap: 8px;
  }

  .format-bar {
    padding: 8px 12px;
    gap: 10px;
  }

  /* Workspace apilado: el lienzo ocupa todo el ancho */
  .app-workspace {
    flex: 1 0 auto;
    flex-direction: column;
    overflow: visible;
  }

  /* Alto mínimo según la foto (lo fija el JS); si sobra pantalla, el lienzo crece */
  .canvas-viewport {
    flex: 1 0 auto;
    width: 100%;
    min-height: 0;
    padding: 12px;
  }

  .empty-dropzone {
    padding: 28px 20px;
    margin: 12px;
  }

  /* Pestaña siempre visible en el borde derecho */
  .sidebar-tab {
    display: inline-flex;
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 60;
    flex-direction: column;
    gap: 8px;
    padding: 14px 8px;
    background: var(--accent-primary);
    color: #ffffff;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    box-shadow: -4px 0 18px rgba(0, 0, 0, 0.45);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    transition: opacity var(--transition-normal), background-color var(--transition-fast);
  }

  .sidebar-tab span {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
  }

  .sidebar-controls {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    width: min(380px, 90vw);
    padding: 0 14px calc(16px + env(safe-area-inset-bottom, 0px));
    border-left: 1px solid var(--border-hover);
    box-shadow: -16px 0 40px rgba(0, 0, 0, 0.55);
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    overscroll-behavior: contain;
  }

  .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 2;
    margin: 0 -14px;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 10px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
  }

  .sidebar-header-title {
    font-size: 14px;
    font-weight: 800;
  }

  body.panel-open .sidebar-controls {
    transform: translateX(0);
  }

  body.panel-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  body.panel-open .sidebar-tab {
    opacity: 0;
    pointer-events: none;
  }

  body.panel-open {
    overflow: hidden;
  }

  /* Secciones inferiores a todo el ancho */
  .promo-carousel {
    height: auto;
    padding: 8px 12px;
  }

  .carousel-strip {
    height: auto;
    padding: 10px 12px 12px;
    gap: 10px;
  }

  .carousel-toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .carousel-track-wrapper {
    padding: 4px 0;
  }

  .toast-container {
    left: 12px;
    right: 12px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    align-items: center;
  }
}

@media (max-width: 640px) {
  .format-bar-title,
  .format-chip-sub {
    display: none;
  }

  .format-bar-chips {
    width: 100%;
    gap: 4px;
  }

  .format-chip {
    flex: 1 0 auto;
    padding: 7px 8px;
    gap: 5px;
  }

  .ai-status-pill {
    padding: 5px;
  }

  #ai-status-text,
  .brand-tag,
  .btn-compare span,
  .export-actions span,
  .user-name {
    display: none;
  }

  .ai-status-pill {
    margin-left: 0;
  }

  .btn-compare,
  .export-actions .btn-primary,
  .export-actions .btn-accent {
    padding: 8px 10px;
  }

  .carousel-actions {
    width: 100%;
  }

  .carousel-actions .btn-sm {
    flex: 1;
  }

  .promo-sublabel {
    display: none;
  }

  .dropzone-hints,
  .login-modal-perks {
    flex-wrap: wrap;
    justify-content: center;
  }
}


/* Pantallas táctiles: controles siempre visibles y tiradores más fáciles de tocar */
@media (hover: none) {
  .thumb-delete-btn {
    display: flex;
  }

  .pan-hint {
    opacity: 1;
    transform: none;
  }

  .canvas-interactive-overlay:not(.draggable) .pan-hint {
    opacity: 0;
  }

  .cropper-handle::before {
    content: "";
    position: absolute;
    inset: -12px;
  }

  .cropper-handle.handle-nw,
  .cropper-handle.handle-ne,
  .cropper-handle.handle-se,
  .cropper-handle.handle-sw {
    width: 18px;
    height: 18px;
  }

  }

/* Espera visible durante carga, detección y renderizado. */
.canvas-viewport { position: relative; }
.render-spinner {
  z-index: 30;
  background: rgba(17, 19, 30, 0.88);
  padding: 20px;
  border-radius: var(--radius-lg);
}
.loading-card {
  width: min(100%, 310px);
  padding: 28px 22px;
  border: 1px solid rgba(129, 140, 248, 0.25);
  border-radius: 20px;
  background: linear-gradient(145deg, #252a46, #171a2a);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.loading-card strong { font-size: 16px; color: #eef2ff; }
.loading-card p { margin: 0; font-size: 13px; line-height: 1.5; color: #b8bfd7; }
.canvas-footer-bar { flex-wrap: wrap; }
.thumb-delete-btn { display: flex; width: 28px; height: 28px; font-size: 14px; }
@media (prefers-reduced-motion: reduce) {
  .loading-card .spinner-circle { animation-duration: 1.8s; }
}

/* Zoom temporal de revisión: solo transforma la vista previa. */
#preview-image { transform-origin: 0 0; transition: transform 220ms ease-out; }
#preview-image.review-zoom-active { transition: none; will-change: transform; }
.review-zoom-hint { display: none; }
@media (pointer: coarse) {
  .review-zoom-hint { display: block; margin: 6px 0 0; text-align: center; font-size: 11px; color: var(--text-muted); }
}
@media (prefers-reduced-motion: reduce) {
  #preview-image { transition: none; }
}

.stickers-panel summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.stickers-panel summary span { font-size: 11px; font-weight: 400; color: var(--text-muted); margin-left: 8px; }
.sticker-help { font-size: 12px; line-height: 1.5; color: var(--text-muted); margin: 12px 0; }
.sticker-category { font-size: 12px; margin: 12px 0 6px; }
.sticker-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; }
.sticker-grid button { height: 56px; border: 1px solid var(--border-subtle); background: var(--bg-input); border-radius: 10px; padding: 6px; }
.sticker-grid button:hover { border-color: var(--accent-primary); }
.sticker-grid img { width: 100%; height: 100%; object-fit: contain; }
.sticker-layer { position: absolute; inset: 0; z-index: 26; pointer-events: none; transform-origin: 0 0; transition: transform 220ms ease-out; }
.sticker-layer.review-zoom-active { transition: none; }
.sticker-layer.editing { pointer-events: auto; touch-action: none; }
.placed-sticker { position: absolute; touch-action: none; }
.placed-sticker.selected { outline: 2px dashed #a5b4fc; outline-offset: 4px; cursor: move; }
.canvas-aspect-box .placed-sticker img { object-fit: contain; width: 100%; height: 100%; }
#sticker-done { z-index: 28; }
#sticker-controls { margin-top: 12px; }
#sticker-controls .slider-header { margin-top: 10px; }
.sticker-credits { display: inline-block; font-size: 11px; color: var(--text-muted); margin: 12px 8px 0 0; }
@media (prefers-reduced-motion: reduce) { .sticker-layer { transition: none; } }

.sticker-accessories button { background: #dce2ef; }

/* Escenas de la doble exposición */
.scene-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.scene-card {
  position: relative; padding: 0; border: 2px solid transparent; border-radius: 10px;
  overflow: hidden; background: var(--bg-card); cursor: pointer; aspect-ratio: 4 / 3;
}
.scene-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scene-card span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 4px 3px; font-size: 11px;
  color: #fff; text-align: center; background: linear-gradient(transparent, rgba(0,0,0,.65));
}
.scene-card.active { border-color: var(--accent-primary); }
.scene-card:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 1px; }

/* Sticker de WhatsApp */
.sticker-border-toggle {
  display: flex; align-items: center; gap: 6px; font-size: 12px;
  color: var(--text-muted); cursor: pointer; user-select: none; padding: 0 2px;
}
.sticker-border-toggle input { accent-color: var(--accent-primary); }

.sticker-dialog-box { max-width: 380px; }
.sticker-preview {
  position: relative; width: 256px; height: 256px; margin: 4px auto 12px; border-radius: 12px;
  background: repeating-conic-gradient(#2a2e3d 0% 25%, #222635 0% 50%) 50% / 20px 20px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.sticker-preview img { width: 256px; height: 256px; object-fit: contain; display: block; }
.sticker-preview.is-loading img { opacity: .45; }
.sticker-preview-loading {
  position: absolute; font-size: 12px; color: #fff; background: rgba(0,0,0,.55);
  padding: 4px 10px; border-radius: 999px;
}
.sticker-text-input {
  width: 100%; box-sizing: border-box; padding: 11px 12px; border-radius: 10px;
  border: 1px solid var(--border-color, rgba(255,255,255,.14)); background: var(--bg-card);
  color: inherit; font-size: 15px;
}
.sticker-text-input:focus { outline: 2px solid var(--accent-primary); outline-offset: 1px; }
.sticker-text-meta {
  display: flex; justify-content: space-between; align-items: center; margin: 8px 2px 14px;
  font-size: 12px; color: var(--text-muted);
}
.sticker-dialog-actions { display: flex; gap: 10px; justify-content: flex-end; }
