/* ========================================================
   SD AGENCY · SUITE E-COMMERCE & ADS IA (MASTER ESCALA)
   Estética Dual: "Sistema Cuaderno / Papel Claro" & "Estudio Oscuro"
   ======================================================== */

/* 1. FUENTES LOCALES Y VARIABLES DE TEMA */
:root {
  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Bricolage Grotesque', 'Montserrat', sans-serif;
  --font-serif: 'Lora', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-hand: 'Caveat', cursive;

  /* Paleta fija de Sidebar Oscuro (Idéntico a Master Escala) */
  --sidebar-bg: #0D1117;
  --sidebar-border: #1E293B;
  --sidebar-text: #E2E8F0;
  --sidebar-muted: #94A3B8;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active: rgba(16, 185, 129, 0.12);

  /* Acentos Esmeralda & Neón */
  --emerald-primary: #00D47E;
  --emerald-hover: #10B981;
  --emerald-glow: rgba(0, 212, 126, 0.35);
  --cyan-accent: #00E5FF;
  --amber-accent: #F59E0B;
  --danger-accent: #EF4444;
  --blue-accent: #3B82F6;

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  --transition-fast: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Modo Cuaderno / Papel Claro (Por Defecto) */
body.light-theme {
  --bg-main: #F8F7F3;
  --bg-card: #FFFFFF;
  --bg-card-subtle: #F1EFEA;
  --bg-input: #FFFFFF;
  --border-clean: #E5E4DE;
  --border-card: #E8E7DF;
  --text-main: #1C1917;
  --text-sub: #57534E;
  --text-muted: #8E8A83;
  --card-shadow: 0 4px 20px -2px rgba(28, 25, 23, 0.06), 0 2px 6px -1px rgba(28, 25, 23, 0.04);
  --spine-dots: #D6D3C9;
}

/* Modo Estudio Oscuro */
body.dark-theme {
  --bg-main: #0B0F17;
  --bg-card: #111827;
  --bg-card-subtle: #172033;
  --bg-input: #131B2A;
  --border-clean: #1F2937;
  --border-card: #1F2937;
  --text-main: #F8FAFC;
  --text-sub: #CBD5E1;
  --text-muted: #64748B;
  --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  --spine-dots: #1E293B;
}

/* 2. RESET & ESTRUCTURA BASE */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* Layout General: Sidebar Izquierdo + Área de Trabajo */
.app-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* ========================================================
   3. MENÚ LATERAL IZQUIERDO OSCURO (#0D1117 · 260px)
   ======================================================== */
.app-sidebar {
  width: 260px;
  min-width: 260px;
  height: 100%;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 50;
  user-select: none;
}

.sidebar-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--sidebar-border);
}

.suite-logo-block {
  display: flex;
  align-items: center;
  gap: 10px;
}

.suite-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--emerald-primary), var(--cyan-accent));
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
  box-shadow: 0 0 14px var(--emerald-glow);
}

.suite-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.5px;
  color: #FFFFFF;
  display: block;
  line-height: 1.1;
}

.suite-tagline {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--emerald-primary);
  font-weight: 700;
  display: block;
  margin-top: 2px;
}

/* Caja de Marca Activa en Sidebar */
.sidebar-brand-box {
  padding: 12px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  background: rgba(255, 255, 255, 0.02);
}

.brand-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.brand-box-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.btn-new-brand-quick {
  background: transparent;
  border: none;
  color: var(--emerald-primary);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: var(--radius-xs);
  transition: var(--transition-fast);
}

.btn-new-brand-quick:hover {
  background: rgba(0, 212, 126, 0.1);
}

.brand-box-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}

.brand-swatch-indicator {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background-color: var(--emerald-primary);
  box-shadow: 0 0 8px var(--emerald-primary);
  flex-shrink: 0;
}

.brand-native-select {
  background: transparent;
  border: none;
  color: #FFFFFF;
  font-weight: 600;
  font-size: 12px;
  width: 100%;
  outline: none;
  cursor: pointer;
}

.brand-native-select option {
  background: var(--sidebar-bg);
  color: #FFFFFF;
}

.brand-active-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.sidebar-brand-pill {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  color: var(--sidebar-text);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
}

.sidebar-brand-pill.active {
  background: rgba(0, 212, 126, 0.15);
  border-color: var(--emerald-primary);
  color: var(--emerald-primary);
  font-weight: 700;
}

/* Botón Principal Destacado Verde Esmeralda (#00D47E) */
.sidebar-cta-block {
  padding: 14px 16px;
}

.btn-create-product-cta {
  width: 100%;
  padding: 11px 14px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--emerald-primary), var(--emerald-hover));
  color: #062817;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: 0 4px 18px var(--emerald-glow);
  transition: var(--transition-fast);
}

.btn-create-product-cta:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 6px 22px var(--emerald-glow);
}

.btn-create-product-cta:active {
  transform: translateY(0);
}

.btn-cta-plus {
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.btn-cta-badge {
  background: rgba(6, 40, 23, 0.25);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  font-weight: 700;
  color: #062817;
}

/* Navegación del Sidebar */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--sidebar-border);
  border-radius: var(--radius-full);
}

.nav-section-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--sidebar-muted);
  padding: 12px 10px 4px;
  text-transform: uppercase;
}

.sidebar-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-fast);
  margin-bottom: 2px;
  position: relative;
}

.sidebar-item:hover {
  background: var(--sidebar-hover);
  color: #FFFFFF;
}

.sidebar-item.active {
  background: var(--sidebar-active);
  color: var(--emerald-primary);
  font-weight: 700;
}

.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--emerald-primary);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 8px var(--emerald-primary);
}

.item-icon {
  font-size: 15px;
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-pill-new {
  font-size: 9px;
  background: var(--emerald-primary);
  color: #062817;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: var(--radius-full);
}

.item-pill-badge {
  font-size: 9px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--sidebar-muted);
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

/* Acordeón del Sidebar */
.accordion-toggle {
  justify-content: space-between;
}

.acc-chevron {
  font-size: 11px;
  color: var(--sidebar-muted);
  transition: transform 0.2s ease;
}

.sidebar-accordion.open .acc-chevron {
  transform: rotate(180deg);
}

.accordion-submenu {
  display: none;
  padding-left: 20px;
  margin-bottom: 4px;
}

.sidebar-accordion.open .accordion-submenu {
  display: block;
}

.submenu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  color: var(--sidebar-muted);
  font-size: 11.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-fast);
}

.submenu-item:hover {
  color: #FFFFFF;
  background: var(--sidebar-hover);
}

.submenu-item.active {
  color: var(--emerald-primary);
  font-weight: 700;
}

.sub-dot {
  width: 5px;
  height: 5px;
  border-radius: var(--radius-full);
  background: var(--sidebar-border);
}

.submenu-item.active .sub-dot {
  background: var(--emerald-primary);
  box-shadow: 0 0 6px var(--emerald-primary);
}

.sidebar-create-toggle {
  background: rgba(0, 212, 126, 0.10);
  border: 1px solid rgba(0, 212, 126, 0.28);
  color: #FFFFFF;
  font-weight: 700;
}

.sidebar-create-toggle:hover {
  background: rgba(0, 212, 126, 0.18);
  border-color: var(--emerald-primary);
}

.sidebar-item:focus-visible,
.submenu-item:focus-visible {
  outline: 2px solid var(--emerald-primary);
  outline-offset: -2px;
}

/* Pie del Sidebar */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--sidebar-border);
}

