/* Race Club RaceRoom site. One stylesheet for every raceroom page.
   Rules come from the skill "race-club-raceroom-design".
   Colors, fonts and sizes are set ONLY in the token block below. */

@view-transition { navigation: auto; }

/* ---------- Tokens ---------- */
:root {
  /* Light theme, same palette as the old Race Club site (offwhite page, white cards, silver lines,
     carbon text, steel for quiet text, one red). The top bar stays near-black with the white logo. */
  --rr-bg: #F5F5F3;
  --rr-card: #FFFFFF;
  --rr-panel: #FFFFFF;
  --rr-panel-strong: #E6EAEE;
  --rr-line: #D8DDE1;
  --rr-ink: #171717;
  --rr-text: #171717;
  --rr-muted: #536575;
  --rr-red: #F21B0C;
  --rr-up: #1F5C25;
  --rr-on-red: #FFFFFF;
  --rr-invert-bg: #171717;
  --rr-invert-text: #FFFFFF;
  --rr-shadow: 0 0 0 1px #D8DDE1, 0 2px 10px rgba(23, 23, 23, 0.05);
  --rr-font: "Montserrat", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --rr-pad: 32px;
  --rr-gap: 8px;
  --rr-gap-tiles: 16px;   /* space between photo tiles and news tiles */
  --rr-control: rgba(23, 23, 23, 0.06);
  --rr-well: rgba(23, 23, 23, 0.05);
  --rr-pill: rgba(23, 23, 23, 0.12);
  --rr-pill-on: rgba(23, 23, 23, 0.65);
  /* Top bar (always dark, white logo) */
  --rr-bar: #141416;
  --rr-bar-line: #2C2D31;
  --rr-bar-text: #FFFFFF;
  --rr-bar-muted: #B4B7BD;
  --rr-bar-control: rgba(255, 255, 255, 0.10);
  /* Text laid over a photo or graphic */
  --rr-photo-text: #FFFFFF;
  --rr-photo-muted: rgba(255, 255, 255, 0.85);
  --rr-photo-fade: rgba(23, 23, 23, 0.88);
  --rr-photo-line: rgba(255, 255, 255, 0.45);
  --rr-speed: 0.16s;
}

/* ---------- Cards and panels: white with a thin silver outline ---------- */
.rr-panel, .rr-card, .rr-stat, .rr-hero, .rr-rank-tile, .rr-barlist, .rr-article, .rr-empty, .rr-notice, .rr-tile, .rr-promo { box-shadow: var(--rr-shadow); }

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--rr-bg); }
body {
  font-family: var(--rr-font);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--rr-text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, select { font-family: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--rr-text); outline-offset: 2px; }

