/* ======================
   🟣 BURBUJA Y POPUP - Chat Salcedo
   ====================== */

/* --- BURBUJA flotante --- */
#scs-chatBubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 64px;
  height: 64px;
  background-color: var(--scs-primary-color, #4f46e5);
  color: var(--scs-primary-text-color, #ffffff);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
  cursor: pointer;
  z-index: 999998; /* Un punto menos que el popup */
  transition: transform 0.25s ease, opacity 0.3s;
  opacity: 1;
  visibility: visible;
}

/* Ocultar burbuja cuando el chat está abierto para evitar que bloquee clics en el popup */
body.scs-chat-open #scs-chatBubble {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}


/* --- VENTANA emergente del chat --- */
#scs-chatPopup {
  position: fixed;
  /* bottom, top, left, right y width, height se aplicarán dinámicamente via JS */
  background: white;
  border-radius: 1rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  overflow: hidden;
  /* transform-origin se aplicará dinámicamente via JS */
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
  z-index: 999999; /* Máxima prioridad */
  display: none;
  flex-direction: column;
  
  /* Estado inicial: Oculto */
  transform: scale(0.9); /* Un poco más grande que 0 para una transición más bonita */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Estado abierto: Visible */
body.scs-chat-open #scs-chatPopup {
  transform: scale(1);
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* --- Versión responsive (móviles) --- */
@media (max-width: 768px) {
  #scs-chatPopup {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    border-radius: 0 !important;
    z-index: 1000000 !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
  }
}

/* 🟢 CORRECCIÓN PANTALLA COMPLETA 
   Ocultar scroll de la web para evitar que la barra de desplazamiento tape el botón de cierre */
body.scs-fullscreen-mode {
  overflow: hidden !important;
}

/* ======================
   CABECERA DEL CHAT
   ====================== */
/* Cabecera con posición relativa para contener el botón de cierre */
#scs-mainHeader {
  background-color: var(--scs-primary-color, #4f46e5);
  color: var(--scs-primary-text-color, #ffffff) !important;
  padding: 10px 45px;  /* 45px a los lados para compensar el botón y centrar */
  min-height: 50px;   /* Altura mínima para centrado vertical */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative; /* Necesario para posicionar el botón absoluto dentro */
}

/* Forzar color configurado en todos los elementos de texto dentro de la cabecera */
#scs-mainHeader * {
  color: var(--scs-primary-text-color, #ffffff) !important;
}

/* Estilos comunes para cualquier nivel de encabezado en la cabecera */
#scs-mainHeader h1,
#scs-mainHeader h2,
#scs-mainHeader h3,
#scs-mainHeader h4,
#scs-mainHeader h5,
#scs-mainHeader h6 {
  margin: 0 !important;
  color: var(--scs-primary-text-color, #ffffff) !important;
  line-height: 1.2 !important;
  padding: 0 !important;
}

/* Escala controlada para evitar desproporciones (Bootstrap/Tema) */
#scs-mainHeader h1 { font-size: 1.4rem !important; }
#scs-mainHeader h2 { font-size: 1.3rem !important; }
#scs-mainHeader h2 { font-size: 1.8rem !important; }
#scs-mainHeader h3 { font-size: 1.8rem !important; }
#scs-mainHeader h4 { font-size: 1.1rem !important; }
#scs-mainHeader h5 { font-size: 1.0rem !important; }
#scs-mainHeader h6 { font-size: 0.9rem !important; }

/* Botón de cierre - se adapta automáticamente al alto de la cabecera */
#scs-closeChatBtn {
  position: absolute;
  top: 0;
  right: 0;
  background: rgba(0,0,0,0.15); /* Tono más oscuro para diferenciar */
  color: var(--scs-primary-text-color, white);
  border: none;
  border-radius: 0;
  border-top-right-radius: 1rem; /* Mantiene el redondeo de la esquina del popup */
  width: 45px; /* Ancho fijo del botón */
  height: 100%; /* Se adapta al 100% del alto de la cabecera */
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  z-index: 9000;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#scs-closeChatBtn:hover {
  background: rgba(0,0,0,0.25); /* Más oscuro al hacer hover */
}

/* ======================
   💬 ESTILOS DEL CHAT
   ====================== */

#scs-app {
  width: 100%;
  height: 100%;
  flex: 1; /* Forzar expansión en el flex contenedor */
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
}