.vps-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--sidebar-border);
}

.vps-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--emerald-primary);
  box-shadow: 0 0 6px var(--emerald-primary);
  flex-shrink: 0;
}

.vps-info {
  display: flex;
  flex-direction: column;
}

.vps-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #FFFFFF;
}

.vps-sub {
  font-size: 9.5px;
  color: var(--sidebar-muted);
}

/* ========================================================
   4. BORDE DE ESPIRAL DE CUADERNO / NOTEBOOK SPINE (1:1 MASTER ESCALA)
   ======================================================== */
.notebook-spine {
  width: 24px;
  height: 100%;
  background-color: #fafcfb;
  position: relative;
  flex-shrink: 0;
  border-right: 1px solid #e2e8f0;
  background-image:
    radial-gradient(circle at 15px 22px, #1e293b 5.5px, transparent 6px),
    linear-gradient(to bottom, transparent 19px, #334155 19px, #334155 25px, transparent 25px);
  background-size: 24px 44px, 15px 44px;
  background-repeat: repeat-y;
  background-position: 0 12px, 0 12px;
}

/* ========================================================
   5. ÁREA PRINCIPAL DE TRABAJO & TOPBAR
   ======================================================== */
.app-main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--bg-main);
}

.app-topbar {
  height: 60px;
  padding: 0 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-clean);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  box-shadow: var(--card-shadow);
  z-index: 20;
}

.topbar-left {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 0;
  row-gap: 2px;
}

.btn-topbar-history-back {
  grid-column: 1;
  grid-row: 1 / span 2;
  margin-right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-clean);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-topbar-history-back:hover {
  border-color: var(--emerald-primary);
  color: var(--emerald-primary);
  background: rgba(16, 185, 129, 0.08);
}

.btn-topbar-history-back.hidden {
  display: none !important;
}

.topbar-left .view-current-title,
.topbar-left .view-current-sub {
  grid-column: 2;
}

.view-current-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.view-current-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-active-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-clean);
  padding: 5px 12px;
  border-radius: var(--radius-full);
}

.active-brand-dot {
  width: 9px;
  height: 9px;
  border-radius: var(--radius-full);
  background: var(--emerald-primary);
  box-shadow: 0 0 6px var(--emerald-primary);
}

.active-brand-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.active-brand-badge {
  font-size: 10px;
  color: var(--text-muted);
  padding-left: 6px;
  border-left: 1px solid var(--border-clean);
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
}

/* Botón Toggle de Modo Claro / Modo Oscuro */
.theme-switch-wrapper {
  display: flex;
  align-items: center;
}

.btn-theme-toggle {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-clean);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-theme-toggle:hover {
  border-color: var(--emerald-primary);
}

.theme-icon {
  font-size: 13px;
}

body.light-theme .dark-icon {
  opacity: 0.35;
}

body.dark-theme .light-icon {
  opacity: 0.35;
}

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

.status-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--emerald-primary);
  box-shadow: 0 0 6px var(--emerald-primary);
}

/* Contenedor de Vistas (Fondo retícula estudio Master Escala 1:1 en modo claro) */
.app-main-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

body.light-theme .app-main-content {
  background-color: #fafcfb;
  background-image:
    linear-gradient(to right, rgba(19, 23, 21, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(19, 23, 21, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
}

.view-panel {
  display: none;
  animation: fadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-panel.active {
  display: block;
}

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

/* ========================================================
   6. COMPONENTES COMUNES: TARJETAS DE PAPEL, BOTONES, FORMS
   ======================================================== */
.paper-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--card-shadow);
  position: relative;
}

.card-header-clean {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-clean);
}

.card-header-clean h4 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}

.badge-tag-clean {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-clean);
  color: var(--text-muted);
  font-weight: 700;
}

.module-header-block {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.module-header-block h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
}

.module-header-block p {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
  border: none;
  font-family: var(--font-sans);
}

.btn-primary {
  background: #1E293B;
  color: #FFFFFF;
}

body.dark-theme .btn-primary {
  background: #334155;
  color: #FFFFFF;
}

.btn-primary:hover {
  filter: brightness(1.15);
}

.btn-secondary {
  background: var(--bg-card-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-clean);
}

.btn-secondary:hover {
  background: var(--border-clean);
}

.btn-emerald {
  background: var(--emerald-primary);
  color: #062817;
  font-weight: 800;
  box-shadow: 0 4px 14px var(--emerald-glow);
}

.btn-emerald:hover {
  background: var(--emerald-hover);
  filter: brightness(1.05);
}

.btn-emerald-lg {
  padding: 12px 24px;
  font-size: 13.5px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--emerald-primary), var(--emerald-hover));
  color: #062817;
  font-family: var(--font-display);
  font-weight: 800;
  box-shadow: 0 6px 20px var(--emerald-glow);
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-emerald-lg:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.btn-outline-clean {
  background: transparent;
  border: 1px solid var(--border-clean);
  color: var(--text-sub);
  font-size: 11px;
}

.btn-outline-clean:hover {
  border-color: var(--emerald-primary);
  color: var(--emerald-primary);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 11px;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 10px;
  border-radius: var(--radius-xs);
}

.btn-icon-sm {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-clean);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-close-clean {
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-close-clean:hover {
  color: var(--text-main);
}

.file-hidden {
  display: none !important;
}

/* Formularios */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 5px;
}

.form-input, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-clean);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 12.5px;
  font-family: var(--font-sans);
  outline: none;
  transition: var(--transition-fast);
}

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

.form-input-sm {
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-clean);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 11.5px;
  outline: none;
}

.form-highlight {
  font-weight: 800;
  color: var(--emerald-primary);
}

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

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

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.mt-4 { margin-top: 20px; }
.w-100 { width: 100%; }

/* ========================================================
   7. VISTA 1: 🏠 INICIO & HERMES IA
   ======================================================== */
.home-guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--card-shadow);
  margin-bottom: 24px;
}

.guide-greeting {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.guide-greeting h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
}

.guide-greeting p {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.guide-steps-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.guide-step-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-clean);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.guide-step-card:hover {
  transform: translateY(-2px);
  border-color: var(--emerald-primary);
}

.step-badge {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  color: var(--emerald-primary);
  background: rgba(0, 212, 126, 0.12);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
}

.guide-step-card h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.guide-step-card p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Layout Dúo Conversacional Hermes + Entrega */
.hermes-duo-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
  margin-bottom: 24px;
}

.hermes-chat-box {
  display: flex;
  flex-direction: column;
  height: 580px;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-clean);
  margin-bottom: 12px;
}

.agent-avatar-tag {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #10B981, #00E5FF);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 0 10px var(--emerald-glow);
}

.agent-avatar-tag h4 {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
}

.agent-sub {
  font-size: 10.5px;
  color: var(--text-muted);
}

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

.chat-history-container {
  flex: 1;
  overflow-y: auto;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-history-container::-webkit-scrollbar {
  width: 4px;
}

.chat-history-container::-webkit-scrollbar-thumb {
  background: var(--border-clean);
  border-radius: var(--radius-full);
}

.chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  line-height: 1.45;
  word-break: break-word;
}

.chat-bubble.assistant {
  align-self: flex-start;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-clean);
  color: var(--text-main);
}

.chat-bubble.user {
  align-self: flex-end;
  background: #1E293B;
  color: #FFFFFF;
}

body.dark-theme .chat-bubble.user {
  background: var(--emerald-primary);
  color: #062817;
  font-weight: 600;
}