/* ---------- App frame: the page never scrolls, only the content area does ---------- */
.rr-app {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.rr-app > * { position: relative; z-index: 1; flex-shrink: 0; }

/* ---------- Top bar ---------- */
.rr-app > .rr-topbar { z-index: 5; }
.rr-app > .rr-page-head { z-index: 4; }
.rr-topbar {
  --rr-text: var(--rr-bar-text);
  --rr-muted: var(--rr-bar-muted);
  --rr-line: var(--rr-bar-line);
  --rr-control: var(--rr-bar-control);
  --rr-invert-bg: var(--rr-bar-text);
  --rr-invert-text: var(--rr-bar);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 48px;
  min-height: 96px;
  padding: 14px var(--rr-pad);
  background: var(--rr-bar);
  border-bottom: 1px solid var(--rr-bar-line);
  color: var(--rr-text);
}
.rr-logo { display: inline-flex; align-items: center; transition: opacity var(--rr-speed) ease; }
.rr-logo:hover { opacity: 0.8; }
.rr-logo-img { display: block; height: 25px; width: auto; max-width: 100%; object-fit: contain; object-position: left center; }
.rr-nav { display: flex; align-items: center; gap: var(--rr-gap); flex-wrap: nowrap; flex-shrink: 0; }
/* The menu buttons always stay on one row. When they do not fit beside the logo and icons, the shell adds
   rr-topbar-stacked and the whole row drops under them (also always the case in portrait, see below). */
.rr-topbar-stacked .rr-logo { order: 1; min-width: 0; flex: 1 1 0; }
.rr-topbar-stacked .rr-topbar-end { order: 2; flex-shrink: 0; }
.rr-topbar-stacked .rr-nav { order: 3; flex: 0 0 100%; overflow-x: auto; scrollbar-width: none; }
.rr-topbar-end { display: flex; align-items: center; gap: var(--rr-gap); margin-left: auto; }

/* Top buttons: no border, see-through fill. Hover = light border. Active = solid light. */
.rr-nav-item, .rr-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  border: 1px solid transparent;
  background: var(--rr-control);
  color: var(--rr-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color var(--rr-speed) ease, border-color var(--rr-speed) ease, color var(--rr-speed) ease;
}
.rr-nav-item { padding: 0 16px; font-weight: 400; }
.rr-icon-btn { width: 34px; padding: 0; }
.rr-icon-btn svg { display: block; width: 18px; height: 18px; }
.rr-nav-item:hover, .rr-icon-btn:hover { border-color: var(--rr-text); }
.rr-nav-item[aria-current="page"] {
  background: var(--rr-invert-bg);
  border-color: var(--rr-invert-bg);
  color: var(--rr-invert-text);
}
/* Icons at the far right are not part of the navbar: icon only, no fill, same white border on hover. */
.rr-topbar-end .rr-icon-btn { background: transparent; }
.rr-icon-btn[aria-current="page"] { border-color: var(--rr-text); }
.rr-icon-btn[aria-disabled="true"] { color: var(--rr-muted); cursor: default; }
.rr-icon-btn[aria-disabled="true"]:hover { border-color: transparent; }

/* ---------- Tooltip: white box, point at top middle, dark text ---------- */
[data-rr-tip] { position: relative; }
[data-rr-tip]::before, [data-rr-tip]::after {
  position: absolute;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--rr-speed) ease;
}
[data-rr-tip]::before {
  content: "";
  top: calc(100% + 2px);
  left: 50%;
  margin-left: -6px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid var(--rr-invert-bg);
}
[data-rr-tip]::after {
  content: attr(data-rr-tip);
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  background: var(--rr-invert-bg);
  color: var(--rr-invert-text);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.4;
  text-transform: uppercase;
  white-space: nowrap;
}
[data-rr-tip]:hover::before, [data-rr-tip]:hover::after,
[data-rr-tip]:focus-visible::before, [data-rr-tip]:focus-visible::after { opacity: 1; }
[data-rr-tip].rr-tip-end::after { left: auto; right: 0; transform: none; }

/* ---------- Page title row ---------- */
.rr-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  min-height: 84px;
  padding: 32px var(--rr-pad) 12px;
}
.rr-page-title {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
}
.rr-head-tools { display: flex; align-items: flex-end; gap: var(--rr-gap); flex-wrap: wrap; }

/* ---------- Sub-tabs ---------- */
.rr-subtabs { display: flex; padding: 0 var(--rr-pad); }
.rr-subtab {
  position: relative;
  flex: 1 1 0;
  padding: 10px 8px;
  border-bottom: 1px solid var(--rr-line);
  color: var(--rr-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color var(--rr-speed) ease, border-color var(--rr-speed) ease;
}
.rr-subtab-alert { display: inline-flex; margin-left: 6px; vertical-align: middle; color: var(--rr-red); }
.rr-subtab-alert svg { display: block; width: 14px; height: 14px; }
.rr-subtab:hover { color: var(--rr-text); border-bottom-color: var(--rr-text); }
.rr-subtab[aria-current="page"] {
  color: var(--rr-red);
  border-bottom: 2px solid var(--rr-red);
  padding-bottom: 9px;
}
.rr-subtab[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  margin-left: -6px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--rr-red);
}

