/* Profile workspace: shared member shell and section surfaces. Load after legacy section styles. */
.profile-workspace,
.profile-page-nav,
.profile-mobile-subnav,
.public-profile-page {
    --profile-header-height: 56px;
    --profile-sidebar-width: 264px;
    color: var(--ds-ink);
    font-family: var(--ds-font-sans);
    font-size: var(--ds-font-size-body);
    line-height: var(--ds-line-height-body);
}

.profile-workspace *,
.profile-workspace *::before,
.profile-workspace *::after,
.profile-page-nav *,
.public-profile-page * {
    box-sizing: border-box;
}

body:has(.profile-workspace) {
    margin: 0;
    background: var(--ds-bg);
}

.profile-page-nav {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: var(--profile-header-height);
    padding: 0 var(--ds-space-6);
    border-bottom: 1px solid var(--ds-line);
    background: var(--ds-card);
    z-index: 200;
}

.profile-page-nav .back-to-map {
    position: static;
    transform: none;
    justify-self: start;
    min-width: 0;
    font-size: var(--ds-font-size-bodySm);
    line-height: var(--ds-line-height-bodySm);
}

.profile-page-nav .back-to-map a {
    gap: var(--ds-space-2);
    width: auto;
    color: var(--ds-ink);
    font-family: var(--ds-font-sans);
}

.profile-page-nav .profile-page-logo {
    margin: 0;
    justify-self: center;
    white-space: nowrap;
}

.profile-page-nav .profile-page-logo img {
    object-fit: contain;
    flex: none;
}

.profile-nav-actions {
    display: flex;
    align-items: center;
    justify-self: end;
}

.profile-nav-actions form {
    margin: 0;
}

.profile-nav-actions button,
.profile-mobile-menu > summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ds-space-2);
    min-height: 44px;
    padding: var(--ds-space-2) var(--ds-space-3);
    border: 0;
    border-radius: var(--ds-radius-sm);
    background: transparent;
    color: var(--ds-ink);
    font: inherit;
    font-size: var(--ds-font-size-bodySm);
    cursor: pointer;
}

.profile-nav-actions button:hover,
.profile-mobile-menu > summary:hover {
    background: var(--ds-surface);
}

.profile-mobile-menu,
.profile-mobile-subnav {
    display: none;
}

.profile-layout.profile-workspace {
    display: flex;
    align-items: stretch;
    flex-direction: row;
    margin-top: var(--profile-header-height);
    min-height: calc(100dvh - var(--profile-header-height));
    background: var(--ds-bg);
}

.profile-workspace .profile-sidebar {
    flex: 0 0 var(--profile-sidebar-width);
    width: var(--profile-sidebar-width);
    min-width: 0;
    height: calc(100dvh - var(--profile-header-height));
    top: var(--profile-header-height);
    gap: var(--ds-space-4);
    padding: var(--ds-space-6) var(--ds-space-4) var(--ds-space-8);
    border-right: 1px solid var(--ds-line);
    background: var(--ds-card);
}

.profile-workspace .sidebar-profile-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--ds-space-3);
    padding: 0 0 var(--ds-space-4);
    margin: 0;
    min-height: 72px;
    border: 0;
    border-bottom: 1px solid var(--ds-line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    text-align: left;
}

.profile-workspace .sidebar-avatar {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    margin: 0;
    border: 0;
    border-radius: var(--ds-radius-pill);
    background-position: center;
    background-size: cover;
    object-fit: cover;
}

.sidebar-profile-identity {
    min-width: 0;
}

.profile-workspace .sidebar-user-name {
    margin: 0;
    color: var(--ds-ink);
    font-family: var(--ds-font-sans);
    font-size: var(--ds-font-size-label);
    font-weight: 600;
    line-height: var(--ds-line-height-label);
    overflow-wrap: anywhere;
}

.sidebar-public-link {
    color: var(--ds-link);
    font-size: var(--ds-font-size-bodySm);
    line-height: var(--ds-line-height-bodySm);
    text-decoration: none;
}

.profile-workspace .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: var(--ds-space-4);
    width: 100%;
    margin: 0;
}

.profile-nav-group {
    display: flex;
    flex-direction: column;
    gap: var(--ds-space-1);
}

.profile-nav-group-title {
    margin: 0;
    padding: 0 var(--ds-space-3) var(--ds-space-1);
    color: var(--ds-ink-soft);
    font-size: var(--ds-font-size-overline);
    font-weight: 600;
    line-height: var(--ds-line-height-overline);
    letter-spacing: .06em;
    text-transform: uppercase;
}

.profile-workspace .side-tab,
.profile-mobile-menu .side-tab {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--ds-space-3);
    width: 100%;
    min-height: 44px;
    padding: var(--ds-space-2) var(--ds-space-3);
    border: 0;
    border-radius: var(--ds-radius-md);
    color: var(--ds-ink);
    background: transparent;
    font-family: var(--ds-font-sans);
    font-size: var(--ds-font-size-label);
    font-weight: 400;
    line-height: var(--ds-line-height-label);
    text-decoration: none;
}

.profile-workspace .side-tab-icon,
.profile-mobile-menu .side-tab-icon {
    flex: 0 0 20px;
    width: 20px;
    font-size: 20px;
    color: var(--ds-ink-soft);
}

.profile-nav-link-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-wrap: anywhere;
}

.profile-nav-description {
    margin-top: var(--ds-space-1);
    color: var(--ds-ink-soft);
    font-size: var(--ds-font-size-caption);
    line-height: var(--ds-line-height-caption);
}

.profile-nav-count {
    min-width: 24px;
    margin-left: auto;
    padding: 0 var(--ds-space-2);
    border-radius: var(--ds-radius-pill);
    background: var(--ds-surface);
    color: var(--ds-ink-soft);
    font-size: var(--ds-font-size-caption);
    text-align: center;
}

.profile-nav-count:empty {
    display: none;
}

.profile-nav-external {
    margin-left: auto;
    color: var(--ds-ink-soft);
    font-size: 16px;
}

.profile-workspace .side-tab:hover,
.profile-mobile-menu .side-tab:hover {
    background: var(--ds-surface);
}

.profile-workspace .side-tab-active,
.profile-mobile-menu .side-tab-active {
    background: color-mix(in srgb, var(--ds-brand) 14%, var(--ds-card));
    color: var(--ds-ink);
    font-weight: 600;
}

.profile-workspace .side-tab-active::before,
.profile-mobile-menu .side-tab-active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: var(--ds-radius-pill);
    background: var(--ds-brand-strong);
}

.profile-workspace .side-tab-active .side-tab-icon {
    color: var(--ds-brand-strong);
}

.profile-workspace :is(.profile-content-area, .profile-main) {
    flex: 1;
    min-width: 0;
    max-width: none;
    width: auto;
    padding: var(--ds-space-8) var(--ds-space-8) var(--ds-space-16);
    background: var(--ds-bg);
}

.profile-reading-column,
.profile-workspace #user-settings {
    width: 100%;
    max-width: 720px;
}

.profile-page-heading {
    margin-bottom: var(--ds-space-6);
}

.profile-page-heading h1 {
    margin: var(--ds-space-1) 0 var(--ds-space-2);
    color: var(--ds-ink);
    font-family: var(--ds-font-display);
    font-size: var(--ds-font-size-h1);
    line-height: var(--ds-line-height-h1);
}

