@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-primary: #08070d;
  --bg-secondary: #110e1c;
  --bg-tertiary: #191629;
  --glass-bg: rgba(17, 14, 28, 0.65);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-border-focus: rgba(99, 102, 241, 0.4);
  
  --accent-primary: #6366f1; /* Indigo */
  --accent-secondary: #a855f7; /* Violet */
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --sidebar-width: 260px;
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 20px;
  --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  color-scheme: dark;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.1) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(8, 7, 13, 1) 0px, rgba(8, 7, 13, 0.8) 100%);
  background-attachment: fixed;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* App Container Layout */
.app-container {
  display: flex;
  width: 100vw;
  min-height: 100vh;
  position: relative;
}

/* Sidebar Styling */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(13, 10, 22, 0.85);
  border-right: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  padding: 24px;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--glass-border);
}

.logo-icon {
  background: var(--accent-gradient);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  font-family: var(--font-display);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.logo-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  list-style: none;
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-item button {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  padding: 14px 16px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.nav-item button:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.nav-item.active button {
  background: rgba(99, 102, 241, 0.15);
  color: #fff;
  box-shadow: inset 0 0 0 1px var(--glass-border-focus);
}

.nav-item button svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  transition: var(--transition-smooth);
}

.nav-item.active button svg {
  stroke: var(--accent-primary);
  filter: drop-shadow(0 0 5px rgba(99, 102, 241, 0.5));
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.git-status {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.git-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.git-indicator.syncing {
  background: var(--warning);
  box-shadow: 0 0 8px var(--warning);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

/* Main Content Panel */
.main-content {
  margin-left: var(--sidebar-width);
  flex-grow: 1;
  min-height: 100vh;
  padding: 40px;
  /* Idea #5: sin #offlineModeBar fija — padding normal */
  padding-top: 40px;
  max-width: 1400px;
}

/* UX-1 — context bar + hub subnav */
.studio-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: var(--border-radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
}

.active-persona-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.active-persona-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
}

.active-persona-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: min(280px, 55vw);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.12);
  color: #fff;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.active-persona-btn:hover {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(52, 211, 153, 0.2);
}

#activePersonaChipName {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-persona-caret {
  opacity: 0.7;
  font-size: 11px;
}

.active-persona-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  min-width: 220px;
  max-width: 320px;
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 10px;
  background: #15121f;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
}

.active-persona-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
}

.active-persona-option:hover,
.active-persona-option.is-active {
  background: rgba(52, 211, 153, 0.15);
}

.active-persona-empty {
  padding: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.active-context-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.2);
  padding: 12px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--glass-border);
}

.active-context-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.studio-context-copy {
  background: rgba(52, 211, 153, 0.28) !important;
  border: 1px solid rgba(52, 211, 153, 0.55) !important;
  color: #fff !important;
  white-space: nowrap;
}

.studio-context-copy.is-copied,
.btn.is-copied {
  background: rgba(52, 211, 153, 0.4) !important;
  border-color: rgba(110, 231, 183, 0.75) !important;
  color: #a7f3d0 !important;
}

.studio-context-copy:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hub-subnav {
  margin: 0 0 20px;
  padding: 4px;
  border-radius: var(--border-radius-md);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
}

.hub-subnav-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.hub-subnav-inner[hidden] {
  display: none !important;
}

.hub-subnav-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.hub-subnav-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.hub-subnav-btn.active {
  color: #fff;
  background: rgba(99, 102, 241, 0.35);
  border: 1px solid rgba(99, 102, 241, 0.45);
}

@media (max-width: 768px) {
  .studio-context-bar {
    margin-top: 4px;
  }
  .active-persona-label {
    display: none;
  }
}

/* UX-2 — Persona Engine 3 pasos */
.persona-stepper {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 10px;
  padding: 6px;
  border-radius: var(--border-radius-md);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--glass-border);
}

.persona-step-btn {
  flex: 1;
  min-width: 120px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.persona-step-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.persona-step-btn.is-active {
  color: #fff;
  background: rgba(52, 211, 153, 0.18);
  border-color: rgba(52, 211, 153, 0.45);
}

.persona-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.08);
}

.persona-step-btn.is-active .persona-step-num {
  background: rgba(52, 211, 153, 0.45);
}

.persona-step-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 18px;
  line-height: 1.4;
}

.persona-step-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
}

.persona-identity-details {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.persona-identity-details > summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.persona-advanced-block > summary {
  list-style: none;
}

#persona-engine[data-active-step="1"] [data-persona-step="2"],
#persona-engine[data-active-step="1"] [data-persona-step="3"],
#persona-engine[data-active-step="2"] [data-persona-step="1"],
#persona-engine[data-active-step="2"] [data-persona-step="3"],
#persona-engine[data-active-step="3"] [data-persona-step="1"],
#persona-engine[data-active-step="3"] [data-persona-step="2"] {
  display: none !important;
}

/* Editor layout visible en pasos 1–2; dentro, form vs sheet por data-step */
#persona-engine[data-active-step="3"] [data-persona-step="1-2"] {
  display: none !important;
}

#persona-engine[data-active-step="1"] .pack-library-card,
#persona-engine[data-active-step="1"] #personaProfileSheet {
  display: none !important;
}

#persona-engine[data-active-step="2"] #personaForm {
  display: none !important;
}

/* Identidad — hint Latina + tez clara + score inline (idea #2) */
.identity-lock-hint {
  display: none;
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.1);
}
#persona-engine[data-active-step="1"] .identity-lock-hint:not([hidden]) {
  display: block;
}
.identity-lock-hint-text {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.45;
  color: #fde68a;
}
.lock-health-inline {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
  color: var(--text-secondary);
  white-space: nowrap;
}
.lock-health-inline.lock-solid {
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
}
.lock-health-inline.lock-ok {
  border-color: rgba(251, 191, 36, 0.4);
  color: #fde68a;
}
.lock-health-inline.lock-weak {
  border-color: rgba(248, 113, 113, 0.45);
  color: #fca5a5;
}

/* Paso 2 · modo «primer JSON»: solo ficha mínima + Copiar JSON */
.persona-step2-focus-banner {
  display: none;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.1);
}
.persona-step2-focus-lead {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}
.persona-step2-focus-lead strong {
  color: #6ee7b7;
}
#persona-engine[data-step2-focus="1"][data-active-step="2"] .persona-step2-focus-banner {
  display: block;
}
#persona-engine[data-step2-focus="1"][data-active-step="2"] #personaStep2FocusBanner {
  display: block;
}
#persona-engine[data-step2-focus="1"][data-active-step="2"] [data-step2-secondary] {
  display: none !important;
}
#persona-engine[data-step2-focus="1"][data-active-step="2"] #btnOpenImportModal {
  display: none !important;
}
#persona-engine[data-step2-focus="1"][data-active-step="2"] .editor-layout {
  grid-template-columns: 1fr;
}
#persona-engine[data-step2-focus="1"][data-active-step="2"] .persona-step-hint {
  color: #6ee7b7;
}

/* Paso 1 con formulario abierto: foco en Identidad (sin muro Crear + Biblia) */
#persona-engine[data-active-step="1"][data-form-open="1"] #personaCreateOptionsCard,
#persona-engine[data-active-step="1"][data-form-open="1"] #nichePresetsBar {
  display: none !important;
}

#persona-engine[data-form-open="1"][data-creating="1"] [data-persona-edit-only] {
  display: none !important;
}

/* Compactar crear: cabecera/título menos ruido; banner corto */
#persona-engine[data-form-open="1"] .content-header .content-title p,
#persona-engine[data-form-open="1"] #editorHeaderTitle {
  display: none !important;
}
#persona-engine[data-form-open="1"] #createModeBanner {
  padding: 6px 10px !important;
  font-size: 11px !important;
  margin-bottom: 8px !important;
}
#persona-engine[data-form-open="1"] #personaForm > .glass-card {
  padding: 10px 12px !important;
  margin-top: 8px !important;
}
#persona-engine[data-form-open="1"][data-creating="1"] #personaIdentityGenDetails {
  display: none !important;
}

.persona-advanced-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.persona-advanced-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 8px;
  font-family: var(--font-display);
}

