/**
 * Fijate Tools - Probador de Uñas y Manicura en Vivo
 * Hoja de estilos canónica con tema claro y oscuro (Midnight Slate),
 * controles táctiles adaptados a móviles (>= 40px) y estética visual premium.
 */

:root {
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Paleta base modo oscuro (Midnight Slate) */
  --bg-app: #0b0f17;
  --bg-surface: #111726;
  --bg-surface-elevated: #182236;
  --bg-surface-subtle: #1e2a42;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(56, 189, 248, 0.5);

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

  --accent-primary: #38bdf8;
  --accent-primary-hover: #0ea5e9;
  --accent-gold: #c5a059;
  --accent-rose: #f43f5e;

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

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.6);
}

[data-theme="light"] {
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-surface-subtle: #e2e8f0;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-active: rgba(14, 165, 233, 0.6);

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

  --accent-primary: #0284c7;
  --accent-primary-hover: #0369a1;
  --accent-gold: #a17c38;
  --accent-rose: #e11d48;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

.mono,
.tech-spec-val,
code {
  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;
}

/* =============================================================================
   Estructura general y layout con sidebar AdSense
   ============================================================================= */

.tool-layout {
  max-width: 1280px;
  margin: 0.5rem auto 2.5rem;
  padding: 0 1rem;
  width: 100%;
  flex: 1 0 auto;
}

.tool-with-sidebar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 1536px) {
  .tool-with-sidebar {
    grid-template-columns: 1fr 300px;
  }
}

.tool-main-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.tool-ad-sidebar {
  display: none;
}

@media (min-width: 1536px) {
  .tool-ad-sidebar {
    display: block;
    position: sticky;
    top: 5.5rem;
    align-self: start;
    width: 300px;
  }
}

.tools-ad-banner-section.tools-ad-banner-top {
  margin: 0.2rem auto 0.6rem auto;
  min-height: 90px;
}

/* =============================================================================
   Tarjeta principal del simulador de uñas
   ============================================================================= */

.card-main {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Barra superior de modelos de estudio y fototipos de piel */
.studio-model-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.85rem;
  padding: 0.55rem 1rem;
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-subtle);
  min-height: 48px;
}

.studio-model-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.studio-model-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.studio-model-label svg {
  color: var(--accent-gold, #c5a059);
}

/* =============================================================================
   Barra de Looks Virales y Tendencias a 1 clic
   ============================================================================= */

.viral-presets-bar {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.6rem 1rem;
  background: linear-gradient(90deg, rgba(197, 160, 89, 0.08) 0%, rgba(56, 189, 248, 0.05) 50%, rgba(139, 92, 246, 0.08) 100%);
  border-bottom: 1px solid var(--border-subtle);
}

.presets-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.presets-title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-gold, #c5a059);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.btn-surprise-look {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 28px;
  padding: 0.2rem 0.65rem;
  background: linear-gradient(135deg, #f43f5e 0%, #a855f7 50%, #3b82f6 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-main);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.35);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-surprise-look:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.5);
}

.btn-surprise-look:active {
  transform: translateY(0) scale(0.98);
}

.presets-scroll-wrap {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.15rem 0 0.35rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.presets-scroll-wrap::-webkit-scrollbar {
  height: 4px;
}

.presets-scroll-wrap::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

.presets-scroll-wrap::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 4px;
}

.btn-preset-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0.3rem 0.85rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
  user-select: none;
}

.btn-preset-pill:hover {
  border-color: rgba(197, 160, 89, 0.6);
  color: var(--text-main);
  background: rgba(197, 160, 89, 0.14);
  transform: translateY(-1px);
}

