/* Archivo variable (SIL Open Font License), served from this site. */
@font-face {
  font-family: 'Archivo'; font-style: normal; font-weight: 400 800; font-stretch: 62% 125%; font-display: swap;
  src: url(../fonts/archivo-latin-ext.woff2) format('woff2');
  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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Archivo'; font-style: normal; font-weight: 400 800; font-stretch: 62% 125%; font-display: swap;
  src: url(../fonts/archivo-latin.woff2) format('woff2');
  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;
}

/* ---------------------------------------------------------------
   AGS (Age Group Stats; "Smilzo" until v0.11) - mobile-first.
   Andatura palette kept; type moved to Archivo (condensed cut for
   headlines and times, like race signage and the finish clock).
   One rule for colour: orange marks the top-10% cutoff, nothing else.
   --------------------------------------------------------------- */
:root {
  --c-primary:        #1E3A8C;   /* lane navy */
  --c-primary-hover:  #15296B;
  --c-primary-soft:   rgba(30, 58, 140, 0.07);
  --c-primary-ring:   rgba(30, 58, 140, 0.28);

  --c-accent:         #FF5C39;   /* cutoff orange */
  --c-accent-hover:   #E0411D;
  --c-accent-ink:     #C8361A;   /* orange that passes AA on white */
  --c-accent-soft:    rgba(255, 92, 57, 0.10);

  --c-highlight:      #FFD23F;   /* medal yellow, podium 1st only */
  --c-highlight-soft: rgba(255, 210, 63, 0.32);

  --c-ok:             #15803D;
  --c-ok-soft:        rgba(22, 163, 74, 0.10);
  --c-error:          #B42318;
  --c-error-soft:     rgba(192, 54, 47, 0.10);

  --c-text:           #0F172A;
  --c-text-muted:     #4B5870;
  --c-text-faint:     #8A96AB;

  --c-border:         #DCE2EC;
  --c-border-strong:  #B8C3D6;
  --c-bg:             #EEF1F6;   /* course grey */
  --c-card:           #FFFFFF;   /* bib paper */

  /* tokens the navy theme has to change (v0.12) */
  --c-on-primary:     #FFFFFF;   /* text on a --c-primary background */
  --c-highlight-ink:  #7A560F;   /* text on --c-highlight-soft */
  --c-header-bg:      rgba(238, 241, 246, 0.92);
  --c-row-hover:      #F7F9FC;
  --c-row-total:      #F5F7FB;
  --c-row-total-key:  #FCEDE9;
  --c-row-picked:     #EEF2FB;
  --c-brand:          var(--c-primary);
  color-scheme: light;

  --space-2xs: 0.25rem;
  --space-xs:  0.5rem;
  --space-sm:  0.75rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2.25rem;
  --space-2xl: 3rem;

  --gutter: 1rem;

  --radius-sm:   4px;
  --radius:      6px;
  --radius-lg:   10px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgb(15 23 42 / 5%);
  --shadow:    0 1px 3px rgb(15 23 42 / 8%);
  --shadow-lg: 0 12px 28px rgb(15 23 42 / 12%);

  --header-h:    3.5rem;
  --content-max: 70rem;

  --font-body: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --narrow: 72%;   /* font-stretch for display + clock figures */
}
@media (min-width: 48rem) {
  :root { --gutter: 2rem; --header-h: 4rem; }
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--c-bg);
  color: var(--c-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 1rem;
  line-height: 1.5;
  overflow-x: hidden;
}
a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-hover); text-decoration: underline; text-underline-offset: 0.15em; }
:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 700; line-height: 1.15; }
p { margin: 0; }
table { border-collapse: collapse; width: 100%; }
[x-cloak] { display: none !important; }
.num, .tnum { font-variant-numeric: tabular-nums; }

/* ---------- typography ---------- */
.display, .page__title, .h1, .h2 {
  font-stretch: var(--narrow);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.02;
}
.display    { font-size: clamp(2.5rem, 7vw + 1rem, 4.25rem); }
.page__title { font-size: clamp(2rem, 5vw + 1rem, 3rem); }
.h1         { font-size: 2.25rem; }
.h2         { font-size: 1.625rem; }
.h3         { font-size: 1.25rem; letter-spacing: -0.01em; }
.h4         { font-size: 1.0625rem; font-weight: 600; }
.h6         { font-size: 0.875rem; font-weight: 600; color: var(--c-text-muted); }
.small      { font-size: 0.8125rem; color: var(--c-text-muted); }
.muted      { color: var(--c-text-muted); }
.mono       { font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace; font-size: 0.85em; }
.eyebrow    { font-size: 0.875rem; font-weight: 600; color: var(--c-primary); margin-bottom: 0.35rem; }
.eyebrow a  { color: inherit; }

