:root {
  --bg: #ffffff;
  --mist: #f3f6fa;
  --mist-2: #e9eef5;
  --line: #e2e8f0;
  --line-2: #cfd8e3;
  --ink: #0e1726;
  --ink-2: #4b5768;
  --ink-3: #8a94a6;
  --blue: #155eef;
  --blue-dk: #0d47c4;
  --blue-50: #ecf2ff;
  --orange: #ff6a13;
  --green: #0e9f6e;
  --road: #475569;
  --st-maybe: #f5a524;
  --st-registered: #155eef;
  --st-paid: #0e9f6e;
  --danger: #d92d20;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Barlow', system-ui, -apple-system, sans-serif;
  --r: 14px;
  --shadow: 0 1px 2px rgba(14, 23, 38, .06), 0 4px 14px rgba(14, 23, 38, .05);
  --shadow-up: 0 2px 4px rgba(14, 23, 38, .06), 0 12px 28px rgba(14, 23, 38, .10);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--body); font-size: 15.5px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgba(21, 94, 239, .45); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.boot { padding: 100px 20px; text-align: center; color: var(--ink-3); }
h1, h2, h3 { margin: 0; line-height: 1.08; }
.disp { font-family: var(--display); font-style: italic; font-weight: 800; letter-spacing: -.005em; }
h1 { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 40px; }
h2 { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 28px; }
h3 { font-size: 17px; font-weight: 700; }
.sub { color: var(--ink-2); margin: 6px 0 0; max-width: 64ch; }
.muted { color: var(--ink-3); }

