:root {
    --fpgc-navy: #123F52;
    --fpgc-blue: #0A93C7;
    --fpgc-blue-dark: #087EAA;
    --fpgc-green: #32BE5B;
    --fpgc-pale: #F4FAFB;
    --fpgc-border: #DCE7EA;
    --fpgc-text: #435761;
    --fpgc-white: #FFFFFF;
    --fpgc-shadow: 0 18px 50px rgba(18, 63, 82, 0.18);
}

.fpgc-root,
.fpgc-root * {
    box-sizing: border-box;
}

.fpgc-root {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99999;
    font-family: inherit;
}

.fpgc-launcher {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: var(--fpgc-navy);
    color: var(--fpgc-white);
    box-shadow: 0 12px 30px rgba(18, 63, 82, 0.25);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.fpgc-launcher:hover,
.fpgc-launcher:focus-visible {
    background: #0d3343;
    transform: translateY(-1px);
    box-shadow: 0 15px 34px rgba(18, 63, 82, 0.30);
}

.fpgc-launcher-icon {
    display: inline-flex;
    width: 24px;
    height: 24px;
}

.fpgc-launcher-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.fpgc-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    width: min(390px, calc(100vw - 32px));
    height: min(680px, calc(100vh - 90px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--fpgc-border);
    border-radius: 22px;
    background: var(--fpgc-white);
    box-shadow: var(--fpgc-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(.985);
    transform-origin: bottom right;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

.fpgc-root.is-open .fpgc-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.fpgc-root.is-open .fpgc-launcher {
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
}

.fpgc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    background: var(--fpgc-navy);
    color: var(--fpgc-white);
}

.fpgc-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.fpgc-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--fpgc-green);
    color: var(--fpgc-white);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .03em;
}

.fpgc-brand strong,
.fpgc-brand span {
    display: block;
}

.fpgc-brand strong {
    font-size: 15px;
    line-height: 1.15;
}

.fpgc-brand span {
    margin-top: 2px;
    font-size: 12px;
    opacity: .82;
}

.fpgc-close {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    color: var(--fpgc-white);
    cursor: pointer;
    font: inherit;
    font-size: 27px;
    font-weight: 300;
    line-height: 1;
}

.fpgc-close:hover,
.fpgc-close:focus-visible {
    background: rgba(255,255,255,.2);
}

.fpgc-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    background: var(--fpgc-white);
    scroll-behavior: smooth;
}

.fpgc-messages {
    padding: 20px 16px 12px;
    background:
        linear-gradient(rgba(244,250,251,.93), rgba(244,250,251,.93)),
        radial-gradient(circle at top right, rgba(10,147,199,.08), transparent 42%);
}

.fpgc-message-row {
    display: flex;
    margin-bottom: 10px;
}

.fpgc-message-row--bot {
    justify-content: flex-start;
}

.fpgc-message-row--user {
    justify-content: flex-end;
}

.fpgc-bubble {
    max-width: 86%;
    padding: 11px 13px;
    font-size: 14px;
    line-height: 1.5;
    word-break: normal;
    overflow-wrap: anywhere;
}

.fpgc-bubble--bot {
    border: 1px solid var(--fpgc-border);
    border-radius: 6px 17px 17px 17px;
    background: var(--fpgc-white);
    color: var(--fpgc-text);
}

.fpgc-bubble--user {
    border-radius: 17px 17px 6px 17px;
    background: var(--fpgc-blue);
    color: var(--fpgc-white);
}

.fpgc-actions {
    display: grid;
    gap: 8px;
    padding: 12px 16px 14px;
    border-top: 1px solid var(--fpgc-border);
    background: var(--fpgc-white);
}

.fpgc-option {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #b8dce9;
    border-radius: 11px;
    background: var(--fpgc-white);
    color: var(--fpgc-navy);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.fpgc-option:hover,
.fpgc-option:focus-visible {
    border-color: var(--fpgc-blue);
    background: #eef8fc;
    transform: translateY(-1px);
}

.fpgc-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-top: 1px solid var(--fpgc-border);
    background: #fbfdfd;
}

.fpgc-nav-btn {
    padding: 7px 9px;
    border: 0;
    background: transparent;
    color: var(--fpgc-blue-dark);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
}

.fpgc-nav-btn:hover:not(:disabled),
.fpgc-nav-btn:focus-visible:not(:disabled) {
    text-decoration: underline;
}

.fpgc-nav-btn:disabled {
    opacity: .35;
    cursor: default;
}

.fpgc-typing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 50px;
    min-height: 37px;
}

.fpgc-typing span {
    width: 6px;
    height: 6px;
    display: block;
    border-radius: 50%;
    background: #8ca4ae;
    animation: fpgcTyping 1s infinite ease-in-out;
}

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

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

@keyframes fpgcTyping {
    0%, 60%, 100% { transform: translateY(0); opacity: .45; }
    30% { transform: translateY(-3px); opacity: 1; }
}


@media (min-width: 601px) and (max-height: 760px) {
    .fpgc-panel {
        height: calc(100vh - 88px);
        max-height: 640px;
    }

}

@media (max-width: 600px) {
    .fpgc-root {
        right: 14px;
        bottom: 14px;
    }

    .fpgc-launcher {
        min-height: 52px;
        padding: 0 16px;
    }

    .fpgc-panel {
        position: fixed;
        inset: 10px;
        width: auto;
        height: auto;
        max-height: none;
        border-radius: 18px;
        transform-origin: bottom right;
    }

    .fpgc-header {
        padding: 14px 16px;
    }

    .fpgc-messages {
        padding: 16px 13px 10px;
    }

    .fpgc-actions {
        padding: 10px 13px 12px;
    }

    .fpgc-option {
        padding: 11px 12px;
    }

    .fpgc-bubble {
        max-width: 90%;
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fpgc-panel,
    .fpgc-launcher,
    .fpgc-option {
        transition: none !important;
    }

    .fpgc-typing span {
        animation: none !important;
    }
}
