@import url('https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@500;700;800;900&family=Familjen+Grotesk:wght@400;500;600;700&family=Martian+Mono:wght@400;600;700&family=Noto+Sans+Oriya:wght@400;500;600;700;800;900&display=swap');

/* =========================================================================
   SORO MARATHON — design system
   Asphalt before dawn, cut with high-vis. Signage typography, road markings,
   timing-board numerals.
   ========================================================================= */

:root {
  /* surface — wet asphalt at 5am */
  --ink:        #0a0b0d;
  --ink-2:      #101217;
  --ink-3:      #171a21;
  --ink-4:      #1f232c;
  --line:       #272c36;
  --line-soft:  #1c2027;

  /* ink on asphalt — road paint, never pure white */
  --chalk:      #f2eee6;
  --chalk-2:    #b9b4a8;
  --chalk-3:    #7c7970;

  /* sunrise + safety gear */
  --ember:      #ff4a16;
  --ember-deep: #bf3009;
  --dawn:       #ffa24b;
  --hivis:      #d8ff3e;

  --ok:         #4ade80;
  --warn:       #fbbf24;
  --bad:        #f87171;

  --display: 'Big Shoulders Display', 'Noto Sans Oriya', 'Arial Narrow', sans-serif;
  --body:    'Familjen Grotesk', 'Noto Sans Oriya', ui-sans-serif, sans-serif;
  --mono:    'Martian Mono', 'Noto Sans Oriya', ui-monospace, monospace;

  --gutter: clamp(1.25rem, 4vw, 4.5rem);
  --maxw: 1440px;
  --radius: 2px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-sharp: cubic-bezier(0.65, 0, 0.35, 1);

  /* small tones that follow the theme */
  --placeholder: #555350;
  --alert-fg:    #ffc9c9;
  --backdrop:    rgba(5, 6, 8, 0.78);
  --grain:       0.35;

  color-scheme: dark;
}

/* =========================================================================
   LIGHT THEME — the same road, after sunrise. Paper ground, ink type; the
   accents are deepened so they read as text on light and still carry light
   text when used as a fill.
   Applies when the visitor picks Light, or picks System (the default) on a
   device set to light. theme.js sets data-theme; the media query covers
   System with no attribute set.
   ========================================================================= */
:root[data-theme='light'] {
  --ink:        #f5f3ee;
  --ink-2:      #fdfcfa;
  --ink-3:      #efece5;
  --ink-4:      #e5e1d7;
  --line:       #d5d0c4;
  --line-soft:  #e4e0d6;
  --chalk:      #14161b;
  --chalk-2:    #43454b;
  --chalk-3:    #6a6862;
  --ember:      #cc3a0a;
  --ember-deep: #a02d06;
  --dawn:       #b86412;
  --hivis:      #3f6f00;
  --ok:         #15803d;
  --warn:       #a15c07;
  --bad:        #c0262d;
  --placeholder: #9a968d;
  --alert-fg:    #8f1d1d;
  --backdrop:    rgba(20, 22, 27, 0.45);
  --grain:       0.18;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    --ink:        #f5f3ee;
    --ink-2:      #fdfcfa;
    --ink-3:      #efece5;
    --ink-4:      #e5e1d7;
    --line:       #d5d0c4;
    --line-soft:  #e4e0d6;
    --chalk:      #14161b;
    --chalk-2:    #43454b;
    --chalk-3:    #6a6862;
    --ember:      #cc3a0a;
    --ember-deep: #a02d06;
    --dawn:       #b86412;
    --hivis:      #3f6f00;
    --ok:         #15803d;
    --warn:       #a15c07;
    --bad:        #c0262d;
    --placeholder: #9a968d;
    --alert-fg:    #8f1d1d;
    --backdrop:    rgba(20, 22, 27, 0.45);
    --grain:       0.18;
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--chalk);
  font-family: var(--body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---- atmosphere: film grain + a dawn that never quite arrives ----------- */
body::before {
  content: '';
  position: fixed;
  inset: -50%;
  z-index: 0;
  pointer-events: none;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--hivis); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--hivis);
  outline-offset: 3px;
}

/* ---- layout ------------------------------------------------------------ */
.shell {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  position: relative;
  z-index: 1;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--hivis);
  color: var(--ink);
  padding: 0.75rem 1.25rem;
  z-index: 100;
  font-weight: 700;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ---- typography -------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 900;
  line-height: 0.85;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  margin: 0;
}

.display-xl { font-size: clamp(3.75rem, 13vw, 12rem); }
.display-l  { font-size: clamp(2.75rem, 7.5vw, 6.5rem); }
.display-m  { font-size: clamp(2rem, 4vw, 3.5rem); }
.display-s  { font-size: clamp(1.5rem, 2.2vw, 2rem); }

.outline-type {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--chalk-3);
}

.lede {
  font-size: clamp(1.0625rem, 1rem + 0.45vw, 1.375rem);
  line-height: 1.5;
  color: var(--chalk-2);
  max-width: 54ch;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--chalk-3);
  margin: 0;
}

.accent { color: var(--ember); }
.hivis  { color: var(--hivis); }
.mono   { font-family: var(--mono); }

/* ---- buttons ----------------------------------------------------------- */
.btn {
  --btn-bg: var(--ember);
  --btn-fg: #fff;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.0625rem 1.875rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bg);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.btn > * { position: relative; z-index: 1; }
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--hivis);
  transform: translateY(101%);
  transition: transform 0.4s var(--ease-sharp);
}
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 34px -14px var(--ember); }
.btn:hover:not(:disabled)::after { transform: translateY(0); }
.btn:hover:not(:disabled) { color: var(--ink); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--chalk);
  border-color: var(--line);
}
.btn--ghost:hover:not(:disabled) { box-shadow: none; border-color: var(--hivis); }

.btn--hivis { --btn-bg: var(--hivis); --btn-fg: var(--ink); }
.btn--hivis::after { background: var(--chalk); }
.btn--hivis:hover:not(:disabled) { box-shadow: 0 14px 34px -14px var(--hivis); }