/* ---------- header ---------- */
.topbar { position: sticky; top: 0; z-index: 900; background: #fff; border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1280px; margin: 0 auto; height: 64px; padding: 0 20px; display: flex; align-items: center; gap: 28px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; white-space: nowrap; }
.logo-text { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 25px; letter-spacing: -.01em; }
.logo-mark { width: 30px; height: 22px; position: relative; flex: none; }
.logo-mark::before, .logo-mark::after { content: ''; position: absolute; top: 0; bottom: 0; width: 11px; transform: skewX(-18deg); border-radius: 2px; }
.logo-mark::before { left: 4px; background: var(--blue); }
.logo-mark::after { left: 17px; background: var(--orange); }
.logo-mark.big { display: block; margin: 0 auto 12px; width: 48px; height: 34px; }
.logo-mark.big::before { width: 17px; left: 6px; } .logo-mark.big::after { width: 17px; left: 27px; }
.tabs { display: flex; gap: 2px; flex: 1; }
.tabs a { display: flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; color: var(--ink-2); font-weight: 600; text-decoration: none; }
.tabs a:hover { background: var(--mist); color: var(--ink); }
.tabs a.on { color: var(--blue); background: var(--blue-50); }
.tabs svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.account { display: flex; align-items: center; gap: 8px; }
.me-btn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 3px 12px 3px 3px; cursor: pointer; font-weight: 600; }
.me-btn:hover { border-color: var(--line-2); }
.badge-dot { min-width: 20px; height: 20px; border-radius: 999px; background: var(--orange); color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; padding: 0 6px; }
.menu { position: absolute; right: 20px; top: 58px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-up); padding: 6px; min-width: 220px; z-index: 950; }
.menu a, .menu button { display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; border: 0; background: none; color: var(--ink); font-weight: 500; cursor: pointer; text-decoration: none; }
.menu a:hover, .menu button:hover { background: var(--mist); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

@media (max-width: 820px) {
  .topbar-in { height: 56px; gap: 10px; padding: 0 14px; }
  .logo { flex: 1; min-width: 0; }
  .logo-text { font-size: 21px; overflow: hidden; text-overflow: ellipsis; }
  .tabs { position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg); border-top: 1px solid var(--line); justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 900; }
  .tabs a { flex-direction: column; gap: 1px; padding: 4px 10px; font-size: 12px; }
  .tabs a.on { background: none; }
  body { padding-bottom: 72px; }
  .me-btn span.nm { display: none; }
  .me-btn { padding: 3px; }
  .account .btn.ghost { display: none; }
}

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--bg); font-weight: 700; cursor: pointer; text-decoration: none !important; white-space: nowrap; color: var(--ink); transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dk); border-color: var(--blue-dk); }
.btn.accent { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.accent:hover { background: #e85a07; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--mist); }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 13.5px; }
.btn.big { min-height: 50px; padding: 0 26px; font-size: 17px; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 999px; border: 0; background: transparent; cursor: pointer; color: var(--ink-2); text-decoration: none !important; }
.icon-btn:hover { background: var(--mist); color: var(--ink); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--blue-50), #fff 92%); border-bottom: 1px solid var(--line); }
.hero::before { content: ''; position: absolute; right: -6%; top: -30%; width: 58%; height: 160%; transform: skewX(-18deg); background: repeating-linear-gradient(90deg, rgba(21, 94, 239, .07) 0 26px, transparent 26px 52px); pointer-events: none; }
.hero::after { content: ''; position: absolute; right: 23%; top: -20%; width: 16px; height: 150%; transform: skewX(-18deg); background: var(--orange); opacity: .9; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .hero::before { animation: lanes 1s cubic-bezier(.2, .8, .2, 1) both; }
  .hero::after { animation: slash .9s .15s cubic-bezier(.2, .8, .2, 1) both; }
  @keyframes lanes { from { transform: translateX(18%) skewX(-18deg); opacity: 0; } }
  @keyframes slash { from { transform: translateX(60vw) skewX(-18deg); } }
}
.hero-in { position: relative; z-index: 1; max-width: 1280px; margin: 0 auto; padding: 44px 20px 34px; }
.hero h1 { font-size: clamp(26px, 2.95vw, 44px); line-height: 1.05; white-space: nowrap; }
.hero h1 .h1-accent { color: var(--orange); }
.hero p.lead { font-size: 17.5px; color: var(--ink-2); margin: 12px 0 20px; }
.hero p.lead span { display: block; }
.runner { position: absolute; right: 7%; top: 50%; width: 300px; transform: translateY(-50%); pointer-events: none; z-index: -1; }
.runner .fig { fill: var(--blue); }
.runner .speed { fill: var(--orange); opacity: .55; }
@media (prefers-reduced-motion: no-preference) {
  .runner .speed { animation: dash 1.3s ease-in-out infinite; }
  @keyframes dash { 0%, 100% { transform: translateX(0); opacity: .6; } 50% { transform: translateX(-8px); opacity: .3; } }
}
@media (max-width: 1100px) { .runner { display: none; } }
@media (max-width: 980px) { .hero p.lead span { display: inline; } .hero h1 { font-size: clamp(24px, 6.4vw, 52px); white-space: normal; } .hero h1 .h1-accent { display: block; margin-top: 2px; } }
@media (max-width: 360px) { .hero h1 { white-space: normal; } }
.search { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px; box-shadow: var(--shadow-up); max-width: 760px; }
.search svg { width: 20px; height: 20px; margin-left: 12px; flex: none; fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; height: 44px; font-size: 16px; background: transparent; }
.search select { border: 0; border-left: 1px solid var(--line); height: 36px; padding: 0 10px; background: transparent; color: var(--ink-2); max-width: 190px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.quick button { border: 1px solid var(--line-2); background: rgba(255, 255, 255, .85); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--ink-2); }
.quick button:hover { border-color: var(--blue); color: var(--blue); }
.quick button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
@media (max-width: 640px) {
  .quick { display: none; }
  .hero p.lead { margin-bottom: 14px; }
  .hero-in { padding: 22px 16px 18px; }
  .hero::after { right: 6%; width: 10px; }
  .search select { display: none; }
  .search .btn { padding: 0 14px; }
}

/* ---------- page ---------- */
.page { max-width: 1280px; margin: 0 auto; padding: 26px 20px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.narrow { max-width: 760px; }
.narrow-wide { max-width: 1080px; }

/* ---------- filter bar ---------- */
.fbar-wrap { position: sticky; top: 64px; z-index: 800; background: #fff; border-bottom: 1px solid var(--line); }
.fbar { max-width: 1280px; margin: 0 auto; padding: 10px 20px; display: flex; gap: 8px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.fbar::-webkit-scrollbar { display: none; }
.pill { position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line-2); background: #fff; font-weight: 600; font-size: 14.5px; cursor: pointer; color: var(--ink); white-space: nowrap; }
.pill:hover { border-color: var(--ink-3); }
.pill.on { border-color: var(--blue); background: var(--blue-50); color: var(--blue); }
.pill svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pill .n { background: var(--blue); color: #fff; border-radius: 999px; font-size: 12px; padding: 0 7px; line-height: 19px; }
.fbar .spacer { flex: 1; }
.fbar .btn.accent { flex: none; min-height: 38px; }
.pill .sm, .fbar .sm { display: none; }
.pill .pt { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.pill.toggle.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.fbar .clear { flex: none; font-weight: 600; font-size: 14px; color: var(--ink-2); background: none; border: 0; cursor: pointer; padding: 0 8px; }
.fbar .clear:hover { color: var(--blue); }
.pop { position: fixed; z-index: 1000; overflow-y: auto; overscroll-behavior: contain; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-up); padding: 18px; width: 380px; max-width: calc(100vw - 24px); }
.pop h4 { margin: 0 0 10px; font-size: 15px; }
.pop-foot { position: sticky; bottom: -18px; background: #fff; padding-bottom: 2px; display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  .fbar-wrap { top: 56px; }
  .fbar { padding: 8px 12px; flex-wrap: wrap; overflow: visible; gap: 6px; }
  .fbar .pill { height: 34px; padding: 0 10px; font-size: 13.5px; gap: 4px; }
  .fbar .pill svg { width: 13px; height: 13px; }
  .fbar .spacer { display: none; }
  .fbar .clear { padding: 0 4px; font-size: 13px; }
  .fbar .btn.accent { min-height: 34px; padding: 0 12px; }
  .fbar .lg { display: none; }
  .fbar .sm { display: inline; }
  .pill .pt { max-width: 96px; }
  .pop { position: fixed; left: 0 !important; right: 0; bottom: 0; top: auto !important; width: 100%; max-width: none; border-radius: 18px 18px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 1001; max-height: 80vh; }
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line-2); background: #fff; border-radius: 999px; padding: 6px 13px; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; }
.f-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { margin-bottom: 14px; }
.field label, .f-grid label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.field input, .field select, .field textarea, .f-grid input, .f-grid select { width: 100%; height: 42px; padding: 0 12px; border: 1.5px solid var(--line-2); border-radius: 10px; background: #fff; }
.field textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .f-grid input:focus, .f-grid select:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(21, 94, 239, .14); }
.field .hint { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--blue); flex: none; }
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 600; font-size: 14.5px; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer; transition: background .15s; margin: 0; flex: none; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked { background: var(--blue); }
.switch input:checked::after { transform: translateX(16px); }

/* ---------- results ---------- */
.result-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.result-bar .count { font-weight: 700; font-size: 16px; }
.from-note { font-size: 14px; color: var(--ink-2); }
.month { margin: 28px 0 12px; display: flex; align-items: baseline; gap: 12px; }
.month h2 { font-size: 32px; }
.month span { color: var(--ink-3); font-weight: 600; }
.race { display: grid; grid-template-columns: 76px 1fr auto; gap: 18px; align-items: center; padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px; transition: box-shadow .18s, border-color .18s, transform .18s; }
.race:hover { box-shadow: var(--shadow-up); border-color: var(--line-2); }
.race.mine { box-shadow: inset 4px 0 0 var(--blue); }
.race.pending { background: repeating-linear-gradient(-45deg, #fff 0 12px, #fffaf3 12px 24px); border-color: #fbd9a8; }
.dtile { width: 76px; text-align: center; border-radius: 12px; background: var(--mist); padding: 8px 4px 9px; position: relative; overflow: hidden; }
.dtile::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--road); }
.dtile.trail::before { background: var(--green); }
.dtile.inne::before { background: var(--ink-3); }
.dtile .dw { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: lowercase; }
.dtile b { display: block; font-family: var(--display); font-style: italic; font-weight: 800; font-size: 36px; line-height: .95; letter-spacing: -.02em; }
.dtile.range b { font-size: 25px; padding: 5px 0 2px; }
.dtile .mo { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.race-main { min-width: 0; }
.race-name { font-weight: 700; font-size: 18px; line-height: 1.25; color: var(--ink); background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.race-name:hover { color: var(--blue); text-decoration: underline; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.tag { font-size: 12.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--mist-2); color: var(--ink-2); white-space: nowrap; }
.tag.type { color: #fff; background: var(--road); }
.tag.type.trail { background: var(--green); }
.tag.type.inne { background: var(--ink-3); }
.tag.km { background: var(--blue-50); color: var(--blue); }
.tag.wait { background: #fff1db; color: #a15c00; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.meta .it { display: inline-flex; align-items: center; gap: 5px; }
.meta svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.meta b { color: var(--ink); }
.team { display: flex; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.av { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 11.5px; flex: none; border: 2px solid #fff; position: relative; }
.team .av { margin-right: -6px; }
.team .av::after { content: ''; position: absolute; right: -3px; bottom: -3px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff; background: var(--st); }
.team-names { font-size: 13px; color: var(--ink-2); margin-left: 14px; }
.race-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.status { display: inline-flex; background: var(--mist); border-radius: 999px; padding: 3px; gap: 2px; }
.status button { border: 0; background: transparent; padding: 6px 12px; font-size: 13.5px; font-weight: 700; cursor: pointer; color: var(--ink-2); border-radius: 999px; white-space: nowrap; }
.status button:hover { background: #fff; color: var(--ink); }
.status button.on[data-s="maybe"] { background: var(--st-maybe); color: #fff; }
.status button.on[data-s="registered"] { background: var(--st-registered); color: #fff; }
.status button.on[data-s="paid"] { background: var(--st-paid); color: #fff; }
.side-links { display: flex; gap: 2px; align-items: center; }
.more { display: flex; justify-content: center; margin: 22px 0; }
.empty { padding: 56px 20px; text-align: center; color: var(--ink-2); background: var(--mist); border-radius: var(--r); }
.empty strong { display: block; font-family: var(--display); font-style: italic; font-size: 28px; color: var(--ink); margin-bottom: 6px; }
@media (max-width: 760px) {
  .race { grid-template-columns: 62px 1fr; gap: 12px 14px; padding: 14px; }
  .dtile { width: 62px; }
  .dtile b { font-size: 30px; }
  .race-name { font-size: 16.5px; }
  .race-side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .status button { padding: 6px 10px; }
}

/* ---------- calendar ---------- */
.cal-tools { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin-bottom: 18px; }
.q-nav { display: flex; align-items: center; gap: 6px; }
.q-nav strong { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 28px; min-width: 250px; text-align: center; }
.months3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.mcal { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.mcal h3 { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 24px; margin: 0 4px 10px; }
.mgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mgrid .dow { font-size: 11.5px; font-weight: 700; color: var(--ink-3); text-align: center; padding-bottom: 2px; }
.day { min-height: 78px; border-radius: 9px; background: var(--mist); padding: 4px; display: flex; flex-direction: column; gap: 3px; border: 1.5px solid transparent; text-align: left; font: inherit; min-width: 0; }
.day.out { background: transparent; }
.day.we { background: #eaf0f7; }
.day.today { border-color: var(--orange); }
.day.has { cursor: pointer; }
.day.has:hover { border-color: var(--blue); background: #fff; }
.day .dn { font-weight: 700; font-size: 13px; color: var(--ink-2); line-height: 1.1; }
.ev { display: flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; line-height: 1.2; border-radius: 5px; padding: 2px 4px; color: #fff; background: var(--ink-3); overflow: hidden; white-space: nowrap; }
.ev svg { width: 12px; height: 12px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ev span { overflow: hidden; text-overflow: ellipsis; }
.ev.maybe { background: var(--st-maybe); }
.ev.registered { background: var(--st-registered); }
.ev.paid { background: var(--st-paid); }
.ev-more { font-size: 11px; font-weight: 700; color: var(--ink-2); padding-left: 2px; }
.ev-count { margin-top: auto; align-self: flex-start; font-size: 11px; font-weight: 700; color: var(--blue); background: var(--blue-50); border-radius: 999px; padding: 0 7px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--ink-2); margin-top: 16px; align-items: center; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }
.legend svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; vertical-align: -3px; margin-right: 4px; }
@media (max-width: 1100px) { .months3 { grid-template-columns: 1fr; } .day { min-height: 60px; } }
@media (max-width: 520px) { .ev span { display: none; } .ev { justify-content: center; } .q-nav strong { min-width: 0; font-size: 22px; } }

/* ---------- map ---------- */
#map { height: calc(100vh - 250px); min-height: 440px; border-radius: var(--r); border: 1px solid var(--line); }
.pin-home { width: 22px; height: 22px; border-radius: 50%; background: var(--orange); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--orange); }
.leaflet-popup-content { font-family: var(--body); font-size: 14px; margin: 14px 16px; }
.leaflet-popup-content-wrapper { border-radius: 14px; }
.pop-race h4 { margin: 0 0 4px; font-size: 16px; }
.pop-race p { margin: 2px 0; color: var(--ink-2); }

/* ---------- cards / forms pages ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.card + .card { margin-top: 18px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.cols .card + .card { margin-top: 0; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.err { color: var(--danger); font-size: 14px; min-height: 20px; margin: 4px 0; }
.ok-note { background: #e8f7f0; color: #075e42; border-radius: 12px; padding: 14px 16px; margin: 10px 0; }
.note { background: var(--mist); color: var(--ink-2); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin: 10px 0; }
.copyline { display: flex; gap: 6px; }
.copyline input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--mist); font-size: 13px; }
.people { display: grid; }
.person { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.person:last-child { border-bottom: 0; }
.person .nm { flex: 1; min-width: 160px; }
.person .nm small { display: block; color: var(--ink-3); }
.person .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.st-pill { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 8px; background: #fff1db; color: #a15c00; }
.jobs { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.jobs td { padding: 7px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.jobs td:first-child { font-weight: 600; white-space: nowrap; }
.stats { display: flex; gap: 28px; margin: 6px 0 14px; flex-wrap: wrap; }
.stats div b { display: block; font-family: var(--display); font-style: italic; font-weight: 800; font-size: 34px; line-height: 1; }
.stats div span { color: var(--ink-2); font-size: 13.5px; }
.steps { padding-left: 20px; margin: 8px 0; color: var(--ink-2); }
.steps li { margin-bottom: 4px; }
.pending-card { border: 1px solid #fbd9a8; background: #fffaf3; border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.pending-card h4 { margin: 0 0 4px; font-size: 16px; }
.pending-card .kv { font-size: 14px; color: var(--ink-2); margin: 2px 0; }
.pending-card .actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- auth ---------- */
.auth-wrap { min-height: calc(100vh - 64px); display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { position: relative; overflow: hidden; background: var(--blue); color: #fff; padding: 56px 48px; display: flex; flex-direction: column; justify-content: flex-end; }
.auth-side::before { content: ''; position: absolute; inset: -20% -30% -20% 30%; transform: skewX(-18deg); background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .09) 0 30px, transparent 30px 60px); }
.auth-side::after { content: ''; position: absolute; right: 18%; top: -10%; height: 130%; width: 18px; transform: skewX(-18deg); background: var(--orange); }
.auth-side h2 { position: relative; z-index: 1; font-size: clamp(40px, 5vw, 64px); line-height: .95; max-width: 11ch; }
.auth-side p { position: relative; z-index: 1; color: #dbe6ff; max-width: 40ch; font-size: 17px; }
.auth-main { display: grid; place-items: center; padding: 40px 22px; }
.auth-main form { width: min(420px, 100%); }
.auth-main h1 { font-size: 40px; margin-bottom: 6px; }
.auth-main .btn.big { width: 100%; margin-top: 6px; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; font-size: 14.5px; flex-wrap: wrap; }
@media (max-width: 860px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { padding: 30px 22px; min-height: 180px; } }
.auth-body { min-height: 100vh; display: grid; place-items: center; background: var(--blue-50); padding: 20px; margin: 0; }
.auth-card { background: #fff; border-radius: 18px; padding: 34px; width: min(420px, 100%); text-align: center; box-shadow: var(--shadow-up); }
.auth-card h1 { font-size: 34px; margin: 6px 0 8px; }
.auth-card p { color: var(--ink-2); }
.auth-card form { margin-top: 18px; }

/* ---------- dialog ---------- */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: 0 24px 70px rgba(14, 23, 38, .3); color: var(--ink); }
dialog::backdrop { background: rgba(14, 23, 38, .45); backdrop-filter: blur(2px); }
.dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 22px 12px; }
.dlg-head h2 { font-size: 30px; }
.dlg-body { padding: 4px 22px 18px; overflow: auto; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; font-size: 14.5px; margin: 14px 0; }
.detail-grid dt { color: var(--ink-3); font-weight: 600; }
.detail-grid dd { margin: 0; }
.desc { white-space: pre-line; color: var(--ink-2); font-size: 14.5px; background: var(--mist); border-radius: 12px; padding: 12px 14px; max-height: 220px; overflow: auto; }
.link-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.day-list .race { grid-template-columns: 62px 1fr; }
.day-list .race-side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; }

/* ---------- toast + footer ---------- */
#toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 30px); opacity: 0; background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-weight: 600; transition: transform .2s, opacity .2s; z-index: 2000; pointer-events: none; max-width: calc(100vw - 30px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 820px) { #toast { bottom: 88px; } }
.foot { border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13px; background: var(--mist); }
.foot-in { max-width: 1280px; margin: 0 auto; padding: 20px; display: flex; gap: 12px 32px; justify-content: space-between; flex-wrap: wrap; align-items: center; }
.foot-in p { margin: 0; flex: 1 1 520px; }
.foot-links { display: flex; gap: 8px 20px; flex-wrap: wrap; }
.foot-links a { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--ink-3); font-size: 12.5px; }
.foot-links svg, .extra-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.extra-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.extra-link:hover, .extra-link.on { color: #d00; background: #fff0f0; text-decoration: none; }
@media (max-width: 1080px) { .extra-link span { display: none; } }
@media (max-width: 820px) { .extra-link { padding: 8px; margin-left: auto; } .extra-link svg { width: 22px; height: 22px; } }
/* videos */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* inline filter bar (calendar, map) */
.fbar-wrap.inline { position: static; border: 1px solid var(--line); border-radius: var(--r); margin: 0 0 14px; z-index: auto; }
.fbar-wrap.inline .fbar { padding: 10px 12px; flex-wrap: wrap; overflow: visible; }
#calPeople { margin: -4px 0 14px; }
#qLabel .sm { display: none; }
/* segmented control */
.seg { display: inline-flex; background: var(--bg-2, #f1f4f9); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; font: inherit; font-weight: 600; font-size: 14px; color: var(--ink-2); padding: 7px 16px; border-radius: 999px; cursor: pointer; }
.seg button.on { background: #fff; color: var(--blue); box-shadow: 0 1px 3px rgba(16, 24, 40, .15); }
.seg button:not(.on):hover { color: var(--ink); }
/* map */
.map-top { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 10px; }
.map-top .legend { margin-top: 0; }
/* google sync */
.gsync { display: flex; align-items: center; gap: 18px; margin-top: 28px; flex-wrap: wrap; }
.gsync h2 { margin: 0 0 4px; font-size: 18px; }
.gsync .sub { margin: 0; }
.gs-ico { width: 48px; height: 48px; border-radius: 12px; background: var(--blue-50); color: var(--blue); display: grid; place-items: center; flex: none; }
.gs-ico svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.gs-txt { flex: 1; min-width: 220px; }
.gs-act { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .fbar-wrap.inline { border: 0; border-radius: 0; }
  .fbar-wrap.inline .fbar { padding: 0; }
  .fbar-wrap.inline .btn.accent, .fbar-wrap.inline .clear { display: none; }
  #qLabel .lg { display: none; } #qLabel .sm { display: inline; }
  .q-nav strong { font-size: 22px; }
  .seg { width: 100%; } .seg button { flex: 1; padding: 7px 8px; }
  .gs-act { width: 100%; }
}


.page-head .sub { max-width: none; }
.lg-home { color: inherit; text-decoration: none; display: inline-flex; align-items: center; }
.lg-home small { margin-left: 6px; color: var(--ink-3); font-size: 12.5px; }
.lg-home:hover, .lg-home:hover small { color: var(--blue); }

/* person race list */
.pl-list { display: grid; }
.pl-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pl-item:last-child { border-bottom: 0; }
.pl-date { width: 46px; flex: none; text-align: center; background: var(--blue-50); border-radius: 10px; padding: 4px 0; line-height: 1.1; }
.pl-date b { display: block; font-size: 18px; } .pl-date span { font-size: 12px; color: var(--ink-2); }
.pl-main { flex: 1; min-width: 0; }
.pl-main .race-name { font-size: 15.5px; text-align: left; }
.pl-meta { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.pl-st { font-weight: 600; }
.pl-st.paid { color: var(--st-paid); } .pl-st.registered { color: var(--st-registered); } .pl-st.maybe { color: #b7791f; }
.pl-add { flex: none; color: var(--blue); border: 1.5px solid var(--blue); }
.pl-add:hover { background: var(--blue); color: #fff; }
.pl-added { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--green); }
.pl-added svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.person .btn svg { width: 15px; height: 15px; }

/* range sliders (drive filter) */
.rng { margin-bottom: 16px; min-width: 260px; }
.rng-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.rng-top label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin: 0; }
.rng-top b { font-size: 15px; color: var(--blue); }
.rng input[type=range] { width: 100%; accent-color: var(--blue); height: 24px; margin: 0; cursor: pointer; }
.rng-scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); }

.pl-side { flex: none; display: flex; align-items: center; gap: 4px; }
.pl-added { border: 0; background: none; cursor: pointer; font: inherit; padding: 6px 8px; border-radius: 999px; }
.pl-added:hover { background: var(--mist); }
.pl-choose button { padding: 6px 10px; font-size: 13px; }
@media (max-width: 640px) {
  .pl-item.choosing { flex-wrap: wrap; }
  .pl-item.choosing .pl-side { width: 100%; justify-content: flex-end; }
}

.diff { border-collapse: collapse; font-size: 14px; margin: 6px 0 8px; width: 100%; }
.diff td { padding: 4px 12px 4px 0; vertical-align: top; overflow-wrap: anywhere; }
.diff td:first-child { color: var(--ink-3); white-space: nowrap; width: 1%; }
.diff .old { color: var(--ink-3); text-decoration: line-through; }
.diff .new { font-weight: 600; }


/* ---------------- Ambitny Amator ---------------- */
.vid-page .page-head .sub { max-width: 70ch; }
.yt-sub { gap: 8px; color: #fff !important; background: #ff0033; border-color: #ff0033; }
.yt-sub:hover { background: #d9002b; border-color: #d9002b; }
.yt-sub svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.frame { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #0b1220; }
.frame img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.frame .play { position: absolute; inset: 0; display: grid; place-items: center; border: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,.35)); cursor: pointer; }
.frame .play span { width: 64px; height: 46px; border-radius: 14px; background: #ff0033; display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); transition: transform .15s; }
.frame .play svg { width: 24px; height: 24px; fill: #fff; }
.frame:hover img { transform: scale(1.04); }
.frame:hover .play span { transform: scale(1.1); }
.v-new, .v-short { position: absolute; top: 10px; left: 10px; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; pointer-events: none; }
.v-new { background: var(--orange); color: #fff; }
.v-short { left: auto; right: 10px; background: rgba(0,0,0,.65); color: #fff; }
.v-info .when { color: var(--ink-3); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.v-info h3 { font-size: 17px; line-height: 1.3; margin: 0 0 6px; }
.desc-v { color: var(--ink-2); font-size: 14px; line-height: 1.5; white-space: pre-line; overflow: hidden; max-height: 4.5em; overflow-wrap: anywhere; }
.desc-v.long { max-height: 9em; }
.desc-v.open { max-height: none; }
.more-v { border: 0; background: none; color: var(--blue); font-weight: 600; font-size: 14px; padding: 4px 0; cursor: pointer; }
.v-feature { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 26px; align-items: center; padding: 18px;
  border-radius: 18px; background: linear-gradient(135deg, #0f1b33, #13284f 60%, #1b3a6e); color: #fff; box-shadow: 0 18px 40px -18px rgba(16, 40, 90, .55); }
.v-feature .v-info h3 { font-size: 24px; color: #fff; }
.v-feature .when { color: #9fb3d9; }
.v-feature .desc-v { color: #d3dcef; font-size: 15px; }
.v-feature .desc-v a, .v-feature .more-v { color: #8cb4ff; }
.v-sec { font-size: 22px; margin: 34px 0 14px; }
.v-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.v-card { display: flex; flex-direction: column; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 12px 14px; transition: box-shadow .2s, transform .2s; }
.v-card:hover { box-shadow: 0 12px 28px -14px rgba(16, 24, 40, .3); transform: translateY(-2px); }
.v-card .v-info { padding: 0 4px; }
@media (max-width: 980px) { .v-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .v-feature { grid-template-columns: 1fr; gap: 16px; } }
@media (max-width: 600px) { .v-grid { grid-template-columns: 1fr; } .v-feature { padding: 12px; border-radius: 14px; } .v-feature .v-info h3 { font-size: 19px; } }

/* teams */
.col-stack { display: grid; gap: 18px; align-content: start; }
.role-pill { display: inline-block; font-size: 11.5px; font-weight: 700; color: var(--orange); background: #fff1e8; border-radius: 999px; padding: 1px 8px; margin-left: 4px; vertical-align: 1px; }
.team-desc { color: var(--ink-2); margin: 6px 0 0; max-width: 70ch; }
.req-msg { font-size: 13.5px; color: var(--ink-2); font-style: italic; margin-top: 2px; }
.team-q { width: 100%; height: 42px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 12px; font: inherit; margin-bottom: 8px; }
.team-list { display: grid; }
.team-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.team-row:last-child { border-bottom: 0; }
.team-choice { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 8px; margin: 4px 0 16px; }
.team-choice legend { font-weight: 700; padding: 0 6px; }
.radio { display: flex; align-items: center; gap: 9px; padding: 6px 0; cursor: pointer; font-size: 15px; }
.radio input { accent-color: var(--blue); width: 17px; height: 17px; margin: 0; }
.tc-sub { margin: 2px 0 10px 26px; }
.join-card { text-align: center; padding: 34px 24px; }
.join-card h1 { margin: 4px 0; }
.join-ico { width: 56px; height: 56px; border-radius: 16px; background: var(--blue-50); color: var(--blue); display: grid; place-items: center; margin: 0 auto 10px; }
.join-ico svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.join-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.tabs a { position: relative; }
.tabs a .badge-dot { position: absolute; top: -5px; right: -8px; min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; }

#teamForm { margin-top: 12px; }

.team-people .person { flex-wrap: nowrap; }
.team-people .nm { min-width: 0; }
.nm-line { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; }
.team-people .actions { flex: none; align-items: center; }
.team-people .actions .btn { width: 148px; justify-content: center; }
.btn-ph { display: inline-block; width: 148px; }
.icon-ph { display: inline-block; width: 36px; }
.role-pill { display: inline-flex; align-items: center; gap: 4px; margin-left: 0; }
svg.cband { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; flex: none; }
.cap-btn { display: inline-flex; align-items: center; gap: 5px; border: 1px dashed var(--line-2); background: #fff; color: var(--ink-2); font: inherit; font-size: 12.5px; font-weight: 600;
  border-radius: 999px; padding: 2px 10px 2px 7px; cursor: pointer; }
.cap-btn:hover { border-color: var(--orange); color: var(--orange); border-style: solid; }
.cap-btn.off:hover { border-color: var(--ink-3); color: var(--ink); }
@media (max-width: 640px) {
  .team-people .person { flex-wrap: wrap; }
  .team-people .nm { flex: 1 1 calc(100% - 50px); }
  .team-people .actions { width: 100%; padding-left: 40px; justify-content: space-between; }
  .team-people .actions .btn { width: auto; }
  .btn-ph, .icon-ph { display: none; }
  .cap-btn { white-space: nowrap; }
}

.team-box { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.team-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--blue-50); color: var(--blue); display: grid; place-items: center; flex: none; }
.team-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.acc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.acc-actions .btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.acc-actions .danger { margin-left: auto; }
.acc-actions .btn:disabled { opacity: .5; }

/* legal + settings */
.legal-body { line-height: 1.65; color: var(--ink-2); }
.legal-body h2 { font-size: 19px; margin: 22px 0 8px; color: var(--ink); }
.legal-body h2:first-of-type { margin-top: 8px; }
.legal-body ol, .legal-body ul { padding-left: 22px; margin: 0 0 8px; }
.legal-body li { margin-bottom: 6px; }
.legal-body p { margin: 0 0 10px; }
.lead-l { color: var(--ink-3); font-size: 14px; }
#notifForm fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 6px; margin: 12px 0 0; }
#notifForm legend { font-weight: 700; padding: 0 6px; }
#notifForm .hint { margin: 0 0 4px; }
#notifForm .check { margin: 6px 0; }
.big-switch { font-size: 15.5px; }
.danger-zone { border-color: #f6d0cc; }
.check span a { font-weight: 600; }

.acc-page { max-width: 1120px; }
.acc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.acc-grid > .card { margin: 0; }
.acc-page .danger-zone { margin-top: 18px; }
@media (max-width: 860px) { .acc-grid { grid-template-columns: 1fr; } }
.pw-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