/* ---------- Content ---------- */
/* The scroll area holds the page content and the footer, so the footer moves with the page. */
.rr-scroll {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--rr-line) transparent;
}
.rr-foot { flex: 0 0 auto; margin-top: auto; }
.rr-content {
  flex: 1 0 auto;
  padding: 16px var(--rr-pad) 24px;
}
.rr-stack { display: flex; flex-direction: column; gap: 16px; }
.rr-grid-2, .rr-grid-3 { display: grid; gap: var(--rr-gap); }
.rr-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rr-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rr-row-stats { display: grid; gap: var(--rr-gap); grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.rr-split { display: grid; gap: 16px; grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
.rr-span-2 { grid-column: span 2; }

.rr-heading {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
}
.rr-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.rr-body { margin: 0; color: var(--rr-muted); }
.rr-note { font-size: 11.5px; font-weight: 400; color: var(--rr-muted); }
.rr-red { color: var(--rr-red); }

/* ---------- Bottom bar: legal notice at the left, previous / next links at the right ---------- */
.rr-bottombar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 47px;
  margin: 0 var(--rr-pad);
  padding: 12px 0 16px;
  border-top: 1px solid var(--rr-line);
}
/* Previous / next links just above the footer line (Leaderboards sub-tabs, news stories) */
.rr-steps { display: flex; justify-content: flex-end; gap: 24px; padding: 8px var(--rr-pad) 16px; }
.rr-steps:empty { display: none; }
.rr-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.rr-step-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--rr-text);
  transition: background-color var(--rr-speed) ease, color var(--rr-speed) ease;
}
.rr-step:hover .rr-step-key { background: var(--rr-invert-bg); color: var(--rr-invert-text); }
.rr-legal { flex: none; max-width: 100%; text-align: center; font-size: 10.5px; line-height: 1.45; color: var(--rr-muted); }
.rr-version { flex: none; font-size: 10.5px; line-height: 1.45; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rr-muted); white-space: nowrap; }
.rr-legal-text { margin-right: 8px; }
.rr-legal-link { color: var(--rr-text); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.rr-legal-link:hover, .rr-legal-link:focus-visible { text-decoration: underline; }

/* ---------- Big block that is a link: stays the same size, white border on hover (like the top buttons) ---------- */
.rr-block-link { border: 1px solid transparent; transition: border-color var(--rr-speed) ease; }
.rr-block-link:hover, .rr-block-link:focus-visible { border-color: var(--rr-text); }

/* ---------- Filter group ---------- */
.rr-segment { display: inline-flex; flex-wrap: wrap; }
.rr-segment-option {
  height: 28px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--rr-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--rr-speed) ease;
}
.rr-segment-option:hover { color: var(--rr-text); }
.rr-segment-option[aria-pressed="true"] { background: var(--rr-invert-bg); color: var(--rr-invert-text); }

/* ---------- Dropdown ---------- */
.rr-select { position: relative; display: inline-block; }
.rr-select-btn {
  display: flex;
  align-items: stretch;
  height: 34px;
  padding: 0;
  border: 1px solid var(--rr-line);
  background: var(--rr-well);
  color: var(--rr-text);
  cursor: pointer;
  transition: border-color var(--rr-speed) ease;
}
.rr-select-text {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.rr-select-label { font-weight: 400; }
.rr-select-value { font-weight: 800; }
.rr-select-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  border-left: 1px solid var(--rr-line);
  transition: border-color var(--rr-speed) ease;
}
.rr-select-arrow::after {
  content: "";
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid var(--rr-text);
  transition: transform var(--rr-speed) ease;
}
.rr-select-btn:hover, .rr-select-btn:focus-visible, .rr-select-btn[aria-expanded="true"],
.rr-select-btn:hover .rr-select-arrow, .rr-select-btn:focus-visible .rr-select-arrow,
.rr-select-btn[aria-expanded="true"] .rr-select-arrow { border-color: var(--rr-text); }
.rr-select-btn[aria-expanded="true"] .rr-select-arrow::after { transform: rotate(180deg); }
.rr-select-list {
  position: absolute;
  z-index: 20;
  top: 100%;
  left: 0;
  min-width: 100%;
  max-height: 280px;
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  border: 1px solid var(--rr-text);
  border-top: 0;
  background: var(--rr-card);
  list-style: none;
}
.rr-select-option {
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.rr-select-option[data-rr-focus="true"] { background: var(--rr-panel-strong); }
.rr-select-option[aria-selected="true"] { background: var(--rr-invert-bg); color: var(--rr-invert-text); }

/* ---------- Check box ---------- */
.rr-check {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.rr-check input { position: absolute; width: 0; height: 0; opacity: 0; }
.rr-check-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--rr-line);
  background: var(--rr-well);
  transition: border-color var(--rr-speed) ease;
}
.rr-check-box::after {
  content: "";
  width: 14px;
  height: 14px;
  background: var(--rr-text);
  opacity: 0;
  transition: opacity var(--rr-speed) ease;
}
.rr-check input:checked + .rr-check-box::after { opacity: 1; }
.rr-check:hover .rr-check-box, .rr-check input:focus-visible + .rr-check-box { border-color: var(--rr-text); }

