/* KG3 FAQ chatbot — shadcn-style shell */

.kg3-chatbot {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 9990;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
    width: min(22rem, calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
    font-family: inherit;
    pointer-events: none;
}

.kg3-chatbot > * {
    pointer-events: auto;
}

.kg3-chatbot__panel {
    width: 100%;
    margin: 0;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow:
        0 20px 40px rgb(15 23 42 / 0.12),
        0 4px 12px rgb(15 23 42 / 0.06);
}

.kg3-chatbot__panel.hidden {
    display: none !important;
}

.kg3-chatbot__panel:not(.hidden) {
    display: flex;
    flex-direction: column;
    max-height: min(32rem, calc(100vh - 7rem));
}

.kg3-chatbot__header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border-bottom: 1px solid rgb(226 232 240);
    background: linear-gradient(180deg, rgb(248 250 252 / 0.95) 0%, rgb(255 255 255) 100%);
    padding: 0.875rem 1rem;
}

.kg3-chatbot__header-main {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.75rem;
}

.kg3-chatbot__avatar {
    display: grid;
    height: 2.25rem;
    width: 2.25rem;
    flex-shrink: 0;
    place-items: center;
    border-radius: 0.5rem;
    background: #ed1d24;
    color: #fff;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.08);
}

.kg3-chatbot__title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    color: #0f172a;
}

.kg3-chatbot__subtitle {
    margin: 0.125rem 0 0;
    font-size: 0.75rem;
    line-height: 1.25;
    color: #64748b;
}

.kg3-chatbot__close {
    flex-shrink: 0;
    height: 2rem !important;
    width: 2rem !important;
    min-width: 2rem;
    padding: 0 !important;
    color: #64748b !important;
}

.kg3-chatbot__crumb {
    flex-shrink: 0;
    border-bottom: 1px solid rgb(241 245 249);
    background: #fff;
    padding: 0.5rem 1rem;
}

.kg3-chatbot__crumb-text {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
}

.kg3-chatbot__messages {
    flex: 1 1 auto;
    min-height: 6rem;
    max-height: 14rem;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 1rem;
}

.kg3-chatbot__messages > * + * {
    margin-top: 0.75rem;
}

.kg3-chatbot__message-block {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.kg3-chatbot__message-label {
    margin: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ed1d24;
}

.kg3-chatbot__bubble {
    border-radius: 0.5rem;
    border: 1px solid rgb(226 232 240);
    background: rgb(248 250 252);
    padding: 0.75rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #334155;
}

.kg3-chatbot__bubble p {
    margin: 0 0 0.5rem;
}

.kg3-chatbot__bubble p:last-child {
    margin-bottom: 0;
}

.kg3-chatbot__options {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-top: 1px solid rgb(226 232 240);
    background: #fff;
    padding: 0.75rem 1rem;
    max-height: 10rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.kg3-chatbot__option {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.625rem;
    border-radius: 0.375rem;
    border: 1px solid rgb(226 232 240);
    background: #fff;
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 500;
    color: #0f172a;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.kg3-chatbot__option:hover {
    border-color: rgb(237 29 36 / 0.35);
    background: #fff5f5;
    color: #d01920;
}

.kg3-chatbot__option:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgb(255 255 255), 0 0 0 4px rgb(237 29 36 / 0.35);
}

.kg3-chatbot__option-icon {
    display: grid;
    height: 2rem;
    width: 2rem;
    flex-shrink: 0;
    place-items: center;
    border-radius: 0.375rem;
    background: rgb(241 245 249);
    color: #ed1d24;
    font-size: 0.75rem;
}

.kg3-chatbot__option-label {
    flex: 1;
    min-width: 0;
}

.kg3-chatbot__option-chevron {
    flex-shrink: 0;
    font-size: 0.625rem;
    color: #94a3b8;
}

.kg3-chatbot__hint {
    margin: 0;
    padding: 0.5rem 0;
    text-align: center;
    font-size: 0.75rem;
    color: #94a3b8;
}

.kg3-chatbot__hint--error {
    color: #dc2626;
}

.kg3-chatbot__footer {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.625rem;
    border-top: 1px solid rgb(226 232 240);
    background: rgb(248 250 252 / 0.9);
    padding: 0.75rem 1rem;
}

.kg3-chatbot__footer-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.kg3-chatbot__footer-actions .inline-flex {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
}

.kg3-chatbot__footer-human {
    width: 100%;
    justify-content: center !important;
    font-size: 0.75rem !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

.kg3-chatbot button.hidden,
.kg3-chatbot a.hidden {
    display: none !important;
}

.kg3-chatbot__fab {
    flex-shrink: 0;
    align-self: flex-end;
    height: 3.5rem !important;
    width: 3.5rem !important;
    min-width: 3.5rem;
    padding: 0 !important;
    border: 1px solid #ed1d24 !important;
    border-radius: 9999px !important;
    background: #ed1d24 !important;
    color: #fff !important;
    box-shadow:
        0 10px 25px rgb(237 29 36 / 0.28),
        0 2px 6px rgb(15 23 42 / 0.08);
}

.kg3-chatbot__fab:hover {
    transform: scale(1.03);
    background: #d01920 !important;
    border-color: #d01920 !important;
    color: #fff !important;
}

.kg3-chatbot__fab i {
    font-size: 1.25rem;
    margin: 0;
    color: #fff !important;
}

@media (max-width: 380px) {
    .kg3-chatbot {
        right: 1rem;
        bottom: 1rem;
        width: calc(100vw - 2rem);
    }

    .kg3-chatbot__footer-actions {
        flex-direction: column;
    }

    .kg3-chatbot__footer-actions .inline-flex {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kg3-chatbot__fab:hover {
        transform: none;
    }
}
