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

html,
body{
overflow-x:hidden;
font-family:Inter,Arial,sans-serif;
}

/* BOTÓN FLOTANTE */
#leoia-pro-launcher{
position:fixed;
right:24px;
bottom:24px;
width:76px;
height:76px;
border:none;
border-radius:50%;
background:linear-gradient(135deg,#2563eb,#7c3aed);
display:flex;
align-items:center;
justify-content:center;
cursor:pointer;
z-index:99999999;
box-shadow:0 20px 60px rgba(15,23,42,.45);
color:#fff;
font-size:34px;
}

/* DASHBOARD */
#leoia-pro-dashboard{
display:none;
position:fixed;
inset:0;
width:100vw;
height:100vh;
background:#06111f;
z-index:99999999;
overflow:hidden;
color:#0f172a;
}

/* SIDEBAR IZQUIERDA */
#leoia-pro-sidebar{
position:absolute;
left:0;
top:0;
bottom:0;
width:330px;
background:linear-gradient(180deg,#071a2e,#0b2037);
border-right:1px solid rgba(255,255,255,.08);
padding:24px 22px;
overflow-y:auto;
color:#fff;
}

.leoia-pro-brand{
display:flex;
align-items:center;
gap:14px;
margin-bottom:34px;
}

.leoia-pro-brand-icon{
width:58px;
height:58px;
border-radius:18px;
background:rgba(255,255,255,.08);
display:flex;
align-items:center;
justify-content:center;
font-size:34px;
}

.leoia-pro-brand h2{
font-size:24px;
font-weight:900;
letter-spacing:.5px;
}

.leoia-pro-brand p{
font-size:11px;
letter-spacing:2px;
color:#cbd5e1;
margin-top:4px;
}

.leoia-pro-assistant-box{
display:flex;
align-items:center;
gap:14px;
margin-bottom:24px;
}

.leoia-pro-lion{
width:64px;
height:64px;
border-radius:50%;
background:#10253d;
display:flex;
align-items:center;
justify-content:center;
font-size:34px;
}

.leoia-pro-assistant-box h3{
font-size:24px;
font-weight:900;
}

.leoia-pro-assistant-box p{
font-size:13px;
color:#cbd5e1;
margin-top:4px;
}

#leoia-pro-new-chat{
width:100%;
height:58px;
border:none;
border-radius:12px;
background:linear-gradient(135deg,#2563eb,#7c3aed);
color:#fff;
font-size:16px;
font-weight:800;
cursor:pointer;
margin-bottom:28px;
}

.leoia-pro-history-title{
font-size:14px;
font-weight:900;
margin-bottom:14px;
}

#leoia-pro-search-chat{
width:100%;
height:48px;
border-radius:12px;
border:1px solid rgba(148,163,184,.25);
background:#10253d;
padding:0 16px;
color:#fff;
outline:none;
margin-bottom:18px;
}

#leoia-pro-history{
display:flex;
flex-direction:column;
gap:10px;
}

.leoia-pro-chat-item{
display:grid;
grid-template-columns:22px 1fr auto;
gap:8px;
align-items:center;
padding:10px 0;
font-size:13px;
color:#e5e7eb;
}

.leoia-pro-chat-item strong{
font-weight:500;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}

.leoia-pro-chat-item em{
font-style:normal;
font-size:12px;
color:#cbd5e1;
}

.leoia-pro-stats-card{
margin-top:30px;
background:rgba(255,255,255,.06);
border:1px solid rgba(255,255,255,.08);
border-radius:18px;
padding:20px;
}

.leoia-pro-stats-card h3{
font-size:15px;
margin-bottom:18px;
}

.leoia-pro-stat-row{
display:flex;
align-items:center;
justify-content:space-between;
margin-bottom:18px;
font-size:13px;
color:#cbd5e1;
}

.leoia-pro-stat-row strong{
font-size:21px;
color:#fff;
}

.leoia-pro-stat-row.positive span{
color:#22c55e;
}

/* MAIN */
#leoia-pro-main{
position:absolute;
left:330px;
right:0;
top:0;
bottom:0;
background:#f8fbff;
display:flex;
flex-direction:column;
border-radius:26px 0 0 26px;
overflow:hidden;
}

/* TOPBAR */
#leoia-pro-topbar{
height:88px;
display:flex;
align-items:center;
justify-content:space-between;
padding:0 34px;
background:#ffffff;
border-bottom:1px solid #e5e7eb;
}

.leoia-pro-top-title h1{
font-size:22px;
font-weight:900;
color:#0f172a;
}

.leoia-pro-online{
margin-top:5px;
font-size:13px;
color:#16a34a;
font-weight:700;
}

.leoia-pro-online i{
display:inline-block;
width:9px;
height:9px;
border-radius:50%;
background:#10b981;
margin-right:6px;
box-shadow:0 0 10px #10b981;
}

.leoia-pro-top-actions{
display:flex;
align-items:center;
gap:10px;
}

.leoia-pro-guide,
.leoia-pro-theme,
#leoia-pro-close{
border:none;
background:#f1f5f9;
height:42px;
border-radius:13px;
padding:0 18px;
font-weight:800;
cursor:pointer;
color:#0f172a;
}

.leoia-pro-theme,
#leoia-pro-close{
width:42px;
padding:0;
font-size:18px;
}

/* TOOLS */
#leoia-pro-tools{
height:86px;
display:flex;
align-items:center;
gap:12px;
padding:0 34px;
background:#fff;
border-bottom:1px solid #eef2f7;
overflow-x:auto;
}

.leoia-pro-tool,
#leoia-pro-mic-top{
height:54px;
border:1px solid #e2e8f0;
background:#ffffff;
border-radius:15px;
padding:0 20px;
font-weight:800;
cursor:pointer;
color:#0f172a;
box-shadow:0 4px 12px rgba(15,23,42,.03);
white-space:nowrap;
}

