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

/* ==================== VARIABLES ====================
   Colores, variables y tokens centrales. Mantener aquí los valores
   principales de la paleta para facilitar ajustes temáticos.
*/



:root {
    /* Colores principales - Tonos grises en vez de negro puro */
    --bg-primary: #1a1a1e;
    /* Gris oscuro en vez de negro brillante */
    --bg-secondary: #25252a;
    /* Gris medio-oscuro */
    --bg-tertiary: #2f2f35;
    /* Gris más claro */
    --bg-hover: #3a3a42;
    /* Hover gris visible */

    /* Azules para selección - Más apagados */
    --blue-primary: #4a6fa5;
    /* Azul apagado */
    --blue-hover: #5d7fa8;
    /* Azul hover suave */
    --blue-light: #6b8bb3;
    /* Azul claro mate */

    /* Grises */
    --gray-100: #e0e0e2;
    --gray-200: #c8c8cc;
    --gray-300: #b0b0b8;
    --gray-400: #90909a;
    --gray-500: #707078;
    --gray-600: #55555d;
    --gray-700: #3f3f47;
    --gray-800: #2a2a32;

    /* Textos - Grises suaves */
    --text-primary: #d8d8dc;
    /* Gris claro mate */
    --text-secondary: #a8a8b0;
    /* Gris medio */
    --text-muted: #88889 0;
    /* Gris apagado */

    /* Otros */
    --success: #5a8c6a;
    /* Verde mate */
    --warning: #b8904a;
    /* Dorado mate */
    --error: #b85a5a;
    /* Rojo mate */
    --green-primary: #6a9c7a;
    --red-primary: #c86a6a;

    /* Sombras - Muy sutiles */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.25);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

/* ==================== LIGHT THEME (MATTE GRAY) ==================== */
[data-theme="light"] {
    /* Backgrounds - Grises mates, sin brillo */
    --bg-primary: #e8e8ea;
    /* Gris mate medio */
    --bg-secondary: #d9d9db;
    /* Gris más oscuro */
    --bg-tertiary: #c8c8cc;
    /* Gris oscuro */
    --bg-hover: #b8b8bd;
    /* Hover bien visible */

    /* Blues - Apagados y mates */
    --blue-primary: #4a6fa5;
    /* Azul muy apagado */
    --blue-hover: #3d5a85;
    /* Azul oscuro mate */
    --blue-light: #5d7fa8;
    /* Azul claro apagado */

    /* Grises - Mantener */
    --gray-100: #e5e5e7;
    --gray-200: #d1d1d5;
    --gray-300: #b8b8bd;
    --gray-400: #9090a0;
    --gray-500: #707080;
    --gray-600: #50505a;
    --gray-700: #3a3a42;
    --gray-800: #2a2a32;

    /* Textos - Oscuros sin negro puro */
    --text-primary: #2b2b30;
    /* Gris muy oscuro mate */
    --text-secondary: #52525a;
    /* Gris oscuro */
    --text-muted: #757580;
    /* Gris medio */

    /* Status colors - Muy apagados */
    --success: #4a7c5d;
    /* Verde mate oscuro */
    --warning: #b8860b;
    /* Dorado oscuro mate */
    --error: #8b3a3a;
    /* Rojo mate oscuro */
    --green-primary: #5a8c6a;
    --red-primary: #a04040;

    /* Shadows - Muy sutiles, casi invisibles */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow-md: 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 4px 8px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 8px 12px -3px rgba(0, 0, 0, 0.06);
}

/* Smooth transitions for theme switching */
:root,
[data-theme="light"],
[data-theme="dark"] {
    transition: background-color 300ms ease, color 300ms ease;
}

body,
.sidebar,
.main-content,
.main-header,
.content-area,
.nav-item,
.btn,
button,
.chat-item,
.project-card,
.message-content {
    transition: background-color 300ms ease, color 300ms ease, border-color 300ms ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow: auto;
    /* Permitimos scroll a nivel de página para que la barra quede al borde derecho */
    font-size: 12px;
    /* Reducido de ~16px default */
    line-height: 1.5;
    /* Más compacto */
}

/* ==================== GLOBAL SCROLLBAR ====================
   Definimos una única apariencia global para la scrollbar (html/body).
   Evitar scrollbars por separado en contenedores salvo que sea necesario.
*/
/* ==================== SCROLLBAR TEMÁTICA OSCURA ==================== */
*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

*::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 2px solid var(--bg-primary);
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--blue-dark);
}

/* ==========================================================================
     MINIMAL VISUALS: eliminar bordes y sombras globalmente (EXCEPTO .unassign-drop-zone)

     - Por petición: no queremos bordes visibles en ningún componente salvo la
         ` .unassign-drop-zone ` que sirve como zona de desasignación resaltada.
     - Aplicamos `border: none !important` y `box-shadow: none !important` a los
         componentes más usados para asegurar consistencia visual.
     - Para evitar eliminar interactividad por completo, neutralizamos
         transformaciones/filters en :hover y luego reintroducimos hovers muy
         sutiles (solo cambio de fondo) en elementos interactivos.
     Nota: si quieres que un componente específico recupere sombra/borde,
     añade reglas explícitas con `!important` para ese selector.
========================================================================== */

/* Reset selectivo de bordes y sombras */
button,
.btn,
.btn-send,
.btn-clear,
.btn-attach,
.btn-img,
.btn-primary,
.btn-secondary,
.btn-save-models,
.btn-goto,
.btn-delete-multiple,
.nav-item,
.nav-item-new-chat,
.icon-btn,
.user-btn,
.tab,
.sort-btn,
.sort-option,
.prompt-input,
.prompt-area,
.prompt-header,
.prompt-info,
.sidebar,
.sidebar-close-btn,
.main-content,
.main-header,
.content-area,
.project-card,
.project-header,
.chat-item,
.chat-header,
.chat-preview,
.llm-card,
.llm-toggle,
.llm-header,
.llm-model-select,
.llm-advanced-config,
.config-grid,
.config-item,
.config-input,
.config-section-title,
.pagination-btn,
.pagination-page,
.search-container,
.search-input,
.search-clear-btn,
.chat-delete-btn,
.message-copy-btn,
.current-chat-info,
.conversation-message,
.conversation-container,
.conversation-area,
.preguntar-container,
.new-chat-card,
.select-project,
.input-chat-name,
.field-label,
.form-field-with-label,
.tabs-container,
.tabs,
.history-toolbar,
.sala-container,
.llm-grid,
.llm-model-selector,
.llm-info,
.llm-status,
.llm-description,
.btn-wrapper,
.btn-save-wrapper,
.message-header,
.message-content,
.message-time,
.message-images,
.message-image-item,
.message-image,
.code-block,
.code-header,
.code-copy-btn,
.code-language,
.table-wrapper,
.table-scroll,
.error-message,
.loading-message,
.welcome-container,
.welcome-logo,
.welcome-actions,
.chats-list,
.chat-arrow,
.chat-name,
.chat-date,
.chat-options,
.chat-info,
.btn-go-to-chat,
.pagination-container,
.pagination-info,
.pagination-controls,
.pagination-pages,
.sort-arrow,
.project-grid,
.projects-grid,
.project-title,
.project-description,
.project-meta,
.project-stats,
.tab-content,
.section-content,
.section-title,
.project-drop-zone,
.project-chat-item,
.orphan-chat-item,
.attached-file-item,
.attached-image-thumbnail,
.project-instruction-file-item,
.icon-option,
.icon-preview-btn {
    border: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

/* Neutralizar efectos visuales agresivos en hover/active */
*:hover,
*:active,
*:focus {
    transform: none !important;
    filter: none !important;
}

/* Hover sutil y sencillo para todos los elementos interactivos */
button,
.btn,
.nav-item,
.icon-btn,
.user-btn,
.project-card,
.chat-item,
.orphan-chat-item,
.project-chat-item,
.initial-response,
.conversation-message,
.llm-card {
    transition: background-color 120ms ease, color 120ms ease;
}

button:hover,
.btn:hover,
.nav-item:hover,
.icon-btn:hover,
.user-btn:hover,
.project-card:hover,
.chat-item:hover,
.orphan-chat-item:hover,
.project-chat-item:hover,
.initial-response:hover,
.conversation-message:hover,
.llm-card:hover {
    background-color: rgba(255, 255, 255, 0.001);
    color: var(--text-primary);
    box-shadow: none !important;
    filter: none !important;
}

/* ==================== GLOBAL HOVER SOFTENING ====================
   Eliminar degradados, brillos, glows y movimientos en hover para mantener
   una estética minimalista. Aplicar un cambio de fondo muy sutil.
   Se usa !important para neutralizar reglas específicas que aplican
   degradados o sombras en selectores concretos. */
.hover-soften-target,
button,
.btn,
.nav-item,
.icon-btn,
.user-btn,
.project-card,
.chat-item,
.orphan-chat-item,
.project-chat-item,
.initial-response,
.conversation-message,
.llm-card,
.project-actions button,
.btn-icon,
.btn-attach-file,
.btn-attach-image,
.code-copy-btn,
.response-copy-btn,
.round-copy-btn,
.result-copy-btn,
.consensus-copy-btn,
.project-drop-zone,
.column-header,
.collapsible-section .section-title-bar,
.round-header,
.initial-response-header,
.collaboration-header {
    transition: background-color 160ms ease !important;
}

/* Neutralizar cualquier background-image/gradient y sombras en hover */
.hover-soften-target:hover,
button:hover,
.btn:hover,
.nav-item:hover,
.icon-btn:hover,
.user-btn:hover,
.project-card:hover,
.chat-item:hover,
.orphan-chat-item:hover,
.project-chat-item:hover,
/* .initial-response:hover, */
/* .conversation-message:hover, */
.llm-card:hover,
.project-actions button:hover,
.btn-icon:hover,
.btn-attach-file:hover,
.btn-attach-image:hover,
.code-copy-btn:hover,
.response-copy-btn:hover,
.round-copy-btn:hover,
.result-copy-btn:hover,
.consensus-copy-btn:hover,
.project-drop-zone:hover,
.column-header:hover,
.collapsible-section .section-title-bar:hover,
.round-header:hover,
.initial-response-header:hover,
.collaboration-header:hover {
    background-image: none !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
    filter: none !important;
}

/* Excepciones: mantener color de texto o iconos en hover sin efectos visuales
   extra (no se introducen sombras ni degradados). */
.round-header:hover .round-arrow,
.initial-response-header:hover .response-arrow,
.collapsible-section .section-title-bar:hover .section-arrow {
    color: var(--text-muted) !important;
}

/* Asegurar que la excepción .unassign-drop-zone mantiene su borde y estilo */
.unassign-drop-zone {
    border: 2px dashed rgba(239, 68, 68, 0.3) !important;
    border-radius: 12px !important;
}

/* ==========================================================================
   RESET Y GUÍAS DE ESTILO (LIMPIEZA)

   - Se quita el reset global agresivo de bordes porque impedía que
     componentes que definen sus propios bordes (tarjetas, inputs, menus)
     se muestren correctamente.
   - Mantendremos un reset moderado: dejar las cajas, eliminar outlines por
     foco y normalizar apariencias de controles. Los bordes deben definirse
     explícitamente por componente si se desea que sean visibles.
========================================================================== */

/* conservar box-sizing global (definido al inicio) y eliminar outlines visibles */
*:focus {
    outline: none;
}

/* Normalizar controles: conservar fuente, quitar apariencia nativa pero
   sin eliminar bordes si fueron definidos por componentes. */
button,
input,
textarea,
select {
    font: inherit;
    background: transparent;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Excepción visual importante: zona para desasignar (resaltada en rojo). */

/* Restaurar SOLO el borde del .unassign-drop-zone */
.unassign-drop-zone {
    border: 2px dashed rgba(239, 68, 68, 0.3) !important;
    border-radius: 12px !important;
}

.unassign-drop-zone::before {
    border: none !important;
}

.unassign-drop-zone:hover {
    border-color: rgba(239, 68, 68, 0.5) !important;
}

.unassign-drop-zone.drag-over {
    border-color: var(--error) !important;
    border-style: solid !important;
}

/* Restaurar borde izquierdo en desplegables y selectores */
select,
.llm-model-select,
.select-project,
.sort-btn,
.sort-dropdown,
.btn-send,
.btn-attach,
.btn-img,
.btn-clear {
    background-color: var(--bg-secondary);
    border: none;
    color: var(--text-primary);
    padding: 0.45rem 0.7rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 500;
    font-size: 0.85rem;
    box-shadow: none;
    transition: none;
}

.btn-send:hover,
.btn-attach:hover,
.btn-img:hover,
.btn-clear:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: none;
    transform: none;
}

@media (max-width: 480px) {
    .app-container {
        padding-bottom: 36px;
        /* Altura del footer en móvil pequeño */
    }
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: 64px;
    background-color: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
    border-right: none !important;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 110;
}

.sidebar-header {
    margin-bottom: 1.25rem;
    /* Reducido de 2rem */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0 0.5rem;
}

.sidebar-logo {
    width: 36px;
    /* Reducido de 48px */
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-close-btn {
    display: none;
    /* Oculto por defecto en desktop */
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-5%);
    background: var(--bg-tertiary);
    border: 0px solid var(--gray-700);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    transition: all 0.3s ease;
    z-index: 10;
    flex-shrink: 0;
}

.sidebar-close-btn:hover {
    background: var(--bg-hover);
    border-color: var(--gray-600);
    transform: none;
}

.sidebar-close-btn i {
    font-size: 1.1rem;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    /* Reducido de 0.5rem */
    width: 100%;
    padding: 0 0.5rem;
    /* Reducido de 0.75rem */
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.5rem 0.35rem;
    background: none;
    border: none !important;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
    font-size: 0.7rem;
    position: relative;
}

.nav-item i {
    font-size: 1.1rem;
    /* Reducido de 1.25rem */
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
    box-shadow: none;
    filter: none;
    transition: none;
}

.nav-item.active {
    background-color: var(--bg-tertiary);
    color: var(--blue-primary);
    border-left: none !important;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--blue-primary);
    border-radius: 0 3px 3px 0;
}

