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

body{

    font-family:'Inter',sans-serif;

    background:#f4f7fb;

    height:100vh;

    overflow:hidden;

}

.app{

    display:flex;

    flex-direction:column;

    height:100vh;

}

.topbar{

    height:70px;

    background:#ffffff;

    border-bottom:1px solid #e5e7eb;

    display:flex;

    align-items:center;

    padding:0 30px;

    box-shadow:0 2px 15px rgba(0,0,0,.03);

}

.logo{

    font-size:24px;

    font-weight:700;

    color:#2563eb;

}

.logo i{

    margin-right:10px;

}

.user{

    color:#666;

    font-weight:500;

}

.chat-container{
    flex:1;
    width:100%;
    max-width:900px;
    margin:0 auto;
    display:flex;
    flex-direction:column;
    padding:25px;
    overflow:hidden;
    min-height:0;
}

.logo-big{

    width:90px;

    height:90px;

    border-radius:25px;

    background:linear-gradient(135deg,#2563eb,#5b8cff);

    display:flex;

    align-items:center;

    justify-content:center;

    color:white;

    font-size:40px;

    margin:auto;

    margin-bottom:25px;

    box-shadow:0 15px 40px rgba(37,99,235,.25);

}

.welcome h1{

    font-size:48px;

    font-weight:700;

    margin-bottom:15px;

}

.welcome p{

    font-size:22px;

    color:#666;

    line-height:1.6;

}

.chat-input{

    background:white;

    border-top:1px solid #e5e7eb;

    padding:25px;

}

.chat-input .form-control{

    border-radius:18px;

    border:none;

    background:#f4f6fb;

    padding:18px 20px;

    font-size:18px;

}

.chat-input .form-control:focus{

    box-shadow:none;

    background:white;

    border:1px solid #2563eb;

}

.chat-input .btn{

    border-radius:18px;

    width:70px;

    font-size:22px;

}
.subtitle{

    font-size:24px;

    color:#2563eb;

    font-weight:600;

    margin-top:15px;

}

.description{

    margin-top:20px;

    color:#6b7280;

    font-size:18px;

    max-width:650px;

    line-height:1.8;

}

.chat-area{
    flex:1;
    width:100%;
    margin-top:25px;
    overflow-y:auto;
    overflow-x:hidden;
    min-height:0;
    padding-right:8px;
}

.welcome{
    flex-shrink:0;
}

.chat-box{

    background:white;

    border-radius:22px;

    padding:10px;

    display:flex;

    align-items:center;

    box-shadow:0 10px 40px rgba(0,0,0,.08);

}

.attach-btn{

    width:52px;

    height:52px;

    border:none;

    border-radius:15px;

    background:transparent;

    font-size:22px;

    color:#666;

}

.attach-btn:hover{

    background:#f2f4f8;

}

.send-btn{

    width:52px;

    height:52px;

    border:none;

    border-radius:15px;

    background:#2563eb;

    color:white;

    font-size:20px;

    transition:.25s;

}

.send-btn:hover{

    transform:scale(1.05);

    background:#1d4ed8;

}

.chat-box .form-control{

    border:none!important;

    background:transparent!important;

    box-shadow:none!important;

    font-size:18px;

}
.mensaje{

    max-width:75%;
    padding:16px 22px;
    border-radius:18px;
    margin:15px 0;
    font-size:17px;
    line-height:1.6;
    white-space: pre-wrap;

}

.usuario {
    width: fit-content;
    max-width: 75%;
    margin-left: auto;
    padding: 10px 15px;

    background: #dbeafe;
    color: #1e3a8a;

    border: 1px solid #bfdbfe;
    border-radius: 16px 16px 5px 16px;

    box-shadow: 0 3px 10px rgba(37, 99, 235, .08);
    font-weight: 500;
}

.ia{
    background:white;
    color:#222;
    margin-right:auto;
    box-shadow:0 5px 20px rgba(0,0,0,.08);
    text-align:left;
}

.pensando{
    display:flex;
    align-items:center;
    gap:12px;
    width:max-content;
    min-height:56px;
}

.pensando-texto{
    display:block;
    color:#6b7280;
    font-size:15px;
    font-weight:500;
}

.pensando-puntos{
    display:flex;
    align-items:center;
    gap:5px;
}

.pensando-puntos i{
    display:block;
    width:8px;
    height:8px;
    border-radius:50%;
    background:#2563eb;
    animation:pensandoAnimacion 1.2s infinite ease-in-out;
}

.pensando-puntos i:nth-child(2){
    animation-delay:.15s;
}

.pensando-puntos i:nth-child(3){
    animation-delay:.30s;
}

@keyframes pensandoAnimacion{
    0%, 80%, 100%{
        opacity:.25;
        transform:translateY(0);
    }

    40%{
        opacity:1;
        transform:translateY(-5px);
    }
}

/* =========================================================
   Ariadna.ws - Núcleo versión 1.0
   Elementos estructurados de conocimiento
   ========================================================= */

.respuesta-principal{
    white-space:pre-wrap;
    font-size:17px;
    line-height:1.65;
}

.knowledge-items{
    margin-top:20px;
    display:flex;
    flex-direction:column;
    gap:12px;
}

.knowledge-item{
    position:relative;
    border:1px solid transparent;
    border-radius:14px;
    padding:14px 16px;
    text-align:left;
    transition:.2s ease;
}

.knowledge-item:hover{
    transform:translateY(-1px);
}

.knowledge-item-header{
    display:flex;
    align-items:center;
    gap:9px;
    margin-bottom:7px;
    font-size:15px;
    font-weight:700;
    color:#374151;
}

.knowledge-item-header i{
    font-size:17px;
}

.knowledge-item-content{
    color:#4b5563;
    font-size:15px;
    line-height:1.65;
    white-space:pre-wrap;
}

.knowledge-item-page{
    display:flex;
    align-items:center;
    gap:5px;
    margin-top:9px;
    color:#6b7280;
    font-size:13px;
    font-weight:500;
}

.knowledge-item-link{
    display:inline-flex;
    align-items:center;
    gap:6px;
    margin-top:11px;
    padding:8px 13px;
    border-radius:9px;
    background:#2563eb;
    color:white;
    text-decoration:none;
    font-size:14px;
    font-weight:600;
    transition:.2s;
}

.knowledge-item-link:hover{
    background:#1d4ed8;
    color:white;
    transform:translateY(-1px);
}

/* Resumen */
.knowledge-item-resumen{
    background:#eff6ff;
}

.knowledge-item-resumen .knowledge-item-header{
    color:#1d4ed8;
}

/* Causa */
.knowledge-item-causa{
    background:#fff7ed;
}

.knowledge-item-causa .knowledge-item-header{
    color:#c2410c;
}

/* Solución */
.knowledge-item-solucion{
    background:#f0fdf4;
}

.knowledge-item-solucion .knowledge-item-header{
    color:#15803d;
}

/* Comprobaciones */
.knowledge-item-comprobacion{
    background:#f8fafc;
    border-color:#e2e8f0;
}

.knowledge-item-comprobacion .knowledge-item-header{
    color:#334155;
}

/* Advertencias */
.knowledge-item-advertencia{
    background:#fff7ed;
    border-color:#fed7aa;
}

.knowledge-item-advertencia .knowledge-item-header{
    color:#c2410c;
}

/* Notas */
.knowledge-item-nota{
    background:#f5f3ff;
}

.knowledge-item-nota .knowledge-item-header{
    color:#6d28d9;
}

/* Imágenes */
.knowledge-item-imagen{
    background:#f0f9ff;
}

.knowledge-item-imagen .knowledge-item-header{
    color:#0369a1;
}

/* Vídeos */
.knowledge-item-video{
    background:#faf5ff;
}

.knowledge-item-video .knowledge-item-header{
    color:#7e22ce;
}

/* Documentos */
.knowledge-item-documento{
    background:#f8fafc;
}

.knowledge-item-documento .knowledge-item-header{
    color:#475569;
}

/* URLs */
.knowledge-item-url{
    background:#f8fafc;
}

.knowledge-item-url .knowledge-item-header{
    color:#2563eb;
}

/* Conocimiento relacionado */
.knowledge-item-relacionado{
    background:#eef2ff;
}

.knowledge-item-relacionado .knowledge-item-header{
    color:#4338ca;
}

/* =========================================================
   Relaciones entre conocimientos
   ========================================================= */

.knowledge-relations{
    margin-top:18px;
    padding-top:16px;
    border-top:1px solid #e5e7eb;
}

.knowledge-relations-title{
    display:flex;
    align-items:center;
    gap:8px;
    margin-bottom:10px;
    color:#4338ca;
    font-size:14px;
    font-weight:700;
}

.knowledge-relations-title i{
    font-size:17px;
}

.knowledge-relation-item{

    width:100%;

    display:flex;
    justify-content:space-between;
    align-items:center;

    padding:14px 18px;

    margin-top:10px;

    background:#eef2ff;

    border:1px solid #dbe3ff;

    border-radius:12px;

    cursor:pointer;

    transition:.25s;

    text-align:left;

}

.knowledge-relation-item:hover{

    background:white;

    border-color:#2563eb;

    transform:translateY(-2px);

    box-shadow:0 8px 20px rgba(37,99,235,.12);

}

.knowledge-relation-left{

    display:flex;
    flex-direction:column;
    gap:4px;

}

.knowledge-relation-left strong{

    color:#1e3a8a;

    font-size:15px;

}

.knowledge-relation-left span{

    color:#6b7280;

    font-size:13px;

}

.knowledge-relation-arrow{

    font-size:22px;

    color:#2563eb;

    transition:.2s;

}

.knowledge-relation-item:hover .knowledge-relation-arrow{

    transform:translateX(5px);

}

.knowledge-item-page-link{
    width:max-content;
    color:#64748b;
    text-decoration:none;
    cursor:pointer;
    transition:.2s;
}

.knowledge-item-page-link:hover{
    color:#2563eb;
    text-decoration:underline;
}

.knowledge-item-header{
    margin-bottom:8px;
}

.knowledge-item-content{
    margin-left:28px;
}

/* =========================================================
   RECURSOS DE LOS ELEMENTOS
   ========================================================= */

.knowledge-item-resource{
    display:flex;
    align-items:center;
    gap:6px;
    width:max-content;
    margin-top:6px;
    margin-left:28px;
    font-size:.82rem;
    color:#2563eb;
    font-weight:600;
    text-decoration:none;
    line-height:1.3;
    transition:.2s;
}

.knowledge-item-resource:hover{
    color:#1d4ed8;
    text-decoration:underline;
}

.knowledge-item-resource i{
    font-size:.82rem;
}


/* =========================================================
   VISOR DE RECURSOS
   ========================================================= */

.resource-viewer{
    position:fixed;
    inset:0;
    z-index:9999;
    display:flex;
    justify-content:center;
    align-items:center;
}

.resource-viewer.hidden{
    display:none;
}

.resource-viewer-backdrop{
    position:absolute;
    inset:0;
    background:rgba(0,0,0,.75);
    backdrop-filter:blur(3px);
}

.resource-viewer-window{
    position:relative;
    z-index:2;
    max-width:90vw;
    max-height:90vh;
    background:#fff;
    border-radius:18px;
    padding:20px;
    box-shadow:0 20px 60px rgba(0,0,0,.35);
    overflow:auto;
}

.resource-viewer-close{
    position:absolute;
    top:12px;
    right:12px;
    width:40px;
    height:40px;
    border:none;
    border-radius:50%;
    background:#f3f4f6;
    cursor:pointer;
    font-size:18px;
    transition:.2s;
}

.resource-viewer-close:hover{
    background:#e5e7eb;
    transform:rotate(90deg);
}

#resourceViewerContent{
    text-align:center;
}