/* Formulario de inicio */
#scs-startChatForm {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  width: 100%;
  flex-direction: column;
  gap: 1rem;
  /* El display flex se controla via JS/Inline style */
}

/* Los estilos del formulario ahora se manejan mediante utilidades scs-* al final del archivo */

/* Interfaz del chat */
#scs-chatInterface {
  flex: 1;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  /* El display flex se controla via JS/Inline style */
}

/* Área de conversación - TAMAÑO DE LETRA CONFIGURABLE */
#scs-chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  background-color: #f3f4f6;
  /* font-size se aplicará dinámicamente via JS */
  min-height: 0; /* CRÍTICO */
}

/* Área de input - SIEMPRE VISIBLE */
.scs-chat-input-area {
  position: relative;
  flex-shrink: 0;
  padding: 0.75rem;
  background: white;
  border-top: 1px solid #dee2e6;
}

/* Arreglo del input-group para alinear textarea y botón */
.scs-chat-input-area .input-group {
  display: flex !important;
  align-items: stretch !important;
}

.scs-chat-input-area #scs-userInput {
  flex: 1 !important;
  min-width: 0 !important;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  margin: 0 !important;
}

/* Mensajes */
/* Mensajes */
.scs-msg-content {
  padding: 0.6rem;
  border-radius: 0.6rem;
  max-width: 80%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.scs-user-message .scs-msg-content {
  background-color: var(--scs-primary-color, #4f46e5);
  color: var(--scs-primary-text-color, #ffffff);
  border-bottom-right-radius: 0;
  margin-right: 8px;
}

.scs-assistant-message .scs-msg-content {
  background-color: white;
  color: #212529;
  border: 1px solid #dee2e6;
  border-top-left-radius: 0;
  word-break: break-word;
  margin-left: 8px;
}

.scs-msg-time {
  font-size: 14px !important; /* Legibilidad física garantizada */
  opacity: 0.8;
  margin-top: 5px;
  display: block;
  align-self: flex-end;
}

.scs-avatar {
  border-radius: 50%;
  margin: 0 6px;
  object-fit: cover;
  width: 48px !important;
  height: 48px !important;
}

.scs-assistant-message .scs-avatar,
.scs-user-message .scs-avatar,
.scs-typing-indicator .scs-avatar {
  width: 48px !important;
  height: 48px !important;
}

.scs-user-message { 
  flex-direction: row-reverse; 
}

.scs-assistant-message { 
  flex-direction: row; 
}

/* Estilos del indicador de escritura (spinner) */
.scs-typing-indicator .scs-msg-content {
  display: flex;
  align-items: center;
}

.scs-typing-indicator .scs-msg-content span:first-child {
  margin-right: 8px;
}

.scs-typing-indicator .scs-dot {
  background-color: #333;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin: 0 2px;
  animation: scs-dot-flicker 1.4s infinite ease-in-out both;
}

.scs-typing-indicator .scs-dot-1 { animation-delay: -0.32s; }
.scs-typing-indicator .scs-dot-2 { animation-delay: -0.16s; }
.scs-typing-indicator .scs-dot-3 { animation-delay: 0s; }

@keyframes scs-dot-flicker {
  0%, 80%, 100% { opacity: 0; }
  40% { opacity: 1; }
}

/* Ajustes para textarea */
#scs-startChatForm p {
  font-size: 1.25rem;
  color: #444;
  line-height: 1.4;
}
/* --- Rediseño Moderno del Área de Input --- */
.scs-modern-input-wrapper {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 0 !important;
  padding: 0px 0px 10px 0px !important;
  background: white !important;
  border-top: 1px solid #f0f0f0 !important;
}

.scs-input-container-pill {
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  background: white !important;
  border-radius: 24px !important;
  padding: 4px 4px 4px 12px !important; /* Reducido el padding derecho para mayor proximidad al borde */
  gap: 8px !important;
  transition: all 0.2s ease !important;
  border: 1px solid #e0e0e0 !important;
  box-sizing: border-box !important;
  min-height: 48px !important; /* Asegurar altura consistente */
}

.scs-input-container-pill:focus-within {
  background: #fff !important;
  border-color: var(--scs-primary-color) !important;
  box-shadow: 0 0 0 2px rgba(var(--scs-primary-color-rgb, 79, 70, 229), 0.1) !important;
}

/* Botón + de adjuntos */
.scs-attach-wrapper {
  position: relative !important;
}

.scs-attach-btn {
  background: none !important;
  border: none !important;
  color: #5f6368 !important;
  padding: 6px !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s !important;
}

.scs-attach-btn:hover {
  background: rgba(0,0,0,0.05) !important;
  color: #202124 !important;
}

/* Previsualización de archivos seleccionados */
.scs-file-previews-container {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin-bottom: 8px !important;
  width: 100% !important;
  max-height: 120px !important;
  overflow-y: auto !important;
  padding: 2px !important;
}

.scs-file-preview {
  display: none;
  align-items: center !important;
  background: #f8f9fa !important;
  border-radius: 12px !important;
  padding: 4px 10px 4px 6px !important;
  font-size: 13px !important;
  color: #3c4043 !important;
  margin-bottom: 8px !important;
  width: fit-content !important;
  border: 1px solid #e0e0e0 !important;
  max-width: 90% !important;
  animation: scs-fade-in-up 0.2s ease-out !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
  margin-bottom: 0 !important; /* El margen lo maneja el gap del contenedor */
}

.scs-file-preview-media {
  width: 28px !important;
  height: 28px !important;
  margin-right: 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 6px !important;
  overflow: hidden !important;
  background: #e8eaed !important;
  flex-shrink: 0 !important;
}

.scs-file-preview-media img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.scs-file-preview-media span {
  font-size: 16px !important;
}

.scs-file-preview-name {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 150px !important;
  font-weight: 500 !important;
}

.scs-remove-file-btn {
  background: none !important;
  border: none !important;
  color: #5f6368 !important;
  font-size: 18px !important;
  margin-left: 10px !important;
  cursor: pointer !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  transition: color 0.2s !important;
}

.scs-remove-file-btn:hover {
  color: #d93025 !important;
}

/* Área de texto dentro de la píldora */
#scs-userInput {
  flex: 1 !important;
  background: none !important;
  border: none !important;
  padding: 10px 0 !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
  color: #202124 !important;
  box-shadow: none !important;
  outline: none !important;
  min-height: auto !important;
  max-height: 120px !important;
  height: 40px !important;
  overflow-y: auto !important;
  scrollbar-width: none !important;
  resize: none !important; /* Bloqueado el escalado por el usuario */
}

#scs-userInput::-webkit-scrollbar {
  display: none !important;
}