/* Avanzado: oculto en el flujo principal salvo details abiertas por el usuario en paso 2 */
#persona-engine[data-active-step="1"] [data-persona-step="advanced"],
#persona-engine[data-active-step="3"] [data-persona-step="advanced"] {
  display: none !important;
}

@media (max-width: 768px) {
  .persona-step-label {
    font-size: 12px;
  }
  .persona-step-btn {
    min-width: 0;
    padding: 8px 6px;
  }
}

/* Header */
.content-header {
  margin-bottom: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.content-title h1 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.content-title p {
  color: var(--text-secondary);
  font-size: 15px;
}

/* Glass Card */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  padding: 28px;
  margin-bottom: 28px;
  transition: var(--transition-smooth);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.09);
}

/* Tab Panel Switcher */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

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

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 28px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 20px;
}

.stat-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
}

.stat-card:hover .stat-icon {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
  transition: var(--transition-smooth);
}

.stat-info h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.stat-info p {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
}

/* Acciones rápidas — crear influencer desde el Portafolio */
.quick-create-steps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  font-size: 11px;
  color: var(--text-muted);
}
.quick-create-steps li {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}
.quick-create-steps li.is-active {
  color: #ecfdf5;
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.18);
  font-weight: 700;
}
.quick-create-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

/* Job router — Portafolio */
.job-router-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.job-router-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-smooth);
}
.job-router-btn:hover,
.job-router-btn:focus-visible {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.1);
  outline: none;
}
.job-router-btn-icon {
  font-size: 20px;
  line-height: 1;
}
.job-router-btn-label {
  font-size: 14px;
  font-weight: 600;
}
.job-router-btn-hint {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

.path-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #6ee7b7;
  font-weight: 600;
}
.path-kicker-optin {
  color: #fbbf24;
}

/* Pack PPV / explícito — discovery opt-in (no Camino A) */
.explicit-pack-discovery-card {
  border: 1px dashed rgba(251, 191, 36, 0.35);
}
.explicit-pack-discovery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.explicit-pack-discovery-ficha {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px dashed rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.05);
}
.explicit-pack-discovery-ficha summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 2px 0;
}

/* Work mode — Camino A chatbots (default) vs Camino B NVIDIA local */
.work-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.work-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-smooth);
}
.work-mode-btn:hover,
.work-mode-btn:focus-visible {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.1);
  outline: none;
}
.work-mode-btn.is-active {
  border-color: rgba(16, 185, 129, 0.55);
  background: rgba(16, 185, 129, 0.14);
}
.work-mode-btn-icon {
  font-size: 20px;
  line-height: 1;
}
.work-mode-btn-label {
  font-size: 14px;
  font-weight: 600;
}
.work-mode-btn-hint {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}
html:not([data-work-mode="nvidia"]) [data-nvidia-only] {
  display: none !important;
}

@media (max-width: 720px) {
  .work-mode-grid {
    grid-template-columns: 1fr;
  }
}

.quick-create-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-smooth);
}
.quick-create-btn:hover,
.quick-create-btn:focus-visible {
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(99, 102, 241, 0.12);
  outline: none;
}
.quick-create-btn-icon {
  font-size: 20px;
  line-height: 1;
}
.quick-create-btn-label {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.quick-create-btn-hint {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}
.import-origin-block.is-origin-focus {
  outline: 1px solid rgba(16, 185, 129, 0.45);
  outline-offset: 4px;
  border-radius: 10px;
}
.import-origin-block.is-origin-muted {
  opacity: 0.55;
}
.import-json-review textarea {
  min-height: 120px;
}
@media (max-width: 768px) {
  .job-router-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .quick-create-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 480px) {
  .job-router-grid {
    grid-template-columns: 1fr;
  }
}

/* Persona Editor Workspace */
.editor-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
}

@media (max-width: 1024px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }
}

.editor-form-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type="text"], select, textarea {
  width: 100%;
  background: rgba(8, 7, 13, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 12px 16px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: var(--transition-smooth);
}

input[type="text"]:focus, select:focus, textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
  background: rgba(8, 7, 13, 0.8);
}

select {
  cursor: pointer;
}

select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* JSON Editor & Preview Panel */
.json-preview-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 450px;
}

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

.panel-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-primary);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.json-editor {
  flex-grow: 1;
  background: #06050b;
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  color: #a78bfa;
  resize: none;
  outline: none;
  overflow-y: auto;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.8);
}

/* Persona Gallery / Grid */
.persona-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.persona-card {
  position: relative;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  aspect-ratio: 4 / 5;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.persona-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.persona-card:hover img {
  transform: scale(1.05);
}

.persona-card::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(8, 7, 13, 0.9) 0%, rgba(8, 7, 13, 0.2) 60%, transparent 100%);
  z-index: 1;
}

.persona-card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 16px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.persona-card-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.persona-card-tag {
  font-size: 11px;
  color: var(--text-secondary);
}

.persona-card.selected {
  border-color: var(--accent-primary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.persona-card.selected::before {
  content: '✓';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  z-index: 3;
}

/* Buttons */
.btn {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  outline: none;
  padding: 12px 24px;
  border-radius: var(--border-radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

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

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  box-shadow: none;
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: none;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: var(--border-radius-sm);
}

/* Prompt Console / Preview */
.prompt-console {
  background: rgba(8, 7, 13, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 16px;
  margin-top: 24px;
}

.prompt-text {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Script Panel Grid */
.script-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
}

@media (max-width: 900px) {
  .script-layout {
    grid-template-columns: 1fr;
  }
}

.script-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 600px;
  overflow-y: auto;
  padding-right: 8px;
}

.script-tab-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: left;
}

.script-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.script-tab-btn.active {
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.4);
  color: #fff;
  box-shadow: inset 0 0 10px rgba(168, 85, 247, 0.1);
}

.script-tab-btn .angle-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.script-tab-btn.active .angle-name {
  color: var(--accent-secondary);
}

.script-tab-btn .angle-hook {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.script-viewer {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.script-header-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 16px;
}

.script-angle-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}

.script-content-box {
  background: rgba(6, 5, 11, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 24px;
}

.script-section {
  margin-bottom: 20px;
}

.script-section:last-child {
  margin-bottom: 0;
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-label.demo { color: var(--accent-secondary); }
.section-label.turn { color: #f59e0b; }
.section-label.cta { color: var(--success); }

.section-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
}

.section-cue {
  font-size: 12px;
  font-style: italic;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* UGC Creator / Social Mockup */
.studio-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: start;
}

@media (max-width: 900px) {
  .studio-layout {
    grid-template-columns: 1fr;
  }
}

.social-mockup-wrapper {
  display: flex;
  justify-content: center;
}

.phone-mockup {
  width: 320px;
  height: 568px; /* 16:9 aspect ratio */
  border-radius: 36px;
  border: 8px solid #1e1b2e;
  background: #000;
  position: relative;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.phone-screen {
  width: 100%;
  height: 100%;
  position: relative;
}

.mockup-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Watermark & Disclosures on Video */
.compliance-watermark {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: none;
  z-index: 10;
}

.compliance-watermark.active {
  display: block;
}

.mockup-overlay-left {
  position: absolute;
  bottom: 24px;
  left: 16px;
  right: 64px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mockup-creator-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.creator-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #fff;
  object-fit: cover;
}

.creator-handle {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.mockup-caption {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.4;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.mockup-disclosure-tag {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  display: inline-block;
  margin-top: 4px;
  color: #fff;
}

.mockup-overlay-right {
  position: absolute;
  bottom: 24px;
  right: 12px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: #fff;
}

.mockup-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  cursor: pointer;
}

.mockup-action-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Pitch Builder & Licensing Calculator */
.pricing-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
}

@media (max-width: 900px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

.licensing-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-smooth);
}

.licensing-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--glass-border-focus);
}

.licensing-info h4 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.licensing-info p {
  font-size: 12px;
  color: var(--text-secondary);
}

.licensing-price {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-primary);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.licensing-price .price-multiplier {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-body);
  text-transform: uppercase;
}

.pitch-preview {
  background: linear-gradient(135deg, rgba(30, 27, 46, 0.9) 0%, rgba(13, 10, 22, 0.95) 100%);
  border: 1px solid var(--glass-border-focus);
  border-radius: var(--border-radius-lg);
  padding: 32px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
}

.pitch-preview::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--accent-gradient);
}

.pitch-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 16px;
}