#resourceViewerContent img{
    max-width:100%;
    max-height:75vh;
    border-radius:12px;
}

.resource-viewer-video{
    display:block;
    width:min(900px,85vw);
    max-height:75vh;
    background:#000;
    border-radius:12px;
}

.resource-viewer-title{
    margin-top:12px;
    font-size:15px;
    font-weight:600;
    color:#374151;
}


/* =========================================================
   MODOS DE RESPUESTA
   ========================================================= */

.knowledge-mode-actions{
    display:flex;
    gap:10px;
    margin:14px 0 18px;
    flex-wrap:wrap;
}

.knowledge-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 2px 0 14px;
    padding-bottom: 11px;
    border-bottom: 1px solid #e2e8f0;
    color: #1e293b;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
}

.knowledge-section-heading i {
    margin-top: 2px;
    color: #2563eb;
    font-size: 17px;
}

.knowledge-mode-btn{
    display:inline-flex;
    align-items:center;
    gap:7px;
    padding:10px 14px;
    border:1px solid #dbe3f0;
    border-radius:10px;
    background:#fff;
    color:#334155;
    font-size:14px;
    font-weight:600;
    cursor:pointer;
    transition:.2s;
}

.knowledge-mode-btn:hover{
    border-color:#2563eb;
    color:#2563eb;
    transform:translateY(-1px);
}