.quick-prompts-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 0;
  border-top: 1px solid var(--border-clean);
}

.quick-prompts-bar::-webkit-scrollbar {
  height: 3px;
}

.prompt-chip {
  flex-shrink: 0;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-clean);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  transition: var(--transition-fast);
}

.prompt-chip:hover {
  border-color: var(--emerald-primary);
  color: var(--emerald-primary);
}

.chat-attachment-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card-subtle);
  border: 1px dashed var(--emerald-primary);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin-top: 6px;
}

.chat-attachment-preview img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: var(--radius-xs);
}

.att-details {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.att-details strong {
  font-size: 11px;
  color: var(--text-main);
}

.att-details span {
  font-size: 9.5px;
  color: var(--text-muted);
}

.btn-remove-attachment {
  background: transparent;
  border: none;
  color: var(--danger-accent);
  font-weight: 800;
  cursor: pointer;
  font-size: 14px;
}

.chat-composer-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.btn-composer-attach {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-clean);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-textarea {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-clean);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 12px;
  font-family: var(--font-sans);
  resize: none;
  outline: none;
}

.chat-textarea:focus {
  border-color: var(--emerald-primary);
}

.btn-composer-send {
  background: var(--emerald-primary);
  border: none;
  color: #062817;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-composer-send:hover {
  background: var(--emerald-hover);
}

/* Columna Derecha: Entrega en Vivo y Aduanas */
.hermes-live-delivery {
  display: flex;
  flex-direction: column;
  height: 580px;
}

.mini-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card-subtle);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.m-step {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}

.m-step.active {
  color: var(--emerald-primary);
}

.m-arrow {
  font-size: 9px;
  color: var(--text-muted);
}

.delivery-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.empty-delivery-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 24px;
}

.empty-delivery-icon {
  font-size: 38px;
  margin-bottom: 10px;
  opacity: 0.6;
}

.empty-delivery-state h5 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.empty-delivery-state p {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
  max-width: 320px;
}

/* Tarjetas Rápidas de Repositorios Open-Source */
.open-repos-hub-strip {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--card-shadow);
}

.hub-strip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.hub-strip-header h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.hub-strip-header p {
  font-size: 11.5px;
  color: var(--text-muted);
}

.repo-quick-cards-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.repo-quick-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-clean);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.repo-quick-card:hover {
  transform: translateY(-2px);
  border-color: var(--emerald-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

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

.rq-icon {
  font-size: 20px;
}

.rq-status {
  font-size: 9px;
  font-weight: 700;
  color: var(--emerald-primary);
}

.repo-quick-card h4 {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.repo-quick-card p {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 10px;
}

.rq-link {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--emerald-primary);
}

/* ========================================================
   8. VISTA 2: ✨ CREADOR DE PRODUCTO (4 PASOS)
   ======================================================== */
.creator-stepper-header {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  margin-bottom: 20px;
  box-shadow: var(--card-shadow);
}

.creator-step-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  text-align: left;
}

.creator-step-tab:hover {
  background: var(--bg-card-subtle);
}

.creator-step-tab.active {
  background: rgba(0, 212, 126, 0.1);
}

.c-num {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-clean);
  color: var(--text-sub);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
}

.creator-step-tab.active .c-num {
  background: var(--emerald-primary);
  border-color: var(--emerald-primary);
  color: #062817;
}

.c-info strong {
  display: block;
  font-size: 12px;
  color: var(--text-main);
}

.c-info span {
  font-size: 10px;
  color: var(--text-muted);
}

.c-connector {
  flex: 1;
  height: 1px;
  background: var(--border-clean);
  margin: 0 10px;
}

.creator-step-body {
  display: none;
  animation: fadeIn 0.2s ease;
}

.creator-step-body.active {
  display: block;
}

.step-card-box {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--card-shadow);
}

.step-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-clean);
}

.step-title-row h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}

.step-title-row p {
  font-size: 12px;
  color: var(--text-muted);
}

/* Caja de Importar URL */
.url-import-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-clean);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 20px;
}

.url-import-icon {
  font-size: 26px;
}

.url-import-fields {
  flex: 1;
}

.url-import-fields label {
  display: block;
  font-size: 11.5px;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.url-input-group {
  display: flex;
  gap: 8px;
}

.creator-grid-2cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.product-dropzone-box {
  border: 2px dashed var(--border-clean);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  margin-bottom: 14px;
  background: var(--bg-card-subtle);
  cursor: pointer;
  transition: var(--transition-fast);
}

.product-dropzone-box:hover {
  border-color: var(--emerald-primary);
}

.drop-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}

.drop-visual h4 {
  font-size: 13px;
  color: var(--text-main);
  margin-bottom: 4px;
}

.drop-visual p {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.drop-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.drop-preview img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-clean);
}

.bundles-preset-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-clean);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 10px;
}

.bundles-preset-box label {
  font-size: 11px;
  color: var(--text-sub);
}

.bundles-chips {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.b-chip {
  font-size: 11px;
  background: var(--bg-card);
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-clean);
}

.b-chip.highlight {
  border-color: var(--emerald-primary);
  color: var(--text-main);
}

.step-actions-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-clean);
}

/* PASO 2: ¿QUÉ QUIERES CREAR? */
.creative-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-main);
}

.group-sub {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.creative-options-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.creative-options-grid.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.creative-option-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-clean);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: var(--transition-fast);
  position: relative;
}

.creative-option-card input[type="checkbox"] {
  position: absolute;
  top: 12px;
  right: 12px;
  accent-color: var(--emerald-primary);
  width: 16px;
  height: 16px;
}

.creative-option-card:hover {
  border-color: var(--emerald-primary);
}

.creative-option-card.selected {
  border-color: var(--emerald-primary);
  background: rgba(0, 212, 126, 0.05);
}

.c-card-icon {
  font-size: 26px;
  margin-bottom: 8px;
}

.c-card-content h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.c-card-content p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 10px;
}

.c-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  background: var(--bg-card);
  border: 1px solid var(--border-clean);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  color: var(--emerald-primary);
}

/* PASO 3: BUYER PERSONA & 6 ÁNGULOS */
.step-sub-section {
  margin-bottom: 20px;
}

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

.sub-section-header h4 {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
}

.sub-note {
  font-size: 11px;
  color: var(--text-muted);
}

.personas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.persona-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-clean);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.persona-card.selected {
  border-color: var(--emerald-primary);
  background: rgba(0, 212, 126, 0.05);
}

.persona-badge {
  font-size: 9px;
  font-weight: 800;
  background: var(--emerald-primary);
  color: #062817;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.angles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.angle-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-clean);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.angle-card.selected {
  border-color: var(--emerald-primary);
  background: rgba(0, 212, 126, 0.05);
}