.nav-item-new-chat {
    /* background-color: rgba(12, 74, 110, 0.3) !important; */
    color: #094d6d !important;
    border: none !important;
    font-weight: 500;
}

.nav-item-new-chat:hover {
    background-color: rgba(7, 52, 78, 0.38) !important;
    color: #094d6d !important;
    border: none !important;
    transform: none;
    box-shadow: none;
}

.nav-item-new-chat i {
    color: #094d6d;
}

.nav-item-new-chat:hover i {
    color: #094d6d;
    filter: none;
}

.sidebar-footer {
    margin-top: auto;
}

.footer-logo {
    width: 32px;
    /* Reducido de 40px */
    height: 32px;
    object-fit: contain;
    opacity: 0.6;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: visible;
    /* Dejar que el body gestione el scroll */
    margin-left: 64px;
    /* Ancho del sidebar fijo */
    height: auto;
    /* Ajustar a contenido para permitir scroll del body */
    position: relative;
}

.main-header {
    background-color: var(--bg-secondary);
    padding: 0.65rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none !important;
}

.section-title {
    font-size: 1.15rem;
    /* Reducido de 1.5rem */
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 0.65rem;
    /* Reducido de 1rem */
    align-items: center;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    /* Reducido de 1.25rem */
    cursor: pointer;
    padding: 0.4rem;
    /* Reducido de 0.5rem */
    border-radius: 6px;
    /* Reducido de 8px */
    transition: all 0.2s ease;
}

.icon-btn:hover {
    color: var(--blue-primary);
    background-color: var(--bg-tertiary);
    box-shadow: none;
    filter: none;
    transition: none;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    /* Reducido de 0.5rem */
    background: none;
    border: 0px solid var(--gray-600);
    color: var(--text-primary);
    padding: 0.4rem 0.75rem;
    /* Reducido de 0.5rem 1rem */
    border-radius: 6px;
    /* Reducido de 8px */
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.user-btn:hover {
    border-color: var(--gray-600);
    color: var(--text-primary);
    box-shadow: none;
    filter: none;
    transition: none;
}

.user-btn i {
    font-size: 1rem;
    /* Reducido de 1.25rem */
}

/* ==================== CONTENT AREA ==================== */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    /* Reducido de 2rem */
    background-color: var(--bg-primary);
}

.section-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(2px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== TABS ==================== */
.tabs-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    /* Reducido de 1rem */
    padding: 0.35rem 0;
    /* Reducido de 0.5rem */
    border-bottom: 2px solid var(--gray-700);
}

.tabs {
    display: flex;
    gap: 0.35rem;
    /* Reducido de 0.5rem */
}

.tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.4rem 0.75rem;
    /* Reducido de 0.5rem 1rem */
    cursor: pointer;
    font-size: 0.85rem;
    /* Reducido de 0.9rem */
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
    position: relative;
    top: 2px;
}

.tab:hover {
    color: var(--text-primary);
    background: none;
    box-shadow: none;
    filter: none;
    transition: none;
}

.tab.active {
    color: var(--blue-primary);
    border-bottom-color: var(--blue-primary);
}

/* ==================== HISTORY TOOLBAR ==================== */
.history-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

/* Barra de búsqueda */
.search-container {
    flex: 1;
    min-width: 250px;
    max-width: 400px;
    position: relative;
    display: flex;
    align-items: center;
    margin: 0 auto;
    order: 2;
    /* Centrar en el medio */
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 1;
}

.search-input {
    width: 100%;
    background-color: var(--bg-tertiary);
    border: 0px solid var(--gray-600);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.search-clear-btn {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-clear-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-hover);
}

/* Botón eliminar múltiple */
.btn-delete-multiple {
    background-color: var(--error);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    order: 3;
    /* Después de búsqueda */
}

.btn-delete-multiple:hover {
    background-color: #dc2626;
    transform: none;
    box-shadow: none;
}

.btn-delete-multiple:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-delete-multiple span {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Desplegable ordenar */
.sort-dropdown {
    position: relative;
    order: 4;
    /* Al final */
}

.sort-btn {
    background-color: var(--bg-tertiary);
    border: 0px solid var(--gray-600);
    color: var(--text-secondary);
    padding: 0.5rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sort-btn:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--gray-600);
    color: var(--text-secondary);
    box-shadow: none;
    filter: none;
    transition: none;
}

.sort-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.sort-dropdown.active .sort-arrow {
    transform: rotate(180deg);
}

.sort-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background-color: var(--bg-secondary);
    border: 0px solid #0c4a6e;
    /* Azul más oscuro para desplegables */
    border-left: 2px solid #000d14;
    /* Azul más oscuro */
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    min-width: 180px;
    z-index: 100;
    overflow: hidden;
}

.sort-option {
    width: 100%;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.65rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.sort-option:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    box-shadow: none;
    filter: none;
    transition: none;
}

.sort-option i {
    width: 16px;
    text-align: center;
}

.sort-option.active {
    background-color: rgba(14, 165, 233, 0.1);
    color: var(--blue-primary);
}

/* Checkbox en chats */
.chat-item-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--blue-primary);
    margin-right: 0.75rem;
    flex-shrink: 0;
}

/* Botón eliminar individual en chat */
.chat-delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.35rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-item:hover .chat-delete-btn,
.chat-item:hover .btn-go-to-chat {
    opacity: 1;
}

.chat-delete-btn:hover {
    color: var(--error);
    background-color: rgba(239, 68, 68, 0.1);
}

/* Paginación */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-top: 1rem;
    border-top: none !important;
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-info {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-btn {
    background-color: var(--bg-tertiary);
    border: 0px solid var(--gray-600);
    color: var(--text-secondary);
    padding: 0.5rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background-color: var(--bg-hover);
    border-color: var(--blue-primary);
    color: var(--blue-primary);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-pages {
    /*no se usa?*/
    min-width: 32px;
}

.pagination-page {
    min-width: 32px;
    height: 32px;
    background-color: var(--bg-tertiary);
    border: none !important;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 150ms ease, color 150ms ease;
}

.pagination-page:hover {
    background-color: rgba(255, 255, 255, 0.02);
    border: none !important;
    color: var(--blue-primary);
}

.pagination-page.active {
    background-color: var(--blue-primary);
    border: none !important;
    color: white;
}

.pagination-page.dots {
    border: none;
    background: none;
    cursor: default;
}

.pagination-page.dots:hover {
    background: none;
    border: none;
    color: var(--text-secondary);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* Chat/Project info in tabs bar */
.current-chat-info {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    font-size: 0.65rem;
    color: var(--text-secondary);
    padding: 0.75rem 0.35rem;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.05) 0%, transparent 100%);
    border-bottom: none;
    /*0px solid rgba(14, 165, 233, 0.1); */
    border-radius: 8px 8px 0 0;
    margin-bottom: 0.05rem;
}

.current-chat-info i {
    color: var(--blue-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    filter: none;
}

.current-chat-info:hover i {
    transform: none;
    filter: none;
}

.current-chat-info .separator {
    color: var(--gray-500);
    font-weight: 300;
    opacity: 0.5;
}

.current-chat-info span span {
    color: var(--text-primary);
    font-weight: 600;
    transition: color 0.2s ease;
}

.current-chat-info:hover span span {
    color: var(--text-primary);
}

/* ==================== INICIO SECTION ==================== */
.welcome-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.welcome-logo {
    width: 250px;
    height: auto;
    margin-bottom: 2rem;
    object-fit: contain;
}

.welcome-container h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--blue-primary), var(--blue-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-container p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.welcome-actions {
    display: flex;
    gap: 1rem;
}

/* ==================== BUTTONS ==================== */
.btn-primary {
    background-color: var(--blue-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: var(--blue-hover);
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 0px solid var(--gray-600);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background-color: var(--bg-hover);
    border-color: var(--blue-primary);
    color: var(--blue-primary);
}

/* ==================== SALA SECTION ==================== */
.sala-container {
    padding: 1.25rem;
    overflow-x: hidden;
    overflow-y: auto;
    min-height: auto;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
}

.sala-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1.5px solid rgba(14, 165, 233, 0.2);
    position: relative;
}

.sala-container h3 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--text-primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    position: relative;
}

.btn-config {
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-config:hover {
    background: var(--bg-hover);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    transform: none;
    box-shadow: none;
}

.btn-config i {
    font-size: 0.875rem;
}

.sala-container h3::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, var(--blue-primary), transparent);
}

.llm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.25rem;
    width: 100%;
    box-sizing: border-box;
}

.llm-card {
    background: var(--bg-secondary);
    border: 0px solid var(--gray-700);
    border-radius: 8px;
    padding: 0.65rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    position: relative;
    overflow: hidden;
    min-height: auto;
    width: 100%;
    box-sizing: border-box;
}

.llm-card:hover {
    border-color: var(--gray-600);
    box-shadow: none;
    background: var(--bg-hover);
}

