/* ==========================================================================
   SocialHub — Profile, composer, settings, report and document surfaces
   Mobile-first. Every value comes from a token in sh-tokens.css.
   Load order: after sh-app.css (pushed into @stack('app-styles')).
   ========================================================================== */

/* ==========================================================================
   1. Profile header — cover with an overlapping avatar
   ========================================================================== */

.sh-prof-cover {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--sh-surface-sunken);
}

.sh-prof-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sh-prof-cover-btn {
    position: absolute;
    top: var(--sh-sp-3);
    right: var(--sh-sp-3);
    background: rgba(15, 23, 42, 0.62);
    color: var(--sh-text-inverse);
    border: 0;
    backdrop-filter: blur(6px);
}

.sh-prof-cover-btn:hover {
    background: rgba(15, 23, 42, 0.78);
    color: var(--sh-text-inverse);
}

.sh-prof-cover-btn svg {
    width: 16px;
    height: 16px;
}

.sh-prof-body {
    padding: 0 var(--sh-sp-4) var(--sh-sp-4);
}

/* The identity block sits under the cover; the avatar pulls up over it.
 *
 * The lift belongs to the avatar, not the row. When the row carried it,
 * everything in the row was hoisted over the cover — so a name that wrapped
 * to two lines grew upwards and drew its first line in dark text on top of
 * the cover photo, where it was unreadable ("Priya Sharma" read as
 * "Sharma"). With the margin on the avatar alone, the row starts at the
 * cover's bottom edge and grows downwards, so the text can never climb
 * over the image however long the name is. */
.sh-prof-id {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: var(--sh-sp-3);
}

.sh-prof-presence {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    font-size: var(--sh-fs-xs);
    font-weight: var(--sh-fw-semibold);
}

.sh-prof-avatar {
    position: relative;
    flex-shrink: 0;
    margin-top: calc(var(--sh-sp-10) * -1);
}

.sh-prof-avatar .sh-avatar {
    width: 88px;
    height: 88px;
    border: 4px solid var(--sh-surface);
    box-shadow: var(--sh-shadow-md);
    background: var(--sh-surface);
}

.sh-prof-avatar-btn {
    position: absolute;
    right: 0;
    bottom: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--sh-primary-600);
    color: var(--sh-text-inverse);
    border: 3px solid var(--sh-surface);
}

.sh-prof-avatar-btn:hover {
    background: var(--sh-primary-700);
    color: var(--sh-text-inverse);
}

.sh-prof-avatar-btn svg {
    width: 14px;
    height: 14px;
}

.sh-prof-identity {
    flex: 1 1 180px;
    min-width: 0;
    padding-bottom: var(--sh-sp-1);
}

.sh-prof-name {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: var(--sh-fs-2xl);
    font-weight: var(--sh-fw-extrabold);
    letter-spacing: -0.02em;
    color: var(--sh-text-strong);
    line-height: var(--sh-lh-tight);
}

.sh-prof-handle {
    margin: 2px 0 0;
    font-size: var(--sh-fs-base);
    color: var(--sh-text-muted);
}

.sh-prof-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--sh-sp-2);
    width: 100%;
}

.sh-prof-actions .sh-btn {
    flex: 1 1 auto;
    justify-content: center;
}

/* "View as Public" is secondary information on a phone. */
.sh-prof-action-wide {
    display: none;
}

.sh-prof-headline {
    margin: var(--sh-sp-4) 0 0;
    font-size: var(--sh-fs-md);
    color: var(--sh-text);
    line-height: var(--sh-lh-snug);
}

.sh-prof-prompt a {
    color: var(--sh-link);
    font-weight: var(--sh-fw-semibold);
}

.sh-prof-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sh-sp-2) var(--sh-sp-4);
    margin-top: var(--sh-sp-3);
    font-size: var(--sh-fs-sm);
    color: var(--sh-text-muted);
}

.sh-prof-meta span,
.sh-prof-meta a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.sh-prof-meta a {
    color: var(--sh-link);
}

