/* Discord-inspired member card; colors come from the member's own palette. */
html.pp-open,
html.pp-open body {
    overflow: hidden;
    overscroll-behavior: none;
}

#profile-preview.pp-dialog {
    --pp-surface: #111317;
    --pp-raised: #181c22;
    --pp-border: #2a3038;
    --pp-muted: #a6b0be;
    --pp-accent: #8ac5ff;
    box-sizing: border-box;
    width: calc(100% - 32px);
    max-width: 460px;
    max-height: calc(100dvh - 40px);
    margin: auto;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--pp-border);
    border-radius: 20px;
    background: var(--pp-surface);
    color: var(--pa-text, #eef2f7);
    box-shadow: 0 24px 80px rgb(0 0 0 / 50%), 0 0 0 4px rgb(255 255 255 / 3%);
    font: inherit;
    font-size: 13px;
    line-height: 1.6;
    color-scheme: dark;
}

#profile-preview.pp-dialog[open] {
    display: flex;
    flex-direction: column;
}

#profile-preview.pp-dialog:not([open]),
#profile-preview [hidden] {
    display: none !important;
}

#profile-preview::backdrop {
    background: rgb(0 0 0 / 65%);
    backdrop-filter: blur(5px);
}

#profile-preview *,
#profile-preview *::before,
#profile-preview *::after {
    box-sizing: border-box;
}

#profile-preview :is(a, button, [tabindex]):focus-visible {
    outline: 2px solid var(--pp-accent);
    outline-offset: 3px;
}

#profile-preview .pp-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: 2px 8px 2px 20px;
}

#profile-preview #pp-title {
    color: var(--pp-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

#profile-preview .pp-close {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 180ms ease;
}

#profile-preview .pp-close:hover {
    background: var(--pp-raised);
}

#profile-preview .pp-body {
    min-width: 0;
    min-height: 0;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--pp-border) transparent;
    -webkit-overflow-scrolling: touch;
}

#profile-preview .pp-banner {
    position: relative;
    height: 112px;
    margin: 0 8px;
    overflow: hidden;
    isolation: isolate;
    border-radius: 12px 12px 4px 4px;
    background: linear-gradient(125deg, color-mix(in srgb, var(--pp-accent) 44%, var(--pp-surface)), var(--pp-surface));
}

#profile-preview .pp-banner::before {
    position: absolute;
    inset: -40%;
    z-index: -1;
    background: radial-gradient(ellipse at var(--pp-light-x, 45%) var(--pp-light-y, 45%), color-mix(in srgb, var(--pp-accent) 55%, transparent), transparent 55%);
    content: '';
}

#profile-preview .pp-banner::after {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, var(--pp-accent) 1px, transparent 1px);
    background-size: 16px 16px;
    mask-image: linear-gradient(110deg, transparent 30%, #000);
    opacity: .18;
    content: '';
}

#profile-preview .pp-banner-orbit {
    position: absolute;
    width: 220px;
    height: 220px;
    top: -120px;
    right: 30px;
    border: 1px solid color-mix(in srgb, var(--pp-accent) 50%, transparent);
    border-radius: 50%;
    box-shadow: 0 0 0 24px color-mix(in srgb, var(--pp-accent) 7%, transparent), 0 0 0 48px color-mix(in srgb, var(--pp-accent) 5%, transparent);
    transform: translate(var(--pp-orbit-x, 0px), var(--pp-orbit-y, 0px));
}

#profile-preview .pp-banner-star {
    position: absolute;
    top: 12px;
    right: 40px;
    color: var(--pp-accent);
    font-size: 44px;
    opacity: .8;
}

#profile-preview .pp-banner-wordmark {
    position: absolute;
    bottom: 14px;
    right: 20px;
    color: var(--pp-accent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .3em;
    opacity: .75;
}

#profile-preview .pp-identity {
    position: relative;
    padding: 0 24px 12px;
}

#profile-preview .pp-avatar-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
    margin-top: -34px;
    margin-bottom: 16px;
}

#profile-preview .pp-avatar {
    position: relative;
    display: flex;
    flex: 0 0 88px;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    overflow: hidden;
    border: 5px solid var(--pp-surface);
    border-radius: 50%;
    background: var(--pp-raised);
    color: var(--pp-accent);
    box-shadow: 0 0 0 1px var(--pp-border);
    font-size: 30px;
    font-weight: 700;
}

#profile-preview .pp-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#profile-preview .pp-badge-shelf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 252px;
    min-height: 44px;
    padding: 6px 8px;
    border: 1px solid var(--pp-border);
    border-radius: 9px;
    background: var(--pp-raised);
    cursor: pointer;
    transition: border-color 180ms ease, background-color 180ms ease;
}

#profile-preview .pp-badge-shelf:hover {
    border-color: var(--pp-accent);
    background: color-mix(in srgb, var(--pp-accent) 9%, var(--pp-surface));
}