.llm-card.active {
    border-color: var(--blue-primary);
    background: var(--bg-secondary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.llm-card.disabled {
    opacity: 0.5;
    filter: grayscale(0.3);
}

.llm-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    padding-bottom: 0.45rem;
    border-bottom: 0px solid rgba(14, 165, 233, 0.1);
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.llm-info {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.llm-icon {
    font-size: 1.1rem;
    transition: color 0.2s ease;
}

.llm-card:hover .llm-icon {
    color: var(--blue-primary);
}

.llm-card.active .llm-icon {
    color: var(--blue-primary);
}

.llm-info h4 {
    font-size: 0.85rem;
    margin-bottom: 0.15rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.llm-card.active .llm-info h4 {
    color: var(--blue-light);
}

.llm-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 600;
    background: var(--gray-700);
    color: var(--text-secondary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: background 0.2s ease;
}

.llm-status.active {
    background: var(--gray-600);
    color: var(--success);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.llm-toggle {
    background: var(--gray-700);
    border: 0px solid var(--gray-600);
    border-radius: 16px;
    color: var(--gray-500);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 42px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.llm-toggle::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--gray-500);
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    left: 2px;
}

.llm-toggle i {
    position: relative;
    z-index: 1;
    transition: opacity 0.2s ease;
    opacity: 0.6;
}

.llm-toggle.active {
    background: var(--gray-600);
    border-color: var(--success);
    color: var(--success);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.llm-toggle.active::before {
    transform: translateX(18px);
    background: var(--success);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.llm-toggle.active i {
    opacity: 1;
    color: var(--success);
}

.llm-toggle:hover {
    border-color: var(--gray-500);
}

.llm-toggle.active:hover {
    border-color: var(--success);
}

.llm-model-selector {
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.llm-model-selector label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.llm-card.active .llm-model-selector label {
    color: var(--blue-primary);
}

.llm-model-select {
    flex: 1;
    background: var(--bg-secondary) !important;
    border: 0px solid rgba(14, 165, 233, 0.2);
    border-left: 2px solid rgba(14, 165, 233, 0.3);
    border-radius: 5px;
    padding: 0.4rem 0.6rem;
    color: var(--text-primary) !important;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-weight: 500;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.llm-model-select option {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    padding: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.llm-model-select option:hover,
.llm-model-select option:checked {
    background: var(--bg-hover) !important;
    color: var(--text-primary) !important;
}

.llm-model-select:hover {
    border-color: rgba(14, 165, 233, 0.4);
    border-left-color: var(--blue-primary);
    background: var(--bg-secondary);
    box-shadow: none;
    transform: none;
    color: var(--text-primary) !important;
}

.llm-model-select:focus {
    outline: none;
    border-color: var(--blue-primary);
    border-left-color: var(--blue-primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1), 0 2px 8px rgba(14, 165, 233, 0.2);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(14, 165, 233, 0.08) 100%);
    color: var(--text-primary) !important;
}

.llm-card.active .llm-model-select {
    border-color: var(--blue-primary);
    border-left-color: var(--blue-primary);
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(14, 165, 233, 0.05) 100%);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.2), 0 1px 3px rgba(14, 165, 233, 0.15);
    color: var(--text-primary) !important;
}

.llm-description {
    color: var(--text-secondary);
    line-height: 1.4;
    font-size: 0.7rem;
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 0px solid rgba(14, 165, 233, 0.1);
    position: relative;
    z-index: 2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow: hidden;
}

.llm-card.active .llm-description {
    color: var(--text-primary);
    border-top-color: rgba(14, 165, 233, 0.2);
}

.btn-save-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1.5px solid rgba(14, 165, 233, 0.15);
}

.btn-save-models {
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    min-width: 80px;
}

.btn-save-models:hover {
    background: var(--bg-hover);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    transform: none;
    box-shadow: none;
}

.btn-save-models:active {
    box-shadow: none;
}

.btn-save-models.saving {
    background-color: var(--bg-tertiary);
    border-color: rgba(255, 255, 255, 0.1);
    cursor: wait;
    opacity: 0.7;
}

.btn-save-models.saved {
    background-color: var(--bg-tertiary);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--text-primary);
}

/* ==================== CONFIGURACIÓN AVANZADA ==================== */
.llm-advanced-config {
    margin-top: 2rem;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    position: relative;
    overflow: visible;
    min-height: auto;
    width: 100%;
    box-sizing: border-box;
}

.config-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.config-section-title i {
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: color 0.2s ease;
}

.config-section-title:hover i {
    color: var(--text-secondary);
}

.config-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    z-index: 2;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border: none;
    transition: none;
    position: relative;
    z-index: 2;
    min-height: auto;
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
}

.config-item:hover {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.config-item label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s ease;
    margin-bottom: 0.375rem;
}

.config-item:hover label {
    color: var(--text-secondary);
}

.config-item label i {
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: color 0.2s ease;
    filter: none;
}

.config-item:hover label i {
    transform: none;
    filter: none;
    color: var(--text-muted);
}

.config-input {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 400;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: none;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
    font-family: inherit;
}

.config-input:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 1px var(--blue-primary);
    background: var(--bg-secondary);
    transform: none;
}

.config-input:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: none;
    background: var(--bg-secondary);
    transform: none;
}

.config-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    position: relative;
    z-index: 2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
    font-weight: 400;
}

/* ==================== PREGUNTAR SECTION ==================== */
.preguntar-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.prompt-header {
    margin-bottom: 1.5rem;
}

.prompt-info {
    display: flex;
    gap: 1rem;
}

.form-field-with-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.select-project,
.input-chat-name {
    width: 100%;
    background-color: var(--bg-secondary);
    border: 0px solid var(--gray-600);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
}

.select-project:focus,
.input-chat-name:focus {
    outline: none;
    border-color: var(--blue-primary);
}

.prompt-area {
    background-color: var(--bg-secondary);
    border: none;
    border-radius: 12px;
    padding: 1rem;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
}

.prompt-input {
    flex: 1 1 auto;
    min-height: 48px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    margin: 0;
    border: none;
    box-shadow: none;
    caret-color: var(--blue-primary);
}

.prompt-input:focus {
    outline: none;
    border-color: transparent;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.06);
}

/* Texto dentro del input más integrado al fondo: contraste sutil */
.prompt-input::placeholder {
    color: var(--text-muted);
    opacity: 0.9;
}

.prompt-input:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.06);
}

.prompt-actions {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
    margin-left: 0.5rem;
}

.btn-clear {
    background-color: var(--bg-tertiary);
    border: 0px solid var(--gray-600);
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-clear:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.btn-send,
.btn-clear,
.btn-attach,
.btn-img {
    background-color: var(--bg-secondary);
    border: none;
    color: var(--text-primary);
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-weight: 500;
    font-size: 0.85rem;
    box-shadow: none;
    transition: none;
}

.btn-send:hover,
.btn-clear:hover,
.btn-attach:hover,
.btn-img:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: none;
    transform: none;
    max-width: 400px;
    transition: all 0.3s ease;
}

.new-chat-card:hover {
    border-color: var(--blue-primary);
    transform: translateY(-1px);
}

.new-chat-card i {
    font-size: 4rem;
    color: var(--blue-primary);
    margin-bottom: 1.5rem;
}

.new-chat-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.new-chat-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* ==================== HISTORIAL - CHATS ==================== */
.chats-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-item {
    background-color: var(--bg-secondary);
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.15);
}

.chat-item:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), 0 2px 5px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-header:hover {
    background-color: var(--bg-tertiary);
}

.chat-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

/* Asegurar que el checkbox esté alineado */
.chat-header .chat-info {
    display: flex;
    align-items: center;
}

.chat-arrow {
    font-size: 0.75rem !important;
    color: #fff !important;
    opacity: 1 !important;
    vertical-align: middle !important;
    line-height: 1 !important;
    transition: none;
}

.chat-item.expanded .chat-arrow {
    transform: rotate(90deg);
}

.chat-name {
    font-weight: 500;
    flex: 1;
}

.chat-llms {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.8;
    white-space: nowrap;
}

.chat-date {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.chat-options {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.chat-options:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.chat-preview {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    background-color: var(--bg-tertiary);
    padding: 0 0.5rem;
}

.chat-item.expanded .chat-preview {
    max-height: 300px;
    padding: 0.5rem;
    border-top: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: max-height 0.3s ease-in, padding 0.3s ease-in;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.preview-text {
    color: var(--text-secondary);
    margin: 0;
    margin-bottom: 0.4rem;
    font-size: 0.75rem;
    line-height: 1.3;
    padding: 0 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    word-wrap: break-word;
    max-height: calc(1.3em * 4);
}

.chat-item.expanded .preview-text {
    display: -webkit-box !important;
    -webkit-line-clamp: 4 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: break-word !important;
    word-wrap: break-word !important;
    max-height: calc(1.3em * 4) !important;
}

.btn-goto {
    background-color: var(--blue-primary);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.btn-goto:hover {
    background-color: var(--blue-hover);
}

/* ==================== HISTORIAL - PROYECTOS ==================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background-color: var(--bg-secondary);
    border: none;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.15);
}

.project-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.25), 0 4px 10px rgba(0, 0, 0, 0.3);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.project-header h4 {
    font-size: 1.25rem;
}

.project-options {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    transition: all 0.2s ease;
}

.project-options:hover {
    color: var(--text-primary);
}

.project-info {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.project-date {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ==================== PROCESO SECTION ==================== */
#proceso-section {
    position: relative;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px);
    padding-bottom: 0 !important;
}

.conversation-container {
    /* Integrada con el fondo: sin bordes ni fondo para que no destaque */
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 1.25rem 0 0.5rem 0;
    /* Dejamos algo de padding superior */
    padding-bottom: 120px;
    /* Espacio para el prompt fijo */
    height: auto;
    /* Dejar que el contenido ocupe su espacio y el body haga el scroll */
    overflow: visible;
    /* El scroll será del body (barra al borde derecho) */
    margin: 0 auto 1rem;
    /* Centrado y margin-bottom */
    width: 100%;
    max-width: 860px;
    /* Ajustado a nuevo ancho */
    box-shadow: none;
    position: relative;
}

.conversation-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(14, 165, 233, 0.3), transparent);
    pointer-events: none;
}

.conversation-area {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: relative;
    padding: 0.5rem 0;
}

/* Efecto de scroll suave */
.conversation-container {
    scroll-behavior: smooth;
}

/* Nota: eliminadas las reglas de scrollbar específicas del contenedor para
   usar una única definición global de scrollbar más abajo (html/body). */

/* Estilos de scrollbar global (barra al borde derecho de la pantalla) */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 10px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
    background: transparent;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
    background: rgba(14, 165, 233, 0.18);
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
    background: rgba(14, 165, 233, 0.38);
}

.conversation-message {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(14, 165, 233, 0.03) 100%);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    border-left: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.conversation-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: transparent;
    transition: all 0.3s ease;
}

.conversation-message:hover {
    transform: none;
    box-shadow: none;
    background: var(--bg-secondary);
}

.conversation-message.claude {
    border-left-color: #da7756;
}

