/* ═══════════════════════════════════════════════
   DESIGN TOKENS & VARIABLES
═══════════════════════════════════════════════ */
:root {
  --primary: #3b82f6;
  --primary-glow: rgba(59, 130, 246, .35);
  --bg: #0a0b0f;
  --bg-1: #111218;
  --bg-2: #181a23;
  --bg-3: #1e2130;
  --bg-4: #252840;
  --border: rgba(83, 53, 53, 0.07);
  --border-2: rgba(255, 255, 255, .12);
  --text: #f0f1f5;
  --text-2: #9ca3b0;
  --text-3: #6b7280;
  --accent: #7c3aed;
  --accent-2: #06b6d4;
  --success: #10b981;
  --error: #f43f5e;
  --warn: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --shadow: 0 4px 24px rgba(0, 0, 0, .5);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, .7);
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --transition: 0.18s cubic-bezier(.4, 0, .2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ═══════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

html {
  scroll-behavior: smooth
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  outline: none
}

input,
select,
textarea {
  font-family: inherit;
  outline: none
}

a {
  color: inherit;
  text-decoration: none
}

/* ═══════════════════════════════════════════════
   SCROLLBAR
═══════════════════════════════════════════════ */
::-webkit-scrollbar {
  width: 5px;
  height: 5px
}

::-webkit-scrollbar-track {
  background: var(--bg-1)
}

::-webkit-scrollbar-thumb {
  background: var(--bg-4);
  border-radius: 99px
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-3)
}

/* ═══════════════════════════════════════════════
   NOISE TEXTURE OVERLAY
═══════════════════════════════════════════════ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ═══════════════════════════════════════════════
   AMBIENT GLOWS
═══════════════════════════════════════════════ */
.ambient {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(100px);
  opacity: .12;
  z-index: 0;
  transition: background 2s ease;
}

.ambient-1 {
  width: 600px;
  height: 600px;
  top: -200px;
  left: -100px;
  background: var(--primary)
}

.ambient-2 {
  width: 400px;
  height: 400px;
  bottom: -100px;
  right: -100px;
  background: var(--accent)
}

/* ═══════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════ */
.app-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ═══════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════ */
.header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 28px;
  height: 60px;
  background: rgba(10, 11, 15, .85);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -.02em;
  white-space: nowrap;
}

.logo-icon img {
  width: 200px;
  height: auto;
  margin-top: 14px;
}

.logo-icon {
  width: 150px;
  height: auto;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.logo span {
  color: var(--text-2);
  font-weight: 500
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 auto;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 4px;
}

.nav-btn {
  padding: 6px 16px;
  border-radius: 99px;
  background: none;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-body);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}

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

.nav-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 12px var(--primary-glow);
}

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

.icon-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: all var(--transition);
}

.icon-btn:hover {
  color: var(--text);
  background: var(--bg-3);
  border-color: var(--border-2)
}

/* ═══════════════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════════════ */
.main {
  flex: 1;
  padding: 28px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto
}

/* ═══════════════════════════════════════════════
   TABS CONTENT
═══════════════════════════════════════════════ */
.tab-pane {
  display: none;
  animation: fadeUp .3s ease-out
}

.tab-pane.active {
  display: block
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

/* ═══════════════════════════════════════════════
   DESIGN SYSTEM COMPONENTS
═══════════════════════════════════════════════ */
/* Card */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition);
}

.card:hover {
  border-color: var(--border-2)
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.card-header h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.card-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 16px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.card-body {
  padding: 24px
}

/* Label */
.label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  margin-bottom: 7px;
}

/* Input */
.input {
  width: 100%;
  padding: 9px 13px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13.5px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.input::placeholder {
  color: var(--text-3)
}

/* Select */
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

select.input option {
  background: var(--bg-2);
  color: var(--text)
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
  transition: opacity .15s;
}

.btn:hover::after {
  opacity: .06
}

.btn:active {
  transform: scale(.97)
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 12px var(--primary-glow);
}

.btn-primary:hover {
  box-shadow: 0 4px 20px var(--primary-glow)
}

.btn-secondary {
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--border-2);
}

.btn-secondary:hover {
  background: var(--bg-4);
  border-color: rgba(255, 255, 255, .2)
}

.btn-ghost {
  background: none;
  color: var(--text-2);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-2);
  background: var(--bg-2)
}

.btn-accent {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 2px 16px rgba(124, 58, 237, .3);
}

.btn-sm {
  padding: 6px 13px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 6px;
  font-weight: 600;
}

/* Slider / Range */
.slider-wrap {
  position: relative;
  padding: 4px 0
}