.angle-tags {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.a-tag {
  font-size: 8.5px;
  font-weight: 800;
  background: var(--bg-card);
  padding: 2px 5px;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
}

.landing-sections-checklist {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.l-sec-item {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-clean);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.l-sec-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.l-sec-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

/* PASO 4: RESULTADOS EN 5 PESTAÑAS */
.results-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin-bottom: 16px;
  box-shadow: var(--card-shadow);
}

.res-product-summary {
  display: flex;
  align-items: center;
  gap: 12px;
}

.res-icon {
  font-size: 26px;
}

.res-product-summary h4 {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
}

.res-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.res-badges-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.res-aduanas-pill {
  display: flex;
  gap: 6px;
}

.aduana-stamp {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

.aduana-stamp.approved {
  background: rgba(0, 212, 126, 0.12);
  color: var(--emerald-primary);
  border: 1px solid var(--emerald-primary);
}

.results-tabs-strip {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-clean);
  padding-bottom: 4px;
}

.res-tab-btn {
  padding: 9px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.res-tab-btn:hover {
  color: var(--text-main);
}

.res-tab-btn.active {
  color: var(--emerald-primary);
  border-bottom-color: var(--emerald-primary);
}

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

.results-tab-panel.active {
  display: block;
}

/* MARCO REALISTA DE IPHONE */
.landing-preview-workspace {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 28px;
  align-items: start;
}

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

.iphone-frame {
  width: 375px;
  height: 740px;
  background: #000;
  border-radius: 46px;
  padding: 12px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.4), 0 0 0 4px #27272A;
  position: relative;
  overflow: hidden;
}

.iphone-dynamic-island {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 96px;
  height: 22px;
  background: #000;
  border-radius: var(--radius-full);
  z-index: 30;
}

.iphone-screen {
  width: 100%;
  height: 100%;
  background: #FFFFFF;
  border-radius: 36px;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  color: #111827;
  font-family: var(--font-sans);
}

.iphone-screen::-webkit-scrollbar {
  width: 3px;
}

.iphone-screen::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-full);
}

/* 10 Secciones de la Landing dentro del iPhone */
.iph-announcement-bar {
  background: #0D1117;
  color: #FFFFFF;
  font-size: 9.5px;
  padding: 6px 10px;
  text-align: center;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 25;
}

.iph-hero-section {
  padding: 38px 16px 20px;
  text-align: center;
  background: #FAFAF9;
}

.iph-hero-section h2 {
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 8px;
}

.iph-product-hero-img {
  width: 220px;
  height: 220px;
  object-fit: contain;
  margin: 12px auto;
  display: block;
}

.iph-price-tag {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 10px 0;
}

.iph-current-price {
  font-size: 24px;
  font-weight: 900;
  color: #10B981;
}

.iph-old-price {
  font-size: 14px;
  text-decoration: line-through;
  color: #9CA3AF;
}

.iph-btn-cta {
  display: block;
  width: 100%;
  padding: 12px;
  background: #10B981;
  color: #FFFFFF;
  border-radius: 8px;
  font-weight: 800;
  font-size: 13px;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.iph-section {
  padding: 20px 16px;
  border-bottom: 1px solid #E5E7EB;
}

.iph-section h3 {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 10px;
  text-align: center;
}

.iph-benefits-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.iph-benefit-item {
  background: #F3F4F6;
  padding: 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
}

.iph-comparison-table {
  width: 100%;
  font-size: 10px;
  border-collapse: collapse;
}

.iph-comparison-table th, .iph-comparison-table td {
  padding: 6px 8px;
  border: 1px solid #E5E7EB;
  text-align: center;
}

.iph-comparison-table th:first-child, .iph-comparison-table td:first-child {
  text-align: left;
}

.iph-testimonial-card {
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  font-size: 11px;
}

/* ANUNCIOS: ESTRUCTURAS GANADORAS RENDERIZADAS */
.ads-filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-clean);
  margin-bottom: 18px;
}

.ad-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
}

.btn-group-pill {
  display: flex;
  gap: 4px;
}

.filter-pill-btn {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-clean);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  color: var(--text-sub);
  cursor: pointer;
}

.filter-pill-btn.active {
  background: var(--emerald-primary);
  border-color: var(--emerald-primary);
  color: #062817;
  font-weight: 700;
}

.rendered-ads-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.ad-render-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
}

.ad-card-canvas-box {
  width: 100%;
  aspect-ratio: 1 / 1;
  position: relative;
  overflow: hidden;
  background: #111827;
}

.ad-render-card[data-format="4:5"] .ad-card-canvas-box {
  aspect-ratio: 4 / 5;
}

.ad-render-card[data-format="9:16"] .ad-card-canvas-box {
  aspect-ratio: 9 / 16;
}

.ad-card-footer {
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-clean);
  background: var(--bg-card);
}

.ad-card-footer h5 {
  font-size: 12px;
  color: var(--text-main);
  font-weight: 700;
}

/* 1. Estructura Testimonio WhatsApp */
.wa-ad-mockup {
  width: 100%;
  height: 100%;
  background: #ECE5DD;
  display: flex;
  flex-direction: column;
  position: relative;
  font-family: var(--font-sans);
}

.wa-header {
  background: #075E54;
  color: #FFFFFF;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.wa-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 14px;
}

.wa-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
}

.wa-online {
  font-size: 9.5px;
  color: #A7F3D0;
}

.wa-chat-area {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wa-bubble-in {
  align-self: flex-start;
  background: #FFFFFF;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 11px;
  color: #111827;
  max-width: 80%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.wa-bubble-img {
  align-self: flex-start;
  background: #FFFFFF;
  padding: 4px;
  border-radius: 8px;
  max-width: 75%;
}

.wa-bubble-img img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
}

.wa-bubble-out {
  align-self: flex-end;
  background: #DCF8C6;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 11px;
  color: #111827;
  max-width: 80%;
}

.wa-checks {
  font-size: 9px;
  color: #34B7F1;
  float: right;
  margin-left: 6px;
}

.wa-bottom-banner {
  background: #075E54;
  color: #FFFFFF;
  padding: 10px;
  text-align: center;
}

.wa-bottom-price {
  font-size: 16px;
  font-weight: 900;
  color: #25D366;
}

/* 2. Estructura Periódico Editorial */
.newspaper-ad-mockup {
  width: 100%;
  height: 100%;
  background: #FDFBF7;
  border: 4px double #1F2937;
  padding: 14px;
  display: flex;
  flex-direction: column;
  color: #111827;
  font-family: var(--font-serif);
}

.news-header-masthead {
  text-align: center;
  border-bottom: 2px solid #111827;
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.news-masthead-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.news-headline {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 8px;
  text-align: center;
}

.news-body-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: center;
}

.news-body-grid img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  filter: contrast(1.1);
}

.news-column p {
  font-size: 9.5px;
  line-height: 1.35;
  text-align: justify;
}

/* 3. Estructura Antes vs Después */
.before-after-ad-mockup {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  font-family: var(--font-sans);
}

.ba-col {
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.ba-col.before {
  background: #18181B;
  color: #F87171;
  border-right: 2px solid #EF4444;
}

.ba-col.after {
  background: #064E3B;
  color: #34D399;
}

.ba-title {
  font-size: 13px;
  font-weight: 900;
}

.ba-list {
  font-size: 10.5px;
  color: #F3F4F6;
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 4. Estructura Hero Arco & Podio */
.hero-podium-mockup {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 40%, rgba(0, 212, 126, 0.15) 0%, #090D16 80%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  position: relative;
  color: #FFFFFF;
}

.hp-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  text-align: center;
}

.hp-img-center {
  width: 180px;
  height: 180px;
  object-fit: contain;
  filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.6));
}

.hp-callouts {
  width: 100%;
  display: flex;
  justify-content: space-between;
}

.hp-callout-pill {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  padding: 4px 8px;
  border-radius: var(--radius-full);
  font-size: 9.5px;
  border: 1px solid var(--emerald-primary);
}

/* 5. Vista Previa Feed Meta Ads (Patrocinado) */
.feed-post-mockup {
  width: 100%;
  height: 100%;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  border: 1px solid var(--border-clean);
}

