.profile-page .auth-bar {
    height: 3.5rem;
    padding-inline: 1rem;
}

.profile-page .auth-brand-link img {
    height: 2.25rem;
}

.profile-brand {
    display: none;
    font-size: 0.875rem;
    font-weight: 700;
}

.profile-links {
    display: none;
    align-items: center;
    gap: 0.125rem;
    flex: 1;
    min-width: 0;
    margin-inline: 0.5rem;
    overflow-x: auto;
}

.profile-links a,
.profile-menu-panel a {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.625rem;
    border-radius: 0.375rem;
    color: hsl(var(--muted));
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.profile-links a:hover,
.profile-menu-panel a:hover {
    color: hsl(var(--fg));
    background: hsl(var(--accent));
}

.profile-end {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-inline-start: auto;
}

.profile-name {
    display: none;
    max-width: 7.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.75rem;
    color: hsl(var(--muted));
}

.profile-name:hover {
    color: hsl(var(--fg));
}

.profile-logout-form {
    display: none;
}

.profile-page a.profile-signin {
    display: none;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    color: hsl(var(--p));
    font-size: 0.75rem;
    font-weight: 600;
}

.profile-page a.profile-signin:hover {
    background: hsl(var(--accent));
}

.profile-links a[aria-current="page"],
.profile-menu-panel a[aria-current="page"] {
    color: hsl(var(--fg));
    background: hsl(var(--accent));
    font-weight: 600;
}

.profile-page button.profile-logout,
.profile-page button.profile-signout {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border: 0;
    background: transparent;
    color: hsl(var(--fg));
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

.profile-page button.profile-logout:hover,
.profile-page button.profile-signout:hover {
    background: hsl(var(--accent));
}

.profile-page button.profile-signout {
    width: 100%;
    justify-content: flex-start;
    padding: 0.625rem 1rem;
    color: hsl(0 72% 51%);
    font-size: 0.875rem;
}

.profile-menu {
    position: static;
}

.profile-menu summary {
    display: inline-flex;
    align-items: center;
    list-style: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    color: hsl(var(--fg));
}

.profile-menu summary::-webkit-details-marker {
    display: none;
}

.profile-menu summary:hover,
.profile-menu[open] summary {
    background: hsl(var(--accent));
}

.profile-menu .menu-close {
    display: none;
}

.profile-menu[open] .menu-icon {
    display: none;
}

.profile-menu[open] .menu-close {
    display: block;
}

.profile-menu-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: 3.5rem;
    z-index: 40;
    display: grid;
    gap: 0.125rem;
    padding: 0.75rem;
    background: hsl(var(--bg));
    border-top: 1px solid hsl(var(--line));
}

.profile-menu-panel a {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
}

.profile-menu-panel .glyph {
    font-size: 1rem;
}

.profile-menu-foot {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid hsl(var(--line));
}

.profile-wrap {
    width: 100%;
    max-width: 42rem;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

.profile-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.profile-title .glyph,
.profile-card h2 .glyph,
.profile-page button.auth-submit .glyph {
    font-size: 1.25rem;
}

.profile-card h2 .glyph {
    font-size: 1.25rem;
}

.profile-card {
    margin-bottom: 1.5rem;
    background: white;
    border: 1px solid hsl(var(--line));
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
}

.profile-identity {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem 1.5rem;
}

.profile-avatar-form {
    margin: 0;
}

.profile-avatar {
    position: relative;
    width: 6rem;
    height: 6rem;
}

.profile-avatar img,
.profile-fallback {
    width: 6rem;
    height: 6rem;
    border-radius: 9999px;
    object-fit: cover;
}

.profile-fallback {
    display: grid;
    place-items: center;
    background: hsl(var(--p) / 0.1);
    color: hsl(var(--p));
    font-size: 1.25rem;
    font-weight: 700;
}

.profile-avatar-hit {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgb(0 0 0 / 0.4);
    color: white;
    opacity: 0;
    cursor: pointer;
    transition: opacity 0.15s;
}

.profile-avatar:hover .profile-avatar-hit,
.profile-avatar:focus-within .profile-avatar-hit {
    opacity: 1;
}

.profile-avatar-hit .glyph {
    font-size: 1.5rem;
}

.profile-avatar-hit input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.profile-who {
    text-align: center;
}

.profile-page p.profile-person {
    font-size: 1.125rem;
    font-weight: 600;
}

.profile-page p.profile-mail,
.profile-page p.profile-outside {
    color: hsl(var(--muted));
    font-size: 0.875rem;
}

.profile-page p.profile-outside {
    margin-top: 0.25rem;
    font-size: 0.75rem;
}

.profile-count {
    display: block;
    color: hsl(var(--muted));
    font-size: 0.75rem;
    font-weight: 400;
    text-align: left;
}

.profile-roles {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.375rem;
    margin-top: 0.5rem;
}

.profile-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    background: hsl(var(--accent));
    color: hsl(var(--fg));
    font-size: 0.75rem;
    font-weight: 600;
}

.profile-card h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 1.5rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.profile-form {
    display: grid;
    gap: 1rem;
    padding: 0 1.5rem 1.5rem;
}

.profile-grid {
    display: grid;
    gap: 1rem;
}

.profile-form label {
    display: grid;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.profile-form input,
.profile-form select,
.profile-form textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid hsl(var(--line));
    border-radius: 0.5rem;
    background: white;
    color: inherit;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 400;
    outline: none;
}

.profile-form textarea {
    min-height: 4.5rem;
    resize: vertical;
}

.profile-form input:focus,
.profile-form select:focus,
.profile-form textarea:focus {
    border-color: transparent;
    box-shadow: 0 0 0 2px hsl(var(--p));
}

.profile-form .auth-password input {
    padding-left: 2.5rem;
}

.profile-page button.auth-submit {
    width: 100%;
}

.profile-page button.auth-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.profile-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (hover: none) {
    .profile-avatar-hit {
        opacity: 1;
    }
}

@media (min-width: 640px) {
    .profile-brand {
        display: inline;
    }

    .profile-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 768px) {
    .profile-links,
    .profile-logout-form,
    .profile-page a.profile-signin {
        display: flex;
    }

    .profile-name {
        display: inline-block;
    }

    .profile-menu {
        display: none;
    }
}
