/* Available-space overlays. The native canvas, camera and page buttons stay game-owned. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
html,body{overflow-x:hidden}
@media(max-width:1100px){
 body:has(>#ui>.menu-ui){position:fixed;inset:0;width:100%;height:100%;overflow:hidden}
}
html body #staticMenu{
 left:calc(var(--sq-visible-left,0px) + max(8px,env(safe-area-inset-left,0px)))!important;
 top:calc(var(--sq-visible-top,0px) + max(8px,env(safe-area-inset-top,0px)))!important;
 max-width:calc(var(--sq-available-width,100vw) - 16px)!important;
}
/* Native menus use scaled coordinates; Safari's chrome can shrink only the visual viewport. */
@media(min-width:601px){
 html body #ui:has(>.menu-ui>.track-info-ui:not(.hidden)),
 html body #ui:has(>.menu-ui>.track-selection-ui:not(.hidden)){
  height:calc(var(--sq-available-height,100vh) / var(--ui-scale-factor,1))!important;
  top:var(--sq-visible-top,0px)!important;
 }
 html[data-sq-space="short"] body .track-info-ui>.side-panel>.thumbnail{padding:12px!important;max-height:140px!important;min-height:32px!important}
 html[data-sq-space="short"] body .track-info-ui>.side-panel>:is(.personal-best-title,.opponents-title){font-size:24px!important;margin-top:6px!important}
 html[data-sq-space="short"] body .track-info-ui>.side-panel>.personal-best{margin-bottom:6px!important}
 html[data-sq-space="short"] body .track-info-ui>.side-panel>.personal-best>div{margin-block:4px!important;font-size:24px!important;line-height:26px!important}
 html[data-sq-space="short"] body .track-info-ui>.side-panel>.opponents-container{min-height:24px!important;flex:1 1 0!important;margin-block:4px!important;overflow:auto!important}
 html[data-sq-space="short"] body .track-info-ui>.side-panel>.play{height:80px!important;font-size:40px!important}
}
@media(max-width:1100px) and (orientation:landscape){
 html body .track-selection-ui>.image-button-container{box-sizing:border-box!important;padding-inline:calc(8px / var(--ui-scale-factor,1))!important}
}
/* A status chip describes one run, not the width of its grid column. */
html body .track-info-ui .leaderboard-ui button.main .verified-state{
 width:fit-content!important;max-width:100%!important;min-width:0!important;
 align-self:flex-start!important;justify-self:start!important;flex:0 0 auto!important;
 white-space:nowrap!important;flex-wrap:nowrap!important;box-sizing:border-box!important;
}
@media(max-width:600px) and (orientation:portrait){
 html body .menu-ui>.track-selection-ui:not(.hidden):not([hidden]),
 html body .menu-ui>.track-info-ui:not(.hidden):not([hidden]){max-width:var(--sq-available-width,100vw)!important;min-width:0!important;box-sizing:border-box!important}
 html body .track-selection-ui>.bar,
 html body .track-selection-ui>.image-button-container{width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box!important}
 html body .track-selection-ui>.image-button-container{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:4px!important}
 html body .track-selection-ui>.image-button-container>.button{min-width:0!important;max-width:100%!important;width:100%!important;box-sizing:border-box!important;overflow-wrap:anywhere;font-size:clamp(13px,3.6vw,17px)!important}
 html body .track-info-ui .leaderboard-ui button.main{height:76px!important;min-height:76px!important;grid-template-columns:56px 72px minmax(0,1fr)!important}
 html body .track-info-ui .leaderboard-ui button.main>.image-container,
 html body .track-info-ui .leaderboard-ui button.main>.image-container img{width:56px!important;height:56px!important}
 html body .track-info-ui .leaderboard-ui button.main>.right{overflow:hidden!important}
 html body .track-info-ui .leaderboard-ui button.main .verified-state{font-size:12px!important;gap:4px!important;padding:2px 5px!important;min-height:22px!important;line-height:1.2!important}
}
@media(min-width:390px) and (max-width:600px) and (orientation:portrait){
 html:root body .track-info-ui .leaderboard-ui:not(.sq-event-board)>.button-wrapper::before{min-height:44px!important}
 html:root body .track-info-ui .leaderboard-ui:not(.sq-event-board)>.button-wrapper{grid-template-columns:minmax(58px,1fr) minmax(58px,.9fr) minmax(112px,1.4fr) 44px!important;grid-template-rows:44px!important;gap:4px!important;min-height:52px!important;padding:4px 0!important}
 html:root body .track-info-ui .leaderboard-ui:not(.sq-event-board)>.button-wrapper>button{height:44px!important;min-height:44px!important;padding:4px!important;font-size:14px!important}
 html:root body .track-info-ui .leaderboard-ui:not(.sq-event-board)>.button-wrapper>.only-verified{grid-column:3!important;grid-row:1!important}
 html:root body .track-info-ui .leaderboard-ui:not(.sq-event-board)>.button-wrapper>.icon-button.first{grid-column:4!important;grid-row:1!important;min-width:44px!important}
}
.overall-mobile-tools[hidden],.overall-mobile-drawer[hidden] { display: none !important; }
html body #overallLeaderboardPanel #overallDailyGrid[data-mobile-axis] {
  position: relative !important;
  grid-template-columns: minmax(0,1fr) 60px !important;
  grid-template-rows: 44px 44px !important;
  gap: 6px !important;
  padding: 6px 8px !important;
  height: 106px !important;
  max-height: 106px !important;
  overflow: visible !important;
}
html body #overallLeaderboardPanel #overallDailyGrid[data-mobile-axis] > :is(.overall-center-tools,.overall-footer-right) {
  padding: 0 !important; border: 0 !important; background: none !important;
  min-height: 0 !important; height: auto !important; gap: 0 !important;
}
html body #overallLeaderboardPanel #overallDailyGrid[data-mobile-axis] .overall-center-tools {
  grid-column: 1 / -1 !important; grid-row: 1 !important; display: block !important;
}
html body #overallLeaderboardPanel #overallDailyGrid[data-mobile-axis] .overall-footer-right {
  grid-column: 1 !important; grid-row: 2 !important; display: block !important;
}
html body #overallLeaderboardPanel #overallDailyGrid[data-mobile-axis] .overall-pager {
  display: flex !important; align-items: center !important; justify-content: center !important;
  height: 44px !important; min-height: 44px !important; gap: 4px !important; padding: 0 !important;
}
html body #overallLeaderboardPanel #overallDailyGrid[data-mobile-axis] .overall-page-button {
  flex: 0 0 44px !important; width: 44px !important; height: 44px !important;
  min-height: 44px !important; padding: 0 !important; font-size: 24px !important;
}
html body #overallLeaderboardPanel #overallDailyGrid[data-mobile-axis] .overall-page-position { min-width: 106px !important; }
html body #overallLeaderboardPanel #overallDailyGrid[data-mobile-axis] .overall-category-control {
  position: relative !important; grid-template-columns: minmax(0,1fr) 44px !important;
  height: 44px !important; min-height: 44px !important; padding: 0 !important;
}
html body #overallLeaderboardPanel #overallDailyGrid[data-mobile-axis] .overall-category-info { width: 44px !important; height: 44px !important; }
html body #overallLeaderboardPanel #overallDailyGrid[data-mobile-axis] .overall-category-description {
  position: absolute !important; right: 0 !important; bottom: calc(100% + 8px) !important;
  width: min(390px,calc(var(--sq-available-width) - 24px)) !important;
  max-height: calc(var(--sq-available-height) - 160px); overflow-y: auto; z-index: 22;
}
html body #overallLeaderboardPanel #overallDailyGrid[data-mobile-axis] .overall-category-select {
  min-height: 44px !important; height: 44px !important; padding: 0 !important; gap: 4px !important;
  display: flex !important;
}
html body #overallLeaderboardPanel #overallDailyGrid[data-mobile-axis] .overall-category-select > span {
  position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip-path: inset(50%) !important;
}
html body #overallLeaderboardPanel #overallDailyGrid[data-mobile-axis] .sq-category-trigger {
  height: 44px !important; min-height: 44px !important; padding: 7px 10px !important; font-size: 16px !important;
}
html body #overallLeaderboardPanel #overallDailyGrid[data-mobile-axis] .overall-mobile-tools {
  grid-column: 2 !important; grid-row: 2 !important; min-width: 0 !important; width: 60px !important;
  height: 44px !important; min-height: 44px !important; padding: 4px !important;
  color: #dbf6ff; background: #2b4677; border: 1px solid #8ab5d8; font: 16px ForcedSquare,sans-serif;
  cursor: pointer; pointer-events: auto;
}
html body #overallLeaderboardPanel #overallDailyGrid[data-mobile-axis] > .overall-mobile-drawer {
  position: absolute !important; inset: auto 6px calc(100% + 4px) !important;
  display: flex !important; flex-direction: column !important; gap: 8px !important;
  width: auto !important; max-height: min(420px,calc(var(--sq-available-height) - 120px)) !important;
  overflow-y: auto !important; overscroll-behavior: contain; padding: 10px !important;
  border: 1px solid #8ab5d8 !important; background: #1a2d52 !important;
  box-shadow: 0 -8px 24px #0006; z-index: 20;
}
html body #overallLeaderboardPanel #overallDailyGrid[data-mobile-axis] > .overall-mobile-drawer[hidden] { display: none !important; }
html body #overallLeaderboardPanel #overallDailyGrid[data-mobile-axis] .overall-mobile-drawer > * { flex: 0 0 auto !important; }
html body #overallLeaderboardPanel #overallDailyGrid[data-mobile-axis] .overall-mobile-drawer .leaderboard-arcade { display: block !important; }
html body #overallLeaderboardPanel #overallDailyGrid[data-mobile-axis] :is(button,input) {
  clip-path: none !important; transform: none !important; border-radius: 2px !important;
}
html body #overallLeaderboardPanel #overallDailyGrid[data-mobile-axis="landscape"] {
  grid-template-columns: minmax(280px,1fr) minmax(180px,1fr) 60px !important;
  grid-template-rows: 44px !important; height: 58px !important; max-height: 58px !important;
}
html body #overallLeaderboardPanel #overallDailyGrid[data-mobile-axis="landscape"] .overall-center-tools { grid-column: 1 !important; grid-row: 1 !important; }
html body #overallLeaderboardPanel #overallDailyGrid[data-mobile-axis="landscape"] .overall-footer-right { grid-column: 2 !important; grid-row: 1 !important; }
html body #overallLeaderboardPanel #overallDailyGrid[data-mobile-axis="landscape"] .overall-mobile-tools { grid-column: 3 !important; grid-row: 1 !important; }
@media (max-width: 700px), (max-width: 1100px) and (max-height: 500px) {
  html body #overallLeaderboardPanel .overall-entry { min-height: 82px !important; padding-block: 6px !important; }
  html body #overallLeaderboardPanel .overall-entry .overall-car-model { width: 54px !important; min-width: 54px !important; height: 54px !important; margin-right: 6px !important; }
  html body #overallLeaderboardPanel .overall-entry .overall-name { font-size: 19px !important; }
  html body #overallLeaderboardPanel .overall-entry .overall-name-main { flex-wrap: nowrap !important; }
  html body #overallLeaderboardPanel .overall-entry .overall-racer-meta { font-size: 11px !important; }
  html body #overallLeaderboardPanel .overall-entry .overall-score { font-size: 24px !important; }
  html body #overallLeaderboardPanel .overall-entry .overall-score-unit { font-size: 10px !important; }
  html body #overallLeaderboardPanel .overall-entry .overall-rank { width: auto !important; font-size: 23px !important; }
  html body #overallLeaderboardPanel .overall-entry .overall-mid { gap: 3px !important; }
}
@media (max-width: 1100px) and (max-height: 500px) {
  html body #overallLeaderboardPanel .overall-sub,
  html body #overallLeaderboardPanel .overall-opportunities,
  html body #overallLeaderboardPanel .overall-racer-meta { display: none !important; }
  html body #overallLeaderboardPanel .overall-top { padding: 4px 8px !important; }
  html body #overallLeaderboardPanel .overall-top h2 { font-size: 24px !important; }
  html body #overallLeaderboardPanel .overall-top .overall-filter-host { order: initial !important; width: auto !important; }
}
@media (max-width: 600px) and (orientation: portrait) {
  html body .track-selection-ui > .tracks-container.open > .wrapper { display: block !important; width: 100% !important; min-width: 0 !important; }
  html body .track-selection-ui > .tracks-container.open:not(.no-group-containers) > .wrapper > div:has(> .track):not(.hidden):not([hidden]):not([style*="display: none"]):not(.sq-featured-events) {
    display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    width: 100% !important; min-width: 0 !important; gap: 8px !important; margin: 0 0 12px !important;
  }
  html body .track-selection-ui > .tracks-container.open.no-group-containers > .wrapper {
    display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 8px !important;
  }
  html body .track-selection-ui .tracks-container .track:not(.track-of-the-week):not(.hidden):not([hidden]):not([style*="display: none"]) { display: block !important; width: 100% !important; min-width: 0 !important; }
  html body .track-selection-ui .track:not(.track-of-the-week) > .button { display: block !important; width: 100% !important; max-width: none !important; height: 174px !important; }
  html body .track-selection-ui .track:not(.track-of-the-week) > .button > .thumbnail {
    box-sizing: border-box !important; margin: 0 !important; padding: 6px !important;
    width: 100% !important; height: 112px !important; object-fit: contain !important;
  }
  html body .track-selection-ui .track-title > p { box-sizing: border-box !important; width: 100% !important; max-width: 100% !important; }
}
@media (max-width: 600px) and (orientation: portrait) {
  html body .track-selection-ui .tracks-container .track[style*="display: none"] { display: none !important; }
}
:root {
  --sq-available-width: 100vw;
  --sq-available-height: 100vh;
  --sq-visible-top: 0px;
}
/* Weight, population and source age lead. Policy/change timestamps are secondary. */
html:root body #polytrackTrackFreshness.polytrack-track-freshness {
  background: #21364c !important;
  pointer-events: auto;
  box-shadow: 0 6px 18px #0004 !important;
}
html:root body #polytrackTrackFreshness .track-data-weight {
  font-size: calc(clamp(20px, 1.65vw, 25px) * var(--sq-ui-scale,1));
  line-height: 1.1;
  color: #ffe6a6;
}
html:root body #polytrackTrackFreshness .track-data-players { font-size: calc(clamp(20px, 1.65vw, 25px) * var(--sq-ui-scale,1)); line-height: 1.1; color: #c6edff; }
html:root body #polytrackTrackFreshness.polytrack-track-freshness > strong { align-items: baseline; gap: 6px 12px; }
html:root body #polytrackTrackFreshness.polytrack-track-freshness[data-layout="vertical"],
html:root body #polytrackTrackFreshness.polytrack-track-freshness[data-layout="compact"][data-expanded="true"] {
  width: fit-content !important;
  max-width: var(--sq-track-data-width) !important;
  padding: calc(7px * var(--sq-ui-scale,1)) calc(9px * var(--sq-ui-scale,1)) !important;
  gap: 4px !important;
}
html:root body #polytrackTrackFreshness.polytrack-track-freshness[data-layout="compact"]:not([data-expanded="true"]) {
  width: 44px !important;
  height: 44px !important;
  padding: 10px !important;
}
html:root body #polytrackTrackFreshness.polytrack-track-freshness[data-layout="horizontal"] > strong { flex-direction: row !important; align-items: baseline; gap: 8px 16px !important; }
html:root body #polytrackTrackFreshness.polytrack-track-freshness[data-detail="essential"] > :is(.track-data-update,.track-data-unlock) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
}
html:root body #polytrackTrackFreshness.polytrack-track-freshness[data-detail="essential"]:is(:hover,:focus-within) > :is(.track-data-update,.track-data-unlock),
html:root body #polytrackTrackFreshness.polytrack-track-freshness[data-detail="full"] > :is(.track-data-update,.track-data-unlock) {
  position: static !important;
  width: auto !important;
  height: auto !important;
  overflow: visible !important;
  clip-path: none !important;
}
html:root body #polytrackTrackFreshness:focus-visible { outline: 2px solid #a1edff; outline-offset: 3px; }
@supports (height: 100dvh) { :root { --sq-available-height: 100dvh; } }
html body :is(#overallLeaderboardPanel,#overallProfilePopup,#overallHelpPopup) {
  box-sizing: border-box;
  overscroll-behavior: contain;
  top: var(--sq-visible-top, 0px) !important;
  left: var(--sq-visible-left, 0px) !important;
  right: auto !important;
  bottom: auto !important;
  width: var(--sq-available-width) !important;
  height: var(--sq-available-height) !important;
}
html body #overallFilterPanel { min-width: 0; box-sizing: border-box; }
html body :is(#overallProfilePopup,#overallHelpPopup) {
  width: min(100%, var(--sq-available-width)) !important;
  height: min(100%, var(--sq-available-height)) !important;
}
html body #overallLeaderboardPanel .overall-shell {
  width: min(1540px, calc(var(--sq-available-width) - 16px)) !important;
  height: calc(var(--sq-available-height) - 16px) !important;
  max-height: calc(var(--sq-available-height) - 16px) !important;
  min-height: calc(var(--sq-available-height) - 16px) !important;
  flex: 0 0 auto;
  min-width: 0;
}
/* Override legacy short-screen fixed list heights without moving native track UI. */
html body #overallLeaderboardPanel .overall-shell { box-sizing: border-box !important; overflow: hidden !important; }
html body #overallLeaderboardPanel #overallLeaderboardList {
  flex: 1 1 0 !important; min-height: 0 !important; max-height: none !important;
  box-sizing: border-box !important; min-width: 0; overflow-y: auto !important; overscroll-behavior: contain;
}
/* Short windows must scroll the shell when controls exceed its visible height. */
@media (max-height: 420px) {
  html body #overallLeaderboardPanel .overall-shell { overflow-y: auto !important; }
  html body #overallLeaderboardPanel #overallLeaderboardList { min-height: 110px !important; flex-shrink: 0 !important; }
}
html body #overallLeaderboardList .overall-entry { animation-duration: .16s !important; }
/* Search and its filter action form one row; notices get the next full line. */
html body #overallLeaderboardPanel #overallFilterPanel {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  min-width: 0;
}
html body #overallLeaderboardPanel #overallFilterPanel > .overall-racer-search {
  order: 0;
  flex: 1 1 160px !important;
  max-width: none !important;
  min-width: 0 !important;
}
html body #overallLeaderboardPanel #overallFilterPanel > [data-personal-filter-button] {
  order: 1;
  flex: 0 0 auto !important;
  align-self: center !important;
  margin: 0 !important;
}
html body #overallLeaderboardPanel #overallFilterPanel > :not(.overall-racer-search):not([data-personal-filter-button]) {
  order: 2;
  flex-basis: 100%;
}
#overallTopTrackScope[hidden]{display:none!important}
#overallTopTrackScope{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;width:100%;min-width:0}
#overallTopTrackScope>button{min-width:0;min-height:44px;padding:5px 7px;white-space:normal;line-height:1.2}
@media(min-width:701px){
 html body #overallLeaderboardPanel #overallFilterPanel>.overall-racer-search,
 html body #overallLeaderboardPanel #overallFilterPanel>[data-personal-filter-button]{height:44px!important;min-height:44px!important;box-sizing:border-box}
}
@media(min-width:1101px){
 html body #overallLeaderboardPanel .overall-top{display:grid!important;grid-template-columns:minmax(0,.8fr) minmax(320px,1.7fr) auto!important;align-items:center!important;gap:16px!important}
 html body #overallLeaderboardPanel .overall-top .overall-title-group{grid-column:1!important;grid-row:1!important;min-width:0}
 html body #overallLeaderboardPanel .overall-top .overall-title-group h2{font-size:clamp(26px,2.2vw,38px)!important;white-space:normal!important;line-height:1.1}
 html body #overallLeaderboardPanel .overall-top #overallFilterPanel{grid-column:2!important;grid-row:1!important;width:100%!important;max-width:680px!important;justify-self:center}
 html body #overallLeaderboardPanel .overall-top .overall-actions{grid-column:3!important;grid-row:1!important;justify-self:end;margin:0!important}
}
html body #overallLeaderboardList .overall-loading::before {
  content: '';
  display: block;
  width: 30px;
  height: 30px;
  margin: 0 auto 12px;
  border: 3px solid #5575a5;
  border-top-color: #9ceaff;
  border-radius: 50%;
  animation: sq-ranking-loading .7s linear infinite;
}
@keyframes sq-ranking-loading { to { transform: rotate(360deg); } }
html body #overallProfilePopup .overall-profile-card,
html body #overallHelpPopup .overall-help-card {
  box-sizing: border-box;
  width: min(1440px, calc(var(--sq-available-width) - 24px)) !important;
  max-width: calc(var(--sq-available-width) - 24px) !important;
  max-height: calc(var(--sq-available-height) - 24px) !important;
  overflow: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