.pitch-badge {
  background: var(--accent-gradient);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.pitch-invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

.pitch-invoice-table th, .pitch-invoice-table td {
  padding: 12px 0;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.pitch-invoice-table th {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.pitch-invoice-table td {
  font-size: 14px;
}

.pitch-invoice-table tr:last-child td {
  border-bottom: none;
}

.pitch-total-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--glass-border);
  padding-top: 16px;
  margin-bottom: 24px;
}

.pitch-total-label {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}

.pitch-total-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 800;
  color: var(--success);
}

/* Compliance Panel toggles */
.compliance-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.toggle-switch-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  padding: 14px 18px;
  border-radius: var(--border-radius-md);
  transition: var(--transition-smooth);
}

.toggle-switch-wrapper:hover {
  background: rgba(255, 255, 255, 0.04);
}

.toggle-info h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.toggle-info p {
  font-size: 11px;
  color: var(--text-secondary);
}

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-tertiary);
  transition: .4s;
  border-radius: 34px;
  border: 1px solid var(--glass-border);
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-primary);
  border-color: transparent;
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* Unified feedback toast (success / error / info / loading) — visible ≥3s on mutations */
.sync-banner,
.app-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: min(420px, calc(100vw - 32px));
  background: rgba(16, 185, 129, 0.95);
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--border-radius-md);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  transform: translateY(150%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.25s ease;
  z-index: 4000;
}

.sync-banner.show,
.app-toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.sync-banner.error,
.app-toast.type-error {
  background: rgba(239, 68, 68, 0.96);
}

.sync-banner.type-info,
.app-toast.type-info {
  background: rgba(99, 102, 241, 0.96);
}

.sync-banner.type-loading,
.app-toast.type-loading {
  background: rgba(30, 41, 59, 0.96);
  border-color: rgba(148, 163, 184, 0.35);
}

.sync-banner.type-success,
.app-toast.type-success {
  background: rgba(16, 185, 129, 0.96);
}

.sync-banner svg,
.app-toast svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.app-toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-toast-icon .toast-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: toast-spin 0.7s linear infinite;
}

@keyframes toast-spin {
  to { transform: rotate(360deg); }
}

#syncBannerText {
  flex: 1;
  word-break: break-word;
}

/* ===== PHOTO UPLOAD & ANALYSIS PANEL ===== */

.upload-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 1024px) {
  .upload-section {
    grid-template-columns: 1fr;
  }
}

.upload-dropzone {
  border: 2px dashed rgba(99, 102, 241, 0.3);
  border-radius: var(--border-radius-lg);
  padding: 48px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  min-height: 320px;
  background: rgba(99, 102, 241, 0.03);
}

.upload-dropzone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(99, 102, 241, 0.06) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

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

.upload-dropzone:hover::before {
  opacity: 1;
}

.upload-dropzone.drag-over {
  border-color: var(--accent-secondary);
  background: rgba(168, 85, 247, 0.1);
  transform: scale(1.01);
  box-shadow: 0 0 30px rgba(168, 85, 247, 0.15);
}

.upload-dropzone.has-image {
  padding: 0;
  border-style: solid;
  border-color: var(--glass-border-focus);
}

.upload-icon-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.upload-dropzone:hover .upload-icon-circle {
  background: var(--accent-gradient);
  border-color: transparent;
  transform: scale(1.08);
  box-shadow: 0 5px 20px rgba(99, 102, 241, 0.35);
}

.upload-icon-circle svg {
  width: 28px;
  height: 28px;
  stroke: var(--accent-primary);
  fill: none;
  stroke-width: 2;
  transition: var(--transition-smooth);
}

.upload-dropzone:hover .upload-icon-circle svg {
  stroke: #fff;
}

.upload-text-main {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

.upload-text-sub {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 260px;
}

.upload-text-sub span {
  color: var(--accent-primary);
  font-weight: 600;
  cursor: pointer;
}

.upload-preview-img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  max-height: 480px;
  object-fit: cover;
  border-radius: calc(var(--border-radius-lg) - 2px);
}

.upload-preview-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(8, 7, 13, 0.95) 0%, rgba(8, 7, 13, 0.5) 60%, transparent 100%);
  padding: 24px 20px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.upload-preview-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.upload-preview-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
}

.upload-preview-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-change-photo {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 14px;
  border-radius: var(--border-radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-change-photo:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Analysis Panel */
.analysis-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.analysis-status-card {
  background: rgba(6, 5, 11, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.analysis-spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--bg-tertiary);
  border-top-color: var(--accent-primary);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.analysis-status-text h4 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.analysis-status-text p {
  font-size: 12px;
  color: var(--text-secondary);
}

.analysis-color-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 2px solid var(--glass-border);
  position: relative;
  cursor: default;
  transition: var(--transition-smooth);
}

.color-swatch:hover {
  transform: scale(1.15);
  border-color: #fff;
}

.color-swatch-label {
  font-size: 9px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 4px;
}

/* Analysis detail grid */
.analysis-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 700px) {
  .analysis-detail-grid {
    grid-template-columns: 1fr;
  }
}

.analysis-field {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: var(--transition-smooth);
}

.analysis-field:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.analysis-field-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.analysis-field-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.analysis-field.full-width {
  grid-column: 1 / -1;
}

/* Category headers in analysis */
.analysis-category {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 10px 0 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.analysis-category.identity { color: var(--accent-primary); }
.analysis-category.facial { color: #f472b6; }
.analysis-category.hair-cat { color: #fbbf24; }
.analysis-category.aesthetic { color: var(--accent-secondary); }
.analysis-category.photo { color: #34d399; }
.analysis-category.clothing-cat { color: #60a5fa; }

/* Editable fields in analysis */
.analysis-field input, .analysis-field select {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 4px 0;
  width: 100%;
  outline: none;
  transition: var(--transition-smooth);
}

.analysis-field input:focus, .analysis-field select:focus {
  border-bottom-color: var(--accent-primary);
}

.analysis-field select {
  cursor: pointer;
}

.analysis-field select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Animated reveal for analysis results */
.analysis-reveal {
  animation: slideUpFade 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
}

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

/* Staggered delay classes */
.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.2s; }
.delay-5 { animation-delay: 0.25s; }
.delay-6 { animation-delay: 0.3s; }
.delay-7 { animation-delay: 0.35s; }
.delay-8 { animation-delay: 0.4s; }

/* Full JSON output panel */
.analysis-json-output {
  background: #06050b;
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  color: #a78bfa;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.8);
}

.analysis-actions {
  display: flex;
  gap: 12px;
}

.analysis-actions .btn {
  flex: 1;
}

/* ===== MODAL OVERLAYS ===== */
.modal-overlay, .login-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 7, 13, 0.8);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease forwards;
}

.modal-card, .login-card {
  border: 1px solid var(--glass-border-focus);
  background: linear-gradient(135deg, rgba(30, 27, 46, 0.9) 0%, rgba(13, 10, 22, 0.95) 100%);
  animation: scaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.1) forwards;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ===== SETTINGS MODAL (tabs + scroll — evita muro de perfiles) ===== */
.settings-modal-overlay {
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 24px 12px;
}

.settings-card {
  width: 100%;
  max-width: 560px;
  max-height: min(88vh, 900px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 28px 28px 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  position: relative;
  margin: auto;
}

.settings-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  z-index: 2;
}

.settings-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-right: 28px;
  flex-shrink: 0;
}

.settings-tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(135deg, rgba(30, 27, 46, 0.98) 0%, rgba(13, 10, 22, 0.98) 100%);
}

.settings-tab {
  appearance: none;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.settings-tab:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.settings-tab.is-active {
  color: #fff;
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.15);
}

.settings-tab[hidden] {
  display: none !important;
}

.settings-panels {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.settings-panel[hidden] {
  display: none !important;
}

.settings-panel.is-active {
  display: block;
}

.settings-panel-divider {
  border: none;
  border-top: 1px solid var(--glass-border);
  margin: 20px 0;
}

.profiles-list-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.profiles-list-toolbar input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  outline: none;
}

.profiles-list-count {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.profiles-list-scroll,
.settings-scroll-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(42vh, 320px);
  overflow-y: auto;
  margin-bottom: 4px;
  padding-right: 2px;
}

.audit-log-list.settings-scroll-list {
  max-height: min(36vh, 280px);
}

/* ===== CAMPAIGNS ===== */
.campaign-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 18px 20px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.campaign-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--glass-border-focus);
  transform: translateY(-2px);
}