.conversation-message.claude::before {
    background: linear-gradient(180deg, var(--blue-primary), #da7756);
    opacity: 0.8;
}

.conversation-message.claude:hover {
    border-left-color: #da7756;
    box-shadow: none;
}

.conversation-message.chatgpt {
    border-left-color: var(--success);
}

.conversation-message.chatgpt::before {
    background: linear-gradient(180deg, var(--success), #0e7e7e);
    opacity: 0.8;
}

.conversation-message.chatgpt:hover {
    border-left-color: #0e7e7e;
    box-shadow: none;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    position: relative;
    padding-bottom: 0.5rem;
    border-bottom: 0px solid rgba(255, 255, 255, 0.05);
}

.message-header i {
    font-size: 1.15rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.conversation-message:hover .message-header i {
    transform: none;
    filter: none;
}

.message-time {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.75rem;
    /* Reducido de 0.875rem */
    font-weight: 400;
    margin-right: 0.5rem;
}

/* Botón copiar en mensajes */
.message-copy-btn {
    background: rgba(14, 165, 233, 0.1);
    border: 0px solid rgba(14, 165, 233, 0.3);
    color: var(--blue-primary);
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    opacity: 0;
    transform: scale(0.9) translateY(-1px);
    box-shadow: 0 1px 3px rgba(14, 165, 233, 0.2);
}

.conversation-message:hover .message-copy-btn {
    opacity: 1;
    transform: none;
}

.message-copy-btn:hover {
    background: rgba(14, 165, 233, 0.2);
    border-color: var(--blue-primary);
    color: var(--blue-light);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3), 0 1px 3px rgba(14, 165, 233, 0.2);
    transform: scale(1.05);
}

.message-copy-btn i {
    font-size: 0.65rem;
}

.message-copy-btn.copied {
    color: var(--success);
    border-color: var(--success);
    background-color: rgba(16, 185, 129, 0.1);
}

.message-content {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    padding: 0.25rem 0;
    animation: fadeInMessage 0.4s ease-in;
}

@keyframes fadeInMessage {
    from {
        opacity: 0;
        transform: translateY(2px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Imágenes en mensajes */
.message-images {
    margin-bottom: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.message-image-item {
    border-radius: 8px;
    overflow: hidden;
    max-width: 200px;
    max-height: 200px;
    width: auto;
    height: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    background-color: var(--bg-secondary);
    flex-shrink: 0;
}

.message-image {
    width: 100%;
    height: 100%;
    max-width: 200px;
    max-height: 200px;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Resultado Tab */
.resultado-container {
    background-color: var(--bg-secondary);
    border: none;
    border-radius: 12px;
    padding: 0;
    padding-bottom: 120px;
    /* Espacio para el prompt fijo */
    height: calc(100vh - 340px);
    overflow-y: auto;
    margin-bottom: 1rem;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
}

.resultado-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: none;
    background-color: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 5;
    margin-bottom: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.resultado-header h3 {
    font-size: 1.5rem;
}

.btn-copy {
    background-color: var(--bg-tertiary);
    border: 0px solid var(--gray-600);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.resultado-content {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1.05rem;
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

/* Fixed Prompt Input Container */
.fixed-prompt-container {
    position: fixed;
    bottom: 40px;
    /* Justo encima del footer (altura exacta del footer) */
    left: 64px;
    /* Ancho del sidebar */
    right: 0;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, rgba(14, 165, 233, 0.03) 100%);
    border-top: 0px solid rgba(14, 165, 233, 0.15);
    padding: 0.75rem 1rem;
    z-index: 50;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.3), 0 -4px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    margin-bottom: -1px;
    /* Para que toque exactamente el footer */
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
}

.prompt-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
}

.prompt-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.prompt-left-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Prompt Input Container */
.prompt-input-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(14, 165, 233, 0.05) 100%);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 0.4rem 0.4rem 0.4rem 0.6rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.prompt-input-container:hover {
    border-color: transparent;
}

.prompt-input-container:focus-within {
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), inset 0 1px 2px rgba(0, 0, 0, 0.05);
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(14, 165, 233, 0.05) 100%);
}

/* Botón + del menú */
.btn-plus-menu {
    position: relative;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-plus-menu:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-plus-menu:active {
    transform: scale(0.95);
}

.btn-plus-menu.active {
    background-color: var(--bg-hover);
    border-color: var(--blue-primary);
    color: var(--blue-primary);
}

/* Menú desplegable del botón + */
.plus-menu-dropdown {
    position: absolute;
    left: 0.75rem;
    bottom: calc(100% + 8px);
    background-color: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
    min-width: 240px;
    padding: 0.5rem 0;
    z-index: 100;
    animation: fadeInDown 0.2s ease;
    overflow: hidden;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Items del menú desplegable */
.plus-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.plus-menu-item:hover {
    background-color: var(--bg-hover);
}

.plus-menu-item i {
    width: 20px;
    color: var(--text-secondary);
    font-size: 1rem;
}

.plus-menu-item:hover i {
    color: var(--blue-primary);
}

.plus-menu-item span {
    flex: 1;
}

.plus-menu-item.active {
    background-color: rgba(14, 165, 233, 0.1);
}

.plus-menu-item.active i {
    color: var(--blue-primary);
}

.plus-menu-item:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: none;
}

.plus-menu-item:disabled:hover {
    background-color: transparent;
}

.plus-menu-item:disabled i {
    color: var(--text-muted) !important;
}

.prompt-input-fixed {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 0.75rem 0.75rem;
    border-radius: 0;
    font-size: 0.9rem;
    font-family: inherit;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
    text-align: left;
    line-height: 1.5;
}

.prompt-input-fixed:focus {
    outline: none;
    border: none;
    box-shadow: none;
    background: transparent;
    transform: none;
    text-align: left;
}

.prompt-input-fixed:not(:placeholder-shown) {
    text-align: left;
}

.prompt-buttons-right {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.prompt-input-fixed::placeholder {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    line-height: 1.5;
}

.prompt-buttons {
    display: flex;
    gap: 0.4rem;
    /* Reducido de 0.5rem */
}

.btn-clear-compact,
.btn-send-compact {
    background-color: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.4rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
}

.btn-clear-compact:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.btn-send-compact {
    background-color: var(--blue-primary);
    color: white;
    transition: all 0.2s ease;
}

.btn-send-compact:hover {
    background-color: var(--blue-hover);
    transform: scale(1.05);
}

.btn-send-compact:active {
    transform: scale(0.95);
}

.btn-clear-compact i,
.btn-send-compact i {
    font-size: 0.85rem;
}

/* Web Search Toggle */
.web-search-toggle-container {
    display: flex;
    align-items: center;
}

.web-search-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    user-select: none;
}

.web-search-toggle-label i {
    color: var(--blue-primary);
    font-size: 0.9rem;
}

.web-search-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.web-search-toggle:hover {
    color: var(--text-secondary);
}

.web-search-toggle.active {
    color: var(--blue-primary);
}

.web-search-toggle.active i {
    color: var(--blue-primary);
}

/* Thinking Toggle */
.thinking-toggle-container {
    display: flex;
    align-items: center;
}

.thinking-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    user-select: none;
}

.thinking-toggle-label i {
    color: var(--blue-primary);
    font-size: 0.9rem;
}

.thinking-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thinking-toggle:hover {
    color: var(--text-secondary);
}

.thinking-toggle.active {
    color: var(--blue-primary);
}

.thinking-toggle.active i {
    color: var(--blue-primary);
}

/* File Attachment Buttons */
.btn-attach-file,
.btn-attach-image {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(14, 165, 233, 0.05) 100%);
    border: 0px solid rgba(14, 165, 233, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-secondary);
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.btn-attach-file:hover,
.btn-attach-image:hover {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(14, 165, 233, 0.05) 100%);
    border-color: var(--blue-primary);
    color: var(--blue-primary);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.2), 0 1px 3px rgba(14, 165, 233, 0.1);
    transform: translateY(-1px);
}

.btn-attach-file:active,
.btn-attach-image:active {
    transform: scale(0.95);
}

/* Attached Files Container */
.attached-files-container {
    background-color: var(--bg-secondary);
    border: 0px solid var(--gray-600);
    border-radius: 6px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.attached-files-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.attached-file-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--bg-tertiary);
    border: 0px solid var(--gray-600);
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    max-width: 250px;
    min-width: 150px;
}

.attached-file-item .file-icon {
    color: var(--blue-primary);
    font-size: 0.9rem;
}

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

.attached-file-item .file-size {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.attached-file-item .file-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.attached-file-item .file-remove:hover {
    color: var(--red-primary);
}

/* Image Preview Styles */
.attached-file-item .file-image-preview {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border-radius: 4px;
    overflow: hidden;
    background-color: var(--bg-secondary);
    border: 0px solid var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
}

.attached-image-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.attached-file-item .file-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    gap: 0.2rem;
}

.attached-file-item .file-info .file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Drag & Drop Styles */
.prompt-input-wrapper.drag-over {
    border: 2px dashed var(--blue-primary);
    background-color: rgba(14, 165, 233, 0.1);
}

.prompt-input-wrapper.drag-over .prompt-input-fixed {
    pointer-events: none;
}

/* ==================== CONFIGURACIÓN SECTION (PAGE) ==================== */
#configuracion-section {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.config-page-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: calc(100vh - 200px);
    overflow: hidden;
}

.config-page-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    background: var(--bg-secondary);
}

.config-page-topbar h3 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.config-page-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar izquierdo */
.config-page-sidebar {
    width: 25%;
    min-width: 200px;
    background: var(--bg-primary);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.config-page-search {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}

.config-page-search i {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.config-page-search input {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 0.5rem 0.75rem 0.5rem 2rem;
    color: var(--text-primary);
    font-size: 0.8125rem;
    transition: border-color 0.2s ease;
}

.config-page-search input::placeholder {
    color: var(--text-muted);
}

.config-page-search input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.2);
}

.config-page-nav {
    padding: 0.25rem 0;
    display: flex;
    flex-direction: column;
}

.config-page-nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8125rem;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.config-page-nav-item i {
    font-size: 0.8125rem;
    width: 16px;
    text-align: center;
}

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

.config-page-nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-left-color: var(--blue-primary);
}

/* Área de contenido derecha */
.config-page-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem;
    background: var(--bg-secondary);
}

.config-page-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1.25rem 0;
}

.config-page-setting-group {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.config-page-setting {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.875rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.config-page-setting:last-child {
    border-bottom: none;
}

.config-page-setting-info {
    flex: 1;
    min-width: 0;
    padding-right: 1rem;
}

.config-page-setting-info label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.config-page-setting-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

.config-page-select {
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    font-size: 0.8125rem;
    width: 120px;
    flex-shrink: 0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.config-page-select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

.config-page-select:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

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

.config-page-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.config-page-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.config-page-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: 0.2s;
    border-radius: 24px;
}

.config-page-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-muted);
    transition: 0.2s;
    border-radius: 50%;
}

.config-page-toggle input:checked+.config-page-toggle-slider {
    background-color: var(--blue-primary);
    border-color: var(--blue-primary);
}

.config-page-toggle input:checked+.config-page-toggle-slider:before {
    transform: translateX(20px);
    background-color: white;
}

.config-page-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.config-page-actions .btn-primary {
    background: var(--bg-tertiary) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
    padding: 0.5rem 1rem !important;
    border-radius: 4px !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    min-width: 80px !important;
    box-shadow: none !important;
    text-transform: none !important;
}

.config-page-actions .btn-primary:hover {
    background: var(--bg-hover) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: var(--text-primary) !important;
    transform: none !important;
    box-shadow: none !important;
}

.config-page-actions .btn-primary:active {
    box-shadow: none !important;
    transform: none !important;
}

.config-section {
    background-color: var(--bg-secondary);
    border: 0px solid #0c4a6e;
    /* Azul más oscuro para desplegables */
    border-left: 2px solid #000d14;
    /* Azul más oscuro */
    border-radius: 8px;
    /* Reducido de 12px */
    padding: 1rem;
    /* Reducido de 1.5rem */
    margin-bottom: 1rem;
    /* Reducido de 1.5rem */
}

.config-section h4 {
    font-size: 1.05rem;
    /* Reducido de 1.25rem */
    margin-bottom: 0.75rem;
    /* Reducido de 1rem */
    color: var(--text-primary);
}

.config-option {
    margin-bottom: 0.75rem;
    /* Reducido de 1rem */
}

.config-option:last-child {
    margin-bottom: 0;
}

.config-option label {
    display: block;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    /* Reducido de 0.5rem */
    font-size: 0.9rem;
    /* Reducido de 0.95rem */
}

.config-select {
    width: 100%;
    background-color: var(--bg-primary);
    border: 0px solid var(--gray-600);
    color: var(--text-primary);
    padding: 0.6rem 0.85rem;
    /* Reducido de 0.75rem 1rem */
    border-radius: 6px;
    /* Reducido de 8px */
    font-size: 0.9rem;
    /* Reducido de 1rem */
    cursor: pointer;
}

.config-select:focus {
    outline: none;
    border-color: var(--blue-primary);
}

.config-option input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

/* Scrollbars: usamos las reglas globales definidas más arriba (html/body)
   para mantener una única apariencia en toda la app. */