.profile-page-heading p {
    margin: 0;
    color: var(--ds-ink-soft);
    font-size: var(--ds-font-size-bodyLg);
    line-height: var(--ds-line-height-bodyLg);
}

.profile-page-heading .profile-page-eyebrow {
    font-size: var(--ds-font-size-overline);
    line-height: var(--ds-line-height-overline);
}

.profile-page-eyebrow {
    display: block;
    color: var(--ds-ink-soft);
    font-size: var(--ds-font-size-overline);
    font-weight: 600;
    line-height: var(--ds-line-height-overline);
    letter-spacing: .06em;
    text-transform: uppercase;
}

.profile-back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--ds-space-2);
    min-height: 40px;
    margin-bottom: var(--ds-space-4);
    color: var(--ds-ink);
    font-size: var(--ds-font-size-label);
    text-decoration: none;
}

.profile-photo-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--ds-space-6);
}

.profile-avatar-upload {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    border-radius: var(--ds-radius-pill);
}

.profile-photo-row .profile-hero-avatar {
    margin-top: 0;
}

.profile-photo-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--ds-space-2);
}

.profile-file-input,
.profile-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.profile-avatar-upload:focus-within {
    outline: 2px solid var(--ds-focus);
    outline-offset: var(--ds-space-1);
}

.profile-photo-actions:focus-within label[for="profile-photo-input"] {
    outline: 2px solid var(--ds-focus);
    outline-offset: var(--ds-space-1);
}

.profile-header-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--ds-space-3);
    margin-bottom: var(--ds-space-6);
}

.profile-person-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--ds-space-3);
    min-height: 80px;
    padding: var(--ds-space-4) 0;
    border-bottom: 1px solid var(--ds-line);
}

.profile-person-row:last-child {
    border-bottom: 0;
}

.profile-person-avatar {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: var(--ds-radius-pill);
    background: var(--ds-surface);
    object-fit: cover;
}

.profile-person-name {
    color: var(--ds-ink);
    font-weight: 500;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.profile-person-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--ds-space-2);
}

.profile-person-menu {
    position: relative;
}

.profile-person-menu > summary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--ds-radius-pill);
    list-style: none;
    cursor: pointer;
}

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

.profile-person-menu > summary:hover {
    background: var(--ds-surface);
}

.profile-person-menu > button {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 2;
    min-width: 160px;
    min-height: 48px;
    padding: var(--ds-space-3) var(--ds-space-4);
    border: 1px solid var(--ds-line);
    border-radius: var(--ds-radius-md);
    color: var(--ds-error-text);
    background: var(--ds-elevated);
    box-shadow: var(--ds-shadow-elevated);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.profile-workspace .tab.active {
    width: 100%;
}

.profile-section-header,
.profile-workspace .content-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--ds-space-4);
    margin: 0 0 var(--ds-space-6);
    padding: 0;
    border: 0;
}

.profile-section-eyebrow,
.profile-eyebrow {
    display: block;
    margin: 0 0 var(--ds-space-1);
    color: var(--ds-ink-soft);
    font-size: var(--ds-font-size-overline);
    font-weight: 600;
    letter-spacing: .06em;
    line-height: var(--ds-line-height-overline);
    text-transform: uppercase;
}

.profile-section-title,
.profile-section-header h1,
.profile-workspace .content-section-title,
.profile-workspace .account-settings-title {
    margin: 0;
    color: var(--ds-ink);
    font-family: var(--ds-font-display);
    font-size: var(--ds-font-size-h1);
    font-weight: 700;
    line-height: var(--ds-line-height-h1);
    overflow-wrap: anywhere;
}

.profile-section-header h2 {
    margin: 0;
    color: var(--ds-ink);
    font-family: var(--ds-font-display);
    font-size: var(--ds-font-size-h3);
    font-weight: 600;
    line-height: var(--ds-line-height-h3);
}

.profile-section-header p {
    color: var(--ds-ink-soft);
}

.profile-section-header > a,
.profile-meta a,
.profile-hero-bio a {
    color: var(--ds-link);
    text-decoration: none;
}

.profile-section-header > a {
    font-size: var(--ds-font-size-bodySm);
    line-height: var(--ds-line-height-bodySm);
}

.profile-section-header > a:hover,
.profile-meta a:hover,
.profile-hero-bio a:hover {
    color: var(--ds-link-hover);
    text-decoration: underline;
}

.profile-section-header:has(> h1) {
    display: block;
}

.profile-section-header > h1 {
    margin-bottom: var(--ds-space-2);
}

.profile-section-header > p:last-child {
    margin-bottom: 0;
    font-size: var(--ds-font-size-bodyLg);
    line-height: var(--ds-line-height-bodyLg);
}

.profile-section-description {
    margin: var(--ds-space-2) 0 0;
    color: var(--ds-ink-soft);
    font-size: var(--ds-font-size-bodyLg);
    line-height: var(--ds-line-height-bodyLg);
}

.profile-section-actions,
.profile-hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--ds-space-3);
}

.profile-workspace :is(.profile-panel, .settings-card, .account-settings-card) {
    min-width: 0;
    margin: 0 0 var(--ds-space-6);
    padding: var(--ds-space-6);
    border: 1px solid var(--ds-line);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-card);
    box-shadow: var(--ds-shadow-card);
}

.profile-panel > :last-child,
.profile-workspace .settings-card > :last-child {
    margin-bottom: 0;
}

.profile-panel > h2 {
    margin: 0 0 var(--ds-space-4);
    color: var(--ds-ink);
    font-family: var(--ds-font-display);
    font-size: var(--ds-font-size-h3);
    font-weight: 600;
    line-height: var(--ds-line-height-h3);
}

.profile-panel .profile-section-title,
.profile-workspace :is(.settings-card-title, .account-settings-card h2) {
    margin: 0 0 var(--ds-space-2);
    color: var(--ds-ink);
    font-family: var(--ds-font-display);
    font-size: var(--ds-font-size-h3);
    font-weight: 600;
    line-height: var(--ds-line-height-h3);
}

.profile-panel .profile-section-header {
    align-items: center;
    margin-bottom: var(--ds-space-4);
}

.profile-panel > .profile-section-description {
    margin-bottom: var(--ds-space-4);
    font-size: var(--ds-font-size-bodySm);
    line-height: var(--ds-line-height-bodySm);
}

.profile-panel .profile-section-title {
    margin: 0;
}

.profile-workspace :is(.settings-card-hint, .account-settings-description) {
    margin: 0 0 var(--ds-space-4);
    color: var(--ds-ink-soft);
    font-family: var(--ds-font-sans);
    font-size: var(--ds-font-size-bodySm);
    line-height: var(--ds-line-height-bodySm);
}

.profile-workspace :is(.settings-label, .account-settings-label) {
    margin-bottom: var(--ds-space-2);
    color: var(--ds-ink);
    font-size: var(--ds-font-size-label);
    font-weight: 500;
    letter-spacing: normal;
    text-transform: none;
}

.profile-workspace :is(.settings-input, .bio-textarea) {
    width: 100%;
    max-width: none;
    border-radius: var(--ds-radius-sm);
    background: var(--ds-bg);
    color: var(--ds-ink);
}

.profile-workspace textarea {
    resize: vertical;
}

.profile-workspace :is(.btn-primary, .btn-outline, .btn-secondary, .btn-outline-danger, .profile-button) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ds-space-2);
    min-height: 40px;
    max-width: 100%;
    padding: var(--ds-space-2) var(--ds-space-4);
    border-radius: var(--ds-radius-md);
    font-family: var(--ds-font-sans);
    font-size: var(--ds-font-size-label);
    font-weight: 600;
    line-height: var(--ds-line-height-label);
    text-decoration: none;
    cursor: pointer;
}

