.afe-ai-widget,
.afe-wa-widget {
    position: fixed;
    right: 1.25rem;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.afe-ai-widget { bottom: 10.9rem; z-index: 1092; }
.afe-wa-widget { bottom: 5.7rem; z-index: 1090; }
.afe-ai-widget__launcher,
.afe-wa-widget__launcher {
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .28);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.afe-ai-widget__launcher:hover,
.afe-wa-widget__launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 50px rgba(15, 23, 42, .32);
    filter: saturate(1.08);
}
.afe-ai-widget__launcher { background: linear-gradient(135deg, #111827, var(--afe-accent, #2563eb)); }
.afe-wa-widget__launcher { background: linear-gradient(135deg, #075e54, #128c7e 48%, #25d366); }
.afe-ai-widget__launcher svg,
.afe-wa-widget__launcher svg { width: 24px; height: 24px; stroke-width: 2.35; }
.afe-wa-widget__badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 24px;
    height: 24px;
    padding: 0 .42rem;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: .74rem;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 10px 24px rgba(239, 68, 68, .35);
}
.afe-ai-widget__panel,
.afe-wa-widget__panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: min(420px, calc(100vw - 2rem));
    max-height: min(640px, calc(100vh - 7rem));
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 26px 70px rgba(15, 23, 42, .24);
    border: 1px solid rgba(15, 23, 42, .08);
}
.afe-wa-widget__panel {
    width: min(398px, calc(100vw - 2rem));
    height: min(610px, calc(100vh - 8.25rem));
    display: flex;
    flex-direction: column;
    background: #f0f2f5;
    border-radius: 26px;
    border: 1px solid rgba(15, 23, 42, .10);
    box-shadow: 0 28px 76px rgba(15, 23, 42, .28);
}
.afe-ai-widget__header,
.afe-wa-widget__header {
    height: 68px;
    padding: .95rem 1rem;
    color: #fff;
    background: linear-gradient(135deg, var(--afe-primary, #0f172a), var(--afe-secondary, #111827));
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.afe-ai-widget__header small,
.afe-wa-widget__header small {
    display: block;
    opacity: .84;
    font-size: .78rem;
    margin-top: .12rem;
}
.afe-wa-widget__header {
    height: 64px;
    padding: .78rem .82rem;
    background: linear-gradient(135deg, #075e54, #128c7e 58%, #1fae67);
    flex: 0 0 auto;
}
.afe-wa-widget__brand {
    display: flex;
    align-items: center;
    gap: .66rem;
    min-width: 0;
}
.afe-wa-widget__brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.20);
}
.afe-wa-widget__brand-icon svg { width: 20px; height: 20px; }
.afe-wa-widget__brand strong { display: block; line-height: 1.05; font-size: 1rem; }
.afe-wa-widget__brand small { max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.afe-wa-widget__header-actions {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}
.afe-wa-widget__icon-btn,
.afe-wa-widget__back {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(255,255,255,.16);
    text-decoration: none;
    transition: background .16s ease, transform .16s ease;
}
.afe-wa-widget__icon-btn:hover,
.afe-wa-widget__back:hover {
    color: #fff;
    background: rgba(255,255,255,.26);
    transform: translateY(-1px);
}
.afe-wa-widget__icon-btn svg,
.afe-wa-widget__back svg { width: 18px; height: 18px; }
.afe-wa-widget__body,
.afe-wa-widget__thread {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.afe-wa-widget__search-wrap {
    margin: .76rem .82rem .5rem;
    min-height: 42px;
    border-radius: 999px;
    background: #fff;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 0 .78rem;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .06);
    border: 1px solid rgba(15, 23, 42, .06);
}
.afe-wa-widget__search-wrap svg {
    width: 17px;
    height: 17px;
    color: #64748b;
    flex: 0 0 auto;
}
.afe-wa-widget__search {
    border: 0;
    outline: 0;
    width: 100%;
    min-width: 0;
    font-size: .9rem;
    color: #0f172a;
    background: transparent;
}
.afe-wa-widget__summary {
    padding: 0 .98rem .4rem;
    color: #64748b;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
}
.afe-wa-widget__list {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 0 .72rem .82rem;
    display: grid;
    align-content: start;
    gap: .48rem;
    scrollbar-width: thin;
}
.afe-wa-widget__item {
    width: 100%;
    border: 1px solid rgba(15, 23, 42, .06);
    border-radius: 18px;
    background: #fff;
    padding: .68rem .72rem;
    text-align: left;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .06);
    display: grid;
    grid-template-columns: 42px 1fr auto;
    gap: .68rem;
    align-items: center;
    color: #0f172a;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
}
.afe-wa-widget__item:hover,
.afe-wa-widget__item.is-active {
    background: #ffffff;
    border-color: rgba(18, 140, 126, .30);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .10);
    transform: translateY(-1px);
}
.afe-wa-widget__avatar {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(135deg, #075e54, #25d366);
    font-weight: 900;
    font-size: .78rem;
    letter-spacing: .02em;
    flex: 0 0 auto;
}
.afe-wa-widget__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.afe-wa-widget__item-main { min-width: 0; }
.afe-wa-widget__item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    min-width: 0;
}
.afe-wa-widget__item-name {
    font-weight: 850;
    font-size: .91rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #0f172a;
}
.afe-wa-widget__item-time {
    font-size: .68rem;
    color: #94a3b8;
    white-space: nowrap;
    flex: 0 0 auto;
}
.afe-wa-widget__item-preview {
    display: -webkit-box;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.25;
    max-height: 2.5em;
    font-size: .79rem;
    margin-top: .1rem;
}
.afe-wa-widget__item-side {
    display: grid;
    justify-items: end;
    gap: .28rem;
}
.afe-wa-widget__item-badge {
    min-width: 23px;
    height: 23px;
    border-radius: 999px;
    background: #25d366;
    color: #052e20;
    font-size: .72rem;
    font-weight: 950;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 .38rem;
}
.afe-wa-widget__pill {
    border-radius: 999px;
    padding: .16rem .42rem;
    background: #eef2f7;
    color: #475569;
    font-size: .65rem;
    font-weight: 850;
    white-space: nowrap;
}
.afe-wa-widget__thread-head {
    height: 64px;
    padding: .64rem .76rem;
    display: flex;
    align-items: center;
    gap: .64rem;
    background: #fff;
    border-bottom: 1px solid rgba(15, 23, 42, .08);
    flex: 0 0 auto;
}
.afe-wa-widget__thread-head .afe-wa-widget__back {
    color: #0f172a;
    background: #f1f5f9;
}
.afe-wa-widget__thread-head .afe-wa-widget__back:hover { color: #0f172a; background: #e2e8f0; }
.afe-wa-widget__thread-head .afe-wa-widget__avatar {
    width: 38px;
    height: 38px;
}
.afe-wa-widget__thread-title { min-width: 0; }
.afe-wa-widget__thread-title strong {
    display: block;
    max-width: 220px;
    color: #0f172a;
    font-size: .92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.afe-wa-widget__thread-title small {
    display: block;
    max-width: 230px;
    color: #64748b;
    font-size: .73rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.afe-ai-widget__messages,
.afe-wa-widget__messages {
    height: 330px;
    overflow: auto;
    padding: 1rem;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: .65rem;
}
.afe-wa-widget__messages {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    padding: .9rem .74rem;
    gap: .42rem;
    background:
        radial-gradient(circle at 0 0, rgba(37,211,102,.10), transparent 25%),
        linear-gradient(180deg, #e9edef, #f7faf9);
    scrollbar-width: thin;
}
.afe-ai-widget__bubble,
.afe-wa-widget__bubble {
    max-width: 86%;
    padding: .7rem .8rem;
    border-radius: 18px;
    background: #fff;
    color: #0f172a;
    align-self: flex-start;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .06);
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}
.afe-wa-widget__bubble {
    max-width: 82%;
    padding: .5rem .62rem .4rem;
    border-radius: 15px 15px 15px 4px;
    font-size: .88rem;
    line-height: 1.32;
    white-space: normal;
    box-shadow: 0 1px 1px rgba(15,23,42,.10);
    position: relative;
}
.afe-ai-widget__bubble--out,
.afe-wa-widget__bubble--out {
    color: #fff;
    background: #111827;
    align-self: flex-end;
}
.afe-wa-widget__bubble--out {
    color: #0f172a;
    background: #d9fdd3;
    border-radius: 15px 15px 4px 15px;
}
.afe-wa-widget__bubble-text {
    color: #0f172a;
    white-space: pre-wrap;
}
.afe-wa-widget__bubble-time {
    color: #64748b;
    font-size: .66rem;
    text-align: right;
    margin-top: .18rem;
    line-height: 1;
}
.afe-wa-widget__bubble-quote {
    border-left: 3px solid #25d366;
    background: rgba(255,255,255,.72);
    border-radius: 10px;
    padding: .34rem .45rem;
    margin-bottom: .34rem;
    color: #475569;
    cursor: pointer;
}
.afe-wa-widget__bubble-quote strong,
.afe-wa-widget__bubble-quote small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.afe-wa-widget__bubble-quote strong { font-size: .72rem; color: #075e54; }
.afe-wa-widget__bubble-quote small { font-size: .72rem; }
.afe-wa-widget__bubble-actions {
    position: absolute;
    top: -10px;
    right: 8px;
    opacity: 0;
    transform: translateY(3px);
    transition: opacity .14s ease, transform .14s ease;
}
.afe-wa-widget__bubble:hover .afe-wa-widget__bubble-actions { opacity: 1; transform: translateY(0); }
.afe-wa-widget__reply-btn {
    width: 25px;
    height: 25px;
    border: 0;
    border-radius: 999px;
    color: #0f172a;
    background: #fff;
    box-shadow: 0 8px 18px rgba(15,23,42,.16);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.afe-wa-widget__reply-btn svg { width: 14px; height: 14px; }
.afe-wa-widget__attachments {
    display: grid;
    gap: .32rem;
    margin-top: .38rem;
}
.afe-wa-widget__attach-card,
.afe-wa-widget__attach-chip {
    display: block;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(255,255,255,.74);
    color: #0f172a;
    text-decoration: none;
    border: 1px solid rgba(15,23,42,.08);
}
.afe-wa-widget__attach-card:hover,
.afe-wa-widget__attach-chip:hover { color: #0f172a; border-color: rgba(18,140,126,.32); }
.afe-wa-widget__attach-thumb,
.afe-wa-widget__attach-video video {
    width: 100%;
    height: 112px;
    display: block;
    object-fit: cover;
    background: #e2e8f0;
}
.afe-wa-widget__attach-video { position: relative; display: block; }
.afe-wa-widget__attach-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 900;
    background: rgba(15,23,42,.22);
}
.afe-wa-widget__attach-caption,
.afe-wa-widget__attach-chip {
    padding: .42rem .5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    font-size: .74rem;
}
.afe-wa-widget__attach-caption strong,
.afe-wa-widget__attach-chip strong {
    display: block;
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.afe-wa-widget__attach-caption small,
.afe-wa-widget__attach-chip small { color: #64748b; }
.afe-wa-widget__form {
    flex: 0 0 auto;
    padding: .58rem .64rem .68rem;
    background: #f0f2f5;
    border-top: 1px solid rgba(15, 23, 42, .08);
}
.afe-ai-widget__form {
    padding: .8rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .5rem;
    align-items: end;
    background: #fff;
    border-top: 1px solid rgba(15, 23, 42, .08);
}
.afe-ai-widget__form textarea,
.afe-wa-widget__form textarea {
    resize: none;
    min-height: 42px;
    max-height: 98px;
    border-radius: 14px;
}
.afe-wa-widget__reply-draft {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: .62rem;
    border-left: 3px solid #25d366;
    background: #fff;
    border-radius: 14px;
    padding: .44rem .55rem;
    margin-bottom: .42rem;
    box-shadow: 0 1px 0 rgba(15,23,42,.06);
}
.afe-wa-widget__reply-draft.is-visible { display: flex; }
.afe-wa-widget__reply-draft span { min-width: 0; }
.afe-wa-widget__reply-draft strong,
.afe-wa-widget__reply-draft small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.afe-wa-widget__reply-draft strong { color: #075e54; font-size: .76rem; }
.afe-wa-widget__reply-draft small { color: #64748b; font-size: .76rem; }
.afe-wa-widget__reply-draft button {
    border: 0;
    background: #f1f5f9;
    color: #334155;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    flex: 0 0 auto;
}
.afe-wa-widget__composer {
    display: grid;
    grid-template-columns: 1fr 40px 40px;
    gap: .45rem;
    align-items: end;
}
.afe-wa-widget__input {
    width: 100%;
    min-height: 40px;
    max-height: 88px;
    border: 1px solid rgba(15,23,42,.08);
    border-radius: 18px;
    padding: .55rem .72rem;
    background: #fff;
    color: #0f172a;
    outline: 0;
    font-size: .88rem;
    line-height: 1.28;
    box-shadow: 0 1px 0 rgba(15,23,42,.05);
}
.afe-wa-widget__input:focus { border-color: rgba(18,140,126,.34); box-shadow: 0 0 0 3px rgba(37,211,102,.13); }
.afe-wa-widget__composer-btn {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: transform .16s ease, filter .16s ease;
}
.afe-wa-widget__composer-btn:hover { transform: translateY(-1px); filter: saturate(1.08); }
.afe-wa-widget__composer-btn svg { width: 18px; height: 18px; }
.afe-wa-widget__composer-btn--ai { background: linear-gradient(135deg, #111827, #2563eb); }
.afe-wa-widget__composer-btn--send { background: linear-gradient(135deg, #128c7e, #25d366); }
.afe-ai-widget__quick {
    padding: .8rem 1rem 0;
    display: flex;
    gap: .45rem;
    flex-wrap: wrap;
    background: #fff;
}
.afe-ai-widget__quick button {
    border: 1px solid rgba(15, 23, 42, .10);
    background: #f8fafc;
    border-radius: 999px;
    padding: .34rem .65rem;
    font-size: .78rem;
    font-weight: 700;
    color: #334155;
}
.afe-wa-widget__empty,
.afe-ai-widget__empty {
    color: #64748b;
    font-size: .9rem;
    text-align: center;
    padding: 1rem;
}
.afe-wa-widget__empty {
    margin: .4rem;
    border-radius: 18px;
    background: #fff;
    border: 1px dashed rgba(100,116,139,.28);
}
.afe-wa-widget__loading {
    color: #64748b;
    font-size: .86rem;
    text-align: center;
    padding: .9rem;
}
.afe-assistant-loading { opacity: .72; pointer-events: none; }
.afe-wa-widget__bubble.is-jump { animation: afeWaJump .9s ease; }
@keyframes afeWaJump {
    0%, 100% { box-shadow: 0 1px 1px rgba(15,23,42,.10); }
    35% { box-shadow: 0 0 0 4px rgba(37,211,102,.30), 0 1px 1px rgba(15,23,42,.10); }
}
@media (max-width: 767.98px) {
    .afe-ai-widget,
    .afe-wa-widget { right: .75rem; }
    .afe-ai-widget { bottom: 10rem; }
    .afe-wa-widget { bottom: 5.35rem; }
    .afe-ai-widget__panel,
    .afe-wa-widget__panel {
        width: calc(100vw - 1rem);
        max-height: calc(100vh - 6rem);
        right: -.25rem;
    }
    .afe-wa-widget__panel {
        height: min(590px, calc(100vh - 7.3rem));
        border-radius: 22px;
    }
    .afe-ai-widget__messages { height: 300px; }
    .afe-wa-widget__thread-title strong { max-width: 175px; }
    .afe-wa-widget__thread-title small { max-width: 190px; }
    .afe-wa-widget__bubble { max-width: 88%; }
}
@media (max-width: 390px) {
    .afe-wa-widget__item { grid-template-columns: 38px 1fr; }
    .afe-wa-widget__item-side { display: none; }
    .afe-wa-widget__header-actions { gap: .22rem; }
    .afe-wa-widget__icon-btn { width: 32px; height: 32px; }
}

.afe-ai-widget--contabasic .afe-ai-widget__launcher {
    background: linear-gradient(135deg, #0f172a, #2563eb);
}

.afe-contabasic-panel .afe-ai-widget__panel {
    border-color: rgba(37, 99, 235, .22);
}


/* Ajuste compacto del asistente IA */
.afe-ai-widget {
    right: 1rem;
    bottom: 9.7rem;
    z-index: 1105;
}
.afe-ai-widget--contabasic {
    bottom: 1rem;
}
.afe-ai-widget__panel {
    width: min(380px, calc(100vw - 2rem));
    max-height: min(510px, calc(100vh - 6.5rem));
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, .10);
    box-shadow: 0 22px 54px rgba(15, 23, 42, .22);
}
.afe-ai-widget--contabasic .afe-ai-widget__panel {
    max-height: min(500px, calc(100vh - 6rem));
}
.afe-ai-widget__header {
    height: 58px;
    padding: .7rem .88rem;
    flex: 0 0 auto;
}
.afe-ai-widget__header strong {
    display: block;
    font-size: .96rem;
    line-height: 1.08;
}
.afe-ai-widget__header small {
    font-size: .72rem;
    margin-top: .08rem;
}
.afe-ai-widget__messages {
    flex: 1 1 auto;
    min-height: 190px;
    height: auto;
    max-height: 310px;
    padding: .82rem;
    gap: .55rem;
    background: linear-gradient(180deg, #f8fafc 0%, #eef4ff 100%);
    scrollbar-width: thin;
}
.afe-ai-widget__bubble {
    max-width: 88%;
    padding: .58rem .68rem;
    border-radius: 16px;
    font-size: .9rem;
    line-height: 1.35;
    box-shadow: 0 1px 1px rgba(15, 23, 42, .08);
}
.afe-ai-widget__bubble--out {
    background: #0f172a;
}
.afe-ai-widget__quick {
    flex: 0 0 auto;
    max-height: 88px;
    overflow: auto;
    padding: .62rem .78rem .54rem;
    gap: .36rem;
    border-top: 1px solid rgba(15, 23, 42, .06);
    scrollbar-width: thin;
}
.afe-ai-widget__quick button {
    max-width: 100%;
    padding: .28rem .56rem;
    font-size: .73rem;
    line-height: 1.18;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.afe-ai-widget__form {
    flex: 0 0 auto;
    padding: .62rem .72rem .72rem;
    grid-template-columns: 1fr 42px;
    gap: .45rem;
}
.afe-ai-widget__form textarea {
    min-height: 40px;
    max-height: 84px;
    border-radius: 16px;
    padding: .55rem .7rem;
    font-size: .9rem;
    line-height: 1.28;
}
.afe-ai-widget__form button {
    width: 42px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.afe-ai-widget__form button svg {
    width: 17px;
    height: 17px;
}
.afe-ai-widget--open .afe-ai-widget__launcher {
    opacity: .96;
    transform: scale(.96);
}
.afe-ai-widget__panel[hidden] {
    display: none !important;
}
@media (max-width: 767.98px) {
    .afe-ai-widget,
    .afe-ai-widget--contabasic {
        right: .65rem;
        bottom: .75rem;
    }
    .afe-ai-widget__panel {
        width: calc(100vw - 1.25rem);
        max-height: calc(100vh - 5.25rem);
        right: -.1rem;
        border-radius: 20px;
    }
    .afe-ai-widget__messages {
        min-height: 180px;
        max-height: calc(100vh - 16rem);
    }
}

.afe-app--contador .afe-ai-widget,
.afe-app--contador .afe-wa-widget,
.afe-app--contador .afe-chat-widget {
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1092;
}
.afe-app--contador .afe-ai-widget__launcher,
.afe-app--contador .afe-wa-widget__launcher,
.afe-app--contador .afe-chat-widget__launcher {
    display: none !important;
}
.afe-contador-chat-hub {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1096;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.afe-contador-chat-hub__launcher {
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, var(--afe-primary, #0f172a), var(--afe-accent, #2563eb));
    box-shadow: 0 20px 45px rgba(15, 23, 42, .28);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.afe-contador-chat-hub__launcher:hover,
.afe-contador-chat-hub.is-open .afe-contador-chat-hub__launcher {
    transform: translateY(-2px);
    box-shadow: 0 24px 54px rgba(15, 23, 42, .34);
    filter: saturate(1.08);
}
.afe-contador-chat-hub__launcher svg {
    width: 25px;
    height: 25px;
    stroke-width: 2.35;
}
.afe-contador-chat-hub__badge,
.afe-contador-chat-hub__count {
    min-width: 24px;
    height: 24px;
    padding: 0 .42rem;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: .74rem;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.afe-contador-chat-hub__badge {
    position: absolute;
    top: -5px;
    right: -5px;
    border: 2px solid #fff;
    box-shadow: 0 10px 24px rgba(239, 68, 68, .35);
}
.afe-contador-chat-hub__menu {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: min(350px, calc(100vw - 2rem));
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 26px 70px rgba(15, 23, 42, .24);
}
.afe-contador-chat-hub__head {
    padding: .9rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: #fff;
    background: linear-gradient(135deg, var(--afe-primary, #0f172a), var(--afe-secondary, #111827));
}
.afe-contador-chat-hub__head strong,
.afe-contador-chat-hub__head small {
    display: block;
}
.afe-contador-chat-hub__head small {
    margin-top: .12rem;
    font-size: .78rem;
    opacity: .82;
}
.afe-contador-chat-hub__close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-size: 1.28rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.afe-contador-chat-hub__close:hover {
    background: rgba(255, 255, 255, .26);
}
.afe-contador-chat-hub__list {
    padding: .65rem;
    display: grid;
    gap: .5rem;
}
.afe-contador-chat-hub__item {
    width: 100%;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 17px;
    background: #fff;
    color: #0f172a;
    padding: .72rem;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: .7rem;
    text-align: left;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
}
.afe-contador-chat-hub__item:hover,
.afe-contador-chat-hub__item.is-active {
    background: #f8fafc;
    border-color: rgba(37, 99, 235, .24);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .10);
    transform: translateY(-1px);
}
.afe-contador-chat-hub__icon {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #111827, var(--afe-accent, #2563eb));
}
.afe-contador-chat-hub__icon--wa {
    background: linear-gradient(135deg, #075e54, #128c7e 48%, #25d366);
}
.afe-contador-chat-hub__icon--chat {
    background: linear-gradient(135deg, var(--afe-primary, #0f172a), var(--afe-secondary, #111827));
}
.afe-contador-chat-hub__icon svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.35;
}
.afe-contador-chat-hub__text {
    min-width: 0;
}
.afe-contador-chat-hub__text strong,
.afe-contador-chat-hub__text small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.afe-contador-chat-hub__text strong {
    font-size: .94rem;
    line-height: 1.15;
}
.afe-contador-chat-hub__text small {
    color: #64748b;
    font-size: .78rem;
    margin-top: .12rem;
}
@media (max-width: 767.98px) {
    .afe-app--contador .afe-ai-widget,
    .afe-app--contador .afe-wa-widget,
    .afe-app--contador .afe-chat-widget,
    .afe-contador-chat-hub {
        right: .75rem;
        bottom: .9rem;
    }
    .afe-contador-chat-hub__menu {
        width: min(330px, calc(100vw - 1.5rem));
    }
}


/* Ajuste 2026-07-11: asistente más compacto y sin pre-preguntas visibles */
.afe-ai-widget__quick[hidden],
.afe-ai-widget__quick:empty {
    display: none !important;
}
.afe-ai-widget__panel {
    width: min(360px, calc(100vw - 2rem));
    max-height: min(455px, calc(100vh - 6rem));
    border-radius: 18px;
}
.afe-ai-widget__header {
    height: 50px;
    padding: .58rem .76rem;
}
.afe-ai-widget__header strong {
    font-size: .9rem;
}
.afe-ai-widget__header small {
    display: none;
}
.afe-ai-widget__messages {
    min-height: 165px;
    max-height: 265px;
    padding: .68rem;
    gap: .45rem;
}
.afe-ai-widget__bubble {
    padding: .48rem .58rem;
    border-radius: 14px;
    font-size: .84rem;
    line-height: 1.28;
}
.afe-ai-widget__form {
    padding: .48rem .56rem .56rem;
    grid-template-columns: 1fr 36px;
    gap: .36rem;
}
.afe-ai-widget__form textarea {
    min-height: 34px;
    max-height: 58px;
    border-radius: 12px;
    padding: .42rem .56rem;
    font-size: .84rem;
    line-height: 1.22;
}
.afe-ai-widget__form button {
    width: 36px;
    height: 34px;
    border-radius: 10px !important;
}
.afe-ai-widget__form button svg {
    width: 16px;
    height: 16px;
}

/* Widget público de asistencia */
.afe-front-ai {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1095;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.afe-front-ai__launcher {
    width: 54px;
    height: 54px;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--afe-primary, #071B3A), var(--afe-accent, #2F80ED));
    color: #fff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .24);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.afe-front-ai__launcher svg { width: 23px; height: 23px; }
.afe-front-ai__panel {
    position: absolute;
    right: 0;
    bottom: 68px;
    width: min(360px, calc(100vw - 24px));
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 22px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, .24);
    overflow: hidden;
}
.afe-front-ai__panel[hidden] { display: none !important; }
.afe-front-ai__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .9rem 1rem;
    background: linear-gradient(135deg, var(--afe-primary, #071B3A), var(--afe-secondary, #0D2B52));
    color: #fff;
}
.afe-front-ai__header strong { display: block; font-size: .95rem; line-height: 1.1; }
.afe-front-ai__header small { display: block; opacity: .78; font-size: .72rem; margin-top: .1rem; }
.afe-front-ai__close {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 10px;
    background: rgba(255,255,255,.16);
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
}
.afe-front-ai__messages {
    height: 278px;
    overflow: auto;
    padding: .85rem;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: .55rem;
}
.afe-front-ai__bubble {
    max-width: 88%;
    padding: .62rem .72rem;
    border-radius: 15px;
    font-size: .84rem;
    line-height: 1.38;
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, .08);
    background: #fff;
}
.afe-front-ai__bubble--out {
    align-self: flex-end;
    background: var(--afe-accent, #2F80ED);
    color: #fff;
    border-color: transparent;
}
.afe-front-ai__quick {
    display: flex;
    gap: .4rem;
    padding: .6rem .75rem 0;
    background: #ffffff;
    flex-wrap: wrap;
}
.afe-front-ai__quick button {
    border: 1px solid rgba(15, 23, 42, .10);
    background: #f8fafc;
    color: #334155;
    border-radius: 999px;
    padding: .28rem .55rem;
    font-size: .73rem;
    font-weight: 700;
}
.afe-front-ai__form {
    display: grid;
    grid-template-columns: 1fr 38px;
    gap: .5rem;
    padding: .65rem .75rem .75rem;
    background: #fff;
}
.afe-front-ai__form textarea {
    width: 100%;
    min-height: 38px;
    max-height: 64px;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 13px;
    resize: none;
    padding: .55rem .7rem;
    outline: none;
    font-size: .84rem;
}
.afe-front-ai__form textarea:focus {
    border-color: var(--afe-accent, #2F80ED);
    box-shadow: 0 0 0 .16rem rgba(47,128,237,.13);
}
.afe-front-ai__form button {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 13px;
    background: #0f172a;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.afe-front-ai__form button svg { width: 17px; height: 17px; }
.afe-front-ai.is-loading .afe-front-ai__form button { opacity: .7; }
@media (max-width: 575.98px) {
    .afe-front-ai { right: .75rem; bottom: .75rem; }
    .afe-front-ai__panel { right: -.25rem; bottom: 64px; }
    .afe-front-ai__messages { height: 245px; }
}


/* Planes usa el mismo diseño y forma del widget público de asistencia. */
.afe-front-ai--plans .afe-front-ai__panel,
.afe-front-ai--plans .afe-front-ai__header,
.afe-front-ai--plans .afe-front-ai__messages,
.afe-front-ai--plans .afe-front-ai__bubble,
.afe-front-ai--plans .afe-front-ai__quick,
.afe-front-ai--plans .afe-front-ai__form {
    font-family: inherit;
}

/* Ajuste final widget IA panel: compositor compacto, botones de rutas y preloader */
.afe-assistant-loading {
    opacity: 1 !important;
    pointer-events: auto !important;
}
.afe-assistant-loading .afe-ai-widget__form {
    opacity: 1;
}
.afe-ai-widget__form {
    min-height: 48px !important;
    padding: .42rem .5rem .5rem !important;
    grid-template-columns: 1fr 36px !important;
    align-items: center !important;
    background: #ffffff !important;
}
.afe-ai-widget__form textarea {
    height: 34px !important;
    min-height: 34px !important;
    max-height: 46px !important;
    padding: .38rem .54rem !important;
    line-height: 1.18 !important;
    overflow-y: auto !important;
    border-radius: 11px !important;
    box-shadow: none !important;
}
.afe-ai-widget__form textarea:disabled {
    background: #f8fafc !important;
    opacity: .86;
}
.afe-ai-widget__form button {
    width: 36px !important;
    height: 34px !important;
    min-width: 36px !important;
    border-radius: 11px !important;
}
.afe-ai-widget__messages {
    background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%) !important;
}
.afe-ai-widget__typing {
    width: auto;
    min-width: 96px;
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    padding: .46rem .58rem !important;
    color: #475569;
    background: #fff !important;
    border: 1px solid rgba(37, 99, 235, .12);
    box-shadow: 0 8px 22px rgba(15, 23, 42, .08) !important;
}
.afe-ai-widget__typing span {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #2563eb;
    animation: afeAiTyping 1s infinite ease-in-out;
}
.afe-ai-widget__typing span:nth-child(2) { animation-delay: .16s; }
.afe-ai-widget__typing span:nth-child(3) { animation-delay: .32s; }
.afe-ai-widget__typing em {
    margin-left: .18rem;
    font-size: .74rem;
    font-style: normal;
    font-weight: 700;
    color: #64748b;
}
@keyframes afeAiTyping {
    0%, 80%, 100% { transform: translateY(0); opacity: .38; }
    40% { transform: translateY(-3px); opacity: 1; }
}
.afe-ai-widget__route-row {
    display: flex;
    flex-wrap: wrap;
    gap: .34rem;
    margin-top: .48rem;
}
.afe-ai-widget__route-btn {
    display: inline-flex;
    align-items: center;
    gap: .32rem;
    max-width: 100%;
    padding: .34rem .52rem;
    border-radius: 999px;
    color: #0f172a;
    background: #eef4ff;
    border: 1px solid rgba(37, 99, 235, .18);
    text-decoration: none;
    font-size: .74rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 6px 14px rgba(37, 99, 235, .08);
}
.afe-ai-widget__route-btn:hover {
    color: #fff;
    background: #2563eb;
    border-color: #2563eb;
    text-decoration: none;
}
.afe-ai-widget__route-btn svg {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    stroke-width: 2.3;
}
.afe-ai-widget__route-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Ajuste 2026-07-11: área de mensajes del widget IA panel un poco más alta */
.afe-ai-widget__panel {
    max-height: min(520px, calc(100vh - 6rem)) !important;
}
.afe-ai-widget__messages {
    min-height: 215px !important;
    height: 310px !important;
    max-height: min(330px, calc(100vh - 190px)) !important;
}
@media (max-width: 575.98px) {
    .afe-ai-widget__panel {
        max-height: calc(100vh - 5rem) !important;
    }
    .afe-ai-widget__messages {
        min-height: 205px !important;
        height: 285px !important;
        max-height: calc(100vh - 180px) !important;
    }
}

/* ai-copilot-contextual-20260711 */
.afe-ai-copilot-btn{display:inline-flex;align-items:center;gap:.35rem;font-weight:800;margin:.25rem .35rem .25rem 0;white-space:nowrap}
.afe-ai-copilot-btn svg{width:16px;height:16px;stroke-width:2.4}
.afe-ai-copilot-floating{position:fixed;right:5.35rem;bottom:1.2rem;z-index:1030;display:flex;gap:.5rem;align-items:center}
.afe-ai-copilot-floating .btn{display:inline-flex;align-items:center;gap:.45rem;font-size:.84rem;font-weight:900;padding:.52rem .78rem;background:#2563eb;border-color:#2563eb}
.afe-ai-copilot-floating svg{width:17px;height:17px;stroke-width:2.5}
.afe-ai-copilot-modal .modal-header{background:#0f172a;color:#fff;border:0}.afe-ai-copilot-modal .modal-header .text-muted{color:rgba(255,255,255,.72)!important}.afe-ai-copilot-modal .btn-close{filter:invert(1)}
.afe-ai-copilot__message{border:1px solid rgba(37,99,235,.18);background:#eff6ff;color:#0f172a;border-radius:14px;padding:.75rem .9rem;font-weight:800;margin-bottom:.75rem}
.afe-ai-copilot__warnings{display:grid;gap:.45rem;margin-bottom:.75rem}.afe-ai-copilot__warnings>div{display:flex;align-items:flex-start;gap:.45rem;border:1px solid rgba(245,158,11,.22);background:#fffbeb;color:#78350f;border-radius:12px;padding:.55rem .65rem;font-size:.86rem;font-weight:700}.afe-ai-copilot__warnings svg{width:16px;height:16px;min-width:16px;margin-top:.1rem}
.afe-ai-copilot__checks{display:flex;flex-wrap:wrap;gap:.4rem;margin-bottom:.85rem}.afe-ai-copilot__checks span{display:inline-flex;align-items:center;gap:.28rem;border-radius:999px;padding:.34rem .58rem;font-size:.78rem;font-weight:900;border:1px solid rgba(148,163,184,.28)}.afe-ai-copilot__checks .is-ok{background:#ecfdf5;color:#047857}.afe-ai-copilot__checks .is-warn{background:#fff7ed;color:#c2410c}.afe-ai-copilot__checks svg{width:14px;height:14px;stroke-width:2.6}
.afe-ai-copilot__suggestions{display:grid;gap:.55rem}.afe-ai-copilot__suggestion{display:flex;align-items:center;gap:.75rem;border:1px solid rgba(15,23,42,.08);border-radius:14px;padding:.7rem .75rem;background:#fff;box-shadow:0 8px 22px rgba(15,23,42,.05)}.afe-ai-copilot__suggestion strong{display:block;font-size:.88rem;color:#0f172a}.afe-ai-copilot__suggestion p{margin:.1rem 0;color:#475569;font-size:.82rem;line-height:1.25}.afe-ai-copilot__suggestion small{display:block;color:#64748b;font-weight:700}.afe-ai-copilot__suggestion .btn{display:inline-flex;align-items:center;gap:.32rem;font-weight:900}.afe-ai-copilot__suggestion svg{width:15px;height:15px}
.afe-ai-copilot__applied{outline:2px solid rgba(37,99,235,.35)!important;box-shadow:0 0 0 .25rem rgba(37,99,235,.12)!important;transition:box-shadow .2s ease, outline .2s ease}
.afe-ai-copilot-toast{position:fixed;right:1.1rem;bottom:5.35rem;z-index:2000;background:#0f172a;color:#fff;border-radius:14px;padding:.7rem .9rem;font-weight:800;font-size:.86rem;box-shadow:0 14px 34px rgba(15,23,42,.24);opacity:0;transform:translateY(8px);pointer-events:none;transition:.18s ease}.afe-ai-copilot-toast.show{opacity:1;transform:translateY(0)}
@media(max-width:767.98px){.afe-ai-copilot-floating{right:1rem;left:1rem;bottom:5.9rem}.afe-ai-copilot-floating .btn{width:100%;justify-content:center}.afe-ai-copilot__suggestion{align-items:flex-start;flex-direction:column}.afe-ai-copilot__suggestion .btn{width:100%;justify-content:center}}

/* ai-copilot-precision-ui-20260711 */
.afe-ai-copilot-modal{background:#ffffff;color:#0f172a;border:1px solid rgba(148,163,184,.22);box-shadow:0 24px 70px rgba(15,23,42,.20)}
.afe-ai-copilot-modal .modal-header{background:linear-gradient(135deg,#f8fafc 0%,#eff6ff 100%)!important;color:#0f172a!important;border-bottom:1px solid rgba(148,163,184,.22)!important;padding:.75rem 1rem!important}
.afe-ai-copilot-modal .modal-title{font-size:.98rem;font-weight:900;color:#0f172a!important}
.afe-ai-copilot-modal .modal-header .text-muted{color:#64748b!important;font-weight:700}
.afe-ai-copilot-modal .btn-close{filter:none!important;background-color:#fff;border-radius:12px;opacity:1;box-shadow:0 4px 12px rgba(15,23,42,.08)}
.afe-ai-copilot-modal .modal-body{background:#fff;color:#0f172a;padding:.9rem!important}
.afe-ai-copilot__message{background:#f8fafc!important;color:#0f172a!important;border-color:rgba(37,99,235,.18)!important;box-shadow:inset 4px 0 0 #2563eb}
.afe-ai-copilot__warnings>div{background:#fff7ed!important;color:#7c2d12!important;border-color:rgba(251,146,60,.35)!important}
.afe-ai-copilot__checks span{background:#fff;color:#334155;border-color:rgba(148,163,184,.26)}
.afe-ai-copilot__checks .is-ok{background:#ecfdf5!important;color:#047857!important;border-color:rgba(16,185,129,.22)!important}.afe-ai-copilot__checks .is-warn{background:#fff7ed!important;color:#c2410c!important;border-color:rgba(251,146,60,.30)!important}
.afe-ai-copilot__suggestion{background:#ffffff!important;color:#0f172a!important;border-color:rgba(148,163,184,.25)!important;transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease}
.afe-ai-copilot__suggestion:hover{transform:translateY(-1px);box-shadow:0 14px 28px rgba(15,23,42,.09)!important;border-color:rgba(37,99,235,.28)!important;background:#ffffff!important;color:#0f172a!important}
.afe-ai-copilot__suggestion strong{color:#0f172a!important}.afe-ai-copilot__suggestion p{color:#475569!important}.afe-ai-copilot__suggestion small{color:#64748b!important}
.afe-ai-copilot__apply{width:36px;height:36px;min-width:36px;border:0;border-radius:12px;background:#2563eb;color:#fff;display:inline-flex;align-items:center;justify-content:center;box-shadow:0 8px 18px rgba(37,99,235,.24);transition:transform .15s ease,background .15s ease,box-shadow .15s ease}
.afe-ai-copilot__apply:hover,.afe-ai-copilot__apply:focus{background:#1d4ed8;color:#fff;transform:translateY(-1px);box-shadow:0 10px 22px rgba(37,99,235,.30)}
.afe-ai-copilot__apply svg{width:17px!important;height:17px!important;stroke-width:2.7!important}
.afe-ai-copilot-btn{border-radius:12px!important;padding:.44rem .55rem!important;min-width:38px;justify-content:center;background:#fff!important;color:#2563eb!important;border-color:rgba(37,99,235,.26)!important;box-shadow:0 4px 10px rgba(15,23,42,.04)}
.afe-ai-copilot-btn:hover,.afe-ai-copilot-btn:focus{background:#eff6ff!important;color:#1d4ed8!important;border-color:rgba(37,99,235,.40)!important;box-shadow:0 8px 18px rgba(37,99,235,.11)}
.afe-ai-copilot-btn__text{font-size:.78rem;line-height:1;font-weight:900}
.afe-ai-copilot-floating .btn{background:#2563eb!important;color:#fff!important;border-color:#2563eb!important}.afe-ai-copilot-floating .btn:hover{background:#1d4ed8!important;color:#fff!important;border-color:#1d4ed8!important}
@media(max-width:767.98px){.afe-ai-copilot-btn__text{display:none}.afe-ai-copilot-btn{width:38px;height:38px;padding:0!important}.afe-ai-copilot__apply{width:100%;min-width:100%}}

/* ai-copilot-ui-logic-clean-20260711 */
.afe-ai-widget__form .afe-ai-copilot-btn,
.afe-ai-widget [data-ai-copilot-action]:not(.afe-ai-widget__launcher) {
    display: none !important;
}
.afe-ai-copilot-btn--icon {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    padding: 0 !important;
    gap: 0 !important;
    border-radius: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #ffffff !important;
    color: #2563eb !important;
    border: 1px solid rgba(37,99,235,.26) !important;
}
.afe-ai-copilot-btn--icon:hover,
.afe-ai-copilot-btn--icon:focus {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border-color: rgba(37,99,235,.42) !important;
    box-shadow: 0 8px 18px rgba(37,99,235,.12) !important;
}
.afe-ai-copilot-btn--icon svg {
    width: 17px !important;
    height: 17px !important;
    stroke-width: 2.6 !important;
}
.afe-ai-copilot-floating {
    right: 5.15rem !important;
    bottom: 1.18rem !important;
}
.afe-ai-copilot-floating__btn {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 999px !important;
}
.afe-ai-copilot-floating__btn svg {
    width: 18px !important;
    height: 18px !important;
}
.afe-ai-copilot-modal .modal-dialog {
    max-width: 760px;
}
.afe-ai-copilot-modal .modal-header {
    min-height: 58px;
}
.afe-ai-copilot__suggestion {
    gap: .65rem !important;
    padding: .62rem .68rem !important;
}
.afe-ai-copilot__suggestion p:empty,
.afe-ai-copilot__suggestion small:empty {
    display: none !important;
}
.afe-ai-copilot__apply {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    border-radius: 11px !important;
}
@media (max-width: 767.98px) {
    .afe-ai-copilot-floating {
        right: 4.8rem !important;
        left: auto !important;
        bottom: 1rem !important;
    }
    .afe-ai-copilot-floating .btn {
        width: 42px !important;
        min-width: 42px !important;
    }
}

/* ai-copilot-document-review-20260711 */
.afe-ai-copilot-modal .modal-dialog{max-width:720px!important}
.afe-ai-copilot-modal .modal-body{max-height:72vh;overflow:auto}
.afe-ai-copilot__message{font-size:.92rem!important;line-height:1.35!important;padding:.62rem .75rem!important;margin-bottom:.65rem!important}
.afe-ai-copilot__warnings{gap:.38rem!important;margin-bottom:.65rem!important}
.afe-ai-copilot__warnings>div{font-size:.82rem!important;padding:.48rem .58rem!important;border-radius:11px!important}
.afe-ai-copilot__checks{gap:.32rem!important;margin-bottom:.65rem!important}
.afe-ai-copilot__checks span{font-size:.74rem!important;padding:.28rem .48rem!important}
.afe-ai-copilot-floating__btn[title*="Revisar"]{background:#0f766e!important;border-color:#0f766e!important;color:#fff!important}
.afe-ai-copilot-floating__btn[title*="Revisar"]:hover{background:#0d9488!important;border-color:#0d9488!important;color:#fff!important}
.afe-ai-copilot-btn--icon[title*="Revisar"]{color:#0f766e!important;border-color:rgba(15,118,110,.30)!important;background:#fff!important}
.afe-ai-copilot-btn--icon[title*="Revisar"]:hover{background:#ecfdf5!important;color:#0f766e!important;border-color:rgba(15,118,110,.45)!important}

/* Copiloto IA: botones compactos y revisión coherente por contexto */
.afe-ai-copilot-btn--icon,
.afe-ai-copilot-floating__btn{
    width:38px!important;
    height:38px!important;
    min-width:38px!important;
    padding:0!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:0!important;
    border-radius:13px!important;
}
.afe-ai-copilot-floating__btn{border-radius:999px!important;width:44px!important;height:44px!important;min-width:44px!important;}
.afe-ai-copilot-btn--icon .visually-hidden,
.afe-ai-copilot-floating__btn .visually-hidden{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;}
.afe-ai-copilot-btn--icon svg,
.afe-ai-copilot-floating__btn svg{width:18px!important;height:18px!important;stroke-width:2.55!important;}
.afe-ai-widget__form .afe-ai-copilot-btn,
.afe-ai-widget__form [data-ai-copilot-action]{display:none!important;}
.afe-ai-copilot-modal .modal-dialog{max-width:680px!important;}
.afe-ai-copilot-modal .modal-body{max-height:68vh!important;overflow:auto!important;padding:.85rem!important;}
.afe-ai-copilot__suggestions{gap:.46rem!important;}
.afe-ai-copilot__suggestion{padding:.62rem .68rem!important;border-radius:13px!important;}
.afe-ai-copilot__suggestion strong{font-size:.84rem!important;}
.afe-ai-copilot__suggestion p{font-size:.79rem!important;line-height:1.22!important;}
.afe-ai-copilot__suggestion small{font-size:.75rem!important;}
.afe-ai-copilot__apply{width:34px!important;height:34px!important;min-width:34px!important;border-radius:11px!important;}
.afe-ai-copilot__message{font-size:.88rem!important;}
@media(max-width:767.98px){
    .afe-ai-copilot-floating{right:4.7rem!important;left:auto!important;bottom:1rem!important;}
    .afe-ai-copilot-floating .btn{width:44px!important;justify-content:center!important;}
    .afe-ai-copilot-modal .modal-dialog{margin:.55rem!important;max-width:calc(100vw - 1.1rem)!important;}
}