.btn .arrow { transition: transform 0.35s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

.btn--block { width: 100%; justify-content: center; }

/* ---- nav --------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  border-bottom: 1px solid var(--line-soft);
  transition: border-color 0.3s ease;
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  height: 72px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.brand span { color: var(--ember); }
.brand small {
  font-family: var(--mono);
  font-size: 0.5625rem;
  letter-spacing: 0.2em;
  color: var(--chalk-3);
  font-weight: 600;
}
.nav__links {
  display: flex;
  gap: 2.25rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--chalk-2);
}
.nav__links a { position: relative; padding-block: 0.25rem; }
.nav__links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--hivis);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}
.nav__links a:hover { color: var(--chalk); }
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }

.nav__cta { display: flex; align-items: center; gap: 1rem; }
.nav .btn { padding: 0.75rem 1.25rem; font-size: 0.6875rem; white-space: nowrap; }

@media (max-width: 900px) {
  .nav__links { display: none; }
}
/* ---- theme toggle: System → Light → Dark ---------------------------------- */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--chalk-2);
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease;
}
.theme-toggle:hover { border-color: var(--hivis); color: var(--chalk); }
.theme-toggle svg { grid-area: 1 / 1; width: 16px; height: 16px; display: none; }
.theme-toggle:not([data-mode]) .theme-toggle__system,
.theme-toggle[data-mode='system'] .theme-toggle__system,
.theme-toggle[data-mode='light'] .theme-toggle__light,
.theme-toggle[data-mode='dark'] .theme-toggle__dark { display: block; }
/* On pages without a nav bar (sign-in, 404) it sits in the corner. */
.theme-toggle--corner { position: fixed; top: 1rem; right: 1rem; z-index: 60; background: var(--ink-2); }

/* ---- language toggle: English ↔ Odia (names the language it switches to) -- */
.lang-toggle {
  flex: none;
  height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--chalk-2);
  font-family: var(--body);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease;
}
.lang-toggle:hover { border-color: var(--hivis); color: var(--chalk); }
.lang-toggle:lang(en) { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.1em; }
/* Pages without a nav bar (404) keep both toggles in the corner. */
.corner-toggles { position: fixed; top: 1rem; right: 1rem; z-index: 60; display: flex; gap: 0.5rem; }
.corner-toggles > * { background: var(--ink-2); }

/* Phones: make room for the login button beside the brand and main CTA. */
@media (max-width: 600px) {
  .theme-toggle { width: 2.25rem; height: 2.25rem; }
  .lang-toggle { height: 2.25rem; padding: 0 0.5rem; font-size: 0.8125rem; }
  .nav__inner { gap: 1rem; }
  .nav__cta { gap: 0.5rem; }
  .nav__cta .eyebrow, .nav .brand small, .nav .btn .arrow { display: none; }
  .nav .nav__cta .btn { padding: 0.6875rem 0.75rem; letter-spacing: 0.08em; }
}
@media (max-width: 420px) {
  .hide-narrow { display: none; }   /* "Enter the race" becomes "Enter" */
}
@media (max-width: 360px) {
  .nav .nav__cta .btn { padding-inline: 0.625rem; font-size: 0.625rem; letter-spacing: 0.04em; }
}

/* ---- hero -------------------------------------------------------------- */
.hero {
  position: relative;
  padding-block: clamp(3rem, 7vw, 6rem) clamp(3rem, 6vw, 5rem);
  overflow: hidden;
}
.hero::before {
  /* the sun, still below the horizon */
  content: '';
  position: absolute;
  left: -10%;
  bottom: -55%;
  width: min(90vw, 1100px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 74, 22, 0.28) 0%, rgba(255, 162, 75, 0.1) 38%, transparent 68%);
  filter: blur(30px);
  pointer-events: none;
  animation: breathe 9s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.06); }
}

/* lane markings running down the page */
.lanes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  opacity: 0.55;
}
.lanes span {
  border-left: 1px dashed var(--line);
  height: 100%;
}
.lanes span:first-child { border-left: none; }

.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: end;
}
@media (max-width: 980px) {
  .hero__grid { grid-template-columns: 1fr; align-items: start; }
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}
.hero__meta .dot { width: 5px; height: 5px; background: var(--ember); border-radius: 50%; }

.hero__title { position: relative; }
.hero__title .line { display: block; overflow: hidden; }
.hero__title .line > span {
  display: block;
  transform: translateY(105%);
  animation: riseIn 1s var(--ease) forwards;
}
.hero__title .line:nth-child(1) > span { animation-delay: 0.05s; }
.hero__title .line:nth-child(2) > span { animation-delay: 0.14s; }
.hero__title .line:nth-child(3) > span { animation-delay: 0.23s; }
@keyframes riseIn { to { transform: translateY(0); } }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: clamp(1.75rem, 3vw, 2.75rem);
}

.hero__aside {
  display: grid;
  gap: 1.25rem;
}

/* countdown — a timing board bolted to the finish gantry */
.clock {
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--ink-3), var(--ink-2));
  padding: 1.5rem;
  position: relative;
}
.clock::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 42px; height: 3px;
  background: var(--hivis);
}
.clock__label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.125rem;
}
.clock__digits {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  text-align: center;
}
.clock__cell {
  background: var(--ink);
  border: 1px solid var(--line-soft);
  padding: 0.75rem 0.25rem 0.5rem;
}
.clock__num {
  font-family: var(--mono);
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  font-weight: 700;
  color: var(--hivis);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.clock__unit {
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.16em;
  color: var(--chalk-3);
  text-transform: uppercase;
  margin-top: 0.5rem;
}

.figures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-right: none;
}
.figures div {
  padding: 1.125rem 1rem;
  border-right: 1px solid var(--line);
}
.figures strong {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  line-height: 0.9;
  color: var(--chalk);
}
.figures span {
  font-family: var(--mono);
  font-size: 0.5625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--chalk-3);
}

/* ---- ticker ------------------------------------------------------------ */
.ticker {
  border-block: 1px solid var(--line);
  background: var(--ember);
  color: #fff;
  overflow: hidden;
  position: relative;
  z-index: 1;
  padding-block: 0.875rem;
}
.ticker__track {
  display: flex;
  width: max-content;
  animation: slide 42s linear infinite;
}
.ticker:hover .ticker__track { animation-play-state: paused; }
@keyframes slide { to { transform: translateX(-50%); } }
.ticker__group { display: flex; flex-shrink: 0; }
.ticker__item {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding-inline: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  white-space: nowrap;
}
.ticker__item::after { content: '\25C6'; font-size: 0.5rem; opacity: 0.6; }

/* ---- sections + km markers --------------------------------------------- */
.section { padding-block: clamp(4.5rem, 9vw, 9rem); position: relative; }
.section--alt { background: var(--ink-2); border-block: 1px solid var(--line-soft); }

.km {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: clamp(1.75rem, 3vw, 2.75rem);
}
.km__marker {
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--ink);
  background: var(--hivis);
  padding: 0.3rem 0.6rem;
  flex-shrink: 0;
}
.km__rule {
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--line) 0 14px, transparent 14px 26px);
}
.km__label {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--chalk-3);
  flex-shrink: 0;
}