#leoia-pro-mic-top{
color:#4f46e5;
}

/* LAYOUT CHAT */
#leoia-pro-chat-layout {
    display: grid;
    grid-template-columns:
minmax(0, 1.15fr)
minmax(560px, .95fr);
    gap: 16px;
    height: calc(100vh - 230px);
    min-height: 0;
    overflow: hidden;
}

#leoia-pro-chat-panel {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* WELCOME */
#leoia-pro-welcome{
padding:46px;
text-align:center;
overflow-y:auto;
}

.leoia-pro-welcome-logo{
width:86px;
height:86px;
border-radius:24px;
background:linear-gradient(135deg,#2563eb,#7c3aed);
display:flex;
align-items:center;
justify-content:center;
font-size:42px;
color:#fff;
margin:0 auto 16px;
}

#leoia-pro-welcome h2{
font-size:34px;
font-weight:900;
}

#leoia-pro-welcome p{
max-width:680px;
margin:14px auto 28px;
font-size:16px;
line-height:1.7;
color:#475569;
}

.leoia-pro-welcome-grid{
display:grid;
grid-template-columns:repeat(4,1fr);
gap:14px;
margin-top:28px;
}

.leoia-pro-welcome-grid div{
background:#f8fafc;
border:1px solid #e5e7eb;
border-radius:18px;
padding:18px;
text-align:left;
}

.leoia-pro-welcome-grid strong{
display:block;
font-size:15px;
margin-bottom:8px;
}

.leoia-pro-welcome-grid span{
font-size:13px;
color:#64748b;
}

/* MENSAJES */
#leoia-pro-messages{
display:none;
flex:1;
overflow-y:auto;
padding:28px 36px;
flex-direction:column;
gap:18px;
}

#leoia-pro-messages.active{
display:flex;
}

.leoia-pro-user{
align-self:flex-end;
max-width:72%;
background:#eef2ff;
color:#0f172a;
padding:18px 22px;
border-radius:18px 18px 4px 18px;
font-size:15px;
line-height:1.7;
}

.leoia-pro-ai{
align-self:flex-start;
max-width:88%;
background:#fff;
border:1px solid #e2e8f0;
box-shadow:0 10px 35px rgba(15,23,42,.06);
padding:24px 26px;
border-radius:18px;
font-size:15px;
line-height:1.8;
color:#111827;
}

.leoia-pro-ai h1,
.leoia-pro-ai h2,
.leoia-pro-ai h3{
color:#4f46e5;
font-weight:900;
margin:18px 0 10px;
line-height:1.3;
}

.leoia-pro-ai h3{
font-size:18px;
}

.leoia-pro-ai p{
margin:0 0 14px;
color:#111827;
line-height:1.8;
}

.leoia-pro-ai ul{
margin:8px 0 16px 22px;
}

.leoia-pro-ai li{
margin-bottom:7px;
}

.leoia-pro-ai strong{
font-weight:900;
color:#111827;
}

.leoia-pro-ai a{
color:#4f46e5;
text-decoration:none;
}

.leoia-source-badge{
display:inline-block;
background:#eef2ff;
color:#4f46e5;
border:1px solid #c7d2fe;
padding:7px 12px;
border-radius:999px;
font-size:12px;
font-weight:800;
margin-bottom:12px;
}

.leoia-pro-loading,
.leoia-pro-error{
align-self:flex-start;
max-width:75%;
padding:18px 20px;
border-radius:18px;
background:#fff;
border:1px solid #e5e7eb;
box-shadow:0 10px 30px rgba(15,23,42,.06);
color:#475569;
}

.leoia-pro-error{
background:#fef2f2;
border-color:#fecaca;
color:#991b1b;
}

/* PANEL DERECHO */
#leoia-pro-rightbar {

    display: flex;

    flex-direction: column;

    gap: 16px;

    overflow: hidden;

    min-width: 420px;

    height: 100%;
}

.leoia-pro-side-card{
background:#fff;
border:1px solid #e5e7eb;
border-radius:18px;
padding:18px;
box-shadow:0 8px 25px rgba(15,23,42,.04);
}

.leoia-pro-side-card h3{
font-size:15px;
font-weight:900;
margin-bottom:14px;
}

.leoia-pro-side-head{
display:flex;
align-items:center;
justify-content:space-between;
margin-bottom:12px;
}

.leoia-pro-side-head button,
.leoia-pro-line-btn{
border:none;
background:#eef2ff;
color:#4f46e5;
border-radius:10px;
padding:8px 12px;
font-size:12px;
font-weight:900;
cursor:pointer;
}

.leoia-pro-doc-item{
display:flex;
gap:12px;
padding:12px 0;
border-bottom:1px solid #f1f5f9;
}

.leoia-pro-doc-item:last-child{
border-bottom:none;
}

.leoia-pro-doc-item span{
width:34px;
height:34px;
border-radius:10px;
display:flex;
align-items:center;
justify-content:center;
}

.leoia-pro-doc-item.pink span{
background:#fce7f3;
color:#db2777;
}

.leoia-pro-doc-item.orange span{
background:#ffedd5;
color:#ea580c;
}

.leoia-pro-doc-item.green span{
background:#dcfce7;
color:#16a34a;
}

.leoia-pro-doc-item strong{
display:block;
font-size:13px;
color:#4f46e5;
}

.leoia-pro-doc-item small{
font-size:12px;
color:#475569;
}

.leoia-pro-timeline{
display:flex;
flex-direction:column;
gap:18px;
margin:12px 0 18px;
}

.leoia-pro-timeline div{
position:relative;
padding-left:26px;
}

.leoia-pro-timeline i{
position:absolute;
left:0;
top:4px;
width:12px;
height:12px;
border-radius:50%;
border:3px solid #4f46e5;
background:#fff;
}

