/* Race content only. Bootstrap 5.3.8 is supplied by the site layout. */
.race-results {
  --color-accent: #0b5ed7;
  --color-accent-ink: #fff;
  --color-error: #b42318;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --color-paper: #ffffff;
  --color-paper-2: #f8f9fa;
  --color-paper-3: #e9ecef;
  --color-ink: #212529;
  --color-muted: #596168;
  --color-link: #0b5ed7;
  --color-focus: #0056b3;
  --color-rule: #dce0e3;
  --color-strong-rule: #a8afb5;
  --color-five-rule: #bec5cb;
  --color-control-edge: #7a838b;
  --color-column: #f0f1f2;
  --color-lap-label: var(--color-paper-2);
  --color-active: #dce5ee;
  --color-hover: #e8edf1;
  --color-kart: #d7dde3;
  --color-kart-ink: #2f3c48;
  --color-kart-edge: #aeb8c2;
  --color-kart-hover: #c9d2db;
  --color-race: #df73ff;
  --color-stint: #0dcaf0;
  --color-event-ink: #172027;
  --color-avatar-paper: #ffffff;
  --color-pit: #212529;
  --color-pit-ink: #ffc107;
  --color-tag: #9440c8;
  --color-tag-ink: #ffffff;
  --color-award-winner: #ffc107;
  --color-award-best-lap: #0dcaf0;
  --color-award-mover: #0d6efd;
  --color-award-pits: #198754;
  --color-award-warmup: #fd7e14;
  --color-award-stability: #6f42c1;
  --color-selected: #0056b3;
  --color-selected-fill: #dcecff;
  --color-legend-edge: #7a838b;
  --color-scrollbar: #a8afb5;
  --bs-body-color: var(--color-ink);
  --bs-body-bg: var(--color-paper);
  --bs-border-color: var(--color-control-edge);
  --bs-secondary-color: var(--color-muted);
  --space-3xs: 2px;
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --container: 1480px;
  --gutter: 16px;
  --lap-label-width: 52px;
  --stats-label-width: 160px;
  --lap-driver-width: 100px;
  --lap-aux-driver-width: 124px;
  --stats-driver-width: 100px;
  --driver-max-width: 120px;
  max-width: var(--container);
  margin: 0;
  padding: var(--space-md);
  font: 400 14px/1.45 var(--font-body);
  color: var(--color-ink);
  background: var(--color-paper);
}
[data-bs-theme="dark"] .race-results {
  color-scheme: dark;
  --color-paper: #191c1f;
  --color-paper-2: #23272b;
  --color-paper-3: #32383e;
  --color-pit: #665c4a;
  --color-ink: #f1f3f5;
  --color-muted: #b0bac2;
  --color-rule: #3a4249;
  --color-strong-rule: #697782;
  --color-five-rule: #56636e;
  --color-control-edge: #8796a2;
  --color-column: #22272b;
  --color-lap-label: var(--color-paper-3);
  --color-stint: #0a8a9e;
  --color-hover: #323b44;
  --color-active: #344c66;
  --color-link: #84b9ff;
  --color-accent: #84b9ff;
  --color-accent-ink: #172027;
  --color-focus: #84b9ff;
  --color-selected: #84b9ff;
  --color-selected-fill: #2d4661;
  --color-legend-edge: #8796a2;
  --color-scrollbar: #697782;
  --color-kart: #2c3339;
  --color-kart-ink: #d3dce3;
  --color-kart-edge: #4a5660;
  --color-kart-hover: #3a444d;
}
.race-results button {
  white-space: nowrap;
}
.race-results button,
.race-results .race-nav a,
.race-results .gap-options {
  border-radius: 8px;
}
.race-results a:where(:not(.btn)) {
  color: var(--color-link);
}
.race-results a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.race-results button[aria-busy="true"] {
  cursor: progress;
}
.race-results button:focus-visible,
.race-results a:focus-visible,
.race-results input:focus-visible,
.race-results select:focus-visible,
.race-results [tabindex]:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}
.race-results button,
.race-results a,
.race-results input {
  touch-action: manipulation;
}
.race-results svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.race-results button svg {
  width: 20px;
  height: 20px;
  display: block;
}
.race-results .mono {
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
}
@media screen and (min-width: 701px) and (min-height: 501px), screen and (min-width: 1001px) {
  html:has(body.race-results-page) {
    scrollbar-gutter: stable;
  }
  body.race-results-page {
    /* Reserve room behind the fixed details panel, after the footer. */
    padding-bottom: var(--selection-height, 0px);
  }
  .race-results {
    padding-bottom: 0;
  }
  .race-compact .workspace,
  .race-compact .summary {
    max-width: 608px;
  }
  .race-results .table-scroll {
    max-width: calc(var(--lap-label-width) + var(--driver-count, 9) * var(--driver-max-width));
  }
  .race-results #panel-stats .stats-wrap {
    max-width: calc(var(--stats-label-width) + var(--driver-count, 9) * var(--driver-max-width));
  }
}
.race-results .heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin: 0 0 var(--space-xs);
}
.race-results .heading h1 {
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0;
  min-width: 0;
  overflow-wrap: break-word;
}
.race-results .race-nav {
  display: flex;
  flex-shrink: 0;
  gap: var(--space-2xs);
}
.race-results .race-nav [aria-disabled="true"] {
  opacity: 0.4;
  pointer-events: none;
}
.race-results .race-nav a {
  position: relative;
  display: grid;
  place-content: center;
  width: 32px;
  height: 32px;
}
.race-results .race-nav svg {
  width: 16px;
  height: 16px;
}
.race-results .meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-md);
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.5;
}
.race-results .meta > span:first-child {
  font-weight: 600;
  color: var(--color-ink);
}
.race-results .tag {
  font-size: inherit;
  line-height: 1.5;
  font-weight: 600;
  color: var(--color-tag-ink);
  background: var(--color-tag);
  padding: var(--space-3xs) var(--space-xs);
}
.race-results .summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  padding: var(--space-sm) 0;
  margin: var(--space-md) 0 var(--space-sm);
  border-top: 1px solid var(--color-rule);
  border-bottom: 1px solid var(--color-rule);
}
.race-results .metric {
  padding: 0 var(--space-md);
  border-left: 1px solid var(--color-rule);
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: center;
}
.race-results .metric.winner {
  --metric-accent: var(--color-award-winner);
}
.race-results .metric.best-lap {
  --metric-accent: var(--color-award-best-lap);
}
.race-results .metric.biggest-mover {
  --metric-accent: var(--color-award-mover);
}
.race-results .metric.best-pitstops {
  --metric-accent: var(--color-award-pits);
}
.race-results .metric.best-warmup {
  --metric-accent: var(--color-award-warmup);
}
.race-results .metric.best-stability {
  --metric-accent: var(--color-award-stability);
}
.race-results .metric:first-child {
  border-left: 0;
  padding-left: 0;
}
.race-results .metric:last-child {
  padding-right: 0;
}
.race-results .metric .label {
  font-size: 12px;
  color: var(--metric-accent);
  margin-bottom: var(--space-2xs);
  white-space: nowrap;
}
.race-results .metric strong {
  display: block;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
.race-results .metric small {
  display: block;
  color: var(--color-muted);
  font-size: 12px;
  margin-top: var(--space-2xs);
}
.race-results .metric button {
  border: 0;
  text-align: inherit;
  padding: 0;
  width: 100%;
  background: var(--color-paper);
  border-radius: 0;
  position: relative;
  white-space: normal;
}
.race-results .metric button:hover strong {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.race-results .metric button:active {
  background: var(--color-paper-3);
}
.race-compact .summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  row-gap: var(--space-md);
}
.race-compact .metric:nth-child(3n + 1) {
  border-left: 0;
}
.race-results .workspace {
  --result-row-height: 29px;
  background: var(--color-paper);
  border: 0;
}
.race-results .section-tabs {
  align-items: stretch;
  gap: var(--space-lg);
  border-bottom: 1px solid var(--color-rule);
  height: 42px;
  overflow-x: auto;
  scrollbar-width: thin;
  flex-wrap: nowrap;
  overflow-y: hidden;
}
.race-results .section-tabs .nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  font-size: 13px;
  color: var(--color-muted);
  border: 0;
  border-radius: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  padding: 0;
  white-space: nowrap;
  min-height: 40px;
  line-height: 1.45;
}
.race-results .section-tabs .nav-link.active {
  border-bottom-color: var(--color-link);
  color: var(--color-link);
  font-weight: 600;
}
.race-results .toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-xs) 0;
}
.race-results .toggles {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 13px;
  flex-wrap: wrap;
}
.race-results .check {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: 32px;
  cursor: pointer;
  white-space: nowrap;
}
.race-results .gap-picker {
  z-index: 12;
  width: 147px;
  max-width: 100%;
  font-size: 13px;
}
.race-results .gap-trigger {
  border-radius: var(--bs-border-radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs);
  width: 100%;
  height: 32px;
  padding: 0 var(--space-xs);
  font: inherit;
  text-align: left;
  line-height: 1.3;
}
.race-results .gap-options {
  min-width: 100%;
  width: max-content;
  max-width: calc(100vw - 24px);
  max-height: 50dvh;
  overflow: auto;
  padding: var(--space-2xs);
  box-shadow: 0 4px 12px #0000001a;
  --bs-dropdown-border-color: var(--color-control-edge);
  --bs-dropdown-link-hover-bg: var(--color-selected-fill);
  font-size: 13px;
}
.race-results .gap-option {
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  min-height: 32px;
  padding: 0 var(--space-xs);
  line-height: 1.3;
}
.race-results .gap-option:after {
  content: "";
  width: 8px;
  height: 5px;
  margin: 0 2px;
  border: solid currentColor;
  border-width: 0 0 1.5px 1.5px;
  transform: translateY(-1px) rotate(-45deg);
  visibility: hidden;
}
.race-results .gap-option.current:after {
  visibility: visible;
}

