/* ===========================================================================
   LIQUID GLASS — Apple WWDC25 inspired design language
   Layer loaded LAST → sobreescribe lo viejo donde sea relevante.

   Principios:
   - Materiales translúcidos con backdrop-filter (blur + saturate)
   - Bordes con luminancia interna (specular highlight gradiente)
   - Radios continuos (squircle-feel: 18-32px)
   - Tipografía SF Pro / system-ui con tracking ligeramente negativo
   - Acentos luminosos (menos saturación, más brillo)
   - Sombras de profundidad blanda (multi-capa)
   - Sin bordes duros #262626; reemplazo con hairlines rgba(255,255,255,.06)
   =========================================================================== */

:root {
  /* — Base canvas — */
  --bg:        #0A0B10;        /* dark indigo, no negro puro */
  --bg-soft:   #0E1018;
  --bg-orb-1:  rgba(124, 92, 246, 0.18);  /* ambient purple orb */
  --bg-orb-2:  rgba(45,  212, 191, 0.10); /* ambient teal   orb */
  --bg-orb-3:  rgba(244, 114, 182, 0.07); /* ambient pink   orb */

  /* — Hairlines (no más #262626) — */
  --line:      rgba(255,255,255,0.06);
  --line-2:    rgba(255,255,255,0.04);
  --dot:       rgba(255,255,255,0.04);

  /* — Glass material (frosted) — */
  --glass-bg:        rgba(20, 22, 30, 0.72);
  --glass-bg-hi:     rgba(28, 30, 40, 0.80);
  --glass-bg-strong: rgba(14, 16, 24, 0.88);
  --glass-blur:      blur(24px) saturate(160%);
  --glass-blur-sm:   blur(14px) saturate(140%);

  /* — Specular edge (luminous top highlight) — */
  --edge-shine:
    inset 0 1px 0 rgba(255,255,255,0.10),
    inset 0 0 0 1px rgba(255,255,255,0.05);
  --edge-shine-strong:
    inset 0 1px 0 rgba(255,255,255,0.16),
    inset 0 0 0 1px rgba(255,255,255,0.07);

  /* — Shadows (atmospheric) — */
  --shadow-1: 0 10px 30px -8px rgba(0,0,0,0.5);
  --shadow-2: 0 22px 60px -16px rgba(0,0,0,0.65), 0 6px 14px -6px rgba(0,0,0,0.4);
  --shadow-elevated:
    0 30px 80px -22px rgba(0,0,0,0.75),
    0 10px 30px -10px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.10),
    inset 0 0 0 1px rgba(255,255,255,0.05);

  /* — Texto — */
  --text-1: rgba(255,255,255,0.96);
  --text-2: rgba(255,255,255,0.74);
  --text-3: rgba(255,255,255,0.50);
  --text-4: rgba(255,255,255,0.32);

  /* — Acentos luminosos (menos saturados, más vivos) — */
  --accent:   #A78BFA;
  --accent-2: #C4B5FD;
  --accent-3: #DDD6FE;
  --success:  #34D399;
  --success-2:#6EE7B7;
  --warn:     #FBBF24;
  --danger:   #FB7185;
  --blue:     #7DD3FC;
  --indigo:   #818CF8;

  /* — Curva Apple ease-out — */
  --ease: cubic-bezier(0.32, 0.72, 0.0, 1);
}

/* ---------------------------------------------------------------------------
   Tipografía SF Pro (system-ui en macOS)
   --------------------------------------------------------------------------- */
html, body {
  font-family:
    -apple-system, BlinkMacSystemFont,
    "SF Pro Display", "SF Pro Text",
    system-ui, "Segoe UI", "Helvetica Neue", Helvetica,
    "Geist", Arial, sans-serif !important;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
}
.mono {
  font-family:
    "SF Mono", ui-monospace, "Menlo", "Monaco", "Cascadia Mono",
    "JetBrains Mono", monospace !important;
  letter-spacing: 0.02em;
}

/* ---------------------------------------------------------------------------
   Ambient background — orbes de luz suaves de fondo (estáticos, no animados)
   --------------------------------------------------------------------------- */
body::before {
  content: "";
  position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(50vmax 40vmax at 18% 12%, var(--bg-orb-1), transparent 65%),
    radial-gradient(40vmax 35vmax at 88% 88%, var(--bg-orb-2), transparent 70%),
    var(--bg);
}
.app { background: transparent !important; position: relative; z-index: 1; }

/* Canvas viewport — fondo transparente, grilla más fina */
.canvas-viewport { background: transparent !important; }
.canvas-world {
  background-image: radial-gradient(circle at center, rgba(255,255,255,0.05) 1px, transparent 1.5px) !important;
  background-size: 28px 28px !important;
}
.canvas-vignette { display: none; }

/* ---------------------------------------------------------------------------
   Topbar — glass flotante
   --------------------------------------------------------------------------- */
.topbar {
  position: fixed; top: 14px; left: 14px; right: 14px;
  z-index: 45;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px !important;
  background: var(--glass-bg) !important;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 0 !important;
  border-radius: 22px;
  box-shadow: var(--shadow-2), var(--edge-shine);
}

.brand-mark {
  width: 30px; height: 30px;
  border-radius: 10px;
  background: linear-gradient(135deg, #A78BFA 0%, #818CF8 100%) !important;
  border: 0 !important;
  box-shadow:
    0 6px 18px rgba(124,92,246,0.45),
    inset 0 1px 0 rgba(255,255,255,0.3);
}
.brand-mark::before {
  background: rgba(255,255,255,0.95);
  width: 6px; height: 6px;
  box-shadow: none;
}
.brand-name { font-weight: 600; letter-spacing: -0.012em; }
.brand-name sup {
  background: rgba(255,255,255,0.10);
  border: 0;
  color: rgba(255,255,255,0.78);
  font-weight: 500;
  border-radius: 5px;
}

/* Mode tabs — glass segmented */
.mode-tabs {
  background: rgba(0,0,0,0.20) !important;
  border: 0 !important;
  border-radius: 13px;
  padding: 4px !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}
.mode-tab {
  border-radius: 9px !important;
  padding: 7px 14px !important;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.mode-tab.is-active {
  background: linear-gradient(135deg, rgba(167,139,250,0.32), rgba(124,58,237,0.22)) !important;
  color: #fff !important;
  box-shadow:
    0 6px 18px -6px rgba(124,58,237,0.55),
    inset 0 1px 0 rgba(255,255,255,0.30),
    inset 0 0 0 1px rgba(167,139,250,0.40) !important;
  backdrop-filter: blur(12px) saturate(1.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  transition: all .4s cubic-bezier(0.32,0.72,0,1);
}
.mode-tab.is-active .mode-tab-dot {
  background: #C4B5FD !important;
  box-shadow: 0 0 12px rgba(196,181,253,0.9);
}
html[data-theme="light"] .mode-tab.is-active {
  background: linear-gradient(135deg, rgba(124,58,237,0.18), rgba(167,139,250,0.12)) !important;
  color: #4C1D95 !important;
  box-shadow:
    0 6px 18px -6px rgba(124,58,237,0.35),
    inset 0 1px 0 rgba(255,255,255,0.6),
    inset 0 0 0 1px rgba(124,58,237,0.30) !important;
}

.crumb { font-weight: 400; }
.crumb b { font-weight: 600; }

.btn-ghost, .btn-primary {
  border-radius: 11px !important;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.btn-primary {
  background: linear-gradient(180deg, #A78BFA 0%, #8B5CF6 100%) !important;
  border: 0 !important;
  color: #fff !important;
  padding: 8px 14px !important;
  box-shadow:
    0 8px 20px -6px rgba(139,92,246,0.5),
    inset 0 1px 0 rgba(255,255,255,0.25),
    inset 0 0 0 1px rgba(255,255,255,0.10) !important;
}
.btn-primary:hover:not(:disabled) {
  box-shadow:
    0 12px 28px -6px rgba(139,92,246,0.7),
    inset 0 1px 0 rgba(255,255,255,0.30),
    inset 0 0 0 1px rgba(255,255,255,0.15) !important;
  transform: translateY(-1px);
}
.btn-ghost {
  background: rgba(255,255,255,0.05) !important;
  border: 0 !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.08) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10);
}

/* ---------------------------------------------------------------------------
   Left rail — flotante, glass
   --------------------------------------------------------------------------- */
.leftrail {
  top: 78px; left: 14px; bottom: 14px;
  width: 60px;
  background: var(--glass-bg) !important;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 0 !important;
  border-radius: 20px;
  box-shadow: var(--shadow-2), var(--edge-shine);
  padding: 10px 0;
}
.rail-item {
  width: 44px; height: 44px;
  border-radius: 13px !important;
}
.rail-item:hover {
  background: rgba(255,255,255,0.07);
  color: var(--text-1);
}
.rail-item.is-active {
  background: linear-gradient(135deg, rgba(167,139,250,0.30), rgba(139,92,246,0.18)) !important;
  color: var(--text-1) !important;
  box-shadow:
    0 6px 14px -4px rgba(124,92,246,0.5),
    inset 0 1px 0 rgba(255,255,255,0.22),
    inset 0 0 0 1px rgba(255,255,255,0.08);
}
.rail-item-marker { display: none; }     /* la propia píldora ya marca activo */
.rail-item::after {
  background: rgba(20,22,30,0.92) !important;
  border: 0 !important;
  box-shadow:
    0 10px 24px -8px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.10),
    inset 0 0 0 1px rgba(255,255,255,0.06) !important;
  border-radius: 9px !important;
}

.rail-item-badge {
  background: linear-gradient(180deg, #A78BFA, #8B5CF6) !important;
  box-shadow:
    0 4px 10px -2px rgba(124,92,246,0.5),
    inset 0 1px 0 rgba(255,255,255,0.3);
}

/* ---------------------------------------------------------------------------
   Drawers — glass flotante, no edge-to-edge
   --------------------------------------------------------------------------- */
.left-drawer {
  top: 78px; bottom: 14px; left: 82px;
  background: var(--glass-bg-strong) !important;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 0 !important;
  border-radius: 22px;
  box-shadow: var(--shadow-elevated);
  width: 340px;
}
.drawer-head {
  border-bottom: 1px solid rgba(255,255,255,0.05) !important;
  padding: 18px 20px 16px !important;
}
.drawer-title { font-size: 16px; font-weight: 600; letter-spacing: -0.015em; }
.drawer-kicker {
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3) !important;
  font-size: 10.5px;
}

.drawer-section-label {
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 10.5px;
  color: var(--text-3) !important;
}

.node-add-card {
  background: rgba(255,255,255,0.04) !important;
  border: 0 !important;
  border-radius: 16px !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  padding: 14px 16px !important;
}
.node-add-card:hover {
  background: rgba(255,255,255,0.07) !important;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--add-c) 55%, transparent),
    0 14px 30px -10px color-mix(in srgb, var(--add-c) 28%, transparent),
    inset 0 1px 0 rgba(255,255,255,0.10) !important;
  transform: translateY(-2px);
}
.node-add-icon {
  background: rgba(255,255,255,0.04);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
.node-add-title { font-weight: 600; letter-spacing: -0.005em; }
.node-add-hint  { letter-spacing: 0.06em; }
.node-add-plus {
  background: color-mix(in srgb, var(--add-c) 22%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--add-c) 35%, transparent);
}

.tpl-card {
  border: 0 !important;
  background: rgba(255,255,255,0.025) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
  border-radius: 14px !important;
}
.tpl-card:hover {
  background: rgba(255,255,255,0.05) !important;
  box-shadow: inset 0 0 0 1px rgba(167,139,250,0.4);
}

/* — Moodboard drawer y Gallery drawer — usan los mismos tokens — */
.vault-sheet {
  background: var(--glass-bg-strong) !important;
  border-radius: 22px !important;
  border: 0 !important;
  box-shadow: var(--shadow-elevated) !important;
  top: 78px !important; bottom: 14px !important; left: 82px !important;
  max-width: calc(100vw - 96px) !important;
}
.gallery-panel {
  background: var(--glass-bg-strong) !important;
  border: 0 !important;
  border-radius: 22px !important;
  box-shadow: var(--shadow-elevated) !important;
  top: 78px !important; bottom: 14px !important; left: 82px !important;
}

/* ---------------------------------------------------------------------------
   Nodos del canvas — material glass
   --------------------------------------------------------------------------- */
.node-v2 {
  background: var(--glass-bg-hi) !important;
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 0 !important;
  border-radius: 22px !important;
  box-shadow: var(--shadow-elevated) !important;
}
.node-wrap:hover .node-v2 {
  box-shadow:
    0 32px 80px -22px rgba(0,0,0,0.7),
    0 12px 30px -10px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.14),
    inset 0 0 0 1px rgba(167,139,250,0.35),
    0 0 32px rgba(167,139,250,0.18) !important;
  transform: scale(1.012);
}
.node-wrap:hover .node-v2[data-accent="green"] {
  box-shadow:
    0 32px 80px -22px rgba(0,0,0,0.7),
    0 12px 30px -10px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.14),
    inset 0 0 0 1px rgba(52,211,153,0.4),
    0 0 32px rgba(52,211,153,0.18) !important;
}
.node-wrap:hover .node-v2[data-accent="amber"] {
  box-shadow:
    0 32px 80px -22px rgba(0,0,0,0.7),
    0 12px 30px -10px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.14),
    inset 0 0 0 1px rgba(251,191,36,0.4),
    0 0 32px rgba(251,191,36,0.18) !important;
}
.node-v2.is-selected {
  box-shadow:
    0 36px 90px -22px rgba(0,0,0,0.75),
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 0 0 1.5px var(--accent),
    0 0 40px rgba(167,139,250,0.32) !important;
}

.node-v2-header {
  border-bottom: 1px solid rgba(255,255,255,0.05) !important;
  padding: 14px 16px !important;
}
.node-v2-title { font-weight: 600; letter-spacing: -0.012em; }
.node-v2-substatus {
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.node-v2-icon {
  background: rgba(255,255,255,0.04) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06) !important;
  border-radius: 10px !important;
}
.node-v2-close {
  background: rgba(251,113,133,0.10) !important;
  color: #FECDD3 !important;
  border-radius: 8px !important;
  width: 24px !important; height: 24px !important;
}
.node-v2-close:hover {
  background: rgba(251,113,133,0.20) !important;
}

/* Form bits dentro de nodos */
.node-input,
.node-textarea,
.composer-textarea {
  background: rgba(0,0,0,0.22) !important;
  border: 0 !important;
  border-radius: 12px !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
  font-size: 13px !important;
  padding: 10px 12px !important;
}
.node-input:focus,
.node-textarea:focus,
.composer-textarea:focus {
  background: rgba(0,0,0,0.30) !important;
  box-shadow: inset 0 0 0 1.5px rgba(167,139,250,0.6) !important;
}

.field-label {
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 10.5px;
  color: var(--text-3);
}

/* Model pill (header de Imagen/Video) */
.model-pill {
  background: rgba(255,255,255,0.06) !important;
  border: 0 !important;
  border-radius: 9px !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  padding: 5px 11px !important;
  color: var(--text-1) !important;
}
.model-pill:hover {
  background: rgba(167,139,250,0.18) !important;
  box-shadow: inset 0 0 0 1px rgba(167,139,250,0.35);
  color: var(--accent-3) !important;
}
.model-pill-menu {
  background: rgba(14, 16, 24, 0.96) !important;
  border: 0 !important;
  border-radius: 14px !important;
  box-shadow: var(--shadow-2), var(--edge-shine);
  padding: 6px !important;
}
.model-pill-opt {
  border-radius: 9px !important;
  padding: 8px 10px !important;
}
.model-pill-opt:hover { background: rgba(255,255,255,0.07) !important; }
.model-pill-opt.is-active {
  background: rgba(167,139,250,0.15) !important;
  box-shadow: inset 0 0 0 1px rgba(167,139,250,0.3);
}

.persona-chip {
  background: rgba(244,114,182,0.08) !important;
  border: 0 !important;
  box-shadow: inset 0 0 0 1px rgba(244,114,182,0.20);
  border-radius: 7px !important;
  padding: 4px 9px !important;
  color: #F9A8D4 !important;
}

.incoming-chip {
  background: rgba(167,139,250,0.12) !important;
  border: 0 !important;
  box-shadow: inset 0 0 0 1px rgba(167,139,250,0.25);
  border-radius: 7px !important;
  color: var(--accent-3) !important;
}

/* Tipo toggle (Prompt Node) */
.tipo-toggle {
  background: rgba(0,0,0,0.22) !important;
  border: 0 !important;
  border-radius: 12px !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
  padding: 4px !important;
}
.tipo-btn { border-radius: 9px !important; font-weight: 500; }
.tipo-btn.is-active.accent-indigo {
  background: linear-gradient(180deg, rgba(167,139,250,0.32), rgba(139,92,246,0.18)) !important;
  color: #DDD6FE !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 0 0 1px rgba(167,139,250,0.45);
}
.tipo-btn.is-active.accent-green {
  background: linear-gradient(180deg, rgba(52,211,153,0.30), rgba(16,185,129,0.16)) !important;
  color: #6EE7B7 !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 0 0 1px rgba(52,211,153,0.45);
}

/* Counter */
.counter {
  background: rgba(0,0,0,0.22) !important;
  border: 0 !important;
  border-radius: 10px !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}
.counter-btn { border-radius: 6px !important; }
.counter-btn:hover { background: rgba(255,255,255,0.07) !important; }

/* Select / Seg / Slider / Toggle */
.select-box, .seg-row {
  background: rgba(0,0,0,0.22) !important;
  border: 0 !important;
  border-radius: 11px !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}
.seg-chip { border-radius: 7px !important; font-weight: 500; }
.seg-chip.is-active {
  background: linear-gradient(180deg, rgba(52,211,153,0.30), rgba(16,185,129,0.16)) !important;
  color: #6EE7B7 !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.16),
    inset 0 0 0 1px rgba(52,211,153,0.45) !important;
}
.toggle-track {
  background: rgba(255,255,255,0.10) !important;
  width: 36px !important; height: 20px !important;
  border-radius: 999px !important;
}
.toggle-knob {
  width: 16px !important; height: 16px !important;
  background: #fff !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3) !important;
}
.toggle.is-on .toggle-track {
  background: linear-gradient(180deg, var(--accent), #8B5CF6) !important;
}
.toggle.is-on .toggle-knob {
  left: 18px !important;
  background: #fff !important;
}

.seed-btn {
  background: rgba(0,0,0,0.22) !important;
  border: 0 !important;
  border-radius: 11px !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}
.seed-btn:hover {
  background: rgba(0,0,0,0.30) !important;
  box-shadow: inset 0 0 0 1px rgba(167,139,250,0.35);
}

/* Action soft buttons */
.btn-soft {
  background: rgba(255,255,255,0.05) !important;
  border: 0 !important;
  border-radius: 11px !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  font-weight: 500;
}
.btn-soft:hover {
  background: rgba(255,255,255,0.08) !important;
  box-shadow: inset 0 0 0 1px rgba(167,139,250,0.40) !important;
}
.btn-primary-light {
  background: linear-gradient(180deg, rgba(129,140,248,0.30), rgba(99,102,241,0.16)) !important;
  color: #C7D2FE !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.16),
    inset 0 0 0 1px rgba(129,140,248,0.45) !important;
}

/* Generate button — vidrio tintado del accent */
.btn-generate {
  border-radius: 14px !important;
  padding: 12px 14px !important;
  font-weight: 600 !important;
  letter-spacing: -0.005em;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--btn-c, var(--accent)) 80%, transparent),
    color-mix(in srgb, var(--btn-c, var(--accent)) 50%, transparent)) !important;
  color: #fff !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.22),
    inset 0 0 0 1px rgba(255,255,255,0.10),
    0 10px 24px -8px color-mix(in srgb, var(--btn-c, var(--accent)) 55%, transparent) !important;
}
.btn-generate:hover:not(:disabled) {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.28),
    inset 0 0 0 1px rgba(255,255,255,0.16),
    0 16px 36px -8px color-mix(in srgb, var(--btn-c, var(--accent)) 75%, transparent) !important;
  transform: translateY(-1px);
}

/* Ref slot — glass dashed */
.ref-slot {
  background: rgba(0,0,0,0.18) !important;
  border: 1.5px dashed rgba(255,255,255,0.12) !important;
  border-radius: 14px !important;
}
.ref-slot:hover { border-color: rgba(167,139,250,0.45) !important; }

/* Note node — glass amber */
.note-node {
  background: linear-gradient(180deg, rgba(251,191,36,0.10), rgba(20,22,30,0.55)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    inset 0 0 0 1px rgba(251,191,36,0.18),
    var(--shadow-elevated) !important;
}
.note-title { color: var(--warn) !important; font-weight: 600 !important; letter-spacing: -0.012em; }
.note-text {
  background: rgba(251,191,36,0.04) !important;
  border: 0 !important;
  box-shadow: inset 0 0 0 1px rgba(251,191,36,0.16) !important;
  border-radius: 12px !important;
  color: #FDE68A !important;
}

/* ---------------------------------------------------------------------------
   Edges del canvas — siempre detrás de los nodos
   --------------------------------------------------------------------------- */
/* Jerarquía de capas: grupo (fondo) < edges < nodos individuales */
.edges-svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: visible;
}
.node-wrap { position: absolute; z-index: 2; }
.node-wrap.group-wrap { z-index: 0; }

/* Botón copiar prompt en lightbox */
.lightbox-copy-prompt {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(139,92,246,0.12);
  border: 1px solid rgba(139,92,246,0.3);
  color: #c4b5fd;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 11px;
  cursor: pointer;
  transition: background .15s;
}
.lightbox-copy-prompt:hover { background: rgba(139,92,246,0.22); }

/* Lightbox imagen ocupa espacio correctamente */
.lightbox-media {
  display: flex; align-items: center; justify-content: center;
  max-height: 72vh;
  overflow: hidden;
  border-radius: 12px;
  background: #111;
}
.lightbox-media img { max-width: 80vw; max-height: 72vh; object-fit: contain; display: block; }

.edge-base {
  stroke: rgba(255,255,255,0.10) !important;
  stroke-width: 1.5;
}
.edge-base.is-active {
  stroke: var(--accent) !important;
  opacity: 0.55;
}
.edge-dash {
  stroke: var(--accent) !important;
  stroke-width: 2 !important;
  stroke-dasharray: 8 10 !important;
}
.edge-particle { fill: var(--accent-3) !important; }
.temp-edge { stroke: var(--accent) !important; }
.nh {
  background: rgba(20,22,30,0.85) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 4px 10px -2px rgba(167,139,250,0.4);
}
.nh:hover {
  box-shadow: 0 0 18px 4px rgba(167,139,250,0.5) !important;
}

/* ---------------------------------------------------------------------------
   HUD inferior y supercomputer toggle
   --------------------------------------------------------------------------- */
