/* ==========================================================================
   Fijate Tools - Probador de Color de Pelo en Vivo con Cámara
   Estilo corporativo adaptativo con aceleración GPU y paleta Midnight Slate
   ========================================================================== */

:root,
[data-theme="dark"],
body.dark-mode {
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Paleta corporativa oscura (Midnight Slate) */
  --bg-page: #0b0f17;
  --bg-card: #111827;
  --bg-surface: #1e293b;
  --bg-surface-hover: #26334d;
  --bg-input: #0f172a;
  
  --border-color: rgba(255, 255, 255, 0.1);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-focus: #8b5cf6;

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

  --color-primary: #8b5cf6;
  --color-primary-hover: #7c3aed;
  --color-primary-rgb: 139, 92, 246;

  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);

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

[data-theme="light"],
body.light-mode,
body.light-theme {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-surface: #f1f5f9;
  --bg-surface-hover: #e2e8f0;
  --bg-input: #ffffff;

  --border-color: rgba(0, 0, 0, 0.12);
  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-focus: #7c3aed;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;

  --color-primary: #7c3aed;
  --color-primary-hover: #6d28d9;
  --color-primary-rgb: 124, 58, 237;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Contención estructural y tipografías
   ========================================================================== */

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

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-main);
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.brand-title,
.seo-title,
.modal-title {
  font-family: var(--font-heading);
}

.mono,
.slider-val,
.hex-text {
  font-family: var(--font-mono);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Layout institucional */
.tool-layout {
  max-width: 1200px;
  width: 100%;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  flex: 1 0 auto;
}

.tool-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
}

/* Tarjeta principal */
.card-main {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
  backdrop-filter: blur(12px);
}

/* ==========================================================================
   Barra superior de selección de entrada
   ========================================================================== */

.input-source-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.source-group-left,
.source-group-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
}

.btn-action-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.625rem 1.25rem;
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 42px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  box-shadow: 0 4px 14px rgba(var(--color-primary-rgb), 0.35);
}

.btn-action-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(var(--color-primary-rgb), 0.45);
}

.btn-action-primary:active {
  transform: translateY(0);
}

.btn-action-secondary,
.btn-upload-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.625rem 1rem;
  font-family: var(--font-main);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 42px;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn-action-secondary:hover,
.btn-upload-label:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-focus);
  transform: translateY(-1px);
}

.sample-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
}

.btn-sample-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-main);
  cursor: pointer;
  min-height: 36px;
  transition: all 0.15s ease;
}

.btn-sample-pill:hover {
  border-color: var(--color-primary);
  background: var(--bg-surface-hover);
}

.sample-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.sample-dot.brunette {
  background: #4a2e18;
}

.sample-dot.blonde {
  background: #d4af37;
}

/* ==========================================================================
   Escenario interactivo (Cámara / Canvas / Split Slider)
   ========================================================================== */

.stage-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 580px;
  background: #05070a;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: none;
}

.stage-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0.001;
  pointer-events: none;
  z-index: -1;
}

.stage-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Badge de estado flotante */
.stage-status-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(11, 15, 23, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: #f8fafc;
  z-index: 10;
  pointer-events: none;
}

.status-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-subtle);
}

.status-indicator-dot.active {
  background-color: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
}

.status-indicator-dot.processing {
  background-color: var(--color-warning);
  animation: pulse-dot 1.2s infinite;
}

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

/* Split slider interactivo (Antes / Después) */
.split-divider-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
  z-index: 15;
  cursor: ew-resize;
  pointer-events: auto;
}

.split-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  color: #0b0f17;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  cursor: ew-resize;
  border: 2px solid var(--color-primary);
  transition: transform 0.1s ease;
}

.split-handle:hover {
  transform: translate(-50%, -50%) scale(1.1);
}

.split-labels {
  position: absolute;
  bottom: 4.5rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 12;
}

.split-badge {
  background: rgba(11, 15, 23, 0.85);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Barra de acciones flotantes en el lienzo */
.stage-action-bar {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-full);
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  max-width: 95%;
}

.btn-stage-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  color: #f8fafc;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  padding: 0.45rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  min-height: 38px;
  transition: all 0.15s ease;
}

.btn-stage-action:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-stage-action.active {
  background: var(--color-primary);
  color: #ffffff;
}

/* Loading overlay */
.stage-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 15, 23, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 30;
  color: #ffffff;
  text-align: center;
  padding: 1.5rem;
}

.spinner-circle {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1rem;
}

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