.profile-workspace .btn-primary,
.profile-button-primary {
    border: 1px solid var(--ds-brand);
    background: var(--ds-brand);
    color: var(--ds-on-cta);
}

.profile-workspace .btn-primary:hover:not(:disabled),
.profile-button-primary:hover {
    border-color: var(--ds-brand-hover);
    background: var(--ds-brand-hover);
}

.profile-workspace :is(.btn-outline, .btn-secondary, .profile-button-secondary) {
    border: 1px solid var(--ds-input-border);
    background: var(--ds-card);
    color: var(--ds-ink);
}

.profile-workspace :is(.btn-outline, .btn-secondary):hover:not(:disabled) {
    background: var(--ds-surface);
}

.profile-workspace .btn-outline-danger {
    border: 1px solid var(--ds-input-border);
    background: var(--ds-card);
    color: var(--ds-error-text);
}

.profile-workspace :is(button, input, select, textarea):focus-visible,
.profile-workspace a:focus-visible,
.profile-page-nav :focus-visible {
    outline: 2px solid var(--ds-focus);
    outline-offset: var(--ds-space-1);
}

.profile-workspace button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.profile-workspace .settings-card-danger {
    border-color: var(--ds-error);
    background: var(--ds-card);
    box-shadow: none;
}

.profile-list-row {
    display: flex;
    align-items: center;
    gap: var(--ds-space-3);
    min-height: 72px;
    padding: var(--ds-space-3) 0;
    border-bottom: 1px solid var(--ds-line);
    color: var(--ds-ink);
    text-decoration: none;
}

.profile-list-row:last-child {
    border-bottom: 0;
}

a.profile-list-row:hover {
    color: var(--ds-link);
}

.profile-list-icon,
.profile-stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: var(--ds-radius-md);
    background: var(--ds-surface);
    color: var(--ds-ink-soft);
}

.profile-list-content {
    flex: 1;
    min-width: 0;
}

.profile-list-title {
    display: block;
    color: var(--ds-ink);
    font-size: var(--ds-font-size-label);
    font-weight: 500;
    line-height: var(--ds-line-height-label);
}

.profile-list-description {
    display: block;
    margin-top: var(--ds-space-1);
    color: var(--ds-ink-soft);
    font-size: var(--ds-font-size-bodySm);
    line-height: var(--ds-line-height-bodySm);
}

.profile-list-value {
    margin-left: auto;
    color: var(--ds-ink-soft);
    font-size: var(--ds-font-size-bodySm);
    text-align: right;
}

.profile-settings-group {
    margin-bottom: var(--ds-space-6);
}

.profile-settings-group > .profile-eyebrow {
    margin-bottom: var(--ds-space-3);
}

.profile-settings-link {
    display: flex;
    align-items: center;
    gap: var(--ds-space-3);
    min-height: 80px;
    padding: var(--ds-space-4);
    border-bottom: 1px solid var(--ds-line);
    background: var(--ds-card);
    color: var(--ds-ink);
    text-decoration: none;
}

.profile-settings-link:first-child {
    border-radius: var(--ds-radius-lg) var(--ds-radius-lg) 0 0;
}

.profile-settings-link:last-child {
    border-bottom: 0;
    border-radius: 0 0 var(--ds-radius-lg) var(--ds-radius-lg);
}

.profile-settings-link:only-child {
    border-radius: var(--ds-radius-lg);
}

.profile-settings-link > .material-icons-outlined:first-child {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: var(--ds-radius-md);
    background: var(--ds-surface);
    color: var(--ds-ink-soft);
    font-size: 24px;
}

.profile-settings-link-copy {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    gap: var(--ds-space-1);
}

.profile-settings-link-copy .profile-section-description {
    margin: 0;
    color: var(--ds-ink-soft);
    font-size: var(--ds-font-size-bodySm);
    line-height: var(--ds-line-height-bodySm);
}

.profile-settings-link:hover {
    color: var(--ds-link);
    background: var(--ds-bg);
}

.profile-browser-session-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--ds-space-4);
}

.profile-browser-session-actions form {
    margin: 0;
}

.profile-browser-session-actions a {
    color: var(--ds-link);
}

.profile-workspace .profile-identity-form.change-data-layout {
    width: 100%;
    max-width: 720px;
    min-height: 0;
    margin: 0;
    padding: 0;
}

.profile-overview {
    display: flex;
    flex-direction: column;
    gap: var(--ds-space-6);
}

.profile-overview > section:not(.profile-hero) .profile-section-title {
    font-size: var(--ds-font-size-h3);
    font-weight: 600;
    line-height: var(--ds-line-height-h3);
}

.profile-overview > section .profile-section-description {
    font-size: var(--ds-font-size-bodySm);
    line-height: var(--ds-line-height-bodySm);
}

.profile-hero {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--ds-line);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-card);
    box-shadow: var(--ds-shadow-card);
}

.profile-hero::before {
    content: "";
    display: block;
    height: 88px;
    background: color-mix(in srgb, var(--ds-brand) 14%, var(--ds-card));
}

.profile-hero-body {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--ds-space-4);
    padding: 0 var(--ds-space-6) var(--ds-space-6);
}

.profile-hero-avatar {
    flex: 0 0 96px;
    width: 96px;
    height: 96px;
    margin-top: -48px;
    border: 4px solid var(--ds-card);
    border-radius: var(--ds-radius-pill);
    background-color: var(--ds-surface);
    background-position: center;
    background-size: cover;
    object-fit: cover;
}

.profile-hero-identity {
    flex: 1;
    min-width: 180px;
    padding-top: var(--ds-space-4);
}

.profile-hero-identity h1,
.profile-hero-identity h2 {
    margin: 0;
    color: var(--ds-ink);
    font-family: var(--ds-font-display);
    font-size: var(--ds-font-size-h3);
    font-weight: 600;
    line-height: var(--ds-line-height-h3);
    overflow-wrap: anywhere;
}

.profile-hero-actions {
    padding-top: var(--ds-space-4);
}

.profile-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--ds-space-2) var(--ds-space-3);
    margin: var(--ds-space-2) 0;
    color: var(--ds-ink-soft);
    font-size: var(--ds-font-size-caption);
    line-height: var(--ds-line-height-caption);
}

.profile-meta .material-icons-outlined {
    font-size: 16px;
    vertical-align: middle;
}

.profile-hero-bio {
    margin: var(--ds-space-3) 0 0;
    max-width: 720px;
    white-space: pre-line;
    overflow-wrap: anywhere;
    font-size: var(--ds-font-size-bodySm);
    line-height: var(--ds-line-height-bodySm);
}

.profile-stat-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: var(--ds-space-4);
}

.profile-stat-grid--month {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.profile-stat-card {
    display: flex;
    flex-direction: column;
    gap: var(--ds-space-2);
    min-width: 0;
    min-height: 168px;
    padding: var(--ds-space-4);
    border: 1px solid var(--ds-line);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-card);
    color: var(--ds-ink);
    box-shadow: var(--ds-shadow-card);
    text-decoration: none;
}

a.profile-stat-card:hover {
    border-color: var(--ds-brand-strong);
}

