:root {
  --bg: #efefec;
  --panel: #ffffff;
  --panel-soft: #f7f6f2;
  --ink: #17191c;
  --muted: #666b72;
  --line: #d8d3c8;
  --accent: #c5202c;
  --accent-2: #064f99;
  --accent-3: #cf8f1d;
  --chip: #ebe4d7;
  --shadow: 0 16px 42px rgba(20, 22, 26, 0.1);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(239, 239, 236, 0.95) 360px),
    var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 24px;
  background: rgba(250, 249, 245, 0.9);
  border-bottom: 1px solid rgba(20, 22, 26, 0.12);
  backdrop-filter: blur(14px);
}

.brand-block {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 14px;
}

.brand-logo {
  width: 172px;
  height: 48px;
  object-fit: contain;
  object-position: left center;
}

.logo-fallback {
  width: 72px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #111;
  color: #fff;
  font-size: 20px;
  font-weight: 950;
}

.logo-fallback[hidden] {
  display: none;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 2px;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.meta-line span {
  white-space: nowrap;
}

.source-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 8px 10px;
}

.source-pill span {
  color: var(--muted);
  font-size: 12px;
}

.source-pill strong {
  font-size: 13px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 11px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

main {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 16px 22px 36px;
}

.site-home {
  background: #f3f2ef;
}

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 5vw, 76px);
  color: #fff;
  background: linear-gradient(180deg, rgba(12, 14, 17, 0.82), rgba(12, 14, 17, 0.28));
}

.site-brand img {
  width: 190px;
  height: 52px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.42));
}

.site-nav nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-nav a {
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.site-nav nav a {
  padding: 9px 11px;
  border-radius: var(--radius);
}

.site-nav .nav-cta {
  background: var(--accent);
}

.home-main {
  width: 100%;
  max-width: none;
  padding: 0;
}

.home-hero {
  position: relative;
  min-height: 78vh;
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #fff;
  background: #101114;
}

.home-hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% 56%;
}

.home-hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 10, 14, 0.82) 0%, rgba(8, 10, 14, 0.48) 44%, rgba(8, 10, 14, 0.12) 100%),
    linear-gradient(0deg, rgba(8, 10, 14, 0.64), rgba(8, 10, 14, 0.05) 54%);
}

.home-hero-content {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 36px));
  margin-left: clamp(18px, 7vw, 96px);
  padding: 120px 0 64px;
}

.home-hero-logo {
  width: min(300px, 72vw);
  height: auto;
  margin-bottom: 18px;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.42));
}

.home-hero h1 {
  margin: 0 0 14px;
  color: #fff;
  font-size: clamp(42px, 7vw, 88px);
  line-height: 0.94;
}

.home-hero p {
  max-width: 660px;
  margin-bottom: 24px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 18px;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 15px;
  border-radius: var(--radius);
  font-weight: 900;
  text-decoration: none;
}

.primary-link {
  color: #fff;
  background: var(--accent);
}