html body #overallProfilePopup .overall-profile-header,
html body #overallProfilePopup .profile-dialog-toolbar,
html body #overallHelpPopup .overall-help-header,
html body #overallHelpPopup .overall-help-head {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #25386c;
}
/* Keep the sticky toolbar flush with the scrollport, including after a scroll. */
html body #overallProfilePopup .overall-profile-card {
  padding-top: 0 !important;
  clip-path: none !important;
}
html body #overallProfilePopup .profile-dialog-toolbar {
  top: 0 !important;
  margin-top: 0 !important;
  z-index: 15;
}
.profile-participation{grid-column:1/-1;min-width:0;padding:10px 12px;background:#223663;color:#dceaff;font-size:17px}
.profile-participation-counts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin:6px 0 0;font-size:17px;line-height:1.35}
.profile-participation-counts>div{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:4px 8px;padding:5px 8px;background:#172650;color:#dceaff;font-weight:normal;min-width:0}
.profile-participation-counts dt{font-size:15px;color:#b8d3ee}
.profile-participation-counts dd{margin:0;font:700 21px/1.3 'Trebuchet MS',Verdana,sans-serif;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.profile-participation-note{display:block;margin-top:6px;line-height:1.4}
@media(max-width:600px){.profile-participation-counts{grid-template-columns:repeat(2,minmax(0,1fr))}}
.profile-no-medals{margin:6px 0!important;padding:8px 10px!important;line-height:1.4!important;font-size:17px!important;background:transparent!important;border:0!important;color:#c2d3e9!important}
.profile-no-medals>span{display:block;color:#eef6ff;font-weight:normal}
.profile-no-medals small{display:block;font-size:14px;line-height:1.4}
html body #overallHelpPopup .overall-help-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)) !important;
  gap: 14px !important;
  align-items: start;
}
html body #overallLeaderboardPanel #overallHelpPopup .overall-help-grid section { min-width: 0; padding: 12px; overflow-wrap: anywhere; grid-column: auto !important; }
html body #overallHelpPopup .overall-help-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
html body #overallHelpPopup .overall-help-head h3 { font-size: clamp(22px, 3vw, 32px); min-width: 0; }
html body #overallHelpPopup #overallHelpClose { flex: 0 0 auto; width: auto !important; min-width: 88px !important; min-height: 44px !important; padding: 8px 18px !important; font-size: 17px !important; white-space: nowrap; }
html body #overallHelpPopup .overall-help-grid p { line-height: 1.4; }
html body #overallHelpPopup .overall-help-content > h4 { margin: 20px 0 6px; color: #9ce8ff; }
html body #overallHelpPopup .ranked-help-note { margin: 0 0 12px; color: #becde8; line-height: 1.4; }
html body #overallHelpPopup .ranked-help-sections { display: grid; gap: 8px; }
html body #overallHelpPopup .ranked-help-controls { min-width: 0; border: 1px solid #4b6690; background: #17264c; }
html body #overallHelpPopup .ranked-help-controls summary { min-height: 44px; box-sizing: border-box; padding: 12px 16px; cursor: pointer; color: #e1f6ff; }
html body #overallHelpPopup .ranked-help-controls summary:focus-visible { outline: 2px solid #8ee9ff; outline-offset: -3px; }
html body #overallHelpPopup .ranked-help-controls[open] summary { background: #29416f; border-bottom: 1px solid #4b6690; }
html body #overallHelpPopup .ranked-help-controls dl { margin: 0; padding: 4px 16px 12px; }
html body #overallHelpPopup .ranked-help-controls dl > div { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 0; border-bottom: 1px solid #304568; }
html body #overallHelpPopup .ranked-help-controls dl > div:last-child { border-bottom: 0; }
html body #overallHelpPopup .ranked-help-controls dt { flex: 1 1 210px; min-width: 0; color: #96e7ff; }
html body #overallHelpPopup .ranked-help-controls dd { flex: 2 1 260px; min-width: 0; margin: 0; line-height: 1.5; color: #e2eafb; }
html body #overallHelpPopup .ranked-help-controls kbd { font: inherit; overflow-wrap: anywhere; }
html body #overallHelpPopup .overall-help-actions { position: sticky; bottom: 0; background: #25386c; padding-block: 8px; }
html body .pt-group-filter-menu .fm-shell {
  max-width: calc(var(--sq-available-width) - 24px) !important;
  max-height: calc(var(--sq-available-height) - 24px) !important;
  box-sizing: border-box;
  overscroll-behavior: contain;
}
html body .pt-group-filter-menu {
  top: var(--sq-visible-top, 0px);
  left: var(--sq-visible-left, 0px);
  width: var(--sq-available-width);
  height: var(--sq-available-height);
}
html body :is(#overallProfilePopup,#overallHelpPopup,#overallFilterPanel) :is(input,select,textarea) {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
html body :is(#overallLeaderboardPanel,#overallProfilePopup,#overallHelpPopup,#overallFilterPanel) :is(button,summary,select,input):focus-visible {
  outline: 2px solid #a1edff;
  outline-offset: 2px;
}
html body .track-info-ui .leaderboard-ui > .button-wrapper {
  width: calc(100% - 20px) !important;
  max-width: none !important;
}
/* Keep the native information panel on the right while its board mounts. */
html body .track-info-ui.sq-event-scaffold-needed::before {
  content: 'Loading event standings';
  display: grid;
  place-items: center;
  width: 600px;
  align-self: stretch;
  flex: 0 0 600px;
  background: #29366b;
  color: #c6e9ff;
  font: 20px ForcedSquare, sans-serif;
  order: -1;
}
@media (max-width: 600px) and (orientation: portrait) {
  html body .track-info-ui.sq-event-scaffold-needed::before { width: 100%; flex: 1 1 120px; min-height: 120px; order: 1; }
}
/* Each custom profile section responds to its own column, not the monitor's name. */
html body #overallProfileContent { container-type: inline-size; }
html body #overallProfilePopup :is(.profile-guide-controls,.profile-track-list,.profile-results,.profile-stat-strip) { min-width: 0; }
@container (max-width: 720px) {
  #overallProfilePopup .profile-guide-controls { flex-wrap: wrap !important; gap: 8px !important; }
  #overallProfilePopup .profile-guide-track { min-width: 0 !important; }
  #overallProfilePopup .profile-track-head { font-size: 13px !important; }
}
@media (max-width: 1100px), (max-height: 700px) {
  html body .pt-group-filter-menu .fm-shell {
    max-height: calc(var(--sq-available-height) - 24px) !important;
  }
  html body #overallLeaderboardPanel .overall-top { padding: 10px 14px !important; gap: 10px; }
  html body #overallLeaderboardPanel .overall-top h2 { font-size: clamp(26px, 3.2vw, 42px) !important; }
  html body #overallLeaderboardPanel .overall-actions { gap: 6px; }
  html body #overallLeaderboardPanel .overall-action-btn { min-width: 68px; min-height: 44px; font-size: 18px; }
  html body #overallLeaderboardPanel .overall-sub { padding: 6px 14px; font-size: 13px; }
  html body #overallLeaderboardPanel .overall-columns { padding-block: 6px; font-size: 12px; }
  html body #overallLeaderboardPanel #overallDailyGrid { gap: 6px !important; padding: 6px !important; }
  html body #overallLeaderboardPanel #overallDailyGrid > div { padding: 5px !important; }
  html body #overallLeaderboardPanel #overallDailyGrid .overall-center-tools { gap: 6px !important; }
  html body #overallLeaderboardPanel #overallDailyGrid .competition-track-name { font-size: 17px !important; }
  html body #overallLeaderboardPanel #overallDailyGrid .competition-result { font-size: 12px !important; }
  html body #overallLeaderboardPanel #overallDailyGrid .overall-challenge-stack > section { min-height: 58px !important; padding: 4px !important; }
  html body #overallLeaderboardPanel #overallDailyGrid .competition-feature-button { grid-template-columns: 40px minmax(0,1fr) !important; }
  html body #overallLeaderboardPanel #overallDailyGrid .competition-feature-image { width: 40px !important; height: 40px !important; }
}
@media (min-width: 701px) and (max-width: 1100px) {
  html body #overallLeaderboardPanel .overall-shell { --rank-columns: 68px minmax(0,1.3fr) minmax(0,1fr) minmax(92px,.5fr); }
}
/* Wide but short school-laptop windows retain three distinct footer sections. */
@media (min-width: 1000px) and (max-height: 700px) {
  html body #overallLeaderboardPanel #overallDailyGrid {
    grid-template-columns: minmax(0,1fr) minmax(0,.95fr) minmax(0,1fr) !important;
    grid-template-rows: auto !important;
    max-height: 38vh !important;
  }
  html body #overallLeaderboardPanel #overallDailyGrid .overall-challenge-stack { grid-column: 1 !important; grid-row: 1 !important; grid-template-columns: minmax(0,1fr) !important; }
  html body #overallLeaderboardPanel #overallDailyGrid .overall-center-tools { grid-column: 2 !important; grid-row: 1 !important; }
  html body #overallLeaderboardPanel #overallDailyGrid .overall-footer-right { grid-column: 3 !important; grid-row: 1 !important; }
}
@media (max-width: 700px) {
  html body #overallLeaderboardPanel { padding: 4px !important; }
  html body #overallLeaderboardPanel .overall-shell { width: calc(var(--sq-available-width) - 8px) !important; height: calc(var(--sq-available-height) - 8px) !important; }
  html body #overallLeaderboardPanel .overall-top { flex-wrap: wrap; padding: 8px !important; }
  html body #overallLeaderboardPanel .overall-title-group { flex: 1 1 170px; }
  html body #overallLeaderboardPanel .overall-actions { margin-left: auto; }
  html body #overallLeaderboardPanel .overall-actions button { min-width: 54px; padding-inline: 8px; font-size: 16px; }
  html body #overallProfilePopup .profile-hero { grid-template-columns: minmax(0,1fr) !important; }
  html body #overallProfilePopup .profile-identity h3 { overflow-wrap: anywhere; }
  html body #overallProfilePopup .profile-track-history { min-width: 0; }
  html body #overallProfilePopup .profile-guide-controls .profile-guide-filter { min-height: 44px !important; }
}
@media (max-height: 460px) {
  html body #overallLeaderboardPanel .overall-top { padding-block: 4px !important; }
  html body #overallLeaderboardPanel .overall-sub { max-height: 30px; overflow: auto; }
  html body #overallProfilePopup .overall-profile-card,
  html body #overallHelpPopup .overall-help-card { max-height: calc(var(--sq-available-height) - 12px) !important; }
  html body #overallProfilePopup .profile-hero { gap: 10px; }
  html body #overallProfilePopup .profile-car-column { max-height: 150px; overflow: auto; }
  html body #overallLeaderboardPanel #overallDailyGrid { max-height: 48vh !important; }
}
@media (max-height: 440px) and (min-width: 641px) {
  html body #overallLeaderboardPanel #overallDailyGrid { grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important; grid-template-rows: auto auto !important; }
  html body #overallLeaderboardPanel #overallDailyGrid .overall-center-tools { grid-column: 1 !important; grid-row: 1 !important; }
  html body #overallLeaderboardPanel #overallDailyGrid .overall-footer-right { grid-column: 2 !important; grid-row: 1 !important; }
  html body #overallLeaderboardPanel #overallDailyGrid .overall-challenge-stack { grid-column: 1 / -1 !important; grid-row: 2 !important; grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important; }
  html body #overallLeaderboardPanel .overall-page-arrow { min-width: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  html body :is(#overallLeaderboardPanel,#overallProfilePopup,#overallHelpPopup,#overallFilterPanel) * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

html body #overallLeaderboardPanel #overallDailyGrid[data-mobile-axis] .overall-mobile-drawer .overall-track-scope button{min-height:44px!important;flex:1 1 auto}
/* Help stays searchable without turning every shortcut into a large button. */
#overallHelpPopup .ranked-help-search{margin:14px 0 18px}
#overallHelpPopup .ranked-help-search>label{display:block;margin-bottom:6px;color:#a7d5ff}
#overallHelpPopup .ranked-help-search>div{display:flex;gap:8px;min-width:0}
#overallHelpPopup .ranked-help-search input{flex:1;min-width:0;min-height:44px;box-sizing:border-box;padding:8px 12px;background:#14214b;color:#eefaff;border:1px solid #7fa9d0;font:inherit}
#overallHelpPopup .ranked-help-search button{flex:0 0 auto;min-height:44px;padding:8px 14px}
#overallHelpPopup .ranked-help-controls summary{min-height:44px;box-sizing:border-box;display:flex;align-items:center;gap:10px;cursor:pointer}
#overallHelpPopup .ranked-help-controls summary small{margin-left:auto;color:#9ebbd8;font-size:.8em}
#overallHelpPopup .ranked-help-controls summary::before{content:'';width:0;height:0;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:7px solid #7ee7ff;flex:0 0 auto}
#overallHelpPopup .ranked-help-controls[open] summary::before{transform:rotate(90deg)}
#overallHelpPopup .ranked-help-controls [hidden],#overallHelpPopup .ranked-help-controls[hidden]{display:none!important}
#overallHelpPopup .ranked-help-controls kbd{overflow-wrap:anywhere;white-space:normal}
#overallHelpPopup [data-help-empty]{color:#ffd28c}
#overallHelpPopup [data-help-empty][hidden]{display:none!important}
#overallHelpPopup .ranked-help-search input:focus-visible{outline:2px solid #7ee7ff;outline-offset:2px}

/* Respect reduced-motion preferences without changing native finish typography or geometry. */
@media(prefers-reduced-motion:reduce){html body .time-announcer-ui > .current > div{transition:none!important}}

/* Keep common preferences paired; technical controls stay out of the main grid. */
@media(max-width:1100px) and (max-height:500px){
 html body #overallLeaderboardPanel .overall-top{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;grid-template-rows:auto auto!important;gap:4px!important}
 html body #overallLeaderboardPanel .overall-top .overall-title-group{grid-column:1!important;grid-row:1!important;min-width:0!important}
 html body #overallLeaderboardPanel .overall-top .overall-actions{grid-column:2!important;grid-row:1!important;margin:0!important}
 html body #overallLeaderboardPanel .overall-top #overallFilterPanel{grid-column:1/-1!important;grid-row:2!important;width:100%!important}
}
html body .settings-menu-ui>h2{padding-top:max(12px,env(safe-area-inset-top,0px))!important}
html body .settings-menu-ui>.container{padding-left:max(10px,env(safe-area-inset-left,0px))!important;padding-right:max(10px,env(safe-area-inset-right,0px))!important}
html body .settings-menu-ui>.button-wrapper{padding:8px max(8px,env(safe-area-inset-right,0px)) max(8px,env(safe-area-inset-bottom,0px)) max(8px,env(safe-area-inset-left,0px))!important}
.settings-menu-ui #sqRankedSettings{padding:8px 0!important;box-sizing:border-box;min-width:0;border-bottom:0;background:transparent;color:var(--text-color)}
.settings-menu-ui #sqRankedSettings>h2{margin:0 0 8px!important;padding:4px 0;font-size:calc(24px * var(--sq-ui-scale,1))!important;font-weight:normal;line-height:1.15}
.settings-menu-ui #sqRankedSettings .sq-settings-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px 12px!important;margin:8px 0!important;align-items:stretch}
.settings-menu-ui #sqRankedSettings .sq-settings-grid>.sq-setting-row{display:grid!important;grid-template-columns:minmax(0,1fr) calc(108px * var(--sq-ui-scale,1))!important;align-items:center!important;grid-column:auto!important;gap:8px!important;margin:0!important;padding:8px 0!important;min-width:0!important;min-height:60px!important;border:0!important;background:transparent!important;box-shadow:none!important;clip-path:none!important;box-sizing:border-box}
.settings-menu-ui #sqRankedSettings .sq-settings-grid>.sq-setting-row:last-child:nth-child(odd){grid-column:1/-1!important}
.settings-menu-ui #sqRankedSettings .sq-setting-row>:is(p,label){margin:0!important;min-width:0!important;font-size:calc(18px * var(--sq-ui-scale,1))!important;line-height:1.3!important;color:var(--text-color)!important;white-space:normal!important;overflow:visible!important;overflow-wrap:anywhere}
.settings-menu-ui #sqRankedSettings .sq-setting-row>.button-wrapper{margin:0!important;min-width:0!important;display:flex!important}
.settings-menu-ui #sqRankedSettings .sq-setting-row .button{margin:0!important;min-width:0!important;min-height:44px!important;height:auto!important;box-sizing:border-box;font-size:calc(18px * var(--sq-ui-scale,1))!important;line-height:1.2!important}
.settings-menu-ui #sqRankedSettings .sq-setting-row .button.selected{background-color:var(--button-hover-color)!important}
.settings-menu-ui #sqRankedSettings .sq-setting-row>select{min-width:0!important;width:100%!important;font:italic calc(18px * var(--sq-ui-scale,1))/1.2 ForcedSquare,sans-serif!important;min-height:44px;box-sizing:border-box;padding:6px 10px;background:var(--surface-tertiary-color);color:var(--text-color);border:0}
.settings-menu-ui #sqRankedSettings .sq-range-controls{display:flex;align-items:center;gap:6px;min-width:0!important;width:100%!important;min-height:44px}
.settings-menu-ui #sqRankedSettings .sq-range-controls input{width:100%!important;min-width:0!important;flex:1;margin:0!important;min-height:44px;accent-color:var(--text-color)!important}
.settings-menu-ui #sqRankedSettings .sq-range-controls output{color:var(--text-color)!important;font-size:calc(16px * var(--sq-ui-scale,1))!important;min-width:4ch;text-align:right}
.settings-menu-ui #sqRankedSettings .sq-settings-advanced{margin-top:8px;border:0;padding:0}
.settings-menu-ui #sqRankedSettings .sq-settings-advanced>summary{padding:10px 0;min-height:44px;box-sizing:border-box;cursor:pointer;color:var(--text-color);font-size:calc(20px * var(--sq-ui-scale,1));line-height:1.2}
.settings-menu-ui #sqRankedSettings .sq-settings-advanced .sq-setting-secret{grid-column:1/-1!important;display:block!important}
.settings-menu-ui #sqRankedSettings .sq-secret-controls{min-width:0;gap:8px!important}
.settings-menu-ui #sqRankedSettings .sq-secret-controls input{box-sizing:border-box;min-width:0!important;min-height:44px;background:var(--surface-tertiary-color);border:0;color:var(--text-color);font:italic calc(18px * var(--sq-ui-scale,1))/1.2 ForcedSquare,sans-serif!important}
.settings-menu-ui #sqRankedSettings .sq-setting-secret.is-verified .button{background:var(--button-color)!important;color:var(--text-color)!important}
.settings-menu-ui #sqRankedSettings .sq-setting-secret .sq-backup-validation{margin-top:8px!important;font-size:calc(16px * var(--sq-ui-scale,1))!important;color:var(--text-color)!important}
.settings-menu-ui #sqRankedSettings :is(select,input,summary):focus-visible{outline:2px solid var(--text-color);outline-offset:2px}
.settings-menu-ui #sqRankedSettings .sq-settings-advanced .sq-developer-export{grid-column:1/-1!important;margin:0!important;min-height:44px;font-size:calc(18px * var(--sq-ui-scale,1));white-space:normal;line-height:1.2}
@media(max-width:700px){
 .settings-menu-ui #sqRankedSettings .sq-settings-grid{grid-template-columns:minmax(0,1fr)!important}
 .settings-menu-ui #sqRankedSettings .sq-settings-grid>.sq-setting-row{min-height:56px!important}
}
/* Menu coordinates are logical pixels only while the native UI is scaled. */
html:not(.sq-game-expanded) body #ui:has(>.menu-ui>:is(.main-buttons-container,.track-selection-ui,.track-info-ui,.settings-menu-ui):not(.hidden)){
 --sq-menu-scale:var(--sq-menu-fit-scale,1);
 --ui-scale-factor:var(--sq-menu-scale);
 transform:scale(var(--sq-menu-scale))!important;transform-origin:top left!important;
 left:var(--sq-visible-left,0px)!important;top:var(--sq-visible-top,0px)!important;
 width:calc(var(--sq-available-width,100vw) / var(--sq-menu-scale))!important;
 height:calc(var(--sq-available-height,100vh) / var(--sq-menu-scale))!important;
}
@media(max-width:600px) and (orientation:portrait){
 html:not(.sq-game-expanded) body #ui:has(>.menu-ui>:is(.track-selection-ui,.track-info-ui):not(.hidden)){--sq-menu-scale:1}
 html body #ui>.menu-ui>:is(.track-selection-ui,.track-info-ui):not(.hidden){height:100%!important;width:100%!important}
}
@media(max-width:800px),(max-width:1100px) and (max-height:500px){
 html:not(.sq-game-expanded) body #ui:has(>.menu-ui>.settings-menu-ui:not(.hidden)){--sq-menu-scale:1}
 html body #ui>.menu-ui>.settings-menu-ui:not(.hidden){height:100%!important;width:100%!important}
}

/* Phone reflow uses physical pixels, so native scaled safe-area spacers no longer apply. */
@media (max-width: 600px) and (orientation: portrait) {
  html body #ui > .menu-ui > :is(.track-selection-ui,.track-info-ui):not(.hidden):not([hidden]) {
    padding: max(8px, env(safe-area-inset-top,0px)) max(8px, env(safe-area-inset-right,0px)) max(8px, env(safe-area-inset-bottom,0px)) max(8px, env(safe-area-inset-left,0px)) !important;
  }
}
/* Size the shell from the padded overlay, not a second independent viewport calculation. */
html body #overallLeaderboardPanel {
  --sq-overlay-gap: 8px;
  padding: max(var(--sq-overlay-gap), env(safe-area-inset-top,0px)) max(var(--sq-overlay-gap), env(safe-area-inset-right,0px)) max(var(--sq-overlay-gap), env(safe-area-inset-bottom,0px)) max(var(--sq-overlay-gap), env(safe-area-inset-left,0px)) !important;
}
html body #overallLeaderboardPanel .overall-shell {
  width: min(1540px, 100%) !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
}
@media (max-width: 700px) {
  html body #overallLeaderboardPanel { --sq-overlay-gap: 4px; }
}
/* Keep identity readable in the actual list column, including split-screen and safe areas. */
html body #overallLeaderboardList { container-type: inline-size; }
@container (max-width: 600px) {
  html body #overallLeaderboardPanel .overall-entry {
    grid-template-columns: clamp(42px, 12cqw, 62px) minmax(0,1fr) minmax(76px,.6fr) !important;
    grid-template-areas: 'rank name name' 'rank mid stats' !important;
    column-gap: clamp(4px, 1.5cqw, 9px) !important;
    row-gap: 3px !important;
  }
  html body #overallLeaderboardPanel .overall-entry .overall-name-label { flex: 1; min-width: 0; }
  html body #overallLeaderboardPanel .overall-entry .overall-name-main {
    display: block !important;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
  }
}
/* Track records share the available row width instead of imposing wide fixed columns. */
@container (min-width: 601px) {
  html body #overallLeaderboardPanel[data-category="topTracks"] .overall-track-entry {
    grid-template-columns: 64px minmax(0,1.3fr) minmax(0,1fr) minmax(100px,.55fr) !important;
  }
}
/* Top Tracks keeps both the track record and your saved result visible on compact layouts. */
html body #overallLeaderboardPanel[data-category="topTracks"] .overall-track-entry .overall-best-line:nth-child(2) {
  display: block !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

