.profile-dashboard {
    --profile-accent: #8ac5ff;
    --profile-muted: #a6adb8;
    --profile-surface: #111317;
    --profile-border: #292d33;
    max-width: 1320px;
    padding: 40px 24px 64px;
}

.profile-dashboard [hidden] {
    display: none !important;
}

.profile-dashboard :focus-visible {
    outline: 2px solid var(--profile-accent);
    outline-offset: 4px;
}

.profile-page-heading,
.profile-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.profile-page-heading {
    padding-bottom: 28px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--profile-border);
}

.profile-eyebrow,
.profile-section-kicker {
    display: block;
    color: var(--profile-accent);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    line-height: 1.6;
}

.profile-page-heading h1 {
    margin: 8px 0;
    font-size: clamp(26px, 3vw, 34px);
    line-height: 1.25;
    letter-spacing: -.035em;
}

.profile-page-heading p,
.profile-muted {
    color: var(--profile-muted);
    font-size: 13px;
    line-height: 1.7;
}

.profile-back-link,
.profile-text-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    color: var(--profile-accent);
    font-size: 13px;
    text-decoration: none;
    flex-shrink: 0;
}

.profile-layout {
    display: grid;
    grid-template-columns: 204px minmax(0, 1fr);
    align-items: start;
    gap: 28px;
}

.profile-sidebar {
    position: sticky;
    top: calc(var(--navbar-height, 64px) + 24px);
    min-width: 0;
}

.profile-side-nav {
    padding: 8px;
    border: 1px solid var(--profile-border);
    border-radius: 12px;
    background: var(--profile-surface);
}

.profile-side-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--profile-muted);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.profile-side-nav a span {
    width: 16px;
    color: inherit;
    font-size: 18px;
    line-height: 1;
    text-align: center;
}

.profile-side-nav a:hover {
    color: var(--text-primary, #fff);
    background: #202329;
}

.profile-side-nav a.is-current {
    background: #edf4fb;
    color: #111827;
}

.profile-sidebar > p {
    margin: 16px 12px;
    color: var(--profile-muted);
    font-size: 11px;
    line-height: 1.8;
}

.profile-main {
    min-width: 0;
}

.profile-dashboard .account-panel {
    padding: 24px;
    margin-bottom: 20px;
    border-color: var(--profile-border);
    background: var(--profile-surface);
}

.profile-dashboard .account-identity {
    gap: 20px;
    min-height: 160px;
    border-top: 2px solid #557593;
}

.profile-dashboard .account-avatar {
    width: 80px;
    height: 80px;
    background: #1b252f;
    color: var(--profile-accent);
    border-color: #3b4e61;
    font-size: 30px;
}

.profile-dashboard .account-identity h2 {
    margin: 8px 0;
    color: var(--text-primary, #fff);
    font-size: 26px;
    line-height: 1.25;
    letter-spacing: -.025em;
}

.profile-dashboard .account-role {
    display: inline-block;
    padding: 2px 7px;
    background: #1b2027;
    border-color: #343c46;
    color: #b9c7d6;
    font-size: 9px;
}

.profile-dashboard .account-identity small {
    margin: 0;
    color: var(--profile-muted);
    font-size: 12px;
}

.profile-identity-caption {
    display: block;
    margin-top: 8px;
    color: var(--profile-muted);
    font-size: 11px;
}

.profile-dashboard .account-identity-actions,
.profile-public-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 0 0 auto;
    gap: 8px;
    max-width: 208px;
}

.profile-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid var(--profile-border);
    border-radius: 8px;
    background: #171b21;
    color: #e9edf3;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.profile-button:hover {
    border-color: #68798b;
    background: #212831;
}

.profile-dashboard .account-identity-actions .profile-button {
    color: #e9edf3;
    font-size: 12px;
}

.profile-button.profile-button-primary,
.profile-dashboard .account-identity-actions .profile-button-primary {
    border-color: #edf4fb;
    background: #edf4fb;
    color: #111827;
}

.profile-button.profile-button-primary:hover {
    border-color: #c7e1fa;
    background: #c7e1fa;
}

.profile-button:disabled {
    opacity: .6;
    cursor: wait;
}

.profile-load-state {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    margin-bottom: 20px;
    border: 1px solid var(--profile-border);
    border-radius: 8px;
    background: var(--profile-surface);
    color: var(--profile-muted);
    font-size: 13px;
    line-height: 1.7;
}