/* ---------- layout chrome ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--c-header-bg);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--c-border);
}
.site-header__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm);
}
.brand {
  display: inline-flex; align-items: center; gap: 0.5rem;
  color: var(--c-text); line-height: 1;
}
.brand:hover { color: var(--c-text); text-decoration: none; }
.brand__mark { width: 1.875rem; height: 1.875rem; display: block; }
.brand__name { font-weight: 800; font-stretch: 62%; font-size: 1.75rem; letter-spacing: 0.01em; color: var(--c-brand); }
.brand__full { display: none; font-weight: 600; font-size: 0.8125rem; color: var(--c-text-muted);
  padding-left: 0.6rem; border-left: 1px solid var(--c-border-strong); }
@media (min-width: 48rem) { .brand__full { display: inline; } }
.nav { display: flex; gap: 0.125rem; align-items: center; font-size: 0.9375rem; }
.nav a {
  color: var(--c-text-muted);
  padding: 0.5rem 0.65rem; border-radius: var(--radius);
  font-weight: 600;
}
.nav a:hover { color: var(--c-primary); background: var(--c-primary-soft); text-decoration: none; }
.nav a.is-active { color: var(--c-primary); box-shadow: inset 0 -2px 0 var(--c-primary); border-radius: 0; }
.nav-toggle { display: none; }

main.page {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-lg) var(--gutter) var(--space-2xl);
}
@media (min-width: 48rem) { main.page { padding-top: var(--space-xl); } }

.page__head { display: flex; flex-direction: column; gap: var(--space-md); margin-bottom: var(--space-lg); }
.page__head > div:first-child { max-width: 46rem; }
.page__sub { color: var(--c-text-muted); margin-top: var(--space-xs); font-size: 1rem; }
.page__actions { display: flex; gap: var(--space-xs); flex-wrap: wrap; align-items: center; }
@media (min-width: 48rem) {
  .page__head { flex-direction: row; align-items: flex-end; justify-content: space-between; }
  .page__sub { font-size: 1.0625rem; }
}

.site-foot {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-lg) var(--gutter) var(--space-2xl);
  color: var(--c-text-muted);
  font-size: 0.8125rem;
  border-top: 1px solid var(--c-border);
  display: flex; flex-direction: column; gap: var(--space-xs);
}
.site-foot__links { display: flex; gap: 0.25rem 1rem; flex-wrap: wrap; align-items: center; }
.site-foot__links a { color: var(--c-text-muted); text-decoration: underline; text-decoration-color: var(--c-border-strong); }

/* ---------- language switch ---------- */
.lang-switch { display: inline-flex; align-items: center; margin-left: 0.25rem; }
.select--sm {
  padding: 0.35rem 1.6rem 0.35rem 0.55rem; font-size: 0.8125rem; font-weight: 600;
  width: auto; background-position: right 0.45rem center; min-height: 2.25rem;
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- flash ---------- */
.flash-stack { position: fixed; top: calc(var(--header-h) + var(--space-sm)); right: var(--gutter); left: var(--gutter); z-index: 30; display: flex; flex-direction: column; gap: 0.5rem; max-width: 22rem; margin-left: auto; }
.flash { background: var(--c-card); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 0.65rem 0.9rem; box-shadow: var(--shadow); font-size: 0.875rem; }
.flash--ok { border-color: var(--c-ok); background: var(--c-ok-soft); color: var(--c-ok); }
.flash--err { border-color: var(--c-error); background: var(--c-error-soft); color: var(--c-error); }

/* ---------- buttons ---------- */
.btn {
  font-family: inherit; font-weight: 600; font-size: 0.9375rem; line-height: 1.2;
  padding: 0.7rem 1.1rem; min-height: 2.75rem; border-radius: var(--radius); border: 1px solid transparent;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--c-primary-ring); }
.btn--primary   { background: var(--c-primary); color: var(--c-on-primary); }
.btn--primary:hover { background: var(--c-primary-hover); color: var(--c-on-primary); }
.btn--accent    { background: var(--c-accent); color: #fff; }
.btn--accent:hover { background: var(--c-accent-hover); color: #fff; }
.btn--secondary { background: var(--c-card); border-color: var(--c-border-strong); color: var(--c-text); }
.btn--secondary:hover { border-color: var(--c-primary); color: var(--c-primary); }
.btn--ghost     { background: transparent; color: var(--c-primary); }
.btn--ghost:hover { background: var(--c-primary-soft); color: var(--c-primary); }
.btn--danger    { background: var(--c-error); color: #fff; }
.btn--danger:hover { filter: brightness(0.92); color: #fff; }
.btn--sm        { padding: 0.45rem 0.8rem; min-height: 2.25rem; font-size: 0.875rem; }
.btn[disabled], .btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.field > label { font-weight: 600; font-size: 0.875rem; color: var(--c-text); }
.field .help  { font-size: 0.75rem; color: var(--c-text-muted); }
.field .err   { font-size: 0.75rem; color: var(--c-error); }

.input, .select, .textarea {
  font-family: inherit; font-size: 1rem; /* 16px stops iOS zoom-on-focus */
  padding: 0.65rem 0.85rem; min-height: 2.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--c-border-strong);
  background: var(--c-card);
  color: var(--c-text);
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--c-text-faint); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-ring);
}
.textarea { resize: vertical; min-height: 6rem; }
.select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%234B5870' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  padding-right: 2.25rem;
}