.profile-stat-value {
    font-family: var(--ds-font-display);
    font-size: var(--ds-font-size-h2);
    font-weight: 600;
    line-height: var(--ds-line-height-h2);
    overflow-wrap: anywhere;
}

.profile-stat-label {
    color: var(--ds-ink-soft);
    font-size: var(--ds-font-size-label);
    line-height: var(--ds-line-height-label);
}

.profile-stat-hint {
    color: var(--ds-ink-soft);
    font-size: var(--ds-font-size-caption);
    line-height: var(--ds-line-height-caption);
}

.profile-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: var(--ds-space-6);
}

.profile-dashboard-grid > .profile-panel {
    margin: 0;
}

.profile-panel-footer {
    display: block;
    margin-top: var(--ds-space-6);
    padding-top: var(--ds-space-4);
    border-top: 1px solid var(--ds-line);
    color: var(--ds-link);
    text-decoration: none;
}

.profile-panel-footer a {
    color: var(--ds-link);
    text-decoration: none;
}

.profile-memory-privacy {
    position: absolute;
    top: var(--ds-space-3);
    left: var(--ds-space-3);
    max-width: calc(100% - var(--ds-space-6));
    padding: var(--ds-space-1) var(--ds-space-2);
    border-radius: var(--ds-radius-pill);
    background: var(--ds-card);
    color: var(--ds-ink-soft);
    font-size: var(--ds-font-size-caption);
    line-height: var(--ds-line-height-caption);
}

.profile-memory-image {
    position: relative;
}

.profile-memory-body p {
    margin: var(--ds-space-1) 0 0;
    color: var(--ds-ink-soft);
    font-size: var(--ds-font-size-caption);
    line-height: var(--ds-line-height-caption);
}

.profile-notice {
    padding: var(--ds-space-4);
    border: 1px solid var(--ds-line);
    border-left: 3px solid var(--ds-success-text);
    border-radius: var(--ds-radius-md);
    background: var(--ds-card);
    color: var(--ds-ink);
}

.profile-empty-state {
    grid-column: 1 / -1;
    color: var(--ds-ink-soft);
    text-align: center;
}

.profile-empty-state h3 {
    color: var(--ds-ink);
    font-family: var(--ds-font-display);
    font-size: var(--ds-font-size-h3);
    line-height: var(--ds-line-height-h3);
}

.profile-balance-row {
    display: flex;
    align-items: center;
    gap: var(--ds-space-3);
    min-height: 48px;
    margin-bottom: var(--ds-space-3);
    color: var(--ds-ink-soft);
    font-size: var(--ds-font-size-label);
}

.profile-balance-row strong {
    margin-left: auto;
    color: var(--ds-ink);
    font-size: var(--ds-font-size-h4);
    font-variant-numeric: tabular-nums;
}

.profile-workspace :is(.profile-memory-grid, .memory-grid, .moment-grid, .sm-cards-grid, .vh-cards-grid) {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: var(--ds-space-6) !important;
    min-width: 0;
}

/* The older library templates set presentation inline; these overrides keep their controls and handlers intact. */
.profile-workspace :is(.memory-card, .moment-card, .sm-card, .vh-card, .profile-memory-card) {
    display: flex;
    flex-direction: column;
    position: relative;
    min-width: 0;
    width: 100%;
    border: 1px solid var(--ds-line) !important;
    border-radius: var(--ds-radius-lg) !important;
    background: var(--ds-card) !important;
    color: var(--ds-ink);
    box-shadow: var(--ds-shadow-card);
    text-decoration: none;
    overflow: hidden;
}

.profile-workspace :is(.memory-card, .moment-card, .sm-card, .vh-card):hover {
    transform: none !important;
    box-shadow: var(--ds-shadow-elevated) !important;
}

.profile-workspace :is(.memory-image, .moment-image, .sm-card-img, .vh-card-img, .profile-memory-image) {
    flex: none;
    width: 100%;
    height: auto !important;
    aspect-ratio: 4 / 3;
    background-color: var(--ds-surface) !important;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.profile-workspace :is(.memory-image, .moment-image, .sm-card-img, .vh-card-img, .profile-memory-image) img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-workspace :is(.memory-info, .moment-info, .sm-card-body, .vh-card-body, .profile-memory-body) {
    min-width: 0;
    padding: var(--ds-space-4) !important;
    background: var(--ds-card);
}

.profile-workspace :is(.memory-info h3, .moment-info h3, .sm-card-title, .vh-card-title, .profile-memory-body h3) {
    margin: 0 0 var(--ds-space-1);
    color: var(--ds-ink) !important;
    font-family: var(--ds-font-sans) !important;
    font-size: var(--ds-font-size-body) !important;
    font-weight: 500 !important;
    line-height: var(--ds-line-height-body) !important;
    overflow-wrap: anywhere;
}

.profile-workspace :is(.memory-info h4, .moment-info h4) {
    margin: 0 0 var(--ds-space-1) !important;
    color: var(--ds-ink) !important;
    font-family: var(--ds-font-sans) !important;
    font-size: var(--ds-font-size-body) !important;
    font-weight: 500 !important;
    line-height: var(--ds-line-height-body) !important;
    overflow-wrap: anywhere;
}

.profile-workspace :is(.memory-image, .moment-image) .status-badge {
    left: var(--ds-space-3);
    right: auto !important;
    max-width: calc(100% - var(--ds-space-6));
    border-radius: var(--ds-radius-pill) !important;
    background: var(--ds-card) !important;
    color: var(--ds-success-text) !important;
    font-size: var(--ds-font-size-caption) !important;
    line-height: var(--ds-line-height-caption);
}

.profile-workspace :is(.memory-image, .moment-image) .status-badge.published {
    display: none;
}

.profile-workspace :is(.view-memory-btn, .view-moment-btn) {
    flex: none !important;
    min-height: 40px;
    padding: var(--ds-space-2) var(--ds-space-3) !important;
    border: 1px solid var(--ds-input-border) !important;
    border-radius: var(--ds-radius-md) !important;
    background: var(--ds-card) !important;
    color: var(--ds-ink) !important;
    font-family: var(--ds-font-sans) !important;
    font-size: var(--ds-font-size-bodySm) !important;
}

.profile-workspace :is(.sm-card-meta, .vh-card-meta, .memory-event-date, .engagement-stats, .profile-memory-meta) {
    color: var(--ds-ink-soft) !important;
    font-size: var(--ds-font-size-caption) !important;
    line-height: var(--ds-line-height-caption);
}

.profile-workspace :is(.memory-controls, .moment-controls, .sm-controls, .vh-controls) {
    align-items: flex-end !important;
    gap: var(--ds-space-4) !important;
    margin-bottom: var(--ds-space-6) !important;
}

.profile-workspace :is(.memory-controls, .moment-controls) > div {
    min-width: 0 !important;
}

.profile-workspace :is(.memory-controls, .moment-controls) > div:first-child {
    flex: 1;
    width: auto !important;
    max-width: 420px;
}

.profile-workspace :is(.memory-controls, .moment-controls) > div:last-child {
    flex-wrap: wrap;
}

.profile-workspace :is(#memory-search, #moment-search, #memory-sort, #moment-sort, .sm-search-input, .vh-search-input, .sm-sort-select, .vh-sort-select) {
    max-width: 100%;
    min-height: 48px;
    border: 1px solid var(--ds-input-border) !important;
    border-radius: var(--ds-radius-sm) !important;
    background: var(--ds-bg) !important;
    color: var(--ds-ink) !important;
    font-family: var(--ds-font-sans) !important;
    font-size: var(--ds-font-size-body) !important;
    line-height: var(--ds-line-height-body);
}

.profile-workspace :is(.sm-time-label, .vh-time-label) {
    margin-bottom: var(--ds-space-4);
    color: var(--ds-ink-soft);
    font-size: var(--ds-font-size-label);
}

.profile-workspace :is(.sm-time-group, .vh-time-group) {
    margin-bottom: var(--ds-space-8);
}

.profile-workspace .collections-panel {
    max-width: none;
}

.profile-workspace .coll-row {
    min-height: 88px;
    margin-bottom: var(--ds-space-3);
    padding: var(--ds-space-4);
    border: 1px solid var(--ds-line);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-card);
    box-shadow: var(--ds-shadow-card);
}

