/* ═════════════════════════════════════════════════════════════════════════
   ESTILO NATIVO DE CHAINLIT (DESIGN SYSTEM SHADCN / RADIX)
   ═════════════════════════════════════════════════════════════════════════ */

/* ─── BARRA DE PROMPT Y CONTROLES VISUALES (IMAGEN Y VIDEO) ──────────── */

.higgsfield-prompt-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 10px 8px 10px;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  user-select: none;
  font-family: inherit;
  animation: hgFade 0.15s ease-out;
}

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

/* Selector de Modos: Crear Imagen / Crear Video */
.hg-mode-selector {
  display: flex;
  align-items: center;
  gap: 3px;
  background: hsl(var(--muted) / 0.5);
  padding: 2px;
  border-radius: 8px;
  border: 1px solid hsl(var(--border));
  margin-right: 2px;
}

.hg-mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: hsl(var(--muted-foreground));
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
  font-family: inherit;
}

.hg-mode-tab:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--accent));
}

.hg-mode-tab.image-active,
.hg-mode-tab.video-active {
  background: hsl(var(--background));
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.hg-mode-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  font-size: 9px;
  font-weight: 700;
  margin-left: 4px;
  transition: all 0.15s ease;
  line-height: 1;
}

.hg-mode-tab:hover .hg-mode-close {
  background: hsl(var(--destructive) / 0.85);
  color: hsl(var(--destructive-foreground));
}

.hg-options-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  animation: hgFade 0.15s ease-out;
}

.hg-options-group.hidden {
  display: none !important;
}

