/* Only the statistics landing page uses this compact phone layout. */
.mobile-driver-shortcut{display:none}
@media(max-width:700px){
  .statistics-page>.hero{padding:14px 16px 16px}
  .statistics-page .hero-copy{padding:0 0 8px}
  .statistics-page .hero-copy .eyebrow{margin-bottom:6px;font-size:.65rem}
  .statistics-page .hero h1{font-size:1.55rem;line-height:1.15}
  .statistics-page .hero-copy>p:last-child{font-size:.875rem;line-height:1.4;margin-top:7px}
  .statistics-page .mobile-driver-shortcut{position:relative;z-index:1;display:flex;align-items:center;justify-content:center;min-height:48px;margin:3px 0 8px;padding:10px 14px;border-radius:7px;background:#fff;color:#067b14;font-weight:850;text-decoration:none}
  .statistics-page .updated{display:block;border:0;background:none;border-radius:0;padding:0;font-size:.75rem;line-height:1.4}
  .statistics-page .update-schedule{display:block;margin:3px 0 0;font-size:.7rem;line-height:1.4}
  .statistics-page .hero>.archive-link{display:inline-flex;align-items:center;justify-content:center;min-height:44px;margin:8px 6px 0 0;padding:8px 12px;box-shadow:none}
  .statistics-page>main>.overview{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:12px 0;transform:none}
  .statistics-page>main>.overview article{min-height:64px;padding:10px 12px;box-shadow:none;border-top-width:3px}
  .statistics-page>main>.overview strong{font-size:1.35rem}
  .statistics-page>main>.overview span{margin-top:4px;font-size:.65rem}
  .statistics-page .filters{padding:16px}
  .statistics-page .filters .section-heading{gap:10px;margin-bottom:14px}
  .statistics-page .filters .section-heading .eyebrow{display:none}
  .statistics-page .filters h2{font-size:1.35rem}
  .statistics-page .filter-grid>label{order:1}
  .statistics-page .filter-grid>.statistics-driver-search{order:0;grid-column:1/-1}
  .statistics-page #driverSearch{scroll-margin-top:20px;min-height:48px;font-size:16px}
  .statistics-page #driverSearch:target{outline:3px solid #08a31a;outline-offset:3px}

  /* Race results and profile drill-downs become readable cards on phones. */
  .statistics-page .driver-dialog,
  .statistics-page .dialog-shell,
  .statistics-page .profile-metric-evidence{max-width:100%;overflow-x:hidden}
  .statistics-page .profile-history,
  .statistics-page .driver-races-table,
  .statistics-page .profile-metric-evidence>.table-wrap{max-height:none;overflow:visible;border:0;background:transparent}
  .statistics-page :is(.leaderboard-event-results,.profile-events-table,.profile-runs-table,.metric-rating-table,.metric-events-table,.metric-runs-table){display:block;width:100%;min-width:0!important;table-layout:auto}
  .statistics-page :is(.leaderboard-event-results,.profile-events-table,.profile-runs-table,.metric-rating-table,.metric-events-table,.metric-runs-table)>thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}
  .statistics-page :is(.leaderboard-event-results,.profile-events-table,.profile-runs-table,.metric-rating-table,.metric-events-table,.metric-runs-table)>tbody{display:grid;gap:10px;width:100%}
  .statistics-page :is(.leaderboard-event-results,.profile-events-table,.profile-runs-table,.metric-rating-table,.metric-events-table,.metric-runs-table)>tbody>tr:not(.driver-races-detail-row):not(.driver-run-detail-row){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 14px;width:100%;padding:12px;border:1px solid #c9d8cd;border-top:3px solid #08a31a;border-radius:10px;background:#fff;box-shadow:0 5px 15px rgba(2,40,11,.07)}
  .statistics-page :is(.leaderboard-event-results,.profile-events-table,.profile-runs-table,.metric-rating-table,.metric-events-table,.metric-runs-table)>tbody>tr:not(.driver-races-detail-row):not(.driver-run-detail-row)>td{display:flex;min-width:0;min-height:34px;padding:0;border:0;align-items:flex-start;justify-content:space-between;gap:8px;text-align:right;white-space:normal;overflow-wrap:anywhere}
  .statistics-page :is(.leaderboard-event-results,.profile-events-table,.profile-runs-table,.metric-rating-table,.metric-events-table,.metric-runs-table)>tbody>tr:not(.driver-races-detail-row):not(.driver-run-detail-row)>td::before{content:var(--cell-label);flex:0 0 auto;color:#66736b;font-size:.62rem;font-weight:900;letter-spacing:.04em;text-align:left;text-transform:uppercase}
  .statistics-page :is(.profile-events-table,.profile-runs-table,.metric-rating-table,.metric-events-table,.metric-runs-table)>tbody>tr>td:nth-child(1){--cell-label:'Date'}
  .statistics-page .profile-events-table>tbody>tr>td:nth-child(2),
  .statistics-page .metric-rating-table>tbody>tr>td:nth-child(2),
  .statistics-page .metric-events-table>tbody>tr>td:nth-child(2){--cell-label:'Event'}
  .statistics-page .profile-events-table>tbody>tr>td:nth-child(3),
  .statistics-page .metric-events-table>tbody>tr>td:nth-child(3){--cell-label:'Races'}
  .statistics-page .profile-events-table>tbody>tr>td:nth-child(4),
  .statistics-page .metric-events-table>tbody>tr>td:nth-child(4){--cell-label:'Class'}
  .statistics-page .profile-events-table>tbody>tr>td:nth-child(5),
  .statistics-page .metric-events-table>tbody>tr>td:nth-child(5){--cell-label:'Overall'}
  .statistics-page .profile-events-table>tbody>tr>td:nth-child(6){--cell-label:'Final'}
  .statistics-page .profile-events-table>tbody>tr>td:nth-child(7),
  .statistics-page .metric-events-table>tbody>tr>td:nth-child(6){--cell-label:'Qual'}
  .statistics-page .profile-events-table>tbody>tr>td:nth-child(8){--cell-label:'Result'}
  .statistics-page .profile-events-table>tbody>tr>td:nth-child(9){--cell-label:'Best lap'}
  .statistics-page .profile-events-table>tbody>tr>td:nth-child(10){--cell-label:'Consistency'}
  .statistics-page .profile-events-table>tbody>tr>td:nth-child(11){--cell-label:'Pace'}
  .statistics-page .profile-events-table>tbody>tr>td:nth-child(12){--cell-label:'cRating'}
  .statistics-page .metric-events-table>tbody>tr>td:nth-child(7){--cell-label:'Final'}
  .statistics-page .metric-rating-table>tbody>tr>td:nth-child(3){--cell-label:'Rated sessions'}
  .statistics-page .metric-rating-table>tbody>tr>td:nth-child(4){--cell-label:'Start'}
  .statistics-page .metric-rating-table>tbody>tr>td:nth-child(5){--cell-label:'Change'}
  .statistics-page .metric-rating-table>tbody>tr>td:nth-child(6){--cell-label:'End'}
  .statistics-page .profile-runs-table>tbody>tr>td:nth-child(1){--cell-label:'Round'}
  .statistics-page :is(.profile-runs-table,.metric-runs-table)>tbody>tr>td:nth-child(2){--cell-label:'Race'}
  .statistics-page :is(.profile-runs-table,.metric-runs-table)>tbody>tr>td:nth-child(3){--cell-label:'Position'}
  .statistics-page :is(.profile-runs-table,.metric-runs-table)>tbody>tr>td:nth-child(4){--cell-label:'Laps / time'}
  .statistics-page .profile-runs-table>tbody>tr>td:nth-child(5){--cell-label:'Fastest'}
  .statistics-page .metric-runs-table>tbody>tr>td:nth-child(5){--cell-label:'Best'}
  .statistics-page :is(.profile-runs-table,.metric-runs-table)>tbody>tr>td:nth-child(6){--cell-label:'Average'}
  .statistics-page :is(.profile-runs-table,.metric-runs-table)>tbody>tr>td:nth-child(7){--cell-label:'Consistency'}
  .statistics-page :is(.profile-runs-table,.metric-runs-table)>tbody>tr>td:nth-child(8){--cell-label:'Pace'}
  .statistics-page .profile-runs-table>tbody>tr>td:nth-child(9){--cell-label:'Video'}
  .statistics-page .metric-runs-table>tbody>tr>td:nth-child(9){--cell-label:'Gain'}
  .statistics-page .leaderboard-event-results>tbody>tr>td:nth-child(2){--cell-label:'Event'}
  .statistics-page .leaderboard-event-results>tbody>tr>td:nth-child(3){--cell-label:'Races'}
  .statistics-page .leaderboard-event-results>tbody>tr>td:nth-child(4){--cell-label:'Class'}
  .statistics-page .leaderboard-event-results>tbody>tr>td:nth-child(5){--cell-label:'Overall'}
  .statistics-page .leaderboard-event-results>tbody>tr>td:nth-child(6){--cell-label:'Qualifying'}
  .statistics-page .leaderboard-event-results>tbody>tr>td:nth-child(7){--cell-label:'Final'}
  .statistics-page :is(.leaderboard-event-results,.profile-events-table,.metric-events-table)>tbody>tr:not(.driver-races-detail-row)>td:nth-child(2),
  .statistics-page :is(.profile-events-table,.metric-events-table)>tbody>tr:not(.driver-races-detail-row)>td:nth-child(3),
  .statistics-page :is(.profile-runs-table,.metric-runs-table)>tbody>tr:not(.driver-run-detail-row)>td:nth-child(2){grid-column:1/-1}
  .statistics-page .driver-races-toggle{min-width:96px;min-height:44px}
  .statistics-page :is(.driver-races-detail-row,.driver-run-detail-row){display:block;width:100%;padding:0;background:transparent}
  .statistics-page :is(.driver-races-detail-row,.driver-run-detail-row)[hidden]{display:none!important}
  .statistics-page :is(.driver-races-detail-row,.driver-run-detail-row)>td{display:block!important;width:100%;padding:0!important;border:0!important;background:transparent!important}
  .statistics-page :is(.driver-races-detail-row,.driver-run-detail-row)>td::before{content:none!important}
  .statistics-page .driver-run-detail{position:sticky;left:0;box-sizing:border-box;width:calc(100vw - 40px);max-width:calc(100vw - 40px);margin:0;padding:10px 0 4px;overflow:hidden}
  .statistics-page .driver-run-detail .run-detail-summary{grid-template-columns:repeat(5,minmax(0,1fr));gap:3px;margin-bottom:8px}
  .statistics-page .driver-run-detail .run-detail-summary>span{grid-column:auto;min-width:0;min-height:38px;padding:4px 2px;border-top-width:2px}
  .statistics-page .driver-run-detail .run-detail-summary strong{font-size:.76rem;line-height:1;white-space:nowrap}
  .statistics-page .driver-run-detail .run-detail-summary small{margin-top:2px;font-size:0;line-height:1;white-space:nowrap}
  .statistics-page .driver-run-detail .run-detail-summary small[data-mobile-label]::after{content:attr(data-mobile-label);font-size:.43rem}
  .statistics-page .driver-run-detail .run-summary-fastest{order:-1}
  .statistics-page .run-detail-columns{grid-template-columns:minmax(0,1fr);width:100%;min-width:0;max-width:100%}
  .statistics-page .run-lap-list .table-wrap{max-height:none;overflow-x:hidden;overflow-y:visible}
  .statistics-page .run-laps-table{width:100%;min-width:0;table-layout:fixed}
  .statistics-page .run-laps-table{font-size:.72rem}
  .statistics-page .run-laps-table th,.statistics-page .run-laps-table td{padding:6px 3px;white-space:nowrap}
  .statistics-page .run-laps-table th:nth-child(1),.statistics-page .run-laps-table td:nth-child(1){width:24%;text-align:center}
  .statistics-page .run-laps-table th:nth-child(2),.statistics-page .run-laps-table td:nth-child(2){width:46%;text-align:center}
  .statistics-page .run-laps-table th:nth-child(3),.statistics-page .run-laps-table td:nth-child(3){width:30%;text-align:center}
  .statistics-page .run-detail-chart{position:relative;top:auto;box-sizing:border-box;width:100%;min-width:0;max-width:100%;padding:10px;overflow:hidden}
  .statistics-page .run-detail-chart h4,.statistics-page .run-lap-chart-help,.statistics-page .run-detail-links,.statistics-page .run-detail-links a,.statistics-page .run-detail-links p{max-width:100%;white-space:normal;overflow-wrap:anywhere}
  .statistics-page .run-lap-chart-legend{gap:6px 10px;font-size:.66rem}
  .statistics-page .run-detail-links{box-sizing:border-box;width:100%;padding:10px}
  .statistics-page .run-lap-chart-scroll{overflow:hidden}
  .statistics-page .run-lap-chart-scroll svg{width:100%;min-width:0;height:auto}
  .statistics-page .race-results-wrap{max-height:none;overflow-x:auto;overflow-y:visible}
  .statistics-page .race-result-driver-row{cursor:pointer}
  .statistics-page .race-result-driver-row[aria-expanded="true"]>td{background:#edf8ef}
  .statistics-page .race-result-driver-detail:not([hidden]){display:table-row!important}
  .statistics-page .race-result-driver-detail>td{display:table-cell!important;width:auto;padding:0!important}
  .statistics-page .race-result-driver-detail .driver-run-detail{position:sticky;left:0;width:calc(100vw - 40px);min-width:0;padding:10px 0 14px}
  .statistics-page .race-result-driver-detail .run-detail-summary{grid-template-columns:repeat(5,minmax(0,1fr));gap:3px;margin-bottom:8px}
  .statistics-page .race-result-driver-detail .run-detail-summary>span{min-height:38px;padding:4px 2px;border-top-width:2px}
  .statistics-page .race-result-driver-detail .run-detail-summary strong{font-size:.76rem;line-height:1}
  .statistics-page .race-result-driver-detail .run-detail-summary small{margin-top:2px;font-size:0;line-height:1}
  .statistics-page .race-result-driver-detail .run-summary-fastest{order:-1}
  .statistics-page :is(.run-summary-average-10,.run-summary-average-15){display:none}
  .statistics-page #raceLapCharts{padding:12px;overflow:hidden}
  .statistics-page #raceLapCharts .lap-position-summary{margin-bottom:18px;padding-bottom:18px}
  .statistics-page #raceLapCharts .lap-chart-row{grid-template-columns:1fr;gap:6px;padding:16px 0}
  .statistics-page #raceLapCharts .lap-chart-expand{overflow-x:hidden}
  .statistics-page #raceLapCharts .lap-chart-scroll svg{width:100%;min-width:0;height:auto}
}

/* 2026-10-24: Keep expanded results and lap drill-downs inside phone viewport. */
@media (max-width:700px){
  .statistics-page, .statistics-page main, .statistics-page main > *,
  .statistics-page .driver-dialog, .statistics-page .dialog-shell,
  .statistics-page .profile-history, .statistics-page .profile-metric-evidence,
  .statistics-page .driver-races-table, .statistics-page .table-wrap{
    box-sizing:border-box;min-width:0;max-width:100%;
  }
  .statistics-page :is(.leaderboard-event-results,.profile-events-table,.profile-runs-table,.metric-rating-table,.metric-events-table,.metric-runs-table){
    box-sizing:border-box;width:100%!important;min-width:0!important;max-width:100%!important;
  }
  .statistics-page :is(.leaderboard-event-results,.profile-events-table,.profile-runs-table,.metric-rating-table,.metric-events-table,.metric-runs-table)>tbody{
    box-sizing:border-box;min-width:0;max-width:100%;
  }
  .statistics-page :is(.leaderboard-event-results,.profile-events-table,.profile-runs-table,.metric-rating-table,.metric-events-table,.metric-runs-table)>tbody>tr:not(.driver-races-detail-row):not(.driver-run-detail-row){
    box-sizing:border-box;grid-template-columns:minmax(0,1fr)!important;min-width:0;max-width:100%;
  }
  .statistics-page :is(.leaderboard-event-results,.profile-events-table,.profile-runs-table,.metric-rating-table,.metric-events-table,.metric-runs-table)>tbody>tr:not(.driver-races-detail-row):not(.driver-run-detail-row)>td{
    box-sizing:border-box;grid-column:1/-1;min-width:0;width:100%;max-width:100%;align-items:center;
    overflow-wrap:anywhere;word-break:normal;
  }
  .statistics-page :is(.leaderboard-event-results,.profile-events-table,.profile-runs-table,.metric-rating-table,.metric-events-table,.metric-runs-table)>tbody>tr:not(.driver-races-detail-row):not(.driver-run-detail-row)>td > *{
    min-width:0;max-width:100%;overflow-wrap:anywhere;
  }
  .statistics-page .driver-run-detail,.statistics-page .race-result-driver-detail .driver-run-detail{
    position:relative;left:auto;box-sizing:border-box;width:100%;max-width:100%;min-width:0;
  }
  .statistics-page .driver-run-detail .run-detail-summary,
  .statistics-page .race-result-driver-detail .run-detail-summary{
    grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;
  }
  .statistics-page .driver-run-detail .run-detail-summary>span,
  .statistics-page .race-result-driver-detail .run-detail-summary>span{
    box-sizing:border-box;min-width:0;padding:10px 8px;min-height:66px;
  }
  .statistics-page .driver-run-detail .run-detail-summary strong,
  .statistics-page .race-result-driver-detail .run-detail-summary strong{font-size:1.05rem;white-space:normal}
  .statistics-page .driver-run-detail .run-detail-summary small,
  .statistics-page .race-result-driver-detail .run-detail-summary small{font-size:.65rem;line-height:1.3;white-space:normal}
  .statistics-page .driver-run-detail .run-detail-summary small[data-mobile-label]::after{content:none}
  .statistics-page .run-detail-columns,.statistics-page .run-lap-list,.statistics-page .run-detail-chart{
    box-sizing:border-box;min-width:0;max-width:100%;
  }
  .statistics-page .run-lap-chart-scroll,.statistics-page #raceLapCharts .lap-chart-scroll{max-width:100%;overflow-x:auto}
}

/* Prevent wide desktop result widgets from setting the width of the mobile dialog. */
@media(max-width:700px){
  .statistics-page .driver-dialog{max-width:100vw!important;overflow-x:hidden}
  .statistics-page .driver-dialog .dialog-shell{box-sizing:border-box;width:100%;max-width:100%;min-width:0;overflow-x:clip}
  .statistics-page .driver-dialog .dialog-shell > *,
  .statistics-page .driver-dialog .profile-section,
  .statistics-page .driver-dialog .profile-metric-evidence,
  .statistics-page .driver-dialog .profile-metric-cards,
  .statistics-page .driver-dialog .profile-history,
  .statistics-page .driver-dialog .table-wrap{
    box-sizing:border-box;min-width:0;max-width:100%;
  }
  .statistics-page .driver-dialog .profile-history{overflow-x:clip!important}
  .statistics-page .driver-dialog .profile-events-table,
  .statistics-page .driver-dialog .profile-events-table tbody,
  .statistics-page .driver-dialog .profile-events-table tr{
    box-sizing:border-box;min-width:0!important;max-width:100%!important;
  }
  .statistics-page .driver-dialog .profile-events-table td{
    box-sizing:border-box;min-width:0!important;max-width:100%!important;
    white-space:normal!important;overflow-wrap:anywhere!important;
  }
  .statistics-page .driver-dialog .profile-events-table td::before{flex-shrink:0}
  .statistics-page .driver-dialog .profile-events-table td > :is(a,button,span,strong){
    min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere;
  }
}

/* Leaderboard source drill-down is nested in a wide desktop leaderboard table.
   Constrain the nested panel itself, not just its result cards. */
@media(max-width:700px){
  .statistics-page .leaderboard-source-row>td{padding:0!important}
  .statistics-page .leaderboard-source-panel{
    position:sticky;left:0;box-sizing:border-box;
    width:calc(100vw - 32px)!important;max-width:calc(100vw - 32px)!important;
    min-width:0!important;padding:12px!important;overflow:visible;
    border:3px solid #078719;border-radius:12px;background:#f4faf5;
    box-shadow:0 12px 32px rgba(0,55,15,.2);
    scroll-margin-top:10px;
  }
  .statistics-page .leaderboard-evidence-banner{
    position:relative;display:grid;grid-template-columns:minmax(0,1fr);gap:2px;
    margin:-4px -4px 14px;padding:12px 14px 16px;border-radius:8px;
  }
  .statistics-page .leaderboard-evidence-banner::after{
    position:absolute;right:16px;bottom:-11px;content:'↓';display:grid;place-items:center;
    width:30px;height:30px;color:#06270d;background:#9cf63e;border:3px solid #fff;border-radius:50%;
    font-size:1rem;font-weight:950;box-shadow:0 4px 10px rgba(0,0,0,.18);
  }
  .statistics-page .leaderboard-evidence-banner span{font-size:.62rem}
  .statistics-page .leaderboard-evidence-banner strong{font-size:1.05rem}
  .statistics-page .leaderboard-evidence-banner small{margin:3px 0 0;color:#d8f1dc;font-size:.72rem}
  .statistics-page .leaderboard-evidence-note{font-size:.76rem}
  .statistics-page .selected-evidence-score{
    box-sizing:border-box;width:100%;max-width:100%;grid-template-columns:minmax(0,auto) minmax(0,1fr);
  }
  .statistics-page .selected-evidence-score strong{font-size:1.3rem;overflow-wrap:anywhere}
  .statistics-page .leaderboard-source-heading{
    display:flex;flex-direction:column;align-items:stretch;min-width:0;max-width:100%;gap:10px;
  }
  .statistics-page .leaderboard-source-heading>div{min-width:0;max-width:100%;overflow-wrap:anywhere}
  .statistics-page .leaderboard-source-heading .profile-open{
    box-sizing:border-box;width:100%;max-width:100%;white-space:normal;min-height:44px;
  }
  .statistics-page .leaderboard-source-collapse{
    position:static;box-sizing:border-box;max-width:100%;width:100%;margin:0 0 10px;
    white-space:normal;overflow-wrap:anywhere;
  }
  .statistics-page .leaderboard-source-panel .source-scorecards{
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr));min-width:0;max-width:100%;
  }
  .statistics-page .leaderboard-source-panel .source-scorecards>span{
    box-sizing:border-box;min-width:0;max-width:100%;padding:10px;overflow-wrap:anywhere;
  }
  .statistics-page .leaderboard-source-panel details{
    box-sizing:border-box;width:100%;min-width:0;max-width:100%;
  }
  .statistics-page .leaderboard-source-panel details .table-wrap{
    box-sizing:border-box;width:calc(100% - 16px);min-width:0;max-width:calc(100% - 16px);
    margin:0 8px 8px!important;overflow-x:hidden!important;
  }
  .statistics-page .leaderboard-source-panel .leaderboard-event-results,
  .statistics-page .leaderboard-source-panel .leaderboard-event-results tbody,
  .statistics-page .leaderboard-source-panel .leaderboard-event-results tbody>tr{
    box-sizing:border-box;width:100%!important;min-width:0!important;max-width:100%!important;
  }
  .statistics-page .leaderboard-source-panel .leaderboard-event-results tbody>tr>td{
    box-sizing:border-box;min-width:0!important;max-width:100%!important;
    white-space:normal!important;overflow-wrap:anywhere!important;
  }
}

/* Mobile race explorer: retain the complete desktop table in its own scroll area,
   but render an expanded driver's lap breakdown at viewport width. */
@media(max-width:700px){
  .statistics-page #raceExplorer,.statistics-page #raceExplorer .race-results-wrap{
    box-sizing:border-box;min-width:0;max-width:100%;
  }
  .statistics-page #raceExplorer .race-results-wrap{
    position:relative;overflow-x:auto!important;overflow-y:auto;
    -webkit-overflow-scrolling:touch;
  }
  .statistics-page #raceExplorer .race-results-wrap > table{
    width:max-content;min-width:100%;max-width:none;table-layout:auto;
  }
  .statistics-page #raceExplorer .race-result-driver-detail:not([hidden]){
    display:table-row!important;
  }
  .statistics-page #raceExplorer .race-result-driver-detail>td{
    position:relative;box-sizing:border-box;padding:0!important;
  }
  .statistics-page #raceExplorer .race-result-driver-detail .driver-run-detail{
    position:sticky!important;left:0!important;
    box-sizing:border-box!important;width:calc(100vw - 48px)!important;
    min-width:0!important;max-width:calc(100vw - 48px)!important;
    margin:0!important;padding:10px 6px 14px!important;
    overflow:visible!important;
  }
  .statistics-page #raceExplorer .race-result-driver-detail .run-detail-summary{
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;width:100%!important;min-width:0!important;
  }
  .statistics-page #raceExplorer .race-result-driver-detail .run-detail-summary>span{
    display:block;box-sizing:border-box;min-width:0!important;
    width:auto!important;max-width:100%!important;min-height:70px;
    padding:10px 8px!important;text-align:left;
  }
  .statistics-page #raceExplorer .race-result-driver-detail .run-detail-summary strong{
    display:block;font-size:1.05rem!important;white-space:normal!important;overflow-wrap:anywhere;
  }
  .statistics-page #raceExplorer .race-result-driver-detail .run-detail-summary small{
    display:block;font-size:.66rem!important;line-height:1.3!important;
    white-space:normal!important;overflow-wrap:anywhere;
  }
  .statistics-page #raceExplorer .race-result-driver-detail .run-detail-summary small[data-mobile-label]::after{content:none!important}
  .statistics-page #raceExplorer .race-result-driver-detail .run-detail-columns{
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;
    width:100%!important;min-width:0!important;max-width:100%!important;
  }
  .statistics-page #raceExplorer .race-result-driver-detail :is(.run-lap-list,.run-detail-chart,.run-detail-links){
    box-sizing:border-box;width:100%!important;min-width:0!important;max-width:100%!important;
  }
  .statistics-page #raceExplorer .race-result-driver-detail .run-lap-list .table-wrap{
    box-sizing:border-box;width:100%!important;min-width:0!important;max-width:100%!important;
    overflow-x:hidden!important;
  }
  .statistics-page #raceExplorer .race-result-driver-detail .run-laps-table{
    box-sizing:border-box;width:100%!important;min-width:0!important;max-width:100%!important;
    table-layout:fixed!important;font-size:.73rem;
  }
  .statistics-page #raceExplorer .race-result-driver-detail .run-laps-table :is(th,td){
    box-sizing:border-box;padding:7px 3px!important;white-space:nowrap;
  }
  .statistics-page #raceExplorer .race-result-driver-detail .run-lap-chart-scroll{
    width:100%;max-width:100%;overflow-x:auto;
  }
}