.section__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: end;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}
@media (max-width: 860px) { .section__head { grid-template-columns: 1fr; } }

/* ---- about / stats ----------------------------------------------------- */
.about {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.about__cell {
  background: var(--ink);
  padding: clamp(1.5rem, 2.5vw, 2.25rem);
  transition: background 0.4s var(--ease);
}
.about__cell:hover { background: var(--ink-3); }
.about__cell h3 {
  font-size: 1.375rem;
  margin-bottom: 0.75rem;
  color: var(--chalk);
}
.about__cell p { color: var(--chalk-2); font-size: 0.9375rem; margin: 0; }
.about__num {
  font-family: var(--mono);
  font-size: 0.625rem;
  color: var(--ember);
  letter-spacing: 0.18em;
  display: block;
  margin-bottom: 1.25rem;
}

/* ---- registration counters banner -------------------------------------- */
.banner { margin: 0; border: 1px solid var(--line); background: var(--ink-2); }
.banner > a { display: block; }
.banner img { display: block; width: 100%; height: auto; }
.banner__calls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  padding: 1rem clamp(1rem, 2.5vw, 1.5rem);
  border-top: 1px solid var(--line);
}
.banner__calls .eyebrow { margin: 0; margin-right: auto; }
.banner__calls a {
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--chalk);
  text-decoration: none;
  white-space: nowrap;
}
.banner__calls a:hover { color: var(--hivis); }
@media (max-width: 600px) { .banner__calls .eyebrow { flex-basis: 100%; } }

/* ---- race category cards ----------------------------------------------- */
.races { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }

.race {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.5fr) minmax(0, 0.9fr);
  gap: clamp(1.25rem, 3vw, 3rem);
  align-items: center;
  padding: clamp(1.75rem, 3vw, 2.5rem) clamp(1.5rem, 3vw, 2.5rem);
  background: var(--ink);
  transition: background 0.45s var(--ease);
  overflow: hidden;
}
.race::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--ember);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.45s var(--ease);
}
.race:hover { background: var(--ink-3); }
.race:hover::before { transform: scaleY(1); transform-origin: top; }

@media (max-width: 900px) {
  .race { grid-template-columns: 1fr; align-items: start; }
}

.race__distance {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(2.5rem, 5.5vw, 4.25rem);
  line-height: 0.82;
  letter-spacing: -0.02em;
  transition: color 0.45s var(--ease);
}
.race:hover .race__distance { color: var(--ember); }
.race__distance sub {
  display: block;
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--chalk-3);
  margin-top: 0.75rem;
  vertical-align: baseline;
}
.race__name {
  font-family: var(--display);
  font-size: 1.625rem;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
}
.race__blurb { color: var(--chalk-2); font-size: 0.9375rem; margin: 0 0 1rem; }
.race__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--chalk-3);
}
.race__facts b { color: var(--chalk-2); font-weight: 600; }

.race__buy { text-align: right; display: grid; gap: 0.875rem; justify-items: end; }
@media (max-width: 900px) { .race__buy { justify-items: start; text-align: left; } }
.race__price {
  font-family: var(--display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  line-height: 1;
}
.race__price small {
  display: block;
  font-family: var(--mono);
  font-size: 0.5625rem;
  letter-spacing: 0.14em;
  color: var(--chalk-3);
  font-weight: 400;
  margin-top: 0.375rem;
}

.slots {
  width: 100%;
  min-width: 150px;
  display: grid;
  gap: 0.5rem;
}
.slots__bar {
  height: 3px;
  background: var(--ink-4);
  overflow: hidden;
}
.slots__fill {
  height: 100%;
  background: var(--hivis);
  width: 0;
  transition: width 1.2s var(--ease);
}
.slots__fill--low { background: var(--warn); }
.slots__fill--critical { background: var(--ember); }
.slots__text {
  font-family: var(--mono);
  font-size: 0.5625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--chalk-3);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.3rem 0.55rem;
  border: 1px solid currentColor;
  border-radius: 1px;
}
.tag--sold { color: var(--bad); }
.tag--low { color: var(--warn); }
.tag--open { color: var(--hivis); }

/* ---- schedule ---------------------------------------------------------- */
.schedule { border-top: 1px solid var(--line); }
.slot {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) minmax(0, 0.8fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: 1.5rem 0.5rem;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
  transition: padding-left 0.4s var(--ease), background 0.4s var(--ease);
}
.slot:hover { padding-left: 1.25rem; background: var(--ink-3); }
@media (max-width: 760px) { .slot { grid-template-columns: 90px 1fr; } .slot > :last-child { grid-column: 1 / -1; } }
.slot__time {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--hivis);
  font-variant-numeric: tabular-nums;
}
.slot__what { font-family: var(--display); font-size: 1.375rem; font-weight: 800; text-transform: uppercase; }
.slot__note { color: var(--chalk-3); font-size: 0.875rem; }

/* ---- kit --------------------------------------------------------------- */
.kit { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
.kit__item {
  border: 1px solid var(--line);
  padding: 1.75rem 1.5rem;
  position: relative;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease);
}
.kit__item:hover { transform: translateY(-4px); border-color: var(--ember); }
.kit__icon { color: var(--ember); margin-bottom: 1.25rem; }
.kit__item h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.kit__item p { margin: 0; color: var(--chalk-2); font-size: 0.9375rem; }

/* ---- faq --------------------------------------------------------------- */
.faq { border-top: 1px solid var(--line); max-width: 900px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 1.5rem 3rem 1.5rem 0;
  font-family: var(--display);
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  font-weight: 800;
  text-transform: uppercase;
  position: relative;
  transition: color 0.3s ease;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--ember); }
.faq summary::after {
  content: '+';
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 1.25rem;
  color: var(--hivis);
  transition: transform 0.35s var(--ease);
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(135deg); }
.faq p { margin: 0 0 1.5rem; color: var(--chalk-2); max-width: 65ch; }

/* ---- final call -------------------------------------------------------- */
.cta {
  position: relative;
  padding-block: clamp(5rem, 11vw, 10rem);
  text-align: center;
  overflow: hidden;
  border-top: 1px solid var(--line);
}
.cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 120%, rgba(255, 74, 22, 0.3), transparent 60%);
}
.cta > * { position: relative; }

/* ---- footer ------------------------------------------------------------ */
.footer { border-top: 1px solid var(--line); background: var(--ink-2); padding-block: 3.5rem 2rem; }
.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 2.5rem;
  margin-bottom: 3rem;
}
@media (max-width: 860px) { .footer__grid { grid-template-columns: repeat(2, 1fr); } }
.footer h4 {
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--chalk-3);
  margin-bottom: 1.25rem;
  text-transform: uppercase;
}
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.625rem; }
.footer li a { color: var(--chalk-2); font-size: 0.9375rem; transition: color 0.25s ease; }
.footer li a:hover { color: var(--hivis); }
.footer__base {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  color: var(--chalk-3);
  text-transform: uppercase;
}