.campaign-card.active-campaign {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.4);
}

.campaign-card-info h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.campaign-card-info p {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ===== PROMPT GALLERY ===== */
.gallery-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  transition: var(--transition-smooth);
}

.gallery-card:hover {
  border-color: var(--glass-border-focus);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

.gallery-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-bottom: 1px solid var(--glass-border);
}

.gallery-card-content {
  padding: 16px;
}

.gallery-card-prompt {
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== VERSION TIMELINE ===== */
.version-timeline-item {
  display: flex;
  gap: 16px;
  position: relative;
  padding-left: 20px;
  border-left: 2px solid var(--glass-border);
}

.version-timeline-item::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 2px solid var(--bg-primary);
}

.version-timeline-content {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  padding: 12px 16px;
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.version-timeline-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* ===== PORTFOLIO / DASHBOARD STYLES ===== */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 16px;
}

.portfolio-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s, box-shadow 0.3s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.portfolio-card:hover {
  transform: translateY(-5px);
  border-color: var(--glass-border-focus);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(99, 102, 241, 0.1);
}

.portfolio-card.selected {
  border-color: var(--accent-primary);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.25);
  background: rgba(99, 102, 241, 0.03);
}

.portfolio-card.archived-style {
  opacity: 0.65;
}

.portfolio-card-img-wrapper {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 Aspect Ratio */
  overflow: hidden;
  border-bottom: 1px solid var(--glass-border);
}

.portfolio-card-img-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.portfolio-card:hover .portfolio-card-img-wrapper img {
  transform: scale(1.04);
}

.portfolio-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(8, 7, 13, 0.75);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  color: var(--text-primary);
}

.portfolio-badge.badge-style {
  background: rgba(99, 102, 241, 0.8);
  border-color: rgba(99, 102, 241, 0.3);
}

.portfolio-badge.badge-archived {
  left: auto;
  right: 12px;
  background: rgba(239, 68, 68, 0.85);
  border-color: rgba(239, 68, 68, 0.3);
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 0.5px;
}

.portfolio-badge.badge-chatbot-ok {
  left: auto;
  right: 12px;
  top: 44px;
  background: rgba(52, 211, 153, 0.9);
  border-color: rgba(52, 211, 153, 0.35);
  font-size: 9px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* W16 — export-ready badges (señal; no bloquean) */
.portfolio-badge.badge-export-ready,
.portfolio-badge.badge-lock-review,
.portfolio-badge.badge-no-anchor {
  left: 12px;
  top: 44px;
  right: auto;
  font-size: 9px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  appearance: none;
}

.portfolio-badge.badge-export-ready {
  background: rgba(52, 211, 153, 0.88);
  border-color: rgba(52, 211, 153, 0.4);
  color: #ecfdf5;
}

.portfolio-badge.badge-lock-review {
  background: rgba(239, 68, 68, 0.88);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fff;
}

.portfolio-badge.badge-no-anchor {
  background: rgba(245, 158, 11, 0.9);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fffbeb;
}

.portfolio-badge.badge-export-ready:hover,
.portfolio-badge.badge-lock-review:hover,
.portfolio-badge.badge-no-anchor:hover {
  filter: brightness(1.08);
}

/* Chatbot OK baja si hay badge export a la izquierda */
.portfolio-card-img-wrapper:has([data-export-status]) .badge-chatbot-ok {
  top: 72px;
}

#chatbotSessionModal .chatbot-session-row input {
  width: 16px;
  height: 16px;
  accent-color: #34d399;
}

.portfolio-card-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.portfolio-card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.portfolio-card-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.portfolio-card-gens {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-secondary);
  background: rgba(168, 85, 247, 0.08);
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid rgba(168, 85, 247, 0.15);
}

.portfolio-card-tag {
  font-size: 12px;
  color: var(--text-secondary);
}

.portfolio-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.portfolio-card-actions button {
  flex: 1 1 calc(50% - 6px);
  min-width: 96px;
  text-align: center;
  white-space: nowrap;
}

.portfolio-card-actions .btn-quick-copy-pack {
  background: rgba(52, 211, 153, 0.18);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #a7f3d0;
  font-weight: 600;
}

.portfolio-card-actions .btn-quick-packs {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
}

/* W13 — menú Packs en tarjeta de portafolio */
.portfolio-pack-menu {
  position: relative;
  flex: 1 1 calc(50% - 6px);
  min-width: 96px;
}

.portfolio-pack-menu .btn-quick-packs {
  width: 100%;
  font-size: 11px;
  padding: 6px 10px;
}

.portfolio-pack-menu-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border-radius: var(--border-radius-sm);
  background: rgba(12, 16, 24, 0.96);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.portfolio-pack-menu-list[hidden] {
  display: none !important;
}

.portfolio-pack-menu-list button {
  width: 100%;
  text-align: left;
  font-size: 11px;
  padding: 7px 8px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.portfolio-pack-menu-list button:hover {
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
}

.portfolio-last-pack {
  margin-top: 6px;
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.35;
  min-height: 1.2em;
}

.pack-last-status {
  min-height: 1.2em;
}

#btnRecopyLastPack:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Filter buttons styling */
.btn-filter {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
}

.btn-filter:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.btn-filter.active {
  background: var(--accent-primary);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

/* ===== G1: Constructor de prompt por chips (variantes estilo studio) ===== */
.pb-group { margin-bottom: 12px; }
.pb-group > label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 7px;
  font-weight: 700;
}
.pb-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pb-chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 5px 11px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  outline: none;
  line-height: 1.2;
}
.pb-chip:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); }
.pb-chip.active {
  background: var(--accent-primary);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.32);
}
.variant-mode-spicy .pb-chip.active {
  background: linear-gradient(135deg, #ef4444, #d946ef);
  box-shadow: 0 3px 10px rgba(239, 68, 68, 0.32);
}

/* ===== GENERATION HISTORY TIMELINE ===== */
.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.history-card {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 Aspect Ratio */
  border-radius: var(--border-radius-md);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-card:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: var(--glass-border-focus);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.history-card-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8, 7, 13, 0.95) 0%, rgba(8, 7, 13, 0.2) 60%, transparent 100%);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.history-card:hover .history-card-overlay {
  opacity: 1;
}

.history-type-badge {
  align-self: flex-start;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 8px;
  color: #fff;
  background: rgba(8, 7, 13, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.history-type-badge.badge-style {
  background: rgba(99, 102, 241, 0.85);
  border-color: rgba(99, 102, 241, 0.2);
}

.history-type-badge.badge-variant {
  background: rgba(168, 85, 247, 0.85);
  border-color: rgba(168, 85, 247, 0.2);
}

.history-type-badge.badge-ugc {
  background: rgba(245, 158, 11, 0.85);
  border-color: rgba(245, 158, 11, 0.2);
}

.history-card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-card-date {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}

.history-card-prompt {
  font-size: 11px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== HISTORY MODAL OVERLAY ===== */
.history-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 7, 13, 0.85);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  animation: fadeIn 0.25s ease forwards;
}

.history-modal-content {
  border: 1px solid var(--glass-border-focus);
  background: linear-gradient(135deg, rgba(30, 27, 46, 0.95) 0%, rgba(13, 10, 22, 0.98) 100%);
  border-radius: var(--border-radius-lg);
  max-width: 600px;
  width: 90%;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  animation: scaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.1) forwards;
}

.history-modal-content img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-bottom: 1px solid var(--glass-border);
}

.history-modal-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: rgba(8, 7, 13, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 24px;
  font-weight: 300;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s;
  z-index: 10;
}

.history-modal-close:hover {
  background: rgba(239, 68, 68, 0.8);
  border-color: transparent;
}

.history-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(13, 10, 22, 0.75);
  border: 1px solid var(--glass-border-focus);
  color: #fff;
  font-size: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 3010;
  user-select: none;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.history-nav-btn:hover {
  background: var(--accent-primary);
  border-color: transparent;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.6);
}

.history-nav-prev {
  left: 24px;
}

.history-nav-next {
  right: 24px;
}

/* ===== RIGHT PANEL TABBED WORKSPACE ===== */
.right-panel-tabbed-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 16px;
}