/* One continuous profile canvas, with header content flush to the right edge. */
html body #overallProfilePopup .overall-profile-card { background-attachment: local !important; background-repeat: no-repeat !important; }
html body #overallProfilePopup .profile-hero { padding-right: 0 !important; min-width: 0; }
html body #overallProfilePopup .profile-identity { min-width: 0; }
html body #overallProfilePopup .profile-podium-wide { grid-column: 1 / -1; width: 100%; margin: 0 !important; display: flex !important; align-items: center; flex-direction: row !important; flex-wrap: wrap; gap: 10px 18px; min-height: 64px; }
html body #overallProfilePopup .profile-podium-wide .profile-achievement-medals { display: flex; flex-wrap: wrap; gap: 10px; }
html body #overallProfilePopup .profile-podium-wide .profile-ranked-count { margin-left: auto; }
html body #overallProfilePopup .profile-podium-target { display: flex; flex: 1; gap: 8px 16px; align-items: center; flex-wrap: wrap; font-size: 17px; }
html body #overallProfilePopup .profile-podium-target b { color: var(--profile-accent, #7ee7ff); }
html body #overallProfilePopup .profile-track-head { display:grid !important; padding-left:10px !important; }
html body #overallProfilePopup .profile-track-head,
html body #overallProfilePopup .profile-track-row { grid-template-columns:84px minmax(0,1fr) 110px 132px 112px 82px !important; }
html body #overallProfilePopup .profile-track-head button { min-width:0; text-align:center; }
html body #overallProfilePopup .profile-track-row > .profile-track-percent { color:#b4e5ff; font-variant-numeric:tabular-nums; text-align:right; }
@media (max-width: 1000px) {
  html body #overallProfilePopup .profile-track-head { grid-template-columns:repeat(6,minmax(0,1fr)) !important; gap:2px; padding:4px !important; }
  html body #overallProfilePopup .profile-track-head button { padding-inline:2px; font-size:clamp(9px,2.6vw,13px) !important; }
  html body #overallProfilePopup .profile-track-row { grid-template-columns:72px minmax(0,1fr) minmax(0,1fr) !important; grid-template-areas:"image name name" "weight result time" "weight percent time" !important; }
  html body #overallProfilePopup .profile-track-row > .profile-track-visual { grid-area:image !important; }
  html body #overallProfilePopup .profile-track-row > .profile-track-name { grid-area:name !important; }
  html body #overallProfilePopup .profile-track-row > .profile-track-weight { grid-area:weight !important; }
  html body #overallProfilePopup .profile-track-row > .profile-track-result { grid-area:result !important; }
  html body #overallProfilePopup .profile-track-row > time { grid-area:time !important; display:block !important; }
  html body #overallProfilePopup .profile-track-row > .profile-track-percent { grid-area:percent; text-align:left; }
}
html body #overallLeaderboardPanel[data-category="topTracks"] #overallDailyGrid .overall-center-tools { justify-content: center; align-content: center; }
html body #overallLeaderboardPanel[data-category="topTracks"] #overallDailyGrid .overall-challenge-stack { align-content: center; }
@media (max-width: 700px) {
 html body #overallProfilePopup .profile-podium-wide { min-height: 58px; padding: 10px !important; gap: 8px; }
 html body #overallProfilePopup .profile-podium-wide .profile-ranked-count { margin-left: 0; }
 html body #overallProfilePopup .profile-podium-target { font-size: 15px; }
}
html body #overallProfilePopup .profile-podium-wide { box-sizing: border-box !important; min-width: 0; max-width: 100%; }
html body #overallProfilePopup button.profile-podium-target { border: 1px solid #607fad; background: #1b2c5c; color: inherit; padding: 6px 12px; text-align: left; cursor: pointer; }
html body #overallProfilePopup button.profile-podium-target .profile-track-image-frame { width: 42px; height: 42px !important; min-height: 42px !important; max-height: 42px !important; flex: 0 0 42px; }
html body #overallProfilePopup button.profile-podium-target:focus-visible { outline: 2px solid #7ee7ff; outline-offset: 2px; }
html body .leaderboard-ui button.main .right .verified-state { align-self: flex-end !important; margin-left: auto !important; max-width: 100%; width: max-content; }