.feed-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}

.feed-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--emerald-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #000;
}

.feed-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.feed-sponsored {
  font-size: 9.5px;
  color: var(--text-muted);
}

.feed-copy-text {
  padding: 0 14px 10px;
  font-size: 11.5px;
  color: var(--text-main);
  line-height: 1.35;
}

.feed-media-box {
  flex: 1;
  background: #000;
  overflow: hidden;
}

.feed-media-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed-cta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-card-subtle);
  border-top: 1px solid var(--border-clean);
}

/* PESTAÑA 3: COPYS EN TRIPLETS */
.copys-triplet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.copy-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.copy-badge-type {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.copy-badge-type.problema { background: rgba(239, 68, 68, 0.15); color: #EF4444; }
.copy-badge-type.beneficio { background: rgba(16, 185, 129, 0.15); color: #10B981; }
.copy-badge-type.social { background: rgba(59, 130, 246, 0.15); color: #3B82F6; }

.copy-block {
  margin-bottom: 12px;
}

.copy-label {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.copy-val {
  font-size: 12px;
  color: var(--text-main);
  line-height: 1.4;
}

/* PESTAÑA 4: VIDEOS UGC & SIMULADOR 9:16 */
.ugc-video-workspace {
  display: grid;
  grid-template-columns: 240px 380px 1fr;
  gap: 24px;
  align-items: start;
}

.ugc-styles-sidebar h4, .ugc-broll-panel h4 {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
}

.ugc-style-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition-fast);
}

.ugc-style-card:hover {
  border-color: var(--emerald-primary);
}

.ugc-style-card.active {
  border-color: var(--emerald-primary);
  background: rgba(0, 212, 126, 0.05);
}

.ugc-style-card strong {
  font-size: 12px;
  display: block;
  color: var(--text-main);
}

.ugc-style-card p {
  font-size: 10px;
  color: var(--text-muted);
}

.video-mockup-916 {
  width: 340px;
  height: 600px;
  background: #000000;
  border-radius: 36px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
  margin: 0 auto;
  border: 4px solid #27272A;
  display: flex;
  flex-direction: column;
}

.video-overlay-badges {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  z-index: 20;
}

.v-badge-time {
  font-size: 10px;
  color: #FFFFFF;
  background: rgba(0, 0, 0, 0.6);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.v-badge-live {
  font-size: 10px;
  font-weight: 800;
  color: #EF4444;
  background: rgba(0, 0, 0, 0.6);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.video-scene-content {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.scene-backdrop {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #18181B 0%, #09090B 100%);
}

.scene-visual-product {
  position: relative;
  z-index: 5;
  width: 200px;
  height: 200px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.7));
  animation: floatProduct 3s ease-in-out infinite alternate;
}

@keyframes floatProduct {
  from { transform: translateY(-6px); }
  to { transform: translateY(6px); }
}

.tiktok-captions-box {
  position: absolute;
  bottom: 80px;
  left: 16px;
  right: 16px;
  text-align: center;
  z-index: 10;
  line-height: 1.3;
}

.caption-word {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 900;
  color: #FFFFFF;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
  text-transform: uppercase;
  margin: 0 2px;
}

.caption-word.hl {
  color: #FACC15;
}

.video-player-controls {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 20;
}

.btn-play-pause {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--emerald-primary);
  border: none;
  color: #062817;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-audio-speak {
  flex: 1;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #FFFFFF;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-audio-speak:hover {
  background: rgba(255, 255, 255, 0.3);
}

.broll-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.broll-item {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.broll-time {
  font-size: 9.5px;
  font-weight: 800;
  color: var(--emerald-primary);
}

.broll-desc {
  font-size: 11.5px;
  color: var(--text-main);
  margin-top: 2px;
}

/* TABLA STORYBOARD */
.storyboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.storyboard-table th, .storyboard-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-clean);
  text-align: left;
}

.storyboard-table th {
  background: var(--bg-card-subtle);
  font-weight: 800;
  color: var(--text-sub);
}

.aduanas-scores-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.aduana-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-clean);
  border-radius: var(--radius-md);
  padding: 16px;
}

.aduana-box h5 {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 10px;
}

.score-circle {
  font-size: 28px;
  font-weight: 900;
  color: var(--emerald-primary);
  margin-bottom: 10px;
}

.score-circle span {
  font-size: 14px;
  color: var(--text-muted);
}

.aduana-box ul {
  list-style: none;
  font-size: 11.5px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-sub);
}

/* ========================================================
   9. VISTA 5: 🧪 MIS TESTEOS (11 SWITCHES DE VIABILIDAD)
   ======================================================== */
.testeos-workspace-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 24px;
}

.test-product-selector-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-clean);
}

.test-group-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
}

.test-group-weight {
  font-size: 10.5px;
  color: var(--emerald-primary);
}

.test-switches-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.test-switch-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-clean);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  cursor: pointer;
}

.ts-info {
  display: flex;
  flex-direction: column;
  max-width: 82%;
}

.ts-info strong {
  font-size: 12px;
  color: var(--text-main);
}

.ts-info span {
  font-size: 10.5px;
  color: var(--text-muted);
}

/* Switches Toggles */
.switch-slider {
  position: relative;
  width: 38px;
  height: 20px;
  background: #CBD5E1;
  border-radius: var(--radius-full);
  transition: var(--transition-fast);
  flex-shrink: 0;
}

body.dark-theme .switch-slider {
  background: #334155;
}

.switch-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background: #FFFFFF;
  transition: var(--transition-fast);
}

input:checked + .switch-slider {
  background: var(--emerald-primary);
}

input:checked + .switch-slider::before {
  transform: translateX(18px);
}

/* Círculo de Viabilidad SVG */
.viability-summary-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.viability-gauge-box {
  width: 160px;
  height: 160px;
  position: relative;
  margin: 16px auto;
}

.viability-circle-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.circle-bg {
  fill: none;
  stroke: var(--bg-card-subtle);
  stroke-width: 12;
}

.circle-progress {
  fill: none;
  stroke: var(--emerald-primary);
  stroke-width: 12;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}

.gauge-center-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gauge-pct {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  color: var(--emerald-primary);
}

.gauge-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.verdict-banner-box {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  margin-bottom: 20px;
}

.verdict-banner-box.success {
  background: rgba(0, 212, 126, 0.1);
  border: 1px solid var(--emerald-primary);
}

.v-icon {
  font-size: 24px;
}

.verdict-banner-box h5 {
  font-size: 13px;
  font-weight: 800;
  color: var(--emerald-primary);
}

.verdict-banner-box p {
  font-size: 11px;
  color: var(--text-sub);
}

.quick-test-calc {
  width: 100%;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: left;
}

.quick-test-calc h5 {
  font-size: 11.5px;
  font-weight: 800;
  margin-bottom: 8px;
}

.mini-kpis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mini-kpi {
  background: var(--bg-card);
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-clean);
  display: flex;
  flex-direction: column;
}

.mini-kpi span { font-size: 9.5px; color: var(--text-muted); }
.mini-kpi strong { font-size: 11.5px; color: var(--text-main); }

/* ========================================================
   10. VISTA 6: 🔍 BÚSQUEDA DE PRODUCTOS (WINNERS & RADAR)
   ======================================================== */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.clean-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.clean-table th, .clean-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-clean);
  text-align: left;
}

.clean-table th {
  background: var(--bg-card-subtle);
  font-weight: 800;
  color: var(--text-sub);
}