.form-grid { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.form-grid--wide > * { grid-column: 1 / -1; }
.form-actions { display: flex; gap: var(--space-sm); flex-wrap: wrap; margin-top: var(--space-lg); padding-top: var(--space-md); border-top: 1px solid var(--c-border); }

.check { display: inline-flex; align-items: center; gap: 0.6rem; cursor: pointer; user-select: none; font-size: 0.9375rem; font-weight: 500; }
.check input[type="checkbox"] {
  appearance: none; width: 1.125rem; height: 1.125rem; border: 1.5px solid var(--c-border-strong);
  border-radius: var(--radius-sm); background: var(--c-card); cursor: pointer; flex-shrink: 0; margin: 0;
}
.check input[type="checkbox"]:checked { background: var(--c-primary); border-color: var(--c-primary); background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>"); background-repeat: no-repeat; background-position: center; background-size: 0.8rem; }

/* search: input and button on one line, at every width */
.search { display: flex; gap: var(--space-xs); align-items: stretch; }
.search .input { flex: 1; min-width: 0; }

/* toolbar (filters) */
.toolbar { display: flex; gap: var(--space-sm); flex-wrap: wrap; align-items: end; margin-bottom: var(--space-md); }
.toolbar .field { flex: 1 1 10rem; }
.toolbar .field--grow { flex: 3 1 14rem; }
.toolbar .btn { flex: 0 0 auto; }

/* segmented control (links or buttons) */
.seg {
  display: inline-flex; flex-wrap: nowrap; max-width: 100%; overflow-x: auto;
  background: var(--c-card); border: 1px solid var(--c-border-strong); border-radius: var(--radius);
  padding: 3px; gap: 2px; scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg > a, .seg > button {
  font: inherit; font-size: 0.875rem; font-weight: 600; white-space: nowrap;
  color: var(--c-text-muted); background: transparent; border: 0; cursor: pointer;
  padding: 0.45rem 0.8rem; min-height: 2.25rem; border-radius: 4px;
  display: inline-flex; align-items: center;
}
.seg > a:hover, .seg > button:hover { color: var(--c-primary); text-decoration: none; }
.seg > .is-active, .seg > [aria-pressed="true"] { background: var(--c-primary); color: var(--c-on-primary); }
.seg > .is-active:hover, .seg > [aria-pressed="true"]:hover { color: var(--c-on-primary); }

/* ---------- surfaces ---------- */
.card { background: var(--c-card); border: 1px solid var(--c-border); border-radius: var(--radius-lg); padding: var(--space-md); }
.card--lg { padding: var(--space-lg); }
@media (min-width: 48rem) { .card--lg { padding: var(--space-xl); } }
.card--hover { transition: border-color 0.15s ease; }
.card--hover:hover { border-color: var(--c-primary); }

/* stat strip: numbers side by side, not one card each */
.tiles {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--c-card); border: 1px solid var(--c-border); border-radius: var(--radius-lg);
  margin: 0 0 var(--space-lg);
}
.tiles--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 48rem) { .tiles { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); } }
.tile { padding: var(--space-sm) var(--space-md); border-left: 1px solid var(--c-border); border-top: 1px solid var(--c-border); min-width: 0; }
.tiles .tile:nth-child(-n+2) { border-top: 0; }
.tiles .tile:nth-child(odd) { border-left: 0; }
.tiles--3 .tile { border-top: 0; border-left: 1px solid var(--c-border); padding-left: 0.75rem; padding-right: 0.5rem; }
.tiles--3 .tile__val { font-size: clamp(1.25rem, 5.5vw, 2.25rem); }
.tiles--3 .tile:first-child { border-left: 0; }
@media (min-width: 48rem) {
  .tiles .tile { border-top: 0; border-left: 1px solid var(--c-border); }
  .tiles .tile:first-child { border-left: 0; }
}
.tile__lbl { font-size: 0.8125rem; font-weight: 600; color: var(--c-text-muted); }
.tile__val {
  font-size: clamp(1.5rem, 5vw + 0.5rem, 2.25rem); font-weight: 800; font-stretch: var(--narrow);
  color: var(--c-text); font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 0.15rem;
  overflow-wrap: anywhere;
}
.tile__sub { font-size: 0.75rem; color: var(--c-text-muted); margin-top: 0.15rem; }
.tile--accent .tile__val { color: var(--c-primary); }

/* ---------- chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem; font-weight: 600; white-space: nowrap;
  background: var(--c-primary-soft); color: var(--c-primary);
  border: 1px solid transparent; line-height: 1.1;
}
.chip--im      { background: var(--c-primary); color: var(--c-on-primary); }
.chip--im703   { background: var(--c-primary-soft); color: var(--c-primary); }
.chip--marathon { background: var(--c-highlight-soft); color: var(--c-highlight-ink); }
.chip--5150    { background: transparent; border-color: var(--c-border-strong); color: var(--c-text-muted); }
.chip--accent  { background: var(--c-accent-soft); color: var(--c-accent-ink); }
.chip--gold    { background: var(--c-highlight-soft); color: var(--c-highlight-ink); }
.chip--ok      { background: var(--c-ok-soft); color: var(--c-ok); }
.chip--err     { background: var(--c-error-soft); color: var(--c-error); }
.chip--outline { background: transparent; border-color: var(--c-border-strong); color: var(--c-text-muted); }
.chip__dot     { width: 0.45rem; height: 0.45rem; border-radius: var(--radius-pill); background: currentColor; opacity: 0.85; }

/* ---------- tables ----------
   Never clipped: wide tables scroll inside their frame, first column sticks. */
.table-wrap {
  background: var(--c-card); border: 1px solid var(--c-border); border-radius: var(--radius-lg);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.table { width: 100%; }
.table th, .table td { padding: 0.6rem 0.75rem; text-align: left; font-size: 0.9375rem; vertical-align: middle; }
.table th { font-size: 0.8125rem; font-weight: 600; color: var(--c-text-muted); border-bottom: 1px solid var(--c-border-strong); white-space: nowrap; background: var(--c-card); }
.table tbody tr { border-top: 1px solid var(--c-border); }
.table tbody tr:first-child { border-top: 0; }
.table .num { font-variant-numeric: tabular-nums; }
.table .right { text-align: right; }
.table .nowrap { white-space: nowrap; }
.table td small { display: block; font-size: 0.75rem; color: var(--c-text-muted); font-weight: 400; }
.row-actions { display: inline-flex; gap: 0.4rem; }
@media (hover: hover) { .table tbody tr:hover { background: var(--c-row-hover); } }

.hide-sm { display: none; }
@media (min-width: 48rem) { .hide-sm { display: revert; } .only-sm { display: none !important; } }

/* ---------- empty / banner ---------- */
.empty { padding: var(--space-xl) var(--space-md); text-align: center; background: var(--c-card); border: 1px dashed var(--c-border-strong); border-radius: var(--radius-lg); color: var(--c-text-muted); }
.empty h3 { font-size: 1.125rem; color: var(--c-text); margin-bottom: 0.4rem; }
.empty--compact { padding: var(--space-md); }

.banner { background: var(--c-card); border: 1px solid var(--c-border); border-left: 3px solid var(--c-primary); border-radius: var(--radius); padding: var(--space-sm) var(--space-md); }
.banner__title { font-weight: 700; margin-bottom: 0.25rem; }
.banner p { color: var(--c-text-muted); font-size: 0.9375rem; }

/* ---------- misc layout ---------- */
.split { display: grid; gap: var(--space-md); grid-template-columns: 1fr; }
@media (min-width: 55rem) { .split { grid-template-columns: 1.4fr 1fr; } }
.inline-form { display: inline-flex; }
.stack { display: flex; flex-direction: column; gap: 0.6rem; }
.stack--lg { gap: var(--space-md); }
.section { margin-bottom: var(--space-xl); }
.note { font-size: 0.8125rem; color: var(--c-text-muted); max-width: 42rem; }

/* ===============================================================
   Home
   =============================================================== */
.hero { margin-bottom: var(--space-lg); max-width: 48rem; }
.hero .display { margin-bottom: var(--space-sm); }
.hero p { color: var(--c-text-muted); font-size: 1.0625rem; max-width: 38rem; }
.hero .search { margin-top: var(--space-lg); max-width: 34rem; }

.series-block { margin-bottom: var(--space-xl); }
.series-block__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-xs) var(--space-md);
  flex-wrap: wrap; margin-bottom: var(--space-sm);
}
.series-block__head .h2 { display: flex; align-items: baseline; gap: var(--space-xs); flex-wrap: wrap; }
.series-block__dist { font-size: 0.875rem; font-weight: 500; font-stretch: 100%; color: var(--c-text-muted); letter-spacing: 0; }
.series-block__foot { margin-top: var(--space-xs); font-size: 0.9375rem; font-weight: 600; }