/* Pills de Configuración */
.hg-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  background: hsl(var(--secondary) / 0.6);
  color: hsl(var(--secondary-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
}

.hg-pill:hover,
.hg-pill.active,
.hg-pill.open {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  border-color: hsl(var(--border));
}

.hg-chevron {
  opacity: 0.6;
  transition: transform 0.15s ease;
  margin-left: 2px;
}

.hg-pill.open .hg-chevron {
  transform: rotate(-90deg);
}

/* Stepper de cantidad */
.hg-stepper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px;
  background: hsl(var(--secondary) / 0.6);
  color: hsl(var(--secondary-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  user-select: none;
}

.hg-step-btn {
  background: none;
  border: none;
  color: hsl(var(--muted-foreground));
  font-size: 13px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.15s;
}

.hg-step-btn:hover {
  color: hsl(var(--foreground));
}

/* Menús Desplegables / Popovers (Despliegan hacia arriba) */
.hg-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  top: auto;
  left: 0;
  z-index: 999999;
  background: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  padding: 6px;
  min-width: 250px;
  max-height: min(420px, 60vh);
  overflow-y: auto;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
  display: none;
  font-family: inherit;
  animation: hgPopoverUp 0.15s ease-out;
}

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

.hg-popover.show {
  display: block;
}

.hg-popover-header {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  padding: 4px 6px 6px 6px;
  border-bottom: 1px solid hsl(var(--border) / 0.6);
  margin-bottom: 4px;
}

.hg-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 5px;
  font-size: 12px;
  color: hsl(var(--popover-foreground));
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.hg-menu-item:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.hg-menu-item.selected {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  font-weight: 600;
}

.hg-inject-btn {
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #d8b4fe;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.hg-inject-btn:hover {
  background: rgba(168, 85, 247, 0.35);
  border-color: rgba(168, 85, 247, 0.7);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Grid para Aspect Ratio */
.hg-ratio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  min-width: 240px;
  padding: 2px;
}

.hg-ratio-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 7px 4px;
  background: hsl(var(--secondary) / 0.4);
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hg-ratio-card:hover {
  background: hsl(var(--accent));
  border-color: hsl(var(--border));
}

.hg-ratio-card.selected {
  background: hsl(var(--accent));
  border-color: hsl(var(--ring));
}

.hg-box {
  background: hsl(var(--muted-foreground) / 0.3);
  border: 1px solid hsl(var(--muted-foreground) / 0.6);
  border-radius: 2px;
  margin-bottom: 4px;
}

.hg-box.b-auto  { width: 18px; height: 18px; border-style: dashed; }
.hg-box.b-1-1   { width: 18px; height: 18px; }
.hg-box.b-16-9  { width: 24px; height: 14px; }
.hg-box.b-9-16  { width: 14px; height: 24px; }
.hg-box.b-4-3   { width: 20px; height: 15px; }
.hg-box.b-3-4   { width: 15px; height: 20px; }
.hg-box.b-21-9  { width: 26px; height: 12px; }

.hg-rtitle {
  font-size: 11px;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.hg-rdesc {
  font-size: 9px;
  color: hsl(var(--muted-foreground));
}

/* ═════════════════════════════════════════════════════════════════════════
   BARRA SUPERIOR (HEADER) — ESTILO IDÉNTICO A LOS BOTONES DE CHAINLIT
   ═════════════════════════════════════════════════════════════════════════ */

.hg-header-bar {
  position: fixed;
  top: 0;
  /* Chainlit ocupa left (nueva-conversación) y right (Léeme + tema)
     Nos centramos justo en el medio de la barra nativa de Chainlit.
     El ancho del header nativo es 100vw; Chainlit pone sus botones en
     los extremos. Dejamos margen para no chocarlos. */
  left: 50%;
  transform: translateX(-50%);
  height: 60px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 50;
  pointer-events: auto;
}

.hg-header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px;
  background: transparent;
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.hg-header-btn:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  border-color: hsl(var(--border));
}

.hg-header-btn.primary {
  background: hsl(var(--primary) / 0.12);
  border-color: hsl(var(--primary) / 0.35);
  color: hsl(var(--foreground));
}

.hg-header-btn.primary:hover {
  background: hsl(var(--primary) / 0.22);
  border-color: hsl(var(--primary));
  color: hsl(var(--foreground));
}

.hg-header-btn.info-btn {
  background: transparent;
  border-color: hsl(var(--border));
  color: hsl(var(--muted-foreground));
}

.hg-header-btn.info-btn:hover,
.hg-header-btn.info-btn.active {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  border-color: hsl(var(--ring) / 0.6);
}

.session-count-badge {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 9999px;
  font-weight: 600;
}

.hg-header-btn.user-btn {
  background: transparent;
  color: hsl(var(--muted-foreground));
  border-color: hsl(var(--border));
  margin-left: 4px;
}

.hg-header-btn.user-btn:hover {
  background: hsl(var(--destructive) / 0.12);
  border-color: hsl(var(--destructive) / 0.35);
  color: hsl(var(--destructive));
}


/* ═════════════════════════════════════════════════════════════════════════
   MODALES (SESIONES E INFO) — ESTILO SHADCN DIALOG
   ═════════════════════════════════════════════════════════════════════════ */

.session-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.session-modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.session-modal-box,
.info-modal-box {
  width: 90%;
  max-width: 720px;
  max-height: 85vh;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  border-radius: 10px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: inherit;
  transform: scale(0.97);
  transition: transform 0.15s ease;
}

.session-modal-backdrop.show .session-modal-box,
.session-modal-backdrop.show .info-modal-box {
  transform: scale(1);
}

.session-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid hsl(var(--border));
}

.session-modal-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: hsl(var(--foreground));
  display: flex;
  align-items: center;
  gap: 8px;
}

.session-modal-close {
  background: transparent;
  border: none;
  color: hsl(var(--muted-foreground));
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.session-modal-close:hover {
  background: hsl(var(--accent));
  color: hsl(var(--foreground));
}

.session-modal-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.25);
}

.session-search,
.sidebar-search-input {
  flex: 1;
  height: 34px;
  background: hsl(var(--muted) / 0.5);
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  padding: 0 10px;
  color: hsl(var(--foreground));
  font-size: 12.5px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}

.session-search:focus,
.sidebar-search-input:focus {
  border-color: hsl(var(--ring));
}

.session-modal-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Tarjeta de Sesión */
.session-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: hsl(var(--card) / 0.4);
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  transition: all 0.15s ease;
}

.session-card:hover {
  background: hsl(var(--accent) / 0.5);
  border-color: hsl(var(--border));
}