.winners-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.winner-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.w-badge-num {
  font-size: 11px;
  font-weight: 800;
  background: var(--emerald-primary);
  color: #062817;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.w-chart-svg {
  width: 100%;
  height: 60px;
  margin: 10px 0;
}

.radar-kpis-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.radar-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  box-shadow: var(--card-shadow);
}

.radar-kpi-card.highlight {
  border-color: var(--emerald-primary);
}

.rk-val {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  color: var(--text-main);
  display: block;
}

.radar-kpi-card.highlight .rk-val {
  color: var(--emerald-primary);
}

.rk-lbl {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-muted);
}

.radar-search-bar {
  display: flex;
  gap: 10px;
}

/* ========================================================
   11. VISTA 7: 🎨 ESTUDIO DE CAPAS (CANVA)
   ======================================================== */
.editor-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 16px;
  box-shadow: var(--card-shadow);
}

.editor-tools-left, .editor-tools-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.editor-control-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.editor-control-group label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
}

.editor-workspace {
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  gap: 18px;
  height: calc(100vh - 170px);
}

.editor-layers-panel, .editor-props-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

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

.panel-header h4 {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-main);
}

.layers-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.layer-item-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-clean);
  font-size: 11px;
  cursor: pointer;
  color: var(--text-main);
  transition: var(--transition-fast);
}

.layer-item-btn.selected {
  border-color: var(--emerald-primary);
  background: rgba(0, 212, 126, 0.1);
  font-weight: 700;
}

.layers-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--border-clean);
  display: flex;
  gap: 4px;
}

.editor-canvas-container {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

.canvas-viewport {
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

#designerCanvas {
  display: block;
  width: 520px;
  height: 520px;
  background: #FFFFFF;
}

.canvas-overlay-safezones {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.safe-zone-top, .safe-zone-bottom {
  background: rgba(239, 68, 68, 0.15);
  border: 1px dashed rgba(239, 68, 68, 0.4);
  font-size: 9px;
  color: #EF4444;
  text-align: center;
  padding: 2px;
}

.safe-zone-top { height: 14%; }
.safe-zone-bottom { height: 22%; }

.props-body {
  padding: 12px;
  flex: 1;
  overflow-y: auto;
}

.quick-content-box {
  padding: 12px;
  border-top: 1px solid var(--border-clean);
  background: var(--bg-card-subtle);
}

.quick-content-box h5 {
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 8px;
}

/* ========================================================
   12. VISTA 8: 🧬 MIS MARCAS (ADN Y FICHA EDITORIAL EN VIVO)
   ======================================================== */
.marcas-view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.marcas-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.brand-switcher-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-clean);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.brand-switcher-wrapper label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-sub);
  white-space: nowrap;
}

.btn-delete-brand-header {
  color: var(--danger-accent, #EF4444) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
}

.btn-delete-brand-header:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: var(--danger-accent, #EF4444) !important;
}

.form-row-palette-6 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.form-row-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

@media (max-width: 900px) {
  .form-row-palette-6 {
    grid-template-columns: repeat(3, 1fr);
  }
  .form-row-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .form-row-palette-6 {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-row-4 {
    grid-template-columns: 1fr;
  }
}

/* Ficha Editorial de Marca Activa */
.active-brand-sheet {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--card-shadow);
  margin-bottom: 30px;
}

.active-brand-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-clean);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.active-brand-identity-badge {
  display: flex;
  align-items: center;
  gap: 14px;
}

.active-brand-avatar-box {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-clean);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-card-subtle);
}

.active-brand-meta h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 2px 0;
}

.active-brand-meta p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

.active-brand-section-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-clean);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 20px;
}

.active-brand-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-weight: 800;
  font-size: 13.5px;
  color: var(--text-main);
}

.active-logos-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 960px) {
  .active-logos-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .active-logos-grid {
    grid-template-columns: 1fr;
  }
}

.active-logo-card {
  background: var(--bg-card);
  border: 1px solid var(--border-clean);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.active-logo-card-header span {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main);
}

.logo-preview-box {
  height: 84px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6px;
  transition: var(--transition-fast);
}

.logo-preview-box.on-dark {
  background: #0B1D13;
  border: 1px solid #1E293B;
}

.logo-preview-box.on-light {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
}

.logo-preview-box.neutral {
  background: rgba(148, 163, 184, 0.08);
  border: 1px dashed var(--border-clean);
}

.active-palette-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

@media (max-width: 960px) {
  .active-palette-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 560px) {
  .active-palette-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.active-color-card {
  background: var(--bg-card);
  border: 1px solid var(--border-clean);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  text-align: center;
}

.active-color-card label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
}

.active-color-card input[type="color"] {
  width: 44px;
  height: 36px;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  background: transparent;
}

.active-specimen-card {
  background: var(--bg-card);
  border: 1px solid var(--border-clean);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-top: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.specimen-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.specimen-display-box {
  border-radius: var(--radius-sm);
  padding: 24px;
  transition: var(--transition-fast);
  border: 1px solid var(--border-clean);
}

.active-review-photos-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.active-review-photo-item {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-xs);
  overflow: hidden;
  border: 1px solid var(--border-clean);
  background: var(--bg-card);
}

.active-review-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-remove-review-photo {
  position: absolute;
  top: 3px;
  right: 3px;
  background: rgba(239, 68, 68, 0.9);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-full);
  width: 18px;
  height: 18px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.btn-remove-review-photo:hover {
  background: #DC2626;
}

.active-brand-actions-bar {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-clean);
}

.installed-custom-font-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-clean);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
}

.brands-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.brand-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--card-shadow);
}

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

.brand-title-group h4 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.brand-title-group span {
  font-size: 11px;
  color: var(--text-muted);
}

.brand-palette-strip {
  display: flex;
  gap: 6px;
  margin: 12px 0;
}

.palette-swatch-box {
  flex: 1;
  height: 32px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #FFFFFF;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* ========================================================
   13. VISTA 9: 💰 FINANZAS & LOGÍSTICA
   ======================================================== */
.finance-calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.finance-results-box {
  background: var(--bg-card);
}

.kpi-metric-hero {
  text-align: center;
  padding: 18px;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 18px;
}

.hero-lbl {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.hero-val {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  color: var(--emerald-primary);
  display: block;
}

.hero-sub {
  font-size: 11px;
  color: var(--text-sub);
}

.finance-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
}

.f-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border-clean);
}

.f-divider {
  border-top: 2px solid var(--border-clean);
  padding-top: 10px;
  font-weight: 800;
}

.finance-kpis-quad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.f-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--card-shadow);
}

.f-kpi-card.highlight {
  border-color: var(--emerald-primary);
}

.fk-title { font-size: 11px; color: var(--text-muted); }
.fk-value { font-family: var(--font-display); font-size: 20px; font-weight: 900; color: var(--text-main); margin-top: 4px; display: block; }
.fk-sub { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.text-emerald { color: var(--emerald-primary) !important; }

.chart-bars-container {
  height: 160px;
  display: flex;
  align-items: flex-end;
  gap: 18px;
  padding-top: 20px;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.bar-fill {
  width: 100%;
  border-radius: 4px 4px 0 0;
  background: var(--emerald-primary);
  transition: height 0.4s ease;
}

.bar-lbl {
  font-size: 10px;
  color: var(--text-muted);
}

/* ========================================================
   14. VISTA 10: 🔌 REPOSITORIOS PLUG & PLAY
   ======================================================== */
.repos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.repo-card-pnp {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.pnp-title h4 {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
}

.pnp-title span {
  font-size: 10.5px;
  color: var(--text-muted);
}

.pnp-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

/* ========================================================
   15. VISTA 11: 🧰 CAJA DE HERRAMIENTAS
   ======================================================== */
.tools-section-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
}

.tools-grid-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: var(--card-shadow);
  position: relative;
}

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

.tool-card.highlight-card {
  border-color: var(--emerald-primary);
}

.tool-icon {
  font-size: 24px;
  margin-bottom: 8px;
  display: block;
}

.tool-card h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.tool-card p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

.tool-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 9px;
  font-weight: 800;
  background: var(--bg-card-subtle);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  color: var(--emerald-primary);
}