.profile-workspace .coll-thumb {
    width: 64px;
    height: 64px;
    min-width: 64px;
    border-radius: var(--ds-radius-md);
}

.profile-workspace .coll-name {
    font-family: var(--ds-font-sans);
    font-size: var(--ds-font-size-body);
    font-weight: 500;
}

.profile-blox-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--ds-space-6);
}

.profile-blox-summary {
    display: flex;
    align-items: center;
    gap: var(--ds-space-3);
    min-width: 0;
    min-height: 90px;
    padding: var(--ds-space-4);
    border: 1px solid var(--ds-line);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-card);
    color: var(--ds-ink);
    text-decoration: none;
    box-shadow: var(--ds-shadow-card);
}

.profile-workspace .at-wallets-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--ds-space-6);
}

.profile-workspace #user-assets {
    position: relative;
}

.profile-wallet-toolbar {
    display: flex;
    justify-content: flex-end;
    position: absolute;
    top: var(--ds-space-4);
    right: 0;
}

.profile-workspace #user-assets > .profile-section-header .profile-heading-copy {
    padding-right: 180px;
}

.profile-balance-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--ds-space-6);
    margin-bottom: var(--ds-space-6);
}

.profile-workspace .profile-balance-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--ds-space-2);
    min-height: 266px;
    margin-bottom: 0;
}

.profile-balance-card h2 {
    margin: 0;
    color: var(--ds-ink-soft);
    font-family: var(--ds-font-sans);
    font-size: var(--ds-font-size-label);
    font-weight: 500;
    line-height: var(--ds-line-height-label);
}

.profile-balance-card .profile-stat-value {
    margin: 0;
    font-size: var(--ds-font-size-h1);
    font-weight: 700;
    line-height: var(--ds-line-height-h1);
}

.profile-stat-caption {
    margin: 0;
    color: var(--ds-ink-soft);
    font-size: var(--ds-font-size-bodySm);
    line-height: var(--ds-line-height-bodySm);
}

.profile-balance-activity {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    margin-top: auto;
    color: var(--ds-ink);
    font-size: var(--ds-font-size-label);
    text-decoration: none;
}

.profile-wallet-blox-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--ds-space-4);
}

.profile-wallet-blox-summary p {
    flex: 1;
    min-width: 0;
    margin: 0;
}

.profile-wallet-blox-summary a {
    display: inline-flex;
    align-items: center;
    color: var(--ds-link);
    font-size: var(--ds-font-size-bodySm);
    text-decoration: none;
}

.profile-wallet-activity .at-history-tabs {
    display: flex;
    width: fit-content;
    max-width: 100%;
    margin-bottom: var(--ds-space-4);
}

.profile-wallet-all-activity {
    margin-top: var(--ds-space-6);
}

.profile-workspace .profile-wallet-connections .at-wallet-card {
    display: flex;
    align-items: center;
    gap: var(--ds-space-3);
    width: 100%;
    margin-top: var(--ds-space-4);
    padding: var(--ds-space-4);
    border-radius: var(--ds-radius-sm);
    background: var(--ds-bg);
    box-shadow: none;
}

.profile-wallet-connections .at-wallet-body {
    flex: 1;
    min-width: 0;
}

.profile-wallet-connections-compact .at-wallet-card {
    margin-top: 0;
}

.profile-status-message:empty {
    display: none;
}

.profile-blox-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--ds-space-4);
    margin-bottom: var(--ds-space-6);
}

.profile-blox-stats .profile-stat-tile {
    margin-bottom: 0;
    text-decoration: none;
}

.profile-blox-stats .profile-stat-value {
    margin: 0;
}

.profile-blox-metarent-summary > summary {
    min-height: 40px;
    color: var(--ds-ink);
    cursor: pointer;
}

.profile-blox-summary-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--ds-space-4);
    margin: var(--ds-space-4) 0 0;
}

.profile-blox-summary-details dt {
    color: var(--ds-ink-soft);
    font-size: var(--ds-font-size-bodySm);
}

.profile-blox-summary-details dd {
    margin: var(--ds-space-1) 0 0;
    font-size: var(--ds-font-size-h4);
    font-weight: 600;
}

.profile-blox-sort {
    margin-bottom: var(--ds-space-6);
}

.profile-blox-sort label {
    display: block;
    margin-bottom: var(--ds-space-2);
    font-size: var(--ds-font-size-label);
    font-weight: 500;
}

.profile-blox-sort > div {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--ds-space-3);
}

.profile-blox-sort select {
    min-height: 48px;
    max-width: 100%;
    padding: var(--ds-space-3) var(--ds-space-4);
    border: 1px solid var(--ds-input-border);
    border-radius: var(--ds-radius-sm);
    background: var(--ds-bg);
    color: var(--ds-ink);
    font: inherit;
}

.profile-workspace .blox-gallery-for-user:has(.profile-blox-city) {
    display: block;
}

.profile-blox-city {
    margin-bottom: var(--ds-space-8);
}

.profile-blox-city-heading {
    display: flex;
    align-items: center;
    gap: var(--ds-space-3);
    min-height: 56px;
    margin-bottom: var(--ds-space-4);
    list-style: none;
    font-family: var(--ds-font-display);
    font-size: var(--ds-font-size-h3);
    font-weight: 600;
    line-height: var(--ds-line-height-h3);
    cursor: pointer;
}

.profile-blox-city-heading::-webkit-details-marker {
    display: none;
}

.profile-blox-city-heading > .material-icons-outlined {
    margin-left: auto;
}

.profile-blox-city-heading .profile-section-description {
    margin: 0;
    font-family: var(--ds-font-sans);
    font-size: var(--ds-font-size-bodySm);
    font-weight: 400;
    line-height: var(--ds-line-height-bodySm);
}

.profile-blox-city-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--ds-space-6);
}

.profile-workspace .profile-blox-city-grid .blox-card-panel {
    width: 100%;
}

.profile-workspace .at-wallet-card,
.profile-workspace .at-history-panel,
.profile-workspace .at-token-card {
    min-width: 0;
    border: 1px solid var(--ds-line);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-card);
    color: var(--ds-ink);
    box-shadow: var(--ds-shadow-card);
}

.profile-workspace .at-wallet-addr {
    overflow-wrap: anywhere;
    white-space: normal;
}

.profile-workspace .at-tokens-layout {
    display: flex;
    flex-direction: column;
    gap: var(--ds-space-6);
}

.profile-workspace .at-token-cards-col {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--ds-space-6);
    width: 100%;
    min-width: 0;
}

.profile-workspace .at-token-card {
    width: 100%;
    min-height: 160px;
    padding: var(--ds-space-6);
}

