.ia-wrap { max-width: 980px; }

.ia-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1rem;
    height: 65vh;
    min-height: 480px;
}

.ia-sidebar {
    border: 1px solid var(--color-sutil, #e5e7eb);
    border-radius: 10px;
    padding: 0.75rem;
    overflow-y: auto;
}

.ia-conversaciones-lista {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ia-conversaciones-lista li a {
    display: block;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    color: var(--color-texto, #212529);
    text-decoration: none;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ia-conversaciones-lista li a:hover { background: var(--color-sutil, #f1f5f9); }
.ia-conversaciones-lista li a.active { background: #e0e7ff; color: #3730a3; font-weight: 600; }

.ia-chat {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-sutil, #e5e7eb);
    border-radius: 10px;
    overflow: hidden;
}

.ia-mensajes {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.ia-mensaje { display: flex; }
.ia-mensaje--usuario { justify-content: flex-end; }
.ia-mensaje--asistente { justify-content: flex-start; }

.ia-mensaje__burbuja {
    max-width: 75%;
    padding: 0.55rem 0.85rem;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.4;
    white-space: pre-wrap;
}

.ia-mensaje--usuario .ia-mensaje__burbuja { background: #0d6efd; color: #fff; border-bottom-right-radius: 2px; }
.ia-mensaje--asistente .ia-mensaje__burbuja { background: var(--color-sutil, #f1f5f9); color: var(--color-texto, #212529); border-bottom-left-radius: 2px; }
.ia-mensaje__burbuja a { color: inherit; text-decoration: underline; font-weight: 600; }

.ia-input-form {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid var(--color-sutil, #e5e7eb);
}

.ia-input-form textarea { flex: 1; resize: none; }
.ia-restantes { display: block; text-align: right; padding: 0 0.75rem 0.5rem; font-size: 0.78rem; }

.ia-vacio { text-align: center; color: var(--color-texto-suave, #6c757d); padding: 2.5rem 1rem; }
.ia-sugerencias { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 1rem; }
.ia-sugerencia {
    border: 1px solid var(--color-sutil, #e5e7eb);
    background: #fff;
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.82rem;
    color: var(--color-texto, #212529);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.ia-sugerencia:hover { border-color: #198754; background: #f0fdf4; }

.ia-titulo { display: flex; align-items: center; gap: 0.6rem; }
.ia-titulo__eva { width: 2.25rem; height: 2.25rem; flex-shrink: 0; }
.ia-nota { font-size: 0.82rem; color: var(--color-texto-suave, #6c757d); margin: 0.75rem 0 0; }

@media (max-width: 767.98px) {
    .ia-layout { grid-template-columns: 1fr; height: auto; }
    .ia-sidebar { max-height: 160px; }
    .ia-chat { height: 70vh; min-height: 420px; }
    .ia-mensaje__burbuja { max-width: 88%; }
}
