/* Biegi w Polsce – arkusz stylów
   Kolory i odstępy są w zmiennych na górze; tryb ciemny przełącza się automatycznie. */

:root {
  /* paleta RunPixie, spokojna: jasne tło, białe karty, JEDEN akcent (malinowy) – bez czarnych bloków */
  --bg: #f4f3f1;
  --surface: #ffffff;
  --surface-2: #faf9f8;
  --muted: #ecebe8;          /* neutralne wypełnienia: plakietki, paski dni, karty bez zdjęcia */
  --ink: #26262b;
  --ink-2: #5a5a62;
  --ink-3: #7c7c84;
  --line: #e6e4e0;
  --accent: #fb2056;
  --accent-hover: #e12554;
  --accent-ink: #cf1043;
  --accent-soft: #ffeef2;
  --navy: var(--accent);      /* stany aktywne (wybrany filtr, sortowanie, strona) – w kolorze akcentu */
  --navy-2: var(--accent-hover);
  --green: #0f8a5f;
  --green-soft: #e6f5ee;
  --blue-soft: var(--muted);
  --blue-ink: var(--ink-2);
  --hero-bg: radial-gradient(900px 480px at 88% -10%, rgba(251, 32, 86, .10) 0%, transparent 60%), #fbfaf9;
  --hero-ink: var(--ink);
  --hero-ink-2: var(--ink-2);
  --hero-line: var(--line);
  --footer-bg: #ecebe8;
  --footer-ink: var(--ink);
  --footer-ink-2: var(--ink-2);
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 16px rgba(0, 0, 0, .06);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .06), 0 12px 32px rgba(0, 0, 0, .14);
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1200px;
  color-scheme: light;
}

/* Ciemna kolorystyka – włączana przyciskiem w nagłówku (domyślnie jasna) */
:root[data-theme="dark"] {
  /* jak u Runmageddonu: jedno grafitowe tło, karty o ton jaśniejsze */
  --bg: #141516;
  --surface: #1e1f21;
  --surface-2: #191a1b;
  --muted: #2a2b2e;
  --ink: #ececee;
  --ink-2: #b9b9c0;
  --ink-3: #8c8c94;
  --line: #2a2b2e;
  --accent-soft: #3a1520;
  --accent-ink: #ff6b8e;
  --green-soft: #0f2e24;
  --hero-bg: radial-gradient(900px 480px at 88% -10%, rgba(251, 32, 86, .16) 0%, transparent 60%), #141516;
  --hero-ink: #ececee;
  --hero-ink-2: #b9b9c0;
  --hero-line: #2f3033;
  --footer-bg: #191a1b;
  --footer-ink: #ececee;
  --footer-ink-2: #9a9aa2;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .4);
  color-scheme: dark;
}
.theme-toggle {
  background: none; border: 1px solid var(--line); color: var(--ink-2); border-radius: 999px;
  width: 38px; height: 38px; display: inline-grid; place-items: center; cursor: pointer; flex: none;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-3); }
.theme-toggle .icon { width: 18px; height: 18px; }
.site-header .wrap > .theme-toggle { order: 3; margin-left: 8px; }
@media (max-width: 900px) {
  .site-header .wrap > .theme-toggle { margin-left: auto; order: 2; }
  .site-header .menu-toggle { margin-left: 4px; order: 3; }
}
.theme-toggle .moon { display: block; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -.01em; margin: 0; }
h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); font-weight: 700; text-transform: uppercase; }
h2 { font-size: clamp(1.35rem, 2.5vw, 1.75rem); font-weight: 700; text-transform: uppercase; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.icon { width: 1.1em; height: 1.1em; flex: none; vertical-align: -.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Nagłówek ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.logo-mark { width: 36px; height: 36px; }
.logo-text { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: .02em; line-height: 1; text-transform: uppercase; }
.logo-text span { color: var(--accent); }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a, .nav summary {
  text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: .95rem;
  padding: 8px 12px; border-radius: 8px; cursor: pointer; list-style: none;
}
.nav summary::-webkit-details-marker { display: none; }
.nav a:hover, .nav summary:hover, .nav a.active { color: var(--ink); background: var(--surface-2); }
.nav details { position: relative; }
.nav .dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); width: 440px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
}
.nav .dropdown a { font-size: .9rem; padding: 7px 10px; }
/* Przyciski jak na runpixie.com: pigułka, wielkie litery, pogrubione */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 .9rem/1 var(--font); text-decoration: none; cursor: pointer; text-transform: uppercase; letter-spacing: .02em;
  padding: 13px 26px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-2); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-3); }