.profile-load-state[data-state="error"] {
    border-color: #75464e;
    color: #ffbcc6;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.profile-stat {
    min-width: 0;
    padding: 20px 16px;
    border: 1px solid var(--profile-border);
    border-radius: 10px;
    background: var(--profile-surface);
}

.profile-stat > span {
    display: block;
    color: #c4cbd4;
    font-size: 11px;
    line-height: 1.6;
}

.profile-stat > strong {
    display: block;
    margin: 12px 0 8px;
    font-size: clamp(23px, 2.5vw, 30px);
    line-height: 1;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.04em;
}

.profile-stat > small {
    display: block;
    color: var(--profile-muted);
    font-size: 10px;
    line-height: 1.6;
}

.profile-data-note {
    margin: -8px 0 24px;
    color: var(--profile-muted);
    font-size: 11px;
    line-height: 1.7;
}

.profile-resume-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin-bottom: 28px;
    padding: 24px;
    border: 1px solid #344657;
    border-radius: 10px;
    background: #101923;
}

.profile-resume-panel h2 {
    margin: 6px 0;
    font-size: 19px;
    line-height: 1.4;
    letter-spacing: -.02em;
}

.profile-resume-panel p {
    color: var(--profile-muted);
    font-size: 12px;
    line-height: 1.7;
}

.profile-resume-panel .profile-button {
    flex-shrink: 0;
}

.profile-section {
    margin-bottom: 28px;
    scroll-margin-top: 100px;
}

.profile-section-heading {
    margin-bottom: 16px;
}

.profile-section-heading h2 {
    margin: 4px 0 0;
    font-size: 19px;
    letter-spacing: -.02em;
    line-height: 1.5;
}

.profile-count {
    color: var(--profile-muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.profile-achievements {
    display: block;
}

.profile-dashboard .profile-identity {
    position: relative;
    isolation: isolate;
    border-radius: 16px;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.profile-dashboard .profile-identity::before {
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: radial-gradient(ellipse at 12% 0%, color-mix(in srgb, var(--pa-accent, #8ac5ff) 15%, transparent), transparent 65%);
    pointer-events: none;
    content: '';
}

.profile-dashboard .profile-identity:is(:hover, :focus-within) {
    border-color: var(--pa-accent, #8ac5ff);
    box-shadow: 0 12px 32px rgb(0 0 0 / 18%);
}

.profile-activity {
    overflow: hidden;
    border: 1px solid var(--profile-border);
    border-radius: 10px;
    background: var(--profile-surface);
}

.profile-activity-item {
    display: block;
    padding: 18px 20px;
    border-bottom: 1px solid var(--profile-border);
    color: inherit;
    text-decoration: none;
}

.profile-activity-item:last-child {
    border-bottom: 0;
}

a.profile-activity-item:hover {
    background: #1b2027;
}

.profile-activity-item p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    color: #d9dfe8;
    font-size: 13px;
    line-height: 1.8;
}

.profile-activity-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    color: var(--profile-muted);
    font-size: 11px;
}

.profile-activity-meta > span {
    color: var(--profile-accent);
}

.profile-empty {
    padding: 28px 24px;
    color: var(--profile-muted);
    font-size: 13px;
    line-height: 1.8;
}

.profile-empty strong {
    display: block;
    margin-bottom: 4px;
    color: #d9dfe8;
    font-size: 14px;
}

.profile-privacy-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.profile-privacy-row > div {
    max-width: 600px;
}

.profile-privacy-row > div > label {
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.profile-dashboard .profile-privacy-row p {
    margin: 6px 0 0;
    color: var(--profile-muted);
    font-size: 12px;
    line-height: 1.8;
}

.profile-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    flex: 0 0 44px;
    cursor: pointer;
}

.profile-switch input {
    position: absolute;
    z-index: 1;
    width: 44px;
    height: 44px;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.profile-switch input + span {
    position: relative;
    display: block;
    width: 42px;
    height: 24px;
    border: 1px solid #68798b;
    border-radius: 12px;
    background: #2c333d;
    pointer-events: none;
}

.profile-switch input + span::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e9edf3;
    content: "";
}

.profile-switch input:checked + span {
    border-color: #8ac5ff;
    background: #8ac5ff;
}

.profile-switch input:checked + span::after {
    left: 21px;
    background: #111827;
}

.profile-switch input:focus-visible + span {
    outline: 2px solid var(--profile-accent);
    outline-offset: 4px;
}

.profile-switch input:disabled + span {
    opacity: .5;
}

.profile-dashboard .profile-feedback {
    min-height: 20px;
    margin: 12px 0 0;
    color: var(--profile-muted);
    font-size: 11px;
    line-height: 1.7;
}

.profile-feedback[data-state="error"] {
    color: #ffbcc6;
}

.profile-credential {
    display: grid;
    gap: 8px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--profile-border);
}

.profile-credential > span {
    color: var(--profile-muted);
    font-size: 11px;
}

.profile-credential > strong {
    overflow-wrap: anywhere;
    font-size: 13px;
    font-weight: 500;
}

.profile-dashboard .account-provider-state {
    color: #c6ced8;
}

.profile-dashboard .account-provider-state.connected {
    color: #73dca1;
}

.profile-dashboard .account-signout {
    min-height: 44px;
    color: #ff9fae;
}

.profile-dashboard #contact-email-form .form-label {
    display: block;
    margin: 16px 0 8px;
}

.profile-dashboard #contact-email-form .form-input {
    max-width: 520px;
}

.profile-dashboard #contact-email-form button {
    margin-top: 20px;
}

.profile-guest {
    max-width: 640px;
    margin: 32px auto;
}

.profile-empty-icon {
    display: block;
    margin-bottom: 16px;
    color: var(--profile-accent);
    font-size: 32px;
}

.profile-public-page {
    max-width: 1160px;
}

.profile-public-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid var(--profile-border);
    border-radius: 8px;
    color: #bcc9d7;
    font-size: 11px;
}