.sh-prof-meta svg {
    flex-shrink: 0;
    color: var(--sh-text-subtle);
}

/* ---- Stats row ---------------------------------------------------------- */

.sh-prof-stats {
    display: flex;
    align-items: stretch;
    gap: var(--sh-sp-2);
    margin-top: var(--sh-sp-4);
    padding-top: var(--sh-sp-4);
    border-top: 1px solid var(--sh-border);
}

.sh-prof-stat {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.sh-prof-stat-value {
    font-size: var(--sh-fs-xl);
    font-weight: var(--sh-fw-extrabold);
    color: var(--sh-text-strong);
    line-height: var(--sh-lh-tight);
}

.sh-prof-stat-label {
    font-size: var(--sh-fs-xs);
    color: var(--sh-text-muted);
}

/* ---- Tab strip ---------------------------------------------------------- */

.sh-prof-tabs {
    padding: 0 var(--sh-sp-2);
    border-top: 1px solid var(--sh-border);
}

.sh-prof-tabs .sh-tabs {
    border-bottom: 0;
}

.sh-prof-tab-count {
    font-size: var(--sh-fs-xs);
    font-weight: var(--sh-fw-bold);
    color: var(--sh-text-subtle);
}

.sh-tab.is-active .sh-prof-tab-count {
    color: var(--sh-primary-600);
}

/* ==========================================================================
   2. Profile detail blocks — bio, quick info, social links, completion
   ========================================================================== */

.sh-prof-bio {
    margin: 0;
    font-size: var(--sh-fs-md);
    line-height: var(--sh-lh-relaxed);
    color: var(--sh-text);
    white-space: pre-line;
}

.sh-prof-info {
    display: flex;
    flex-direction: column;
    gap: var(--sh-sp-3);
}

.sh-prof-info-row {
    display: flex;
    align-items: center;
    gap: var(--sh-sp-3);
    min-width: 0;
    font-size: var(--sh-fs-base);
    color: var(--sh-text);
}

.sh-prof-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    flex-shrink: 0;
    color: var(--sh-text-subtle);
}

.sh-prof-social:hover {
    color: var(--sh-link);
}

.sh-prof-checks {
    display: flex;
    flex-direction: column;
    gap: var(--sh-sp-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.sh-prof-check {
    display: flex;
    align-items: center;
    gap: var(--sh-sp-3);
    font-size: var(--sh-fs-base);
    color: var(--sh-text-muted);
}

.sh-prof-check a {
    color: var(--sh-text-muted);
}

.sh-prof-check a:hover {
    color: var(--sh-link);
}

.sh-prof-check-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px dashed var(--sh-border-strong);
    color: var(--sh-text-subtle);
}

.sh-prof-check.is-done {
    color: var(--sh-text);
}

.sh-prof-check.is-done .sh-prof-check-mark {
    border: 0;
    background: var(--sh-success-50);
    color: var(--sh-success-600);
}

/* ==========================================================================
   3. Post grid on the profile
   ========================================================================== */

.sh-prof-posts {
    display: flex;
    flex-direction: column;
    gap: var(--sh-sp-4);
}

.sh-prof-list,
.sh-prof-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sh-sp-4);
}

.sh-prof-list > *,
.sh-prof-grid > * {
    min-width: 0;
}

.sh-segment-item-icon {
    padding: 0 var(--sh-sp-3);
}

.sh-segment-item-icon svg {
    width: 18px;
    height: 18px;
}

.sh-ptile {
    display: flex;
    flex-direction: column;
}

.sh-ptile-media {
    display: block;
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--sh-surface-sunken);
}

.sh-ptile-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sh-ptile-body {
    display: flex;
    flex-direction: column;
    gap: var(--sh-sp-2);
    padding: var(--sh-sp-3);
    flex: 1 1 auto;
}

.sh-ptile-title {
    font-size: var(--sh-fs-md);
    font-weight: var(--sh-fw-semibold);
    color: var(--sh-text-strong);
    line-height: var(--sh-lh-snug);
}