/* Race Explorer structural mobile cards: release expanded laps from the
   desktop table's intrinsic eleven-column width. */
@media(max-width:700px){
  .statistics-page #raceExplorer .race-results-wrap{
    display:block!important;box-sizing:border-box;width:100%!important;
    max-width:100%!important;min-width:0!important;
    overflow-x:hidden!important;overflow-y:visible!important;
  }
  .statistics-page #raceExplorer .race-results-wrap > table{
    display:block!important;box-sizing:border-box;width:100%!important;
    min-width:0!important;max-width:100%!important;table-layout:auto!important;
  }
  .statistics-page #raceExplorer .race-results-wrap > table > thead{
    position:absolute!important;width:1px;height:1px;overflow:hidden;
    clip-path:inset(50%);
  }
  .statistics-page #raceExplorer .race-results-wrap > table > tbody{
    display:grid!important;grid-template-columns:minmax(0,1fr);
    gap:8px;box-sizing:border-box;width:100%!important;min-width:0!important;
  }
  .statistics-page #raceExplorer .race-result-driver-row{
    display:grid!important;box-sizing:border-box;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    width:100%!important;min-width:0!important;max-width:100%!important;
    padding:10px;gap:6px 12px;border:1px solid #d1ded4;border-radius:9px;
    background:#fff;
  }
  .statistics-page #raceExplorer .race-result-driver-row > td{
    display:flex!important;box-sizing:border-box;align-items:center;
    justify-content:space-between;gap:8px;padding:5px 0!important;
    border:0!important;min-width:0!important;max-width:100%;
    text-align:right!important;white-space:normal!important;overflow-wrap:anywhere;
  }
  .statistics-page #raceExplorer .race-result-driver-row > td::before{
    flex:0 0 auto;text-align:left;font-size:.65rem;font-weight:800;
    letter-spacing:.025em;color:#53655a;text-transform:uppercase;
  }
  .statistics-page #raceExplorer .race-result-driver-row > td:nth-child(1)::before{content:'Pos'}
  .statistics-page #raceExplorer .race-result-driver-row > td:nth-child(2)::before{content:'Driver'}
  .statistics-page #raceExplorer .race-result-driver-row > td:nth-child(3)::before{content:'Avatar'}
  .statistics-page #raceExplorer .race-result-driver-row > td:nth-child(4)::before{content:'Qualifying'}
  .statistics-page #raceExplorer .race-result-driver-row > td:nth-child(5)::before{content:'Laps / time'}
  .statistics-page #raceExplorer .race-result-driver-row > td:nth-child(6)::before{content:'Behind'}
  .statistics-page #raceExplorer .race-result-driver-row > td:nth-child(7)::before{content:'Fastest'}
  .statistics-page #raceExplorer .race-result-driver-row > td:nth-child(8)::before{content:'Average'}
  .statistics-page #raceExplorer .race-result-driver-row > td:nth-child(9)::before{content:'Consistency'}
  .statistics-page #raceExplorer .race-result-driver-row > td:nth-child(10)::before{content:'Pace'}
  .statistics-page #raceExplorer .race-result-driver-row > td:nth-child(11)::before{content:'Potential'}
  .statistics-page #raceExplorer .race-result-driver-row > td:nth-child(2){
    grid-column:1/-1;justify-content:flex-start;
  }
  .statistics-page #raceExplorer .race-result-driver-row > td:nth-child(2)::before{margin-right:10px}
  .statistics-page #raceExplorer .race-result-driver-row > td:nth-child(2) .driver-name{
    min-width:0;white-space:normal;overflow-wrap:anywhere;text-align:left;
  }
  .statistics-page #raceExplorer .race-result-driver-detail:not([hidden]){
    display:block!important;box-sizing:border-box;width:100%!important;
    min-width:0!important;max-width:100%!important;
    margin:0 0 12px;padding:0!important;border:0!important;
  }
  .statistics-page #raceExplorer .race-result-driver-detail > td{
    display:block!important;box-sizing:border-box;
    width:100%!important;min-width:0!important;max-width:100%!important;
    padding:0!important;border:0!important;
  }
  .statistics-page #raceExplorer .race-result-driver-detail .driver-run-detail{
    position:static!important;left:auto!important;
    width:100%!important;min-width:0!important;max-width:100%!important;
    box-sizing:border-box;padding:8px!important;overflow:visible!important;
  }
  .statistics-page #raceExplorer .race-result-driver-detail .run-detail-summary{
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    width:100%!important;
  }
  .statistics-page #raceExplorer .race-result-driver-detail .run-detail-columns{
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;
    width:100%!important;
  }
}