.rr-check-partial .rr-check-box::after { height: 4px; opacity: 1; }

/* ---------- Text box (same look as a dropdown) ---------- */
.rr-input {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--rr-line);
  background: var(--rr-well);
  transition: border-color var(--rr-speed) ease;
}
.rr-input:hover, .rr-input:focus-within { border-color: var(--rr-text); }
.rr-input-label {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.rr-input input, .rr-input textarea {
  flex: 1 1 auto;
  min-width: 0;
  width: 150px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--rr-text);
  color-scheme: dark;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
}
.rr-input input:focus, .rr-input textarea:focus { outline: none; }
.rr-input input[type="number"] { width: 64px; }
.rr-input-wide { display: flex; flex: 1 1 360px; }
/* Shown but not editable: no hover border, muted value. */
.rr-input-locked, .rr-input-locked:hover { border-color: var(--rr-line); background: transparent; }
.rr-input-locked input { color: var(--rr-muted); cursor: default; }
/* A box that failed a check: red border until it is fixed. */
.rr-input[aria-invalid="true"], .rr-input[aria-invalid="true"]:hover, .rr-input[aria-invalid="true"]:focus-within,
.rr-select[aria-invalid="true"] .rr-select-btn, .rr-select[aria-invalid="true"] .rr-select-arrow { border-color: var(--rr-red); }
.rr-textarea { display: flex; align-items: flex-start; height: auto; padding: 8px 12px; }
.rr-textarea textarea { height: 56px; resize: vertical; line-height: 1.45; }

/* ---------- Rows of option boxes, notices ---------- */
.rr-form-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--rr-gap); }
/* Three even columns of option boxes: name at the left, value at the right. */
.rr-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--rr-gap); }
.rr-form-grid .rr-select { display: block; }
.rr-form-grid .rr-select-btn { width: 100%; }
.rr-form-grid .rr-select-text { flex: 1 1 auto; justify-content: space-between; min-width: 0; }
.rr-form-grid .rr-select-value { overflow: hidden; text-overflow: ellipsis; }
.rr-form-grid .rr-input { display: flex; }
.rr-form-grid .rr-input input { text-align: right; }
.rr-subheading { margin: 8px 0 0; font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rr-muted); }
.rr-notice { margin: 0; padding: 8px 12px; border-left: 2px solid var(--rr-text); background: var(--rr-panel); }
.rr-notice-warn { border-left-color: var(--rr-red); }

/* ---------- Tree (class, then cars, then liveries) ---------- */
.rr-tree-row { display: flex; align-items: center; gap: 8px; min-height: 34px; border-bottom: 1px solid var(--rr-line); }
.rr-tree-l2 { padding-left: 36px; }
.rr-tree-l3 { padding-left: 72px; }
.rr-tree-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: border-color var(--rr-speed) ease;
}
.rr-tree-toggle:hover { border-color: var(--rr-text); }
.rr-tree-toggle::after {
  content: "";
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid var(--rr-text);
  transition: transform var(--rr-speed) ease;
}
.rr-tree-toggle[aria-expanded="true"]::after { transform: rotate(90deg); }
.rr-tree-count { margin-left: auto; padding-right: 12px; }