.sh-ptile-title:hover {
    color: var(--sh-link);
}

.sh-ptile-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: var(--sh-fs-xs);
    color: var(--sh-text-muted);
}

.sh-ptile-foot {
    display: flex;
    align-items: center;
    gap: var(--sh-sp-4);
    margin-top: auto;
    padding-top: var(--sh-sp-2);
    border-top: 1px solid var(--sh-border);
}

.sh-ptile-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: var(--sh-fs-sm);
    font-weight: var(--sh-fw-semibold);
    color: var(--sh-text-muted);
}

.sh-ptile-stat svg {
    color: var(--sh-primary-600);
}

.sh-ptile-menu {
    margin-inline-start: auto;
}

/* ==========================================================================
   4. Photo grids
   ========================================================================== */

.sh-photo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--sh-sp-2);
}

.sh-photo-tile {
    display: block;
    aspect-ratio: 1 / 1;
    border-radius: var(--sh-radius-sm);
    overflow: hidden;
    background: var(--sh-surface-sunken);
}

.sh-photo-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--sh-dur) var(--sh-ease);
}

.sh-photo-tile:hover img {
    transform: scale(1.05);
}

.sh-photo-grid-rail {
    gap: 6px;
}

/* ==========================================================================
   5. Forms — profile edit, composer, settings, report
   ========================================================================== */

.sh-grid-fields {
    gap: 0 var(--sh-sp-4);
}

.sh-form-foot {
    display: flex;
    flex-direction: column-reverse;
    gap: var(--sh-sp-2);
    padding-bottom: var(--sh-sp-2);
}

.sh-form-foot .sh-btn {
    justify-content: center;
}

.sh-form-foot-actions {
    display: flex;
    flex-direction: column-reverse;
    gap: var(--sh-sp-2);
}

/* ---- Avatar + cover preview on the edit page ---------------------------- */

.sh-edit-cover {
    position: relative;
    background: var(--sh-surface-sunken);
    border-radius: var(--sh-radius);
    aspect-ratio: 16 / 7;
    /* The avatar hangs below the cover, so this must not clip. */
    margin-bottom: var(--sh-sp-6);
}

.sh-edit-cover > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: var(--sh-radius);
}

.sh-edit-avatar {
    position: absolute;
    left: var(--sh-sp-4);
    bottom: calc(var(--sh-sp-4) * -1);
}

.sh-edit-avatar .sh-avatar {
    width: 72px;
    height: 72px;
    border: 3px solid var(--sh-surface);
    box-shadow: var(--sh-shadow-md);
}

/* ---- Composer header ---------------------------------------------------- */

.sh-composer-head {
    display: flex;
    align-items: center;
    gap: var(--sh-sp-3);
    padding-bottom: var(--sh-sp-4);
    margin-bottom: var(--sh-sp-4);
    border-bottom: 1px solid var(--sh-border);
}

/* ---- Radio chips (post type) -------------------------------------------- */

.sh-choice-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sh-sp-2);
}

.sh-choice input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.sh-choice-face {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 var(--sh-sp-4);
    border: 1px solid var(--sh-border-strong);
    border-radius: var(--sh-radius-pill);
    background: var(--sh-surface);
    font-size: var(--sh-fs-base);
    font-weight: var(--sh-fw-semibold);
    color: var(--sh-text-muted);
    cursor: pointer;
    transition: border-color var(--sh-dur-fast) var(--sh-ease),
        background var(--sh-dur-fast) var(--sh-ease),
        color var(--sh-dur-fast) var(--sh-ease);
}

.sh-choice-face svg {
    width: 17px;
    height: 17px;
}

.sh-choice input:checked + .sh-choice-face {
    border-color: var(--sh-primary-600);
    background: var(--sh-primary-50);
    color: var(--sh-primary-700);
}

.sh-choice input:focus-visible + .sh-choice-face {
    box-shadow: var(--sh-shadow-focus);
}