.session-card-left {
  flex: 1;
  min-width: 0;
  margin-right: 10px;
}

.session-card-title {
  font-size: 13px;
  font-weight: 500;
  color: hsl(var(--foreground));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.session-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: hsl(var(--muted-foreground));
}

.session-card-model {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
}

.session-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-session-action {
  background: hsl(var(--secondary));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--secondary-foreground));
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 11.5px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.btn-session-action:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.btn-session-action.primary {
  background: hsl(var(--primary) / 0.12);
  border-color: hsl(var(--primary) / 0.35);
  color: hsl(var(--foreground));
}

.btn-session-action.primary:hover {
  background: hsl(var(--primary) / 0.22);
  border-color: hsl(var(--primary));
}

.session-card.active-session {
  border-color: hsl(var(--primary) / 0.6);
  background: hsl(var(--primary) / 0.08);
}

.session-badge-active {
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 9999px;
  margin-left: 6px;
}

.btn-session-action.delete:hover {
  background: hsl(var(--destructive) / 0.15);
  border-color: hsl(var(--destructive) / 0.4);
  color: hsl(var(--destructive));
}

.session-empty {
  text-align: center;
  padding: 30px 10px;
  color: hsl(var(--muted-foreground));
  font-size: 13px;
}

/* ─── CUERPO DEL MODAL DE INFORMACIÓN (GUÍA) ─────────────────────────── */

.system-info-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  color: hsl(var(--muted-foreground));
  font-size: 13px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.system-info-modal-body::-webkit-scrollbar {
  width: 6px;
}

.system-info-modal-body::-webkit-scrollbar-thumb {
  background: hsl(var(--border));
  border-radius: 3px;
}

.info-banner {
  background: hsl(var(--muted) / 0.45);
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: hsl(var(--foreground));
  font-size: 12.5px;
}

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

.info-card {
  background: hsl(var(--card) / 0.35);
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  padding: 14px;
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: hsl(var(--foreground));
  padding-bottom: 8px;
  border-bottom: 1px solid hsl(var(--border));
}

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

.info-table th {
  text-align: left;
  padding: 6px 8px;
  color: hsl(var(--muted-foreground));
  font-weight: 600;
  border-bottom: 1px solid hsl(var(--border));
}

.info-table td {
  padding: 7px 8px;
  border-bottom: 1px solid hsl(var(--border) / 0.5);
  color: hsl(var(--foreground));
}

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

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.info-grid-item {
  background: hsl(var(--secondary) / 0.4);
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  padding: 8px 10px;
  transition: all 0.15s ease;
}

.info-grid-item:hover {
  background: hsl(var(--accent));
}

.info-grid-item-title {
  font-weight: 600;
  font-size: 12.5px;
  color: hsl(var(--foreground));
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.info-grid-item-desc {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  line-height: 1.35;
}

.info-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border: 1px solid hsl(var(--border));
  margin: 2px;
}

/* ═════════════════════════════════════════════════════════════════════════
   PANEL LATERAL (SIDEBAR) — ESTILO NATIVO DE CHAINLIT
   ═════════════════════════════════════════════════════════════════════════ */

/* Botón flotante para alternar panel */
.sidebar-toggle-btn {
  position: fixed;
  top: 14px;
  /* Chainlit coloca su botón «Nueva conversación» en left≈14px (~38px de ancho).
     Posicionamos el toggle a su derecha con margen. */
  left: 60px;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  z-index: 50;
  transition: all 0.15s ease;
}

.sidebar-toggle-btn:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  border-color: hsl(var(--border));
}

/* Ocultar botón flotante cuando el panel está desplegado */
body.ai-sidebar-open .sidebar-toggle-btn,
.ai-sidebar.open ~ .sidebar-toggle-btn {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-15px);
}

/* Contenedor del Sidebar Lateral */
.ai-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  background: hsl(var(--sidebar-background, var(--background)));
  border-right: 1px solid hsl(var(--border));
  display: flex;
  flex-direction: column;
  z-index: 100;
  transform: translateX(-100%);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  user-select: none;
}

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

