﻿#fe-assistant {
    --fe-gold: #C9732C;
    --fe-gold-soft: #E4A769;
    --fe-gold-2: #F3B26C;
    --fe-text: #2B2119;
    --fe-muted: #7A6656;
    --fe-bg: #fdfaf5;
    --fe-nav: #241710;
    --fe-border: #E4D5C5;
    --fe-card: #ffffff;
    font-family: system-ui,-apple-system,"Segoe UI",sans-serif;
    color: var(--fe-text);
    position: fixed;
    z-index: 9997;
}

    #fe-assistant * {
        box-sizing: border-box;
    }

#fe-launcher {
    position: fixed;
    right: 15px;
    bottom: 15px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    z-index: 9997;
    background: linear-gradient(145deg, #1D4ED8, #0F172A);
    color: #fff;
    box-shadow: 0 12px 28px rgba(29, 78, 216, 0.45), 0 0 0 3px rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    transition: transform .25s ease, box-shadow .25s ease;
}

    #fe-launcher:hover {
        transform: translateY(-3px) scale(1.06);
        box-shadow: 0 16px 34px rgba(29, 78, 216, 0.55), 0 0 0 4px rgba(255, 255, 255, 0.45);
    }

    #fe-launcher i {
        line-height: 1;
    }

    #fe-launcher:active {
        transform: scale(.96);
    }

    #fe-launcher:focus-visible {
        outline: 3px solid rgba(201,115,44,.45);
        outline-offset: 3px;
    }

    #fe-launcher svg {
        width: 18px;
        height: 18px;
    }

.fe-launcher-icon,
.fe-launcher-close {
    position: absolute;
    display: flex;
    transition: opacity .2s ease, transform .3s ease;
}

.fe-launcher-close {
    opacity: 0;
    transform: rotate(-90deg);
}

#fe-assistant[data-open="true"] .fe-launcher-icon {
    opacity: 0;
    transform: rotate(90deg);
}

#fe-assistant[data-open="true"] .fe-launcher-close {
    opacity: 1;
    transform: rotate(0);
}

.fe-launcher-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--fe-gold-2);
    animation: fePulse 2.4s ease-out infinite;
    pointer-events: none;
}

#fe-assistant[data-open="true"] .fe-launcher-pulse {
    display: none;
}

@keyframes fePulse {
    0% {
        transform: scale(1);
        opacity: .7;
    }

    70% {
        transform: scale(1.5);
        opacity: 0;
    }

    100% {
        opacity: 0;
    }
}

#fe-nudge {
    position: fixed;
    right: 64px;
    bottom: 207px;
    background: var(--fe-card);
    color: var(--fe-text);
    padding: .6rem 1.9rem .6rem .8rem;
    border-radius: 14px 14px 4px 14px;
    border: 1px solid var(--fe-border);
    box-shadow: 0 12px 30px rgba(0,0,0,.14);
    font-size: .82rem;
    font-weight: 600;
    max-width: 210px;
    line-height: 1.3;
    opacity: 0;
    transform: translateY(8px) scale(.96);
    pointer-events: none;
    transition: opacity .35s ease, transform .35s cubic-bezier(.16,1,.3,1);
}

    #fe-nudge.show {
        opacity: 1;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }

#fe-assistant[data-open="true"] #fe-nudge {
    opacity: 0 !important;
    pointer-events: none !important;
}

.fe-nudge-x {
    position: absolute;
    top: 4px;
    right: 6px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--fe-muted);
    line-height: 1;
    padding: .1rem .2rem;
}

#fe-panel {
    position: fixed;
    right: 72px;
    bottom: 15px;
    z-index: 9996;
    width: 328px;
    max-width: calc(100vw - 92px);
    height: 494px;
    max-height: calc(100vh - 40px);
    padding: 0;
    background: var(--fe-bg);
    border-radius: 20px;
    border: 1px solid var(--fe-border);
    box-shadow: 0 26px 70px rgba(40,20,8,.30);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(.97);
    pointer-events: none;
    transform-origin: bottom right;
    transition: opacity .3s ease, transform .3s cubic-bezier(.16,1,.3,1);
}

#fe-assistant[data-open="true"] #fe-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

#fe-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20,12,8,.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
    z-index: -1;
}

.fe-head {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .7rem .85rem;
    background: linear-gradient(135deg,var(--fe-nav),#3a2417);
    color: #FCE6CB;
    flex: 0 0 auto;
    border-radius: 20px 20px 0 0;
}

.fe-head-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex: 0 0 auto;
    background: linear-gradient(145deg,var(--fe-gold-2),var(--fe-gold));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 6px 14px rgba(0,0,0,.25);
}

    .fe-head-avatar svg {
        width: 19px;
        height: 19px;
    }

