: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;
  overflow-x: hidden;
  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;
}

.social-pill {
  color: var(--ink);
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease;
}

.social-pill:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.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);
}

.guide-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(197, 32, 44, 0.08), transparent 28%),
    linear-gradient(180deg, #f8f7f3, #eeece7);
}

.guide-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px clamp(16px, 4vw, 54px);
  background: rgba(250, 249, 245, 0.94);
  border-bottom: 1px solid rgba(20, 22, 26, 0.12);
  backdrop-filter: blur(14px);
}

.guide-brand img {
  width: 178px;
  height: 48px;
  display: block;
  object-fit: contain;
  object-position: left center;
}

.guide-nav-actions,
.guide-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.guide-nav-link,
.guide-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-weight: 900;
  text-decoration: none;
}

.guide-nav-link {
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
}

.guide-nav-primary,
.guide-button-primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.guide-main {
  width: min(1120px, 100%);
  padding: 22px 22px 64px;
}

.guide-hero {
  min-height: 430px;
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-radius: 14px;
  background: #11151a;
  box-shadow: var(--shadow);
}

.guide-hero-picture,
.guide-hero-picture img,
.guide-hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.guide-hero-picture img {
  object-fit: cover;
  object-position: center 35%;
}

.guide-hero-shade {
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(8, 10, 14, 0.9) 0%, rgba(8, 10, 14, 0.58) 52%, rgba(8, 10, 14, 0.18) 100%),
    linear-gradient(0deg, rgba(8, 10, 14, 0.86), transparent 70%);
}

.guide-hero-content {
  position: relative;
  z-index: 2;
  width: min(680px, 100%);
  padding: clamp(28px, 5vw, 58px);
  color: #fff;
}

.guide-hero-logo {
  width: min(270px, 70vw);
  height: auto;
  margin-bottom: 24px;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.42));
}

.guide-hero h1 {
  max-width: 620px;
  margin-bottom: 12px;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.guide-hero p:not(.eyebrow) {
  max-width: 600px;
  margin-bottom: 22px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 17px;
}

.guide-button {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.guide-button-whatsapp {
  color: #fff;
  background: #168b55;
  border-color: #168b55;
}

.guide-section {
  margin-top: 40px;
}

.guide-section-heading {
  margin-bottom: 16px;
}

.guide-section-heading h2,
.guide-glossary h2,
.guide-footer-cta h2 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.guide-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.guide-step {
  min-height: 132px;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(20, 22, 26, 0.05);
}

.guide-step > span {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 50%;
  font-weight: 950;
}

.guide-step h3,
.guide-feature-card h3 {
  margin-bottom: 5px;
  font-size: 18px;
  line-height: 1.15;
}

.guide-step p,
.guide-feature-card p,
.guide-tip p {
  margin-bottom: 0;
  color: var(--muted);
}

.guide-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.guide-feature-card {
  min-height: 170px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(20, 22, 26, 0.06);
}

.guide-feature-card > span {
  display: inline-block;
  margin-bottom: 13px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.guide-glossary {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) 1.25fr;
  align-items: center;
  gap: 28px;
  margin-top: 40px;
  padding: 26px;
  color: #fff;
  background: #17191c;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.guide-glossary dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0;
}

.guide-glossary dl div {
  padding: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
}

.guide-glossary dt {
  color: #fff;
  font-size: 16px;
  font-weight: 950;
}

.guide-glossary dd {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.guide-tip {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 14px;
  padding: 14px 16px;
  background: rgba(197, 32, 44, 0.08);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
}

.guide-footer-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 40px;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.guide-footer-cta h2 {
  max-width: 650px;
}

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: clamp(600px, 64vh, 760px);
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #fff;
  background: #101114;
}

.home-hero-picture {
  position: absolute;
  inset: 0;
  display: block;
}

.home-hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 34%;
}

.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(1440px, calc(100% - 48px));
  margin-inline: auto;
  padding: 96px 0 54px;
}

.home-hero-logo {
  width: min(300px, 76vw);
  height: auto;
  margin-bottom: 16px;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.76)) drop-shadow(0 14px 24px rgba(0, 0, 0, 0.48));
}

.home-hero-copy {
  max-width: 680px;
  display: grid;
  gap: 9px;
  margin-bottom: 24px;
}

.home-hero-copy .eyebrow {
  width: max-content;
  margin: 0;
  padding: 5px 9px;
  color: #fff;
  background: rgba(197, 32, 44, 0.92);
  border-radius: var(--radius);
  font-size: 12px;
  letter-spacing: 0.035em;
}

.home-hero-description {
  max-width: 660px;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 18px;
  line-height: 1.45;
}

.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);
}

.onboard-contribute-button {
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid #0d624d;
  border-radius: 8px;
  background: #167c62;
  color: #fff;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.onboard-contribute-button:hover { background: #0d624d; }
.onboard-contribute-button:focus-visible { outline: 3px solid rgba(22, 124, 98, .3); outline-offset: 2px; }

.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-social-callout {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) auto minmax(240px, 0.7fr);
  align-items: center;
  gap: 24px;
  padding: 22px 24px;
  border-radius: var(--radius);
  background: linear-gradient(125deg, #15171a 0%, #22252a 58%, #35171b 100%);
  color: #fff;
  box-shadow: var(--shadow);
  scroll-margin-top: 96px;
}

.home-social-copy {
  min-width: 0;
}

.home-social-copy .eyebrow {
  margin: 0 0 4px;
  color: #ff6670;
}

.home-social-copy h2 {
  margin: 0 0 6px;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.05;
}

.home-social-copy p:last-child {
  max-width: 650px;
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  line-height: 1.45;
}

.home-social-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: 210px;
}

.home-social-features span {
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 850;
}

.home-social-link {
  min-height: 78px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 13px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease;
}

.home-social-link:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.14);
}

.home-social-link span,
.home-social-link b {
  color: rgba(255, 255, 255, 0.65);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.home-social-link strong {
  font-size: 19px;
}

.home-social-link b {
  margin-top: 4px;
  color: #ff6670;
}

.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(6, minmax(0, 1fr));
  gap: 12px;
}

.sponsor-logo {
  min-height: 96px;
  display: grid;
  place-items: center;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  overflow: hidden;
}

.sponsor-logo img {
  width: 100%;
  max-width: 100%;
  max-height: 96px;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.sponsor-logo-wide img {
  max-height: 104px;
}

.sponsor-logo-graginsa img {
  transform: scale(1.22);
}

.sponsor-logo-quironsalud img,
.sponsor-logo-g2ti img {
  transform: scale(0.96);
}

.sponsor-logo-grupodex img {
  transform: scale(0.84);
}

.sponsor-logo-molano img {
  transform: scale(0.79);
}

.sponsor-logo-skoda img {
  position: relative;
  top: 15px;
  transform: scale(1.9);
}

.sponsor-logo-priority {
  grid-column: span 1;
}

.sponsor-logo-dark {
  background: #fff;
}

.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: 190px;
  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-picture {
  position: absolute;
  inset: 0;
  display: block;
}

.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 24%;
}

.hero-media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 10, 14, 0.82) 0%, rgba(8, 10, 14, 0.48) 31%, rgba(14, 16, 20, 0.1) 62%, rgba(14, 16, 20, 0.03) 100%),
    linear-gradient(0deg, rgba(14, 16, 20, 0.28), rgba(14, 16, 20, 0.02) 58%);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  padding: 22px 30px;
}

.hero-copy {
  max-width: 470px;
  display: grid;
  align-content: center;
  gap: 7px;
}

.hero-copy img {
  width: 165px;
  max-width: 60vw;
  height: auto;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.38));
}

.hero-copy h2 {
  margin: 0 0 4px;
  font-size: 24px;
  line-height: 0.95;
  letter-spacing: 0.055em;
}

.hero-copy p {
  margin: 0;
  max-width: 450px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  line-height: 1.4;
}

.hero-social {
  display: grid;
  max-width: 430px;
  margin-top: 5px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 7px;
  background: rgba(10, 12, 16, 0.32);
  color: #fff;
  text-decoration: none;
  backdrop-filter: blur(5px);
}

.hero-social strong {
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.07em;
}

.hero-social span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  line-height: 1.35;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(105px, 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);
}

.context-kpi {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  appearance: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.context-kpi:hover {
  border-color: #dfa2a7;
  background: #fffafa;
  box-shadow: var(--shadow), inset 0 3px 0 var(--accent);
  transform: translateY(-1px);
}

.context-kpi:focus-visible {
  outline: 3px solid rgba(197, 32, 44, 0.25);
  outline-offset: 2px;
}

.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;
}

.database-scope {
  display: grid;
  grid-template-columns: minmax(210px, 0.7fr) minmax(430px, 1.35fr) auto;
  align-items: center;
  gap: 14px;
  margin: 12px 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #17191c 0%, #22252a 100%);
  box-shadow: var(--shadow);
}

.database-scope-copy {
  display: grid;
  gap: 2px;
  color: #fff;
}

.database-scope-copy span {
  color: #f05a63;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.database-scope-copy strong {
  font-size: 15px;
  line-height: 1.15;
}

.database-scope-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.database-scope-button {
  min-width: 0;
  min-height: 55px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.database-scope-button strong {
  font-size: 14px;
}

.database-scope-button small {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.68);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.database-scope-button:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.11);
}

.database-scope-button.active {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(197, 32, 44, 0.25);
}

.database-scope-button.active small {
  color: rgba(255, 255, 255, 0.86);
}