.hud {
  left: 82px !important;
  bottom: 24px;
}
.hud-pill, .hud-zoom {
  background: var(--glass-bg) !important;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 0 !important;
  border-radius: 13px !important;
  box-shadow: var(--shadow-1), var(--edge-shine);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.hud-zoom button { color: var(--text-2); }
.hud-zoom button:hover { background: rgba(255,255,255,0.06); color: var(--text-1); }

.super-toggle {
  background: var(--glass-bg-strong) !important;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 0 !important;
  border-radius: 999px !important;
  box-shadow: var(--shadow-2), var(--edge-shine);
  padding: 11px 16px !important;
}
.super-toggle:hover {
  box-shadow:
    var(--shadow-2),
    var(--edge-shine),
    0 0 28px rgba(167,139,250,0.4) !important;
}

/* Supercomputer panel — glass derecho */
.super-panel {
  background: var(--glass-bg-strong) !important;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 0 !important;
  border-radius: 22px !important;
  top: 78px !important; bottom: 14px !important; right: 14px !important;
  box-shadow: var(--shadow-elevated) !important;
}
.super-header { border-bottom: 1px solid rgba(255,255,255,0.05) !important; }
.super-title  { font-weight: 600; letter-spacing: -0.012em; }
.super-header-icon {
  background: linear-gradient(135deg, rgba(167,139,250,0.30), rgba(139,92,246,0.15)) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), inset 0 0 0 1px rgba(167,139,250,0.30) !important;
}
.log {
  background: rgba(255,255,255,0.03) !important;
  border: 0 !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
  border-radius: 14px !important;
  padding: 12px 14px !important;
}
.composer-box {
  background: rgba(0,0,0,0.22) !important;
  border: 0 !important;
  border-radius: 14px !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
.composer-box:focus-within {
  box-shadow: inset 0 0 0 1.5px rgba(167,139,250,0.5) !important;
}
.super-empty-hint {
  background: rgba(167,139,250,0.08) !important;
  border: 0 !important;
  box-shadow: inset 0 0 0 1px rgba(167,139,250,0.22);
  color: var(--accent-3) !important;
  border-radius: 9px !important;
}

/* ---------------------------------------------------------------------------
   Toasts (Liquid Glass)
   --------------------------------------------------------------------------- */
.toast {
  background: rgba(14, 16, 24, 0.94) !important;
  border: 0 !important;
  border-radius: 14px !important;
  box-shadow: var(--shadow-2), var(--edge-shine);
}

/* ---------------------------------------------------------------------------
   Canvas-help — flotante glass
   --------------------------------------------------------------------------- */
.canvas-help {
  background: var(--glass-bg) !important;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 0 !important;
  border-radius: 999px !important;
  box-shadow: var(--shadow-1), var(--edge-shine);
  top: 100px !important;
  color: var(--text-3);
  font-weight: 500;
}
.canvas-help .kbd {
  background: rgba(255,255,255,0.08) !important;
  border: 0 !important;
}

/* ---------------------------------------------------------------------------
   Moodboard internals — glass
   --------------------------------------------------------------------------- */
.moodboard-card {
  background: rgba(255,255,255,0.03) !important;
  border: 0 !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  border-radius: 18px !important;
}
.moodboard-card:hover { box-shadow: inset 0 0 0 1px rgba(167,139,250,0.4); }
.moodboard-card.is-active { box-shadow: inset 0 0 0 1px var(--accent), 0 0 28px rgba(167,139,250,0.25); }
.moodboard-card.is-locked { box-shadow: inset 0 0 0 1.5px var(--success), 0 0 28px rgba(52,211,153,0.3); }
.lock-switch {
  background: rgba(255,255,255,0.05) !important;
  border: 0 !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  border-radius: 9px !important;
  font-weight: 500;
}
.lock-switch.is-locked {
  background: linear-gradient(180deg, rgba(52,211,153,0.25), rgba(16,185,129,0.12)) !important;
  color: var(--success-2) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.16),
    inset 0 0 0 1px rgba(52,211,153,0.45),
    0 0 18px rgba(52,211,153,0.3);
}

/* Gallery cards */
.gallery-card {
  background: rgba(255,255,255,0.03) !important;
  border: 0 !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  border-radius: 16px !important;
  overflow: hidden;
}
.gallery-card:hover { box-shadow: inset 0 0 0 1px rgba(167,139,250,0.4), 0 14px 30px -10px rgba(167,139,250,0.20); }
.gallery-filters {
  background: rgba(0,0,0,0.22) !important;
  border: 0 !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
  border-radius: 11px !important;
}
.gallery-filter { border-radius: 8px !important; font-weight: 500; }
.gallery-filter.is-active {
  background: rgba(255,255,255,0.08) !important;
  color: var(--text-1) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.16),
    inset 0 0 0 1px rgba(255,255,255,0.06) !important;
}

/* ---------------------------------------------------------------------------
   Style locked badge en Cinematographer
   --------------------------------------------------------------------------- */
.style-locked-badge {
  background: linear-gradient(180deg, rgba(52,211,153,0.18), rgba(16,185,129,0.06)) !important;
  border: 0 !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.16),
    inset 0 0 0 1px rgba(52,211,153,0.40) !important;
  border-radius: 10px !important;
  font-weight: 500 !important;
}

/* ---------------------------------------------------------------------------
   Connect menu — popup flotante "Añadir nodo conectado"
   --------------------------------------------------------------------------- */
.connect-menu {
  position: fixed;
  z-index: 90;
  min-width: 260px;
  padding: 8px;
  background: rgba(14, 16, 24, 0.96) !important;
  border-radius: 16px;
  box-shadow:
    0 22px 60px -16px rgba(0,0,0,0.7),
    0 6px 14px -6px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.14),
    inset 0 0 0 1px rgba(255,255,255,0.07);
  animation: connect-menu-in .18s var(--ease) both;
  /* anchor right below cursor */
  transform-origin: top left;
}
@keyframes connect-menu-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
.connect-menu-header {
  padding: 10px 12px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.connect-menu-kicker {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  font-weight: 500;
  margin-bottom: 2px;
}
.connect-menu-title {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: rgba(255,255,255,0.96);
}
.connect-menu-list {
  display: flex; flex-direction: column;
  gap: 2px;
  padding: 6px 0 4px;
}
.connect-menu-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.96);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: background .12s, transform .15s var(--ease);
  position: relative;
}
.connect-menu-item:hover {
  background: color-mix(in srgb, var(--cm-c) 14%, transparent);
  transform: translateX(2px);
}
.connect-menu-item:hover .connect-menu-arrow { opacity: 1; transform: translateX(0); }
.connect-menu-icon {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.connect-menu-meta { flex: 1; min-width: 0; }
.connect-menu-label {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: rgba(255,255,255,0.96);
}
.connect-menu-hint {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-top: 2px;
}
.connect-menu-arrow {
  font-family: "SF Mono", ui-monospace, monospace;
  color: var(--cm-c);
  font-size: 12px;
  opacity: 0;
  transform: translateX(-3px);
  transition: all .15s var(--ease);
}
.connect-menu-foot {
  border-top: 1px solid rgba(255,255,255,0.05);
  padding: 8px 12px 4px;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  text-align: center;
}

/* ---------------------------------------------------------------------------
   Edge — pulse de conexión recién creada
   --------------------------------------------------------------------------- */
.edge-just-created .edge-base {
  stroke: var(--accent) !important;
  opacity: 1 !important;
  animation: edge-flash 1.2s var(--ease);
}
@keyframes edge-flash {
  0%   { stroke-width: 1.5; opacity: 0.3; }
  20%  { stroke-width: 3.5; opacity: 1; }
  100% { stroke-width: 1.5; opacity: 0.55; }
}
.edge-just-created .edge-dash {
  animation: edge-dash 0.5s linear infinite, edge-newpulse 1.2s var(--ease);
}
@keyframes edge-newpulse {
  0%   { stroke-width: 4; opacity: 1; }
  100% { stroke-width: 2; opacity: 0.85; }
}

/* Cursor durante connect */
body.is-connecting { cursor: crosshair !important; }
body.is-connecting .canvas-viewport { cursor: crosshair !important; }
/* Resalta los input handles disponibles cuando se está arrastrando */
body.is-connecting .nh[data-side="left"] {
  box-shadow: 0 0 16px 4px rgba(167,139,250,0.55) !important;
  animation: handle-attract 1s ease-in-out infinite !important;
}
@keyframes handle-attract {
  0%, 100% { transform: translate(0, -50%) scale(1); }
  50%      { transform: translate(0, -50%) scale(1.25); }
}
.scroll-thin::-webkit-scrollbar { width: 4px !important; }
.scroll-thin::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08) !important;
  border-radius: 4px !important;
}
.scroll-thin::-webkit-scrollbar-track { background: transparent !important; }

/* ===========================================================================
   Clients panel
   =========================================================================== */
.clients-list { display: flex; flex-direction: column; gap: 8px; }
.client-card {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  background: var(--surf-card, rgba(255,255,255,0.03));
  box-shadow: inset 0 0 0 1px var(--surf-line, rgba(255,255,255,0.06));
  border-radius: 14px;
  color: var(--text-1);
  cursor: pointer;
  text-align: left;
  transition: all .2s var(--ease);
}
.client-card:hover {
  background: var(--surf-card-hi, rgba(255,255,255,0.05));
  box-shadow: inset 0 0 0 1px rgba(167,139,250,0.45);
  transform: translateY(-1px);
}
.client-avatar {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  flex-shrink: 0;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.2),
    inset 0 0 0 1px rgba(255,255,255,0.08);
}
.client-avatar-text {
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.client-card-meta { flex: 1; min-width: 0; }
.client-card-name { font-size: 13px; font-weight: 500; letter-spacing: -0.005em; }
.client-card-sub {
  margin-top: 2px;
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-3);
}
.client-card-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.client-palette-mini { display: flex; gap: 2px; }
.client-palette-mini span {
  width: 10px; height: 10px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2);
}
.client-projects {
  font-size: 9.5px;
  letter-spacing: 0.10em;
  color: var(--text-3);
}

.add-client-btn {
  margin-top: 10px;
  display: inline-flex; align-items: center; gap: 7px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  background: linear-gradient(135deg, rgba(167,139,250,0.22), rgba(124,58,237,0.14));
  color: #EDE9FE;
  border-radius: 14px;
  box-shadow:
    0 6px 18px -8px rgba(124,58,237,0.5),
    inset 0 1px 0 rgba(255,255,255,0.22),
    inset 0 0 0 1px rgba(167,139,250,0.35);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  justify-content: center;
  transition: all .4s cubic-bezier(0.32,0.72,0,1);
}
.add-client-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(167,139,250,0.32), rgba(124,58,237,0.22));
  color: #fff;
  box-shadow:
    0 10px 26px -8px rgba(124,58,237,0.65),
    inset 0 1px 0 rgba(255,255,255,0.3),
    inset 0 0 0 1px rgba(167,139,250,0.5);
}
.add-client-btn:active { transform: translateY(0) scale(0.99); }

.client-detail { display: flex; flex-direction: column; gap: 18px; }
.client-back {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border: 0; background: var(--surf-card, rgba(255,255,255,0.04));
  color: var(--text-2);
  border-radius: 8px;
  font-size: 11.5px; font-weight: 500;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--surf-line, rgba(255,255,255,0.06));
}
.client-back:hover { background: var(--surf-card-hi, rgba(255,255,255,0.07)); color: var(--text-1); }

.client-hero {
  position: relative;
  border-radius: 16px;
  padding: 22px 18px;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 0 0 1px rgba(255,255,255,0.08);
}
.client-hero-fade { position: absolute; inset: 0; background: linear-gradient(135deg, transparent 30%, rgba(0,0,0,0.55) 100%); }
.client-hero-content { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; }
.client-hero-initials {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: rgba(0,0,0,0.30);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-size: 20px; font-weight: 600;
  letter-spacing: -0.02em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
  flex-shrink: 0;
}
.client-hero-text { min-width: 0; color: #fff; }
.client-hero-name {
  font-size: 18px; font-weight: 600; letter-spacing: -0.015em;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.client-hero-tagline {
  margin-top: 4px;
  font-size: 12.5px; font-style: italic;
  color: rgba(255,255,255,0.85);
}

.client-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.stat-cell {
  padding: 10px 12px;
  background: var(--surf-card, rgba(255,255,255,0.03));
  border-radius: 11px;
  box-shadow: inset 0 0 0 1px var(--surf-line, rgba(255,255,255,0.05));
}
.stat-label {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.stat-value {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-1);
  font-weight: 500;
}
.client-section { display: flex; flex-direction: column; gap: 8px; }
.client-contact {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px;
  background: var(--surf-card, rgba(255,255,255,0.03));
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--surf-line, rgba(255,255,255,0.05));
}
.client-contact-avatar {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(167,139,250,0.30), rgba(124,92,246,0.18));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16);
  color: var(--text-1);
  font-weight: 600; font-size: 11.5px;
}
.client-contact-name { font-size: 13px; color: var(--text-1); font-weight: 500; }
.client-contact-role {
  margin-top: 1px;
  font-size: 9.5px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-3);
}
.client-contact-email {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--accent);
  text-decoration: none;
}
.client-contact-email:hover { color: var(--accent-2); }
.client-palette { display: flex; gap: 8px; flex-wrap: wrap; }
.client-swatch { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.client-swatch-color {
  width: 44px; height: 44px;
  border-radius: 11px;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.10),
    0 4px 10px -3px rgba(0,0,0,0.4);
}
.client-swatch-hex {
  font-size: 9px;
  color: var(--text-3);
  letter-spacing: 0.05em;
}
.client-typo { display: flex; flex-direction: column; gap: 4px; }
.typo-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px;
  background: var(--surf-card, rgba(255,255,255,0.03));
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px var(--surf-line, rgba(255,255,255,0.05));
}
.typo-label {
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.typo-name { font-size: 13px; color: var(--text-1); letter-spacing: -0.005em; }
.client-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.client-tag { padding: 4px 9px; border-radius: 6px; font-size: 11px; font-weight: 500; }
.client-tag-good {
  background: rgba(52,211,153,0.10);
  color: rgba(110,231,183,1);
  box-shadow: inset 0 0 0 1px rgba(52,211,153,0.25);
}
.client-tag-bad {
  background: rgba(251,113,133,0.08);
  color: rgba(254,202,202,0.96);
  box-shadow: inset 0 0 0 1px rgba(251,113,133,0.22);
}
.client-refs { display: flex; flex-direction: column; gap: 4px; }
.client-ref {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 11px;
  background: var(--surf-card, rgba(255,255,255,0.025));
  border-radius: 9px;
  box-shadow: inset 0 0 0 1px var(--surf-line, rgba(255,255,255,0.04));
  text-decoration: none;
  color: var(--text-1);
  transition: all .15s var(--ease);
}
.client-ref:hover {
  background: var(--surf-card-hi, rgba(255,255,255,0.05));
  box-shadow: inset 0 0 0 1px rgba(167,139,250,0.3);
}
.client-ref-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(167,139,250,0.85);
  box-shadow: 0 0 8px rgba(167,139,250,0.6);
}
.client-ref-arrow { margin-left: auto; color: var(--text-3); }
.client-actions { margin-top: 4px; display: flex; gap: 8px; }

/* ===========================================================================
   LIGHT MODE — overrides cuando html[data-theme="light"]
   =========================================================================== */
html[data-theme="light"] {
  /* Canvas lavanda muy suave — más carácter que blanco puro */
  --bg:         #F0EFF5;
  --bg-soft:    #E8E7F0;
  --bg-orb-1:   rgba(109, 40, 217, 0.08);
  --bg-orb-2:   rgba(245, 158, 11, 0.06);

  /* Contenedores blancos con alta opacidad — bien definidos */
  --glass-bg:        rgba(255, 255, 255, 0.88);
  --glass-bg-hi:     rgba(255, 255, 255, 0.95);
  --glass-bg-strong: rgba(255, 255, 255, 0.98);

  /* Texto warm-dark — menos frío que negro puro */
  --text-1: #1A1523;
  --text-2: rgba(26, 21, 35, 0.68);
  --text-3: rgba(26, 21, 35, 0.46);
  --text-4: rgba(26, 21, 35, 0.30);

  /* Cards blancas con opacidad alta */
  --surf-card:     rgba(255, 255, 255, 0.92);
  --surf-card-hi:  rgba(255, 255, 255, 1.00);
  --surf-line:     rgba(109, 40, 217, 0.12);

  /* Borders violeta suave */
  --line:    rgba(109,40,217,0.10);
  --line-2:  rgba(109,40,217,0.06);

  /* Accent violeta vivo en light */
  --accent:   #6D28D9;
  --accent-2: #7C3AED;
  --accent-3: #5B21B6;

  /* Sombras violeta — más elegantes que negro */
  --shadow-1: 0 2px 12px rgba(109,40,217,0.08), 0 1px 3px rgba(109,40,217,0.05);
  --shadow-2: 0 8px 28px -6px rgba(109,40,217,0.14), 0 2px 8px -2px rgba(109,40,217,0.08);
  --shadow-elevated:
    0 20px 60px -18px rgba(109,40,217,0.18),
    0 8px 24px -8px rgba(109,40,217,0.12),
    inset 0 1px 0 rgba(255,255,255,0.90),
    inset 0 0 0 1px rgba(109,40,217,0.08);

  --edge-shine:
    inset 0 1px 0 rgba(255,255,255,0.90),
    inset 0 0 0 1px rgba(109,40,217,0.08);
  --edge-shine-strong:
    inset 0 1px 0 rgba(255,255,255,0.95),
    inset 0 0 0 1px rgba(109,40,217,0.10);
}

html[data-theme="light"] body::before {
  background:
    radial-gradient(50vmax 40vmax at 18% 12%, rgba(124,92,246,0.12), transparent 65%),
    radial-gradient(40vmax 35vmax at 88% 88%, rgba(245,158,11,0.08), transparent 70%),
    #FAFAF7 !important;
}

html[data-theme="light"] .canvas-world {
  background-image: radial-gradient(circle at center, rgba(15,17,22,0.08) 1px, transparent 1.5px) !important;
}

html[data-theme="light"] .node-input,
html[data-theme="light"] .node-textarea,
html[data-theme="light"] .composer-textarea,
html[data-theme="light"] .tipo-toggle,
html[data-theme="light"] .counter,
html[data-theme="light"] .select-box,
html[data-theme="light"] .seg-row,
html[data-theme="light"] .seed-btn,
html[data-theme="light"] .mode-tabs {
  background: rgba(15,17,22,0.04) !important;
  box-shadow: inset 0 0 0 1px rgba(15,17,22,0.08) !important;
  color: var(--text-1) !important;
}

html[data-theme="light"] .node-v2-close {
  background: rgba(251,113,133,0.10) !important;
  color: #E11D48 !important;
}

html[data-theme="light"] .lightbox {
  background: rgba(15,17,22,0.50) !important;
}
html[data-theme="light"] .lightbox-media img { background: #fff; }

html[data-theme="light"] .client-hero-fade {
  background: linear-gradient(135deg, transparent 30%, rgba(0,0,0,0.35) 100%);
}

html[data-theme="light"] .edge-base { stroke: rgba(15,17,22,0.18) !important; }
html[data-theme="light"] .edge-base.is-active { stroke: var(--accent) !important; opacity: 0.7; }
html[data-theme="light"] .nh {
  background: #FFFFFF !important;
  border-color: var(--accent) !important;
  box-shadow: 0 4px 10px -2px rgba(124,92,246,0.4);
}

/* ===========================================================================
   Tweaks panel
   =========================================================================== */
.tweaks-panel {
  position: fixed;
  right: 14px; bottom: 14px;
  z-index: 110;
  width: 260px;
  padding: 14px;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 18px;
  box-shadow: var(--shadow-elevated);
  display: flex; flex-direction: column;
  gap: 14px;
}
.tweaks-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-2);
}
.tweaks-title { font-size: 12.5px; font-weight: 600; letter-spacing: -0.012em; color: var(--text-1); }
.tweaks-kicker {
  margin-top: 2px;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.tweaks-close {
  border: 0; background: transparent;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 6px;
  color: var(--text-3);
  cursor: pointer;
}
.tweaks-close:hover { background: var(--surf-card); color: var(--text-1); }
.tweak-row {
  display: flex; flex-direction: column; gap: 6px;
}
.tweak-row-label {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-3);
}
.theme-seg {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--surf-card);
  border-radius: 9px;
  padding: 3px;
  gap: 3px;
  box-shadow: inset 0 0 0 1px var(--surf-line);
}
.theme-seg-btn {
  border: 0; background: transparent;
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--text-3);
  font-size: 11.5px; font-weight: 500;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: all .15s var(--ease);
}
.theme-seg-btn:hover { color: var(--text-1); }
.theme-seg-btn.is-on {
  background: var(--accent);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 4px 10px -3px color-mix(in srgb, var(--accent) 50%, transparent);
}
.theme-swatches {
  display: flex; gap: 6px;
}
.theme-swatch {
  width: 28px; height: 28px;
  border-radius: 9px;
  cursor: pointer;
  border: 0;
  box-shadow: inset 0 0 0 1.5px var(--surf-line);
  transition: all .15s var(--ease);
}
.theme-swatch:hover { transform: scale(1.08); }
.theme-swatch.is-on { box-shadow: inset 0 0 0 2.5px var(--text-1), 0 4px 12px -3px rgba(0,0,0,0.3); }

/* Theme toggle in topbar */
.theme-toggle-btn {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border: 0;
  background: var(--surf-card, rgba(255,255,255,0.05)) !important;
  color: var(--text-2);
  border-radius: 11px;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--surf-line, rgba(255,255,255,0.06));
  transition: all .25s var(--ease);
}
/* ===========================================================================
   Minimap (replaces HUD + supercomputer toggle bottom-right)
   =========================================================================== */
.minimap-wrap {
  position: fixed;
  right: 10px; bottom: 10px;
  z-index: 22;
  width: 148px;
  padding: 7px;
  background: rgba(12,12,14,0.55);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 11px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
  display: flex; flex-direction: column;
  gap: 5px;
  opacity: 0.45;
  transition: opacity .2s;
}
.minimap-wrap:hover { opacity: 1; }
html[data-theme="light"] .minimap-wrap {
  background: rgba(255,255,255,0.55);
  border-color: rgba(0,0,0,0.08);
}
.minimap-head {
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-4);
  padding: 0 2px;
}
.minimap {
  display: block;
  border-radius: 7px;
  cursor: pointer;
  background: rgba(0,0,0,0.12);
}
html[data-theme="light"] .minimap { background: rgba(15,17,22,0.04); }
.minimap-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2px;
  font-size: 9px;
  color: var(--text-4);
}
.minimap-zoom button {
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border: 0; background: rgba(255,255,255,0.06);
  color: var(--text-3);
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
}
.minimap-zoom button:hover { color: var(--text-1); background: rgba(255,255,255,0.12); }

/* Hide old HUD + supercomputer toggle */
.hud { display: none !important; }
.super-toggle { display: none !important; }

/* Old supercomputer brief — superseded by cortex-stage */
.super-stage,
.super-stage-brief { display: none !important; }
.super-stage-brief {
  display: block;
  grid-template-columns: none;
  position: fixed;
  top: 78px; left: 14px; right: 14px; bottom: 14px;
  overflow-y: auto;
  z-index: 40;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 22px;
  box-shadow: var(--shadow-elevated);
}
.super-brief-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(60vmax 50vmax at 25% 20%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%),
    radial-gradient(50vmax 40vmax at 80% 90%, color-mix(in srgb, var(--success) 12%, transparent), transparent 65%);
  pointer-events: none;
  animation: brief-bg-drift 28s ease-in-out infinite;
}
@keyframes brief-bg-drift {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(40px, -30px); }
}
.super-brief-content {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: 40px 32px 60px;
  display: flex; flex-direction: column;
  gap: 28px;
  animation: brief-in .6s var(--ease) both;
}
@keyframes brief-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.super-brief-head {
  text-align: center;
  padding-bottom: 8px;
}
.super-brief-kicker {
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.85;
}
.super-brief-title {
  margin: 10px 0 6px;
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -0.028em;
  color: var(--text-1);
  line-height: 1.1;
}
.super-brief-subtitle {
  font-size: 14.5px;
  color: var(--text-3);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.5;
}

.super-brief-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.brief-slot {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  color: var(--text-1);
  text-align: left;
  box-shadow: var(--shadow-1), var(--edge-shine);
  transition: all .25s var(--ease);
}
.brief-slot:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2), var(--edge-shine);
}
.brief-slot.is-locked {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.16),
    inset 0 0 0 1.5px #34D399,
    0 0 22px rgba(52,211,153,0.22);
}
.brief-slot-avatar {
  width: 46px; height: 46px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: var(--surf-card);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), inset 0 0 0 1px rgba(255,255,255,0.06);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.brief-slot-placeholder { color: var(--text-3); }
.brief-slot-meta { flex: 1; min-width: 0; }
.brief-slot-label { font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); }
.brief-slot-value { margin-top: 4px; font-size: 14px; color: var(--text-1); font-weight: 500; letter-spacing: -0.005em; }
.brief-slot-arrow { color: var(--text-3); font-family: "SF Mono", monospace; font-size: 14px; }

.super-brief-section { display: flex; flex-direction: column; gap: 8px; }
.super-brief-section-label {
  font-size: 10px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 4px;
}
.super-brief-prompt {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border-radius: 16px;
  box-shadow: var(--shadow-1), var(--edge-shine);
}
.super-brief-prompt textarea {
  width: 100%;
  background: transparent;
  border: 0; outline: 0;
  resize: none;
  color: var(--text-1);
  font-size: 14.5px;
  line-height: 1.55;
  padding: 14px 16px;
  letter-spacing: -0.005em;
  font-family: inherit;
}
.super-brief-prompt textarea::placeholder { color: var(--text-4); }