/* ===============================================================
   Race list rows (home, /races/)
   =============================================================== */
.races { list-style: none; margin: 0; padding: 0; background: var(--c-card); border: 1px solid var(--c-border); border-radius: var(--radius-lg); }
.races > li { display: flex; align-items: center; gap: var(--space-sm); padding: 0 var(--space-md) 0 0; border-top: 1px solid var(--c-border); }
.races > li:first-child { border-top: 0; }
.race-row {
  flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.1rem var(--space-sm);
  padding: 0.75rem 0 0.75rem var(--space-md); color: var(--c-text);
}
.race-row:hover { text-decoration: none; color: var(--c-primary); }
.race-row__name { font-weight: 700; font-size: 1rem; line-height: 1.25; }
.race-row__meta { grid-column: 1; font-size: 0.8125rem; color: var(--c-text-muted); font-variant-numeric: tabular-nums; }
.race-row__chip { grid-column: 2; grid-row: 1; align-self: start; justify-self: end; }
.race-row__n { grid-column: 2; grid-row: 2; font-size: 0.8125rem; color: var(--c-text-muted); font-variant-numeric: tabular-nums; text-align: right; }
.races__aside { flex: 0 0 auto; font-size: 0.875rem; font-weight: 600; padding: 0.5rem 0; }
@media (max-width: 30rem) { .races__aside { display: none; } .races > li { padding-right: 0; } .race-row { padding-right: var(--space-md); } }

/* ===============================================================
   Race page: editions
   =============================================================== */
.editions { list-style: none; margin: 0; padding: 0; background: var(--c-card); border: 1px solid var(--c-border); border-radius: var(--radius-lg); }
.editions > li {
  display: grid; grid-template-columns: 4.25rem minmax(0, 1fr) auto; gap: 0.15rem var(--space-sm); align-items: center;
  padding: 0.7rem var(--space-md); border-top: 1px solid var(--c-border);
}
.editions > li:first-child { border-top: 0; }
.editions__year { grid-column: 1; grid-row: 1 / span 2; font-size: 1.75rem; font-weight: 800; font-stretch: var(--narrow); font-variant-numeric: tabular-nums; line-height: 1; color: var(--c-text); }
.editions__year:hover { text-decoration: none; color: var(--c-primary); }
.editions__info { grid-column: 2; font-size: 0.875rem; color: var(--c-text-muted); display: flex; flex-wrap: wrap; gap: 0.25rem 0.6rem; align-items: center; font-variant-numeric: tabular-nums; }
.editions__info strong { color: var(--c-text); }
.editions__links { grid-column: 3; grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: flex-end; gap: 0.15rem; font-size: 0.9375rem; font-weight: 600; }
.editions__links a { padding: 0.2rem 0; }
@media (min-width: 40rem) { .editions__links { flex-direction: row; gap: var(--space-md); } }

/* ===============================================================
   Results page
   =============================================================== */