/* =========================================================================
   FORMS — registration
   ========================================================================= */
.page-head { padding-block: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 3vw, 2.5rem); }

.reg {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: start;
  padding-bottom: clamp(4rem, 8vw, 7rem);
}
@media (max-width: 1040px) { .reg { grid-template-columns: 1fr; } }

.fieldset { border: none; margin: 0 0 2.75rem; padding: 0; }
.fieldset > legend { padding: 0; width: 100%; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.span-2 { grid-column: span 2; }
@media (max-width: 640px) { .span-2 { grid-column: span 1; } }

/* Pack each field to the top of its grid cell; a neighbour with a hint makes
   the row taller, and stretching would push this field's control out of line. */
.field { display: grid; gap: 0.5rem; align-content: start; }
.field > label {
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--chalk-3);
}
.field > label .req { color: var(--ember); }

.field input,
.field select,
.field textarea {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  color: var(--chalk);
  width: 100%;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.field input::placeholder { color: var(--placeholder); opacity: 1; }
.field input:hover, .field select:hover { border-color: var(--ink-4); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--hivis);
  background: var(--ink-3);
}
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237c7970' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* Text, date and select controls render at different intrinsic heights
   (the date picker's calendar button, the select's native box). Pin one
   height on the registration form so every row lines up. */
.reg .field input,
.reg .field select {
  height: calc(1.5em + 1.75rem + 2px);
  line-height: 1.5;
}
.reg .field input[type='date'] { -webkit-appearance: none; appearance: none; text-align: left; }
.reg .field input[type='date']::-webkit-date-and-time-value { text-align: left; }

.field .hint { margin: 0; font-size: 0.75rem; line-height: 1.5; color: var(--chalk-3); }
.field .err {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  color: var(--bad);
}
/* Empty error slots must not reserve space under every field. */
.field .err:empty { display: none; }

/* An input with a button beside it, e.g. bib number + Check. */
.input-action { display: flex; gap: 0.5rem; }
.input-action input { flex: 1 1 auto; min-width: 0; }
.input-action .btn { flex: none; align-self: stretch; justify-content: center; }

/* Verdict of the bib Check button. */
.bib-check {
  display: block;
  font-family: var(--mono);
  font-size: 0.6875rem;
  line-height: 1.55;
  letter-spacing: 0.04em;
}
.bib-check[hidden] { display: none; }
.bib-check--busy { color: var(--chalk-3); }
.bib-check--ok   { color: var(--ok); }
.bib-check--warn { color: var(--warn); }
.bib-check--bad  { color: var(--bad); }
.bib-check b { font-weight: 700; }
.field.is-invalid input,
.field.is-invalid select { border-color: var(--bad); }

/* race picker */
.picker { display: grid; gap: 0.75rem; }
.picker__opt { position: relative; }
.picker__opt input { position: absolute; opacity: 0; pointer-events: none; }
.picker__opt label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1.125rem 1.25rem;
  border: 1px solid var(--line);
  background: var(--ink-2);
  cursor: pointer;
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s var(--ease);
}
.picker__opt label:hover { border-color: var(--ink-4); transform: translateX(3px); }
.picker__opt input:checked + label {
  border-color: var(--ember);
  background: linear-gradient(90deg, rgba(255, 74, 22, 0.1), transparent 60%);
}
.picker__opt input:focus-visible + label { outline: 2px solid var(--hivis); outline-offset: 2px; }
.picker__opt input:disabled + label { opacity: 0.4; cursor: not-allowed; }
.picker__dist {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 900;
  min-width: 3.5rem;
}
.picker__opt input:checked + label .picker__dist { color: var(--ember); }
.picker__name { font-weight: 600; }
.picker__meta { font-family: var(--mono); font-size: 0.625rem; letter-spacing: 0.1em; color: var(--chalk-3); text-transform: uppercase; }
.picker__price { font-family: var(--mono); font-size: 0.875rem; font-weight: 700; }

/* consent rows */
.consent { display: grid; gap: 1rem; }
.check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.875rem;
  align-items: start;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--ink-2);
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--chalk-2);
  transition: border-color 0.25s ease;
}
.check:hover { border-color: var(--ink-4); }
.check input {
  appearance: none;
  width: 18px; height: 18px;
  margin-top: 2px;
  border: 1px solid var(--line);
  background: var(--ink);
  display: grid;
  place-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.check input::before {
  content: '';
  width: 9px; height: 9px;
  background: var(--hivis);
  transform: scale(0);
  transition: transform 0.2s var(--ease);
}
.check input:checked { border-color: var(--hivis); }
.check input:checked::before { transform: scale(1); }
.check a { color: var(--chalk); text-decoration: underline; text-underline-offset: 3px; }

/* ---- order summary (sticky rail) --------------------------------------- */
.summary {
  position: sticky;
  top: 96px;
  border: 1px solid var(--line);
  background: linear-gradient(170deg, var(--ink-3), var(--ink-2));
}
.summary__head {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.summary__body { padding: 1.5rem; display: grid; gap: 1rem; }
.summary__race {
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.9;
}
.summary__race span { color: var(--ember); }
.row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--chalk-2);
}
.row .mono { font-variant-numeric: tabular-nums; }
.summary__rule { height: 1px; background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 12px); }
.summary__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 0.25rem;
}
.summary__total b { font-family: var(--display); font-size: 2.25rem; font-weight: 900; }
.summary__foot { padding: 0 1.5rem 1.5rem; display: grid; gap: 1rem; }
.secure {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.5625rem;
  letter-spacing: 0.1em;
  color: var(--chalk-3);
  text-transform: uppercase;
}
.paylogos { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.paylogos span {
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.45rem;
  border: 1px solid var(--line);
  color: var(--chalk-3);
}

.alert {
  padding: 0.875rem 1rem;
  border: 1px solid var(--bad);
  background: rgba(248, 113, 113, 0.08);
  color: var(--alert-fg);
  font-size: 0.875rem;
}
.alert--info { border-color: var(--line); background: var(--ink-3); color: var(--chalk-2); }
.alert--hivis { border-color: var(--hivis); background: rgba(216, 255, 62, 0.07); color: var(--chalk); }

/* ---- status page + the bib --------------------------------------------- */
.status-wrap { min-height: 70vh; display: grid; place-items: center; padding-block: clamp(3rem, 7vw, 6rem); }
.status-card { width: 100%; max-width: 760px; text-align: center; }

.spinner {
  width: 46px; height: 46px;
  margin: 0 auto 2rem;
  border: 2px solid var(--line);
  border-top-color: var(--ember);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner--sm { width: 24px; height: 24px; margin: 0; }

/* the race bib — a real one, pin holes and all */
.bib {
  /* A bib is printed paper in either theme: pin its own ink and paper. */
  --ink: #0a0b0d;
  --chalk: #f2eee6;
  position: relative;
  max-width: 480px;
  margin: 0 auto 2.5rem;
  background: var(--chalk);
  color: var(--ink);
  padding: 1.75rem 1.5rem 1.25rem;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.9);
  animation: bibIn 0.85s var(--ease) both;
  --punch: radial-gradient(circle, var(--ink) 40%, transparent 42%);
}
@keyframes bibIn {
  from { opacity: 0; transform: translateY(22px) rotate(-1.5deg) scale(0.96); }
  to   { opacity: 1; transform: none; }
}
.bib::before, .bib::after {
  content: '';
  position: absolute;
  top: 12px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.16);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}
