﻿:root {
    --ai-z: 2147483000;
    --ai-gap: 18px;
    --ai-shadow: 0 18px 48px rgba(0,0,0,.22);
    --ai-off-bg: #1e2837;
    --ai-border: rgba(0,0,0,.12);
    --ai-text: #212529;
    --ai-muted: #6c757d;
    --ai-user-bg: rgba(124, 58, 237, .12);
    --ai-user-br: rgba(124, 58, 237, .25);
    --ai-bot-bg: #caf0f8;
    --ai-bot-br: rgba(13, 110, 253, .20);
}

html, body {
    height: 100%;
}

/* Escopo: garante Inter só no widget */
#ai-trigger,
#ai-backdrop,
#ai-offcanvas {
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* ===== Trigger pill ===== */
#ai-trigger {
    position: fixed;
    right: var(--ai-gap);
    bottom: var(--ai-gap);
    z-index: var(--ai-z);
    cursor: pointer;
    user-select: none;
}

    #ai-trigger.hidden {
        display: none;
    }

#ai-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.16);
    box-shadow: var(--ai-shadow);
    background: rgba(30, 40, 55, .92);
    backdrop-filter: blur(10px);
    color: #eaf2ff;
    font-size: 13px;
    font-weight: 600; /* sem exagero */
    letter-spacing: .2px;
}

    #ai-pill:hover {
        background: rgba(30, 40, 55, .98);
    }

    #ai-pill .pill-logo {
        width: 26px;
        height: 26px;
        display: block;
        flex: 0 0 auto;
        filter: drop-shadow(0 2px 6px rgba(0,0,0,.35));
        opacity: .95;
    }

    #ai-pill .pill-text {
        display: inline-flex;
        align-items: baseline;
        gap: 8px;
        white-space: nowrap;
    }

    #ai-pill .pill-sub {
        font-size: 11px;
        font-weight: 500;
        color: rgba(234, 242, 255, .72);
    }

    #ai-pill .dot {
        width: 10px;
        height: 10px;
        border-radius: 999px;
        background: #22c55e;
        border: 2px solid rgba(0,0,0,.35);
        box-shadow: 0 0 0 2px rgba(255,255,255,.12);
        margin-left: 2px;
        flex: 0 0 auto;
    }


    #ai-pill .dot {
        position: relative;
    }

        /* “anel” pulsando */
        #ai-pill .dot::after {
            content: "";
            position: absolute;
            inset: -6px;
            border-radius: 999px;
            background: rgba(34, 197, 94, .25);
            animation: aiPulse 1.35s ease-out infinite;
        }

@keyframes aiPulse {
    0% {
        transform: scale(.55);
        opacity: .0;
    }

    20% {
        opacity: .65;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

/* quando estiver OFF, sem pulso */
#ai-pill .dot.off {
    background: #9ca3af;
}

    #ai-pill .dot.off::after {
        display: none;
    }


/* ===== Backdrop ===== */
#ai-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.42);
    z-index: calc(var(--ai-z) - 1);
    display: none;
}

    #ai-backdrop.open {
        display: block;
    }

/* ===== Offcanvas ===== */
#ai-offcanvas {
    position: fixed;
    inset: 0 0 0 auto; /* ocupa até embaixo */
    width: min(520px, 100vw);
    background: var(--ai-off-bg);
    border-left: 1px solid rgba(255,255,255,.08);
    box-shadow: var(--ai-shadow);
    z-index: var(--ai-z);
    transform: translateX(110%);
    transition: transform .25s ease;
    display: flex;
    flex-direction: column;
}

    #ai-offcanvas.open {
        transform: translateX(0);
    }

/* ===== Header ===== */
#ai-header {
    padding: 30px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: rgba(30, 40, 55, .98);
    gap: 12px;
}

#ai-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

/* Logo: sem fundo feio, só destaque via sombra + halo sutil */
#ai-logo {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    background: transparent;
    border: none;
}

    #ai-logo .lyra-mini {
        width: 34px; /* antes estava 28 */
        height: 34px; /* antes estava 28 */
        display: block;
        filter: drop-shadow(0 1px 2px rgba(0,0,0,.35));
        opacity: .95;
    }

#ai-title-wrap {
    min-width: 0;
}

#ai-title {
    color: #eaf2ff;
    font-size: 18px;
    font-weight: 700; /* negrito só aqui */
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#ai-status {
    color: rgba(234, 242, 255, .65);
    font-size: 11px;
    font-weight: 500;
    margin-top: 2px;
}

#ai-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 0 0 auto;
}

.ai-btn {
    height: 32px;
    padding: 0 10px;
    border-radius: 7px !important;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    color: #eaf2ff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600; /* negrito só em botões */
}

    .ai-btn:hover {
        background: rgba(255,255,255,.10);
    }

/* ===== Messages ===== */
#ai-messages {
    flex: 1;
    padding: 12px;
    overflow: auto;
    background: var(--ai-off-bg);
}

.msg {
    max-width: 88%;
    padding: 10px 12px;
    border-radius: 7px;
    margin: 8px 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 13px;
    font-weight: 500; /* texto normal */
    line-height: 1.35;
    border: 1px solid rgba(255,255,255,.08);
    white-space: pre-line
}

    .msg.user {
        margin-left: auto;
        background: rgba(124, 58, 237, .20);
        border-color: rgba(124, 58, 237, .30);
        color: #f3efff;
    }

    .msg.bot {
        margin-right: auto;
        background: var(--ai-bot-bg);
        border-color: rgba(202, 240, 248, .65);
        color: #0b1a2a;
    }

/* ===== Input bar ===== */
#ai-inputbar {
    padding: 10px;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex;
    gap: 4px;
    align-items: center;
    background: rgba(30, 40, 55, .98);
}

#ai-input {
    flex: 1;
    height: 42px;
    border-radius: 7px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(0,0,0,.18);
    color: #eaf2ff;
    padding: 0 12px;
    outline: none;
    font-size: 13px;
    font-weight: 500;
}

    #ai-input::placeholder {
        color: rgba(234, 242, 255, .55);
    }

#ai-send {
    height: 38px;
    padding: 0 14px;
    border-radius: 7px !important;
    border: 1px solid rgba(255,255,255,.12);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700; /* negrito só aqui */
}

    #ai-send:hover {
        background: rgba(255,255,255,.14);
    }

    #ai-send:disabled {
        opacity: .55;
        cursor: not-allowed;
    }

.msg-download {
    display: inline-block;
    margin-top: 6px;
    font-weight: 600;
    text-decoration: underline;
}