/* Botón de envío circular integrado dentro de la píldora */
.scs-btn-circular {
  width: 40px !important; /* Aumentado de 36px a 40px para llenar mejor la curva */
  height: 40px !important;
  border-radius: 50% !important;
  border: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
  background-color: #f1f3f4 !important;
  color: #bdc1c6 !important;
  box-shadow: none !important;
  margin: 0 !important;
}

.scs-btn-circular:not(:disabled) {
  background-color: var(--scs-primary-color) !important;
  color: var(--scs-primary-text-color, #ffffff) !important;
}

.scs-btn-circular:disabled {
  background-color: #f1f3f4 !important;
  color: #bdc1c6 !important;
  cursor: default !important;
}

.scs-btn-circular:not(:disabled):hover {
  transform: scale(1.02) !important;
  filter: brightness(1.08) !important;
}

.scs-btn-circular svg {
  width: 20px !important; /* Proporcional al nuevo tamaño de 40px */
  height: 20px !important;
}

@keyframes scs-fade-in-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Limpieza de estilos antiguos de input */
.scs-action-buttons-row {
  display: flex !important;
  flex-direction: row !important;
  gap: 12px !important;
  width: 100% !important;
/*   padding: 0 15px 15px !important; */
  align-items: center !important;
  justify-content: space-between !important;
}

#scs-accessibilityBtn svg,
#scs-newChatBtn svg {
  width: 20px !important; /* Iconos más grandes y visibles */
  height: 20px !important;
  margin-bottom: 0 !important;
}

#scs-newChatBtn {
  background-color: #ffffff !important;
  border: 1.5px solid #d1d5db !important; /* Borde más visible */
  color: #374151 !important;
  padding: 12px 24px !important; /* Más grandes */
  font-size: 15px !important;
}

#scs-newChatBtn:hover {
  background-color: #f9fafb !important;
  border-color: #9ca3af !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
}

#scs-accessibilityBtn {
  background-color: var(--scs-primary-color, #4f46e5) !important;
  border: 1.5px solid var(--scs-primary-color, #4f46e5) !important;
  color: var(--scs-primary-text-color, #ffffff) !important;
  padding: 12px 24px !important; /* Más grandes */
  font-size: 15px !important;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2) !important;
}

#scs-accessibilityBtn:hover {
  filter: brightness(1.1) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 15px rgba(79, 70, 229, 0.3) !important;
}

