/* 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:218px;min-width:0;max-width:100%;overflow:visible;}
@media (max-width:599px) {.profile-history-chart {min-height:190px;}}
.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;}
.rating-profile .profile-section-nav,.profile-section-nav {position:sticky;top:var(--site-header-height,64px);z-index:20;display:flex;gap:4px;overflow-x:auto;background:#fff;border:1px solid #dbe3eb;border-radius:10px;padding:4px 6px;margin:12px 0 14px;transition:box-shadow 0.16s ease;}
.rating-profile .profile-section-nav.is-stuck,.profile-section-nav.is-stuck {box-shadow:0 4px 12px rgba(15,23,42,0.08);}
.rating-profile .profile-section-nav a,.profile-section-nav a {display:inline-flex;align-items:center;justify-content:center;flex:none;min-height:36px;padding:6px 14px;color:#526175;font-size:.8125rem;font-weight:500;text-decoration:none;border-radius:6px;border-bottom:0;}
.rating-profile .profile-section-nav a:hover,.profile-section-nav a:hover {color:#172333;background:#f1f5f9;}
.rating-profile .profile-section-nav a[aria-current],.profile-section-nav a[aria-current] {color:#047857;background:#ecfdf5;font-weight:600;}
.player-profile-page :is(#profile-ratings,#profile-history,#player-games,#fide-tournaments,#uscf-tournaments) {scroll-margin-top:calc(var(--site-header-height,64px) + var(--profile-nav-height,48px) + 16px);}
.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;}
.rating-profile .profile-history-hub,.profile-history-hub {min-width:0;margin:16px 0;background:white;border:1px solid #dbe3eb;border-radius:12px;padding:16px 20px 14px;}
.profile-history-topbar {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 12px;margin-bottom:12px;padding-bottom:10px;border-bottom:1px solid #edf1f5;}
.profile-history-topbar[hidden],.profile-history-sources[hidden],.profile-history-source[hidden] {display:none!important;}
.rc-hub-label {font-size:0.75rem;font-weight:600;color:#64748b;letter-spacing:0.03em;text-transform:uppercase;}
.rating-profile .profile-history-sources,.profile-history-sources {display:inline-flex;flex-wrap:wrap;gap:2px;padding:2px;border:1px solid #dbe3eb;border-radius:8px;background:#f1f5f9;}
.rating-profile .profile-history-sources > button,.profile-history-sources > button {min-height:28px;border:0;border-radius:6px;padding:4px 12px;font-size:0.78125rem;font-weight:500;line-height:1.25;color:#526175;background:transparent;cursor:pointer;}
.rating-profile .profile-history-sources > button[aria-pressed="true"],.profile-history-sources > button[aria-pressed="true"] {background:#ffffff;color:#047857;font-weight:600;box-shadow:0 1px 2px rgba(15,23,42,0.08);}
.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:36px;display:flex;align-items:center;color:#047857;text-decoration:underline;font-size:.8125rem;}
.profile-chart-export .profile-chart-downloads {padding:6px 0;}
.profile-chart-export .profile-chart-downloads button {min-height:36px;}
.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:2px;}
@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:2px;padding:4px;}.profile-section-nav a {min-height:40px;padding-inline:11px;}
 .profile-ratings-block .profile-records {grid-template-columns:1fr;}
 .profile-history-hub {padding:14px;}
}
@container player-profile (max-width:22rem) {.profile-ratings-block .profile-rating-cards {grid-template-columns:1fr!important;}}
.dark .rating-profile .profile-section-nav,.dark .profile-section-nav {background:#1f2937;border-color:#374151;}
.dark .rating-profile .profile-section-nav.is-stuck,.dark .profile-section-nav.is-stuck {box-shadow:0 4px 16px rgba(0,0,0,0.35);}
.dark .rating-profile .profile-section-nav a,.dark .profile-section-nav a,.dark .player-game-mobile-event {color:#cbd5e1;}
.dark .rating-profile .profile-section-nav a:hover,.dark .profile-section-nav a:hover {color:#f8fafc;background:#293548;}
.dark .rating-profile .profile-section-nav a[aria-current],.dark .profile-section-nav a[aria-current],.dark .profile-chart-export summary {color:#6ee7b7;background:#103f34;}
.dark .rating-profile .profile-history-hub,.dark .profile-history-hub {background:#1f2937;border-color:#374151;color:#f3f4f6;}
.dark .profile-history-topbar {border-color:#334155;}
.dark .rc-hub-label {color:#94a3b8;}
.dark .rating-profile .profile-history-sources,.dark .profile-history-sources {background:#111827;border-color:#374151;}
.dark .rating-profile .profile-history-sources > button,.dark .profile-history-sources > button {color:#cbd5e1;background:transparent;}
.dark .rating-profile .profile-history-sources > button[aria-pressed="true"],.dark .profile-history-sources > button[aria-pressed="true"] {background:#334155;color:#6ee7b7;box-shadow:0 1px 2px rgba(0,0,0,0.3);}
.dark .player-game-mobile {border-color:#374151;}.dark .player-game-mobile-meta {color:#9ca3af;}

/* ==========================================================================
   Compact RadarChess-Inspired Rating History Card (FIDE, USCF, CFC, ECF)
   ========================================================================== */