@media (min-width: 1025px) {
  body.ai-sidebar-open {
    padding-left: 260px;
    transition: padding-left 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  z-index: 95;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.sidebar-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.ai-sidebar-header {
  padding: 14px 14px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid hsl(var(--border));
}

.ai-sidebar-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-sidebar-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.ai-sidebar-close-btn {
  background: transparent;
  border: none;
  color: hsl(var(--muted-foreground));
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s;
}

.ai-sidebar-close-btn:hover {
  background: hsl(var(--accent));
  color: hsl(var(--foreground));
}

.ai-sidebar-new-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid hsl(var(--primary) / 0.35);
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--foreground));
  font-family: inherit;
  transition: all 0.15s;
  box-sizing: border-box;
}

.ai-sidebar-new-btn:hover {
  background: hsl(var(--primary) / 0.2);
  border-color: hsl(var(--primary));
}

.ai-sidebar-search {
  width: 100%;
  height: 32px;
  background: hsl(var(--muted) / 0.5);
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  padding: 0 10px;
  color: hsl(var(--foreground));
  font-size: 12px;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
}

.ai-sidebar-search:focus {
  border-color: hsl(var(--ring));
}

.ai-sidebar-section-title {
  padding: 12px 14px 6px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: hsl(var(--muted-foreground));
}

.ai-sidebar-styles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 0 12px 10px 12px;
}

.ai-style-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  background: hsl(var(--secondary) / 0.4);
  border: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.ai-style-chip:hover {
  background: hsl(var(--accent));
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}

.ai-style-chip-icon {
  font-size: 13px;
  flex-shrink: 0;
}

.ai-style-chip-label {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ai-sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: hsl(var(--foreground));
  border: 1px solid transparent;
}

.ai-sidebar-item:hover {
  background: hsl(var(--accent));
}

.ai-sidebar-item.active {
  background: hsl(var(--accent));
  border-color: hsl(var(--border));
  font-weight: 600;
}

.ai-sidebar-item-main {
  flex: 1;
  min-width: 0;
  margin-right: 6px;
}

.ai-sidebar-item-title {
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-sidebar-item-meta {
  font-size: 10.5px;
  color: hsl(var(--muted-foreground));
  margin-top: 2px;
}

.ai-sidebar-item-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.15s;
}

.ai-sidebar-item:hover .ai-sidebar-item-actions {
  opacity: 1;
}

.ai-sidebar-act-btn {
  background: transparent;
  border: none;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  padding: 3px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1;
  transition: all 0.15s;
}

.ai-sidebar-act-btn:hover {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
}

.ai-sidebar-act-btn.delete:hover {
  color: hsl(var(--destructive));
}

.ai-sidebar-footer {
  border-top: 1px solid hsl(var(--border));
  padding: 10px 14px;
  color: hsl(var(--muted-foreground));
  font-size: 11px;
}

/* Toast flotante (sale arriba de la ventana de texto sin encimarse) */
.session-toast {
  position: fixed;
  bottom: 230px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 100005;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
}

.session-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Modal de autenticación / login si se requiere */
/* Modal de autenticación / login Agora (Firebase Auth) */
.crewai-auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 15, 0.82);
  backdrop-filter: blur(10px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  animation: agoraFadeIn 0.25s ease-out;
}

@keyframes agoraFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.crewai-auth-card {
  width: 92%;
  max-width: 410px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border) / 0.8);
  border-radius: 16px;
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px hsl(var(--primary) / 0.1);
}

.crewai-auth-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.crewai-auth-logo {
  font-size: 34px;
  margin-bottom: 2px;
  filter: drop-shadow(0 4px 12px rgba(59, 130, 246, 0.3));
}

.crewai-auth-title {
  font-size: 22px;
  font-weight: 700;
  color: hsl(var(--foreground));
  letter-spacing: -0.02em;
  margin: 0;
}

.crewai-auth-subtitle {
  font-size: 13px;
  color: hsl(var(--muted-foreground));
  margin: 0;
  line-height: 1.4;
}

.agora-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 44px;
  border-radius: 10px;
  background: #ffffff;
  color: #1f2937;
  border: 1px solid rgba(0, 0, 0, 0.12);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
  font-family: inherit;
}