/* Clases de utilidad (fallback de Bootstrap) */
.scs-d-none { display: none !important; }
.scs-d-flex { display: flex !important; }
.scs-w-100 { width: 100% !important; }
.scs-flex-grow-1 { flex-grow: 1 !important; }
.scs-align-items-center { align-items: center !important; }
.scs-justify-content-between { justify-content: space-between !important; }
.scs-p-2 { padding: 0.5rem !important; }
.scs-m-0 { margin: 0 !important; }

/* ======================
   📝 ESTILOS PARA CONTENIDO HTML EN MENSAJES
   ====================== */

/* Contenedor de texto del mensaje */
.scs-msg-text {
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Enlaces */
.scs-msg-text a {
  color: var(--scs-primary-color, #4f46e5);
  text-decoration: underline;
  word-break: break-word;
}

.scs-msg-text a:hover {
  opacity: 0.8;
}

/* Enlaces como botones */
.scs-link-button {
  display: inline-block !important;
  background-color: var(--scs-primary-color, #4f46e5) !important;
  color: var(--scs-primary-text-color, #ffffff) !important;
  padding: 10px 20px !important;
  margin: 8px 0 !important;
  border-radius: 10px !important;
  text-decoration: none !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  font-size: 1.2rem !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 4px 6px rgba(0,0,0,0.15) !important;
  vertical-align: middle !important;
  text-align: center !important;
  min-width: 140px !important;
}

.scs-link-button::before {
  content: "👉 " !important;
  margin-right: 4px !important;
}

.scs-link-button:hover {
  filter: brightness(1.1) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 12px rgba(0,0,0,0.15) !important;
  opacity: 1 !important;
  color: #ffffff !important;
}

/* Listas */
.scs-msg-text ul,
.scs-msg-text ol {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.scs-msg-text li {
  margin: 0.25rem 0;
}

/* Títulos */
.scs-msg-text h1,
.scs-msg-text h2,
.scs-msg-text h3,
.scs-msg-text h4,
.scs-msg-text h5,
.scs-msg-text h6 {
  margin: 0.75rem 0 0.5rem 0;
  font-weight: 600;
  line-height: 1.3;
}

.scs-msg-text h1 { font-size: 1.6rem; }
.scs-msg-text h2 { font-size: 1.4rem; }
.scs-msg-text h3 { font-size: 1.2rem; }
.scs-msg-text h4 { font-size: 1.1rem; } /* Claramente entre 1.2 y 1.0 */
.scs-msg-text h5 { font-size: 1rem; }
.scs-msg-text h6 { font-size: 0.9rem; }

/* Párrafos */
.scs-msg-text p {
  margin: 0.5rem 0;
}

/* Código */
.scs-msg-text code {
  background: rgba(0, 0, 0, 0.05);
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
}

.scs-msg-text pre {
  background: rgba(0, 0, 0, 0.05);
  padding: 0.75rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 0.5rem 0;
}

.scs-msg-text pre code {
  background: none;
  padding: 0;
}

/* Citas */
.scs-msg-text blockquote {
  border-left: 3px solid var(--scs-primary-color, #4f46e5);
  padding-left: 1rem;
  margin: 0.5rem 0;
  color: rgba(0, 0, 0, 0.7);
  font-style: italic;
}

/* Tablas */
.scs-msg-text table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.9em;
}

.scs-msg-text th,
.scs-msg-text td {
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0.5rem;
  text-align: left;
}

.scs-msg-text th {
  background: rgba(0, 0, 0, 0.05);
  font-weight: 600;
}

.scs-msg-text tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}

/* Imágenes */
.scs-msg-text img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 0.5rem 0;
  display: block;
}

/* Línea horizontal */
.scs-msg-text hr {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  margin: 1rem 0;
}

/* Texto tachado */
.scs-msg-text s,
.scs-msg-text strike {
  text-decoration: line-through;
  opacity: 0.7;
}

/* ======================
   ♿ PANEL DE ACCESIBILIDAD - DISEÑO PROFESIONAL
   ====================== */

/* Panel principal */
.scs-accessibility-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #1a202c !important; /* Siempre oscuro para alto contraste */
  color: #ffffff !important;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  transform: translateY(100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none; /* Evita bloquear clics cuando está oculto */
}

.scs-accessibility-panel.show {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto; /* Permite interacción cuando está visible */
}

/* ======================
   ⭐ SATISFACCIÓN (CSAT)
   ====================== */
.scs-csat-container {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  margin: 10px 0;
  text-align: center;
  animation: scsFadeIn 0.3s ease-out;
}

.scs-csat-title {
  font-weight: 600;
  margin-bottom: 12px;
  color: #374151;
  font-size: 1rem; /* Asegura 16px min para evitar zoom en iOS y mejorar lectura */
}

.scs-csat-options {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.scs-csat-option {
  font-size: 24px;
  cursor: pointer;
  transition: transform 0.2s;
  user-select: none;
}

.scs-csat-option:hover {
  transform: scale(1.25);
}

.scs-csat-thanks {
  color: #059669;
  font-weight: 500;
  font-size: 0.85rem; /* Antes 12px, ahora ~13.6px */
  animation: scsFadeIn 0.3s ease-out;
}


/* ======================
   📁 ENVÍO DE ARCHIVOS
   ====================== */
.scs-attach-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    color: #6b7280;
    transition: color 0.2s;
}

.scs-attach-btn:hover {
    color: #3b82f6;
}

#scs-file-input {
    display: none;
}

.scs-attachment-preview {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
}

.scs-attachment-remove {
    cursor: pointer;
    color: #ef4444;
    font-weight: bold;
    margin-left: 10px;
}

.scs-message-attachment {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 5px;
    text-decoration: none;
    color: inherit;
    font-size: 0.9rem;
}

.scs-message-attachment:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Bloqueo de entrada al finalizar */
.scs-input-locked {
  background: #f3f4f6 !important;
  cursor: not-allowed !important;
}

.scs-accessibility-panel.show {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

/* Cabecera */
.scs-panel-header {
  background: #1a1a2e; /* Sin degradado, color sólido oscuro */
  padding: 0;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: relative;
  border-bottom: 3px solid #ffffff;
}

.scs-header-icon-left {
  width: 72px;
  height: 100%;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  border-right: 3px solid #ffffff;
}

.scs-panel-title {
  flex: 1;
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.scs-close-panel {
  height: 100% !important;
  width: 72px !important;
  background: #000000 !important;
  border: none !important;
  border-left: 3px solid #ffffff !important;
  color: #ffffff !important;
  border-radius: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  padding: 0 !important;
  margin: 0 !important;
  flex-shrink: 0 !important;
}

.scs-close-panel:hover {
  background: #222222 !important;
}

.scs-close-panel svg {
  width: 24px !important;
  height: 24px !important;
  display: block !important;
  fill: none !important;
  stroke: #ffffff !important;
  stroke-width: 2.5 !important;
}

#scs-startChatSubmit {
  padding: 1.2rem;
  font-size: 1.4rem;
  font-weight: 700;
  border-radius: 0.8rem;
  margin-top: 5px;
}
#scs-mainHeader h3 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
}
.scs-panel-header h6 {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Contenido */
.scs-panel-content {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

/* Filas de opciones */
.scs-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.scs-option-row:last-of-type {
  border-bottom: none;
}

.scs-option-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.scs-option-icon {
  font-size: 28px;
  width: 36px;
  text-align: center;
}

.scs-option-text {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  line-height: 1.3;
}

/* Switches modernos - grandes para accesibilidad */
.scs-accessibility-panel .scs-switch {
  position: relative;
  display: inline-block;
  width: 64px;
  height: 34px;
}

.scs-accessibility-panel .scs-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.scs-accessibility-panel .scs-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #4a5568;
  border-radius: 34px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.scs-accessibility-panel .scs-slider:before {
  position: absolute;
  content: '';
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background: #ffffff;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.scs-accessibility-panel input:checked + .scs-slider {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 2px 12px rgba(102, 126, 234, 0.5);
}

.scs-accessibility-panel input:checked + .scs-slider:before {
  transform: translateX(30px);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
}

.scs-accessibility-panel .scs-slider:hover {
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Switches en otros contextos (admin, etc.) - mantener tamaño original */
.scs-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

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

.scs-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #cbd5e0;
  border-radius: 28px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.scs-slider:before {
  position: absolute;
  content: '';
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

input:checked + .scs-slider {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

input:checked + .scs-slider:before {
  transform: translateX(24px);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}

.scs-slider:hover {
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Separador */
.scs-separator {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.15) 50%, transparent 100%);
  margin: 20px 0;
}

/* Sección de tamaño de texto */
.scs-text-size-section {
  margin-top: 8px;
}

/* Botón de Reset */
.scs-reset-section {
  text-align: center;
  padding-top: 4px;
}

.scs-reset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: #94a3b8;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.scs-reset-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.35);
  color: #e2e8f0;
}

.scs-reset-btn svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.scs-section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

/* Botones de acción base (Nueva conversación, Ajustes) */
.scs-action-buttons-row {
    display: flex !important;
    gap: 8px !important;
    width: 100% !important;
    margin-top: 10px !important;
}

.scs-action-buttons-row .scs-btn {
    flex: 1 !important;
    padding: 10px !important;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scs-action-buttons-row .scs-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

/* Botones de tamaño */
.scs-size-buttons {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 12px !important;
  margin-top: 15px !important;
}

.scs-size-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 2px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 12px !important;
  color: #ffffff !important;
  padding: 15px 10px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  text-transform: uppercase !important;
}

.scs-size-btn:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: #667eea !important;
}

.scs-size-btn.active {
  background: #667eea !important;
  border-color: #ffffff !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
}

.scs-size-btn {
  padding: 16px 10px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 600;
  color: #cbd5e0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.scs-size-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.5s;
}

.scs-size-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.scs-size-btn:hover::before {
  left: 100%;
}

.scs-size-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  border-color: #667eea;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
  transform: translateY(-1px);
}

.scs-size-btn.active::before {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

/* ======================
   🌗 MODO ALTO CONTRASTE
   ====================== */

/* Cabecera */
.scs-high-contrast #scs-mainHeader {
  background-color: #000000 !important;
  border-bottom: 1px solid #444 !important;
}

.scs-high-contrast #scs-mainHeader *,
.scs-high-contrast #scs-mainHeader h1,
.scs-high-contrast #scs-mainHeader h2,
.scs-high-contrast #scs-mainHeader h3,
.scs-high-contrast #scs-mainHeader h4,
.scs-high-contrast #scs-mainHeader h5,
.scs-high-contrast #scs-mainHeader h6 {
  color: #ffffff !important;
}

.scs-high-contrast #scs-closeChatBtn {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
}

