.faq-widget {
    position: fixed;
    right: clamp(14px, 2vw, 28px);
    bottom: 18px;
    z-index: 80;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.faq-widget__button {
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 50%;
    background: #0ea5e9;
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(14, 165, 233, 0.36);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: transform 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.faq-widget__button:hover,
.faq-widget__button:focus-visible {
    background: #0284c7;
    box-shadow: 0 12px 28px rgba(2, 132, 199, 0.42);
    transform: translateY(-1px);
    outline: none;
}

.faq-widget__panel {
    position: absolute;
    right: 0;
    bottom: 68px;
    width: min(360px, calc(100vw - 28px));
    max-height: min(620px, calc(100vh - 110px));
    background: #ffffff;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.24);
    overflow: hidden;
    display: none;
}

.faq-widget--open .faq-widget__panel {
    display: flex;
    flex-direction: column;
}

.faq-widget__header {
    min-height: 50px;
    padding: 12px 14px;
    background: linear-gradient(to right, #52a0fd 0%, #00d7ef 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.faq-widget__back,
.faq-widget__close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.faq-widget__back:hover,
.faq-widget__close:hover,
.faq-widget__back:focus-visible,
.faq-widget__close:focus-visible {
    background: rgba(255, 255, 255, 0.28);
    outline: none;
}

.faq-widget__back[hidden] {
    display: none;
}

.faq-widget__title {
    flex: 1;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    min-width: 0;
}

.faq-widget__body {
    padding: 12px;
    overflow-y: auto;
}

.faq-widget__lead {
    margin: 0 0 10px;
    color: #334155;
    font-size: 13px;
    line-height: 1.5;
}

.faq-widget__list {
    display: grid;
    gap: 8px;
}

.faq-widget__item {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #d7ecff;
    border-radius: 8px;
    background: #f8fcff;
    color: #0f172a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
    text-align: left;
}

.faq-widget__item:hover,
.faq-widget__item:focus-visible {
    border-color: #38bdf8;
    background: #eff9ff;
    outline: none;
}

.faq-widget__item i {
    color: #0284c7;
    flex: 0 0 auto;
}

.faq-widget__answer-question {
    margin: 0 0 10px;
    color: #0f172a;
    font-size: 14px;
    line-height: 1.55;
    font-weight: 700;
}

.faq-widget__answer-text {
    margin: 0;
    color: #334155;
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-line;
}

.faq-widget__footer {
    padding: 10px 12px 12px;
    border-top: 1px solid #e0f2fe;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.faq-widget__help {
    margin-top: 16px;
    display: grid;
    gap: 8px;
}

.faq-widget__help-heading {
    margin: 16px 0 8px;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.faq-widget__link {
    min-height: 38px;
    padding: 9px 10px;
    border-radius: 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

.faq-widget__link--faq {
    color: #0369a1;
    background: #e0f2fe;
}

.faq-widget__link--contact,
.faq-widget__link--support {
    color: #ffffff;
    background: #ef4444;
}

.faq-widget__link:hover,
.faq-widget__link:focus-visible {
    filter: brightness(0.96);
    outline: none;
}

@media screen and (max-width: 420px) {
    .faq-widget {
        right: 12px;
        bottom: 14px;
    }

    .faq-widget__button {
        width: 52px;
        height: 52px;
        font-size: 22px;
    }

    .faq-widget__panel {
        bottom: 64px;
        max-height: calc(100vh - 92px);
    }
}
