.wbm-auth { position: relative; }

.wbm-auth__avatar {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--wb-soft), var(--wb-soft-2));
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}

.wbm-auth__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wbm-auth__menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 210px;
    display: grid;
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--wb-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 22px 70px rgba(65, 44, 132, 0.18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(.98);
    transition: opacity .16s ease, transform .16s ease, visibility 0s .16s;
    z-index: 320;
}

.wbm-auth.is-open .wbm-auth__menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    transition: opacity .16s ease, transform .16s ease;
}

.wbm-auth__menu a,
.wbm-auth__menu button {
    width: 100%;
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #2c2546;
    font: inherit;
    font-size: 13.5px;
    font-weight: 750;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.wbm-auth__menu a:hover,
.wbm-auth__menu button:hover {
    background: rgba(139, 92, 246, .09);
    color: #5b21e6;
}

.wb-auth__overlay {
    position: fixed;
    inset: 0;
    z-index: 700;
    background: rgba(19, 15, 36, .46);
    backdrop-filter: blur(8px);
}

.wb-auth__modal {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 710;
    width: min(430px, calc(100vw - 28px));
    max-height: calc(100vh - 28px);
    overflow: auto;
    transform: translate(-50%, -50%);
    padding: 22px;
    border: 1px solid rgba(113, 79, 236, .18);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 30px 100px rgba(32, 24, 67, .28);
}

.wb-auth__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: rgba(139, 92, 246, .08);
    color: #3a3354;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.wb-auth__head {
    display: flex;
    gap: 12px;
    align-items: center;
    padding-right: 34px;
}

.wb-auth__mark {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--wb-soft), var(--wb-soft-2));
    color: #fff;
    font-weight: 900;
}

.wb-auth__head h2 {
    margin: 0;
    color: #17132d;
    font-size: 22px;
    line-height: 1.15;
}

.wb-auth__head p,
.wb-auth__note {
    margin: 5px 0 0;
    color: #635d78;
    font-size: 13.5px;
    line-height: 1.45;
}

.wb-auth__tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 20px 0 14px;
    padding: 5px;
    border-radius: 14px;
    background: #f4efff;
}

.wb-auth__tab {
    min-height: 38px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #635d78;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.wb-auth__tab.is-active {
    background: #fff;
    color: #5b21e6;
    box-shadow: 0 8px 22px rgba(65, 44, 132, .10);
}

.wb-auth__view {
    display: none;
    gap: 12px;
}

.wb-auth__view.is-active { display: grid; }

.wb-auth__field {
    display: grid;
    gap: 6px;
    color: #3a3354;
    font-size: 13px;
    font-weight: 800;
}

.wb-auth__input {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.wb-auth__field .wb-auth__input > i {
    position: absolute;
    top: 50%;
    left: 12px;
    z-index: 1;
    transform: translateY(-50%);
    color: #7c6ba8;
    font-size: 16px;
    line-height: 1;
    pointer-events: none;
}

.wb-auth__field input {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(113, 79, 236, .20);
    border-radius: 12px;
    padding: 0 12px;
    background: #fff;
    color: #17132d;
    font: inherit;
    font-weight: 650;
    outline: none;
}

.wb-auth__input input {
    display: block;
    padding-left: 38px;
}

.wb-auth__field input:focus {
    border-color: rgba(139, 92, 246, .60);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, .10);
}

.wb-auth__check {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    color: #4d455f;
    font-size: 13px;
    line-height: 1.35;
}

.wb-auth__check input { margin-top: 2px; }

.wb-auth__submit {
    min-height: 46px;
    border: 0;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--wb-soft), var(--wb-soft-2));
    color: #fff;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(139, 92, 246, .24);
}

.wb-auth__submit:disabled {
    cursor: wait;
    opacity: .68;
}

.wb-auth__link {
    min-height: 34px;
    border: 0;
    background: transparent;
    color: #5b21e6;
    font: inherit;
    font-size: 13.5px;
    font-weight: 850;
    cursor: pointer;
}

.wb-auth__message {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(20, 184, 166, .10);
    color: #0f766e;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.35;
}

.wb-auth__message.is-error {
    background: rgba(239, 68, 68, .10);
    color: #b91c1c;
}

@media (max-width: 760px) {
    .wbm-auth__menu {
        left: 0;
        right: auto;
    }
}

.wb-history-empty {
    display: grid;
    gap: 12px;
    justify-items: start;
    padding: 16px;
    border: 1px solid rgba(113, 79, 236, .16);
    border-radius: 16px;
    background: rgba(255, 255, 255, .78);
    color: #3a3354;
}

.wb-recent-empty {
    width: 100%;
    padding: 16px;
    border: 1px solid rgba(113, 79, 236, .14);
    border-radius: 14px;
    background: rgba(255, 255, 255, .72);
    color: #3a3354;
    font-weight: 700;
}