.fe-head-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    flex: 1;
}

    .fe-head-meta strong {
        font-size: .9rem;
    }

    .fe-head-meta span {
        font-size: .7rem;
        opacity: .85;
        display: flex;
        align-items: center;
        gap: .35rem;
    }

    .fe-head-meta em {
        font-style: normal;
    }

.fe-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #46d27f;
    box-shadow: 0 0 0 3px rgba(70,210,127,.25);
    display: inline-block;
}

.fe-head-min {
    border: none;
    background: rgba(255,255,255,.12);
    color: #FCE6CB;
    width: 29px;
    height: 29px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .fe-head-min:hover {
        background: rgba(255,255,255,.22);
    }

    .fe-head-min svg {
        width: 14px;
        height: 14px;
    }

.fe-body {
    flex: 1;
    overflow-y: auto;
    padding: .85rem .8rem .35rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    scroll-behavior: smooth;
}

    .fe-body::-webkit-scrollbar {
        width: 7px;
    }

    .fe-body::-webkit-scrollbar-thumb {
        background: rgba(122,102,86,.28);
        border-radius: 99px;
    }

.fe-msg {
    max-width: 88%;
    padding: .6rem .75rem;
    border-radius: 14px;
    font-size: .84rem;
    line-height: 1.45;
    animation: feIn .35s cubic-bezier(.16,1,.3,1) both;
}

    .fe-msg.bot {
        align-self: flex-start;
        background: var(--fe-card);
        border: 1px solid var(--fe-border);
        border-bottom-left-radius: 5px;
        box-shadow: 0 4px 12px rgba(0,0,0,.04);
    }

    .fe-msg.user {
        align-self: flex-end;
        background: linear-gradient(135deg,var(--fe-gold),#b5631f);
        color: #fff;
        border-bottom-right-radius: 5px;
        font-weight: 600;
    }

    .fe-msg strong {
        font-weight: 800;
    }

    .fe-msg .fe-price {
        color: var(--fe-gold);
        font-weight: 800;
    }

@keyframes feIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fe-typing {
    align-self: flex-start;
    background: var(--fe-card);
    border: 1px solid var(--fe-border);
    border-bottom-left-radius: 5px;
    padding: .75rem .9rem;
    border-radius: 16px;
    display: flex;
    gap: 4px;
}

    .fe-typing span {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: var(--fe-gold-soft);
        animation: feBounce 1.2s infinite;
    }

        .fe-typing span:nth-child(2) {
            animation-delay: .18s;
        }

        .fe-typing span:nth-child(3) {
            animation-delay: .36s;
        }

@keyframes feBounce {
    0%,60%,100% {
        transform: translateY(0);
        opacity: .5;
    }

    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

.fe-options {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    align-self: stretch;
    margin: .1rem 0 .3rem;
    animation: feIn .4s ease both;
}

.fe-opt {
    text-align: left;
    width: 100%;
    padding: .6rem .75rem;
    border-radius: 12px;
    border: 1.5px solid var(--fe-border);
    background: var(--fe-card);
    color: var(--fe-text);
    font-size: .83rem;
    font-weight: 650;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .5rem;
    transition: transform .14s ease,border-color .14s ease,background .14s ease,box-shadow .14s ease;
}

    .fe-opt:hover {
        transform: translateX(2px);
        border-color: var(--fe-gold);
        background: #fff7ee;
        box-shadow: 0 8px 18px rgba(201,115,44,.12);
    }

    .fe-opt:active {
        transform: scale(.98);
    }

    .fe-opt:focus-visible {
        outline: 2px solid var(--fe-gold);
        outline-offset: 2px;
    }

    .fe-opt .fe-emoji {
        font-size: 1.02rem;
        flex: 0 0 auto;
    }

    .fe-opt.primary {
        background: linear-gradient(135deg,var(--fe-gold),#b5631f);
        color: #fff;
        border-color: transparent;
        box-shadow: 0 8px 20px rgba(201,115,44,.3);
    }

        .fe-opt.primary:hover {
            background: linear-gradient(135deg,#d57f33,#a35716);
            filter: brightness(1.03);
        }

    .fe-opt.wa {
        background: linear-gradient(135deg,#2bd96e,#1eb85c);
        color: #fff;
        border-color: transparent;
        box-shadow: 0 8px 20px rgba(37,211,102,.3);
    }

        .fe-opt.wa:hover {
            filter: brightness(1.05);
        }

    .fe-opt.ghost {
        background: transparent;
        border-color: transparent;
        color: var(--fe-muted);
        font-weight: 600;
        padding: .45rem .85rem;
        justify-content: center;
    }

        .fe-opt.ghost:hover {
            background: rgba(122,102,86,.08);
            transform: none;
        }

.fe-opt-grid {
    display: flex;
    gap: .45rem;
}

    .fe-opt-grid .fe-opt {
        flex: 1;
        justify-content: center;
        text-align: center;
    }

.fe-rec {
    background: linear-gradient(160deg,#fff7ee,#fff);
    border: 1.5px solid var(--fe-gold-soft);
    border-radius: 13px;
    padding: .7rem .75rem;
    align-self: stretch;
    animation: feIn .4s ease both;
    box-shadow: 0 8px 22px rgba(201,115,44,.1);
}

    .fe-rec h4 {
        margin: 0 0 .2rem;
        font-size: .9rem;
        color: var(--fe-text);
    }

    .fe-rec .fe-rec-tag {
        display: inline-block;
        font-size: .62rem;
        font-weight: 800;
        letter-spacing: .07em;
        text-transform: uppercase;
        color: var(--fe-gold);
        background: rgba(201,115,44,.12);
        padding: .18rem .45rem;
        border-radius: 99px;
        margin-bottom: .35rem;
    }

    .fe-rec p {
        margin: .18rem 0;
        font-size: .79rem;
        color: var(--fe-muted);
        line-height: 1.4;
    }

    .fe-rec .fe-rec-price {
        color: var(--fe-gold);
        font-weight: 800;
        font-size: .85rem;
    }

.fe-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .5rem .9rem;
    border-top: 1px solid var(--fe-border);
    background: var(--fe-card);
    flex: 0 0 auto;
}

.fe-restart {
    border: none;
    background: none;
    color: var(--fe-gold);
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    padding: .25rem;
    border-radius: 8px;
}

    .fe-restart:hover {
        text-decoration: underline;
    }

.fe-credit {
    font-size: .68rem;
    color: var(--fe-muted);
}

@media (max-width: 575.98px) {
    #fe-launcher {
        right: 12px;
        bottom: 198px;
        width: 38px;
        height: 38px;
    }

        #fe-launcher svg {
            width: 17px;
            height: 17px;
        }

    #fe-nudge {
        right: 58px;
        bottom: 198px;
        font-size: .78rem;
        max-width: 180px;
        padding: .5rem 1.7rem .5rem .7rem;
    }

    #fe-panel {
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: 80vh;
        border-radius: 18px 18px 0 0;
        z-index: 9999;
    }

    #fe-assistant[data-open="true"] #fe-backdrop {
        opacity: 1;
        pointer-events: auto;
        z-index: 9998;
    }

    .fe-head {
        padding: .6rem .75rem;
        border-radius: 18px 18px 0 0;
    }

    .fe-head-avatar {
        width: 30px;
        height: 30px;
    }

        .fe-head-avatar svg {
            width: 17px;
            height: 17px;
        }

    .fe-head-meta strong {
        font-size: .85rem;
    }

    .fe-head-meta span {
        font-size: .66rem;
    }

    .fe-body {
        padding: .7rem .65rem .3rem;
        gap: .4rem;
    }

    .fe-msg {
        font-size: .8rem;
        padding: .55rem .7rem;
        max-width: 90%;
    }

    .fe-opt {
        padding: .55rem .7rem;
        font-size: .8rem;
        border-radius: 11px;
    }

        .fe-opt .fe-emoji {
            font-size: .95rem;
        }

    .fe-rec {
        padding: .6rem .7rem;
    }

        .fe-rec h4 {
            font-size: .86rem;
        }

        .fe-rec p {
            font-size: .76rem;
        }

    .fe-foot {
        padding: .4rem .75rem;
    }

    .fe-restart {
        font-size: .74rem;
    }

    .fe-credit {
        font-size: .64rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    #fe-assistant * {
        animation: none !important;
        transition: opacity .15s ease !important;
    }
}
@media (max-width: 575.98px) {
    #fe-launcher {
        right: 10px !important;
        bottom: 162px !important;
        width: 32px !important;
        height: 32px !important;
    }

        #fe-launcher svg {
            width: 15px !important;
            height: 15px !important;
        }

    .fe-launcher-pulse {
        display: none !important;
    }

    #fe-nudge {
        right: 50px !important;
        bottom: 162px !important;
        font-size: 0.72rem !important;
        max-width: 170px !important;
    }
}