.quiz-grid { display: flex; flex-direction: column; gap: 8px; }
.quiz-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  background: var(--surf-card);
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px var(--surf-line);
}
.quiz-label {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.quiz-options { display: flex; flex-wrap: wrap; gap: 5px; }
.quiz-chip {
  padding: 7px 12px;
  border: 0;
  background: var(--surf-card);
  color: var(--text-2);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--surf-line);
  transition: all .15s var(--ease);
}
.quiz-chip:hover {
  color: var(--text-1);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}
.quiz-chip.is-on {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 25%, transparent), color-mix(in srgb, var(--accent) 10%, transparent));
  color: var(--accent-2);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent),
    0 4px 12px -3px color-mix(in srgb, var(--accent) 35%, transparent);
}

.super-brief-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding-top: 10px;
}
.super-brief-completion {
  display: flex; align-items: center; gap: 10px;
  flex: 1;
}
.super-brief-progress {
  flex: 1;
  height: 4px;
  background: var(--surf-line);
  border-radius: 999px;
  overflow: hidden;
}
.super-brief-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 50%, transparent);
  transition: width .35s var(--ease);
}
.super-brief-completion span { font-size: 10.5px; color: var(--text-3); }
.super-brief-launch {
  padding: 12px 22px !important;
  font-size: 13.5px !important;
}

/* ===========================================================================
   Picker popup
   =========================================================================== */
.picker-backdrop {
  position: fixed; inset: 0;
  z-index: 280;
  background: rgba(0,0,0,0.50);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: grid; place-items: center;
  padding: 40px;
  animation: backdrop-in .25s ease;
}
.picker-popup {
  width: 540px;
  max-width: 92vw;
  max-height: 78vh;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 20px;
  box-shadow: var(--shadow-elevated);
  display: flex; flex-direction: column;
  animation: lightbox-pop .3s var(--ease) both;
}
.picker-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line-2);
}
.picker-kicker {
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
}
.picker-title {
  margin-top: 3px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-1);
}
.picker-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex; flex-direction: column;
  gap: 6px;
}
.picker-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px;
  background: var(--surf-card);
  border: 0;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px var(--surf-line);
  cursor: pointer;
  text-align: left;
  color: var(--text-1);
  transition: all .15s var(--ease);
}
.picker-row:hover {
  background: var(--surf-card-hi);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}
.picker-row.is-on, .picker-row.is-locked {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent);
}
.picker-row.is-locked { box-shadow: inset 0 0 0 1.5px #34D399; }
.picker-row-avatar {
  width: 42px; height: 42px;
  border-radius: 13px;
  display: grid; place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), inset 0 0 0 1px rgba(255,255,255,0.06);
}
.picker-row-thumbs {
  display: flex; gap: 3px;
  flex-shrink: 0;
}
.picker-row-thumb {
  width: 38px; height: 42px;
  border-radius: 8px;
  background-size: cover; background-position: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}
.picker-row-meta { flex: 1; min-width: 0; }
.picker-row-title { font-size: 13.5px; font-weight: 500; letter-spacing: -0.005em; color: var(--text-1); }
.picker-row-sub  { margin-top: 3px; font-size: 10.5px; letter-spacing: 0.06em; color: var(--text-3); }
.picker-row-side { flex-shrink: 0; }
.picker-row-clear {
  background: transparent;
  box-shadow: inset 0 0 0 1px transparent;
  border: 1px dashed var(--surf-line);
}
.picker-row-clear:hover { box-shadow: inset 0 0 0 1px var(--surf-line); }
.super-stage {
  position: fixed;
  top: 78px; left: 82px; right: 14px; bottom: 14px;
  z-index: 18;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 22px;
  box-shadow: var(--shadow-elevated);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 420px;
  animation: super-stage-in .5s var(--ease) both;
}
@keyframes super-stage-in {
  from { opacity: 0; transform: scale(0.985); }
  to   { opacity: 1; transform: scale(1); }
}

.super-stage-main {
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--line-2);
  display: flex; flex-direction: column;
}

.super-stage-head {
  padding: 24px 28px 18px;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line-2);
}
.super-stage-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.022em;
  color: var(--text-1);
  line-height: 1.15;
}
.super-stage-title-em {
  background: linear-gradient(90deg, var(--accent), var(--accent-2) 60%, var(--success-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 8s ease-in-out infinite;
  background-size: 200% 100%;
}
@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
.super-stage-subtitle {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-3);
  max-width: 540px;
  line-height: 1.55;
}
.super-status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px;
  background: var(--surf-card);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--surf-line);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-2);
  flex-shrink: 0;
}
.super-status-pill .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.super-status-pill.is-running .dot { animation: pulse-dot 1.2s ease-in-out infinite; }
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.4); opacity: 0.6; }
}

/* Agent orbits canvas */
.super-orbits {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid; place-items: center;
  overflow: hidden;
}
.super-orbits::before, .super-orbits::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(40vmax 30vmax at 30% 40%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    radial-gradient(35vmax 28vmax at 70% 70%, color-mix(in srgb, var(--success) 14%, transparent), transparent 65%);
  pointer-events: none;
}
.super-orbits::after {
  animation: orb-drift 22s ease-in-out infinite;
}
@keyframes orb-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-30px, 20px) scale(1.05); }
}

.orbit-svg {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
}
.orbit-ring {
  fill: none;
  stroke: var(--surf-line);
  stroke-width: 1;
  stroke-dasharray: 3 5;
  opacity: 0.5;
}
.orbit-ring.is-active {
  stroke: var(--accent);
  stroke-dasharray: 6 8;
  animation: orbit-spin 12s linear infinite;
  opacity: 0.8;
}
@keyframes orbit-spin {
  to { stroke-dashoffset: -56; }
}

.agent-orb {
  position: absolute;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 2;
}
.agent-orb-disc {
  position: relative;
  width: 72px; height: 72px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--glass-bg-hi);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 0 0 1px rgba(255,255,255,0.10),
    0 18px 36px -10px rgba(0,0,0,0.5);
  transition: all .25s var(--ease);
}
.agent-orb:hover .agent-orb-disc {
  transform: scale(1.08);
}
.agent-orb-disc::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--ao-c) 60%, transparent);
  opacity: 0;
  transition: opacity .25s var(--ease);
}
.agent-orb.is-running .agent-orb-disc::before {
  opacity: 1;
  animation: orb-pulse-ring 1.6s ease-out infinite;
}
@keyframes orb-pulse-ring {
  0%   { transform: scale(1);   opacity: 0.9; }
  100% { transform: scale(1.5); opacity: 0;   }
}
.agent-orb.is-running .agent-orb-disc {
  background: color-mix(in srgb, var(--ao-c) 22%, var(--glass-bg-hi));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.22),
    inset 0 0 0 1px color-mix(in srgb, var(--ao-c) 50%, transparent),
    0 0 30px color-mix(in srgb, var(--ao-c) 50%, transparent),
    0 18px 36px -10px rgba(0,0,0,0.5);
}
.agent-orb.is-done .agent-orb-disc {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 0 0 1px color-mix(in srgb, #34D399 60%, transparent),
    0 0 18px color-mix(in srgb, #34D399 25%, transparent),
    0 18px 36px -10px rgba(0,0,0,0.5);
}
.agent-orb-letter {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: color-mix(in srgb, var(--ao-c) 80%, var(--text-1));
}
.agent-orb-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.agent-orb-status {
  font-size: 9px;
  font-family: "SF Mono", ui-monospace, monospace;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.agent-orb.is-running .agent-orb-status { color: color-mix(in srgb, var(--ao-c) 80%, var(--text-1)); }
.agent-orb.is-done    .agent-orb-status { color: var(--success-2); }

/* Composer big */
.super-stage-composer {
  padding: 18px 28px 24px;
  border-top: 1px solid var(--line-2);
}
.super-stage-composer-box {
  background: var(--surf-card);
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--surf-line);
  transition: box-shadow .15s var(--ease);
}
.super-stage-composer-box:focus-within {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 60%, transparent);
}
.super-stage-composer textarea {
  width: 100%;
  background: transparent;
  border: 0; outline: 0;
  resize: none;
  color: var(--text-1);
  font-size: 14.5px;
  line-height: 1.55;
  padding: 14px 16px;
  letter-spacing: -0.005em;
  font-family: inherit;
}
.super-stage-composer textarea::placeholder { color: var(--text-4); }
.super-stage-composer-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  border-top: 1px solid var(--line-2);
}
.super-stage-composer-hints {
  display: flex; gap: 5px;
  flex-wrap: wrap;
}
.super-hint {
  padding: 5px 10px;
  border: 0;
  background: var(--surf-card);
  color: var(--text-2);
  border-radius: 7px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--surf-line);
  transition: all .15s var(--ease);
}
.super-hint:hover {
  background: color-mix(in srgb, var(--accent) 10%, var(--surf-card));
  color: color-mix(in srgb, var(--accent) 50%, var(--text-1));
}

/* Side feed */
.super-stage-feed {
  display: flex; flex-direction: column;
  min-height: 0;
}
.super-stage-feed-head {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line-2);
}
.super-stage-feed-title {
  font-size: 13px; font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--text-1);
}
.super-stage-feed-kicker {
  margin-top: 3px;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.super-stage-feed-body {
  flex: 1; overflow-y: auto;
  padding: 14px 16px;
  display: flex; flex-direction: column;
  gap: 8px;
}
.super-stage-feed-body .log { animation: log-in .35s var(--ease); }
@keyframes log-in {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: translateX(0); }
}

.super-stage-empty {
  text-align: center;
  padding: 40px 20px;
  margin: auto 0;
}
.super-stage-empty-kicker {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-4);
}
.super-stage-empty-title {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-1);
  font-weight: 500;
}
.super-stage-empty-body {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.55;
  max-width: 280px;
  margin-left: auto; margin-right: auto;
}


/* ===========================================================================
   CORTEX STAGE — Supercomputer cinematic page
   =========================================================================== */
.theme-toggle-btn:hover {
  color: var(--text-1);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent);
  transform: rotate(15deg);
}

.cortex-stage {
  position: fixed;
  top: 78px; left: 14px; right: 14px; bottom: 14px;
  z-index: 40;
  border-radius: 24px;
  background: radial-gradient(120% 100% at 50% 0%, #15101F 0%, #0A0B10 60%, #07070C 100%);
  overflow: hidden;
  box-shadow: var(--shadow-elevated);
  animation: cortex-in .6s var(--ease) both;
}
html[data-theme="light"] .cortex-stage {
  background: radial-gradient(120% 100% at 50% 0%, #F4F1FA 0%, #FAFAF7 60%, #F0EFEB 100%);
}
@keyframes cortex-in { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: scale(1); } }
.cortex-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(45vmax 35vmax at 20% 12%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    radial-gradient(40vmax 32vmax at 80% 88%, color-mix(in srgb, var(--success) 15%, transparent), transparent 65%),
    radial-gradient(30vmax 25vmax at 50% 50%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%);
  animation: cortex-drift 32s ease-in-out infinite;
}
@keyframes cortex-drift {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(60px, -40px); }
}
.cortex-grain {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(circle at 25% 25%, rgba(255,255,255,0.025) 1px, transparent 1.5px),
    radial-gradient(circle at 75% 75%, rgba(255,255,255,0.02) 1px, transparent 1.5px);
  background-size: 3px 3px, 5px 5px;
  opacity: .6;
  mix-blend-mode: overlay;
}

.cortex-inner {
  position: relative; z-index: 2;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(280px, 460px) 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "head head"
    "swarm form";
  align-items: center;
  padding: 24px 36px 28px;
  max-width: 1320px;
  margin: 0 auto;
  gap: 18px 36px;
}
.cortex-head { grid-area: head; }
.cortex-swarm { grid-area: swarm; }
.cortex-form { grid-area: form; }
@media (max-width: 920px) {
  .cortex-inner {
    grid-template-columns: 1fr;
    grid-template-areas: "head" "swarm" "form";
    padding: 18px 18px 22px;
    gap: 14px;
  }
}

.cortex-head { text-align: center; padding-top: 8px; }
.cortex-kicker {
  font-size: 10.5px; letter-spacing: 0.28em; text-transform: uppercase;
  color: color-mix(in srgb, var(--accent) 75%, var(--text-2));
  opacity: 0.9;
}
.cortex-title {
  margin: 8px 0 2px;
  font-size: clamp(38px, 5.5vw, 64px);
  font-weight: 300;
  letter-spacing: -0.045em;
  line-height: 0.95;
  color: var(--text-1);
}
.cortex-title-soft {
  font-weight: 200;
  color: var(--text-2);
  animation: cortex-letter-in .9s var(--ease) both;
}
.cortex-title-em {
  font-weight: 600; font-style: italic;
  background: linear-gradient(110deg, var(--accent) 0%, var(--accent-2) 30%, var(--success-2) 55%, var(--accent-2) 80%, var(--accent) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: cortex-letter-in .9s var(--ease) both, cortex-shimmer 8s ease-in-out infinite;
  animation-delay: 0s, 1s;
}
@keyframes cortex-letter-in {
  from { opacity: 0; transform: translateY(20px); filter: blur(8px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}
@keyframes cortex-shimmer { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.cortex-tagline {
  margin: 6px auto 0; max-width: 560px;
  font-size: 13px; color: var(--text-3);
  letter-spacing: -0.005em; line-height: 1.45;
  animation: cortex-fade-in 1.2s var(--ease) both;
  animation-delay: .4s;
}
.cortex-tagline i { color: var(--text-2); font-style: italic; }
@keyframes cortex-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.cortex-swarm {
  position: relative;
  display: grid; place-items: center;
  width: 100%;
  height: 100%;
  min-height: 320px;
  max-height: 560px;
  animation: cortex-fade-in 1.4s var(--ease) both;
  animation-delay: .2s;
}

.cortex-swarm-inner {
  position: relative;
  width: min(100%, 720px);
  aspect-ratio: 520 / 360;
}
.cortex-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.cortex-orb-label {
  position: absolute; left: 50%; bottom: -2px;
  transform: translateX(-50%);
  font-size: 9.5px; letter-spacing: 0.20em; text-transform: uppercase;
  color: var(--text-3); white-space: nowrap;
}
.cortex-orb-label::before {
  content: ""; display: inline-block;
  width: 6px; height: 6px; margin-right: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  vertical-align: middle;
  animation: cortex-led 1.4s ease-in-out infinite;
}
@keyframes cortex-led {
  0%, 100% { opacity: .55; transform: scale(.85); }
  50%      { opacity: 1;   transform: scale(1.1); }
}

.cortex-form {
  display: flex; flex-direction: column; gap: 14px;
  animation: cortex-fade-in 1s var(--ease) both;
  animation-delay: .6s;
}
.cortex-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Context strip — contexto heredado del topbar (read-only) */
.cortex-ctx-strip {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: 14px;
  background: rgba(255,255,255,0.03);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
html[data-theme="light"] .cortex-ctx-strip {
  background: rgba(255,255,255,0.7);
  box-shadow: inset 0 0 0 1px rgba(15,17,22,0.08);
}
.cortex-ctx-tag {
  font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent); opacity: 0.9;
}
.cortex-ctx-item { display: flex; align-items: center; gap: 7px; }
.cortex-ctx-dot { width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 6px currentColor; }
.cortex-ctx-k { font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.cortex-ctx-v { font-size: 12px; color: var(--text-1); font-weight: 500; }
.cortex-ctx-sep { width: 1px; height: 18px; background: rgba(255,255,255,0.1); }
html[data-theme="light"] .cortex-ctx-sep { background: rgba(15,17,22,0.1); }
.cortex-ctx-hint { font-size: 9px; color: var(--text-4); margin-left: auto; letter-spacing: 0.1em; }
.cortex-slot {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 15px;
  border: 0;
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-radius: 16px;
  text-align: left;
  color: var(--text-1);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), inset 0 0 0 1px rgba(255,255,255,0.06);
  transition: all .25s var(--ease);
}
html[data-theme="light"] .cortex-slot {
  background: rgba(255,255,255,0.65);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), inset 0 0 0 1px rgba(15,17,22,0.08);
}
.cortex-slot:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,0.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent),
    0 14px 30px -10px color-mix(in srgb, var(--accent) 25%, transparent);
}
.cortex-slot.is-locked {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14),
    inset 0 0 0 1.5px #34D399,
    0 0 22px rgba(52,211,153,0.22);
}
.cortex-slot-avatar {
  width: 42px; height: 42px;
  border-radius: 13px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), inset 0 0 0 1px rgba(255,255,255,0.06);
  color: #fff; font-size: 15px; font-weight: 600;
  letter-spacing: -0.02em; flex-shrink: 0;
}
.cortex-slot-plus { color: var(--text-3); font-weight: 300; font-size: 18px; }
.cortex-slot-meta { flex: 1; min-width: 0; }
.cortex-slot-label { font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-3); }
.cortex-slot-value {
  margin-top: 3px; font-size: 14px; font-weight: 500;
  color: var(--text-1); letter-spacing: -0.005em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cortex-slot-hint {
  margin-top: 2px; font-size: 9.5px;
  letter-spacing: 0.12em; color: var(--text-4);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cortex-slot-arrow {
  color: var(--text-3); font-family: "SF Mono", monospace;
  font-size: 14px; flex-shrink: 0;
}

.cortex-prompt {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), inset 0 0 0 1px rgba(255,255,255,0.06);
  transition: box-shadow .2s var(--ease);
}
html[data-theme="light"] .cortex-prompt {
  background: rgba(255,255,255,0.75);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.95), inset 0 0 0 1px rgba(15,17,22,0.08);
}
.cortex-prompt:focus-within {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent),
    0 0 28px color-mix(in srgb, var(--accent) 20%, transparent);
}
.cortex-prompt textarea {
  width: 100%; background: transparent; border: 0; outline: 0; resize: none;
  color: var(--text-1); font-family: inherit;
  font-size: 15px; line-height: 1.55;
  padding: 16px 18px; letter-spacing: -0.005em;
}
.cortex-prompt textarea::placeholder { color: var(--text-4); }
.cortex-prompt-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px 10px 16px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
html[data-theme="light"] .cortex-prompt-foot { border-top-color: rgba(15,17,22,0.06); }
.cortex-prompt-hint {
  font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text-4);
}

.cortex-launch {
  position: relative; border: 0; background: transparent;
  border-radius: 12px;
  padding: 10px 20px;
  cursor: pointer; color: #fff;
  font-weight: 500; font-size: 13.5px;
  letter-spacing: -0.005em;
  overflow: hidden;
  transition: transform .2s var(--ease);
}
.cortex-launch-bg {
  position: absolute; inset: 0;
  background: linear-gradient(110deg, var(--accent), var(--accent-2) 60%, var(--accent));
  background-size: 200% 100%;
  border-radius: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.30),
    inset 0 0 0 1px rgba(255,255,255,0.14),
    0 12px 24px -6px color-mix(in srgb, var(--accent) 55%, transparent);
  transition: background-position .4s var(--ease), box-shadow .25s var(--ease);
}
.cortex-launch-label { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 7px; }
.cortex-launch:hover:not(:disabled) { transform: translateY(-1px); }
.cortex-launch:hover:not(:disabled) .cortex-launch-bg {
  background-position: 100% 0%;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),
    inset 0 0 0 1px rgba(255,255,255,0.20),
    0 18px 36px -6px color-mix(in srgb, var(--accent) 70%, transparent);
}
.cortex-launch:disabled { opacity: 0.45; cursor: not-allowed; }
.cortex-launch:disabled .cortex-launch-bg {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
}

/* Old supercomputer brief — superseded by cortex-stage */
.super-stage, .super-stage-brief { display: none !important; }


/* ===========================================================================
   FORMS — NewClient + NewMoodboard
   =========================================================================== */
.form-stage {
  display: flex; flex-direction: column;
  gap: 16px;
  padding-bottom: 12px;
}
.form-hero {
  position: relative;
  border-radius: 18px;
  padding: 22px 20px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), inset 0 0 0 1px rgba(255,255,255,0.08);
  animation: form-hero-pulse 6s ease-in-out infinite;
}
@keyframes form-hero-pulse {
  0%, 100% { filter: brightness(1) saturate(1); }
  50%      { filter: brightness(1.1) saturate(1.15); }
}
.form-hero-fade {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 30%, rgba(0,0,0,0.45) 100%);
}
.form-hero-content {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 14px;
  color: #fff;
}
.form-hero-avatar {
  width: 58px; height: 58px;
  display: grid; place-items: center;
  border-radius: 17px;
  background: rgba(0,0,0,0.30);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 21px; font-weight: 600;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
  transition: transform .35s var(--ease);
}
.form-hero:hover .form-hero-avatar { transform: scale(1.04) rotate(-3deg); }
.form-hero-name {
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.15;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.form-hero-tag {
  margin-top: 4px;
  font-size: 13px; font-style: italic;
  color: rgba(255,255,255,0.85);
}
.form-hero-meta {
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
}

/* Step pills */
.form-steps { display: flex; gap: 5px; }
.form-step {
  display: flex; align-items: center; gap: 7px;
  flex: 1;
  padding: 8px 11px;
  border: 0;
  background: var(--surf-card, rgba(255,255,255,0.03));
  border-radius: 11px;
  box-shadow: inset 0 0 0 1px var(--surf-line, rgba(255,255,255,0.05));
  color: var(--text-3);
  cursor: pointer;
  font-size: 11.5px; font-weight: 500;
  letter-spacing: -0.005em;
  transition: all .2s var(--ease);
}
.form-step:hover { color: var(--text-1); }
.form-step.is-active {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent) 8%, transparent));
  color: var(--text-1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent);
}
.form-step.is-done {
  color: var(--success-2);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success) 35%, transparent);
}
.form-step-n {
  display: grid; place-items: center;
  width: 18px; height: 18px;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  font-size: 10.5px;
  flex-shrink: 0;
}
.form-step.is-active .form-step-n { background: var(--accent); color: #fff; }
.form-step.is-done   .form-step-n { background: var(--success); color: #fff; }
.form-step-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Sections */
.form-section { display: flex; flex-direction: column; gap: 14px; animation: form-section-in .35s var(--ease) both; }
@keyframes form-section-in {
  from { opacity: 0; transform: translateY(6px); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 2px; }
.form-label {
  font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-3);
  font-weight: 500;
}
.form-hint {
  font-size: 9.5px; color: var(--text-4);
  letter-spacing: 0.10em; font-style: italic;
}

.form-input {
  width: 100%;
  padding: 11px 13px;
  border: 0;
  background: var(--surf-card, rgba(255,255,255,0.04));
  color: var(--text-1);
  border-radius: 11px;
  font-family: inherit;
  font-size: 13.5px;
  letter-spacing: -0.005em;
  outline: 0;
  box-shadow: inset 0 0 0 1px var(--surf-line, rgba(255,255,255,0.06));
  transition: box-shadow .15s var(--ease), background .15s;
}
.form-input::placeholder { color: var(--text-4); }
.form-input:focus {
  background: var(--surf-card-hi, rgba(255,255,255,0.06));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent);
}
.form-input-sm { padding: 9px 11px; font-size: 12.5px; }

.form-select-wrap { position: relative; }
.form-select-wrap::after {
  content: "▾";
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
  font-size: 11px;
}
.form-select-wrap select {
  appearance: none; -webkit-appearance: none;
  padding-right: 30px;
  cursor: pointer;
}

.form-grid {
  display: grid; grid-template-columns: 1fr 2fr;
  gap: 10px;
}
.form-grid .form-field.is-wide { grid-column: span 1; }

.form-range {
  -webkit-appearance: none;
  width: 100%; height: 4px;
  background: var(--surf-card);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--surf-line);
  outline: 0;
}
.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 4px 12px -2px color-mix(in srgb, var(--accent) 55%, transparent);
  cursor: pointer;
}