.loading-msg {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.loading-submsg {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Panel de control de colorimetría y tintes
   ========================================================================== */

.color-controls-section {
  margin-top: 1.5rem;
}

.controls-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.category-tabs {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-surface);
  padding: 0.3rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.tab-pill {
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: var(--radius-full);
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 38px;
}

.tab-pill:hover {
  color: var(--text-main);
}

.tab-pill.active {
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(var(--color-primary-rgb), 0.3);
}

.current-shade-display {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
}

.shade-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
}

.shade-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Grilla de Swatches */
.swatches-panel {
  display: none;
  margin-bottom: 1.5rem;
}

.swatches-panel.active {
  display: block;
}

.swatches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.75rem;
}

.swatch-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.5rem;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  min-height: 80px;
}

.swatch-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary);
  background: var(--bg-surface-hover);
}

.swatch-card.active {
  border-color: var(--color-primary);
  background: var(--bg-surface-hover);
  box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.4);
}

.swatch-preview {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-bottom: 0.5rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}

.swatch-card:hover .swatch-preview,
.swatch-card.active .swatch-preview {
  transform: scale(1.1);
}

.swatch-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
  text-align: center;
  line-height: 1.2;
}

/* Selector personalizado */
.custom-color-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
}

.picker-input-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.color-wheel-input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
  padding: 0;
}

.color-wheel-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-wheel-input::-webkit-color-swatch {
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.hex-text {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-main);
  background: var(--bg-input);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.picker-help-text {
  font-size: 0.8125rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0;
}

/* Deslizadores de ajuste fino */
.sliders-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1rem;
}

.slider-control {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-header label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
}

.slider-val {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-primary);
  background: var(--bg-card);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.styled-range {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  outline: none;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
}

.styled-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.styled-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.styled-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

/* ==========================================================================
   Guía educativa SEO y preguntas frecuentes
   ========================================================================== */

.seo-guide-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.seo-title {
  font-size: 1.5rem;
  margin: 0 0 0.75rem;
  color: var(--text-main);
  line-height: 1.25;
}

.seo-intro {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 1.5rem;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.faq-item[open] {
  border-color: var(--color-primary);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  list-style: none;
  user-select: none;
  min-height: 44px;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-icon {
  flex-shrink: 0;
  transition: transform 0.2s ease;
  color: var(--text-muted);
}

.faq-item[open] .faq-icon {
  transform: rotate(180deg);
  color: var(--color-primary);
}

.faq-answer {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
}

.faq-answer p {
  margin: 0 0 0.75rem;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

.faq-answer ul {
  margin: 0 0 0.75rem;
  padding-left: 1.25rem;
}

.faq-answer li {
  margin-bottom: 0.35rem;
}

/* ==========================================================================
   Modal accesible de avisos y confirmaciones
   ========================================================================== */

.app-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.modal-dialog {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 460px;
  width: 100%;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  z-index: 10;
  animation: modal-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.modal-title {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text-main);
}

.btn-close-modal {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}

.btn-close-modal:hover {
  color: var(--text-main);
}

.modal-body {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Acciones interactivas dentro del modal de aviso */
.modal-actions-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-top: 1rem;
}

.btn-modal-action {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  min-height: 44px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-modal-action:hover {
  background: var(--bg-surface-hover);
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

.btn-modal-action.primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.3);
}

.modal-notice-box {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-main);
  line-height: 1.45;
  margin-bottom: 0.75rem;
}

/* ==========================================================================
   Adaptación responsiva para móviles
   ========================================================================== */

@media (max-width: 768px) {
  .card-main {
    padding: 1rem;
  }

  .input-source-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .source-group-left {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .source-group-left .btn-action-primary,
  .source-group-left .btn-mobile-capture {
    grid-column: span 1;
    width: 100%;
    font-size: 0.8125rem;
    padding: 0.5rem 0.65rem;
  }

  .source-group-right {
    justify-content: center;
  }

  .stage-container {
    aspect-ratio: 3 / 4; /* Óptimo para selfies en posición vertical de smartphone */
  }

  .stage-action-bar {
    width: calc(100% - 1.5rem);
    justify-content: space-around;
    padding: 0.3rem;
  }

  .btn-stage-action {
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
  }

  .sliders-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .swatches-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .swatch-card {
    padding: 0.5rem 0.25rem;
    min-height: 72px;
  }

  .swatch-preview {
    width: 26px;
    height: 26px;
    margin-bottom: 0.35rem;
  }

  .controls-header {
    flex-direction: column;
    align-items: stretch;
  }

  .category-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tab-pill {
    padding: 0.45rem 0.25rem;
    font-size: 0.75rem;
    text-align: center;
  }
}