.scs-high-contrast #scs-closeChatBtn:hover {
  background: rgba(255, 255, 255, 0.25) !important;
}

/* Mensajes */
.scs-high-contrast .scs-assistant-message .scs-msg-content {
  background-color: #000000 !important;
  color: #ffffff !important;
  border: 1px solid #333 !important;
}

.scs-high-contrast .scs-user-message .scs-msg-content {
  background-color: #ffffff !important;
  color: #000000 !important;
  border: 1px solid #ccc !important;
}

.scs-high-contrast #scs-chat-container {
  background-color: #1a1a1a !important;
  font-size: 1.1rem !important; /* Aumentado ligeramente para legibilidad */
}

.scs-high-contrast .scs-chat-input-area,
.scs-high-contrast .scs-modern-input-wrapper {
  background: #1a1a1a !important;
  border-top-color: #444 !important;
}

.scs-high-contrast .scs-input-container-pill {
  background: #2a2a2a !important;
  border-color: #666 !important;
}

.scs-high-contrast .scs-input-container-pill:focus-within {
  border-color: #aaa !important;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15) !important;
}

.scs-high-contrast #scs-userInput {
  background: transparent !important;
  color: #ffffff !important;
}

.scs-high-contrast #scs-userInput::placeholder {
  color: #aaaaaa !important;
}

