/* ==========================================================================
   ChromaStudio PRO — Modern Design System & Stylesheet
   Designed for Professional Designers & UI/UX Engineers
   ========================================================================== */

:root {
  --bg-main: #0b0f19;
  --bg-surface: #131b2e;
  --bg-surface-elevated: #1a243d;
  --bg-surface-hover: #223052;
  --bg-card: #151f36;
  --bg-card-inner: #0f1626;

  --border-subtle: #23304d;
  --border-card: #2c3c61;
  --border-active: #6366f1;
  --border-focus: #818cf8;

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

  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --accent-glow: rgba(99, 102, 241, 0.35);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Background Ambient Glows */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.22;
}
.glow-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #6366f1, transparent 70%);
  top: -100px;
  left: 5%;
}
.glow-2 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, #ec4899, transparent 70%);
  bottom: -100px;
  right: 5%;
}
.glow-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #3b82f6, transparent 70%);
  top: 35%;
  left: 45%;
}

/* ==========================================================================
   GLOBAL INPUTS & BUTTONS (NO DEFAULT BROWSER WHITE INPUTS)
   ========================================================================== */

input[type="text"], select {
  background: var(--bg-card-inner) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-card) !important;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.45rem 0.75rem;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input[type="text"]:focus, select:focus {
  border-color: var(--border-active) !important;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

input[type="color"] {
  -webkit-appearance: none;
  border: 1px solid var(--border-card);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--bg-card-inner);
  padding: 2px;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
}

/* ==========================================================================
   HEADER & NAVIGATION BAR
   ========================================================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  background: rgba(11, 15, 25, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  gap: 1.5rem;
}

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

.brand-badge {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.brand-info h1 {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.badge-pro {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 6px;
  background: var(--accent-gradient);
  border-radius: 999px;
  color: white;
  letter-spacing: 0.05em;
}

.brand-info p {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  background: #101726;
  padding: 4px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  gap: 3px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-btn svg {
  width: 15px;
  height: 15px;
}

.nav-btn:hover {
  color: var(--text-main);
  background: var(--bg-surface-elevated);
}

.nav-btn.active {
  color: #fff;
  background: var(--bg-surface-elevated);
  border-color: var(--border-active);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.highlight-nav-btn {
  color: #f472b6;
  background: rgba(236, 72, 153, 0.08);
}
.highlight-nav-btn:hover {
  background: rgba(236, 72, 153, 0.16);
  color: #fbcfe8;
}
.highlight-nav-btn.active {
  background: #24162e;
  border-color: #ec4899;
  color: #fff;
}

/* Header Action Buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.icon-action-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.icon-action-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-active);
}

.badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent-primary);
  color: white;
  font-size: 0.62rem;
  font-weight: 700;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--accent-gradient);
  color: white;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.5rem 1.05rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: 0 4px 14px var(--accent-glow);
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-active);
}

.btn-sm {
  font-size: 0.76rem;
  padding: 0.35rem 0.75rem;
}

/* ==========================================================================
   APP CONTENT & SECTION HEADERS
   ========================================================================== */

.app-content {
  flex: 1;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
}

.tab-pane {
  display: none;
  flex: 1;
  animation: tabFadeIn 0.2s ease-in-out;
}

.tab-pane.active {
  display: flex;
  flex-direction: column;
}

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

.section-header {
  padding: 1.25rem 2.5rem 0.75rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ==========================================================================
   TAB 1: LIVE PALETTE GENERATOR
   ========================================================================== */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  background: #0f1626;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 1rem;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.keyboard-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.keyboard-hint kbd {
  background: #1a233a;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}

.harmony-selector-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.color-count-ctrl {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-card-inner);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-card);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.ctrl-btn {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-weight: bold;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.count-value {
  font-weight: 700;
  color: var(--text-main);
  min-width: 14px;
  text-align: center;
}

/* Palette Canvas Hero Strip */
.palette-canvas {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 145px);
  width: 100%;
}

