:root{
  --primary:#9C1F3A;
  --secondary:#0C9795;
  --ink:#171719;
  --muted:#6f7077;
  --line:#e8e8eb;
  --soft:#f5f5f7;
  --white:#fff;
  --shadow:0 24px 80px rgba(0,0,0,.14);
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:transparent;color:var(--ink);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
body{padding:0}
button,textarea{font:inherit}
button{cursor:pointer}
.chat-shell{width:100%;height:100dvh;min-height:560px;display:grid;grid-template-rows:auto 1fr auto auto auto;background:var(--white);overflow:hidden}
.chat-header{display:flex;align-items:center;gap:12px;padding:16px 18px;border-bottom:1px solid var(--line);background:rgba(255,255,255,.96)}
.brand-mark,.brand-logo{width:42px;height:42px;border-radius:14px;flex:none}
.brand-mark{display:grid;place-items:center;background:linear-gradient(135deg,var(--primary),var(--secondary));color:#fff;font-weight:900;font-size:19px}
.brand-logo{object-fit:contain;background:#fff}
.header-copy{display:grid;gap:3px;min-width:0;flex:1}
.header-copy strong{font-size:15px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.header-copy span{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.icon-button{width:38px;height:38px;border:0;border-radius:12px;background:transparent;color:#5e6066;display:grid;place-items:center;transition:.18s ease}
.icon-button:hover{background:var(--soft);color:var(--ink)}
.icon-button svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.messages{padding:24px 18px 16px;overflow-y:auto;overscroll-behavior:contain;scroll-behavior:smooth;background:linear-gradient(180deg,#fff 0%,#fbfbfc 100%)}
.message{display:flex;margin:0 0 14px;animation:message-in .28s ease both}
.message.user{justify-content:flex-end}
.bubble{max-width:min(82%,620px);padding:13px 15px;border-radius:18px;font-size:15px;line-height:1.48;white-space:pre-wrap;overflow-wrap:anywhere}
.message.assistant .bubble{background:var(--soft);border:1px solid var(--line);border-bottom-left-radius:6px}
.message.user .bubble{background:var(--ink);color:#fff;border-bottom-right-radius:6px}
.source-label{display:block;margin-top:9px;padding-top:9px;border-top:1px solid rgba(0,0,0,.08);font-size:11px;color:var(--muted)}
.typing{display:flex;align-items:center;gap:5px;min-width:58px}
.typing i{width:7px;height:7px;border-radius:50%;background:#9b9da3;animation:pulse 1s infinite ease-in-out}
.typing i:nth-child(2){animation-delay:.15s}.typing i:nth-child(3){animation-delay:.3s}
.suggestions{display:flex;gap:8px;padding:8px 18px 12px;overflow-x:auto;scrollbar-width:none;background:#fbfbfc}
.suggestions::-webkit-scrollbar{display:none}
.suggestion{flex:0 0 auto;max-width:260px;padding:9px 12px;border-radius:999px;border:1px solid var(--line);background:#fff;color:#323339;font-size:12px;line-height:1.25;text-align:left;transition:.18s ease}
.suggestion:hover{border-color:var(--secondary);transform:translateY(-1px)}
.composer{display:flex;align-items:flex-end;gap:10px;padding:12px 14px;border-top:1px solid var(--line);background:#fff}
.composer textarea{flex:1;min-height:46px;max-height:128px;resize:none;border:1px solid #d9dade;border-radius:16px;padding:12px 14px;outline:none;line-height:1.35;background:#fff;color:var(--ink)}
.composer textarea:focus{border-color:var(--secondary);box-shadow:0 0 0 3px color-mix(in srgb,var(--secondary) 14%,transparent)}
.composer button{height:46px;padding:0 18px;border:0;border-radius:15px;background:var(--primary);color:#fff;font-weight:800;transition:.18s ease}
.composer button:hover{filter:brightness(.95)}
.composer button:disabled,.composer textarea:disabled{opacity:.55;cursor:not-allowed}
.chat-footer{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:0 16px 12px;background:#fff;color:var(--muted);font-size:10.5px;line-height:1.35}
.chat-footer a{color:var(--primary);font-weight:750;text-decoration:none;white-space:nowrap}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@keyframes message-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes pulse{0%,80%,100%{opacity:.35;transform:scale(.8)}40%{opacity:1;transform:scale(1)}}
@media(max-width:560px){
  .chat-shell{min-height:100dvh}
  .chat-header{padding:13px 14px}.brand-mark,.brand-logo{width:38px;height:38px;border-radius:12px}
  .messages{padding:18px 13px 12px}.bubble{max-width:89%;font-size:14px}
  .suggestions{padding-left:13px;padding-right:13px}.composer{padding:10px}.composer button{padding:0 14px}
  .chat-footer{padding:0 12px 10px;align-items:flex-start}.chat-footer span{max-width:70%}
}


/*LOOK*/
/* 1. Resetear márgenes y anchos globales de la página */
html, body {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

/* 2. Forzar al contenedor del chat a expandirse */
main.chat-shell {
    width: 95% !important;             /* Ocupa el 95% del ancho de la ventana */
    max-width: 1200px !important;       /* Límite máximo para pantallas panorámicas gigantes */
    min-width: 320px !important;
    margin: 20px auto !important;       /* Centrado horizontal */
    
    height: calc(100vh - 40px) !important;
    max-height: 850px !important;
    
    /* display: flex !important; */
    flex-direction: column !important;
    box-sizing: border-box !important;
}

/* 3. Asegurar que las zonas internas usen todo el ancho disponible dentro del chat */
.chat-header, 
.messages, 
.suggestions, 
.composer, 
.chat-footer {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* 4. Adaptación total para pantallas pequeñas/móviles */
@media (max-width: 768px) {
    main.chat-shell {
        width: 100% !important;
        max-width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }
}
/*SUGGESTION*/
/* Sección de Sugerencias Adaptativa y Compacta */
section.suggestions {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important; /* 2 columnas iguales en móvil */
    gap: 6px !important;
    padding: 6px 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* En pantallas de escritorio / monitores (> 600px), pasa a 4 columnas en 1 sola fila */
@media (min-width: 601px) {
    section.suggestions {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* Estilo súper compacto para los botones */
button.suggestion {
    width: 100% !important;
    font-size: 0.75rem !important; /* Tamaño de letra más pequeño para que encaje mejor */
    padding: 6px 8px !important;
    margin: 0 !important;
    line-height: 1.2 !important;
    
    /* Mantiene el texto compacto en un máximo de 1 o 2 líneas */
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-align: center !important;
}