.scs-high-contrast .scs-attach-btn {
  color: #cccccc !important;
}

.scs-high-contrast .scs-attach-btn:hover {
  background: rgba(255,255,255,0.1) !important;
  color: #ffffff !important;
}

.scs-high-contrast .scs-btn-circular:disabled {
  background-color: #333 !important;
  color: #666 !important;
}

.scs-high-contrast .scs-action-buttons-row {
  background: #1a1a1a !important;
}

.scs-high-contrast #scs-newChatBtn {
  background-color: #2a2a2a !important;
  border-color: #666 !important;
  color: #ffffff !important;
}

.scs-high-contrast #scs-newChatBtn:hover {
  background-color: #333 !important;
  border-color: #999 !important;
}

/* ======================
   📺 MODO PANTALLA COMPLETA
   ====================== */
.scs-fullscreen-mode #scs-chatPopup {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0 !important;
  z-index: 999999 !important;
}

body.scs-chat-open.scs-fullscreen-mode #scs-chatBubble {
  display: none !important;
}

/* ======================
   📏 TAMAÑOS DE TIPOGRAFÍA
   ====================== */
.scs-font-small #scs-chat-container {
  font-size: 15px !important; 
}

.scs-font-medium #scs-chat-container {
  font-size: 18px !important; 
}

