/* Legwork: track blue, navy ink, bib white, pace yellow. One family (Archivo), two widths. */

@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo-latin.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo-latin-ext.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: #0E1A3A;
  --ink-2: #2B3654;
  --muted: #5A6684;
  --track: #2348D8;
  --track-deep: #1A35A8;
  --track-wash: #E8EDFB;
  --paper: #F5F7FB;
  --white: #FFFFFF;
  --line: #DCE2EF;
  --line-strong: #C3CCE0;
  --pace: #FFC93C;
  --danger: #C62839;
  --danger-wash: #FDECEE;
  --ok: #0E8A63;
  --ok-wash: #E4F5EE;

  --font: 'Archivo', 'Arial Narrow', Arial, sans-serif;
  --display-stretch: 68%;
  --r-sm: 6px;
  --r: 8px;
  --r-lg: 14px;
  --shadow-paper: 0 1px 0 rgba(14, 26, 58, 0.04), 0 26px 44px -18px rgba(6, 16, 60, 0.55);
  --ring: 0 0 0 2px var(--bg), 0 0 0 5px var(--text);
}

/* Theme tokens. --white, --ink and --paper stay literal (used by the bib and other "paper" objects). */
:root, [data-theme='light'] {
  color-scheme: light;
  --bg: #F5F7FB;
  --surface: #FFFFFF;
  --surface-2: #F5F7FB;
  --text: #0E1A3A;
  --ink-2: #2B3654;
  --muted: #5A6684;
  --line: #DCE2EF;
  --line-strong: #C3CCE0;
  --link: #2348D8;
  --track-wash: #E8EDFB;
  --inverse-bg: #0E1A3A;
  --inverse-text: #FFFFFF;
  --band: #0E1A3A;
  --placeholder: #A7B0C6;
  --danger-text: #8E1A28;
  --danger-line: #F1C3C9;
  --ok-text: #0A5E44;
  --warn-wash: #FFF4D6;
  --warn-text: #7A5300;
}
[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0A1230;
  --surface: #111B42;
  --surface-2: #0C1538;
  --text: #EEF2FF;
  --ink-2: #C6CFEA;
  --muted: #97A3C7;
  --line: #233063;
  --line-strong: #34437C;
  --link: #93A9FF;
  --track: #3D63FF;
  --track-deep: #2C4FE6;
  --track-wash: #1A2867;
  --inverse-bg: #E8EDFF;
  --inverse-text: #0A1230;
  --band: #060B22;
  --placeholder: #56638F;
  --danger: #FF6B7D;
  --danger-wash: #3A1326;
  --danger-text: #FFC2CA;
  --danger-line: #6B2338;
  --ok: #3DD6A0;
  --ok-wash: #0D3A31;
  --ok-text: #9DF0CF;
  --warn-wash: #3A2D08;
  --warn-text: #FFDC85;
  --shadow-paper: 0 1px 0 rgba(0, 0, 0, .2), 0 26px 44px -18px rgba(0, 0, 0, .7);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  --display-words: 0.08em;
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--link); text-decoration-thickness: 2px; }
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }
strong { font-weight: 700; }
.nowrap { overflow-wrap: anywhere; }
.muted { color: var(--muted); }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--inverse-bg); color: var(--inverse-text); padding: 10px 16px; border-radius: var(--r);
  font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { width: min(1160px, 100% - 48px); margin-inline: auto; }

/* ---------- Wordmark ---------- */
.wordmark {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--text); text-decoration: none;
  font-weight: 850; font-stretch: 80%; font-size: 1.375rem; letter-spacing: -0.015em; line-height: 1;
}
.wordmark:hover { color: var(--text); }
.wordmark { --logo-hole: var(--surface); }
.logo-mark { width: 26px; height: 26px; color: var(--track); flex: none; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--track); --btn-fg: var(--white); --btn-border: var(--track);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border: 1.5px solid var(--btn-border); border-radius: var(--r);
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 700; font-size: 1rem; line-height: 1; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background-color .15s, border-color .15s, color .15s, transform .1s;
}
.btn:hover { --btn-bg: var(--track-deep); --btn-border: var(--track-deep); color: var(--btn-fg); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { cursor: not-allowed; opacity: .45; transform: none; }
.btn--primary[disabled]:hover { --btn-bg: var(--track); --btn-border: var(--track); }
.btn--secondary { --btn-bg: var(--surface); --btn-fg: var(--text); --btn-border: var(--line-strong); }
.btn--secondary:hover { --btn-bg: var(--track-wash); --btn-border: var(--link); --btn-fg: var(--link); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--white); --btn-border: rgba(255, 255, 255, .55); }
.btn--ghost:hover { --btn-bg: rgba(255, 255, 255, .12); --btn-border: var(--white); --btn-fg: var(--white); }
.btn--danger { --btn-bg: var(--danger); --btn-border: var(--danger); }
.btn--danger:hover { --btn-bg: #A21F2F; --btn-border: #A21F2F; }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: .9375rem; }
.btn--lg { min-height: 56px; padding: 0 28px; font-size: 1.0625rem; }
.btn--block { width: 100%; }
.btn.is-busy { pointer-events: none; }
.btn.is-busy::before {
  content: ''; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-row--center { justify-content: center; }

.link-quiet {
  background: none; border: 0; padding: 6px 2px; cursor: pointer;
  color: var(--ink-2); font-weight: 600; text-decoration: none; font-size: .9375rem;
}
.link-quiet:hover { color: var(--link); text-decoration: underline; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 20px; }
.field { display: grid; gap: 7px; }
.field__top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.field label { font-weight: 650; font-size: .9375rem; }
.field__aside { font-size: .875rem; font-weight: 600; }
.field__control { position: relative; }
.field input {
  width: 100%; height: 50px; padding: 0 14px;
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--r);
  font-size: 1rem; transition: border-color .15s, box-shadow .15s;
}
.field input:hover { border-color: #9AA6C2; }
.field input:focus { outline: none; border-color: var(--track); box-shadow: 0 0 0 4px rgba(35, 72, 216, .16); }
.field--error input { border-color: var(--danger); }
.field--error input:focus { box-shadow: 0 0 0 4px rgba(198, 40, 57, .16); }
.field__control--password input { padding-right: 76px; }
.reveal {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  height: 36px; padding: 0 12px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--link); font-weight: 700; font-size: .875rem; cursor: pointer;
}
.reveal:hover { background: var(--track-wash); }
.field__hint { font-size: .875rem; color: var(--muted); line-height: 1.45; }
.field__error { font-size: .875rem; color: var(--danger); font-weight: 600; line-height: 1.45; }
.field__error::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 8px; vertical-align: 2px; }

.check { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; font-size: .9375rem; line-height: 1.5; color: var(--ink-2); }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--track); cursor: pointer; }
.check label { cursor: pointer; }
.check--error input { outline: 2px solid var(--danger); outline-offset: 2px; }
.check__error { margin-top: -12px; padding-left: 34px; }

.meter { display: grid; gap: 6px; }
.meter__bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.meter__bar span { height: 4px; border-radius: 2px; background: var(--line); transition: background-color .2s; }
.meter__label { font-size: .8125rem; font-weight: 600; color: var(--muted); min-height: 1.2em; }
.meter[data-score='1'] .meter__bar span:nth-child(-n+1) { background: var(--danger); }
.meter[data-score='2'] .meter__bar span:nth-child(-n+2) { background: #D98A0B; }
.meter[data-score='3'] .meter__bar span:nth-child(-n+3) { background: var(--track); }
.meter[data-score='4'] .meter__bar span { background: var(--ok); }

.alert { padding: 13px 16px; border-radius: var(--r); font-size: .9375rem; font-weight: 600; line-height: 1.45; margin-bottom: 20px; }
.alert:focus { outline: none; }
.alert--error { background: var(--danger-wash); color: var(--danger-text); border-left: 4px solid var(--danger); }
.alert--ok { background: var(--ok-wash); color: var(--ok-text); border-left: 4px solid var(--ok); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 40; left: 50%; top: 18px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px;
  max-width: calc(100% - 32px); padding: 12px 10px 12px 18px;
  background: var(--inverse-bg); color: var(--inverse-text); border-radius: var(--r);
  box-shadow: 0 14px 30px -12px rgba(14, 26, 58, .6);
  font-weight: 600; font-size: .9375rem;
  animation: toast-in .35s cubic-bezier(.2, .9, .3, 1.2);
}
.toast::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--pace); flex: none; }
.toast.is-leaving { opacity: 0; transform: translate(-50%, -8px); transition: opacity .25s, transform .25s; }
.toast__close { border: 0; background: transparent; color: inherit; opacity: .7; font-size: 1.375rem; line-height: 1; width: 32px; height: 32px; border-radius: var(--r-sm); cursor: pointer; }
.toast__close:hover { opacity: 1; background: rgba(127, 127, 127, .15); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -12px); } }

