/* Player ratings share one live/official display, with published rapid and blitz. */
.player-summary h1 {font-size:1.75rem;font-weight:600;line-height:1.3;overflow-wrap:anywhere;}
.profile-facts {grid-template-columns:repeat(3,minmax(0,1fr));margin-bottom:16px;}
.profile-facts > div {padding:8px 0;}
.profile-country-value {display:flex;align-items:center;gap:6px;line-height:1.4;}
.profile-country-value .f24 {display:inline-flex;align-items:center;flex:none;}
.profile-country-value .flag {vertical-align:middle;}
.profile-fide-ratings {margin-top:16px;border-top:1px solid #e5e7eb;padding-top:20px;color:#111827;}
.profile-ratings-heading {display:flex;flex-wrap:wrap;gap:12px;align-items:center;justify-content:space-between;margin-bottom:16px;}
.profile-ratings-heading h2 {font-size:1.25rem;font-weight:600;}
.profile-rating-switch {display:flex;gap:4px;padding:4px;border:1px solid #d1d5db;border-radius:8px;background:#f3f4f6;}
.profile-rating-switch button {padding:10px 14px;min-height:44px;border-radius:5px;font-size:0.875rem;font-weight:600;color:#4b5563;}
.profile-rating-switch button[aria-pressed="true"] {background:#1f2937;color:#fff;}
.profile-rating-switch button:focus-visible,.profile-ratings-footer button:focus-visible {outline:2px solid #2563eb;outline-offset:2px;}
.profile-rating-cards {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;}
.profile-rating-card {padding:18px 20px;border:1px solid #d1d5db;border-radius:8px;background:#f9fafb;min-width:0;}
.profile-rating-value {font-size:2.125rem;line-height:1.2;font-weight:700;font-variant-numeric:tabular-nums;}
.profile-rating-top {display:flex;flex-wrap:wrap;align-items:baseline;gap:10px;}
.profile-rating-delta {font-size:1rem;font-weight:600;}
.profile-rapid .profile-rating-value {color:#2563eb;}
.profile-blitz .profile-rating-value {color:#0369a1;}
.profile-rating-card h3 {font-size:1.0625rem;font-weight:600;margin-top:14px;}
.profile-rating-source {font-size:0.75rem;color:#6b7280;margin-top:6px;}
.profile-ratings-footer {display:flex;flex-wrap:wrap;align-items:center;gap:10px 20px;font-size:0.875rem;margin-top:14px;}
.profile-ratings-footer a,.profile-ratings-footer button {text-decoration:underline;color:#007d83;min-height:44px;display:inline-flex;align-items:center;}
.profile-ratings-footer [hidden],.profile-rating-delta[hidden] {display:none;}
.profile-rating-update {color:#92400e;font-size:0.75rem;}
.dark .profile-fide-ratings {color:#f3f4f6;border-color:#374151;}
.dark .profile-rating-card,.dark .profile-rating-switch {background:#111827;border-color:#4b5563;}
.dark .profile-rating-switch button {color:#d1d5db;}
.dark .profile-rating-switch button[aria-pressed="true"] {background:#e5e7eb;color:#111827;}
.dark .profile-rapid .profile-rating-value {color:#93c5fd;}
.dark .profile-blitz .profile-rating-value {color:#7dd3fc;}
.dark .profile-rating-source {color:#9ca3af;}
.dark .profile-ratings-footer a,.dark .profile-ratings-footer button {color:#5eead4;}
.dark .profile-rating-update {color:#fcd34d;}
@media(max-width:600px) {
 .player-summary h1 {font-size:1.5rem;}
 .profile-facts {grid-template-columns:repeat(2,minmax(0,1fr));}
 .profile-rating-cards {grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
 .profile-classical {grid-column:1 / -1;}
 .profile-rating-card {padding:14px 10px;}
 .profile-rating-value {font-size:1.625rem;}
 .profile-rating-card h3 {font-size:0.9375rem;}
 .profile-rating-switch {width:100%;}
 .profile-rating-switch button {flex:1;}
}


.profile-records {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:16px;}
.profile-record-panel {padding:16px 20px;border:1px solid #e5e7eb;border-radius:8px;min-width:0;}
.profile-record-panel h3 {font-size:1rem;font-weight:600;margin-bottom:12px;}
.profile-record-panel dl > div {display:flex;flex-wrap:wrap;justify-content:space-between;gap:6px 16px;margin:8px 0;font-size:0.875rem;}
.profile-record-panel dt {color:#64748b;}
.profile-record-panel dd {font-weight:600;font-variant-numeric:tabular-nums;}
.profile-record-panel dd span {color:#64748b;font-weight:400;margin-left:6px;}
.profile-record-panel a {text-decoration:underline;}
.profile-record-note {font-size:0.75rem;color:#64748b;margin-top:12px;}
.profile-chart-section {margin:24px 0;color:#111827;min-width:0;}
.profile-chart-heading {display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;}
.profile-chart-heading h2 {font-size:1.375rem;font-weight:600;}
.profile-chart-ranges {display:flex;gap:2px;background:#f3f4f6;border:1px solid #d1d5db;border-radius:6px;padding:3px;}
.profile-chart-ranges button,.profile-chart-types button {min-height:44px;padding:8px 12px;font-size:0.875rem;border-radius:4px;font-weight:500;}
.profile-chart-ranges button[aria-pressed="true"] {background:#1f2937;color:#fff;}
.profile-chart-types {display:flex;flex-wrap:wrap;gap:6px;margin-top:16px;}
.profile-chart-types button {border:1px solid #d1d5db;color:#475569;}
.profile-chart-types button[aria-pressed="true"] {border-color:#4f46e5;background:#eef2ff;color:#4338ca;}
.profile-chart-types button:focus-visible,.profile-chart-ranges button:focus-visible {outline:2px solid #2563eb;outline-offset:2px;}
.profile-chart-summary {font-size:0.8125rem;color:#64748b;margin:12px 0 0;min-height:20px;}
.profile-history-chart {min-height:380px;min-width:0;max-width:100%;overflow:hidden;}
@media (max-width:599px) {.profile-history-chart {min-height:280px;}}
.profile-chart-footer {display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;color:#64748b;font-size:0.75rem;}
.profile-chart-footer button {text-decoration:underline;min-height:44px;color:#007d83;}
.profile-chart-values summary {cursor:pointer;font-size:0.875rem;min-height:44px;display:flex;align-items:center;text-decoration:underline;}
.profile-chart-table-scroll {max-height:260px;overflow:auto;}
.profile-chart-table-scroll table {width:100%;font-size:0.8125rem;border-collapse:collapse;}
.profile-chart-table-scroll th,.profile-chart-table-scroll td {text-align:right;padding:8px 12px;border-bottom:1px solid #e5e7eb;}
.profile-chart-table-scroll th:first-child,.profile-chart-table-scroll td:first-child {text-align:left;}
.profile-chart-table-scroll th {position:sticky;top:0;background:#f9fafb;}
.dark .profile-record-panel {border-color:#374151;}
.dark .profile-record-panel dt,.dark .profile-record-panel dd span,.dark .profile-record-note,.dark .profile-chart-summary,.dark .profile-chart-footer {color:#9ca3af;}
.dark .profile-chart-section {color:#f3f4f6;}
.dark .profile-chart-ranges {background:#111827;border-color:#4b5563;}
.dark .profile-chart-ranges button[aria-pressed="true"] {background:#e5e7eb;color:#111827;}
.dark .profile-chart-types button {border-color:#4b5563;color:#d1d5db;}
.dark .profile-chart-types button[aria-pressed="true"] {background:#312e81;border-color:#818cf8;color:#e0e7ff;}
.dark .profile-chart-footer button {color:#5eead4;}
.dark .profile-chart-table-scroll th {background:#111827;}
.dark .profile-chart-table-scroll td,.dark .profile-chart-table-scroll th {border-color:#374151;}
@media(max-width:600px){.profile-records {grid-template-columns:1fr;}.profile-record-panel {padding:14px;}.profile-chart-heading h2 {font-size:1.25rem;}.profile-chart-types {gap:4px;}.profile-chart-types button {padding:8px 10px;font-size:0.8125rem;}.profile-chart-ranges {margin-left:auto;}}

.profile-title {display:inline-block;font-size:1.125rem;vertical-align:middle;padding:3px 7px;background:#475569;color:#fff;border-radius:4px;line-height:1.25;}
.profile-birth-age {font-size:0.8125rem;color:#64748b;}
.dark .profile-birth-age {color:#9ca3af;}

.profile-chart-downloads {display:flex;gap:16px;flex-wrap:wrap;}
.profile-chart-export-status {font-size:0.75rem;color:#92400e;}
.profile-chart-downloads button:disabled {opacity:.5;}
.dark .profile-chart-export-status {color:#fcd34d;}

/* Game pagination is available above and below the table, with touch-sized links. */
.player-games-pagination {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 16px;margin:16px 0;}
.player-games-page-links {display:flex;align-items:center;flex-wrap:wrap;gap:8px;}
.player-games-page-links a {display:inline-flex;align-items:center;justify-content:center;min-height:44px;min-width:44px;padding:8px 12px;text-decoration:underline;text-underline-offset:3px;}
#player-games {scroll-margin-top:96px;}

.game-medium-tabs {display:flex;flex-wrap:wrap;gap:8px;margin:16px 0 10px;}
.game-medium-tabs a {display:inline-flex;align-items:center;gap:8px;padding:10px 14px;border:1px solid #cbd5e1;border-radius:8px;text-decoration:none;min-height:44px;}
.game-medium-tabs a[aria-current="page"] {background:#1f2937;color:white;border-color:#1f2937;}
.game-medium-tabs span {font-size:.8em;opacity:.8;font-variant-numeric:tabular-nums;}
.game-medium-note {font-size:.875rem;color:#64748b;margin:0 0 16px;max-width:75ch;}
.dark .game-medium-tabs a {border-color:#475569;}
.dark .game-medium-tabs a[aria-current="page"] {background:#334155;}

/* Compact identity header: layout changes are limited to the main player profile. */
.player-summary {padding:24px;}
.player-summary .profile-identity-header {display:flex;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;gap:18px 28px;padding-bottom:22px;}
.player-summary .profile-identity-main {flex:1;min-width:0;}
.player-summary .profile-identity-header h1 {display:flex;align-items:baseline;gap:10px;margin:0;font-size:2rem;line-height:1.25;letter-spacing:-.5px;}
.player-summary .profile-name {min-width:0;overflow-wrap:anywhere;}
.player-summary .profile-title {flex:none;align-self:center;font-size:1.0625rem;letter-spacing:0;padding:4px 7px;}
.player-summary [data-profile-playing]:empty {display:none;}
.player-summary .profile-identity-meta {display:flex;align-items:center;flex-wrap:wrap;gap:8px 18px;margin-top:10px;font-size:0.875rem;color:#475569;line-height:1.5;}
.player-summary .profile-country-value {gap:7px;color:#1f2937;font-weight:500;}
.player-summary .profile-meta-label {color:#64748b;margin-right:3px;}
.player-summary .profile-birth-age {font-size:0.8125rem;white-space:nowrap;}
.player-summary .profile-identifiers {display:flex;align-self:center;flex-wrap:wrap;gap:20px;margin:2px 0 0;padding:0;}
.player-summary .profile-identifiers > div {border-left:1px solid #e2e8f0;padding-left:20px;}
.player-summary .profile-identifiers dt {font-size:0.6875rem;letter-spacing:.05em;line-height:1.5;font-weight:500;color:#64748b;}
.player-summary .profile-identifiers dd {margin:3px 0 0;font-size:0.875rem;font-weight:500;font-variant-numeric:tabular-nums;line-height:1.5;}
.player-summary .profile-fide-ratings,.player-summary .profile-domestic-ratings {margin-top:0;border-top:1px solid #e5e7eb;padding-top:18px;}
.player-summary .profile-ratings-heading {margin-bottom:14px;}
.player-summary .profile-ratings-heading h2 {font-size:1.125rem;}
.player-summary .profile-rating-switch {padding:3px;gap:2px;}
.player-summary .profile-rating-switch button {padding:8px 12px;min-height:40px;font-size:0.8125rem;}
.player-summary .profile-rating-cards.has-domestic-rating {grid-template-columns:repeat(4,minmax(0,1fr));}
.player-summary .profile-rating-card {padding:18px;}
.player-summary .profile-rating-value {font-size:clamp(28px,2.4vw,36px);letter-spacing:-.6px;}
.player-summary .profile-rating-card h3 {margin-top:10px;font-size:0.9375rem;}
.player-summary .profile-domestic {background:#f1f8f6;border-color:#c9e1d8;}
.player-summary .profile-domestic .profile-rating-value {color:#116b57;}
.player-summary .profile-record-panel {padding:16px 18px;}
.dark .player-summary .profile-identity-meta,.dark .player-summary .profile-meta-label,.dark .player-summary .profile-identifiers dt {color:#9ca3af;}
.dark .player-summary .profile-country-value {color:#e5e7eb;}
.dark .player-summary .profile-identifiers > div,.dark .player-summary .profile-domestic-ratings,.dark .player-summary .profile-fide-ratings {border-color:#374151;}
.dark .player-summary .profile-domestic {background:#102a26;border-color:#285247;}
.dark .player-summary .profile-domestic .profile-rating-value {color:#75d4b3;}
@media(max-width:1100px){
 .player-summary .profile-rating-cards.has-domestic-rating {grid-template-columns:repeat(2,minmax(0,1fr));}
 .player-summary .profile-identity-header h1 {font-size:1.75rem;}
 .player-summary .profile-identifiers {gap:14px;}
 .player-summary .profile-identifiers > div {padding-left:14px;}
}
@media(max-width:600px){
 .player-summary {padding:16px;}
 .player-summary .profile-identity-header {gap:14px;padding-bottom:18px;}
 .player-summary .profile-identity-main {flex-basis:100%;}
 .player-summary .profile-identity-header h1 {font-size:1.625rem;gap:8px;}
 .player-summary .profile-title {font-size:0.9375rem;}
 .player-summary .profile-identity-meta {gap:6px 14px;margin-top:10px;font-size:0.8125rem;}
 .player-summary .profile-identifiers {width:100%;gap:24px;margin:0;}
 .player-summary .profile-identifiers > div {border:0;padding:0;}
 .player-summary .profile-identifiers dd {font-size:0.8125rem;}
 .player-summary .profile-fide-ratings,.player-summary .profile-domestic-ratings {padding-top:16px;}
 .player-summary .profile-ratings-heading {gap:10px;margin-bottom:12px;}
 .player-summary .profile-rating-switch {width:auto;max-width:100%;}
 .player-summary .profile-rating-switch button {padding:8px 10px;min-height:40px;}
 .player-summary .profile-rating-cards.has-domestic-rating .profile-classical {grid-column:auto;}
 .player-summary .profile-rating-card {padding:14px 12px;}
 .player-summary .profile-rating-value {font-size:1.75rem;}
 .player-summary .profile-rating-top {gap:5px;}
 .player-summary .profile-rating-delta {font-size:0.8125rem;}
 .player-summary .profile-rating-card h3 {font-size:0.875rem;}
 .player-summary .profile-records {gap:10px;margin-top:12px;}
 .player-summary .profile-record-panel {padding:14px;}
}

/* Keep the compact identity readable in dark mode and controls on one line. */
.dark .player-summary .profile-identity-header h1,.dark .player-summary .profile-identifiers dd {color:#f3f4f6;}
.player-summary .profile-rating-switch {flex-shrink:0;}
.player-summary .profile-rating-switch button {white-space:nowrap;min-height:44px;}

/* Verified local player portraits. */

/* Proposed portrait header: scoped to the existing profile component. */
.profile-identity-header.has-portrait{display:grid;grid-template-columns:96px minmax(0,1fr);align-items:center;gap:16px 22px}
.has-portrait .profile-identity-main{min-width:0;flex-basis:auto}
.has-portrait .profile-identifiers{width:auto;grid-column:3;align-self:center}
.profile-portrait{width:96px;margin:0;align-self:start}
.profile-portrait-trigger{display:block;width:100%;padding:0;border:0;background:transparent;color:inherit;text-align:center;cursor:pointer}
.profile-portrait-trigger:focus-visible{outline:2px solid #008568;outline-offset:4px;border-radius:12px}
.profile-portrait-frame{display:block;position:relative;width:96px;height:96px;overflow:hidden;border:1px solid #d6dfe6;border-radius:12px;background:#e7f3ee;isolation:isolate}
.profile-portrait-initials{display:grid;place-items:center;position:absolute;inset:0;font-size:1.6875rem;font-weight:650;color:#08745c;letter-spacing:-.5px}
.profile-portrait-frame img{display:block;position:absolute;inset:0;z-index:1;width:100%;height:100%;object-fit:cover;object-position:center}
.profile-portrait-caption{display:block;margin-top:3px;font-size:0.6875rem;line-height:20px;color:#526579;text-decoration:underline;text-underline-offset:2px}
.profile-portrait.is-missing img,.profile-portrait.is-missing .profile-portrait-caption{display:none}
.profile-portrait.is-missing .profile-portrait-trigger{cursor:default}
.profile-portrait.is-missing .profile-portrait-frame{border-color:#d5e5df}
.profile-identity-header h1{min-width:0}
.profile-identity-header .profile-title{align-self:flex-start;margin-top:5px}
.dark .profile-portrait-frame{background:#183b33;border-color:#37534b}
.dark .profile-portrait-initials{color:#90d7be}
.dark .profile-portrait-caption{color:#aabccb}
.portrait-credit-dialog{width:min(360px,calc(100vw - 32px));max-height:90vh;overflow:auto;padding:24px;border:1px solid #d6dfe6;border-radius:14px;background:white;color:#16283a;box-shadow:0 16px 70px #0f172a35}
.portrait-credit-dialog::backdrop{background:#0f172a88}
.portrait-credit-dialog h2{font-size:1.3125rem;font-weight:650;margin:0 0 16px}
.portrait-credit-dialog img{display:block;max-width:100%;height:auto;width:200px;border-radius:10px;margin:0 auto 16px}
.portrait-credit-dialog p{margin:8px 0;font-size:0.875rem;line-height:1.5}
.portrait-credit-dialog a{color:#007e64;text-decoration:underline;text-underline-offset:2px}
.portrait-credit-dialog button{display:block;min-height:44px;margin:18px 0 0 auto;padding:8px 18px;background:#007e64;color:white;border:0;border-radius:8px;cursor:pointer}
.dark .portrait-credit-dialog{background:#1f2937;color:#e5e7eb;border-color:#475569}
.dark .portrait-credit-dialog a{color:#7dd8bb}
@media(max-width:800px){
 .profile-identity-header.has-portrait{grid-template-columns:72px minmax(0,1fr);align-items:start;gap:12px 16px}
 .has-portrait .profile-identifiers{grid-column:1/-1;justify-self:start;width:100%;margin:0;gap:24px}
 .has-portrait .profile-identifiers>div{border:0;padding:0}
 .profile-portrait{width:72px}.profile-portrait-frame{width:72px;height:72px;border-radius:10px}
 .profile-portrait-initials{font-size:1.4375rem}
 .profile-identity-header.has-portrait h1{font-size:1.5rem;gap:7px}
 .player-summary .profile-identity-meta{gap:4px 12px;margin-top:8px;font-size:0.8125rem}
 .profile-identity-header .profile-title{margin-top:3px}
 .player-summary .profile-birth>.profile-meta-label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
}
@media(max-width:359px){
 .profile-identity-header.has-portrait{grid-template-columns:64px minmax(0,1fr);column-gap:12px}
 .profile-portrait{width:64px}.profile-portrait-frame{width:64px;height:64px}
 .profile-identity-header.has-portrait h1{font-size:1.4375rem;gap:6px}
 .profile-portrait-caption{font-size:0.625rem}
}

.profile-identity-header.has-portrait.has-identifiers{grid-template-columns:96px minmax(0,1fr) auto}
.national-profile-identity,.archive-profile-identity{padding-bottom:22px}
.has-portrait.national-profile-identity h1{font-size:1.875rem;font-weight:600;line-height:1.25;margin:0;overflow-wrap:anywhere}
.archive-profile-identity h1{overflow-wrap:anywhere}
.portrait-credit-dialog:not([open]){display:none}
@media(max-width:800px){.profile-identity-header.has-portrait.has-identifiers{grid-template-columns:72px minmax(0,1fr)}.has-portrait.national-profile-identity h1{font-size:1.5rem}}
@media(max-width:359px){.profile-identity-header.has-portrait.has-identifiers{grid-template-columns:64px minmax(0,1fr)}}

/* A compact biography introduces the player before the rating dashboard. */
.profile-biography{position:relative;margin:0 0 20px;color:#334155;scroll-margin-top:100px}
.profile-biography-heading{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.profile-biography-content{max-width:88ch;min-width:0;font-size:0.9375rem;line-height:1.7;overflow-wrap:anywhere}
.profile-biography-content p{margin:0 0 12px}
.profile-biography-content p:last-child{margin-bottom:0}
.profile-biography summary{display:block;list-style:none;cursor:pointer;font:inherit;color:inherit}
.profile-biography summary::-webkit-details-marker{display:none}
.profile-biography-toggle{display:inline;white-space:nowrap;margin-inline-start:.3em;padding-block:6px;font-size:0.8125rem;font-weight:500;color:#007d68;text-underline-offset:3px}
.profile-biography summary:hover .profile-biography-toggle{text-decoration:underline}
.profile-biography summary:focus-visible{outline:2px solid #008568;outline-offset:4px;border-radius:3px}
.profile-biography-more[open]>summary{display:none}
.dark .profile-biography{color:#cbd5e1}
.dark .profile-biography-toggle{color:#78d8bf}
@media(max-width:480px){.profile-biography{margin-bottom:16px}.profile-biography-content{font-size:0.875rem;line-height:1.65}}

.biography-player-page{max-width:1200px;margin:0 auto;padding:24px}
.biography-player-games{border-top:1px solid #e2e8f0;padding-top:20px;margin-top:20px}
.biography-player-games h2{font-size:1.25rem;font-weight:600;margin:0 0 8px}
.biography-player-games p{font-size:0.875rem;line-height:1.6;color:#64748b}
.biography-player-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}
.biography-player-actions a{display:inline-flex;min-height:44px;align-items:center;padding:10px 16px;border:1px solid #cbd5e1;border-radius:8px;color:#007d68;text-decoration:none;font-size:0.875rem;font-weight:500}
.biography-player-actions a:first-child{background:#007d68;color:#fff;border-color:#007d68}
.dark .biography-player-games{border-color:#475569}.dark .biography-player-games p{color:#cbd5e1}.dark .biography-player-actions a{border-color:#475569;color:#78d8bf}.dark .biography-player-actions a:first-child{color:#fff}
@media(max-width:600px){.biography-player-page{padding:16px}}

/* Section navigation spans the profile, including history and saved games. */
.site-shell:has(.player-profile-page),#main-content:has(.player-profile-page) {overflow:visible;}
.player-profile-page {container:player-profile / inline-size;min-width:0;}
.profile-section-nav {position:sticky;top:var(--site-header-height,72px);z-index:15;display:flex;gap:4px;overflow-x:auto;background:#f8fafc;border-bottom:1px solid #dbe3eb;padding:6px 0;margin:10px 0 18px;}
.profile-section-nav a {display:inline-flex;align-items:center;justify-content:center;flex:none;min-height:44px;padding:8px 16px;color:#526175;font-size:.875rem;text-decoration:none;border-bottom:3px solid transparent;}
.profile-section-nav a[aria-current] {color:#047857;border-bottom-color:#047857;font-weight:600;}
.player-profile-page :is(#profile-ratings,#profile-history,#player-games,#fide-tournaments) {scroll-margin-top:calc(var(--site-header-height,72px) + var(--profile-nav-height,56px) + 12px);}
.profile-ratings-block .profile-fide-ratings,.profile-ratings-block .profile-domestic-ratings {border-top:0;padding-top:0;}
.profile-ratings-block .profile-classical .profile-rating-switch {display:flex;flex-wrap:wrap;margin-top:12px;max-width:100%;width:100%;}
.profile-ratings-block .profile-rating-switch button {flex:1;min-width:0;white-space:normal;font-size:.75rem;line-height:1.4;padding:8px;}
.profile-ratings-block .profile-rating-cards {grid-template-columns:repeat(auto-fit,minmax(min(100%,12rem),1fr));}
.profile-ratings-block .profile-rating-value {font-size:2rem;}
.profile-history-hub {min-width:0;margin:24px 0;background:white;border:1px solid #e2e8f0;border-radius:8px;padding:24px;}
.profile-history-heading {display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:12px;margin-bottom:18px;}
.profile-history-heading h2 {font-size:1.375rem;font-weight:700;}
.profile-history-sources {display:flex;flex-wrap:wrap;gap:6px;}
.profile-history-sources[hidden],.profile-history-source[hidden] {display:none!important;}
.profile-history-sources button {min-height:32px;border:0;border-radius:6px;padding:5px 12px;font-size:.8125rem;line-height:1.25;}
.profile-history-sources button[aria-pressed="true"] {background:#047857;border-color:#047857;color:white;}
.profile-history-source .profile-chart-section {margin:0;padding:0;border:0;box-shadow:none;background:transparent;}
.profile-history-source .profile-chart-heading h2 {font-size:1rem;}
.profile-chart-export summary {cursor:pointer;min-height:44px;display:flex;align-items:center;color:#047857;text-decoration:underline;font-size:.8125rem;}
.profile-chart-export .profile-chart-downloads {padding:8px 0;}
.profile-chart-export .profile-chart-downloads button {min-height:44px;}
.player-games-mobile {display:none;list-style:none;padding:0;margin:0;}
.player-game-mobile {display:flex;flex-direction:column;gap:6px;padding:14px 0;border-bottom:1px solid #e2e8f0;color:inherit;text-decoration:none;}
.player-game-mobile-heading {display:flex;justify-content:space-between;align-items:baseline;flex-wrap:wrap;gap:6px 12px;font-size:.875rem;}
.player-game-mobile-heading strong {min-width:0;overflow-wrap:anywhere;}
.player-game-mobile-meta {font-size:.75rem;color:#64748b;}
.player-game-mobile-event {font-size:.8125rem;color:#475569;line-height:1.5;overflow-wrap:anywhere;}
.player-profile-page :is(a,button,summary):focus-visible {outline:2px solid #059669;outline-offset:3px;}
@container player-profile (max-width:45rem) {
 .player-games-desktop {display:none;}.player-games-mobile {display:block;}
 .profile-ratings-block .profile-rating-cards,.profile-ratings-block .profile-rating-cards.has-domestic-rating {grid-template-columns:repeat(2,minmax(0,1fr));}
 .player-profile-page .profile-ratings-block .profile-rating-cards .profile-classical:has(.profile-rating-switch),.profile-ratings-block .profile-domestic {grid-column:1/-1;}
 .profile-section-nav {gap:0;}.profile-section-nav a {padding-inline:10px;}
 .profile-ratings-block .profile-records {grid-template-columns:1fr;}
 .profile-history-hub {padding:16px;}
}
@container player-profile (max-width:22rem) {.profile-ratings-block .profile-rating-cards {grid-template-columns:1fr!important;}}
.dark .profile-section-nav {background:#111827;border-color:#374151;}
.dark .profile-section-nav a,.dark .player-game-mobile-event {color:#cbd5e1;}
.dark .profile-section-nav a[aria-current],.dark .profile-chart-export summary {color:#6ee7b7;}
.dark .profile-history-hub {background:#1f2937;border-color:#374151;color:#f3f4f6;}
.dark .profile-history-sources button {border-color:#475569;color:#cbd5e1;}
.dark .profile-history-sources button[aria-pressed="true"] {background:#065f46;border-color:#047857;color:#ecfdf5;}
.dark .player-game-mobile {border-color:#374151;}.dark .player-game-mobile-meta {color:#9ca3af;}

/* Compact, unified Rating History header & segmented toolbar (ECF, CFC, FIDE, USCF). */
.rating-profile .profile-history-heading {margin-bottom:14px;}
.rating-profile .profile-history-heading .profile-history-sources {gap:2px;padding:3px;border-radius:8px;}
.rating-profile .profile-history-heading .profile-history-sources > button {min-height:32px;padding:5px 12px;border-radius:6px;font-size:0.8125rem;line-height:1.25;cursor:pointer;transition:color 0.14s ease,background-color 0.14s ease,box-shadow 0.14s ease;}
.rating-profile .profile-history-heading .profile-history-sources > button:hover:not([aria-pressed="true"]) {color:var(--rating-ink,#172333);background:rgba(255,255,255,0.55);}
.dark .rating-profile .profile-history-heading .profile-history-sources > button:hover:not([aria-pressed="true"]) {color:#f8fafc;background:rgba(255,255,255,0.06);}
.rating-profile .profile-chart-header {display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:4px 16px;margin:0 0 10px;}
.rating-profile :is(.ecf-cards,.cfc-cards) + .profile-chart-header {margin-top:20px;padding-top:16px;border-top:1px solid var(--rating-border,#dbe3eb);}
.rating-profile .profile-chart-header :is(h2,h3) {margin:0;font-size:1.0625rem;font-weight:650;line-height:1.35;letter-spacing:-0.01em;color:var(--rating-ink,#172333);}
.rating-profile .profile-chart-header .profile-chart-summary {margin:0;padding:0;border:0;border-radius:0;background:transparent;color:var(--rating-muted,#64748b);font-size:0.8125rem;line-height:1.45;min-height:0;font-variant-numeric:tabular-nums;}
.rating-profile .profile-chart-toolbar {display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 12px;margin:0 0 8px;}
.rating-profile .profile-chart-controls {display:flex;flex-wrap:wrap;align-items:center;gap:8px;min-width:0;}
.rating-profile .profile-chart-toolbar :is(.profile-chart-types,.profile-chart-ranges) {display:inline-flex;flex-wrap:nowrap;align-items:center;gap:2px;margin:0;padding:3px;border:1px solid var(--rating-border,#dbe3eb);border-radius:8px;background:#eaf0f5;max-width:100%;overflow-x:auto;scrollbar-width:none;}
.rating-profile .profile-chart-toolbar :is(.profile-chart-types,.profile-chart-ranges)::-webkit-scrollbar {display:none;}
.rating-profile .profile-chart-toolbar .profile-chart-ranges {margin-left:auto;}
.rating-profile .profile-chart-toolbar :is(.profile-chart-types,.profile-chart-ranges) > button {appearance:none;display:inline-flex;align-items:center;justify-content:center;min-height:30px;padding:5px 11px;margin:0;border:0;border-radius:6px;background:transparent;color:var(--rating-muted,#526175);font-size:0.8125rem;font-weight:500;line-height:1.25;white-space:nowrap;cursor:pointer;touch-action:manipulation;transition:color 0.14s ease,background-color 0.14s ease,box-shadow 0.14s ease;}
.rating-profile .profile-chart-toolbar :is(.profile-chart-types,.profile-chart-ranges) > button:hover:not([aria-pressed="true"]) {color:var(--rating-ink,#172333);background:rgba(255,255,255,0.55);}
.rating-profile .profile-chart-toolbar :is(.profile-chart-types,.profile-chart-ranges) > button:focus-visible {outline:2px solid #059669;outline-offset:2px;position:relative;z-index:1;}
.rating-profile .profile-chart-toolbar :is(.profile-chart-types,.profile-chart-ranges) > button[aria-pressed="true"] {background:var(--rating-card,#fff);color:var(--rating-ink,#172333);border:0;font-weight:600;box-shadow:0 1px 2px rgba(15,23,42,0.08),0 0 0 1px rgba(15,23,42,0.04);}
.rating-profile .profile-chart-toolbar .profile-chart-ranges > button[aria-pressed="true"],
.rating-profile .profile-chart-toolbar .profile-chart-types > button[data-chart-type="compare"][aria-pressed="true"] {background:var(--rating-card,#fff);color:var(--rating-green,#047857);border:0;}
.rating-profile .profile-chart-toolbar .profile-chart-types > button:is([data-chart-type="rapid"],[data-cfc-kind="Q"],[data-ecf-kind="rapid"])[aria-pressed="true"] {background:var(--rating-card,#fff);color:var(--rating-rapid-ink,#2563eb);border:0;}
.rating-profile .profile-chart-toolbar .profile-chart-types > button:is([data-chart-type="blitz"],[data-ecf-kind="blitz"])[aria-pressed="true"] {background:var(--rating-card,#fff);color:var(--rating-blitz,#0369a1);border:0;}
.dark .rating-profile :is(.ecf-cards,.cfc-cards) + .profile-chart-header {border-color:var(--rating-border,#3b495d);}
.dark .rating-profile .profile-chart-header :is(h2,h3) {color:var(--rating-ink,#f1f5f9);}
.dark .rating-profile .profile-chart-header .profile-chart-summary {color:var(--rating-muted,#aab8ca);background:transparent;}
.dark .rating-profile .profile-chart-toolbar :is(.profile-chart-types,.profile-chart-ranges) {background:#192332;border-color:var(--rating-border,#3b495d);}
.dark .rating-profile .profile-chart-toolbar :is(.profile-chart-types,.profile-chart-ranges) > button {color:#cbd5e1;background:transparent;}
.dark .rating-profile .profile-chart-toolbar :is(.profile-chart-types,.profile-chart-ranges) > button:hover:not([aria-pressed="true"]) {color:#f8fafc;background:rgba(255,255,255,0.06);}
.dark .rating-profile .profile-chart-toolbar :is(.profile-chart-types,.profile-chart-ranges) > button[aria-pressed="true"] {background:#334155;color:#f8fafc;border:0;box-shadow:0 1px 2px rgba(0,0,0,0.28),inset 0 1px 0 rgba(255,255,255,0.06);}
.dark .rating-profile .profile-chart-toolbar .profile-chart-ranges > button[aria-pressed="true"],
.dark .rating-profile .profile-chart-toolbar .profile-chart-types > button[data-chart-type="compare"][aria-pressed="true"] {background:#334155;color:var(--rating-green,#6ee7b7);}
.dark .rating-profile .profile-chart-toolbar .profile-chart-types > button:is([data-chart-type="rapid"],[data-cfc-kind="Q"],[data-ecf-kind="rapid"])[aria-pressed="true"] {background:#334155;color:var(--rating-rapid-ink,#93c5fd);}
.dark .rating-profile .profile-chart-toolbar .profile-chart-types > button:is([data-chart-type="blitz"],[data-ecf-kind="blitz"])[aria-pressed="true"] {background:#334155;color:var(--rating-blitz,#7dd3fc);}
@media (max-width:640px) {
 .rating-profile .profile-chart-header {gap:3px 12px;margin-bottom:10px;}
 .rating-profile .profile-chart-header :is(h2,h3) {font-size:1rem;}
 .rating-profile .profile-chart-header .profile-chart-summary {font-size:0.75rem;}
 .rating-profile .profile-chart-toolbar {gap:8px;margin-bottom:8px;}
 .rating-profile .profile-chart-controls {display:contents;}
 .rating-profile .profile-chart-toolbar :is(.profile-chart-types,.profile-chart-ranges) > button {min-height:36px;padding:6px 10px;font-size:0.78125rem;}
 .rating-profile .profile-history-heading .profile-history-sources > button {min-height:36px;padding:6px 11px;}
}
@media (prefers-reduced-motion:reduce) {
 .rating-profile .profile-chart-toolbar :is(.profile-chart-types,.profile-chart-ranges) > button {transition:none;}
}