/* ---- Report reasons ------------------------------------------------------ */

.sh-reason-list {
    display: flex;
    flex-direction: column;
    gap: var(--sh-sp-2);
}

.sh-reason {
    display: flex;
    align-items: flex-start;
    gap: var(--sh-sp-3);
    padding: var(--sh-sp-3);
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius);
    cursor: pointer;
    transition: border-color var(--sh-dur-fast) var(--sh-ease),
        background var(--sh-dur-fast) var(--sh-ease);
}

.sh-reason:hover {
    background: var(--sh-surface-alt);
}

.sh-reason input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--sh-primary-600);
    cursor: pointer;
}

.sh-reason:has(input:checked) {
    border-color: var(--sh-primary-600);
    background: var(--sh-primary-50);
}

.sh-reason-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sh-reason-title {
    font-size: var(--sh-fs-md);
    font-weight: var(--sh-fw-semibold);
    color: var(--sh-text-strong);
}

.sh-reason-hint {
    font-size: var(--sh-fs-sm);
    color: var(--sh-text-muted);
    line-height: var(--sh-lh-snug);
}

.sh-report-subject {
    margin: var(--sh-sp-2) 0 0;
    padding: var(--sh-sp-3);
    border-inline-start: 3px solid var(--sh-border-strong);
    background: var(--sh-surface-alt);
    border-radius: 0 var(--sh-radius-sm) var(--sh-radius-sm) 0;
    font-size: var(--sh-fs-base);
    color: var(--sh-text);
    line-height: var(--sh-lh-snug);
}

/* ==========================================================================
   6. Static CMS page — a readable prose column
   ========================================================================== */

.sh-doc {
    max-width: 760px;
}

.sh-doc-head {
    padding-bottom: var(--sh-sp-6);
    margin-bottom: var(--sh-sp-6);
    border-bottom: 1px solid var(--sh-border);
}

.sh-doc-title {
    margin: 0;
    font-size: var(--sh-fs-3xl);
    font-weight: var(--sh-fw-extrabold);
    letter-spacing: -0.025em;
    color: var(--sh-text-strong);
    line-height: var(--sh-lh-tight);
}

.sh-doc-lead {
    margin: var(--sh-sp-3) 0 0;
    font-size: var(--sh-fs-lg);
    color: var(--sh-text-muted);
    line-height: var(--sh-lh-relaxed);
}

.sh-doc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sh-sp-2) var(--sh-sp-4);
    margin: var(--sh-sp-4) 0 0;
    font-size: var(--sh-fs-sm);
    color: var(--sh-text-subtle);
}

.sh-doc-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.sh-prose {
    font-size: var(--sh-fs-md);
    line-height: var(--sh-lh-relaxed);
    color: var(--sh-text);
}

.sh-prose > * + * {
    margin-top: var(--sh-sp-4);
}

.sh-prose h2,
.sh-prose h3,
.sh-prose h4 {
    margin-top: var(--sh-sp-8);
    color: var(--sh-text-strong);
    font-weight: var(--sh-fw-bold);
    line-height: var(--sh-lh-snug);
}

.sh-prose h2 { font-size: var(--sh-fs-2xl); }
.sh-prose h3 { font-size: var(--sh-fs-xl); }
.sh-prose h4 { font-size: var(--sh-fs-lg); }

.sh-prose ul,
.sh-prose ol {
    padding-inline-start: var(--sh-sp-5);
}

.sh-prose li + li {
    margin-top: var(--sh-sp-2);
}

.sh-prose a {
    color: var(--sh-link);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.sh-prose blockquote {
    margin-inline-start: 0;
    padding: var(--sh-sp-3) var(--sh-sp-4);
    border-inline-start: 3px solid var(--sh-primary-600);
    background: var(--sh-surface-alt);
    border-radius: 0 var(--sh-radius) var(--sh-radius) 0;
    color: var(--sh-text-muted);
}

.sh-prose img {
    max-width: 100%;
    height: auto;
    border-radius: var(--sh-radius);
}

.sh-prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--sh-fs-base);
}