.rc-card {min-width:0;position:relative;}
.rc-embedded-chart {margin-top:16px;padding-top:14px;border-top:1px solid #e2e8f0;}
.dark .rc-embedded-chart {border-color:#334155;}

.rc-top-row {display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 12px;margin-bottom:8px;}
.rc-eyebrow {margin:0;font-size:0.72rem;font-weight:650;letter-spacing:0.06em;line-height:1.35;text-transform:uppercase;color:#64748b;}
.dark .rc-eyebrow {color:#94a3b8;}

/* Segmented pills (Rating/World rank, Discipline, Range) */
.rc-card .rc-mode-switch,.rc-card .rc-seg-group {
  display:inline-flex;flex-wrap:nowrap;align-items:center;gap:2px;margin:0;padding:2px;
  border:1px solid #dbe3eb;border-radius:8px;background:#f1f5f9;max-width:100%;overflow-x:auto;scrollbar-width:none;
}
.rc-card .rc-mode-switch::-webkit-scrollbar,.rc-card .rc-seg-group::-webkit-scrollbar {display:none;}
.rc-card .rc-mode-switch[hidden] {display:none!important;}
.rc-card .rc-mode-switch > button,.rc-card .rc-seg-group > button {
  appearance:none;display:inline-flex;align-items:center;justify-content:center;
  min-height:28px;padding:4px 10px;margin:0;border:0;border-radius:6px;background:transparent;
  color:#526175;font-size:0.78125rem;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;
}
.rc-card .rc-mode-switch > button:hover:not([aria-pressed="true"]),
.rc-card .rc-seg-group > button:hover:not([aria-pressed="true"]) {color:#172333;background:rgba(255,255,255,0.65);}
.rc-card .rc-mode-switch > button[aria-pressed="true"],
.rc-card .rc-seg-group > button[aria-pressed="true"] {
  background:#ffffff;color:#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);
}
.rc-card .rc-mode-switch > button[aria-pressed="true"] {color:#92400e;}
.rc-card .rc-ranges > button[aria-pressed="true"] {color:#92400e;}
.rc-card .rc-types > button:is([data-chart-type="rapid"],[data-cfc-kind="Q"],[data-ecf-kind="rapid"])[aria-pressed="true"] {color:#2563eb;}
.rc-card .rc-types > button:is([data-chart-type="blitz"],[data-ecf-kind="blitz"])[aria-pressed="true"] {color:#0284c7;}
.rc-card .rc-types > button:is([data-chart-type="compare"],[data-cfc-kind="compare"],[data-ecf-kind="compare"])[aria-pressed="true"] {color:#047857;}
.rc-card .rc-types.is-dimmed {opacity:0.55;}

.rc-controls-row {display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 10px;margin:0 0 6px;}
.rc-right-controls {display:inline-flex;flex-wrap:wrap;align-items:center;gap:8px;margin-left:auto;}

/* Events toggle switch (RadarChess-inspired amber pill switch) */
.rc-card .rc-events-toggle {
  appearance:none;display:inline-flex;align-items:center;gap:7px;min-height:32px;padding:4px 10px 4px 7px;margin:0;
  border:1px solid #dbe3eb;border-radius:8px;background:#ffffff;color:#334155;
  font-size:0.78125rem;font-weight:500;line-height:1.2;cursor:pointer;touch-action:manipulation;
  transition:border-color 0.15s ease,background-color 0.15s ease,color 0.15s ease;
}
.rc-card .rc-events-toggle[hidden] {display:none!important;}
.rc-card .rc-events-toggle:hover {border-color:#cbd5e1;background:#f8fafc;}
.rc-card .rc-toggle-track {
  position:relative;display:inline-flex;align-items:center;width:28px;height:16px;border-radius:999px;
  background:#64748b;transition:background-color 0.16s ease;flex:none;
}
.rc-card .rc-toggle-knob {
  width:12px;height:12px;border-radius:50%;background:#ffffff;transform:translateX(2px);
  box-shadow:0 1px 2px rgba(15,23,42,0.22);transition:transform 0.16s ease;
}
.rc-card .rc-events-toggle[aria-pressed="true"] {border-color:#d6b87b;background:#fffcf5;color:#78350f;}
.rc-card .rc-events-toggle[aria-pressed="true"] .rc-toggle-track {background:#8a5a00;}
.rc-card .rc-events-toggle[aria-pressed="true"] .rc-toggle-knob {transform:translateX(14px);}

/* SVG Plot & Floating Tooltip */
.rc-plot {position:relative;min-height:218px;width:100%;user-select:none;-webkit-user-select:none;}
.rc-svg {display:block;width:100%;height:auto;overflow:visible;}
.rc-empty {display:flex;align-items:center;justify-content:center;min-height:160px;font-size:0.84rem;color:#64748b;text-align:center;padding:16px;}
.rc-tooltip {
  position:absolute;z-index:10;pointer-events:none;min-width:118px;max-width:230px;padding:7px 10px;
  border-radius:8px;border:1px solid #dbe3eb;background:rgba(255,255,255,0.96);color:#0f172a;
  box-shadow:0 6px 18px rgba(15,23,42,0.12);font-size:0.75rem;line-height:1.4;
  backdrop-filter:blur(4px);font-variant-numeric:tabular-nums;
}
.rc-tooltip[hidden] {display:none!important;}
.rc-tt-date {font-size:0.7rem;font-weight:600;color:#64748b;margin-bottom:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.rc-tt-row {display:flex;align-items:center;gap:6px;margin-top:2px;}
.rc-tt-dot {width:7px;height:7px;border-radius:50%;flex:none;}
.rc-tt-name {color:#475569;flex:1;}
.rc-tt-val {font-weight:700;color:#0f172a;}
.rc-tt-sub {margin-top:3px;font-size:0.6875rem;color:#64748b;line-height:1.35;}

/* Minimalist bottom legend */
.rc-legend {display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;margin-top:2px;font-size:0.75rem;color:#64748b;line-height:1.4;}
.rc-legend:empty {display:none;}
.rc-leg-item {display:inline-flex;align-items:center;gap:6px;white-space:nowrap;}
.rc-leg-swatch {display:inline-block;flex:none;}
.rc-leg-line {width:13px;height:2px;border-radius:1px;background:var(--sw,#334155);}
.rc-leg-dot {width:8px;height:8px;border-radius:50%;background:var(--sw,#92400e);}
.rc-leg-diamond {width:7px;height:7px;background:var(--sw,#1d4ed8);transform:rotate(45deg);}
.rc-leg-triangle {width:0;height:0;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:7px solid var(--sw,#15803d);}

/* Compact interactive event detail readout */
.rc-event-detail {
  margin-top:6px;padding:6px 10px;border-radius:7px;border:1px solid #e2e8f0;background:#f8fafc;
  font-size:0.8125rem;line-height:1.45;color:#334155;font-variant-numeric:tabular-nums;
}
.rc-event-detail[hidden] {display:none!important;}
.rc-detail-hint {color:#64748b;}
.rc-detail-content {display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 4px;}
.rc-detail-title {font-weight:600;color:#0f172a;text-decoration:none;}
a.rc-detail-title {color:#1d4ed8;text-decoration:underline;text-underline-offset:2px;}
a.rc-detail-title:hover {color:#1e40af;}
.rc-detail-meta {color:#475569;}
.rc-detail-norm {
  display:inline-flex;align-items:center;margin-left:6px;padding:1px 7px;border-radius:999px;
  background:#dcfce7;color:#166534;font-size:0.7rem;font-weight:650;letter-spacing:0.02em;
}

/* 1-line factual summary sentence */
.rating-profile .rc-card .rc-summary,.rc-card .rc-summary {
  margin:7px 0 0;padding:0;border:0;border-radius:0;background:transparent;
  color:#334155;font-size:0.8125rem;line-height:1.45;min-height:0;font-variant-numeric:tabular-nums;
}

/* Subtle utility footer */
.rc-footer {
  display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:6px 16px;
  margin-top:8px;padding-top:7px;border-top:1px solid #edf1f5;
}
.rc-footer .profile-chart-values {flex:1 1 200px;min-width:0;}
.rc-footer .profile-chart-values summary {
  min-height:28px;font-size:0.78125rem;color:#64748b;text-decoration:underline;text-underline-offset:2px;
}
.rc-footer .profile-chart-values summary:hover {color:#0f172a;}
.rc-export-actions {display:inline-flex;align-items:center;gap:4px;flex:none;}
.rc-card .rc-export-actions > button {
  appearance:none;min-height:28px;padding:3px 8px;margin:0;border:1px solid #e2e8f0;border-radius:6px;
  background:transparent;color:#64748b;font-size:0.72rem;font-weight:500;cursor:pointer;
  transition:color 0.14s ease,border-color 0.14s ease,background-color 0.14s ease;
}
.rc-card .rc-export-actions > button:hover {color:#0f172a;border-color:#cbd5e1;background:#f8fafc;}
.rc-card .rc-export-actions > button:disabled {opacity:0.45;}

/* Dark mode for .rc-* */
.dark .rc-card .rc-mode-switch,.dark .rc-card .rc-seg-group {background:#111827;border-color:#374151;}
.dark .rc-card .rc-mode-switch > button,.dark .rc-card .rc-seg-group > button {color:#94a3b8;background:transparent;}
.dark .rc-card .rc-mode-switch > button:hover:not([aria-pressed="true"]),
.dark .rc-card .rc-seg-group > button:hover:not([aria-pressed="true"]) {color:#f8fafc;background:rgba(255,255,255,0.06);}
.dark .rc-card .rc-mode-switch > button[aria-pressed="true"],
.dark .rc-card .rc-seg-group > button[aria-pressed="true"] {
  background:#334155;color:#f8fafc;box-shadow:0 1px 2px rgba(0,0,0,0.3),inset 0 1px 0 rgba(255,255,255,0.06);
}
.dark .rc-card .rc-mode-switch > button[aria-pressed="true"] {color:#fbbf24;}
.dark .rc-card .rc-ranges > button[aria-pressed="true"] {color:#fbbf24;}
.dark .rc-card .rc-types > button:is([data-chart-type="rapid"],[data-cfc-kind="Q"],[data-ecf-kind="rapid"])[aria-pressed="true"] {color:#93c5fd;}
.dark .rc-card .rc-types > button:is([data-chart-type="blitz"],[data-ecf-kind="blitz"])[aria-pressed="true"] {color:#7dd3fc;}
.dark .rc-card .rc-types > button:is([data-chart-type="compare"],[data-cfc-kind="compare"],[data-ecf-kind="compare"])[aria-pressed="true"] {color:#6ee7b7;}
.dark .rc-card .rc-events-toggle {background:#111827;border-color:#374151;color:#cbd5e1;}
.dark .rc-card .rc-events-toggle:hover {border-color:#4b5563;background:#1e293b;}
.dark .rc-card .rc-toggle-track {background:#475569;}
.dark .rc-card .rc-events-toggle[aria-pressed="true"] {border-color:#92400e;background:#292011;color:#fde68a;}
.dark .rc-card .rc-events-toggle[aria-pressed="true"] .rc-toggle-track {background:#d97706;}
.dark .rc-empty {color:#94a3b8;}
.dark .rc-tooltip {border-color:#475569;background:rgba(17,24,39,0.96);color:#f8fafc;box-shadow:0 8px 24px rgba(0,0,0,0.45);}
.dark .rc-tt-date {color:#94a3b8;}
.dark .rc-tt-name {color:#cbd5e1;}
.dark .rc-tt-val {color:#f8fafc;}
.dark .rc-tt-sub {color:#94a3b8;}
.dark .rc-legend {color:#94a3b8;}
.dark .rc-event-detail {border-color:#334155;background:#111827;color:#cbd5e1;}
.dark .rc-detail-hint {color:#94a3b8;}
.dark .rc-detail-title {color:#f8fafc;}
.dark a.rc-detail-title {color:#93c5fd;}
.dark a.rc-detail-title:hover {color:#bfdbfe;}
.dark .rc-detail-meta {color:#94a3b8;}
.dark .rc-detail-norm {background:#064e3b;color:#a7f3d0;}
.dark .rating-profile .rc-card .rc-summary,.dark .rc-card .rc-summary {color:#cbd5e1;background:transparent;}
.dark .rc-footer {border-color:#334155;}
.dark .rc-footer .profile-chart-values summary {color:#94a3b8;}
.dark .rc-footer .profile-chart-values summary:hover {color:#f8fafc;}
.dark .rc-card .rc-export-actions > button {border-color:#374151;color:#94a3b8;}
.dark .rc-card .rc-export-actions > button:hover {color:#f8fafc;border-color:#4b5563;background:#263244;}

/* Responsive mobile polish */
@media (max-width:640px) {
 .rc-top-row {gap:6px 8px;margin-bottom:6px;}
 .rc-controls-row {gap:6px;}
 .rc-right-controls {width:100%;justify-content:space-between;margin-left:0;}
 .rc-card .rc-mode-switch > button,.rc-card .rc-seg-group > button {min-height:34px;padding:5px 9px;font-size:0.75rem;}
 .rc-card .rc-events-toggle {min-height:34px;padding:4px 9px 4px 6px;font-size:0.75rem;}
 .rc-plot {min-height:190px;}
 .rc-summary {font-size:0.78125rem;}
 .rc-event-detail {font-size:0.78125rem;}
}
@media (prefers-reduced-motion:reduce) {
 .profile-section-nav,.rc-card .rc-mode-switch > button,.rc-card .rc-seg-group > button,.rc-card .rc-events-toggle,.rc-card .rc-toggle-track,.rc-card .rc-toggle-knob {transition:none;}
}