.podium { display: grid; gap: var(--space-sm); grid-template-columns: 1fr; margin-bottom: var(--space-lg); }
@media (min-width: 40rem) { .podium { grid-template-columns: 1fr 1fr; } }
.podium__card { padding: var(--space-sm) var(--space-md); }
.podium__title { font-weight: 700; font-size: 0.9375rem; margin-bottom: var(--space-xs); }
.podium__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.podium__row { display: grid; grid-template-columns: 1.75rem 1fr auto; align-items: center; gap: 0.6rem; }
.podium__rank { width: 1.6rem; height: 1.6rem; border-radius: var(--radius-pill); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8125rem; background: var(--c-bg); color: var(--c-text-muted); }
.podium__rank--1 { background: var(--c-highlight); color: #5C3F00; }
.podium__name { font-weight: 600; display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.podium__name small { font-weight: 400; color: var(--c-text-muted); font-size: 0.75rem; }
.podium__time { font-variant-numeric: tabular-nums; font-weight: 700; }

.filters { margin-bottom: var(--space-md); }
.filters > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 600; font-size: 0.9375rem; color: var(--c-primary);
  padding: 0.55rem 0.9rem; min-height: 2.75rem; border: 1px solid var(--c-border-strong); border-radius: var(--radius); background: var(--c-card);
}
.filters > summary::-webkit-details-marker { display: none; }
.filters > summary::after { content: ""; width: 0.45rem; height: 0.45rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.filters[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.filters[open] > summary { margin-bottom: var(--space-sm); }
.filters__count { background: var(--c-primary); color: var(--c-on-primary); border-radius: var(--radius-pill); font-size: 0.75rem; padding: 0.05rem 0.45rem; }

.results-meta { display: flex; justify-content: space-between; gap: var(--space-sm); margin-bottom: var(--space-xs); }

.table--results tr.is-dnf { color: var(--c-text-muted); }
.table--results .finish { font-weight: 700; }
/* phones: each result becomes a two-line row, no sideways scrolling */
@media (max-width: 47.99rem) {
  .table--results thead { display: none; }
  .table--results, .table--results tbody { display: block; }
  .table--results tr {
    display: grid; grid-template-columns: 2.25rem repeat(3, minmax(0, 1fr));
    gap: 0.1rem 0.5rem; padding: 0.6rem var(--space-sm); align-items: baseline;
  }
  .table--results td { padding: 0; font-size: 0.9375rem; }
  .table--results .c-pos { grid-row: 1 / span 2; font-weight: 700; text-align: left; color: var(--c-text-muted); }
  .table--results .c-ath { grid-column: 2 / span 2; min-width: 0; }
  .table--results .c-fin { grid-column: 4; text-align: right; }
  .table--results .c-split { grid-row: 2; font-size: 0.8125rem; color: var(--c-text-muted); text-align: left; white-space: nowrap; }
  .table--results .c-split::before { content: attr(data-label) " "; color: var(--c-text-faint); }
  .table--results .c-swim { grid-column: 2; }
  .table--results .c-bike { grid-column: 3; }
  .table--results .c-run  { grid-column: 4; text-align: right; }
  .table--results .c-ag, .table--results .c-agpos, .table--results .c-t { display: none; }
}

.pagination { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); margin-top: var(--space-md); }
.pagination__spacer { width: 1px; }

/* ===============================================================
   Thresholds
   =============================================================== */
/* the cutoff clock: pick gender + age group, read your time */
.cutoff {
  background: var(--c-card); border: 1px solid var(--c-border); border-radius: var(--radius-lg);
  padding: var(--space-md); margin-bottom: var(--space-lg);
}
@media (min-width: 48rem) { .cutoff { padding: var(--space-lg); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--space-lg); align-items: end; } }
.cutoff__pick { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; margin-bottom: var(--space-md); }
.cutoff__pick .select { width: auto; flex: 1 1 9rem; }
@media (min-width: 48rem) { .cutoff__pick { margin-bottom: 0; grid-column: 1 / -1; } .cutoff__pick .select { flex: 0 1 14rem; } }
.cutoff__lead { font-size: 0.9375rem; font-weight: 600; color: var(--c-text); }
.cutoff__clock {
  display: block; font-weight: 800; font-stretch: var(--narrow); font-variant-numeric: tabular-nums;
  font-size: clamp(4rem, 22vw, 7.5rem); line-height: 0.95; letter-spacing: -0.02em;
  color: var(--c-text); margin: 0.1rem 0 0.25rem;
  border-bottom: 4px solid var(--c-accent); padding-bottom: 0.25rem; width: max-content; max-width: 100%;
}
.cutoff__meta { font-size: 0.875rem; color: var(--c-text-muted); font-variant-numeric: tabular-nums; }

.ladder { list-style: none; margin: var(--space-md) 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--c-border); }
@media (min-width: 48rem) { .ladder { margin-top: 0; } }
.ladder li { padding: 0.5rem 0.25rem 0 0; min-width: 0; }
.ladder__p { display: block; font-size: 0.75rem; font-weight: 600; color: var(--c-text-muted); }
.ladder__t { display: block; font-size: 1rem; font-weight: 700; font-stretch: var(--narrow); font-variant-numeric: tabular-nums; }
@media (min-width: 30rem) { .ladder__t { font-size: 1.25rem; } }
.ladder li.is-key { box-shadow: inset 0 3px 0 var(--c-accent); }
.ladder li.is-key .ladder__p { color: var(--c-accent-ink); }

.thr-section { margin-bottom: var(--space-xl); }
.thr-section__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-sm); margin-bottom: var(--space-xs); }

.table--thresholds th, .table--thresholds td { padding: 0.55rem 0.3rem; font-size: 0.875rem; }
.table--thresholds td.num { font-stretch: 84%; }
.table--thresholds td:first-child { max-width: 5.25rem; line-height: 1.2; }
.table--thresholds th:first-child, .table--thresholds td:first-child {
  position: sticky; left: 0; z-index: 1; background: var(--c-card); padding-left: var(--space-sm);
}
.table--thresholds th:last-child, .table--thresholds td:last-child { padding-right: var(--space-sm); }
@media (min-width: 48rem) {
  .table--thresholds th, .table--thresholds td { padding: 0.6rem 0.75rem; font-size: 0.9375rem; }
  .table--thresholds td.num { font-stretch: 100%; }
  .table--thresholds td:first-child { max-width: none; }
  .table--thresholds th:first-child, .table--thresholds td:first-child { padding-left: var(--space-md); }
}
.table--thresholds td.is-key { font-weight: 700; color: var(--c-text); box-shadow: inset 2px 0 0 var(--c-accent-soft), inset -2px 0 0 var(--c-accent-soft); background: rgba(255, 92, 57, 0.06); }
.table--thresholds th.is-key { color: var(--c-accent-ink); box-shadow: inset 0 -2px 0 var(--c-accent); }
.table--thresholds tr.is-total td { background: var(--c-row-total); border-bottom: 1px solid var(--c-border-strong); }
.table--thresholds tr.is-total td.is-key { background: var(--c-row-total-key); }
.table--thresholds tr.is-picked td { background: var(--c-row-picked); }
.table--thresholds tr.is-picked td:first-child { box-shadow: inset 3px 0 0 var(--c-primary); }

/* ---------- prose ---------- */
.prose { max-width: 44rem; }
.prose h2 { margin-top: var(--space-lg); margin-bottom: 0.5rem; }
.prose h2:first-child { margin-top: 0; }
.prose p { margin-bottom: 0.85rem; color: var(--c-text); font-size: 1rem; line-height: 1.6; }

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

/* ===============================================================
   v0.6: live search + "where would you place?"
   =============================================================== */
.live { margin-top: var(--space-sm); }
.live .races { box-shadow: var(--shadow-lg); }
.live__count { color: var(--c-text-muted); font-size: 0.9375rem; margin-bottom: var(--space-sm); }
.live__more { margin-top: var(--space-xs); font-weight: 600; font-size: 0.9375rem; }

