/* FuelBotics chatbot */
.fbc {
    --fbc-brand: #0d9488;
    --fbc-brand-dark: #0b7068;
    --fbc-brand-soft: #e6f6f4;
    --fbc-navy: #0f1f2e;
    --fbc-text: #0f172a;
    --fbc-muted: #64748b;
    --fbc-line: #e2e8f0;
    --fbc-surface: #f5f7fa;
    --fbc-radius: 22px;
    --fbc-shadow: 0 24px 64px rgba(15, 31, 46, .22), 0 4px 14px rgba(15, 31, 46, .08);
    font-family: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--fbc-text);
}

    .fbc *,
    .fbc *::before,
    .fbc *::after {
        box-sizing: border-box;
    }

    .fbc button,
    .fbc input {
        font: inherit;
        color: inherit;
    }

.fbc-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Launcher */
.fbc-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 990;
    width: 60px;
    height: 60px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #14b8a6 0%, var(--fbc-brand) 55%, var(--fbc-brand-dark) 100%);
    color: #fff !important;
    cursor: pointer;
    box-shadow: 0 14px 32px rgba(13, 148, 136, .38), 0 2px 6px rgba(15, 31, 46, .12);
    transition: transform .2s ease, box-shadow .2s ease;
}

    .fbc-launcher:hover {
        transform: translateY(-2px) scale(1.03);
        box-shadow: 0 18px 40px rgba(13, 148, 136, .45), 0 2px 6px rgba(15, 31, 46, .12);
    }

    .fbc-launcher:focus-visible,
    .fbc-icon-btn:focus-visible,
    .fbc-chip:focus-visible,
    .fbc-action:focus-visible,
    .fbc-send:focus-visible {
        outline: 3px solid rgba(13, 148, 136, .45);
        outline-offset: 2px;
    }

    .fbc-launcher i {
        grid-area: 1 / 1;
        font-size: 24px;
        transition: transform .25s ease, opacity .2s ease;
    }

.fbc-launcher__close {
    opacity: 0;
    transform: rotate(-90deg) scale(.6);
}

.fbc.is-open .fbc-launcher__open {
    opacity: 0;
    transform: rotate(90deg) scale(.6);
}

.fbc.is-open .fbc-launcher__close {
    opacity: 1;
    transform: none;
}

.fbc-launcher__badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    display: grid;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

    .fbc-launcher__badge[hidden] {
        display: none;
    }

/* Panel */
.fbc-panel {
    position: fixed;
    right: 24px;
    bottom: 100px;
    z-index: 990;
    width: 390px;
    height: min(640px, calc(100vh - 200px));
    min-height: 320px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(15, 31, 46, .06);
    border-radius: var(--fbc-radius);
    box-shadow: var(--fbc-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(.97);
    transform-origin: bottom right;
    transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
}

.fbc.is-open .fbc-panel {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .22s ease, transform .22s ease, visibility 0s;
}

/* Header */
.fbc-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 14px 18px 18px;
    background: radial-gradient(120% 140% at 0% 0%, #1f5f5b 0%, var(--fbc-navy) 60%);
    color: #fff;
}

    .fbc-head::after {
        content: "";
        position: absolute;
        inset: 0;
        background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
        background-size: 28px 28px;
        pointer-events: none;
    }

    .fbc-head > * {
        position: relative;
        z-index: 1;
    }

.fbc-avatar {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 1px var(--fbc-line);
}

    .fbc-avatar img {
        width: auto;
        height: 18px;
        display: block;
    }

.fbc-head .fbc-avatar {
    width: 44px;
    height: 44px;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .14);
}

    .fbc-head .fbc-avatar img {
        height: 26px;
    }

.fbc-head__text {
    flex: 1;
    min-width: 0;
}

    .fbc-head__text h2 {
        margin: 0;
        font-size: 17px;
        font-weight: 700;
        line-height: 1.2;
        color: #fff;
    }

    .fbc-head__text p {
        margin: 4px 0 0;
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 13px;
        color: rgba(255, 255, 255, .72);
    }

.fbc-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, .25);
}

.fbc-icon-btn {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, .8) !important;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

    .fbc-icon-btn:hover {
        background: rgba(255, 255, 255, .12);
        color: #fff !important;
    }

    .fbc-icon-btn i {
        font-size: 16px;
    }

/* Messages */
.fbc-log {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 20px 16px 8px;
    background: var(--fbc-surface);
    scroll-behavior: smooth;
}

.fbc-msg {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
    animation: fbc-in .25s ease both;
}

.fbc-msg--user {
    justify-content: flex-end;
}

.fbc-msg__body {
    min-width: 0;
    max-width: 82%;
}

.fbc-msg--user .fbc-msg__body {
    max-width: 78%;
}

