/* Burbuja flotante */
.thoria-float-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 60px;
    height: 60px;

    /* Elimina padding y borde genéricos */
    padding: 0 !important;
    border: none !important;
    margin: 0 !important;

    /* Fondo: imagen limpia, sin color superpuesto */
    background: transparent url('/assets/thoria-avatar.png') no-repeat center center / cover !important;

    /* Resto de tu estilo */
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid rgba(255, 255, 255, 0.9) !important;
}

.thoria-float-btn:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.6);
    border-color: rgba(255, 255, 255, 1) !important;
}

/* Panel deslizable */
.thoria-drawer {
    position: absolute;
    bottom: 0;
    right: 16px;
    width: 380px;
    max-width: 90%;
    height: 0;
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 32px rgba(59, 130, 246, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: height 0.4s ease-in-out;
    border: 1px solid #e2e8f0;
    border-bottom: none;
}

.thoria-drawer.open {
    height: 480px;
}

.thoria-drawer-header {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    padding: 16px 20px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    border-radius: 20px 20px 0 0;
}

.thoria-drawer-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg,
            rgba(255, 255, 255, 0.1) 25%,
            transparent 25%,
            transparent 50%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0.1) 75%,
            transparent 75%);
    background-size: 20px 20px;
    pointer-events: none;
}

.thoria-drawer-close {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    z-index: 1;
}

.thoria-drawer-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.thoria-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.thoria-input-area {
    display: flex;
    border-top: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 12px;
    gap: 12px;
}

.thoria-input {
    flex: 1;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    padding: 12px 18px;
    font-size: 0.9rem;
    outline: none;
    background: #ffffff;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    color: #475569;
}

.thoria-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: #f0f9ff;
}

.thoria-input::placeholder {
    color: #94a3b8;
}

.thoria-send {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    padding: 0 16px;
    border: none;
    border-radius: 20px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.thoria-send:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: scale(1.05) translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.thoria-send:active {
    transform: scale(0.95);
}

/* CLASE GENÉRICA PARA OCULTAR */
.hidden {
    display: none;
}

.message {
    padding: 12px 16px;
    border-radius: 18px;
    margin-bottom: 12px;
    max-width: 85%;
    position: relative;
    font-size: 0.9rem;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message.user {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    margin-left: auto;
    border-bottom-right-radius: 6px;
    position: relative;
}

.message.user::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -8px;
    width: 0;
    height: 0;
    border-left: 8px solid #2563eb;
    border-bottom: 8px solid transparent;
}

.message.bot {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: #334155;
    margin-right: auto;
    border-bottom-left-radius: 6px;
    border: 1px solid #e2e8f0;
    position: relative;
}

.message.bot::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -8px;
    width: 0;
    height: 0;
    border-right: 8px solid #f8fafc;
    border-bottom: 8px solid transparent;
}

.timestamp {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    display: block;
    margin-top: 6px;
    text-align: right;
    font-weight: 400;
}

.message.bot .timestamp {
    color: #94a3b8;
    text-align: left;
}

/* Indicador de escritura */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    margin-bottom: 12px;
    max-width: 85%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3b82f6;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Efectos de entrada para mensajes */
.message {
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Scrollbar personalizado para el área de mensajes */
.thoria-messages::-webkit-scrollbar {
    width: 6px;
}

.thoria-messages::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.thoria-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 3px;
}

.thoria-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

/* Estados del botón de envío */
.thoria-send:disabled {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    color: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Efecto de pulsación para mensajes */
.message:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Mensaje de bienvenida especial */
.welcome-message {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #7dd3fc;
    color: #0c4a6e;
    padding: 16px 20px;
    border-radius: 16px;
    margin-bottom: 16px;
    text-align: center;
    font-weight: 500;
    animation: welcomePulse 2s ease-in-out;
}

@keyframes welcomePulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(125, 211, 252, 0.3);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 4px 16px rgba(125, 211, 252, 0.5);
    }
}