.secondary-link {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.home-strip {
  width: min(1180px, calc(100% - 32px));
  margin: -34px auto 0;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  box-shadow: var(--shadow);
}

.home-strip div {
  min-height: 92px;
  padding: 17px 18px;
  background: #fff;
}

.home-strip strong,
.home-strip span {
  display: block;
}

.home-strip strong {
  margin-bottom: 5px;
  font-size: 18px;
}

.home-strip span {
  color: var(--muted);
  font-size: 13px;
}

.home-section {
  width: min(1180px, calc(100% - 32px));
  margin: 72px auto;
  scroll-margin-top: 96px;
}

.home-section h2 {
  margin-bottom: 16px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.02;
}

.home-section p {
  color: #3d4148;
  font-size: 17px;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.sponsors-section {
  margin-top: 64px;
}

.sponsor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.sponsor-logo {
  min-height: 122px;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.sponsor-logo img {
  max-width: 100%;
  max-height: 78px;
  object-fit: contain;
}

.sponsor-logo-wide img {
  max-height: 88px;
}

.sponsor-logo-dark {
  background: #17191c;
}

.sponsor-logo-muted {
  background: linear-gradient(135deg, #e8e9e7, #f7f6f2);
}

.sponsor-strip {
  width: 100%;
  aspect-ratio: 21 / 8;
  margin-top: 12px;
  display: block;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.split-section,
.dossier-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 480px);
  gap: 42px;
  align-items: center;
}

.split-section img,
.dossier-section img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stats-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.stats-band div {
  min-height: 132px;
  padding: 22px;
  background: #16191d;
  color: #fff;
}

.stats-band span {
  display: block;
  margin-bottom: 14px;
  color: #d73a45;
  font-size: 13px;
  font-weight: 950;
}

.stats-band strong {
  display: block;
  max-width: 270px;
  font-size: 22px;
  line-height: 1.12;
}

.dossier-section {
  grid-template-columns: minmax(320px, 480px) minmax(0, 1fr);
  padding-bottom: 36px;
}

.dossier-section .primary-link {
  margin-top: 8px;
}

.gallery-section {
  width: min(1360px, calc(100% - 32px));
}

.gallery-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
  scrollbar-gutter: stable;
}

.gallery-track figure {
  position: relative;
  flex: 0 0 min(420px, 82vw);
  aspect-ratio: 16 / 10;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: #17191c;
  scroll-snap-align: start;
  box-shadow: var(--shadow);
}

.gallery-track img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.gallery-track figcaption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 6px 9px;
  color: #fff;
  background: rgba(17, 19, 22, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.team-hero {
  position: relative;
  min-height: 170px;
  overflow: hidden;
  display: grid;
  align-items: stretch;
  margin-bottom: 14px;
  color: #fff;
  border: 1px solid rgba(20, 22, 26, 0.18);
  border-radius: var(--radius);
  background: #111;
  box-shadow: var(--shadow);
}

.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 54% 64%;
}

.hero-media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(14, 16, 20, 0.86) 0%, rgba(14, 16, 20, 0.42) 42%, rgba(14, 16, 20, 0.02) 100%),
    linear-gradient(0deg, rgba(14, 16, 20, 0.48), rgba(14, 16, 20, 0.04) 52%);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  padding: 22px 28px;
}

.hero-copy {
  max-width: 760px;
  display: grid;
  align-content: end;
  gap: 12px;
}

.hero-copy img {
  width: 190px;
  max-width: 60vw;
  height: auto;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.38));
}

.hero-copy h2 {
  margin: 0 0 6px;
  font-size: 30px;
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy p {
  margin: 0;
  max-width: 560px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
}

.kpi {
  min-height: 76px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  box-shadow: var(--shadow), inset 0 3px 0 rgba(197, 32, 44, 0.85);
}

.kpi .label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.kpi .value {
  overflow: hidden;
  display: -webkit-box;
  margin-top: 6px;
  font-size: 21px;
  font-weight: 850;
  line-height: 1.08;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.kpi .hint {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(210px, 300px) minmax(160px, 240px) minmax(180px, 280px) minmax(220px, 1fr) 64px 42px;
  align-items: end;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.field {
  display: grid;
  gap: 5px;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

select,
input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffefa;
  color: var(--ink);
  padding: 0 11px;
  outline: none;
}

select:focus,
input:focus,
button:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 60, 50, 0.18);
}

.icon-button {
  width: 42px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
}

.icon-button span {
  display: block;
  transform: translateY(-1px);
  font-weight: 900;
}

.grt-filter-button {
  width: 64px;
  background: #fffefa;
  color: var(--accent);
  border-color: rgba(197, 32, 44, 0.35);
}

.grt-filter-button span {
  transform: none;
  font-size: 12px;
  letter-spacing: 0;
}

.grt-filter-button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 8px 18px rgba(197, 32, 44, 0.18);
}