.webp-result-box {
  margin-top: 8px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ========================================================
   16. BOTÓN FLOTANTE & DRAWER CONVERSACIONAL HERMES
   ======================================================== */
.hermes-floating-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0D1117;
  color: #FFFFFF;
  border: 1px solid var(--emerald-primary);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 8px 24px var(--emerald-glow);
  z-index: 100;
  transition: var(--transition-fast);
}

.hermes-floating-launcher:hover {
  transform: scale(1.05);
}

.launcher-avatar {
  font-size: 16px;
}

.launcher-text {
  font-size: 12px;
  font-weight: 800;
  color: #FFFFFF;
}

.launcher-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background: var(--emerald-primary);
  box-shadow: 0 0 6px var(--emerald-primary);
}

.hermes-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  z-index: 150;
  display: flex;
  justify-content: flex-end;
}

.hermes-drawer-dialog {
  width: 380px;
  height: 100%;
  background: var(--bg-card);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  animation: slideLeft 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideLeft {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

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

.drawer-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-composer {
  padding: 12px;
  border-top: 1px solid var(--border-clean);
  display: flex;
  gap: 8px;
}

.drawer-composer textarea {
  flex: 1;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-clean);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 12px;
  outline: none;
  resize: none;
}

/* ========================================================
   17. MODALES & TOAST NOTIFICATION
   ======================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-dialog {
  width: 580px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.modal-dialog-full {
  width: 95vw;
  height: 90vh;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-clean);
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--border-clean);
}

.modal-body-iframe {
  flex: 1;
}

.modal-body-iframe iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: var(--radius-sm);
}

.form-section-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--emerald-primary);
  margin: 14px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-row-palette {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.color-picker-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-clean);
  padding: 6px;
  border-radius: var(--radius-xs);
  text-align: center;
}

.color-picker-box label {
  font-size: 9px;
  display: block;
}

.color-picker-box input[type="color"] {
  width: 100%;
  height: 24px;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  background: transparent;
}

.color-hex-label {
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.toast-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #0D1117;
  color: #FFFFFF;
  border: 1px solid var(--emerald-primary);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 300;
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.hidden {
  display: none !important;
}

/* ========================================================
   RESPONSIVE MÓVIL / TABLET COMPACTA (<= 900px)
   ======================================================== */
@media (max-width: 900px) {
  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 220;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  }
  body.mobile-nav-open .app-sidebar {
    transform: translateX(0);
  }
  .notebook-spine {
    display: none;
  }
  .app-main-wrapper {
    width: 100%;
    min-width: 0;
  }
  .app-topbar {
    height: auto;
    min-height: 52px;
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .topbar-right {
    flex-wrap: wrap;
    gap: 6px;
  }
  .active-brand-badge,
  .view-current-sub {
    display: none;
  }
  .view-section {
    padding: 12px !important;
  }
}

/* ========================================================
   SD AGENCY v4.2 · REDISEÑO VISUAL LIMPIO Y SIMPLIFICADO
   ======================================================== */
body.light-theme {
  --bg-main: #F3F6FA;
  --bg-card: #FFFFFF;
  --bg-card-subtle: #F8FAFC;
  --border-clean: #E2E8F0;
  --border-card: #E2E8F0;
  --text-main: #0F172A;
  --text-sub: #334155;
  --text-muted: #64748B;
}

body.light-theme .app-main-content {
  background-color: #F3F6FA;
  background-image: none;
}

.notebook-spine {
  display: none !important;
}

/* Cajón colapsable "Más herramientas" en el Sidebar */
.sidebar-more-tools-drawer {
  margin-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
}

.sidebar-more-tools-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: #94A3B8;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: var(--transition-fast);
}

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

.sidebar-more-tools-summary:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.07);
}

.sidebar-more-tools-drawer[open] .more-tools-chevron {
  transform: rotate(180deg);
}

.sidebar-more-tools-body {
  margin-top: 6px;
  padding-left: 4px;
}

/* Atajos rápidos en el Topbar */
.topbar-quick-create-strip {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-topbar-quick {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-clean);
  color: var(--text-main);
  padding: 5px 11px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-topbar-quick:hover {
  border-color: var(--emerald-primary);
  transform: translateY(-1px);
}

.btn-topbar-quick.primary {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.45);
  color: #059669;
}

body.dark-theme .btn-topbar-quick.primary {
  color: #34D399;
}

/* Hero Hub en Inicio (4 tarjetas grandes y limpias) */
.home-hero-hub {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 8px 24px -6px rgba(15, 23, 42, 0.05);
  margin-bottom: 20px;
}

.home-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.home-kicker-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #059669;
  background: rgba(16, 185, 129, 0.12);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
}

body.dark-theme .home-kicker-pill {
  color: #34D399;
}

.home-hero-header h3 {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.home-hero-header p {
  font-size: 13px;
  color: var(--text-sub);
  margin-top: 4px;
}

.home-hero-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.quick-launch-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 1200px) {
  .quick-launch-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .quick-launch-grid {
    grid-template-columns: 1fr;
  }
}

.ql-card {
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--border-clean);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.ql-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px -6px rgba(15, 23, 42, 0.1);
}