.leoia-pro-timeline strong{
display:block;
font-size:14px;
color:#1e293b;
}

.leoia-pro-timeline span{
display:block;
font-size:13px;
color:#1e293b;
}

.leoia-pro-timeline small{
font-size:12px;
color:#64748b;
}

#leoia-pro-suggestions{
display:flex;
flex-direction:column;
gap:10px;
}

#leoia-pro-suggestions button{
border:1px solid #e5e7eb;
background:#f8fafc;
border-radius:12px;
padding:12px;
font-size:12px;
text-align:left;
cursor:pointer;
color:#1e293b;
}

/* INPUT */
#leoia-pro-input-zone{
height:78px;
display:grid;
grid-template-columns:54px 1fr 46px 58px;
gap:10px;
align-items:center;
padding:10px 22px;
background:#fff;
border-top:1px solid #e5e7eb;
}

#leoia-pro-mic{
width:54px;
height:54px;
border:none;
border-radius:50%;
background:#eef2ff;
color:#4f46e5;
font-size:24px;
cursor:pointer;
}

#leoia-pro-mic.listening{
background:#fee2e2;
color:#dc2626;
animation:pulseMic 1s infinite;
}

@keyframes pulseMic{
0%{box-shadow:0 0 0 0 rgba(220,38,38,.35)}
70%{box-shadow:0 0 0 14px rgba(220,38,38,0)}
100%{box-shadow:0 0 0 0 rgba(220,38,38,0)}
}

#leoia-pro-input{
width:100%;
height:54px;
border:1px solid #c7d2fe;
border-radius:15px;
padding:16px;
resize:none;
outline:none;
font-size:15px;
color:#0f172a;
background:#fff;
}

#leoia-pro-attach{
border:none;
background:#fff;
font-size:22px;
cursor:pointer;
}

#leoia-pro-send{
width:58px;
height:54px;
border:none;
border-radius:16px;
background:linear-gradient(135deg,#2563eb,#7c3aed);
color:#fff;
font-size:26px;
cursor:pointer;
}

.leoia-pro-disclaimer{
text-align:center;
font-size:12px;
color:#64748b;
padding-bottom:8px;
background:#fff;
}

/* VOZ */
.leoia-pro-voice-actions{
display:flex;
gap:8px;
margin-top:14px;
border-top:1px solid #e5e7eb;
padding-top:12px;
}

.leoia-pro-voice-actions button{
border:none;
background:#eef2ff;
color:#4f46e5;
border-radius:10px;
padding:8px 12px;
font-weight:800;
cursor:pointer;
}

/* ADMIN */
.leoia-pro-admin-card{
background:#fff;
border-radius:18px;
padding:25px;
margin-bottom:22px;
box-shadow:0 12px 35px rgba(0,0,0,.08);
max-width:920px;
}

/* RESPONSIVE */
@media(max-width:1200px){
#leoia-pro-chat-layout{
grid-template-columns:1fr;
}

#leoia-pro-rightbar{
display:none;
}
}

@media(max-width:900px){

#leoia-pro-sidebar{
display:none;
}

#leoia-pro-main{
left:0;
border-radius:0;
}

.leoia-pro-welcome-grid{
grid-template-columns:1fr;
}

#leoia-pro-tools{
padding:0 14px;
}

#leoia-pro-chat-layout{
padding:0 12px;
}

#leoia-pro-input-zone{
grid-template-columns:48px 1fr 44px 52px;
padding:10px 12px;
}

.leoia-pro-user,
.leoia-pro-ai{
max-width:100%;
}

.leoia-pro-guide{
display:none;
}
}
/* =====================================================
   LEO IA PRO — BOTONES FUNCIONALES Y VISIBLES
===================================================== */

/* Botones superiores */
#leoia-pro-tools button,
.leoia-pro-tool,
#leoia-pro-mic-top{
    color:#0f172a !important;
    background:#ffffff !important;
    border:1px solid #dbe3ef !important;
    font-weight:800 !important;
    font-size:14px !important;
    opacity:1 !important;
    visibility:visible !important;
    text-shadow:none !important;
}

/* Hover elegante */
#leoia-pro-tools button:hover,
.leoia-pro-tool:hover,
#leoia-pro-mic-top:hover{
    background:#eef2ff !important;
    color:#4338ca !important;
    border-color:#c7d2fe !important;
    transform:translateY(-1px);
}

/* Botón activo */
.leoia-pro-tool.active,
#leoia-pro-mic-top.listening{
    background:#4338ca !important;
    color:#ffffff !important;
    border-color:#4338ca !important;
}

/* Botones del input */
#leoia-pro-mic,
#leoia-pro-attach,
#leoia-pro-send{
    color:#ffffff !important;
    opacity:1 !important;
    visibility:visible !important;
}

/* Micrófono */
#leoia-pro-mic{
    background:#4f46e5 !important;
    border:none !important;
}

/* Adjuntar */
#leoia-pro-attach{
    background:#0f172a !important;
    border:none !important;
    border-radius:14px !important;
    width:48px !important;
    height:48px !important;
}

/* Enviar */
#leoia-pro-send{
    background:linear-gradient(135deg,#2563eb,#7c3aed) !important;
    border:none !important;
}

/* Botones de respuesta */
.leoia-pro-voice-actions button,
.leoia-pro-copy,
.leoia-pro-speak,
.leoia-pro-stop-speak{
    background:#eef2ff !important;
    color:#4338ca !important;
    border:1px solid #c7d2fe !important;
    font-weight:800 !important;
    font-size:13px !important;
    border-radius:10px !important;
    padding:8px 12px !important;
    cursor:pointer !important;
    opacity:1 !important;
}

/* Hover botones respuesta */
.leoia-pro-voice-actions button:hover{
    background:#4338ca !important;
    color:#ffffff !important;
}