/* Responsive improvements */
@media (max-width: 768px) {
    .thoria-drawer {
        width: 95%;
        right: 2.5%;
    }

    .thoria-float-btn {
        width: 50px;
        height: 50px;
        bottom: 12px;
        right: 12px;
    }

    .message {
        max-width: 90%;
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    .thoria-input {
        font-size: 0.85rem;
        padding: 10px 16px;
    }

    .thoria-send {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }

    .thoria-drawer-header {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}

/* ===== Overrides de layout solo para el panel lateral de ThorIA ===== */
#thoriaGlobal .thoria-drawer {
    position: fixed !important;
    right: 20px !important;
    top: 110px !important;
    bottom: 1px !important;
    /* pegado al borde inferior */
    width: 580px !important;
    height: auto !important;
    /* ignora alturas fijas */
    padding-bottom: 0 !important;
}

#thoriaGlobal .thoria-drawer.open {
    height: auto !important;
    /* neutraliza .open { height:480px } */
}

/* sin “suelo” decorativo ni márgenes fantasma */
#thoriaGlobal .thoria-drawer::after {
    content: none !important;
    display: none !important;
}

#thoriaGlobal .thoria-body {
    height: calc(100% - 88px) !important;
    overflow: hidden;
}

#thoriaGlobal .thoria-messages {
    flex: 1 1 auto;
    overflow: auto;
}

#thoriaGlobal .thoria-input-row {
    margin-bottom: 0 !important;
}

/* ===================== ThorIA — Tema naranja & blanco ===================== */
:root {
    --th-orange: #ff7a18;
    /* principal */
    --th-orange-dark: #d9620f;
    /* hover/acento */
    --th-orange-soft: #fff3e7;
    /* fondos muy suaves */
    --th-ink: #1b2430;
    /* texto principal */
    --th-muted: #6c7280;
    /* texto tenue */
    --th-border: #e8eaf0;
    /* bordes suaves */
    --th-surface: #ffffff;
    /* superficie base */
}

/* ---------- FAB (burbuja flotante) ---------- */
.thoria-float-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 60px;
    height: 60px;
    padding: 0 !important;
    border: none !important;
    margin: 0 !important;
    background: transparent url('/assets/thoria-avatar.png') no-repeat center/cover !important;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .95) !important;
    box-shadow: 0 6px 18px rgba(217, 98, 15, .35);
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease;
}

.thoria-float-btn:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 10px 28px rgba(217, 98, 15, .45);
}

/* ---------- Panel deslizable ---------- */
.thoria-drawer {
    position: absolute;
    bottom: 0;
    right: 16px;
    width: 380px;
    max-width: 90%;
    height: 0;
    background: var(--th-surface);
    border-radius: 20px 20px 0 0;
    border: 1px solid var(--th-border);
    border-bottom: none;
    box-shadow: 0 -8px 32px rgba(217, 98, 15, .25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: height .4s ease-in-out;
}

.thoria-drawer.open {
    height: 480px;
}

/* Header del drawer */
.thoria-drawer-header {
    background: linear-gradient(135deg, var(--th-orange) 0%, var(--th-orange-dark) 100%);
    color: #fff;
    padding: 16px 20px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    border-radius: 20px 20px 0 0;
}

.thoria-drawer-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, .12) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .12) 50%, rgba(255, 255, 255, .12) 75%, transparent 75%);
    background-size: 20px 20px;
    pointer-events: none;
}

/* Botón cerrar: más pequeño y naranja marcado */
.thoria-drawer-close {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    background: #fff;
    color: var(--th-orange-dark);
    border: 1px solid rgba(0, 0, 0, .06);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    border-radius: 8px;
    z-index: 1;
    transition: all .2s ease;
}

.thoria-drawer-close:hover {
    background: var(--th-orange);
    color: #fff;
    border-color: transparent;
    transform: scale(1.05);
}

/* Área de mensajes */
.thoria-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: linear-gradient(135deg, #fff 0%, var(--th-orange-soft) 100%);
}

.thoria-messages::-webkit-scrollbar {
    width: 6px;
}

.thoria-messages::-webkit-scrollbar-track {
    background: #ffeede;
    border-radius: 3px;
}

.thoria-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--th-orange), var(--th-orange-dark));
    border-radius: 3px;
}

.thoria-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--th-orange-dark), #b44f0c);
}