.sh-prose th,
.sh-prose td {
    padding: var(--sh-sp-2) var(--sh-sp-3);
    border: 1px solid var(--sh-border);
    text-align: start;
}

.sh-prose code {
    padding: 2px 6px;
    border-radius: var(--sh-radius-xs);
    background: var(--sh-surface-sunken);
    font-size: var(--sh-fs-sm);
}

/* ==========================================================================
   7. Tablet
   ========================================================================== */

/* ==========================================================================
   Profile tab panels — friends, videos, reels, events, groups

   Every tab is a panel on the profile now, so each needs its own grid.
   ========================================================================== */

.sh-prof-people {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sh-sp-3);
}

.sh-prof-person {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
    padding: var(--sh-sp-3);
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius-sm);
    text-align: center;
    text-decoration: none;
}

.sh-prof-person:hover {
    background: var(--sh-surface-sunken);
}

.sh-prof-person .sh-avatar {
    display: inline-flex;
}

.sh-prof-person-name {
    font-size: var(--sh-fs-sm);
    font-weight: var(--sh-fw-semibold);
    color: var(--sh-text-strong);
    overflow-wrap: anywhere;
}

.sh-prof-person-handle {
    font-size: var(--sh-fs-xs);
    color: var(--sh-text-muted);
    overflow-wrap: anywhere;
}

/* A video tile is a photo tile that says it will play. */
.sh-prof-videotile {
    position: relative;
}

.sh-prof-playbadge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    /* On the thumbnail in both themes, so the colour is fixed. */
    color: var(--sh-white);
    filter: drop-shadow(0 1px 4px rgb(0 0 0 / 60%));
    pointer-events: none;
}

.sh-prof-playbadge svg {
    width: 30px;
    height: 30px;
}

.sh-prof-tiletime {
    position: absolute;
    inset-block-end: 4px;
    inset-inline-start: 4px;
    padding: 1px 5px;
    border-radius: var(--sh-radius-xs);
    background: rgb(0 0 0 / 65%);
    color: var(--sh-white);
    font-size: 10px;
}

.sh-prof-cards {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sh-sp-3);
}

.sh-prof-card {
    display: flex;
    align-items: center;
    gap: var(--sh-sp-3);
    min-width: 0;
    padding: var(--sh-sp-2);
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius-sm);
    text-decoration: none;
}

.sh-prof-card:hover {
    background: var(--sh-surface-sunken);
}

.sh-prof-card-thumb {
    flex: 0 0 auto;
    width: 76px;
    aspect-ratio: 16 / 10;
    border-radius: var(--sh-radius-xs);
    overflow: hidden;
    background: var(--sh-surface-sunken);
}

.sh-prof-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sh-prof-card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-width: 0;
    gap: 2px;
}

.sh-prof-card-title {
    font-size: var(--sh-fs-sm);
    font-weight: var(--sh-fw-semibold);
    color: var(--sh-text-strong);
    overflow-wrap: anywhere;
}

.sh-prof-card-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: var(--sh-fs-xs);
    color: var(--sh-text-muted);
}

.sh-prof-card-meta svg {
    flex: 0 0 auto;
    width: 13px;
    height: 13px;
}

/* ==========================================================================
   Settings → Privacy: "Who can see your details"
   A read-only summary of the per-field audiences chosen on Edit Profile.
   ========================================================================== */

.sh-set-audiences {
    display: flex;
    flex-direction: column;
    gap: var(--sh-sp-1);
    margin: 0;
    padding: 0;
    list-style: none;
}

.sh-set-audience {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--sh-sp-2);
    padding: var(--sh-sp-2) 0;
    border-bottom: 1px solid var(--sh-border);
}

.sh-set-audience:last-child {
    border-bottom: 0;
}

.sh-set-audience-label {
    font-size: var(--sh-fs-sm);
    color: var(--sh-text);
    min-width: 0;
}