.ql-card.ql-emerald:hover { border-color: #10B981; }
.ql-card.ql-blue:hover { border-color: #3B82F6; }
.ql-card.ql-purple:hover { border-color: #8B5CF6; }
.ql-card.ql-amber:hover { border-color: #F59E0B; }

.ql-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.ql-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  background: var(--bg-card);
  border: 1px solid var(--border-clean);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.ql-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
}

.ql-emerald .ql-badge { background: rgba(16, 185, 129, 0.14); color: #059669; }
.ql-blue .ql-badge { background: rgba(59, 130, 246, 0.14); color: #2563EB; }
.ql-purple .ql-badge { background: rgba(139, 92, 246, 0.14); color: #7C3AED; }
.ql-amber .ql-badge { background: rgba(245, 158, 11, 0.14); color: #D97706; }

body.dark-theme .ql-emerald .ql-badge { color: #34D399; }
body.dark-theme .ql-blue .ql-badge { color: #60A5FA; }
body.dark-theme .ql-purple .ql-badge { color: #A78BFA; }
body.dark-theme .ql-amber .ql-badge { color: #FBBF24; }

.ql-card h4 {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.ql-card p {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.45;
  margin-bottom: 12px;
}

.ql-deliverables {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  padding-top: 10px;
  border-top: 1px dashed var(--border-clean);
  margin-bottom: 14px;
}

.ql-cta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-clean);
  color: var(--text-main);
  transition: var(--transition-fast);
}

.ql-card:hover .ql-cta-row {
  background: #0F172A;
  color: #FFFFFF;
  border-color: #0F172A;
}

body.dark-theme .ql-card:hover .ql-cta-row {
  background: var(--emerald-primary);
  color: #062817;
  border-color: var(--emerald-primary);
}

/* Fila Resumen de Marca Activa + Trabajos Recientes */
.home-workspace-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 18px;
  margin-bottom: 20px;
}

@media (max-width: 960px) {
  .home-workspace-row {
    grid-template-columns: 1fr;
  }
}

/* Modo de una sola columna para Hermes cuando no hay entrega activa */
.hermes-duo-layout.single-col-mode {
  grid-template-columns: 1fr;
}

.hermes-duo-layout.single-col-mode .hermes-chat-box {
  height: 360px;
}

/* ==========================================================================
   FASE 4 · CREAR VIDEO (VID-02, VID-03, VID-05, VID-06)
   Galería de Estructuras Reproducibles, Zona Segura 56% y Subtítulos Animados CSS
   ========================================================================== */
.sd-safe-zone-56-notice {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(16, 185, 129, 0.42);
  background: rgba(16, 185, 129, 0.08);
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-main);
}

.sd-video-struct-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 14px;
}

.sd-video-struct-card {
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--bg-card, #ffffff);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.sd-video-struct-card:hover {
  border-color: rgba(16, 185, 129, 0.55);
  transform: translateY(-1px);
}

.sd-video-struct-card.is-selected {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.06);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.14);
}

.sd-video-struct-preview {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(155deg, #0f172a 0%, #1e293b 55%, #064e3b 100%);
  aspect-ratio: 16 / 10;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sd-video-struct-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sd-video-struct-play-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.sd-video-struct-play-btn:hover {
  background: #10b981;
  transform: scale(1.04);
}

/* Muestrario Animado de 4 Estilos de Subtítulos (VID-03) */
.sd-sub-sampler-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.sd-sub-card {
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--bg-card, #ffffff);
  padding: 10px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.sd-sub-card.is-selected {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.06);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.14);
}

.sd-sub-stage {
  position: relative;
  height: 68px;
  border-radius: 9px;
  background: radial-gradient(circle at 50% 25%, #1e293b 0%, #090d16 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
  margin-bottom: 8px;
}

/* 1. karaoke — Karaoke palabra por palabra */
.sd-sub-preview-karaoke {
  display: inline-flex;
  gap: 5px;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: #ffffff;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.85);
}

.sd-sub-preview-karaoke .sd-kw {
  padding: 2px 5px;
  border-radius: 5px;
  animation: sdKaraokeWordHighlight 2.4s infinite ease-in-out;
}

.sd-sub-preview-karaoke .sd-kw:nth-child(1) { animation-delay: 0s; }
.sd-sub-preview-karaoke .sd-kw:nth-child(2) { animation-delay: 0.8s; }
.sd-sub-preview-karaoke .sd-kw:nth-child(3) { animation-delay: 1.6s; }

@keyframes sdKaraokeWordHighlight {
  0%, 30% {
    background: #10b981;
    color: #052e16;
    transform: scale(1.1);
  }
  36%, 100% {
    background: transparent;
    color: #ffffff;
    transform: scale(1);
  }
}

/* 2. pop_elastico — Pop elástico */
.sd-sub-preview-pop_elastico {
  display: inline-block;
  font-weight: 900;
  font-size: 14px;
  text-transform: uppercase;
  color: #facc15;
  -webkit-text-stroke: 1px #0f172a;
  text-shadow: 0 3px 0 #0f172a, 0 5px 10px rgba(0, 0, 0, 0.65);
  animation: sdPopElasticoBounce 1.8s infinite cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes sdPopElasticoBounce {
  0% { transform: scale(0.72); opacity: 0.65; }
  35% { transform: scale(1.14) rotate(-1.5deg); opacity: 1; }
  65% { transform: scale(0.98) rotate(0.5deg); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* 3. caja_limpia — Caja limpia */
.sd-sub-preview-caja_limpia {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #f8fafc;
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  animation: sdCajaLimpiaSlide 2.6s infinite ease-in-out;
}

@keyframes sdCajaLimpiaSlide {
  0% { transform: translateY(6px); opacity: 0.5; }
  18%, 82% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-3px); opacity: 0.7; }
}

/* 4. marca_resaltado — Resaltado con HEX y tipografía .ttf/.otf de la Marca Activa */
.sd-sub-preview-marca_resaltado {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--sd-brand-font, 'Montserrat', sans-serif);
  font-size: 13px;
  font-weight: 900;
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--sd-brand-primary, #1e3a8a);
  border: 2px solid var(--sd-brand-accent, #f59e0b);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.35);
  animation: sdMarcaResaltadoGlow 2.2s infinite ease-in-out;
}

.sd-sub-preview-marca_resaltado .sd-brand-pill {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--sd-brand-accent, #f59e0b);
  color: #090d16;
  font-weight: 900;
}

@keyframes sdMarcaResaltadoGlow {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.06); filter: brightness(1.12); }
}

/* Aduana Visual de Keyframes 6C y Zona Segura Central 56 % (VID-05) */
.sd-keyframe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.sd-keyframe-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 290px;
  border-radius: 10px;
  overflow: hidden;
  background: #090d16;
  border: 1px solid var(--border);
  margin-bottom: 8px;
}

.sd-keyframe-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Modo de voz por escena (voz en off / en vivo) y aviso de fotograma desactualizado */
.sd-scene-voice-mode {
  margin-top: 8px;
}

.sd-scene-voice-mode-label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 4px;
}

.sd-scene-voice-mode-options {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sd-scene-voice-mode-option {
  flex: 1 1 100px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  line-height: 1.3;
}

.sd-scene-voice-mode-option.is-active {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.14);
}

.sd-scene-voice-mode-option:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.sd-scene-voice-mode-warning {
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  font-size: 11px;
  font-weight: 700;
}

.sd-live-speech-help {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-sub);
}

/* Selectores de modelo «al crear la pieza» (fotogramas en el paso 4, persona hablando en el paso 5). */
.sd-create-model-picker {
  margin: 10px 0 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.sd-create-model-picker > label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-main);
}
.sd-create-model-picker select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.sd-create-model-help {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-sub);
}
.sd-create-model-note {
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.45;
  color: #b45309;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
  padding: 6px 8px;
}

.sd-safe-zone-overlay {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 22%;
  bottom: 22%;
  border: 1.5px dashed rgba(16, 185, 129, 0.85);
  border-radius: 8px;
  pointer-events: none;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 4px 6px;
}

.sd-safe-zone-overlay span {
  font-size: 9px;
  font-weight: 800;
  background: rgba(9, 13, 22, 0.78);
  color: #34d399;
  padding: 1px 5px;
  border-radius: 4px;
}

/* Tarjetas de Animación por Escenas en Paso 5 (VID-06) */
.sd-scene-clip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 14px;
  text-align: left;
}

.sd-scene-clip-card {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card, #ffffff);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}


/* «Regenerar esta pieza» en el resultado del asistente de imágenes */
.sd-regen-btn-destacado {
  background: #dc2626;
  border: 1px solid #b91c1c;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}

.sd-regen-btn-destacado:hover:not(:disabled) {
  background: #b91c1c;
}

.sd-regen-generando {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px dashed #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  font-size: 11.5px;
  font-weight: 800;
  text-align: left;
}

.sd-regen-panel {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  text-align: left;
}

.sd-regen-panel textarea {
  width: 100%;
  resize: vertical;
  font-size: 12px;
}