.profile-public-label > span {
    color: #73dca1;
}

.profile-private-notice {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    margin-bottom: 28px;
    border: 1px solid var(--profile-border);
    border-radius: 10px;
    background: var(--profile-surface);
}

.profile-private-notice > span {
    color: var(--profile-accent);
    font-size: 28px;
}

.profile-private-notice strong {
    font-size: 13px;
}

.profile-private-notice p {
    margin-top: 4px;
    color: var(--profile-muted);
    font-size: 12px;
    line-height: 1.7;
}

@media (max-width: 1100px) {
    .profile-layout {
        grid-template-columns: 180px minmax(0, 1fr);
        gap: 20px;
    }

    .profile-dashboard .account-identity {
        flex-wrap: wrap;
    }

    .profile-dashboard .account-identity-actions,
    .profile-public-actions {
        flex-basis: 100%;
        flex-direction: row;
        max-width: none;
    }

    .profile-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .profile-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

    .profile-sidebar {
        position: static;
    }

    .profile-sidebar > p {
        display: none;
    }

    .profile-side-nav {
        display: flex;
        gap: 4px;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .profile-side-nav a {
        flex-shrink: 0;
    }
}

@media (max-width: 560px) {
    .profile-dashboard {
        padding: 24px 16px 48px;
    }

    .profile-page-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 20px;
        padding-bottom: 16px;
    }

    .profile-page-heading p {
        font-size: 12px;
    }

    .profile-dashboard .account-panel {
        padding: 20px;
    }

    .profile-dashboard .account-identity {
        gap: 16px;
    }

    .profile-dashboard .account-avatar {
        width: 64px;
        height: 64px;
        font-size: 25px;
    }

    .profile-dashboard .account-identity h2 {
        font-size: 22px;
    }

    .profile-identity-caption {
        display: none;
    }

    .profile-dashboard .account-identity-actions {
        flex-direction: column;
    }

    .profile-stat {
        padding: 16px 12px;
    }

    .profile-resume-panel {
        align-items: stretch;
        flex-direction: column;
        gap: 16px;
        padding: 20px;
    }

    .profile-achievements {
        grid-template-columns: minmax(0, 1fr);
    }

    .profile-section-heading {
        gap: 12px;
    }

    .profile-section-heading h2 {
        font-size: 18px;
    }

    .profile-count {
        max-width: 100px;
        text-align: right;
    }

    .profile-privacy-row {
        gap: 16px;
    }

    .profile-load-state {
        align-items: flex-start;
        flex-direction: column;
    }

    .profile-public-actions {
        flex-wrap: wrap;
    }
}