.color-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem 1.25rem;
  position: relative;
  transition: flex 0.2s ease, background-color 0.2s ease;
  user-select: none;
}

.column-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.action-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.8;
  transition: all var(--transition-fast);
}

.action-icon-btn:hover {
  opacity: 1;
  transform: scale(1.08);
  background: rgba(0, 0, 0, 0.5);
}

.action-icon-btn.is-locked {
  background: #ffffff;
  color: #0f172a;
  opacity: 1;
  border-color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.column-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
}

.color-hex {
  font-family: var(--font-mono);
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.color-hex:hover {
  background: rgba(0, 0, 0, 0.2);
}

.color-rgb-val {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  opacity: 0.85;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.color-rgb-val:hover {
  background: rgba(0, 0, 0, 0.18);
}

.color-name {
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.85;
}

.color-role-tag {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  margin-top: 2px;
}

.column-bottom {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.quick-tool-btn {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  color: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.quick-tool-btn:hover {
  background: rgba(0, 0, 0, 0.45);
  transform: translateY(-2px);
}

/* ==========================================================================
   RESALTADOR INTELIGENTE SEGÚN FONDO & CAPTURA (HIGH AESTHETICS)
   ========================================================================== */

.highlighter-container {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.5rem;
  padding: 0.5rem 2.5rem 3rem 2.5rem;
  flex: 1;
}

.highlighter-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.hl-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.hl-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: white;
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.hl-card-header h3 {
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.hl-card-header p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Screenshot Dropzone */
.screenshot-dropzone {
  border: 2px dashed var(--border-card);
  border-radius: var(--radius-lg);
  background: var(--bg-card-inner);
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: all var(--transition-fast);
}

.screenshot-dropzone:hover, .screenshot-dropzone.dragover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.08);
}

.screenshot-drop-content {
  text-align: center;
  padding: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.screenshot-drop-content svg {
  width: 26px;
  height: 26px;
  color: var(--accent-primary);
  margin-bottom: 2px;
}

.screenshot-drop-content p {
  font-size: 0.8rem;
  color: var(--text-main);
}

.screenshot-drop-content span {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.screenshot-preview-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.screenshot-preview-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: crosshair;
}

.picker-overlay-hint {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  font-size: 0.68rem;
  padding: 3px 7px;
  border-radius: 4px;
  pointer-events: none;
}

.btn-remove-screenshot {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Dual Inputs */
.inputs-grid-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.input-block label {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.color-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.hex-text-input {
  width: 100%;
}

.rgb-text-input {
  width: 100%;
}

.rgb-text-input-sm {
  width: 110px;
}

.current-bg-preview-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card-inner);
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
}

.bg-swatch-box {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.bg-swatch-info {
  display: flex;
  flex-direction: column;
}

.bg-title {
  font-size: 0.8rem;
  font-weight: 700;
}

.bg-meta {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.btn-generate-hl {
  width: 100%;
  justify-content: center;
  padding: 0.7rem;
  font-size: 0.88rem;
  border-radius: var(--radius-md);
}

/* Highlighter Results Area */
.highlighter-results {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  overflow-y: auto;
}

.results-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-card);
  padding-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.results-top-bar h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.results-top-bar p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.preview-mode-switch {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-card-inner);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-card);
}

.preview-mode-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  padding: 0 4px;
}

.mode-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mode-toggle-btn.active {
  background: var(--bg-surface-elevated);
  color: white;
  border: 1px solid var(--border-active);
}

.mode-toggle-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.options-groups {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.hl-group-section {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

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

.group-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.group-title svg {
  width: 17px;
  height: 17px;
  color: var(--accent-primary);
}

.group-title h4 {
  font-size: 0.95rem;
  font-weight: 700;
}

.group-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.hl-cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

/* Individual Pop Suggestion Card */
.hl-card-item {
  background: #0d1424;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.hl-card-item:hover {
  transform: translateY(-3px);
  border-color: var(--border-active);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

.hl-sample-surface {
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  position: relative;
  min-height: 115px;
  background-size: cover;
  background-position: center;
  transition: background 0.2s ease;
}

.hl-badge-preview {
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.hl-button-preview {
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.78rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.hl-card-details {
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: #090e1a;
  border-top: 1px solid var(--border-subtle);
}

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

.hl-ratio-tag {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 800;
  color: #38bdf8;
}

.hl-type-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.hl-codes-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: #060a12;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.hl-code-click {
  cursor: pointer;
  transition: color 0.15s ease;
}
.hl-code-click:hover {
  color: #38bdf8;
}

.hl-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.hl-action-btn {
  flex: 1;
  padding: 5px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.hl-action-btn:hover {
  border-color: var(--border-active);
  background: var(--bg-surface-hover);
}

/* ==========================================================================
   TAB 2: HARMONIES GRID
   ========================================================================== */

.base-picker-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-surface);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  flex-wrap: wrap;
}

.rgb-box-inline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.harmonies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
  padding: 1rem 2.5rem 3rem 2.5rem;
}

.harmony-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

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

.harmony-card-header h3 {
  font-size: 1.02rem;
  font-weight: 700;
}

.harmony-card-header p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.harmony-swatches {
  display: flex;
  height: 80px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.harmony-swatch {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: flex 0.15s ease;
}

.harmony-swatch:hover {
  flex: 1.45;
}

/* ==========================================================================
   TAB 3: SCALES & DESIGN SYSTEM TOKENS
   ========================================================================== */

.scale-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-surface);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  flex-wrap: wrap;
}

.scale-visualizer {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 8px;
  padding: 1rem 2.5rem;
}

.scale-step-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  transition: transform var(--transition-fast);
}

.scale-step-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-active);
}