.place { margin-bottom: var(--space-lg); scroll-margin-top: calc(var(--header-h) + var(--space-sm)); }
.place__title { font-size: 1.25rem; font-weight: 800; font-stretch: var(--narrow); margin-bottom: var(--space-sm); }
.place__with { font-size: 0.875rem; color: var(--c-text-muted); margin: -0.4rem 0 var(--space-sm); }
.place__with strong { color: var(--c-text); }
.place__form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-sm); align-items: end; }
.place__form .btn { grid-column: 1 / -1; }
.place__form--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 48rem) {
  .place__form { grid-template-columns: minmax(0, 12rem) minmax(0, 12rem) auto; justify-content: start; }
  .place__form .btn { grid-column: auto; }
  .place__form--4 { grid-template-columns: repeat(4, minmax(0, 9rem)) auto; }
}
.input--time { font-variant-numeric: tabular-nums; font-weight: 600; }
.place .note { margin-top: var(--space-xs); }
.place__err { margin-top: var(--space-sm); color: var(--c-error); font-size: 0.9375rem; font-weight: 600; }

.place__out { margin-top: var(--space-md); display: grid; gap: var(--space-sm); }
@media (min-width: 48rem) { .place__out { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); } }
.place__row { border-top: 1px solid var(--c-border); padding-top: var(--space-sm); }
.place__split { font-size: 0.9375rem; font-weight: 700; display: flex; justify-content: space-between; gap: var(--space-sm); }
.place__mine { font-variant-numeric: tabular-nums; color: var(--c-text-muted); font-weight: 600; }
.place__cells { list-style: none; margin: var(--space-xs) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(5.75rem, 1fr)); gap: var(--space-xs); }
.place__cells li { min-width: 0; }
.place__scope { display: block; font-size: 0.75rem; font-weight: 600; color: var(--c-text-muted); }
.place__pos { display: block; font-size: 1.75rem; font-weight: 800; font-stretch: var(--narrow); font-variant-numeric: tabular-nums; line-height: 1.05; }
.place__of { display: block; font-size: 0.75rem; color: var(--c-text-muted); font-variant-numeric: tabular-nums; }
.place__cells li.is-ag .place__pos { color: var(--c-primary); }
.place__pct { display: block; margin-top: 0.15rem; font-size: 0.8125rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--c-text); }
.place__cells li.is-ag .place__pct { color: var(--c-primary); }
.place__form--4 .place__ag { grid-column: 1 / -1; }
@media (min-width: 48rem) {
  .place__form--4 { grid-template-columns: minmax(0, 13rem) repeat(4, minmax(0, 8rem)) auto; }
  .place__form--4 .place__ag { grid-column: auto; }
}

/* ===============================================================
   v0.7: My races (list kept in the browser) + history charts
   =============================================================== */
[hidden] { display: none !important; }

.place__save { margin-top: var(--space-sm); display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; }
.place__saved, .mybib__ok { font-size: 0.875rem; font-weight: 600; color: var(--c-ok); }
.place__saved a, .mybib__ok a { font-weight: 700; }

.mybib { margin-top: var(--space-md); padding-top: var(--space-md); border-top: 1px solid var(--c-border);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-sm); align-items: end; }
.mybib__out, .mybib__ok { grid-column: 1 / -1; margin: 0; }
.mybib__out { font-size: 0.9375rem; font-weight: 600; display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; }
@media (min-width: 48rem) { .mybib { grid-template-columns: minmax(0, 18rem) auto; justify-content: start; } }
.table tr.is-me > td { background: var(--c-highlight-soft); }
.table tr.is-me .c-ath strong::after { content: " \2605"; color: var(--c-primary); }

.myraces { list-style: none; margin: 0 0 var(--space-lg); padding: 0; display: grid; gap: var(--space-sm); }
@media (min-width: 60rem) { .myraces { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.myrace { background: var(--c-card); border: 1px solid var(--c-border); border-radius: var(--radius-lg);
  padding: var(--space-md); min-width: 0; }
.myrace--plan { border-style: dashed; border-color: var(--c-border-strong); }
.myrace__head { display: flex; justify-content: space-between; align-items: start; gap: var(--space-sm); }
.myrace__name { font-weight: 800; font-size: 1.0625rem; line-height: 1.2; color: var(--c-text); text-decoration: none; }
a.myrace__name:hover { color: var(--c-primary); text-decoration: underline; }
.myrace__tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.35rem; }
.myrace__del { flex: 0 0 auto; background: none; border: 0; padding: 0.25rem 0; font: inherit; font-size: 0.8125rem;
  font-weight: 600; color: var(--c-text-muted); cursor: pointer; text-decoration: underline; }
.myrace__del:hover { color: var(--c-error); }
.myrace__body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-md); align-items: end; margin-top: var(--space-sm); }
.myrace__lbl { display: block; font-size: 0.75rem; font-weight: 600; color: var(--c-text-muted); }
.myrace__fin { display: block; font-size: 2.25rem; font-weight: 800; font-stretch: var(--narrow); line-height: 1; }
.myrace__pos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-xs); }
.myrace__pos li { min-width: 0; }
.myrace__rank { display: block; font-size: 1.25rem; font-weight: 800; font-stretch: var(--narrow); font-variant-numeric: tabular-nums; line-height: 1.1; }
.myrace__pos li.is-ag .myrace__rank, .myrace__pos li.is-ag .place__pct { color: var(--c-primary); }
.myrace__splits { margin: var(--space-sm) 0 0; padding-top: var(--space-sm); border-top: 1px solid var(--c-border);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-xs); }
.myrace__splits dt { font-size: 0.75rem; font-weight: 600; color: var(--c-text-muted); }
.myrace__splits dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.myrace__splits small { display: block; font-size: 0.75rem; font-weight: 600; color: var(--c-text-muted); }
.myrace__vs { margin: var(--space-xs) 0 0; font-size: 0.75rem; color: var(--c-text-muted); }