.database-scope-sources {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.database-scope-source {
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
  text-align: right;
  text-decoration: none;
}

.database-scope-source.secondary {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 700;
}

.database-scope-source:hover {
  color: #fff;
  text-decoration: underline;
}

body[data-scope="wrc"] .filter-region,
body[data-scope="wrc"] .filter-province,
body[data-scope="wrc"] .filter-championship,
body[data-scope="wrc"] #grt-filter,
body[data-scope="wrc"] .import-disclosure {
  display: none;
}

body[data-scope="wrc"] .toolbar .search-field {
  grid-column: span 7;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.toolbar.simple-filters {
  display: block;
  overflow: visible;
  padding: 0;
}

.filter-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #faf9f5);
  border-radius: var(--radius) var(--radius) 0 0;
}

.filter-intro > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.filter-intro > div > span,
.view-picker-heading span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-intro strong {
  color: var(--ink);
  font-size: 18px;
}

.filter-intro small,
.view-picker-heading small {
  color: var(--muted);
  font-size: 11px;
}

.filter-reset-button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.filter-reset-button:hover {
  border-color: rgba(197, 32, 44, 0.35);
  color: var(--accent);
}

.filter-primary,
.filter-secondary {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
}

.filter-primary {
  padding: 13px 14px;
}

.filter-more {
  border-top: 1px solid var(--line);
}

.filter-more > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.filter-more > summary::-webkit-details-marker {
  display: none;
}

.filter-more > summary::before {
  content: "+";
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ece9e1;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.filter-more[open] > summary::before {
  content: "−";
}

.filter-more > summary > span {
  font-size: 12px;
  font-weight: 900;
}

.filter-more > summary > small {
  flex: 1 1 auto;
  color: var(--muted);
  font-size: 11px;
}

.filter-more > summary > b {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  background: #ece9e1;
  color: var(--muted);
  font-size: 10px;
}

.filter-more.has-active > summary > b {
  background: rgba(197, 32, 44, 0.12);
  color: var(--accent);
}

.filter-secondary {
  padding: 13px 14px 14px;
  border-top: 1px solid var(--line);
  background: #f7f5ef;
}

.filter-secondary .grt-filter-button {
  grid-column: span 2;
  width: 100%;
  height: 40px;
  border: 1px solid rgba(197, 32, 44, 0.35);
  border-radius: 6px;
  background: #fffefa;
  color: var(--accent);
  cursor: pointer;
}

.view-picker-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding: 0 2px;
}

.view-picker-heading > div {
  display: grid;
  gap: 1px;
}

.view-picker-heading strong {
  color: var(--ink);
  font-size: 18px;
}

.import-disclosure {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.import-disclosure > summary {
  padding: 10px 13px;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
}

.import-disclosure[open] > summary {
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.import-disclosure .import-panel {
  margin-top: 0;
  border: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: none;
}

.analysis-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: #17191c;
  color: #fff;
  box-shadow: var(--shadow);
}

.tabs + .analysis-context {
  margin-top: 10px;
}

.analysis-context-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.analysis-context-copy > span {
  color: #ff6c73;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.analysis-context-copy > strong {
  overflow: hidden;
  font-size: 18px;
  line-height: 1.15;
  text-overflow: ellipsis;
}

.analysis-context-copy > small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
}

.analysis-context-tags {
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.analysis-context-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.analysis-context-clear {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 108, 115, 0.55);
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.analysis-context-clear:disabled {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.42);
  cursor: default;
}
.analysis-context-tags span {
  overflow: hidden;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.84);
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-year,
.filter-region,
.filter-province {
  grid-column: span 2;
}

.filter-championship {
  grid-column: span 3;
}

.filter-rally,
.filter-stage {
  grid-column: span 3;
}

.filter-car {
  grid-column: span 3;
}

.toolbar .search-field {
  grid-column: span 4;
  position: relative;
}

.search-suggestions {
  position: absolute;
  z-index: 50;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  overflow: hidden;
  max-height: min(420px, 58vh);
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(15, 18, 20, 0.2);
}

.search-suggestions[hidden] {
  display: none;
}

.lookup-field {
  position: relative;
  min-width: 0;
}

.select-lookup-native {
  display: none !important;
}

.select-lookup-control {
  position: relative;
  min-width: 0;
  width: 100%;
}

.select-lookup-control:focus-within {
  z-index: 90;
}

.select-lookup-input {
  min-width: 0;
  padding-left: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23777b80' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
  background-size: 16px 16px;
  text-overflow: ellipsis;
}

.select-lookup-input:disabled {
  cursor: not-allowed;
  background: #f0eee8;
  color: var(--muted);
}

.lookup-suggestions {
  position: absolute;
  z-index: 70;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  overflow: auto;
  max-height: min(380px, 56vh);
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 20px 52px rgba(15, 18, 20, 0.24);
}

.lookup-suggestions[hidden] {
  display: none;
}

.select-lookup-control.lookup-upward .lookup-suggestions {
  top: auto;
  bottom: calc(100% + 6px);
}

.lookup-option {
  display: grid;
  width: 100%;
  gap: 2px;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.lookup-option:hover,
.lookup-option.active {
  background: #f1eee7;
}

.lookup-option strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lookup-option span,
.lookup-empty {
  color: var(--muted);
  font-size: 11px;
  text-transform: none;
}

.lookup-empty {
  padding: 12px;
  text-align: center;
}

.search-suggestion {
  display: grid;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.search-suggestion:hover,
.search-suggestion.active {
  background: #f4f1eb;
}

.search-suggestion strong {
  overflow: hidden;
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-suggestion small {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-field.searching input {
  padding-right: 36px;
  background-image: radial-gradient(circle at center, transparent 52%, var(--accent) 54%, var(--accent) 64%, transparent 66%);
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 15px 15px;
}

.toolbar .icon-button {
  grid-column: span 1;
  justify-self: stretch;
  width: 100%;
}

.field {
  display: grid;
  gap: 5px;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.field .lookup-option span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  text-transform: none;
}

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);
}

.tc-picker {
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.tc-picker > header,
.tc-picker-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
}

.tc-picker > header > div,
.tc-picker-empty > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.tc-picker > header span,
.tc-picker-empty span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tc-picker > header strong,
.tc-picker-empty strong {
  color: var(--ink);
  font-size: 17px;
}

.tc-picker > header small,
.tc-picker-empty small {
  color: var(--muted);
  font-size: 11px;
}

.tc-picker-empty {
  border-left: 4px solid var(--accent);
}

.tc-button-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 7px;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: #f4f2ed;
}

.tc-button {
  min-width: 0;
  min-height: 82px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 3px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.tc-button:hover {
  border-color: rgba(197, 32, 44, 0.4);
  transform: translateY(-1px);
}

.tc-button.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, #202226, #111214);
  color: #fff;
  box-shadow: inset 4px 0 0 var(--accent);
}

.tc-button strong {
  font-size: 17px;
  line-height: 1;
}

.tc-button span,
.tc-button small {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tc-button span {
  font-size: 11px;
  font-weight: 850;
}

.tc-button small {
  color: var(--muted);
  font-size: 10px;
}

.tc-button.active small {
  color: rgba(255, 255, 255, 0.66);
}

.wide-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.classification-wizard {
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.classification-wizard > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #faf9f5);
}

.classification-wizard > header > div {
  display: grid;
  gap: 2px;
}

.classification-wizard > header span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.classification-wizard > header strong {
  font-size: 18px;
}

.classification-wizard > header small {
  color: var(--muted);
  font-size: 11px;
}

.classification-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  background: #f4f2ed;
}

.classification-step {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-content: start;
  gap: 8px 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.classification-step > b {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e9e5dc;
  color: var(--ink);
  font-size: 14px;
}

.classification-step.active {
  border-color: rgba(197, 32, 44, 0.55);
  box-shadow: inset 0 3px 0 var(--accent);
}

.classification-step:focus-within {
  position: relative;
  z-index: 80;
}

.classification-step.active > b {
  background: var(--accent);
  color: #fff;
}

.classification-step.done > b {
  background: #26745f;
  color: #fff;
}

.classification-step.locked {
  opacity: 0.58;
}

.classification-step > span {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 2px;
}

.classification-step > span strong {
  color: var(--ink);
  font-size: 14px;
}

.classification-step > span small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.classification-step > select,
.classification-step > .select-lookup-control,
.classification-actions {
  grid-column: 1 / -1;
}

.classification-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.classification-actions button {
  min-height: 40px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #17191c;
  color: #fff;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.classification-actions button:last-child {
  background: #fff;
  color: var(--ink);
}

.classification-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.guided-wizard {
  margin-bottom: 14px;
}

.guide-control-slot,
.guided-secondary-action,
.guided-chip-list,
.guided-step-note {
  grid-column: 1 / -1;
}

.guide-control-slot {
  position: relative;
  min-width: 0;
}

.guide-control-slot .field,
.guide-control-slot input,
.guide-control-slot select {
  width: 100%;
  min-width: 0;
}

.classification-step.locked .guide-control-slot {
  pointer-events: none;
}

.classification-step.locked .guide-control-slot input {
  background: #f0eee8;
}

.classification-actions.single-action {
  grid-template-columns: 1fr;
}

.guided-step-note {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}

.guided-secondary-action {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.guided-secondary-action:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.guided-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.guided-chip-list span {
  padding: 5px 7px;
  border-radius: 999px;
  background: #ece8de;
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
}

.select-lookup-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
  padding: 5px 7px 5px 9px;
  border: 1px solid rgba(197, 32, 44, 0.22);
  border-radius: 7px;
  background: rgba(197, 32, 44, 0.06);
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
}

.select-lookup-current[hidden] {
  display: none;
}

.select-lookup-current span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-lookup-current button {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(197, 32, 44, 0.12);
  color: var(--accent);
  font: 900 16px/24px Arial, sans-serif;
  cursor: pointer;
}

.rally-year-picker {
  gap: 7px;
}

.rally-year-picker button {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.rally-year-picker button strong {
  font-size: 12px;
  font-weight: 900;
}

.rally-year-picker button small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.rally-year-picker button:hover,
.rally-year-picker button:focus-visible {
  border-color: var(--accent);
  outline: 2px solid color-mix(in srgb, var(--accent) 22%, transparent);
  outline-offset: 1px;
}

.rally-year-picker button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.rally-year-picker button.active small {
  color: rgba(255, 255, 255, 0.82);
}

.guided-wizard-detail {
  padding: 0 12px 12px;
  border-top: 1px solid var(--line);
  background: #f4f2ed;
}

.guided-wizard-detail .variant-picker {
  margin: 0;
  border-top: 0;
  background: #fff;
}

.guided-result {
  scroll-margin-top: 14px;
}

.view-purpose {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(220px, 0.7fr);
  align-items: center;
  gap: 10px 14px;
  padding: 12px 14px;
  border: 1px solid #c9d9e7;
  border-left: 4px solid #24577d;
  border-radius: var(--radius);
  background: #f3f8fc;
}

.view-purpose > b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #24577d;
  color: #fff;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.view-purpose > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.view-purpose > div strong {
  color: var(--ink);
  font-size: 15px;
}

.view-purpose > div span,
.view-purpose > small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.view-purpose > small {
  padding-left: 14px;
  border-left: 1px solid #c9d9e7;
}

.view-purpose.history-purpose {
  border-color: #dccfb1;
  border-left-color: #8b6424;
  background: #fbf8f0;
}

.view-purpose.history-purpose > b {
  background: #8b6424;
}

.view-purpose.history-purpose > small {
  border-left-color: #dccfb1;
}

.view-purpose.driver-purpose {
  border-color: #c7dcd3;
  border-left-color: #26745f;
  background: #f2f8f5;
}

.view-purpose.driver-purpose > b {
  background: #26745f;
}

.view-purpose.driver-purpose > small {
  border-left-color: #c7dcd3;
}

.comparison-mode-chooser {
  display: grid;
  grid-template-columns: minmax(190px, 0.42fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #17191c;
  box-shadow: var(--shadow);
}

.comparison-mode-chooser > div:first-child {
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 6px 8px;
}

.comparison-mode-chooser > div:first-child span {
  color: #f18b91;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.comparison-mode-chooser > div:first-child strong {
  color: #fff;
  font-size: 20px;
}

.comparison-mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.comparison-mode-options button {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: #25282d;
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.comparison-mode-options button:hover {
  border-color: rgba(255, 255, 255, 0.42);
}

.comparison-mode-options button.active {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 8px 20px rgba(197, 32, 44, 0.24);
}

.comparison-mode-options b {
  font-size: 15px;
}

.comparison-mode-options span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
  line-height: 1.35;
}

.comparison-mode-options button.active span {
  color: rgba(255, 255, 255, 0.85);
}

.driver-profile-wizard .classification-steps {
  grid-template-columns: minmax(0, 1fr);
}

.driver-profile-wizard .classification-step {
  grid-template-columns: 34px minmax(180px, 0.36fr) minmax(260px, 1fr) auto;
  align-items: center;
}

.driver-profile-wizard .guide-control-slot,
.driver-profile-wizard .guided-secondary-action {
  grid-column: auto;
}

.driver-profile-wizard .guided-secondary-action {
  min-height: 42px;
  padding-inline: 14px;
}

.driver-profile-hero {
  display: grid;
  grid-template-columns: minmax(250px, 0.75fr) minmax(0, 1.6fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  box-shadow: var(--shadow);
}

.driver-profile-identity {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 150px;
  padding: 20px;
  background: #17191c;
  color: #fff;
}

.driver-profile-identity > span {
  color: #f18b91;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.driver-profile-identity > strong {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.05;
}

.driver-profile-identity > small {
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
}

.driver-profile-identity > em {
  color: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.driver-profile-identity > a {
  width: fit-content;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.driver-profile-identity > a:hover {
  color: #fff;
}

.driver-profile-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.driver-profile-kpis > div {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
  padding: 16px 12px;
  background: #fff;
  text-align: center;
}

.driver-profile-kpis > .codriver-kpi-link,
.driver-profile-kpis > .driver-kpi-link,
.codriver-drilldown,
.driver-drilldown {
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.codriver-drilldown-context,
.driver-drilldown-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid #efc7ca;
  border-left: 4px solid var(--accent);
  border-radius: 9px;
  background: #fff7f7;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.codriver-drilldown-context button,
.driver-drilldown-context button {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid #e7b7bb;
  border-radius: 7px;
  background: #fff;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
}

.codriver-drilldown-context button:hover,
.codriver-drilldown-context button:focus-visible,
.driver-drilldown-context button:hover,
.driver-drilldown-context button:focus-visible {
  border-color: var(--accent);
  outline: none;
}

@media (max-width: 560px) {
  .codriver-drilldown-context,
  .driver-drilldown-context {
    align-items: stretch;
    flex-direction: column;
  }

  .codriver-drilldown-context button,
  .driver-drilldown-context button {
    width: 100%;
  }
}
#codriver-partners-section,
#codriver-history-section,
#codriver-years-section,
#codriver-wins-section,
#codriver-results-section {
  scroll-margin-top: 118px;
}

#driver-history-section,
#driver-cars-section,
#driver-years-section,
#driver-wins-section,
#driver-results-section {
  scroll-margin-top: 118px;
}

.profile-person-link {
  display: block;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 800;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.profile-person-link:hover,
.profile-person-link:focus-visible {
  color: #a40e1a;
  outline: 2px solid rgba(211, 31, 45, 0.3);
  outline-offset: 2px;
}

.context-link {
  display: inline;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-align: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(197, 32, 44, 0.38);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
  touch-action: manipulation;
}

.context-link:hover,
.context-link:focus-visible {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.context-link:focus-visible {
  outline: 2px solid rgba(197, 32, 44, 0.28);
  outline-offset: 2px;
}

.context-link[aria-busy=true] {
  opacity: 0.58;
  cursor: progress;
}

.crew .context-link,
.hall-name .context-link,
.codriver-result-crew .context-link {
  overflow: hidden;
  display: inline-block;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

@media (hover: hover) {
  .driver-profile-kpis > .codriver-kpi-link:hover,
  .driver-profile-kpis > .driver-kpi-link:hover {
    background: #fff7f7;
    box-shadow: inset 0 -3px 0 var(--accent);
  }

  .codriver-drilldown:hover,
  .driver-drilldown:not(tr):hover {
    border-color: #e4a9ae;
    background: #fffafa;
    box-shadow: 0 8px 20px rgba(24, 26, 29, 0.08);
    transform: translateY(-1px);
  }

  tr.driver-drilldown:hover td {
    background: #fff7f7;
  }
}

.driver-profile-kpis > .codriver-kpi-link:focus-visible,
.driver-profile-kpis > .driver-kpi-link:focus-visible,
.codriver-drilldown:focus-visible,
.driver-drilldown:focus-visible {
  position: relative;
  z-index: 2;
  outline: 3px solid rgba(211, 31, 45, 0.32);
  outline-offset: -3px;
}
.driver-profile-kpis span,
.driver-profile-kpis small {
  color: var(--muted);
  font-size: 10px;
}

.driver-profile-kpis span {
  font-weight: 900;
  text-transform: uppercase;
}

.driver-profile-kpis strong {
  color: var(--ink);
  font-size: clamp(22px, 2.2vw, 32px);
}

.driver-data-coverage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid #efc7ca;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: #fff7f7;
  box-shadow: var(--shadow);
}

.driver-data-coverage > div {
  display: grid;
  gap: 3px;
}

.driver-data-coverage span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.driver-data-coverage strong {
  color: var(--ink);
  font-size: 17px;
}

.driver-data-coverage small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.driver-data-coverage > a {
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid #e7b7bb;
  border-radius: 7px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
}

.driver-data-coverage > a:hover {
  border-color: var(--accent);
  background: #fff;
}

.driver-year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 8px;
  padding: 12px;
}

.driver-year-grid article {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--warm);
}

.driver-year-grid article > strong {
  color: var(--ink);
  font-size: 22px;
}

.driver-year-grid article > span,
.driver-year-grid article > small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.driver-year-grid article > b {
  color: var(--accent);
  font-size: 13px;
}

.driver-win-list {
  display: grid;
  gap: 7px;
  padding: 12px;
}

.driver-win-list article {
  min-width: 0;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--warm);
}

.driver-win-list article > span {
  color: var(--accent);
  font-size: 15px;
  font-weight: 950;
}

.driver-win-list article > div,
.driver-win-list article > p {
  min-width: 0;
  display: grid;
  gap: 2px;
  margin: 0;
}

.driver-win-list article > div > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.driver-win-list small {
  color: var(--muted);
  font-size: 11px;
}

.driver-win-list article > p {
  justify-items: end;
}

.driver-win-list article > p > strong {
  font-size: 18px;
}

#classification-final,
#classification-evolution {
  scroll-margin-top: 14px;
}

.compare-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.compare-position-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #f4f2ed;
}

.compare-position-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.compare-position-card.grt-card {
  border-color: rgba(197, 32, 44, 0.35);
  box-shadow: inset 3px 0 0 var(--accent);
}

.compare-position-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.compare-position-card header > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.compare-position-card header strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-position-card header > div > span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-position-card header p {
  display: grid;
  justify-items: end;
  gap: 2px;
  flex: 0 0 auto;
  margin: 0;
  text-align: right;
}

.compare-position-card header p span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.compare-position-card header p b {
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.compare-position-card footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 5px 12px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.compare-classification-source {
  margin: 0;
  padding: 0 12px 10px;
  background: #f4f2ed;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.compare-tc-position {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  margin-right: 7px;
  padding: 4px 6px;
  border-radius: 999px;
  background: #ede9df;
  color: var(--ink);
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
}

.historical-compare-controls {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 46px minmax(240px, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #faf8f2);
}

.versus-mark {
  display: grid;
  place-items: center;
  height: 40px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 950;
}

.primary-action {
  min-height: 40px;
  padding: 8px 15px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.primary-action:disabled {
  opacity: 0.62;
  cursor: wait;
}

.compare-lookup-slot,
.record-lookup-slot {
  position: relative;
  min-width: 0;
}

.compare-lookup-slot .lookup-clear,
.record-lookup-slot .lookup-clear {
  position: absolute;
  right: 7px;
  bottom: 6px;
}

.lookup-clear {
  z-index: 2;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #e9e5dc;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.compare-lookup-slot input,
.record-lookup-slot input {
  padding-right: 40px;
}

.record-lookup-slot {
  grid-column: 1 / -1;
  max-width: 680px;
}

.record-lookup-slot .lookup-suggestions {
  min-width: min(620px, calc(100vw - 60px));
}

.variant-help {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.compare-placeholder,
.loading-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  gap: 7px;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.compare-placeholder strong {
  color: var(--ink);
  font-size: 20px;
}

.compare-placeholder.compact {
  min-height: 100px;
  padding: 22px;
}

.inline-alert {
  margin: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(197, 32, 44, 0.3);
  border-radius: 7px;
  background: rgba(197, 32, 44, 0.07);
  color: var(--accent);
  font-weight: 800;
}

.duel-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 0.55fr) minmax(0, 1fr);
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.duel-driver,
.duel-score {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 122px;
  padding: 18px;
  background: #fff;
}

.duel-driver.second {
  text-align: right;
}

.duel-driver > span,
.duel-score > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.duel-driver > strong {
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(18px, 2vw, 27px);
  line-height: 1.08;
  text-overflow: ellipsis;
}

.duel-driver > small,
.duel-score > small {
  color: var(--muted);
  font-size: 12px;
}

.duel-driver > em {
  color: var(--ink-soft);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.duel-score {
  justify-items: center;
  background: #17191c;
  color: #fff;
  text-align: center;
}

.duel-score > span,
.duel-score > small {
  color: rgba(255, 255, 255, 0.68);
}

.duel-score > strong {
  color: #fff;
  font-size: clamp(28px, 4vw, 43px);
  line-height: 1;
}

.duel-score i {
  color: rgba(255, 255, 255, 0.4);
  font-style: normal;
}
.duel-score.duel-verdict > strong {
  max-width: 100%;
  font-size: clamp(20px, 2.7vw, 32px);
  overflow-wrap: anywhere;
}

.duel-score.duel-verdict.has-winner > span {
  color: #ffb41f;
}

.duel-score.duel-verdict > i {
  max-width: 220px;
  font-size: 10px;
  line-height: 1.25;
}

.duel-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  background: #f4f2ed;
}

.pilot-duel-kpis {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.driver-car-kpis {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.car-duel-kpis {
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
}

.driver-car-table-wrap table {
  min-width: 820px;
}

.duel-kpis > div {
  display: grid;
  align-content: center;
  min-height: 74px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.duel-kpis span,
.duel-kpis small {
  color: var(--muted);
  font-size: 11px;
}

.duel-kpis strong {
  color: var(--ink);
  font-size: 21px;
}

.car-category-comparison {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  padding: 0 16px 16px;
}

.car-category-comparison > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.car-category-comparison > div > strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.car-category-comparison span {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 900;
}

.car-category-comparison small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.car-mobile-list {
  display: none;
}

.car-mobile-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.car-mobile-card > header {
  display: grid;
  gap: 2px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
}

.car-mobile-card > header span {
  overflow: hidden;
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.car-mobile-card > header strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.car-mobile-card > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.car-mobile-card > div > span {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 9px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.car-mobile-card > div > span:nth-child(2n) {
  border-right: 0;
}

.car-mobile-card > div > span:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.car-mobile-card small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.car-mobile-card > div strong {
  color: var(--ink);
  font-size: 16px;
}

.car-rally-card > footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  background: #f7f6f2;
}

.car-rally-card > footer > span,
.car-rally-card > footer > small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.car-rally-card > footer > strong {
  grid-row: span 2;
  align-self: center;
}

.car-mobile-limit {
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  background: #f7f6f2;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}

.pilot-win-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.pilot-win-column {
  min-width: 0;
  padding: 14px;
  background: #fff;
}

.pilot-win-column > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
}

.pilot-win-column.second > header {
  border-color: var(--accent-2);
}

.pilot-win-column > header div {
  min-width: 0;
  display: grid;
}

.pilot-win-column > header span,
.pilot-win-row span {
  color: var(--muted);
  font-size: 11px;
}

.pilot-win-column > header > div > span {
  color: var(--accent);
  font-weight: 900;
  text-transform: uppercase;
}

.pilot-win-column.second > header > div > span {
  color: var(--accent-2);
}

.pilot-win-column > header strong {
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pilot-win-column > header small {
  color: var(--muted);
  font-size: 10px;
}

.pilot-win-column > header b {
  min-width: 36px;
  color: var(--ink);
  font-size: 28px;
  text-align: right;
}

.pilot-win-rows {
  display: grid;
  gap: 7px;
}

.category-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.category-breakdown > span {
  min-width: 0;
  display: grid;
  gap: 1px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f5f0;
}

.category-breakdown strong {
  font-size: 10px;
}

.category-breakdown small {
  color: var(--muted);
  font-size: 9px;
}

.pilot-win-group-label {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pilot-win-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--warm);
}

.pilot-win-row > div,
.pilot-win-row > p {
  min-width: 0;
  display: grid;
  margin: 0;
}

.pilot-win-row > div > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pilot-win-row > p {
  justify-items: end;
}

.pilot-win-row > p > strong {
  font-size: 20px;
}

.category-result-badges {
  display: flex !important;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.category-result-badge {
  display: inline-flex;
  width: max-content;
  padding: 2px 5px;
  border-radius: 999px;
  background: #e7eef7;
  color: #064f99;
  font-size: 9px;
  line-height: 1.2;
}

.category-result-badge.absolute {
  background: #ece8df;
  color: var(--ink);
}

.category-cell-note {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed #bfd0e2;
  color: #064f99 !important;
  font-weight: 750;
  white-space: normal;
}

.empty-state.compact {
  min-height: 68px;
  padding: 18px 10px;
}

.subsection-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 16px 4px;
}

.subsection-heading div {
  display: grid;
}

.subsection-heading span,
.subsection-heading small {
  color: var(--muted);
  font-size: 11px;
}

.subsection-heading span {
  color: var(--accent);
  font-weight: 900;
  text-transform: uppercase;
}

.subsection-heading strong {
  font-size: 17px;
}

.timeline-block {
  min-width: 0;
}

.timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 8px 16px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.timeline-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.duel-color {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--accent);
}

.duel-color.second {
  background: var(--accent-2);
}

.timeline-scroll {
  overflow-x: auto;
  padding: 12px 16px 18px;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.duel-timeline {
  min-width: max(100%, calc(var(--timeline-years) * 104px));
  display: grid;
  grid-template-columns: repeat(var(--timeline-years), minmax(92px, 1fr));
  align-items: end;
  gap: 6px;
  min-height: 250px;
  padding: 18px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #faf8f2);
}

.timeline-year {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 0;
}

.timeline-bars {
  width: 62px;
  height: 150px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 5px;
  padding-bottom: 1px;
  border-bottom: 1px solid #bdb7ab;
}

.timeline-bar {
  width: 25px;
  height: var(--bar);
  min-height: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 3px;
  border-radius: 5px 5px 2px 2px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
}

.timeline-bar.second {
  background: var(--accent-2);
}

.timeline-label {
  font-size: 13px;
}

.timeline-year > span,
.timeline-year > small {
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.hall-list {
  max-height: min(70vh, 720px);
  overflow: auto;
  display: grid;
  gap: 7px;
  padding: 12px;
  scrollbar-gutter: stable;
}

.hall-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 62px 62px;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.hall-podium {
  background: linear-gradient(90deg, rgba(197, 32, 44, 0.08), #fff);
}

.hall-position {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--chip);
  font-weight: 950;
}

.hall-1 .hall-position {
  background: var(--accent);
  color: #fff;
}

.hall-name,
.hall-metric {
  min-width: 0;
  display: grid;
}

.hall-name strong,
.hall-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hall-name span,
.hall-metric span {
  color: var(--muted);
  font-size: 10px;
}

.hall-metric {
  text-align: right;
}

.hall-metric strong {
  font-size: 18px;
}

.record-timeline {
  display: grid;
  gap: 7px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #faf8f3;
}

.record-timeline-row {
  display: grid;
  grid-template-columns: 44px minmax(120px, 1fr) 76px;
  align-items: center;
  gap: 9px;
}

.record-timeline-row > strong {
  font-size: 12px;
}

.record-timeline-row > div:last-child {
  display: grid;
  text-align: right;
}

.record-timeline-row small {
  color: var(--muted);
  font-size: 10px;
}

.record-timeline-track {
  position: relative;
  height: 3px;
  border-radius: 999px;
  background: #ded9cf;
}

.record-timeline-track span {
  position: absolute;
  top: 50%;
  left: clamp(0%, var(--point), 100%);
  width: 11px;
  height: 11px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  transform: translate(-50%, -50%);
}

.cell-note {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  white-space: normal;
}

.winner-cell {
  background: rgba(6, 79, 153, 0.07);
  box-shadow: inset 3px 0 0 var(--accent-2);
}

.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;
}

.rally-compare-controls {
  align-items: end;
  grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
}

.rally-year-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: end;
}

.rally-year-chips span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.rally-compare-list {
  display: grid;
  gap: 14px;
  padding: 12px;
  background: #f4f2ed;
}

.rally-final-section { padding: 13px; background: #f4f2ed; border-bottom: 1px solid var(--line); }
.rally-final-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 0 2px 11px; }
.rally-final-section-heading h3 { margin: 0; font-size: 19px; }
.rally-final-section-heading > span { color: var(--muted); font-size: 12px; font-weight: 800; }
.rally-final-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 12px; }
.rally-final-card { overflow: hidden; display: grid; align-content: start; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.rally-final-card > header { display: flex; justify-content: space-between; gap: 9px; padding: 9px 12px; background: #17191c; color: #fff; }
.rally-final-card > header > div { min-width: 0; display: grid; gap: 2px; }
.rally-final-card > header strong { font-size: 18px; }
.rally-final-card > header span { overflow: hidden; color: rgba(255,255,255,.72); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.rally-final-status { min-height: 0; margin: 0; padding: 7px 12px; color: var(--muted); font-size: 11px; font-weight: 750; background: var(--panel-soft); }
.rally-final-podium { display: grid; gap: 0; padding: 8px; }
.rally-final-podium-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; align-items: center; min-height: 48px; padding: 6px; border-bottom: 1px solid var(--line); }
.rally-final-podium-row:last-child { border-bottom: 0; }
.rally-final-podium-row > div { min-width: 0; display: grid; gap: 2px; }
.rally-final-podium-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.rally-final-podium-row small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 700; }
.rally-final-podium-time { text-align: right; }
.rally-final-podium-time small { color: var(--accent); }
.rally-final-details { border-top: 1px solid var(--line); }
.rally-final-details summary { cursor: pointer; padding: 10px 12px; color: var(--ink); font-size: 13px; font-weight: 900; list-style-position: inside; }
.rally-final-table { width: 100%; min-width: 500px; border-collapse: collapse; font-size: 12px; }
.rally-final-table th, .rally-final-table td { padding: 7px 8px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.rally-final-table th { color: var(--muted); font-size: 10px; letter-spacing: .03em; text-transform: uppercase; }
.rally-final-table small { display: block; margin-top: 2px; color: var(--muted); font-weight: 650; }
.rally-final-card > footer { min-height: 38px; display: flex; align-items: center; padding: 6px 12px; border-top: 1px solid var(--line); background: #fff; }
.rally-final-card > footer .context-link { color: var(--accent); font-size: 12px; font-weight: 900; }
.rally-no-times { color: var(--muted); font-size: 12px; font-weight: 750; }

.rally-stage-card {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.rally-stage-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}

.rally-stage-card-header h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.15;
}

.rally-stage-card-header > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.rally-stage-card-meta {
  flex: 0 1 440px;
  display: grid;
  justify-items: end;
  gap: 7px;
}

.rally-stage-distance {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.rally-stage-records {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.rally-stage-record {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 1px 8px;
  min-width: 205px;
  padding: 7px 9px;
  color: #fff;
  background: #17191c;
  border-radius: var(--radius);
}

.rally-stage-record span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rally-stage-record strong {
  color: #fff;
  font-size: 16px;
}

.rally-stage-record small {
  grid-column: 1 / -1;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.76);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rally-year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1px;
  background: var(--line);
}

.rally-year-column {
  min-width: 0;
  background: #fff;
}

.rally-year-header {
  min-height: 58px;
  display: grid;
  gap: 2px;
  padding: 11px 12px;
  background: #17191c;
  color: #fff;
}

.rally-year-header strong,
.rally-year-header span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rally-year-header strong {
  font-size: 18px;
}

.rally-year-header span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.rally-stage-result {
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.rally-stage-result:last-child {
  border-bottom: 0;
}

.rally-stage-title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.rally-stage-title span {
  padding: 4px 7px;
  background: var(--chip);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
}

.rally-stage-title strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rally-stage-title em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.rally-top-list {
  display: grid;
  gap: 6px;
}

.rally-top-row {
  min-height: 44px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--panel-soft);
  border: 1px solid transparent;
  border-radius: 6px;
}

.rally-top-row .crew strong,
.rally-top-row .crew span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rally-top-row .crew span {
  font-size: 11px;
}

.rally-top-row .crew .rally-car-line {
  display: block;
  margin-top: 2px;
  overflow: visible;
  color: #444a52;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.2;
  text-overflow: clip;
  white-space: normal;
}

.rally-top-row .mini-stat {
  min-width: 62px;
}

.rally-top-row .mini-stat > span {
  display: block;
}

.rally-best-tc {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.rally-top-row.grt-row,
.rally-top-row.rally-grt-extra {
  background: linear-gradient(90deg, rgba(197, 32, 44, 0.12), rgba(255, 254, 250, 0.98));
  border-color: rgba(197, 32, 44, 0.34);
  box-shadow: inset 4px 0 0 var(--accent);
}

.rally-top-separator {
  margin: 3px 0 0;
  padding-top: 6px;
  border-top: 1px dashed rgba(197, 32, 44, 0.35);
  color: var(--accent);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.rally-empty {
  margin: 10px;
  padding: 18px 10px;
}

.panel {
  min-width: 0;
  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;
}

.surface-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 20px;
  padding: 3px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.surface-badge-tarmac { color: #2e7d4f; background: #e7f5eb; }
.surface-badge-gravel { color: #8b5a16; background: #fff0d8; }
.surface-badge-mixed { color: #286898; background: #e4f2fb; }
.surface-badge-unknown { color: #646971; background: #f1f2f4; }
.table-wrap {
  width: 100%;
  overflow: auto;
  max-height: min(72vh, 780px);
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
  -webkit-overflow-scrolling: touch;
}

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;
}

.matrix-mobile-label,
.mobile-cell-label {
  display: none;
}

.stage-matrix-table .crew strong {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 7px;
  align-items: baseline;
  white-space: normal;
  line-height: 1.25;
}

.stage-matrix-table .crew span,
.pilot-compare-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}

.stage-matrix-table th,
.stage-matrix-table td,
.pilot-compare-table th,
.pilot-compare-table td {
  min-width: 180px;
}

.stage-matrix-table .rank-cell,
.pilot-compare-table .tc-cell {
  min-width: 74px;
}

.pilot-result-cell {
  line-height: 1.35;
}

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;
}

.tyre-logos {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  vertical-align: middle;
}

.tyre-logos .tyre-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 15px;
  padding: 1px 4px 0;
  overflow: hidden;
  border: 1px solid rgba(20, 22, 25, 0.16);
  border-radius: 3px;
  background: #fff;
  color: #16181b;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 7px;
  font-style: italic;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(20, 22, 25, 0.08);
}

.tyre-logos .tyre-pirelli { background: #ffd500; color: #d71920; border-color: #e1bc00; }
.tyre-logos .tyre-michelin { color: #07549a; border-color: #a7c4dc; }
.tyre-logos .tyre-bfgoodrich { color: #e21f2f; border-color: #96aac1; }
.tyre-logos .tyre-bridgestone { color: #151515; border-bottom-color: #e31937; }
.tyre-logos .tyre-mrf { background: #d81920; color: #fff; border-color: #b40e14; }
.tyre-logos .tyre-hankook { color: #161616; border-left: 4px solid #ef6c00; }
.tyre-logos .tyre-kumho { color: #c7192c; border-color: #d9a3aa; }
.tyre-logos .tyre-yokohama { color: #111; border-left: 4px solid #d71920; }
.tyre-logos .tyre-dmack { background: #17191c; color: #fff; border-bottom-color: #d71920; }
.tyre-logos .tyre-fedima { color: #d71920; border-color: #d8a3aa; }
.tyre-logos .tyre-nankang { color: #07549a; border-bottom-color: #d71920; }
.tyre-logos .tyre-toyo { color: #07549a; border-bottom-color: #d71920; }
.tyre-logos .tyre-hoosier { color: #5c2d91; border-color: #bba4d1; }
.tyre-logos .tyre-dunlop { background: #ffe000; color: #111; border-color: #e0c400; }
.tyre-logos .tyre-cooper { color: #164477; border-color: #9bb1c7; }
.tyre-logos .tyre-continental { background: #f5c400; color: #111; border-color: #d3a900; }
.tyre-logos .tyre-goodyear { background: #11417d; color: #ffd23f; border-color: #0d3260; }
.tyre-logos .tyre-kleber,
.tyre-logos .tyre-mabor,
.tyre-logos .tyre-camac,
.tyre-logos .tyre-nokian { color: #07549a; border-color: #9bbad5; }
.tyre-logos .tyre-silverstone,
.tyre-logos .tyre-advan { color: #111; border-left: 4px solid #d71920; }
.tyre-logos .tyre-barum { background: #f4c400; color: #123c70; border-color: #d2aa00; }
.tyre-logos .tyre-firestone,
.tyre-logos .tyre-uniroyal,
.tyre-logos .tyre-lassa { color: #d71920; border-color: #d8a3aa; }
.tyre-logos .tyre-falken { color: #126b8a; border-bottom-color: #ef2b37; }
.tyre-logos .tyre-mixed { color: #555; border-style: dashed; }
.tyre-logos .tyre-maxsport,
.tyre-logos .tyre-matador,
.tyre-logos .tyre-avon,
.tyre-logos .tyre-other { color: #333; border-color: #bbb; }

.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;
}

.panel > .summary-list {
  max-height: min(68vh, 720px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.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;
}

.scratch-scope {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 12px 12px 0;
}

.scratch-scope-button {
  min-height: 36px;
  padding: 8px 10px;
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.scratch-scope-button.active {
  color: #fff;
  background: #17191c;
  border-color: #17191c;
}

.scratch-scope-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.scratch-ranking-list {
  padding-top: 8px;
}

.scratch-total {
  min-width: 54px;
  text-align: right;
}

.scratch-total strong,
.scratch-total span {
  display: block;
}

.scratch-total strong {
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
}

.scratch-total span {
  margin-top: 3px;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.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);
  }

  .home-social-callout {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.55fr);
  }

  .home-social-features {
    display: none;
  }

  .split-section,
  .dossier-section {
    grid-template-columns: 1fr;
  }

  .dossier-section img {
    order: 2;
  }

  .stats-band {
    grid-template-columns: 1fr;
  }

  .sponsor-grid {
    grid-template-columns: repeat(3, 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) {
  .view-purpose {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 11px;
  }

  .view-purpose > b {
    justify-self: start;
  }

  .view-purpose > small {
    padding: 7px 0 0;
    border-top: 1px solid #c9d9e7;
    border-left: 0;
  }

  .view-purpose.history-purpose > small {
    border-top-color: #dccfb1;
  }

  .view-purpose.driver-purpose > small {
    border-top-color: #c7dcd3;
  }

  .comparison-mode-chooser {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }

  .comparison-mode-chooser > div:first-child {
    padding: 4px 2px;
  }

  .comparison-mode-options {
    grid-template-columns: 1fr;
  }

  .comparison-mode-options button {
    min-height: 64px;
    padding: 10px 12px;
  }

  .driver-profile-wizard .classification-step {
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: start;
  }

  .driver-profile-wizard .guide-control-slot,
  .driver-profile-wizard .guided-secondary-action {
    grid-column: 1 / -1;
  }

  .driver-profile-hero {
    grid-template-columns: 1fr;
  }

  .driver-profile-identity {
    min-height: 126px;
    padding: 16px;
  }

  .driver-profile-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .driver-profile-kpis > div:last-child {
    grid-column: 1 / -1;
  }

  .driver-data-coverage {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .driver-data-coverage > a {
    width: 100%;
    text-align: center;
  }

  .driver-year-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 9px;
  }

  .driver-win-list {
    padding: 9px;
  }

  .driver-win-list article {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 9px;
  }

  .database-scope {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 11px;
  }

  .database-scope-actions {
    grid-template-columns: 1fr 1fr;
  }

  .database-scope-button {
    min-height: 60px;
    padding: 8px 9px;
  }

  .database-scope-button small {
    white-space: normal;
  }

  .database-scope-sources {
    justify-items: start;
  }

  .database-scope-source {
    text-align: left;
  }
  .classification-wizard > header {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .classification-steps {
    grid-template-columns: 1fr;
  }

  .overall-table {
    min-width: 0;
    display: block;
  }

  .overall-table thead {
    display: none;
  }

  .overall-table tbody {
    display: grid;
    gap: 8px;
    padding: 8px;
    background: #f4f2ed;
  }

  .overall-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .overall-table td {
    min-width: 0;
    display: grid;
    gap: 2px;
    padding: 0;
    border: 0;
    text-align: left;
    white-space: normal;
  }

  .overall-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .overall-table td:nth-child(3),
  .overall-table td:nth-child(4) {
    grid-column: 1 / -1;
  }

  .filter-intro,
  .view-picker-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .filter-intro strong,
  .view-picker-heading strong {
    font-size: 16px;
  }

  .filter-primary,
  .filter-secondary {
    grid-template-columns: 1fr;
  }

  .filter-primary > *,
  .filter-secondary > * {
    grid-column: 1 / -1;
  }

  .filter-more > summary > small {
    display: none;
  }

  .analysis-context {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
    padding: 11px 12px;
  }

  .analysis-context-copy > strong {
    font-size: 16px;
  }

  .analysis-context-actions {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
  }
  .analysis-context-tags {
    justify-content: flex-start;
  }

  .guide-topbar {
    min-height: 62px;
    gap: 8px;
    padding: 8px 10px;
  }

  .guide-brand img {
    width: 132px;
    height: 40px;
  }

  .guide-nav-actions {
    flex-wrap: nowrap;
    gap: 5px;
  }

  .guide-nav-link {
    min-height: 36px;
    padding: 7px 8px;
    font-size: 11px;
  }

  .guide-main {
    padding: 12px 12px 40px;
  }

  .guide-hero {
    min-height: 520px;
  }

  .guide-hero-picture img {
    object-position: center center;
    transform: scale(1.12) translateX(4%);
  }

  .guide-hero-shade {
    background: linear-gradient(180deg, rgba(8, 10, 14, 0.34), rgba(8, 10, 14, 0.9) 72%);
  }

  .guide-hero-content {
    padding: 24px 20px;
  }

  .guide-hero-logo {
    width: 220px;
    margin-bottom: 18px;
  }

  .guide-hero h1 {
    font-size: 40px;
  }

  .guide-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .guide-steps,
  .guide-feature-grid,
  .guide-glossary,
  .guide-glossary dl {
    grid-template-columns: 1fr;
  }

  .guide-step,
  .guide-feature-card {
    min-height: 0;
  }

  .guide-glossary {
    gap: 18px;
    padding: 22px;
  }

  .guide-tip,
  .guide-footer-cta {
    align-items: flex-start;
    flex-direction: column;
  }

  .guide-footer-cta .guide-actions {
    flex: 1 1 100%;
  }

  .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: center center;
  }

  .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-inline: auto;
    padding: 110px 0 42px;
  }

  .home-hero-logo {
    width: 235px;
    margin-bottom: 12px;
  }

  .home-hero-copy {
    gap: 7px;
    margin-bottom: 18px;
  }

  .home-hero-description {
    font-size: 15px;
    line-height: 1.4;
  }

  .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-social-callout {
    width: calc(100% - 24px);
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 18px;
  }

  .home-social-link {
    min-height: 70px;
  }

  .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-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sponsor-logo {
    min-height: 88px;
    padding: 8px;
  }

  .sponsor-logo img,
  .sponsor-logo-wide img {
    max-height: 76px;
  }

  .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: repeat(2, minmax(0, 1fr));
  }

  .top-actions .source-pill {
    grid-column: 1 / -1;
  }

  .top-link {
    justify-content: center;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .team-hero {
    min-height: 260px;
  }

  .hero-photo {
    object-position: center center;
    transform: scale(1.14) translateX(6%);
  }

  .hero-media {
    background:
      linear-gradient(180deg, rgba(8, 10, 14, 0.08) 0%, rgba(8, 10, 14, 0.18) 42%, rgba(8, 10, 14, 0.9) 100%);
  }

  .hero-content {
    align-items: end;
    padding: 18px;
  }

  .hero-copy {
    max-width: 100%;
    gap: 5px;
  }

  .hero-copy img {
    width: 145px;
  }

  .hero-copy h2 {
    font-size: 20px;
  }

  .hero-copy p {
    font-size: 14px;
  }

  .hero-social {
    max-width: 100%;
    padding: 7px 9px;
  }

  .hero-social span {
    font-size: 10px;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .toolbar > * {
    grid-column: 1 / -1;
  }

  .stage-table-wrap {
    overflow-x: auto;
  }

  .stage-times-table {
    min-width: 760px;
    table-layout: auto;
  }

  .tc-picker > header,
  .tc-picker-empty {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .tc-button-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stage-times-table.stage-scoped {
    min-width: 0;
    display: block;
  }

  .stage-times-table.stage-scoped thead {
    display: none;
  }

  .stage-times-table.stage-scoped tbody {
    display: grid;
    gap: 8px;
    padding: 8px;
    background: #f4f2ed;
  }

  .stage-times-table.stage-scoped tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .stage-times-table.stage-scoped td {
    min-width: 0;
    display: grid;
    gap: 2px;
    padding: 0;
    border: 0;
    text-align: left;
    white-space: normal;
  }

  .stage-times-table.stage-scoped td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .stage-times-table.stage-scoped .team-cell,
  .stage-times-table.stage-scoped .car-cell {
    grid-column: 1 / -1;
  }

  .stage-matrix-wrap,
  .pilot-compare-wrap {
    overflow: visible;
    max-height: none;
    scrollbar-gutter: auto;
  }

  .stage-matrix-table,
  .pilot-compare-table {
    min-width: 0;
    display: block;
  }

  .stage-matrix-table thead,
  .pilot-compare-table thead {
    display: none;
  }

  .stage-matrix-table tbody,
  .stage-matrix-table tr,
  .stage-matrix-table td,
  .pilot-compare-table tbody,
  .pilot-compare-table tr,
  .pilot-compare-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .stage-matrix-table tr,
  .pilot-compare-table tr {
    margin: 0;
    padding: 10px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
  }

  .stage-matrix-table td,
  .pilot-compare-table td {
    padding: 8px 0;
    border-bottom: 0;
    white-space: normal;
  }

  .stage-matrix-table .rank-cell,
  .pilot-compare-table .tc-cell {
    padding-bottom: 6px;
  }

  .stage-matrix-table .stage-matrix-cell,
  .pilot-compare-table .scratch-cell,
  .pilot-compare-table .stage-name-cell,
  .pilot-compare-table .pilot-result-cell {
    margin-top: 8px;
    padding: 10px;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }

  .stage-matrix-table .stage-matrix-cell.grt-cell,
  .pilot-compare-table .pilot-result-cell.grt-cell {
    background: linear-gradient(90deg, rgba(197, 32, 44, 0.12), rgba(255, 254, 250, 0.98));
    border-color: rgba(197, 32, 44, 0.34);
  }

  .matrix-mobile-label,
  .mobile-cell-label {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.25;
    text-transform: uppercase;
  }

  .stage-matrix-table .matrix-crew {
    gap: 4px;
  }

  .stage-matrix-table .matrix-crew strong {
    display: grid;
    gap: 3px;
    font-size: 13px;
  }

  .matrix-crew .time {
    font-size: 15px;
  }

  .matrix-crew .driver-name {
    color: var(--ink);
    overflow-wrap: anywhere;
  }

  .import-panel,
  .import-form {
    grid-template-columns: 1fr;
  }

  .compare-controls {
    grid-template-columns: 1fr;
  }

  .compare-position-summary {
    grid-template-columns: 1fr;
  }

  .historical-compare-controls {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .versus-mark {
    height: 22px;
  }

  .primary-action {
    width: 100%;
  }

  .record-lookup-slot,
  .record-lookup-slot .lookup-suggestions {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .duel-summary {
    grid-template-columns: 1fr;
  }

  .duel-driver,
  .duel-driver.second {
    min-height: 92px;
    padding: 14px;
    text-align: left;
  }

  .duel-score {
    min-height: 104px;
    order: 3;
  }

  .duel-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pilot-win-grid {
    grid-template-columns: 1fr;
  }

  .pilot-win-column {
    padding: 11px;
  }

  .pilot-win-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .pilot-win-row > p {
    grid-auto-flow: column;
    justify-content: start;
    justify-items: start;
    align-items: baseline;
    gap: 4px;
  }

  .pilot-win-row > p span {
    text-align: left;
    white-space: normal;
  }

  .category-breakdown {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-breakdown > span {
    width: 100%;
  }

  .subsection-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .timeline-scroll {
    padding-inline: 10px;
  }

  .hall-row {
    grid-template-columns: 32px minmax(0, 1fr) 54px 54px;
    gap: 7px;
    padding-inline: 8px;
  }

  .hall-metric strong {
    font-size: 16px;
  }

  .history-table-wrap {
    max-height: none;
    overscroll-behavior-y: auto;
    touch-action: pan-x pan-y;
  }

  .history-table {
    min-width: 820px;
  }

  .rally-compare-controls {
    grid-template-columns: 1fr;
  }

  .rally-year-chips {
    align-self: stretch;
  }

  .rally-year-chips span {
    flex: 1 1 130px;
    justify-content: center;
  }

  .rally-compare-list {
    padding: 8px;
  }

  .rally-stage-card-header {
    flex-direction: column;
    gap: 6px;
  }

  .rally-stage-card-meta {
    width: 100%;
    flex-basis: auto;
    justify-items: stretch;
  }

  .rally-stage-records {
    display: grid;
    justify-content: stretch;
  }

  .rally-stage-record {
    min-width: 0;
  }

  .rally-stage-card-header > span {
    white-space: normal;
  }

  .rally-year-grid {
    grid-template-columns: 1fr;
  }

  .rally-year-picker button {
    flex: 1 1 calc(33.333% - 7px);
    justify-content: center;
  }

  .rally-year-header strong,
  .rally-year-header span,
  .rally-stage-title strong,
  .rally-top-row .crew strong,
  .rally-top-row .crew span {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .rally-stage-title {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .rally-stage-title em {
    grid-column: 2;
  }

  .rally-top-row {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .rally-top-row .mini-stat {
    grid-column: 2;
    min-width: 0;
    text-align: left;
  }

  .variant-picker-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .variant-picker-title strong {
    text-align: left;
  }

  .icon-button {
    width: 100%;
  }

  .tabs {
    position: static;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
    gap: 5px;
    padding-top: 7px;
    background: rgba(239, 239, 236, 0.96);
    backdrop-filter: blur(9px);
  }

  .tab {
    min-width: 0;
    padding: 0 5px;
    font-size: 11px;
  }

  .surface-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 20px;
  padding: 3px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.surface-badge-tarmac { color: #2e7d4f; background: #e7f5eb; }
.surface-badge-gravel { color: #8b5a16; background: #fff0d8; }
.surface-badge-mixed { color: #286898; background: #e4f2fb; }
.surface-badge-unknown { color: #646971; background: #f1f2f4; }
.table-wrap {
    max-height: none;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: auto;
    scrollbar-gutter: auto;
    touch-action: pan-x pan-y;
  }

  .panel > .summary-list {
    max-height: none;
    overflow: visible;
    overscroll-behavior: auto;
  }
}

@media (max-width: 460px) {
  .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .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%;
  }

  .sponsor-grid {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .panel-header {
    flex-direction: column;
  }

  .duel-kpis {
    grid-template-columns: 1fr;
  }

  .driver-profile-kpis,
  .driver-year-grid {
    grid-template-columns: 1fr;
  }

  .driver-profile-kpis > div:last-child {
    grid-column: auto;
  }

  .hall-row {
    grid-template-columns: 30px minmax(0, 1fr) 48px;
  }

  .hall-row .hall-metric:last-child {
    display: none;
  }

  .record-timeline-row {
    grid-template-columns: 38px minmax(86px, 1fr) 68px;
    gap: 6px;
  }
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 9px 13px;
  border-radius: 6px;
  background: #111418;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #1d72cf;
  outline-offset: 3px;
}

.site-utilities {
  position: fixed;
  right: 16px;
  bottom: 14px;
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px;
  border: 1px solid rgba(23, 25, 28, 0.15);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(20, 22, 26, 0.16);
  backdrop-filter: blur(10px);
}

.visit-counter {
  padding: 0 8px 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.suggestion-trigger {
  min-height: 32px;
  padding: 6px 11px;
  border: 0;
  border-radius: 999px;
  background: #17191c;
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}

.suggestion-trigger:hover {
  background: var(--accent);
}

.updates-trigger {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 4px;
  padding: 6px 11px;
  border: 0;
  border-radius: 999px;
  background: #f2efe7;
  color: #17191c;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}

.updates-trigger small {
  color: #656a72;
  font-size: 9px;
  font-weight: 750;
}

.updates-trigger:hover {
  background: #e6e1d7;
}

.updates-dialog {
  width: min(920px, calc(100% - 28px));
  max-height: min(880px, calc(100vh - 32px));
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: #f4f2ed;
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
}

.updates-dialog::backdrop {
  background: rgba(12, 14, 17, 0.68);
  backdrop-filter: blur(3px);
}

.updates-dialog-shell {
  max-height: min(880px, calc(100vh - 32px));
  overflow: auto;
  overscroll-behavior: contain;
}

.updates-dialog-heading {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #dedbd3;
  background: rgba(255, 255, 255, 0.97);
}

.updates-dialog-heading h2 {
  margin: 3px 0 5px;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1;
}

.updates-dialog-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.updates-close {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #f4f2ed;
  color: var(--ink);
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
}

.updates-content {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.updates-loading,
.updates-empty,
.updates-error {
  margin: 0;
  padding: 30px;
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.updates-error {
  color: #9e1824;
}

.updates-entry {
  overflow: clip;
  border: 1px solid #dedbd3;
  border-radius: 12px;
  background: #fff;
}

.updates-entry > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 17px;
  cursor: pointer;
  list-style: none;
}

.updates-entry > summary::-webkit-details-marker {
  display: none;
}

.updates-entry > summary > span {
  display: grid;
  gap: 2px;
}

.updates-entry > summary strong {
  font-size: 15px;
}

.updates-entry > summary small {
  color: var(--muted);
  font-size: 10px;
}

.updates-entry > summary > b {
  padding: 6px 9px;
  border-radius: 999px;
  background: #17191c;
  color: #fff;
  font-size: 10px;
  white-space: nowrap;
}

.updates-entry-body {
  display: grid;
  gap: 15px;
  padding: 0 17px 17px;
  border-top: 1px solid #ece9e2;
}

.updates-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  margin-top: 15px;
  border-radius: 10px;
  background: #dedbd3;
}

.updates-summary-grid span {
  display: grid;
  gap: 2px;
  padding: 12px;
  background: #f4f2ed;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.updates-summary-grid b {
  color: var(--ink);
  font-size: 18px;
}

.updates-sources-block h3 {
  margin: 0 0 7px;
  font-size: 11px;
  text-transform: uppercase;
}

.updates-sources,
.updates-items {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.updates-source {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 11px;
  border-radius: 8px;
  background: #17191c;
  color: #fff;
  font-size: 10px;
}

.updates-source span {
  color: rgba(255, 255, 255, 0.72);
  text-align: right;
}

.updates-item {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto auto;
  align-items: center;
  gap: 15px;
  padding: 11px 12px;
  border: 1px solid #e6e2da;
  border-left: 4px solid #737a83;
  border-radius: 9px;
  background: #fbfaf7;
}

.updates-item.is-new {
  border-left-color: #16844a;
}

.updates-item.is-corrected {
  border-left-color: #d0202d;
}

.updates-item-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.updates-item-main strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.updates-item-main small {
  color: var(--muted);
  font-size: 9px;
}

.updates-action {
  color: #d0202d;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.updates-item.is-new .updates-action {
  color: #16844a;
}

.updates-item-numbers {
  display: flex;
  gap: 12px;
}

.updates-item-numbers span {
  display: grid;
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.updates-item-numbers b {
  color: var(--ink);
  font-size: 12px;
}

.updates-item-numbers small {
  color: #737a83;
  font-size: 8px;
}

.updates-item > a {
  color: #ba1825;
  font-size: 10px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.updates-item > a:hover {
  text-decoration: underline;
}
.updates-reviewed-sources {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.updates-reviewed-source {
  display: grid;
  gap: 3px;
  padding: 9px 11px;
  border: 1px solid #e2ded6;
  border-radius: 8px;
  background: #f8f6f1;
}

.updates-reviewed-source strong {
  font-size: 11px;
}

.updates-reviewed-source span {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.updates-reviewed-source.has-errors {
  border-color: #efc8cc;
}

.updates-decision {
  display: grid;
  grid-column: 1 / -1;
  gap: 7px;
  padding: 11px 12px;
  border-radius: 8px;
  background: #f1eee7;
}

.updates-decision > strong {
  font-size: 10px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.updates-decision p {
  margin: 0;
  color: #4f555d;
  font-size: 11px;
  line-height: 1.45;
}

.updates-confirmed-by {
  color: #555c64;
  font-size: 10px;
}

.updates-confirmed-by a {
  color: #ba1825;
  font-weight: 850;
}

.updates-affected-crews {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.updates-affected-crews li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 9px;
  border-radius: 6px;
  background: #fff;
  font-size: 10px;
}

.updates-affected-crews span {
  color: var(--muted);
  text-align: right;
}

.updates-retained {
  padding-top: 2px;
}

.updates-retained > summary {
  width: fit-content;
  cursor: pointer;
  color: #ba1825;
  font-size: 10px;
  font-weight: 850;
}

.updates-retained ul {
  display: grid;
  gap: 4px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.updates-retained li {
  display: grid;
  grid-template-columns: auto minmax(130px, 1fr) auto minmax(160px, 1fr);
  gap: 7px;
  padding: 6px 8px;
  border-radius: 5px;
  background: #fff;
  font-size: 9px;
}

.updates-retained small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-dialog {
  width: min(560px, calc(100% - 28px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

.suggestion-dialog::backdrop {
  background: rgba(12, 14, 17, 0.62);
  backdrop-filter: blur(3px);
}

.suggestion-form {
  display: grid;
  gap: 17px;
  padding: 24px;
}

.suggestion-heading,
.suggestion-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.suggestion-heading h2 {
  margin: 2px 0 0;
  font-size: 24px;
  line-height: 1.1;
}

.suggestion-close {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel-soft);
  color: var(--ink);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.suggestion-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.suggestion-form small {
  color: var(--muted);
  font-weight: 600;
}

.suggestion-form input,
.suggestion-form textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.suggestion-form textarea {
  min-height: 130px;
  resize: vertical;
}

.suggestion-optional-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.suggestion-trap {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
}

.suggestion-privacy {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

#suggestion-status {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.suggestion-submit {
  min-width: 150px;
  padding: 10px 16px;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
}

.suggestion-submit:disabled {
  cursor: wait;
  opacity: 0.6;
}

.event-documents {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid #d8d4cb;
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  background: linear-gradient(105deg, #fff 0%, #fbfaf7 100%);
  box-shadow: 0 8px 24px rgba(20, 22, 26, 0.07);
}

.event-documents[hidden] {
  display: none !important;
}

.category-winners {
  margin: 0 0 14px;
  padding: 16px;
  border: 1px solid #d8d4cb;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(20, 22, 26, 0.07);
}

.category-winners[hidden] {
  display: none !important;
}

.category-winners-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.category-winners-header p,
.category-winners-header h2 {
  margin: 0;
}

.category-winners-header h2 {
  font-size: 19px;
  line-height: 1.15;
}

.category-winners-header > span {
  max-width: 430px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.category-winner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.category-winner-card {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #e2ded6;
  border-radius: 8px;
  background: #f8f6f2;
}

.category-winner-card.grt-row {
  border-color: rgba(197, 32, 44, 0.42);
  box-shadow: inset 3px 0 0 var(--accent);
  background: #fff5f5;
}

.category-winner-label {
  width: max-content;
  max-width: 100%;
  margin-bottom: 3px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #17191c;
  color: #fff;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.035em;
}

.category-winner-card strong,
.category-winner-card span,
.category-winner-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-winner-card strong {
  font-size: 14px;
}

.category-winner-card > span:not(.category-winner-label),
.category-winner-card small {
  color: var(--muted);
  font-size: 11px;
}

.event-documents-copy {
  display: grid;
  min-width: 230px;
  gap: 2px;
}

.event-documents-copy p,
.event-documents-copy strong,
.event-documents-copy span {
  margin: 0;
}

.event-documents-copy strong {
  color: var(--ink);
  font-size: 15px;
}

.event-documents-copy > span {
  color: var(--muted);
  font-size: 12px;
}

.event-document-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.document-action {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid #d6d2c9;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.15;
  text-decoration: none;
}

.document-action:hover {
  border-color: #aaa49a;
  background: #f4f2ed;
}

.document-action.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.document-action.primary:hover {
  background: #a91621;
}

.document-action > span {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: #ece9e2;
  color: var(--ink);
  font-size: 10px;
}

.document-action.disabled {
  border-style: dashed;
  background: #f2f0eb;
  color: #7a7770;
  cursor: default;
}

.entries-dialog {
  width: min(1080px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.36);
}

.entries-dialog::backdrop {
  background: rgba(12, 14, 17, 0.68);
  backdrop-filter: blur(3px);
}

.entries-dialog-shell {
  display: flex;
  max-height: calc(100vh - 32px);
  flex-direction: column;
}

.entries-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.entries-dialog-header h2 {
  margin: 2px 0 3px;
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.08;
}

.entries-dialog-meta,
.entries-result-count {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.dialog-close {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel-soft);
  color: var(--ink);
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
}

.entries-dialog-content {
  min-height: 220px;
  padding: 16px 20px 22px;
  overflow: auto;
}

.entries-search {
  width: min(480px, 100%);
}

.entries-search input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.entries-result-count {
  margin: 8px 0 12px;
  font-weight: 750;
}

.entries-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.entries-table {
  min-width: 760px;
}

.entries-table th,
.entries-table td {
  padding: 10px 12px;
}

.entry-number {
  display: inline-grid;
  min-width: 31px;
  height: 31px;
  place-items: center;
  padding: 0 6px;
  border-radius: 50%;
  background: #ece9e1;
  color: var(--ink);
  font-weight: 900;
}

@media (max-width: 600px) {
  .site-utilities {
    right: 9px;
    bottom: 9px;
  }

  .visit-counter {
    display: none;
  }

  .updates-trigger,
  .suggestion-trigger {
    min-height: 38px;
    padding-inline: 12px;
  }

  .updates-trigger small {
    display: none;
  }

  .updates-dialog {
    width: calc(100% - 14px);
    max-height: calc(100dvh - 14px);
    border-radius: 12px;
  }

  .updates-dialog-shell {
    max-height: calc(100dvh - 14px);
  }

  .updates-dialog-heading {
    padding: 17px 16px 14px;
  }

  .updates-dialog-heading p {
    max-width: 270px;
  }

  .updates-content {
    padding: 10px;
  }

  .updates-entry > summary {
    padding: 13px;
  }

  .updates-entry-body {
    padding: 0 12px 12px;
  }

  .updates-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .updates-source {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .updates-source span {
    text-align: left;
  }

  .updates-item {
    grid-template-columns: 1fr auto;
    gap: 10px;
  }

  .updates-item-main {
    grid-column: 1 / -1;
  }

  .updates-item-main strong {
    white-space: normal;
  }

  .updates-item-numbers {
    gap: 10px;
  }

  .updates-reviewed-sources {
    grid-template-columns: 1fr;
  }

  .updates-affected-crews li {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .updates-affected-crews span {
    text-align: left;
  }

  .updates-retained li {
    grid-template-columns: auto 1fr auto;
  }

  .updates-retained small {
    grid-column: 2 / -1;
    white-space: normal;
  }

  .suggestion-form {
    padding: 19px;
  }

  .suggestion-optional-fields {
    grid-template-columns: 1fr;
  }

  .suggestion-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .suggestion-submit {
    width: 100%;
  }

  .event-documents {
    align-items: stretch;
    flex-direction: column;
    padding: 13px;
  }

  .category-winners {
    padding: 13px;
  }

  .category-winners-header {
    align-items: start;
    flex-direction: column;
    gap: 5px;
  }

  .category-winners-header > span {
    text-align: left;
  }

  .category-winner-grid {
    grid-template-columns: 1fr;
  }

  .event-document-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .document-action {
    width: 100%;
  }

  .entries-dialog {
    width: calc(100% - 12px);
    max-height: calc(100vh - 12px);
    border-radius: 11px;
  }

  .entries-dialog-shell {
    max-height: calc(100vh - 12px);
  }

  .entries-dialog-header {
    padding: 16px 15px 13px;
  }

  .entries-dialog-content {
    padding: 13px 12px 18px;
  }

  .entries-table-wrap {
    overflow: visible;
    border: 0;
  }

  .entries-table,
  .entries-table tbody {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .entries-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .entries-table tbody {
    display: grid;
    gap: 9px;
  }

  .entries-table tbody tr {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 7px 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
  }

  .entries-table tbody tr.grt-row {
    border-color: rgba(197, 32, 44, 0.32);
    border-left: 4px solid var(--accent);
    background: #fff5f5;
  }

  .entries-table td {
    display: block;
    grid-column: 2;
    padding: 0;
    border: 0;
    white-space: normal;
  }

  .entries-table td:first-child {
    grid-row: 1 / span 4;
    grid-column: 1;
  }

  .entries-table td[data-label]::before {
    display: block;
    margin: 0 0 1px;
    color: var(--muted);
    content: attr(data-label);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .entries-table td:first-child::before,
  .entries-table td:nth-child(2)::before {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Legal, privacy and source transparency */
.legal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  margin-top: 44px;
  padding: 22px max(24px, calc((100vw - 1320px) / 2));
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: #17191c;
  color: #fff;
}

.legal-footer > div {
  display: grid;
  gap: 3px;
  max-width: 620px;
}

.legal-footer strong {
  font-size: 13px;
}

.legal-footer span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
}

.legal-footer .visit-counter {
  display: inline;
  padding: 0;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.legal-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 16px;
}

.legal-footer a {
  color: #fff;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.legal-footer a:hover,
.legal-footer a:focus-visible {
  color: #ff6670;
  text-decoration: underline;
}

.suggestion-legal-check {
  display: flex !important;
  align-items: flex-start;
  grid-template-columns: auto 1fr !important;
  gap: 9px !important;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.suggestion-legal-check input {
  width: 17px !important;
  height: 17px;
  margin: 2px 0 0;
}

.suggestion-legal-check span {
  font-size: 12px;
  font-weight: 650;
}

.suggestion-legal-check a {
  color: var(--accent-2);
}

.legal-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 85% 0, rgba(197, 32, 44, 0.08), transparent 30%),
    linear-gradient(180deg, #fff, var(--bg));
}

.legal-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px max(20px, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid rgba(20, 22, 26, 0.12);
  background: rgba(250, 249, 245, 0.93);
  backdrop-filter: blur(14px);
}

.legal-topbar img {
  display: block;
  width: 150px;
  height: 42px;
  object-fit: contain;
  object-position: left center;
}

.legal-topbar nav {
  display: flex;
  gap: 9px;
}

.legal-topbar nav a {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.legal-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0 18px;
}

.legal-hero {
  max-width: 790px;
  margin-bottom: 24px;
}

.legal-hero h1 {
  margin: 4px 0 12px;
  font-size: clamp(32px, 5vw, 58px);
  letter-spacing: -0.04em;
}

.legal-hero > p:not(.eyebrow, .legal-version) {
  color: var(--muted);
  font-size: clamp(16px, 2vw, 20px);
}

.legal-version {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.legal-draft-note {
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid #d49b2e;
  border-left: 5px solid #d49b2e;
  border-radius: 8px;
  background: #fff8e6;
  color: #5e410b;
}

.legal-draft-note strong {
  display: block;
  margin-bottom: 3px;
}

.legal-index {
  position: sticky;
  top: 69px;
  z-index: 8;
  display: flex;
  gap: 7px;
  margin: 22px 0;
  padding: 9px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(20, 22, 26, 0.06);
  scrollbar-width: thin;
}

.legal-index a {
  flex: 0 0 auto;
  padding: 8px 11px;
  border-radius: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.legal-index a:hover,
.legal-index a:focus-visible {
  background: var(--panel-soft);
  color: var(--accent);
}

.legal-card {
  scroll-margin-top: 142px;
  margin: 0 0 18px;
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.legal-card h2 {
  margin: 2px 0 22px;
  font-size: clamp(26px, 4vw, 38px);
  letter-spacing: -0.025em;
}

.legal-card h3 {
  margin: 28px 0 8px;
  font-size: 17px;
}

.legal-card p,
.legal-card li,
.legal-card dd {
  color: #41464d;
}

.legal-card a {
  color: var(--accent-2);
  font-weight: 700;
}

.legal-card li + li {
  margin-top: 7px;
}

.legal-identity {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.legal-identity > div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.legal-identity dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.legal-identity dd {
  margin: 4px 0 0;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.legal-identity mark {
  padding: 2px 4px;
  background: #ffe5a8;
  color: #6f4a00;
}

.legal-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.legal-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 12px;
}

.legal-table th,
.legal-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.legal-table th {
  background: #17191c;
  color: #fff;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.legal-table tr:last-child td {
  border-bottom: 0;
}

.legal-source-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  padding: 0;
  list-style: none;
}

.legal-source-list li {
  margin: 0;
}

.legal-source-list a {
  display: block;
  min-height: 48px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  text-decoration: none;
}

.legal-action-card {
  border-top: 4px solid var(--accent);
}

.legal-official-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 38px;
  padding: 15px;
  border-radius: 9px;
  background: #17191c;
  color: #fff;
}

.legal-official-links strong {
  width: 100%;
}

.legal-official-links a {
  padding: 7px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
}

@media (max-width: 720px) {
  .legal-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px 18px 76px;
  }

  .legal-footer nav {
    justify-content: flex-start;
  }

  .legal-topbar {
    padding: 9px 12px;
  }

  .legal-topbar img {
    width: 118px;
  }

  .legal-topbar nav a:first-child {
    display: none;
  }

  .legal-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 34px;
  }

  .legal-index {
    top: 61px;
    margin-right: -10px;
    margin-left: -10px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .legal-card {
    padding: 20px 17px;
  }

  .legal-identity {
    grid-template-columns: 1fr;
  }
}

/* Instagram: una llamada visual propia, compacta y legible sobre fotografía. */
.instagram-mark {
  position: relative;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: inline-block;
  border: 2px solid currentColor;
  border-radius: 7px;
}

.instagram-mark::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.instagram-mark::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.social-pill {
  gap: 10px;
  padding: 7px 11px;
  border: 0;
  color: #fff;
  background: linear-gradient(115deg, #632fbd, #c32f77 54%, #ed5b35);
  box-shadow: 0 8px 24px rgba(144, 38, 118, 0.2);
}

.social-pill > span {
  display: grid;
  gap: 0;
  color: #fff;
}

.social-pill small {
  color: rgba(255, 255, 255, 0.74);
  font-size: 9px;
  font-weight: 750;
}

.social-pill strong {
  color: #fff;
  font-size: 12px;
}

.home-social-callout {
  position: relative;
  grid-template-columns: minmax(0, 1.35fr) auto minmax(280px, 0.65fr);
  min-height: 210px;
  overflow: hidden;
  padding: 30px 32px 30px 112px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  background:
    radial-gradient(circle at 88% -20%, rgba(255, 158, 58, 0.28), transparent 34%),
    radial-gradient(circle at 3% 120%, rgba(120, 52, 220, 0.38), transparent 40%),
    linear-gradient(125deg, #111318 0%, #1a1721 48%, #481530 100%);
}

.home-social-callout::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.2;
  background-image: linear-gradient(115deg, transparent 0 68%, rgba(255,255,255,.12) 68% 68.2%, transparent 68.2%);
}

.home-social-orbit {
  position: absolute;
  left: -44px;
  width: 138px;
  height: 138px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: linear-gradient(145deg, #6337c7, #d72d78 58%, #f1843d);
  box-shadow: 0 0 0 15px rgba(255, 255, 255, 0.025), 0 0 0 30px rgba(255, 255, 255, 0.018);
}

.home-social-orbit .instagram-mark {
  width: 38px;
  height: 38px;
  border-width: 3px;
}

.home-social-orbit .instagram-mark::before {
  inset: 8px;
  border-width: 3px;
}

.home-social-copy,
.home-social-features,
.home-social-link {
  position: relative;
  z-index: 1;
}

.home-social-copy .eyebrow {
  color: #ff9ec5;
}

.home-social-copy h2 {
  font-size: clamp(27px, 3vw, 42px);
  letter-spacing: -0.025em;
}

.home-social-features {
  max-width: 190px;
  justify-content: flex-start;
}

.home-social-features span {
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.055);
}

.home-social-link {
  min-height: 112px;
  grid-template-columns: 76px auto minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  padding: 17px 18px;
  border-color: rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: linear-gradient(130deg, rgba(255,255,255,.13), rgba(255,255,255,.055));
  backdrop-filter: blur(9px);
}

.home-social-photo {
  grid-row: 1;
  width: 76px;
  height: 76px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.home-social-link > span {
  display: grid;
  color: #fff;
  text-transform: none;
  letter-spacing: 0;
}

.home-social-link small {
  color: rgba(255, 255, 255, 0.66);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.home-social-link strong {
  font-size: 20px;
}

.home-social-link b {
  grid-column: 1 / -1;
  margin: 7px 0 0;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.11);
  color: #fff;
  font-size: 11px;
  letter-spacing: .02em;
}

.home-social-link em {
  float: right;
  color: #ff9cc4;
  font-size: 17px;
  font-style: normal;
}

.hero-social {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  max-width: 455px;
  margin-top: 7px;
  padding: 8px 10px;
  border-color: rgba(255, 255, 255, 0.22);
  border-radius: 9px;
  background: linear-gradient(105deg, rgba(71, 28, 111, .54), rgba(154, 29, 78, .42));
}

.hero-social .instagram-mark {
  width: 22px;
  height: 22px;
}

.hero-social > span {
  display: grid;
  min-width: 0;
}

.hero-social strong {
  font-size: 11px;
}

.hero-social small {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.73);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-social b {
  color: #fff;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.suggestion-delivery {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #d8e2d9;
  border-radius: 8px;
  background: #f4f8f4;
  color: #38513b;
  font-size: 12px;
  line-height: 1.4;
}

.car-mode-switch {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f1efe9;
}

.car-mode-switch button {
  min-height: 34px;
  padding: 7px 13px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
  cursor: pointer;
}

.car-mode-switch button.active {
  background: #17191c;
  color: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,.13);
}

.wizard-explanation {
  margin: 0;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.guide-control-stack {
  display: grid;
  gap: 6px;
}

.guide-locked-control {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 8px 11px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: #f7f6f2;
  font-size: 12px;
}

@media (max-width: 760px) {
  .social-pill {
    padding: 7px 8px;
  }

  .social-pill small {
    display: none;
  }

  .home-social-callout {
    min-height: 0;
    grid-template-columns: 1fr;
    padding: 78px 20px 20px;
  }

  .home-social-orbit {
    top: -63px;
    left: 50%;
    transform: translateX(-50%);
  }

  .home-social-features {
    max-width: none;
  }

  .home-social-link {
    min-height: 96px;
    grid-template-columns: 68px auto minmax(0, 1fr);
  }

  .home-social-photo {
    width: 68px;
    height: 68px;
  }

  .hero-social b {
    display: none;
  }

  .car-compare-wizard > header {
    align-items: flex-start;
    gap: 10px;
  }

  .car-mode-switch {
    width: 100%;
  }

  .car-mode-switch button {
    flex: 1;
  }

  #view-cars,
  #view-cars .wide-grid,
  #view-cars .guided-result,
  #view-cars .panel,
  #view-cars .section-grid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  #view-cars .car-table-desktop {
    display: none;
  }

  #view-cars .car-mobile-list {
    display: grid;
    gap: 8px;
    padding: 10px;
  }

  #view-cars .timeline-scroll,
  #view-compare .timeline-scroll {
    overflow: visible;
    padding: 10px;
    touch-action: pan-y;
  }

  #view-cars .duel-timeline,
  #view-compare .duel-timeline {
    min-width: 0;
    min-height: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 8px;
    padding: 8px;
  }

  #view-cars .timeline-year,
  #view-compare .timeline-year {
    align-content: end;
    min-width: 0;
    padding: 8px 4px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
  }

  #view-cars .timeline-bars,
  #view-compare .timeline-bars {
    width: 50px;
    height: 86px;
  }

  #view-cars .timeline-year > span,
  #view-cars .timeline-year > small,
  #view-compare .timeline-year > span,
  #view-compare .timeline-year > small {
    overflow: hidden;
    width: 100%;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.view-purpose.codriver-purpose {
  border-color: #cbd8e8;
  border-left-color: #315f91;
  background: #f3f7fb;
}

.view-purpose.codriver-purpose > b {
  background: #315f91;
}

.view-purpose.codriver-purpose > small {
  border-left-color: #cbd8e8;
}

.codriver-profile-hero .driver-profile-identity {
  background:
    radial-gradient(circle at 90% 15%, rgba(77, 132, 188, 0.32), transparent 38%),
    #17191c;
}

.codriver-partner-grid,
.codriver-result-grid,
.codriver-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 9px;
  padding: 12px;
}

.codriver-partner-grid article {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--warm);
}

.codriver-partner-grid article > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.codriver-partner-grid article > div strong,
.codriver-partner-grid article > div small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.codriver-partner-grid article > div small {
  color: var(--muted);
  font-size: 11px;
}

.codriver-partner-name > small {
  font-size: 9px !important;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.codriver-partner-cars {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 5px !important;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.codriver-combo-label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.codriver-partner-car {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid #e4ddd1;
  border-radius: 7px;
  background: #fff;
}

.codriver-partner-car strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.codriver-partner-car span {
  color: var(--muted);
  font-size: 10px;
}

.codriver-partner-car span b {
  color: var(--accent);
  font-size: 12px;
}

.codriver-partner-grid dl,
.codriver-result-grid dl {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin: 2px 0 0;
}

.codriver-partner-grid dl div,
.codriver-result-grid dl div {
  display: grid;
  gap: 2px;
  padding: 7px 5px;
  border-radius: 6px;
  background: #fff;
  text-align: center;
}

.codriver-partner-grid dt,
.codriver-result-grid dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.codriver-partner-grid dd,
.codriver-result-grid dd {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
}

.codriver-result-grid article,
.codriver-history-grid article {
  min-width: 0;
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.codriver-result-grid article header,
.codriver-history-grid article header {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.codriver-result-grid article header span,
.codriver-history-grid article header span {
  color: var(--accent);
  font-weight: 950;
}

.codriver-result-grid article header strong,
.codriver-history-grid article header strong,
.codriver-result-crew strong,
.codriver-result-crew span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.codriver-result-crew {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.codriver-result-crew span {
  color: var(--muted);
  font-size: 11px;
}

.codriver-result-crew .codriver-result-car {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  overflow: visible;
  white-space: normal;
}

.codriver-result-car > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.codriver-result-car > b {
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: 999px;
  background: #f2eee6;
  color: var(--muted);
  font-size: 9px;
  font-weight: 950;
}

.codriver-result-car > b.positive {
  background: #fbe5e7;
  color: var(--accent);
}

.codriver-history-grid article footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.driver-history-status {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 3px;
}

.driver-history-status small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.codriver-history-grid article footer b {
  color: var(--ink);
  font-size: 12px;
}

.codriver-history-grid article footer a,
.driver-win-list article > p a {
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  text-decoration: none;
}

@media (max-width: 760px) {
  #view-codrivers,
  #view-codrivers .wide-grid,
  #view-codrivers .panel,
  #view-codrivers .section-grid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  #view-codrivers .hall-list {
    max-height: none;
    overflow: visible;
    scrollbar-gutter: auto;
    touch-action: pan-y;
  }

  .codriver-partner-grid,
  .codriver-result-grid,
  .codriver-history-grid {
    grid-template-columns: 1fr;
    padding: 9px;
  }
}

@media (max-width: 460px) {
  .codriver-partner-cars {
    grid-template-columns: 1fr;
  }

  .codriver-partner-grid dl,
  .codriver-result-grid dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Automatic driver achievements by canonical car */
.driver-car-achievements {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  min-width: 0;
  max-width: 100%;
  padding: 14px;
}
.driver-car-achievement-card {
  display: grid;
  gap: 13px;
  min-width: 0;
  max-width: 100%;
  padding: 16px;
  border: 1px solid #e5e0d8;
  border-top: 3px solid var(--red);
  border-radius: 13px;
  background: linear-gradient(145deg, #fff 0%, #faf8f4 100%);
  box-shadow: 0 10px 25px rgba(20, 22, 24, .06);
}
.driver-car-achievement-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.driver-car-achievement-card > header div { display: grid; min-width: 0; gap: 2px; }
.driver-car-achievement-card > header span,
.driver-car-achievement-card > header small,
.driver-car-achievement-kpis span,
.driver-car-achievement-wins > span,
.driver-car-aliases { color: var(--muted); font-size: 11px; }
.driver-car-achievement-card > header span,
.driver-car-achievement-wins > span { font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.driver-car-achievement-card > header strong { display: block; overflow-wrap: anywhere; font-size: 18px; line-height: 1.15; }
.driver-car-achievement-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.driver-car-achievement-kpis div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 9px;
  border-radius: 9px;
  background: #f1eee8;
}
.driver-car-achievement-kpis b { overflow-wrap: anywhere; font-size: 17px; }
.driver-car-achievement-wins { display: grid; gap: 5px; padding-top: 2px; }
.driver-car-achievement-wins small { display: block; overflow-wrap: anywhere; color: #34383d; }
.driver-car-achievement-wins b { margin-right: 5px; color: var(--red); }
.driver-car-aliases { margin: 0; padding-top: 8px; border-top: 1px dashed #d9d2c8; }
@media (max-width: 620px) {
  #view-drivers,
  #view-drivers .wide-grid,
  #view-drivers .panel,
  #view-drivers .section-grid,
  #driver-cars-section,
  #driver-cars-section .driver-car-achievements,
  #driver-cars-section .driver-car-achievement-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  #view-drivers { touch-action: pan-y; }
  .driver-car-achievements { grid-template-columns: minmax(0, 1fr); gap: 9px; padding: 9px; }
  .driver-car-achievement-card { gap: 11px; padding: 12px; }
  .driver-car-achievement-card > header { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .driver-car-achievement-card > header small { justify-self: start; white-space: normal; }
  .driver-car-achievement-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .driver-car-achievement-kpis div { min-height: 58px; align-content: center; padding: 8px; }
  .driver-car-achievement-kpis span { overflow-wrap: anywhere; line-height: 1.2; }
  .driver-car-achievement-wins small { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 5px; }
  .driver-car-achievement-wins b { margin-right: 0; }
  .driver-car-aliases { overflow-wrap: anywhere; line-height: 1.35; }
}
/* Full mobile containment for the dynamic driver profile. */
@media (max-width: 760px) {
  html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body,
  .app-shell,
  main {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  #view-drivers {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
    overflow-x: clip;
    contain: inline-size;
    touch-action: pan-y;
  }

  #view-drivers > .wide-grid,
  #view-drivers .view-purpose,
  #view-drivers .classification-wizard,
  #view-drivers .classification-steps,
  #view-drivers .classification-step,
  #view-drivers .guide-control-slot,
  #view-drivers .guided-secondary-action,
  #view-drivers .field,
  #view-drivers .lookup-field,
  #view-drivers .lookup-suggestions,
  #view-drivers .driver-profile-hero,
  #view-drivers .driver-profile-identity,
  #view-drivers .driver-profile-kpis,
  #view-drivers .driver-data-coverage,
  #view-drivers .driver-drilldown-context,
  #view-drivers .driver-year-grid,
  #view-drivers .driver-win-list,
  #view-drivers .driver-history-grid,
  #view-drivers .codriver-history-grid,
  #view-drivers .driver-car-achievements,
  #view-drivers .panel,
  #view-drivers .section-grid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  #view-drivers > .wide-grid,
  #view-drivers .panel {
    contain: inline-size;
  }

  #view-drivers input,
  #view-drivers select,
  #view-drivers button {
    max-width: 100%;
    min-width: 0;
  }

  #view-drivers .driver-profile-identity > strong,
  #view-drivers .driver-profile-identity > small,
  #view-drivers .driver-profile-identity > em,
  #view-drivers .driver-data-coverage *,
  #view-drivers .driver-year-grid *,
  #view-drivers .driver-win-list * {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  #view-drivers .table-wrap,
  #view-drivers .history-table-wrap,
  #view-drivers .driver-car-table-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: visible;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
  }
}

@media (max-width: 460px) {
  #view-drivers .driver-win-list article {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  #view-drivers .driver-win-list article > p {
    grid-column: 2;
    justify-items: start;
    text-align: left;
  }
}
/* Clear single-model cards and resilient mobile car layouts. */
.car-selected-profile {
  display: grid;
  gap: 0;
  background: #f4f2ed;
}

.car-selected-profile > header {
  display: grid;
  gap: 3px;
  padding: 18px;
  background: #17191c;
  color: #fff;
}

.car-selected-profile > header span {
  color: #f18b91;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.car-selected-profile > header strong {
  overflow-wrap: anywhere;
  font-size: clamp(23px, 3vw, 36px);
  line-height: 1.08;
}

.car-selected-profile > header small {
  color: rgba(255, 255, 255, .68);
  font-size: 11px;
}

.car-selected-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 8px;
  padding: 12px;
}

.car-selected-kpis > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.car-selected-kpis span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.car-selected-kpis strong {
  color: var(--ink);
  font-size: 22px;
}

.car-selected-profile > p {
  margin: 0;
  padding: 0 14px 14px;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 760px) {
  #view-cars {
    overflow-x: hidden;
    overflow-x: clip;
    contain: inline-size;
    touch-action: pan-y;
  }

  #view-cars > .wide-grid,
  #view-cars .panel,
  #view-cars .car-mobile-list,
  #view-cars .car-mobile-card,
  #view-cars .car-selected-profile,
  #view-cars .car-selected-kpis {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  #view-cars > .wide-grid,
  #view-cars .panel {
    contain: inline-size;
  }

  #view-cars .car-mobile-card > header,
  #view-cars .car-mobile-card > header span,
  #view-cars .car-mobile-card > header strong,
  #view-cars .car-mobile-card > header .context-link {
    min-width: 0;
    max-width: 100%;
  }

  #view-cars .car-mobile-card > header span,
  #view-cars .car-mobile-card > header strong,
  #view-cars .car-mobile-card > header .context-link {
    display: block;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #view-cars .car-rally-card > footer > span,
  #view-cars .car-rally-card > footer > small,
  #view-cars .car-rally-card > footer .context-link {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #view-cars .car-selected-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 10px;
  }
}

@media (max-width: 420px) {
  #view-cars .car-rally-card > footer {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #view-cars .car-rally-card > footer > small {
    grid-column: 1 / -1;
  }
}

/* Mobile viewport safety: prevent a wide nested control from shifting the whole site. */
@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
  }

  .app-shell,
  main,
  main > *,
  .view,
  .panel,
  .wide-grid,
  .section-grid,
  .guided-result,
  .filter-panel,
  .lookup-slot,
  .lookup-suggestions {
    min-width: 0;
    max-width: 100%;
  }

  input,
  select,
  textarea,
  button {
    max-width: 100%;
  }

  .lookup-suggestions,
  .record-lookup-slot .lookup-suggestions,
  .compare-lookup-slot .lookup-suggestions {
    width: min(100%, calc(100vw - 24px));
  }

  .compare-placeholder strong {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
.onboard-panel { margin: 14px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.onboard-panel summary { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 13px; border-radius: 8px; cursor: pointer; color: #fff; background: #167c62; box-shadow: 0 2px 0 rgba(0,0,0,.12); font-weight: 900; }
.onboard-panel summary:hover { background: #0d624d; }
.onboard-panel[open] summary { background: #105b49; }
.onboard-panel form { margin: 12px 0 8px; display: grid; grid-template-columns: minmax(250px, 1fr) minmax(240px, 1fr) auto; gap: 8px; }
.onboard-panel select, .onboard-panel input { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 7px; font: inherit; }
.onboard-panel button { border: 0; border-radius: 7px; padding: 10px 14px; background: var(--accent); color: #fff; font-weight: 850; cursor: pointer; }
.onboard-panel small { color: var(--muted); }
.stage-record-focus { display: grid; gap: 6px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(135deg, #17191c, #2a2d32); color: #fff; }
.stage-record-focus > span { color: #ff6670; font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.stage-record-focus > strong { font-size: clamp(30px, 3vw, 44px); line-height: 1; }
.stage-record-focus p { margin: 2px 0; font-size: 15px; line-height: 1.45; }
.stage-record-focus a { color: #fff; }
.stage-record-focus small { color: rgba(255,255,255,.72); }
@media (max-width: 760px) { .onboard-panel form { grid-template-columns: 1fr; } }

.approved-onboards { margin: 14px 0; padding: 13px 15px; background: #fff3f3; border-left: 4px solid var(--accent); border-radius: var(--radius); }
.approved-onboards > strong { display: block; margin-bottom: 8px; }
.approved-onboards div { display: grid; gap: 7px; }
.approved-onboards a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); text-decoration: none; background: #fff; font-weight: 750; }
.approved-onboards a:hover { border-color: var(--accent); }
.approved-onboards small { color: var(--accent); white-space: nowrap; }
.approved-onboards .onboard-video-link > small { display: flex; align-items: flex-end; flex-direction: column; gap: 2px; }
.approved-onboards .onboard-video-link > small em { color: var(--muted); font-size: .7rem; font-style: normal; font-weight: 650; }
.approved-onboards .onboard-video-link.rallytv { border-left: 4px solid #18243f; }
.approved-onboards .onboard-video-link.rallytv > small b { color: #18243f; }
@media (max-width: 760px) { .approved-onboards a { align-items: flex-start; flex-direction: column; gap: 4px; } }
@media (max-width: 760px) { .approved-onboards .onboard-video-link > small { align-items: flex-start; } }

.approved-onboards em { color: var(--muted); font-style: normal; font-weight: 600; }

.onboard-badge { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 1px 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .7rem; line-height: 1.35; vertical-align: middle; }
.onboard-badge b { font-size: .68rem; }
.tc-button .onboard-badge { margin-left: 4px; }

.onboard-catalog-intro { margin: 18px 0; padding: 22px; border-radius: var(--radius); background: linear-gradient(135deg, #fff3f3, #fff); border: 1px solid var(--line); }
.onboard-catalog-intro span, .onboard-gallery-card > span { color: var(--accent); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.onboard-catalog-intro h2 { margin: 5px 0; }
.onboard-catalog-intro p { margin: 0; color: var(--muted); }
.onboard-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.onboard-gallery-card { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.onboard-gallery-card h3 { margin: 8px 0; }
.onboard-gallery-card p { min-height: 70px; color: var(--muted); line-height: 1.55; }
.onboard-gallery-card p b { color: var(--ink); }
.onboard-gallery-card a { display: inline-block; padding: 9px 12px; border-radius: 7px; background: var(--accent); color: #fff; font-weight: 750; text-decoration: none; }

.onboard-search{display:block;max-width:560px;margin-top:16px}.onboard-search span{display:block;margin-bottom:6px;font-size:.78rem;font-weight:800}.onboard-search input{width:100%;min-height:42px;padding:10px;border:1px solid var(--line);border-radius:8px}.onboard-source-link{display:inline-flex;align-items:flex-start;flex-direction:column;gap:2px;padding:7px 10px;border-radius:6px;background:var(--accent);color:#fff;text-decoration:none;font-weight:750;white-space:nowrap}.onboard-source-link small{color:rgba(255,255,255,.82);font-size:.68rem}.onboard-source-link.rallytv{background:#18243f}.onboard-source-link:hover{filter:brightness(.92)}
.onboard-activity-summary{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:18px 0 4px}.onboard-activity-summary>strong{display:flex;align-items:baseline;gap:6px;margin-right:4px;font-size:1.5rem}.onboard-activity-summary>strong small{color:var(--muted);font-size:.78rem;text-transform:uppercase;letter-spacing:.04em}.onboard-status{display:inline-flex;align-items:center;padding:5px 9px;border-radius:999px;font-size:.75rem;font-weight:800;white-space:nowrap}.onboard-status.approved{background:#e4f5eb;color:#17643d}.onboard-status.pending{background:#fff2cf;color:#825b00}.onboard-status.rejected{background:#eceff2;color:#5d6670}
.onboard-pager{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:12px 0;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:var(--panel-soft);color:var(--muted);font-size:.82rem}.onboard-pager div{display:flex;align-items:center;gap:8px}.onboard-pager button{min-height:36px;padding:7px 11px;border:1px solid var(--line);border-radius:7px;background:#fff;color:var(--ink);font:inherit;font-weight:800;cursor:pointer}.onboard-pager button:disabled{opacity:.45;cursor:not-allowed}.onboard-pager strong{color:var(--ink);white-space:nowrap}@media(max-width:620px){.onboard-pager{align-items:stretch;flex-direction:column}.onboard-pager div{justify-content:space-between}.onboard-pager button{padding:7px 8px}.onboard-pager strong{font-size:.75rem}}

/* Desktop containment for Coches: tables and comparisons must resize inside the page. */
#view-cars,
#view-cars > .wide-grid,
#view-cars .classification-wizard,
#view-cars .classification-steps,
#view-cars .classification-step,
#view-cars .guided-result,
#view-cars .section-grid,
#view-cars .panel,
#view-cars .table-wrap,
#view-cars .timeline-scroll,
#view-cars .guide-control-stack,
#view-cars .guide-control-slot,
#view-cars .lookup-field {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

#view-cars {
  overflow-x: clip;
}

#view-cars > .wide-grid {
  grid-template-columns: minmax(0, 1fr);
}

#view-cars .table-wrap,
#view-cars .timeline-scroll {
  display: block;
  overflow-x: auto;
  overflow-y: auto;
}

#view-cars .panel-header > div,
#view-cars .duel-driver,
#view-cars .duel-score {
  min-width: 0;
}

#view-cars .panel-header h2,
#view-cars .panel-header p,
#view-cars .duel-driver > strong,
#view-cars .duel-driver > small,
#view-cars .duel-score > small {
  overflow-wrap: anywhere;
}

@media (min-width: 1101px) {
  #view-cars .section-grid.stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 761px) and (max-width: 1100px) {
  #view-cars .classification-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-cars .classification-step:last-child {
    grid-column: 1 / -1;
  }
}

/* Unified Tramos navigation. */
.tramos-mode-toggle { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 14px; padding:8px; border:1px solid var(--line); border-radius:var(--radius); background:var(--panel-soft); }
.tramos-mode-toggle button { min-height:38px; padding:7px 13px; border:1px solid var(--line); border-radius:999px; background:#fff; color:var(--ink); font:inherit; font-size:13px; font-weight:850; cursor:pointer; }
.tramos-mode-toggle button.active { border-color:var(--accent); background:var(--accent); color:#fff; }
@media (max-width:560px) { .tramos-mode-toggle { display:grid; grid-template-columns:1fr 1fr; } .tramos-mode-toggle button { min-width:0; padding:7px 6px; font-size:12px; } }