.btn-sm { padding: 10px 18px; font-size: .8rem; }
.nav .btn { margin-left: 8px; color: #fff; }
.nav .btn:hover { color: #fff; background: var(--accent-hover); }
.menu-toggle { display: none; margin-left: auto; background: none; border: 0; color: var(--ink); padding: 8px; cursor: pointer; }
.menu-toggle .icon { width: 26px; height: 26px; }

@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; gap: 2px; box-shadow: var(--shadow-lg);
  }
  .nav.open { display: flex; }
  .nav .dropdown { position: static; width: auto; box-shadow: none; border: 0; padding: 0 0 0 12px; }
  .nav .btn { margin: 8px 0 0; }
}

/* ---------- Hero ---------- */
.hero {
  /* przycinamy tylko na boki (ozdobne tło) – podpowiedzi wyszukiwarki mogą wychodzić w dół, nad kolejną sekcję */
  position: relative; z-index: 60; overflow-x: clip; overflow-y: visible; color: var(--hero-ink);  /* nad paskami dni (podpowiedzi) */
  background: var(--hero-bg); border-bottom: 1px solid var(--hero-line);
  padding: 64px 0 72px;
}
.hero .wrap { position: relative; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .85rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent-ink); margin-bottom: 14px;
}
.hero-kicker::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(251, 32, 86, .28); }
.hero h1 { max-width: 16ch; }
.hero h1::after { content: ""; display: block; width: 64px; height: 3px; background: var(--accent); margin-top: 20px; border-radius: 2px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-lead { font-size: 1.08rem; color: var(--hero-ink-2); max-width: 48ch; margin: 16px 0 28px; }
.search-box {
  display: grid; grid-template-columns: 1fr 190px 190px auto; gap: 8px;
  background: var(--surface); padding: 8px; border-radius: 32px; max-width: 900px;
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.search-box input, .search-box select {
  border: 0; background: var(--surface-2); color: var(--ink); font: 500 1rem var(--font);
  padding: 14px 20px; border-radius: 999px; min-width: 0; width: 100%;
}
.search-box input:focus, .search-box select:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.search-box .btn { padding: 14px 24px; font-size: 1rem; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.quick a {
  color: var(--ink-2); text-decoration: none; font-size: .9rem; font-weight: 500;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
}
.quick a:hover { border-color: var(--accent); color: var(--accent-ink); }
/* „Zdjęcia” (Run Pixie) – wyróżnione kolorem marki */
.quick a.quick-photo { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.quick a.quick-photo:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.quick a.quick-more { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink); border-color: var(--ink-3); }
@media (max-width: 900px) and (min-width: 701px) { .search-box { grid-template-columns: 1fr 1fr; } .search-box input { grid-column: 1 / -1; } }

/* Podpowiedzi w wyszukiwarce */
.has-suggest { position: relative; }
.suggest {
  position: absolute; z-index: 1100; left: 8px; right: 8px; top: calc(100% + 4px); max-width: 560px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; text-align: left;
}
fieldset .suggest { left: 0; right: 0; }
.suggest a { display: block; padding: 10px 14px; text-decoration: none; color: var(--ink); border-top: 1px solid var(--line); }
.suggest a:first-child { border-top: 0; }
.suggest a b { display: block; font-weight: 600; font-size: .95rem; line-height: 1.3; }
.suggest a span { display: block; font-size: .8rem; color: var(--ink-3); margin-top: 2px; }
.suggest a:hover, .suggest a.on { background: var(--surface-2); }
.suggest a:hover b, .suggest a.on b { color: var(--accent-ink); }
.suggest a.suggest-all { font-size: .82rem; font-weight: 700; color: var(--accent-ink); background: var(--surface-2); }
.suggest a.suggest-all:first-child { position: sticky; top: 0; z-index: 1; border-bottom: 1px solid var(--line); }

/* „Do kalendarza” – Google albo plik .ics */
.cal-menu { position: relative; }
.cal-menu summary { list-style: none; cursor: pointer; }
.cal-menu summary::-webkit-details-marker { display: none; }
.cal-menu-list {
  position: absolute; z-index: 50; top: calc(100% + 6px); left: 0; min-width: 240px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden;
}
.cal-menu-list a { display: block; padding: 11px 16px; color: var(--ink); text-decoration: none; font-weight: 500; }
.cal-menu-list a + a { border-top: 1px solid var(--line); }
.cal-menu-list a:hover { background: var(--surface-2); color: var(--accent-ink); }
.map-note { margin: 8px 0 0; }

/* Telefon: pływający pasek z liczbą włączonych filtrów – żeby było jasne, czemu biegów jest mało */
.active-filters {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 14px; padding: 10px 16px; border-radius: 999px;
  background: var(--ink); color: var(--bg, #fff); box-shadow: 0 6px 18px rgba(0, 0, 0, .18); font-size: .92rem;
}
.active-filters > span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; flex: 1; overflow: hidden; }
.active-filters .af-names { font-weight: 500; }
.active-filters { border-radius: 18px; }
.active-filters a { color: inherit; font-weight: 700; text-decoration: none; padding: 2px 10px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
/* Telefon: zamiast paska z nazwami – baner na górze listy „Zastosowano 3 filtry · Wyczyść” */
.af-slot { display: none; }
@media (max-width: 900px) {
  .active-filters { display: none; }
  /* nad wszystkim poza nagłówkiem strony (filtry, paski dni) – zawsze jedna linijka */
  .af-slot { display: block; position: sticky; top: 64px; z-index: 950; }
  .af-slot:empty { display: none; }
  .af-mobile {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 8px 8px 8px 14px; border-radius: 999px; background: var(--ink); color: var(--bg, #fff);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .2); font-weight: 600; font-size: .85rem; white-space: nowrap;
  }
  .af-mobile span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .af-mobile .icon { width: 15px; height: 15px; flex: none; }
  .af-mobile a { color: inherit; font-weight: 700; font-size: .8rem; text-decoration: none; padding: 3px 10px; border-radius: 999px; border: 1px solid currentColor; flex: none; }
  .layout:has(.af-mobile) .day-head { top: 112px; }
}
/* Baner filtrów: cały zmienia kolor (3 razy) – widać to też przy przewijaniu */
@keyframes af-pulse {
  0%, 100% { background-color: var(--ink); }
  50% { background-color: var(--accent); }
}
.af-flash { animation: af-pulse 1s ease-in-out 3; }
.af-flash1 { animation: af-pulse 1s ease-in-out 1; }  /* kolejny dodany filtr – raz */
/* Po przejściu na listę z wybranym filtrem: zaznaczone pola przez chwilę mrugają */
@keyframes flash-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 32, 86, 0); }
  50% { box-shadow: 0 0 0 5px rgba(251, 32, 86, .45); }
}
.flash { animation: flash-ring .8s ease-in-out 3; }
.btn-photo { background: var(--accent-soft); color: var(--accent-ink); border: 2px solid var(--accent); }
.btn-photo:hover { background: var(--accent); color: #fff; }
.hero-stats { display: flex; gap: 40px; margin-top: 40px; flex-wrap: wrap; }
.hero-stats div { font-size: .85rem; color: var(--ink-3); }
.hero-stats strong { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; color: var(--hero-ink); line-height: 1.1; }
@media (max-width: 700px) {
  .hero { padding: 40px 0 48px; }
  .search-box { grid-template-columns: 1fr; }
  .hero-stats { gap: 24px; }
}

/* ---------- Sekcje ---------- */
.section { padding: 56px 0 8px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.section-head p { margin: 6px 0 0; color: var(--ink-2); }
.link-more { font-weight: 600; color: var(--accent-ink); text-decoration: none; white-space: nowrap; }
.link-more:hover { text-decoration: underline; }
.more-day { margin: 18px 0 0; text-align: center; }

/* ---------- Karta biegu ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card {
  position: relative; display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: transparent; }
.card-media { position: relative; aspect-ratio: 16 / 10; background: var(--surface-2); overflow: hidden; }
.card-media .blur { position: absolute; inset: -20px; background-size: cover; background-position: center; filter: blur(18px) saturate(1.2); opacity: .55; transform: scale(1.1); }
.card-media img { position: relative; width: 100%; height: 100%; object-fit: contain; }
.card-media.empty { display: grid; place-items: center; background: var(--muted); }
.card-media.empty svg { width: 64px; height: 64px; color: var(--ink-3); opacity: .45; }
.card-body { padding: 16px 16px 18px 92px; position: relative; flex: 1; min-height: 104px; }
.card h3 { font-size: 1rem; font-weight: 600; line-height: 1.3; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { font-size: .875rem; color: var(--ink-2); display: flex; align-items: flex-start; gap: 5px; }
.card .meta .icon { margin-top: .2em; }
.card .chips { margin-top: 10px; }
.card.is-past { opacity: .72; }

/* „Numer startowy” z datą */
.bib {
  position: absolute; left: 14px; top: -26px; width: 66px; text-align: center;
  background: #fff; color: #18181b; border-radius: 8px; padding: 9px 4px 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18); border-top: 5px solid var(--accent);
  font-family: var(--font-display); line-height: 1;
}
.bib::before, .bib::after { content: ""; position: absolute; top: 5px; width: 5px; height: 5px; border-radius: 50%; background: #d8d3c8; }
.bib::before { left: 6px; }
.bib::after { right: 6px; }
.bib .d { display: block; font-size: 1.65rem; font-weight: 700; }
.bib .m { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-ink); margin-top: 2px; }
.bib .w { display: block; font-family: var(--font); font-size: .66rem; color: #7c8799; margin-top: 4px; text-transform: uppercase; letter-spacing: .05em; }
:root[data-theme="dark"] .bib .m { color: #cf1043; }
.bib.multi .d { font-size: 1.15rem; padding: 4px 0 3px; white-space: nowrap; letter-spacing: -.02em; }

/* Chipy */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { text-decoration: none; font-size: .75rem; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: var(--muted); color: var(--ink-2); white-space: nowrap; }
.chip.alt { background: var(--blue-soft); color: var(--blue-ink); }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.gray { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }

/* Nagłówek dnia */
/* Pasek dnia: wyraźna granica między dniami; przykleja się pod nagłówkiem strony przy przewijaniu */
.day-head {
  position: sticky; top: 72px; z-index: 5; display: flex; align-items: center; gap: 12px;
  margin: 48px 0 18px; padding: 11px 20px; border-radius: 999px;
  background: var(--muted); color: var(--ink); box-shadow: 0 4px 14px rgba(0, 0, 0, .06);
}
.day-head:first-child { margin-top: 0; }
.day-head h3 { font-size: 1.05rem; font-weight: 700; color: inherit; }
.day-head h3::first-letter { text-transform: uppercase; }
.day-head h3 small { font-weight: 500; color: var(--ink-3); }
.day-head .count { margin-left: auto; color: var(--ink-3); font-size: .85rem; font-weight: 600; white-space: nowrap; }
.day-head .today { background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; }
.day-head.is-weekend { background: var(--accent-soft); color: var(--accent-ink); }
.day-head.is-weekend .count { color: var(--accent-ink); opacity: .8; }
@media (max-width: 700px) { .day-head { top: 70px; padding: 9px 16px; } .day-head h3 { font-size: .95rem; } }

/* Wiersz biegu (kompaktowy) */
.rows { display: flex; flex-direction: column; gap: 10px; }
.row {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 10px 10px; text-decoration: none;
}
.row:hover { border-color: var(--ink-3); }
.row .mini-bib { text-align: center; font-family: var(--font-display); line-height: 1; background: var(--surface-2); border-radius: 8px; padding: 8px 0; }
.row .mini-bib b { display: block; font-size: 1.3rem; font-weight: 700; }
.row .mini-bib b.multi { font-size: .95rem; padding: 4px 0 3px; }
.row .mini-bib span { font-size: .72rem; font-weight: 700; text-transform: uppercase; color: var(--accent-ink); }
.row h4 { margin: 0 0 2px; font-size: 1rem; font-weight: 600; line-height: 1.3; }
.row .meta { font-size: .85rem; color: var(--ink-2); }
.row .dist { font-size: .85rem; font-weight: 600; color: var(--ink-3); white-space: nowrap; }

/* Województwa */
.regions { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.region-tile {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; font-weight: 600;
}
.region-tile:hover { border-color: var(--accent); color: var(--accent-ink); }
.region-tile { font-size: .95rem; }
.region-tile span { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--accent-ink); }

/* Pasek „zgłoś bieg” */
.cta-band {
  margin: 64px 0 0; border-radius: 28px; padding: 40px; color: var(--ink); display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: var(--accent-soft);
}
.cta-band h2 { font-size: 1.7rem; }
.cta-band p { margin: 8px 0 0; color: var(--ink-2); max-width: 52ch; }
.cta-band .btn { background: var(--accent); color: #fff; }
.cta-band .btn:hover { background: var(--accent-hover); }

/* ---------- Strona listy ---------- */
.page-head { padding: 36px 0 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.page-head h1 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
.page-head p { margin: 8px 0 0; color: var(--ink-2); }
.crumbs { font-size: .85rem; color: var(--ink-3); margin-bottom: 10px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.layout { display: grid; grid-template-columns: 280px 1fr; gap: 32px; padding: 28px 16px 56px; align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }
.layout > * { min-width: 0; }  /* długa treść (np. nazwy filtrów) nie może rozpychać kolumny poza ekran */

.filters { position: sticky; top: 84px; z-index: 40; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.filters summary { display: none; }
.filters fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.filters legend, .filters label.lbl { font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 8px; display: block; }
.filters .opts { display: flex; flex-wrap: wrap; gap: 6px; }
.filters .opts label { cursor: pointer; }
.filters .opts input { position: absolute; opacity: 0; pointer-events: none; }
.filters .opts span { display: inline-block; font-size: .85rem; font-weight: 500; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); }
.filters .opts input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }
.filters .opts input:focus-visible + span { outline: 2px solid var(--accent); }
:root[data-theme="dark"] .filters .opts input:checked + span { background: var(--accent); border-color: var(--accent); }
/* Filtr „Zdjęcia” w kolorach Run Pixie */
.photo-opt { cursor: pointer; display: inline-block; }
.photo-opt input { position: absolute; opacity: 0; pointer-events: none; }
.photo-opt span {
  display: inline-flex; align-items: center; gap: 6px; font: 700 .8rem var(--font); text-transform: uppercase; letter-spacing: .02em;
  padding: 8px 14px; border-radius: 999px; border: 2px solid var(--accent); color: var(--accent-ink); background: var(--accent-soft);
}
.photo-opt span .icon { width: 15px; height: 15px; }
.photo-opt input:checked + span { background: var(--accent); color: #fff; }
.photo-opt input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.filters #id_kiedy { width: 100%; margin-bottom: 8px; }
.dates { display: grid; grid-template-columns: 1fr; gap: 8px; }
.dates input { min-width: 0; }
.filters .check { display: flex; gap: 8px; align-items: center; font-size: .9rem; margin-bottom: 16px; }
.filters .actions { display: flex; gap: 8px; }
.filters .actions .btn { flex: 1; }
/* filtry działają od razu – na komputerze przycisk „Pokaż biegi” jest zbędny (na telefonie zwija filtry) */
@media (min-width: 901px) { .filters-inner.is-live [data-show] { display: none; } }
#wyniki { transition: opacity .15s; }
#wyniki.is-loading { opacity: .45; pointer-events: none; }
@media (max-width: 900px) {
  .filters { position: static; padding: 0; }
  .filters summary { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; font-weight: 600; cursor: pointer; list-style: none; }
  .filters summary::-webkit-details-marker { display: none; }
  .filters .filters-inner { padding: 0 16px 16px; }
}

input[type=text], input[type=search], input[type=email], input[type=url], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; font: 400 .95rem var(--font); color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar .found { font-weight: 600; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg a { display: inline-flex; gap: 6px; align-items: center; padding: 7px 14px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.seg a.on { background: var(--navy); color: #fff; }
:root[data-theme="dark"] .seg a.on { background: var(--accent); }

.empty-state { text-align: center; padding: 56px 16px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-state h3 { margin-bottom: 8px; }

.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 40px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 42px; text-align: center; padding: 10px 12px; border-radius: 999px; text-decoration: none; font-weight: 600; background: var(--surface); border: 1px solid var(--line); }
.pagination .cur { background: var(--navy); color: #fff; border-color: var(--navy); }
.pagination a:hover { border-color: var(--ink-3); }

/* ---------- Sortowanie ---------- */
.sortbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: -6px 0 16px; }
.sortbar a, .sortbar button {
  font: 500 .85rem var(--font); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); text-decoration: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
}
.sortbar a:hover, .sortbar button:hover { border-color: var(--ink-3); color: var(--ink); }
.sortbar .on { background: var(--navy); border-color: var(--navy); color: #fff; }
:root[data-theme="dark"] .sortbar .on { background: var(--accent); border-color: var(--accent); }
.sortbar .icon { width: 14px; height: 14px; }
.card .meta-extra { gap: 10px; flex-wrap: wrap; font-size: .8rem; color: var(--ink-3); margin-top: 3px; }
.card .meta-extra span + span::before { content: "·"; margin-right: 10px; }

/* ---------- Widok kalendarza ---------- */
.cal-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-title { font-size: 1.15rem; min-width: 12ch; text-align: center; text-transform: none; }
.seg-sm a { padding: 6px 12px; font-size: .85rem; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-wd { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); text-align: center; padding: 4px 0; }
.cal-wd.we { color: var(--accent-ink); }
.cal-day {
  position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 104px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; text-decoration: none; overflow: hidden;
}
.cal-day:hover { border-color: var(--ink-3); }
.cal-day.is-other { opacity: .45; }
.cal-day.is-past { background: var(--surface-2); }
.cal-day.is-past .cal-num { color: var(--ink-3); }
.cal-num { font-weight: 700; font-size: .95rem; line-height: 1; }
.cal-day.is-today { border: 2px solid var(--accent); }
.cal-day.is-today .cal-num { background: var(--accent); color: #fff; border-radius: 999px; padding: 4px 7px; align-self: flex-start; }
.cal-day.is-selected { box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
.cal-count { position: absolute; top: 8px; right: 8px; font-size: .7rem; font-weight: 700; background: var(--navy); color: #fff; border-radius: 999px; padding: 2px 7px; }
.cal-titles { display: flex; flex-direction: column; gap: 2px; font-size: .72rem; line-height: 1.25; color: var(--ink-2); }
.cal-titles span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-titles span::before { content: "• "; color: var(--accent); }
.cal-titles em { font-style: normal; color: var(--accent-ink); font-weight: 600; }
.cal-selected { margin-top: 28px; scroll-margin-top: 80px; }
/* Widok roczny: 12 małych miesięcy */
.cal-year { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.cal-ym { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.cal-ym-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; text-decoration: none; color: var(--ink); margin-bottom: 8px; }
.cal-ym-head:hover b { color: var(--accent-ink); }
.cal-ym-head span { font-size: .72rem; color: var(--ink-3); }
.cal-ym-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; text-align: center; }
.cal-ym-wd { font-size: .66rem; font-weight: 700; color: var(--ink-3); }
.cal-ym-wd.we { color: var(--accent-ink); }
.cal-yd { display: grid; place-items: center; aspect-ratio: 1; border-radius: 6px; font-size: .74rem; color: var(--ink-3); text-decoration: none; }
.cal-yd.we { color: var(--ink-2); }
a.cal-yd { color: var(--ink); font-weight: 700; }
a.cal-yd.lv1 { background: rgba(251, 32, 86, .14); }
a.cal-yd.lv2 { background: rgba(251, 32, 86, .38); }
a.cal-yd.lv3 { background: var(--accent); color: #fff; }
a.cal-yd:hover { outline: 2px solid var(--accent); }
a.cal-yd.is-past { opacity: .5; }
.cal-yd.is-today { box-shadow: inset 0 0 0 2px var(--accent); }
/* legenda nad miesiącami (jak w kalendarzu aktywności): mniej ▢▤■ więcej */
.cal-year-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: .8rem; color: var(--ink-2); margin: -4px 0 12px; }
.cal-year-legend .lg { display: inline-flex; align-items: center; gap: 4px; }
.cal-year-legend .cal-yd { width: 16px; height: 16px; aspect-ratio: auto; display: inline-block; border-radius: 4px; }
.cal-year-legend .lv1 { background: rgba(251, 32, 86, .14); }
.cal-year-legend .lv2 { background: rgba(251, 32, 86, .38); }
.cal-year-legend .lv3 { background: var(--accent); }
.cal-cols { display: grid; gap: 10px; }
.cal-tydzien { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-weekend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cal-col { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-width: 0; }
.cal-col.is-today { border: 2px solid var(--accent); }
.cal-col.is-past { background: var(--surface-2); }
.cal-col-head { font-size: .85rem; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.cal-col-head b { text-transform: capitalize; }
.cal-list { display: flex; flex-direction: column; gap: 6px; }
.cal-item { display: block; text-decoration: none; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); border-left: 3px solid var(--accent); }
.cal-item:hover { background: var(--accent-soft); }
.cal-item b { display: block; font-size: .8rem; font-weight: 600; line-height: 1.25; }
.cal-item span { display: block; font-size: .72rem; line-height: 1.3; color: var(--ink-3); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-wide { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: center; text-decoration: none;
  padding: 6px; border-radius: 10px; background: var(--surface-2); border: 1px solid transparent; }
.cal-wide:hover { border-color: var(--accent); }
.cal-wide img, .cal-wide .ph { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--muted); display: grid; place-items: center; }
.cal-wide .ph .icon { color: var(--ink-3); opacity: .5; width: 24px; height: 24px; }
.cal-wide b { display: block; font-size: .88rem; font-weight: 600; line-height: 1.3; }
.cal-wide small { display: block; font-size: .76rem; color: var(--ink-3); margin-top: 2px; }
@media (max-width: 900px) {
  .cal-tydzien { grid-template-columns: 1fr; }
  .cal-day { min-height: 64px; padding: 6px; }
  .cal-titles { display: none; }
  .cal-count { position: static; align-self: flex-start; }
}
@media (max-width: 560px) { .cal-weekend { grid-template-columns: 1fr; } .cal-month { gap: 3px; } }
.flatpickr-day.selected, .flatpickr-day.selected:hover { background: var(--accent); border-color: var(--accent); }

/* ---------- Mapa ---------- */
.map { height: 560px; border-radius: var(--radius); border: 1px solid var(--line); z-index: 0; background: var(--surface-2); }
.map-full { height: calc(100vh - 64px - 74px); min-height: 420px; border-radius: 0; border: 0; }
.map-bar { background: var(--surface); border-bottom: 1px solid var(--line); padding: 14px 0; }
.map-bar form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.map-bar input, .map-bar select { width: auto; flex: 1 1 180px; }
.leaflet-popup-content { font-family: var(--font); margin: 12px 14px; }
.leaflet-popup-content .pop-t { font-weight: 700; font-size: .95rem; line-height: 1.25; display: block; margin-bottom: 4px; color: #26262b; text-decoration: none; }
.leaflet-popup-content .pop-t:hover { color: var(--accent-ink); }
.leaflet-popup-content .pop-m { color: #4b5b74; font-size: .85rem; }
/* Telefon: podpowiedź „dwoma palcami” na mapie */
.map-hint {
  position: absolute; inset: 0; z-index: 1000; display: grid; place-items: center; pointer-events: none;
  background: rgba(20, 20, 24, .45); color: #fff; font: 700 1.05rem var(--font); text-align: center; padding: 20px;
  opacity: 0; transition: opacity .2s;
}
.map-hint.on { opacity: 1; }
/* Miasto z biegami bez dokładnego miejsca startu: liczba w kółku (przerywany okrąg wokół miasta) */
.pin-area {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: var(--accent-ink, #cf1043); font: 700 .8rem var(--font); border: 2px dashed var(--accent);
  box-shadow: 0 1px 5px rgba(0, 0, 0, .3);
}
.leaflet-popup-content .pop-area { max-height: 300px; overflow-y: auto; padding-right: 4px; }
.leaflet-popup-content .pop-area > b { display: block; font-size: 1rem; margin-bottom: 2px; color: #26262b; }
.leaflet-popup-content .pop-area > .pop-m { display: block; margin-bottom: 8px; }
.leaflet-popup-content .pop-area .pop-t { margin-top: 8px; }
.pin { background: var(--accent); width: 14px; height: 14px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background: rgba(251, 32, 86, .25) !important; }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div { background: var(--accent) !important; color: #fff !important; font-weight: 700; font-family: var(--font); }

/* ---------- Szczegóły biegu ---------- */
.race-hero { background: var(--surface); border-bottom: 1px solid var(--line); padding: 32px 0 40px; }
.race-hero .wrap { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; }
.race-hero h1 { font-size: clamp(1.6rem, 3.4vw, 2.5rem); margin-bottom: 18px; }
.race-facts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; font-size: 1.05rem; }
.race-facts div { display: flex; gap: 10px; align-items: center; }
.race-facts .icon { color: var(--accent); width: 1.25em; height: 1.25em; }
.race-facts strong { font-weight: 600; }
.race-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.poster { border-radius: var(--radius); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--shadow); }
.poster img { width: 100%; max-height: 520px; object-fit: contain; background: var(--surface-2); }
.options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 1em; scroll-margin-top: 90px; }
#formuly { scroll-margin-top: 90px; }
.option { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.option b { display: block; font-weight: 600; }
.prose .btn-primary, .prose .btn-primary:hover { color: #fff; text-decoration: none; }
.option span { display: block; font-size: .85rem; color: var(--ink-3); }
.poster-fig { margin: 0; }
.poster-fig figcaption { font-size: .8rem; color: var(--ink-3); margin-top: 8px; text-align: right; }
.poster-fig figcaption a { color: var(--ink-2); }
.prose-h { font-size: 1.05rem; margin: 0 0 .6em !important; letter-spacing: .02em; }
.prose p + .prose-h, .prose * + .prose-h { margin-top: 1.6em !important; }
.past-note { display: inline-flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-weight: 600; font-size: .9rem; color: var(--ink-2); margin-bottom: 14px; }
.race-body { display: grid; grid-template-columns: 1fr 360px; gap: 40px; padding: 40px 16px 24px; align-items: start; }
.prose { font-size: 1.02rem; overflow-wrap: anywhere; }
.prose h2, .prose h3 { margin: 1.4em 0 .5em; }
.prose a { color: var(--accent-ink); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose table { border-collapse: collapse; width: 100%; }
.prose td, .prose th { border: 1px solid var(--line); padding: 6px 8px; }
.side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 84px; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.box h3 { font-size: 1.15rem; margin-bottom: 12px; }
/* Zaproszenie do zdjęć na Run Pixie */
.box.runpixie { background: var(--accent-soft); border-color: transparent; }
.box.runpixie > .icon { width: 30px; height: 30px; color: var(--accent); margin-bottom: 8px; }
.box.runpixie h3 { margin-bottom: 6px; color: var(--ink); }
.box.runpixie p { font-size: .9rem; color: var(--ink-2); margin-bottom: 14px; }
.chip.photo { background: var(--accent-soft); color: var(--accent-ink); display: inline-flex; align-items: center; gap: 4px; }
.chip.photo .icon { width: 13px; height: 13px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: .92rem; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
/* „Dane aktualne na dzień …” – widać, że dane sprawdzamy, i na kiedy są aktualne */
.verified { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; padding: 12px 14px; border-radius: 12px;
  background: var(--green-soft); color: var(--ink-2); font-size: .85rem; line-height: 1.45; }
.verified .icon { color: var(--green); width: 20px; height: 20px; margin-top: 1px; }
.verified b { display: block; color: var(--ink); font-size: .9rem; margin-bottom: 2px; }
.verified.muted { background: var(--muted); }
.verified.muted .icon { color: var(--ink-3); }
.map-mini { height: 240px; border-radius: 10px; margin-top: 4px; }
details.report summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
details.report form { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 900px) {
  .race-hero .wrap, .race-body { grid-template-columns: 1fr; }
  .race-hero .poster-fig { order: -1; }
  .side { position: static; }
}

/* ---------- Formularze ---------- */
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.form-section { border: 0; margin: 0 0 28px; padding: 0 0 24px; border-bottom: 1px solid var(--line); }
.form-section:last-of-type { border-bottom: 0; }
.form-section legend { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; margin-bottom: 14px; display: flex; gap: 10px; align-items: center; }
.form-section legend .num { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 1rem; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fields .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .fields { grid-template-columns: 1fr; } .form-card { padding: 18px; } }
.field label.lbl { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field .help { font-size: .8rem; color: var(--ink-3); margin-top: 4px; }
.field .err, .errorlist { color: #c2262e; font-size: .85rem; margin: 4px 0 0; padding: 0; list-style: none; }
.field .req { color: var(--accent); }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.checks label { cursor: pointer; }
.checks input { position: absolute; opacity: 0; pointer-events: none; }
.checks span { display: inline-block; font-size: .875rem; font-weight: 500; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); }
.checks input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }
.checks input:focus-visible + span { outline: 2px solid var(--accent); }
.hp { position: absolute; left: -9999px; }
.geo-row { display: flex; gap: 8px; margin-bottom: 10px; }
.geo-row input { flex: 1; }
.alert { padding: 14px 16px; border-radius: 10px; margin: 16px 0; font-weight: 500; }
.alert-success { background: var(--green-soft); color: var(--green); }
.alert-error { background: #fdecec; color: #a11d24; }
.messages { list-style: none; margin: 0; padding: 0; }

/* ---------- Teksty (regulamin itp.) ---------- */
.text-page { max-width: 780px; padding: 40px 16px 64px; }
.text-page h2 { margin: 1.6em 0 .6em; font-size: 1.6rem; }
.text-page li { margin-bottom: .4em; }

/* ---------- Stopka ---------- */
.site-footer { margin-top: 72px; background: var(--footer-bg); color: var(--footer-ink-2); padding: 48px 0 28px; font-size: .92rem; border-top: 1px solid var(--line); }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.site-footer h4 { color: var(--footer-ink); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 12px; }
.site-footer a { color: var(--footer-ink); text-decoration: none; }
.site-footer a:hover { color: var(--accent-ink); text-decoration: underline; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.site-footer .logo-text { color: var(--footer-ink); }
.site-footer .bottom { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 20px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .85rem; }
@media (max-width: 700px) { .site-footer .cols { grid-template-columns: 1fr; } }