/* =====================================================================
   AUDIO DEL ASISTENTE · agregar al FINAL de asistente.css
   Botón de lectura en el header + mini botón "leer" por respuesta
   ===================================================================== */

/* Botón de audio en el encabezado (interruptor de lectura automática) */
.fe-head-audio {
    border: none;
    background: rgba(255,255,255,.12);
    color: #FCE6CB;
    width: 29px;
    height: 29px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    flex: 0 0 auto;
    transition: background .2s ease,color .2s ease,box-shadow .2s ease;
}

    .fe-head-audio:hover {
        background: rgba(255,255,255,.22);
    }

    .fe-head-audio i {
        line-height: 1;
    }

    /* Activo = lectura automática encendida */
    .fe-head-audio.active {
        background: linear-gradient(145deg,var(--fe-gold-2),var(--fe-gold));
        color: #fff;
    }
    /* Hablando = pulso */
    .fe-head-audio.speaking {
        animation: feAudioPulse 1.1s ease-in-out infinite;
    }

@keyframes feAudioPulse {
    0%,100% {
        box-shadow: 0 0 0 0 rgba(243,178,108,.55);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(243,178,108,0);
    }
}

/* Mini botón "leer" dentro de cada respuesta del bot */
.fe-tts-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin-left: .4rem;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--fe-border);
    background: #fff;
    color: var(--fe-muted);
    cursor: pointer;
    font-size: .72rem;
    line-height: 1;
    transition: all .15s ease;
}

    .fe-tts-btn:hover {
        color: var(--fe-gold);
        border-color: var(--fe-gold);
        background: #fff7ee;
    }

    .fe-tts-btn:active {
        transform: scale(.92);
    }

    .fe-tts-btn.speaking {
        background: linear-gradient(135deg,var(--fe-gold),#b5631f);
        color: #fff;
        border-color: transparent;
        animation: feAudioPulse 1.1s ease-in-out infinite;
    }

.fe-rec .fe-tts-btn {
    margin-top: .45rem;
}

/* Resalte sutil de la respuesta que se está leyendo */
.fe-msg.bot.fe-reading {
    box-shadow: 0 0 0 2px var(--fe-gold-soft),0 4px 12px rgba(0,0,0,.04);
}

.fe-rec.fe-reading {
    box-shadow: 0 0 0 2px var(--fe-gold-soft),0 8px 22px rgba(201,115,44,.1);
}

/* =====================================================================
   AUDIO DEL ASISTENTE · agregar al FINAL de asistente.css
   Botón de lectura en el header + mini botón "leer" por respuesta
   ===================================================================== */

/* Botón de audio en el encabezado (interruptor de lectura automática) */
.fe-head-audio {
    border: none;
    background: rgba(255,255,255,.12);
    color: #FCE6CB;
    width: 29px;
    height: 29px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    flex: 0 0 auto;
    transition: background .2s ease,color .2s ease,box-shadow .2s ease;
}

    .fe-head-audio:hover {
        background: rgba(255,255,255,.22);
    }

    .fe-head-audio i {
        line-height: 1;
    }

    /* Activo = lectura automática encendida */
    .fe-head-audio.active {
        background: linear-gradient(145deg,var(--fe-gold-2),var(--fe-gold));
        color: #fff;
    }
    /* Hablando = pulso */
    .fe-head-audio.speaking {
        animation: feAudioPulse 1.1s ease-in-out infinite;
    }

@keyframes feAudioPulse {
    0%,100% {
        box-shadow: 0 0 0 0 rgba(243,178,108,.55);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(243,178,108,0);
    }
}

/* Mini botón "leer" dentro de cada respuesta del bot */
.fe-tts-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin-left: .4rem;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--fe-border);
    background: #fff;
    color: var(--fe-muted);
    cursor: pointer;
    font-size: .72rem;
    line-height: 1;
    transition: all .15s ease;
}

    .fe-tts-btn:hover {
        color: var(--fe-gold);
        border-color: var(--fe-gold);
        background: #fff7ee;
    }

    .fe-tts-btn:active {
        transform: scale(.92);
    }

    .fe-tts-btn.speaking {
        background: linear-gradient(135deg,var(--fe-gold),#b5631f);
        color: #fff;
        border-color: transparent;
        animation: feAudioPulse 1.1s ease-in-out infinite;
    }

.fe-rec .fe-tts-btn {
    margin-top: .45rem;
}

/* Resalte sutil de la respuesta que se está leyendo */
.fe-msg.bot.fe-reading {
    box-shadow: 0 0 0 2px var(--fe-gold-soft),0 4px 12px rgba(0,0,0,.04);
}

.fe-rec.fe-reading {
    box-shadow: 0 0 0 2px var(--fe-gold-soft),0 8px 22px rgba(201,115,44,.1);
}

/* Mini botón "leer opciones" (debajo del bloque de botones) */
.fe-opts-ttsbar {
    display: flex;
    justify-content: flex-end;
    margin-top: .1rem;
}

    .fe-opts-ttsbar .fe-tts-btn {
        margin-left: 0;
    }
/* Resalte del bloque de opciones mientras se lee */
.fe-options.fe-reading {
    outline: 2px solid var(--fe-gold-soft);
    outline-offset: 3px;
    border-radius: 12px;
}