/* My Profile — the signed-in user's own page.
 *
 * Keyed on the --app-* tokens the Docs skin defines, so it follows branding
 * changes. Everything structural (panel-card, app-table, pill-status,
 * workspace-grid, detail-list, tag-cluster) is reused from app.css; only the
 * identity card, the avatar, the link tiles and a few text styles are new.
 */

/* --- Identity card --------------------------------------------------------- */

.profile-identity {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.25rem 1.5rem;
    align-items: start;
    margin-bottom: 1.5rem;
}

.profile-identity-photo {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    align-items: center;
}

.profile-identity-copy h2 {
    margin: 0;
    font-size: 1.35rem;
}

.profile-role {
    margin: 0.2rem 0 0.9rem;
    color: var(--app-muted);
    font-size: 0.92rem;
}

.profile-identity-side {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    align-items: flex-end;
    text-align: right;
}

.profile-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.6rem 1.25rem;
    margin: 0;
}

.profile-facts > div {
    min-inline-size: 0;
}

.profile-facts dt {
    margin: 0;
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.profile-facts dd {
    margin: 0.1rem 0 0;
    font-size: 0.92rem;
    overflow-wrap: anywhere;
}

/* --- Avatar ---------------------------------------------------------------- */

.profile-avatar {
    inline-size: 6rem;
    block-size: 6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--app-surface-alt);
    border: 2px solid var(--app-border);
    border-radius: 50%;
}

.profile-avatar-img {
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
    /* A portrait photo's subject is usually in the upper half. */
    object-position: center top;
}

.profile-avatar-initials {
    color: var(--app-primary);
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.profile-photo-edit > summary,
.profile-contact-edit > summary {
    cursor: pointer;
    list-style: none;
}

.profile-photo-edit > summary::-webkit-details-marker,
.profile-contact-edit > summary::-webkit-details-marker {
    display: none;
}

.profile-photo-forms {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding: 0.85rem;
    min-inline-size: 15rem;
    background: var(--app-surface-alt);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
}

.profile-photo-forms form {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    align-items: flex-start;
}

.profile-contact-edit form {
    margin-top: 0.75rem;
    padding: 0.85rem;
    min-inline-size: 16rem;
    text-align: left;
    background: var(--app-surface-alt);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
}

.profile-hint {
    display: block;
    color: var(--app-muted);
    font-size: 0.74rem;
}

/* --- Link tiles ------------------------------------------------------------ */

.profile-link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 0.7rem;
    margin-top: 0.35rem;
}

.profile-link-tile {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    padding: 0.7rem 0.85rem;
    color: inherit;
    text-decoration: none;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.profile-link-tile:hover,
.profile-link-tile:focus-visible {
    border-color: var(--app-primary);
    transform: translateY(-1px);
}

.profile-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    inline-size: 2rem;
    block-size: 2rem;
    flex: 0 0 auto;
    color: var(--app-primary);
    background: var(--app-surface-alt);
    border-radius: var(--app-radius);
}

.profile-link-copy {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-inline-size: 0;
}

.profile-link-copy strong {
    font-size: 0.9rem;
}

.profile-link-copy small {
    color: var(--app-muted);
    font-size: 0.75rem;
}

.profile-link-chevron {
    color: var(--app-muted);
    font-size: 0.8rem;
}

/* --- Record panels --------------------------------------------------------- */

.profile-more,
.profile-empty {
    margin: 0.5rem 0 0;
    color: var(--app-muted);
    font-size: 0.82rem;
}

.profile-empty {
    padding: 0.9rem 0;
}

.profile-group-label {
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

/* --- The signed-in user in the sidebar ------------------------------------- */

.sidebar-user-head {
    display: flex;
    gap: 0.55rem;
    align-items: center;
    margin-bottom: 0.35rem;
    color: inherit;
    text-decoration: none;
}

.sidebar-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    inline-size: 2rem;
    block-size: 2rem;
    flex: 0 0 auto;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.sidebar-avatar img {
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
    object-position: center top;
}

.sidebar-user-head:hover .sidebar-avatar,
.sidebar-user-head:focus-visible .sidebar-avatar {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 1px;
}

@media (max-width: 62rem) {
    .profile-identity {
        grid-template-columns: 1fr;
    }

    .profile-identity-side {
        align-items: flex-start;
        text-align: left;
    }
}
