#chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1080;
    font-family: inherit;
}

#chat-widget-toggle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: #f57f1f;
    color: #fff;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
    font-size: 26px;
    cursor: pointer;
    transition: transform 0.18s ease, background-color 0.18s ease;
}

#chat-widget-toggle:hover {
    transform: scale(1.06);
    background: #e0701b;
}

#chat-widget-panel {
    position: absolute;
    bottom: 84px;
    right: 0;
    width: 460px;
    max-width: calc(100vw - 32px);
    height: 640px;
    max-height: calc(100vh - 130px);
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-widget-header {
    background: #f57f1f;
    color: #fff;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-widget-brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-grow: 1;
}

.chat-widget-logo {
    height: auto;
    width: 50%;
    margin: 10px auto;
    display: block;
}

.chat-widget-header .chat-widget-subtitle {
    color: rgba(255, 255, 255, 0.92);
    text-align: center;
}

.chat-widget-header button {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    align-self: flex-start;
}

.chat-widget-header button:hover {
    opacity: 0.8;
}

.chat-widget-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px;
    background: #f7f7f7;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-widget-footer {
    border-top: 1px solid #e9e9e9;
    padding: 12px 14px;
    background: #fff;
}

.chat-widget-footer .form-control {
    border-radius: 999px;
    padding-left: 16px;
}

.chat-widget-footer .btn {
    border-radius: 999px;
    margin-left: 8px;
    padding: 8px 16px;
    background: #017f42;
    border-color: #017f42;
    color: #fff;
}

.chat-widget-footer .btn:hover,
.chat-widget-footer .btn:focus {
    background: #016436;
    border-color: #016436;
    color: #fff;
}

.chat-bubble {
    max-width: 88%;
    padding: 11px 14px;
    border-radius: 16px;
    margin-bottom: 4px;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.chat-bubble-bot {
    background: #fff;
    border: 1px solid #ececec;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-bubble-user {
    background: #f57f1f;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    margin-left: auto;
}

.chat-faq-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.chat-faq-category {
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #999;
    margin-top: 10px;
    margin-bottom: 2px;
    padding-left: 4px;
}

.chat-faq-item {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.chat-faq-item:hover {
    background: #fff7ee;
    border-color: #f57f1f;
}

.chat-faq-item:active {
    transform: scale(0.99);
}

.chat-faq-item .chat-faq-arrow {
    color: #f57f1f;
    font-size: 14px;
    flex-shrink: 0;
}

.chat-faq-answer-card {
    background: #fff;
    border: 1px solid #ececec;
    border-left: 4px solid #f57f1f;
    border-radius: 12px;
    padding: 14px 16px;
    margin-top: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.chat-faq-answer-question {
    font-weight: 600;
    font-size: 14px;
    color: #222;
    margin-bottom: 8px;
}

.chat-faq-answer-text {
    font-size: 14px;
    color: #444;
    line-height: 1.5;
    white-space: pre-wrap;
}

.chat-faq-back {
    margin-top: 10px;
    background: #fff;
    border: 1px solid #f57f1f;
    color: #f57f1f;
    border-radius: 999px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chat-faq-back:hover {
    background: #f57f1f;
    color: #fff;
}

.chat-operator-cta {
    background: #fff7ee;
    border: 1px dashed #f57f1f;
    color: #b95a10;
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    font-weight: 500;
    text-align: center;
    margin-top: 14px;
    transition: background-color 0.15s ease;
}

.chat-operator-cta:hover {
    background: #ffe9d3;
}

.chat-operator-cta.wa {
    background: #08c60820;
    border: 1px dashed #08c608;
    color: #0a910a;
}

.chat-operator-cta.wa:hover {
    background: #08c60840;
}

.chat-success-icon {
    font-size: 44px;
    color: #2e7d32;
    text-align: center;
    margin: 14px 0 6px;
}

.chat-success-actions {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

.chat-success-actions .btn {
    border-radius: 999px;
    padding: 8px 18px;
}

.chat-error {
    color: #c62828;
    font-size: 13px;
    margin-top: 4px;
    padding: 0 4px;
}

@media (max-width: 540px) {
    #chat-widget {
        bottom: 16px;
        right: 16px;
    }

    #chat-widget-panel {
        width: calc(100vw - 24px);
        height: calc(100vh - 110px);
        right: 0;
        bottom: 80px;
    }
}