.fbc-bubble {
    padding: 11px 14px;
    border-radius: 18px 18px 18px 6px;
    background: #fff;
    border: 1px solid var(--fbc-line);
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--fbc-text);
    overflow-wrap: anywhere;
    box-shadow: 0 1px 2px rgba(15, 31, 46, .04);
}

    .fbc-bubble p {
        margin: 0;
    }

        .fbc-bubble p + p {
            margin-top: 8px;
        }

    .fbc-bubble strong,
    .fbc-bubble b {
        font-weight: 700;
    }

    .fbc-bubble ul {
        margin: 8px 0 0;
        padding: 0;
        list-style: none;
    }

        .fbc-bubble ul + p {
            margin-top: 8px;
        }

    .fbc-bubble li {
        position: relative;
        padding-left: 16px;
    }

        .fbc-bubble li + li {
            margin-top: 5px;
        }

        .fbc-bubble li::before {
            content: "";
            position: absolute;
            left: 2px;
            top: .62em;
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: var(--fbc-brand);
        }

.fbc-msg--user .fbc-bubble {
    border: 0;
    border-radius: 18px 18px 6px 18px;
    background: linear-gradient(135deg, var(--fbc-brand) 0%, var(--fbc-brand-dark) 100%);
    color: #fff;
}

.fbc-msg--error .fbc-bubble {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

/* Typing indicator */
.fbc-typing {
    display: inline-flex;
    gap: 4px;
    padding: 14px 16px;
}

    .fbc-typing span {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: #94a3b8;
        animation: fbc-dot 1.2s infinite both;
    }

        .fbc-typing span:nth-child(2) {
            animation-delay: .15s;
        }

        .fbc-typing span:nth-child(3) {
            animation-delay: .3s;
        }

/* Action buttons under a bot reply */
.fbc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.fbc-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 0;
    border-radius: 999px;
    background: var(--fbc-brand);
    color: #fff !important;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none !important;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}

    .fbc-action:hover {
        background: var(--fbc-brand-dark);
        transform: translateY(-1px);
    }

    .fbc-action i {
        font-size: 12px;
    }

.fbc-action--ghost {
    background: #fff;
    border: 1px solid #b7e4de;
    color: var(--fbc-brand-dark) !important;
}

    .fbc-action--ghost:hover {
        background: var(--fbc-brand-soft);
    }

/* Suggestion chips */
.fbc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 2px 0 14px 40px;
}

.fbc-chip {
    padding: 8px 14px;
    border: 1px solid #b7e4de;
    border-radius: 999px;
    background: #fff;
    color: var(--fbc-brand-dark) !important;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

    .fbc-chip:hover {
        background: var(--fbc-brand-soft);
        border-color: var(--fbc-brand);
        transform: translateY(-1px);
    }

    .fbc-chip:disabled {
        opacity: .5;
        cursor: default;
        transform: none;
    }

/* Composer */
.fbc-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 12px 14px;
    background: #fff;
    border-top: 1px solid var(--fbc-line);
}

    .fbc-form input[type="text"] {
        flex: 1;
        min-width: 0;
        height: 46px;
        padding: 0 16px;
        border: 1px solid var(--fbc-line);
        border-radius: 999px;
        background: var(--fbc-surface);
        font-size: 15px;
        outline: none;
        transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
    }

        .fbc-form input[type="text"]::placeholder {
            color: #94a3b8;
        }

        .fbc-form input[type="text"]:focus {
            border-color: var(--fbc-brand);
            background: #fff;
            box-shadow: 0 0 0 4px rgba(13, 148, 136, .12);
        }

.fbc-send {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--fbc-brand);
    color: #fff !important;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease, opacity .15s ease;
}

    .fbc-send:hover:not(:disabled) {
        background: var(--fbc-brand-dark);
        transform: scale(1.05);
    }

    .fbc-send:disabled {
        opacity: .4;
        cursor: default;
    }

    .fbc-send i {
        font-size: 16px;
        margin-left: -2px;
    }

.fbc-foot {
    margin: 0;
    padding: 0 16px 12px;
    background: #fff;
    font-size: 12.5px;
    text-align: center;
    color: var(--fbc-muted);
}

    .fbc-foot a {
        color: var(--fbc-brand-dark);
        font-weight: 600;
    }

        .fbc-foot a:hover {
            text-decoration: underline;
        }

@keyframes fbc-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes fbc-dot {
    0%, 80%, 100% {
        opacity: .3;
        transform: translateY(0);
    }

    40% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

/* Phones: full-screen sheet */
@media (max-width: 540px) {
    .fbc-launcher {
        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom));
        width: 56px;
        height: 56px;
    }

    .fbc-panel {
        inset: 0;
        z-index: 1200;
        width: 100%;
        height: 100%;
        height: 100dvh;
        border: 0;
        border-radius: 0;
        transform: translateY(24px);
        transform-origin: bottom center;
    }

    .fbc.is-open .fbc-launcher {
        opacity: 0;
        visibility: hidden;
    }

    .fbc-head {
        padding-top: calc(14px + env(safe-area-inset-top));
        padding-bottom: 14px;
    }

    .fbc-foot {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }

    .fbc-msg__body {
        max-width: 86%;
    }

    html.fbc-lock,
    html.fbc-lock body {
        overflow: hidden;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fbc-launcher,
    .fbc-launcher i,
    .fbc-panel,
    .fbc-msg,
    .fbc-typing span {
        transition: none !important;
        animation: none !important;
    }

    .fbc-log {
        scroll-behavior: auto;
    }
}