/* Accent presets grid */
.accent-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.accent-card {
  position: relative;
  display: flex; flex-direction: column; gap: 0;
  padding: 0; border: 0;
  background: transparent;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: inset 0 0 0 1.5px transparent;
  transition: all .2s var(--ease);
}
.accent-card:hover { transform: translateY(-2px); }
.accent-card.is-on { box-shadow: inset 0 0 0 2px var(--accent), 0 8px 22px -8px color-mix(in srgb, var(--accent) 45%, transparent); }
.accent-card-bg {
  height: 58px;
  width: 100%;
}
.accent-card-name {
  padding: 5px 8px;
  background: var(--surf-card);
  font-size: 9.5px;
  letter-spacing: 0.10em;
  color: var(--text-3);
  text-transform: uppercase;
  text-align: center;
}
.accent-card.is-on .accent-card-name { color: var(--text-1); }

/* Palette row */
.palette-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.palette-cell {
  position: relative;
  display: block;
  aspect-ratio: 1;
  border-radius: 11px;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), inset 0 1px 0 rgba(255,255,255,0.18);
  overflow: hidden;
  transition: transform .2s var(--ease);
}
.palette-cell:hover { transform: scale(1.05); }
.palette-cell input[type="color"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
  border: 0;
}
.palette-cell-hex {
  position: absolute;
  left: 0; right: 0; bottom: 4px;
  text-align: center;
  font-size: 9px;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.04em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  pointer-events: none;
}

/* Tag input */
.taginput { display: flex; flex-direction: column; gap: 7px; }
.taginput-tags { display: flex; flex-wrap: wrap; gap: 5px; min-height: 0; }
.taginput-tags:empty { display: none; }
.taginput-remove {
  margin-left: 5px;
  border: 0; background: transparent;
  color: inherit;
  opacity: 0.55;
  cursor: pointer;
  font-size: 9.5px;
  padding: 0 2px;
}
.taginput-remove:hover { opacity: 1; }

/* Moodboard hero */
.moodboard-hero {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--surf-card);
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--surf-line);
}
.moodboard-hero-orb {
  width: 48px; height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
  animation: orb-rotate 6s linear infinite, orb-breathe 3s ease-in-out infinite;
  box-shadow: 0 0 24px currentColor;
}
@keyframes orb-rotate { to { transform: rotate(360deg); } }
@keyframes orb-breathe { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.15); } }
.moodboard-hero-kicker {
  font-size: 9.5px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text-3);
}
.moodboard-hero-title { margin-top: 3px; font-size: 16px; font-weight: 600; letter-spacing: -0.012em; color: var(--text-1); }
.moodboard-hero-sub { margin-top: 3px; font-size: 10px; letter-spacing: 0.12em; color: var(--text-3); }

/* Intent grid */
.intent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.intent-card {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px;
  border: 0;
  background: var(--surf-card);
  border-radius: 11px;
  color: var(--text-1);
  cursor: pointer;
  text-align: left;
  box-shadow: inset 0 0 0 1px var(--surf-line);
  transition: all .15s var(--ease);
  font-size: 12.5px;
}
.intent-card:hover { background: var(--surf-card-hi); }
.intent-card.is-on { box-shadow: inset 0 0 0 1.5px var(--accent); }
.intent-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }

/* Form foot (action buttons) */
.form-foot {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line-2);
  margin-top: 8px;
}
.form-btn-ghost, .form-btn-primary {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px;
  border: 0;
  border-radius: 11px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: all .2s var(--ease);
}
.form-btn-ghost {
  background: var(--surf-card);
  color: var(--text-2);
  box-shadow: inset 0 0 0 1px var(--surf-line);
}
.form-btn-ghost:hover { background: var(--surf-card-hi); color: var(--text-1); }
.form-btn-primary {
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 75%, var(--bg)));
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    inset 0 0 0 1px rgba(255,255,255,0.10),
    0 8px 20px -6px color-mix(in srgb, var(--accent) 50%, transparent);
}
.form-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.30),
    inset 0 0 0 1px rgba(255,255,255,0.15),
    0 12px 28px -6px color-mix(in srgb, var(--accent) 70%, transparent);
}
.form-btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

/* Popup wrapper (moodboard new form floats over vault) */
.form-popup-backdrop {
  position: fixed; inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid; place-items: center;
  padding: 30px;
  animation: backdrop-in .25s ease;
}
.form-popup {
  width: 540px;
  max-width: 92vw;
  max-height: 88vh;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 22px;
  box-shadow: var(--shadow-elevated);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: lightbox-pop .3s var(--ease) both;
}
.form-popup-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line-2);
}
.form-popup-kicker {
  font-size: 9.5px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--text-3);
}
.form-popup-title {
  margin-top: 3px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.018em;
  color: var(--text-1);
}
.form-popup .form-stage {
  padding: 20px 22px 22px;
  overflow-y: auto;
}


/* ===========================================================================
   Edge selection + delete
   =========================================================================== */
.edge-selected .edge-base {
  stroke: var(--accent) !important;
  stroke-width: 2 !important;
  opacity: 0.95 !important;
}
.edge-delete-btn {
  animation: edge-delete-pop .25s var(--ease) both;
  transform-origin: center;
}
.edge-delete-btn:hover { animation: none; transform-box: fill-box; }
.edge-delete-btn:hover circle:nth-child(2) { fill: rgba(251,113,133,0.15); }
@keyframes edge-delete-pop {
  from { opacity: 0; transform-box: fill-box; }
  to   { opacity: 1; }
}




/* ===========================================================================
   Edge — elegant continuous data-flow animation
   =========================================================================== */
.edge-base {
  stroke: color-mix(in srgb, var(--accent) 40%, transparent) !important;
  stroke-width: 1.5 !important;
  fill: none !important;
  opacity: 0.85;
}
.edges-svg g:not(.edge-selected):not(.edge-just-created) .edge-base {
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--accent) 30%, transparent));
}

/* Top traveling glow line — a pixel-art comet skimming the edge */
.edges-svg g:not(.edge-just-created) .edge-base + .edge-stream-pixel {
  display: none;
}

.edge-stream {
  fill: none;
  stroke: url(#edge-stream-grad);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-dasharray: 1 11;
  animation: edge-stream-flow 2.4s linear infinite;
  filter: url(#edgeGlow);
}
@keyframes edge-stream-flow {
  to { stroke-dashoffset: -36; }
}

.edge-stream-pixel {
  fill: var(--accent-2);
  filter: url(#edgeGlow);
}

.edge-base.is-active {
  stroke: var(--accent) !important;
  opacity: 1 !important;
  stroke-width: 2 !important;
}


/* ===========================================================================
   Claude bridge chip + project cards + settings + empty states
   =========================================================================== */
.claude-bridge {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surf-card)) 0%, var(--surf-card) 100%);
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
  position: relative; overflow: hidden;
}
.claude-bridge::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 100% at 80% 50%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%);
  pointer-events: none;
}
.claude-bridge-icon {
  position: relative; z-index: 1;
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 65%, var(--bg)));
  color: #fff;
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 6px 14px -4px color-mix(in srgb, var(--accent) 50%, transparent);
  animation: bridge-orb 4s ease-in-out infinite;
}
@keyframes bridge-orb { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.claude-bridge-text { flex: 1; position: relative; z-index: 1; }
.claude-bridge-title { font-size: 12.5px; font-weight: 600; color: var(--text-1); letter-spacing: -0.005em; }
.claude-bridge-sub { margin-top: 2px; font-size: 9.5px; color: var(--text-3); letter-spacing: 0.12em; text-transform: uppercase; }
.claude-bridge-dot {
  position: relative; z-index: 1;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
  animation: bridge-pulse 1.6s ease-in-out infinite;
}
@keyframes bridge-pulse { 0%,100% { opacity: 0.55; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.15); } }

/* ===========================================================================
   Project groups + cards
   =========================================================================== */
.project-group { margin-top: 16px; }
.project-group-head {
  display: flex; align-items: center; gap: 11px;
  padding: 4px 6px 10px;
}
.project-group-avatar {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 11px;
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
}
.project-group-avatar-ghost {
  background: var(--surf-card);
  color: var(--text-3);
  box-shadow: inset 0 0 0 1px var(--surf-line);
}
.project-group-name { font-size: 12.5px; font-weight: 600; color: var(--text-1); letter-spacing: -0.005em; }
.project-group-count { font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); margin-top: 2px; }

.project-list { display: flex; flex-direction: column; gap: 6px; }
.project-card {
  position: relative;
  background: var(--surf-card);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--surf-line);
  transition: all .2s var(--ease);
  overflow: hidden;
}
.project-card:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
.project-card.is-active { box-shadow: inset 0 0 0 1.5px var(--accent), 0 8px 20px -8px color-mix(in srgb, var(--accent) 30%, transparent); }
.project-card-main {
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  padding: 11px 14px;
  border: 0; background: transparent;
  color: var(--text-1);
  text-align: left;
  cursor: pointer;
}
.project-card-thumbs { display: flex; flex-shrink: 0; padding-left: 16px; }
.project-card-thumbs span {
  width: 24px; height: 24px;
  border-radius: 7px;
  display: inline-block;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.20), 0 0 0 2px var(--surf-card);
}
.project-card-meta { flex: 1; min-width: 0; }
.project-card-name { font-size: 13px; font-weight: 500; color: var(--text-1); letter-spacing: -0.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-card-stats { margin-top: 3px; font-size: 9.5px; color: var(--text-3); letter-spacing: 0.06em; }
.project-card-arrow { color: var(--text-3); font-family: "SF Mono", monospace; font-size: 13px; }
.project-card-delete {
  position: absolute; top: 8px; right: 8px;
  display: grid; place-items: center;
  width: 22px; height: 22px;
  border: 0;
  background: var(--surf-card);
  color: var(--text-3);
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  box-shadow: inset 0 0 0 1px var(--surf-line);
  transition: all .15s var(--ease);
}
.project-card:hover .project-card-delete { opacity: 1; }
.project-card-delete:hover { background: rgba(251,113,133,0.16); color: #FB7185; box-shadow: inset 0 0 0 1px rgba(251,113,133,0.45); }

.empty-state {
  text-align: center;
  padding: 32px 18px;
  margin-top: 14px;
  background: var(--surf-card);
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--surf-line);
}
.empty-state-icon { font-size: 28px; opacity: 0.7; }
.empty-state-title { margin-top: 10px; font-size: 13.5px; font-weight: 500; color: var(--text-1); letter-spacing: -0.01em; }
.empty-state-body { margin: 8px auto 0; max-width: 260px; font-size: 12px; color: var(--text-3); line-height: 1.55; }

/* ===========================================================================
   Settings drawer
   =========================================================================== */
.settings-section { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.settings-section-label {
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 4px 4px;
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  background: var(--surf-card);
  border-radius: 13px;
  box-shadow: inset 0 0 0 1px var(--surf-line);
  transition: all .2s var(--ease);
}
.settings-row:hover { background: var(--surf-card-hi); }
.settings-row-meta { min-width: 0; flex: 1; }
.settings-row-title { font-size: 13px; font-weight: 500; color: var(--text-1); letter-spacing: -0.005em; }
.settings-row-sub { margin-top: 3px; font-size: 10px; color: var(--text-3); letter-spacing: 0.08em; }
.settings-accents { display: inline-flex; gap: 5px; }
.settings-accent {
  width: 28px; height: 28px; border: 0;
  border-radius: 9px;
  background: var(--surf-card-hi);
  box-shadow: inset 0 0 0 1px var(--surf-line);
  cursor: pointer;
  display: grid; place-items: center;
  transition: all .15s var(--ease);
}
.settings-accent:hover { transform: scale(1.08); }
.settings-accent.is-on { box-shadow: inset 0 0 0 2px var(--ac); }
.settings-accent-disc { width: 14px; height: 14px; border-radius: 5px; box-shadow: inset 0 1px 0 rgba(255,255,255,0.25); }

.settings-card {
  padding: 12px 13px;
  background: var(--surf-card);
  border-radius: 13px;
  box-shadow: inset 0 0 0 1px var(--surf-line);
}
.settings-card-row { display: flex; align-items: center; gap: 11px; }
.settings-int-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), inset 0 0 0 1px rgba(255,255,255,0.06);
}
.settings-card-meta { flex: 1; min-width: 0; }
.settings-card-title { font-size: 12.5px; font-weight: 500; color: var(--text-1); letter-spacing: -0.005em; }
.settings-card-sub { margin-top: 3px; font-size: 10px; color: var(--text-3); letter-spacing: 0.06em; }
.settings-status {
  padding: 4px 9px;
  border-radius: 6px;
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}
.settings-status-ok {
  background: rgba(52,211,153,0.10);
  color: var(--success-2);
  box-shadow: inset 0 0 0 1px rgba(52,211,153,0.30);
}
.settings-action {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 13px;
  border: 0;
  background: var(--surf-card);
  color: var(--text-2);
  border-radius: 11px;
  cursor: pointer;
  font-size: 12px; font-weight: 500;
  letter-spacing: -0.005em;
  box-shadow: inset 0 0 0 1px var(--surf-line);
  transition: all .15s var(--ease);
}
.settings-action-danger:hover {
  background: rgba(251,113,133,0.10);
  color: #FECDD3;
  box-shadow: inset 0 0 0 1px rgba(251,113,133,0.40);
}
.settings-foot {
  margin-top: 18px;
  padding: 0 4px;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--text-4);
  text-transform: uppercase;
  text-align: center;
}

/* ===========================================================================
   Settings v2 — clases sett-*
   =========================================================================== */

/* Perfil */
.sett-profile {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--surf-card);
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--surf-line);
  margin-bottom: 6px;
}
.sett-profile-avatar {
  width: 40px; height: 40px; border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--bg)));
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #fff; letter-spacing: -0.02em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 4px 12px -3px color-mix(in srgb, var(--accent) 50%, transparent);
  flex-shrink: 0;
}
.sett-profile-info { flex: 1; min-width: 0; }
.sett-profile-name { font-size: 13px; font-weight: 600; color: var(--text-1); letter-spacing: -0.01em; }
.sett-profile-email { font-size: 10px; color: var(--text-3); margin-top: 2px; letter-spacing: 0.04em; }
.sett-profile-pro {
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
  white-space: nowrap;
}

/* Workspace */
.sett-workspace {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--accent) 6%, var(--surf-card));
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
  margin-bottom: 6px;
}
.sett-ws-logo { height: 22px; width: auto; opacity: 0.85; }
.sett-ws-info { flex: 1; min-width: 0; }
.sett-ws-name { font-size: 12.5px; font-weight: 600; color: var(--text-1); letter-spacing: -0.01em; }
.sett-ws-meta { font-size: 9.5px; color: var(--text-3); margin-top: 2px; letter-spacing: 0.06em; }

/* Groups */
.sett-group {
  margin-top: 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.sett-group-label {
  font-size: 9.5px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-3); padding: 0 4px 2px;
}

/* Rows */
.sett-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  background: var(--surf-card);
  border-radius: 13px;
  box-shadow: inset 0 0 0 1px var(--surf-line);
  transition: background .18s var(--ease);
}
.sett-row:hover { background: var(--surf-card-hi); }
.sett-row-left { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; }
.sett-row-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--surf-card-hi);
  box-shadow: inset 0 0 0 1px var(--surf-line);
  color: var(--text-2);
}
.sett-row-title { font-size: 12.5px; font-weight: 500; color: var(--text-1); letter-spacing: -0.005em; }
.sett-row-sub { margin-top: 2px; font-size: 9.5px; color: var(--text-3); letter-spacing: 0.06em; }

/* Segment control */
.sett-seg { display: inline-flex; gap: 2px; background: var(--surf-card-hi); border-radius: 10px; padding: 2px; box-shadow: inset 0 0 0 1px var(--surf-line); }
.sett-seg-btn {
  padding: 5px 9px;
  border: 0; border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font-family: inherit; font-size: 11px; font-weight: 500;
  cursor: pointer;
  transition: all .15s var(--ease);
  white-space: nowrap;
}
.sett-seg-btn.is-on {
  background: var(--surf-card);
  color: var(--text-1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3), inset 0 0 0 1px var(--surf-line);
}
.sett-seg-btn:hover:not(.is-on) { color: var(--text-1); }

/* Accents */
.sett-accents { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.sett-accent {
  width: 26px; height: 26px; border: 0;
  border-radius: 8px;
  background: var(--surf-card-hi);
  box-shadow: inset 0 0 0 1px var(--surf-line);
  cursor: pointer;
  display: grid; place-items: center;
  transition: all .15s var(--ease);
}
.sett-accent:hover { transform: scale(1.1); }
.sett-accent.is-on { box-shadow: inset 0 0 0 2px var(--ac), 0 0 10px -2px var(--ac); }
.sett-accent-disc { width: 13px; height: 13px; border-radius: 4px; box-shadow: inset 0 1px 0 rgba(255,255,255,0.25); display: block; }

/* Integraciones */
.sett-int-card {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 14px;
  background: var(--surf-card);
  border-radius: 13px;
  box-shadow: inset 0 0 0 1px var(--surf-line);
}
.sett-int-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), inset 0 0 0 1px rgba(255,255,255,0.06);
}
.sett-int-meta { flex: 1; min-width: 0; }
.sett-int-title { font-size: 12.5px; font-weight: 500; color: var(--text-1); letter-spacing: -0.005em; }
.sett-int-sub { margin-top: 2px; font-size: 9.5px; color: var(--text-3); letter-spacing: 0.05em; }
.sett-int-backend {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 14px;
  font-size: 9.5px; letter-spacing: 0.07em;
  color: var(--text-4);
  background: color-mix(in srgb, var(--bg) 60%, var(--surf-card));
  border-radius: 9px;
  box-shadow: inset 0 0 0 1px var(--surf-line);
}

/* Status badges */
.sett-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
}
.sett-badge-ok {
  background: rgba(52,211,153,0.10);
  color: var(--success-2);
  box-shadow: inset 0 0 0 1px rgba(52,211,153,0.28);
}
.sett-badge-err {
  background: rgba(251,113,133,0.10);
  color: #FCA5A5;
  box-shadow: inset 0 0 0 1px rgba(251,113,133,0.28);
}
.sett-badge-checking {
  background: rgba(251,191,36,0.08);
  color: rgba(251,191,36,0.6);
  box-shadow: inset 0 0 0 1px rgba(251,191,36,0.20);
  letter-spacing: 0.3em;
}
.sett-badge-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; display: inline-block; flex-shrink: 0;
  box-shadow: 0 0 5px currentColor;
}
.sett-badge-dot-err { background: #FCA5A5; }

/* Modelos activos */
.sett-models { display: flex; flex-wrap: wrap; gap: 6px; }
.sett-model-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px;
  background: var(--surf-card);
  border-radius: 9px;
  box-shadow: inset 0 0 0 1px var(--surf-line);
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 10px; letter-spacing: 0.04em; color: var(--text-2);
}
.sett-model-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

/* Botones de acción */
.sett-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border: 0;
  background: var(--surf-card);
  color: var(--text-2);
  border-radius: 11px;
  cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 500; letter-spacing: -0.003em;
  box-shadow: inset 0 0 0 1px var(--surf-line);
  transition: all .15s var(--ease);
  width: 100%;
}
.sett-btn:hover { background: var(--surf-card-hi); color: var(--text-1); }
.sett-btn-danger {
  color: rgba(251,113,133,0.75);
}
.sett-btn-danger:hover {
  background: rgba(251,113,133,0.08);
  color: #FCA5A5;
  box-shadow: inset 0 0 0 1px rgba(251,113,133,0.35);
}

/* Zona de peligro */
.sett-danger-zone {
  padding: 12px 14px;
  background: rgba(251,113,133,0.04);
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(251,113,133,0.14);
}
.sett-danger-desc {
  font-size: 11.5px; font-weight: 300; color: var(--text-3); line-height: 1.5;
  margin-bottom: 10px; margin-top: 4px;
}

/* Acento fijo + fixed tags */
.sett-accent-fixed {
  display: flex; align-items: center; gap: 7px;
}
.sett-accent-fixed-disc {
  width: 14px; height: 14px; border-radius: 50%;
  background: #8F7EE9;
  box-shadow: 0 0 8px rgba(143,126,233,0.55);
  flex-shrink: 0;
}
.sett-accent-fixed-label {
  font-size: 10.5px; color: var(--text-3); letter-spacing: 0.05em;
}
.sett-fixed-tag {
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em;
  color: rgba(143,126,233,0.85);
  background: rgba(143,126,233,0.12);
  border: 1px solid rgba(143,126,233,0.25);
  border-radius: 20px;
  padding: 2px 9px;
  white-space: nowrap;
}

/* Danger zone — confirm + auth steps */
.sett-danger-warn {
  font-size: 11px; color: rgba(251,113,133,0.8);
  line-height: 1.5; margin-bottom: 10px;
}
.sett-danger-confirm-actions {
  display: flex; gap: 8px; justify-content: flex-end;
}
.sett-danger-auth {
  display: flex; flex-direction: column; gap: 8px;
}
.sett-danger-auth-label {
  font-size: 11px; color: var(--text-3);
}
.sett-danger-auth-hint {
  font-size: 10.5px; color: rgba(143,126,233,0.7);
  margin-top: -4px;
}
.sett-danger-input {
  width: 100%; background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; padding: 7px 10px;
  font-size: 12px; color: var(--text-1);
  outline: none; font-family: var(--font-mono);
  transition: border-color 0.15s;
}
.sett-danger-input:focus {
  border-color: rgba(251,113,133,0.4);
  box-shadow: 0 0 0 2px rgba(251,113,133,0.08);
}
.sett-danger-error {
  font-size: 10.5px; color: #FCA5A5;
  animation: shake 0.3s ease;
}
@keyframes shake {
  0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)}
}
.sett-danger-confirm {
  display: flex; flex-direction: column; gap: 10px;
}

/* ── ClientDetailModal — IA context fields ── */
.client-color-emotion {
  font-size: 10.5px; font-style: italic; color: var(--text-3);
  margin-top: 4px; line-height: 1.45;
  font-family: var(--font-mono, monospace);
}
.client-tone-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 600;
  color: rgba(251,191,36,0.9);
  background: rgba(251,191,36,0.1);
  border: 1px solid rgba(251,191,36,0.25);
  border-radius: 20px; padding: 2px 9px;
}
.client-tag-audience {
  display: inline-flex; align-items: center;
  font-size: 10.5px; font-weight: 500;
  color: rgba(99,179,237,0.9);
  background: rgba(99,179,237,0.1);
  border: 1px solid rgba(99,179,237,0.22);
  border-radius: 20px; padding: 2px 9px;
}
.client-tag-pillar {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 500;
  color: rgba(143,126,233,0.9);
  background: rgba(143,126,233,0.1);
  border: 1px solid rgba(143,126,233,0.22);
  border-radius: 20px; padding: 2px 9px;
}
.client-pillar-num {
  width: 14px; height: 14px; border-radius: 50%;
  background: rgba(143,126,233,0.25);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 8.5px; font-weight: 700; color: #A78BFA;
  flex-shrink: 0;
}
.client-composition {
  font-size: 10.5px; font-style: italic; color: var(--text-3);
  line-height: 1.5; font-family: var(--font-mono, monospace);
  opacity: 0.85;
}

/* ── Logo section — ClientDetailModal ── */
.client-logo-preview {
  width: 100%; max-height: 80px; object-fit: contain;
  background: rgba(255,255,255,0.04); border-radius: 8px;
  padding: 8px; margin-bottom: 8px;
  border: 1px solid rgba(255,255,255,0.07);
}
.client-logo-desc {
  font-size: 10.5px; line-height: 1.55; color: var(--text-2);
  margin-bottom: 8px;
}
.client-logo-meta {
  display: flex; flex-direction: column; gap: 4px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 7px; padding: 8px 10px;
  margin-bottom: 6px;
}
.client-logo-meta-row {
  display: flex; gap: 8px; align-items: baseline;
}
.client-logo-meta-label {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-4);
  min-width: 80px; flex-shrink: 0;
}
.client-logo-meta-val {
  font-size: 10.5px; color: var(--text-3); line-height: 1.4;
}

/* Footer */
.sett-foot {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  margin-top: 20px; padding: 12px 4px;
  font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-4);
  border-top: 1px solid var(--surf-line);
}
.sett-foot-logo { height: 14px; width: auto; opacity: 0.3; }