.right-panel-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 8px;
}

.panel-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.panel-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.panel-tab-btn.active {
  color: #fff;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.panel-tab-content {
  display: none;
}

.panel-tab-content.active {
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease;
}

/* Extra badge styling inside model recommendations */
.badge-variant {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-ugc {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Option Cards Hover Effect */
.option-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.option-card:hover {
  border-color: var(--glass-border-focus) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

/* Profile Image Container Hover Effect */
.profile-image-container {
  transition: all 0.3s ease;
}

.profile-image-container:hover {
  transform: scale(1.03);
  border-color: var(--accent-primary) !important;
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.25) !important;
}



/* ======= UX Polish & Spicy Theme ======= */

/* Spicy Theme Transition */
.variant-vault-layout {
  transition: all 0.4s ease-in-out;
}
.spicy-theme {
  background: radial-gradient(circle at center, rgba(147, 51, 234, 0.08) 0%, transparent 70%);
  border-radius: var(--border-radius-lg);
  box-shadow: inset 0 0 40px rgba(147, 51, 234, 0.05), 0 0 20px rgba(239, 68, 68, 0.1);
  padding: 10px;
}

/* Micro-interactions */
.glass-card, .btn {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.glass-card:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(1px);
}

/* Lightbox / History Modal */
.history-modal-overlay {
  display: flex; /* overridden by inline display:none when hidden */
  align-items: center;
  justify-content: center;
}
.history-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.history-modal-content img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--border-radius-md);
  box-shadow: 0 10px 40px rgba(0,0,0,0.7);
}
.history-nav-btn {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
}
.history-nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.1);
}
.history-nav-prev { left: 20px; }
.history-nav-next { right: 20px; }

/* Mobile Lightbox Adjustments */
@media (max-width: 768px) {
  .history-nav-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  .history-nav-prev { left: 10px; }
  .history-nav-next { right: 10px; }
  .history-modal-content img {
    max-height: 60vh;
  }
}

/* Loading state animation */
@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); border-color: rgba(99, 102, 241, 0.4); }
  50% { box-shadow: 0 0 15px 5px rgba(99, 102, 241, 0.6); border-color: rgba(99, 102, 241, 1); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); border-color: rgba(99, 102, 241, 0.4); }
}
.loading-pulse {
  animation: pulseGlow 2s infinite ease-in-out;
}

/* M2: Drag and Drop Import Dropzone & Thumbnail Strip */
.import-dropzone {
  border: 2px dashed var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 24px 16px;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

.import-dropzone:hover,
.import-dropzone.dragover,
.import-dropzone:focus,
.import-dropzone:focus-within {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}
.import-dropzone:focus {
  outline: 2px solid rgba(16, 185, 129, 0.65);
  outline-offset: 2px;
}
.import-file-input {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 10px auto 0;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}
.import-file-input:focus {
  outline: 2px solid rgba(16, 185, 129, 0.75);
  outline-offset: 3px;
  border-radius: 4px;
}

.import-dropzone-icon {
  font-size: 28px;
  margin-bottom: 8px;
  display: block;
}

.import-counter-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
}

.import-counter-badge.has-files {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
}

.import-counter-badge.full {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

.import-thumbnail-strip {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.import-thumb-card {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: #000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: transform 0.2s ease;
}

.import-thumb-card:hover {
  transform: scale(1.04);
}

.import-thumb-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.import-thumb-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(220, 53, 69, 0.9);
  color: #fff;
  border: none;
  font-size: 11px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.import-thumb-remove:hover {
  background: #dc3545;
  transform: scale(1.1);
}

.import-thumb-badge {
  position: absolute;
  bottom: 3px;
  left: 3px;
  background: rgba(99, 102, 241, 0.85);
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  text-transform: uppercase;
}

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

.shimmer-anim {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ====================================================
   MOBILE & TABLET RESPONSIVE ENGINE (< 768px)
   ==================================================== */

.mobile-header {
  display: none;
}
.mobile-sidebar-backdrop {
  display: none;
}
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  /* Prevent horizontal overflow */
  html, body, .app-container {
    overflow-x: hidden;
    max-width: 100vw;
  }

  body {
    padding-bottom: 64px; /* Space for bottom nav */
    padding-top: 56px;    /* mobile-header only (offline = chip en sidebar) */
  }

  /* Mobile Top Header Bar */
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--glass-border);
    padding: 0 16px;
    z-index: 1000;
    backdrop-filter: blur(10px);
  }

  .mobile-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
  }
  .mobile-menu-btn:active {
    background: rgba(255, 255, 255, 0.1);
  }

  .mobile-logo {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  /* Off-Canvas Sidebar Drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    z-index: 1010;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .mobile-sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1005;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .mobile-sidebar-backdrop.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  /* Main Content Layout Adjustments (UX-0b: no heredar margin-left del escritorio) */
  .main-content {
    margin-left: 0;
    padding: 16px;
    padding-top: 16px;
    width: 100%;
    max-width: 100%;
  }

  /* Fixed Bottom Navigation Bar */
  .mobile-bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(17, 14, 28, 0.95);
    border-top: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    z-index: 1000;
  }

  .mobile-nav-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 500;
    flex: 1;
    height: 100%;
    cursor: pointer;
    transition: color 0.2s ease;
  }

  .mobile-nav-item.active {
    color: var(--accent-primary);
  }

  .mobile-nav-item svg {
    stroke: currentColor;
  }

  /* Touch Targets & Form Inputs */
  input[type="text"],
  input[type="password"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important; /* Prevents auto-zoom on iOS Safari */
  }

  .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Persona Vault Grid on Mobile */
  .personas-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    gap: 12px !important;
  }

  /* UGC Studio Layout on Mobile */
  .studio-container {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* Bottom Sheet Modals on Mobile */
  .modal-content,
  .modal-dialog {
    width: 100% !important;
    max-width: 100% !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    margin: 0 !important;
    max-height: 90vh !important;
  }
}

/* ============================================
   F1 — Character lock health panel
   ============================================ */
.lock-health {
  margin-bottom: 10px;
}

.lock-health-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--border-radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 11px;
  cursor: pointer;
  text-align: left;
  transition: var(--transition-smooth);
}

.lock-health-head:hover {
  border-color: var(--glass-border-focus);
}

.lock-health-head.lock-solid {
  border-color: rgba(16, 185, 129, 0.35);
}

.lock-health-head.lock-ok {
  border-color: rgba(245, 158, 11, 0.35);
}

.lock-health-head.lock-weak {
  border-color: rgba(239, 68, 68, 0.4);
}

.lock-health-title strong {
  color: var(--text-primary);
}

.lock-health-dot {
  font-size: 8px;
  margin-right: 5px;
}

.lock-solid .lock-health-dot {
  color: var(--success);
}

.lock-ok .lock-health-dot {
  color: var(--warning);
}

.lock-weak .lock-health-dot {
  color: var(--danger);
}

.lock-health-count {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

.lock-health-caret {
  display: inline-block;
  transition: transform 0.2s ease;
}

.lock-health-head.open .lock-health-caret {
  transform: rotate(180deg);
}

.lock-health-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 8px 10px;
  border-radius: var(--border-radius-sm);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  max-height: 170px;
  overflow-y: auto;
}

.lock-issue {
  display: flex;
  gap: 8px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  padding: 3px 0;
}

.lock-issue-badge {
  flex: 0 0 14px;
  height: 14px;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.lock-issue-error .lock-issue-badge {
  background: rgba(239, 68, 68, 0.18);
  color: var(--danger);
}

.lock-issue-warning .lock-issue-badge {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.lock-issue-info .lock-issue-badge {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
}

.lock-issue-text em {
  color: var(--text-muted);
  font-style: normal;
}

/* ============================================
   W12 — Character lock revisions
   ============================================ */
.lock-revisions {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: var(--border-radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
}

.lock-revisions-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-primary);
}

.lock-revisions-hint {
  margin: 4px 0 8px;
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.4;
}

.lock-revisions-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.lock-revisions-empty {
  font-size: 10.5px;
  color: var(--text-muted);
  padding: 4px 0;
}

.lock-rev-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--border-radius-sm);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid transparent;
}

.lock-rev-row:hover {
  border-color: var(--glass-border);
}