/* ---------- The bib ---------- */
.bib {
  --bib-w: 360px;
  position: relative; width: var(--bib-w); max-width: 100%;
  background: var(--white); color: var(--ink);
  border-radius: 10px; box-shadow: var(--shadow-paper);
  text-align: center; overflow: hidden;
}
.bib__pin {
  position: absolute; width: 11px; height: 11px; border-radius: 50%;
  background: var(--paper); box-shadow: inset 0 1px 2px rgba(14, 26, 58, .35);
}
.bib__pin--tl { top: 14px; left: 14px; } .bib__pin--tr { top: 14px; right: 14px; }
.bib__pin--bl { bottom: 58px; left: 14px; } .bib__pin--br { bottom: 58px; right: 14px; }
.bib__head {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 18px 40px 0; font-weight: 850; font-stretch: 80%; font-size: 1rem; color: var(--track);
}
.bib__head .logo-mark { width: 18px; height: 18px; }
.bib__number {
  padding: 4px 24px 0;
  font-size: calc(var(--bib-w) * .37); font-weight: 900; font-stretch: 62%;
  line-height: .95; letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bib__name {
  padding: 2px 28px 20px; min-height: 1.4em;
  font-size: calc(var(--bib-w) * .062); font-weight: 750; font-stretch: 85%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bib__name.is-placeholder { color: #A7B0C6; }
.bib__tab {
  border-top: 2px dashed var(--line-strong); background: var(--paper);
  padding: 12px 20px; font-size: .8125rem; font-weight: 600; color: var(--muted);
}
.bib--md { --bib-w: 300px; }
.bib--md .bib__pin--bl, .bib--md .bib__pin--br { bottom: 54px; }

.bib--print .bib__number { animation: ink 1s .25s steps(18, end) both; }
@keyframes ink { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ---------- Track panel (auth) ---------- */
.auth__grid { min-height: 100vh; display: grid; grid-template-columns: minmax(400px, 46%) 1fr; }
.track {
  position: relative; overflow: hidden; isolation: isolate;
  background: #2348D8; color: var(--white);
  display: flex; flex-direction: column; padding: 32px 48px 48px;
}
.track__lanes {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, transparent 0 72px, rgba(255, 255, 255, .5) 72px 78px, transparent 78px),
    repeating-linear-gradient(180deg, transparent 0 calc(12.5vh - 2px), rgba(255, 255, 255, .17) calc(12.5vh - 2px) 12.5vh);
}
.track__top .wordmark { color: var(--white); --logo-hole: #2348D8; }
.track__top .logo-mark { color: var(--white); }
.track__body { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 44px; padding-left: 70px; }
.track .bib { transform: rotate(-3.5deg); }
.track__copy { max-width: 26rem; }
.track__copy h2 { font-size: clamp(2rem, 3.2vw, 2.75rem); font-weight: 850; font-stretch: var(--display-stretch); line-height: 1; letter-spacing: -0.01em; word-spacing: var(--display-words); margin-bottom: 14px; }
.track__copy p { font-size: 1.0625rem; color: rgba(255, 255, 255, .86); max-width: 34ch; }

.auth__main { display: flex; flex-direction: column; align-items: center; padding: 48px 24px 28px; }
.auth__mobile-head { display: none; }
.auth__card { width: 100%; max-width: 420px; margin-block: auto; }
.auth__title { font-size: 2.5rem; font-weight: 850; font-stretch: var(--display-stretch); line-height: 1.02; letter-spacing: -0.01em; word-spacing: var(--display-words); margin-bottom: 10px; }
.auth__lead { color: var(--ink-2); font-size: 1.0625rem; margin-bottom: 28px; }
.auth__switch { margin-top: 24px; text-align: center; color: var(--ink-2); font-size: .9375rem; }
.auth__switch a { font-weight: 700; }
.auth__legal { display: flex; gap: 20px; margin-top: 32px; font-size: .8125rem; }
.auth__legal a { color: var(--muted); }
.auth__icon { width: 56px; height: 56px; border-radius: 14px; background: var(--track-wash); display: grid; place-items: center; margin-bottom: 20px; }
.auth__icon svg { width: 30px; fill: none; stroke: var(--link); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.stack-sm { display: grid; gap: 4px; }
.pending-resend { margin-bottom: 24px; }

@media (max-width: 900px) {
  .auth__grid { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .track { display: none; padding: 20px 24px 28px; }
  .track:has(.bib) { display: flex; }
  .track:has(.bib) .track__top, .track:has(.bib) .track__copy { display: none; }
  .track__lanes { background: repeating-linear-gradient(180deg, transparent 0 38px, rgba(255, 255, 255, .17) 38px 40px); }
  .track__body { padding: 0; align-items: center; gap: 0; }
  .track .bib { --bib-w: 230px; }
  .track .bib .bib__pin--bl, .track .bib .bib__pin--br { bottom: 52px; }
  .auth__main { padding-top: 22px; }
  .auth__mobile-head { display: block; width: 100%; max-width: 420px; margin-bottom: 28px; }
  .auth__card { margin-block: 0 auto; }
  .auth__title { font-size: 2.125rem; }
}

/* ---------- Public site ---------- */
.site-header { position: absolute; inset: 0 0 auto; z-index: 5; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.site-header .wordmark { color: var(--white); --logo-hole: #2348D8; }
.site-header .logo-mark { color: var(--white); }
.site-header__nav { display: flex; align-items: center; gap: 18px; }
.site-header .link-quiet { color: var(--white); }
.site-header .btn--primary { --btn-bg: var(--white); --btn-fg: var(--track-deep); --btn-border: var(--white); }
.site-header .btn--primary:hover { --btn-bg: var(--pace); --btn-border: var(--pace); --btn-fg: var(--ink); }

/* Legal pages have no blue hero, so the header sits on paper. */
.site:not(:has(.hero)) .site-header { position: static; border-bottom: 1px solid var(--line); background: var(--surface); }
.site:not(:has(.hero)) .site-header .wordmark { color: var(--text); --logo-hole: var(--surface); }
.site:not(:has(.hero)) .site-header .logo-mark { color: var(--track); }
.site:not(:has(.hero)) .site-header .link-quiet { color: var(--ink-2); }
.site:not(:has(.hero)) .site-header .btn--primary { --btn-bg: var(--track); --btn-fg: var(--white); --btn-border: var(--track); }

.hero {
  position: relative; isolation: isolate; overflow: hidden;
  background: #2348D8; color: var(--white);
  padding: 150px 0 110px;
}
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: repeating-linear-gradient(180deg, transparent 0 78px, rgba(255, 255, 255, .14) 78px 80px);
}
.hero__inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 64px; align-items: center; }
.hero__title {
  font-size: clamp(3.25rem, 7.4vw, 6.5rem); font-weight: 900; font-stretch: 64%;
  line-height: .9; letter-spacing: -0.005em; word-spacing: var(--display-words); max-width: 9.5em; margin-bottom: 28px;
}
.hero__lead { font-size: 1.1875rem; line-height: 1.55; color: rgba(255, 255, 255, .9); max-width: 34rem; margin-bottom: 34px; }
.hero .btn--primary { --btn-bg: var(--pace); --btn-fg: var(--ink); --btn-border: var(--pace); }
.hero .btn--primary:hover { --btn-bg: #FFD566; --btn-border: #FFD566; }
.hero__fine { margin-top: 18px; font-size: .9375rem; color: rgba(255, 255, 255, .75); }

.standings { margin: 0; background: var(--white); color: var(--ink); border-radius: var(--r-lg); box-shadow: var(--shadow-paper); padding: 8px 8px 12px; }
.standings__cap { display: flex; justify-content: space-between; padding: 14px 16px 10px; font-size: .875rem; font-weight: 700; color: var(--muted); }
.standings__list { list-style: none; margin: 0; padding: 0; }
.lane {
  display: grid; grid-template-columns: 30px 58px 1fr auto; align-items: center; column-gap: 14px; row-gap: 8px;
  padding: 12px 16px; border-top: 1px solid var(--line);
}
.lane__no { width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--ink); color: var(--white); display: grid; place-items: center; font-weight: 800; font-size: .9375rem; }
.lane:first-child .lane__no { background: var(--pace); color: var(--ink); }
.lane__bib { border: 1.5px solid var(--line-strong); border-radius: 5px; text-align: center; font-weight: 900; font-stretch: 62%; font-size: 1.125rem; line-height: 1.5; font-variant-numeric: tabular-nums; }
.lane__name { font-weight: 700; }
.lane__steps { font-weight: 800; font-stretch: 80%; font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.lane__run { grid-column: 2 / -1; height: 5px; border-radius: 3px; background: var(--track-wash); overflow: hidden; }
.lane__fill { display: block; height: 100%; background: var(--track); border-radius: 3px; transform-origin: left; animation: run 1.1s cubic-bezier(.2, .8, .2, 1) both; }
.lane:nth-child(2) .lane__fill { animation-delay: .08s; } .lane:nth-child(3) .lane__fill { animation-delay: .16s; }
.lane:nth-child(4) .lane__fill { animation-delay: .24s; } .lane:nth-child(5) .lane__fill { animation-delay: .32s; }
@keyframes run { from { transform: scaleX(0); } }
.lane__fill--10 { width: 100%; } .lane__fill--9 { width: 90%; } .lane__fill--8 { width: 80%; } .lane__fill--7 { width: 70%; }
.lane__fill--6 { width: 60%; } .lane__fill--5 { width: 50%; } .lane__fill--4 { width: 40%; } .lane__fill--3 { width: 30%; }

.section-title { font-size: clamp(2rem, 4vw, 3rem); font-weight: 900; font-stretch: var(--display-stretch); line-height: 1; letter-spacing: -0.01em; word-spacing: var(--display-words); }
.how { padding: 96px 0; }
.how__steps { list-style: none; counter-reset: step; margin: 48px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.how__steps li { counter-increment: step; border-top: 3px solid var(--text); padding-top: 22px; }
.how__steps li::before { content: counter(step); display: block; font-size: 4.5rem; font-weight: 900; font-stretch: 62%; line-height: .9; color: var(--link); margin-bottom: 16px; }
.how__steps h3 { font-size: 1.375rem; font-weight: 800; margin-bottom: 8px; }
.how__steps p { color: var(--ink-2); max-width: 34ch; }

.promise { background: var(--band); color: var(--white); padding: 88px 0; }
.promise__inner { display: grid; grid-template-columns: .8fr 1.2fr; gap: 64px; align-items: start; }
.promise__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.promise__list li { position: relative; padding-left: 38px; font-size: 1.0625rem; color: rgba(255, 255, 255, .82); max-width: 52ch; }
.promise__list li::before { content: ''; position: absolute; left: 0; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--pace) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M6 11.5l3.2 3.2L16 8' fill='none' stroke='%230E1A3A' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 22px no-repeat; }
.promise__list strong { color: var(--white); }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.site-footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 28px 0; }
.site-footer nav { display: flex; gap: 24px; }
.site-footer nav a { color: var(--muted); font-size: .9375rem; }

.prose { max-width: 70ch; padding: 64px 0 96px; }
.prose h1 { font-size: 3rem; font-weight: 900; font-stretch: var(--display-stretch); line-height: 1; margin-bottom: 10px; }
.prose h2 { font-size: 1.375rem; font-weight: 800; margin: 36px 0 10px; }
.prose p, .prose li { color: var(--ink-2); font-size: 1.0625rem; }
.prose p + p { margin-top: 12px; }
.prose ul { padding-left: 1.2em; display: grid; gap: 8px; }
.prose__meta { color: var(--muted); }
.draft-note { margin: 24px 0 8px; padding: 12px 16px; border-radius: var(--r); background: var(--warn-wash); border-left: 4px solid var(--pace); color: var(--text) !important; font-weight: 600; }

@media (max-width: 960px) {
  .hero { padding: 116px 0 72px; }
  .hero__inner, .promise__inner { grid-template-columns: 1fr; gap: 48px; }
  .how__steps { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 560px) {
  .wrap { width: calc(100% - 32px); }
  .site-header .link-quiet { display: none; }
  .hero .btn-row .btn { flex: 1; }
  .lane { grid-template-columns: 26px 50px 1fr auto; column-gap: 10px; padding: 11px 10px; }
  .how, .promise { padding: 64px 0; }
}

/* ---------- App shell ---------- */
.app-bar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.app-bar__inner { display: flex; align-items: center; gap: 40px; height: 68px; }
.app-bar__nav { display: flex; gap: 6px; height: 100%; }
.app-bar__nav a {
  display: flex; align-items: center; padding: 0 12px; height: 100%;
  color: var(--ink-2); font-weight: 650; text-decoration: none;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.app-bar__nav a:hover { color: var(--text); }
.app-bar__nav a[aria-current='page'] { color: var(--text); border-bottom-color: var(--link); }
.app-bar__user { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.app-bar__name { font-weight: 650; max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bib-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 7px;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface);
  font-weight: 900; font-stretch: 62%; font-size: 1.125rem; line-height: 1.2; font-variant-numeric: tabular-nums;
}
.bib-chip .logo-mark { width: 16px; height: 16px; }

.app-main { padding: 44px 0 80px; }
.page-head { margin-bottom: 32px; }
.page-head h1 { font-size: clamp(2.25rem, 4.4vw, 3.25rem); font-weight: 900; font-stretch: var(--display-stretch); line-height: 1; letter-spacing: -0.01em; word-spacing: var(--display-words); margin-bottom: 8px; overflow-wrap: anywhere; }
.page-head p { color: var(--muted); font-size: 1.0625rem; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; }
.panel__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.panel__head h2 { font-size: 1.125rem; font-weight: 800; }

.dash { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }
.dash__side { display: grid; gap: 20px; justify-items: center; }
.today { display: grid; grid-template-columns: auto 1fr; gap: 36px; align-items: center; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.today__count { display: grid; }
.today__num { font-size: 6.5rem; font-weight: 900; font-stretch: 62%; line-height: .85; font-variant-numeric: tabular-nums; }
.today__unit { color: var(--muted); font-weight: 600; margin-top: 8px; }
.empty { display: grid; gap: 8px; justify-items: start; max-width: 40ch; }
.empty__title { font-weight: 800; font-size: 1.0625rem; }
.empty p:not(.empty__title) { color: var(--ink-2); margin-bottom: 8px; }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; padding-top: 24px; }
.week__day { display: grid; gap: 8px; justify-items: center; }
.week__bar { width: 100%; height: 110px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); }
.week__day--today .week__bar { border: 2px dashed var(--track); background: var(--track-wash); }
.week__day--future .week__bar { opacity: .5; }
.week__label { font-size: .8125rem; font-weight: 650; color: var(--muted); }
.week__day--today .week__label { color: var(--link); font-weight: 800; }

.stats { width: 100%; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.stats > div { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 20px; }
.stats > div + div { border-top: 1px solid var(--line); }
.stats dt { color: var(--muted); font-weight: 600; font-size: .9375rem; }
.stats dd { margin: 0; font-weight: 850; font-stretch: 80%; font-size: 1.25rem; }

/* ---------- Settings ---------- */
.settings { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.settings__section { display: grid; grid-template-columns: 280px 1fr; gap: 40px; padding: 32px; scroll-margin-top: 90px; }
.settings__section + .settings__section { border-top: 1px solid var(--line); }
.settings__intro h2 { font-size: 1.1875rem; font-weight: 800; margin-bottom: 6px; }
.settings__intro p { color: var(--muted); font-size: .9375rem; }
.settings__body { max-width: 520px; display: grid; gap: 18px; align-content: start; }
.settings__body .form { justify-items: start; }
.settings__body .field { width: 100%; }
.form--inline { grid-template-columns: 1fr auto; align-items: start; gap: 12px; }
.form--inline .btn { margin-top: 29px; }

.list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r); }
.list__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 16px; }
.list__row + .list__row { border-top: 1px solid var(--line); }
.list--compact .list__row { display: block; padding: 10px 16px; }
.list__row--warn { box-shadow: inset 3px 0 0 var(--danger); }
.list__title { font-weight: 700; display: block; }
.list__meta { color: var(--muted); font-size: .875rem; display: block; }
.tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 99px; background: var(--ok-wash); color: var(--ok-text); font-size: .75rem; font-weight: 700; vertical-align: 2px; }

.data-actions { display: grid; gap: 14px; }
.data-actions__item { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); }
.danger { border: 1px solid var(--danger-line); border-radius: var(--r); }
.danger summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px; cursor: pointer; border-radius: var(--r); }
.danger summary::-webkit-details-marker { display: none; }
.danger summary::after { content: ''; flex: none; width: 10px; height: 10px; border-right: 2px solid var(--danger); border-bottom: 2px solid var(--danger); transform: rotate(45deg) translateY(-3px); transition: transform .2s; }
.danger[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.danger summary .list__title { color: var(--danger); }
.danger .form { padding: 4px 16px 18px; }

@media (max-width: 900px) {
  .dash { grid-template-columns: 1fr; }
  .dash__side { grid-template-columns: auto 1fr; align-items: center; justify-items: stretch; }
  .settings__section { grid-template-columns: 1fr; gap: 18px; padding: 24px 20px; }
}
@media (max-width: 640px) {
  .app-bar__inner { gap: 16px; }
  .app-bar__name { display: none; }
  .app-bar__nav a { padding: 0 8px; }
  .today { grid-template-columns: 1fr; gap: 20px; }
  .today__num { font-size: 5rem; }
  .panel { padding: 20px; }
  .week { gap: 6px; }
  .week__bar { height: 80px; }
  .dash__side { grid-template-columns: 1fr; justify-items: center; }
  .form--inline { grid-template-columns: 1fr; }
  .form--inline .btn { margin-top: 0; }
  .data-actions__item { flex-direction: column; align-items: flex-start; }
}

/* ---------- Errors ---------- */
.error { min-height: 100vh; display: grid; place-content: center; justify-items: center; text-align: center; padding: 40px 24px; gap: 14px; }
.error .wordmark { margin-bottom: 28px; }
.error__code { font-size: 7rem; font-weight: 900; font-stretch: 62%; line-height: .85; color: var(--link); }
.error h1 { font-size: 2rem; font-weight: 850; font-stretch: var(--display-stretch); }
.error p:not(.error__code) { color: var(--ink-2); max-width: 44ch; margin-bottom: 14px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* ---------- Fixes from review ---------- */
.meter[hidden] { display: none; }
.alert:focus-visible { box-shadow: none; }
.app .toast { top: 84px; }
.bib__number.is-unprinted { color: #E3E8F2; }
.app-bar .link-quiet { white-space: nowrap; }
@media (max-width: 640px) {
  .app-bar .wordmark span, .app-bar .bib-chip { display: none; }
  .app-bar__inner { gap: 10px; }
}

/* ---------- Step 2: logging ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.page-head--row { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--link); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-quiet--danger:hover { color: var(--danger); }
.tag--warn { background: var(--warn-wash); color: var(--warn-text); }
.tag--quiet { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.tag { margin-left: 0; }

/* Week chart */
.week-head { display: flex; justify-content: space-between; align-items: baseline; padding-top: 24px; }
.week-head h3 { font-size: 1rem; font-weight: 800; }
.week-head p { color: var(--muted); }
.week-head strong { color: var(--text); font-weight: 850; font-stretch: 80%; font-size: 1.125rem; }
ol.week { list-style: none; margin: 0; padding: 12px 0 0; }
.week__day { gap: 6px; }
.week__value { font-size: .8125rem; font-weight: 800; font-stretch: 80%; min-height: 1.2em; font-variant-numeric: tabular-nums; }
.week__bar { display: block; height: 110px; overflow: hidden; }
.week__bar rect { fill: var(--track); }
.week__day--review .week__bar rect { fill: #9DB0EC; }
.week__day--today .week__bar { border: 2px dashed var(--track); }
.week__day--today .week__bar rect { fill: var(--track); }
.week__day--today .week__value { color: var(--link); }

.nudge { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 20px; padding: 12px 16px; border-radius: var(--r); background: var(--warn-wash); font-size: .9375rem; font-weight: 600; }
.nudge a { font-weight: 800; white-space: nowrap; }

/* Upload */
.upload-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.upload { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; display: grid; gap: 16px; }
.drop { position: relative; display: grid; place-items: center; min-height: 340px; padding: 24px; border: 2px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--surface-2); cursor: pointer; text-align: center; transition: border-color .15s, background-color .15s; }
.drop:hover, .drop.is-over { border-color: var(--track); background: var(--track-wash); }
.drop:focus-within { border-color: var(--track); box-shadow: 0 0 0 4px rgba(35, 72, 216, .16); }
.drop__input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.drop__empty { display: grid; justify-items: center; gap: 8px; pointer-events: none; }
.drop__icon { width: 56px; height: 56px; fill: none; stroke: var(--link); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 6px; }
.drop__title { font-size: 1.25rem; font-weight: 800; }
.drop__hint { color: var(--muted); font-size: .9375rem; }
.drop__preview { position: relative; display: block; pointer-events: none; border-radius: 12px; overflow: hidden; box-shadow: 0 18px 36px -18px rgba(14, 26, 58, .5); }
.drop__preview[hidden], .drop__empty[hidden] { display: none; }
.drop__preview img { display: block; max-height: 420px; width: auto; }
.drop__scan { position: absolute; inset: 0; display: none; }
.upload.is-reading .drop__scan { display: block; background: linear-gradient(180deg, transparent 0, rgba(255, 201, 60, .0) 40%, rgba(255, 201, 60, .55) 50%, rgba(255, 201, 60, 0) 60%, transparent 100%); background-size: 100% 300%; animation: scan 1.4s ease-in-out infinite; }
@keyframes scan { from { background-position: 0 100%; } to { background-position: 0 0; } }
.upload__status { min-height: 1.4em; color: var(--muted); font-size: .9375rem; text-align: center; }
.tips { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; }
.tips h2 { font-size: 1.125rem; font-weight: 800; margin-bottom: 14px; }
.tips ul { margin: 0 0 16px; padding-left: 1.1em; display: grid; gap: 10px; color: var(--ink-2); }
.tips__note { font-size: .9375rem; color: var(--muted); padding-top: 14px; border-top: 1px solid var(--line); }

/* Confirm */
.confirm-grid { display: grid; grid-template-columns: minmax(0, auto) minmax(320px, 440px); gap: 40px; align-items: start; justify-content: start; }
.shot { margin: 0; }
.shot__frame { position: relative; display: inline-block; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-paper); background: var(--white); }
.shot__frame img { display: block; max-height: 74vh; width: auto; max-width: 100%; height: auto; }
.shot__mark { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.shot__mark rect { fill: rgba(255, 201, 60, .22); stroke: var(--pace); stroke-width: 3; animation: mark .6s .2s cubic-bezier(.2, .9, .3, 1.2) both; transform-origin: center; transform-box: fill-box; }
@keyframes mark { from { opacity: 0; transform: scale(1.25); } }
.confirm-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; position: sticky; top: 92px; }
.confirm { display: grid; gap: 20px; }
.verdict__label { color: var(--muted); font-weight: 650; }
.verdict__num { font-size: clamp(4.5rem, 9vw, 6.5rem); font-weight: 900; font-stretch: 62%; line-height: .9; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.verdict__unit { font-weight: 700; font-size: 1.125rem; margin-top: 4px; }
.verdict--none h2, .verdict--blocked h2 { font-size: 1.5rem; font-weight: 850; font-stretch: 80%; line-height: 1.15; margin-bottom: 8px; }
.verdict--none p, .verdict--blocked p { color: var(--ink-2); }
.verdict--blocked { padding: 16px 18px; border-radius: var(--r); background: var(--danger-wash); border-left: 4px solid var(--danger); margin-bottom: 20px; }
.day-chip { display: inline-flex; align-items: center; gap: 9px; justify-self: start; padding: 8px 14px; border-radius: 99px; background: var(--track-wash); color: var(--link); font-weight: 700; }
.day-chip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--track); }
.day-pick { border: 0; padding: 0; margin: 0; }
.day-pick legend { font-weight: 800; padding: 0; }
.day-pick__hint { color: var(--muted); font-size: .9375rem; margin: 2px 0 12px; }
.day-pick__options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice > span { display: grid; gap: 2px; padding: 14px 16px; border: 1.5px solid var(--line-strong); border-radius: var(--r); color: var(--muted); font-size: .9375rem; transition: border-color .15s, background-color .15s; }
.choice strong { color: var(--text); font-size: 1rem; }
.choice:hover > span { border-color: #9AA6C2; }
.choice input:checked + span { border-color: var(--track); background: var(--track-wash); box-shadow: inset 0 0 0 1px var(--track); }
.choice input:focus-visible + span { box-shadow: var(--ring); }
.fix { border-top: 1px solid var(--line); padding-top: 14px; }
.fix summary { cursor: pointer; font-weight: 700; color: var(--link); list-style: none; display: inline-flex; align-items: center; gap: 8px; }
.fix summary::-webkit-details-marker { display: none; }
.fix summary::after { content: ''; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.fix[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.fix__body { display: grid; gap: 12px; padding-top: 14px; }
.fix__hint { color: var(--muted); font-size: .875rem; }
.replace-note { font-size: .9375rem; color: var(--ink-2); padding: 10px 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.confirm__alt { text-align: center; margin-top: 14px; }

/* History */
.history { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.history__row { display: grid; grid-template-columns: 170px 150px 1fr auto; gap: 16px; align-items: center; padding: 16px 22px; }
.history__row + .history__row { border-top: 1px solid var(--line); }
.history__day { display: grid; }
.history__rel { font-weight: 750; }
.history__date { color: var(--muted); font-size: .875rem; }
.history__steps { font-size: 1.625rem; font-weight: 900; font-stretch: 68%; font-variant-numeric: tabular-nums; }
.history__steps span { font-size: .875rem; font-weight: 600; font-stretch: 100%; color: var(--muted); }
.history__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.history__actions { display: flex; align-items: center; gap: 14px; }
.empty-state { display: grid; justify-items: start; gap: 8px; }
.empty-state p:not(.empty__title) { color: var(--ink-2); margin-bottom: 8px; }

@media (max-width: 900px) {
  .upload-grid, .confirm-grid { grid-template-columns: 1fr; }
  .confirm-panel { position: static; }
  .shot { text-align: center; }
  .shot__frame img { max-height: 52vh; }
  .history__row { grid-template-columns: 1fr auto; row-gap: 8px; }
  .history__tags { grid-column: 1 / -1; }
  .history__actions { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .drop { min-height: 260px; }
  .upload, .tips, .confirm-panel { padding: 18px; }
  .week__value { font-size: .6875rem; }
}
/* ---------- Log steps: manual first ---------- */
.log-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 28px; align-items: start; }
.log-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; display: grid; gap: 18px; }
.log-card > *, .day-pick { min-width: 0; }
.count-field__box input { width: 100%; }
.log-card h2 { font-size: 1.375rem; font-weight: 850; font-stretch: 80%; }
.log-card--primary { border-top: 4px solid var(--track); }
.log-card__lead { color: var(--ink-2); margin-top: -8px; }
.choice__meta { display: block; font-style: normal; font-size: .8125rem; margin-top: 4px; color: var(--muted); }
.choice input:checked + span .choice__meta { color: var(--link); }
.count-field { display: grid; gap: 7px; }
.count-field label { font-weight: 650; font-size: .9375rem; }
.count-field__box { display: flex; align-items: baseline; gap: 12px; padding: 6px 18px; background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--r); transition: border-color .15s, box-shadow .15s; }
.count-field__box:focus-within { border-color: var(--track); box-shadow: 0 0 0 4px rgba(35, 72, 216, .16); }
.count-field__box:has([aria-invalid='true']) { border-color: var(--danger); }
.count-field__box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 0; font-size: 4rem; font-weight: 900; font-stretch: 62%; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text); }
.count-field__box input::placeholder { color: var(--placeholder); }
.count-field__box span { font-weight: 700; color: var(--muted); }
.drop--compact { min-height: 220px; }
.log-card.upload { padding: 28px; }
@media (max-width: 900px) {
  .log-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .log-card, .log-card.upload { padding: 20px; }
  .count-field__box input { font-size: 3.25rem; }
}

/* Paper objects (bib, example leaderboard) stay light in both themes */
.bib, .standings { --line: #DCE2EF; --line-strong: #C3CCE0; --muted: #5A6684; --track-wash: #E8EDFB; --text: #0E1A3A; color-scheme: light; }

/* Theme switch */
.theme-form { display: inline-flex; margin: 0; }
.theme-toggle { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r); border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--text); cursor: pointer; transition: border-color .15s, background-color .15s; }
.theme-toggle:hover { border-color: var(--link); background: var(--track-wash); }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-sun { display: none; }
[data-theme='dark'] .theme-toggle .icon-sun { display: block; }
[data-theme='dark'] .theme-toggle .icon-moon { display: none; }
.site-header .theme-toggle { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, .45); }
.site-header .theme-toggle:hover { background: rgba(255, 255, 255, .12); border-color: var(--white); }
.site:not(:has(.hero)) .site-header .theme-toggle { color: var(--text); border-color: var(--line-strong); }
.auth__tools { width: 100%; max-width: 420px; display: flex; justify-content: flex-end; margin-bottom: 8px; }
.theme-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 420px; }

/* 7-day strip */
.day-strip { border: 0; padding: 0; margin: 0; min-width: 0; }
.day-strip__legend { font-weight: 800; padding: 0; }
.day-strip__days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day-chip-opt { position: relative; cursor: pointer; min-width: 0; }
.day-chip-opt input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.day-chip-opt > span { display: grid; justify-items: center; gap: 1px; padding: 10px 2px 9px; border: 1.5px solid var(--line-strong); border-radius: var(--r); text-align: center; transition: border-color .15s, background-color .15s; }
.day-chip-opt:hover > span { border-color: var(--muted); }
.day-chip-opt__name { font-size: .75rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.day-chip-opt__num { font-size: 1.5rem; font-weight: 900; font-stretch: 68%; line-height: 1.1; font-variant-numeric: tabular-nums; }
.day-chip-opt__steps { font-size: .6875rem; font-weight: 650; color: var(--muted); white-space: nowrap; }
.day-chip-opt--logged .day-chip-opt__steps { color: var(--ok); }
.day-chip-opt input:checked + span { border-color: var(--link); background: var(--track-wash); box-shadow: inset 0 0 0 1px var(--link); }
.day-chip-opt input:checked + span .day-chip-opt__name { color: var(--link); }
.day-chip-opt input:focus-visible + span { box-shadow: var(--ring); }
.replace-hint { min-height: 1.3em; margin-top: -8px; font-size: .875rem; color: var(--muted); }
@media (max-width: 400px) {
  .day-strip__days { gap: 4px; }
  .day-chip-opt__num { font-size: 1.25rem; }
  .day-chip-opt__steps { font-size: .625rem; }
}
@media (max-width: 640px) {
  .app-bar__inner { gap: 6px; }
  .app-bar__nav { gap: 0; }
  .app-bar__nav a { padding: 0 7px; }
  .app-bar__user { gap: 8px; }
  .app-bar .theme-toggle { width: 36px; height: 36px; }
}
@media (max-width: 400px) {
  .app-bar .wordmark { display: none; }
}

/* ===================== Step 3: league, goals, medals, food ===================== */

/* Nav: text on desktop, icon tabs on phones */
.app-bar__nav a svg { display: none; }
.app-bar__nav a span { display: inline; }
.tab-bar { display: none; }
.bib-chip { text-decoration: none; color: var(--text); }
.bib-chip:hover { border-color: var(--link); color: var(--text); }
@media (max-width: 760px) {
  .app-bar__nav { display: none; }
  .app-bar .wordmark { display: inline-flex; }
  .app-bar .wordmark span { display: inline; }
  .app-bar .bib-chip { display: inline-flex; }
  .app-main { padding-bottom: 110px; }
  .tab-bar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .tab-bar a { display: grid; justify-items: center; gap: 3px; padding: 6px 2px; border-radius: var(--r); color: var(--muted); text-decoration: none; font-size: .6875rem; font-weight: 700; }
  .tab-bar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .tab-bar a[aria-current='page'] { color: var(--link); background: var(--track-wash); }
  .medal-toast, .app .toast { top: auto; bottom: 86px; }
}
@media (max-width: 400px) {
  .app-bar .wordmark span, .app-bar .bib-chip { display: none; }
}

/* Honesty note */
.honesty { margin-top: -4px; padding: 12px 14px; border-radius: var(--r); background: var(--warn-wash); color: var(--text); font-size: .9375rem; line-height: 1.45; border-left: 4px solid var(--pace); }
.honesty[hidden] { display: none; }
.log-side__goal { font-size: 3.5rem; font-weight: 900; font-stretch: 62%; line-height: 1; font-variant-numeric: tabular-nums; }
.log-side__goal span { font-size: 1rem; font-weight: 700; font-stretch: 100%; color: var(--muted); }
.log-side__rules { margin: 0; padding-left: 1.1em; display: grid; gap: 8px; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 16px; }

/* Goals and progress */
.dash__main { display: grid; gap: 28px; min-width: 0; }
.goals { display: grid; gap: 22px; }
.goal__top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.goal__label { font-weight: 750; }
.goal__reward { flex: none; font-size: .8125rem; font-weight: 800; color: var(--muted); padding: 2px 9px; border-radius: 99px; border: 1px solid var(--line-strong); }
.goal--done .goal__reward { color: var(--ok-text); background: var(--ok-wash); border-color: transparent; }
.goal__bar { height: 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.goal__fill { display: block; height: 100%; border-radius: 99px; background: var(--track); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.goal--done .goal__fill { background: var(--ok); }
.goal__meta { margin-top: 7px; font-size: .875rem; color: var(--muted); }
.goal--today { margin-top: -6px; padding-bottom: 6px; }
.goal--today .goal__bar { height: 12px; }
.stats dd a { color: inherit; text-decoration: none; }
.stats dd a:hover { color: var(--link); text-decoration: underline; }
.bib-link { display: block; border-radius: 10px; text-decoration: none; }
.bib-link:hover .bib { transform: translateY(-2px); }
.bib-link .bib { transition: transform .2s; }

/* Medals */
.medal { display: block; flex: none; }
.medal--md { width: 64px; height: 84px; }
.medal--sm { width: 40px; height: 52px; }
.medal--lg { width: 96px; height: 126px; }
.medal__ribbon-a { fill: var(--track); }
.medal__ribbon-b { fill: #1A35A8; }
.medal__rim { stroke: rgba(0, 0, 0, .18); stroke-width: 1; }
.medal__glyph { font-family: var(--font); font-weight: 900; font-stretch: 62%; font-size: 20px; fill: rgba(40, 24, 0, .82); }
.medal__glyph--sm { font-size: 16px; }
.medal__glyph--xs { font-size: 12.5px; }
.medal--gold .medal__rim { fill: #D29A13; } .medal--gold .medal__face { fill: #F7CB4D; }
.medal--silver .medal__rim { fill: #8D99AE; } .medal--silver .medal__face { fill: #DCE3EE; }
.medal--bronze .medal__rim { fill: #A35E2C; } .medal--bronze .medal__face { fill: #E0975C; }
.medal--locked .medal__rim, .medal--locked .medal__face { fill: var(--surface-2); stroke: var(--line-strong); stroke-width: 1.5; }
.medal--locked .medal__ribbon-a, .medal--locked .medal__ribbon-b { fill: var(--line-strong); }
.medal--locked .medal__glyph { fill: var(--muted); }
.medal-grid { list-style: none; margin: 0 0 36px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.medal-card { display: flex; gap: 16px; align-items: flex-start; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.medal-card__body { min-width: 0; flex: 1; }
.medal-card h3 { font-size: 1.0625rem; font-weight: 800; }
.medal-card p { color: var(--ink-2); font-size: .9375rem; margin-top: 2px; }
.medal-card__meta { color: var(--muted) !important; font-size: .8125rem !important; margin-top: 8px !important; font-weight: 600; }
.medal-card__meta--earned { color: var(--ok) !important; }
.medal-card__progress { height: 6px; margin-top: 12px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.medal-card__fill { display: block; height: 100%; background: var(--link); border-radius: 99px; }
.medal-card--locked h3 { color: var(--ink-2); }
.section-sub { font-size: 1.25rem; font-weight: 850; font-stretch: 80%; margin: 6px 0 14px; }
.medal-toast { position: fixed; z-index: 40; left: 50%; top: 84px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; max-width: calc(100% - 32px); padding: 12px 10px 12px 14px; border-radius: var(--r-lg); background: var(--inverse-bg); color: var(--inverse-text); box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .6); animation: medal-in .55s cubic-bezier(.2, .9, .3, 1.3); }
.medal-toast__art { display: flex; gap: 4px; }
.medal-toast__title { font-size: .8125rem; font-weight: 700; opacity: .75; }
.medal-toast__name { font-weight: 850; font-size: 1.0625rem; }
.medal-toast.is-leaving { opacity: 0; transition: opacity .25s; }
@keyframes medal-in { from { opacity: 0; transform: translate(-50%, -16px) scale(.92); } }

/* Leaderboard */
.tabs { display: flex; gap: 6px; margin-bottom: 22px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); width: max-content; max-width: 100%; }
.tabs a { padding: 8px 16px; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 700; text-decoration: none; white-space: nowrap; }
.tabs a:hover { color: var(--text); background: var(--surface-2); }
.tabs a[aria-current='page'] { background: var(--track); color: var(--white); }
.board-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.board { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.board__head { display: flex; justify-content: space-between; align-items: baseline; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.board__head h2 { font-size: 1.125rem; font-weight: 800; }
.board__head span { color: var(--muted); font-size: .9375rem; }
.board__list { list-style: none; margin: 0; padding: 0; }
.board__row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 110px; gap: 14px; align-items: center; padding: 13px 22px; }
.board__row + .board__row { border-top: 1px solid var(--line); }
.board__row--me { background: var(--track-wash); box-shadow: inset 4px 0 0 var(--link); }
.board__row--gap { border-top: 2px dashed var(--line-strong) !important; }
.board__rank { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); font-weight: 900; font-stretch: 80%; }
.board__row--top1 .board__rank { background: #F7CB4D; border-color: #D29A13; color: #3A2600; }
.board__row--top2 .board__rank { background: #DCE3EE; border-color: #8D99AE; color: #1D2433; }
.board__row--top3 .board__rank { background: #E0975C; border-color: #A35E2C; color: #2E1606; }
.board__who { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--text); text-decoration: none; }
.board__who:hover .board__name { text-decoration: underline; }
.board__bib { flex: none; min-width: 54px; padding: 1px 6px; text-align: center; border-radius: 5px; background: var(--white); color: var(--ink); border: 1.5px solid #C3CCE0; font-weight: 900; font-stretch: 62%; font-size: 1.0625rem; font-variant-numeric: tabular-nums; }
.board__name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board__steps { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .9375rem; text-align: right; white-space: nowrap; }
.board__points { text-align: right; font-weight: 900; font-stretch: 75%; font-size: 1.25rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.board__steps span, .board__points span { font-size: .8125rem; font-weight: 600; font-stretch: 100%; color: var(--muted); }
.board__empty { padding: 32px 22px; display: grid; gap: 8px; justify-items: start; }
.board-side { display: grid; gap: 16px; }
.you-card__label { font-weight: 750; color: var(--muted); }
.you-card__rank { font-size: 4.5rem; font-weight: 900; font-stretch: 62%; line-height: 1; margin: 6px 0 14px; }
.you-card__rank span { font-size: 1rem; font-weight: 650; font-stretch: 100%; color: var(--muted); margin-left: 8px; }
.you-card__stats { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; }
.you-card__stats dt { color: var(--muted); font-size: .8125rem; font-weight: 650; }
.you-card__stats dd { margin: 0; font-weight: 850; font-stretch: 80%; font-size: 1.25rem; }
.you-card .btn { margin-top: 14px; }
.how-points { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; }
.how-points summary { cursor: pointer; font-weight: 800; color: var(--link); }
.how-points ul { margin: 12px 0 0; padding-left: 1.1em; display: grid; gap: 8px; color: var(--ink-2); font-size: .9375rem; }

/* Profile */
.profile { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 40px; align-items: start; }
.profile__name { font-size: clamp(2.25rem, 4.4vw, 3.25rem); font-weight: 900; font-stretch: var(--display-stretch); line-height: 1; margin-bottom: 20px; overflow-wrap: anywhere; }
.profile__name .tag { font-size: .875rem; vertical-align: middle; font-stretch: 100%; }
.profile__stats { margin: 0 0 28px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.profile__stats > div { padding: 16px 18px; }
.profile__stats > div + div { border-left: 1px solid var(--line); }
.profile__stats dt { color: var(--muted); font-size: .8125rem; font-weight: 650; }
.profile__stats dd { margin: 2px 0 0; font-size: 1.75rem; font-weight: 900; font-stretch: 70%; font-variant-numeric: tabular-nums; }
.profile__stats dd span { font-size: .875rem; font-weight: 600; font-stretch: 100%; color: var(--muted); }
.medal-shelf { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px; }
.medal-shelf li { display: grid; justify-items: center; gap: 6px; width: 84px; text-align: center; font-size: .75rem; font-weight: 700; color: var(--ink-2); }
.medal-shelf .medal { width: 56px; height: 74px; }

/* Food */
.food-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; margin-top: 20px; }
.food-day__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.food-day__head h2 { font-size: 1.5rem; font-weight: 850; font-stretch: 80%; }
.food-day__total { color: var(--muted); font-weight: 700; }
.food-day__total span { color: var(--text); font-size: 3rem; font-weight: 900; font-stretch: 62%; line-height: 1; font-variant-numeric: tabular-nums; }
.food-day .empty { padding: 20px 0 6px; }
.food-list { list-style: none; margin: 0; padding: 0; }
.food-list__row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 0; }
.food-list__row + .food-list__row { border-top: 1px solid var(--line); }
.food-list__name { font-weight: 750; overflow-wrap: anywhere; }
.food-list__meta { color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.food-list__kcal { font-weight: 900; font-stretch: 75%; font-size: 1.25rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.food-list__kcal span { font-size: .8125rem; font-weight: 600; font-stretch: 100%; color: var(--muted); }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { color: var(--danger); border-color: var(--line); background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.food-add { display: grid; gap: 16px; }
.food-form { display: grid; gap: 14px; }
.food-form h2 { font-size: 1.125rem; font-weight: 800; }
.food-credit { font-size: .8125rem; color: var(--muted); }
.scan-cta { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--r-lg); background: #2348D8; color: var(--white); text-decoration: none; box-shadow: var(--shadow-paper); transition: transform .15s, background-color .15s; }
.scan-cta:hover { color: var(--white); background: #1A35A8; transform: translateY(-1px); }
.scan-cta svg { width: 44px; height: 44px; flex: none; fill: none; stroke: var(--pace); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.scan-cta strong { display: block; font-size: 1.25rem; font-weight: 850; }
.scan-cta span span { color: rgba(255, 255, 255, .8); font-size: .9375rem; }
.day-chip-link { color: var(--text); text-decoration: none; display: block; }
.day-chip-link:hover { color: var(--text); }
.day-chip-link[aria-current='page'] > span { border-color: var(--link); background: var(--track-wash); box-shadow: inset 0 0 0 1px var(--link); }
.day-chip-link[aria-current='page'] .day-chip-opt__name { color: var(--link); }

/* Scanner */
.scan { display: grid; gap: 16px; max-width: 560px; }
.scan__view { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-lg); overflow: hidden; background: #050A1C; border: 1px solid var(--line); }
.scan__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan__frame { position: absolute; inset: 22% 10%; pointer-events: none; display: none; }
.scan.is-live .scan__frame { display: block; }
.scan__frame::before, .scan__frame::after, .scan__frame span::before, .scan__frame span::after { content: ''; position: absolute; width: 34px; height: 34px; border: 4px solid var(--pace); }
.scan__frame::before { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.scan__frame::after { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.scan__frame span::before { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.scan__frame span::after { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.scan__frame span { position: absolute; inset: 0; }
.scan.is-live .scan__frame span { background: linear-gradient(180deg, transparent 48%, rgba(255, 201, 60, .9) 49%, rgba(255, 201, 60, .9) 51%, transparent 52%); background-size: 100% 200%; animation: scanline 1.6s ease-in-out infinite alternate; }
@keyframes scanline { from { background-position: 0 30%; } to { background-position: 0 70%; } }
.scan__idle { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 16px; padding: 20px; text-align: center; color: #C6CFEA; }
.scan__idle svg { width: 64px; height: 64px; fill: none; stroke: var(--pace); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.scan__idle p { font-size: .875rem; max-width: 34ch; }
.scan.is-live .scan__idle { display: none; }
.scan__status { min-height: 1.4em; font-weight: 650; color: var(--ink-2); }
.scan__type { display: grid; gap: 8px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.scan__type label { font-weight: 700; }
.scan__type-row { display: flex; gap: 10px; }
.scan__type-row input { flex: 1; min-width: 0; height: 48px; padding: 0 14px; border: 1.5px solid var(--line-strong); border-radius: var(--r); background: var(--surface); font-size: 1.0625rem; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.scan__type-row input:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 4px rgba(35, 72, 216, .16); }

/* Product */
.product { max-width: 600px; display: grid; gap: 20px; }
.product__brand { color: var(--muted); font-weight: 700; }
.product__head h1 { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 900; font-stretch: var(--display-stretch); line-height: 1.02; margin: 4px 0 6px; overflow-wrap: anywhere; }
.product__code { color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.product__facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.product__facts > div { padding: 16px 18px; }
.product__facts > div + div { border-left: 1px solid var(--line); }
.product__facts dt { color: var(--muted); font-size: .875rem; font-weight: 650; }
.product__facts dd { margin: 2px 0 0; font-size: 2rem; font-weight: 900; font-stretch: 68%; }
.product__facts dd span { font-size: .875rem; font-weight: 600; font-stretch: 100%; color: var(--muted); }
.product__form { display: grid; gap: 18px; }
.product__form h2 { font-size: 1.25rem; font-weight: 850; font-stretch: 80%; }
.product__total { font-size: 1.0625rem; color: var(--ink-2); }
.product__total strong { color: var(--text); font-size: 1.5rem; font-weight: 900; font-stretch: 75%; }

@media (max-width: 960px) {
  .board-grid, .food-grid, .profile { grid-template-columns: 1fr; }
  .profile__bib { justify-self: center; }
  .profile__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile__stats > div:nth-child(3) { border-left: 0; }
  .profile__stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .board__row { grid-template-columns: 38px minmax(0, 1fr) auto; padding: 12px 14px; gap: 10px; }
  .board__steps { display: none; }
  .board__bib { min-width: 44px; font-size: .9375rem; }
  .board__head { padding: 14px; }
  .tabs { width: 100%; }
  .tabs a { flex: 1; text-align: center; padding: 8px 6px; }
  .medal-grid { grid-template-columns: 1fr; }
  .product__facts > div + div { border-left: 0; border-top: 1px solid var(--line); }
}
[data-progress="0"] { width: 0%; }
[data-progress="5"] { width: 5%; }
[data-progress="10"] { width: 10%; }
[data-progress="15"] { width: 15%; }
[data-progress="20"] { width: 20%; }
[data-progress="25"] { width: 25%; }
[data-progress="30"] { width: 30%; }
[data-progress="35"] { width: 35%; }
[data-progress="40"] { width: 40%; }
[data-progress="45"] { width: 45%; }
[data-progress="50"] { width: 50%; }
[data-progress="55"] { width: 55%; }
[data-progress="60"] { width: 60%; }
[data-progress="65"] { width: 65%; }
[data-progress="70"] { width: 70%; }
[data-progress="75"] { width: 75%; }
[data-progress="80"] { width: 80%; }
[data-progress="85"] { width: 85%; }
[data-progress="90"] { width: 90%; }
[data-progress="95"] { width: 95%; }
[data-progress="100"] { width: 100%; }
.scan { width: 100%; }
.scan > * { min-width: 0; }
.scan__type-row input { width: 100%; }
.scan__type-row .btn { flex: none; }

/* Streak, next-up medals, medal page extras */
.streak { width: 100%; display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.streak__flame { width: 40px; height: 40px; flex: none; fill: var(--pace); }
.streak--none .streak__flame { fill: var(--line-strong); }
.streak--at-risk { border-color: var(--pace); box-shadow: inset 0 0 0 1px var(--pace); }
.streak__count { font-size: 2rem; font-weight: 900; font-stretch: 68%; line-height: 1; }
.streak__count span { font-size: 1rem; font-weight: 700; font-stretch: 100%; color: var(--muted); }
.streak__text { font-size: .875rem; color: var(--ink-2); margin-top: 4px; }
.next-medals { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.next-medals__item { display: flex; gap: 14px; align-items: flex-start; }
.next-medals__body { flex: 1; min-width: 0; }
.medal-card__rarity { font-size: .75rem !important; color: var(--muted) !important; margin-top: 4px !important; }
.medal-card--secret .medal__glyph { fill: var(--muted); }
.medal-card--secret { border-style: dashed; }
.section-sub__count { font-size: .9375rem; font-weight: 650; font-stretch: 100%; color: var(--muted); margin-left: 6px; }
.medal-section { scroll-margin-top: 90px; }
.tier-tally { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-bottom: 28px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.tier-tally__item { display: flex; align-items: center; gap: 8px; color: var(--ink-2); text-transform: none; }
.tier-tally__item strong { color: var(--text); font-size: 1.25rem; font-weight: 900; font-stretch: 75%; }
.tier-tally__jump { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.tier-tally__jump a { padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--ink-2); font-size: .8125rem; font-weight: 700; text-decoration: none; }
.tier-tally__jump a:hover { border-color: var(--link); color: var(--link); }
@media (max-width: 640px) { .tier-tally__jump { margin-left: 0; } }
img.medal { object-fit: contain; }
img.medal--locked { filter: grayscale(1); opacity: .4; }
.medal__icon { stroke: rgba(40, 24, 0, .82); }
.medal__icon * { vector-effect: none; }
.medal--locked .medal__icon { stroke: var(--muted); }
.medal__glyph--stamp { font-size: 8.5px; letter-spacing: .02em; }
.medal__glyph--stamp-long { font-size: 7px; }

/* ===================== Admin dashboard ===================== */
:root, [data-theme='light'] { --chart: #2348D8; --chart-lit: #1A35A8; --grid: #E3E8F2; }
[data-theme='dark'] { --chart: #5B7CFF; --chart-lit: #93A9FF; --grid: #1E2A57; }
.live { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: .9375rem; }
.live__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.kpi { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); display: grid; gap: 4px; align-content: start; }
.kpi__label { color: var(--muted); font-size: .875rem; font-weight: 650; }
.kpi__value { font-size: 2.5rem; font-weight: 900; font-stretch: 64%; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi__change { font-size: .75rem; font-weight: 650; color: var(--muted); }
.kpi__change--up { color: var(--ok); }
.kpi__change--down { color: var(--danger); }
.kpi__change--up::before { content: '\2191 '; }
.kpi__change--down::before { content: '\2193 '; }
.charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.chart { margin: 0; padding: 16px 16px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); min-width: 0; }
.chart__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.chart__head h3 { font-size: 1rem; font-weight: 800; }
.chart__head span { color: var(--muted); font-size: .8125rem; font-weight: 600; white-space: nowrap; }
.chart__plot { position: relative; }
.chart__plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart__grid { stroke: var(--grid); stroke-width: 1; }
.chart__axis { fill: var(--muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart__bar { fill: var(--chart); transition: fill .12s; }
.chart__bar.is-lit { fill: var(--chart-lit); }
.chart__hit { fill: transparent; cursor: crosshair; }
.chart-tip { position: absolute; z-index: 5; transform: translate(-50%, -100%); padding: 6px 10px; border-radius: var(--r-sm); background: var(--inverse-bg); color: var(--inverse-text); font-size: .8125rem; font-weight: 700; white-space: nowrap; pointer-events: none; box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .5); }
.chart-tip[hidden] { display: none; }
.chart__table { margin-top: 6px; }
.chart__table summary { cursor: pointer; font-size: .8125rem; font-weight: 700; color: var(--link); }
.chart__table table, .data-table { width: 100%; border-collapse: collapse; font-size: .875rem; margin-top: 8px; }
.chart__table th, .chart__table td, .data-table th, .data-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.data-table th, .chart__table th { color: var(--muted); font-weight: 700; font-size: .8125rem; }
.data-table .num, .chart__table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.data-table a { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.data-table a:hover { color: var(--link); }
.data-table .board__bib { min-width: 46px; font-size: .9375rem; }
.table-wrap { overflow-x: auto; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.admin-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-grid .panel h3 { font-size: 1rem; font-weight: 800; margin-bottom: 14px; }
.funnel__steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.funnel__top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.funnel__label { font-weight: 700; }
.funnel__value { font-weight: 900; font-stretch: 75%; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.funnel__rate { display: block; margin-top: 4px; font-size: .8125rem; color: var(--muted); font-weight: 600; }
.rank__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rank__row { position: relative; display: flex; justify-content: space-between; gap: 12px; padding: 6px 8px; border-radius: var(--r-sm); font-size: .9375rem; }
.rank__row .rank__bar { position: absolute; inset: 0; height: auto; border: 0; background: transparent; border-radius: var(--r-sm); }
.rank__row .rank__fill { background: var(--track-wash); border-radius: var(--r-sm); height: 100%; }
.rank__label, .rank__value { position: relative; }
.rank__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.rank__value { font-weight: 800; font-variant-numeric: tabular-nums; }
.funnel .rank__bar { display: block; height: 12px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.funnel .rank__fill { display: block; height: 100%; background: var(--chart); border-radius: 99px; }
.rank__unit { margin-top: 8px; font-size: .75rem; color: var(--muted); }
.facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.facts dt { color: var(--muted); font-size: .8125rem; font-weight: 650; }
.facts dd { margin: 2px 0 0; font-size: 1.5rem; font-weight: 900; font-stretch: 72%; font-variant-numeric: tabular-nums; }
.facts dd span { font-size: .875rem; font-weight: 600; font-stretch: 100%; color: var(--muted); }
.facts__note { margin-top: 14px; font-size: .8125rem; }
.admin-note { margin: -4px 0 24px; font-size: .875rem; }
.how-counted summary { cursor: pointer; font-weight: 800; color: var(--link); }
.how-counted ul { margin: 12px 0 0; padding-left: 1.1em; display: grid; gap: 8px; color: var(--ink-2); font-size: .9375rem; }
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .charts, .admin-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .charts, .admin-grid, .admin-grid--3 { grid-template-columns: 1fr; }
  .kpi__value { font-size: 2rem; }
  .tab-bar { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; }
}
.charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart--wide { grid-column: 1 / -1; }
.chart__axis { font-size: 12px; }
.rank__row .rank__fill { display: block; }
[data-theme='dark'] .rank__row .rank__fill { background: #1F2E70; }
@media (max-width: 1100px) { .charts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .charts { grid-template-columns: 1fr; } }
.tab-bar a { min-width: 0; }
.tab-bar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .live { font-size: .8125rem; }
  .tabs a { padding: 8px 4px; font-size: .875rem; }
}
.admin-grid > *, .charts > * { min-width: 0; }
@media (max-width: 760px) { .charts, .admin-grid, .admin-grid--3 { grid-template-columns: minmax(0, 1fr); } }

/* Home page hero: photo of a walker at sunset, headline over the sky */
.hero--photo {
  display: flex; align-items: flex-start; text-align: center;
  min-height: clamp(640px, 94vh, 940px); padding: 132px 0 64px;
  background-color: #0A1230;
  background-image:
    linear-gradient(180deg, rgba(10, 18, 48, .94) 0%, rgba(10, 18, 48, .78) 30%, rgba(10, 18, 48, .25) 56%, rgba(10, 18, 48, 0) 70%, rgba(10, 18, 48, .45) 100%),
    url('/img/hero-sunset-3000.jpg');
  background-image:
    linear-gradient(180deg, rgba(10, 18, 48, .94) 0%, rgba(10, 18, 48, .78) 30%, rgba(10, 18, 48, .25) 56%, rgba(10, 18, 48, 0) 70%, rgba(10, 18, 48, .45) 100%),
    image-set(url('/img/hero-sunset-3000.webp') type('image/webp'), url('/img/hero-sunset-3000.jpg') type('image/jpeg'));
  background-size: cover;
  background-position: center 75%;
}
.hero--photo::before { display: none; }
.hero--photo .hero__inner { grid-template-columns: 1fr; justify-items: center; width: min(1160px, 100% - 48px); }
.hero--photo .hero__copy { max-width: 820px; }
.hero--photo .hero__title { max-width: 13em; margin-inline: auto; text-shadow: 0 2px 28px rgba(0, 0, 0, .35); }
.hero--photo .hero__lead { margin-inline: auto; text-shadow: 0 1px 14px rgba(0, 0, 0, .45); }
.hero--photo .btn-row { justify-content: center; }
.hero--photo .hero__fine { color: rgba(255, 255, 255, .85); text-shadow: 0 1px 10px rgba(0, 0, 0, .5); }
.hero--photo .btn--ghost { --btn-bg: rgba(10, 18, 48, .35); backdrop-filter: blur(4px); }
@media (max-width: 760px) {
  .hero--photo {
    min-height: 92vh; padding-top: 108px;
    background-image:
      linear-gradient(180deg, rgba(10, 18, 48, .94) 0%, rgba(10, 18, 48, .8) 38%, rgba(10, 18, 48, .2) 64%, rgba(10, 18, 48, 0) 76%, rgba(10, 18, 48, .45) 100%),
      url('/img/hero-sunset-mobile.jpg');
    background-image:
      linear-gradient(180deg, rgba(10, 18, 48, .94) 0%, rgba(10, 18, 48, .8) 38%, rgba(10, 18, 48, .2) 64%, rgba(10, 18, 48, 0) 76%, rgba(10, 18, 48, .45) 100%),
      image-set(url('/img/hero-sunset-mobile.webp') type('image/webp'), url('/img/hero-sunset-mobile.jpg') type('image/jpeg'));
    background-position: center bottom;
  }
}

.table-preview { padding: 96px 0 24px; }
.table-preview__inner { display: grid; grid-template-columns: .9fr 1.1fr; gap: 64px; align-items: center; }
.table-preview__lead { margin-top: 16px; font-size: 1.125rem; color: var(--ink-2); max-width: 40ch; }
@media (max-width: 960px) { .table-preview__inner { grid-template-columns: 1fr; gap: 32px; } .table-preview { padding: 64px 0 8px; } }
@media (min-width: 961px) {
  .hero--photo {
    align-items: center; text-align: left; padding: 110px 0 72px;
    background-image:
      linear-gradient(180deg, rgba(10, 18, 48, .7) 0%, rgba(10, 18, 48, 0) 22%),
      linear-gradient(90deg, rgba(10, 18, 48, 0) 28%, rgba(10, 18, 48, .55) 52%, rgba(10, 18, 48, .9) 100%),
      url('/img/hero-sunset-3000.jpg');
    background-image:
      linear-gradient(180deg, rgba(10, 18, 48, .7) 0%, rgba(10, 18, 48, 0) 22%),
      linear-gradient(90deg, rgba(10, 18, 48, 0) 28%, rgba(10, 18, 48, .55) 52%, rgba(10, 18, 48, .9) 100%),
      image-set(url('/img/hero-sunset-3000.webp') type('image/webp'), url('/img/hero-sunset-3000.jpg') type('image/jpeg'));
    background-position: 30% 70%;
  }
  .hero--photo .hero__inner { grid-template-columns: 1fr 1fr; justify-items: stretch; }
  .hero--photo .hero__copy { grid-column: 2; max-width: 560px; }
  .hero--photo .hero__title { margin-inline: 0; font-size: clamp(3.25rem, 5.6vw, 5.5rem); }
  .hero--photo .hero__lead { margin-inline: 0; }
  .hero--photo .btn-row { justify-content: flex-start; }
}
.standings.is-armed:not(.is-visible) .lane__fill { animation-play-state: paused; }