.myadd { margin-bottom: var(--space-md); scroll-margin-top: calc(var(--header-h) + var(--space-sm)); }
.myadd__form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm); align-items: end; }
.myadd__race, .myadd__form .btn, .myadd__err { grid-column: 1 / -1; }
.myadd__err { margin: 0; }
.myadd .note { margin-top: var(--space-sm); }
@media (min-width: 48rem) {
  .myadd__form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .myadd__race { grid-column: span 2; }
  .myadd__form .btn { grid-column: auto; justify-self: start; }
}
.mytools { margin-bottom: var(--space-xl); display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; }
.mytools .note { flex-basis: 100%; margin: 0; }

.mycharts { margin-bottom: var(--space-lg); }
.mycharts__block { margin-bottom: var(--space-lg); }
.mycharts__block .note { margin: 0.15rem 0 var(--space-sm); }
.mycharts__grid { display: grid; gap: var(--space-sm); }
.mycharts__grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.mychart { margin: 0; background: var(--c-card); border: 1px solid var(--c-border); border-radius: var(--radius-lg);
  padding: var(--space-sm) var(--space-sm) var(--space-xs); min-width: 0; }
.mychart__title { font-weight: 700; font-size: 0.9375rem; margin-bottom: 0.25rem; }
.mychart__plot { position: relative; }
.mychart svg { display: block; max-width: 100%; height: auto; touch-action: pan-y; }
.mychart__grid { stroke: var(--c-border); stroke-width: 1; }
.mychart__cross { stroke: var(--c-border-strong); stroke-width: 1; }
.mychart__tick { font-size: 11px; fill: var(--c-text-muted); font-variant-numeric: tabular-nums; }
.mychart__val { font-size: 12px; font-weight: 700; fill: var(--c-text); font-variant-numeric: tabular-nums;
  paint-order: stroke; stroke: var(--c-card); stroke-width: 3px; stroke-linejoin: round; }