.agora-google-btn:hover {
  background: #f8fafc;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transform: translateY(-1px);
}

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

.agora-auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: hsl(var(--muted-foreground) / 0.7);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 4px 0;
}

.agora-auth-divider::before,
.agora-auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid hsl(var(--border));
}

.agora-auth-divider::before { margin-right: 12px; }
.agora-auth-divider::after { margin-left: 12px; }

.crewai-auth-tabs {
  display: flex;
  background: hsl(var(--muted) / 0.6);
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}

.crewai-auth-tab {
  flex: 1;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: hsl(var(--muted-foreground));
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.crewai-auth-tab.active {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.crewai-auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.crewai-auth-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.crewai-auth-label {
  font-size: 12px;
  font-weight: 500;
  color: hsl(var(--foreground) / 0.9);
}

.crewai-auth-input {
  width: 100%;
  height: 38px;
  background: hsl(var(--muted) / 0.4);
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  padding: 0 12px;
  color: hsl(var(--foreground));
  font-size: 13px;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.crewai-auth-input:focus {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 2px hsl(var(--primary) / 0.2);
}

.crewai-auth-error {
  display: none;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
}

.crewai-auth-submit-btn {
  width: 100%;
  height: 40px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
  font-family: inherit;
  margin-top: 4px;
}

.crewai-auth-submit-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.crewai-auth-submit-btn:active {
  transform: translateY(0);
}

.crewai-auth-footer {
  text-align: center;
  font-size: 11px;
  color: hsl(var(--muted-foreground) / 0.8);
  margin-top: -4px;
}

/* ═════════════════════════════════════════════════════════════════════════
   ORGANIZACIÓN DEL MENÚ DE CONFIGURACIÓN (SUBCATEGORÍAS CHAINLIT)
   ═════════════════════════════════════════════════════════════════════════ */

.cl-settings-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 2px 14px 2px;
  margin-bottom: 4px;
  border-bottom: 1px solid hsl(var(--border));
}

.cl-settings-filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 9999px;
  font-size: 0.77rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--secondary) / 0.5);
  color: hsl(var(--muted-foreground));
  transition: all 0.15s ease-in-out;
  user-select: none;
  font-family: inherit;
}

.cl-settings-filter-tab:hover {
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}

.cl-settings-filter-tab.active {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.cl-settings-section-divider {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  margin-top: 14px;
  margin-bottom: 4px;
  background: hsl(var(--muted) / 0.35);
  border: 1px solid hsl(var(--border) / 0.75);
  border-radius: 8px;
  user-select: none;
}

.cl-settings-section-divider:first-of-type {
  margin-top: 4px;
}

.cl-settings-section-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cl-settings-section-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.cl-settings-section-title-box {
  display: flex;
  flex-direction: column;
}

.cl-settings-section-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  letter-spacing: -0.01em;
}

.cl-settings-section-desc {
  font-size: 0.69rem;
  color: hsl(var(--muted-foreground));
  margin-top: 1px;
}

.cl-settings-section-badge {
  font-size: 0.67rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 9999px;
  background: hsl(var(--secondary));
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
}

.cl-settings-item {
  transition: opacity 0.15s ease;
}

/* ── Panel de Conexiones y Credenciales ───────────────────────────────── */
.cl-settings-credentials-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
  margin-bottom: 12px;
  font-family: inherit;
}

.cl-cred-card {
  background: hsl(var(--card) / 0.5);
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s ease;
}

.cl-cred-card:hover {
  border-color: hsl(var(--ring) / 0.4);
}

.cl-cred-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.cl-cred-title-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cl-cred-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  display: flex;
  align-items: center;
  gap: 6px;
}

.cl-cred-desc {
  font-size: 0.72rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.35;
}

.cl-cred-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 9999px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--secondary) / 0.6);
  white-space: nowrap;
}

.cl-cred-badge.active {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.3);
}