.profile-workspace .at-token-card--active {
    border-color: var(--ds-brand-strong);
    background: var(--ds-card);
}

.profile-workspace .at-token-value {
    font-family: var(--ds-font-display);
    font-size: var(--ds-font-size-h1);
    line-height: var(--ds-line-height-h1);
    font-variant-numeric: tabular-nums;
}

.profile-workspace .at-history-panel {
    width: 100%;
    padding: var(--ds-space-6);
}

.profile-workspace .at-history-header {
    flex-wrap: wrap;
    gap: var(--ds-space-4);
}

.profile-workspace .at-history-title {
    font-family: var(--ds-font-display);
    font-size: var(--ds-font-size-h3);
    line-height: var(--ds-line-height-h3);
}

.profile-workspace .at-history-row {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr) auto;
    gap: var(--ds-space-4);
    min-height: 56px;
    border-bottom: 1px solid var(--ds-line);
}

.profile-workspace .at-history-note {
    min-width: 0;
    overflow-wrap: anywhere;
}

.profile-workspace .at-history-tabs {
    padding: var(--ds-space-1);
    border-radius: var(--ds-radius-pill);
    background: var(--ds-surface);
}

.profile-workspace .at-history-tab {
    min-height: 36px;
    padding: var(--ds-space-2) var(--ds-space-4);
    border: 0;
    border-radius: var(--ds-radius-pill);
    color: var(--ds-ink-soft);
    background: transparent;
}

.profile-workspace .at-history-tab--active {
    color: var(--ds-ink);
    background: var(--ds-card);
    box-shadow: var(--ds-shadow-card);
}

.profile-workspace .blox-gallery-for-user {
    gap: var(--ds-space-6);
}

.profile-workspace .blox-card-panel {
    width: calc((100% - var(--ds-space-12)) / 3);
    border-color: var(--ds-line);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-card);
}

.profile-workspace :is(.empty-state, .sm-empty-state, .vh-empty-state, .md-empty) {
    padding: var(--ds-space-12) var(--ds-space-6);
    border: 1px solid var(--ds-line);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-card);
    color: var(--ds-ink-soft);
    text-align: center;
}

.profile-workspace :is(.pagination, .sm-pagination, .vh-pagination, .md-pagination) {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--ds-space-3);
    margin-top: var(--ds-space-8);
}

.profile-workspace :is(.pagination-btn, .moment-pagination-btn, .sm-pagination-btn, .vh-pagination-btn) {
    min-height: 40px;
    border: 1px solid var(--ds-input-border);
    border-radius: var(--ds-radius-md);
    color: var(--ds-ink);
    background: var(--ds-card);
}

.profile-workspace .md-app {
    padding: 0;
    background: var(--ds-bg);
}

.profile-workspace .md-main {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.profile-workspace .md-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--ds-space-6);
}

.profile-workspace .md-tabs {
    flex-wrap: wrap;
}

.profile-workspace .md-filters {
    flex-wrap: wrap;
    gap: var(--ds-space-3);
}

.profile-workspace .md-filters > * {
    min-width: 0;
    max-width: 100%;
}

.profile-workspace .account-settings-layout {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
}

.profile-workspace .account-settings-sidebar {
    display: none;
}

.profile-workspace .account-settings-main {
    width: 100%;
    min-width: 0;
    max-width: none;
    margin: 0;
}

.profile-workspace.account-settings-page {
    padding-top: 0;
}

.profile-workspace.connections-page {
    padding-top: 0;
}

.profile-workspace .connection-management-container {
    width: 100%;
    max-width: 720px;
    margin: 0;
    padding: 0;
}

.profile-workspace .connection-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ds-space-2);
    border: 0;
    margin-bottom: var(--ds-space-6);
}

.profile-workspace .connection-tabs .tab-btn {
    min-height: 40px;
    padding: var(--ds-space-2) var(--ds-space-4);
    border: 1px solid var(--ds-line);
    border-radius: var(--ds-radius-pill);
    background: var(--ds-card);
    color: var(--ds-ink);
}

.profile-workspace .connection-tabs .tab-btn.active {
    border-color: var(--ds-brand-strong);
    background: color-mix(in srgb, var(--ds-brand) 14%, var(--ds-card));
}

.profile-standing .profile-list-icon {
    color: var(--ds-success-text);
}

.profile-standing-restricted .profile-list-icon {
    color: var(--ds-error-text);
}

.profile-standing h2 {
    margin: 0 0 var(--ds-space-1);
    font-family: var(--ds-font-display);
    font-size: var(--ds-font-size-h3);
    line-height: var(--ds-line-height-h3);
}

.profile-restriction-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ds-space-2);
    margin: var(--ds-space-4) 0 0;
    padding: 0;
    list-style: none;
}

.profile-restriction-list li {
    padding: var(--ds-space-1) var(--ds-space-2);
    border: 1px solid var(--ds-error-text);
    border-radius: var(--ds-radius-pill);
    color: var(--ds-error-text);
    background: var(--ds-card);
    font-size: var(--ds-font-size-caption);
}

.profile-table-scroll {
    width: 100%;
    overflow-x: auto;
}

.profile-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--ds-ink);
    font-size: var(--ds-font-size-bodySm);
    line-height: var(--ds-line-height-bodySm);
    text-align: left;
}

.profile-table :is(th, td) {
    min-width: 96px;
    padding: var(--ds-space-3);
    border-bottom: 1px solid var(--ds-line);
    vertical-align: top;
}

.profile-table th {
    color: var(--ds-ink-soft);
    font-weight: 600;
}

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

.profile-support-banner {
    flex-wrap: wrap;
    padding: var(--ds-space-4);
    border: 1px solid var(--ds-line);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-card);
}

.profile-workspace .settings-heading {
    margin-bottom: var(--ds-space-6);
    padding-bottom: 0;
    border: 0;
}

.profile-workspace .nc-page {
    max-width: 720px;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: var(--ds-bg);
}

/* List views use the available workspace; forms keep their reading width. */
.profile-workspace :is(.follow-management-container, .connection-management-container, .nc-page.profile-reading-column) {
    width: 100%;
    max-width: none;
}

.profile-workspace a.profile-button-ghost {
    border: 1px solid transparent;
    background: transparent;
    color: var(--ds-link);
}

.profile-workspace a.account-settings-back {
    display: inline-flex;
    align-items: center;
    gap: var(--ds-space-2);
    min-height: 44px;
    color: var(--ds-link);
    text-decoration: none;
}

.profile-workspace a.account-settings-back:hover {
    text-decoration: underline;
}

.profile-notification-tabs,
.profile-segmented-control {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--ds-space-1);
    width: fit-content;
    max-width: 100%;
    margin: 0 0 var(--ds-space-6);
    padding: var(--ds-space-1);
    border-radius: var(--ds-radius-pill);
    background: var(--ds-surface);
}

.profile-notification-tabs a,
.profile-segmented-control a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: var(--ds-space-2) var(--ds-space-4);
    border-radius: var(--ds-radius-pill);
    color: var(--ds-ink-soft);
    font-size: var(--ds-font-size-label);
    line-height: var(--ds-line-height-label);
    text-decoration: none;
}

.profile-notification-tabs a[aria-current="page"],
.profile-segmented-control a[aria-current="page"] {
    background: var(--ds-card);
    color: var(--ds-ink);
    box-shadow: var(--ds-shadow-card);
}

.profile-insights-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--ds-space-4);
    margin-bottom: var(--ds-space-6);
}