.range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: var(--bg-4);
  cursor: pointer;
  outline: none;
  position: relative;
  transition: opacity var(--transition);
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  border: 2.5px solid var(--bg-1);
  cursor: grab;
  box-shadow: 0 0 0 0 var(--primary-glow);
  transition: box-shadow var(--transition), transform var(--transition);
}

.range-slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 6px var(--primary-glow);
  transform: scale(1.15);
}

.range-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  box-shadow: 0 0 0 8px var(--primary-glow);
  transform: scale(1.2);
}

.range-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  border: 2.5px solid var(--bg-1);
  cursor: grab;
}

.range-track-fill {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  border-radius: 99px;
  background: var(--primary);
  pointer-events: none;
  transition: width var(--transition);
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slider-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  min-width: 36px;
  text-align: right;
}

/* Color Picker Input */
.color-picker-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-swatch-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-2);
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  transition: border-color var(--transition);
}

.color-swatch-btn:hover {
  border-color: rgba(255, 255, 255, .3)
}

.color-swatch-btn input[type="color"] {
  position: absolute;
  inset: 0;
  width: 150%;
  height: 150%;
  opacity: 0;
  cursor: pointer;
  left: -25%;
  top: -25%;
}

/* ═══════════════════════════════════════════════
   TAB 1 — SELECTOR
═══════════════════════════════════════════════ */
.selector-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}

.picker-card {
  padding: 0
}

.color-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1.7;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
  cursor: crosshair;
}

#color-map {
  display: block;
  width: 100%;
  height: 100%
}

.canvas-marker {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid #fff;
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .4), 0 2px 8px rgba(0, 0, 0, .5);
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: box-shadow var(--transition);
}

.picker-sliders {
  padding: 20px 24px 16px
}

.picker-slider-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.picker-slider-row:last-child {
  margin-bottom: 0
}

.picker-slider-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
  min-width: 54px;
}

.hue-track {
  position: relative;
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}

.alpha-track {
  position: relative;
  flex: 1;
  height: 4px;
  border-radius: 99px;
}

/* Format inputs */
.format-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.format-tab {
  flex: 1;
  padding: 5px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 5px;
  background: none;
  color: var(--text-3);
  transition: all var(--transition);
}

.format-tab.active {
  background: var(--bg-4);
  color: var(--text)
}

.format-inputs {
  display: flex;
  gap: 8px
}

.format-input-group {
  flex: 1
}

.format-input-group label {
  font-size: 10px;
  color: var(--text-3);
  font-weight: 600;
  letter-spacing: .06em;
  display: block;
  margin-bottom: 4px
}

/* Right column */
.selector-right {
  display: flex;
  flex-direction: column;
  gap: 16px
}

.preview-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.preview-swatch {
  height: 120px;
  transition: background .15s ease;
}

.preview-info {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.preview-hex {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .02em;
}

.preview-meta {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 1px
}

.preview-actions {
  display: flex;
  gap: 6px
}

.history-card .card-body {
  padding: 16px 20px
}

.history-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.history-dot {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  position: relative;
}

.history-dot:hover {
  transform: scale(1.15);
  border-color: rgba(255, 255, 255, .4)
}

.history-dot::after {
  content: attr(data-hex);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) scale(.8);
  background: var(--bg-4);
  color: var(--text);
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition);
  border: 1px solid var(--border-2);
}

.history-dot:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1)
}

/* ═══════════════════════════════════════════════
   TAB 2 — PALETTES
═══════════════════════════════════════════════ */
.palettes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.palette-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
}

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

.palette-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
}

.palette-card-title {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-display);
}

.palette-swatches {
  display: flex;
  height: 80px;
}

.palette-swatch {
  flex: 1;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: flex var(--transition);
}

.palette-swatch:hover {
  flex: 2.2
}

.palette-swatch-hex {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  opacity: 0;
  white-space: nowrap;
  transition: opacity var(--transition);
  pointer-events: none;
  backdrop-filter: blur(4px);
}

.palette-swatch:hover .palette-swatch-hex {
  opacity: 1
}

.palette-card-footer {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════
   TAB 3 — CONTRAST
═══════════════════════════════════════════════ */
.contrast-grid {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 20px;
  align-items: start;
}

.contrast-ratio-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  gap: 6px;
}

.ratio-number {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
  background: linear-gradient(135deg, var(--primary), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ratio-label {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 600;
  letter-spacing: .05em
}

.wcag-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
  margin-top: 8px
}

.badge {
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}

.badge-pass {
  background: rgba(16, 185, 129, .15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, .3)
}

.badge-fail {
  background: rgba(244, 63, 94, .15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, .3)
}

.badge-warn {
  background: rgba(245, 158, 11, .15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, .3)
}

.color-pair-inputs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 24px;
}

.color-input-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.color-input-role {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
  min-width: 44px;
}

