.history-pagination{display:flex;align-items:center;justify-content:space-between;margin:20px 0;gap:15px}.history-results small{display:block;color:var(--muted);font-size:11px}.history-results th,.history-results td{white-space:nowrap}.history-download.button{display:inline-flex;align-items:center;justify-content:center;gap:10px;flex:none;min-height:44px;padding:12px 18px;box-sizing:border-box;white-space:nowrap;font-size:14px}.history-download.button>span{font-size:19px;line-height:1}.history-chart td{color:#fff;font-weight:700;text-align:center}.history-chart th{text-align:center}.history-rider-laps{display:grid;gap:28px}.history-rider-laps h3{margin:0 0 14px}.history-rider-laps h3 small{font-size:12px;font-weight:400;color:var(--muted);display:block;margin-top:5px}.identity-history-scopes{display:flex;gap:8px;margin-bottom:18px}.identity-history-scopes button[aria-pressed=true]{border-color:#0092ff;background:#0092ff20;color:#fff}.server-history-page .track-layout-grid{align-items:start}@media(max-width:650px){.history-pagination{flex-wrap:wrap}.server-history-page .server-detail-heading{display:block}.history-download.button{display:flex;width:100%;margin-top:15px}}

.history-race-main{display:grid;grid-template-columns:minmax(250px,.32fr) minmax(0,.68fr);gap:22px;align-items:start}.history-race-main>.panel{min-width:0}.history-map .track-map svg{max-height:310px}.history-map .track-map-heading h1{font-size:20px}.history-map .track-map-callout{display:none}.history-map .track-map-legend{font-size:10px;gap:7px}.history-race-facts{display:flex;flex-wrap:wrap;gap:20px 40px;border:1px solid #333;background:#161616;padding:16px 20px;margin:20px 0}.history-race-facts span{display:flex;flex-direction:column;gap:5px}.history-race-facts small{font-size:10px;text-transform:uppercase;color:var(--muted)}.history-race-facts strong,.history-race-facts a{font-size:13px}.history-results{font-size:12px}.history-results th,.history-results td{padding:12px 10px}.history-results td:nth-child(4){white-space:normal;min-width:160px}.history-results .history-finished{color:#65d4a0}.history-rider-detail{font-size:10px;white-space:nowrap;padding:5px 7px;min-height:28px}.history-lap-scroll{max-height:420px;scrollbar-width:thin}.history-lap-scroll th{position:sticky;top:0;background:#202020;z-index:1}.history-legend{display:flex;gap:8px 20px;flex-wrap:wrap;margin:20px 0;max-height:150px;overflow:auto}.history-legend label{display:flex;align-items:center;gap:7px;margin:0;font-size:12px;cursor:pointer}.history-legend input{width:15px;height:15px;margin:0;accent-color:#0092ff}.history-legend i{width:16px;height:3px;flex:none}.history-plot svg{display:block;width:100%;max-height:370px}.history-plot-grid line{stroke:#333;stroke-width:1}.history-plot-grid text{fill:#93a0ad;font-size:11px}.history-plot-axis{display:flex;justify-content:space-between;color:#93a0ad;font-size:11px;padding:0 20px 8px 58px}.history-chart th,.history-chart td{padding:10px 15px}.history-chart{font-size:12px}.history-results .rider-name{font-size:12px}
@media(max-width:1250px){.history-race-main{grid-template-columns:1fr}.history-map .track-map{max-width:520px;margin:auto}.history-map .track-map svg{max-height:260px}}
.history-track-route{fill:none;stroke:#fff;stroke-width:9;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.history-track-finish{stroke:#111;stroke-width:4;stroke-linecap:butt;vector-effect:non-scaling-stroke}
.history-race-date{white-space:nowrap;font-variant-numeric:tabular-nums}
.history-race-date small{display:block;margin-top:4px;font-size:10px;color:var(--muted)}

.history-race-main{align-items:stretch}.history-race-main>.panel{margin-bottom:20px;display:flex;flex-direction:column}.history-race-main>.panel>.panel-body{flex:1;display:flex;flex-direction:column}.history-results-content{display:flex;flex-direction:column;flex:1;min-width:0}.history-results-pagination{margin-top:auto;padding-top:18px;gap:12px;flex-wrap:wrap}.history-results-pagination .track-pagination-controls{margin-left:auto;flex-wrap:wrap;justify-content:flex-end}.history-results-pagination .track-page-numbers{flex-wrap:wrap}.history-results-content>.table-wrap{flex:1}.history-results-content .history-results{height:100%}

.history-race-main .history-lap-scroll{flex:1;min-height:0}.server-history-page>.panel .history-results-content>.table-wrap{flex:initial}.server-history-page>.panel .history-results{height:auto}

.history-laps-content{display:flex;flex-direction:column;flex:1;min-width:0}.history-race-main .history-lap-scroll{max-height:none;overflow-x:auto}.history-laps-content th,.history-laps-content td{padding:8px 10px}.history-results th,.history-results td,.history-laps-content th,.history-laps-content td{text-align:center;vertical-align:middle}.history-results td:nth-child(4){min-width:160px;text-align:center}.history-results .rider-name,.history-laps-content .rider-name{display:inline-block;text-align:center}.history-laps-pagination{margin-top:auto;padding-top:16px;gap:10px;flex-wrap:wrap}.history-laps-pagination .track-pagination-controls{margin-left:auto;justify-content:flex-end;flex-wrap:wrap}.history-laps-pagination .track-page-numbers{flex-wrap:wrap}.history-laps-content .history-lap-scroll{flex:1}.history-laps-content table{height:auto;width:100%}.history-laps-content tr{height:42px}

.history-chart-controls{display:flex;align-items:center;gap:20px;margin:20px 0 12px}.history-chart-controls>.form-help{margin:0;max-width:520px}.history-rider-picker{position:relative;flex:none}.history-rider-picker>summary{cursor:pointer;padding:12px 16px;border:1px solid #3a5267;background:#162432;color:#fff;list-style-position:inside}.history-rider-picker summary span{font-size:11px;color:#93cfff;margin-left:12px}.history-picker-body{position:absolute;left:0;top:100%;width:360px;max-width:calc(100vw - 64px);padding:16px;background:#181c22;border:1px solid #3a5267;box-shadow:0 12px 35px #0009;z-index:5}.history-picker-body>label{font-size:11px}.history-picker-body .history-legend{display:grid;grid-template-columns:1fr;max-height:260px;margin:14px 0 0;gap:0}.history-picker-body .history-legend label{padding:9px 0;border-bottom:1px solid #ffffff10}.history-picker-body .history-legend label[hidden]{display:none}.history-selected-legend{display:flex;flex-wrap:wrap;gap:8px 18px;margin-bottom:20px;font-size:12px;color:#d4deea}.history-selected-legend span{display:inline-flex;align-items:center;gap:7px}.history-selected-legend i{width:18px;height:4px;border-radius:2px}.history-chart-help{font-size:13px;color:#b5c1cd;margin-bottom:16px}.history-position-table summary{cursor:pointer;color:#93cfff;font-size:12px}.history-plot-grid text{font-size:13px;fill:#b8c4d0}.history-plot-grid line{stroke:#ffffff16}.history-plot-axis{font-size:12px;color:#b8c4d0}@media(max-width:650px){.history-chart-controls{display:block}.history-chart-controls>.form-help{margin-top:12px}.history-rider-picker{width:100%}}

.history-plot{position:relative}.history-line-hit{pointer-events:stroke;cursor:help}.history-plot [data-history-plot-rider]:hover>polyline:not(.history-line-hit){stroke-width:4}.history-rider-tooltip{position:absolute;z-index:4;padding:8px 12px;background:#111820;color:#fff;border:1px solid;border-radius:5px;box-shadow:0 5px 18px #0008;font-size:12px;font-weight:600;pointer-events:none;max-width:calc(100% - 16px)}.history-rider-tooltip[hidden]{display:none}

.history-race-main>.panel:not(.history-map){align-self:start}.history-laps-content .history-lap-scroll{flex:initial}.history-results th,.history-results td{padding:6px 10px}.history-results tr{height:42px}

.history-download-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));justify-content:flex-end;align-items:stretch;gap:10px;flex:none}.history-download-actions .history-download{display:inline-flex;align-items:center;justify-content:center;width:100%;min-height:46px;padding:12px 18px;margin:0;box-sizing:border-box;font-size:14px;line-height:20px;gap:10px}
.map-replay-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(270px,32%);gap:18px;align-items:start}.map-replay-board{border:1px solid #34485a;background:#121b24;max-height:540px;overflow:auto;scrollbar-width:thin;min-width:0}.map-replay-board h3{font-size:14px;margin:0;padding:14px 12px;border-bottom:2px solid #0092ff}.map-replay-board table{width:100%;table-layout:fixed;font-size:11px}.map-replay-board th{position:sticky;top:0;background:#202932;font-size:9px;letter-spacing:.04em}.map-replay-board :is(th,td){padding:10px 6px;vertical-align:middle}.map-replay-board th:first-child{width:34px}.map-replay-board th:nth-child(3){width:36px}.map-replay-board th:last-child{width:64px}.map-replay-board td:first-child{text-align:center;font-weight:800;border-left:3px solid var(--replay-color)}.map-replay-board td:nth-child(2){overflow-wrap:anywhere}.map-replay-board td strong{font-size:11px;display:block}.map-replay-board td small{display:block;color:#97acbe;font-size:10px;margin-top:3px}.map-replay-board td:last-child{font-variant-numeric:tabular-nums;white-space:nowrap}.map-replay-board .is-leader td:first-child{color:#39ff14}.map-replay-board .is-leader td{background:#39ff1409}
@media(max-width:800px){.map-replay-layout{grid-template-columns:1fr}.map-replay-board{max-height:340px}.map-replay-board td strong{font-size:12px}}
@media(max-width:650px){.history-download-actions{display:grid;grid-template-columns:1fr 1fr;justify-content:stretch;margin-top:16px}.history-download-actions .history-download{width:100%;margin:0;font-size:12px;padding:10px;white-space:normal;gap:6px}}

[data-history-plot-rider][hidden]{display:none}.history-rider-color{flex:none;display:inline-block;vertical-align:middle}

.history-analysis-tabs{display:flex;gap:6px;flex-wrap:wrap;border-bottom:1px solid #344352;margin:20px 0 12px;padding-bottom:12px}.history-analysis-tabs button{font-size:12px;padding:10px 15px}.history-analysis-tabs button[aria-selected=true]{background:#0092ff;border-color:#0092ff;color:#fff}.history-analysis-exports{margin-left:auto;display:flex;gap:8px;flex-wrap:wrap}.history-analysis-exports button{font-size:11px;white-space:nowrap}.history-analysis .history-chart-controls{flex-wrap:wrap}.history-analysis .history-selected-legend{font-size:11px;gap:8px 16px}.history-analysis-scroll{max-width:100%;overflow:auto;scrollbar-width:thin}.history-analysis-table{width:100%;font-size:12px;font-variant-numeric:tabular-nums}.history-analysis-table th,.history-analysis-table td{padding:12px 13px;text-align:center;white-space:nowrap;vertical-align:middle}.history-analysis-table th[scope=row]{text-align:left;font-weight:600;min-width:160px}.history-analysis-table td small{display:block;font-size:10px;color:#91a6ba;margin-top:4px}.history-analysis-matrix th[scope=row]{position:sticky;left:0;background:#171d22;z-index:1;max-width:210px;overflow:hidden;text-overflow:ellipsis}.history-analysis-matrix th[scope=row] b{display:block;color:#8ac8ff;font-size:11px;margin-bottom:4px}.history-analysis-matrix thead th:first-child{position:sticky;left:0;z-index:2;background:#202020}.history-analysis-matrix td{padding:5px;min-width:120px}.history-analysis-lap{display:block;width:100%;border:1px solid transparent;background:transparent;border-radius:3px;padding:10px 12px;color:inherit;min-height:58px;font-size:12px}.history-analysis-lap:hover,.history-analysis-lap:focus-visible{border-color:#0092ff;background:#0092ff16}.history-analysis-lap small{display:block;font-weight:400;font-size:10px;color:#97a7b6;margin-top:5px}.history-analysis-lap.is-personal-best{background:#0092ff18;color:#70bfff;border-color:#0092ff44}.history-analysis-lap.is-race-best{background:#b397f822;color:#d1bfff;border-color:#b397f877}.history-analysis-lap.is-opening{color:#b4bec7}.history-analysis-missing{font-size:10px;color:#8494a3}.history-analysis-toolbar{display:flex;align-items:center;gap:20px;flex-wrap:wrap;margin-bottom:16px}.history-analysis-toolbar label{min-width:240px;font-size:12px}.history-analysis-toolbar .form-help{margin:0;max-width:460px}.history-analysis-gain{color:#65d4a0;font-weight:800}.history-analysis-loss{color:#f27990;font-weight:800}.history-analysis-plot-scroll{overflow-x:auto;scrollbar-width:thin}.history-analysis-plot{min-width:800px}.history-analysis-plot svg{max-height:none;width:100%;height:auto}.history-analysis-plot .history-plot-grid text{font-size:12px}.history-analysis-lap-facts{display:flex;gap:15px;align-items:center;flex-wrap:wrap;margin:16px 0}.history-analysis-lap-facts strong{font-size:24px;color:#70bfff}.history-analysis-lap-facts span{font-size:13px;color:#bac5cf}.history-analysis [data-history-plot-rider]:focus-within>polyline:not(.history-line-hit){stroke-width:4}.history-analysis button:focus-visible{outline:2px solid #8ac8ff;outline-offset:3px}
@media(max-width:650px){.history-analysis-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.history-analysis-tabs button{font-size:11px;padding:10px 8px}.history-analysis-tabs button:last-child{grid-column:1/-1}.history-analysis-exports{margin-left:0;margin-top:12px}.history-analysis-table th,.history-analysis-table td{padding:9px;font-size:11px}.history-analysis-matrix td{padding:4px}.history-analysis-matrix th[scope=row]{min-width:140px;max-width:160px}.history-analysis .history-chart-controls>.form-help{max-width:none}.history-analysis-toolbar label{min-width:0;width:100%}}
@media print{body:has(.history-analysis) :is(header,footer,.race-schedule-strip,.messages-fab,.history-chart-controls,.history-analysis-tabs,.server-section-links,.history-download-actions){display:none!important}body:has(.history-analysis),body:has(.history-analysis) main{background:#fff!important;color:#111!important}.history-analysis .panel,.history-analysis .panel-body{background:#fff!important;color:#111!important;border-color:#aaa!important}.history-analysis-scroll{overflow:visible}.history-analysis-table{font-size:8px}.history-analysis-table td,.history-analysis-table th{padding:5px;color:#111!important}.history-analysis-matrix th[scope=row]{position:static;background:#eee}.history-analysis-plot-scroll{overflow:visible}.history-analysis-plot{min-width:0}.history-analysis .history-selected-legend{color:#222}.history-analysis button{color:#111!important;background:#fff!important}.history-analysis .form-help,.history-analysis .history-chart-help{color:#444!important}}

/* Unvalidated recorded crossing times retain the standard lap-cell layout. */
.history-analysis-lap.is-unvalidated,.history-analysis-lap.is-unvalidated b,.history-analysis-lap.is-unvalidated small{color:#ff626b}.history-analysis-lap.is-unvalidated{border-color:#80383e;background:#281b1d}.history-analysis-lap.is-unvalidated:hover{border-color:#ff626b}.history-analysis-lap-facts strong.history-analysis-loss{color:#ff626b}