/* Input */
.thoria-input-area {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-top: 1px solid var(--th-border);
    background: linear-gradient(135deg, #fff 0%, #fff8f1 100%);
}

.thoria-input {
    flex: 1;
    border: 2px solid var(--th-border);
    border-radius: 20px;
    padding: 12px 18px;
    font-size: .9rem;
    outline: none;
    background: #fff;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, .04);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
    color: var(--th-ink);
}

.thoria-input:focus {
    border-color: var(--th-orange);
    box-shadow: 0 0 0 3px rgba(255, 122, 24, .18);
    background: #fffdf8;
}

.thoria-input::placeholder {
    color: #98a1ad;
}

/* Botón enviar */
.thoria-send {
    background: linear-gradient(135deg, var(--th-orange) 0%, var(--th-orange-dark) 100%);
    color: #fff;
    padding: 0 16px;
    border: none;
    border-radius: 20px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(217, 98, 15, .28);
    transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
    font-size: 1.1rem;
}

.thoria-send:hover {
    transform: scale(1.05) translateY(-1px);
    box-shadow: 0 6px 14px rgba(217, 98, 15, .35);
}

.thoria-send:active {
    transform: scale(.95);
}

.thoria-send:disabled {
    background: linear-gradient(135deg, #eee 0%, #ddd 100%);
    color: #9aa1ab;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Burbujas */
.message {
    padding: 12px 16px;
    border-radius: 18px;
    margin-bottom: 12px;
    max-width: 85%;
    position: relative;
    font-size: .9rem;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
    animation: messageSlideIn .3s ease-out;
}

.message.user {
    margin-left: auto;
    color: #fff;
    background: linear-gradient(135deg, var(--th-orange) 0%, var(--th-orange-dark) 100%);
    border-bottom-right-radius: 6px;
}

.message.user::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -8px;
    width: 0;
    height: 0;
    border-left: 8px solid var(--th-orange-dark);
    border-bottom: 8px solid transparent;
}

.message.bot {
    margin-right: auto;
    color: var(--th-ink);
    background: linear-gradient(135deg, #fff 0%, #fffaf5 100%);
    border: 1px solid var(--th-border);
    border-bottom-left-radius: 6px;
}

.message.bot::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -8px;
    width: 0;
    height: 0;
    border-right: 8px solid #fffaf5;
    border-bottom: 8px solid transparent;
}

/* Timestamps */
.timestamp {
    font-size: .7rem;
    display: block;
    margin-top: 6px;
    text-align: right;
    font-weight: 400;
    color: rgba(255, 255, 255, .9);
}

.message.bot .timestamp {
    color: #949eaa;
    text-align: left;
}

/* Indicador "escribiendo" */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    max-width: 85%;
    background: linear-gradient(135deg, #fff 0%, #fffaf5 100%);
    border-radius: 18px;
    border: 1px solid var(--th-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--th-orange);
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
    animation-delay: .2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: .4s;
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: .55;
    }

    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Efectos de entrada */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mensaje de bienvenida */
.welcome-message {
    background: linear-gradient(135deg, #fff8ef 0%, #ffeede 100%);
    border: 2px solid #ffc692;
    color: #7a3f0a;
    padding: 16px 20px;
    border-radius: 16px;
    margin-bottom: 16px;
    text-align: center;
    font-weight: 600;
    animation: welcomePulse 2s ease-in-out;
}

@keyframes welcomePulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(255, 198, 146, .35);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 6px 16px rgba(255, 198, 146, .5);
    }
}

/* Responsive */
@media (max-width:768px) {
    .thoria-drawer {
        width: 95%;
        right: 2.5%;
    }

    .thoria-float-btn {
        width: 50px;
        height: 50px;
        bottom: 12px;
        right: 12px;
    }

    .message {
        max-width: 90%;
        padding: 10px 14px;
        font-size: .85rem;
    }

    .thoria-input {
        font-size: .85rem;
        padding: 10px 16px;
    }

    .thoria-send {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }

    .thoria-drawer-header {
        padding: 12px 16px;
        font-size: .95rem;
    }
}

/* ===== Overrides de layout solo para el panel lateral de ThorIA ===== */
#thoriaGlobal .thoria-drawer {
    position: fixed !important;
    right: 20px !important;
    top: 110px !important;
    bottom: 1px !important;
    width: 580px !important;
    height: auto !important;
    padding-bottom: 0 !important;
}