/* ---------- Page pills ---------- */
.rr-pager { display: flex; justify-content: center; gap: 6px; padding-top: 8px; }
.rr-pill {
  display: flex;
  align-items: center;
  width: 34px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.rr-pill::before {
  content: "";
  display: block;
  width: 100%;
  height: 8px;
  border: 1px solid var(--rr-line);
  border-radius: 4px;
  background: var(--rr-pill);
  transition: background-color var(--rr-speed) ease, border-color var(--rr-speed) ease;
}
.rr-pill[aria-current="page"]::before { background: var(--rr-pill-on); }
.rr-pill:hover::before, .rr-pill:focus-visible::before { background: var(--rr-text); border-color: var(--rr-text); }

/* ---------- News: a block that is the same height on every page, with the pills right under it ---------- */
.rr-content.rr-content-fill { display: flex; flex-direction: column; }
.rr-news { display: flex; flex: 1 0 auto; flex-direction: column; }
.rr-news-grid {
  display: grid;
  flex: 1 0 auto;
  gap: var(--rr-gap-tiles);
  grid-template-rows: repeat(2, minmax(170px, 1fr));
}
.rr-news-grid .rr-promo { min-height: 0; }
.rr-news-first { grid-template-columns: 2fr 1fr; }
.rr-news-first > :first-child { grid-row: span 2; }
.rr-news-rest { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rr-news-quad { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- Sidebar list ---------- */
.rr-sidelist { display: flex; flex-direction: column; }
.rr-sidelist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding: 4px 12px;
  border: 0;
  border-bottom: 1px solid var(--rr-line);
  background: transparent;
  color: var(--rr-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color var(--rr-speed) ease;
}
.rr-sidelist-row:hover { background: var(--rr-panel-strong); }
.rr-sidelist-row[aria-pressed="true"] { background: var(--rr-invert-bg); color: var(--rr-invert-text); }

/* ---------- Card ---------- */
.rr-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 96px;
  padding: 16px;
  background: var(--rr-panel);
}
.rr-card-title { margin: 0; font-size: 17px; font-weight: 800; line-height: 1.2; text-transform: uppercase; }

/* ---------- Progress bar ---------- */
.rr-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--rr-line); }
.rr-progress-fill { height: 100%; background: var(--rr-text); }

/* ---------- Stat tile ---------- */
.rr-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; background: var(--rr-panel); }
.rr-stat-value { font-size: 30px; font-weight: 800; line-height: 1.1; text-transform: uppercase; }

/* ---------- Label and value ---------- */
.rr-kv { display: flex; flex-direction: column; gap: 2px; }
.rr-kv-value { font-size: 13px; font-weight: 600; }
.rr-kv-row { flex-direction: row; justify-content: space-between; align-items: baseline; padding: 4px 0; }
.rr-kv-list { display: flex; flex-wrap: wrap; gap: 16px 32px; }

/* ---------- Panel (plain box that groups catalogue parts) ---------- */
.rr-panel { padding: 16px; background: var(--rr-panel); }

/* ---------- Table ---------- */
.rr-table-wrap { overflow-x: auto; }
.rr-table { width: 100%; border-collapse: collapse; }
.rr-table th {
  padding: 8px 12px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.rr-table th.rr-sorted { color: var(--rr-red); }
.rr-table th.rr-sorted::after { content: " \25B2"; font-size: 8px; }
.rr-table td {
  height: 40px;
  padding: 6px 12px;
  border-top: 1px solid var(--rr-line);
  font-size: 13px;
  font-weight: 600;
  vertical-align: middle;
  white-space: nowrap;
}
.rr-table .rr-num { text-align: right; font-variant-numeric: tabular-nums; }
.rr-table tr { transition: background-color var(--rr-speed) ease; }
.rr-table tr.rr-row-link { cursor: pointer; }
.rr-table tr.rr-row-link:hover { background: var(--rr-panel-strong); }
.rr-table tr.rr-row-me { background: var(--rr-panel-strong); }
.rr-cell-main { display: block; text-transform: uppercase; }
.rr-cell-sub { display: block; font-size: 11.5px; font-weight: 400; color: var(--rr-muted); }

/* ---------- Ranked bar list ---------- */
.rr-barlist { padding: 16px; background: var(--rr-panel); }
.rr-barlist-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.rr-barlist-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) minmax(0, 1.4fr) 56px;
  align-items: center;
  gap: 12px;
  min-height: 28px;
  border-top: 1px solid var(--rr-line);
  font-weight: 600;
}
.rr-barlist-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: uppercase; }
.rr-bar { height: 4px; background: var(--rr-red); }
.rr-barlist-value { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Tags ---------- */
.rr-tag, .rr-tag-outline {
  display: inline-block;
  align-self: flex-start;
  padding: 2px 6px;
  border: 1px solid var(--rr-red);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: nowrap;
}
.rr-tag { background: var(--rr-red); color: var(--rr-on-red); }
.rr-tag-outline { border-color: var(--rr-text); }

/* ---------- Change indicator ---------- */
.rr-delta-up { color: var(--rr-up); }
.rr-delta-down { color: var(--rr-red); }

/* ---------- Photo tile and promo tile ---------- */
.rr-tile, .rr-promo {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  min-height: 200px;
  padding: 16px;
  background-color: var(--rr-panel);
  background-position: center;
  background-size: cover;
}
.rr-tile.rr-has-photo::before, .rr-promo.rr-has-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--rr-photo-fade), transparent 75%);
}
.rr-tile > *, .rr-promo > * { position: relative; }
/* Text over a photo or graphic is always light, on the dark fade */
.rr-tile.rr-has-photo, .rr-promo.rr-has-photo {
  --rr-text: var(--rr-photo-text);
  --rr-muted: var(--rr-photo-muted);
  --rr-line: var(--rr-photo-line);
  --rr-invert-bg: var(--rr-photo-text);
  --rr-invert-text: var(--rr-ink);
  color: var(--rr-photo-text);
}
.rr-promo-feature { min-height: 300px; }
/* Large photo and news blocks that are links lift off the page on hover (no border change). */
.rr-promo.rr-block-link, .rr-rank-tile.rr-block-link { transition: transform var(--rr-speed) ease, box-shadow var(--rr-speed) ease; }
.rr-promo.rr-block-link:hover, .rr-promo.rr-block-link:focus-visible, .rr-rank-tile.rr-block-link:hover, .rr-rank-tile.rr-block-link:focus-visible {
  border-color: transparent;
  transform: translateY(-4px);
  box-shadow: 0 0 0 1px #D8DDE1, 0 12px 24px rgba(23, 23, 23, 0.28);
}
@media (prefers-reduced-motion: reduce) {
  .rr-promo.rr-block-link:hover, .rr-promo.rr-block-link:focus-visible, .rr-rank-tile.rr-block-link:hover, .rr-rank-tile.rr-block-link:focus-visible { transform: none; }
}
.rr-promo-soon { cursor: default; }
.rr-tile-title { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.2; text-transform: uppercase; }
.rr-promo-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.rr-tile-corner { position: absolute; top: 16px; left: 16px; }

