/* ==========================================================================
   User Profile Modal
   ========================================================================== */

.wt-upm-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 450;
    background: rgba(10, 5, 8, .6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    align-items: flex-end;
    justify-content: center;
}
.wt-upm-backdrop--open { display: flex; }

.wt-upm-modal {
    background: var(--white);
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 520px;
    overflow: hidden;
    animation: wtUpmUp .28s cubic-bezier(.4, 0, .2, 1);
}

@keyframes wtUpmUp {
    from { transform: translateY(32px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── Sliding panels ── */
.wt-upm-clip {
    overflow: hidden;
}

.wt-upm-track {
    display: flex;
    width: 300%;
    transition: transform .28s cubic-bezier(.4, 0, .2, 1);
}
.wt-upm-track--config {
    transform: translateX(-33.333333%);
}
.wt-upm-track--notifications {
    transform: translateX(-66.666667%);
}

.wt-upm-panel {
    width: 33.333333%;
    flex-shrink: 0;
    padding: 20px 20px 28px;
    box-sizing: border-box;
}

/* ── Close button ── */
.wt-upm-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--gray-100);
    cursor: pointer;
    margin-left: auto;
    margin-bottom: 16px;
    color: var(--gray-500);
    transition: background .15s, color .15s;
}
.wt-upm-close:hover { background: var(--gray-200); color: var(--gray-800); }
.wt-upm-close svg   { width: 16px; height: 16px; }

/* ── Header: avatar + info ── */
.wt-upm-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.wt-upm-avatar-wrap {
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
    width: 100px;
    height: 100px;
}

.wt-upm-avatar {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
    background: var(--gray-100);
    display: block;
}

.wt-upm-avatar-edit {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s;
}

.wt-upm-avatar-wrap:hover .wt-upm-avatar-edit {
    opacity: 1;
}

.wt-upm-avatar-edit svg {
    width: 22px;
    height: 22px;
    color: var(--white);
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.4));
}

@media (hover: none) {
    .wt-upm-avatar-edit {
        opacity: 1;
        background: rgba(0, 0, 0, .3);
    }
}

.wt-upm-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.wt-upm-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wt-upm-login {
    font-size: .82rem;
    color: var(--gray-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Separator ── */
.wt-upm-sep {
    height: 1px;
    background: var(--gray-100);
    margin: 0 -20px 8px;
}

/* ── Menu list ── */
.wt-upm-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wt-upm-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    color: var(--gray-800);
    text-decoration: none;
    border-radius: 8px;
    transition: background .15s;
    box-sizing: border-box;
}
.wt-upm-item:hover { background: var(--gray-50); }

.wt-upm-item--danger         { color: #dc2626; }
.wt-upm-item--danger:hover   { background: #fff5f5; }

.wt-upm-item__icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: var(--gray-500);
}
.wt-upm-item--danger .wt-upm-item__icon { color: #ef4444; }

.wt-upm-item__label {
    flex: 1;
    text-align: left;
    font-size: .97rem;
    font-weight: 500;
}

.wt-upm-item__chev {
    width: 16px;
    height: 16px;
    color: var(--gray-300);
    flex-shrink: 0;
}

/* ── Config panel topbar ── */
.wt-upm-config-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.wt-upm-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--gray-600);
    flex-shrink: 0;
    transition: background .15s;
}
.wt-upm-back:hover { background: var(--gray-100); }
.wt-upm-back svg   { width: 18px; height: 18px; }

.wt-upm-config-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
}

.wt-upm-notification-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 6px;
}

.wt-upm-notification-card__copy {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 4px;
}

.wt-upm-notification-card__copy strong {
    color: var(--gray-900);
    font-size: .97rem;
    font-weight: 650;
}

.wt-upm-notification-card__copy span {
    color: var(--gray-500);
    font-size: .8rem;
    line-height: 1.4;
}

.wt-upm-switch {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    cursor: pointer;
}

.wt-upm-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.wt-upm-switch__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.wt-upm-switch__control {
    position: relative;
    display: block;
    width: 48px;
    height: 28px;
    border-radius: 999px;
    background: var(--gray-200);
    transition: background .18s ease, opacity .18s ease;
}

.wt-upm-switch__control::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 2px 7px rgba(0, 0, 0, .2);
    transition: transform .18s ease;
}

.wt-upm-switch input:checked + .wt-upm-switch__control {
    background: var(--fuchsia-500, #e0007a);
}

.wt-upm-switch input:checked + .wt-upm-switch__control::after {
    transform: translateX(20px);
}

.wt-upm-switch input:focus-visible + .wt-upm-switch__control {
    outline: 3px solid rgba(224, 0, 122, .2);
    outline-offset: 2px;
}

.wt-upm-switch input:disabled + .wt-upm-switch__control {
    opacity: .55;
    cursor: wait;
}

.wt-upm-notification-status {
    min-height: 20px;
    margin: 2px 6px 0;
    color: var(--gray-500);
    font-size: .78rem;
}

.wt-upm-notification-status.is-success { color: #15803d; }
.wt-upm-notification-status.is-error { color: #dc2626; }

/* ── Mobile: full screen ── */
@media (max-width: 620px) {
    .wt-upm-backdrop {
        align-items: flex-start;
    }

    .wt-upm-modal {
        position: fixed;
        inset: 0;
        border-radius: 0;
        max-width: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .wt-upm-clip { overflow: hidden; }

    .wt-upm-panel {
        padding: 28px 18px 32px;
    }

    .wt-upm-sep { margin: 0 -18px 8px; }
}

/* ── Desktop: centered card ── */
@media (min-width: 621px) {
    .wt-upm-backdrop {
        align-items: center;
        justify-content: center;
        padding: 24px;
    }

    .wt-upm-modal {
        border-radius: 16px;
        width: 380px;
        max-width: calc(100vw - 48px);
    }
}