#profile-preview .pp-name {
    margin: 0;
    color: inherit;
    font-size: 24px;
    font-weight: 750;
    line-height: 1.3;
    letter-spacing: -.03em;
    overflow-wrap: anywhere;
}

#profile-preview .pp-username {
    margin: 4px 0 0;
    color: var(--pp-muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

#profile-preview .pp-identity-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 12px;
    margin-top: 8px;
}

#profile-preview .pp-role {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 3px 9px;
    border: 1px solid var(--pp-border);
    border-radius: 6px;
    color: var(--pp-accent);
    font-size: 11px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

#profile-preview .pp-role::before {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    content: '';
}

#profile-preview .pp-owner-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--pp-accent);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
}

#profile-preview .pp-owner-link:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

#profile-preview .pp-tabs {
    display: flex;
    gap: 24px;
    margin: 0 24px 20px;
    border-bottom: 1px solid var(--pp-border);
}

#profile-preview .pp-tabs button {
    min-height: 44px;
    padding: 8px 0 12px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--pp-muted);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: color 180ms ease, border-color 180ms ease;
}

#profile-preview .pp-tabs button:hover,
#profile-preview .pp-tabs button[aria-selected="true"] {
    border-bottom-color: var(--pp-accent);
    background: transparent;
    color: var(--pa-text, #eef2f7);
}

#profile-preview .pp-panel {
    min-width: 0;
    margin: 0 24px 24px;
    outline-offset: 4px;
}

#profile-preview .pp-member-since {
    margin-bottom: 16px;
}

#profile-preview .pp-section-label {
    color: var(--pp-muted);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .07em;
}

#profile-preview .pp-meta {
    margin: 4px 0 0;
    color: inherit;
    font-size: 13px;
}

#profile-preview .pp-collection-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

#profile-preview .pp-collection-count {
    color: var(--pp-muted);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
}

#profile-preview .achievement-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

#profile-preview .achievement-badge {
    justify-content: center;
    min-height: 84px;
}

#profile-preview .achievement-mini-more {
    color: var(--pp-muted);
    font-size: 11px;
    font-weight: 600;
}

#profile-preview .pp-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--pp-border);
    border-radius: 12px;
    background: var(--pp-raised);
}

#profile-preview .pp-stat {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 4px;
    padding: 14px 16px;
}

#profile-preview .pp-stat:nth-child(even) {
    border-left: 1px solid var(--pp-border);
}

#profile-preview .pp-stat:nth-child(n+3) {
    border-top: 1px solid var(--pp-border);
}

#profile-preview .pp-stat-value {
    color: inherit;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

#profile-preview .pp-stat-label,
#profile-preview .pp-note {
    color: var(--pp-muted);
    font-size: 11px;
    overflow-wrap: anywhere;
}

#profile-preview .pp-note {
    margin: 12px 0 0;
    line-height: 1.8;
}

#profile-preview .pp-privacy {
    margin: 0;
    padding: 16px;
    border: 1px solid var(--pp-border);
    border-radius: 12px;
    background: var(--pp-raised);
    color: var(--pp-muted);
    font-size: 12px;
    line-height: 1.8;
}

#profile-preview .pp-status {
    margin: 0;
    padding: 40px 24px;
    color: var(--pp-muted);
    text-align: center;
    overflow-wrap: anywhere;
}

#profile-preview .pp-error-title,
#profile-preview .pp-loading-line {
    margin: 0;
    color: inherit;
    font-size: 16px;
    font-weight: 600;
}

#profile-preview .pp-retry {
    min-height: 44px;
    margin-top: 16px;
    padding: 10px 20px;
    border: 1px solid var(--pp-border);
    border-radius: 8px;
    background: var(--pp-accent);
    color: var(--pa-on-accent, #132234);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 359px) {
    #profile-preview.pp-dialog {
        width: calc(100% - 16px);
        border-radius: 16px;
    }

    #profile-preview .pp-identity {
        padding-right: 16px;
        padding-left: 16px;
    }

    #profile-preview :is(.pp-tabs, .pp-panel) {
        margin-right: 16px;
        margin-left: 16px;
    }

    #profile-preview .pp-avatar-row {
        gap: 12px;
    }

    #profile-preview .achievement-mini .achievement-art {
        width: 20px;
        height: 20px;
    }

    #profile-preview .pp-stat {
        padding: 12px;
    }
}

@media (max-height: 480px) {
    #profile-preview.pp-dialog {
        max-height: calc(100dvh - 16px);
    }
}

@media (min-height: 600px) and (max-height: 800px) {
    #profile-preview .pp-banner {
        height: 80px;
    }

    #profile-preview .pp-avatar-row {
        margin-bottom: 12px;
    }

    #profile-preview .achievement-badge {
        gap: 6px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    #profile-preview .achievement-badge .achievement-art {
        width: 48px;
        height: 48px;
    }

    #profile-preview .achievement-detail {
        min-height: 112px;
        margin-top: 12px;
        padding: 12px;
    }
}