.scale-step-color {
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.scale-step-info {
  padding: 0.6rem 0.4rem;
  text-align: center;
  background: var(--bg-card-inner);
}

.scale-step-num {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
}

.scale-step-hex {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.tokens-code-box {
  margin: 1.5rem 2.5rem 3rem 2.5rem;
  background: #050811;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.code-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.btn-copy-sm {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-copy-sm:hover {
  border-color: var(--accent-primary);
}

.tokens-code-box pre {
  padding: 1.25rem;
  overflow-x: auto;
}

.tokens-code-box code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.6;
}

/* ==========================================================================
   TAB 4: IMAGE EXTRACTOR
   ========================================================================== */

.extractor-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 1rem 2.5rem 3rem 2.5rem;
}

.drop-zone {
  border: 2px dashed var(--border-card);
  border-radius: var(--radius-xl);
  background: var(--bg-card-inner);
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: all var(--transition-normal);
  overflow: hidden;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.06);
}

.file-input-hidden {
  display: none;
}

.drop-content {
  text-align: center;
  padding: 2rem;
}

.drop-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem auto;
}

.drop-content h3 {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}

.drop-content p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.highlight-link {
  color: var(--accent-primary);
  text-decoration: underline;
}

.preview-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.preview-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-remove {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.75);
  color: white;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.extracted-results {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

.extracted-swatches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 12px;
  flex: 1;
  min-height: 220px;
  align-content: start;
}

.extracted-swatch-item {
  height: 110px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 8px;
  cursor: pointer;
  transition: transform var(--transition-fast);
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.extracted-swatch-item:hover {
  transform: scale(1.04);
}

.extracted-swatch-item span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  background: rgba(0, 0, 0, 0.45);
  padding: 2px 4px;
  border-radius: 4px;
}

.empty-state-text {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-dim);
  font-size: 0.88rem;
}

/* ==========================================================================
   TAB 5: ACCESSIBILITY WCAG & COLOR BLINDNESS
   ========================================================================== */