/* Main race standings remain a horizontally scrollable, one-row-per-driver
   grid. The expanded lap panel stays phone-width regardless of table width. */
@media(max-width:700px){
  .statistics-page #raceExplorer{
    --race-mobile-columns:42px 190px 68px 92px 112px 80px 120px 95px 102px 75px 112px;
  }
  .statistics-page #raceExplorer .race-results-wrap{
    display:block!important;box-sizing:border-box;
    width:100%!important;min-width:0!important;max-width:100%!important;
    overflow-x:auto!important;overflow-y:visible!important;
    -webkit-overflow-scrolling:touch;
  }
  .statistics-page #raceExplorer .race-results-wrap > table{
    display:block!important;box-sizing:border-box;
    width:max-content!important;min-width:100%!important;max-width:none!important;
    table-layout:auto!important;
  }
  .statistics-page #raceExplorer .race-results-wrap > table > thead{
    position:static!important;display:block!important;width:auto!important;height:auto!important;
    overflow:visible!important;clip-path:none!important;
  }
  .statistics-page #raceExplorer .race-results-wrap > table > thead > tr,
  .statistics-page #raceExplorer .race-result-driver-row{
    display:grid!important;grid-template-columns:var(--race-mobile-columns)!important;
    box-sizing:border-box;width:max-content!important;min-width:100%!important;
    max-width:none!important;gap:0!important;
  }
  .statistics-page #raceExplorer .race-results-wrap > table > thead > tr > th,
  .statistics-page #raceExplorer .race-result-driver-row > td{
    display:flex!important;box-sizing:border-box;align-items:center;justify-content:center;
    min-width:0!important;max-width:none!important;width:auto!important;
    padding:10px 5px!important;border-radius:0!important;
    text-align:center!important;white-space:nowrap!important;overflow:visible!important;
  }
  .statistics-page #raceExplorer .race-result-driver-row{
    padding:0!important;border:0!important;border-bottom:1px solid #d1ded4!important;
    border-radius:0!important;background:#fff;
  }
  .statistics-page #raceExplorer .race-result-driver-row > td::before{
    content:none!important;display:none!important;
  }
  .statistics-page #raceExplorer .race-result-driver-row > td:nth-child(2){
    grid-column:auto!important;justify-content:flex-start!important;
  }
  .statistics-page #raceExplorer .race-result-driver-row > td:nth-child(2) .driver-name{
    white-space:normal!important;text-align:left!important;
  }
  .statistics-page #raceExplorer .race-results-wrap > table > tbody{
    display:block!important;box-sizing:border-box;
    width:max-content!important;min-width:100%!important;
  }
  .statistics-page #raceExplorer .race-result-driver-detail:not([hidden]){
    display:block!important;position:sticky!important;left:0!important;
    box-sizing:border-box;width:calc(100vw - 48px)!important;
    min-width:0!important;max-width:calc(100vw - 48px)!important;
    margin:0 0 10px!important;border:0!important;
  }
  .statistics-page #raceExplorer .race-result-driver-detail > td{
    display:block!important;box-sizing:border-box;width:100%!important;
    min-width:0!important;max-width:100%!important;
  }
  .statistics-page #raceExplorer .race-result-driver-detail .driver-run-detail{
    box-sizing:border-box;width:100%!important;min-width:0!important;max-width:100%!important;
    padding:8px!important;
  }
}

