/* ============================================================
   SELECTOR DE COLOR DE IMAGEN - FIJATE TOOLS
   CSS Moderno, Responsive & Optimizado
   ============================================================ */

:root {
  --bg-main: #0b0f19;
  --bg-surface: #111827;
  --bg-card: #1f2937;
  --bg-card-hover: #263345;
  --bg-input: #0f172a;
  --border-color: #374151;
  --border-focus: #3b82f6;
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-primary-glow: rgba(59, 130, 246, 0.25);

  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.35);

  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-title: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   CABECERA (.app-header)
   ============================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  height: 64px;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-back-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.2s ease;
}

.btn-back-tools:hover {
  color: var(--text-main);
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.08);
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo-box {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.3));
  border: 1px solid rgba(59, 130, 246, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
}

.brand-text {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.brand-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-header-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-header-action:hover {
  color: var(--text-main);
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.08);
}

.history-count-badge {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--accent-primary);
  color: #fff;
  border-radius: 9999px;
  padding: 0 4px;
}

/* ============================================================
   CONTENEDOR PRINCIPAL (.app-main-container)
   ============================================================ */
.app-main-container {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Barra de introducción */
.tool-intro-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 0.5rem;
}

.tool-main-heading {
  font-family: var(--font-title);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.tool-main-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  max-width: 800px;
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.28);
  color: #34d399;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
}

/* ============================================================
   WORKSPACE GRID (CANVAS + INSPECTOR)
   ============================================================ */
.color-workspace-grid {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 1.5rem;
  align-items: start;
}

.workspace-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

/* ============================================================
   CANVAS WORKSPACE (COLUMNA IZQUIERDA)
   ============================================================ */
.canvas-workspace-card {
  display: flex;
  flex-direction: column;
  min-height: 580px;
}

.canvas-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: rgba(15, 23, 42, 0.75);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.canvas-image-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.canvas-toolbar-buttons {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-tool-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-tool-icon:hover {
  color: var(--text-main);
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
}

.btn-tool-action-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-tool-action-sm:hover {
  color: var(--text-main);
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
}

/* Dropzone inicial */
.dropzone-area {
  flex: 1;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  padding: 2.5rem 1.5rem;
  background: 
    radial-gradient(circle at center, rgba(59, 130, 246, 0.04) 0%, transparent 70%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.01) 0, rgba(255,255,255,0.01) 10px, transparent 10px, transparent 20px);
  border: 2px dashed rgba(59, 130, 246, 0.25);
  margin: 1rem;
  border-radius: var(--radius-lg);
  transition: all 0.25s ease;
}

.dropzone-area:hover,
.dropzone-area.drag-over {
  border-color: var(--accent-primary);
  background-color: rgba(59, 130, 246, 0.06);
  transform: scale(0.995);
}

.file-input-hidden {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.dropzone-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  pointer-events: none;
}

.dropzone-icon-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.25));
  border: 1px solid rgba(59, 130, 246, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  margin-bottom: 0.5rem;
  box-shadow: 0 0 25px rgba(59, 130, 246, 0.2);
}

.dropzone-title {
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
}