.contrast-preview {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.preview-mock-nav {
  padding: 14px 20px;
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-mock-body {
  padding: 28px
}

.preview-mock-body h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 10px;
}

.preview-mock-body p {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 20px
}

.preview-mock-btn {
  display: inline-block;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: default;
}

/* ═══════════════════════════════════════════════
   TAB 4 — SIMULATOR
═══════════════════════════════════════════════ */
.simulator-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  align-items: start;
}

.simulator-controls .card-body {
  display: flex;
  flex-direction: column;
  gap: 16px
}

.control-field {
  display: flex;
  flex-direction: column;
  gap: 6px
}

.mock-browser {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.mock-browser-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}

.mock-dots {
  display: flex;
  gap: 5px
}

.mock-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%
}

.mock-dot-r {
  background: #f43f5e
}

.mock-dot-y {
  background: #f59e0b
}

.mock-dot-g {
  background: #10b981
}

.mock-url-bar {
  flex: 1;
  background: var(--bg-3);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 11px;
  color: var(--text-3);
}

.mock-site {
  padding: 0
}

.mock-site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  font-size: 13px;
  font-weight: 700;
}

.mock-site-nav-links {
  display: flex;
  gap: 20px;
  font-size: 12px;
  font-weight: 500;
  opacity: .8
}

.mock-hero {
  padding: 48px 24px;
  text-align: center;
}

.mock-hero h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 10px
}

.mock-hero p {
  font-size: 13px;
  opacity: .75;
  margin-bottom: 20px;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6
}

.mock-hero-btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: default;
}

.mock-cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 0 24px 28px;
}

.mock-card {
  padding: 16px;
  border-radius: 10px;
}

.mock-card-icon {
  font-size: 18px;
  margin-bottom: 8px
}

.mock-card-title {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px
}

.mock-card-text {
  font-size: 11px;
  opacity: .65;
  line-height: 1.5
}

/* ═══════════════════════════════════════════════
   TAB 5 — TOOLS / GRADIENT
═══════════════════════════════════════════════ */
.tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.tool-full {
  grid-column: 1/-1
}

/* Gradient tool */
.gradient-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  padding: 24px;
}

.grad-preview-area {
  aspect-ratio: 1.8;
  border-radius: var(--radius);
  border: 2px solid var(--border-2);
  overflow: hidden;
  position: relative;
  transition: box-shadow var(--transition);
  background: var(--bg-3);
}

.grad-preview-area:hover {
  box-shadow: 0 8px 40px rgba(0, 0, 0, .6)
}

#grad-preview {
  width: 100%;
  height: 100%;
  transition: background .18s ease
}

.grad-controls {
  display: flex;
  flex-direction: column;
  gap: 18px
}

.grad-type-row {
  display: flex;
  gap: 8px
}

.grad-type-btn {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  transition: all var(--transition);
}

.grad-type-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-color: transparent;
  color: #fff;
}

/* Stops list */
.stops-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.stop-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition);
  animation: stopIn .2s var(--ease-spring) both;
}

@keyframes stopIn {
  from {
    opacity: 0;
    transform: scale(.95) translateY(-4px)
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0)
  }
}

.stop-item:hover {
  border-color: var(--border-2)
}

.stop-color-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 2px solid var(--border-2);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
}

.stop-color-btn input[type="color"] {
  position: absolute;
  inset: 0;
  width: 150%;
  height: 150%;
  left: -25%;
  top: -25%;
  opacity: 0;
  cursor: pointer;
}

.stop-pos-wrap {
  flex: 1
}

.stop-pos-wrap .range-slider {
  --primary: var(--accent-2);
}

.stop-remove {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  color: var(--text-3);
  font-size: 14px;
  transition: all var(--transition);
}

.stop-remove:hover {
  background: rgba(244, 63, 94, .15);
  color: #fb7185
}

.stops-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.stops-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
}

/* Gradient Presets */
.presets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 24px 20px
}

.preset-swatch {
  width: 44px;
  height: 30px;
  border-radius: 7px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
}

.preset-swatch:hover {
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, .4)
}

/* Code area */
.code-area {
  padding: 0 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.code-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.code-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
}

.code-lang {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3)
}

.code-pre {
  padding: 12px 14px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: #a5f3fc;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.6;
}

/* Manipulation tool */
.manipulation-body {
  padding: 20px 24px
}

.adj-slider-group {
  margin-bottom: 16px
}

.adj-slider-group:last-child {
  margin-bottom: 0
}

.adj-slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}

.adj-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3)
}

.adj-val {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  min-width: 32px;
  text-align: right
}

.variations-section {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

.variations-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  margin-bottom: 10px;
}

.variations-row {
  display: flex;
  gap: 6px;
  height: 48px;
  border-radius: 10px;
  overflow: hidden;
}