/* Shared mobile drill-down pattern for driver event/race history and metric evidence.
   Scroll the compact result rows horizontally; keep the expanded detail in view. */
@media(max-width:700px){
  .statistics-page .driver-dialog .profile-history,
  .statistics-page .driver-dialog .driver-races-table,
  .statistics-page .driver-dialog .profile-metric-evidence > .table-wrap{
    display:block;box-sizing:border-box;width:100%;max-width:100%;
    min-width:0;overflow-x:auto!important;overflow-y:visible!important;
    -webkit-overflow-scrolling:touch;
  }
  .statistics-page .driver-dialog :is(.profile-events-table,.profile-runs-table,.metric-events-table,.metric-runs-table){
    display:block!important;box-sizing:border-box;width:max-content!important;
    max-width:none!important;min-width:100%!important;table-layout:auto!important;
  }
  .statistics-page .driver-dialog :is(.profile-events-table,.profile-runs-table,.metric-events-table,.metric-runs-table)>thead{
    display:block!important;position:static!important;clip:initial!important;clip-path:none!important;
    height:auto!important;width:auto!important;overflow:visible!important;
  }
  .statistics-page .driver-dialog :is(.profile-events-table,.profile-runs-table,.metric-events-table,.metric-runs-table)>tbody{
    display:block!important;box-sizing:border-box;width:max-content!important;min-width:100%!important;
  }
  .statistics-page .driver-dialog .profile-events-table{--history-columns:104px 230px 95px 130px 90px 90px 88px 100px 105px 105px 90px 90px}
  .statistics-page .driver-dialog .profile-runs-table{--history-columns:95px 215px 75px 110px 95px 95px 100px 80px 90px}
  .statistics-page .driver-dialog .metric-events-table{--history-columns:104px 230px 95px 130px 90px 88px 105px}
  .statistics-page .driver-dialog .metric-runs-table{--history-columns:104px 215px 75px 110px 95px 95px 100px 80px 90px}
  .statistics-page .driver-dialog :is(.profile-events-table,.profile-runs-table,.metric-events-table,.metric-runs-table)>thead>tr,
  .statistics-page .driver-dialog :is(.profile-events-table,.profile-runs-table,.metric-events-table,.metric-runs-table)>tbody>tr:not(.driver-races-detail-row):not(.driver-run-detail-row){
    display:grid!important;box-sizing:border-box;grid-template-columns:var(--history-columns)!important;
    width:max-content!important;min-width:100%!important;max-width:none!important;
    gap:0!important;margin:0!important;padding:0!important;border-radius:0!important;
    border:0!important;border-bottom:1px solid #d5e1d8!important;box-shadow:none!important;
  }
  .statistics-page .driver-dialog :is(.profile-events-table,.profile-runs-table,.metric-events-table,.metric-runs-table)>thead>tr>th,
  .statistics-page .driver-dialog :is(.profile-events-table,.profile-runs-table,.metric-events-table,.metric-runs-table)>tbody>tr:not(.driver-races-detail-row):not(.driver-run-detail-row)>td{
    display:flex!important;grid-column:auto!important;box-sizing:border-box;
    align-items:center;justify-content:center;gap:4px;min-width:0!important;
    width:auto!important;max-width:none!important;min-height:44px;
    padding:8px 6px!important;white-space:normal!important;overflow-wrap:anywhere;
    font-size:.76rem;text-align:center!important;
  }
  .statistics-page .driver-dialog :is(.profile-events-table,.profile-runs-table,.metric-events-table,.metric-runs-table)>tbody>tr:not(.driver-races-detail-row):not(.driver-run-detail-row)>td::before{
    content:none!important;display:none!important;
  }
  .statistics-page .driver-dialog :is(.profile-events-table,.profile-runs-table,.metric-events-table,.metric-runs-table)>tbody>tr:not(.driver-races-detail-row):not(.driver-run-detail-row)>td:nth-child(2){
    justify-content:flex-start;text-align:left!important;
  }
  .statistics-page .driver-dialog :is(.profile-events-table,.profile-runs-table,.metric-events-table,.metric-runs-table)>tbody>tr:not(.driver-races-detail-row):not(.driver-run-detail-row)>td > *{
    min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere;
  }
  .statistics-page .driver-dialog :is(.profile-events-table,.profile-runs-table,.metric-events-table,.metric-runs-table)>tbody>tr:is(.driver-races-detail-row,.driver-run-detail-row):not([hidden]){
    display:block!important;position:sticky!important;left:0!important;
    box-sizing:border-box;width:calc(100vw - 52px)!important;
    max-width:calc(100vw - 52px)!important;min-width:0!important;
    margin:0 0 10px!important;padding:0!important;
  }
  .statistics-page .driver-dialog :is(.profile-events-table,.profile-runs-table,.metric-events-table,.metric-runs-table)>tbody>tr:is(.driver-races-detail-row,.driver-run-detail-row)>td{
    display:block!important;box-sizing:border-box;width:100%!important;
    min-width:0!important;max-width:100%!important;padding:0!important;
  }
  .statistics-page .driver-dialog :is(.profile-events-table,.profile-runs-table,.metric-events-table,.metric-runs-table)>tbody>tr:is(.driver-races-detail-row,.driver-run-detail-row)[hidden]{
    display:none!important;
  }
  .statistics-page .driver-dialog .driver-run-detail{
    position:static!important;left:auto!important;box-sizing:border-box;
    width:100%!important;min-width:0!important;max-width:100%!important;
  }
  .statistics-page .driver-dialog .driver-run-detail .run-detail-summary{
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    min-width:0!important;max-width:100%!important;gap:8px;
  }
  .statistics-page .driver-dialog .driver-run-detail .run-detail-summary > span{
    box-sizing:border-box;min-width:0!important;max-width:100%!important;
    padding:10px 8px!important;min-height:64px;
  }
  .statistics-page .driver-dialog .driver-run-detail .run-detail-summary small{
    display:block!important;font-size:.64rem!important;line-height:1.3!important;
  }
  .statistics-page .driver-dialog .driver-run-detail .run-detail-columns{
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;
    width:100%!important;min-width:0!important;
  }
  .statistics-page .driver-dialog .driver-run-detail :is(.run-lap-list,.run-detail-chart,.run-detail-links,.run-laps-table){
    box-sizing:border-box;width:100%!important;min-width:0!important;max-width:100%!important;
  }
}