.bib::before { left: 12px; }
.bib::after { right: 12px; }

.bib__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6b675e;
  padding-bottom: 0.875rem;
  border-bottom: 2px solid var(--ink);
}
.bib__num {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(2.75rem, 10vw, 4.5rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  padding-block: 0.75rem 0.25rem;
  font-variant-numeric: tabular-nums;
}
.bib__name {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border-top: 2px solid var(--ink);
  padding-top: 0.625rem;
}
.bib__strip {
  margin-top: 0.875rem;
  padding-top: 0.75rem;
  border-top: 1px dashed #b3aea2;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6b675e;
}
.bib--fm { background: var(--chalk); }
.bib--hm { background: #ffd9a8; }
.bib--tk { background: #cdeaff; }
.bib--fr { background: #d8ff3e; }

.receipt {
  border: 1px solid var(--line);
  text-align: left;
  margin-bottom: 2rem;
}
.receipt__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.875rem;
}
.receipt__row:last-child { border-bottom: none; }
.receipt__row dt { color: var(--chalk-3); font-family: var(--mono); font-size: 0.625rem; letter-spacing: 0.12em; text-transform: uppercase; margin: 0; }
.receipt__row dd { margin: 0; text-align: right; font-weight: 500; }

.next-steps { display: grid; gap: 0.75rem; text-align: left; margin-bottom: 2.5rem; }
.next-steps li {
  list-style: none;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.875rem;
  align-items: start;
  padding: 0.875rem 1rem;
  border-left: 2px solid var(--line);
  color: var(--chalk-2);
  font-size: 0.9375rem;
}
.next-steps li b { font-family: var(--mono); font-size: 0.625rem; color: var(--hivis); letter-spacing: 0.1em; }

/* mock gateway panel */
.mockpay {
  max-width: 460px;
  margin: 0 auto;
  border: 1px dashed var(--hivis);
  background: rgba(216, 255, 62, 0.04);
  padding: 1.75rem;
  text-align: left;
  display: grid;
  gap: 1rem;
}

/* =========================================================================
   ADMIN — race control
   ========================================================================= */
.admin { padding-block: 2rem 5rem; }

.login {
  max-width: 420px;
  margin: 12vh auto;
  border: 1px solid var(--line);
  background: var(--ink-2);
  padding: 2.25rem;
  display: grid;
  gap: 1.25rem;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 2.5rem;
}
.tile { background: var(--ink-2); padding: 1.375rem 1.5rem; }
.tile__k {
  font-family: var(--mono);
  font-size: 0.5625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--chalk-3);
  margin-bottom: 0.75rem;
}
.tile__v {
  font-family: var(--display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 900;
  line-height: 0.9;
}
.tile--paid .tile__v { color: var(--hivis); }
.tile--rev .tile__v { color: var(--ember); }

.fill-grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 2.5rem; }
.fill-row {
  background: var(--ink-2);
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 160px;
  gap: 1.5rem;
  align-items: center;
  padding: 1.125rem 1.5rem;
}
@media (max-width: 700px) { .fill-row { grid-template-columns: 1fr; gap: 0.625rem; } }
.fill-row__name { font-family: var(--display); font-weight: 800; font-size: 1.125rem; text-transform: uppercase; }
.fill-row__bar { height: 6px; background: var(--ink); overflow: hidden; }
.fill-row__bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--ember), var(--dawn)); }
.fill-row__n { font-family: var(--mono); font-size: 0.75rem; text-align: right; color: var(--chalk-2); }
@media (max-width: 700px) { .fill-row__n { text-align: left; } }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.25rem;
}
.toolbar input, .toolbar select {
  background: var(--ink-2);
  border: 1px solid var(--line);
  padding: 0.625rem 0.875rem;
  color: var(--chalk);
  font-size: 0.875rem;
}
.toolbar input:focus, .toolbar select:focus { outline: none; border-color: var(--hivis); }
.toolbar .spacer { flex: 1; }