.import-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(360px, 1.4fr) minmax(200px, 0.7fr);
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  background: #17191c;
  color: #fff;
  border: 1px solid rgba(20, 22, 26, 0.2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.import-copy {
  display: grid;
  gap: 2px;
}

.import-copy strong {
  font-size: 14px;
}

.import-copy span,
.import-status {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.import-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 8px;
}

.import-form button {
  height: 40px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 850;
  cursor: pointer;
}

.import-form button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.import-status.ok {
  color: #6dd4a9;
  font-weight: 800;
}

.import-status.error {
  color: #ff777f;
  font-weight: 800;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  border-bottom: 1px solid var(--line);
}

.tab {
  min-width: 94px;
  height: 40px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: var(--panel-soft);
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.tab.active {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: inset 0 3px 0 var(--accent);
}

.view {
  display: none;
  margin-top: 14px;
}

.active-view {
  display: block;
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 14px;
}

.stage-view-grid {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 310px);
}

.wide-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.compare-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.variant-picker {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.variant-picker-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.variant-picker-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.variant-picker-title strong {
  color: var(--ink);
  font-size: 13px;
  text-align: right;
}

.variant-options {
  max-height: 188px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  padding: 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.variant-check {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}

.variant-check.suggested {
  border-color: rgba(201, 60, 50, 0.42);
  background: #fff8ed;
}

.variant-check input {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  padding: 0;
}

.variant-check input:disabled {
  cursor: default;
}

.variant-check span,
.variant-check strong,
.variant-check small {
  display: block;
  min-width: 0;
}

.variant-check strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.variant-check small {
  color: var(--muted);
  font-size: 12px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2,
.panel-header h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.panel-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 24px;
  padding: 3px 8px;
  background: var(--chip);
  color: var(--ink);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  scrollbar-gutter: stable;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

td {
  font-size: 13px;
}

.stage-table-wrap {
  overflow-x: hidden;
}

.stage-times-table {
  min-width: 0;
  table-layout: fixed;
}

.stage-times-table th,
.stage-times-table td {
  padding: 8px 8px;
}

.stage-times-table .pos-col {
  width: 48px;
}

.stage-times-table .year-col {
  width: 52px;
}

.stage-times-table .rally-col {
  width: 15%;
}

.stage-times-table .tc-col {
  width: 46px;
}

.stage-times-table .dorsal-col {
  width: 58px;
}

.stage-times-table .team-col {
  width: 23%;
}

.stage-times-table .car-col {
  width: 17%;
}

.stage-times-table .time-col {
  width: 76px;
}

.stage-times-table .gap-col {
  width: 58px;
}

.stage-times-table .speed-col {
  width: 58px;
}

.stage-times-table .skm-col {
  width: 54px;
}

.stage-times-table .rally-cell,
.stage-times-table .team-cell,
.stage-times-table .car-cell {
  white-space: normal;
  line-height: 1.25;
}

.stage-times-table .rally-cell,
.stage-times-table .car-cell,
.stage-times-table .crew strong,
.stage-times-table .crew span {
  overflow-wrap: anywhere;
}

.stage-times-table .year-cell,
.stage-times-table .numeric {
  font-variant-numeric: tabular-nums;
}

.stage-times-table .year-cell,
.stage-times-table .numeric,
.stage-times-table .time {
  text-align: right;
}

tbody tr:hover {
  background: #fff8ed;
}

tbody tr.grt-row {
  background: linear-gradient(90deg, rgba(197, 32, 44, 0.11), rgba(6, 79, 153, 0.05) 72%);
  box-shadow: inset 4px 0 0 var(--accent);
}

tbody tr.grt-row:hover {
  background: linear-gradient(90deg, rgba(197, 32, 44, 0.15), rgba(6, 79, 153, 0.08) 72%);
}

tbody tr.grt-row-soft {
  background: linear-gradient(90deg, rgba(197, 32, 44, 0.05), transparent 74%);
}

.grt-row .pos:not(.win) {
  background: rgba(197, 32, 44, 0.14);
  color: var(--accent);
}

.pos {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--chip);
  font-weight: 900;
}

.pos.win {
  background: var(--accent);
  color: #fff;
}

.crew {
  display: grid;
  gap: 2px;
}

.crew strong {
  font-size: 13px;
}

.crew span {
  color: var(--muted);
  font-size: 12px;
}

.grt-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  vertical-align: middle;
  letter-spacing: 0;
}

.time {
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.muted {
  color: var(--muted);
}

.positive {
  color: var(--accent-2);
  font-weight: 800;
}

.warning {
  color: var(--accent-3);
  font-weight: 800;
}

.summary-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.summary-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.summary-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-row span {
  color: var(--muted);
  font-size: 12px;
}

.record-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px minmax(0, 1fr) 86px;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.summary-row.grt-row,
.record-row.grt-row,
.grt-cell {
  background: linear-gradient(90deg, rgba(197, 32, 44, 0.11), rgba(255, 254, 250, 0.96));
  border-color: rgba(197, 32, 44, 0.34);
  box-shadow: inset 4px 0 0 var(--accent);
}

th.grt-cell {
  box-shadow: inset 0 3px 0 var(--accent);
}

.grt-legend-item {
  font-weight: 900;
}

.summary-row .grt-badge,
.record-row .grt-badge,
.grt-cell .grt-badge,
.legend .grt-badge {
  color: #fff;
  font-size: 10px;
}

.record-row strong,
.record-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-stat {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.chart-wrap {
  padding: 16px;
}

.chart {
  width: 100%;
  min-height: 360px;
  display: block;
  background: linear-gradient(180deg, #ffffff 0%, #fbfaf6 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 0 16px 16px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.empty-state {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1100px) {
  .home-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .split-section,
  .dossier-section {
    grid-template-columns: 1fr;
  }

  .dossier-section img {
    order: 2;
  }

  .stats-band {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .section-grid {
    grid-template-columns: 1fr;
  }

  .stage-view-grid {
    grid-template-columns: 1fr;
  }

  .hero-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .site-nav {
    position: absolute;
    align-items: flex-start;
    padding: 12px;
  }

  .site-brand img {
    width: 144px;
    height: 42px;
  }

  .site-nav nav {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 3px;
  }

  .site-nav nav a {
    padding: 8px 7px;
    font-size: 12px;
  }

  .home-hero {
    min-height: 82vh;
  }

  .home-hero-photo {
    object-position: 58% 56%;
  }

  .home-hero-shade {
    background:
      linear-gradient(180deg, rgba(8, 10, 14, 0.78) 0%, rgba(8, 10, 14, 0.2) 42%, rgba(8, 10, 14, 0.82) 100%),
      linear-gradient(90deg, rgba(8, 10, 14, 0.78), rgba(8, 10, 14, 0.18));
  }

  .home-hero-content {
    width: calc(100% - 24px);
    margin-left: 12px;
    padding: 110px 0 34px;
  }

  .home-hero-logo {
    width: 210px;
    margin-bottom: 14px;
  }

  .home-hero h1 {
    font-size: 44px;
  }

  .home-hero p {
    font-size: 15px;
  }

  .home-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .home-strip {
    width: calc(100% - 24px);
    margin-top: -22px;
    grid-template-columns: 1fr;
  }

  .home-strip div {
    min-height: 74px;
    padding: 13px 14px;
  }

  .home-section {
    width: calc(100% - 24px);
    margin: 46px auto;
  }

  .home-section h2 {
    font-size: 31px;
  }

  .home-section p {
    font-size: 15px;
  }

  .stats-band div {
    min-height: 104px;
  }

  .stats-band strong {
    font-size: 19px;
  }

  .sponsor-logo {
    min-height: 104px;
  }

  .sponsor-strip {
    aspect-ratio: 16 / 8;
  }

  .gallery-section {
    width: calc(100% - 24px);
  }

  .gallery-track {
    gap: 10px;
  }

  .gallery-track figure {
    flex-basis: 84vw;
  }

  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
  }

  main {
    padding: 12px;
  }

  .brand-block {
    align-items: flex-start;
  }

  .brand-logo {
    width: 148px;
    height: 44px;
  }

  .logo-fallback {
    width: 58px;
    height: 44px;
  }

  h1 {
    font-size: 20px;
  }

  .source-pill {
    width: 100%;
    justify-content: space-between;
  }

  .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .top-link {
    justify-content: center;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .team-hero {
    min-height: 280px;
  }

  .hero-photo {
    object-position: 48% 66%;
  }

  .hero-media {
    background:
      linear-gradient(180deg, rgba(14, 16, 20, 0.86) 0%, rgba(14, 16, 20, 0.24) 45%, rgba(14, 16, 20, 0.76) 100%);
  }

  .hero-content {
    padding: 18px;
  }

  .hero-copy h2 {
    font-size: 28px;
  }

  .hero-copy p {
    font-size: 14px;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .stage-table-wrap {
    overflow-x: auto;
  }

  .stage-times-table {
    min-width: 760px;
    table-layout: auto;
  }

  .import-panel,
  .import-form {
    grid-template-columns: 1fr;
  }

  .compare-controls {
    grid-template-columns: 1fr;
  }

  .variant-picker-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .variant-picker-title strong {
    text-align: left;
  }

  .icon-button {
    width: 100%;
  }

  .tab {
    flex: 1 1 110px;
  }
}

@media (max-width: 460px) {
  .site-nav {
    gap: 8px;
  }

  .site-nav nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .home-hero h1 {
    font-size: 38px;
  }

  .primary-link,
  .secondary-link {
    width: 100%;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .panel-header {
    flex-direction: column;
  }
}