/* Fit the expanded leaderboard source panel to the *visible* scroll container,
   not to the viewport or the full desktop-width table. */
@media(max-width:700px){
  .statistics-page .leaderboard-table-wrap{container-type:inline-size}
  .statistics-page .leaderboard-source-row>td{padding:0!important}
  .statistics-page .leaderboard-source-panel{
    position:sticky!important;left:0!important;
    box-sizing:border-box!important;
    width:calc(100cqw - 16px)!important;
    min-width:0!important;max-width:calc(100cqw - 16px)!important;
    margin:0 8px!important;padding:12px!important;
    overflow:visible!important;
  }
  .statistics-page .leaderboard-source-panel .source-scorecards{
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    width:100%!important;min-width:0!important;max-width:100%!important;
    gap:8px!important;
  }
  .statistics-page .leaderboard-source-panel .source-scorecards>span{
    box-sizing:border-box!important;min-width:0!important;
    width:100%!important;max-width:100%!important;
    padding:10px!important;font-size:clamp(.98rem,4.7vw,1.2rem)!important;
    overflow-wrap:anywhere;
  }
  .statistics-page .leaderboard-source-panel details,
  .statistics-page .leaderboard-source-panel details .table-wrap{
    box-sizing:border-box;min-width:0!important;max-width:100%!important;
  }
  .statistics-page .leaderboard-source-panel .leaderboard-event-results tbody>tr:not(.driver-races-detail-row)>td{
    min-width:0!important;max-width:100%!important;
    gap:8px!important;overflow-wrap:anywhere!important;
  }
  .statistics-page .leaderboard-source-panel .leaderboard-event-results tbody>tr:not(.driver-races-detail-row)>td> *{
    min-width:0;max-width:100%;overflow-wrap:anywhere;white-space:normal;
  }
}