/* Keep earned and next-podium cards beneath the car. */
html body #overallProfilePopup .profile-car-column { display:flex !important; flex-direction:column; gap:10px; min-width:0; max-height:none; overflow:visible; align-self:start; }
html body #overallProfilePopup .profile-car-column > .profile-podium-wide { display:grid !important; grid-template-columns:minmax(0,1fr); align-content:center; justify-items:center; aspect-ratio:1.4; min-height:150px; padding:12px !important; gap:10px; text-align:center; }
html body #overallProfilePopup .profile-podium-wide .profile-achievement-medals { width:100%; justify-content:center; }
html body #overallProfilePopup .profile-podium-wide .profile-ranked-count { margin:0; }
html body #overallProfilePopup button.profile-podium-target { width:100%; display:grid; grid-template-columns:42px minmax(0,1fr); gap:10px; box-sizing:border-box; }
@media(max-width:700px) { html body #overallProfilePopup .profile-car-column > .profile-podium-wide { aspect-ratio:auto; min-height:136px; } }

html body #overallProfilePopup .profile-car-column > .overall-car-model { width:100% !important; height:auto !important; aspect-ratio:1.6; }
html body #overallProfilePopup .profile-car-column .profile-podium-wide .profile-achievement-medals { display:flex !important; min-width:0; flex-wrap:wrap; }
html body #overallProfilePopup .profile-car-column button.profile-podium-target { width:100% !important; min-width:0; flex:1; white-space:normal; }
html body #overallProfilePopup button.profile-podium-target .profile-track-image-frame { width:42px !important; min-width:42px !important; max-width:42px !important; }

html body #overallProfilePopup #overallProfileContent .profile-car-column > .overall-car-model { width:100% !important; max-width:100% !important; min-width:0 !important; height:auto !important; aspect-ratio:1.6; }

/* Calm, equal-sized medal tiles and a single clear podium target. */
html body #overallProfilePopup .profile-podium-wide .profile-achievement-label { font-size:14px; letter-spacing:.06em; line-height:1.3; }
html body #overallProfilePopup .profile-car-column .profile-podium-wide[data-podium-kind="earned"] .profile-achievement-medals { display:grid !important; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px !important; }
html body #overallProfilePopup .profile-podium-wide .profile-medal-card { display:grid !important; grid-template-columns:minmax(0,1fr) !important; grid-template-rows:22px 28px 15px; place-items:center; gap:4px; min-width:0 !important; width:auto !important; margin:0 !important; padding:10px 3px !important; background:#14244c; border:1px solid #5476a16b; box-sizing:border-box; }
html body #overallProfilePopup .profile-podium-wide .profile-medal-card img { width:22px !important; height:22px !important; margin:0 !important; grid-row:1; }
html body #overallProfilePopup .profile-podium-wide .profile-medal-card b { font-size:25px !important; line-height:1; grid-row:2; }
html body #overallProfilePopup .profile-podium-wide .profile-medal-card small { font-size:12px !important; line-height:1; grid-row:3; }
html body #overallProfilePopup .profile-podium-wide .profile-ranked-count { width:100%; padding-top:7px; border-top:1px solid #638cb044; color:#bacde9; font-size:13px; line-height:1.3; }
html body #overallProfilePopup .profile-car-column button.profile-podium-target { border:0; background:transparent; min-height:76px; padding:8px 3px; gap:12px; }
html body #overallProfilePopup .profile-podium-copy { display:grid; gap:7px; min-width:0; }
html body #overallProfilePopup .profile-podium-copy strong { font-size:18px; line-height:1.2; overflow-wrap:anywhere; }
html body #overallProfilePopup .profile-podium-copy small { font-size:14px; color:#b9d5ed; line-height:1.3; }
html body #overallProfilePopup button.profile-podium-target:hover { background:#243869; }

/* Keep the standings visible in short landscape windows without shrinking touch targets. */
@media (min-width:641px) and (max-width:1100px) and (max-height:460px) and (orientation:landscape) {
  html body #overallLeaderboardPanel .overall-top {
    display:grid!important; grid-template-columns:auto minmax(0,1fr) auto!important;
    align-items:center!important; gap:8px!important;
  }
  html body #overallLeaderboardPanel .overall-top .overall-title-group { grid-area:1 / 1!important; min-width:0; }
  html body #overallLeaderboardPanel .overall-top .overall-title-group h2 { font-size:clamp(17px,2.4vw,24px)!important; }
  html body #overallLeaderboardPanel .overall-top #overallFilterPanel { grid-area:1 / 2!important; width:100%!important; max-width:none!important; flex-wrap:nowrap!important; }
  html body #overallLeaderboardPanel .overall-top #overallFilterPanel>.overall-racer-search { flex-basis:0!important; }
  html body #overallLeaderboardPanel .overall-top #overallFilterPanel :is(input,[data-personal-filter-button]) { min-height:44px!important; }
  html body #overallLeaderboardPanel .overall-top .overall-actions { grid-area:1 / 3!important; margin:0!important; }
}
