/* ===========================================================================
   LeftRail + Left Drawers
   =========================================================================== */

.leftrail {
  position: fixed;
  top: 64px; left: 0; bottom: 0;
  z-index: 26;
  width: 60px;
  padding: 12px 0;
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  gap: 6px;
  align-items: center;
}
.rail-spacer { flex: 1; }

.rail-item {
  position: relative;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border: 0;
  background: transparent;
  color: var(--text-3);
  border-radius: 11px;
  cursor: pointer;
  transition: all .2s var(--ease);
}
.rail-item-label { display: none; }      /* tooltip via title instead */
.rail-item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-1);
}
.rail-item.is-active {
  background: rgba(139,92,246,0.14);
  color: var(--accent-3);
}
.rail-item-icon {
  display: grid; place-items: center;
  height: 24px;
}
.rail-item-label {
  display: none;
}
.rail-item-badge {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 14px; height: 14px;
  display: grid; place-items: center;
  padding: 0 3px;
  background: rgba(139,92,246,0.9);
  color: #fff;
  border-radius: 7px;
  font-size: 8.5px;
  box-shadow: 0 0 8px rgba(139,92,246,0.55);
}
.rail-item-marker {
  position: absolute;
  left: -1px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 22px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

/* Tooltip-on-hover label */
.rail-item::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  padding: 5px 10px;
  background: #0F0F0F;
  border: 1px solid #262626;
  color: var(--text-1);
  border-radius: 7px;
  font-family: "Geist", sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s, transform .15s;
  box-shadow: 0 8px 18px -8px rgba(0,0,0,0.7);
  z-index: 50;
}
.rail-item:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(2px);
}
.rail-item.is-active::after { display: none; }

/* Left drawer base */
.left-drawer {
  position: fixed;
  top: 64px; bottom: 0;
  left: 60px;
  z-index: 24;
  width: 340px;
  background: rgba(10,10,10,0.93);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  transform: translate3d(-110%, 0, 0);
  will-change: transform;
  visibility: hidden;
  box-shadow: 0 0 80px rgba(0,0,0,0.6);
}
.left-drawer.is-open {
  transform: translate3d(0, 0, 0);
  visibility: visible;
  animation: drawer-slide-in .35s var(--ease) both;
}
.left-drawer[data-kind="moodboard"] { width: 760px; }
.left-drawer[data-kind="gallery"]   { width: 520px; }

.drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--line-2);
}
.drawer-title { font-size: 15px; color: var(--text-1); font-weight: 500; }
.drawer-kicker {
  margin-top: 3px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 20px;
}
.drawer-section-label {
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-4);
  margin-bottom: 9px;
}

/* Node add cards */
.nodes-list { display: flex; flex-direction: column; gap: 8px; }
.node-add-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
  color: var(--text-1);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  position: relative; overflow: hidden;
  transition: all .2s var(--ease);
}
html[data-theme="light"] .node-add-card {
  border-color: rgba(109,40,217,0.12);
  background: rgba(255,255,255,0.7);
  box-shadow: 0 1px 4px rgba(109,40,217,0.06);
}
html[data-theme="light"] .node-add-card:hover {
  background: rgba(255,255,255,0.95);
  box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--add-c) 22%, transparent), 0 0 0 1px var(--add-c);
}
.node-add-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 100% at 0% 0%, color-mix(in srgb, var(--add-c) 18%, transparent), transparent 55%);
  opacity: 0;
  transition: opacity .25s;
}
.node-add-card:hover {
  border-color: var(--add-c);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -8px rgba(0,0,0,0.5), 0 0 22px color-mix(in srgb, var(--add-c) 26%, transparent);
}
.node-add-card:hover::before { opacity: 1; }
.node-add-icon {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 9px;
  flex-shrink: 0;
  position: relative; z-index: 1;
}
.node-add-meta { flex: 1; min-width: 0; position: relative; z-index: 1; }
.node-add-title { font-size: 13px; color: var(--text-1); font-weight: 500; }
.node-add-hint {
  margin-top: 3px;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-4);
}
.node-add-plus {
  display: grid; place-items: center;
  width: 24px; height: 24px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--add-c) 18%, transparent);
  color: var(--add-c);
  font-size: 14px;
  position: relative; z-index: 1;
}

/* Template cards */
.tpl-card {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px;
  border: 1px dashed #262626;
  background: transparent;
  color: var(--text-1);
  border-radius: 11px;
  cursor: pointer;
  text-align: left;
  transition: all .2s var(--ease);
}
.tpl-card:hover {
  border-style: solid;
  border-color: rgba(139,92,246,0.4);
  background: rgba(139,92,246,0.04);
}
.tpl-icons { display: flex; }
.tpl-dot { width: 12px; height: 12px; border-radius: 50%; }
.tpl-meta { flex: 1; min-width: 0; }
.tpl-title { font-size: 12.5px; color: var(--text-1); }
.tpl-sub {
  margin-top: 3px;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-4);
}
.tpl-arrow { color: var(--text-3); font-size: 14px; }

/* When a left drawer is open, ensure existing right-side toasts shift left */
body:has(.left-drawer.is-open) .toast-stack { right: 20px; }

/* ===========================================================================
   Override existing panels to dock from the LEFT
   =========================================================================== */