.knowledge-mode-btn.primary{
    background:#2563eb;
    border-color:#2563eb;
    color:#fff;
}

.knowledge-mode-btn.primary:hover{
    background:#1d4ed8;
    color:#fff;
}

/*
 * Botones que aparecen directamente dentro de un mensaje,
 * como "Ver toda la información disponible".
 */
.mensaje.ia > .knowledge-mode-btn{
    margin-bottom:12px;
}


/* =========================================================
   DIAGNÓSTICO
   ========================================================= */

.diagnostic-options{
    display:flex;
    gap:10px;
    margin-top:10px;
}

.diagnostic-option{
    min-width:90px;
    padding:10px 18px;
    border:1px solid #dbe3f0;
    border-radius:10px;
    background:#fff;
    color:#334155;
    font-size:14px;
    font-weight:600;
    cursor:pointer;
    transition:.2s;
}

.diagnostic-option:hover{
    background:#2563eb;
    border-color:#2563eb;
    color:#fff;
    transform:translateY(-1px);
}

.diagnostic-back{
    border:0;
    background:transparent;
    color:#64748b;
    font-size:12px;
    padding:0;
    margin-bottom:14px;
    cursor:pointer;
}

.diagnostic-back:hover{
    color:#2563eb;
}


/* =========================================================
   PREGUNTA ACTIVA
   ========================================================= */

