.qa-widget-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #4C4C4C;
    color: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-sizing: border-box;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.qa-widget-toggle:hover {
    background: #5E5E5E;
}

.qa-widget-toggle:focus {
    outline: none;
    background: #4C4C4C;
}

.qa-widget-toggle:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.qa-widget-toggle:focus:hover {
    background: #5E5E5E;
}

.qa-widget-panel {
    position: fixed;
    bottom: 92px;
    right: 24px;
    width: 360px;
    max-width: calc(100vw - 48px);
    height: 70vh;
    max-height: 640px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    box-sizing: border-box;
    min-width: 0;

    /* Animation for expanding widget panel. */
    display: flex;
    opacity: 0;
    transform: translateY(12px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

    /* Spinner to indicate load times. */

.qa-widget-panel.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.qa-widget-spinner-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.qa-widget-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #999;
    border-radius: 50%;
    animation: qa-widget-spin 0.7s linear infinite;
}

@keyframes qa-widget-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Header of widget panel with title and subtitle. */

.qa-widget-header {
    padding: 10px 16px;
    background: #7FA6C4;
    color: #fff;
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.qa-widget-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.qa-widget-header-title {
    font-weight: 700;
    font-size: 16px;
}

.qa-widget-header-subtitle {
    font-weight: 400;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
}

.qa-widget-close {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: background 0.15s ease;
}

.qa-widget-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.qa-widget-body {
    padding: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-width: 0;
}

.qa-widget-question-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    background: #f2f2f2;
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.4;
    letter-spacing: normal;
    cursor: pointer;
    color: #222;
    white-space: normal;
    overflow-wrap: break-word;
    height: auto;
    font-weight: normal;
    text-transform: none;
    transition: transform 0.35s ease, box-shadow 0.35s ease, background 0.35s ease;
}

.qa-widget-question-btn:hover {
    background: #e6e6e6;
    color: #222;
    transform: scale(1.03);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.qa-widget-answer {
    margin-bottom: 12px;
    font-size: 14px;
    color: #222;
    display: none;
    overflow-wrap: break-word;
}

.qa-widget-answer.is-visible {
    display: block;
}

.qa-widget-back-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 13px;
    font-weight: normal;
    cursor: pointer;
    padding: 0 0 12px;
    text-decoration: none;
    text-transform: none;
}

.qa-widget-back-btn:hover {
    background: none;
    color: #666;
    text-decoration: underline;
}