.race-results .race-nav a:after {
  content: "";
  position: absolute;
  inset: -6px 0;
}
.race-results .table-scroll {
  position: relative;
  overflow: visible;
  scrollbar-width: thin;
  scrollbar-color: var(--color-scrollbar) var(--color-paper-2);
  border-top: 1px solid var(--color-strong-rule);
  border-bottom: 1px solid var(--color-strong-rule);
}
.race-results table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-variant-numeric: tabular-nums;
}
.race-results .lap-table {
  table-layout: fixed;
  min-width: calc(var(--lap-label-width) + var(--driver-count, 9) * var(--lap-driver-width));
}
.race-results col.lap-col {
  width: var(--lap-label-width);
}
.race-results .lap-table th,
.race-results .lap-table td {
  text-align: center;
  border: 0;
  border-bottom: 1px solid var(--color-rule);
}
.race-results .lap-table thead {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--color-paper);
  color: var(--color-ink);
}
.race-results .lap-table thead th {
  padding: var(--space-xs) var(--space-2xs);
  font-weight: 400;
  vertical-align: top;
  border-bottom: 1px solid var(--color-strong-rule);
}
.race-results .lap-table thead th:not(:first-child) {
  position: relative;
  padding-bottom: calc(18px + var(--space-xs) + var(--space-2xs));
}
.race-results .lap-table thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 5;
  background: var(--color-lap-label);
  color: var(--color-muted);
  font-size: 12px;
  vertical-align: middle;
}
.race-results .driver-title {
  display: block;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
}
.race-results .driver-title .rank {
  margin-right: var(--space-2xs);
  color: var(--color-muted);
  font-size: 12px;
}
.race-results .driver-title a {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-ink);
  min-width: 0;
  max-width: 100%;
}
.race-results .driver-avatar {
  width: 26px;
  height: 26px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  background: var(--color-avatar-paper);
  margin: 0 auto var(--space-2xs);
}
.race-results .driver-sub {
  position: absolute;
  bottom: var(--space-xs);
  left: var(--space-2xs);
  right: var(--space-2xs);
  display: block;
  text-align: center;
  font-size: 11px;
  color: var(--color-muted);
  margin: 0;
  font-weight: 400;
  line-height: 18px;
}
.race-results .kart-badge {
  display: inline-grid;
  place-items: center;
  vertical-align: middle;
  min-width: 32px;
  height: 18px;
  padding: 0 4px;
  border: 1px solid var(--color-kart-edge);
  background: var(--color-kart);
  color: var(--color-kart-ink);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}