.lock-rev-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 10px;
  color: var(--text-secondary);
  min-width: 0;
}

.lock-rev-when {
  color: var(--text-primary);
  font-weight: 600;
}

.lock-rev-source {
  text-transform: lowercase;
}

.lock-rev-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 3px;
}

.lock-rev-score {
  color: var(--text-muted);
}

.lock-rev-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.lock-rev-actions .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.lock-revision-diff {
  margin: 8px 0 0;
  padding: 8px 10px;
  max-height: 160px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  line-height: 1.45;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ============================================
   F6 — Happy path 60s checklist
   ============================================ */
.happy-path-progress {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 4px 10px;
}

.happy-path-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
}

.happy-path-step {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.02);
}

.happy-path-step.done {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.06);
}

.happy-path-check {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 2px;
}

.happy-path-step.done .happy-path-check {
  color: var(--success);
}

.happy-path-step strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.happy-path-step p {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0 0 10px;
  line-height: 1.4;
}

.happy-path-done {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--success);
}

/* ============================================
   F3 — Queue status chip
   ============================================ */
.queue-status-chip {
  display: none;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
  color: var(--text-primary);
  font-size: 11px;
}

.queue-status-chip.busy {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.1);
}

.queue-status-chip.cooling {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.1);
}

.queue-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
  flex-shrink: 0;
}

.queue-status-chip.busy .queue-status-dot {
  background: var(--accent-primary);
  animation: queuePulse 1.2s ease-in-out infinite;
}

.queue-status-chip.cooling .queue-status-dot {
  background: var(--danger);
}

/* Idea #5 — offline como chip (sidebar), no barra fija */
.offline-mode-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  user-select: none;
}

.offline-mode-chip input {
  margin: 0;
  accent-color: #94a3b8;
}

.offline-mode-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
  flex-shrink: 0;
}

.offline-mode-chip.is-on {
  border-color: rgba(148, 163, 184, 0.55);
  background: rgba(148, 163, 184, 0.16);
  color: var(--text-primary);
}

.offline-mode-chip.is-on .offline-mode-chip-dot {
  background: #94a3b8;
}

.sidebar-studio-tools {
  width: 100%;
  margin-top: 4px;
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  background: rgba(0, 0, 0, 0.2);
  padding: 0 8px 8px;
}

.sidebar-studio-tools > summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 4px;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}

.sidebar-studio-tools > summary::-webkit-details-marker {
  display: none;
}

.sidebar-studio-tools[open] > summary {
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 8px;
}

.sidebar-studio-tools .git-status {
  margin-bottom: 8px;
}

.pin-default-settings-hint {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.1);
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.45;
}

.pin-default-settings-hint code {
  font-family: var(--font-mono);
  font-size: 11px;
}

@keyframes queuePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

button.is-queue-locked,
button.is-queue-locked:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Seguridad / perfiles */
.pin-default-banner {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  z-index: 90;
  display: none;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: rgba(245, 158, 11, 0.12);
  border-bottom: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--text-primary);
  font-size: 12px;
}

.pin-default-banner code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--warning);
}

.active-profile-chip {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 11px;
  color: var(--text-secondary);
}

.active-profile-chip strong {
  color: var(--text-primary);
}

.profile-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.2);
}

.profile-row.is-current {
  border-color: rgba(16, 185, 129, 0.35);
}

.profile-meta {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.profile-row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.profile-current-tag {
  font-size: 10px;
  color: var(--success);
  align-self: center;
}

.member-empty-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.member-empty-banner strong {
  color: #fff;
}

.member-empty-banner-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 200px;
}

/* W14 — empty roster + next CTA */
.empty-roster-panel {
  grid-column: 1 / -1;
  text-align: center;
  padding: 36px 24px;
  border-radius: var(--border-radius-md);
  border: 1px dashed rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.05);
}

.empty-roster-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 20px;
  color: #fff;
}

.empty-roster-lead {
  margin: 0 auto 18px;
  max-width: 420px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.empty-roster-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.happy-path-next-cta {
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.08);
}

.happy-path-next-label {
  margin: 0 0 4px;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #34d399;
}

.happy-path-next-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.happy-path-next-hint {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ─── Cómo usar (guía gráfica) ─────────────────────────────── */
.guide-teaser {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 22px 24px;
  border-radius: var(--border-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(120deg, rgba(52, 211, 153, 0.08), transparent 45%),
    rgba(255, 255, 255, 0.02);
}

.guide-teaser h2 {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 0 0 6px;
}

.guide-teaser p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 46ch;
  line-height: 1.45;
}

.como-usar-page {
  max-width: 980px;
  margin: 0 auto;
  padding-bottom: 64px;
}

.como-usar-hero {
  position: relative;
  min-height: min(72vh, 640px);
  border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
  overflow: hidden;
  margin: -8px -8px 40px;
  display: flex;
  align-items: flex-end;
  isolation: isolate;
  animation: comoUsarFadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.como-usar-hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.como-usar-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  transform: scale(1.04);
  animation: comoUsarKenBurns 18s ease-out both;
}

.como-usar-hero-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(8, 7, 13, 0.15) 0%, rgba(8, 7, 13, 0.55) 45%, rgba(8, 7, 13, 0.92) 100%),
    radial-gradient(ellipse at 20% 80%, rgba(52, 211, 153, 0.18), transparent 50%);
}

.como-usar-hero-copy {
  position: relative;
  z-index: 2;
  padding: clamp(28px, 5vw, 56px);
  max-width: 640px;
  animation: comoUsarFadeUp 0.85s 0.12s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.como-usar-brand {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.95;
  margin: 0 0 14px;
  background: linear-gradient(135deg, #f8fafc 10%, #6ee7b7 55%, #fbbf24 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.como-usar-hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 600;
  margin: 0 0 12px;
  color: #fff;
}

.como-usar-lead {
  font-size: 15px;
  line-height: 1.55;
  color: rgba(248, 250, 252, 0.78);
  margin: 0 0 22px;
  max-width: 42ch;
}

.como-usar-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.como-usar-section {
  margin-bottom: 48px;
  animation: comoUsarFadeUp 0.7s 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.como-usar-section h2 {
  font-family: var(--font-display);
  font-size: 28px;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.como-usar-section-lead {
  margin: 0 0 28px;
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 48ch;
  line-height: 1.5;
}

.como-usar-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  margin-left: 18px;
  padding: 0;
}

.como-usar-step {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px 18px;
  padding: 0 0 32px 22px;
  position: relative;
}

.como-usar-step::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--step-accent, var(--success));
  box-shadow: 0 0 0 4px rgba(8, 7, 13, 0.9), 0 0 18px color-mix(in srgb, var(--step-accent, #34d399) 45%, transparent);
}

.como-usar-step-index {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: color-mix(in srgb, var(--step-accent, #34d399) 70%, #fff);
  line-height: 1;
  letter-spacing: -0.04em;
}

.como-usar-step-body h3 {
  font-family: var(--font-display);
  font-size: 18px;
  margin: 0 0 8px;
}

.como-usar-step-body p {
  margin: 0 0 14px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
  max-width: 52ch;
}

.como-usar-step-body code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #a7f3d0;
}

.como-usar-rule {
  padding: 28px 0 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.como-usar-rule-quote {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  line-height: 1.35;
  color: #fff;
  margin: 12px 0 22px;
  max-width: 28ch;
}

.como-usar-rule-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  margin: 0;
}

.como-usar-rule-list li {
  display: flex;
  gap: 14px;
  align-items: baseline;
  font-size: 14px;
  color: var(--text-secondary);
}

.como-usar-rule-list span {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6ee7b7;
  min-width: 72px;
}

.como-usar-invite-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

@keyframes comoUsarKenBurns {
  from { transform: scale(1.08); }
  to { transform: scale(1.02); }
}

/* ─── Rate limit 429 banner ─────────────────────────────── */
.rate-limit-banner {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  z-index: 240;
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.22), rgba(239, 68, 68, 0.18));
  border-bottom: 1px solid rgba(245, 158, 11, 0.45);
  color: #fde68a;
  font-size: 13px;
  backdrop-filter: blur(12px);
  animation: rateLimitPulse 1.6s ease-in-out infinite;
}

.rate-limit-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.8);
  flex-shrink: 0;
}