/* Legal accordion */
.sett-legal-item {
  border: 1px solid var(--surf-line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 6px;
}
.sett-legal-trigger {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: none; cursor: pointer;
  color: var(--text-2); font-size: 12px; font-weight: 500;
  text-align: left;
  transition: background 0.15s;
}
.sett-legal-trigger:hover { background: var(--surf-card-hi); color: var(--text-1); }
.sett-legal-trigger.is-open { color: var(--text-1); background: var(--surf-card-hi); }
.sett-legal-content {
  padding: 0 12px 12px;
  border-top: 1px solid var(--surf-line);
  animation: sett-legal-in 0.15s ease;
}
@keyframes sett-legal-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.sett-legal-dl {
  margin: 10px 0 0;
  display: grid; grid-template-columns: max-content 1fr; gap: 5px 12px;
}
.sett-legal-dl dt {
  font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-3); font-weight: 600; padding-top: 1px;
  white-space: nowrap;
}
.sett-legal-dl dd {
  font-size: 11px; color: var(--text-2); margin: 0;
  line-height: 1.55;
}
html[data-theme="light"] .sett-legal-trigger { color: rgba(14,13,20,0.7); }
html[data-theme="light"] .sett-legal-trigger.is-open,
html[data-theme="light"] .sett-legal-trigger:hover { color: rgba(14,13,20,0.9); background: rgba(255,255,255,0.85); }
html[data-theme="light"] .sett-legal-dl dt { color: rgba(14,13,20,0.45); }
html[data-theme="light"] .sett-legal-dl dd { color: rgba(14,13,20,0.75); }

/* Light mode overrides */
html[data-theme="light"] .sett-profile,
html[data-theme="light"] .sett-row,
html[data-theme="light"] .sett-int-card,
html[data-theme="light"] .sett-model-chip,
html[data-theme="light"] .sett-btn { background: rgba(255,255,255,0.85) !important; }
html[data-theme="light"] .sett-workspace {
  background: color-mix(in srgb, var(--accent) 5%, rgba(255,255,255,0.7)) !important;
}
html[data-theme="light"] .sett-profile-name,
html[data-theme="light"] .sett-row-title,
html[data-theme="light"] .sett-int-title,
html[data-theme="light"] .sett-ws-name { color: rgba(14,13,20,0.9) !important; }


/* Popup large (for NewClient) */
.form-popup-lg {
  width: 640px;
  max-width: 94vw;
  max-height: 90vh;
}

/* Motion controls */
html[data-motion="reduced"] .edge-stream,
html[data-motion="reduced"] .edge-stream-pixel,
html[data-motion="reduced"] body::before { animation-duration: 8s !important; }
html[data-motion="off"] .edge-stream,
html[data-motion="off"] .edge-stream-pixel,
html[data-motion="off"] .cortex-title-em,
html[data-motion="off"] .agent-orb.is-running .agent-orb-disc::before,
html[data-motion="off"] .led-breath,
html[data-motion="off"] .claude-bridge-dot,
html[data-motion="off"] .bridge-orb { animation: none !important; }

/* Light theme final patches */
html[data-theme="light"] .leftrail,
html[data-theme="light"] .topbar,
html[data-theme="light"] .left-drawer,
html[data-theme="light"] .super-panel,
html[data-theme="light"] .form-popup,
html[data-theme="light"] .vault-sheet,
html[data-theme="light"] .gallery-panel,
html[data-theme="light"] .minimap-wrap {
  background: rgba(255,255,255,0.85) !important;
  box-shadow:
    0 30px 80px -22px rgba(15,17,22,0.18),
    0 10px 28px -10px rgba(15,17,22,0.12),
    inset 0 1px 0 rgba(255,255,255,0.85),
    inset 0 0 0 1px rgba(15,17,22,0.08) !important;
}
html[data-theme="light"] .form-popup-backdrop,
html[data-theme="light"] .picker-backdrop,
html[data-theme="light"] .lightbox { background: rgba(15,17,22,0.35) !important; backdrop-filter: blur(8px); }
html[data-theme="light"] .node-v2 {
  background: rgba(255,255,255,0.92) !important;
  box-shadow:
    0 22px 50px -18px rgba(15,17,22,0.18),
    inset 0 1px 0 rgba(255,255,255,0.95),
    inset 0 0 0 1px rgba(15,17,22,0.08) !important;
}
html[data-theme="light"] .toast { background: rgba(255,255,255,0.95) !important; color: rgba(15,17,22,0.96) !important; }
html[data-theme="light"] .toast-title { color: rgba(15,17,22,0.96); }
html[data-theme="light"] .toast-text { color: rgba(15,17,22,0.65); }
html[data-theme="light"] .agent-orb-disc { background: rgba(255,255,255,0.92); }
html[data-theme="light"] .agent-orb-letter { color: var(--ao-c); }
html[data-theme="light"] .super-toggle { background: rgba(255,255,255,0.92) !important; }


/* ===========================================================================
   Moodboard inspector — Dashboard
   =========================================================================== */
.vault-inspector-dash {
  padding: 20px 18px;
  display: flex; flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.dash-hero {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--surf-card);
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px var(--surf-line);
  position: relative;
  overflow: hidden;
}
.dash-hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 100% at 100% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 65%);
  pointer-events: none;
}
.dash-hero-empty {
  flex-direction: column; align-items: center;
  text-align: center;
  padding: 32px 18px;
}
.dash-hero-orb {
  position: relative;
  width: 78px; height: 78px;
  border-radius: 50%;
  flex-shrink: 0;
  padding: 6px;
  display: grid; place-items: center;
  z-index: 1;
  animation: dash-orb-rot 24s linear infinite;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.45);
}
@keyframes dash-orb-rot { to { transform: rotate(360deg); } }
.dash-orb-empty {
  background: conic-gradient(var(--surf-line), color-mix(in srgb, var(--accent) 22%, var(--surf-line)), var(--surf-line));
}
.dash-orb-empty .dash-orb-core {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--bg-soft, var(--surf-card-hi));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10);
}
.dash-orb-inner {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surf-card);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.30),
    inset 0 0 0 2px rgba(255,255,255,0.08),
    0 6px 14px -4px rgba(0,0,0,0.4);
  animation: dash-orb-rot 24s linear infinite reverse;
}
.dash-orb-score {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.dash-orb-label {
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-top: 2px;
}
.dash-hero-meta { min-width: 0; flex: 1; position: relative; z-index: 1; }
.dash-hero-kicker {
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
}
.dash-hero-title {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-hero-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}
.dash-hero-mood {
  margin-top: 6px;
  display: flex; gap: 4px;
  flex-wrap: wrap;
}
.dash-mood-chip {
  padding: 3px 8px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-radius: 5px;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--accent-3);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}

/* KPIs row */
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.dash-kpi {
  padding: 11px 8px;
  background: var(--surf-card);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--surf-line);
  text-align: center;
  transition: background .15s var(--ease);
}
.dash-kpi:hover { background: var(--surf-card-hi); }
.dash-kpi-val {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-1);
  line-height: 1;
}
.dash-kpi-label {
  margin-top: 5px;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* Generic dash-block */
.dash-block {
  display: flex; flex-direction: column;
  gap: 8px;
  padding: 13px 14px;
  background: var(--surf-card);
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px var(--surf-line);
}
.dash-block-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px;
}
.dash-block-label {
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.dash-block-hint {
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--text-4);
}
.dash-block-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.01em;
}

/* Consistency bar */
.dash-bar {
  position: relative;
  height: 6px;
  background: var(--surf-line);
  border-radius: 99px;
  overflow: hidden;
}
.dash-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 99px;
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 50%, transparent);
  transition: width .45s var(--ease);
}
.dash-bar-track {
  position: relative; height: 1px;
  margin-top: 4px;
}
.dash-bar-track span {
  position: absolute;
  top: 0;
  width: 1px; height: 5px;
  background: var(--text-4);
  opacity: 0.3;
  transform: translate(-50%, -10px);
}

/* Palette */
.dash-palette {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.dash-swatch {
  position: relative;
  aspect-ratio: 1 / 1.2;
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    inset 0 0 0 1px rgba(255,255,255,0.06),
    0 2px 6px -1px rgba(0,0,0,0.30);
  cursor: pointer;
  transition: transform .2s var(--ease);
}
.dash-swatch:hover {
  transform: translateY(-2px) scale(1.05);
  z-index: 2;
}
.dash-swatch-hex {
  position: absolute;
  left: 4px; right: 4px; bottom: 4px;
  text-align: center;
  font-size: 8.5px;
  color: rgba(255,255,255,0.92);
  letter-spacing: 0.03em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  opacity: 0;
  transition: opacity .15s;
}
.dash-swatch:hover .dash-swatch-hex { opacity: 1; }
.dash-swatch-tag {
  position: absolute;
  top: 4px; left: 4px;
  font-size: 8px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.96);
  background: rgba(0,0,0,0.40);
  padding: 1px 5px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

/* Atributos técnicos (luz, lente) */
.dash-attrs {
  display: flex; flex-direction: column;
  gap: 6px;
}
.dash-attr {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 11px;
  background: var(--bg-soft, rgba(0,0,0,0.10));
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px var(--surf-line);
}
html[data-theme="light"] .dash-attr { background: rgba(15,17,22,0.02); }
.dash-attr-icon {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent-2);
  font-size: 14px;
  flex-shrink: 0;
}
.dash-attr-meta { min-width: 0; }
.dash-attr-key {
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.dash-attr-val {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-1);
  line-height: 1.5;
  letter-spacing: -0.005em;
}

/* Chips */
.dash-chips {
  display: flex; flex-wrap: wrap;
  gap: 4px;
}
.dash-chip {
  padding: 4px 9px;
  background: var(--surf-card-hi);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-1);
  letter-spacing: -0.005em;
  box-shadow: inset 0 0 0 1px var(--surf-line);
}
.dash-chip-soft {
  background: transparent;
  color: var(--text-2);
}

/* Prompts */
.dash-copy {
  border: 0;
  background: transparent;
  color: var(--accent-2);
  font-size: 10.5px;
  letter-spacing: -0.005em;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 5px;
  font-family: inherit;
  font-weight: 500;
  transition: background .15s;
}
.dash-copy:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.dash-prompt {
  padding: 11px 12px;
  background: var(--bg-soft, rgba(0,0,0,0.18));
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px var(--surf-line);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-2);
  letter-spacing: -0.002em;
}
html[data-theme="light"] .dash-prompt { background: rgba(15,17,22,0.04); }
.dash-negative-label {
  color: #FCA5A5 !important;
}
.dash-prompt-negative {
  color: var(--text-3);
}


/* ===========================================================================
   LIGHT MODE — comprehensive fixes (hover, text, animations, toasts)
   =========================================================================== */
html[data-theme="light"] {
  /* Text more readable */
  --text-1: rgba(15, 17, 22, 0.96);
  --text-2: rgba(15, 17, 22, 0.70);
  --text-3: rgba(15, 17, 22, 0.50);
  --text-4: rgba(15, 17, 22, 0.34);

  /* Surfaces with more contrast */
  --surf-card:     rgba(15, 17, 22, 0.05);
  --surf-card-hi:  rgba(15, 17, 22, 0.09);
  --surf-line:     rgba(15, 17, 22, 0.12);
  --line:          rgba(15, 17, 22, 0.10);
  --line-2:        rgba(15, 17, 22, 0.07);
  --dot:           rgba(15, 17, 22, 0.18);

  /* Slightly darker accent for AA contrast on light */
  --accent:        #6D52E0;
  --accent-2:      #5740C7;
  --accent-3:      #4434B0;
}

/* Topbar buttons */
html[data-theme="light"] .btn-primary {
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 75%, #000)) !important;
  color: #fff !important;
}
html[data-theme="light"] .btn-ghost,
html[data-theme="light"] .btn-soft,
html[data-theme="light"] .theme-toggle-btn {
  background: rgba(255,255,255,0.7) !important;
  color: rgba(15,17,22,0.78) !important;
  box-shadow: inset 0 0 0 1px rgba(15,17,22,0.10) !important;
}
html[data-theme="light"] .btn-ghost:hover,
html[data-theme="light"] .btn-soft:hover,
html[data-theme="light"] .theme-toggle-btn:hover {
  background: rgba(255,255,255,0.92) !important;
  color: rgba(15,17,22,0.96) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent) !important;
}

/* Mode tabs in topbar */
html[data-theme="light"] .mode-tabs {
  background: rgba(15,17,22,0.05) !important;
}
html[data-theme="light"] .mode-tab {
  color: rgba(15,17,22,0.60) !important;
}
html[data-theme="light"] .mode-tab:hover { color: rgba(15,17,22,0.96) !important; }
html[data-theme="light"] .mode-tab.is-active {
  background: linear-gradient(135deg, rgba(124,58,237,0.16), rgba(167,139,250,0.10)) !important;
  color: #4C1D95 !important;
  box-shadow:
    0 6px 18px -6px rgba(124,58,237,0.35),
    inset 0 1px 0 rgba(255,255,255,0.7),
    inset 0 0 0 1px rgba(124,58,237,0.28) !important;
}
html[data-theme="light"] .mode-tab.is-active .mode-tab-dot {
  background: #7C3AED !important; box-shadow: 0 0 10px rgba(124,58,237,0.7);
}

/* Rail items */
html[data-theme="light"] .rail-item {
  color: rgba(15,17,22,0.60) !important;
}
html[data-theme="light"] .rail-item:hover {
  background: rgba(15,17,22,0.06) !important;
  color: rgba(15,17,22,0.96) !important;
}
html[data-theme="light"] .rail-item.is-active {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, transparent), color-mix(in srgb, var(--accent) 8%, transparent)) !important;
  color: var(--accent) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent) !important;
}
html[data-theme="light"] .rail-item::after {
  background: rgba(20,22,30,0.94) !important;
  color: #fff !important;
}

/* Drawer headers & section labels */
html[data-theme="light"] .drawer-title,
html[data-theme="light"] .super-title,
html[data-theme="light"] .dash-hero-title,
html[data-theme="light"] .vault-name-input,
html[data-theme="light"] .form-popup-title,
html[data-theme="light"] .picker-title,
html[data-theme="light"] .moodboard-hero-title,
html[data-theme="light"] .client-card-name,
html[data-theme="light"] .project-card-name,
html[data-theme="light"] .settings-card-title,
html[data-theme="light"] .settings-row-title,
html[data-theme="light"] .node-v2-title,
html[data-theme="light"] .node-add-title,
html[data-theme="light"] .lightbox-prompt,
html[data-theme="light"] .gallery-meta-prompt,
html[data-theme="light"] .gallery-title,
html[data-theme="light"] .form-hero-name {
  color: rgba(15,17,22,0.96) !important;
}

/* Node inputs in light */
html[data-theme="light"] .node-input,
html[data-theme="light"] .node-textarea,
html[data-theme="light"] .form-input,
html[data-theme="light"] .composer-textarea,
html[data-theme="light"] .cortex-prompt textarea,
html[data-theme="light"] .super-stage-composer textarea,
html[data-theme="light"] .note-text {
  background: #fff !important;
  color: rgba(15,17,22,0.96) !important;
  box-shadow: inset 0 0 0 1px rgba(15,17,22,0.10) !important;
}
html[data-theme="light"] .node-input::placeholder,
html[data-theme="light"] .form-input::placeholder,
html[data-theme="light"] .node-textarea::placeholder { color: rgba(15,17,22,0.34) !important; }
html[data-theme="light"] .node-input:focus,
html[data-theme="light"] .form-input:focus {
  box-shadow: inset 0 0 0 1.5px var(--accent) !important;
}

/* Tipo toggle / Counter / Seg / Select in light */
html[data-theme="light"] .tipo-toggle,
html[data-theme="light"] .counter,
html[data-theme="light"] .seg-row,
html[data-theme="light"] .select-box,
html[data-theme="light"] .seed-btn,
html[data-theme="light"] .url-row,
html[data-theme="light"] .model-pill,
html[data-theme="light"] .theme-seg,
html[data-theme="light"] .quiz-chip,
html[data-theme="light"] .quiz-row {
  background: rgba(255,255,255,0.78) !important;
  color: rgba(15,17,22,0.78) !important;
  box-shadow: inset 0 0 0 1px rgba(15,17,22,0.10) !important;
}
html[data-theme="light"] .tipo-btn,
html[data-theme="light"] .seg-chip,
html[data-theme="light"] .theme-seg-btn,
html[data-theme="light"] .mini-tab {
  color: rgba(15,17,22,0.60) !important;
}
html[data-theme="light"] .tipo-btn:hover,
html[data-theme="light"] .seg-chip:hover,
html[data-theme="light"] .theme-seg-btn:hover,
html[data-theme="light"] .mini-tab:hover { color: rgba(15,17,22,0.96) !important; background: rgba(15,17,22,0.05) !important; }

html[data-theme="light"] .tipo-btn.is-active.accent-indigo,
html[data-theme="light"] .seg-chip.is-active,
html[data-theme="light"] .theme-seg-btn.is-on,
html[data-theme="light"] .quiz-chip.is-on,
html[data-theme="light"] .mini-tab.is-active.accent-green {
  background: var(--accent) !important;
  color: #fff !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 4px 12px -3px color-mix(in srgb, var(--accent) 45%, transparent) !important;
}

/* Cards & rows hover in light */
html[data-theme="light"] .node-add-card,
html[data-theme="light"] .client-card,
html[data-theme="light"] .project-card,
html[data-theme="light"] .picker-row,
html[data-theme="light"] .intent-card,
html[data-theme="light"] .moodboard-card,
html[data-theme="light"] .tpl-card,
html[data-theme="light"] .settings-row,
html[data-theme="light"] .settings-card,
html[data-theme="light"] .cortex-slot,
html[data-theme="light"] .brief-slot,
html[data-theme="light"] .dash-block,
html[data-theme="light"] .dash-kpi,
html[data-theme="light"] .dash-hero,
html[data-theme="light"] .dash-attr {
  background: rgba(255,255,255,0.75) !important;
  box-shadow: inset 0 0 0 1px rgba(15,17,22,0.08) !important;
}
html[data-theme="light"] .node-add-card:hover,
html[data-theme="light"] .client-card:hover,
html[data-theme="light"] .project-card:hover,
html[data-theme="light"] .picker-row:hover,
html[data-theme="light"] .intent-card:hover,
html[data-theme="light"] .moodboard-card:hover,
html[data-theme="light"] .tpl-card:hover,
html[data-theme="light"] .settings-row:hover,
html[data-theme="light"] .cortex-slot:hover {
  background: rgba(255,255,255,0.98) !important;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent),
    0 10px 24px -10px rgba(15,17,22,0.18) !important;
}

/* Node-add-card hover glow en light — usa --add-c del nodo para el glow */
html[data-theme="light"] .node-add-card:hover {
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--add-c) 45%, transparent),
    0 8px 22px -8px color-mix(in srgb, var(--add-c) 32%, transparent),
    0 2px 8px -4px rgba(15,17,22,0.08) !important;
  transform: translateY(-2px);
}
/* node-add-card base en light — borde sutil por color del tipo */
html[data-theme="light"] .node-add-card {
  box-shadow: inset 0 0 0 1px rgba(15,17,22,0.07) !important;
}
/* node-add-icon en light */
html[data-theme="light"] .node-add-icon {
  background: color-mix(in srgb, var(--add-c) 10%, transparent) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--add-c) 22%, transparent) !important;
}
html[data-theme="light"] .node-add-title { color: var(--text-1) !important; }
html[data-theme="light"] .node-add-hint { color: var(--text-3) !important; }
html[data-theme="light"] .node-add-plus {
  background: color-mix(in srgb, var(--add-c) 14%, transparent) !important;
  color: var(--add-c) !important;
}

/* Lock switch */
html[data-theme="light"] .lock-switch {
  background: rgba(255,255,255,0.8) !important;
  color: rgba(15,17,22,0.60) !important;
  box-shadow: inset 0 0 0 1px rgba(15,17,22,0.10) !important;
}
html[data-theme="light"] .lock-switch.is-locked {
  background: rgba(16,185,129,0.14) !important;
  color: #047857 !important;
  box-shadow: inset 0 0 0 1px rgba(16,185,129,0.55) !important;
}

/* Toasts in light — FIXED */
html[data-theme="light"] .toast {
  background: rgba(255,255,255,0.96) !important;
  color: rgba(15,17,22,0.96) !important;
  box-shadow:
    0 20px 50px -16px rgba(15,17,22,0.25),
    inset 0 0 0 1px rgba(15,17,22,0.08) !important;
}
html[data-theme="light"] .toast-title { color: rgba(15,17,22,0.96) !important; }
html[data-theme="light"] .toast-text  { color: rgba(15,17,22,0.65) !important; }
html[data-theme="light"] .toast-close { color: rgba(15,17,22,0.45) !important; }
html[data-theme="light"] .toast-close:hover { color: rgba(15,17,22,0.96) !important; background: rgba(15,17,22,0.06) !important; }

/* Notifications icons keep accent bg with white icon */
html[data-theme="light"] .toast-icon {
  color: var(--toast-c) !important;
  background: color-mix(in srgb, var(--toast-c) 14%, #fff) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--toast-c) 40%, transparent) !important;
}

/* Chips and tags */
html[data-theme="light"] .persona-chip {
  background: rgba(244,114,182,0.10) !important;
  color: #BE185D !important;
  box-shadow: inset 0 0 0 1px rgba(244,114,182,0.32) !important;
}
html[data-theme="light"] .incoming-chip {
  background: color-mix(in srgb, var(--accent) 12%, transparent) !important;
  color: var(--accent) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent) !important;
}
html[data-theme="light"] .client-tag-good {
  background: rgba(16,185,129,0.10) !important;
  color: #065F46 !important;
  box-shadow: inset 0 0 0 1px rgba(16,185,129,0.30) !important;
}
html[data-theme="light"] .client-tag-bad {
  background: rgba(251,113,133,0.10) !important;
  color: #BE123C !important;
  box-shadow: inset 0 0 0 1px rgba(251,113,133,0.32) !important;
}
html[data-theme="light"] .dash-mood-chip {
  background: color-mix(in srgb, var(--accent) 14%, transparent) !important;
  color: var(--accent) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 32%, transparent) !important;
}
html[data-theme="light"] .dash-chip {
  background: rgba(255,255,255,0.92) !important;
  color: rgba(15,17,22,0.92) !important;
  box-shadow: inset 0 0 0 1px rgba(15,17,22,0.10) !important;
}

/* Status pill, log bubbles */
html[data-theme="light"] .super-status-pill {
  background: rgba(255,255,255,0.75) !important;
  color: rgba(15,17,22,0.78) !important;
  box-shadow: inset 0 0 0 1px rgba(15,17,22,0.08) !important;
}
html[data-theme="light"] .log {
  background: rgba(255,255,255,0.85) !important;
  box-shadow: inset 0 0 0 1px rgba(15,17,22,0.06) !important;
}

/* Generate button keeps gradient in light */
html[data-theme="light"] .btn-generate,
html[data-theme="light"] .cortex-launch,
html[data-theme="light"] .form-btn-primary {
  color: #fff !important;
}

/* Add buttons */
html[data-theme="light"] .settings-action {
  background: rgba(255,255,255,0.7) !important;
  color: rgba(15,17,22,0.78) !important;
  box-shadow: inset 0 0 0 1px rgba(15,17,22,0.12) !important;
}
/* +Nuevo proyecto/cliente — púrpura liquid-glass en light */
html[data-theme="light"] .add-client-btn {
  background: linear-gradient(135deg, rgba(124,58,237,0.16), rgba(167,139,250,0.10)) !important;
  color: #4C1D95 !important;
  box-shadow:
    0 6px 18px -8px rgba(124,58,237,0.35),
    inset 0 1px 0 rgba(255,255,255,0.6),
    inset 0 0 0 1px rgba(124,58,237,0.28) !important;
}
html[data-theme="light"] .add-client-btn:hover {
  background: linear-gradient(135deg, rgba(124,58,237,0.24), rgba(167,139,250,0.16)) !important;
  color: #3B1A78 !important;
  box-shadow:
    0 10px 26px -8px rgba(124,58,237,0.45),
    inset 0 1px 0 rgba(255,255,255,0.7),
    inset 0 0 0 1px rgba(124,58,237,0.4) !important;
}

/* Claude bridge */
html[data-theme="light"] .claude-bridge {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, #fff) 0%, #fff 100%) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent) !important;
}

/* Settings status badge */
html[data-theme="light"] .settings-status-ok {
  background: rgba(16,185,129,0.12) !important;
  color: #047857 !important;
  box-shadow: inset 0 0 0 1px rgba(16,185,129,0.32) !important;
}