.cl-cred-badge.inactive {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.cl-cred-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.cl-cred-badge.active .cl-cred-badge-dot {
  animation: clPulseDot 1.8s infinite;
}

@keyframes clPulseDot {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}

.cl-cred-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 6px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-size: 0.78rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.cl-cred-btn-primary:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

.cl-cred-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cl-cred-btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  background: transparent;
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid hsl(var(--border));
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.cl-cred-btn-outline:hover {
  background: hsl(var(--accent));
  color: hsl(var(--foreground));
}

.cl-cred-btn-disconnect {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 4px;
  background: transparent;
  color: hsl(var(--destructive));
  border: 1px solid hsl(var(--destructive) / 0.4);
  font-size: 0.68rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.cl-cred-btn-disconnect:hover {
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
  border-color: hsl(var(--destructive));
}

.cl-cred-btn-disconnect.hidden {
  display: none !important;
}

.cl-cred-warning-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.28);
  border-left: 3px solid #eab308;
  font-size: 0.72rem;
  line-height: 1.45;
  margin-top: 6px;
  margin-bottom: 8px;
}

.cl-cred-warning-icon {
  font-size: 1rem;
  line-height: 1.2;
  flex-shrink: 0;
  margin-top: 1px;
}

.cl-cred-warning-text {
  color: hsl(var(--foreground));
  flex: 1;
}

.cl-cred-warning-text strong {
  color: #eab308;
}

.cl-cred-status-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  background: hsl(var(--muted) / 0.5);
  border: 1px solid hsl(var(--border) / 0.8);
  font-size: 0.75rem;
  color: hsl(var(--foreground));
  gap: 8px;
}

.cl-cred-status-box.hidden {
  display: none !important;
}

.cl-cred-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid hsl(var(--primary) / 0.3);
  border-top-color: hsl(var(--primary));
  border-radius: 50%;
  animation: clSpin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}

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

.cl-cred-input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cl-cred-input-group label {
  font-size: 0.73rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.cl-cred-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.cl-cred-input {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  padding-right: 32px;
  border-radius: 6px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 0.78rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cl-cred-input:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 1px hsl(var(--ring));
}

.cl-cred-toggle-eye {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  padding: 2px;
  font-size: 0.85rem;
  line-height: 1;
}

.cl-cred-toggle-eye:hover {
  color: hsl(var(--foreground));
}

/* ═════════════════════════════════════════════════════════════════════════
   ESTILOS COMPACTOS Y RESPONSIVOS DE LA CONVERSACIÓN Y BARRA DE ESTUDIO
   ═════════════════════════════════════════════════════════════════════════ */

/* Ocultar completamente grupos inactivos (solo Crear Imagen y Crear Video quedan visibles) */
.hg-options-group.hidden,
#hg-image-options.hidden,
#hg-video-options.hidden {
  display: none !important;
}

/* Grupos activos: fila única sin wrap; el ancho lo gestiona JS */
#hg-image-options:not(.hidden),
#hg-video-options:not(.hidden) {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 4px !important;
  overflow: visible !important;
}

/* Ajuste de píldoras para que encajen perfectamente sin desbordarse */
.hg-pill {
  padding: 3px 8px !important;
  height: 26px !important;
  font-size: 11.5px !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

/* ═════════════════════════════════════════════════════════════════════════
   SCROLLBAR OSCURO Y DISCRETO (EVITAR BARRA BLANCA CLÁSICA DE WINDOWS)
   ═════════════════════════════════════════════════════════════════════════ */
* {
  scrollbar-color: hsl(var(--muted-foreground) / 0.25) transparent;
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: hsl(var(--muted-foreground) / 0.25);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--muted-foreground) / 0.45);
}
/* ═════════════════════════════════════════════════════════════════════════
   BOTÓN DE ITERAR EN MENSAJES (TODAS LAS CONVERSACIONES)
   ═════════════════════════════════════════════════════════════════════════ */
.msg-iterate-wrapper {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin-top: 6px !important;
  padding-top: 2px !important;
  width: auto !important;
}

.msg-iterate-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  height: 25px !important;
  padding: 0 10px !important;
  background: hsl(var(--secondary) / 0.65) !important;
  color: hsl(var(--foreground)) !important;
  border: 1px solid hsl(var(--border) / 0.85) !important;
  border-radius: 6px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  user-select: none !important;
  font-family: inherit !important;
  opacity: 0.85 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) !important;
}