.profile-insights-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--ds-space-4);
    margin-bottom: var(--ds-space-6);
}

.profile-stat-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--ds-space-2);
    min-width: 0;
    padding: var(--ds-space-4);
    border: 1px solid var(--ds-line);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-card);
    box-shadow: var(--ds-shadow-card);
}

.profile-stat-tile > .material-icons-outlined {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--ds-radius-md);
    background: var(--ds-surface);
    color: var(--ds-ink-soft);
    font-size: 24px;
}

.profile-stat-tile strong {
    font-family: var(--ds-font-display);
    font-size: var(--ds-font-size-h2);
    font-weight: 600;
    line-height: var(--ds-line-height-h2);
    overflow-wrap: anywhere;
}

.profile-stat-tile h2 {
    margin: 0;
    color: var(--ds-ink-soft);
    font-family: var(--ds-font-sans);
    font-size: var(--ds-font-size-label);
    font-weight: 500;
    line-height: var(--ds-line-height-label);
}

.profile-performance-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--ds-space-6);
    margin-bottom: var(--ds-space-6);
}

.profile-performance-grid progress {
    display: block;
    width: 100%;
    height: 8px;
    border: 0;
    border-radius: var(--ds-radius-pill);
    accent-color: var(--ds-brand-strong);
    overflow: hidden;
}

.profile-performance-grid progress::-webkit-progress-bar {
    background: var(--ds-surface);
}

.profile-performance-grid progress::-webkit-progress-value {
    background: var(--ds-brand-strong);
}

.profile-ranked-memories {
    margin: 0;
    padding-left: var(--ds-space-6);
}

.profile-ranked-memories li {
    padding: var(--ds-space-4) 0;
    border-bottom: 1px solid var(--ds-line);
}

.profile-ranked-memories li:last-child {
    border-bottom: 0;
}

.profile-ranked-memory {
    display: flex;
    align-items: flex-start;
    gap: var(--ds-space-4);
    min-width: 0;
    color: var(--ds-ink);
    text-decoration: none;
}

.profile-ranked-memory img {
    flex: 0 0 96px;
    width: 96px;
    height: 96px;
    border-radius: var(--ds-radius-md);
    object-fit: cover;
}

.profile-ranked-memory-content {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.profile-ranked-memory-content h3 {
    margin: 0 0 var(--ds-space-2);
    font-size: var(--ds-font-size-body);
    font-weight: 500;
    line-height: var(--ds-line-height-body);
}

.profile-memory-metrics {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--ds-space-2) var(--ds-space-4);
    color: var(--ds-ink-soft);
    font-size: var(--ds-font-size-bodySm);
    line-height: var(--ds-line-height-bodySm);
}

.public-profile-page .public-profile-main {
    max-width: 1112px;
    padding: var(--ds-space-8) var(--ds-space-6) var(--ds-space-16);
}

.public-profile-page .public-profile-card {
    border: 1px solid var(--ds-line);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-card);
}

.public-profile-page .public-profile-accent {
    height: 88px;
    background: color-mix(in srgb, var(--ds-brand) 14%, var(--ds-card));
}

.public-profile-page .public-profile-avatar {
    width: 96px;
    height: 96px;
    border: 4px solid var(--ds-card);
}

.public-profile-page .public-profile-bio {
    font-size: var(--ds-font-size-body);
    line-height: var(--ds-line-height-body);
}