.mensaje.ia.pregunta-activa{
    background:#fff8d9;
    border:1px solid #f1d77a;
    box-shadow:0 5px 20px rgba(180,140,20,.10);
}


/* =========================================================
   INTRODUCCIONES Y CIERRES
   ========================================================= */

.diagnostic-success,
.diagnostic-end,
.diagnostic-intro{
    white-space:normal;
}

/* "¡Perfecto!", "¡Genial!", etc. */
.diagnostic-success{
    display:flex;
    flex-direction:column;
    gap:6px;
    padding:10px 12px;
    line-height:1.4;
}

.diagnostic-success strong,
.diagnostic-success span{
    margin:0;
    padding:0;
}

/* Avisos finales */
.diagnostic-end{
    display:flex;
    flex-direction:column;
    gap:4px;
    margin:0 0 10px;
    padding:10px 12px;
    background:#f8fafc;
    border-radius:12px;
    font-size:14px;
    line-height:1.4;
}

/* Mensajes breves tipo:
   "Claro. Te enseño todo lo que tenemos..." */
.diagnostic-intro{
    margin:0;
    padding:0;
    line-height:1.45;
}

.mensaje.ia:has(> .diagnostic-intro){
    padding:12px 16px;
    margin:8px 0;
}


/* =========================================================
   SEPARACIONES DEL DIAGNÓSTICO
   ========================================================= */

.diagnostic-result + .diagnostic-followup,
.knowledge-item + .diagnostic-followup{
    margin-top:12px;
}

/* =========================================================
   MENSAJES DE ÉXITO COMPACTOS
   ========================================================= */

.mensaje.ia:has(> .diagnostic-success){
    padding:12px 16px;
    margin:8px 0;
    min-height:0;
}

.mensaje.ia:has(> .diagnostic-success) .diagnostic-success{
    margin:0;
    padding:0;
    gap:4px;
    min-height:0;
}