.dropzone-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.dropzone-paste-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-dim);
  background: var(--bg-card);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.dropzone-paste-hint kbd {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.dropzone-formats {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

/* Visor Canvas */
.canvas-viewport {
  flex: 1;
  position: relative;
  background: #090d16;
  background-image: 
    linear-gradient(45deg, #0e1422 25%, transparent 25%), 
    linear-gradient(-45deg, #0e1422 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #0e1422 75%), 
    linear-gradient(-45deg, transparent 75%, #0e1422 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 520px;
  cursor: crosshair;
  padding: 1.5rem;
}

.canvas-pan-wrapper {
  display: inline-block;
  position: relative;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.7);
  border-radius: 4px;
  overflow: hidden;
  line-height: 0;
}

#main-canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Lupa flotante (Pixel Loupe) */
.pixel-loupe {
  position: fixed;
  pointer-events: none;
  z-index: 1000;
  width: 124px;
  height: 124px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 6px 20px rgba(0,0,0,0.8), 0 0 0 1px rgba(0,0,0,0.4);
  background: #000;
  overflow: hidden;
  transform: translate(20px, 20px);
  display: flex;
  align-items: center;
  justify-content: center;
}

#loupe-canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.loupe-crosshair {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.loupe-crosshair::before,
.loupe-crosshair::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 2px #000;
}

.loupe-crosshair::before {
  width: 12px;
  height: 2px;
}

.loupe-crosshair::after {
  width: 2px;
  height: 12px;
}

.loupe-color-badge {
  position: absolute;
  bottom: 6px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.8);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.canvas-bottom-hint {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  pointer-events: none;
  white-space: nowrap;
}

/* ============================================================
   PANEL DE INSPECCIÓN (COLUMNA DERECHA)
   ============================================================ */
.inspection-workspace-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Tarjeta Hero del Color Activo */
.active-color-hero {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.active-color-preview-box {
  height: 90px;
  width: 100%;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 0.75rem;
  transition: background-color 0.2s ease;
  box-shadow: inset 0 -10px 20px rgba(0, 0, 0, 0.15);
}

.active-color-pill {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.active-color-primary-meta {
  padding: 1rem;
  background: var(--bg-card);
}

.primary-hex-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.primary-hex-value {
  font-family: var(--font-mono);
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
}

.btn-copy-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--accent-primary);
  color: #fff;
  border: none;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-copy-inline:hover {
  background: var(--accent-primary-hover);
  box-shadow: var(--shadow-glow);
}

.color-rgb-readable {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Sección de Formatos */
.section-label {
  font-family: var(--font-title);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

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

.section-header-flex .section-label {
  margin-bottom: 0;
}

.btn-text-action {
  background: none;
  border: none;
  color: var(--accent-primary);
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

.btn-text-action:hover {
  background: rgba(59, 130, 246, 0.1);
}

.format-rows-container {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.format-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.6rem 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  transition: border-color 0.15s ease;
}

.format-row:hover {
  border-color: rgba(59, 130, 246, 0.5);
}

.format-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-dim);
  width: 55px;
}

.format-code {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 0.5rem;
}

.btn-format-copy {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-format-copy:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
}

/* Accesibilidad WCAG */
.wcag-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.wcag-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.wcag-preview-sample {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.wcag-meta {
  padding: 0.5rem;
}

.wcag-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-bottom: 0.35rem;
}

.wcag-target-name {
  color: var(--text-muted);
}

.wcag-ratio {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #fff;
}

.wcag-badges-row {
  display: flex;
  gap: 0.3rem;
}

.badge-wcag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-wcag.badge-wcag-pass {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

/* Paleta Dominante */
.palette-swatches-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.45rem;
}

.palette-swatch-item {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.palette-swatch-item:hover {
  transform: translateY(-2px) scale(1.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 2;
}

.palette-placeholder-hint {
  grid-column: 1 / -1;
  font-size: 0.8125rem;
  color: var(--text-dim);
  text-align: center;
  padding: 1rem;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-color);
}

/* Armonías Cromáticas */
.harmonies-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.harmony-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.harmony-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 500;
}

.harmony-swatches {
  display: flex;
  gap: 0.4rem;
}

.harmony-chip {
  flex: 1;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.harmony-chip:hover {
  transform: translateY(-2px);
}

/* ============================================================
   SECCIÓN EDUCATIVA Y FAQ
   ============================================================ */
.tool-content-info {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.info-columns-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.info-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.info-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-card-title {
  font-family: var(--font-title);
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
}

.info-card-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* FAQ Box */
.faq-container-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
}

.faq-main-title {
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.25rem;
}

.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-card);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

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

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

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

.faq-arrow {
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

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

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

/* ============================================================
   DRAWER PANEL (HISTORIAL)
   ============================================================ */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
}

.drawer-panel {
  width: 380px;
  max-width: 100%;
  height: 100%;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.25s ease-out;
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

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

.drawer-title-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}

.drawer-title-box h3 {
  font-family: var(--font-title);
  font-size: 1.125rem;
}

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

.btn-drawer-close:hover {
  color: #fff;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
}

.history-item-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.history-color-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.history-color-hex {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}

.history-empty-message {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-dim);
  padding: 2rem 0;
}

.drawer-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-drawer-action {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--accent-primary);
  color: #fff;
  border: none;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
}

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

.btn-drawer-danger {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: transparent;
  color: var(--accent-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
}

.btn-drawer-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* ============================================================
   MODALES CUSTOM
   ============================================================ */
.custom-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.custom-modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 540px;
  max-width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.custom-modal-sm {
  width: 420px;
}

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

.custom-modal-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.custom-modal-title h3 {
  font-family: var(--font-title);
  font-size: 1.125rem;
  color: #fff;
}

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

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

.export-tabs-nav {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.export-tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.export-tab-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

.export-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: #a5f3fc;
  resize: vertical;
}

.custom-modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

.btn-modal-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.btn-modal-secondary:hover {
  background: var(--bg-card-hover);
}

.btn-modal-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent-primary);
  border: none;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
}

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

.btn-modal-danger {
  background: var(--accent-danger);
  border: none;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.btn-modal-danger:hover {
  background: #dc2626;
}

/* ============================================================
   TOAST FLOTANTE
   ============================================================ */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  background: #10b981;
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-notification.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ============================================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ============================================================ */
@media (max-width: 1024px) {
  .color-workspace-grid {
    grid-template-columns: 1fr;
  }
  
  .info-columns-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .btn-text-desktop {
    display: none;
  }
  
  .tool-main-heading {
    font-size: 1.35rem;
  }
  
  .canvas-top-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .canvas-toolbar-buttons {
    width: 100%;
    justify-content: space-between;
  }
  
  .palette-swatches-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .wcag-grid {
    grid-template-columns: 1fr;
  }
}