/* ==================== RESPONSIVE ==================== */
/* ==================== RESPONSIVE - TABLET Y MÓVIL ==================== */
@media (max-width: 1024px) {
    .main-content {
        margin-left: 0;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

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

    .content-area {
        padding: 1rem;
    }

    .llm-grid,
    .config-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
        overflow-x: hidden;
    }

    .app-container {
        padding-bottom: 38px;
    }

    /* Sidebar móvil - oculto por defecto, se muestra con botón */
    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }

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

    .sidebar-header {
        padding: 0 0.75rem;
        margin-bottom: 1rem;
        justify-content: flex-start;
        padding-right: 3rem;
        /* Espacio para el botón de cerrar */
    }

    .sidebar-logo {
        margin-right: auto;
        /* Empuja el logo a la izquierda */
    }

    .sidebar-close-btn {
        display: flex !important;
        /* Visible en móvil */
        position: absolute;
        top: 50%;
        right: 0.75rem;
        transform: translateY(-10%);
    }

    .sidebar-nav {
        padding: 0 0.75rem;
    }

    .nav-item {
        flex-direction: row;
        justify-content: flex-start;
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }

    .nav-item span {
        display: block;
        font-size: 0.9rem;
    }

    .nav-item i {
        font-size: 1.2rem;
    }

    /* Overlay para cerrar sidebar en móvil */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar-overlay.active {
        display: block;
    }

    /* Main content */
    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .main-header {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .section-title {
        font-size: 1.1rem;
    }

    .header-actions {
        gap: 0.5rem;
    }

    .user-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .user-btn span {
        display: none;
    }

    .content-area {
        padding: 0.75rem;
    }

    /* Grids */
    .projects-grid,
    .llm-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .config-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Cards */
    .llm-card {
        padding: 1rem;
    }

    .project-card {
        padding: 1rem;
    }

    /* Botón para abrir sidebar en móvil */
    .mobile-menu-btn {
        display: flex !important;
        position: fixed;
        top: 0.75rem;
        left: 0.75rem;
        z-index: 998;
        background: var(--bg-secondary);
        border: 0px solid var(--gray-700);
        color: var(--text-primary);
        padding: 0.5rem;
        border-radius: 6px;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        transition: all 0.3s ease;
    }

    .mobile-menu-btn:hover {
        background: var(--bg-hover);
        transform: scale(1.05);
    }

    .mobile-menu-btn i {
        font-size: 1.2rem;
    }

    /* Asegurar que el botón esté oculto en desktop */
    @media (min-width: 769px) {
        .mobile-menu-btn {
            display: none !important;
        }
    }

    /* Proceso section */
    #proceso-section {
        height: calc(100vh - 100px);
    }

    .conversation-container {
        height: calc(100vh - 280px);
        padding: 1rem;
        padding-bottom: 120px;
    }

    .fixed-prompt-container {
        left: 0;
        right: 0;
        padding: 0.75rem;
        bottom: 38px;
    }

    .prompt-input-fixed {
        font-size: 16px;
        /* Evita zoom en iOS */
        padding: 0.75rem;
    }

    /* Footer en móvil */
    .app-footer {
        padding: 0.5rem 0.75rem;
        height: auto;
        min-height: auto;
        max-height: 80px;
        left: 0;
        right: 0;
        overflow-y: auto;
    }

    .footer-content {
        font-size: 0.65rem;
        gap: 0.4rem;
        flex-wrap: wrap;
        line-height: 1.4;
        padding: 0;
        justify-content: center;
        text-align: center;
    }

    .footer-separator {
        display: none;
        /* Ocultar separadores en móvil para ahorrar espacio */
    }

    .footer-link {
        font-size: 0.65rem;
        word-break: break-word;
    }

    .footer-brand {
        font-size: 0.65rem;
    }

    /* Ajustar padding del container para el footer */
    .app-container {
        padding-bottom: 50px;
        /* Más espacio para footer en móvil */
    }

    .main-content {
        height: calc(100vh - 50px);
    }

    .fixed-prompt-container {
        bottom: 50px;
    }

    /* Modales */
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 1rem auto;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    /* Tabs */
    .tabs {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .tab {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    /* Chats y proyectos layout - En móvil: proyectos arriba, chats abajo */
    .chats-projects-layout {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
        gap: 1rem;
        height: auto;
        min-height: auto;
    }

    /* Resetear grid-column en móvil */
    .chats-projects-layout .orphan-chats-column,
    .chats-projects-layout .projects-column {
        grid-column: auto !important;
    }

    /* Cambiar orden en móvil: proyectos primero, chats después */
    .chats-projects-layout .projects-column {
        order: 1 !important;
        /* Proyectos primero (arriba) */
        width: 100%;
        min-height: 300px;
        max-height: 50vh;
    }

    .chats-projects-layout .orphan-chats-column {
        order: 2 !important;
        /* Chats después (abajo) */
        width: 100%;
        min-height: 300px;
        max-height: 50vh;
    }

    .column-header {
        padding: 0.75rem 1rem;
        margin-bottom: 0.75rem;
    }

    .column-header h3 {
        font-size: 1.1rem;
    }

    .orphan-chats-list,
    .projects-list {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    /* Project drop zone más compacto en móvil */
    .project-drop-zone {
        padding: 0.75rem 1rem;
        margin-bottom: 0.75rem;
    }

    .project-header-display {
        margin-bottom: 0.5rem;
    }

    .project-icon {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    .project-info-display h4 {
        font-size: 0.95rem;
        margin-bottom: 0.25rem;
    }

    .project-info-display p {
        font-size: 0.8rem;
    }

    .project-actions {
        gap: 0.5rem;
    }

    .project-actions button {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }

    .project-chats-list {
        margin-top: 0.5rem;
        gap: 0.5rem;
    }

    .project-chat-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    /* Orphan chat items más compactos */
    .orphan-chat-item {
        padding: 0.65rem 1rem;
    }

    .orphan-chat-item .chat-name {
        font-size: 0.9rem;
    }

    .orphan-chat-item .chat-date {
        font-size: 0.7rem;
    }

    .orphan-chat-checkbox {
        width: 16px;
        height: 16px;
    }

    /* Current chat info */
    .current-chat-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .separator {
        display: none;
    }

    /* Botones */
    .btn-primary,
    .btn-secondary {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }

    .btn-send-compact,
    .btn-clear-compact {
        padding: 0.75rem;
        min-width: 44px;
        /* Tamaño mínimo táctil */
        min-height: 44px;
    }

    /* Sala section */
    .sala-container {
        padding: 1rem;
    }

    .sala-container h3 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .llm-advanced-config {
        padding: 0;
        margin-top: 1.5rem;
    }

    /* Historial */
    .history-toolbar {
        flex-direction: column;
        gap: 0.75rem;
    }

    .search-container {
        width: 100%;
    }

    /* Paginación */
    .pagination-container {
        flex-direction: column;
        gap: 0.75rem;
    }

    .pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Responsive: mantener usabilidad en pantallas pequeñas */
@media (max-width: 980px) {

    .preguntar-container,
    .conversation-container {
        max-width: 100%;
        padding: 0 0.8rem;
        margin: 0 0 1rem;
    }

    .conversation-container {
        height: calc(100vh - 300px);
    }

    .prompt-input {
        min-height: 140px;
    }
}

/* ==================== LOADING & ERROR MESSAGES ==================== */
.loading-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    color: var(--blue-primary);
    font-size: 1.1rem;
}

.loading-message i {
    font-size: 1.5rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 0px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 2rem;
    color: #ef4444;
}

.error-message i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.error-message p {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.error-message ul {
    margin: 1rem 0 0 1.5rem;
    color: var(--gray-300);
}

.error-message li {
    margin: 0.5rem 0;
}

/* ==================== GEMINI MESSAGES ==================== */
.conversation-message.gemini {
    background-color: var(--bg-tertiary);
    border-left: 2px solid #6028e2;
    /*#8b5cf6;*/
}

.conversation-message.gemini .message-header {
    color: #6028e2;
    /*#8b5cf6;*/
}

/* ==================== USER MESSAGES ==================== */
.conversation-message.user {
    background: var(--bg-secondary);
    border-left: 2px solid var(--blue-primary);
    border: 0px solid var(--gray-700);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.conversation-message.user .message-header {
    color: var(--blue-primary);
    border-bottom-color: var(--gray-700);
}

.conversation-message.user:hover {
    box-shadow: none;
    background: var(--bg-secondary);
}

/* ==================== SYSTEM MESSAGES (JOIN/LEAVE) ==================== */
.system-message {
    text-align: center;
    padding: 0.6rem 0;
    margin: 0.75rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 0px solid var(--gray-700);
    border-bottom: 0px solid var(--gray-700);
    background: linear-gradient(to right, transparent, var(--bg-tertiary) 20%, var(--bg-tertiary) 80%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.system-message i {
    color: var(--success);
    font-size: 0.8rem;
}

.system-message.claude i {
    color: #da7756;
}

.system-message.chatgpt i {
    color: #0e7e7e;
}

.system-message.gemini i {
    color: #6028e2;
    /*#8b5cf6;*/
}

/* Processing Status Message */
.processing-status {
    display: flex;
    justify-content: center;
    padding: 1.5rem;
    margin: 1rem 0;
}

.loading-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    background-color: var(--bg-tertiary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border: 0px solid #0c4a6e;
    /* Azul más oscuro para desplegables */
    border-left: 2px solid #000d14;
    /* Azul más oscuro */
}

.loading-message i {
    color: var(--blue-primary);
    font-size: 1.1rem;
    animation: spin 1s linear infinite;
}

/* Keyframes 'spin' ya definido anteriormente; eliminado duplicado. */

/* ==================== CONSENSUS RESULT ==================== */
.consensus-result {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 2rem;
    border: 0px solid #0c4a6e;
    /* Azul más oscuro para desplegables */
    border-left: 2px solid #000d14;
    /* Azul más oscuro */
}

.consensus-result h4 {
    color: var(--blue-primary);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.consensus-content {
    color: var(--gray-200);
    line-height: 1.8;
    font-size: 1.05rem;
    position: relative;
}

/* Botones copiar genéricos para respuestas iniciales, rondas y resultado
   Alineados en estilo con `.consensus-copy-btn` para consistencia visual. */
.response-copy-btn,
.round-copy-btn,
.result-copy-btn {
    background: rgba(14, 165, 233, 0.08);
    border: none;
    color: var(--blue-primary);
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: none;
    transition: background-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
    margin: 0 0.35rem;
    vertical-align: middle;
    position: relative;
    top: 0;
    left: 0;
    transform: none !important;
    z-index: 2;
}

/* Botones copiar solo visibles cuando están desplegados */
.initial-response:not(.expanded) .response-copy-btn,
.collaboration-round:not(.expanded) .round-copy-btn {
    display: none;
}

.initial-response.expanded:hover .response-copy-btn,
.collaboration-round.expanded:hover .round-copy-btn,
.consensus-result:hover .result-copy-btn {
    opacity: 1;
    transform: none !important;
}

/* Padding normal del header (sin espacio extra para botón copiar) */
.initial-response.expanded .initial-response-header,
.collaboration-round.expanded .round-header {
    padding-left: 1rem;
}

.response-copy-btn:hover,
.round-copy-btn:hover,
.result-copy-btn:hover {
    background-color: rgba(14, 165, 233, 0.12);
    color: var(--blue-light);
    transform: none !important;
    box-shadow: none !important;
}

.response-copy-btn i,
.round-copy-btn i,
.result-copy-btn i {
    font-size: 0.7rem;
}

.response-copy-btn.copied,
.round-copy-btn.copied,
.result-copy-btn.copied {
    color: var(--success);
    border-color: var(--success);
    background-color: rgba(16, 185, 129, 0.1);
}

/* Asegurar que el botón copiar quede alineado al final del header y no se superponga
   con el icono AI. Usamos selectores existentes dentro de los headers para evitar
   crear reglas globales nuevas. */
.initial-response-header .response-copy-btn,
.round-header .round-copy-btn,
.consensus-message-header .result-copy-btn {
    margin-left: auto;
    margin-right: 0.25rem;
    align-self: center;
    order: 2;
}

/* Dar espacio al icono AI para que no coincida con el botón copiar */
.round-header .ai-icon,
.initial-response-header .ai-icon,
.consensus-message-header .ai-icon {
    margin-left: 0.5rem;
    z-index: 3;
}

/* Ajuste para que el header no interfiera con el botón */
.initial-response-header .response-info,
.round-header .round-info {
    flex: 1;
    margin-left: 0;
    /* El botón copiar está a la izquierda, no necesitamos margin */
}

/* ==================== BARRA DE ACCIONES ==================== */
.response-actions-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 0.5rem;
    background: rgba(0, 0, 0, 0.02);
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: rgba(14, 165, 233, 0.08);
    color: var(--blue-primary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.85rem;
    padding: 0;
}

.action-btn:hover {
    background: rgba(14, 165, 233, 0.15);
    color: var(--blue-light);
    transform: scale(1.05);
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn i {
    font-size: 0.85rem;
}

/* Estados específicos de los botones */
.action-btn.copied {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.action-btn.copied i {
    color: var(--success);
}

.action-btn.active {
    background: rgba(14, 165, 233, 0.2);
    color: var(--blue-light);
}

.thumbs-up-btn.active {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.thumbs-down-btn.active {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.action-btn.shared {
    background: rgba(14, 165, 233, 0.2);
    color: var(--blue-light);
}

/* Asegurar que la barra de acciones esté siempre visible */
.initial-response-content .response-actions-bar,
.round-content .response-actions-bar,
.consensus-message-content-wrapper .response-actions-bar {
    display: flex;
}

/* ==================== COLLABORATION PROCESS ==================== */
.collaboration-process,
.collaboration-process.collapsible-section,
div.collaboration-process.collapsible-section {
    background: rgba(14, 165, 233, 0.05) !important;
    background-color: rgba(14, 165, 233, 0.05) !important;
    border: 0px solid rgba(14, 165, 233, 0.2);
    border-radius: 5px;
    padding: 0.4rem;
    margin: 0.4rem 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.collaboration-process::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: none;
    /* remove gradient sweep */
    transition: left 0.6s ease;
}

.collaboration-process:hover::before {
    opacity: 0;
}

.collaboration-process:hover,
.collaboration-process.collapsible-section:hover,
div.collaboration-process.collapsible-section:hover {
    background: rgba(14, 165, 233, 0.05) !important;
    background-color: rgba(14, 165, 233, 0.05) !important;
    border-color: rgba(14, 165, 233, 0.2);
    box-shadow: none !important;
    transform: none !important;
}

/* Hover individual para cada collaboration-round */
.collaboration-round:hover {
    background-color: rgba(255, 255, 255, 0.001);
}

.collaboration-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.5rem;
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.collaboration-header i {
    color: var(--blue-primary);
    font-size: 0.75rem;
}

.collaboration-header span:first-of-type {
    flex: 1;
    font-weight: 600;
    color: var(--blue-primary);
}

.collaboration-status {
    padding: 0.25rem 0.75rem;
    background: rgba(14, 165, 233, 0.2);
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--blue-light);
}

.collaboration-status.completed {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.collaboration-rounds {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* ==================== COLLABORATION ROUND (THINKING-STYLE) ==================== */
.collaboration-round {
    background: rgba(6, 8, 8, 0.65);
    border: 0px solid #0c4a6e;
    border-left: 2px solid #000d14;
    border-radius: 5px;
    overflow: hidden;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    position: relative;
}

.collaboration-round::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(14, 165, 233, 0.35);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.collaboration-round:hover::before {
    opacity: 0;
}

.collaboration-round.appearing {
    animation: slideInThinking 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.collaboration-round.claude {
    border-left: 2px solid #da7756;
}

.collaboration-round.claude:hover {
    border-left-color: #da7756;
    box-shadow: none;
}

.collaboration-round.chatgpt {
    border-left: 2px solid #0e7e7e;
}

.collaboration-round.chatgpt:hover {
    border-left-color: #0e7e7e;
    box-shadow: none;
}

.collaboration-round.gemini {
    border-left: 2px solid #6028e2;
    /*#8b5cf6;*/
}

.collaboration-round.gemini:hover {
    border-left-color: #6028e2;
    /*#a78bfa;*/
    box-shadow: none;
}

.round-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0.5rem;
    cursor: pointer;
    transition: none;
    position: relative;
    user-select: none;
    font-size: 0.75rem;
    background: linear-gradient(90deg, transparent 0%, transparent 100%);
}

.round-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: none;
    /* gradient removed for subtler hover */
    transition: left 0.5s ease;
}

.round-header:hover {
    background-color: transparent;
    transform: none !important;
    box-shadow: none !important;
}

.round-header:hover::after {
    opacity: 0;
}

.round-header:active {
    transform: translateX(2px);
}

.round-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.round-arrow {
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: inline-flex;
    align-items: center;
}

.round-header:hover .round-arrow {
    color: var(--text-muted);
}

.collaboration-round.expanded .round-arrow {
    transform: rotate(90deg);
    color: var(--blue-primary);
}

.round-title {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.75rem;
    transition: color 0.2s ease;
}

.round-header:hover .round-title {
    color: var(--text-primary);
}

.round-number {
    padding: 0.08rem 0.3rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 0.6rem;
    color: var(--text-muted);
    font-weight: 600;
    transition: all 0.2s ease;
}

.round-header:hover .round-number {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.round-header .ai-icon {
    color: var(--text-muted);
    font-size: 0.8rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.round-header:hover .ai-icon {
    transform: none;
}

.collaboration-round.claude .ai-icon {
    color: #da7756;
}

.collaboration-round.claude:hover .ai-icon {
    color: #da7756;
}

.collaboration-round.chatgpt .ai-icon {
    color: #0e7e7e;
}

.collaboration-round.chatgpt:hover .ai-icon {
    color: #0e7e7e;
}

.collaboration-round.gemini .ai-icon {
    color: #6028e2;
    /*#8b5cf6;*/
}

.collaboration-round.gemini:hover .ai-icon {
    color: #6028e2;
    /*#a78bfa;*/
}

.round-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.collaboration-round.expanded .round-content {
    max-height: 5000px;
    border-top: 0px solid var(--gray-700);
}

.round-message {
    padding: 0.5rem 0.6rem;
    color: var(--text-secondary);
    line-height: 1.4;
    font-size: 0.75rem;
}

.round-message p {
    margin: 0.5rem 0;
}

/* Animación de pulsación para mostrar que está procesando */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.collaboration-status:not(.completed) {
    opacity: 0.8;
}

/* ==================== USER QUESTION CONTAINER ==================== */
.user-question-container {
    margin: 0.5rem 0;
    padding: 0;
}

/* ==================== INITIAL RESPONSES SECTION ==================== */
/* Forzar background azul claro para respuestas iniciales - debe estar después de otros estilos */
.initial-responses-section,
.initial-responses-section.collapsible-section,
.initial-responses-section:not(.collapsible-section),
div.initial-responses-section.collapsible-section,
div.initial-responses-section,
.collapsible-section.initial-responses-section {
    background: rgba(14, 165, 233, 0.05) !important;
    background-color: rgba(14, 165, 233, 0.05) !important;
    border: 0px solid rgba(14, 165, 233, 0.2);
    border-radius: 5px;
    padding: 0.4rem;
    margin: 0.4rem 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.initial-responses-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: none !important;
    /* removed gradient sweep */
    transition: left 0.6s ease;
    pointer-events: none;
    /* No bloquear interacciones */
    z-index: -1;
    /* Asegurar que esté detrás del contenido */
}

.initial-responses-section:hover::before {
    opacity: 0;
}

.initial-responses-section:hover,
.initial-responses-section.collapsible-section:hover,
.initial-responses-section:not(.collapsible-section):hover,
div.initial-responses-section.collapsible-section:hover,
div.initial-responses-section:hover {
    background: rgba(14, 165, 233, 0.05) !important;
    background-color: rgba(14, 165, 233, 0.05) !important;
    border-color: rgba(14, 165, 233, 0.18);
    box-shadow: none !important;
    transform: none !important;
}

.collapsible-section .section-title-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.5rem;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 4px;
    position: relative;
}

.collapsible-section .section-title-bar:hover {
    /* background: rgba(14, 164, 233, 0.0); */
    transform: translateX(2px);
}

.section-arrow {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;

}

.collapsible-section.expanded .section-arrow {
    transform: rotate(90deg);
    color: var(--blue-primary);
}

.collapsible-section .section-title-bar:hover .section-arrow {
    color: var(--blue-primary);
}

.section-title-bar i:not(.section-arrow) {
    color: var(--blue-primary);
    font-size: 0.19rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


.collapsible-section:hover .section-title-bar i:not(.section-arrow) {
    transform: scale(0.9);
    color: var(--blue-primary);
}

.section-title-bar span {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.65rem;
    transition: color 0.2s ease;
}

.collapsible-section:hover .section-title-bar span {
    color: var(--blue-light);
}

/* Solo aplicar estilos de colapso a .section-content dentro de .collapsible-section */
.collapsible-section .section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 0;
    display: block;
}

.collapsible-section.expanded .section-content {
    max-height: 10000px !important;
    margin-top: 0.4rem;
    opacity: 1 !important;
    overflow: visible !important;
    display: block !important;
    visibility: visible !important;
}

/* Asegurar que el contenido sea visible cuando está expandido */
.collapsible-section.expanded .initial-responses-container,
.collapsible-section.expanded .collaboration-rounds {
    display: flex !important;
    flex-direction: column !important;
    opacity: 1 !important;
    visibility: visible !important;
    max-height: none !important;
}

/* Por defecto, las secciones deben estar expandidas si no tienen la clase collapsible-section */
.initial-responses-section:not(.collapsible-section) .initial-responses-container,
.collaboration-process:not(.collapsible-section) .collaboration-rounds {
    max-height: none !important;
    opacity: 1 !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
}

.initial-responses-container {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.initial-response {
    background: rgba(6, 8, 8, 0.65);
    border: 0px solid #0c4a6e;
    border-left: 2px solid #000d14;
    border-radius: 5px;
    overflow: hidden;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    position: relative;
}

.initial-response::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    /* Decorative top accent gradient: originally used to add a subtle
       coloured sweep at the top of each initial response. Replaced with
       a flat color to avoid gradients (alpha 0.5 as requested). */
    background: rgba(14, 165, 233, 0.35);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.initial-response:hover::before {
    opacity: 0;
}


.initial-response.appearing {
    animation: slideInThinking 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideInThinking {
    0% {
        opacity: 0;
        transform: translateY(-5px) scale(0.98);
    }

    50% {
        opacity: 0.7;
        transform: translateY(-1px) scale(1);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.initial-response.claude {
    border-left: 2px solid #da7756;
}

.initial-response.claude:hover {
    border-left-color: #da7756;
    /* Removed glow shadow to keep hovers subtle and flat */
    box-shadow: none !important;
}

.initial-response.chatgpt {
    border-left: 2px solid #0e7e7e;

}

.initial-response.chatgpt:hover {
    border-left-color: #0e7e7e;
    /*0e7e7e*/
    /* Removed glow shadow to keep hovers subtle and flat */
    box-shadow: none !important;
}

.initial-response.gemini {
    border-left: 2px solid #6028e2;
    /*#8b5cf6;*/
}

.initial-response.gemini:hover {
    border-left-color: #6028e2;
    /*#a78bfa;*/
    /* Removed glow shadow to keep hovers subtle and flat */
    box-shadow: none !important;
}

.initial-response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0.5rem;
    cursor: pointer;
    transition: none;
    user-select: none;
    font-size: 0.75rem;
    position: relative;
    background: linear-gradient(90deg, transparent 0%, transparent 100%);
}

.initial-response-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    /* Decorative sweep gradient (header highlight) - removed to avoid
       animated gradient effects. Kept area for possible future subtle
       effects. */
    background: none;
    transition: left 0.5s ease;
}

.initial-response-header:hover {
    background-color: transparent;
    transform: none !important;
    box-shadow: none !important;
}

.initial-response-header:hover::after {
    opacity: 0;
}

.initial-response-header:active {
    transform: translateY(1px);
}

/* Estilos para el contenedor de acciones en el header */
.response-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.response-actions .action-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 4px;
    transition: color 0.2s ease, background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.response-actions .action-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.1);
}

.response-actions .action-btn.active {
    color: var(--blue-primary);
}

.response-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.response-arrow {
    color: var(--text-muted);
    font-size: 0.7rem;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: inline-flex;
    align-items: center;
}

.initial-response-header:hover .response-arrow {
    color: var(--text-muted);
}

.initial-response.expanded .response-arrow {
    transform: rotate(90deg);
    color: var(--blue-primary);
}

.response-info .ai-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.75rem;
    transition: color 0.2s ease;
}

.initial-response-header:hover .ai-name {
    color: var(--text-primary);
}

.response-badge {
    padding: 0.08rem 0.3rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 0.6rem;
    color: var(--text-muted);
    font-weight: 600;
    transition: all 0.2s ease;
}

.initial-response-header:hover .response-badge {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.initial-response-header .ai-icon {
    color: var(--text-muted);
    font-size: 0.8rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.initial-response-header:hover .ai-icon {
    transform: none;
}


.initial-response.claude .ai-icon {
    color: #da7756;
}

.initial-response.claude:hover .ai-icon {
    color: #da7756;
}

.initial-response.chatgpt .ai-icon {
    color: var(--success);
}

.initial-response.chatgpt:hover .ai-icon {
    color: #0e7e7e;
}

.initial-response.gemini .ai-icon {
    color: #6028e2;
    /*#8b5cf6;*/
}

.initial-response.gemini:hover .ai-icon {
    color: #6028e2;
    /*#a78bfa;*/
}

.initial-response-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.initial-response.expanded .initial-response-content {
    max-height: 5000px;
    border-top: 0px solid var(--gray-700);
}

.response-message {
    padding: 0.5rem 0.6rem;
    color: var(--text-secondary);
    line-height: 1.4;
    font-size: 0.75rem;
}

.response-message p {
    margin: 0.5rem 0;
}

/* ==================== CHATS/PROYECTOS LAYOUT ==================== */
.chats-projects-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    height: calc(100vh - 200px);
    min-height: 600px;
}

/* En desktop con grid: orden normal (orphan-chats primero, projects después) */
.chats-projects-layout .orphan-chats-column {
    grid-column: 1;
}

.chats-projects-layout .projects-column {
    grid-column: 2;
}

.orphan-chats-column,
.projects-column {
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(14, 165, 233, 0.02) 100%);
    border: 0px solid rgba(14, 165, 233, 0.15);
    border-left: 2px solid rgba(0, 22, 32, 0.3);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.orphan-chats-column::before,
.projects-column::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(14, 165, 233, 0.3), transparent);
    pointer-events: none;
}

.orphan-chats-column:hover,
.projects-column:hover {
    border-color: rgba(14, 165, 233, 0.25);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25), 0 3px 10px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 0px solid rgba(0, 37, 54, 0.15);
    background-color: rgba(255, 255, 255, 0.03);
    /* flat subtle header background */
    position: relative;
    z-index: 1;
}

.column-header h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.15rem;
    margin: 0;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.column-header h3 i {
    color: var(--blue-primary);
    font-size: 1.2rem;
    transition: color 0.2s ease;
}

.column-header:hover h3 i {
    color: var(--blue-light);
}

.count-badge {
    background: var(--blue-primary);
    color: white;
    padding: 0.35rem 0.85rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    /* transition: background 0.2s ease; */
}

.btn-icon {
    background: var(--bg-tertiary);
    border: 0px solid var(--gray-700);
    color: var(--blue-primary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-icon:hover {
    background: var(--bg-hover);
    border-color: var(--gray-600);
    color: var(--blue-light);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.btn-icon:active {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.orphan-chats-list,
.projects-list {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

.orphan-chats-list::-webkit-scrollbar,
.projects-list::-webkit-scrollbar {
    width: 8px;
}

.orphan-chats-list::-webkit-scrollbar-track,
.projects-list::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.orphan-chats-list::-webkit-scrollbar-thumb,
.projects-list::-webkit-scrollbar-thumb {
    background: rgba(14, 165, 233, 0.3);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.orphan-chats-list::-webkit-scrollbar-thumb:hover,
.projects-list::-webkit-scrollbar-thumb:hover {
    background: rgba(14, 165, 233, 0.5);
}

/* Chat huérfano (arrastrable) */
.orphan-chat-item {
    background: var(--bg-tertiary);
    border: 0px solid var(--gray-700);
    border-left: 2px solid var(--gray-600);
    border-radius: 12px;
    padding: 0.85rem 1.25rem;
    cursor: grab;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.orphan-chat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: none;
    /* remove animated gradient */
    transition: left 0.6s ease;
}

.orphan-chat-item:hover::before {
    left: 100%;
}

.orphan-chat-item:hover {
    border-color: var(--blue-primary);
    border-left-color: var(--blue-primary);
    transform: none !important;
    box-shadow: none !important;
    background-color: rgba(255, 255, 255, 0.05);
}

.orphan-chat-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.orphan-chat-item .chat-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.orphan-chat-item .chat-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Checkbox en chats huérfanos */
.orphan-chat-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--blue-primary);
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.orphan-chat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.orphan-chat-item>.chat-name {
    flex: 1;
    margin-bottom: 0;
}

.orphan-chat-item[data-selected="true"] {
    background: var(--bg-hover);
    border-color: var(--blue-primary);
    border-left-color: var(--blue-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Proyecto (zona de drop) */
.project-drop-zone {
    background: var(--bg-tertiary);
    border: 2px dashed var(--gray-700);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: visible;
    min-height: auto;
}

.project-drop-zone:hover {
    border-color: var(--gray-600);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    background: var(--bg-hover);
}

.project-drop-zone.drag-over {
    border-color: var(--blue-primary);
    background: var(--bg-hover);
    border-style: solid;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.project-header-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
}

.project-icon-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.project-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.project-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.project-drop-zone:hover .project-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 2px 6px rgba(0, 0, 0, 0.2);
}

.project-drop-zone:hover .project-icon::before {
    left: 100%;
}

.project-info-display h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.project-stats {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.project-actions {
    display: flex;
    gap: 0.5rem;
}

.project-actions button {
    background: rgba(14, 165, 233, 0.05);
    border: 0px solid rgba(14, 165, 233, 0.2);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem 0.65rem;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.project-actions button:hover {
    background: rgba(14, 165, 233, 0.15);
    border-color: var(--blue-primary);
    color: var(--blue-primary);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.2), 0 1px 3px rgba(14, 165, 233, 0.1);
    transform: translateY(-1px) scale(1.05);
}

.project-actions .btn-new-chat-project:hover {
    color: var(--blue-light);
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.2) 0%, rgba(14, 165, 233, 0.1) 100%);
    box-shadow: 0 3px 12px rgba(14, 165, 233, 0.3), 0 1px 4px rgba(14, 165, 233, 0.2);
}

.project-chats-list {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 0px solid rgba(14, 165, 233, 0.15);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow: visible;
    min-height: 0;
}

/* Solo aplicar scroll cuando hay muchos chats - se aplicará dinámicamente con clase */
.project-chats-list.has-many-chats {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
}

.project-chats-list::-webkit-scrollbar {
    width: 6px;
}

.project-chats-list::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.project-chats-list::-webkit-scrollbar-thumb {
    background: rgba(14, 165, 233, 0.3);
    border-radius: 3px;
    transition: background 0.3s ease;
}

.project-chats-list::-webkit-scrollbar-thumb:hover {
    background: rgba(14, 165, 233, 0.5);
}

.project-chat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    margin-bottom: 0;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(14, 165, 233, 0.02) 100%);
    border: 0px solid rgba(14, 165, 233, 0.1);
    border-radius: 8px;
    cursor: grab;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.project-chat-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(14, 165, 233, 0.18);
    box-shadow: none !important;
    transform: none !important;
}

.project-chat-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.project-chat-item .unassign-chat-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 0;
}

.project-chat-item:hover .unassign-chat-btn {
    opacity: 1;
}

.project-chat-item .unassign-chat-btn:hover {
    color: var(--red-primary);
    background-color: rgba(239, 68, 68, 0.1);
}

.project-chat-actions {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.btn-go-to-chat {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-chat-item:hover .btn-go-to-chat,
.orphan-chat-item:hover .btn-go-to-chat,
.chat-item:hover .btn-go-to-chat {
    opacity: 1;
}

.btn-go-to-chat:hover {
    color: var(--blue-primary);
    background-color: rgba(14, 165, 233, 0.1);
}

.btn-go-to-chat i {
    font-size: 0.75rem;
}

/* Zona de drop para desasignar */
.unassign-drop-zone {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(239, 68, 68, 0.02) 100%);
    border: 2px dashed rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-muted);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.unassign-drop-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.unassign-drop-zone:hover {
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.15), 0 2px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(239, 68, 68, 0.06) 100%);
}

.unassign-drop-zone:hover::before {
    opacity: 1;
}

.unassign-drop-zone.drag-over {
    border-color: var(--red-primary);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.08) 100%);
    border-style: solid;
    color: var(--red-primary);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3), 0 3px 10px rgba(239, 68, 68, 0.2);
    transform: scale(1.02);
}

.unassign-drop-zone i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.unassign-drop-zone p {
    margin: 0;
    font-size: 0.875rem;
}


/* ==================== MODAL ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--bg-secondary);
    border: none;
    border-radius: 8px;
    /* Reducido de 12px */
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

.config-modal-content {
    max-width: 1000px;
    width: 90%;
    height: 85vh;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 8px;
}

.config-modal-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    background: var(--bg-secondary);
}

.config-modal-topbar h3 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.config-modal-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar izquierdo */
.config-sidebar {
    width: 25%;
    min-width: 200px;
    background: var(--bg-primary);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.config-search {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}

.config-search i {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.config-search input {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 0.5rem 0.75rem 0.5rem 2rem;
    color: var(--text-primary);
    font-size: 0.8125rem;
    transition: border-color 0.2s ease;
}

.config-search input::placeholder {
    color: var(--text-muted);
}

.config-search input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.2);
}

.config-nav {
    padding: 0.25rem 0;
    display: flex;
    flex-direction: column;
}

.config-nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8125rem;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.config-nav-item i {
    font-size: 0.8125rem;
    width: 16px;
    text-align: center;
}

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

.config-nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-left-color: var(--blue-primary);
}

/* Área de contenido derecha */
.config-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem;
    background: var(--bg-secondary);
}

.config-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1.25rem 0;
}

.config-setting-group {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.config-setting {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.875rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.config-setting:last-child {
    border-bottom: none;
}

.config-setting-info {
    flex: 1;
    min-width: 0;
    padding-right: 1rem;
}

.config-setting-info label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.config-setting-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

.config-input-inline {
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    font-size: 0.8125rem;
    width: 100px;
    flex-shrink: 0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    text-align: right;
}

.config-input-inline:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

.config-input-inline:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.config-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    bottom: 0;
    background: var(--bg-secondary);
    z-index: 10;
}

.config-modal-actions .btn-secondary {
    background: var(--bg-tertiary) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
    padding: 0.5rem 1rem !important;
    border-radius: 4px !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 80px !important;
    box-shadow: none !important;
    text-transform: none !important;
}

.config-modal-actions .btn-secondary:hover {
    background: var(--bg-hover) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: var(--text-primary) !important;
    transform: none !important;
    box-shadow: none !important;
}

.config-modal-actions .btn-save-changes {
    background: var(--bg-tertiary) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
    padding: 0.5rem 1rem !important;
    border-radius: 4px !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    min-width: 80px !important;
    box-shadow: none !important;
    text-transform: none !important;
}

.config-modal-actions .btn-save-changes:hover {
    background: var(--bg-hover) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: var(--text-primary) !important;
    transform: none !important;
    box-shadow: none !important;
}

.config-modal-actions .btn-save-changes:active {
    box-shadow: none !important;
    transform: none !important;
}

.config-modal-actions .btn-save-changes i {
    font-size: 0.875rem !important;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    /* Reducido de 1.5rem */
    border-bottom: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
    /* Reducido de 1.25rem */
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.125rem;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: none;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.15);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--bg-tertiary);
    border: 0px solid #0c4a6e;
    /* Azul más oscuro para desplegables */
    border-left: 2px solid #000d14;
    /* Azul más oscuro */
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-help-text {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.project-instructions-files {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.project-instructions-files-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.project-instruction-file-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--bg-tertiary);
    border: 0px solid var(--gray-600);
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.project-instruction-file-item .file-icon {
    color: var(--blue-primary);
    font-size: 0.9rem;
}

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

.project-instruction-file-item .file-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.project-instruction-file-item .file-remove:hover {
    color: var(--red-primary);
}

.icon-preview-btn {
    width: 60px;
    height: 60px;
    border: 2px solid var(--gray-700);
    border-radius: 8px;
    background-color: var(--bg-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.2s ease;
}

.icon-preview-btn:hover {
    border-color: var(--blue-primary);
    background-color: var(--bg-hover);
}

.color-picker {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.color-input {
    width: 60px;
    height: 40px;
    border: 0px solid #0c4a6e;
    /* Azul más oscuro para desplegables */
    border-left: 2px solid #000d14;
    /* Azul más oscuro */
    border-radius: 6px;
    cursor: pointer;
    background: none;
}

.color-text-input {
    flex: 1;
    padding: 0.75rem;
    background-color: var(--bg-tertiary);
    border: 0px solid #0c4a6e;
    /* Azul más oscuro para desplegables */
    border-left: 2px solid #000d14;
    /* Azul más oscuro */
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
}

.modal-icon-picker {
    max-width: 600px;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 0.5rem;
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.icon-option {
    width: 50px;
    height: 50px;
    border: 2px solid var(--gray-700);
    border-radius: 8px;
    background-color: var(--bg-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

.icon-option:hover {
    border-color: var(--blue-primary);
    background-color: var(--bg-hover);
    transform: scale(1.1);
}

.icon-option.selected {
    border-color: var(--blue-primary);
    background-color: rgba(14, 165, 233, 0.2);
}

/* ==================== MARKDOWN CONTENT STYLES ==================== */
.markdown-content {
    line-height: 1.7;
    color: var(--text-secondary);
}

/* Headings */
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    color: var(--text-primary);
    font-weight: 600;
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.markdown-content h1 {
    font-size: 1.5rem;
}

.markdown-content h2 {
    font-size: 1.3rem;
}

.markdown-content h3 {
    font-size: 1.15rem;
}

.markdown-content h4 {
    font-size: 1rem;
}

.markdown-content h5 {
    font-size: 0.95rem;
}

.markdown-content h6 {
    font-size: 0.9rem;
}

/* Paragraphs */
.markdown-content p {
    margin-bottom: 0.85rem;
}

.markdown-content p:last-child {
    margin-bottom: 0;
}

/* Links */
.markdown-content a {
    color: var(--blue-primary);
    text-decoration: none;
    border-bottom: 0px solid transparent;
    transition: all 0.2s ease;
}

.markdown-content a:hover {
    border-bottom-color: var(--blue-primary);
}

/* External links (open in new tab) */
.markdown-content a[target="_blank"] {
    position: relative;
    padding-right: 0.5rem;
}

.markdown-content a[target="_blank"]::after {
    content: '↗';
    font-size: 0.75em;
    margin-left: 0.25rem;
    opacity: 0.7;
    display: inline-block;
    vertical-align: super;
    line-height: 1;
}

/* Emphasis */
.markdown-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.markdown-content em {
    font-style: italic;
    color: var(--text-primary);
}

/* Lists */
.markdown-content ul,
.markdown-content ol {
    margin: 0.75rem 0;
    padding-left: 1.75rem;
}

.markdown-content li {
    margin-bottom: 0.4rem;
}

.markdown-content ul {
    list-style-type: disc;
}

.markdown-content ol {
    list-style-type: decimal;
}

.markdown-content ul ul,
.markdown-content ol ul {
    list-style-type: circle;
    margin-top: 0.4rem;
}

.markdown-content ul ol,
.markdown-content ol ol {
    list-style-type: lower-alpha;
    margin-top: 0.4rem;
}

/* Blockquotes */
.markdown-content blockquote {
    border-left: 2px solid var(--blue-primary);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-muted);
    font-style: italic;
    background-color: rgba(14, 165, 233, 0.05);
    padding: 0.75rem 1rem;
    border-radius: 0 6px 6px 0;
}

/* Horizontal Rule */
.markdown-content hr {
    border: none;
    border-top: 2px solid var(--gray-700);
    margin: 1.5rem 0;
}

/* Tables */
.markdown-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.markdown-content table th,
.markdown-content table td {
    border: 0px solid #0c4a6e;
    /* Azul más oscuro para desplegables */
    border-left: 2px solid #000d14;
    /* Azul más oscuro */
    padding: 0.6rem 0.85rem;
    text-align: left;
}

.markdown-content table th {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
}

.markdown-content table tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

.markdown-content table tr:hover {
    background-color: rgba(14, 165, 233, 0.05);
}

/* Inline Code */
.markdown-content code:not(pre code) {
    background-color: var(--bg-tertiary);
    border: 0px solid #0c4a6e;
    /* Azul más oscuro para desplegables */
    border-left: 2px solid #000d14;
    /* Azul más oscuro */
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875em;
    color: var(--blue-light);
}

/* Code Blocks */
.markdown-content pre {
    background-color: #282c34;
    border: 0px solid #0c4a6e;
    /* Azul más oscuro para desplegables */
    border-left: 2px solid #000d14;
    /* Azul más oscuro */
    border-radius: 6px;
    padding: 0;
    margin: 1rem 0;
    overflow: hidden;
    position: relative;
}

.markdown-content pre code {
    display: block;
    padding: 1rem;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #abb2bf;
}

/* Code Block Header (with language and copy button) */
.code-block-wrapper {
    position: relative;
    margin: 1rem 0;
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #21252b;
    border: 0px solid #0c4a6e;
    /* Azul más oscuro para desplegables */
    border-left: 2px solid #00101a;
    /* Azul más oscuro */
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    padding: 0.4rem 0.75rem;
}

.code-block-language {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    font-family: 'Consolas', 'Monaco', monospace;
}

.code-copy-btn {
    background: none;
    border: 0px solid var(--gray-600);
    color: var(--text-secondary);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.code-copy-btn:hover {
    background-color: var(--bg-hover);
    border-color: var(--blue-primary);
    color: var(--blue-primary);
}

.code-copy-btn i {
    font-size: 0.7rem;
}

.code-copy-btn.copied {
    color: var(--success);
    border-color: var(--success);
}

.code-block-wrapper pre {
    margin: 0;
    border-radius: 0 0 6px 6px;
}

/* Scrollbar for code blocks */
.markdown-content pre::-webkit-scrollbar {
    height: 8px;
}

.markdown-content pre::-webkit-scrollbar-track {
    background: #21252b;
}

.markdown-content pre::-webkit-scrollbar-thumb {
    background: #4b5263;
    border-radius: 4px;
}

.markdown-content pre::-webkit-scrollbar-thumb:hover {
    background: #5c6370;
}

/* Task Lists (GitHub-style) */
.markdown-content input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

/* Images */
.markdown-content img {
    max-width: 100%;
    border-radius: 6px;
    margin: 1rem 0;
}

/* ==================== FOOTER ==================== */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-primary);
    padding: 0.5rem 1.5rem;
    height: 40px;
    /* Altura fija para alineación */
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

.footer-content {
    max-width: 1200px;
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.4;
}

.footer-brand {
    font-weight: 600;
    color: var(--blue-primary);
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
    cursor: pointer;
}

.footer-link:hover {
    color: var(--text-secondary);
    text-decoration: underline;
}

.footer-separator {
    color: var(--text-muted);
    opacity: 0.5;
}

/* Responsive: ajustes del footer en pantallas pequeñas */
/* Ajustes adicionales para móvil pequeño */
@media (max-width: 480px) {
    body {
        font-size: 13px;
    }

    .main-header {
        padding: 0.5rem 0.75rem;
    }

    .section-title {
        font-size: 1rem;
    }

    .content-area {
        padding: 0.5rem;
    }

    .llm-card,
    .project-card {
        padding: 0.75rem;
    }

    /* Proyectos aún más compactos en móvil pequeño */
    .project-drop-zone {
        padding: 0.65rem 0.85rem;
    }

    .project-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .project-info-display h4 {
        font-size: 0.9rem;
    }

    .project-info-display p {
        font-size: 0.75rem;
    }

    .orphan-chat-item {
        padding: 0.55rem 0.85rem;
    }

    .project-chat-item {
        padding: 0.45rem 0.65rem;
        font-size: 0.8rem;
    }

    .orphan-chats-list,
    .projects-list {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .column-header {
        padding: 0.5rem 0.75rem;
    }

    .column-header h3 {
        font-size: 1rem;
    }

    .conversation-container {
        padding: 0.75rem;
        padding-bottom: 120px;
    }

    .fixed-prompt-container {
        padding: 0.5rem;
        bottom: auto;
        min-height: auto;
    }

    .prompt-input-fixed {
        font-size: 16px;
        padding: 0.65rem;
    }

    /* Footer en móvil pequeño */
    .app-footer {
        padding: 0.4rem 0.5rem;
        height: auto;
        min-height: auto;
        max-height: 70px;
        overflow-y: auto;
    }

    .footer-content {
        font-size: 0.6rem;
        gap: 0.3rem;
        line-height: 1.3;
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }

    .footer-separator {
        display: none;
    }

    .footer-link {
        font-size: 0.6rem;
        word-break: break-word;
    }

    .footer-brand {
        font-size: 0.6rem;
    }

    /* Ajustar padding del container para el footer */
    .app-container {
        padding-bottom: 45px;
    }

    .main-content {
        height: calc(100vh - 45px);
    }

    .fixed-prompt-container {
        bottom: 45px;
    }

    .btn-send-compact,
    .btn-clear-compact {
        padding: 0.65rem;
        min-width: 40px;
        min-height: 40px;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }

    .sala-container h3 {
        font-size: 1.25rem;
    }

    .llm-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .llm-toggle {
        align-self: flex-end;
    }
}

/* ==================== CONSENSUS RESPONSE (MENSAJE NORMAL) ==================== */
.consensus-response.consensus-message {
    background: var(--bg-secondary);
    border: 0px solid rgba(14, 165, 233, 0.3);
    border-left: 2px solid var(--blue-primary);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 1rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(5px);
}

.consensus-response.consensus-message.appearing {
    animation: consensusAppear 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes consensusAppear {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.consensus-response.consensus-message:hover {
    border-left-color: var(--blue-light);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.75);
    transform: translateY(-1px);
}

.consensus-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(14, 165, 233, 0.05) 100%);
    border-bottom: 0px solid rgba(14, 165, 233, 0.2);
}

.consensus-message-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
}

.consensus-icon {
    color: var(--blue-primary);
    font-size: 1.1rem;
}

.consensus-message-title {
    font-weight: 600;
    color: var(--blue-primary);
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}

.consensus-copy-btn {
    background: rgba(14, 165, 233, 0.1);
    border: 0px solid rgba(14, 165, 233, 0.3);
    color: var(--blue-primary);
    cursor: pointer;
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.75rem;
    opacity: 1;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.consensus-copy-btn:hover {
    background: rgba(14, 165, 233, 0.2);
    border-color: var(--blue-primary);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.consensus-message-content {
    padding: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.9rem;
    animation: fadeInContent 0.5s ease-in 0.2s both;
}

@keyframes fadeInContent {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.consensus-message-content p {
    margin: 0.75rem 0;
}

.consensus-message-content p:first-child {
    margin-top: 0;
}

.consensus-message-content p:last-child {
    margin-bottom: 0;
}

/* ==================== CONSENSUS EDITOR ==================== */
.consensus-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.consensus-toggle-view-btn {
    background: rgba(14, 165, 233, 0.1);
    border: 0px solid rgba(14, 165, 233, 0.3);
    color: var(--blue-primary);
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    box-shadow: 0 1px 3px rgba(14, 165, 233, 0.2);
}

.consensus-toggle-view-btn:hover {
    background: rgba(14, 165, 233, 0.2);
    border-color: var(--blue-primary);
    color: var(--blue-light);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3), 0 1px 3px rgba(14, 165, 233, 0.2);
    transform: translateY(-1px);
}

.consensus-message-content-wrapper {
    position: relative;
}

.consensus-editor-container-wrapper {
    padding: 0;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

.consensus-editor-container {
    width: 100%;
    border-radius: 0;
}

.consensus-editor-container .CodeMirror {
    height: auto;
    min-height: 200px;
    max-height: 600px;
    font-size: 0.9rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    border: none;
    border-radius: 0;
    background: #15151a !important;
}

.consensus-editor-container .CodeMirror-scroll {
    min-height: 200px;
    max-height: 600px;
}

.consensus-editor-container .CodeMirror-gutters {
    background: #1e1e1e;
    border-right: 0px solid #3a3a3a;
}

.consensus-editor-container .CodeMirror-linenumber {
    color: #6e6e6e;
}

.consensus-editor-container .CodeMirror-cursor {
    border-left: 2px solid #f8f8f0;
}

.consensus-text-editor-container {
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 0 0 8px 8px;
}

.consensus-text-editor {
    width: 100%;
    min-height: 200px;
    max-height: 600px;
    padding: 1rem;
    background: var(--bg-secondary);
    border: none;
    /*0px solid rgba(14, 165, 233, 0.2);*/
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    line-height: 1.6;
    resize: vertical;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.consensus-text-editor:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.consensus-editor-view {
    padding: 1rem;
}

/* Ajustes para el editor cuando está visible */
.consensus-response .consensus-editor-container-wrapper {
    display: block;
}

.consensus-response .consensus-editor-view {
    display: none;
}

/* Unificar flechas de listas y desplegables: tamaño pequeño y color blanco */
li>.fa-angle-right,
li>.fa-chevron-right,
li>.fa-arrow-right,
.conversation-arrow,
.ia-arrow,
.list-arrow,
.chevron,
.arrow,
.project-chat-item .fa-angle-right,
.project-chat-item .fa-chevron-right,
.project-chat-item .fa-arrow-right {
    font-size: 0.75rem !important;
    color: #fff !important;
    opacity: 1 !important;
    vertical-align: middle !important;
    line-height: 1 !important;
}

/* ==================== FORZAR BACKGROUND PARA INITIAL RESPONSES (máxima prioridad) ==================== */
/* Este estilo debe estar al final para asegurar que se aplique sobre cualquier otro */
div.initial-responses-section,
div.initial-responses-section.collapsible-section,
.collapsible-section.initial-responses-section,
div.collapsible-section.initial-responses-section,
.conversation-area .initial-responses-section,
.conversation-area .initial-responses-section.collapsible-section,
#conversation-display .initial-responses-section,
#conversation-display .initial-responses-section.collapsible-section {
    background: rgba(14, 165, 233, 0.05) !important;
    background-color: rgba(14, 165, 233, 0.05) !important;
    background-image: none !important;
}

/* Forzar background incluso cuando no está en hover */
div.initial-responses-section:not(:hover),
div.initial-responses-section.collapsible-section:not(:hover),
.collapsible-section.initial-responses-section:not(:hover) {
    background: rgba(14, 165, 233, 0.05) !important;
    background-color: rgba(14, 165, 233, 0.05) !important;
}

/* ==================== THINKING MESSAGES ==================== */
.thinking-message {
    background: none;
    border-left: 2px solid #667eea;
    padding: 4px 0 4px 10px;
    margin: 3px 0;
    animation: thinkingFadeIn 0.2s ease-in;
    opacity: 0.85;
}

.thinking-content {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #667eea;
    font-size: 11px;
    font-weight: 500;
    font-style: italic;
}

.thinking-icon {
    font-size: 12px;
    animation: thinkingPulse 1.5s ease-in-out infinite;
    flex-shrink: 0;
    opacity: 0.8;
}

@keyframes thinkingPulse {

    0%,
    100% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }
}

@keyframes thinkingFadeIn {
    from {
        opacity: 0;
        transform: translateX(-5px);
    }

    to {
        opacity: 0.85;
        transform: translateX(0);
    }
}

@keyframes thinkingFadeOut {
    from {
        opacity: 0.85;
        transform: translateX(0);
        max-height: 30px;
    }

    to {
        opacity: 0;
        transform: translateX(-5px);
        max-height: 0;
        margin: 0;
        padding: 0;
    }
}

.thinking-message.fade-out {
    animation: thinkingFadeOut 0.3s ease-out forwards;
}

/* Responsive */
@media (max-width: 768px) {
    .thinking-message {
        padding: 3px 0 3px 8px;
        margin: 2px 0;
    }

    .thinking-content {
        font-size: 10px;
        gap: 5px;
    }

    .thinking-icon {
        font-size: 11px;
    }
}

/* ==================== FINAL CONSENSUS ==================== */
.final-consensus {
    background-color: rgba(14, 165, 233, 0.08);
    /* Blue tint (Sky 500) */
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0 2rem 0;
    position: relative;
    animation: fadeIn 0.5s ease-out;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.consensus-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(14, 165, 233, 0.15);
    color: var(--blue-primary);
    /* Using app variable */
}

.consensus-header i {
    font-size: 1.25rem;
    filter: drop-shadow(0 0 5px rgba(14, 165, 233, 0.4));
}

.consensus-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.5px;
}

.consensus-content {
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.6;
}

.consensus-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: flex-end;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.final-consensus:hover .consensus-actions {
    opacity: 1;
}

.consensus-actions .action-btn {
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.consensus-actions .action-btn:hover {
    background: rgba(14, 165, 233, 0.15);
    color: var(--blue-primary);
    border-color: rgba(14, 165, 233, 0.3);
    transform: translateY(-1px);
}