/* Botones sugeridos panel derecho */
#leoia-pro-suggestions button{
    color:#1e293b !important;
    background:#f8fafc !important;
    border:1px solid #dbe3ef !important;
    font-weight:700 !important;
}

#leoia-pro-suggestions button:hover{
    color:#4338ca !important;
    background:#eef2ff !important;
}

/* Botón guía y cerrar */
.leoia-pro-guide,
.leoia-pro-theme,
#leoia-pro-close{
    color:#0f172a !important;
    background:#f1f5f9 !important;
    opacity:1 !important;
}

/* Móvil */
@media(max-width:900px){

    #leoia-pro-tools{
        overflow-x:auto !important;
        gap:10px !important;
    }

    #leoia-pro-tools button{
        min-width:max-content !important;
        white-space:nowrap !important;
    }
}
/*
=====================================================
VISOR DOCUMENTO LATERAL
=====================================================
*/

.leoia-pro-doc-viewer {

    display: none;

    flex-direction: column;

    background: #fff;

    border-radius: 20px;

    overflow: hidden;

    border: 1px solid #e5e7eb;

    box-shadow:
    0 20px 45px rgba(0,0,0,.10);

    height: 100%;

    min-height: 700px;

    flex: 1;
}

.leoia-pro-doc-viewer.active {
    display: flex;
}

.leoia-pro-doc-viewer.active {
    display: flex;
}

.leoia-pro-doc-viewer-head {

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 14px 18px;

    border-bottom: 1px solid #eee;

    background:
    linear-gradient(
        135deg,
        #f8f9fc,
        #ffffff
    );
}

.leoia-pro-doc-viewer-head strong {

    display: block;

    font-size: 15px;

    color: #111827;
}

.leoia-pro-doc-viewer-head small {

    color: #6b7280;
}

.leoia-pro-doc-actions {

    display: flex;

    gap: 8px;
}

.leoia-pro-doc-actions button {

    width: 38px;

    height: 38px;

    border: none;

    border-radius: 10px;

    cursor: pointer;

    background: #f3f4f6;

    transition: .2s;
}

.leoia-pro-doc-actions button:hover {

    background: #e5e7eb;
}

#leoia-pro-doc-frame {

    width: 100%;

    height: 100%;

    border: none;

    flex: 1;

    background: #fff;
}
#leoia-pro-input-zone {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 50 !important;
    background: #ffffff !important;
}

/* V11.7 - Providencia activa */
.leoia-active-providencia-notice{
    margin: 12px 0;
    padding: 12px 14px;
    border-radius: 14px;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    color: #4c1d95;
    font-size: 13px;
    line-height: 1.45;
}
.leoia-active-providencia-notice button,
.leoia-clear-providencia{
    margin-left: 8px;
    border: 0;
    background: #ede9fe;
    color: #4c1d95;
    border-radius: 8px;
    padding: 6px 10px;
    font-weight: 700;
    cursor: pointer;
}
.leoia-active-context-badge{
    margin: 0 0 12px 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    color: #065f46;
    font-weight: 700;
}
.leoia-use-providencia:hover{
    filter: brightness(.95);
}


/* =====================================================
   V11.7.3 - Centro de Trabajo Jurídico
   Solo interfaz. No modifica motor ni conexiones.
   ===================================================== */