.variation-swatch {
  flex: 1;
  cursor: pointer;
  position: relative;
  transition: flex var(--transition);
}

.variation-swatch:hover {
  flex: 2.5
}

.variation-swatch-label {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
  opacity: 0;
  white-space: nowrap;
  transition: opacity var(--transition);
}

.variation-swatch:hover .variation-swatch-label {
  opacity: 1
}

/* Intelligence tool */
.intel-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px
}

.intel-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.intel-icon {
  font-size: 20px;
  flex-shrink: 0
}

.intel-info {}

.intel-info strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px
}

.intel-info span {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.4
}

.theme-btns-row {
  display: flex;
  gap: 8px
}

/* Image extraction */
.drop-zone {
  margin: 0 24px 20px;
  border: 2px dashed var(--border-2);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--primary);
  background: rgba(59, 130, 246, .05);
}

.drop-zone-icon {
  font-size: 28px;
  margin-bottom: 8px
}

.drop-zone p {
  font-size: 13px;
  color: var(--text-2)
}

.drop-zone small {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
  display: block
}

.extracted-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 24px 20px;
}

.extracted-swatch {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  position: relative;
}

.extracted-swatch:hover {
  transform: scale(1.15);
  border-color: rgba(255, 255, 255, .4)
}

#image-input {
  display: none
}

/* ═══════════════════════════════════════════════
   DIRECTION INDICATOR
═══════════════════════════════════════════════ */
.direction-wheel {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.direction-line {
  position: absolute;
  width: 2px;
  height: 22px;
  background: var(--primary);
  border-radius: 99px;
  top: 50%;
  left: 50%;
  transform-origin: bottom center;
  bottom: 50%;
  top: auto;
  transition: transform var(--transition);
}

.direction-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
}

/* Gradient history */
.grad-history-strip {
  display: flex;
  gap: 6px;
  padding: 0 24px 16px;
  overflow-x: auto;
}

.grad-history-item {
  width: 56px;
  height: 36px;
  border-radius: 7px;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid transparent;
  transition: all var(--transition);
}

.grad-history-item:hover {
  border-color: rgba(255, 255, 255, .4);
  transform: scale(1.08)
}

/* ═══════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  animation: toastIn .25s var(--ease-spring);
  min-width: 220px;
}

.toast.removing {
  animation: toastOut .2s ease forwards
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(20px) scale(.95)
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1)
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(20px) scale(.95)
  }
}

.toast-icon {
  font-size: 16px
}

/* ═══════════════════════════════════════════════
   SEARCH MODAL
═══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
  animation: fadeIn .2s ease
}

.modal-box {
  background: var(--bg-1);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xl);
  width: 480px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
  animation: modalIn .25s var(--ease-spring);
  overflow: hidden;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(.95) translateY(-10px)
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0)
  }
}

.modal-search-input {
  width: 100%;
  padding: 18px 20px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 16px;
  font-family: var(--font-body);
}

.modal-search-input::placeholder {
  color: var(--text-3)
}

.modal-results {
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}

.search-result-item:hover {
  background: var(--bg-3)
}

.search-result-swatch {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  flex-shrink: 0
}

.search-result-info strong {
  display: block;
  font-size: 13px;
  font-weight: 600
}

.search-result-info span {
  font-size: 11px;
  color: var(--text-3)
}

/* ═══════════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════════ */
@keyframes fadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: .5
  }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-2) 0%, var(--bg-3) 50%, var(--bg-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  to {
    background-position: -200% 0
  }
}

/* ═══════════════════════════════════════════════
   SECTION HEADER
═══════════════════════════════════════════════ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 2px
}

/* ═══════════════════════════════════════════════
   DIVIDER
═══════════════════════════════════════════════ */
.divider {
  height: 1px;
  background: var(--border);
  margin: 0
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */
@media (max-width:1024px) {
  .selector-grid {
    grid-template-columns: 1fr
  }

  .contrast-grid {
    grid-template-columns: 1fr
  }

  .simulator-layout {
    grid-template-columns: 1fr
  }

  .gradient-layout {
    grid-template-columns: 1fr
  }

  .tools-grid {
    grid-template-columns: 1fr
  }
}

@media (max-width:768px) {
  .header {
    padding: 0 16px
  }

  .nav {
    display: none
  }

  .main {
    padding: 16px
  }

  .gradient-layout {
    padding: 16px
  }

  .mock-cards-row {
    grid-template-columns: 1fr 1fr
  }
}

@media (max-width:500px) {
  .mock-site-nav-links {
    display: none
  }

  .mock-cards-row {
    grid-template-columns: 1fr
  }
}

/* Gradient direction indicator row */
.angle-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.angle-row .slider-row {
  flex: 1
}

/* Highlight text focus */
.input:focus,
.range-slider:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}