@media (max-width: 1199px) and (min-width: 813px) {
    .profile-workspace :is(.profile-content-area, .profile-main) {
        padding-right: var(--ds-space-6);
        padding-left: var(--ds-space-6);
    }

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

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

    .profile-workspace :is(.profile-memory-grid, .memory-grid, .moment-grid, .sm-cards-grid, .vh-cards-grid) {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .profile-dashboard-grid,
    .profile-blox-grid,
    .profile-workspace .at-wallets-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .profile-workspace .blox-card-panel {
        width: calc((100% - var(--ds-space-6)) / 2);
    }

    .profile-workspace .at-token-cards-col {
        gap: var(--ds-space-3);
    }

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

    .profile-balance-cards {
        gap: var(--ds-space-3);
    }

    .profile-workspace .at-token-card {
        padding: var(--ds-space-4);
    }

    .profile-workspace .at-history-row {
        grid-template-columns: 96px minmax(0, 1fr) auto;
    }
}

@media (max-width: 812px) {
    .profile-page-nav {
        padding: 0 var(--ds-space-2);
    }

    .profile-page-nav .profile-page-logo {
        transform: scale(.8);
        transform-origin: center;
    }

    .profile-workspace .profile-sidebar {
        display: none;
    }

    .profile-nav-actions {
        display: flex;
        min-width: 0;
    }

    .profile-nav-actions .profile-desktop-logout {
        display: none;
    }

    .profile-mobile-menu {
        display: block;
        justify-self: end;
    }

    .profile-mobile-menu > summary {
        list-style: none;
    }

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

    .profile-mobile-menu-panel {
        position: absolute;
        top: var(--profile-header-height);
        right: 0;
        width: min(360px, 100vw);
        max-height: calc(100dvh - var(--profile-header-height));
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: var(--ds-space-6) var(--ds-space-4);
        border: 1px solid var(--ds-line);
        border-top: 0;
        border-radius: 0 0 0 var(--ds-radius-lg);
        background: var(--ds-elevated);
        box-shadow: var(--ds-shadow-elevated);
    }

    .profile-mobile-menu-panel .sidebar-nav {
        display: flex;
        flex-direction: column;
        gap: var(--ds-space-4);
    }

    .profile-layout.profile-workspace {
        display: block;
        margin-top: var(--profile-header-height);
        width: 100%;
        min-height: calc(100dvh - var(--profile-header-height));
    }

    .profile-workspace :is(.profile-content-area, .profile-main) {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: var(--ds-space-6) var(--ds-space-4) var(--ds-space-12);
    }

    .profile-mobile-subnav {
        box-sizing: border-box;
        display: flex;
        gap: var(--ds-space-2);
        width: 100%;
        min-width: 0;
        max-width: 100%;
        min-height: 56px;
        padding: var(--ds-space-3) var(--ds-space-4);
        overflow-x: auto;
        background: var(--ds-bg);
        scrollbar-width: thin;
        margin-top: var(--profile-header-height);
    }

    .profile-mobile-subnav .mobile-tabs-scroll {
        display: flex;
        flex-wrap: nowrap;
        gap: var(--ds-space-2);
        width: max-content;
        min-width: 0;
        max-width: none;
        margin: 0;
        padding: 0;
        overflow: visible;
    }

    .profile-mobile-subnav ~ .profile-layout.profile-workspace {
        margin-top: 0;
    }

    .profile-mobile-subnav .mobile-tab {
        box-sizing: border-box;
        display: inline-flex;
        flex-direction: row;
        align-items: center;
        gap: var(--ds-space-1);
        flex: none;
        width: auto;
        min-height: 32px;
        margin: 0;
        padding: var(--ds-space-1) var(--ds-space-3);
        border: 1px solid var(--ds-line);
        border-radius: var(--ds-radius-pill);
        color: var(--ds-ink);
        background: var(--ds-card);
        font-size: var(--ds-font-size-bodySm);
        line-height: var(--ds-line-height-bodySm);
        text-decoration: none;
    }

    .profile-mobile-subnav .mobile-tab .side-tab-icon {
        display: none;
    }

    .profile-mobile-subnav .mobile-tab-active {
        border-color: var(--ds-brand-strong);
        background: color-mix(in srgb, var(--ds-brand) 14%, var(--ds-card));
    }

    .profile-section-title,
    .profile-section-header h1,
    .profile-workspace .content-section-title,
    .profile-workspace .account-settings-title,
    .profile-page-heading h1 {
        font-size: var(--ds-font-size-h2);
        line-height: var(--ds-line-height-h2);
    }

    .profile-section-header,
    .profile-workspace .content-section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .profile-section-actions,
    .profile-section-actions > :is(a, button) {
        width: 100%;
    }

    .profile-wallet-toolbar {
        position: static;
        margin-bottom: var(--ds-space-6);
    }

    .profile-wallet-toolbar > button {
        width: 100%;
    }

    .profile-workspace #user-assets > .profile-section-header .profile-heading-copy {
        padding-right: 0;
    }

    .profile-balance-cards,
    .profile-blox-city-grid,
    .profile-blox-summary-details {
        grid-template-columns: minmax(0, 1fr);
    }

    .profile-blox-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--ds-space-3);
    }

    .profile-workspace .profile-balance-card {
        min-height: 240px;
    }

    .profile-workspace :is(.btn-primary, .btn-outline, .btn-secondary, .btn-outline-danger, .profile-button) {
        min-height: 48px;
    }

    .profile-workspace :is(.profile-panel, .settings-card, .account-settings-card) {
        padding: var(--ds-space-4);
    }

    .profile-workspace .settings-card-title {
        font-size: var(--ds-font-size-h4);
        line-height: var(--ds-line-height-h4);
    }

    .profile-hero::before {
        height: 72px;
    }

    .profile-hero-body {
        gap: var(--ds-space-3);
        padding-right: var(--ds-space-4);
        padding-left: var(--ds-space-4);
    }

    .profile-hero-avatar {
        flex-basis: 64px;
        width: 64px;
        height: 64px;
        margin-top: -32px;
    }

    .profile-hero-identity {
        min-width: 0;
        padding-top: var(--ds-space-3);
    }

    .profile-hero-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        padding-top: 0;
    }

    .profile-hero-actions > :is(a, button) {
        width: 100%;
        min-width: 0;
    }

    .profile-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--ds-space-3);
    }

    .profile-person-actions {
        margin-left: auto;
    }

    .profile-photo-row .profile-hero-avatar {
        width: 96px;
        height: 96px;
        flex-basis: 96px;
    }

    .profile-insights-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--ds-space-3);
    }

    .profile-performance-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--ds-space-4);
    }

    .profile-ranked-memory {
        gap: var(--ds-space-3);
    }

    .profile-ranked-memory img {
        flex-basis: 64px;
        width: 64px;
        height: 64px;
    }

    .profile-stat-card {
        min-height: 148px;
    }

    .profile-dashboard-grid,
    .profile-blox-grid,
    .profile-workspace .at-wallets-row {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--ds-space-4);
    }

    .profile-list-row {
        gap: var(--ds-space-2);
    }

    .profile-list-value {
        max-width: 100px;
        font-size: var(--ds-font-size-caption);
    }

    #profile-username-title + .profile-list-row {
        flex-wrap: wrap;
    }

    #profile-username-title + .profile-list-row .profile-list-content {
        flex-basis: calc(100% - 52px);
    }

    #profile-username-title + .profile-list-row .btn-outline {
        margin-left: 52px;
    }

    .profile-workspace :is(.profile-memory-grid, .memory-grid, .moment-grid, .sm-cards-grid, .vh-cards-grid) {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: var(--ds-space-3) !important;
    }

    .profile-workspace :is(.memory-card, .moment-card, .vh-card, .profile-memory-card) {
        display: grid;
        grid-template-columns: 96px minmax(0, 1fr);
        align-items: start;
        gap: var(--ds-space-3);
        min-height: 120px;
        padding: var(--ds-space-3);
    }

    .profile-workspace .sm-card-link {
        display: grid;
        grid-template-columns: 96px minmax(0, 1fr);
        gap: var(--ds-space-3);
        padding: var(--ds-space-3);
    }

    .profile-workspace :is(.memory-image, .moment-image, .sm-card-img, .vh-card-img, .profile-memory-image) {
        width: 96px;
        height: 96px !important;
        aspect-ratio: 1;
        border-radius: var(--ds-radius-md);
    }

    .profile-workspace :is(.memory-info, .moment-info, .sm-card-body, .vh-card-body, .profile-memory-body) {
        padding: 0 !important;
    }

    .profile-workspace :is(.memory-image, .moment-image) {
        position: static !important;
    }

    .profile-workspace :is(.memory-image, .moment-image) img {
        border-radius: var(--ds-radius-md);
    }

    .profile-workspace :is(.memory-image, .moment-image) .status-badge.rooted {
        top: var(--ds-space-3) !important;
        left: 120px;
        right: 44px !important;
        width: fit-content;
        max-width: calc(100% - 164px);
    }

    .profile-workspace .memory-card:has(.status-badge.rooted) .memory-info {
        padding-top: var(--ds-space-8) !important;
    }

    .profile-workspace :is(.memory-edit-btn, .moment-edit-btn) {
        top: var(--ds-space-2) !important;
        right: var(--ds-space-2) !important;
    }

    .profile-workspace :is(.memory-info h4, .moment-info h4) {
        padding-right: var(--ds-space-6);
    }

    .profile-workspace :is(.memory-controls, .moment-controls, .sm-controls, .vh-controls) {
        display: flex;
        flex-direction: column;
        align-items: stretch !important;
    }

    .profile-workspace :is(.memory-controls, .moment-controls) > div,
    .profile-workspace :is(.memory-controls, .moment-controls) > div:first-child,
    .profile-workspace :is(.sm-search-wrap, .vh-search-wrap, .sm-sort-wrap, .vh-sort-wrap) {
        width: 100% !important;
        max-width: none;
    }

    .profile-workspace :is(#memory-sort, #moment-sort, .sm-sort-select, .vh-sort-select) {
        flex: 1;
        width: 100%;
        min-width: 0;
    }

    .profile-workspace .at-token-cards-col {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--ds-space-3);
    }

    .profile-workspace .at-token-card {
        min-height: 128px;
        padding: var(--ds-space-4);
    }

    .profile-workspace .at-history-panel {
        padding: var(--ds-space-4);
    }

    .profile-workspace .at-history-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: var(--ds-space-1) var(--ds-space-3);
        padding: var(--ds-space-3) 0;
    }

    .profile-workspace .at-history-ts {
        grid-column: 1 / -1;
    }

    .profile-workspace .at-history-tabs {
        width: 100%;
        display: flex;
        flex-wrap: nowrap;
    }

    .profile-workspace .at-history-tab {
        flex: 1;
        min-width: 0;
        padding-right: var(--ds-space-2);
        padding-left: var(--ds-space-2);
    }

    .profile-workspace .blox-card-panel {
        width: 100%;
    }

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

    .profile-workspace .coll-row {
        padding: var(--ds-space-3);
    }

    .public-profile-page .public-profile-main {
        padding: var(--ds-space-6) var(--ds-space-4) var(--ds-space-12);
    }

    .public-profile-page .public-profile-avatar {
        width: 64px;
        height: 64px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .profile-workspace *,
    .profile-page-nav * {
        scroll-behavior: auto;
        transition-duration: 0s;
        animation-duration: 0s;
    }
}