.race-results .kart-badge > span {
  display: block;
  line-height: 11px;
  position: relative;
  top: -0.5px;
}
.race-results .kart-link {
  display: inline-block;
  position: relative;
}
.race-results .kart-link:after {
  content: "";
  position: absolute;
  inset: -4px -6px;
}
.race-results .kart-link:hover {
  text-decoration: none;
}
.race-results .kart-link:hover .kart-badge,
.race-results .kart-toggle:hover .kart-badge {
  background: var(--color-kart-hover);
}
.race-results .kart-list {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  white-space: nowrap;
}
.race-results .lap-table tbody th {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--color-lap-label);
  font-size: 12px;
  font-weight: 400;
  color: var(--color-muted);
}
.race-results .lap-table tbody td {
  position: relative;
  background: var(--color-paper);
  height: var(--result-row-height);
  padding: var(--space-2xs) var(--space-xs);
  font-size: 14px;
  line-height: 1.3;
  cursor: pointer;
}
.race-results .lap-table tbody td:nth-of-type(odd) {
  background: var(--color-column);
}
.race-results .lap-table tbody tr:nth-child(5n) td,
.race-results .lap-table tbody tr:nth-child(5n) th {
  border-bottom-color: var(--color-five-rule);
}
.race-results .lap-table tbody tr:hover th {
  color: var(--color-ink);
  background: var(--color-hover);
}
.race-results .lap-table td:hover {
  outline: 1px solid var(--color-ink);
  outline-offset: -1px;
  z-index: 1;
}
.race-results .lap-table td.selected {
  box-shadow: inset 0 0 0 2px var(--color-selected);
}
.race-results .stint-rail {
  display: none;
  position: absolute;
  z-index: 1;
  left: 2px;
  top: -1px;
  bottom: -1px;
  width: 6px;
  border-left: 2px solid var(--color-selected);
  pointer-events: none;
}
.race-results .stint-start .stint-rail {
  top: 3px;
  border-top: 2px solid var(--color-selected);
  border-top-left-radius: 2px;
}
.race-results .stint-end .stint-rail {
  bottom: 3px;
  border-bottom: 2px solid var(--color-selected);
  border-bottom-left-radius: 2px;
}
.race-results .lap-table td.stint-group-selected .stint-rail {
  display: block;
}
.race-results .lap-table tbody td.race {
  background: var(--color-race);
  color: var(--color-event-ink);
  font-weight: 600;
}
.race-results .lap-table tbody td.stint {
  background: var(--color-stint);
  color: var(--color-event-ink);
  font-weight: 600;
}
.race-results .lap-table tbody td.pit {
  background: var(--color-pit);
  color: var(--color-pit-ink);
  font-weight: 600;
  padding-left: var(--space-md);
}
.race-results .lap-table td.pit:before {
  content: "P";
  position: absolute;
  left: 4px;
  top: 4px;
  font-size: 11px;
  line-height: 1;
  font-weight: 600;
}
.race-results .end {
  position: absolute;
  /* Keep the stint count above the time without shifting its baseline. */
  top: 1px;
  right: 2px;
  font-size: 10px;
  line-height: 1;
  color: var(--color-muted);
  font-weight: 400;
}
.race-results .lap-table .stint .end,
.race-results .lap-table .race .end {
  color: var(--color-event-ink);
}
.race-results .lap-table .pit .end {
  color: var(--color-pit-ink);
}
.race-results .aux {
  display: block;
  font-size: 11px;
  line-height: 1.3;
  margin-top: var(--space-2xs);
  white-space: nowrap;
}
.race-results .with-aux .lap-table {
  min-width: calc(var(--lap-label-width) + var(--driver-count, 9) * var(--lap-aux-driver-width));
}
.race-results .with-aux td {
  height: 44px !important;
}
.race-results .lap-table td.empty {
  color: var(--color-muted);
  cursor: default;
}
.race-results .legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-md);
  padding: var(--space-xs) 0;
  color: var(--color-muted);
  font-size: 11px;
  line-height: 1.5;
}
.race-results .legend > span {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
}
.race-results .legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid var(--color-legend-edge);
}
.race-results .legend .race-key {
  background: var(--color-race);
}
.race-results .legend .stint-key {
  background: var(--color-stint);
}
.race-results .legend .pit-key {
  background: var(--color-pit);
}
.race-results .legend .hint {
  flex-basis: 100%;
  margin-left: 0;
}
.race-results .selection {
  position: fixed;
  top: auto;
  bottom: 0;
  left: var(--gutter);
  right: var(--gutter);
  z-index: 6;
  display: block;
  max-height: 50dvh;
  overflow: auto;
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-paper-2);
  font-size: 13px;
  border-top: 1px solid var(--color-strong-rule);
}
.race-results .selection .muted {
  color: var(--color-muted);
}
.race-results .selection strong,
.race-results .selection b {
  font-weight: 600;
}
.race-results .selection-main,
.race-results .selection-lap,
.race-results .selection-stint-meta,
.race-results .selection-stint-times {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-md);
}
.race-results .selection-main,
.race-results .selection-lap {
  min-width: 0;
}
.race-results .selection-main {
  min-height: 28px;
  padding-right: 32px;
}
.race-results .selection-driver {
  overflow-wrap: anywhere;
}
.race-results .selection .close {
  position: absolute;
  right: var(--space-xs);
  top: var(--space-xs);
  padding: 0;
  border: 0;
  background: var(--color-paper-2);
  width: 28px;
  height: 28px;
  font-size: 22px;
}
.race-results .selection-stint {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px var(--space-lg);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--color-rule);
}
.race-results .selection-stint-meta > *,
.race-results .selection-stat {
  white-space: nowrap;
}
.race-results .selection-stint-kart {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
}
.race-results .stats-wrap {
  overflow: visible;
  scrollbar-width: thin;
}
.race-results .stats-table {
  table-layout: fixed;
  min-width: calc(var(--stats-label-width) + var(--driver-count, 9) * var(--stats-driver-width));
  font-size: 13px;
}
.race-results .stats-table th,
.race-results .stats-table td {
  padding: var(--space-xs);
  border-bottom: 1px solid var(--color-rule);
  text-align: right;
  white-space: nowrap;
}
.race-results .stats-table tbody th,
.race-results .stats-table tbody td {
  height: var(--result-row-height);
  padding: var(--space-2xs) var(--space-xs);
  line-height: 1.3;
}
.race-results .stats-label-col {
  width: var(--stats-label-width);
}
.race-results .stat-delta {
  display: block;
  color: var(--color-muted);
  font-size: 0.75em;
  line-height: 1.2;
}
.race-results .stats-table tr:has(.stat-delta) td {
  vertical-align: top;
}
.race-results .stats-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--color-paper-2);
  text-align: left;
  font-weight: 400;
  width: var(--stats-label-width);
}
.race-results .stats-table thead,
.race-results .pits-table thead {
  position: sticky;
  top: 0;
  z-index: 4;
}
.race-results .stats-table thead th {
  background: var(--color-paper-2);
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}
.race-results .stats-table .group th {
  background: var(--color-column);
  color: var(--color-ink);
  padding: var(--space-2xs) var(--space-xs);
  font-weight: 600;
}
.race-results .stats-table button {
  display: block;
  width: 100%;
  padding: 0 var(--space-2xs);
  border: 0;
  background: transparent;
  color: var(--color-link);
}
.race-results .stats-table .kart-toggle {
  min-width: 44px;
  min-height: 0;
  padding: 0;
  line-height: 1;
  text-align: inherit;
}
.race-results .stats-table .kart-selected .kart-badge {
  background: var(--color-selected-fill);
  border-color: var(--color-selected);
  color: var(--color-link);
}
.race-results .stats-table td.kart-selected {
  background: var(--color-selected-fill);
}
.race-results .stats-table td[data-kart] {
  cursor: pointer;
}
.race-results .stats-table .stat-toggle {
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0;
  text-align: inherit;
  line-height: inherit;
  color: inherit;
}
.race-results .driver-crew {
  display: block;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--color-muted);
}
.race-results .stats-help {
  padding: var(--space-sm) 0;
  color: var(--color-muted);
  font-size: 12px;
}
.race-results .pits-table {
  min-width: 650px;
  font-size: 14px;
}
.race-results .pits-table th,
.race-results .pits-table td {
  text-align: left;
  padding: var(--space-xs) var(--space-sm);
  border-bottom: 1px solid var(--color-rule);
}
.race-results .pits-table tbody td {
  height: var(--result-row-height);
  padding: var(--space-2xs) var(--space-sm);
  line-height: 1.3;
  white-space: nowrap;
}
.race-results .pits-table th:nth-child(-n + 2),
.race-results .pits-table td:nth-child(-n + 2) {
  width: 1%;
}
.race-results .pits-table .kart-list {
  display: flex;
}
.race-results .pits-table th {
  background: var(--color-paper-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.race-results .pits-table tr:hover td {
  background: var(--color-hover);
}
.race-results .pit-link {
  display: block;
  border: 0;
  border-bottom: 1px solid var(--color-link);
  padding: 0;
  background: transparent;
  color: var(--color-link);
  border-radius: 0;
}
.race-results .jump-mark th {
  background: var(--color-selected-fill) !important;
  color: var(--color-ink) !important;
}
.race-results ::selection {
  background: var(--color-selected-fill);
  color: var(--color-ink);
}
@media (max-width: 1000px) {
  .race-results .metric {
    padding: 0 var(--space-sm);
  }
  .race-results .metric .label {
    font-size: 11px;
  }
  .race-results .legend .hint {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .race-results * {
    scroll-behavior: auto !important;
  }
}
.race-results .mobile-heading,
.race-results .mobile-control,
.race-results .legend-short,
.race-results .stat-label-short {
  display: none;
}
.race-results .race-nav .race-live {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-width: 60px;
  padding: 0 8px;
  font-size: 13px;
  color: var(--color-link);
  white-space: nowrap;
  flex-shrink: 0;
}
.race-results .race-nav .race-live:hover {
  text-decoration: none;
}
.race-results .race-weather {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.race-results .race-weather svg {
  width: 18px;
  height: 18px;
}
.race-results .race-weather .weather-temperature {
  font-weight: 600;
  color: var(--color-ink);
  font-variant-numeric: tabular-nums;
}
.race-results .btn {
  --bs-btn-font-size: inherit;
  --bs-btn-line-height: inherit;
  --bs-btn-hover-bg: var(--color-paper-3);
  --bs-btn-active-bg: var(--color-active);
  --bs-btn-focus-box-shadow: none;
}
.race-results .btn-outline-secondary {
  --bs-btn-color: var(--color-ink);
  --bs-btn-border-color: var(--color-control-edge);
  --bs-btn-hover-bg: var(--color-paper-3);
  --bs-btn-hover-color: var(--color-ink);
  --bs-btn-hover-border-color: var(--color-control-edge);
  --bs-btn-active-bg: var(--color-active);
  --bs-btn-active-color: var(--color-ink);
  --bs-btn-active-border-color: var(--color-control-edge);
}
.race-results .check.form-check {
  padding: 0;
  margin: 0;
}
.race-results .form-check-input {
  float: none;
  margin: 0;
  width: 15px;
  height: 15px;
  border-color: var(--color-control-edge);
  box-shadow: none;
}
.race-results .form-check-input:checked {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
}
.race-results .gap-trigger:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}
.race-results .lap-table tbody td.heat-cell {
  background: var(--lap-heat);
  color: inherit;
}
.race-results .lap-table tbody td.joker {
  background: #f0c577;
  color: var(--color-event-ink);
}
.race-results .race-edit-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 8px;
  font-size: 12px;
  color: var(--color-muted);
  border-color: var(--color-rule);
  margin-left: auto;
}
.race-results .race-edit-button svg {
  width: 14px;
  height: 14px;
}
.race-results .race-editor {
  --bs-modal-width: 440px;
  --bs-modal-border-color: var(--color-rule);
}
.race-results .race-editor .modal-header {
  padding: 20px 20px 0;
  border: 0;
}
.race-results .race-editor .modal-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}
.race-results .race-editor .modal-body {
  padding: 18px 20px 0;
}
.race-results .race-editor .modal-footer {
  margin: 20px;
  padding: 16px 0 0;
  border-top: 1px solid var(--color-rule);
  gap: 8px;
}
.race-results .race-editor .modal-footer .btn {
  margin: 0;
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}
.race-results .editor-field {
  margin-bottom: 16px;
  font-size: 13px;
}
.race-results .editor-field .form-label {
  margin-bottom: 6px;
}
.race-results .editor-field .form-control {
  height: 40px;
  padding: 8px 10px;
}
.race-results .editor-field .form-control:focus {
  outline: none;
  box-shadow: none;
  background: var(--color-selected-fill);
  border-color: var(--color-focus);
}
.race-results .editor-field .form-text {
  font-size: 12px;
}
.race-results .editor-direction legend {
  font-size: 13px;
  margin-bottom: 8px;
  float: none;
  width: auto;
}
.race-results .editor-direction label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0;
  margin: 0;
  font-size: 14px;
}
.race-results .editor-save {
  background: var(--color-accent);
  color: var(--color-accent-ink);
  border-color: var(--color-accent);
}
.race-results .pit-classification {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  background: transparent;
  border-color: var(--color-control-edge);
}
.race-results .selection-edit-status {
  font-size: 12px;
  color: var(--color-error);
}
/* Page-only layout hook for the site's existing .container-fluid/footer wrapper. */
body.race-results-page > .container-fluid {
  padding: 0;
}