/* Moodboard sheet — antes bottom sheet → ahora left drawer */
.vault-sheet {
  /* Re-anchor to act as a left drawer */
  position: fixed;
  top: 64px; bottom: 0; left: 60px;
  right: auto;
  width: 760px;
  max-width: calc(100vw - 76px);
  height: auto;
  max-height: none;
  border-radius: 0;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  transform: translate3d(-110%, 0, 0);
  will-change: transform;
  transition: transform .42s var(--ease);
  visibility: hidden;
}
.vault-sheet.is-open {
  transform: translate3d(0, 0, 0);
  visibility: visible;
  animation: drawer-slide-in .42s var(--ease) both;
}
@keyframes drawer-slide-in {
  from { transform: translate3d(-110%, 0, 0); }
  to   { transform: translate3d(0, 0, 0); }
}
.vault-backdrop { display: none; }
.vault-handle   { display: none; }

/* Gallery panel — antes right slide → ahora left drawer */
.gallery-panel {
  top: 64px; bottom: 0; left: 60px;
  right: auto;
  width: 520px;
  border-left: 0;
  border-right: 1px solid var(--line);
  transform: translate3d(-110%, 0, 0);
  visibility: hidden;
}
.gallery-panel.is-open {
  transform: translate3d(0, 0, 0);
  visibility: visible;
  animation: drawer-slide-in .42s var(--ease) both;
}
.gallery-backdrop { display: none; }
.gallery-head { grid-template-columns: 1fr auto auto; }
.gallery-grid { grid-template-columns: repeat(2, 1fr); }

/* Canvas help — desplaza para no colisionar con el rail */
.canvas-help { left: calc(50% + 32px); }

/* Style Vault title rename helper (en vault.jsx el texto sigue siendo "Style Vault") */


/* ===========================================================================
   Agents Panel
   =========================================================================== */

.agent-panel-new {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.agent-panel-new-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 10px;
  color: #a5b4fc;
  font-size: 12px;
  font-family: var(--font-mono, monospace);
  cursor: pointer;
  transition: all .2s var(--ease);
}
.agent-panel-new-btn:hover {
  background: rgba(99,102,241,0.22);
  border-color: rgba(99,102,241,0.45);
  color: #c7d2fe;
}
.agent-panel-new-btn svg { flex-shrink: 0; }

.agent-panel-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
  font-family: var(--font-mono, monospace);
  line-height: 1.7;
}
.agent-panel-empty p { margin: 0; }

.agent-panel-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  flex: 1;
}

.agent-card {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background .15s;
}
.agent-card:hover {
  background: rgba(255,255,255,0.025);
}

.agent-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.agent-card-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}
.agent-card-info {
  flex: 1;
  min-width: 0;
}
.agent-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agent-card-role {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono, monospace);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agent-card-actions {
  display: flex;
  gap: 4px;
  margin-left: 4px;
}
.agent-card-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: all .15s;
}
.agent-card-btn:hover {
  background: rgba(255,255,255,0.07);
  color: var(--text-1);
}
.agent-card-btn-del:hover {
  background: rgba(239,68,68,0.14);
  color: #f87171;
}

.agent-card-specialty {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 6px;
  font-style: italic;
}
.agent-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.agent-tag {
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-family: var(--font-mono, monospace);
  background: rgba(255,255,255,0.06);
  color: var(--text-3);
  border: 1px solid rgba(255,255,255,0.06);
}
.agent-tag.style { background: rgba(var(--agent-color-rgb, 99,102,241), 0.12); color: color-mix(in srgb, var(--agent-color, #6366f1) 70%, white); border-color: rgba(var(--agent-color-rgb, 99,102,241), 0.2); }
.agent-tag.avoid { background: rgba(239,68,68,0.07); color: #f87171; border-color: rgba(239,68,68,0.12); }

/* New-Agent Popup */
.new-agent-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  animation: fade-in .2s ease both;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.new-agent-popup {
  width: 420px;
  max-width: calc(100vw - 40px);
  background: var(--surface-1, #111);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: popup-in .25s var(--ease) both;
}
@keyframes popup-in { from { opacity:0; transform: scale(0.96) translateY(8px); } to { opacity:1; transform:none; } }
.new-agent-popup-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  margin: 0;
}
.new-agent-form { display: flex; flex-direction: column; gap: 10px; }
.new-agent-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.new-agent-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.new-agent-field label {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono, monospace);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.new-agent-field input, .new-agent-field textarea {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text-1);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
  resize: none;
}
.new-agent-field input:focus, .new-agent-field textarea:focus {
  border-color: rgba(99,102,241,0.5);
}
.new-agent-field input[type="color"] {
  height: 36px;
  padding: 2px 4px;
  cursor: pointer;
}
.new-agent-popup-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}
.new-agent-popup-cancel {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-3);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.new-agent-popup-cancel:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-1);
}
.new-agent-popup-submit {
  padding: 8px 18px;
  border-radius: 8px;
  border: 0;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.new-agent-popup-submit:hover { opacity: 0.88; }


/* ========================================================================== */
/* Agents — dos botones + ficha expandible (sin cambios)                        */
/* ========================================================================== */
.agents-actions-row { display: flex; gap: 8px; padding: 0 16px 14px; }
.agents-btn-new, .agents-btn-ai {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 9px 10px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.04);
  color: var(--text-1); font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.agents-btn-new:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.18); }