.scs-font-large #scs-chat-container {
  font-size: 22px !important; 
}

.scs-font-huge #scs-chat-container {
  font-size: 26px !important; 
}

/* Escala para el área de entrada (Base 0.85rem) */
.scs-font-small #scs-userInput {
  font-size: 16px !important; 
}

.scs-font-medium #scs-userInput {
  font-size: 18px !important; 
}

.scs-font-large #scs-userInput {
  font-size: 22px !important; 
}

.scs-font-huge #scs-userInput {
  font-size: 26px !important; 
}

/* Escala para las marcas de tiempo (Base 0.85rem) */
.scs-font-small .scs-msg-time {
  font-size: 13px !important; 
}

.scs-font-medium .scs-msg-time {
  font-size: 1.06rem !important;
}

.scs-font-large .scs-msg-time {
  font-size: 1.33rem !important;
}

.scs-font-huge .scs-msg-time {
  font-size: 1.66rem !important;
}
#scs-chat-container,
#scs-userInput,
.scs-msg-content {
  transition: all 0.3s ease;
}

/* Responsive */
@media (max-width: 480px) {
  .scs-accessibility-panel {
    left: 10px;
    right: 10px;
    min-width: auto;
    max-width: calc(100vw - 20px);
  }
  
  .scs-panel-content {
    padding: 16px;
  }
  
  .scs-option-row {
    padding: 12px 0;
  }
  
  .scs-option-text {
    font-size: 16px;
  }
  
  .scs-size-buttons {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  
  .scs-size-btn {
    padding: 10px 6px;
    font-size: 11px;
  }
  
  /* Ocultar opción de pantalla completa en móviles (no tiene sentido allí) */
  #scs-fullscreen-row {
    display: none !important;
  }
}

/* ======================
   🛠️ UTILIDADES SCS (Reemplazo de Bootstrap)
   ====================== */

/* Flexbox utilities */
.scs-flex { display: flex !important; }
.scs-flex-column { flex-direction: column !important; }
.scs-flex-wrap { flex-wrap: wrap !important; }
.scs-justify-between { justify-content: space-between !important; }
.scs-justify-center { justify-content: center !important; }
.scs-justify-start { justify-content: flex-start !important; }
.scs-justify-end { justify-content: flex-end !important; }
.scs-align-center { align-items: center !important; }
.scs-align-end { align-items: flex-end !important; }
.scs-gap-1 { gap: 0.25rem !important; }
.scs-gap-2 { gap: 0.0rem !important; }
.scs-flex-shrink-0 { flex-shrink: 0 !important; }
.scs-flex-grow-1 { flex-grow: 1 !important; }

/* Spacing utilities */
.scs-mb-0 { margin-bottom: 0 !important; }
.scs-mb-1 { margin-bottom: 0.25rem !important; }
.scs-mb-2 { margin-bottom: 0.5rem !important; }
.scs-mb-3 { margin-bottom: 1rem !important; }
.scs-mt-1 { margin-top: 0.25rem !important; }
.scs-mt-2 { margin-top: 0.5rem !important; }
.scs-mt-3 { margin-top: 1rem !important; }

/* Text utilities */
.scs-text-center { text-align: center !important; }
.scs-text-start { text-align: left !important; }
.scs-text-end { text-align: right !important; }
.scs-text-muted { opacity: 0.7 !important; }
.scs-text-danger { color: #dc3545 !important; }
.scs-small { font-size: 1.1rem !important; }
.scs-fw-bold { font-weight: 700 !important; }
.scs-opacity-75 { opacity: 0.75 !important; }
.scs-d-block { display: block !important; }
.scs-d-none { display: none !important; }

/* Form Elements */
.scs-privacy-row {
    display: flex !important;
    align-items: center !important; /* Alineación centrada para el texto y cheque */
    gap: 12px !important;
    margin-top: 15px !important;
    margin-bottom: 25px !important;
    padding: 0 !important;
}

#scs-privacy-policy {
    width: 24px !important;
    height: 24px !important;
    margin: 0 !important; /* Reiniciamos margen para que align-items center funcione perfecto */
    accent-color: var(--scs-primary-color);
    cursor: pointer;
    flex-shrink: 0;
}