.btn-preset-pill.active {
  border-color: var(--accent-gold, #c5a059);
  background: linear-gradient(135deg, rgba(197, 160, 89, 0.25) 0%, rgba(212, 175, 55, 0.15) 100%);
  color: var(--text-main);
  box-shadow: 0 0 10px rgba(197, 160, 89, 0.35);
  font-weight: 700;
}

/* Botones de acción principales */
.btn-action-primary,
.btn-action-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 32px;
  padding: 0.3rem 0.75rem;
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-action-primary {
  background: var(--accent-primary);
  color: #ffffff;
  border: none;
  box-shadow: 0 2px 6px rgba(56, 189, 248, 0.3);
}

.btn-action-primary:hover {
  background: var(--accent-primary-hover);
}

.btn-action-primary.active {
  background: #0284c7;
  outline: 2px solid #38bdf8;
}

.btn-action-secondary {
  background: var(--bg-surface-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-action-secondary:hover {
  background: var(--border-subtle);
  border-color: var(--accent-primary);
}

.btn-action-secondary.active {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: rgba(56, 189, 248, 0.1);
}

/* Barra de fototipos de piel integrada */
.skin-tone-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0;
  background: transparent;
  border-bottom: none;
}

.skin-tone-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 0.1rem;
}

.skin-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.skin-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 28px;
  padding: 0.2rem 0.55rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.skin-pill:hover {
  border-color: var(--accent-primary);
}

.skin-pill.active {
  border-color: var(--accent-primary);
  background: rgba(56, 189, 248, 0.15);
  font-weight: 600;
}

.skin-circle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.25);
  display: inline-block;
  flex-shrink: 0;
}

.btn-toggle-mini {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 28px;
  padding: 0.2rem 0.55rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-toggle-mini.active {
  color: var(--accent-gold);
  border-color: var(--accent-gold);
  background: rgba(197, 160, 89, 0.12);
}

/* =============================================================================
   Escenario interactivo (Stage con vídeo y canvas)
   ============================================================================= */

.stage-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

@media (min-width: 992px) {
  .stage-wrapper {
    grid-template-columns: 1.15fr 0.85fr;
    min-height: 440px;
    align-items: stretch;
  }
}

.stage-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 380px;
  background: radial-gradient(circle at center, #151d2e 0%, #0b0f17 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
}

@media (min-width: 768px) {
  .stage-viewport {
    min-height: 440px;
  }
}

.stage-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
}

.stage-canvas {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  cursor: pointer;
  display: block;
  margin: auto;
}

/* HUD superior de estado */
.stage-hud-top {
  position: absolute;
  top: 0.65rem;
  left: 0.75rem;
  right: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 5;
}

.stage-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(11, 15, 23, 0.85);
  backdrop-filter: blur(8px);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  font-weight: 500;
  color: #ffffff;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
}

.status-dot.ready {
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}

.status-dot.processing {
  background: #f59e0b;
  box-shadow: 0 0 6px #f59e0b;
  animation: pulse 1.5s infinite;
}

.status-dot.error {
  background: #ef4444;
}

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

/* Barra flotante inferior de herramientas sobre el escenario */
.stage-hud-bottom {
  position: absolute;
  bottom: 0.55rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.35rem;
  background: rgba(11, 15, 23, 0.88);
  backdrop-filter: blur(12px);
  padding: 0.25rem 0.45rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-lg);
  z-index: 10;
}

.btn-hud {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 28px;
  padding: 0.2rem 0.65rem;
  background: transparent;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-hud:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-hud.highlight {
  background: var(--accent-gold);
  color: #0b0f17;
}

.btn-hud.highlight:hover {
  background: #d4af37;
}

/* Divisor interactivo del comparador 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);
  cursor: ew-resize;
  z-index: 20;
}

.split-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  color: #0b0f17;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.split-labels {
  position: absolute;
  top: 1rem;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 1.5rem;
  pointer-events: none;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  z-index: 15;
}

.split-label-before {
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.split-label-after {
  color: var(--accent-primary);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* =============================================================================
   Panel lateral de controles de manicura y esmaltes
   ============================================================================= */

.controls-panel {
  padding: 0.85rem 1rem;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: flex-start;
  overflow-y: visible;
}

@media (min-width: 992px) {
  .controls-panel {
    border-top: none;
    border-left: 1px solid var(--border-subtle);
    max-height: none;
  }
}

/* Tarjetas modulares de belleza */
.control-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.control-card:hover {
  border-color: var(--border-active);
}

.card-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  line-height: 1.2;
}