/* ---------- Hero panel ---------- */
.rr-hero { display: flex; flex-direction: column; gap: 4px; padding: 16px; background: var(--rr-panel); }
.rr-hero-title { margin: 0; font-size: 28px; font-weight: 800; line-height: 1.1; text-transform: uppercase; }

/* ---------- Buttons ---------- */
.rr-btn, .rr-btn-save {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 16px;
  border: 1px solid var(--rr-line);
  background: transparent;
  color: var(--rr-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--rr-speed) ease, color var(--rr-speed) ease, border-color var(--rr-speed) ease;
}
.rr-btn:hover, a:hover > .rr-promo-foot .rr-btn {
  background: var(--rr-invert-bg);
  border-color: var(--rr-invert-bg);
  color: var(--rr-invert-text);
}
.rr-btn-save { background: var(--rr-red); border-color: var(--rr-red); color: var(--rr-on-red); }
.rr-btn[disabled] { opacity: 0.4; cursor: default; pointer-events: none; }
.rr-icon-solid svg { fill: currentColor; }
.rr-btn svg { display: block; flex: none; width: 16px; height: 16px; margin-right: 8px; }

/* Two-click confirm: red, white icon and text, tooltip stays up until the button resets (3 seconds). */
.rr-btn.rr-confirming, .rr-btn.rr-confirming:hover,
.rr-icon-btn.rr-confirming, .rr-icon-btn.rr-confirming:hover, .rr-topbar-end .rr-icon-btn.rr-confirming {
  background: var(--rr-red);
  border-color: var(--rr-red);
  color: var(--rr-on-red);
}
.rr-confirming[data-rr-tip]::before, .rr-confirming[data-rr-tip]::after { opacity: 1; }
/* Buttons inside a table: the tooltip opens ABOVE the button and lines up with its right edge, so it is never cut off
   by the table's edge and never makes the table scroll. */
.rr-table [data-rr-tip]::before {
  top: auto;
  bottom: calc(100% + 2px);
  left: auto;
  right: 12px;
  margin-left: 0;
  border-bottom: 0;
  border-top: 6px solid var(--rr-invert-bg);
}
.rr-table [data-rr-tip]::after { top: auto; bottom: calc(100% + 8px); left: auto; right: 0; transform: none; }