#btnRateLimitGoOffline {
  white-space: nowrap;
  flex-shrink: 0;
}

.vault-empty-offline {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  border: 1px dashed var(--glass-border);
  border-radius: var(--border-radius-md);
  background: rgba(0, 0, 0, 0.1);
}

.vault-empty-offline__title {
  color: var(--text-primary);
  font-size: 13px;
  margin: 0;
  font-weight: 600;
}

.vault-empty-offline__lead {
  color: var(--text-secondary);
  font-size: 11px;
  margin-top: 8px;
  line-height: 1.45;
}

.vault-empty-offline__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}

.vault-empty-offline .btn {
  min-width: 160px;
}

.variant-card {
  position: relative;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.variant-card:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.variant-card__img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.variant-zoom-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.variant-card:hover .variant-zoom-icon {
  opacity: 1;
}

.variant-hover-actions {
  padding: 10px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  transform: translateY(100%);
  transition: transform 0.2s ease;
}

.variant-card:hover .variant-hover-actions {
  transform: translateY(0);
}

.variant-hover-actions__pose {
  font-size: 9px;
  color: var(--text-muted);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.variant-hover-actions__btns {
  display: flex;
  gap: 4px;
}

.variant-card__btn {
  flex: 1;
  font-size: 9px;
  padding: 4px 6px;
}

.variant-card__btn--danger {
  background: rgba(220, 53, 69, 0.3);
  color: #ff6b6b;
}

.color-swatch-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

@keyframes rateLimitPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.88; }
}

/* ─── Matriz QA ─────────────────────────────────────────── */
.qa-matrix-panel {
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: rgba(56, 189, 248, 0.06);
}

.qa-matrix-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.qa-matrix-head h4 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 13px;
  color: #7dd3fc;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.qa-matrix-head p {
  margin: 0;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.qa-matrix-score {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: #bae6fd;
  white-space: nowrap;
}

.qa-matrix-score.is-ok {
  color: #6ee7b7;
}

.qa-matrix-head-scores {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.qa-matrix-dhash {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.qa-matrix-dhash.is-ok { color: #6bcb77; }
.qa-matrix-dhash.is-warn { color: #e8c547; }
.qa-matrix-dhash.is-bad { color: #ff6b6b; }

.variant-consistency-chip {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 7px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.72);
  color: #ddd;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.variant-consistency-chip.is-ok {
  color: #b8f0c0;
  border: 1px solid rgba(107, 203, 119, 0.45);
}

.variant-consistency-chip.is-warn {
  color: #f5e6a3;
  border: 1px solid rgba(232, 197, 71, 0.45);
}

.variant-consistency-chip.is-bad {
  color: #ffb3b3;
  border: 1px solid rgba(255, 107, 107, 0.45);
}

.variant-consistency-chip.is-muted {
  color: #aaa;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.qa-matrix-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.qa-slot {
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.28);
  min-height: 150px;
  display: flex;
  flex-direction: column;
}

.qa-slot-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 6px 8px 0;
}

.qa-slot img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  background: #111;
  display: block;
}

.qa-slot-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 8px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}

.qa-matrix-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 8px;
}

.qa-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.qa-check input {
  accent-color: #38bdf8;
}

.qa-matrix-hint {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

@media (max-width: 900px) {
  .rate-limit-banner {
    left: 0;
    top: 52px;
  }

  .qa-matrix-slots {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .como-usar-hero {
    margin: 0 0 28px;
    min-height: 70vh;
    border-radius: var(--border-radius-md);
  }

  .como-usar-step {
    grid-template-columns: 1fr;
    padding-left: 18px;
  }

  .como-usar-step-index {
    font-size: 22px;
  }
}

@media (max-width: 900px) {
  .pin-default-banner {
    left: 0;
  }
}

/* ─── Import confirm (1.2) ──────────────────────────────── */
.import-confirm-hint {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.import-ritual-steps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 18px;
  font-size: 11px;
  color: var(--text-muted);
}

.import-ritual-steps [data-import-ritual] {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

.import-ritual-steps [data-import-ritual].is-active {
  color: #ecfdf5;
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.18);
  font-weight: 700;
}

.import-ritual-steps [data-import-ritual].is-done {
  color: #86efac;
  border-color: rgba(52, 211, 153, 0.25);
}

.import-confirm-traits .form-row {
  display: flex;
  flex-wrap: wrap;
}

.import-confirm-traits input,
.import-confirm-traits select,
.import-confirm-traits .trait-combo {
  pointer-events: auto;
}

.import-confirm-combo-hint {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Combobox in-DOM: reemplaza datalist nativo (roto en modal + autofill) */
.trait-combo {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
}

.trait-combo .trait-combo-input,
.trait-combo input[type="text"] {
  width: 100%;
  padding-right: 36px;
}

.trait-combo-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
  pointer-events: auto;
}

.trait-combo-toggle:hover,
.trait-combo-toggle:focus {
  color: #fff;
}

.trait-combo-menu {
  position: fixed;
  z-index: 5000;
  max-height: min(50vh, 360px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: #1a1625;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
}

.trait-combo-menu [role="option"] {
  padding: 8px 12px;
  cursor: pointer;
  color: #f8fafc;
  font-size: 12px;
  line-height: 1.35;
}

.trait-combo-menu [role="option"]:hover,
.trait-combo-menu [role="option"].is-active {
  background: rgba(99, 102, 241, 0.38);
}

.trait-combo-empty {
  padding: 8px 12px;
  color: var(--text-muted);
  font-size: 12px;
}

.import-lock-health.is-weak {
  color: #fca5a5 !important;
}

/* ─── Offline banner (JSON-first) ───────────────────────── */
.offline-banner {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  z-index: 239;
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: linear-gradient(90deg, rgba(71, 85, 105, 0.35), rgba(30, 41, 59, 0.55));
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  color: #e2e8f0;
  font-size: 13px;
  backdrop-filter: blur(12px);
}

.offline-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #94a3b8;
  flex-shrink: 0;
}

/* UX-0c legacy: #offlineModeBar eliminada (idea #5 → chip). Reglas no-op por si queda markup viejo. */
.offline-mode-bar {
  display: none !important;
}

.offline-pack-highlight {
  outline: 2px solid rgba(16, 185, 129, 0.75) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  animation: offlinePackPulse 1.6s ease-in-out infinite;
}

@keyframes offlinePackPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25); }
  50% { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.12); }
}

@media (max-width: 900px) {
  .offline-banner {
    left: 0;
    top: 52px;
  }
}

@media (max-width: 768px) {
  .offline-mode-bar {
    display: none !important;
  }
}


/* UX-4 — repeated inline → classes */
.btn-compact {
  font-size: 11px;
  padding: 6px 10px;
}
.btn-archive-quiet {
  font-size: 11px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}
.settings-field-input {
  width: 100%;
  padding: 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
}
.flex-col-gap-8 {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.flex-row-gap-8 {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: end;
}
.empty-filter-panel {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-secondary);
  padding: 40px 20px;
  font-size: 14px;
}
.empty-filter-panel__icon {
  font-size: 28px;
  margin-bottom: 10px;
}
.empty-filter-panel__title {
  margin-bottom: 8px;
  color: #fff;
  font-weight: 600;
}
.empty-filter-panel__lead {
  margin-bottom: 16px;
  font-size: 13px;
}
.text-muted-sm {
  font-size: 11px;
  color: var(--text-muted);
}
.persona-card--compact img {
  height: 90px;
}
.persona-card--compact .persona-card-info {
  padding: 6px 8px;
}
.persona-card--compact .persona-card-name {
  font-size: 12px;
}