.resolution-options {
    display: flex;
    flex-direction: column;
    align-items: stretch;

    width: 100%;
    margin-top: 14px;
    gap: 12px;

    white-space: normal;
    box-sizing: border-box;
}

.resolution-options .diagnostic-sat {
    display: block;

    width: 100%;
    margin: 0;
    padding: 14px 0 0;

    border-top: 1px solid #e2e8f0;

    color: #475569;
    font-size: 14px;
    line-height: 1.5;

    white-space: normal;
    box-sizing: border-box;
}

.resolution-options .diagnostic-sat strong {
    display: block;
    margin: 0 0 5px;
    padding: 0;

    color: #334155;
    font-weight: 700;
}

.resolution-options .diagnostic-sat span {
    display: block;
    margin: 0;
    padding: 0;
}

.resolution-options .knowledge-mode-btn {
    align-self: flex-start;
    margin: 0;
}

.knowledge-mode-btn.sat {
    background: #fff7ed;
    border-color: #fdba74;
    color: #9a3412;
}

.knowledge-mode-btn.sat:hover {
    background: #ffedd5;
    border-color: #fb923c;
    color: #7c2d12;
}
.respuesta-principal-parrafo {
    margin: 0 0 10px;
    padding: 0;
}

.respuesta-principal-parrafo:last-child {
    margin-bottom: 0;
}

.knowledge-mode-btn.documentation {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
}

.knowledge-mode-btn.documentation:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #1e293b;
}

.knowledge-mode-btn.assistant {
    background: #9bb7f3;
    border-color:#9bb7f3;
    color: #1d1d1d;
}

.knowledge-mode-btn.assistant:hover {
    background: #83a8f8;
    border-color: #83a8f8;
    color: #1d1d1d;
}

.knowledge-featured-image {
    display: block;
    width: 100%;
    margin: 14px 0 5px;
    padding: 8px;
    background: #f8fafc;
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    color: #334155;
    cursor: pointer;
    text-align: left;
    box-sizing: border-box;
    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        transform .2s ease;
}

.knowledge-featured-image:hover {
    border-color: #93c5fd;
    box-shadow: 0 6px 18px rgba(37, 99, 235, .12);
    transform: translateY(-1px);
}

.knowledge-featured-image img {
    display: block;
    width: 100%;
    max-height: 290px;
    object-fit: contain;
    background: #ffffff;
    border-radius: 10px;
}

.knowledge-featured-image-caption {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 5px 2px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
}

.knowledge-featured-image-caption i {
    color: #2563eb;
}

/* =========================================================
   VÍDEOS DESTACADOS EN LA RESPUESTA INICIAL
   ========================================================= */

.knowledge-featured-videos {
    margin: 14px 0 4px;
    padding: 12px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #f8fbff;
}

.knowledge-featured-videos-title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
    color: #1e3a8a;
    font-size: 13px;
    font-weight: 700;
}

.knowledge-featured-videos-title i {
    color: #2563eb;
    font-size: 16px;
}

.knowledge-featured-videos-list {
    display: grid;
    gap: 8px;
}

.knowledge-featured-video-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    border: 1px solid #dbe3f0;
    border-radius: 10px;
    background: #fff;
    color: #1e293b;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition:
        border-color .2s,
        box-shadow .2s,
        transform .2s;
}

.knowledge-featured-video-link:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, .10);
    transform: translateY(-1px);
}

.knowledge-featured-video-icon {
    display: inline-flex;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #dbeafe;
    color: #2563eb;
    font-size: 20px;
}

.knowledge-featured-video-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.knowledge-featured-video-info strong {
    overflow: hidden;
    color: #1e293b;
    font-size: 13px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.knowledge-featured-video-info > span {
    margin-top: 2px;
    color: #2563eb;
    font-size: 12px;
    font-weight: 600;
}

.knowledge-featured-video-arrow {
    flex: 0 0 auto;
    color: #64748b;
    font-size: 13px;
}

@media (max-width: 600px) {
    .knowledge-featured-videos {
        padding: 10px;
    }

    .knowledge-featured-video-link {
        padding: 9px;
    }
}