#leoia-pro-rightbar{
    background:#f8fafc;
    padding:14px;
    overflow-y:auto;
}
.leoia-workbench{
    display:flex;
    flex-direction:column;
    gap:14px;
}
.leoia-workbench-title,
.leoia-workbench-section,
.leoia-workbench-active{
    background:#ffffff;
    border:1px solid #e5e7eb;
    border-radius:18px;
    box-shadow:0 8px 25px rgba(15,23,42,.04);
}
.leoia-workbench-title{
    padding:16px;
    display:flex;
    align-items:center;
    justify-content:space-between;
}
.leoia-workbench-title h3{
    font-size:15px;
    font-weight:900;
    color:#0f172a;
    margin:0 0 4px;
}
.leoia-workbench-title span{
    font-size:12px;
    color:#64748b;
}
#leoia-workbench-clear,
#leoia-workbench-view-all,
#leoia-workbench-history-clear{
    border:none;
    background:#eef2ff;
    color:#4f46e5;
    border-radius:10px;
    padding:7px 10px;
    font-size:12px;
    font-weight:800;
    cursor:pointer;
}
.leoia-workbench-active{
    padding:14px;
    background:#ecfdf5;
    border-color:#bbf7d0;
    display:flex;
    flex-direction:column;
    gap:8px;
}
.leoia-workbench-active.is-empty{
    background:#f8fafc;
    border-color:#e5e7eb;
}
.leoia-workbench-active strong{
    font-size:13px;
    color:#065f46;
}
.leoia-workbench-active.is-empty strong{
    color:#334155;
}
.leoia-workbench-active span{
    font-size:12px;
    color:#475569;
    line-height:1.45;
}
.leoia-workbench-active button{
    align-self:flex-start;
    border:none;
    background:#fee2e2;
    color:#b91c1c;
    border-radius:9px;
    padding:7px 10px;
    font-weight:800;
    cursor:pointer;
}
.leoia-workbench-section{
    padding:15px;
}
.leoia-workbench-section-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:12px;
}
.leoia-workbench-section-head h4{
    font-size:14px;
    color:#111827;
    font-weight:900;
    margin:0;
}
.leoia-workbench-empty,
.leoia-workbench-note{
    padding:14px;
    border-radius:14px;
    background:#f8fafc;
    color:#64748b;
    font-size:12px;
    line-height:1.45;
}
.leoia-workbench-empty strong{
    display:block;
    color:#334155;
    font-size:13px;
    margin-bottom:4px;
}
.leoia-workbench-main-card{
    border:1px solid #dbeafe;
    background:linear-gradient(180deg,#ffffff,#f8fbff);
    border-radius:16px;
    padding:14px;
}
.leoia-workbench-badge{
    display:inline-flex;
    padding:5px 9px;
    border-radius:999px;
    background:#dcfce7;
    color:#15803d;
    font-size:11px;
    font-weight:900;
    margin-bottom:10px;
}
.leoia-workbench-main-card h4{
    margin:0 0 6px;
    font-size:16px;
    color:#0f172a;
    font-weight:900;
}
.leoia-workbench-main-card p{
    margin:0 0 12px;
    color:#475569;
    font-size:12px;
    line-height:1.45;
}
.leoia-workbench-meta{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
    margin-bottom:12px;
}
.leoia-workbench-meta span{
    display:block;
    background:#f8fafc;
    border:1px solid #e5e7eb;
    border-radius:12px;
    padding:9px 10px;
    font-size:12px;
    color:#0f172a;
}
.leoia-workbench-meta strong{
    display:block;
    color:#64748b;
    font-size:10px;
    text-transform:uppercase;
    letter-spacing:.04em;
    margin-bottom:3px;
}
.leoia-workbench-actions{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:8px;
}
.leoia-workbench-actions button{
    border:1px solid #e5e7eb;
    background:#fff;
    border-radius:11px;
    padding:9px 8px;
    font-size:12px;
    font-weight:900;
    cursor:pointer;
    color:#334155;
}
.leoia-workbench-actions .leoia-workbench-use{
    background:linear-gradient(135deg,#4f46e5,#7c3aed);
    color:#fff;
    border-color:transparent;
}
.leoia-workbench-list{
    display:flex;
    flex-direction:column;
    gap:8px;
}
.leoia-workbench-related-item,
.leoia-workbench-mini{
    display:grid;
    grid-template-columns:30px 1fr auto;
    gap:10px;
    align-items:center;
    padding:10px;
    border:1px solid #e5e7eb;
    border-radius:13px;
    background:#fff;
    cursor:pointer;
}
.leoia-workbench-mini{
    grid-template-columns:28px 1fr;
}
.leoia-workbench-related-item > span,
.leoia-workbench-mini > span{
    width:28px;
    height:28px;
    border-radius:9px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#eef2ff;
    color:#4f46e5;
    font-size:12px;
    font-weight:900;
}
.leoia-workbench-related-item strong,
.leoia-workbench-mini strong{
    display:block;
    font-size:12px;
    color:#1d4ed8;
    line-height:1.35;
}
.leoia-workbench-related-item small,
.leoia-workbench-mini small{
    display:block;
    color:#64748b;
    font-size:11px;
    margin-top:3px;
}
.leoia-workbench-related-item button{
    border:1px solid #dbeafe;
    background:#eff6ff;
    color:#1d4ed8;
    border-radius:10px;
    padding:7px 9px;
    font-size:11px;
    font-weight:900;
    cursor:pointer;
}
@media(max-width:1100px){
    #leoia-pro-rightbar{display:none;}
}


/* =====================================================
   LEO IA V13.2 - SELECTOR DE PROFUNDIDAD
   ===================================================== */

.leoia-depth-selector {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 14px 8px;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
}

.leoia-depth-option {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    text-align: left;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.leoia-depth-option:hover {
    transform: translateY(-1px);
    border-color: #8b5cf6;
    box-shadow: 0 5px 14px rgba(15, 23, 42, .08);
}

.leoia-depth-option.active {
    border-color: #6d28d9;
    background: linear-gradient(135deg, #f5f3ff, #ffffff);
    color: #4c1d95;
    box-shadow: 0 0 0 2px rgba(109, 40, 217, .10);
}

.leoia-depth-option strong,
.leoia-depth-option small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leoia-depth-option strong {
    font-size: 12px;
    line-height: 1.2;
}

.leoia-depth-option small {
    margin-top: 2px;
    color: #64748b;
    font-size: 10px;
}

.leoia-depth-icon {
    flex: 0 0 auto;
    font-size: 18px;
}

.leoia-depth-badge {
    display: inline-flex;
    align-items: center;
    margin: 2px 0 12px;
    padding: 6px 10px;
    border: 1px solid #ddd6fe;
    border-radius: 999px;
    background: #f5f3ff;
    color: #5b21b6;
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 760px) {
    .leoia-depth-selector {
        grid-template-columns: 1fr;
    }

    .leoia-depth-option {
        padding: 8px 10px;
    }
}


/* =====================================================
   LEO IA V13.2.1 - PROCESAMIENTO DINÁMICO
   ===================================================== */

.leoia-pro-loading.leoia-processing-card {
    width: min(620px, 92%);
    max-width: 620px;
    padding: 20px 22px 17px;
    border: 1px solid #cfd8ff;
    border-radius: 20px;
    background:
        radial-gradient(circle at 92% 8%, rgba(124, 58, 237, .11), transparent 34%),
        linear-gradient(135deg, #ffffff 0%, #f7f8ff 54%, #eef4ff 100%);
    box-shadow: 0 18px 45px rgba(48, 63, 159, .13);
    color: #1e293b;
    overflow: hidden;
    position: relative;
}

.leoia-pro-loading.leoia-processing-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #7c3aed, #22c55e, #2563eb);
    background-size: 240% 100%;
    animation: leoiaProcessingTop 2.4s linear infinite;
}

.leoia-processing-main {
    display: flex;
    align-items: center;
    gap: 17px;
}

.leoia-processing-orbit {
    position: relative;
    flex: 0 0 62px;
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
}

.leoia-processing-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid rgba(79, 70, 229, .13);
    border-top-color: #2563eb;
    border-right-color: #7c3aed;
    animation: leoiaProcessingSpin 1.05s linear infinite;
}

.leoia-processing-ring::after {
    content: "";
    position: absolute;
    inset: 7px;
    border-radius: 50%;
    border: 2px dashed rgba(59, 130, 246, .32);
    animation: leoiaProcessingSpinReverse 2.1s linear infinite;
}

.leoia-processing-icon {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 39px;
    height: 39px;
    border-radius: 13px;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .18);
    font-size: 20px;
    animation: leoiaProcessingPulse 1.6s ease-in-out infinite;
}

.leoia-processing-copy {
    min-width: 0;
}

.leoia-processing-kicker {
    margin-bottom: 3px;
    color: #6d28d9;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .075em;
    text-transform: uppercase;
}

.leoia-processing-title {
    color: #172554;
    font-size: 17px;
    font-weight: 900;
    line-height: 1.25;
}

.leoia-processing-detail {
    margin-top: 5px;
    color: #64748b;
    font-size: 12.5px;
    line-height: 1.5;
}

.leoia-processing-progress {
    margin-top: 16px;
}

.leoia-processing-progress-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 7px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}

.leoia-processing-progress-head strong {
    color: #4f46e5;
    font-size: 11px;
}

.leoia-processing-track {
    position: relative;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #dfe7f4;
}

.leoia-processing-track span {
    display: block;
    width: 14%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb, #7c3aed, #22c55e);
    background-size: 180% 100%;
    box-shadow: 0 0 14px rgba(79, 70, 229, .36);
    transition: width .55s ease;
    animation: leoiaProcessingGradient 2s linear infinite;
}

.leoia-processing-stages {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 12px;
}

.leoia-loading-stage {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #d7deeb;
    transition: width .25s ease, background .25s ease, box-shadow .25s ease;
}

.leoia-loading-stage.active {
    width: 27px;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .10);
}

