/* Agente IA del sitio — mismos tokens que el rediseño (azul #1F3B73/#152850, naranja accesible #C84F17). */
.dvwa-root { position: fixed; right: 20px; bottom: 20px; z-index: 1040; font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; }
.dvwa-launcher {
    display: inline-flex; align-items: center; gap: .55rem;
    background: #C84F17; color: #fff; border: 0; border-radius: 999px;
    padding: .75rem 1.15rem .75rem .9rem; font-weight: 700; font-size: .95rem;
    box-shadow: 0 10px 26px rgba(21, 40, 80, .28); cursor: pointer;
    transition: transform .2s ease, background .2s ease;
}
.dvwa-launcher:hover { background: #B54515; transform: translateY(-2px); }
.dvwa-launcher:focus-visible, .dvwa-root button:focus-visible, .dvwa-input:focus-visible, .dvwa-link:focus-visible {
    outline: 3px solid rgba(245, 121, 59, .6); outline-offset: 2px;
}
.dvwa-is-open .dvwa-launcher-label { display: none; }
.dvwa-is-open .dvwa-launcher { padding: .75rem; }

.dvwa-panel {
    position: absolute; right: 0; bottom: 70px; width: 380px; max-width: calc(100vw - 32px);
    height: min(600px, calc(100vh - 120px)); display: flex; flex-direction: column;
    background: #fff; border: 1px solid #E3E8EF; border-radius: 18px; overflow: hidden;
    box-shadow: 0 24px 60px rgba(21, 40, 80, .28);
}
.dvwa-panel[hidden] { display: none; }
.dvwa-head { display: flex; align-items: center; gap: .4rem; background: #152850; color: #fff; padding: .85rem .9rem .85rem 1rem; }
.dvwa-titles { flex: 1; min-width: 0; }
.dvwa-titles strong { display: block; font-family: 'Montserrat', 'Inter', sans-serif; font-size: .98rem; }
.dvwa-titles span { display: block; font-size: .74rem; color: rgba(255, 255, 255, .78); line-height: 1.3; margin-top: .15rem; }
.dvwa-icon-btn { background: rgba(255, 255, 255, .1); color: #fff; border: 0; border-radius: 10px; width: 34px; height: 34px; font-size: 1.2rem; line-height: 1; cursor: pointer; }
.dvwa-icon-btn:hover { background: rgba(255, 255, 255, .2); }

.dvwa-log { flex: 1; overflow-y: auto; padding: 1rem .9rem; background: #F5F7FA; display: flex; flex-direction: column; gap: .55rem; }
.dvwa-msg { display: flex; }
.dvwa-user { justify-content: flex-end; }
.dvwa-bubble { max-width: 85%; padding: .6rem .8rem; border-radius: 14px; font-size: .92rem; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.dvwa-assistant .dvwa-bubble { background: #fff; color: #1C2333; border: 1px solid #E3E8EF; border-bottom-left-radius: 4px; }
.dvwa-user .dvwa-bubble { background: #1F3B73; color: #fff; border-bottom-right-radius: 4px; }
.dvwa-typing .dvwa-bubble { color: #6B7383; font-style: italic; }
.dvwa-link { color: #B84A12; font-weight: 600; text-decoration: underline; }

.dvwa-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .2rem; }
.dvwa-chip { background: #fff; border: 1px solid #D5DCE6; color: #1F3B73; border-radius: 999px; padding: .38rem .75rem; font-size: .82rem; font-weight: 600; cursor: pointer; text-align: left; }
.dvwa-chip:hover { border-color: #C84F17; color: #B84A12; }

.dvwa-card { background: #fff; border: 2px solid #F5793B; border-radius: 14px; padding: .85rem .9rem; font-size: .86rem; }
.dvwa-card-title { font-family: 'Montserrat', 'Inter', sans-serif; font-weight: 700; color: #1F3B73; margin-bottom: .5rem; }
.dvwa-card dl { margin: 0 0 .6rem; }
.dvwa-card dt { color: #6B7383; font-weight: 600; font-size: .74rem; text-transform: uppercase; letter-spacing: .03em; margin-top: .45rem; }
.dvwa-card dt:first-child { margin-top: 0; }
.dvwa-card dd { margin: .1rem 0 0; color: #1C2333; overflow-wrap: anywhere; }
.dvwa-consent { display: flex; gap: .5rem; align-items: flex-start; color: #3D4555; margin: .3rem 0 .7rem; cursor: pointer; }
.dvwa-consent input { margin-top: .2rem; width: 16px; height: 16px; flex: 0 0 auto; }
.dvwa-card-actions { display: flex; justify-content: flex-end; gap: .5rem; }
.dvwa-btn { border-radius: 10px; padding: .5rem .9rem; font-weight: 700; font-size: .86rem; cursor: pointer; border: 2px solid transparent; }
.dvwa-btn-primary { background: #C84F17; color: #fff; }
.dvwa-btn-primary:hover:not(:disabled) { background: #B54515; }
.dvwa-btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.dvwa-btn-ghost { background: #fff; color: #1F3B73; border-color: #E3E8EF; }

.dvwa-form { display: flex; gap: .5rem; padding: .7rem; border-top: 1px solid #E3E8EF; background: #fff; }
.dvwa-input { flex: 1; resize: none; border: 1px solid #D5DCE6; border-radius: 12px; padding: .6rem .75rem; font: inherit; font-size: .92rem; max-height: 110px; }
.dvwa-input:focus { border-color: #C84F17; outline: none; box-shadow: 0 0 0 .18rem rgba(245, 121, 59, .2); }
.dvwa-send { background: #C84F17; color: #fff; border: 0; border-radius: 12px; padding: 0 1rem; font-weight: 700; cursor: pointer; }
.dvwa-send:disabled { opacity: .5; cursor: not-allowed; }
.dvwa-foot { font-size: .72rem; color: #6B7383; text-align: center; padding: 0 .7rem .6rem; background: #fff; }

@media (max-width: 575.98px) {
    .dvwa-root { right: 12px; bottom: 12px; }
    .dvwa-panel { position: fixed; inset: 8px 8px 76px 8px; width: auto; max-width: none; height: auto; }
    .dvwa-launcher-label { display: none; }
    .dvwa-launcher { padding: .8rem; }
}
@media (prefers-reduced-motion: reduce) {
    .dvwa-launcher { transition: none; }
}

/* En el editor visual del sitio (y al traducir) el chat no se muestra. */
body.editor_enable .dvwa-root,
body.o_builder_open .dvwa-root,
html[data-edit_translations="1"] .dvwa-root { display: none !important; }