.sh-set-audience-value {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--sh-fs-sm);
    font-weight: var(--sh-fw-semibold);
    color: var(--sh-text-strong);
}

.sh-set-audience-value svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--sh-text-muted);
}

/* Says why the effective audience differs from the one that was picked. */
.sh-set-audience-note {
    font-size: var(--sh-fs-xs);
    font-weight: var(--sh-fw-normal);
    color: var(--sh-text-muted);
}

@media (min-width: 640px) {
    .sh-prof-people {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .sh-prof-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .sh-prof-people {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}


@media (min-width: 768px) {
    .sh-prof-cover {
        aspect-ratio: 32 / 9;
    }

    .sh-prof-body {
        padding: 0 var(--sh-sp-5) var(--sh-sp-5);
    }

    .sh-prof-id {
        flex-wrap: nowrap;
    }

    .sh-prof-avatar {
        margin-top: calc(var(--sh-sp-16) * -1);
    }

    .sh-prof-avatar .sh-avatar {
        width: 128px;
        height: 128px;
        border-width: 5px;
    }

    .sh-prof-avatar-btn {
        width: 34px;
        height: 34px;
    }

    .sh-prof-avatar-btn svg {
        width: 16px;
        height: 16px;
    }

    .sh-prof-name {
        font-size: var(--sh-fs-3xl);
    }

    .sh-prof-actions {
        width: auto;
        padding-bottom: var(--sh-sp-2);
    }

    .sh-prof-actions .sh-btn {
        flex: 0 0 auto;
    }

    .sh-prof-action-wide {
        display: inline-flex;
    }

    .sh-prof-stats {
        justify-content: flex-start;
        gap: var(--sh-sp-8);
    }

    .sh-prof-stat {
        flex: 0 0 auto;
        align-items: flex-start;
    }

    .sh-prof-tabs {
        padding: 0 var(--sh-sp-3);
    }

    /* Eight tabs do not fit the centre column. `.sh-tabs` scrolls
     * horizontally with its scrollbar hidden, which is right for a thumb on
     * a phone but leaves a mouse no way at all to reach the last two — the
     * strip ended at "Eve…" and Events and Groups were invisible. Wrapping
     * only happens when they genuinely do not fit, so a wide column still
     * lays them out in a single row. */
    .sh-prof-tabs .sh-tabs {
        flex-wrap: wrap;
        overflow-x: visible;
    }

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

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

    .sh-form-foot {
        flex-direction: row;
        justify-content: flex-end;
    }

    .sh-form-foot-split {
        justify-content: space-between;
    }

    .sh-form-foot-actions {
        flex-direction: row;
    }

    .sh-form-foot .sh-btn {
        flex: 0 0 auto;
    }

    .sh-edit-avatar {
        left: var(--sh-sp-6);
    }

    .sh-edit-avatar .sh-avatar {
        width: 96px;
        height: 96px;
    }

    .sh-doc-title {
        font-size: var(--sh-fs-4xl);
    }
}

/* ==========================================================================
   8. Desktop
   ========================================================================== */

@media (min-width: 1024px) {
    /* The three-column shell arrives here and takes the centre column down
     * to around 620px, which leaves the name roughly 180px — not enough for
     * two ordinary words at 3xl, so it wrapped. It steps back up at 1440,
     * where the centre is wide again. */
    .sh-prof-name {
        font-size: var(--sh-fs-2xl);
    }


    .sh-prof-stats {
        gap: var(--sh-sp-10);
    }

    .sh-photo-grid {
        gap: var(--sh-sp-3);
    }

    .sh-photo-grid-rail {
        gap: 6px;
    }
}

@media (min-width: 1280px) {
    .sh-prof-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .sh-prof-grid .sh-ptile-media {
        aspect-ratio: 4 / 3;
    }
}

/* The centre column clears ~900px here, so the name gets its full size back. */
@media (min-width: 1440px) {
    .sh-prof-name {
        font-size: var(--sh-fs-3xl);
    }
}