.a11y-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 1rem 2.5rem 3rem 2.5rem;
}

.a11y-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.a11y-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contrast-selector-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.pair-input label {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.4rem;
}

.contrast-score-display {
  background: #050811;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  border: 1px solid var(--border-subtle);
}

.ratio-number {
  font-size: 2.5rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #38bdf8;
}

.badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.badge-wcag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.badge-wcag.pass {
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.badge-wcag.fail {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.contrast-preview-sample {
  padding: 1.5rem;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.contrast-preview-sample h4 {
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
}

.contrast-preview-sample p {
  font-size: 0.88rem;
  line-height: 1.5;
}

.cb-sim-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.cb-item {
  background: var(--bg-card-inner);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cb-item-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
}

.cb-swatches-strip {
  display: flex;
  height: 36px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.cb-swatch {
  flex: 1;
  height: 100%;
}

/* ==========================================================================
   TAB 6: LIVE UI MOCKUP
   ========================================================================== */

.mockup-frame {
  margin: 1rem 2.5rem 3rem 2.5rem;
  background: #0f172a;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 480px;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(0,0,0,0.4);
}

.mockup-sidebar {
  background: #090e1a;
  padding: 1.5rem;
  border-right: 1px solid var(--border-card);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.mock-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.mock-logo-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-primary);
}

.mock-brand-text {
  font-weight: 700;
  font-size: 0.95rem;
}

.mock-menu {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mock-menu-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
}

.mock-menu-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-weight: 600;
}

.mockup-main {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.mock-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mock-topbar h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.mock-btn-primary {
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

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

.mock-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mock-kpi-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.mock-kpi-val {
  font-size: 1.5rem;
  font-weight: 800;
}

.mock-kpi-delta {
  font-size: 0.72rem;
  color: #4ade80;
}

.mock-chart-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mock-chart-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
}

.mock-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 120px;
  padding-top: 10px;
}

.mock-bar {
  flex: 1;
  border-radius: 6px 6px 0 0;
  transition: height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   MODALS
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
  animation: modalFadeIn 0.18s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-card {
  background: #0d1322;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0,0,0,0.65);
}

.modal-card-sm {
  max-width: 420px;
}

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

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

.modal-title h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  color: white;
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.color-preview-banner {
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.3);
}

.full-width-color-picker {
  width: 100%;
  height: 42px;
  -webkit-appearance: none;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
}

.full-width-color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}

.full-width-color-picker::-webkit-color-swatch {
  border: none;
  border-radius: var(--radius-sm);
}

.export-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.export-tab {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

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

.export-code-container {
  background: #050811;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  max-height: 250px;
  overflow-y: auto;
}

.export-code-container pre {
  padding: 1rem;
}

.export-code-container code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.6;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.saved-palettes-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-height: 350px;
  overflow-y: auto;
}

.saved-palette-item {
  background: var(--bg-card-inner);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.saved-strip {
  display: flex;
  height: 32px;
  width: 180px;
  border-radius: 6px;
  overflow: hidden;
}

.saved-color-dot {
  flex: 1;
  height: 100%;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #0f172a;
  border: 1px solid var(--accent-primary);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  animation: toastIn 0.25s ease, toastOut 0.25s ease 2.5s forwards;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

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

/* ==========================================================================
   RESPONSIVENESS
   ========================================================================== */

@media (max-width: 1040px) {
  .app-header {
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
  }
  .nav-tabs {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }
  .palette-canvas {
    flex-direction: column;
    min-height: auto;
  }
  .color-column {
    min-height: 140px;
    flex-direction: row;
    align-items: center;
  }
  .highlighter-container {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  .extractor-layout, .a11y-grid, .mockup-frame {
    grid-template-columns: 1fr;
    margin: 1rem;
    padding: 0.5rem;
  }
  .scale-visualizer {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    padding: 1rem;
  }
}