/* Node handles visible on light */
html[data-theme="light"] .nh {
  background: #fff !important;
  border-color: var(--accent) !important;
  box-shadow: 0 2px 6px -1px rgba(15,17,22,0.18) !important;
}

/* Cortex title gradient text — keep accent visible */
html[data-theme="light"] .cortex-title-soft { color: rgba(15,17,22,0.75) !important; }

/* Picker row in light */
html[data-theme="light"] .picker-row-title { color: rgba(15,17,22,0.96) !important; }
html[data-theme="light"] .picker-row-sub   { color: rgba(15,17,22,0.55) !important; }

/* Vault main head input */
html[data-theme="light"] .vault-name-input::placeholder { color: rgba(15,17,22,0.40) !important; }
html[data-theme="light"] .vault-main-stat,
html[data-theme="light"] .mb-stat,
html[data-theme="light"] .mb-name { color: rgba(15,17,22,0.78) !important; }

/* Scenarios chips */
html[data-theme="light"] .scenario-chip {
  background: rgba(255,255,255,0.85) !important;
  color: rgba(15,17,22,0.85) !important;
  box-shadow: inset 0 0 0 1px rgba(15,17,22,0.10) !important;
}
html[data-theme="light"] .scenario-chip:hover {
  background: color-mix(in srgb, var(--accent) 12%, #fff) !important;
  color: var(--accent) !important;
}

/* Form steps */
html[data-theme="light"] .form-step.is-active {
  background: color-mix(in srgb, var(--accent) 14%, #fff) !important;
  color: var(--accent) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 42%, transparent) !important;
}

/* Edge lines more visible on light */
html[data-theme="light"] .edge-base {
  stroke: color-mix(in srgb, var(--accent) 50%, transparent) !important;
}

/* Cortex slot text */
html[data-theme="light"] .cortex-slot-value,
html[data-theme="light"] .brief-slot-value { color: rgba(15,17,22,0.96) !important; }


/* ===========================================================================
   LIGHT MODE — additional fixes for URL/ref slots, dropdowns, generate btn
   =========================================================================== */
/* URL row inside video node */
html[data-theme="light"] .url-row .node-input { background: transparent !important; box-shadow: none !important; }
html[data-theme="light"] .btn-add.accent-green {
  background: var(--accent) !important;
  color: #fff !important;
  border-left: 1px solid color-mix(in srgb, var(--accent) 60%, #fff) !important;
}

/* Reference slot dashed */
html[data-theme="light"] .ref-slot {
  background: rgba(255,255,255,0.7) !important;
  border-color: rgba(15,17,22,0.18) !important;
}

/* Native select inside model pill / select-box */
html[data-theme="light"] .native-select { color: rgba(15,17,22,0.96) !important; }
html[data-theme="light"] .native-select option { background: #fff !important; color: rgba(15,17,22,0.96) !important; }

/* Model pill dropdown menu */
html[data-theme="light"] .model-pill-menu {
  background: #fff !important;
  box-shadow:
    0 20px 50px -10px rgba(15,17,22,0.24),
    inset 0 0 0 1px rgba(15,17,22,0.08) !important;
}
html[data-theme="light"] .model-pill-opt { color: rgba(15,17,22,0.92) !important; }
html[data-theme="light"] .model-pill-opt:hover { background: rgba(15,17,22,0.05) !important; }
html[data-theme="light"] .model-pill-opt.is-active {
  background: color-mix(in srgb, var(--accent) 10%, #fff) !important;
  color: var(--accent) !important;
}
html[data-theme="light"] .model-pill-hint { color: rgba(15,17,22,0.50) !important; }

/* Connect menu popup */
html[data-theme="light"] .connect-menu {
  background: #fff !important;
  box-shadow:
    0 22px 60px -16px rgba(15,17,22,0.30),
    inset 0 0 0 1px rgba(15,17,22,0.08) !important;
}
html[data-theme="light"] .connect-menu-title,
html[data-theme="light"] .connect-menu-label { color: rgba(15,17,22,0.96) !important; }
html[data-theme="light"] .connect-menu-kicker { color: rgba(15,17,22,0.50) !important; }
html[data-theme="light"] .connect-menu-hint { color: rgba(15,17,22,0.45) !important; }
html[data-theme="light"] .connect-menu-foot { color: rgba(15,17,22,0.40) !important; border-top-color: rgba(15,17,22,0.06) !important; }
html[data-theme="light"] .connect-menu-icon {
  background: rgba(15,17,22,0.05) !important;
  box-shadow: inset 0 0 0 1px rgba(15,17,22,0.10) !important;
}

/* Counter buttons */
html[data-theme="light"] .counter-btn { color: rgba(15,17,22,0.78) !important; }
html[data-theme="light"] .counter-btn:hover { background: rgba(15,17,22,0.06) !important; color: var(--accent) !important; }
html[data-theme="light"] .counter-val { color: rgba(15,17,22,0.96) !important; }

/* Toggle in light */
html[data-theme="light"] .toggle-track { background: rgba(15,17,22,0.15) !important; }
html[data-theme="light"] .toggle.is-on .toggle-track { background: var(--accent) !important; }
html[data-theme="light"] .toggle-knob { background: #fff !important; box-shadow: 0 2px 6px rgba(15,17,22,0.18) !important; }

/* Collapsible & sliders */
html[data-theme="light"] .collapsible { color: rgba(15,17,22,0.75) !important; }
html[data-theme="light"] .collapsible:hover { background: rgba(15,17,22,0.05) !important; color: rgba(15,17,22,0.96) !important; }

/* Style locked badge */
html[data-theme="light"] .style-locked-badge {
  background: rgba(16,185,129,0.08) !important;
  color: #047857 !important;
  box-shadow: inset 0 0 0 1px rgba(16,185,129,0.40) !important;
}

/* Prompt preview inside cinematographer node */
html[data-theme="light"] .prompt-preview {
  background: rgba(255,255,255,0.85) !important;
  box-shadow: inset 0 0 0 1px rgba(15,17,22,0.08) !important;
}
html[data-theme="light"] .prompt-preview-text { color: rgba(15,17,22,0.78) !important; }

/* Field labels */
html[data-theme="light"] .field-label,
html[data-theme="light"] .vault-side-kicker,
html[data-theme="light"] .drawer-kicker,
html[data-theme="light"] .form-popup-kicker,
html[data-theme="light"] .picker-kicker,
html[data-theme="light"] .cortex-kicker { color: rgba(15,17,22,0.60) !important; }

/* Counter chip */
html[data-theme="light"] .counter-chip {
  background: #fff !important;
  color: rgba(15,17,22,0.60) !important;
  box-shadow: inset 0 0 0 1px rgba(15,17,22,0.10) !important;
}

/* Vault scanner overlay text */
html[data-theme="light"] .scanner-label { color: var(--accent) !important; }

/* Gallery card hover */
html[data-theme="light"] .gallery-card { background: rgba(255,255,255,0.85) !important; }
html[data-theme="light"] .gallery-card:hover {
  background: #fff !important;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent),
    0 14px 30px -10px rgba(15,17,22,0.20) !important;
}
html[data-theme="light"] .gallery-meta-prompt { color: rgba(15,17,22,0.92) !important; }
html[data-theme="light"] .gallery-time { color: rgba(15,17,22,0.45) !important; }
html[data-theme="light"] .gallery-model { color: var(--accent) !important; background: color-mix(in srgb, var(--accent) 10%, #fff) !important; }

/* Lightbox in light */
html[data-theme="light"] .lightbox-close {
  background: rgba(255,255,255,0.85) !important;
  color: rgba(15,17,22,0.92) !important;
}
html[data-theme="light"] .lightbox-tags { color: rgba(255,255,255,0.85) !important; }
html[data-theme="light"] .lightbox-prompt { color: #fff !important; text-shadow: 0 2px 8px rgba(0,0,0,0.4); }

/* Edge delete button center */
html[data-theme="light"] .edge-delete-btn circle:nth-child(2) { fill: #fff !important; }

/* Output cell buttons in light */
html[data-theme="light"] .output-cell-btn {
  background: rgba(255,255,255,0.96) !important;
  color: rgba(15,17,22,0.92) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.95),
    inset 0 0 0 1px rgba(15,17,22,0.10),
    0 4px 10px -3px rgba(15,17,22,0.25) !important;
}
html[data-theme="light"] .output-cell-btn:hover { background: #fff !important; }
html[data-theme="light"] .output-cell-btn-danger:hover { background: rgba(251,113,133,0.16) !important; color: #BE123C !important; }


/* ===========================================================================
   Moodboard inspector — REDESIGN (no rotating orb, all info visible, lock prettier)
   =========================================================================== */
.dash-hero-orb { animation: none !important; }
.dash-orb-inner { animation: none !important; }

.vault-inspector-dash {
  padding: 16px 16px 24px;
  gap: 12px;
}

.dash-hero {
  padding: 12px 14px;
  gap: 12px;
}
.dash-hero-orb {
  width: 64px; height: 64px;
  padding: 5px;
}
.dash-orb-inner {
  width: 54px; height: 54px;
}
.dash-orb-score { font-size: 19px; }
.dash-hero-title { font-size: 15px; }

/* Lock — premium redesign */
.lock-switch {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  border-radius: 11px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.50);
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
  cursor: pointer;
  transition: all .2s cubic-bezier(0.32, 0.72, 0, 1);
}
.lock-switch:hover {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.85);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
.lock-switch.is-locked {
  background: linear-gradient(135deg, rgba(52,211,153,0.30), rgba(16,185,129,0.16));
  color: #6EE7B7;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.20),
    inset 0 0 0 1px rgba(52,211,153,0.55),
    0 0 18px rgba(52,211,153,0.30);
}
.lock-track {
  position: relative;
  width: 24px; height: 14px;
  border-radius: 99px;
  background: rgba(255,255,255,0.12);
  transition: background .2s;
}
.lock-switch.is-locked .lock-track { background: rgba(52,211,153,0.50); }
.lock-knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  transition: all .25s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.lock-switch.is-locked .lock-knob { left: 12px; background: #fff; }

html[data-theme="light"] .lock-switch {
  background: rgba(255,255,255,0.80);
  color: rgba(15,17,22,0.55);
  box-shadow: inset 0 0 0 1px rgba(15,17,22,0.10);
}
html[data-theme="light"] .lock-switch:hover {
  background: #fff;
  color: rgba(15,17,22,0.96);
}
html[data-theme="light"] .lock-switch.is-locked {
  background: linear-gradient(135deg, #34D399, #10B981);
  color: #fff;
  box-shadow: 0 4px 14px -3px rgba(16,185,129,0.5);
}

/* Cortex/Supercomputer — center title, lift swarm */
.cortex-stage { padding-top: 0 !important; }
.cortex-inner {
  padding: 30px 32px 28px !important;
  grid-template-rows: auto auto 1fr !important;
}
.cortex-head { padding-top: 0 !important; padding-bottom: 4px; }
.cortex-title {
  font-family: "Instrument Serif", "PT Serif", Georgia, serif !important;
  font-style: italic;
  font-size: clamp(54px, 9vw, 100px) !important;
  font-weight: 400 !important;
  letter-spacing: -0.025em !important;
}
.cortex-title-soft {
  font-family: -apple-system, "SF Pro Display", "Geist", sans-serif !important;
  font-style: normal;
  font-weight: 200 !important;
  letter-spacing: -0.04em;
}
.cortex-title-em {
  font-family: "Instrument Serif", serif !important;
}
.cortex-swarm { min-height: 200px !important; margin-top: -8px !important; }
.cortex-swarm-inner { aspect-ratio: 520 / 320 !important; }


/* ===========================================================================
   Manifest popup — view complete
   =========================================================================== */
.mfp-popup {
  width: 720px !important;
  max-width: 94vw !important;
  max-height: 90vh !important;
  background: var(--glass-bg-strong);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.mfp-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line-2);
  gap: 16px;
}
.mfp-head-left {
  display: flex; align-items: center; gap: 14px;
  min-width: 0;
}
.mfp-head-orb {
  width: 56px; height: 56px;
  border-radius: 50%;
  padding: 4px;
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: 0 8px 22px -6px rgba(0,0,0,0.4);
}
.mfp-head-orb-inner {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.30),
    inset 0 0 0 2px rgba(255,255,255,0.08);
}
.mfp-head-score {
  font-size: 17px;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.mfp-head-stats {
  margin-top: 5px;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.mfp-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 22px;
  display: flex; flex-direction: column;
  gap: 12px;
}
.mfp-grid {
  display: grid;
  gap: 10px;
}
.mfp-grid-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .mfp-grid-2 { grid-template-columns: 1fr; } }

.mfp-block {
  padding: 14px 16px;
  background: var(--surf-card);
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px var(--surf-line);
  display: flex; flex-direction: column; gap: 10px;
}
.mfp-label {
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
}
.mfp-label-row {
  display: flex; justify-content: space-between; align-items: center;
}
.mfp-label-neg { color: #FCA5A5 !important; }
.mfp-block-hint {
  font-size: 10px;
  color: var(--text-4);
  letter-spacing: 0.05em;
}
.mfp-big-val {
  display: flex; align-items: baseline; gap: 4px;
}
.mfp-big-num {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-1);
  line-height: 1;
}
.mfp-big-suffix {
  font-size: 14px;
  color: var(--text-3);
  font-family: "JetBrains Mono", monospace;
}
.mfp-mood-grid {
  display: flex; flex-wrap: wrap;
  gap: 5px;
}

.mfp-palette {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 6px;
}
.mfp-swatch {
  position: relative;
  aspect-ratio: 1 / 1.1;
  border-radius: 10px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    inset 0 0 0 1px rgba(255,255,255,0.06),
    0 4px 10px -3px rgba(0,0,0,0.35);
  display: flex; align-items: flex-end;
  padding: 8px;
  cursor: pointer;
  transition: transform .2s cubic-bezier(0.32, 0.72, 0, 1);
}
.mfp-swatch:hover { transform: translateY(-3px) scale(1.04); z-index: 2; }
.mfp-swatch-info {
  width: 100%;
  padding: 5px 7px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  border-radius: 6px;
}
.mfp-swatch-role {
  font-size: 8.5px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
}
.mfp-swatch-hex {
  margin-top: 1px;
  font-size: 10.5px;
  color: #fff;
  letter-spacing: 0.02em;
  font-weight: 600;
}

.mfp-attr-head { display: flex; align-items: center; gap: 9px; }
.mfp-attr-icon {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  font-size: 14px;
}
.mfp-attr-text {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-1);
  letter-spacing: -0.005em;
}

.mfp-prompt {
  padding: 12px 13px;
  background: var(--bg-soft, rgba(0,0,0,0.20));
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px var(--surf-line);
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-2);
  letter-spacing: -0.002em;
}
html[data-theme="light"] .mfp-prompt { background: rgba(15,17,22,0.04); }
.mfp-prompt-neg { color: var(--text-3); }

.mfp-open-btn {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 4px;
  border: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, transparent), color-mix(in srgb, var(--accent) 6%, transparent));
  color: var(--accent-2);
  border-radius: 14px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: all .2s cubic-bezier(0.32, 0.72, 0, 1);
}
.mfp-open-btn:hover {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 28%, transparent), color-mix(in srgb, var(--accent) 12%, transparent));
  color: var(--text-1);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent),
    0 8px 22px -6px color-mix(in srgb, var(--accent) 30%, transparent);
  transform: translateY(-1px);
}

/* ===========================================================================
   Supercomputer mode — hide ALL canvas residual UI completely
   =========================================================================== */
html[data-supermode="on"] .canvas-help,
html[data-supermode="on"] .canvas-viewport,
html[data-supermode="on"] .canvas-world,
html[data-supermode="on"] .canvas-vignette,
html[data-supermode="on"] .minimap-wrap,
html[data-supermode="on"] .leftrail,
html[data-supermode="on"] .left-drawer,
html[data-supermode="on"] .super-panel,
html[data-supermode="on"] .form-popup-backdrop,
html[data-supermode="on"] .lightbox,
html[data-supermode="on"] .picker-backdrop,
html[data-supermode="on"] .connect-menu,
html[data-supermode="on"] .edges-svg,
html[data-supermode="on"] .node-wrap,
html[data-supermode="on"] .hud,
html[data-supermode="on"] .gallery-panel,
html[data-supermode="on"] .vault-sheet { display: none !important; pointer-events: none !important; }

/* ===========================================================================
   Cortex — light mode + better hover interactions
   =========================================================================== */
.cortex-swarm-inner {
  position: relative;
  transition: filter .4s cubic-bezier(0.32, 0.72, 0, 1);
}
.cortex-swarm:hover .cortex-svg circle,
.cortex-swarm:hover .cortex-svg path {
  filter: brightness(1.25);
}
.cortex-swarm:hover .cortex-svg {
  animation: cortex-svg-react .8s cubic-bezier(0.32, 0.72, 0, 1) both;
}
@keyframes cortex-svg-react {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.04); }
  100% { transform: scale(1.02); }
}
/* Cursor interactivity follow */
.cortex-swarm { cursor: crosshair; }

/* Light mode cortex enhancements */
html[data-theme="light"] .cortex-stage {
  background:
    radial-gradient(60% 100% at 50% 0%, #F4F1FA 0%, #FAFAF7 60%, #ECEAE5 100%) !important;
}
html[data-theme="light"] .cortex-bg {
  background:
    radial-gradient(45vmax 35vmax at 20% 12%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 60%),
    radial-gradient(40vmax 32vmax at 80% 88%, color-mix(in srgb, #FB7185 18%, transparent), transparent 65%),
    radial-gradient(30vmax 25vmax at 50% 50%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%);
  opacity: 0.85;
}
html[data-theme="light"] .cortex-title { color: rgba(15,17,22,0.98); }
html[data-theme="light"] .cortex-title-soft { color: rgba(15,17,22,0.55) !important; }
html[data-theme="light"] .cortex-tagline { color: rgba(15,17,22,0.62); }

/* Make orbits visible in light */
html[data-theme="light"] .cortex-svg .cortex-orb-label { color: rgba(15,17,22,0.55); }
html[data-theme="light"] .cortex-svg circle[fill="#FFFFFF"] { fill: rgba(15,17,22,0.92) !important; }

/* Cortex orbital paths get stronger in light */
html[data-theme="light"] .cortex-swarm-inner svg ellipse {
  stroke: rgba(15,17,22,0.12) !important;
}
html[data-theme="light"] .cortex-orb-label::before { background: #10B981; box-shadow: 0 0 10px #10B981; }

/* Cortex slot dark text in light */
html[data-theme="light"] .cortex-slot { background: rgba(255,255,255,0.85) !important; }
html[data-theme="light"] .cortex-slot:hover { background: #fff !important; }
html[data-theme="light"] .cortex-slot-value { color: rgba(15,17,22,0.96) !important; }
html[data-theme="light"] .cortex-slot-label,
html[data-theme="light"] .cortex-slot-hint { color: rgba(15,17,22,0.55) !important; }

/* Cortex prompt in light */
html[data-theme="light"] .cortex-prompt { background: rgba(255,255,255,0.92) !important; }
html[data-theme="light"] .cortex-prompt textarea { color: rgba(15,17,22,0.96) !important; }
html[data-theme="light"] .cortex-prompt textarea::placeholder { color: rgba(15,17,22,0.40) !important; }

/* Mouse-follow glow on swarm */
.cortex-swarm-inner::after {
  content: "";
  position: absolute;
  width: 200px; height: 200px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 35%, transparent), transparent 70%);
  left: var(--mx, 50%);
  top: var(--my, 50%);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity .35s cubic-bezier(0.32, 0.72, 0, 1);
  mix-blend-mode: screen;
}
.cortex-swarm:hover .cortex-swarm-inner::after { opacity: 1; }
html[data-theme="light"] .cortex-swarm-inner::after { mix-blend-mode: multiply; }


/* ===========================================================================
   TYPOGRAPHY UPGRADE — Hanken Grotesk body + Cormorant accents
   =========================================================================== */
html, body {
  font-family:
    "Hanken Grotesk", -apple-system, BlinkMacSystemFont,
    "SF Pro Display", "SF Pro Text",
    system-ui, "Segoe UI", "Helvetica Neue",
    sans-serif !important;
  font-feature-settings: "ss01", "ss02";
  letter-spacing: -0.01em;
}
.cortex-title,
.cortex-title-em,
.cortex-title-soft,
.swoon,
.login-h1 .swoon,
.dash-hero-title-serif {
  font-family: "Cormorant Garamond", "Instrument Serif", "PT Serif", Georgia, serif !important;
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.022em;
}
.dash-hero-title,
.form-popup-title,
.picker-title,
.super-stage-title,
.cortex-card-title,
.login-card-title,
.client-hero-name,
.form-hero-name,
.brand-name,
.login-brand-name {
  font-family: "Hanken Grotesk", "SF Pro Display", system-ui, sans-serif !important;
  font-weight: 600;
}

/* H1 cortex — fix cut-off + better wrap */
.cortex-title {
  font-size: clamp(50px, 8.5vw, 96px) !important;
  font-style: italic;
  line-height: 1.05 !important;
  padding-bottom: 0.1em;
  text-wrap: balance;
  display: block;
  text-align: center;
}
.cortex-title-soft {
  font-family: "Hanken Grotesk", system-ui, sans-serif !important;
  font-style: normal !important;
  font-weight: 200 !important;
}
.cortex-head { padding-bottom: 12px; }
.cortex-inner { max-width: 1180px !important; padding: 28px 32px 32px !important; }

/* ===========================================================================
   Moodboard — Manifest cleaner (only score visible, rest in popup)
   =========================================================================== */
/* Hide the long sections — show ONLY score + mood + button */
.vault-inspector-dash > .dash-block:not(.dash-block-keep),
.vault-inspector-dash > .dash-kpis {
  display: none !important;
}
.dash-hero-meta .dash-hero-mood { display: none; }
.vault-inspector-dash { gap: 14px; }

/* Big score card */
.dash-score-card {
  background: var(--surf-card);
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px var(--surf-line);
  padding: 24px 22px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.dash-score-ring {
  position: relative;
  width: 140px; height: 140px;
  display: grid; place-items: center;
}
.dash-score-ring svg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}
.dash-score-ring-bg { stroke: var(--surf-line); stroke-width: 8; fill: none; }
.dash-score-ring-fill {
  stroke: url(#dash-score-grad);
  stroke-width: 8; fill: none;
  stroke-linecap: round;
  filter: drop-shadow(0 0 12px color-mix(in srgb, var(--accent) 50%, transparent));
}
.dash-score-text {
  position: relative; z-index: 2;
  text-align: center;
}
.dash-score-num {
  font-family: "Cormorant Garamond", serif;
  font-size: 52px;
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text-1);
}
.dash-score-label {
  margin-top: 4px;
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3);
  font-family: "Hanken Grotesk", sans-serif;
}
.dash-score-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: -0.005em;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}
.dash-score-explain {
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.5;
  max-width: 260px;
}

/* ===========================================================================
   Cortex — magnetic cursor interaction (agents attracted to cursor)
   =========================================================================== */
.cortex-swarm-inner::after { display: none !important; }
.cortex-swarm { cursor: default; }
.cortex-swarm-inner svg circle { transition: transform .6s cubic-bezier(0.32, 0.72, 0, 1), filter .3s; }
.cortex-swarm:hover .cortex-svg circle:not([fill="#FFFFFF"]) { filter: brightness(1.15); }
.cortex-swarm-inner svg ellipse { transition: stroke .3s; }
.cortex-swarm:hover .cortex-svg ellipse { stroke: color-mix(in srgb, var(--accent) 45%, transparent) !important; }


/* ===========================================================================
   Cortex swarm — bolder interactive presence
   =========================================================================== */
.cortex-swarm-inner svg circle {
  transition: transform .35s cubic-bezier(0.18, 0.9, 0.30, 1.1), filter .25s;
}
.cortex-swarm:hover .cortex-svg ellipse {
  stroke: color-mix(in srgb, var(--accent) 55%, transparent) !important;
  stroke-width: 1.3 !important;
}
.cortex-swarm:hover .cortex-svg ellipse[ry] {
  animation: ring-spin 30s linear infinite;
}
@keyframes ring-spin { to { transform: rotate(360deg); } }
.cortex-swarm:hover .cortex-svg circle[fill="#FFFFFF"],
.cortex-swarm:hover .cortex-svg circle[fill="rgba\(15\,17\,22\,0\.92\)"] {
  r: 9;
}
.cortex-swarm-inner {
  position: relative;
}
.cortex-ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  border: 2px solid color-mix(in srgb, var(--accent) 65%, transparent);
  animation: cortex-ripple-out 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  transform: translate(-50%, -50%);
  z-index: 4;
}
@keyframes cortex-ripple-out {
  0%   { width: 0; height: 0; opacity: 1; border-width: 2px; }
  100% { width: 220px; height: 220px; opacity: 0; border-width: 0.5px; }
}