/* Mobile and short landscape viewports share the compact layout. */
@media (max-width: 700px), (max-width: 1000px) and (max-height: 500px) {
  .race-results {
    --lap-label-width: 28px;
    --stats-label-width: 64px;
    --lap-driver-width: 68px;
    --lap-aux-driver-width: 68px;
    --stats-driver-width: 60px;
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: none;
    padding: 0;
  }
  .race-results .mobile-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2xs);
    flex: 0 0 44px;
    padding: 0 var(--space-xs);
    border-bottom: 1px solid var(--color-rule);
  }
  .race-results .mobile-heading strong {
    flex: 1;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 600;
    min-width: 0;
  }
  .race-results .mobile-heading button {
    flex-shrink: 0;
    height: 44px;
    padding: 0 var(--space-2xs);
    border: 0;
    font-size: 12px;
    color: var(--color-muted);
  }
  .race-results .mobile-race-nav {
    align-self: flex-start;
    flex-shrink: 0;
    gap: 0;
  }
  .race-results .mobile-race-nav a {
    width: 44px;
    height: 44px;
    border: 0;
  }
  .race-results .mobile-race-nav a:after {
    display: none;
  }
  .race-results .race-overview .heading {
    display: none;
  }
  .race-results .race-overview {
    display: none;
    position: absolute;
    z-index: 13;
    top: 44px;
    left: 0;
    right: 0;
    max-height: calc(100% - 44px);
    overflow: auto;
    padding: var(--space-sm);
    background: var(--color-paper);
    border-bottom: 2px solid var(--color-strong-rule);
  }
  .race-results.overview-open .race-overview {
    display: block;
  }
  .race-results .race-overview .meta {
    gap: var(--space-xs);
  }
  .race-results .race-overview .summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: var(--space-sm) 0 0;
    padding: 0;
  }
  .race-results .race-overview .metric {
    padding: var(--space-xs);
  }
  .race-results .race-overview .metric:nth-child(3n + 1) {
    border-left: 0;
  }
  .race-results .race-overview .metric:nth-child(-n + 3) {
    border-bottom: 1px solid var(--color-rule);
  }
  .race-results .race-overview .metric .label {
    white-space: normal;
    font-size: 11px;
  }
  .race-results .race-overview .metric strong {
    font-size: 16px;
  }
  .race-results .race-overview .metric small {
    font-size: 11px;
  }
  .race-results .workspace {
    --result-row-height: 28px;
  }
  .race-results .section-tabs {
    flex: 0 0 40px;
    height: 40px;
    gap: var(--space-sm);
    padding: 0 var(--space-xs);
    scrollbar-width: none;
  }
  .race-results .section-tabs .nav-link {
    font-size: 12px;
  }
  .race-results .tab-pane.active {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }
  .race-results .toolbar {
    position: relative;
    flex: 0 0 40px;
    gap: var(--space-2xs);
    padding: 0 var(--space-2xs);
    border-bottom: 1px solid var(--color-rule);
  }
  .race-results .mobile-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    min-height: 39px;
    border: 0;
    padding: 0 var(--space-xs);
    font-size: 13px;
    background: var(--color-paper);
  }
  .race-results .toolbar .toggles {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.15fr);
    flex: 1;
    min-width: 0;
    gap: var(--space-xs);
    font-size: 12px;
  }
  .race-results .toggles .check {
    min-width: 0;
    min-height: 39px;
    gap: var(--space-2xs);
    white-space: normal;
    line-height: 1.15;
  }
  .race-results .toolbar .gap-picker {
    min-width: 0;
    width: 100%;
    font-size: inherit;
  }
  .race-results .gap-option {
    min-height: 44px;
  }
  .race-results .toolbar .gap-trigger {
    height: auto;
    min-height: 26px;
    gap: var(--space-2xs);
    padding: 2px 3px;
    line-height: 1.15;
  }
  .race-results .toolbar .gap-trigger span {
    min-width: 0;
    white-space: normal;
  }
  .race-results .toolbar .gap-options {
    left: auto;
    right: 0;
  }
  .race-results .expand-button {
    flex: 0 0 44px;
    width: 44px;
    padding: 0;
  }
  .race-results .table-scroll {
    overflow: auto;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: auto;
    flex: 1;
    min-height: 0;
    max-height: none;
    width: 100%;
    border-top: 0;
    scrollbar-gutter: auto;
    -webkit-overflow-scrolling: touch;
  }
  .race-results #lap-scroll {
    padding-bottom: var(--selection-height, 0px);
  }
  .race-results .lap-table thead th {
    padding: var(--space-2xs) 2px;
    vertical-align: middle;
  }
  .race-results .lap-table thead th:not(:first-child) {
    padding-bottom: calc(18px + 2 * var(--space-2xs));
  }
  .race-results .lap-table thead th:first-child {
    font-size: 10px;
    padding: 0;
  }
  .race-results .driver-avatar {
    display: none;
  }
  .race-results .driver-title {
    line-height: 1.15;
  }
  .race-results .driver-title .rank {
    display: none;
  }
  .race-results .driver-title a {
    display: block;
    font-size: 12px;
  }
  .race-results .driver-sub {
    bottom: var(--space-2xs);
  }
  .race-results .lap-table thead {
    height: 48px;
  }
  .race-results .lap-table tbody th {
    font-size: 11px;
  }
  .race-results .lap-table tbody td {
    padding: 2px;
    font-size: 13px;
    white-space: nowrap;
  }
  .race-results .lap-table tbody td.pit {
    padding-left: 12px;
    padding-right: 0;
    font-size: 12px;
  }
  .race-results .lap-table td.pit:before {
    left: 3px;
    top: 3px;
    font-size: 9px;
  }
  .race-results .end {
    font-size: 9px;
    top: 0;
  }
  .race-results .aux {
    font-size: 10px;
    white-space: normal;
    line-height: 1.15;
    margin-top: 2px;
  }
  .race-results .legend {
    flex-shrink: 0;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: var(--space-xs);
    min-height: 28px;
    padding: var(--space-2xs) var(--space-xs)
      max(var(--space-2xs), env(safe-area-inset-bottom));
    font-size: 10px;
    line-height: 1.2;
  }
  .race-results .legend i {
    width: 8px;
    height: 8px;
  }
  .race-results .legend-long,
  .race-results .stat-label-full {
    display: none;
  }
  .race-results .legend-short {
    display: inline;
  }
  .race-results .selection {
    position: absolute;
    z-index: 8;
    left: 0;
    right: 0;
    bottom: 28px;
    border-bottom: 1px solid var(--color-strong-rule);
    font-size: 12px;
    box-shadow: 0 -1px 0 var(--color-strong-rule);
    max-height: 50%;
  }
  .race-results .selection-main {
    display: block;
    min-height: 0;
  }
  .race-results .selection-driver {
    display: block;
    margin-bottom: var(--space-2xs);
  }
  .race-results .selection-lap {
    gap: var(--space-2xs) 10px;
  }
  .race-results .selection-stint {
    gap: 6px;
  }
  .race-results .selection-stint-meta,
  .race-results .selection-stint-times {
    gap: var(--space-2xs) 12px;
  }
  .race-results .selection .close {
    right: 0;
    top: 0;
    width: 44px;
    height: 44px;
  }
  .race-results .stats-help {
    flex-shrink: 0;
    padding: var(--space-xs);
  }
  .race-results .stats-wrap {
    overflow: auto;
    flex: 1;
    min-height: 0;
    max-height: none;
  }
  .race-results .stats-table {
    font-size: 12px;
  }
  .race-results .stats-table th,
  .race-results .stats-table td {
    padding: var(--space-2xs);
    text-align: center;
  }
  .race-results .stats-table tbody th,
  .race-results .stats-table tbody td {
    padding: 2px var(--space-2xs);
  }
  .race-results .stats-table th:first-child {
    width: auto;
    font-size: 11px;
  }
  .race-results .stat-label-short {
    display: inline;
  }
  .race-results .stats-table thead th {
    height: 40px;
    line-height: 1.2;
    vertical-align: middle;
    border-bottom-color: var(--color-strong-rule);
  }
  .race-results .stats-table tbody td {
    background: var(--color-paper);
  }
  .race-results .stats-table tbody td:nth-of-type(odd) {
    background: var(--color-column);
  }
  .race-results .stats-table tbody td.kart-selected {
    background: var(--color-selected-fill);
  }
  .race-results .stats-table .group th {
    position: static;
    height: var(--result-row-height);
    padding: 2px var(--space-2xs);
    font-size: 12px;
    border-top: 1px solid var(--color-strong-rule);
  }
  .race-results .stats-group-label {
    display: inline-block;
    position: sticky;
    left: var(--space-2xs);
  }
  .race-results .stat-gap-detail {
    display: block;
    font-size: 10px;
    line-height: 1.3;
    color: var(--color-muted);
  }
  .race-results .stats-table td:has(.stat-gap-detail) {
    padding-top: 1px;
    padding-bottom: 1px;
    line-height: 1;
  }
  .race-results .stat-duration {
    font-size: 10px;
  }
  .race-results .driver-crew {
    font-size: 10px;
  }
  .race-results .stats-table button {
    min-height: 0;
    min-width: 44px;
    padding: 0;
  }
  .race-results .pits-table {
    min-width: 0;
    font-size: 13px;
  }
  .race-results .pits-table th {
    padding-inline: var(--space-xs);
  }
  .race-results .pits-table tbody td {
    padding: 2px var(--space-xs);
  }
  body.race-results-page.matrix-focus .mobile-heading,
  body.race-results-page.matrix-focus .section-tabs {
    display: none;
  }
  .race-results .mobile-race-nav .race-live {
    width: 40px;
    min-width: 40px;
    padding: 0;
    font-size: 12px;
  }
  .race-results .mobile-race-nav .race-live svg {
    display: none;
  }
  html:has(.race-results),
  body.race-results-page {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }
  html:has(.race-results) {
    scrollbar-width: none;
  }
  html:has(.race-results)::-webkit-scrollbar {
    display: none;
  }
  body.race-results-page {
    min-height: 0 !important;
  }
  body.race-results-page > .navbar {
    flex-shrink: 0;
  }
  body.race-results-page > .container-fluid {
    display: flex;
    flex-direction: column;
    flex: none;
    height: calc(100dvh - var(--race-header-height, 55px));
    min-height: 0;
  }
  body.race-results-page > footer {
    flex-shrink: 0;
  }
  body.race-results-page.matrix-focus > .navbar,
  body.race-results-page.matrix-focus > footer {
    display: none;
  }
  body.race-results-page.matrix-focus > .container-fluid {
    height: 100dvh;
  }
  .race-results .workspace,
  .race-results .tab-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }
  .race-results .form-check-input {
    width: 18px;
    height: 18px;
  }
  .race-results .race-edit-button {
    min-height: 26px;
    padding: 0 6px;
    margin-left: 0;
  }
  .race-results .race-editor .modal-dialog {
    margin: 12px auto;
    width: calc(100% - 24px);
    max-width: var(--bs-modal-width);
  }
  .race-results .editor-field .form-control {
    height: 44px;
    font-size: 16px;
  }
  .race-results .race-editor .modal-footer .btn,
  .race-results .editor-direction label {
    min-height: 40px;
  }
  .race-results .pit-classification {
    min-height: 26px;
    padding: 0 6px;
  }
}
@media (max-width: 360px) {
  .race-results .toolbar .toggles {
    grid-template-columns: minmax(0, 78px) auto minmax(0, 1fr);
    gap: var(--space-2xs);
  }
  .race-results .toolbar .gap-trigger {
    gap: 2px;
    padding-inline: 3px;
  }
}