.table-wrap { border: 1px solid var(--line); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
thead th {
  position: sticky;
  top: 0;
  background: var(--ink-3);
  text-align: left;
  font-family: var(--mono);
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--chalk-3);
  padding: 0.875rem 1rem;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
tbody td { padding: 0.8125rem 1rem; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
tbody tr:hover { background: var(--ink-2); }
tbody tr[data-edit] { cursor: pointer; }
tbody td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 0.25rem 0.5rem;
  border: 1px solid currentColor;
}
.pill--paid { color: var(--ok); }
.pill--pending { color: var(--warn); }
.pill--failed { color: var(--bad); }

.pill--expired { color: var(--chalk-3); }
.pill--cancelled { color: var(--chalk-2); text-decoration: line-through; }

tbody td .sub { color: var(--chalk-3); font-size: 0.75rem; }

/* tabs */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs [role='tab'] {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 0.875rem 1.125rem;
  color: var(--chalk-3);
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}
.tabs [role='tab']:hover { color: var(--chalk); }
.tabs [role='tab'][aria-selected='true'] { color: var(--hivis); border-bottom-color: var(--hivis); }
.tabs [role='tab']:focus-visible { outline: 1px solid var(--hivis); outline-offset: -1px; }

/* inline table actions */
.linkbtn {
  background: none;
  border: none;
  padding: 0.25rem 0.375rem;
  color: var(--hivis);
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}
.linkbtn:hover { text-decoration: underline; }
.linkbtn--danger { color: var(--bad); }

.btn--danger { color: var(--bad); }
.btn--danger:hover:not(:disabled) { border-color: var(--bad); }

/* dialogs */
.modal {
  width: min(960px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 1px solid var(--line);
  background: var(--ink-2);
  color: var(--chalk);
}
.modal::backdrop { background: var(--backdrop); backdrop-filter: blur(3px); }
.modal > form, .modal > div { display: flex; flex-direction: column; max-height: calc(100vh - 2rem); }
.modal__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem 1.75rem 1.25rem;
  border-bottom: 1px solid var(--line);
}
.modal__head .eyebrow { margin: 0 0 0.5rem; font-family: var(--mono); }
.modal__head h2 { margin: 0; }
.modal__x {
  background: none;
  border: 1px solid var(--line);
  color: var(--chalk-2);
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.modal__x:hover { border-color: var(--hivis); color: var(--chalk); }
.modal__body { padding: 1.5rem 1.75rem; overflow-y: auto; }
.modal__body .grid-3 { gap: 1rem 1.25rem; align-items: start; }
.modal__body .field input, .modal__body .field select { padding: 0.625rem 0.875rem; font-size: 0.9375rem; }
.modal__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding: 1.125rem 1.75rem;
  border-top: 1px solid var(--line);
  background: var(--ink);
}
.modal__foot .spacer { flex: 1; }
@media (max-width: 640px) {
  .modal__head, .modal__body, .modal__foot { padding-inline: 1rem; }
}

.meta-line { margin: 1.25rem 0 0; font-family: var(--mono); font-size: 0.625rem; letter-spacing: 0.06em; color: var(--chalk-3); }
.form-msg { margin: 0; font-family: var(--mono); font-size: 0.6875rem; line-height: 1.5; color: var(--bad); }
.modal__body .form-msg { margin-top: 0.75rem; }
.form-msg:empty { display: none; }
.form-msg--ok { color: var(--ok); }

.payload {
  margin: 0;
  padding: 1rem 1.25rem;
  background: var(--ink);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--chalk-2);
  white-space: pre-wrap;
  word-break: break-word;
}

/* settings */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; align-items: start; }
.panel {
  border: 1px solid var(--line);
  background: var(--ink-2);
  padding: 1.75rem;
  display: grid;
  gap: 1.125rem;
  justify-items: start;
}
.panel > .field { justify-self: stretch; }
.panel__title { margin: 0; font-family: var(--display); font-weight: 800; font-size: 1.375rem; text-transform: uppercase; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 0.625rem 1.5rem; margin: 0; }
.kv dt { font-family: var(--mono); font-size: 0.625rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--chalk-3); align-self: center; }
.kv dd { margin: 0; font-family: var(--mono); font-size: 0.8125rem; }

/* ---- admin layout fixes ---------------------------------------------- */
.btn--sm { padding: 0.6875rem 1.125rem; font-size: 0.6875rem; gap: 0.5rem; }
.nav .btn--sm { padding: 0.6875rem 1.125rem; }

.admin-page .field { gap: 0.4375rem; }
.admin-page .login { gap: 1.5rem; }
.admin-page .login .hint { margin: 0; }

/* One control height across the toolbar. */
.toolbar input, .toolbar select, .toolbar .btn { height: 2.75rem; }
.toolbar select {
  appearance: none;
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237c7970' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  border-radius: var(--radius);
}
.toolbar input { border-radius: var(--radius); }
.toolbar__search { width: 300px; max-width: 100%; }

.tabs { margin-top: 0.5rem; }

.fill-row__bar i { min-width: 2px; }

@media (max-width: 700px) {
  .admin-page #last-sync { display: none; }
  .admin-page .brand small { display: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { padding: 1rem 1.125rem; }
  .toolbar { gap: 0.5rem; }
  .toolbar__search { width: 100%; }
  .toolbar select { flex: 1 1 40%; min-width: 0; }
  .toolbar .spacer { display: none; }
  .toolbar .btn { flex: 1 1 auto; justify-content: center; padding-inline: 0.75rem; }
  .settings-grid { grid-template-columns: 1fr; }
  .panel { padding: 1.25rem; }
  .kv { grid-template-columns: 1fr; gap: 0.25rem; }
  .kv dd { margin-bottom: 0.625rem; }
  .tabs { gap: 0; }
  .tabs [role='tab'] { flex: 1 0 auto; padding: 0.875rem 0.375rem; font-size: 0.625rem; letter-spacing: 0.04em; }
}

@media (max-width: 640px) {
  .modal {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: none;
  }
  .modal > form, .modal > div { height: 100%; max-height: 100dvh; }
  .modal__body { flex: 1; }
  .modal__body .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal__body .span-2 { grid-column: span 2; }
  .modal__foot { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; padding-block: 0.875rem; }
  .modal__foot .spacer { display: none; }
  .modal__foot .btn { justify-content: center; padding-inline: 0.5rem; }
}
@media (max-width: 420px) {
  .modal__body .grid-3 { grid-template-columns: 1fr; }
  .modal__body .span-2 { grid-column: span 1; }
}

/* ---- desk users: walk-up entries & cash -------------------------------- */
.whoami {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hivis);
}
.field label .opt { color: var(--chalk-3); font-size: 0.8em; text-transform: none; letter-spacing: 0; margin-left: 0.25rem; }

.desk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
}
@media (max-width: 1040px) { .desk { grid-template-columns: 1fr; } }
.desk .fieldset { margin-bottom: 2rem; }
.desk__legend {
  margin-bottom: 1rem;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--chalk-3);
}
.desk__pay { top: 1rem; }
.desk__pay .summary__race span { font-size: 1rem; }
.check--cash { border-color: var(--hivis); background: rgba(216, 255, 62, 0.06); color: var(--chalk); }
.check--cash b { color: var(--hivis); white-space: nowrap; }
.check.is-invalid { border-color: var(--bad); }
.check .err { grid-column: 2; font-family: var(--mono); font-size: 0.625rem; letter-spacing: 0.08em; color: var(--bad); }
.check .err:empty { display: none; }

.dupes {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--warn);
  background: rgba(251, 191, 36, 0.07);
  font-size: 0.8125rem;
  color: var(--chalk-2);
}
.dupes p { margin: 0; }
.dupes b { color: var(--chalk); }
.dupes ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.5rem; }
.dupes li { display: grid; gap: 0.125rem; }
.dupes .sub { color: var(--chalk-3); font-size: 0.75rem; }