.leoia-loading-stage.complete {
    background: #22c55e;
}

@keyframes leoiaProcessingSpin {
    to { transform: rotate(360deg); }
}

@keyframes leoiaProcessingSpinReverse {
    to { transform: rotate(-360deg); }
}

@keyframes leoiaProcessingPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

@keyframes leoiaProcessingTop {
    to { background-position: 240% 0; }
}

@keyframes leoiaProcessingGradient {
    to { background-position: 180% 0; }
}

/* =====================================================
   LEO IA V13.2.1 - NIVELES MÁS VISIBLES
   ===================================================== */

.leoia-depth-selector {
    position: relative;
    gap: 10px;
    padding: 11px 14px;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
    border-top: 1px solid #dbe4f2;
    box-shadow: 0 -7px 20px rgba(15, 23, 42, .045);
    z-index: 5;
}

.leoia-depth-selector::before {
    content: "Nivel de respuesta";
    position: absolute;
    left: 18px;
    top: -10px;
    padding: 2px 8px;
    border: 1px solid #dbe4f2;
    border-radius: 999px;
    background: #ffffff;
    color: #64748b;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.leoia-depth-option {
    min-height: 54px;
    padding: 9px 12px;
    border: 1.5px solid #cbd5e1;
    border-radius: 15px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 6px 14px rgba(15, 23, 42, .055);
}

.leoia-depth-option:hover {
    transform: translateY(-2px);
    border-color: #7c3aed;
    box-shadow: 0 10px 22px rgba(79, 70, 229, .13);
}

.leoia-depth-option.active {
    border: 2px solid #6d28d9;
    background:
        radial-gradient(circle at 95% 5%, rgba(124, 58, 237, .15), transparent 38%),
        linear-gradient(135deg, #ede9fe 0%, #ffffff 75%);
    color: #4c1d95;
    box-shadow:
        0 0 0 3px rgba(109, 40, 217, .12),
        0 10px 24px rgba(76, 29, 149, .15);
}

.leoia-depth-option.active::after {
    content: "✓";
    margin-left: auto;
    display: grid;
    place-items: center;
    width: 21px;
    height: 21px;
    border-radius: 999px;
    background: #6d28d9;
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
}

.leoia-depth-option strong {
    font-size: 13px;
    line-height: 1.2;
}

.leoia-depth-option small {
    margin-top: 3px;
    font-size: 10.5px;
    font-weight: 700;
}

.leoia-depth-icon {
    display: grid;
    place-items: center;
    flex: 0 0 35px;
    width: 35px;
    height: 35px;
    border-radius: 11px;
    background: #eef2ff;
    font-size: 19px;
}

.leoia-depth-option.active .leoia-depth-icon {
    background: #6d28d9;
    color: #ffffff;
    box-shadow: 0 7px 15px rgba(109, 40, 217, .25);
}

@media (max-width: 760px) {
    .leoia-pro-loading.leoia-processing-card {
        width: 94%;
        padding: 17px;
    }

    .leoia-processing-orbit {
        flex-basis: 52px;
        width: 52px;
        height: 52px;
    }

    .leoia-processing-title {
        font-size: 15px;
    }

    .leoia-depth-selector {
        grid-template-columns: repeat(3, minmax(155px, 1fr));
        overflow-x: auto;
        padding-top: 14px;
    }

    .leoia-depth-option {
        min-width: 155px;
    }
}

/* =====================================================
   LEO IA V14.0.1 — AJUSTE FINO SOBRE V13.2.1
   Mantiene la estructura original y mejora espacio/legibilidad.
   ===================================================== */

/* Botón flotante: rostro visible, sin texto diminuto ni superposición */
#leoia-pro-launcher{
    right:26px !important;
    bottom:28px !important;
    width:68px !important;
    height:68px !important;
    padding:8px !important;
    overflow:visible !important;
    background:linear-gradient(145deg,#5b3fd6,#2f6df6) !important;
    border:3px solid rgba(255,255,255,.88) !important;
    box-shadow:0 0 0 7px rgba(91,63,214,.12),0 14px 34px rgba(35,30,92,.34) !important;
    animation:leoiaLauncherBreath 2.8s ease-in-out infinite;
}
#leoia-pro-launcher img{
    width:48px;
    height:52px;
    display:block;
    object-fit:contain;
    filter:drop-shadow(0 3px 4px rgba(0,0,0,.15));
}
#leoia-pro-launcher:hover{
    transform:translateY(-3px) scale(1.06);
    box-shadow:0 0 0 9px rgba(91,63,214,.16),0 18px 42px rgba(35,30,92,.42) !important;
}
@keyframes leoiaLauncherBreath{
    0%,100%{transform:scale(1)}
    50%{transform:scale(1.035)}
}