#thoriaGlobal .thoria-drawer.open {
    height: auto !important;
}

#thoriaGlobal .thoria-drawer::after {
    content: none !important;
    display: none !important;
}

#thoriaGlobal .thoria-body {
    height: calc(100% - 88px) !important;
    overflow: hidden;
}

#thoriaGlobal .thoria-messages {
    flex: 1 1 auto;
    overflow: auto;
}

#thoriaGlobal .thoria-input-row {
    margin-bottom: 0 !important;
}

/* ===== ThorIA: paleta base ===== */
:root {
    --th-orange: #FF7A18;
    --th-orange-dark: #D9620F;
}

/* FAB con SVG dentro */
.thoria-fab-with-logo {
    background: transparent !important;
    padding: 0 !important;
    border: none !important;
    display: grid;
    place-items: center;
}

.thoria-fab-with-logo svg {
    width: 100%;
    height: 100%;
}

/* Flotar (respirar) suave */
svg[data-thorialogo] #grupo-mascota {
    animation: thoria-float 3.3s ease-in-out infinite;
    transform-origin: 50% 50%;
}

@keyframes thoria-float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-4px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* Parpadeo de ojos */
svg[data-thorialogo] .blink ellipse:first-child {
    transform-origin: center;
    animation: thoria-blink .16s ease-in-out 1;
}

@keyframes thoria-blink {
    0% {
        transform: scaleY(1);
    }

    45% {
        transform: scaleY(0.12);
    }

    100% {
        transform: scaleY(1);
    }
}

/* Boca "hablando" */
svg[data-thorialogo] .talk path {
    transform-origin: center;
    animation: thoria-talk .28s ease-in-out 1;
}

@keyframes thoria-talk {
    0% {
        transform: scaleY(1);
    }

    50% {
        transform: scaleY(1.25);
    }

    100% {
        transform: scaleY(1);
    }
}

/* Saludo del brazo */
svg[data-thorialogo].wave #brazo-der {
    transform-origin: 140px 24px;
    animation: thoria-wave 0.9s ease-in-out 1;
}

@keyframes thoria-wave {
    0% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-18deg);
    }

    50% {
        transform: rotate(12deg);
    }

    75% {
        transform: rotate(-10deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

/* Rayito chispa */
svg[data-thorialogo].spark #rayo {
    animation: thoria-spark 0.7s ease-out 1 forwards;
}

@keyframes thoria-spark {
    0% {
        opacity: 0;
        transform: translate(12px, -6px) scale(0.65) rotate(-10deg);
    }

    15% {
        opacity: 1;
        transform: translate(6px, -16px) scale(0.95) rotate(0deg);
    }

    60% {
        opacity: .9;
        transform: translate(2px, -20px) scale(1) rotate(6deg);
    }

    100% {
        opacity: 0;
        transform: translate(-8px, -34px) scale(1.05) rotate(10deg);
    }
}

/* Accesibilidad: reducir animaciones si el usuario lo pide */
@media (prefers-reduced-motion: reduce) {
    svg[data-thorialogo] * {
        animation: none !important;
        transition: none !important;
    }
}

/* ===== X del chat: más pequeña y naranja fuerte ===== */
.thoria-drawer-close {
    font-size: 14px !important;
    /* más pequeña */
    line-height: 1 !important;
    color: var(--th-orange-dark) !important;
    background: #FFE6D2 !important;
    border: 1px solid #FFC49B !important;
    border-radius: 9999px !important;
    padding: 2px 8px !important;
}

.thoria-drawer-close:hover {
    background: #FFD2AE !important;
    color: #B84F0C !important;
}

/* Forzar tamaño XL del FAB sin tocar tu inline: */
.thoria-logo-xl {
    width: 120px !important;
    height: 120px !important;
}

/* Toque más “premium” en hover (sin romper nada) */
.thoria-fab-with-logo:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, .15);
    transform: translateY(-1px);
    transition: box-shadow .2s ease, transform .2s ease;
}