.card-section-title {
  font-family: var(--font-heading);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

.control-val-badge {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--accent-primary);
  background: rgba(56, 189, 248, 0.14);
  padding: 0.12rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.btn-accent-finger {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 24px;
  padding: 0.15rem 0.55rem;
  background: rgba(197, 160, 89, 0.14);
  border: 1px solid rgba(197, 160, 89, 0.35);
  border-radius: var(--radius-sm);
  color: var(--accent-gold, #c5a059);
  font-family: var(--font-main);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-accent-finger:hover,
.btn-accent-finger.active {
  background: rgba(197, 160, 89, 0.28);
  border-color: var(--accent-gold, #c5a059);
  color: var(--text-main);
}

/* Cuadrícula de formas de uña: 4 columnas balanceadas */
.shapes-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
}

.btn-shape-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 48px;
  padding: 0.35rem 0.2rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-shape-option:hover {
  border-color: rgba(56, 189, 248, 0.5);
  color: var(--text-main);
  background: rgba(56, 189, 248, 0.08);
  transform: translateY(-1px);
}

.btn-shape-option.active {
  border-color: var(--accent-primary);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2) 0%, rgba(2, 132, 199, 0.28) 100%);
  color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.btn-shape-option svg {
  stroke: currentColor;
  width: 16px;
  height: 20px;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.btn-shape-option.active svg {
  transform: scale(1.08);
}

.btn-shape-option span {
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Fila interactiva de longitud de uña */
.length-slider-wrapper {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.1rem 0;
}

.length-hint-text {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.range-slider {
  flex: 1;
  height: 6px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, #1e293b 0%, #38bdf8 50%, #f43f5e 100%);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #38bdf8;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.range-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #38bdf8;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.range-slider::-webkit-slider-thumb:hover,
.range-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.7);
}

/* Selector de dedo individual (Segment control) */
.finger-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-surface);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.finger-tab {
  flex: 1 1 0%;
  min-width: 0;
  min-height: 28px;
  padding: 0.2rem 0.2rem;
  font-size: 0.72rem;
  font-weight: 500;
  text-align: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.finger-tab:hover {
  color: var(--text-main);
  background: var(--bg-surface-subtle);
}

.finger-tab.active {
  background: var(--bg-surface-subtle);
  color: var(--accent-primary);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.finger-tab.has-custom {
  position: relative;
}

.finger-tab.has-custom::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-gold, #c5a059);
  box-shadow: 0 0 5px rgba(197, 160, 89, 0.9);
}

.finger-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.28rem 0.55rem;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: var(--radius-sm);
  font-size: 0.73rem;
  animation: fadeInFast 0.18s ease;
}

[data-theme="light"] .finger-status-bar {
  background: rgba(2, 132, 199, 0.08);
  border-color: rgba(2, 132, 199, 0.22);
}

.finger-status-label {
  color: var(--accent-primary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-reset-finger {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 24px;
  padding: 0.15rem 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-main);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-reset-finger:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.45);
  color: #ef4444;
}

@keyframes fadeInFast {
  from { opacity: 0; transform: translateY(-2px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Subtítulos de agrupación dentro de tarjetas */
.group-sublabel {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  margin-top: 0.2rem;
  margin-bottom: -0.25rem;
  line-height: 1.2;
}

/* Selector de estilos de Nail Art: 3 columnas */
.styles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
}

.btn-style-option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0.25rem 0.2rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.73rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-style-option:hover {
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--accent-primary);
}

.btn-style-option.active {
  border-color: var(--accent-primary);
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-primary);
  font-weight: 700;
}

/* Selector de acabados: 4 columnas */
.finishes-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
}

.btn-finish-option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0.25rem 0.4rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-finish-option:hover {
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--accent-primary);
}

.btn-finish-option.active {
  border-color: var(--accent-primary);
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-primary);
  font-weight: 700;
}

/* Paletas y colecciones */
.palette-tabs {
  display: flex;
  gap: 0.3rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
}

.palette-tab {
  min-height: 26px;
  padding: 0.2rem 0.6rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.palette-tab:hover {
  color: var(--text-main);
  border-color: var(--border-active);
}

.palette-tab.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  box-shadow: 0 2px 6px rgba(56, 189, 248, 0.3);
}

