/* ── Обёртка виджета ── */
.sw {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 7000;
}

/* ── Анимация пульсирующих колец ── */
@keyframes sw-ring {
    0%   { transform: scale(1);   opacity: .55; }
    100% { transform: scale(1.9); opacity: 0;   }
}

.sw__toggle::before,
.sw__toggle::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(126, 157, 255, .35);
    animation: sw-ring 2s ease-out infinite;
    pointer-events: none;
}

.sw__toggle::after {
    animation-delay: .75s;
}

/* ── FAB-кнопка ── */
.sw__toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #7e9dff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
    transition: transform .2s ease, filter .2s ease;
    position: relative;
    z-index: 1;
}

.sw__toggle:hover {
    transform: scale(1.08);
    filter: brightness(1.1);
}

.sw__toggle svg {
    width: 24px;
    height: 24px;
    fill: #fff;
    color: #fff;
    position: relative;
    z-index: 1;
}

.sw__toggle svg path {
    fill: #fff;
}

/* ── Панель ── */
.sw__panel {
    position: absolute;
    bottom: calc(56px + 12px);
    right: 0;
    width: 360px;
    max-width: calc(100vw - 32px);
    max-height: min(640px, 100vh - 40px);
    border-radius: 16px;
    background: radial-gradient(ellipse 200% 180% at 105% -5%, rgba(126, 157, 255, .25) 0%, rgba(126, 157, 255, .1) 40%, transparent 70%), #121821;
    border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(10px) scale(.97);
    pointer-events: none;
    transition: opacity .25s ease, transform .25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sw__panel.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* ── Шапка ── */
.sw__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: 14px 16px 6px;
    flex-shrink: 0;
    background: transparent;
}

.sw__title {
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
    letter-spacing: .01em;
}

.sw__close {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, .5);
    flex-shrink: 0;
    transition: background .18s ease, color .18s ease;
    padding: 0;
}

.sw__close svg {
    width: 16px;
    height: 16px;
}

.sw__close:hover {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

/* ── Тело ── */
.sw__body {
    padding: 0 16px 16px;
    flex: 1;
    overflow-y: auto;
}

.sw__description {
    font-size: .875rem;
    color: rgba(255, 255, 255, .6);
    line-height: 1.55;
    margin: 0 0 16px;
}

/* ── Разделитель ── */
.sw__divider {
    height: 1px;
    background: rgba(255, 255, 255, .07);
    margin: 0 0 16px;
}

/* ── Авторизация (не залогинен) ── */
.sw__auth-hint {
    font-size: .875rem;
    color: rgba(255, 255, 255, .55);
    margin: 0 0 12px;
    line-height: 1.5;
}

/* ── Кнопка Steam ── */
.sw__btn-steam {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    border-radius: 12px;
    background: #7e9dff;
    border: none;
    cursor: pointer;
    color: #fff;
    font-size: .9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: background .2s ease, transform .2s ease;
}

.sw__btn-steam:hover {
    background: #6a8ef0;
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}

.sw__btn-steam svg {
    width: 20px;
    height: 20px;
    fill: #fff;
    flex-shrink: 0;
}

/* ── Кнопка "Написать в поддержку" (залогинен) ── */
.sw__btn-support {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 11px 16px;
    border-radius: 12px;
    background: #7e9dff;
    border: none;
    cursor: pointer;
    color: #fff;
    font-size: .9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: background .2s ease, transform .2s ease;
}

.sw__btn-support:hover {
    background: #6a8ef0;
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}

/* ── FAQ ── */
.sw__faq-label {
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .35);
    text-align: center;
    margin: 0 0 8px;
}

.sw__accordion {
    display: grid;
    gap: 4px;
    margin: 0 0 16px;
}

.sw__accordion .acc__item {
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 10px;
    overflow: hidden;
    transition: background .2s ease, border-color .2s ease;
}

.sw__accordion .acc__item[open] {
    background: rgba(126, 157, 255, .07);
    border-color: rgba(126, 157, 255, .2);
}

.sw__accordion .acc__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: 11px 12px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    font-size: .8125rem;
    font-weight: 500;
    color: rgba(255, 255, 255, .75);
    transition: color .2s ease;
}

.sw__accordion .acc__summary::-webkit-details-marker { display: none; }
.sw__accordion .acc__summary:focus { outline: none; }

.sw__accordion .acc__item[open] > .acc__summary {
    color: #7e9dff;
}

.sw__accordion .acc__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, .3);
    transition: transform .25s ease, color .2s ease;
}

.sw__accordion .acc__icon svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    fill: none;
}

.sw__accordion .acc__item[open] > .acc__summary .acc__icon {
    transform: rotate(90deg);
    color: #7e9dff;
}

.sw__accordion .acc__body-wrap {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .3s ease;
}

.sw__accordion .acc__item.is-open .acc__body-wrap {
    grid-template-rows: 1fr;
}

.sw__accordion .acc__body {
    overflow: hidden;
    padding: 0 12px;
    font-size: .8125rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, .5);
    transition: padding .3s ease;
}

.sw__accordion .acc__item.is-open .acc__body {
    padding: 0 12px 11px;
}

.sw__accordion .acc__body a {
    color: #7e9dff;
    text-decoration: none;
}

.sw__accordion .acc__body a:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .sw__panel {
        width: calc(100vw - 32px);
    }
}