.msg-iterate-btn:hover {
  background: hsl(var(--primary) / 0.18) !important;
  color: hsl(var(--primary)) !important;
  border-color: hsl(var(--primary) / 0.6) !important;
  opacity: 1 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25) !important;
}

.msg-iterate-btn svg {
  width: 12px !important;
  height: 12px !important;
  stroke: currentColor !important;
}

/* Modal de exploración de mensajes en sesiones */
.session-messages-preview {
  margin-top: 8px;
  padding: 8px 10px;
  background: hsl(var(--background) / 0.8);
  border: 1px solid hsl(var(--border) / 0.6);
  border-radius: 6px;
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: hgFade 0.15s ease-out;
}

.session-messages-preview.hidden {
  display: none !important;
}

.session-msg-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  background: hsl(var(--muted) / 0.35);
  border: 1px solid hsl(var(--border) / 0.4);
  border-radius: 6px;
  font-size: 11.5px;
}

.session-msg-item:hover {
  background: hsl(var(--muted) / 0.55);
}

.session-msg-item-text {
  color: hsl(var(--foreground));
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-height: 1.35;
  flex: 1;
}

.session-msg-item-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 10.5px;
  font-weight: 600;
  background: hsl(var(--primary) / 0.15);
  color: hsl(var(--primary));
  border: 1px solid hsl(var(--primary) / 0.35);
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.session-msg-item-btn:hover {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  transform: translateY(-1px);
}

/* ─── BARRA DE ITERACIÓN EN IMÁGENES Y VIDEOS DEL CHAT ─── */
.media-iterate-bar {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-top: 8px !important;
  margin-bottom: 8px !important;
  flex-wrap: wrap !important;
}

.media-iterate-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  height: 28px !important;
  padding: 0 12px !important;
  background: hsl(var(--card)) !important;
  color: hsl(var(--foreground)) !important;
  border: 1px solid hsl(var(--border)) !important;
  border-radius: 8px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  user-select: none !important;
  font-family: inherit !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15) !important;
}

.media-iterate-btn:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25) !important;
}

.media-iterate-btn.image:hover {
  background: hsl(var(--primary) / 0.15) !important;
  border-color: hsl(var(--primary) / 0.6) !important;
  color: hsl(var(--primary)) !important;
}

.media-iterate-btn.video:hover {
  background: rgba(168, 85, 247, 0.15) !important;
  border-color: rgba(168, 85, 247, 0.6) !important;
  color: #c084fc !important;
}

.media-iterate-btn svg {
  width: 13px !important;
  height: 13px !important;
}

/* ─── BANNER DE MEDIO ACTIVO EN EL COMPOSER / CONVERSACIÓN ─── */
.hg-media-reference-banner {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  padding: 6px 10px !important;
  margin-bottom: 6px !important;
  background: hsl(var(--card) / 0.95) !important;
  border: 1px solid hsl(var(--primary) / 0.4) !important;
  border-radius: 10px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
  animation: hgFade 0.2s ease-out !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.hg-media-reference-left {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
}

.hg-media-reference-thumb-wrap {
  width: 38px !important;
  height: 38px !important;
  border-radius: 6px !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
  border: 1px solid hsl(var(--border)) !important;
  background: #000 !important;
}

.hg-media-reference-thumb {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.hg-media-reference-info {
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
}

.hg-media-reference-title {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: hsl(var(--foreground)) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.hg-media-reference-sub {
  font-size: 10.5px !important;
  color: hsl(var(--muted-foreground)) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.hg-media-reference-remove {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 24px !important;
  padding: 0 8px !important;
  border-radius: 6px !important;
  background: hsl(var(--muted) / 0.8) !important;
  color: hsl(var(--foreground)) !important;
  border: 1px solid hsl(var(--border)) !important;
  cursor: pointer !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  transition: all 0.15s ease !important;
  flex-shrink: 0 !important;
}

.hg-media-reference-remove:hover {
  background: hsl(var(--destructive) / 0.2) !important;
  border-color: hsl(var(--destructive) / 0.5) !important;
  color: hsl(var(--destructive)) !important;
}