/* Grilla de muestras circulares perladas tipo esmalte de uñas */
.swatches-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  justify-items: center;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.5rem;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.swatch-card {
  position: relative;
  width: 38px;
  height: 38px;
  max-width: 100%;
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.35);
  cursor: pointer;
  box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.5), inset 0 -3px 5px rgba(0, 0, 0, 0.45), 0 3px 8px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease, border-color 0.18s ease;
}

.swatch-card:hover {
  transform: scale(1.18);
  border-color: var(--accent-primary);
  box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.6), 0 4px 12px rgba(0, 0, 0, 0.4);
}

.swatch-card.active {
  transform: scale(1.18);
  border-color: #ffffff;
  outline: 3px solid var(--accent-primary);
  outline-offset: 2px;
  box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.7), 0 0 14px rgba(56, 189, 248, 0.7);
}

/* Barra de color activo y selector libre */
.active-color-info-bar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.4rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  min-height: 38px;
}

.active-color-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.5);
  flex-shrink: 0;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
}

.active-color-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.active-color-name {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.active-color-hex {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
}

.color-picker-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.15s ease;
}

.color-picker-label:hover {
  border-color: var(--accent-primary);
  background: rgba(56, 189, 248, 0.1);
}

.color-picker-label svg {
  width: 15px;
  height: 15px;
}

.color-picker-input {
  position: absolute;
  top: -10px;
  left: -10px;
  width: 48px;
  height: 48px;
  opacity: 0;
  cursor: pointer;
}

/* Selector de color secundario (oculto por defecto) */
.secondary-color-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.65rem;
  background: rgba(56, 189, 248, 0.08);
  border: 1px dashed var(--accent-primary);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  min-height: 32px;
}

/* Adaptación táctil responsiva para móviles y tablets (< 992px) */
@media (max-width: 991px) {
  .controls-panel {
    gap: 0.85rem;
    padding: 1rem;
  }
  .control-card {
    padding: 0.85rem 1rem;
  }
  .shapes-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
  }
  .btn-shape-option {
    min-height: 46px;
  }
  .btn-shape-option span {
    font-size: 0.72rem;
  }
  .finger-tab {
    min-height: 36px;
    font-size: 0.76rem;
  }
  .styles-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
  }
  .btn-style-option {
    min-height: 38px;
    font-size: 0.75rem;
  }
  .finishes-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
  }
  .btn-finish-option {
    min-height: 38px;
    font-size: 0.75rem;
  }
  .btn-action-primary,
  .btn-action-secondary {
    min-height: 40px;
    font-size: 0.85rem;
  }
  .swatches-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.2rem;
    padding: 0.45rem 0.35rem;
  }
  .swatch-card {
    width: 38px;
    height: 38px;
    max-width: 100%;
  }
  .skin-pill {
    min-height: 34px;
  }
  .btn-toggle-mini {
    min-height: 34px;
  }
}

/* =============================================================================
   Guías editoriales, consejos para manicuristas y FAQ
   ============================================================================= */

.content-guide-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.guide-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

.guide-p {
  color: var(--text-muted);
  line-height: 1.65;
  font-size: 0.95rem;
}

.shapes-advice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .shapes-advice-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .shapes-advice-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.shape-advice-card {
  padding: 1rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.shape-advice-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.shape-advice-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Acordeón FAQ */
.faq-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-summary {
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.faq-summary::after {
  content: '+';
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

details[open] .faq-summary::after {
  content: '−';
}

.faq-content {
  padding: 0 1.25rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

/* =============================================================================
   Modales accesibles (Alerta y Ficha para Salón)
   ============================================================================= */

.app-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
}

.app-modal-backdrop.is-open {
  display: flex;
}

.app-modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalEnter 0.2s ease-out;
}

.app-modal-card.card-export-modal {
  max-width: 640px;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.btn-close-modal {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
}

.modal-body {
  padding: 1.25rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 1rem 1.25rem;
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-subtle);
}

.card-preview-container {
  display: flex;
  justify-content: center;
  background: #0b0f17;
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.card-preview-image {
  max-width: 100%;
  max-height: 480px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  object-fit: contain;
}