/* Marca lateral limpia */
.leoia-pro-brand.leoia-brand-clean{
    display:flex;
    justify-content:center;
    margin:0 0 24px;
}
.leoia-brand-logo{
    width:min(210px,92%);
    height:auto;
    display:block;
    object-fit:contain;
}
.leoia-pro-assistant-box{display:none !important;}

/* Barra superior compacta: En línea y herramientas en la misma fila */
#leoia-pro-topbar{
    min-height:92px;
    height:auto;
    padding:8px 24px;
    gap:14px;
}
.leoia-pro-top-title.leoia-top-integrated{
    min-width:0;
    flex:1;
}
.leoia-pro-top-title h1{
    margin:0 0 5px;
    font-size:17px;
    line-height:1.1;
}
.leoia-top-row{
    display:flex;
    align-items:center;
    gap:14px;
    min-width:0;
}
.leoia-pro-online{
    flex:0 0 auto;
    margin:0;
    white-space:nowrap;
}
#leoia-pro-tools{
    flex:1;
    height:auto !important;
    min-width:0;
    display:flex;
    align-items:center;
    gap:8px;
    padding:0 !important;
    border:0 !important;
    background:transparent !important;
    overflow-x:auto;
    scrollbar-width:thin;
}
.leoia-pro-tool,
#leoia-pro-mic-top{
    height:40px !important;
    min-height:40px;
    padding:0 14px !important;
    border-radius:12px !important;
    font-size:12px !important;
    box-shadow:none !important;
}
.leoia-pro-top-actions{flex:0 0 auto;}
.leoia-pro-theme{display:none !important;}

/* Dos paneles principales bien ajustados */
#leoia-pro-chat-layout{
    flex:1;
    height:auto !important;
    min-height:0;
    grid-template-columns:minmax(0,1.12fr) minmax(410px,.88fr);
    gap:12px;
    padding:0 12px;
}
#leoia-pro-chat-panel,
#leoia-pro-rightbar{
    min-height:0;
}

/* Bienvenida: misma idea, más compacta y sin cajas gigantes */
#leoia-pro-welcome{
    padding:24px 28px 18px;
}
.leoia-pro-welcome-logo{
    width:auto !important;
    height:104px !important;
    margin:0 auto 4px !important;
    border-radius:0 !important;
    background:transparent !important;
}
.leoia-pro-welcome-logo img{
    width:auto;
    height:104px;
    object-fit:contain;
}
#leoia-pro-welcome h2{
    font-size:25px;
    margin:0;
}
#leoia-pro-welcome p{
    margin:8px auto 18px;
    font-size:13px;
    line-height:1.55;
}
.leoia-pro-welcome-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:10px;
    width:min(760px,100%);
    margin:14px auto 0;
}
.leoia-pro-welcome-grid div{
    min-height:90px;
    padding:14px;
    border-radius:15px;
}
.leoia-pro-welcome-grid strong{font-size:13px;margin-bottom:6px;}
.leoia-pro-welcome-grid span{font-size:11.5px;line-height:1.45;}

/* Nivel de respuesta: conserva altura anterior, pero deja leer títulos/subtítulos */
.leoia-depth-selector{
    flex:0 0 auto;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:8px;
    padding:10px 12px 8px;
}
.leoia-depth-option{
    min-height:58px !important;
    padding:8px 11px !important;
    gap:9px;
    overflow:visible;
}
.leoia-depth-option > span:not(.leoia-depth-icon){
    min-width:0;
    display:block;
}
.leoia-depth-option strong,
.leoia-depth-option small{
    white-space:normal !important;
    overflow:visible !important;
    text-overflow:clip !important;
}
.leoia-depth-option strong{
    font-size:12px !important;
    line-height:1.2;
}
.leoia-depth-option small{
    font-size:9.5px !important;
    line-height:1.25;
    color:#64748b;
}
.leoia-depth-icon{
    flex:0 0 34px !important;
    width:34px !important;
    height:34px !important;
    font-size:17px !important;
}
.leoia-depth-option.active::after{
    flex:0 0 20px;
}

/* Botones secundarios legibles */
#leoia-workbench-view-all,
#leoia-workbench-history-clear{
    color:#5b3fd6 !important;
    background:#f5f3ff !important;
    border:1px solid #ddd6fe !important;
    opacity:1 !important;
    font-weight:800 !important;
}
#leoia-workbench-view-all:hover,
#leoia-workbench-history-clear:hover{
    background:#ede9fe !important;
    color:#4c1d95 !important;
}

@media(max-width:1250px){
    #leoia-pro-chat-layout{
        grid-template-columns:minmax(0,1fr) minmax(360px,.78fr);
    }
    .leoia-pro-tool,#leoia-pro-mic-top{padding:0 11px !important;font-size:11px !important;}
}
@media(max-width:1100px){
    #leoia-pro-rightbar{display:none;}
    #leoia-pro-chat-layout{grid-template-columns:1fr;}
}
@media(max-width:900px){
    #leoia-pro-topbar{padding:8px 12px;}
    .leoia-pro-top-title h1{display:none;}
    .leoia-top-row{gap:8px;}
    .leoia-pro-top-actions{gap:6px;}
    .leoia-pro-welcome-grid{grid-template-columns:1fr;}
}