.desk-done {
  max-width: 640px;
  margin: 1rem auto 0;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--hivis);
  background: var(--ink-2);
  display: grid;
  gap: 1.25rem;
  text-align: center;
}
.desk-done .eyebrow { margin: 0; color: var(--ok); }
.desk-done__bib {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(3.5rem, 12vw, 6.5rem);
  line-height: 0.9;
  color: var(--hivis);
  font-variant-numeric: tabular-nums;
}
.desk-done__name { margin: 0; font-size: 1.125rem; font-weight: 600; }
.desk-done .kv { text-align: left; justify-self: center; }
.desk-done__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }

.toolbar__note { margin: 0; max-width: 60ch; font-size: 0.8125rem; color: var(--chalk-3); }
.modal--narrow { width: min(620px, calc(100vw - 2rem)); }
.modal--narrow .grid-2 { gap: 1rem 1.25rem; align-items: end; }
.modal--narrow .check { grid-column: 1 / -1; }

.pill--on { color: var(--ok); }
.pill--off { color: var(--chalk-3); }
tbody td.held { color: var(--hivis); }
tbody td .linkbtn + .linkbtn { margin-left: 0.75rem; }

@media (max-width: 700px) {
  .whoami { display: none; }
  .desk-done__actions .btn { flex: 1 1 100%; justify-content: center; }
}

