.dashboard-shell {
    min-height: 100vh;
    --shell-header-gradient: linear-gradient(90deg, var(--shell-header), var(--shell-header-end));
    background: var(--shell-header-gradient) fixed;
    --shell-muted: #a9b8c7;
}

.dashboard-shell .shell-appbar {
    background: var(--shell-header-gradient) fixed;
    color: #f3f6fa;
}

.shell-appbar .mud-toolbar {
    gap: 12px;
    padding-inline: 24px;
    min-height: 72px;
}

.shell-appbar .mud-icon-button { border-radius: 10px; }
.shell-appbar .mud-icon-button:hover { background: #ffffff12; }
.shell-clock { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.shell-clock .mud-typography { font-size: 13px; font-variant-numeric: tabular-nums; }
.shell-clock > span { color: #bbcbd6; font-size: 10px; letter-spacing: .04em; }
.shell-environment {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    padding: 8px 12px;
    border: 1px solid #ffffff25;
    border-radius: 9px;
    background: #ffffff08;
    font-size: 13px;
    font-weight: 600;
}
.shell-avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid #ffffff45;
    background: #e4edf3;
    color: #2f4657;
    font-size: 12px;
    font-weight: 700;
}

.dashboard-shell .shell-sidebar {
    background: linear-gradient(160deg, var(--shell-sidebar), color-mix(in srgb, var(--shell-sidebar), #101820 25%));
    color: #cbd4de;
    border: 0;
}
.shell-sidebar .mud-drawer-content { overflow: hidden; }
.shell-sidebar .shell-brand {
    display: flex;
    align-items: center;
    min-height: 96px;
    padding: 14px;
    gap: 12px;
    flex-shrink: 0;
}
.shell-brand .shell-avatar { width: 42px; height: 42px; font-size: 15px; }
.shell-account { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; padding: 10px; border-radius: 12px; color: inherit; text-decoration: none; transition: background-color 120ms ease; }
.shell-account:hover, .shell-account:focus-visible { background: #ffffff12; }
.shell-account-details { min-width: 0; }
.shell-brand-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; line-height: 24px; font-weight: 650; letter-spacing: -.025em; color: #f5f7fa; }
.shell-brand-caption { display: block; margin-top: 3px; font-size: 11px; color: var(--shell-muted); }
.shell-navigation { flex: 1; min-height: 0; overflow: auto; padding: 4px 14px 20px; scrollbar-width: thin; scrollbar-color: #ffffff28 transparent; }
.shell-nav .mud-nav-item { margin-block: 3px; }
.shell-nav .mud-nav-link {
    min-height: 44px;
    padding: 11px 13px;
    border-radius: 9px;
    color: #cbd4de;
    transition: background-color 120ms ease, color 120ms ease;
}
.shell-nav .mud-nav-link .mud-nav-link-text { font-size: 14px; line-height: 21px; margin-left: 13px; }
.shell-nav .mud-nav-link .mud-icon-root { color: #aab9c8; width: 20px; height: 20px; }
.shell-nav .mud-nav-link:hover { color: #fff; background: #ffffff0b; }
.dashboard-shell .shell-nav .mud-nav-link.active:not(.mud-nav-link-disabled) {
    color: #fff;
    background: color-mix(in srgb, var(--shell-accent) 17%, transparent);
    font-weight: 600;
}
.shell-nav .mud-nav-link.active .mud-icon-root { color: var(--shell-accent); }
.shell-nav .mud-navgroup > .mud-nav-link .mud-nav-link-expand-icon { width: 17px; height: 17px; color: #8293a4; }
.shell-nav .mud-navgroup .mud-navmenu { padding-left: 14px; }
.shell-nav .mud-navgroup .mud-navmenu .mud-nav-link { padding-left: 13px; }
.shell-nav .mud-navgroup .mud-navmenu .mud-nav-link-text { font-size: 12px; }
.shell-nav .mud-navgroup:has(.active) > .mud-nav-link { color: #fff; }
.shell-nav .mud-nav-link:focus-visible { outline: 2px solid var(--shell-accent); outline-offset: -2px; }

.shell-alerts { margin-top: 18px; }
.shell-alerts .mud-divider { border-color: #ffffff16; }
.shell-alerts .mud-text-secondary { color: var(--shell-muted) !important; font-size: 11px; }
.shell-alerts .mud-nav-link { border-radius: 8px; padding: 10px 13px; }
.shell-alerts .mud-nav-link-text { font-size: 12px; }
.shell-alerts .mud-icon-button { color: #aab9c8; }
.shell-alerts .mud-nav-link:hover, .shell-alerts .dashboard-alert:hover { background: #ffffff0a; }
.shell-alerts .mud-warning-text { color: #e6bd80 !important; }
.shell-alerts .mud-info-text { color: #9abbe4 !important; }
.shell-sidebar-footer { padding: 0 14px 18px; flex-shrink: 0; }
.shell-sidebar-footer .feedback-widget {
    margin: 0 0 14px !important;
    border: 0;
    border-top: 1px solid #ffffff16;
    border-radius: 0;
    color: #bdcbd7;
}
.shell-sidebar-footer .feedback-widget .mud-primary-text { color: #aab9c8 !important; }
.shell-sidebar-footer .feedback-widget .mud-typography { font-size: 13px; }
.shell-sidebar-footer .feedback-widget:hover { background: #ffffff08; }
.shell-client-connection.mud-button-root {
    width: 100%;
    padding: 13px 12px;
    border: 1px solid #ffffff1c;
    border-radius: 11px;
    background: #ffffff06;
    color: #e8edf2;
    text-align: left;
}
.shell-client-connection .mud-button-label { display: flex; gap: 10px; width: 100%; }
.shell-client-icon { display: grid; place-items: center; width: 32px; height: 36px; flex-shrink: 0; color: var(--shell-accent); }
.shell-client-label { flex: 1; min-width: 0; }
.shell-client-label strong { display: block; font-size: 12px; font-weight: 600; }
.shell-client-label > span { display: block; color: var(--shell-muted); font-size: 11px; margin-top: 2px; }
.shell-client-connection .mud-button-label > .mud-icon-root { color: #9cacba; flex-shrink: 0; }
.shell-client-connection.mud-button-root:hover { background: #ffffff10; border-color: #ffffff35; }
.shell-client-connection.mud-button-root:focus-visible { outline: 2px solid var(--shell-accent); outline-offset: 3px; }

.shell-content-surface {
    min-height: calc(100vh - 72px);
    border-radius: 18px 0 0 0;
    background: #f4f6f8;
    padding-block: 26px 40px;
}
.shell-page-container {
    --admin-page-width-scale: 1.25;
    padding-inline: 28px !important;
    max-width: calc(1336px * var(--admin-page-width-scale)) !important;
    margin-inline: auto;
}
/* Scale page containers, keeping control and dialog dimensions unchanged. */
.shell-page-container .mud-container-maxwidth-xs { max-width: calc(444px * var(--admin-page-width-scale)); }
.shell-page-container .mud-container-maxwidth-sm { max-width: calc(600px * var(--admin-page-width-scale)); }
.shell-page-container .mud-container-maxwidth-md { max-width: calc(960px * var(--admin-page-width-scale)); }
.shell-page-container .mud-container-maxwidth-lg { max-width: calc(1280px * var(--admin-page-width-scale)); }
.shell-page-container .mud-container-maxwidth-xl { max-width: calc(1920px * var(--admin-page-width-scale)); }
.shell-page-container .mud-container-maxwidth-xxl { max-width: calc(2560px * var(--admin-page-width-scale)); }
.shell-page-container .admin-page-compact { width: 100%; max-width: calc(1120px * var(--admin-page-width-scale)); margin-inline: auto; }
.shell-page-container .admin-page-narrow { width: 100%; max-width: calc(880px * var(--admin-page-width-scale)); margin-inline: auto; }
.admin-page-compact > .flex-row, .admin-page-narrow > .flex-row { flex-wrap: wrap; }
/* Flat page wrappers share the canvas; actual cards and tables keep their surfaces. */
.shell-page-container > .mud-paper.mud-elevation-0:not(.mud-paper-outlined):not(.mud-table):not(.mud-card),
.shell-page-container > .mud-container > .mud-paper.mud-elevation-0:not(.mud-paper-outlined):not(.mud-table):not(.mud-card) {
    background: transparent;
}
.admin-table-date { display: inline-block; white-space: nowrap; font-variant-numeric: tabular-nums; }
.admin-table-date > span { display: block; color: var(--mud-palette-text-secondary); font-size: 11px; }
.shell-main .mud-table { font-variant-numeric: tabular-nums; }

.shell-page-container .dashboard-page { min-width: 0; padding-top: 0; margin-top: 0; }
.shell-page-container .dashboard-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    height: auto;
    min-height: 40px;
    margin-block: 0 16px;
}
.shell-page-container .dashboard-page-header > * { min-width: 0; }
.shell-page-container .dashboard-page-header .dashboard-page-heading { margin-bottom: 0; }
.shell-page-container .flex-column > .dashboard-page-header { margin-bottom: 0; }
.shell-page-container .dashboard-page-header .flex-column:has(.dashboard-page-heading) { row-gap: 4px !important; }

.shell-page-container .dashboard-page-heading,
.shell-page-container .dashboard-page-title-input input {
    font-family: var(--mud-typography-default-family);
    font-size: 24px;
    line-height: 32px;
    font-weight: 600;
    letter-spacing: -.02em;
    color: var(--mud-palette-text-primary);
    text-align: start;
    min-width: 0;
    overflow-wrap: anywhere;
}
.shell-page-container .dashboard-page-heading { min-height: 40px; padding-block: 4px; align-self: flex-start; }
.shell-page-container .dashboard-page-heading:focus { outline: none; }
.shell-page-container .flex-row:has(> .dashboard-page-heading) {
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.shell-page-container .dashboard-page-heading { margin-block: 0 16px; }
.shell-page-container .flex-row > .dashboard-page-heading { margin-block: 0; }
@media (max-width: 600px) {
    .shell-page-container .dashboard-page-heading,
    .shell-page-container .dashboard-page-title-input input { font-size: 22px; line-height: 30px; }
}

@media (max-width: 1279.98px) {
    .shell-content-surface { border-radius: 16px 16px 0 0; }
    .shell-appbar .mud-toolbar { gap: 10px; padding-inline: 18px; }
}
@media (max-width: 599.98px) {
    .shell-appbar .mud-toolbar { gap: 6px; padding-inline: 12px; min-height: 64px; height: 64px; }
    .dashboard-shell { --mud-appbar-height: 64px; }
    .dashboard-shell .shell-main { padding-top: 64px; }
    .shell-clock, .shell-deploy-label { display: none; }
    .shell-environment { flex-shrink: 0; padding: 7px 9px; font-size: 12px; gap: 6px; }
    .shell-content-surface { padding-block: 18px 28px; min-height: calc(100vh - 64px); }
    .shell-page-container { padding-inline: 14px !important; }
}
@media (prefers-reduced-motion: reduce) {
    .shell-nav .mud-nav-link { transition: none; }
}

/* Keep wide data inside its scroll container without widening the page. */
.shell-main, .shell-content-surface, .shell-page-container,
.shell-page-container .mud-grid-item { min-width: 0; }
.shell-page-container .mud-card-header-content { min-width: 0; overflow-wrap: anywhere; }
.shell-page-container .mud-table { max-width: 100%; }
.shell-page-container .mud-table-container {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
}
.shell-page-container .mud-table-head .mud-table-cell { white-space: nowrap; }
.shell-page-container .mud-table-cell { font-size: .8125rem; line-height: 1.5; }
.shell-page-container .mud-table-dense .mud-table-cell { padding: 6px 8px; }
.shell-page-container .mud-table-toolbar,
.shell-page-container .mud-table-pagination-toolbar {
    flex-wrap: wrap;
    height: auto;
    row-gap: 8px;
    padding-block: 12px;
}
.shell-page-container .mud-table-toolbar > * { min-width: 0; }
.shell-page-container .mud-table-pagination-toolbar { padding-block: 4px; }
.shell-page-container .mud-table-pagination-spacer { flex: 1 1 0; }
.shell-page-container .mud-table-toolbar > .mud-chip-container { flex-shrink: 0; }
.shell-page-container .mud-table-toolbar { white-space: normal; }
.shell-page-container .mud-input-control,
.shell-page-container .mud-input { max-width: 100%; }
.shell-page-container .flex-wrap > .flex-column { min-width: 0; max-width: 100%; }
@media (max-width: 599.98px) {
    .shell-page-container .mud-table-pagination-toolbar { justify-content: flex-end; padding-inline: 8px; }
    .shell-page-container .mud-table-pagination-spacer { display: none; }
    .shell-page-container .mud-table-pagination-display { margin-right: 0; }
    .shell-page-container .mud-toggle-group-horizontal {
        display: flex;
        max-width: 100%;
        overflow-x: auto;
    }
    .shell-page-container .mud-toggle-group-horizontal > .mud-toggle-item {
        flex: 1 0 auto;
        white-space: nowrap;
        padding-inline: 10px;
    }
}
.shell-page-container .mud-paper.mud-elevation-1 {
    box-shadow: 0 1px 3px #202b3b0d, 0 0 0 1px #e4e9ef;
}

.shell-page-container .dashboard-page-heading .mud-link { font: inherit; }

/* Reusable rows keep controls intact and wrap at the available content width. */
.dashboard-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.dashboard-toolbar > * { min-width: 0; max-width: 100%; }
.dashboard-toolbar > .mud-select,
.dashboard-toolbar > .mud-input-control,
.dashboard-toolbar > .mud-picker { flex-shrink: 0; }
.dashboard-toolbar .mud-input-control { margin-block: 0; }
.dashboard-toolbar > .mud-button-root { min-height: 40px; }
.dashboard-filter-panel { padding: 16px; margin-bottom: 16px; }
.dashboard-section { margin-bottom: 24px; }

.mud-dialog .mud-dialog-title { padding: 20px 24px 12px; }
.mud-dialog .mud-dialog-actions { flex-wrap: wrap; gap: 8px; padding: 12px 24px 20px; }
.mud-dialog .mud-dialog-actions > * { margin: 0; }
.mud-dialog .mud-dialog-content { min-width: 0; }
@media (max-width: 599.98px) {
    .dashboard-toolbar > .mud-spacer { display: none; }
    .mud-dialog:not(.mud-dialog-fullscreen) {
        margin: 14px;
        max-width: calc(100% - 28px);
        max-height: calc(100dvh - 28px);
    }
    .mud-dialog-width-full { width: calc(100% - 28px); }
    .mud-dialog .mud-dialog-title { padding: 16px 16px 12px; }
    .mud-dialog .mud-dialog-content { padding-inline: 16px; }
    .mud-dialog .mud-dialog-actions { padding: 12px 16px 16px; }
}

.collection-group-heading { min-width: 0; }
.collection-group-key { max-width: 100%; }
.collection-group-key .mud-chip-content { white-space: normal; overflow-wrap: anywhere; min-width: 0; padding-block: 2px; }

/* Player profile: one identity header, grouped navigation, independent sections. */
.player-profile-page { max-width: calc(1440px * var(--admin-page-width-scale)); margin-inline: auto; min-width: 0; }
.player-profile-page .player-profile-container {
    display: flex; align-items: center; gap: 20px; padding: 20px;
    background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px; margin-bottom: 16px; min-height: 112px;
}
.player-profile-page .avatar-wrapper { flex: 0 0 auto; padding-top: 8px; }
.player-profile-page .avatar-container { width: 64px; height: 64px; position: relative; }
.player-profile-page .player-avatar, .player-profile-page .avatar-placeholder {
    width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--mud-palette-background-grey);
}
.player-profile-page .avatar-hat { position: absolute; width: 130.2%; top: -28.7%; left: -15.2%; z-index: 2; pointer-events: none; }
.player-profile-page .avatar-overlay { position: absolute; z-index: 3; pointer-events: none; }
.player-profile-page .avatar-overlay img { width: 100%; height: 100%; object-fit: contain; }
.player-profile-page .league-icon { width: 24px; height: 24px; bottom: -4px; left: -4px; }
.player-profile-page .trophy-icon { width: 28px; height: 28px; bottom: -5px; right: -6px; }
.player-profile-page .player-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.player-profile-page .player-info > .mud-stack { flex-wrap: wrap; gap: 8px; }
.player-profile-page .player-last-seen { color: var(--mud-palette-text-secondary); font-size: 13px; }
.player-profile-page .last-seen-icon { height: 10px; width: 10px; margin-right: 4px; }
.player-profile-page .player-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.player-profile-page .player-tags .mud-chip { margin: 0; height: auto; min-height: 24px; }
.player-profile-page .profile-status-tag .mud-chip-content { white-space: normal; overflow-wrap: anywhere; }
.player-profile-page .loading-placeholder { background: var(--mud-palette-background-grey); border-radius: 4px; height: 16px; width: 160px; }
.player-profile-page .name-placeholder { height: 28px; }
.player-profile-navigation { margin-bottom: 24px; min-width: 0; }
.player-profile-groups { display: flex; flex-wrap: wrap; gap: 4px; padding-bottom: 8px; border-bottom: 1px solid var(--mud-palette-lines-default); }
.player-profile-groups .profile-group { padding: 8px 14px; color: var(--mud-palette-text-secondary); }
.player-profile-groups .active { background: var(--mud-palette-primary); color: var(--mud-palette-primary-text); }
.player-profile-sections { display: flex; flex-wrap: wrap; gap: 4px 8px; padding-top: 10px; }
.player-profile-sections .profile-section { color: var(--mud-palette-text-secondary); padding: 6px 10px; }
.player-profile-sections .active { background: var(--mud-palette-primary-hover); color: var(--mud-palette-primary); font-weight: 600; }
.player-profile-mobile-nav { display: none; }
.player-profile-body, .profile-panel { min-width: 0; }
.profile-panel-transparent { background: transparent !important; }
.player-profile-body .profile-section-title { font-size: 18px; line-height: 26px; font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.profile-panel > .profile-section-title { margin-bottom: 16px; }
.profile-panel-heading { margin-bottom: 16px; min-height: 36px; flex-wrap: wrap; }
.profile-panel > .mud-stack.mud-stack-row { flex-wrap: wrap; }
.profile-panel .mud-table-container { max-width: 100%; overflow-x: auto; }
.profile-panel .mud-table { min-width: 0; }
.profile-panel .mud-tabs { min-width: 0; }
.profile-panel .mud-toolbar { height: auto; min-height: 56px; flex-wrap: wrap; gap: 8px; padding-block: 8px; }
.profile-panel .mud-table-pagination { flex-wrap: wrap; }
.profile-panel .mud-card { box-shadow: none; border: 1px solid var(--mud-palette-lines-default); }
.profile-related-columns { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 16px; }
.profile-overview-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.profile-stat { padding: 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.profile-stat > .mud-typography-body2 { color: var(--mud-palette-text-secondary); }
.profile-stat > .mud-typography-h5 { font-size: 22px; font-weight: 600; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.profile-overview-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.profile-overview-card + .profile-overview-achievements { margin-top: 16px; }
.profile-overview-card { padding: 20px; min-width: 0; }
.profile-moderation-actions { background: transparent !important; padding-bottom: 16px; }
@media (max-width: 959.98px) {
    .profile-overview-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .profile-related-columns, .profile-overview-columns { grid-template-columns: minmax(0, 1fr); }
    .profile-panel-heading .mud-spacer { display: none; }
}
@media (max-width: 599.98px) {
    .player-profile-page .player-profile-container { padding: 16px; gap: 12px; align-items: flex-start; }
    .player-profile-page .avatar-container, .player-profile-page .player-avatar, .player-profile-page .avatar-placeholder { width: 48px; height: 48px; }
    .player-profile-page .player-info .dashboard-page-heading { font-size: 20px; line-height: 28px; }
    .player-profile-mobile-nav { display: block; }
    .player-profile-groups { display: none; }
    .player-profile-sections { margin-bottom: 12px; }
    .player-profile-sections .profile-section:not([target="_blank"]) { display: none; }
    .profile-overview-card, .profile-stat { padding: 14px; }
    .profile-panel-heading { gap: 8px !important; }
    .profile-panel-heading > .profile-section-title { flex-basis: 100%; }
    .profile-panel .mud-stack-row.dashboard-toolbar { flex-wrap: wrap; }
}
.player-profile-page .profile-online-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--mud-palette-text-secondary); margin-right: 5px; }
.player-profile-page .profile-online-dot.online { background: var(--mud-palette-success); }
.profile-panel .dashboard-toolbar { width: 100%; }
@media (max-width: 599.98px) {
    .profile-panel > .mud-grid, .profile-panel > .mud-stack > .mud-grid { min-width: 0; }
    .profile-panel .dashboard-toolbar > .mud-spacer { display: none; }
}
@media (max-width: 599.98px) {
    .player-profile-sections { display: none; }
}
.profile-nav-count { margin-left: 6px; padding: 0 5px; border-radius: 4px; background: var(--mud-palette-background-grey); font-size: 11px; font-variant-numeric: tabular-nums; }
.player-profile-body .mud-typography-h6 { font-size: 18px; line-height: 26px; font-weight: 600; overflow-wrap: anywhere; }

/* The gallery floats directly over its backdrop, without a dialog surface. */
.mud-dialog.gallery-lightbox {
    background: transparent;
    box-shadow: none;
    border: 0;
    color: #fff;
}
.mud-dialog.gallery-lightbox .mud-dialog-content { padding: 8px; }
.gallery-lightbox-backdrop { background-color: rgb(10 15 22 / 88%) !important; }
@media (max-width: 599.98px) {
    .mud-dialog.gallery-lightbox { margin: 12px; width: calc(100% - 24px); }
}

@media (min-width: 960px) {
    .profile-overview-achievements { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* The mobile profile chooser uses the dialog's focus trap and scroll lock. */
.profile-section-trigger { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 14px; min-height: 60px; border: 1px solid var(--mud-palette-lines-default); border-radius: 10px; background: var(--mud-palette-surface); color: var(--mud-palette-text-primary); text-align: left; font: inherit; cursor: pointer; }
.profile-section-location { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.profile-section-location strong { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.profile-section-category { font-size: 11px; color: var(--mud-palette-text-secondary); }
.profile-section-trigger-action { display: flex; align-items: center; gap: 6px; color: var(--mud-palette-primary); font-size: 13px; flex-shrink: 0; }
.mud-dialog-container:has(.profile-section-sheet) { align-items: flex-end; padding: 0; }
.mud-dialog.profile-section-sheet { margin: 0; width: 100%; max-width: 600px; height: 85vh; height: 85dvh; max-height: calc(100dvh - 16px); border-radius: 20px 20px 0 0; overflow: hidden; }
.profile-section-sheet .mud-dialog-content { padding: 0; display: flex; flex-direction: column; min-height: 0; height: 100%; overflow: hidden; }
.profile-sheet-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 16px 12px; flex-shrink: 0; }
.profile-sheet-header h2 { font-size: 18px; line-height: 26px; font-weight: 600; margin: 0; }
.profile-sheet-header span { font-size: 12px; color: var(--mud-palette-text-secondary); overflow-wrap: anywhere; }
.profile-sheet-search { padding: 0 16px 12px; flex-shrink: 0; border-bottom: 1px solid var(--mud-palette-lines-default); }
.profile-sheet-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 12px max(20px, env(safe-area-inset-bottom)); scroll-padding-block: 44px 12px; }
.profile-sheet-group + .profile-sheet-group { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--mud-palette-lines-default); }
.profile-sheet-group h3 { position: sticky; top: -8px; z-index: 1; display: flex; align-items: center; gap: 10px; margin: 0; padding: 6px 12px; min-height: 32px; font-size: 13px; line-height: 20px; font-weight: 700; color: var(--mud-palette-text-primary); background: var(--mud-palette-background); border-inline-start: 3px solid var(--mud-palette-primary); border-radius: 4px; }
.profile-sheet-link { min-height: 48px; padding: 12px; border-radius: 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--mud-palette-text-primary); font-size: 14px; line-height: 22px; text-decoration: none; }
.profile-sheet-link span { overflow-wrap: anywhere; }
.profile-sheet-link.active { background: var(--mud-palette-primary-hover); color: var(--mud-palette-primary); font-weight: 600; }
.profile-sheet-link:focus-visible, .profile-section-trigger:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: -2px; }
.profile-sheet-link:hover { background: var(--mud-palette-action-default-hover); }
.profile-sheet-empty { padding: 28px 12px; text-align: center; color: var(--mud-palette-text-secondary); font-size: 14px; }
@media (max-width: 599.98px) {
    .player-profile-navigation { position: sticky; top: 64px; z-index: 5; padding-block: 8px; background: var(--mud-palette-background); }
    .player-profile-sections { display: none; }
}

.profile-portrait-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-block: 8px 4px; max-width: 900px; }
.profile-portrait-metric { display: flex; gap: 10px; align-items: center; min-width: 0; padding: 10px 12px; border-radius: 8px; background: var(--mud-palette-background); color: var(--mud-palette-text-primary); text-decoration: none; }
.profile-portrait-metric[href]:hover { background: var(--mud-palette-primary-hover); }
.profile-portrait-metric:focus-visible { outline: 2px solid var(--mud-palette-primary); }
.profile-portrait-metric > img { width: 32px; height: 32px; object-fit: contain; flex: 0 0 auto; }
.profile-portrait-metric > svg { color: var(--mud-palette-text-secondary); flex-shrink: 0; }
.profile-portrait-metric > span:not(.profile-portrait-count) { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.profile-portrait-metric small { color: var(--mud-palette-text-secondary); font-size: 11px; line-height: 16px; }
.profile-portrait-metric strong { font-size: 14px; line-height: 20px; font-weight: 600; overflow-wrap: anywhere; }
.profile-portrait-count { font-size: 11px; margin-left: auto; color: var(--mud-palette-text-secondary); }
.profile-portrait-metric.is-payer strong { color: var(--mud-palette-success); }
.player-profile-page .player-profile-container { align-items: flex-start; }
.player-profile-page .avatar-wrapper { padding-top: 0; }
@media (max-width: 959.98px) {
    .profile-portrait-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 599.98px) {
    .player-profile-page .player-profile-container { display: grid; grid-template-columns: 48px minmax(0, 1fr); }
    .player-profile-page .player-info { display: contents; }
    .player-profile-page .player-info > .mud-stack { grid-column: 2; }
    .player-profile-page .player-info > .player-last-seen,
    .player-profile-page .player-info > .profile-portrait-metrics,
    .player-profile-page .player-info > .player-tags { grid-column: 1 / -1; }
    .profile-portrait-metrics { margin-block: 0; }
    .profile-portrait-metric { padding: 8px 10px; gap: 8px; }
    .profile-portrait-metric > img { width: 28px; height: 28px; }
}

.profile-equipped-pair { display: inline-flex; align-items: center; gap: 4px; }
.profile-equipped-art { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 8px; color: var(--mud-palette-text-secondary); }
.profile-equipped-art img { width: 36px; height: 36px; object-fit: contain; }
.profile-equipped-art:hover { background: var(--mud-palette-action-default-hover); }
.profile-equipped-art:focus-visible { outline: 2px solid var(--mud-palette-primary); }
.player-last-seen { flex-wrap: wrap; }
.profile-last-platform { display: inline-flex; gap: 5px; align-items: center; color: inherit; margin-inline-start: 8px; overflow-wrap: anywhere; }

.profile-details-toggle { display: none; }
button.profile-portrait-metric { border: 0; font: inherit; text-align: start; cursor: pointer; }
button.profile-portrait-metric:hover { background: var(--mud-palette-primary-hover); }
@media (max-width: 599.98px) {
    .profile-details-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 40px; padding: 6px 0 0; border: 0; border-top: 1px solid var(--mud-palette-lines-default); background: transparent; color: var(--mud-palette-text-secondary); font: inherit; font-size: 12px; cursor: pointer; }
    .profile-details-toggle:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: 2px; }
    .player-profile-page .player-info > .profile-details-toggle,
    .player-profile-page .player-info > .profile-portrait-details { grid-column: 1 / -1; }
    .profile-portrait-details { display: none; }
    .profile-portrait-details.is-expanded { display: block; }
    .profile-portrait-details .profile-portrait-metrics { margin-top: 10px; }
    .profile-portrait-details .player-tags { margin-top: 6px; }
}

.profile-payment-glance { display: none; }
@media (max-width: 599.98px) {
    .player-profile-page .player-info > .profile-payment-glance { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 5px; font-size: 12px; line-height: 18px; color: var(--mud-palette-text-secondary); }
    .player-profile-page .player-info > .profile-payment-glance.is-payer { color: var(--mud-palette-success); }
    .profile-payment-glance .mud-icon-root { width: 16px; height: 16px; }
    .profile-payment-glance-count { color: var(--mud-palette-text-secondary); }
}

.player-avatar-artwork { position: relative; display: block; width: 100%; aspect-ratio: 1; isolation: isolate; }
.player-avatar-artwork-photo { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.player-avatar-artwork-decoration { position: absolute; z-index: 1; top: -30%; left: -15%; width: 130%; max-width: none; height: auto; pointer-events: none; }
.profile-avatar-edit { display: block; overflow: visible !important; }
.profile-avatar-edit:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: 4px; }
.profile-decoration-error { font-size: 11px; color: var(--mud-palette-text-secondary); }

/* Keep portrait facts compact and aligned with the card, not the name column. */
.profile-portrait-metric.is-payer > span:not(.profile-portrait-count),
.profile-portrait-metric:first-child > span:not(.profile-portrait-count) { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 6px; }
.profile-portrait-metric:first-child > span > small:first-child { flex-basis: 100%; }
.profile-portrait-details .player-tags:empty { display: none; }
@media (min-width: 600px) {
    .player-profile-page .player-profile-container:not(.loading-state) { display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: 16px; row-gap: 4px; }
    .player-profile-page .player-info, .player-profile-page .profile-portrait-details { display: contents; }
    .player-profile-page .avatar-wrapper { grid-column: 1; grid-row: 1 / 3; }
    .player-profile-page .player-info > .mud-stack { grid-column: 2; grid-row: 1; }
    .player-profile-page .profile-portrait-details > .player-last-seen { grid-column: 2; grid-row: 2; }
    .player-profile-page .profile-portrait-metrics { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; max-width: none; margin: 10px 0 0; }
    .player-profile-page .profile-portrait-metric { flex: 0 1 auto; padding: 7px 10px; gap: 8px; min-height: 48px; }
    .player-profile-page .profile-portrait-details > .player-tags { grid-column: 1 / -1; }
}

/* Shared geometry for analytics header actions, including menu and badge wrappers. */
.analytics-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.analytics-actions > *, .analytics-actions .mud-menu, .analytics-actions .mud-menu-activator,
.analytics-actions .mud-tooltip-root, .analytics-actions .mud-badge-root { align-items: center; }
.analytics-actions .mud-menu, .analytics-actions .mud-menu-activator,
.analytics-actions .mud-tooltip-root { display: inline-flex; }
.analytics-actions .mud-button-root { height: 40px; white-space: nowrap; }
.analytics-actions .mud-icon-button { width: 40px; min-width: 40px; padding: 8px; }
.analytics-actions .mud-button-group { align-items: stretch; }

.cohort-forecast-toolbar .mud-button-root { min-height: 40px; }
.cohort-metrics-page .mud-expand-panel-header { min-height: 48px; padding: 12px 16px; }
.cohort-metrics-page .mud-expand-panel-content { padding: 0 16px 16px; }
/* The expansion panel already provides the card surface. */
.cohort-metrics-page .analytics-section .chart-card,
.cohort-metrics-page .analytics-section .chart-card:hover {
    padding: 0 !important;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: none;
}

.chart-editor__form .mud-input { min-height: 40px; }
@media (max-width: 599.98px) {
    .chart-editor__actions .mud-button:not(.mud-icon-button) { padding-inline: 10px; }
}

.dashboard-back-nav { flex: 0 0 auto; width: 100%; min-width: 0; display: flex; }
.dashboard-back-link.mud-link, .dashboard-back-link.mud-button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 0; font-size: 13px; font-weight: 500; line-height: 20px; }
.dashboard-back-link .mud-icon-root { flex-shrink: 0; }
.dashboard-back-link:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: 3px; border-radius: 4px; }