.mychart__line { stroke: var(--c-primary); stroke-width: 2; stroke-linecap: round; }
.mychart__line.is-plan { stroke-dasharray: 2 6; }
.mychart__dot { fill: var(--c-primary); stroke: var(--c-card); stroke-width: 2; outline: none; }
.mychart__dot.is-plan { fill: var(--c-card); stroke: var(--c-primary); }
.mychart__dot.is-on, .mychart__dot:focus-visible { r: 7; }
.mychart__tip { position: absolute; z-index: 2; pointer-events: none; background: var(--c-text); color: var(--c-bg);
  border-radius: var(--radius); padding: 0.35rem 0.55rem; font-size: 0.75rem; line-height: 1.3; white-space: nowrap;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.mychart__tip strong { font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.mychart__tipx { opacity: 0.75; }

.nav a { white-space: nowrap; }
@media (max-width: 29.99rem) {
  .nav__extra { display: none; }
  .myrace__body { grid-template-columns: minmax(0, 1fr); gap: var(--space-sm); }
}

.prose ul { margin: 0 0 var(--space-md) 1.1rem; padding: 0; }
.prose li { margin-bottom: var(--space-xs); }

/* ===============================================================
   v0.9: AWA points calculator
   =============================================================== */
.awa__form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.awa__race { grid-column: 1 / -1; }
@media (min-width: 48rem) {
  .awa__form { grid-template-columns: minmax(0, 22rem) minmax(0, 10rem) minmax(0, 10rem) auto; }
  .awa__race { grid-column: auto; }
}
.awa__out { margin-top: var(--space-md); padding-top: var(--space-md); border-top: 1px solid var(--c-border); }
.awa__out .cutoff__clock { color: var(--c-primary); }
.awa__pick { margin: 0.25rem 0 0 1.1rem; padding: 0; }
.awa__dot { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; margin-right: 0.35rem; vertical-align: 0.02em; }
.awa__dot--gold { background: #E0AD1F; }
.awa__dot--silver { background: #9A9A9A; }
.awa__dot--bronze { background: #C45928; }
.awa__ladder { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 28rem; margin-top: 0; }
.awa__about { margin-top: var(--space-lg); }
.thr-section .table th.is-key, .thr-section .table td.is-key { color: var(--c-primary); font-weight: 700; }
.thr-section .table td small { color: var(--c-text-muted); font-weight: 400; }

.awa-promo { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem 0.75rem; margin-bottom: var(--space-lg);
  padding: var(--space-sm) var(--space-md); background: var(--c-card); border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-primary); border-radius: var(--radius-lg); text-decoration: none; }
.awa-promo:hover { border-color: var(--c-primary); text-decoration: none; }
.awa-promo__t { font-weight: 800; color: var(--c-primary); }
.awa-promo__s { color: var(--c-text-muted); font-size: 0.9375rem; }

.myrace__awa { margin: var(--space-xs) 0 0; font-size: 0.8125rem; color: var(--c-text-muted); }
.myrace__awa strong { color: var(--c-text); font-variant-numeric: tabular-nums; }
.awa-season { margin-bottom: var(--space-md); }
.awa-season__head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-sm); }
.awa-season__head .place__title { margin: 0; }
.awa-season__tier { font-weight: 700; white-space: nowrap; }
.awa-season__total { font-size: 2.25rem; font-weight: 800; font-stretch: var(--narrow); line-height: 1.1; color: var(--c-primary);
  font-variant-numeric: tabular-nums; margin: var(--space-xs) 0 0; }
.awa-season__total small { font-size: 0.875rem; font-weight: 600; color: var(--c-text-muted); font-stretch: normal; }
.awa-season__gaps { list-style: none; margin: var(--space-sm) 0; padding: 0; display: grid; gap: 0.25rem; font-size: 0.9375rem; }
.awa-season__gaps li.is-done { color: var(--c-ok); }

/* ===============================================================
   v0.10: release notes
   =============================================================== */
.releases { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-md); max-width: 46rem; }
.release { scroll-margin-top: 5rem; }
.release--current { border-left: 4px solid var(--c-accent); }
.release__head { display: flex; align-items: baseline; gap: var(--space-sm); }
.release__v { font-size: 1.5rem; font-weight: 800; font-stretch: var(--narrow); color: var(--c-primary); font-variant-numeric: tabular-nums; }
.release__date { font-size: 0.8125rem; color: var(--c-text-muted); font-variant-numeric: tabular-nums; }
.release__title { margin: 0.15rem 0 var(--space-xs); }
.release__notes { margin: 0; padding-left: 1.15rem; display: grid; gap: 0.3rem; color: var(--c-text); }

/* ===============================================================
   v0.11: AGS brand, privacy page and notice
   =============================================================== */
.notice {
  position: fixed; z-index: 40; right: var(--gutter); bottom: var(--gutter); left: var(--gutter);
  max-width: 23rem; margin-left: auto;
  display: flex; gap: var(--space-sm); align-items: flex-start;
  padding: var(--space-md); background: var(--c-card); color: var(--c-text);
  border: 1px solid var(--c-border-strong); border-top: 4px solid var(--c-primary);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.notice[hidden] { display: none; }
.notice__mark { flex: none; display: block; }
.notice__title { font-weight: 800; font-stretch: var(--narrow); font-size: 1.125rem; line-height: 1.2; }
.notice__text { margin-top: 0.2rem; font-size: 0.875rem; color: var(--c-text-muted); }
.notice__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-top: var(--space-sm); font-size: 0.875rem; }
.notice__actions a { text-decoration: underline; text-decoration-color: var(--c-border-strong); }
@media (prefers-reduced-motion: no-preference) {
  .notice { animation: notice-in 0.25s ease-out; }
  @keyframes notice-in { from { transform: translateY(0.75rem); opacity: 0; } }
}

.privacy { max-width: 44rem; display: grid; gap: var(--space-lg); }
.privacy h2 { font-size: 1.25rem; margin-bottom: var(--space-xs); }
.privacy p + p { margin-top: var(--space-xs); }
.privacy ul { margin: var(--space-xs) 0 0; padding-left: 1.15rem; display: grid; gap: 0.3rem; }
.privacy code { font-family: inherit; font-weight: 600; background: var(--c-primary-soft); padding: 0 0.3em; border-radius: var(--radius-sm); }
.privacy__switch { display: flex; align-items: center; gap: 0.6rem; margin-top: var(--space-sm); font-weight: 600; }
.privacy__switch input { width: 1.15rem; height: 1.15rem; accent-color: var(--c-primary); }

/* ===============================================================
   v0.12: navy theme. The colours of the "we moved" page: lane navy as
   the ground, deeper navy cards, paper-white type. Chosen with the
   button in the header (app.js keeps it in localStorage, ags.theme);
   without a choice the site is light, whatever the system setting.
   =============================================================== */
:root[data-theme="navy"] {
  --c-primary:        #C9D6FF;
  --c-primary-hover:  #FFFFFF;
  --c-primary-soft:   rgba(201, 214, 255, 0.10);
  --c-primary-ring:   rgba(201, 214, 255, 0.40);
  --c-on-primary:     #15296B;
  --c-brand:          #F4F6FA;

  --c-accent-ink:     #FF9A82;
  --c-accent-soft:    rgba(255, 92, 57, 0.20);
  --c-highlight-soft: rgba(255, 210, 63, 0.16);
  --c-highlight-ink:  #FFD23F;

  --c-ok:             #7BE3A4;
  --c-ok-soft:        rgba(123, 227, 164, 0.12);
  --c-error:          #FFA69E;
  --c-error-soft:     rgba(255, 166, 158, 0.12);

  --c-text:           #F4F6FA;
  --c-text-muted:     #C3CEE8;
  --c-text-faint:     #91A2CF;

  --c-border:         #2F4A9C;
  --c-border-strong:  #5A73BE;
  --c-bg:             #1E3A8C;
  --c-card:           #15296B;
  --c-header-bg:      rgba(30, 58, 140, 0.92);
  --c-row-hover:      #1B337F;
  --c-row-total:      #1B337F;
  --c-row-total-key:  rgba(255, 92, 57, 0.22);
  --c-row-picked:     #223F96;

  --shadow-sm: 0 1px 2px rgb(5 12 40 / 30%);
  --shadow:    0 1px 3px rgb(5 12 40 / 40%);
  --shadow-lg: 0 12px 28px rgb(5 12 40 / 50%);
  color-scheme: dark;
}
:root[data-theme="navy"] .select { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23C3CEE8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>"); }
:root[data-theme="navy"] .check input[type="checkbox"]:checked { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315296B' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>"); }
:root[data-theme="navy"] .btn--danger, :root[data-theme="navy"] .btn--danger:hover { color: #3B0A06; }
/* the boar's tile is navy too: give it a paper edge so the mark keeps its shape */
:root[data-theme="navy"] .brand__mark, :root[data-theme="navy"] .notice__mark { border-radius: 22%; box-shadow: 0 0 0 1.5px var(--c-border-strong); }

.theme-toggle {
  flex: none; width: 2.25rem; height: 2.25rem; margin-left: 0.25rem; padding: 0; cursor: pointer;
  display: inline-grid; place-items: center; background: none;
  border: 1px solid var(--c-border-strong); border-radius: var(--radius);
}
.theme-toggle:hover { border-color: var(--c-primary); }
/* a split disc: half course grey, half lane navy; the half in use is ringed */
.theme-toggle__disc {
  width: 1.125rem; height: 1.125rem; border-radius: 50%;
  background: linear-gradient(90deg, #EEF1F6 50%, #1E3A8C 50%);
  box-shadow: 0 0 0 1.5px var(--c-text);
}
.lang-switch { flex: none; }
@media (max-width: 26rem) {
  .nav a { padding-left: 0.4rem; padding-right: 0.4rem; }
  .brand { gap: 0.35rem; }
  .site-header__inner { gap: 0.25rem; }
}
@media (max-width: 24rem) {
  .nav { font-size: 0.875rem; }
  .nav a { padding-left: 0.3rem; padding-right: 0.3rem; }
  .select--sm { padding-left: 0.4rem; padding-right: 1.3rem; background-position: right 0.3rem center; }
  .theme-toggle { width: 2rem; margin-left: 0.15rem; }
  .brand__name { font-size: 1.5rem; }
  .brand__mark { width: 1.625rem; height: 1.625rem; }
}