/* UX-4 utilities — repeated inline patterns */
.u-hidden { display: none; }
.u-flex { display: flex; }
.u-flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.u-mt-10 { margin-top: 10px; }
.u-mb-8 { margin-bottom: 8px; }
.u-mb-24 { margin-bottom: 24px; }
.u-d-block { display: block; }
.u-mb-20 { margin-bottom: 20px; }
.u-m-0 { margin: 0; }
.u-color-white { color: #fff; }
.u-fs-10 { font-size: 10px; }
.u-fs-10-muted { font-size: 10px; color: var(--text-muted); }
.u-label-sm {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.u-section-title {
  font-family: var(--font-display);
  font-size: 16px;
  margin: 0 0 8px;
  color: #fff;
}
.u-section-lead {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0 0 12px;
  line-height: 1.45;
}
.u-hr-soft {
  border: none;
  border-top: 1px solid var(--glass-border);
  margin: 24px 0;
}
.u-chip-xs {
  padding: 2px 8px;
  font-size: 9px;
  height: auto;
}
.u-btn-xs {
  font-size: 10px;
  padding: 5px 9px;
}
.u-eyebrow {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 8px;
}
.u-full-center-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.u-hint-10 {
  font-size: 10px;
  color: var(--text-muted);
  margin: 6px 0 0;
  line-height: 1.4;
}
.u-card-title {
  font-family: var(--font-display);
  margin-bottom: 20px;
}

.u-muted-13 {
  color: var(--text-secondary);
  font-size: 13px;
}

.u-error-13 {
  color: #ff6b6b;
  font-size: 13px;
}

.u-flex-1 { flex: 1; }
.u-w-full { width: 100%; }
.u-mb-16 { margin-bottom: 16px; }
.u-mb-18 { margin-bottom: 18px; }
.u-mt-16 { margin-top: 16px; }
.u-mt-28 { margin-top: 28px; }
.u-gap-wrap {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.u-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.u-grid-2-lg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.u-flex-col-gap {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.u-label-block {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 12px;
}
.u-label-field {
  font-size: 12px;
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
  color: var(--text-secondary);
}
.u-hint-muted {
  font-size: 10px;
  color: var(--text-muted);
  display: block;
  margin-top: 4px;
}
.u-hint-muted-block {
  font-size: 10px;
  color: var(--text-muted);
  margin: 8px 0 0;
  line-height: 1.4;
}
.u-hint-muted-sm {
  font-size: 10px;
  color: var(--text-muted);
  margin: 0 0 8px;
  line-height: 1.4;
}
.u-title-display {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0 0 8px;
  color: #fff;
}
.u-title-card {
  font-family: var(--font-display);
  margin: 0;
}
.u-lead-secondary {
  color: var(--text-secondary);
  font-size: 12px;
  margin-bottom: 20px;
}
.u-pad-y-10 { padding: 10px 12px; }
.u-btn-sm-pad {
  font-size: 11px;
  padding: 8px 12px;
}
.u-btn-sm-pad-tight {
  font-size: 11px;
  padding: 8px 10px;
}
.u-btn-icon-row {
  font-size: 11px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.u-input-pad-12 {
  width: 100%;
  padding: 12px;
}
.u-input-pad-10 {
  width: 100%;
  padding: 10px;
  font-size: 12px;
}
.u-flex-center-gap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #fff;
}
.u-flex-start-gap {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.u-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.u-btn-import {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  padding: 10px 20px;
}
.u-btn-icon-sm {
  display: flex;
  align-items: center;
  gap: 6px;
}
.u-card-pad-24 {
  margin-bottom: 28px;
  padding: 24px;
}
.u-option-card {
  padding: 20px;
  cursor: pointer;
  border: 1px solid var(--glass-border);
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.01);
}
.u-option-icon {
  font-size: 28px;
  padding: 10px;
  border-radius: 12px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.u-option-icon--primary {
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-primary);
}
.u-option-icon--amber {
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
}
.u-option-title {
  font-family: var(--font-display);
  font-size: 15px;
  color: #fff;
  margin-bottom: 6px;
}
.u-option-lead {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.5;
}
.u-step-title {
  font-family: var(--font-display);
  margin-bottom: 6px;
  font-size: 18px;
  color: #fff;
}
.u-niche-bar { margin-top: 18px; }
.u-niche-label {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.u-flex-wrap-gap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.u-niche-ok {
  display: none;
  margin: 10px 0 0;
  font-size: 12px;
  color: #a7f3d0;
}
.u-details-summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 8px 0;
}
.u-flex-gap-12 {
  display: flex;
  gap: 12px;
  margin: 12px 0 0;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.u-hidden-mb-28 {
  display: none;
  margin-bottom: 28px;
}
.u-title-ab {
  font-family: var(--font-display);
  margin-bottom: 16px;
}
.u-lead-ab {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 24px;
}
.u-field-title {
  font-size: 11px;
  font-weight: 600;
  margin: 0 0 6px;
}
.u-scroll-ccc {
  font-size: 11px;
  color: #ccc;
  max-height: 70px;
  overflow-y: auto;
}
.u-text-center-flex1 {
  flex: 1;
  text-align: center;
}
.u-btn-left {
  font-size: 11px;
  padding: 8px 10px;
  text-align: left;
}
.u-err-inline {
  display: none;
  color: var(--danger);
  font-size: 12px;
  margin: 0 0 12px;
}
.u-glass-input {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
}
.u-dark-input {
  width: 100%;
  padding: 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: #fff;
}
.u-bg-soft {
  background: rgba(255, 255, 255, 0.05);
  font-size: 11px;
  color: #fff;
}
.u-span-full { grid-column: 1 / -1; }
.u-w-full-mt {
  width: 100%;
  margin-top: 8px;
  font-size: 11px;
  padding: 8px 10px;
}
.u-fs-11 { font-size: 11px; }
.u-fs-10-only { font-size: 10px; }

.filter-btn-active {
  background: var(--accent-primary) !important;
  color: #fff !important;
}

/* UX detalles — more style= leftovers */
.u-muted-12 { font-size: 12px; color: var(--text-muted); margin: 0; }
.u-color-secondary { color: var(--text-secondary); }
.u-color-danger { color: var(--danger); }
.u-danger-12 { font-size: 12px; color: var(--danger); }
.u-muted-12-plain { font-size: 12px; color: var(--text-muted); }
.u-mb-12 { margin-bottom: 12px; }
.u-mt-12 { margin-top: 12px; }
.u-pad-10-24 { padding: 10px 24px; }
.u-flex-gap-10 { display: flex; gap: 10px; }
.u-flex-gap-8 { display: flex; gap: 8px; }
.u-flex-gap-12-row { display: flex; gap: 12px; }
.u-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}
.u-lead-13 {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 18px;
  line-height: 1.45;
}
.u-list-soft {
  margin: 0 0 20px;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.u-link-quiet {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 8px;
}
.u-flex-min-input {
  flex: 1;
  min-width: 120px;
  padding: 10px 12px;
}
.u-row-soft {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0,0,0,0.2);
  padding: 12px;
  border-radius: var(--border-radius-md);
}
.u-font-display-600 {
  font-family: var(--font-display);
  font-weight: 600;
}
.u-fs-11-sec { font-size: 11px; color: var(--text-secondary); }
.u-fs-11-muted { font-size: 11px; color: var(--text-muted); }
.u-fs-12-sec { font-size: 12px; color: var(--text-secondary); }
.u-fs-12-pad8 { font-size: 12px; padding: 8px; }
.u-title-14-sec {
  font-family: var(--font-display);
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--text-secondary);
}
.u-title-16-sec {
  font-family: var(--font-display);
  font-size: 16px;
  margin-bottom: 12px;
  color: var(--text-secondary);
}
.u-col-soft {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
  background: rgba(0,0,0,0.2);
  padding: 16px;
  border-radius: var(--border-radius-md);
}
.u-full-center-mt {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}
.u-progress-fill {
  width: 0%;
  height: 100%;
  background: var(--accent-gradient);
  transition: width 0.3s ease;
}
.u-mono-right {
  text-align: right;
  font-family: var(--font-mono);
}
.u-scroll-80 {
  font-size: 11px;
  max-height: 80px;
  overflow-y: auto;
}
.u-grid-2-11 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 11px;
  color: var(--text-secondary);
}
.u-amber-eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  color: #fbbf24;
  margin: 0;
  letter-spacing: 0.5px;
}
.u-flex-between-mb8 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.u-glass-textarea {
  width: 100%;
  padding: 12px;
  margin-bottom: 12px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: #fff;
}
.u-sidebar-full {
  width: 100%;
  margin-bottom: 8px;
}
.u-sidebar-full-last {
  width: 100%;
}

.handoff-result {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(52, 211, 153, 0.28);
  background: rgba(52, 211, 153, 0.08);
}
.handoff-result h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 15px;
  color: #fff;
}
.handoff-result p {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
}
.handoff-result-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.handoff-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.handoff-persona-pick {
  min-width: 180px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
}