/* Cursor — disabled */
.cortex-cursor-glow { display: none !important; }


/* ===========================================================================
   Group node (subproyecto)
   =========================================================================== */
.group-node {
  background: rgba(167,139,250,0.04) !important;
  box-shadow:
    inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 35%, transparent),
    0 0 0 transparent !important;
  border-radius: 18px !important;
  pointer-events: auto;
}
.group-node.is-selected {
  background: rgba(167,139,250,0.08) !important;
  box-shadow:
    inset 0 0 0 2px var(--accent),
    0 0 32px color-mix(in srgb, var(--accent) 28%, transparent) !important;
}
.group-node-header {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 13px;
  border-bottom: 1px dashed color-mix(in srgb, var(--accent) 25%, transparent);
  cursor: grab;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 18px 18px 0 0;
}
.group-node-icon {
  color: var(--accent-2);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.04em;
}
.group-node-name {
  flex: 1;
  background: transparent;
  border: 0; outline: 0;
  color: var(--text-1);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.group-node-name::placeholder { color: var(--text-4); }

html[data-theme="light"] .group-node {
  background: rgba(167,139,250,0.06) !important;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 35%, transparent) !important;
}
html[data-theme="light"] .group-node.is-selected { background: rgba(167,139,250,0.12) !important; }

/* ===========================================================================
   Multiselect bar
   =========================================================================== */
.multiselect-bar {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: flex; align-items: center; gap: 4px;
  padding: 6px 8px;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 14px;
  box-shadow:
    0 22px 50px -16px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.10),
    inset 0 0 0 1px rgba(255,255,255,0.06);
  animation: ms-bar-in .35s cubic-bezier(0.32, 0.72, 0, 1) both;
}
@keyframes ms-bar-in {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
html[data-theme="light"] .multiselect-bar {
  background: rgba(255,255,255,0.94) !important;
  box-shadow: 0 22px 50px -16px rgba(15,17,22,0.20), inset 0 0 0 1px rgba(15,17,22,0.08) !important;
}
.multiselect-count {
  padding: 6px 12px;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  border-right: 1px solid var(--surf-line);
  margin-right: 4px;
}
.multiselect-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0;
  background: rgba(255,255,255,0.05);
  color: var(--text-1);
  border-radius: 9px;
  padding: 7px 13px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  transition: all .15s cubic-bezier(0.32, 0.72, 0, 1);
}
.multiselect-btn:hover { background: rgba(255,255,255,0.08); }
.multiselect-btn-primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--accent-2)));
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 4px 12px -3px color-mix(in srgb, var(--accent) 50%, transparent);
}
.multiselect-btn-primary:hover {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.30),
    0 8px 18px -3px color-mix(in srgb, var(--accent) 70%, transparent);
}
.multiselect-btn-danger {
  background: rgba(251,113,133,0.12);
  color: #FB7185;
  box-shadow: inset 0 0 0 1px rgba(251,113,133,0.30);
}
.multiselect-btn-danger:hover { background: rgba(251,113,133,0.22); color: #FECDD3; }
html[data-theme="light"] .multiselect-btn { background: rgba(15,17,22,0.05); color: rgba(15,17,22,0.92); }
html[data-theme="light"] .multiselect-btn:hover { background: rgba(15,17,22,0.10); }
html[data-theme="light"] .multiselect-btn-primary { color: #fff; }
html[data-theme="light"] .multiselect-btn-danger { background: rgba(251,113,133,0.10); color: #BE123C; }


/* ===========================================================================
   Image node — editable seed + slider; ref-slot row for video
   =========================================================================== */
.seed-row { display: flex; gap: 6px; }
.seed-input { flex: 1; font-size: 12px !important; }
.seed-dice {
  display: grid; place-items: center;
  width: 38px;
  border: 0;
  background: var(--surf-card);
  color: var(--text-2);
  border-radius: 9px;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--surf-line);
  transition: all .15s;
}
.seed-dice:hover { color: var(--accent); background: var(--surf-card-hi); }

.image-slider {
  width: 100%; height: 4px;
  -webkit-appearance: none;
  background: linear-gradient(to right, var(--accent), color-mix(in srgb, var(--accent) 30%, transparent));
  border-radius: 99px;
  outline: 0;
  box-shadow: inset 0 0 0 1px var(--surf-line);
}
.image-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 60%, transparent);
  cursor: pointer;
}

.ref-slot-row {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.ref-slot-remove {
  position: absolute;
  top: 4px; right: 4px;
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border: 0;
  background: rgba(0,0,0,0.65);
  color: #fff;
  border-radius: 5px;
  cursor: pointer;
  font-size: 10px;
}

/* ===========================================================================
   Moodboard new — color presets
   =========================================================================== */
.moodboard-color-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.mb-color-swatch {
  border: 0;
  aspect-ratio: 1;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.20), inset 0 0 0 1px rgba(0,0,0,0.10);
  transition: all .15s;
}
.mb-color-swatch:hover { transform: scale(1.06); }
.mb-color-swatch.is-on {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    inset 0 0 0 2.5px var(--text-1),
    0 6px 16px -4px rgba(0,0,0,0.35);
}
.mb-color-custom {
  position: relative;
  border-radius: 10px;
  aspect-ratio: 1;
  display: grid; place-items: center;
  cursor: pointer;
  overflow: hidden;
  font-size: 9px; letter-spacing: 0.10em; text-transform: uppercase;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.20), inset 0 0 0 1px rgba(0,0,0,0.10);
}
.mb-color-custom input[type="color"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
}

/* ===========================================================================
   Client dashboard
   =========================================================================== */
.client-dash { display: flex; flex-direction: column; gap: 10px; }
.client-dash-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
}
.client-dash-card {
  padding: 12px 12px;
  background: var(--surf-card);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--surf-line);
  text-align: center;
}
.client-dash-kpi-label {
  font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-3);
}
.client-dash-kpi-val {
  margin-top: 4px;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.04em;
  color: var(--text-1);
  line-height: 1;
}


/* ===========================================================================
   Moodboard card — "Ver fotos" button
   =========================================================================== */
.moodboard-card { position: relative; }
.mb-card-open {
  position: absolute;
  top: 9px; right: 9px;
  z-index: 3;
  padding: 4px 9px;
  border: 0;
  background: rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.95);
  border-radius: 7px;
  font-family: "JetBrains Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  font-weight: 500;
  cursor: pointer;
  opacity: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity .15s, background .15s;
}
.moodboard-card:hover .mb-card-open { opacity: 1; }
.mb-card-open:hover { background: rgba(0,0,0,0.85); }

/* Gallery popup grid */
.mb-gallery-popup {
  width: 920px !important;
  max-width: 94vw !important;
  max-height: 88vh !important;
  display: flex; flex-direction: column;
}
.mb-gallery-grid {
  padding: 18px 22px 22px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  overflow-y: auto;
  flex: 1;
}
.mb-gallery-thumb {
  position: relative;
  border: 0;
  padding: 0;
  border-radius: 11px;
  overflow: hidden;
  aspect-ratio: 1;
  cursor: pointer;
  background: var(--surf-card);
  box-shadow: inset 0 0 0 1px var(--surf-line);
  transition: all .2s cubic-bezier(0.32, 0.72, 0, 1);
}
.mb-gallery-thumb:hover {
  transform: scale(1.03);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent),
    0 14px 28px -8px rgba(0,0,0,0.45);
  z-index: 2;
}
.mb-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mb-gallery-empty {
  grid-column: 1 / -1;
  display: grid; place-items: center;
  padding: 60px 20px;
  text-align: center;
}

/* Preview lightbox in vault */
.mb-preview {
  position: relative;
  max-width: 90vw; max-height: 90vh;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.7);
  background: var(--bg);
  animation: lightbox-pop .3s cubic-bezier(0.32, 0.72, 0, 1) both;
}
.mb-preview img {
  display: block;
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}
.mb-preview-close {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 2;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: rgba(0,0,0,0.65) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 10px;
  cursor: pointer;
  backdrop-filter: blur(10px);
}


/* User avatar in topbar */
.user-avatar-btn {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border: 0;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--accent-2)));
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  font-family: "Hanken Grotesk", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.30),
    inset 0 0 0 1px rgba(255,255,255,0.14),
    0 4px 12px -3px color-mix(in srgb, var(--accent) 50%, transparent);
  transition: all .25s cubic-bezier(0.32, 0.72, 0, 1);
}
.user-avatar-btn:hover {
  transform: scale(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.40),
    inset 0 0 0 1px rgba(255,255,255,0.22),
    0 8px 20px -4px color-mix(in srgb, var(--accent) 65%, transparent);
}

/* Settings: data button matches accent (primary style) */
.settings-action-primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 75%, var(--bg))) !important;
  color: #fff !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 4px 12px -3px color-mix(in srgb, var(--accent) 50%, transparent) !important;
}
.settings-action-primary:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.32),
    0 8px 20px -4px color-mix(in srgb, var(--accent) 65%, transparent) !important;
}


/* User avatar uses gradient based on color id */
.user-avatar-btn { letter-spacing: 0.02em; }
html[data-accent="violet"] .user-avatar-btn { background: linear-gradient(135deg, #A78BFA, #818CF8) !important; }


/* Profile photo slot */
.profile-photo-slot {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: transform .2s cubic-bezier(0.32, 0.72, 0, 1);
}
.profile-photo-slot:hover { transform: scale(1.04); }
.profile-photo-edit {
  position: absolute;
  inset: auto 0 0 0;
  padding: 4px 0;
  background: rgba(0,0,0,0.60);
  color: rgba(255,255,255,0.95);
  font-family: "JetBrains Mono", monospace;
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  opacity: 0;
  transition: opacity .2s;
  backdrop-filter: blur(8px);
}
.profile-photo-slot:hover .profile-photo-edit { opacity: 1; }

/* ===========================================================================
   Client Detail Modal
   =========================================================================== */
.client-modal {
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modal-in .22s cubic-bezier(.16,1,.3,1);
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1)  translateY(0); }
}

/* Hero header */
.client-modal-head {
  position: relative;
  flex-shrink: 0;
}
.client-modal-hero {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 28px 24px 20px;
  min-height: 120px;
}
.client-modal-initials {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255,255,255,.18);
  border: 1.5px solid rgba(255,255,255,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.5px;
  flex-shrink: 0;
}
.client-modal-name {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  text-shadow: 0 1px 8px rgba(0,0,0,.3);
}
.client-modal-tagline {
  font-size: 11px;
  color: rgba(255,255,255,.75);
  margin-top: 3px;
}
.client-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,.25);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.9);
  transition: background .15s;
}
.client-modal-close:hover { background: rgba(0,0,0,.45); }

/* KPI bar */
.client-modal-kpis {
  display: flex;
  border-bottom: 1px solid var(--border-1, rgba(255,255,255,.06));
  background: var(--surface-2, rgba(255,255,255,.03));
}
.client-modal-kpi {
  flex: 1;
  text-align: center;
  padding: 14px 8px;
  border-right: 1px solid var(--border-1, rgba(255,255,255,.06));
}
.client-modal-kpi:last-child { border-right: none; }
.client-modal-kpi-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-1, #e8e6e1);
  line-height: 1;
}
.client-modal-kpi-label {
  font-size: 9.5px;
  color: var(--text-3, rgba(235,234,228,.38));
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* Body sections */
.client-modal-body {
  padding: 8px 24px 24px;
  overflow-y: auto;
  flex: 1;
}
.client-modal-section {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-1, rgba(255,255,255,.06));
}
.client-modal-section:last-child { border-bottom: none; }

/* Light mode */
html[data-theme="light"] .client-modal-kpis,
html[data-theme="light"] .client-modal-section {
  border-color: rgba(0,0,0,.07);
}
html[data-theme="light"] .client-modal-kpi-val { color: #1a1a2e; }
html[data-theme="light"] .client-modal-kpi-label { color: rgba(0,0,0,.4); }


/* ── ManifestEditPopup edit fields ─────────────────────────────────── */
.mfp-edit-popup { padding-bottom: 0 !important; }

.mfp-edit-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.mfp-edit-textarea,
.mfp-edit-input {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  color: var(--text-1, #e8eaf0);
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
  resize: vertical;
  transition: border-color .15s, background .15s;
  width: 100%;
  box-sizing: border-box;
}
.mfp-edit-textarea:focus,
.mfp-edit-input:focus {
  background: rgba(255,255,255,.07);
  border-color: var(--accent, #8F7EE9);
  outline: none;
}
.mfp-edit-input { resize: none; }

.mfp-edit-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px 20px;
  border-top: 1px solid rgba(255,255,255,.07);
  position: sticky;
  bottom: 0;
  background: var(--bg-modal, #1E2839);
  border-radius: 0 0 18px 18px;
}

/* Light mode overrides */
html[data-theme="light"] .mfp-edit-textarea,
html[data-theme="light"] .mfp-edit-input {
  background: rgba(0,0,0,.03);
  border-color: rgba(0,0,0,.12);
  color: #1a1a2e;
}
html[data-theme="light"] .mfp-edit-textarea:focus,
html[data-theme="light"] .mfp-edit-input:focus {
  background: #fff;
  border-color: #8F7EE9;
}
html[data-theme="light"] .mfp-edit-actions {
  background: #fff;
  border-color: rgba(0,0,0,.08);
}

/* ── ProjectsPanel inline new-project form ─────────────────────────── */
.proj-new-form {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  animation: fadeIn .15s ease;
}
.proj-new-form input {
  flex: 1;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  color: var(--text-1, #e8eaf0);
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  transition: border-color .15s;
}
.proj-new-form input:focus { border-color: var(--accent, #8F7EE9); }
html[data-theme="light"] .proj-new-form input {
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.12);
  color: #1a1a2e;
}
html[data-theme="light"] .proj-new-form input:focus { border-color: #8F7EE9; }


/* ── Topbar: ctx-center (contexto activo integrado) ──────────────────── */
.ctx-center {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: center;
  padding: 0 12px;
  min-width: 0;
}

.ctx-center-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.22);
  white-space: nowrap;
  margin-right: 4px;
}

/* Pills */
.ctx-pill {
  position: relative;
  flex-shrink: 0;
}

.ctx-pill-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px 5px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.4);
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
  line-height: 1;
}
.ctx-pill-btn:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.14);
  color: rgba(255,255,255,.7);
}
.ctx-pill-btn.has-value {
  background: rgba(143,126,233,.12);
  border-color: rgba(143,126,233,.28);
  color: rgba(255,255,255,.9);
}
.ctx-pill.is-open .ctx-pill-btn {
  background: rgba(143,126,233,.18);
  border-color: rgba(143,126,233,.4);
  color: #fff;
}

.ctx-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ctx-pill-dot-sq { border-radius: 2px; }

.ctx-pill-caret {
  width: 8px;
  height: 6px;
  color: currentColor;
  opacity: .5;
  flex-shrink: 0;
  transition: transform .15s;
}
.ctx-pill.is-open .ctx-pill-caret { transform: rotate(180deg); }

.ctx-status-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(52,211,153,0.08);
  border: 1px solid rgba(52,211,153,0.20);
  margin-left: 4px;
  flex-shrink: 0;
  transition: background 200ms ease, box-shadow 200ms ease;
}
.ctx-status-badge:hover {
  background: rgba(52,211,153,0.14);
  box-shadow: 0 0 10px rgba(52,211,153,0.20);
}
.ctx-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(52,211,153,0.9);
  box-shadow: 0 0 6px rgba(52,211,153,0.5);
  animation: ctx-pulse 2.4s ease-in-out infinite;
}
@keyframes ctx-pulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 6px rgba(52,211,153,0.5); }
  50% { opacity: 0.55; transform: scale(0.72); box-shadow: 0 0 3px rgba(52,211,153,0.25); }
}

/* Dropdown */
.ctx-drop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  background: #14162a;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  z-index: 300;
  box-shadow: 0 16px 48px rgba(0,0,0,.6), 0 0 0 1px rgba(143,126,233,.08);
  overflow: hidden;
  animation: ctx-drop-in .14s cubic-bezier(.16,1,.3,1);
}
@keyframes ctx-drop-in {
  from { opacity: 0; transform: translateY(-6px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

.ctx-drop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 8px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.ctx-drop-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
}
.ctx-drop-clear {
  font-size: 10.5px;
  color: rgba(255,100,100,.6);
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Manrope', sans-serif;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background .12s, color .12s;
}
.ctx-drop-clear:hover { background: rgba(255,80,80,.1); color: rgba(255,100,100,.9); }

.ctx-drop-list {
  padding: 6px;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.ctx-drop-empty {
  padding: 16px 14px;
  font-size: 12px;
  color: rgba(255,255,255,.25);
  font-style: italic;
  text-align: center;
}

.ctx-drop-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 9px;
  background: none;
  border: none;
  color: rgba(255,255,255,.7);
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background .12s;
}
.ctx-drop-row:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.9); }
.ctx-drop-row.is-active {
  background: rgba(143,126,233,.14);
  color: #d4cfff;
}
.ctx-drop-row.is-active:hover { background: rgba(143,126,233,.2); }

.ctx-drop-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.ctx-drop-info { flex: 1; min-width: 0; }
.ctx-drop-name {
  font-size: 13px;
  font-weight: 600;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ctx-drop-sub {
  font-size: 10.5px;
  color: rgba(255,255,255,.3);
  white-space: nowrap;
  margin-top: 1px;
}
.ctx-drop-row.is-active .ctx-drop-sub { color: rgba(196,186,255,.45); }

.ctx-drop-mb-pal {
  display: flex;
  height: 24px;
  width: 36px;
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.1);
}

/* Topbar flex: ctx-center toma el espacio central */
.topbar { display: flex !important; align-items: center; }
.topbar .brand { flex-shrink: 0; }
.topbar .mode-tabs { flex-shrink: 0; }
.topbar .ctx-center { flex: 1; }
.topbar .topbar-right { flex-shrink: 0; margin-left: 0; }

/* Oculta la antigua ctx-bar separada */
.ctx-bar { display: none !important; }