.wb-history {
    width: min(100%, 1040px);
    max-width: 100%;
    margin: 18px auto 0;
    border: 1px solid rgba(113, 79, 236, .16);
    border-radius: 18px;
    background: rgba(255, 255, 255, .72);
    box-shadow: 0 16px 44px rgba(65, 44, 132, .08);
    overflow: hidden;
}

.wb-history,
.wb-history * {
    box-sizing: border-box;
}

.wb-history__head {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 16px;
    cursor: pointer;
    color: #17132d;
    font-weight: 900;
}

.wb-history__title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.wb-history__chev {
    transition: transform .16s ease;
}

.wb-history[open] .wb-history__chev {
    transform: rotate(180deg);
}

.wb-history__list {
    display: grid;
    gap: 8px;
    min-width: 0;
    padding: 0 14px 14px;
    overflow: hidden;
}

.fb-history {
    background: rgba(255, 255, 255, .78);
    border-color: rgba(113, 79, 236, .16);
}

.fb-history .wb-history__head {
    color: #17132d;
}

.wb-history-login,
.wb-history-filters button {
    min-height: 36px;
    min-width: 0;
    border: 0;
    border-radius: 11px;
    padding: 0 14px;
    background: linear-gradient(135deg, var(--wb-soft), var(--wb-soft-2));
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 850;
    cursor: pointer;
}

.wb-history-filters {
    display: grid;
    grid-template-columns: minmax(180px, 1.5fr) minmax(110px, .9fr) minmax(110px, .85fr) minmax(110px, .85fr) minmax(76px, auto) minmax(76px, auto);
    gap: 8px;
    min-width: 0;
    margin-bottom: 12px;
}

.wb-history-filters input {
    min-height: 38px;
    min-width: 0;
    border: 1px solid rgba(113, 79, 236, .18);
    border-radius: 11px;
    padding: 0 10px;
    background: #fff;
    color: #17132d;
    font: inherit;
    font-size: 13px;
    outline: none;
}

.wb-history-filters input:focus {
    border-color: rgba(139, 92, 246, .55);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, .10);
}

.wb-history-filters button[data-history-reset] {
    background: #f2ecff;
    color: #5b21e6;
}

.wb-history-card {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(113, 79, 236, .14);
    border-radius: 16px;
    background: rgba(255, 255, 255, .82);
}

.wb-history-card + .wb-history-card {
    margin-top: 8px;
}

.wb-history-card__image {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 0;
    border-radius: 14px;
    background: #f2ecff;
    color: #7c3aed;
    cursor: pointer;
}

.wb-history-card__image img,
.wb-history-card__photos img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wb-history-card__body {
    min-width: 0;
    display: grid;
    gap: 7px;
}

.wb-history-card__title {
    width: 100%;
    min-width: 0;
    border: 0;
    background: transparent;
    color: #17132d;
    font: inherit;
    font-size: 14px;
    font-weight: 850;
    line-height: 1.25;
    text-align: left;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.wb-history-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    color: #635d78;
    font-size: 12px;
}

.wb-history-card__meta span {
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(139, 92, 246, .08);
}

.wb-history-card__photos {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-height: 28px;
    min-width: 0;
    overflow: hidden;
}

.wb-history-card__photos img {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #f2ecff;
}

.wb-history-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 4px;
}

.wb-history-pagination__info {
    color: #635d78;
    font-size: 12px;
    font-weight: 750;
}

.wb-history-pagination button {
    min-height: 34px;
    border: 1px solid rgba(113, 79, 236, .16);
    border-radius: 10px;
    padding: 0 12px;
    background: #fff;
    color: #5b21e6;
    font: inherit;
    font-size: 13px;
    font-weight: 850;
    cursor: pointer;
}

.wb-history-pagination button:disabled {
    cursor: default;
    opacity: .45;
}

@media (max-width: 980px) {
    .wb-history-filters {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

@media (max-width: 720px) {
    .wb-history-filters {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 520px) {
    .wb-history-filters {
        grid-template-columns: 1fr;
    }

    .wb-history-card {
        grid-template-columns: 60px 1fr;
    }

    .wb-history-card__image {
        width: 60px;
        height: 60px;
    }
}

.wb-auth__check--remember {
    align-items: center;
    font-weight: 750;
}

.wb-auth__check--remember input {
    margin-top: 0;
}

@media (max-width: 680px) {
    .wbm-auth__menu {
        position: static;
        left: auto;
        right: auto;
        width: 100%;
        max-width: none;
        display: none;
        margin-top: 8px;
        padding: 7px;
        border-radius: 16px;
        background: #fbf9ff;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .wbm-auth.is-open .wbm-auth__menu {
        display: grid;
        transform: none;
    }
}