/* =====================================================
   LEO IA V14.0.3 - DISEÑO APROBADO
   Conserva la interfaz y corrige únicamente bienvenida y niveles.
   ===================================================== */

/* Bienvenida exactamente en el formato aprobado: logo, pregunta y subtítulo. */
#leoia-pro-welcome{
    display:flex;
    flex-direction:column !important;
    align-items:center !important;
    justify-content:center !important;
    min-height:0 !important;
    padding:26px 24px 18px !important;
    background:#f8fbff !important;
}
.leoia-pro-welcome-logo{
    width:auto !important;
    height:172px !important;
    margin:0 auto 8px !important;
    background:transparent !important;
    border:0 !important;
    box-shadow:none !important;
}
.leoia-pro-welcome-logo img{
    width:auto !important;
    height:172px !important;
    max-width:330px !important;
    object-fit:contain !important;
}
#leoia-pro-welcome h2{
    margin:2px 0 8px !important;
    color:#111827 !important;
    font-size:28px !important;
    font-weight:800 !important;
    line-height:1.2 !important;
    text-align:center !important;
}
#leoia-pro-welcome p{
    margin:0 auto !important;
    color:#64748b !important;
    font-size:14px !important;
    line-height:1.55 !important;
    text-align:center !important;
}
.leoia-pro-welcome-grid{display:none !important;}

/* Nivel de respuesta como en la versión aprobada: compacto, legible y uniforme. */
.leoia-depth-selector{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:8px !important;
    padding:9px 12px 8px !important;
    background:linear-gradient(180deg,#f8fafc 0%,#eef2ff 100%) !important;
}
.leoia-depth-option{
    min-height:55px !important;
    height:55px !important;
    padding:7px 12px !important;
    gap:10px !important;
    border-radius:13px !important;
    overflow:hidden !important;
}
.leoia-depth-option > span:not(.leoia-depth-icon){
    display:flex !important;
    flex-direction:column !important;
    justify-content:center !important;
    min-width:0 !important;
    text-align:left !important;
}
.leoia-depth-option strong{
    color:#111827 !important;
    font-size:11.5px !important;
    font-weight:800 !important;
    line-height:1.15 !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
}
.leoia-depth-option small{
    margin-top:3px !important;
    color:#64748b !important;
    font-size:9px !important;
    font-weight:700 !important;
    line-height:1.15 !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
}
.leoia-depth-option.active strong{color:#111827 !important;}
.leoia-depth-option.active small{color:#64748b !important;}
.leoia-depth-icon{
    flex:0 0 34px !important;
    width:34px !important;
    height:34px !important;
    border-radius:11px !important;
    font-size:18px !important;
}
.leoia-depth-option.active::after{
    flex:0 0 20px !important;
    width:20px !important;
    height:20px !important;
    margin-left:auto !important;
}

/* Barra superior: conserva únicamente las cuatro herramientas acordadas. */
#leoia-pro-tools [data-prompt*="jurisprudencia"],
#leoia-pro-tools [data-action="jurisprudence"],
#leoia-pro-tools .leoia-jurisprudence-tool{
    display:none !important;
}

@media(max-width:760px){
    #leoia-pro-welcome{padding:20px 14px 14px !important;}
    .leoia-pro-welcome-logo,
    .leoia-pro-welcome-logo img{height:132px !important;}
    #leoia-pro-welcome h2{font-size:22px !important;}
    #leoia-pro-welcome p{font-size:12px !important;}
    .leoia-depth-selector{overflow-x:auto !important;grid-template-columns:repeat(3,minmax(230px,1fr)) !important;}
}


/* =====================================================
   LEO IA V14.0.7 - CORRECCIÓN DEFINITIVA DE ESTADOS
   La bienvenida puede ocultarse al iniciar una consulta.
   El indicador dinámico conserva exactamente el diseño V13.2.1.
   ===================================================== */
#leoia-pro-welcome[style*="display: none"]{
    display:none !important;
}
#leoia-pro-messages.active{
    min-height:0;
}

/* Joomla v14.0.7 compatibility */
.leoia-pro-base-filter{display:flex;align-items:center;gap:8px;margin-left:10px;font-size:12px;color:#334155;white-space:nowrap}
.leoia-pro-base-filter select{min-width:155px;border:1px solid #d6dbea;border-radius:10px;padding:7px 30px 7px 10px;background:#fff;color:#172554;font-weight:700}
.leoia-wp-answer h3{margin:18px 0 8px;color:#163a74;font-size:18px;border-left:4px solid #6758e8;padding-left:10px}
.leoia-wp-answer p{margin:8px 0;line-height:1.65;color:#293548}
.leoia-wp-list{margin:8px 0 12px 22px;padding:0}.leoia-wp-list li{margin:7px 0;line-height:1.55}
.leoia-wp-sources{margin-top:18px;padding-top:14px;border-top:1px solid #e5e7eb}.leoia-wp-sources h3{font-size:16px;margin:0 0 10px;color:#173b73}
.leoia-wp-source-list{display:grid;gap:8px}.leoia-source-card{display:flex;gap:10px;align-items:flex-start;padding:11px 12px;border:1px solid #e1e5f0;border-radius:12px;background:#f8faff;text-decoration:none!important;color:#20304a!important;transition:.18s}
.leoia-source-card:hover{transform:translateY(-1px);border-color:#7c6ff0;box-shadow:0 6px 18px rgba(44,50,110,.10)}.leoia-source-card small{display:block;color:#6b7280;margin-top:3px}.leoia-source-arrow{font-size:24px;color:#6659df;line-height:1}
@media(max-width:900px){.leoia-pro-base-filter{width:100%;margin:8px 0 0}.leoia-pro-base-filter select{flex:1}.leoia-top-row{flex-wrap:wrap}}