/* === Thoria: listado de oportunidades en el chat === */

#thoriaGlobal .thoria-briefing {
    background: rgba(255, 255, 255, 0.9);
}

/* Card de oportunidad dentro de Thoria */
#thoriaGlobal .thoria-op-card.result-card {
    padding: 10px 12px;
    border-radius: 12px;
    border-width: 1px;
    margin-bottom: 10px;
    font-size: 13px;
}

/* Título más legible en móvil */
#thoriaGlobal .thoria-op-card h4 {
    font-size: 0.9rem;
    line-height: 1.25rem;
}

/* Líneas de cliente / expediente más compactas */
#thoriaGlobal .thoria-op-card p {
    margin-bottom: 2px;
}

/* Chips (estado, fase, creada) alineados y con menos ruido visual */
#thoriaGlobal .thoria-op-card .chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* Enlaces al pie */
#thoriaGlobal .thoria-op-card a {
    font-size: 11px;
    font-weight: 500;
}

/* Nombre del propietario un poco más discreto */
#thoriaGlobal .thoria-op-card .owner-label {
    font-size: 11px;
    opacity: 0.75;
}

/* ===== ThorIA Tech Cartoon - Animaciones adicionales ===== */

/* Parpadeo de ojos tech (cyan glow) */
svg[data-thorialogo] #ojo-izq,
svg[data-thorialogo] #ojo-der {
    animation: thoria-eye-glow 3s ease-in-out infinite;
}

svg[data-thorialogo] #ojo-der {
    animation-delay: 0.15s;
}

@keyframes thoria-eye-glow {

    0%,
    90%,
    100% {
        filter: url(#glow);
        opacity: 1;
    }

    95% {
        filter: none;
        opacity: 0.3;
    }
}

/* Boca pulsante */
svg[data-thorialogo] #boca path {
    animation: thoria-mouth-pulse 4s ease-in-out infinite;
}

@keyframes thoria-mouth-pulse {

    0%,
    100% {
        stroke-width: 3;
    }

    50% {
        stroke-width: 4;
    }
}

/* Antena parpadeante */
svg[data-thorialogo] #antena circle:last-child {
    animation: thoria-antenna-blink 2s ease-in-out infinite;
}

@keyframes thoria-antenna-blink {

    0%,
    100% {
        opacity: 1;
        r: 3;
    }

    50% {
        opacity: 0.5;
        r: 4;
    }
}

/* Partículas flotantes */
svg[data-thorialogo] .particles circle {
    animation: thoria-particle-float 4s ease-in-out infinite;
}

svg[data-thorialogo] .particles circle:nth-child(2) {
    animation-delay: 1s;
    animation-duration: 3.5s;
}

svg[data-thorialogo] .particles circle:nth-child(3) {
    animation-delay: 2s;
    animation-duration: 4.5s;
}

svg[data-thorialogo] .particles circle:nth-child(4) {
    animation-delay: 0.5s;
    animation-duration: 3s;
}

@keyframes thoria-particle-float {

    0%,
    100% {
        transform: translateY(0) scale(1);
        opacity: 0.6;
    }

    50% {
        transform: translateY(-8px) scale(1.2);
        opacity: 1;
    }
}

/* Brazo saludando mejorado */
svg[data-thorialogo].wave #brazo-der {
    transform-origin: 205px 85px;
    animation: thoria-wave-arm 0.8s ease-in-out;
}

@keyframes thoria-wave-arm {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-15deg);
    }

    75% {
        transform: rotate(10deg);
    }
}

/* Rayos tech */
svg[data-thorialogo].spark #rayo {
    animation: thoria-spark-tech 0.6s ease-out forwards;
}

@keyframes thoria-spark-tech {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    30% {
        opacity: 1;
        transform: scale(1.1);
    }

    100% {
        opacity: 0;
        transform: scale(1) translateY(-10px);
    }
}

/* Hover effect en el FAB - más tech */
.thoria-fab-with-logo:hover svg[data-thorialogo] #ojo-izq,
.thoria-fab-with-logo:hover svg[data-thorialogo] #ojo-der {
    animation: thoria-eye-excited 0.3s ease-in-out;
}

@keyframes thoria-eye-excited {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}