/* ---- printable receipt: only the receipt prints ------------------------- */
#print-area { display: none; }
@media print {
  body.admin-page { background: #fff; color: #000; }
  body.admin-page > *:not(#print-area) { display: none !important; }
  #print-area {
    display: block;
    max-width: 90mm;
    margin: 0 auto;
    font-family: var(--body);
    font-size: 11pt;
    color: #000;
  }
  .desk-receipt header { display: grid; gap: 2pt; text-align: center; padding-bottom: 6pt; border-bottom: 1pt dashed #000; }
  .desk-receipt header b { font-family: var(--display); font-size: 16pt; text-transform: uppercase; }
  .desk-receipt header span { font-family: var(--mono); font-size: 7pt; letter-spacing: 0.14em; text-transform: uppercase; }
  .desk-receipt__bib { margin-top: 8pt; text-align: center; font-family: var(--display); font-weight: 900; font-size: 36pt; line-height: 1; }
  .desk-receipt__name { margin: 4pt 0 8pt; text-align: center; font-weight: 700; }
  .desk-receipt dl { display: grid; grid-template-columns: auto 1fr; gap: 3pt 10pt; margin: 0; padding: 6pt 0; border-block: 1pt dashed #000; }
  .desk-receipt dt { font-family: var(--mono); font-size: 7pt; text-transform: uppercase; letter-spacing: 0.08em; align-self: center; }
  .desk-receipt dd { margin: 0; text-align: right; font-size: 9pt; }
  .desk-receipt footer { margin-top: 6pt; font-size: 8pt; text-align: center; }
}

.empty { padding: 4rem 1rem; text-align: center; color: var(--chalk-3); font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.12em; }

/* ---- payment method chooser (register summary) -------------------------- */
.pay-choice { border: 0; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.pay-choice > legend { padding: 0; margin-bottom: 0.25rem; }
.pay-choice__opt {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--line);
  background: var(--ink-2);
  cursor: pointer;
  transition: border-color 0.15s;
}
.pay-choice__opt:hover { border-color: var(--ink-4); }
.pay-choice__opt:has(input:checked) { border-color: var(--ember); background: rgba(255, 74, 22, 0.06); }
.pay-choice__opt input { accent-color: var(--ember); margin-top: 0.2rem; }
.pay-choice__opt b { display: block; font-size: 0.875rem; font-weight: 600; }
.pay-choice__opt small { display: block; font-size: 0.75rem; color: var(--chalk-3); margin-top: 0.125rem; }
.pay-guide { margin: 0.25rem 0 0; font-size: 0.75rem; color: var(--chalk-3); }

/* ---- manual UPI pay screen --------------------------------------------- */
.upi-pay { max-width: 34rem; margin: 0 auto; }
.upi-grid {
  display: grid; grid-template-columns: auto 1fr; gap: 1.5rem;
  align-items: start; text-align: left;
  padding: 1.25rem; border: 1px solid var(--line); background: var(--ink-2);
}
@media (max-width: 560px) { .upi-grid { grid-template-columns: 1fr; justify-items: center; } }
.upi-qr {
  background: #fff; padding: 0.75rem; display: grid; gap: 0.5rem; justify-items: center;
}
.upi-qr img { display: block; width: 220px; height: 220px; object-fit: contain; image-rendering: pixelated; }
.upi-qr__cap {
  margin: 0; font-family: var(--mono); font-size: 0.5625rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: #0a0b0d;
}
.upi-details { display: grid; gap: 0.625rem; align-content: start; width: 100%; }
.upi-details .copy-btn { margin-left: 0.375rem; vertical-align: middle; }
.upi-steps {
  display: grid; gap: 0.5rem; text-align: left;
  margin: 1.25rem auto; max-width: 30rem; font-size: 0.875rem; color: var(--chalk-2);
}
.upi-steps p { margin: 0; display: flex; gap: 0.75rem; }
.upi-steps b { font-family: var(--mono); color: var(--ember); flex-shrink: 0; }
.upi-utr {
  max-width: 26rem; margin: 1.5rem auto 0; text-align: left;
  padding: 1.5rem; border: 1px solid var(--line); background: var(--ink-2);
}
.upi-utr .btn { margin-top: 0.5rem; }

/* collapsible payment guide video on the UPI pay and resubmit screens */
.upi-guide {
  max-width: 26rem; margin: 1.25rem auto 0; text-align: left;
  border: 1px solid var(--line); background: var(--ink-2);
}
.upi-guide summary {
  cursor: pointer; padding: 0.75rem 1rem;
  font-family: var(--mono); font-size: 0.625rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--hivis);
}
.upi-guide summary:hover { background: var(--ink-3); }
.upi-guide video { display: block; width: 100%; background: #000; border-top: 1px solid var(--line); }
.upi-guide__cap { margin: 0; padding: 0.625rem 1rem; font-size: 0.75rem; line-height: 1.5; color: var(--chalk-3); }

/* ---- track page --------------------------------------------------------- */
.track-wrap { max-width: 720px; padding-bottom: clamp(3rem, 7vw, 6rem); display: grid; gap: 2rem; }
.track-form { display: grid; gap: 1.25rem; }
.track-card {
  border: 1px solid var(--line); background: var(--ink-2);
  padding: 1.5rem; display: grid; gap: 1rem;
}
.track-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.track-card__head h2 { margin: 0.25rem 0 0; font-family: var(--display); font-weight: 800; font-size: 1.375rem; text-transform: uppercase; }
.track-card__note { margin: 0; font-size: 0.875rem; color: var(--chalk-2); }
/* live waiting state inside a pending card — mirrors the status page hold */
.track-wait {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.875rem 1rem; border: 1px solid var(--line); background: var(--ink-3);
  font-size: 0.8125rem; color: var(--chalk-2);
}
.track-wait p { margin: 0; }
.track-wait p + p { margin-top: 0.5rem; }
.track-wait .spinner--sm { flex-shrink: 0; margin-top: 0.125rem; }
.track-wait .eyebrow { margin-bottom: 0.375rem; }
.track-wait b { color: var(--chalk); }
.track-wait--notice { border-color: var(--hivis); background: rgba(216, 255, 62, 0.06); }
.track-card__kv { margin: 0; text-align: left; }
.track-card__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.track-attempts { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.track-attempts th {
  text-align: left; font-family: var(--mono); font-size: 0.5625rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--chalk-3); padding: 0.5rem 0.5rem 0.5rem 0;
  border-bottom: 1px solid var(--line);
}
.track-attempts td { padding: 0.5rem 0.5rem 0.5rem 0; border-bottom: 1px solid var(--line); color: var(--chalk-2); vertical-align: top; }

/* ---- admin: UTR review + UPI QR ----------------------------------------- */
.tile.held .tile__v { color: var(--warn); }
.review-outcomes { display: grid; gap: 0.5rem; }
.review-outcomes .pay-choice__opt { padding: 0.625rem 0.75rem; }
.pay-history { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.pay-history li {
  display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: baseline;
  font-size: 0.8125rem; color: var(--chalk-2);
  padding-bottom: 0.5rem; border-bottom: 1px solid var(--line);
}
.pay-history .sub { flex-basis: 100%; color: var(--chalk-3); font-size: 0.75rem; }
#pay-body .kv { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1.25rem; margin: 0; text-align: left; }
#pay-body .kv dt { font-family: var(--mono); font-size: 0.625rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--chalk-3); }
#pay-body .kv dd { margin: 0; font-size: 0.875rem; }
.upi-preview {
  margin-top: 1rem; padding: 0.75rem; background: #fff; justify-self: start;
  border: 1px solid var(--line);
}
.upi-preview img { display: block; width: 180px; height: 180px; object-fit: contain; image-rendering: pixelated; }

/* inline UPI account editor — the old dialog, now a panel in the UPI tab.
   While it is open it replaces the accounts list (toolbar, banner, table)
   and runs the full width of the content column. */
.upi-editor { gap: 1.25rem; scroll-margin-top: 5rem; }
[data-panel='upi']:has(.upi-editor:not([hidden])) .toolbar,
[data-panel='upi']:has(.upi-editor:not([hidden])) #upi-banner,
[data-panel='upi']:has(.upi-editor:not([hidden])) .table-wrap { display: none; }
.upi-editor__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
}
.upi-editor__head .eyebrow { margin: 0 0 0.375rem; }
.upi-editor__head .panel__title { margin: 0; }
.upi-editor__x {
  background: none;
  border: 1px solid var(--line);
  color: var(--chalk-2);
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.upi-editor__x:hover { border-color: var(--hivis); color: var(--chalk); }
.upi-editor > .grid-2,
.upi-editor > .check,
.upi-editor__foot { width: 100%; }
.upi-editor > .upi-preview { margin-top: 0; }
.upi-editor__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.upi-editor__foot .spacer { flex: 1; }
@media (max-width: 640px) { .upi-editor__foot .spacer { display: none; } }

/* one pre-priced QR per race category, inside the UPI account editor */
.cat-qr { display: grid; gap: 0.5rem; }
.cat-qr__row {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto;
  gap: 0.75rem; align-items: center;
  padding: 0.5rem 0.75rem; border: 1px solid var(--line); background: var(--ink-2);
}
@media (max-width: 640px) { .cat-qr__row { grid-template-columns: 1fr; justify-items: start; } }
.cat-qr__name { font-size: 0.8125rem; }
.cat-qr__name b { font-family: var(--mono); color: var(--ember); margin-right: 0.25rem; }
.cat-qr__row .field { margin: 0; }
.cat-qr__row input[type="file"] { font-size: 0.75rem; max-width: 15rem; }
.cat-qr__state { justify-self: end; }
@media (max-width: 640px) { .cat-qr__state { justify-self: start; } }
.cat-qr__thumb {
  display: inline-block; width: 44px; height: 44px; padding: 2px;
  background: #fff; border: 1px solid var(--line);
}
.cat-qr__thumb img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
#upi-banner { margin: 1rem 0; }

/* ---- scroll reveal ----------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero__title .line > span { transform: none; }
}

/* ---- Odia ----------------------------------------------------------------
   Odia script has tall vowel signs above and below the line, no capitals and
   wide words, so the condensed, tightly-leaded uppercase display style clips
   and overflows. Open the leading, drop the tracking and scale the biggest
   headings down while the page is in Odia. */
html[lang='or'] h1,
html[lang='or'] h2,
html[lang='or'] h3,
html[lang='or'] h4 { line-height: 1.3; letter-spacing: 0; font-weight: 800; }
html[lang='or'] .display-xl { font-size: clamp(2.5rem, 8vw, 7rem); }
html[lang='or'] .display-l  { font-size: clamp(2rem, 5.5vw, 4.5rem); }
html[lang='or'] .display-m  { font-size: clamp(1.625rem, 3.2vw, 2.75rem); }
html[lang='or'] .hero__title .line { padding-bottom: 0.08em; }
html[lang='or'] .outline-type { -webkit-text-stroke-width: 1px; }
html[lang='or'] .eyebrow,
html[lang='or'] .btn,
html[lang='or'] .km__label,
html[lang='or'] .ticker__item,
html[lang='or'] .empty { letter-spacing: 0.02em; }
html[lang='or'] .eyebrow { font-size: 0.75rem; line-height: 1.5; }
html[lang='or'] .btn { font-size: 0.8125rem; }
html[lang='or'] .lede,
html[lang='or'] .faq p,
html[lang='or'] .hint { line-height: 1.7; }
html[lang='or'] .summary__race { line-height: 1.3; }
/* The mono labels are sized for Latin capitals; Odia needs a little more. */
html[lang='or'] .km__label,
html[lang='or'] .picker__meta { font-size: 0.75rem; letter-spacing: 0.02em; }
html[lang='or'] .clock__unit { font-size: 0.625rem; letter-spacing: 0.02em; }
html[lang='or'] .figures span { font-size: 0.6875rem; letter-spacing: 0.02em; }
html[lang='or'] .field > label { font-size: 0.8125rem; letter-spacing: 0.02em; }