/* Light mode */
html[data-theme="light"] .ctx-pill-btn {
  color: rgba(0,0,0,.4);
  border-color: rgba(0,0,0,.1);
  background: rgba(0,0,0,.03);
}
html[data-theme="light"] .ctx-pill-btn:hover {
  background: rgba(0,0,0,.06);
  color: rgba(0,0,0,.7);
}
html[data-theme="light"] .ctx-pill-btn.has-value {
  background: rgba(143,126,233,.1);
  border-color: rgba(143,126,233,.3);
  color: #4a3fa0;
}
html[data-theme="light"] .ctx-center-label { color: rgba(0,0,0,.2); }
html[data-theme="light"] .ctx-drop {
  background: #fff;
  border-color: rgba(0,0,0,.1);
  box-shadow: 0 12px 40px rgba(0,0,0,.15);
}
html[data-theme="light"] .ctx-drop-header { border-color: rgba(0,0,0,.07); }
html[data-theme="light"] .ctx-drop-title { color: rgba(0,0,0,.3); }
html[data-theme="light"] .ctx-drop-row { color: rgba(0,0,0,.7); }
html[data-theme="light"] .ctx-drop-row:hover { background: rgba(0,0,0,.04); color: rgba(0,0,0,.9); }
html[data-theme="light"] .ctx-drop-row.is-active { background: rgba(143,126,233,.1); color: #4a3fa0; }
html[data-theme="light"] .ctx-drop-sub { color: rgba(0,0,0,.35); }
html[data-theme="light"] .ctx-status-badge {
  background: rgba(16,185,129,0.07);
  border-color: rgba(16,185,129,0.22);
}


/* ===========================================================================
   Moodboard Vault v3 — sidebar + galería + ADN popup
   =========================================================================== */

/* Shell v3 */
.vault-sheet-v3 {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.vault-sheet-v3 .vlt3-layout {
  display: grid;
  grid-template-columns: 216px 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Sidebar ── */
.vlt3-sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,0.07);
  overflow: hidden;
}
.vlt3-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.vlt3-sidebar-title {
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text-1);
}
.vlt3-sidebar-sub {
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-4);
  margin-top: 2px;
}
.vlt3-sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Moodboard list item */
.vlt-mb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 11px;
  cursor: pointer;
  transition: background 140ms ease;
  outline: none;
}
.vlt-mb-item:hover { background: rgba(255,255,255,0.04); }
.vlt-mb-item.is-active {
  background: rgba(143,126,233,0.12);
  box-shadow: inset 0 0 0 1px rgba(143,126,233,0.22);
}
.vlt-mb-item.is-locked .vlt-mb-name { color: var(--success-2, #34d399); }
.vlt-mb-strip {
  display: flex;
  width: 26px; height: 42px;
  border-radius: 6px;
  overflow: hidden;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.07);
}
.vlt-mb-strip-seg { flex: 1; }
.vlt-mb-info { flex: 1; min-width: 0; }
.vlt-mb-name {
  font-size: 12px;
  font-weight: 580;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vlt-mb-meta {
  font-size: 9.5px;
  color: var(--text-4);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.05em;
}
.vlt-mb-score {
  background: rgba(143,126,233,0.14);
  color: var(--accent-3, #a78bfa);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 600;
}
.vlt-mb-locked-badge { color: var(--success-2, #34d399); font-size: 8.5px; letter-spacing: 0.12em; }
.vlt-mb-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.vlt-mb-dot.is-idle { background: var(--text-4); }
.vlt-mb-dot.is-ready { background: var(--success-2, #34d399); }
.vlt-mb-dot.is-auditing { background: var(--accent); animation: led-breath 1.4s ease-in-out infinite; box-shadow: 0 0 5px var(--accent); }

/* ── Toolbar principal ── */
.vlt3-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.vlt3-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  min-height: 54px;
}
.vlt3-toolbar-stat {
  font-size: 10.5px;
  color: var(--text-4);
  letter-spacing: 0.07em;
  white-space: nowrap;
}
.vlt3-auditing-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-3, #a78bfa);
  margin-left: 6px;
}
.vlt3-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

/* Botón ADN */
.vlt3-adn-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 20px;
  border: 1px solid rgba(143,126,233,0.35);
  background: rgba(143,126,233,0.10);
  color: var(--accent-3, #a78bfa);
  font-size: 12px;
  font-weight: 580;
  font-family: inherit;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
  letter-spacing: 0.01em;
}
.vlt3-adn-btn:hover {
  background: rgba(143,126,233,0.18);
  border-color: rgba(143,126,233,0.55);
  box-shadow: 0 0 14px rgba(143,126,233,0.20);
}
.vlt3-adn-btn-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  flex-shrink: 0;
}
.vlt3-adn-btn-score {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(143,126,233,0.15);
  border-radius: 5px;
  padding: 1px 6px;
  letter-spacing: 0.05em;
}

/* ── Galería ── */
.vlt-gallery {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  position: relative;
}
.vlt-gallery.is-drag-over {
  box-shadow: inset 0 0 0 2px var(--accent);
  border-radius: 10px;
}
.vlt-gallery-empty {
  height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; gap: 10px;
  color: var(--text-3);
}
.vlt-empty-icon { font-size: 30px; opacity: 0.35; margin-bottom: 4px; }
.vlt-empty-title { font-size: 14px; font-weight: 600; color: var(--text-2); }
.vlt-empty-sub { font-size: 12.5px; color: var(--text-4); max-width: 260px; }

/* Masonry */
.vlt-masonry { columns: 2; column-gap: 10px; }
.vlt-masonry-item {
  break-inside: avoid;
  margin-bottom: 10px;
  position: relative;
  border-radius: 9px;
  overflow: hidden;
  cursor: zoom-in;
}
.vlt-masonry-item img { width: 100%; display: block; border-radius: 9px; transition: opacity 120ms; }
.vlt-masonry-item:hover img { opacity: 0.86; }
.vlt-remove-btn {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.65);
  color: #fff; font-size: 11px;
  display: none; place-items: center;
  border: 0; cursor: pointer; line-height: 1;
}
.vlt-masonry-item:hover .vlt-remove-btn { display: grid; }

/* Sequential scan overlay per thumbnail — KAREN 2026-05-28
   Triggered by .vlt-masonry-item.is-scanning. Each item gets a vertical
   luminous bar that travels top→bottom; delay is set inline so items
   scan one after another in sequence. */
.vlt-masonry-item.is-scanning > img { filter: brightness(0.78) saturate(1.05); transition: filter 200ms ease; }
.vlt-scan-overlay {
  position: absolute; inset: 0;
  pointer-events: none;
  border-radius: 9px;
  overflow: hidden;
  z-index: 2;
  background: linear-gradient(180deg, rgba(167,139,250,0.04), rgba(167,139,250,0.10));
  box-shadow: inset 0 0 0 1px rgba(167,139,250,0.35);
}
.vlt-scan-line {
  position: absolute; left: -2%; right: -2%;
  top: 0; height: 38px;
  background: linear-gradient(180deg,
    rgba(167,139,250,0) 0%,
    rgba(167,139,250,0.45) 45%,
    #A78BFA 50%,
    rgba(167,139,250,0.45) 55%,
    rgba(167,139,250,0) 100%);
  box-shadow: 0 0 24px 6px rgba(167,139,250,0.55), 0 0 60px 10px rgba(167,139,250,0.25);
  mix-blend-mode: screen;
  opacity: 0;
  transform: translateY(-100%);
  animation-name: vlt-scan-line;
  animation-timing-function: cubic-bezier(0.4, 0.0, 0.2, 1);
  animation-fill-mode: both;
  will-change: transform, opacity;
}
.vlt-scan-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(167,139,250,0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167,139,250,0.10) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0;
  animation: vlt-scan-grid 1.5s ease-out both;
  animation-iteration-count: infinite;
}
.vlt-scan-idx {
  position: absolute; bottom: 6px; left: 6px;
  font: 600 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
  color: #A78BFA;
  background: rgba(12,12,12,0.72);
  border: 1px solid rgba(167,139,250,0.45);
  padding: 4px 6px;
  border-radius: 6px;
  text-shadow: 0 0 8px rgba(167,139,250,0.6);
}
@keyframes vlt-scan-line {
  0%   { transform: translateY(-100%); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(120%); opacity: 0; }
}
@keyframes vlt-scan-grid {
  0%   { opacity: 0; }
  20%  { opacity: 0.5; }
  80%  { opacity: 0.5; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .vlt-scan-line, .vlt-scan-grid { animation: none; opacity: 0.4; }
}


/* Drop overlay */
.vlt-drop-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  background: rgba(143,126,233,0.10);
  border: 2px dashed var(--accent);
  border-radius: 12px;
  z-index: 10;
  backdrop-filter: blur(4px);
}
.vlt-drop-icon { font-size: 30px; color: var(--accent); }
.vlt-drop-title { font-size: 15px; font-weight: 650; color: var(--text-1); }
.vlt-drop-sub { font-size: 12px; color: var(--text-3); }

/* Scanner bar — barra superior con gradiente Siri fluido */
.vlt-scanner-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    #FF2D55, #BF5AF2, #5E5CE6, #0A84FF, #64D2FF, #30D158, #FFD60A, #FF2D55);
  background-size: 300% 100%;
  animation: siri-bar-flow 3s linear infinite;
  z-index: 20;
  box-shadow: 0 0 12px rgba(94,92,230,0.6);
}
@keyframes siri-bar-flow { 0% { background-position: 0% 50%; } 100% { background-position: 300% 50%; } }

/* ════════════════════════════════════════════════════════════════
   SHADER LOADER — estado "Generando/Renderizando" de media (OutputNode)
   Shader GLSL de ondas fluidas de color (21st.dev shader-animation) renderizado
   con Three.js RAW en un <canvas> WebGL (componente React ShaderLoader). Este
   CSS solo aporta el CONTENEDOR (bordes redondeados + overflow), el host a
   pantalla completa del nodo y una línea de estado DISCRETA abajo — SIN texto
   centrado sobre el shader. `.siri-gen-wrap` se mantiene por compatibilidad de
   markup viejo.
   ════════════════════════════════════════════════════════════════ */
.shader-loader,
.siri-gen-wrap {
  position: relative;
  display: block;
  min-height: 210px;
  border-radius: 14px;
  overflow: hidden;                 /* recorta el canvas WebGL al radio del nodo */
  isolation: isolate;
  background: #07060d;              /* fallback bajo el canvas */
  border: 1px solid rgba(255,255,255,0.07);
}

/* Host del canvas WebGL: ocupa TODO el loader, shader a pantalla del nodo. */
.shader-loader-host {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.shader-loader-host.shader-loader-bg { border-radius: inherit; }
.shader-loader-host canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Fallback sin WebGL/THREE: degrada a un fondo animado simple, no rompe nada. */
.shader-loader-host.shader-loader-fallback {
  background:
    radial-gradient(120% 90% at 30% 20%, rgba(99,102,241,0.55), transparent 60%),
    radial-gradient(120% 90% at 70% 80%, rgba(16,185,129,0.45), transparent 60%),
    #07060d;
  background-size: 200% 200%;
  animation: shader-loader-fallback-flow 6s ease-in-out infinite alternate;
}
@keyframes shader-loader-fallback-flow {
  0%   { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .shader-loader-host.shader-loader-fallback { animation: none; }
}

/* Light theme: el shader trae su propio fondo oscuro → mismo tratamiento. */
html[data-theme="light"] .shader-loader,
html[data-theme="light"] .siri-gen-wrap {
  background: #0c0a18;
}

/* Estado DISCRETO: una línea mono pequeña abajo, NUNCA centrada sobre el shader. */
.shader-loader-status {
  position: absolute;
  z-index: 2;
  left: 0; right: 0; bottom: 10px;
  text-align: center;
  font-size: 10px; letter-spacing: 0.08em;
  color: rgba(244,238,255,0.78);
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  pointer-events: none;
}

/* reduced-motion: el componente ShaderLoader detecta prefers-reduced-motion y
   renderiza un único frame estático (sin rAF). No hace falta CSS extra. */

/* Lightbox */
.vlt-lightbox {
  position: relative;
  max-width: 90vw; max-height: 90vh;
  border-radius: 14px; overflow: hidden;
}
.vlt-lightbox img { display: block; max-width: 90vw; max-height: 90vh; object-fit: contain; }
.vlt-lightbox-close { position: absolute; top: 10px; right: 10px; z-index: 10; }

/* ===========================================================================
   ADN Popup — popup centrado
   =========================================================================== */
.adn-backdrop {
  position: fixed; inset: 0;
  z-index: 280;
  background: rgba(8,8,14,0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.adn-popup {
  background: var(--glass-bg-strong, rgba(18,18,30,0.97));
  border-radius: 20px;
  box-shadow:
    0 40px 100px -24px rgba(0,0,0,0.75),
    inset 0 1px 0 rgba(255,255,255,0.10),
    inset 0 0 0 1px rgba(255,255,255,0.06);
  width: min(860px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ADN header */
.adn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.adn-head-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.adn-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.adn-score-wrap { flex-shrink: 0; }
.adn-ring-bg { fill: none; stroke: rgba(255,255,255,0.07); stroke-width: 4; }
.adn-ring-fill {
  fill: none;
  stroke: url(#adn-grad);
  stroke-width: 4;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 28px 28px;
}
.adn-score-num { fill: var(--text-1); font-size: 13px; font-weight: 700; font-family: inherit; }
.adn-kicker { font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-4); }
.adn-title { font-size: 17px; font-weight: 680; letter-spacing: -0.015em; color: var(--text-1); margin-top: 3px; }
.adn-sub { font-size: 11px; color: var(--text-4); margin-top: 3px; }
.adn-sub strong { color: var(--text-2); font-weight: 600; }
.adn-edit-btn { white-space: nowrap; }

/* ADN body — 2 columnas */
.adn-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  overflow-y: auto;
  flex: 1;
}
.adn-col {
  display: flex;
  flex-direction: column;
  padding: 20px 24px;
  gap: 0;
}
.adn-col:first-child { border-right: 1px solid rgba(255,255,255,0.06); }
.adn-section {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.adn-section:last-child { border-bottom: 0; }
.adn-section-grow { flex: 1; display: flex; flex-direction: column; }
.adn-label {
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-4);
  margin-bottom: 8px;
}

/* Palette */
.adn-palette { display: flex; gap: 6px; flex-wrap: wrap; }
.adn-swatch {
  width: 32px; height: 32px;
  border-radius: 8px;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10);
  transition: transform 120ms;
  cursor: default;
}
.adn-swatch:hover { transform: scale(1.12); }
.adn-swatch-hex {
  position: absolute;
  bottom: -18px; left: 50%;
  transform: translateX(-50%);
  font-size: 8px; white-space: nowrap;
  opacity: 0; color: var(--text-3);
  transition: opacity 120ms;
  pointer-events: none;
}
.adn-swatch:hover .adn-swatch-hex { opacity: 1; }

/* Tags */
.adn-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.adn-tag {
  font-size: 11px; padding: 3px 9px;
  border-radius: 6px;
  background: rgba(143,126,233,0.12);
  color: var(--accent-3, #a78bfa);
  border: 1px solid rgba(143,126,233,0.2);
}
.adn-tag.adn-tag-dim {
  background: rgba(255,255,255,0.04);
  color: var(--text-3);
  border-color: rgba(255,255,255,0.07);
}

/* Text */
.adn-text { font-size: 12px; color: var(--text-2); line-height: 1.55; }
.adn-text-neg { color: var(--text-4); font-style: italic; }
.adn-prompt {
  font-size: 12px; color: var(--text-2); line-height: 1.65;
  background: rgba(0,0,0,0.20);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
  flex: 1;
}
.adn-copy-btn {
  margin-top: 8px;
  font-size: 10.5px; letter-spacing: 0.10em;
  color: var(--text-4); background: none; border: 0;
  padding: 3px 0; cursor: pointer;
  transition: color 150ms;
  display: block;
}
.adn-copy-btn:hover { color: var(--accent-3, #a78bfa); }

/* Inputs edit mode */
.adn-input {
  width: 100%; background: rgba(0,0,0,0.24);
  border: 0; border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  color: var(--text-1); font-size: 12px; font-family: inherit;
  padding: 8px 10px; outline: none; box-sizing: border-box;
}
.adn-input:focus { box-shadow: inset 0 0 0 1.5px rgba(143,126,233,0.45); }
.adn-textarea {
  width: 100%; background: rgba(0,0,0,0.24);
  border: 0; border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  color: var(--text-1); font-size: 12px; font-family: inherit;
  padding: 8px 10px; outline: none;
  resize: vertical; box-sizing: border-box; min-height: 56px;
}
.adn-textarea:focus { box-shadow: inset 0 0 0 1.5px rgba(143,126,233,0.45); }
.adn-textarea-lg { min-height: 110px; flex: 1; }

/* Button helpers */
.cdp-btn-sm { padding: 5px 11px !important; font-size: 11.5px !important; }

/* Light mode */
html[data-theme="light"] .vlt3-sidebar { border-right-color: rgba(0,0,0,0.07); }
html[data-theme="light"] .vlt3-sidebar-head { border-bottom-color: rgba(0,0,0,0.06); }
html[data-theme="light"] .vlt3-toolbar { border-bottom-color: rgba(0,0,0,0.06); }
html[data-theme="light"] .vlt-mb-item:hover { background: rgba(0,0,0,0.04); }
html[data-theme="light"] .vlt-mb-item.is-active { background: rgba(143,126,233,0.08); }
html[data-theme="light"] .vlt-mb-strip { box-shadow: inset 0 0 0 1px rgba(0,0,0,0.10); }
html[data-theme="light"] .vlt-drop-overlay { background: rgba(143,126,233,0.07); }
html[data-theme="light"] .adn-popup {
  background: rgba(255,255,255,0.97);
  box-shadow: 0 40px 100px -24px rgba(0,0,0,0.22), inset 0 0 0 1px rgba(0,0,0,0.07);
}
html[data-theme="light"] .adn-head { border-bottom-color: rgba(0,0,0,0.07); }
html[data-theme="light"] .adn-col:first-child { border-right-color: rgba(0,0,0,0.06); }
html[data-theme="light"] .adn-section { border-bottom-color: rgba(0,0,0,0.05); }
html[data-theme="light"] .adn-ring-bg { stroke: rgba(0,0,0,0.08); }
html[data-theme="light"] .adn-prompt { background: rgba(0,0,0,0.04); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.07); }
html[data-theme="light"] .adn-input, html[data-theme="light"] .adn-textarea {
  background: rgba(0,0,0,0.04); color: rgba(15,17,22,0.9); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.10);
}
html[data-theme="light"] .adn-tag { border-color: rgba(143,126,233,0.28); }
html[data-theme="light"] .adn-tag.adn-tag-dim { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.08); color: rgba(15,17,22,0.45); }
html[data-theme="light"] .adn-backdrop { background: rgba(15,17,22,0.4); }

/* Edge con datos transferidos: pulso violeta sutil constante (Cliender Desing Pro V1) */
.edge-has-data .edge-base {
  stroke: #A78BFA;
  stroke-opacity: 0.85;
  filter: drop-shadow(0 0 4px rgba(167,139,250,0.5));
  animation: edge-data-pulse 2.2s ease-in-out infinite;
}
@keyframes edge-data-pulse {
  0%, 100% { stroke-opacity: 0.55; filter: drop-shadow(0 0 2px rgba(167,139,250,0.4)); }
  50%      { stroke-opacity: 1;    filter: drop-shadow(0 0 8px rgba(167,139,250,0.85)); }
}

/* ===========================================================================
   SWARM LIVE PANEL — progress + logs + resultado final en SuperStage
   =========================================================================== */

.swarm-live-panel {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 340px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 120;
  pointer-events: auto;
  animation: swarm-panel-in 0.4s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes swarm-panel-in {
  from { opacity: 0; transform: translateY(-50%) translateX(24px); }
  to   { opacity: 1; transform: translateY(-50%) translateX(0); }
}

/* Progress wrap */
.swarm-progress-wrap {
  background: rgba(10,10,14,0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.swarm-agent-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.swarm-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.68rem;
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.04em;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: var(--text-3, #71717a);
  transition: all 0.25s ease;
}
.swarm-badge--running {
  border-color: rgba(139,92,246,0.5);
  background: rgba(139,92,246,0.12);
  color: #C4B5FD;
}
.swarm-badge--done {
  border-color: rgba(16,185,129,0.4);
  background: rgba(16,185,129,0.10);
  color: #6EE7B7;
}
.swarm-badge--error {
  border-color: rgba(239,68,68,0.4);
  background: rgba(239,68,68,0.10);
  color: #FCA5A5;
}
.swarm-badge-check {
  font-size: 0.72rem;
  color: #10B981;
}
.swarm-badge-spin {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid rgba(139,92,246,0.3);
  border-top-color: #8B5CF6;
  animation: badge-spin 0.7s linear infinite;
}
@keyframes badge-spin {
  to { transform: rotate(360deg); }
}
.swarm-badge-label {
  font-size: 0.67rem;
}

.swarm-bar-track {
  height: 3px;
  background: rgba(255,255,255,0.07);
  border-radius: 99px;
  overflow: hidden;
}
.swarm-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #7C3AED, #A78BFA, #C4B5FD);
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.16,1,0.3,1);
  box-shadow: 0 0 8px rgba(167,139,250,0.6);
}

/* Logs */
.swarm-logs {
  background: rgba(10,10,14,0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(139,92,246,0.3) transparent;
}
.swarm-log-row {
  display: grid;
  grid-template-columns: 8px auto 1fr auto;
  align-items: start;
  gap: 6px;
  font-size: 0.72rem;
  line-height: 1.45;
  animation: log-row-in 0.25s ease both;
}
@keyframes log-row-in {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}
.swarm-log-row.is-error .swarm-log-msg {
  color: #FCA5A5;
}
.swarm-log-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
}
.swarm-log-agent {
  font-family: var(--font-mono, monospace);
  font-size: 0.67rem;
  white-space: nowrap;
  font-weight: 600;
}
.swarm-log-msg {
  color: var(--text-2, #a1a1aa);
  font-size: 0.70rem;
  word-break: break-word;
}
.swarm-log-running {
  font-size: 0.62rem;
  color: #8B5CF6;
  white-space: nowrap;
  animation: pulse-text 1.2s ease-in-out infinite;
}
@keyframes pulse-text {
  0%,100% { opacity: 0.5; }
  50%     { opacity: 1; }
}
.swarm-thinking {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}

/* Resultado final */
.swarm-result {
  background: rgba(10,10,14,0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(167,139,250,0.25);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: result-in 0.5s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes result-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
.swarm-result-media {
  width: 100%;
  border-radius: 10px;
  object-fit: cover;
  max-height: 200px;
  border: 1px solid rgba(255,255,255,0.08);
  display: block;
}
.swarm-result-stub {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: rgba(245,158,11,0.07);
  border: 1px dashed rgba(245,158,11,0.25);
  border-radius: 8px;
}
.swarm-result-prompt {
  font-size: 0.70rem;
  color: var(--text-2, #a1a1aa);
  line-height: 1.4;
  font-style: italic;
}
.swarm-result-model {
  font-size: 0.65rem;
  color: var(--text-3, #71717a);
}
.swarm-result-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  color: var(--text-3, #71717a);
  padding-top: 2px;
}

/* ===================================================================== */
/* SWARM MODAL CENTRAL — popup en lugar del panel lateral                 */
/* ===================================================================== */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes swarm-modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes swarm-modal-card-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.swarm-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(5, 5, 15, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: swarm-modal-fade-in 220ms cubic-bezier(0.16, 1, 0.3, 1);
  padding: 24px;
}
.swarm-modal-card {
  width: min(580px, 92vw);
  max-height: 86vh;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(20, 15, 35, 0.96), rgba(10, 8, 20, 0.98));
  border: 1px solid rgba(167, 139, 250, 0.22);
  border-radius: 22px;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(167, 139, 250, 0.12),
    inset 0 1px 1px rgba(255, 255, 255, 0.06);
  padding: 22px 24px 24px;
  color: var(--text-1, #f5f5fa);
  animation: swarm-modal-card-in 320ms cubic-bezier(0.16, 1, 0.3, 1);
}
.swarm-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(167, 139, 250, 0.12);
}
.swarm-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.swarm-modal-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #A78BFA;
  box-shadow: 0 0 12px rgba(167, 139, 250, 0.8);
  animation: orb-pulse 1.6s ease-in-out infinite;
}
.swarm-modal-title {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(199, 210, 254, 0.95);
}
.swarm-modal-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(199, 210, 254, 0.7);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 180ms cubic-bezier(0.32, 0.72, 0, 1);
}
.swarm-modal-close:hover {
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.4);
  color: #FB7185;
}
.swarm-modal-section {
  margin-bottom: 18px;
}
.swarm-modal-section:last-child {
  margin-bottom: 0;
}
.swarm-modal-label {
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(199, 210, 254, 0.45);
  margin-bottom: 8px;
}
.swarm-modal-prompt {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(167, 139, 250, 0.06);
  border: 1px solid rgba(167, 139, 250, 0.18);
  box-shadow: inset 0 0 24px rgba(167, 139, 250, 0.04);
  font-style: italic;
  font-size: 13px;
  color: rgba(245, 245, 250, 0.88);
  line-height: 1.5;
}
.swarm-modal-logs {
  max-height: 220px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 10px 12px;
}
.swarm-modal-download {
  font-size: 10px;
  color: #A78BFA;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.25);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: all 180ms cubic-bezier(0.32, 0.72, 0, 1);
}
.swarm-modal-download:hover {
  background: rgba(167, 139, 250, 0.2);
  border-color: rgba(167, 139, 250, 0.5);
}
.swarm-badge-x {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #FB7185;
  color: #fff;
  font-size: 9px;
}

/* Reopen FAB */
.swarm-reopen-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 199;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.95), rgba(124, 58, 237, 0.92));
  border: 1px solid rgba(167, 139, 250, 0.5);
  color: #fff;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 32px rgba(124, 58, 237, 0.4), 0 0 0 1px rgba(167, 139, 250, 0.25);
  transition: all 220ms cubic-bezier(0.32, 0.72, 0, 1);
}
.swarm-reopen-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(124, 58, 237, 0.55);
}

/* ===================================================================== */
/* SWARM TECH LOADER — placeholder mientras se genera el resultado       */
/* ===================================================================== */
.swarm-tech-loader {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 14px;
  background: radial-gradient(ellipse at center, rgba(167, 139, 250, 0.08), rgba(5, 5, 15, 0.95));
  border: 1px solid rgba(167, 139, 250, 0.18);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.swarm-tech-loader::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(167, 139, 250, 0.18) 50%, transparent 100%);
  animation: tech-scan 2.4s linear infinite;
  pointer-events: none;
}
.swarm-tech-loader::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(167, 139, 250, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167, 139, 250, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.4;
  pointer-events: none;
}
@keyframes tech-scan {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}
.swarm-tech-loader-core {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.swarm-tech-loader-orb {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #C4B5FD, #6D28D9);
  box-shadow: 0 0 32px rgba(167, 139, 250, 0.6), 0 0 64px rgba(167, 139, 250, 0.3);
  animation: orb-pulse 1.8s ease-in-out infinite;
}
@keyframes orb-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 32px rgba(167, 139, 250, 0.6), 0 0 64px rgba(167, 139, 250, 0.3); }
  50% { transform: scale(1.12); box-shadow: 0 0 48px rgba(167, 139, 250, 0.9), 0 0 96px rgba(167, 139, 250, 0.45); }
}
.swarm-tech-loader-label {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(199, 210, 254, 0.85);
  text-shadow: 0 0 8px rgba(167, 139, 250, 0.5);
}
.swarm-tech-loader-dots {
  display: flex;
  gap: 5px;
}
.swarm-tech-loader-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #A78BFA;
  animation: dot-wave 1.2s ease-in-out infinite;
}
.swarm-tech-loader-dot:nth-child(2) { animation-delay: 0.15s; }
.swarm-tech-loader-dot:nth-child(3) { animation-delay: 0.30s; }
.swarm-tech-loader-dot:nth-child(4) { animation-delay: 0.45s; }
@keyframes dot-wave {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}


/* ═══════════════════════════════════════════════════════════════
   Ficha de cliente — LIGHT MODE (stat cells, contacto, swatches)
   var(--surf-card/--surf-line) eran blancos → invisibles en claro
   ═══════════════════════════════════════════════════════════════ */
html[data-theme="light"] .stat-cell {
  background: rgba(124,58,237,0.05) !important;
  box-shadow: inset 0 0 0 1px rgba(124,58,237,0.12) !important;
}
html[data-theme="light"] .stat-label { color: #6B5B8C !important; }
html[data-theme="light"] .stat-value { color: #1A1523 !important; }
html[data-theme="light"] .client-contact {
  background: rgba(124,58,237,0.05) !important;
  box-shadow: inset 0 0 0 1px rgba(124,58,237,0.12) !important;
}
html[data-theme="light"] .client-contact-name { color: #1A1523 !important; }
html[data-theme="light"] .client-contact-role { color: #6B5B8C !important; }
html[data-theme="light"] .client-contact-avatar {
  background: linear-gradient(135deg, rgba(124,58,237,0.22), rgba(167,139,250,0.14)) !important;
  color: #4C1D95 !important;
}
html[data-theme="light"] .client-contact-email { color: #6D28D9 !important; }
html[data-theme="light"] .client-swatch-color {
  box-shadow: inset 0 0 0 1px rgba(15,17,22,0.12), 0 4px 10px -3px rgba(124,58,237,0.2) !important;
}
html[data-theme="light"] .client-swatch-hex { color: #6B5B8C !important; }
html[data-theme="light"] .client-back {
  background: rgba(124,58,237,0.06) !important;
  color: #4C1D95 !important;
  box-shadow: inset 0 0 0 1px rgba(124,58,237,0.15) !important;
}
html[data-theme="light"] .client-pillar-num { color: #6D28D9 !important; }