.agents-btn-ai { background: linear-gradient(135deg, rgba(99,102,241,0.18), rgba(139,92,246,0.18)); border-color: rgba(99,102,241,0.35); color: #a5b4fc; }
.agents-btn-ai:hover { background: linear-gradient(135deg, rgba(99,102,241,0.28), rgba(139,92,246,0.28)); border-color: rgba(99,102,241,0.55); box-shadow: 0 0 16px rgba(99,102,241,0.2); }
.agents-btn-icon { font-size: 14px; line-height: 1; }
/* ficha expandible */
.agent-card-chevron { font-size: 9px; opacity: 0.45; margin-left: auto; flex-shrink: 0; }
.agent-ficha { margin: 8px 0 4px; padding: 10px 12px; background: rgba(255,255,255,0.03); border-radius: 8px; border: 1px solid rgba(255,255,255,0.06); display: flex; flex-direction: column; gap: 7px; }
.ficha-row { display: flex; gap: 8px; font-size: 11.5px; line-height: 1.4; }
.ficha-row-tags { align-items: flex-start; }
.ficha-label { min-width: 74px; opacity: 0.45; font-size: 10px; padding-top: 1px; flex-shrink: 0; }
.ficha-val { color: var(--text-1); opacity: 0.85; }
.ficha-edit-btn { margin-top: 4px; align-self: flex-start; background: none; border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; color: var(--text-2, #aaa); font-size: 11px; padding: 4px 10px; cursor: pointer; transition: background .12s, border-color .12s; }
.ficha-edit-btn:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.2); }
.agent-tag-avoid { background: rgba(239,68,68,0.12); color: #fca5a5; border-color: rgba(239,68,68,0.2); }

/* ========================================================================== */
/* NewAgentPopup — modal premium con live preview                               */
/* ========================================================================== */
@keyframes modal-enter {
  from { opacity: 0; transform: scale(0.93) translateY(18px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}
.agent-form-modal {
  width: 620px;
  max-width: 95vw;
  max-height: 90vh;
  background: var(--glass-bg-strong, #181b24);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.55), 0 0 0 1px rgba(99,102,241,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-enter .32s cubic-bezier(0.16,1,0.3,1) both;
}
.agent-form-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.015);
}
.agent-form-avatar {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transition: background .2s;
  letter-spacing: -0.02em;
}
.agent-form-preview-info { flex: 1; overflow: hidden; }
.agent-form-preview-name {
  font-size: 16px; font-weight: 600; letter-spacing: -0.02em;
  color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.agent-form-preview-role { font-size: 11px; opacity: 0.5; margin-top: 2px; }
.agent-form-close {
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.04);
  color: var(--text-2, #aaa); font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, border-color .12s; flex-shrink: 0;
}
.agent-form-close:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }
.agent-form-accents {
  display: flex; gap: 8px; padding: 12px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.agent-accent-dot {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  padding: 0;
}
.agent-accent-dot:hover { transform: scale(1.18); }
.agent-accent-dot.is-active { transform: scale(1.15); }
.agent-form-body {
  flex: 1; overflow-y: auto; padding: 16px 22px 0;
  display: flex; flex-direction: column;
}
.agent-form-body::-webkit-scrollbar { width: 4px; }
.agent-form-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.agent-form-section-label {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.12em;
  opacity: 0.4; margin: 4px 0 8px;
  padding-bottom: 5px; border-bottom: 1px solid rgba(255,255,255,0.06);
  color: #a5b4fc;
}
.agent-form-footer {
  display: flex; gap: 10px;
  padding: 16px 0 20px;
  margin-top: 8px;
  position: sticky; bottom: 0;
  background: var(--glass-bg-strong, #181b24);
  border-top: 1px solid rgba(255,255,255,0.05);
}
.agent-form-btn-cancel {
  flex: 1; padding: 10px 16px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.04);
  color: var(--text-2, #aaa); font-size: 13px; cursor: pointer;
  transition: background .12s;
}
.agent-form-btn-cancel:hover { background: rgba(255,255,255,0.08); }
.agent-form-btn-save {
  flex: 2; padding: 10px 20px; border-radius: 10px; border: 0;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: opacity .15s, box-shadow .15s;
  box-shadow: 0 4px 20px rgba(99,102,241,0.35);
}
.agent-form-btn-save:hover { opacity: 0.9; box-shadow: 0 6px 24px rgba(99,102,241,0.5); }

/* ========================================================================== */
/* AIAgentPopup — wizard premium · dark/light · animaciones elegantes          */
/* ========================================================================== */

/* Backdrop */
.form-popup-backdrop {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  display: flex; align-items: center; justify-content: center;
  animation: wiz-backdrop-in .28s ease both;
}
@keyframes wiz-backdrop-in { from { opacity:0; } to { opacity:1; } }
html[data-theme="light"] .form-popup-backdrop { background: rgba(26,21,35,0.55); }

.ai-wiz-modal {
  width: 720px; max-width: 94vw; max-height: 88vh;
  background: rgba(14,15,22,0.97);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 28px;
  box-shadow: 0 48px 128px rgba(0,0,0,0.72), 0 0 0 1px rgba(99,102,241,0.12), 0 1px 0 rgba(255,255,255,0.06) inset;
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: wiz-modal-in .38s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes wiz-modal-in {
  from { opacity:0; transform: scale(0.93) translateY(20px); }
  to   { opacity:1; transform: scale(1)    translateY(0); }
}
html[data-theme="light"] .ai-wiz-modal {
  background: rgba(252,251,255,0.98);
  border-color: rgba(109,40,217,0.12);
  box-shadow: 0 48px 128px rgba(109,40,217,0.1), 0 0 0 1px rgba(109,40,217,0.08), 0 1px 0 rgba(255,255,255,0.95) inset;
}

/* Progress track */
.ai-wiz-progress-track { height: 3px; flex-shrink: 0; background: rgba(255,255,255,0.06); }
html[data-theme="light"] .ai-wiz-progress-track { background: rgba(109,40,217,0.09); }
.ai-wiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
  transition: width .5s cubic-bezier(0.16,1,0.3,1);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 10px rgba(139,92,246,0.55);
}

/* Topbar */
.ai-wiz-topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 22px 13px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
html[data-theme="light"] .ai-wiz-topbar { border-bottom-color: rgba(109,40,217,0.09); }
.ai-wiz-kicker { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: #a5b4fc; flex: 1; }
html[data-theme="light"] .ai-wiz-kicker { color: #6D28D9; }

/* Step dots */
.ai-wiz-step-dots { display: flex; gap: 5px; align-items: center; }
.ai-wiz-dot {
  display: block; width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.14);
  transition: background .22s, transform .22s, width .22s;
}
html[data-theme="light"] .ai-wiz-dot { background: rgba(109,40,217,0.14); }
.ai-wiz-dot.done { background: rgba(99,102,241,0.5); }
.ai-wiz-dot.active { background: #6366f1; transform: scale(1.35); width: 16px; border-radius: 3px; }

/* Question wrap */
@keyframes wiz-slide-in {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}
.ai-wiz-question-wrap {
  flex: 1; overflow-y: auto;
  padding: 20px 22px 0;
  animation: wiz-slide-in .32s cubic-bezier(0.16,1,0.3,1) both;
}
.ai-wiz-question-wrap::-webkit-scrollbar { width: 4px; }
.ai-wiz-question-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
html[data-theme="light"] .ai-wiz-question-wrap::-webkit-scrollbar-thumb { background: rgba(109,40,217,0.15); }
.ai-wiz-multi-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px; margin-bottom: 12px;
  background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.22);
  color: #a5b4fc; font-size: 9.5px; letter-spacing: 0.07em;
}
html[data-theme="light"] .ai-wiz-multi-badge { background: rgba(109,40,217,0.07); color: #6D28D9; border-color: rgba(109,40,217,0.2); }
.ai-wiz-q-label {
  font-size: 22px; font-weight: 720; letter-spacing: -0.028em;
  color: var(--text-1, #f0f2f7); line-height: 1.2; margin-bottom: 7px;
}
html[data-theme="light"] .ai-wiz-q-label { color: #1A1523; }
.ai-wiz-q-sub { font-size: 12px; opacity: 0.48; margin-bottom: 20px; line-height: 1.5; }
html[data-theme="light"] .ai-wiz-q-sub { color: #4B3F72; opacity: 0.6; }

/* Options grid */
.ai-wiz-options { display: grid; gap: 10px; margin-bottom: 8px; }
.ai-wiz-opts-4 { grid-template-columns: repeat(2, 1fr); }
.ai-wiz-opts-5 { grid-template-columns: repeat(3, 1fr); }
.ai-wiz-opts-6 { grid-template-columns: repeat(3, 1fr); }

/* Option card */
.ai-wiz-opt {
  position: relative; display: flex; flex-direction: column;
  align-items: flex-start; gap: 4px;
  padding: 14px 14px 13px; border-radius: 16px;
  border: 1.5px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
  cursor: pointer; text-align: left;
  transition: border-color .14s, background .14s, transform .14s, box-shadow .14s;
}
html[data-theme="light"] .ai-wiz-opt { border-color: rgba(109,40,217,0.1); background: rgba(109,40,217,0.025); }
.ai-wiz-opt:hover {
  border-color: rgba(99,102,241,0.45); background: rgba(99,102,241,0.07);
  transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,0.13);
}
html[data-theme="light"] .ai-wiz-opt:hover { border-color: rgba(109,40,217,0.35); background: rgba(109,40,217,0.06); }
.ai-wiz-opt.is-sel {
  border-color: #6366f1; background: rgba(99,102,241,0.1);
  box-shadow: 0 0 0 1px rgba(99,102,241,0.28), 0 6px 20px rgba(99,102,241,0.14);
}
html[data-theme="light"] .ai-wiz-opt.is-sel {
  border-color: #6D28D9; background: rgba(109,40,217,0.08);
  box-shadow: 0 0 0 1px rgba(109,40,217,0.22), 0 4px 14px rgba(109,40,217,0.1);
}
.ai-wiz-opt-icon { font-size: 22px; line-height: 1; margin-bottom: 3px; }
.ai-wiz-opt-name { font-size: 13px; font-weight: 620; color: var(--text-1, #f0f2f7); line-height: 1.2; }
html[data-theme="light"] .ai-wiz-opt-name { color: #1A1523; }
.ai-wiz-opt-desc { font-size: 10.5px; opacity: 0.48; line-height: 1.3; }
html[data-theme="light"] .ai-wiz-opt-desc { color: #4B3F72; opacity: 0.6; }
.ai-wiz-opt-check {
  position: absolute; top: 10px; right: 12px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #6366f1; color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(99,102,241,0.5);
}

/* Nav footer */
.ai-wiz-nav { display: flex; gap: 10px; padding: 14px 22px 20px; border-top: 1px solid rgba(255,255,255,0.06); flex-shrink: 0; }
html[data-theme="light"] .ai-wiz-nav { border-top-color: rgba(109,40,217,0.09); }
.ai-wiz-nav-back {
  flex: 1; padding: 11px 16px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.04);
  color: var(--text-2, #aaa); font-size: 13px; cursor: pointer; font-family: inherit;
  transition: background .12s, border-color .12s;
}
.ai-wiz-nav-back:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.18); }
html[data-theme="light"] .ai-wiz-nav-back { border-color: rgba(109,40,217,0.15); background: rgba(109,40,217,0.03); color: #6D28D9; }
html[data-theme="light"] .ai-wiz-nav-back:hover { background: rgba(109,40,217,0.07); border-color: rgba(109,40,217,0.28); }
.ai-wiz-nav-next {
  flex: 2; padding: 11px 20px; border-radius: 12px; border: 0;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; font-size: 13px; font-weight: 640; cursor: pointer;
  font-family: inherit; letter-spacing: -0.01em;
  transition: opacity .14s, box-shadow .14s, transform .1s;
  box-shadow: 0 4px 22px rgba(99,102,241,0.42);
}
.ai-wiz-nav-next:hover { opacity: 0.92; box-shadow: 0 8px 30px rgba(99,102,241,0.52); transform: translateY(-1px); }
.ai-wiz-nav-next:active { transform: translateY(0); }
.ai-wiz-nav-next.is-disabled { opacity: 0.3; cursor: not-allowed; box-shadow: none; transform: none; }
.ai-wiz-nav-skip {
  flex: 0 0 auto; padding: 11px 16px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: transparent; color: var(--text-3, #666);
  font-size: 12px; cursor: pointer; font-family: inherit;
  letter-spacing: 0.02em;
  transition: color .14s, border-color .14s, background .14s;
}
.ai-wiz-nav-skip:hover { color: var(--text-2); border-color: rgba(255,255,255,0.18); background: rgba(255,255,255,0.05); }
html[data-theme="light"] .ai-wiz-nav-skip { border-color: rgba(109,40,217,0.12); color: #9CA3AF; }
html[data-theme="light"] .ai-wiz-nav-skip:hover { color: #6D28D9; border-color: rgba(109,40,217,0.25); background: rgba(109,40,217,0.04); }

/* Generating — fluido Siri + rings */
.ai-wiz-generating {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px; padding: 52px 28px;
  position: relative; overflow: hidden;
}
.ai-wiz-gen-fluid {
  position: absolute; inset: -30%;
  background:
    radial-gradient(circle at 32% 34%, rgba(99,102,241,0.38), transparent 44%),
    radial-gradient(circle at 68% 38%, rgba(139,92,246,0.35), transparent 44%),
    radial-gradient(circle at 50% 72%, rgba(236,72,153,0.3),  transparent 43%);
  filter: blur(30px) saturate(1.35);
  mix-blend-mode: screen; opacity: 0.75;
  animation: siri-drift 5.5s ease-in-out infinite alternate;
  pointer-events: none;
}
html[data-theme="light"] .ai-wiz-gen-fluid { opacity: 0.28; mix-blend-mode: multiply; }
.ai-wiz-gen-rings {
  position: relative; width: 90px; height: 90px;
  display: flex; align-items: center; justify-content: center; z-index: 1;
}
.ai-wiz-gen-ring { position: absolute; inset: 0; border-radius: 50%; border: 2.5px solid transparent; }
.ai-wiz-gen-ring.r1 { border-top-color: #6366f1; animation: ring-spin 1.4s linear infinite; }
.ai-wiz-gen-ring.r2 { inset: 10px; border-right-color: #8b5cf6; animation: ring-spin 2.1s linear infinite reverse; }
.ai-wiz-gen-ring.r3 { inset: 21px; border-bottom-color: #ec4899; animation: ring-spin 1s linear infinite; }
.ai-wiz-gen-core {
  width: 30px; height: 30px; border-radius: 50%;
  background: conic-gradient(from var(--siri-angle, 0deg), #6366f1, #8b5cf6, #ec4899, #6366f1);
  box-shadow: 0 0 20px rgba(139,92,246,0.75), 0 0 40px rgba(99,102,241,0.3);
  animation: siri-spin 2.4s linear infinite, siri-breathe 1.9s ease-in-out infinite;
}
@keyframes ring-spin { to { transform: rotate(360deg); } }
.ai-wiz-gen-title { font-size: 20px; font-weight: 720; letter-spacing: -0.025em; color: var(--text-1, #f0f2f7); z-index: 1; }
html[data-theme="light"] .ai-wiz-gen-title { color: #1A1523; }
.ai-wiz-gen-sub { font-size: 12px; opacity: 0.45; z-index: 1; text-align: center; }
html[data-theme="light"] .ai-wiz-gen-sub { color: #4B3F72; }

/* Steps ticker durante generación */
.ai-wiz-gen-steps { display: flex; flex-direction: column; gap: 6px; z-index: 1; width: 100%; max-width: 340px; margin-top: 2px; }
.ai-wiz-gen-step { display: flex; align-items: center; gap: 9px; font-size: 11.5px; opacity: 0; }
.ai-wiz-gen-step.done { opacity: 0.4; }
.ai-wiz-gen-step.active { opacity: 1; color: #c4b5fd; }
html[data-theme="light"] .ai-wiz-gen-step.active { color: #6D28D9; }
html[data-theme="light"] .ai-wiz-gen-step.done { opacity: 0.45; color: #4B3F72; }
.ai-wiz-gen-step-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: rgba(167,139,250,0.35); }
.ai-wiz-gen-step.done .ai-wiz-gen-step-dot { background: #10B981; }
.ai-wiz-gen-step.active .ai-wiz-gen-step-dot { background: #A78BFA; box-shadow: 0 0 7px rgba(167,139,250,0.85); animation: siri-breathe 1s ease-in-out infinite; }
html[data-theme="light"] .ai-wiz-gen-step.active .ai-wiz-gen-step-dot { background: #6D28D9; box-shadow: 0 0 7px rgba(109,40,217,0.5); }

/* Preview */
.ai-wiz-preview-body { flex: 1; overflow-y: auto; padding: 16px 22px 0; }
.ai-wiz-preview-body::-webkit-scrollbar { width: 4px; }
.ai-wiz-preview-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
html[data-theme="light"] .ai-wiz-preview-body::-webkit-scrollbar-thumb { background: rgba(109,40,217,0.15); }
.ai-wiz-preview-avatar-row {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 16px; padding: 16px; border-radius: 16px;
  background: rgba(255,255,255,0.028); border: 1px solid rgba(255,255,255,0.07);
}
html[data-theme="light"] .ai-wiz-preview-avatar-row { background: rgba(109,40,217,0.04); border-color: rgba(109,40,217,0.1); }
.ai-wiz-preview-avatar {
  width: 52px; height: 52px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 750; color: #fff; flex-shrink: 0;
  box-shadow: 0 6px 20px rgba(0,0,0,0.36); letter-spacing: -0.02em;
}
.ai-wiz-preview-tag {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px; font-size: 10px; letter-spacing: 0.07em;
  background: rgba(16,185,129,0.12); color: #34d399;
  border: 1px solid rgba(16,185,129,0.22); margin-bottom: 10px;
}
html[data-theme="light"] .ai-wiz-preview-tag { background: rgba(5,150,105,0.08); color: #059669; border-color: rgba(5,150,105,0.2); }

/* ── Sistema de producción visual en ficha de cliente ── */
.client-visual-system {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 14px;
  margin-top: 4px;
}
.client-vr-row { margin-bottom: 12px; }
.client-vr-label {
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 6px;
}
.client-vr-text {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-2);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 8px 10px;
}
.client-tag-brand {
  background: rgba(139,92,246,0.12);
  color: #c4b5fd;
  border: 1px solid rgba(139,92,246,0.25);
}
.client-tag-ig {
  background: rgba(236,72,153,0.10);
  color: #f9a8d4;
  border: 1px solid rgba(236,72,153,0.22);
  text-decoration: none;
  cursor: pointer;
}
.client-tag-ig:hover { background: rgba(236,72,153,0.20); color: #fce7f3; }

/* ══════════════════════════════════════════════════════════════════
   LIGHT MODE — Panel izquierdo, generadores, drawers, animaciones
   Todos los colores hardcodeados oscuros (#0F0F0F, #1F1F1F, #262626,
   rgba(255,255,255,...), rgba(0,0,0,...)) se neutralizan aquí.
   ══════════════════════════════════════════════════════════════════ */

/* Drawer panels y containers */
html[data-theme="light"] .drawer-panel,
html[data-theme="light"] .vault-sheet { background: rgba(252,251,255,0.98); border-color: rgba(109,40,217,0.10); }
html[data-theme="light"] .leftrail { background: rgba(248,246,255,0.96); border-right-color: rgba(109,40,217,0.12); }
html[data-theme="light"] .rail-btn { color: var(--text-2); }
html[data-theme="light"] .rail-btn:hover { background: rgba(109,40,217,0.08); color: #6D28D9; }
html[data-theme="light"] .rail-btn.is-active { background: rgba(109,40,217,0.12); color: #6D28D9; }
html[data-theme="light"] .rail-badge { background: #6D28D9; }

/* Template cards */
html[data-theme="light"] .tpl-card { border-color: rgba(109,40,217,0.15); }
html[data-theme="light"] .tpl-card:hover { border-color: rgba(109,40,217,0.4); background: rgba(109,40,217,0.04); }
html[data-theme="light"] .tpl-title { color: var(--text-1); }

/* Nodes canvas actions */
html[data-theme="light"] .nodes-action-btn { background: rgba(109,40,217,0.05); border-color: rgba(109,40,217,0.15); color: #4B3F72; }
html[data-theme="light"] .nodes-action-btn:hover { background: rgba(109,40,217,0.09); border-color: rgba(109,40,217,0.3); }
html[data-theme="light"] .nodes-action-new:hover { background: rgba(109,40,217,0.12); }
html[data-theme="light"] .drawer-section-label { color: var(--text-3); }

/* Node add card glow — radial visible en light */
html[data-theme="light"] .node-add-card::before {
  background: radial-gradient(120% 100% at 0% 0%, color-mix(in srgb, var(--add-c) 12%, transparent), transparent 55%);
}
html[data-theme="light"] .node-add-title { color: var(--text-1); }
html[data-theme="light"] .node-add-hint { color: var(--text-3); }
html[data-theme="light"] .node-add-plus { background: color-mix(in srgb, var(--add-c) 12%, transparent); }

/* Saved templates */
html[data-theme="light"] .saved-tpl-card { background: rgba(255,255,255,0.8); border-color: rgba(109,40,217,0.12); box-shadow: 0 1px 4px rgba(109,40,217,0.06); }
html[data-theme="light"] .saved-tpl-main:hover { background: rgba(109,40,217,0.04); }
html[data-theme="light"] .saved-tpl-name { color: var(--text-1); }
html[data-theme="light"] .saved-tpl-info { color: var(--text-3); }
html[data-theme="light"] .saved-tpl-load { color: #6D28D9; }
html[data-theme="light"] .tpl-empty { color: var(--text-3); }

/* Canvas actions row */
html[data-theme="light"] .nodes-canvas-actions { border-bottom-color: rgba(109,40,217,0.08); }

/* Moodboard vault en light */
html[data-theme="light"] .vault-sheet { background: rgba(252,251,255,0.99); }
html[data-theme="light"] .vlt-mb-card { background: rgba(255,255,255,0.85); border-color: rgba(109,40,217,0.12); }
html[data-theme="light"] .vlt-mb-card:hover { border-color: rgba(109,40,217,0.3); box-shadow: 0 4px 14px rgba(109,40,217,0.1); }
html[data-theme="light"] .vlt-mb-name { color: var(--text-1); }
html[data-theme="light"] .vlt3-status-pill { background: rgba(109,40,217,0.07); color: #6D28D9; }
html[data-theme="light"] .vlt-masonry-item { box-shadow: 0 1px 4px rgba(109,40,217,0.08); }

/* Agent ficha y panel */
html[data-theme="light"] .agent-ficha { background: rgba(109,40,217,0.03); border-color: rgba(109,40,217,0.10); }
html[data-theme="light"] .ficha-label { color: var(--text-3); }
html[data-theme="light"] .ficha-val { color: var(--text-1); }
html[data-theme="light"] .ficha-edit-btn { border-color: rgba(109,40,217,0.18); color: #6D28D9; }
html[data-theme="light"] .ficha-edit-btn:hover { background: rgba(109,40,217,0.07); }

/* Client cards y modal */
html[data-theme="light"] .client-row { border-bottom-color: rgba(109,40,217,0.07); }
html[data-theme="light"] .client-row:hover { background: rgba(109,40,217,0.04); }

/* ── Wizard: contador + inputs ── */
.ai-wiz-counter {
  font-size: 11px; letter-spacing: 0.1em;
  color: #A78BFA;
  background: rgba(167,139,250,0.10);
  padding: 4px 10px; border-radius: 20px;
  border: 1px solid rgba(167,139,250,0.2);
}
html[data-theme="light"] .ai-wiz-counter { background: rgba(109,40,217,0.07); color: #6D28D9; border-color: rgba(109,40,217,0.2); }
.ai-wiz-form-group { margin-top: 14px; }
.ai-wiz-text-input,
.ai-wiz-textarea-input {
  width: 100%; box-sizing: border-box;
  padding: 13px 16px; border-radius: 14px;
  border: 1.5px solid rgba(167,139,250,0.22);
  background: rgba(255,255,255,0.04);
  color: var(--text-1, #F0F2F7);
  font-family: inherit; font-size: 14px; line-height: 1.5;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.ai-wiz-text-input::placeholder,
.ai-wiz-textarea-input::placeholder { color: rgba(255,255,255,0.28); }
.ai-wiz-text-input:focus,
.ai-wiz-textarea-input:focus {
  outline: none; border-color: #A78BFA;
  background: rgba(167,139,250,0.07);
  box-shadow: 0 0 0 4px rgba(167,139,250,0.1);
}
.ai-wiz-textarea-input { resize: vertical; min-height: 100px; }
html[data-theme="light"] .ai-wiz-text-input,
html[data-theme="light"] .ai-wiz-textarea-input {
  background: rgba(109,40,217,0.03); color: #1A1523;
  border-color: rgba(109,40,217,0.2);
}
html[data-theme="light"] .ai-wiz-text-input:focus,
html[data-theme="light"] .ai-wiz-textarea-input:focus {
  background: rgba(109,40,217,0.05); border-color: #6D28D9;
  box-shadow: 0 0 0 4px rgba(109,40,217,0.08);
}
html[data-theme="light"] .ai-wiz-text-input::placeholder,
html[data-theme="light"] .ai-wiz-textarea-input::placeholder { color: #9CA3AF; }
/* field-label y node-input en preview — light mode */
html[data-theme="light"] .ai-wiz-preview-body .field-label { color: #4B3F72; }
html[data-theme="light"] .ai-wiz-preview-body .node-input,
html[data-theme="light"] .ai-wiz-preview-body .node-textarea {
  background: rgba(109,40,217,0.035); color: #1A1523;
  border-color: rgba(109,40,217,0.18);
}
html[data-theme="light"] .ai-wiz-preview-body .node-input::placeholder,
html[data-theme="light"] .ai-wiz-preview-body .node-textarea::placeholder { color: #9CA3AF; }

/* ═══════════════════════════════════════════════════
   LIGHT MODE — sombras violeta controladas
   ═══════════════════════════════════════════════════ */
html[data-theme="light"] .agent-card { box-shadow: 0 1px 6px rgba(109,40,217,0.07); }
html[data-theme="light"] .agent-card:hover { box-shadow: 0 4px 16px rgba(109,40,217,0.10); }
html[data-theme="light"] .agent-chip { box-shadow: none; border-color: rgba(109,40,217,0.18); }
html[data-theme="light"] .agent-chip.is-open { border-color: rgba(109,40,217,0.4); box-shadow: 0 0 0 3px rgba(109,40,217,0.07); }
html[data-theme="light"] .agent-dropdown { background: rgba(255,255,255,0.97); border-color: rgba(109,40,217,0.14); box-shadow: 0 8px 32px rgba(109,40,217,0.10); }
html[data-theme="light"] .agent-option:hover { background: rgba(109,40,217,0.05); }
html[data-theme="light"] .agent-option.is-active { background: rgba(109,40,217,0.08); }
html[data-theme="light"] .agent-option-check { background: #6D28D9; }
html[data-theme="light"] .agent-tag { background: rgba(109,40,217,0.07); color: #6D28D9; border-color: rgba(109,40,217,0.18); box-shadow: none; }
html[data-theme="light"] .leftrail { background: rgba(248,246,255,0.95); border-right-color: rgba(109,40,217,0.12); }
html[data-theme="light"] .drawer-panel { background: rgba(252,251,255,0.97); border-right-color: rgba(109,40,217,0.10); }
html[data-theme="light"] .drawer-header { border-bottom-color: rgba(109,40,217,0.09); }
html[data-theme="light"] .agents-btn-ai { background: rgba(109,40,217,0.08); color: #6D28D9; border-color: rgba(109,40,217,0.22); box-shadow: none; }
html[data-theme="light"] .agents-btn-ai:hover { background: rgba(109,40,217,0.14); box-shadow: 0 2px 10px rgba(109,40,217,0.12); }
html[data-theme="light"] .agents-btn-new { background: rgba(109,40,217,0.05); border-color: rgba(109,40,217,0.16); color: #4B3F72; }
html[data-theme="light"] .agents-btn-new:hover { background: rgba(109,40,217,0.09); }
html[data-theme="light"] .ai-wiz-opt-check { background: #6D28D9; box-shadow: 0 2px 6px rgba(109,40,217,0.25); }
html[data-theme="light"] .ai-wiz-nav-next { box-shadow: 0 4px 16px rgba(109,40,217,0.28); }
html[data-theme="light"] .ai-wiz-nav-next:hover { box-shadow: 0 6px 22px rgba(109,40,217,0.36); }
html[data-theme="light"] .ai-wiz-text-input:focus,
html[data-theme="light"] .ai-wiz-textarea-input:focus { box-shadow: 0 0 0 3px rgba(109,40,217,0.09); }
html[data-theme="light"] .agent-form-avatar { box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

/* ── NewAgentPopup + forms en light mode ── */
/* Los estilos inline del popup usan var(--text-1) que en light es oscuro — OK.
   Pero el wrapper .ai-wiz-modal en light ya tiene bg blanco (via leftmenu.css).
   Lo que falla: .field-label con color heredado invisible y hover states oscuros. */
html[data-theme="light"] .form-popup-backdrop { background: rgba(26,21,35,0.55); }
/* field-label texto visible en light */
html[data-theme="light"] .field-label { color: #4B3F72; }
/* form-section labels en light */
html[data-theme="light"] .agent-form-section-label { color: #6D28D9; opacity: 1; }
/* form-input en light */
html[data-theme="light"] .form-input {
  background: rgba(109,40,217,0.035); color: #1A1523;
  border-color: rgba(109,40,217,0.18);
}
html[data-theme="light"] .form-input:focus {
  border-color: #6D28D9; box-shadow: 0 0 0 3px rgba(109,40,217,0.08);
}
html[data-theme="light"] .form-input::placeholder { color: #9CA3AF; }
/* form-stage fondo */
html[data-theme="light"] .form-stage { background: transparent; }
html[data-theme="light"] .form-section { border-color: rgba(109,40,217,0.08); }
html[data-theme="light"] .form-popup { background: rgba(252,251,255,0.98); border-color: rgba(109,40,217,0.12); }
html[data-theme="light"] .form-popup-head { border-bottom-color: rgba(109,40,217,0.09); }
html[data-theme="light"] .form-popup-title { color: #1A1523; }
html[data-theme="light"] .form-popup-kicker { color: #6D28D9; }
/* agent-form-btn-save en light */
html[data-theme="light"] .agent-form-btn-save { box-shadow: 0 4px 14px rgba(109,40,217,0.3); }
html[data-theme="light"] .agent-form-btn-cancel { background: rgba(109,40,217,0.05); border-color: rgba(109,40,217,0.15); color: #4B3F72; }
html[data-theme="light"] .agent-form-btn-cancel:hover { background: rgba(109,40,217,0.09); }
/* Topbar color picker circle (box-shadow de selección en light) */
html[data-theme="light"] .ai-wiz-topbar .agent-form-avatar { box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
/* Progress bar en light */
html[data-theme="light"] .ai-wiz-progress-fill { box-shadow: 0 0 8px rgba(109,40,217,0.4); }
/* Avatar preset grid en light */
html[data-theme="light"] .ai-wiz-question-wrap button[title^="Avatar"] {
  box-shadow: 0 0 0 1px rgba(109,40,217,0.12);
}