.scs-privacy-row label {
    font-size: 1.2rem !important;
    line-height: 1.2 !important;
    cursor: pointer;
    color: #333;
    margin: 0 !important;
}

/* Estilos de inputs ULTRA-ESPECÍFICOS para evitar overrides de temas */
#scs-startChatForm .scs-input,
#scs-startChatForm .scs-select {
    display: block !important;
    width: 100% !important;
    padding: 1.25rem 1.4rem !important;
    font-size: 1.4rem !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    color: #000000 !important;
    background-color: #ffffff !important;
    border: 2px solid #ced4da !important;
    border-radius: 0.75rem !important;
    box-sizing: border-box !important;
    transition: all .2s ease-in-out !important;
    margin-bottom: 0.5rem !important;
}

#scs-startChatForm .scs-select {
    padding-right: 2.5rem !important; /* Espacio para la flecha */
    appearance: none !important;
    -webkit-appearance: none !important;
}

#scs-startChatForm .scs-input:focus,
#scs-startChatForm .scs-select:focus {
    border-color: var(--scs-primary-color) !important;
    box-shadow: 0 0 0 0.25rem rgba(79, 70, 229, 0.2) !important;
    outline: 0 !important;
}

#scs-startChatForm .scs-input::placeholder {
    color: #777777 !important;
    opacity: 1 !important;
}

#scs-startChatForm .scs-input-sm,
#scs-startChatForm .scs-select-sm {
    padding: 0.8rem 1rem !important;
    font-size: 1.15rem !important;
}

.scs-select {
    display: block;
    width: 100%;
    padding: 0.5rem 2.25rem 0.5rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #f8f9fa;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    appearance: none;
}

.scs-check-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Buttons */
.scs-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    text-align: center !important;
    text-decoration: none !important;
    vertical-align: middle !important;
    cursor: pointer !important;
    user-select: none !important;
    background-color: transparent !important;
    border: 1.5px solid transparent !important;
    padding: 10px 20px !important;
    font-size: 14px !important;
    border-radius: 50px !important; /* Estilo píldora */
    transition: all .25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    gap: 8px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
}

.scs-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12) !important;
}

.scs-btn-sm {
    padding: 8px 16px !important;
    font-size: 13px !important;
}

.scs-btn-outline-secondary {
    color: #3c4043 !important;
    border-color: #dadce0 !important;
    background-color: #ffffff !important;
}
.scs-btn-outline-secondary:hover {
    border-color: #bdc1c6 !important;
    background-color: #f8f9fa !important;
}

.scs-btn-outline-primary {
    color: #ffffff !important;
    background-color: var(--scs-primary-color) !important;
    border-color: var(--scs-primary-color) !important;
}
.scs-btn-outline-primary:hover {
    filter: brightness(1.1) !important;
}

/* Botón de envío base - Redondo por defecto */
#scs-sendBtn {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    font-size: 18px !important;
    line-height: 1 !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
}

#scs-sendBtn:hover {
    filter: brightness(1.1) !important;
}

/* Modern Input Wrapper */
.scs-modern-input-wrapper {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
    margin-bottom: 12px !important;
}

/* Caja de entrada base */
.scs-input-container-pill {
    display: flex !important;
    align-items: center !important;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 4px 12px !important;
    flex: 1 !important;
    gap: 8px !important;
    transition: all 0.2s ease;
}

.scs-input-container-pill #scs-userInput {
    border: none !important;
    background: transparent !important;
    padding: 8px 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    resize: none !important;
    overflow-y: hidden !important;
    flex: 1 !important;
}

/* Botón + circular grisáceo base */
.scs-attach-btn {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    background: #e2e8f0 !important;
    border: none !important;
    color: #475569 !important;
    font-size: 18px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.scs-attach-btn:hover {
    background: #cbd5e1 !important;
}

/* Fila de botones de acción */
.scs-action-buttons-row {
    display: flex !important;
    gap: 8px !important;
    width: 100% !important;
    margin-top: 10px !important;
}

.scs-action-buttons-row .scs-btn {
    flex: 1 !important;
    padding: 10px !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
}

/* Spinner */
.scs-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: text-bottom;
    border: 0.2em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: scs-spinner-border .75s linear infinite;
}
@keyframes scs-spinner-border {
    to { transform: rotate(360deg); }
}