/* ---------- Upload Results: drop area and file list ---------- */
.rr-drop { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; padding: 24px; border: 1px dashed var(--rr-line); background: var(--rr-panel); }
.rr-drop[data-over="true"] { border-color: var(--rr-text); background: var(--rr-panel-strong); }
.rr-drop .rr-body { max-width: 640px; }
.rr-upload-actions { display: flex; flex-wrap: wrap; gap: var(--rr-gap); }
.rr-status-ok { color: var(--rr-up); }
.rr-status-bad { color: var(--rr-red); }
.rr-table .rr-select { min-width: 260px; }

/* ---------- Links in text ---------- */
.rr-link:hover { text-decoration: underline; }

/* ---------- Article ---------- */
.rr-article { padding: 24px; background: var(--rr-panel); }
.rr-article p { margin: 0 0 16px; font-size: 15px; line-height: 1.6; }
.rr-article p:last-child { margin-bottom: 0; }
.rr-article-meta { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }

/* ---------- Empty state ---------- */
.rr-empty { padding: 16px; background: var(--rr-panel); color: var(--rr-muted); }

/* ---------- Portrait (window taller than wide) ---------- */
@media (orientation: portrait) {
  :root { --rr-pad: 16px; }
  .rr-topbar { gap: 12px; min-height: 0; padding-top: 26px; padding-bottom: 26px; }
  /* Row 1: logo at the left, small icons at the right. Row 2: the menu buttons. */
  .rr-logo { order: 1; min-width: 0; flex: 1 1 0; }
  .rr-topbar-end { order: 2; flex-shrink: 0; }
  .rr-nav { order: 3; flex: 0 0 100%; overflow-x: auto; scrollbar-width: none; }
  .rr-hide-portrait { display: none; }
  .rr-page-head { flex-direction: column; align-items: flex-start; }
  .rr-page-title { font-size: 28px; }
  .rr-subtabs { overflow-x: auto; scrollbar-width: none; }
  .rr-subtab { flex: 0 0 auto; padding-left: 16px; padding-right: 16px; }
  .rr-grid-2, .rr-grid-3, .rr-split, .rr-news-first, .rr-news-rest, .rr-news-quad, .rr-form-grid { grid-template-columns: minmax(0, 1fr); }
  .rr-news-grid { flex: 0 0 auto; grid-template-rows: none; grid-auto-rows: 170px; }
  .rr-news-first > :first-child { grid-row: auto; }
  .rr-news .rr-pager { position: sticky; bottom: -24px; margin-top: auto; padding-bottom: 8px; background: var(--rr-bg); }
  .rr-span-2 { grid-column: auto; }
  .rr-row-stats { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}


/* ---------- Ranking strip: rank 1 large, 2 and 3 medium, 4 to 7 small ---------- */
.rr-strip { display: grid; gap: var(--rr-gap-tiles); grid-template-columns: 2fr 1.3fr 1fr 1fr; grid-template-rows: repeat(2, 136px); }
.rr-rank-tile { display: flex; flex-direction: column; gap: 2px; padding: 16px; background: var(--rr-panel); color: var(--rr-text); text-decoration: none; position: relative; min-width: 0; overflow: hidden; }
.rr-rank-no { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; color: var(--rr-red); }
.rr-rank-name { margin: 0; font-size: 15px; font-weight: 800; line-height: 1.15; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-rank-value { display: flex; align-items: baseline; gap: 8px; margin-top: auto; }
.rr-rank-value .rr-stat-value { font-size: 22px; }
.rr-rank-1 { grid-column: 1; grid-row: 1 / span 2; }
.rr-rank-1 .rr-rank-name { font-size: 24px; white-space: normal; }
.rr-rank-1 .rr-rank-value .rr-stat-value { font-size: 44px; }
.rr-rank-2 { grid-column: 2; grid-row: 1; }
.rr-rank-3 { grid-column: 2; grid-row: 2; }
.rr-rank-2 .rr-rank-value .rr-stat-value, .rr-rank-3 .rr-rank-value .rr-stat-value { font-size: 28px; }
.rr-rank-4 { grid-column: 3; grid-row: 1; }
.rr-rank-5 { grid-column: 4; grid-row: 1; }
.rr-rank-6 { grid-column: 3; grid-row: 2; }
.rr-rank-7 { grid-column: 4; grid-row: 2; }

/* ---------- Totals block: four columns of label and value rows ---------- */
.rr-totals { display: grid; gap: var(--rr-gap); grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rr-totals-col { display: flex; flex-direction: column; gap: 0; padding: 16px; }
.rr-totals-col .rr-heading { margin-bottom: 8px; }
.rr-totals-col .rr-kv-row { border-top: 1px solid var(--rr-line); }

/* ---------- Radar chart ---------- */
.rr-radar { display: flex; align-items: center; justify-content: center; padding: 16px; }
.rr-radar-svg { width: 100%; max-width: 420px; height: auto; }
.rr-radar-web { fill: none; stroke: var(--rr-line); stroke-width: 1; }
.rr-radar-shape { fill: var(--rr-red); fill-opacity: 0.35; stroke: var(--rr-red); stroke-width: 1.5; }
.rr-radar-label { fill: var(--rr-muted); font-family: var(--rr-font); font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.rr-radar-value { fill: var(--rr-text); font-family: var(--rr-font); font-size: 16px; font-weight: 800; }

/* Standings by round: the points of a round dropped from the total are struck through, a bonus is a small raised number */
.rr-drop { text-decoration: line-through; color: var(--rr-muted); }
.rr-bonus { font-size: 9px; font-weight: 700; vertical-align: super; margin-left: 2px; color: var(--rr-red); }
.rr-group-title { margin: 8px 0 0; }

@media (orientation: portrait) {
  .rr-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; grid-auto-rows: 136px; }
  .rr-strip .rr-rank-tile { grid-column: auto; grid-row: auto; }
  .rr-strip .rr-rank-1 { grid-column: 1 / span 2; grid-row: auto; min-height: 176px; }
  .rr-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Seven stat tiles in a row (profile Leaderboards tab) */
.rr-row-stats-compact .rr-stat-value { font-size: 20px; }

/* Earned achievement: a trophy in the top right corner of the card */
.rr-card-earned .rr-card-title { padding-right: 32px; }
.rr-card-trophy { position: absolute; top: 14px; right: 14px; display: block; width: 22px; height: 22px; color: var(--rr-text); }
.rr-card-trophy svg { display: block; width: 100%; height: 100%; }

/* A stack whose rows are spaced exactly like the boxes inside a row (the driver profile overview) */
.rr-stack-tight { gap: var(--rr-gap); }
.rr-stack-tight > .rr-heading { margin: 8px 0 0; }

/* ---------- Flags ---------- */
.rr-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.rr-flag { display: block; flex: none; width: 20px; height: 14px; object-fit: cover; box-shadow: 0 0 0 1px var(--rr-line); }
.rr-rank-name .rr-name, .rr-banner-title .rr-name { max-width: 100%; }

/* ---------- Picture behind text (RR.photo): ranking tiles, banners and hero panels ---------- */
.rr-photo-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.rr-rank-tile.rr-has-photo::before, .rr-banner.rr-has-photo::before, .rr-hero.rr-has-photo::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(to top, var(--rr-photo-fade), rgba(23, 23, 23, 0.15) 80%);
}
.rr-rank-tile.rr-has-photo > :not(.rr-photo-img), .rr-banner.rr-has-photo > :not(.rr-photo-img), .rr-hero.rr-has-photo > :not(.rr-photo-img) { position: relative; z-index: 1; }
.rr-rank-tile.rr-has-photo, .rr-banner.rr-has-photo, .rr-hero.rr-has-photo {
  --rr-text: var(--rr-photo-text);
  --rr-muted: var(--rr-photo-muted);
  --rr-line: var(--rr-photo-line);
  color: var(--rr-photo-text);
  background: var(--rr-bar);
}
.rr-rank-tile.rr-has-photo .rr-rank-no { color: var(--rr-photo-text); }
.rr-hero { position: relative; overflow: hidden; }
.rr-hero.rr-has-photo { min-height: 160px; justify-content: flex-end; }

/* Wide banner at the top of a page */
.rr-banner { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; min-height: 220px; padding: 16px; overflow: hidden; background: var(--rr-panel); box-shadow: var(--rr-shadow); }
.rr-banner-title { margin: 0; font-size: 28px; font-weight: 800; line-height: 1.1; text-transform: uppercase; }
.rr-banner-title .rr-flag { width: 30px; height: 21px; }
@media (orientation: portrait) { .rr-banner { min-height: 170px; } }
