*,
*::before,
*::after {
  box-sizing: border-box;
}

.athlete-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--w-space-2);
  justify-content: flex-end;
}

.athlete-results-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--w-space-3);
}

/* Тихая вторичная кнопка «Предложить исправление» — не конкурирует с витриной. */
.athlete-correction-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.78rem;
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-pill, 999px);
  background: var(--w-surface);
  color: var(--w-text-muted);
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.athlete-correction-trigger:hover {
  border-color: var(--w-primary);
  color: var(--w-primary-hover);
  background: var(--w-primary-soft);
}

.athlete-correction-trigger svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.athlete-results-actions .athlete-correction-trigger span {
  text-transform: none;
  letter-spacing: 0;
  font-size: var(--w-text-sm);
  font-weight: 750;
  color: inherit;
}

.athlete-correction-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: var(--w-space-4);
  background: rgb(15 23 42 / 0.48);
  backdrop-filter: blur(6px);
}

.athlete-correction-modal {
  width: min(860px, 100%);
  max-height: min(86vh, 900px);
  overflow: auto;
  border-radius: var(--w-radius-lg);
  background: var(--w-surface);
  box-shadow: 0 24px 70px rgb(15 23 42 / 0.24);
}

.athlete-correction-head,
.athlete-correction-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--w-space-3);
  padding: var(--w-space-5);
  border-bottom: 1px solid var(--w-border);
}

.athlete-correction-head h2 {
  margin: 0;
  font-size: var(--w-text-2xl);
  letter-spacing: 0;
}

.athlete-correction-head p,
.athlete-correction-muted {
  margin: var(--w-space-1) 0 0;
  color: var(--w-text-soft);
}

.athlete-correction-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-md);
  background: var(--w-surface);
  color: var(--w-text);
  font-size: var(--w-text-xl);
  line-height: 1;
}

.athlete-correction-form {
  display: grid;
  gap: var(--w-space-5);
  padding: var(--w-space-5);
}

.athlete-correction-section {
  display: grid;
  gap: var(--w-space-3);
}

.athlete-correction-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--w-space-2);
}

.athlete-correction-section-head h3 {
  margin: 0;
  font-size: var(--w-text-lg);
}

.athlete-correction-section-head span {
  color: var(--w-text-soft);
  font-size: var(--w-text-sm);
  font-weight: 700;
}

.athlete-correction-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--w-space-3);
  align-items: center;
  padding: var(--w-space-3);
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-md);
  background: var(--w-surface);
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.athlete-correction-row:hover {
  border-color: var(--w-border-strong);
  transform: translateY(-1px);
}

.athlete-correction-row:has(:checked + .athlete-correction-choice--remove) {
  border-color: var(--w-danger);
  background: color-mix(in srgb, var(--w-danger) 8%, transparent);
}

.athlete-correction-row:has(:checked + .athlete-correction-choice--add) {
  border-color: var(--w-success);
  background: color-mix(in srgb, var(--w-success) 8%, transparent);
}

.athlete-correction-row strong,
.athlete-correction-row small {
  display: block;
  min-width: 0;
}

.athlete-correction-row small {
  color: var(--w-text-soft);
}

.athlete-correction-candidate {
  display: grid;
  gap: var(--w-space-2);
  padding-top: var(--w-space-2);
}

.athlete-correction-candidate-title {
  color: var(--w-link);
  font-weight: 800;
}

.athlete-correction-comment {
  display: grid;
  gap: var(--w-space-2);
}

.athlete-correction-comment span {
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
  font-weight: 800;
}

.athlete-correction-comment textarea {
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-md);
  padding: var(--w-space-3);
  background: var(--w-surface);
  color: var(--w-text);
  font: inherit;
  resize: vertical;
}

.athlete-correction-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 32px;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-pill, 999px);
  background: var(--w-surface-subtle);
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
  font-weight: 800;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.athlete-correction-choice--remove::before {
  content: "✕";
  font-size: 0.82em;
}

.athlete-correction-choice--add::before {
  content: "＋";
  font-size: 0.92em;
}

.athlete-correction-toggle:focus-visible + .athlete-correction-choice {
  outline: 3px solid color-mix(in srgb, var(--w-focus) 28%, transparent);
  outline-offset: 2px;
}

.athlete-correction-toggle:checked + .athlete-correction-choice--remove {
  border-color: var(--w-danger);
  background: var(--w-danger-soft);
  color: var(--w-danger);
}

.athlete-correction-toggle:checked + .athlete-correction-choice--add {
  border-color: var(--w-success);
  background: var(--w-success-soft);
  color: var(--w-success);
}

.athlete-correction-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--w-border);
  border-bottom: 0;
}

.w-button--ghost {
  border-color: var(--w-border-strong);
  background: transparent;
  color: var(--w-text-muted);
}

:root {
  color-scheme: light;

  --w-bg: #f7f8fb;
  --w-surface: #ffffff;
  --w-surface-subtle: #f1f4f8;
  --w-surface-raised: #ffffff;
  --w-text: #111827;
  --w-text-muted: #64748b;
  --w-text-soft: #94a3b8;
  --w-border: #dbe3ec;
  --w-border-strong: #b8c3cf;
  --w-primary: #f97316;
  --w-primary-hover: #ea580c;
  --w-primary-soft: #ffedd5;
  --w-link: #c2410c;
  --w-focus: #2563eb;
  --w-danger: #dc2626;
  --w-danger-soft: #fee2e2;
  --w-warning: #b45309;
  --w-warning-soft: #fef3c7;
  --w-success: #15803d;
  --w-success-soft: #dcfce7;

  --w-sport-swim-ow: #0891b2;
  --w-sport-swim-pool: #2563eb;
  --w-sport-running: #dc2626;
  --w-sport-cycling: #16a34a;
  --w-sport-triathlon: #7c3aed;
  --w-sport-default: #64748b;

  --w-tier-elite: #f59e0b;
  --w-tier-strong: #10b981;
  --w-tier-mid: #38bdf8;
  --w-tier-low: #94a3b8;
  --w-tier-elite-band: #fcd34d;
  --w-tier-strong-band: #6ee7b7;
  --w-tier-mid-band: #7dd3fc;
  --w-tier-low-band: #cbd5e1;

  --w-state-waiting-bg: #eef2ff;
  --w-state-waiting-fg: #3730a3;
  --w-state-moderation-bg: #fef3c7;
  --w-state-moderation-fg: #92400e;
  --w-state-completed-bg: #dcfce7;
  --w-state-completed-fg: #166534;
  --w-state-completed-errors-bg: #ffedd5;
  --w-state-completed-errors-fg: #9a3412;
  --w-state-failed-bg: #fee2e2;
  --w-state-failed-fg: #991b1b;
  --w-state-manual-bg: #f3e8ff;
  --w-state-manual-fg: #6b21a8;

  --w-chart-series-a: #f97316;
  --w-chart-series-a-soft: rgba(249, 115, 22, 0.18);
  --w-chart-series-b: #2563eb;
  --w-chart-series-b-soft: rgba(37, 99, 235, 0.14);
  --w-chart-series-c: #059669;
  --w-chart-series-c-soft: rgba(5, 150, 105, 0.14);
  --w-chart-series-d: #64748b;
  --w-chart-series-d-soft: rgba(100, 116, 139, 0.14);
  --w-chart-grid: #e3e9f1;

  --w-font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --w-font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --w-text-xs: 0.75rem;
  --w-text-sm: 0.875rem;
  --w-text-md: 1rem;
  --w-text-lg: 1.125rem;
  --w-text-xl: 1.375rem;
  --w-text-2xl: 1.75rem;
  --w-text-3xl: 2.25rem;

  --w-space-1: 0.25rem;
  --w-space-2: 0.5rem;
  --w-space-3: 0.75rem;
  --w-space-4: 1rem;
  --w-space-5: 1.25rem;
  --w-space-6: 1.5rem;
  --w-space-7: 1.75rem;
  --w-space-8: 2rem;

  --w-radius-sm: 4px;
  --w-radius-md: 6px;
  --w-radius-lg: 8px;
  --w-radius-pill: 999px;

  --w-public-content: 1080px;
  --w-container: 1120px;
  --w-container-wide: 1360px;

  --sport-swim-ow: var(--w-sport-swim-ow);
  --sport-swim-pool: var(--w-sport-swim-pool);
  --sport-running: var(--w-sport-running);
  --sport-cycling: var(--w-sport-cycling);
  --sport-triathlon: var(--w-sport-triathlon);
  --sport-default: var(--w-sport-default);
}

[data-theme="dark"] {
  color-scheme: dark;

  --w-bg: #111827;
  --w-surface: #18212f;
  --w-surface-subtle: #202c3c;
  --w-surface-raised: #1f2937;
  --w-text: #f8fafc;
  --w-text-muted: #cbd5e1;
  --w-text-soft: #94a3b8;
  --w-border: #334155;
  --w-border-strong: #475569;
  --w-primary: #fb923c;
  --w-primary-hover: #fdba74;
  --w-primary-soft: color-mix(in srgb, #fb923c 20%, transparent);
  --w-link: #fdba74;
  --w-focus: #93c5fd;
  --w-danger: #f87171;
  --w-danger-soft: #450a0a;
  --w-warning: #fbbf24;
  --w-warning-soft: #451a03;
  --w-success: #4ade80;
  --w-success-soft: #052e16;
  --w-chart-grid: #334155;
  --w-chart-series-a: #fb923c;
  --w-chart-series-a-soft: rgba(251, 146, 60, 0.2);
  --w-chart-series-b: #60a5fa;
  --w-chart-series-b-soft: rgba(96, 165, 250, 0.16);
  --w-chart-series-c: #34d399;
  --w-chart-series-c-soft: rgba(52, 211, 153, 0.16);
  --w-chart-series-d: #94a3b8;
  --w-chart-series-d-soft: rgba(148, 163, 184, 0.16);

  --w-state-waiting-bg: #1e1b4b;
  --w-state-waiting-fg: #c7d2fe;
  --w-state-moderation-bg: #451a03;
  --w-state-moderation-fg: #fde68a;
  --w-state-completed-bg: #052e16;
  --w-state-completed-fg: #bbf7d0;
  --w-state-completed-errors-bg: #431407;
  --w-state-completed-errors-fg: #fed7aa;
  --w-state-failed-bg: #450a0a;
  --w-state-failed-fg: #fecaca;
  --w-state-manual-bg: #3b0764;
  --w-state-manual-fg: #e9d5ff;

  --w-sport-swim-ow: #35b6e2;
  --w-sport-swim-pool: #6a9dff;
  --w-sport-running: #f87171;
  --w-sport-cycling: #4cc26a;
  --w-sport-triathlon: #b585f2;
  --w-sport-default: #a0a5ad;

  --w-tier-elite: #fbbf24;
  --w-tier-strong: #4ade80;
  --w-tier-mid: #60a5fa;
  --w-tier-low: #64748b;
  --w-tier-elite-band: #d2a233;
  --w-tier-strong-band: #2da876;
  --w-tier-mid-band: #3a8bc2;
  --w-tier-low-band: #586780;
}

html {
  background: var(--w-bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--w-bg);
  color: var(--w-text);
  font-family: var(--w-font-sans);
  font-size: var(--w-text-md);
}

a {
  color: var(--w-link);
}

a:hover {
  color: var(--w-primary-hover);
}

:focus-visible {
  outline: 3px solid var(--w-focus);
  outline: 3px solid color-mix(in srgb, var(--w-focus) 72%, transparent);
  outline-offset: 2px;
}

::selection {
  background: var(--w-primary-soft);
  color: var(--w-text);
}

.w-page-shell {
  width: min(var(--w-container), 100%);
  margin-inline: auto;
  padding: var(--w-space-4);
}

.w-page-shell--wide {
  width: min(var(--w-container-wide), 100%);
}

.w-panel {
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-lg);
  background: var(--w-surface);
  color: var(--w-text);
  padding: var(--w-space-4);
}

.w-panel--subtle {
  background: var(--w-surface-subtle);
}

.w-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--w-space-2);
  border: 1px solid transparent;
  border-radius: var(--w-radius-md);
  padding: 0.55rem 0.9rem;
  background: var(--w-primary);
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.w-button:hover {
  background: var(--w-primary-hover);
  color: #ffffff;
}

.w-button--secondary {
  border-color: var(--w-border-strong);
  background: var(--w-surface);
  color: var(--w-text);
}

.w-button--secondary:hover {
  border-color: var(--w-primary);
  background: var(--w-primary-soft);
  color: var(--w-text);
}

.w-button--danger {
  background: var(--w-danger);
  color: #ffffff;
}

.w-button--danger:hover {
  background: #991b1b;
}

.w-button--compact {
  min-height: 34px;
  padding: 0.35rem 0.65rem;
  font-size: var(--w-text-sm);
}

.w-input,
.w-select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--w-border-strong);
  border-radius: var(--w-radius-md);
  background: var(--w-surface);
  color: var(--w-text);
  padding: 0.55rem 0.7rem;
  font: inherit;
}

.w-input::placeholder {
  color: var(--w-text-soft);
}

.w-input:focus,
.w-select:focus {
  border-color: var(--w-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--w-focus) 18%, transparent);
  outline: none;
}

.w-form-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--w-space-3);
}

.w-form-grid > * {
  grid-column: span 12;
}

.w-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--w-space-1);
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-pill);
  background: var(--w-surface-subtle);
  color: var(--w-text);
  padding: 0.18rem 0.55rem;
  font-size: var(--w-text-xs);
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
}

.w-chip--waiting {
  border-color: transparent;
  background: var(--w-state-waiting-bg);
  color: var(--w-state-waiting-fg);
}

.w-chip--moderation {
  border-color: transparent;
  background: var(--w-state-moderation-bg);
  color: var(--w-state-moderation-fg);
}

.w-chip--completed {
  border-color: transparent;
  background: var(--w-state-completed-bg);
  color: var(--w-state-completed-fg);
}

.w-chip--completed-errors {
  border-color: transparent;
  background: var(--w-state-completed-errors-bg);
  color: var(--w-state-completed-errors-fg);
}

.w-chip--failed {
  border-color: transparent;
  background: var(--w-state-failed-bg);
  color: var(--w-state-failed-fg);
}

.w-chip--manual {
  border-color: transparent;
  background: var(--w-state-manual-bg);
  color: var(--w-state-manual-fg);
}

.w-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-lg);
  background: var(--w-surface);
}

.w-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--w-text);
  font-size: var(--w-text-sm);
}

.w-table th,
.w-table td {
  border-bottom: 1px solid var(--w-border);
  padding: 0.55rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

.w-table th {
  background: var(--w-surface-subtle);
  color: var(--w-text-muted);
  font-weight: 700;
}

.w-table tbody tr:hover {
  background: rgba(217, 244, 239, 0.45);
  background: color-mix(in srgb, var(--w-primary-soft) 45%, transparent);
}

/* Admin still has Bootstrap-era class names. Keep this scoped shim local to admin
   while templates migrate screen by screen to wave components. */
.admin-page #main-content.container-fluid {
  width: min(var(--w-container-wide), calc(100% - 32px));
  margin-inline: auto;
  padding: var(--w-space-6) 0 var(--w-space-8);
}

.admin-page main {
  display: block;
}

.admin-page h2,
.admin-page h3,
.admin-page h5,
.admin-page h6 {
  margin-top: 0;
  color: var(--w-text);
  line-height: 1.2;
}

.admin-page h2 {
  font-size: var(--w-text-2xl);
}

.admin-page h3 {
  margin-bottom: var(--w-space-3);
  font-size: var(--w-text-xl);
}

.admin-page h5 {
  font-size: var(--w-text-lg);
}

.admin-page h6 {
  font-size: var(--w-text-md);
}

.admin-page p {
  margin-top: 0;
}

.admin-page code {
  font-family: var(--w-font-mono);
  font-size: 0.95em;
}

.admin-page .container-fluid {
  width: 100%;
}

.admin-page .row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0;
}

.admin-page .row > * {
  grid-column: 1 / -1;
  min-width: 0;
}

.admin-page .g-2 {
  gap: var(--w-space-2);
}

.admin-page .g-3 {
  gap: var(--w-space-3);
}

.admin-page .col-12 {
  grid-column: span 12;
}

.admin-page .d-flex {
  display: flex;
}

.admin-page .d-inline-block {
  display: inline-block;
}

.admin-page .align-items-center {
  align-items: center;
}

.admin-page .justify-content-between {
  justify-content: space-between;
}

.admin-page .gap-2 {
  gap: var(--w-space-2);
}

.admin-page .w-100 {
  width: 100%;
}

.admin-page .mt-2 {
  margin-top: var(--w-space-2);
}

.admin-page .mt-3 {
  margin-top: var(--w-space-3);
}

.admin-page .mt-4 {
  margin-top: var(--w-space-4);
}

.admin-page .mb-0 {
  margin-bottom: 0;
}

.admin-page .mb-1 {
  margin-bottom: var(--w-space-1);
}

.admin-page .mb-2 {
  margin-bottom: var(--w-space-2);
}

.admin-page .mb-3 {
  margin-bottom: var(--w-space-3);
}

.admin-page .mb-4 {
  margin-bottom: var(--w-space-4);
}

.admin-page .ms-2 {
  margin-left: var(--w-space-2);
}

.admin-page .p-3 {
  padding: var(--w-space-3);
}

.admin-page .pb-2 {
  padding-bottom: var(--w-space-2);
}

.admin-page .border,
.admin-page .border-top,
.admin-page .border-bottom {
  border-color: var(--w-border);
}

.admin-page .border {
  border: 1px solid var(--w-border);
}

.admin-page .border-top {
  border-top: 1px solid var(--w-border);
}

.admin-page .border-bottom {
  border-bottom: 1px solid var(--w-border);
}

.admin-page .border-danger {
  border-color: var(--w-danger);
}

.admin-page .rounded {
  border-radius: var(--w-radius-lg);
}

.admin-page .fw-bold {
  font-weight: 700;
}

.admin-page .small {
  font-size: var(--w-text-sm);
}

.admin-page .text-muted {
  color: var(--w-text-muted);
}

.admin-page .text-danger {
  color: var(--w-danger);
}

.admin-page .text-end {
  text-align: right;
}

.admin-page .text-break {
  overflow-wrap: anywhere;
}

.admin-page .card {
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-lg);
  background: var(--w-surface);
  color: var(--w-text);
}

.admin-page .card-body {
  padding: var(--w-space-4);
  overflow-x: auto;
}

.admin-page .card-title {
  margin-bottom: var(--w-space-3);
  font-weight: 700;
}

.admin-page .alert {
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-lg);
  padding: var(--w-space-3) var(--w-space-4);
  background: var(--w-warning-soft);
  color: var(--w-warning);
}

.admin-page .btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--w-space-2);
  border: 1px solid transparent;
  border-radius: var(--w-radius-md);
  padding: 0.45rem 0.75rem;
  background: var(--w-surface);
  color: var(--w-text);
  font: inherit;
  font-size: var(--w-text-sm);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.admin-page .btn:hover {
  border-color: var(--w-primary);
  background: var(--w-primary-soft);
  color: var(--w-text);
}

.admin-page .btn-sm {
  min-height: 32px;
  padding: 0.3rem 0.55rem;
  font-size: var(--w-text-xs);
}

.admin-page .btn-primary,
.admin-page .btn-warning {
  background: var(--w-primary);
  color: #ffffff;
}

.admin-page .btn-primary:hover,
.admin-page .btn-warning:hover {
  border-color: var(--w-primary-hover);
  background: var(--w-primary-hover);
  color: #ffffff;
}

.admin-page .btn-danger {
  background: var(--w-danger);
  color: #ffffff;
}

.admin-page .btn-danger:hover {
  border-color: #991b1b;
  background: #991b1b;
  color: #ffffff;
}

.admin-page .btn-outline-primary {
  border-color: var(--w-primary);
  color: var(--w-primary-hover);
}

.admin-page .btn-outline-secondary {
  border-color: var(--w-border-strong);
  color: var(--w-text-muted);
}

.admin-page .btn-outline-success {
  border-color: var(--w-success);
  color: var(--w-success);
}

.admin-page .btn-outline-dark {
  border-color: var(--w-text);
  color: var(--w-text);
}

.admin-page .btn-outline-danger {
  border-color: var(--w-danger);
  color: var(--w-danger);
}

.admin-page .btn-outline-success:hover {
  background: var(--w-success-soft);
  color: var(--w-success);
}

.admin-page .btn-outline-danger:hover {
  background: var(--w-danger-soft);
  color: var(--w-danger);
}

.admin-page .form-label {
  display: block;
  margin-bottom: var(--w-space-1);
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
  font-weight: 700;
}

.admin-page .form-control,
.admin-page .form-select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--w-border-strong);
  border-radius: var(--w-radius-md);
  background: var(--w-surface);
  color: var(--w-text);
  padding: 0.45rem 0.65rem;
  font: inherit;
}

.admin-page .form-control-sm {
  min-height: 32px;
  padding: 0.3rem 0.5rem;
  font-size: var(--w-text-sm);
}

.admin-page .form-control::placeholder {
  color: var(--w-text-soft);
}

.admin-page .form-control:focus,
.admin-page .form-select:focus {
  border-color: var(--w-focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--w-focus) 18%, transparent);
  outline: none;
}

.admin-page .badge {
  display: inline-flex;
  align-items: center;
  border-radius: var(--w-radius-pill);
  padding: 0.22rem 0.55rem;
  font-size: var(--w-text-xs);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.admin-page .text-bg-success {
  background: var(--w-state-completed-bg);
  color: var(--w-state-completed-fg);
}

.admin-page .text-bg-warning {
  background: var(--w-state-moderation-bg);
  color: var(--w-state-moderation-fg);
}

.admin-page .text-bg-danger {
  background: var(--w-state-completed-errors-bg);
  color: var(--w-state-completed-errors-fg);
}

.admin-page .text-bg-dark {
  background: var(--w-state-failed-bg);
  color: var(--w-state-failed-fg);
}

.admin-page .text-bg-info {
  background: var(--w-state-manual-bg);
  color: var(--w-state-manual-fg);
}

.admin-page .text-bg-secondary {
  background: var(--w-state-waiting-bg);
  color: var(--w-state-waiting-fg);
}

.admin-page .table-responsive,
.admin-page .row.border-top,
.admin-page .card-body {
  overflow-x: auto;
}

.admin-page .table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  color: var(--w-text);
  font-size: var(--w-text-sm);
}

.admin-page .table-sm {
  min-width: 0;
}

.admin-page .table th,
.admin-page .table td {
  border-bottom: 1px solid var(--w-border);
  padding: 0.55rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

.admin-page .table-sm th,
.admin-page .table-sm td {
  padding: 0.35rem 0.45rem;
}

.admin-page .table th {
  background: var(--w-surface-subtle);
  color: var(--w-text-muted);
  font-weight: 700;
  white-space: nowrap;
}

.admin-page .table-hover tbody tr:hover {
  background: color-mix(in srgb, var(--w-primary-soft) 42%, transparent);
}

.admin-page .table tbody tr.correction-row-keep {
  background: #f1f5f9;
}

.admin-page .table tbody tr.correction-row-add {
  background: #dcfce7;
}

.admin-page .table tbody tr.correction-row-remove {
  background: #fee2e2;
}

.admin-page .table-hover tbody tr.correction-row-keep:hover {
  background: #e2e8f0;
}

.admin-page .table-hover tbody tr.correction-row-add:hover {
  background: #bbf7d0;
}

.admin-page .table-hover tbody tr.correction-row-remove:hover {
  background: #fecaca;
}

.admin-page summary {
  color: var(--w-link);
  cursor: pointer;
  font-weight: 700;
}

.admin-page input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--w-primary);
}

.admin-page #admin-competitions-filter-form,
.admin-page #filter-form {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--w-space-2);
  margin: var(--w-space-3) 0;
}

.admin-page #admin-competitions-filter-form > *,
.admin-page #filter-form > * {
  grid-column: span 12;
}

.admin-page #filter-form > button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--w-radius-md);
  background: var(--w-primary);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

@media (min-width: 768px) {
  .admin-page .col-md-2 {
    grid-column: span 2;
  }

  .admin-page .col-md-3 {
    grid-column: span 3;
  }

  .admin-page .col-md-4 {
    grid-column: span 4;
  }

  .admin-page .col-md-6 {
    grid-column: span 6;
  }

  .admin-page #admin-competitions-filter-form .col-md-2,
  .admin-page #filter-form > button {
    grid-column: span 2;
  }

  .admin-page #admin-competitions-filter-form .col-md-3 {
    grid-column: span 3;
  }

  .admin-page #filter-form .col-12 {
    grid-column: span 10;
  }
}

.admin-page .admin-login {
  min-height: calc(100vh - 96px);
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.admin-page .admin-login-card {
  width: min(100%, 420px);
}

/* Админ-навбар: те же стили, что у публичного (.wave-header/.wave-nav), но
   ссылки слева у бренда, а тема + «Выйти» прижаты вправо. */
.admin-nav {
  flex-wrap: wrap;
  row-gap: var(--w-space-2);
}

.admin-nav__badge {
  padding: 0.05rem 0.4rem;
  border-radius: var(--w-radius-pill);
  background: var(--w-primary-soft);
  color: var(--w-primary-hover);
  font-size: var(--w-text-xs);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-nav__links {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--w-space-1);
  margin-left: var(--w-space-5);
}

.admin-nav__actions {
  display: inline-flex;
  align-items: center;
  gap: var(--w-space-3);
  margin-left: auto;
}

@media (min-width: 992px) {
  .admin-page .col-lg-4 {
    grid-column: span 4;
  }

  .admin-page .col-lg-8 {
    grid-column: span 8;
  }
}

@media (max-width: 767px) {
  .admin-page #main-content.container-fluid {
    width: min(100%, calc(100% - 24px));
    padding-top: var(--w-space-4);
  }

  .admin-page .d-flex {
    flex-wrap: wrap;
  }

  .admin-page .d-inline-block {
    display: block;
    margin: 0 0 var(--w-space-2);
  }

  .admin-page .ms-2 {
    margin-left: 0;
  }
}

.w-empty-state {
  border: 1px dashed var(--w-border-strong);
  border-radius: var(--w-radius-lg);
  padding: var(--w-space-5);
  color: var(--w-text-muted);
  text-align: center;
}

.w-mono {
  font-family: var(--w-font-mono);
  font-variant-numeric: tabular-nums;
}

.w-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sport-accent-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.sport-accent-swim-ow {
  background: var(--sport-swim-ow);
}

.sport-accent-swim-pool {
  background: var(--sport-swim-pool);
}

.sport-accent-running {
  background: var(--sport-running);
}

.sport-accent-cycling {
  background: var(--sport-cycling);
}

.sport-accent-triathlon {
  background: var(--sport-triathlon);
}

.sport-accent-default {
  background: var(--sport-default);
}

.sport-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sport-default);
  background: transparent;
}

.sport-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.sport-icon.sport-accent-swim-ow {
  color: var(--sport-swim-ow);
  background: transparent;
}

.sport-icon.sport-accent-swim-pool {
  color: var(--sport-swim-pool);
  background: transparent;
}

.sport-icon.sport-accent-running {
  color: var(--sport-running);
  background: transparent;
}

.sport-icon.sport-accent-cycling {
  color: var(--sport-cycling);
  background: transparent;
}

.sport-icon.sport-accent-triathlon {
  color: var(--sport-triathlon);
  background: transparent;
}

.sport-icon.sport-accent-default {
  color: var(--sport-default);
  background: transparent;
}

.sport-chip,
.competition-kind-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: var(--w-space-2);
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-pill);
  padding: 0 13px;
  background: var(--w-surface);
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.sport-chip--icon-only {
  width: 34px;
  padding: 0;
  justify-content: center;
}

.wave-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(219, 227, 236, 0.74);
  background: rgba(247, 248, 251, 0.86);
  backdrop-filter: saturate(180%) blur(18px);
}

[data-theme="dark"] .wave-header {
  border-bottom-color: var(--w-border);
  background: rgba(17, 24, 39, 0.86);
}

.wave-nav {
  width: min(var(--w-public-content), calc(100% - 2rem));
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: var(--w-space-4);
  margin-inline: auto;
  padding: 0;
  font-family: var(--w-font-sans);
}

.wave-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--w-space-2);
  color: var(--w-primary);
  font-size: var(--w-text-2xl);
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.wave-brand:hover {
  color: var(--w-primary-hover);
}

.wave-brand-mark {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(249, 115, 22, 0.24);
  border-radius: var(--w-radius-lg);
  background: var(--w-primary-soft);
  color: var(--w-primary-hover);
}

.wave-brand-mark svg {
  width: 17px;
  height: 17px;
}

.wave-nav-links {
  display: inline-flex;
  align-items: center;
  gap: var(--w-space-1);
  margin-left: auto;
}

.wave-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-md);
  background: transparent;
  color: var(--w-text-muted);
  cursor: pointer;
}

.wave-theme-toggle:hover {
  color: var(--w-text);
  border-color: var(--w-border-strong);
}

.wave-theme-toggle__icon {
  width: 20px;
  height: 20px;
  display: block;
}

.wave-theme-toggle__sun {
  display: none;
}

[data-theme="dark"] .wave-theme-toggle__sun {
  display: block;
}

[data-theme="dark"] .wave-theme-toggle__moon {
  display: none;
}

.wave-nav-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--w-radius-pill);
  padding: 0 14px;
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.wave-nav-link:hover {
  color: var(--w-primary-hover);
  background: rgba(255, 237, 213, 0.52);
}

.wave-nav-link.is-active {
  border-color: rgba(249, 115, 22, 0.28);
  background: var(--w-primary-soft);
  color: var(--w-primary-hover);
}

#main-content {
  padding-top: var(--w-space-5);
}

.athlete-result-details summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--w-text-muted);
}

.athlete-details-row {
  display: none;
}

.athlete-details-row.is-open {
  display: table-row;
}

.athlete-details-row > td {
  background: rgba(122, 127, 135, 0.08);
  border-top: 0;
  padding: 0.7rem 0.85rem;
}

[data-theme="dark"] .athlete-details-row > td {
  background: rgba(122, 127, 135, 0.14);
}

.athlete-details-panel .table {
  background: transparent;
}

.mobile-bottom-nav {
  display: none;
}

.wave-scroll-top {
  position: fixed;
  right: max(20px, calc((100vw - var(--w-public-content)) / 2 - 64px));
  bottom: 24px;
  z-index: 45;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-pill);
  background: rgba(255, 255, 255, 0.92);
  color: var(--w-text-muted);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.96);
  transition: opacity 160ms ease, transform 160ms ease, color 160ms ease, border-color 160ms ease;
  backdrop-filter: saturate(180%) blur(14px);
}

.wave-scroll-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.wave-scroll-top:hover {
  border-color: rgba(249, 115, 22, 0.32);
  color: var(--w-primary-hover);
}

[data-theme="dark"] .wave-scroll-top {
  background: rgba(24, 33, 47, 0.92);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

.wave-scroll-top svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .wave-scroll-top {
    transition: none;
  }
}

.home-page {
  background: var(--w-bg);
}

.home-page #main-content {
  padding-top: 0;
  padding-right: 0;
  padding-left: 0;
}

.home-page .mobile-bottom-nav {
  border-top-color: rgba(219, 227, 236, 0.92);
  background: rgba(255, 255, 255, 0.94);
}

.home-page .mobile-bottom-nav__item {
  color: var(--w-text-muted);
}

.home-page .mobile-bottom-nav__item.is-active {
  color: var(--w-primary-hover);
}

.home-shell {
  --home-bg: var(--w-bg);
  --home-surface: var(--w-surface);
  --home-surface-2: var(--w-surface-subtle);
  --home-text: var(--w-text);
  --home-muted: var(--w-text-muted);
  --home-soft: var(--w-text-soft);
  --home-line: var(--w-border);
  --home-accent: var(--w-primary);

  min-height: 100vh;
  padding: 64px var(--w-space-4) 92px;
  background: linear-gradient(180deg, #fbfcfe 0%, var(--home-bg) 34%, var(--home-bg) 100%);
  color: var(--home-text);
}

.home-hero,
.home-section {
  width: min(var(--w-public-content), 100%);
  margin-inline: auto;
}

.home-hero {
  padding-top: 4px;
}

.home-sport-rotator {
  display: inline-grid;
  vertical-align: baseline;
  color: var(--home-accent);
}

.home-sport-rotator span {
  grid-area: 1 / 1;
  opacity: 0;
  animation: homeSportRotate 12s infinite;
}

.home-sport-rotator span:nth-child(2) {
  animation-delay: 2s;
}

.home-sport-rotator span:nth-child(3) {
  animation-delay: 4s;
}

.home-sport-rotator span:nth-child(4) {
  animation-delay: 6s;
}

.home-sport-rotator span:nth-child(5) {
  animation-delay: 8s;
}

.home-sport-rotator span:nth-child(6) {
  animation-delay: 10s;
}

@keyframes homeSportRotate {
  0% {
    opacity: 0;
    transform: translateY(0.3em);
  }
  3% {
    opacity: 1;
    transform: translateY(0);
  }
  14% {
    opacity: 1;
    transform: translateY(0);
  }
  16%,
  100% {
    opacity: 0;
    transform: translateY(-0.3em);
  }
}

.home-hero-main {
  margin-top: 28px;
}

.home-title {
  margin: 0;
  color: var(--home-text);
  font-family: var(--w-font-sans);
  font-size: 4.35rem;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.02;
  overflow-wrap: break-word;
}

.home-title > span {
  display: block;
}

.home-subtitle {
  margin: 24px 0 44px;
  max-width: 690px;
  color: var(--home-muted);
  font-size: var(--w-text-lg);
  font-weight: 600;
  line-height: 1.6;
}

.home-search {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  min-height: 64px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--home-accent);
  border-radius: var(--w-radius-lg);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(14px);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.home-search:focus-within {
  border-color: var(--home-accent);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.1), 0 0 0 4px rgba(249, 115, 22, 0.18);
}

.home-search-icon {
  position: relative;
  flex: 0 0 46px;
  height: 46px;
}

.home-search-icon::before,
.home-search-icon::after {
  content: "";
  position: absolute;
  display: block;
}

.home-search-icon::before {
  top: 13px;
  left: 12px;
  width: 17px;
  height: 17px;
  border: 3px solid var(--w-text-soft);
  border-radius: 50%;
}

.home-search-icon::after {
  top: 29px;
  left: 28px;
  width: 12px;
  height: 3px;
  border-radius: var(--w-radius-pill);
  background: var(--w-text-soft);
  transform: rotate(45deg);
  transform-origin: left center;
}

.home-search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.home-search-input {
  width: 100%;
  min-height: 48px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--home-text);
  padding-inline: var(--w-space-5) var(--w-space-3);
  font-size: var(--w-text-lg);
  font-weight: 600;
}

.home-search-input::placeholder {
  color: var(--w-text-soft);
}

.home-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  width: 96px;
  flex: 0 0 auto;
  margin-left: 0;
  border: 0;
  border-radius: 0 calc(var(--w-radius-lg) - 1px) calc(var(--w-radius-lg) - 1px) 0;
  background: var(--home-accent);
  color: #ffffff;
  cursor: pointer;
  transition: background-color 160ms ease;
}

.home-search-btn-icon {
  width: 24px;
  height: 24px;
}

.home-search-btn:hover {
  background: #fb923c;
}

.home-query-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--w-space-2);
  margin-top: var(--w-space-4);
}

.home-query-chips a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-pill);
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--home-muted);
  font-size: var(--w-text-sm);
  font-weight: 650;
  text-decoration: none;
  transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease;
}

.home-query-chips a:hover {
  border-color: rgba(249, 115, 22, 0.55);
  color: var(--w-primary-hover);
}

/* Тёмная тема: верх главной, поле поиска и чипы-подсказки были на светлом фоне. */
[data-theme="dark"] .home-shell {
  background: linear-gradient(180deg, var(--w-surface) 0%, var(--home-bg) 34%, var(--home-bg) 100%);
}

[data-theme="dark"] .home-search {
  background: var(--w-surface);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .home-query-chips a {
  background: var(--w-surface-subtle);
}

.home-section {
  margin-top: 84px;
  padding-top: 46px;
  border-top: 1px solid var(--home-line);
}

.home-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--w-space-4);
  margin-bottom: 22px;
}

.home-section-head h2 {
  margin: 0;
  color: var(--home-soft);
  font-size: var(--w-text-sm);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-section-head a {
  color: var(--w-primary-hover);
  font-size: var(--w-text-sm);
  font-weight: 800;
  text-decoration: none;
}

.home-section-head a:hover {
  text-decoration: underline;
}

.home-competition-list {
  display: grid;
}

.home-competition-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) 150px;
  gap: var(--w-space-5);
  align-items: center;
  min-height: 88px;
  padding: var(--w-space-5) 0;
  border-bottom: 1px solid var(--home-line);
  color: inherit;
  text-decoration: none;
  transition: background-color 160ms ease;
}

.home-competition-row:first-child {
  border-top: 1px solid var(--home-line);
}

.home-competition-row:hover {
  background: rgba(255, 237, 213, 0.48);
}

[data-theme="dark"] .home-competition-row:hover {
  background: rgba(251, 146, 60, 0.1);
}

.home-competition-date {
  color: var(--home-muted);
  font-size: var(--w-text-sm);
  font-weight: 700;
}

.home-competition-main {
  min-width: 0;
}

.home-competition-title {
  display: block;
  color: var(--home-text);
  font-size: var(--w-text-lg);
  font-weight: 740;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-competition-location {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  min-width: 0;
  color: var(--home-muted);
  font-size: var(--w-text-sm);
}

.home-competition-location > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-competition-location-icon {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  color: var(--home-soft);
}

.home-competition-stage-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.home-competition-stage-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--home-line);
  border-radius: var(--w-radius-pill);
  background: var(--home-surface-2);
  color: var(--home-muted);
  padding: 0 0.55rem;
  font-size: var(--w-text-xs);
  font-weight: 700;
}

.home-competition-stage-chip--more {
  color: var(--home-soft);
}

.home-competition-kind {
  justify-self: start;
}

.home-empty {
  margin: 0;
  color: var(--home-soft);
}

.home-suggest-panel {
  position: absolute;
  top: calc(100% + var(--w-space-3));
  left: 0;
  right: 0;
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-lg);
  background: var(--w-surface);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.28);
  z-index: 20;
  overflow: hidden;
}

[data-theme="dark"] .home-suggest-panel {
  background: var(--w-surface-raised);
  border-color: var(--w-border);
}

.home-suggest-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--w-space-3);
  text-decoration: none;
  color: inherit;
  padding: var(--w-space-3) var(--w-space-4);
  border-bottom: 1px solid var(--w-border);
  text-align: left;
}

.home-suggest-item:last-child {
  border-bottom: none;
}

.home-suggest-item:hover {
  background: rgba(249, 115, 22, 0.14);
}

.home-suggest-item.is-active {
  background: rgba(249, 115, 22, 0.14);
}

.home-suggest-main {
  min-width: 0;
}

.home-suggest-title {
  display: block;
  overflow: hidden;
  color: var(--home-text, var(--w-text));
  font-size: var(--w-text-md);
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-suggest-title mark {
  background: rgba(249, 115, 22, 0.22);
  color: var(--home-text, inherit);
  border-radius: var(--w-radius-sm);
  padding: 0 2px;
}

.home-suggest-subtitle {
  display: block;
  margin-top: 2px;
  color: var(--home-soft, var(--w-text-muted));
  font-size: var(--w-text-xs);
}

.home-suggest-kind {
  flex: 0 0 auto;
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-pill);
  padding: 0.16rem 0.5rem;
  color: var(--home-soft, var(--w-text-muted));
  font-size: var(--w-text-xs);
  font-weight: 700;
}

.home-suggest-empty {
  padding: var(--w-space-3) var(--w-space-4);
  color: var(--home-soft, var(--w-text-muted));
  font-size: var(--w-text-sm);
}

@media (prefers-reduced-motion: reduce) {
  .home-sport-rotator span {
    animation: none;
    opacity: 0;
    transform: none;
  }

  .home-sport-rotator span:first-child {
    opacity: 1;
  }

  .home-search-btn,
  .home-query-chips a,
  .home-competition-row {
    transition: none;
  }
}

.home-result-card {
  border: 1px solid rgba(122, 127, 135, 0.2);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  background: rgba(255, 255, 255, 0.65);
}

[data-theme="dark"] .home-result-card {
  border-color: rgba(160, 165, 173, 0.25);
  background: rgba(28, 33, 39, 0.6);
}

.home-result-title {
  font-size: 1.02rem;
  margin-bottom: 0.5rem;
}

.home-result-list {
  margin: 0;
  padding-left: 1.1rem;
}

.home-result-list li {
  margin-bottom: 0.28rem;
}

.home-result-empty {
  margin: 0;
  color: var(--w-text-muted);
}

.search-page-shell {
  width: min(var(--w-public-content), 100% - 2rem);
  margin: 0 auto;
  padding: 56px 0 72px;
}

.search-page-hero {
  padding-bottom: var(--w-space-8);
  border-bottom: 1px solid var(--w-border);
}

.search-page-kicker {
  margin-bottom: var(--w-space-3);
  color: var(--w-primary-hover);
  font-size: var(--w-text-sm);
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-page-title {
  max-width: 900px;
  margin: 0;
  color: var(--w-text);
  font-size: clamp(2.4rem, 6vw, 4.75rem);
  font-weight: 780;
  letter-spacing: 0;
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.search-page-form {
  display: flex;
  align-items: center;
  min-height: 68px;
  margin-top: var(--w-space-6);
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-lg);
  background: var(--w-surface);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.06);
  padding: 6px;
}

.search-page-input {
  min-width: 0;
  flex: 1 1 auto;
  min-height: 54px;
  border: 0;
  background: transparent;
  color: var(--w-text);
  padding: 0 var(--w-space-3);
  font: inherit;
  font-size: var(--w-text-lg);
  font-weight: 650;
}

.search-page-input::placeholder {
  color: var(--w-text-soft);
}

.search-page-input:focus {
  outline: none;
}

.search-page-submit {
  min-height: 54px;
  border: 1px solid transparent;
  border-radius: var(--w-radius-md);
  background: var(--w-primary);
  color: #ffffff;
  padding: 0 var(--w-space-6);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}

.search-page-submit:hover {
  background: var(--w-primary-hover);
  transform: translateY(-1px);
}

.search-page-summary {
  display: flex;
  flex-wrap: wrap;
  gap: var(--w-space-2);
  margin-top: var(--w-space-4);
}

.search-page-summary span {
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-pill);
  background: var(--w-surface);
  color: var(--w-text-muted);
  padding: 0.28rem 0.7rem;
  font-size: var(--w-text-sm);
  font-weight: 750;
}

.search-results-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: var(--w-space-6);
  margin-top: var(--w-space-8);
}

.search-result-section {
  min-width: 0;
}

.search-result-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--w-space-3);
  margin-bottom: var(--w-space-3);
}

.search-result-section__head h2 {
  margin: 0;
  color: var(--w-text);
  font-size: var(--w-text-2xl);
  font-weight: 780;
  letter-spacing: 0;
}

.search-result-section__head span {
  color: var(--w-text-soft);
  font-size: var(--w-text-sm);
  font-weight: 850;
}

.search-result-list {
  display: grid;
  border-top: 1px solid var(--w-border);
}

.search-result-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 28px;
  align-items: center;
  gap: var(--w-space-3);
  min-height: 76px;
  border-bottom: 1px solid var(--w-border);
  color: var(--w-text);
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.search-result-row--athlete {
  grid-template-columns: 44px minmax(0, 1fr) 28px;
}

.search-result-row:hover {
  background: rgba(255, 237, 213, 0.48);
  color: var(--w-text);
}

[data-theme="dark"] .search-result-row:hover {
  background: rgba(251, 146, 60, 0.1);
}

.search-result-avatar,
.search-result-sport {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--w-primary-soft);
  color: var(--w-primary-hover);
  font-size: var(--w-text-sm);
  font-weight: 850;
}

.search-result-sport {
  border: 1px solid var(--w-border);
  background: var(--w-surface);
}

.search-result-sport .sport-icon {
  width: 21px;
  height: 21px;
}

.search-result-main {
  min-width: 0;
}

.search-result-title {
  display: block;
  overflow: hidden;
  color: var(--w-text);
  font-size: var(--w-text-md);
  font-weight: 780;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-title mark {
  border-radius: var(--w-radius-sm);
  background: rgba(249, 115, 22, 0.18);
  color: inherit;
  padding: 0 2px;
}

.search-result-meta {
  display: block;
  overflow: hidden;
  margin-top: 0.25rem;
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-kind {
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-pill);
  color: var(--w-text-muted);
  padding: 0.22rem 0.6rem;
  font-size: var(--w-text-xs);
  font-weight: 800;
  white-space: nowrap;
}

.search-result-arrow {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--w-text-soft);
}

.search-result-arrow svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.search-result-row:hover .search-result-arrow {
  color: var(--w-primary-hover);
}

.search-result-empty,
.search-page-empty {
  border: 1px dashed var(--w-border-strong);
  border-radius: var(--w-radius-lg);
  color: var(--w-text-muted);
  padding: var(--w-space-5);
}

.search-page-empty {
  margin-top: var(--w-space-8);
}

.search-page-empty h2 {
  margin: 0 0 var(--w-space-2);
  color: var(--w-text);
  font-size: var(--w-text-2xl);
}

.search-page-empty p {
  max-width: 40rem;
  margin: 0;
  font-weight: 650;
  line-height: 1.5;
}

.wave-page-shell {
  width: min(var(--w-container), 100%);
  margin: 0 auto;
  padding: 0.25rem 0.4rem 1rem;
}

.wave-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding-top: var(--w-space-5);
  margin: 0 0 var(--w-space-3);
  color: var(--w-text-soft);
  font-size: var(--w-text-xs);
  font-weight: 500;
  line-height: 1.4;
}

.wave-breadcrumbs a {
  color: var(--w-text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.wave-breadcrumbs a:hover {
  color: var(--w-text);
}

.wave-breadcrumbs span[aria-hidden="true"] {
  font-size: 0;
  line-height: 0;
}

.wave-breadcrumbs span[aria-hidden="true"]::before {
  content: "›";
  font-size: 1rem;
  font-weight: 400;
  color: var(--w-text-soft);
  opacity: 0.7;
}

.wave-breadcrumbs [aria-current="page"] {
  max-width: min(48rem, 100%);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--w-text-soft);
}

.wave-filter-card {
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-lg);
  background: var(--w-surface);
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.04);
  padding: var(--w-space-4);
  margin-bottom: var(--w-space-4);
}

.wave-filter-card__head {
  margin-bottom: var(--w-space-3);
}

.wave-filter-card__title {
  margin: 0 0 var(--w-space-1);
  font-size: clamp(1.15rem, 2.6vw, 1.5rem);
  font-weight: 750;
}

.wave-filter-card__subtitle {
  margin: 0;
  color: var(--w-text-muted);
}

.athletes-index-page {
  width: min(var(--w-public-content), 100% - 2rem);
  margin: 0 auto;
  padding: 56px 0 72px;
}

.athletes-index-hero {
  padding-bottom: var(--w-space-8);
  border-bottom: 1px solid var(--w-border);
}

.athletes-index-title {
  max-width: 820px;
  margin: 0;
  color: var(--w-text);
  font-size: clamp(2.5rem, 6vw, 4.75rem);
  font-weight: 780;
  letter-spacing: 0;
  line-height: 1.02;
}

.athletes-search-form {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  min-height: 64px;
  margin-top: var(--w-space-6);
  padding: 0;
  border: 1px solid var(--w-primary);
  border-radius: var(--w-radius-lg);
  background: var(--w-surface);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.06);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.athletes-search-form:focus-within {
  border-color: var(--w-primary);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.06), 0 0 0 4px rgba(249, 115, 22, 0.18);
}

.athletes-search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.athletes-search-input {
  width: 100%;
  min-height: 48px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--w-text);
  padding-inline: var(--w-space-5) var(--w-space-3);
  font: inherit;
  font-size: var(--w-text-lg);
  font-weight: 600;
}

.athletes-search-input::placeholder {
  color: var(--w-text-soft);
}

.athletes-search-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  width: 96px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 0 calc(var(--w-radius-lg) - 1px) calc(var(--w-radius-lg) - 1px) 0;
  background: var(--w-primary);
  color: #ffffff;
  cursor: pointer;
  transition: background-color 160ms ease;
}

.athletes-search-submit-icon {
  width: 24px;
  height: 24px;
}

.athletes-search-submit:hover {
  background: var(--w-primary-hover);
}

.athletes-index-results {
  margin-top: var(--w-space-8);
}

.athletes-index-results__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--w-space-3);
  margin-bottom: var(--w-space-3);
}

.athletes-index-results__head h2 {
  margin: 0;
  color: var(--w-text);
  font-size: var(--w-text-2xl);
  font-weight: 780;
  letter-spacing: 0;
}

.athlete-list-grid {
  display: grid;
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-lg);
  background: var(--w-surface);
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.athlete-list-card {
  border-bottom: 1px solid var(--w-border);
}

.athlete-list-card:last-child {
  border-bottom: 0;
}

.athlete-list-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto 28px;
  align-items: center;
  gap: var(--w-space-4);
  min-height: 84px;
  padding: 0 var(--w-space-5);
  color: var(--w-text);
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.athlete-list-sports {
  display: inline-flex;
  align-items: center;
  gap: var(--w-space-2);
}

.athlete-list-card__last {
  display: block;
  margin-top: 0.2rem;
  overflow: hidden;
  color: var(--w-text-soft);
  font-size: var(--w-text-xs);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.athlete-list-row:hover {
  background: rgba(255, 237, 213, 0.48);
  color: var(--w-text);
}

[data-theme="dark"] .athlete-list-row:hover {
  background: rgba(251, 146, 60, 0.1);
}

.athlete-list-avatar {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--w-primary-soft);
  color: var(--w-primary-hover);
  font-size: var(--w-text-sm);
  font-weight: 850;
}

.athlete-list-main {
  min-width: 0;
}

.athlete-list-card__name {
  display: block;
  overflow: hidden;
  color: var(--w-text);
  font-size: var(--w-text-lg);
  font-weight: 780;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.athlete-list-card__meta {
  display: block;
  margin-top: 0.28rem;
  overflow: hidden;
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.athlete-list-arrow {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--w-text-soft);
}

.athlete-list-arrow svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.athlete-list-row:hover .athlete-list-arrow {
  color: var(--w-primary-hover);
}

.athlete-list-empty {
  border: 1px dashed var(--w-border-strong);
  border-radius: var(--w-radius-lg);
  color: var(--w-text-muted);
  padding: var(--w-space-5);
}

.athlete-list-empty h3 {
  margin: 0 0 var(--w-space-2);
  color: var(--w-text);
  font-size: var(--w-text-xl);
}

.athlete-list-empty p {
  margin: 0;
  font-weight: 650;
  line-height: 1.5;
}

.athlete-profile-shell {
  width: min(var(--w-public-content), calc(100% - 2rem));
  margin: calc(-1 * var(--w-space-5)) auto 0;
  padding-bottom: 72px;
}

.athlete-profile-hero {
  padding: 0 0 40px;
}

.athlete-profile-head {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--w-space-5);
  padding: 42px max(1rem, calc((100vw - var(--w-public-content)) / 2));
  border-bottom: 1px solid rgba(219, 227, 236, 0.78);
  background: linear-gradient(180deg, #fbfcfe 0%, var(--w-bg) 100%);
  color: var(--w-text);
}

.athlete-profile-person {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--w-space-5);
}

.athlete-profile-avatar {
  width: 96px;
  height: 96px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--w-primary-soft);
  color: var(--w-primary);
  font-size: var(--w-text-2xl);
  font-weight: 850;
}

.athlete-profile-main {
  flex: 1 1 auto;
  min-width: 0;
}

.athlete-profile-back {
  display: inline-flex;
  margin-bottom: var(--w-space-4);
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
  font-weight: 750;
  text-decoration: none;
}

.athlete-profile-back:hover {
  color: var(--w-primary-hover);
}

.athlete-profile-main h1 {
  margin: 0;
  color: var(--w-text);
  font-size: clamp(1.75rem, 2.6vw, 2.5rem);
  font-weight: 780;
  letter-spacing: 0;
  line-height: 1.05;
}

.athlete-profile-meta,
.athlete-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  color: var(--w-text-muted);
}

.athlete-profile-meta {
  margin-top: var(--w-space-3);
  font-size: var(--w-text-md);
  font-weight: 650;
}

.athlete-profile-sports {
  display: flex;
  flex-wrap: wrap;
  gap: var(--w-space-2);
  margin-top: var(--w-space-3);
}

.athlete-profile-sports .sport-chip {
  border-color: rgba(184, 195, 207, 0.72);
  background: rgba(255, 255, 255, 0.78);
  color: var(--w-text-muted);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.athlete-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--w-space-4);
  margin-top: var(--w-space-5);
}

.athlete-metric-card,
.athlete-analytics-card,
.athlete-filter-panel,
.athlete-results-panel,
.athlete-side-block {
  border: 1px solid rgba(219, 227, 236, 0.9);
  border-radius: var(--w-radius-lg);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.04);
}

[data-theme="dark"] .athlete-metric-card,
[data-theme="dark"] .athlete-analytics-card,
[data-theme="dark"] .athlete-filter-panel,
[data-theme="dark"] .athlete-results-panel,
[data-theme="dark"] .athlete-side-block {
  border-color: var(--w-border);
  background: var(--w-surface);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
}

.athlete-metric-card {
  min-height: 112px;
  padding: var(--w-space-4) var(--w-space-5);
}

.athlete-metric-card span,
.athlete-section-head span,
.athlete-side-block h2,
.athlete-analytics-card h2 {
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.athlete-metric-card strong {
  display: block;
  margin-top: var(--w-space-3);
  color: var(--w-text);
  font-size: var(--w-text-3xl);
  line-height: 1;
}

.athlete-metric-card small {
  display: block;
  margin-top: var(--w-space-2);
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
  font-weight: 650;
}

.athlete-tabs {
  width: max-content;
  max-width: 100%;
  display: inline-flex;
  gap: 4px;
  margin-top: var(--w-space-5);
  border: 1px solid rgba(219, 227, 236, 0.86);
  border-radius: var(--w-radius-pill);
  background: rgba(241, 244, 248, 0.78);
  padding: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.athlete-tab {
  min-height: 42px;
  border: 0;
  border-radius: var(--w-radius-pill);
  background: transparent;
  color: var(--w-text-muted);
  padding: 0 18px;
  font: inherit;
  font-size: var(--w-text-sm);
  font-weight: 780;
  cursor: pointer;
  transition: background-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.athlete-tab.is-active {
  color: var(--w-text);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.athlete-tab:hover {
  color: var(--w-primary-hover);
}

.athlete-tab-panel {
  padding-top: var(--w-space-5);
}

/* Тёмная тема: шапка профиля, чип вида спорта, кнопка «Поделиться» и переключатель
   вкладок имели захардкоженный светлый фон — даём тёмные поверхности. */
[data-theme="dark"] .athlete-profile-head {
  border-bottom-color: var(--w-border);
  background: linear-gradient(180deg, var(--w-surface) 0%, var(--w-bg) 100%);
}

[data-theme="dark"] .athlete-profile-sports .sport-chip {
  border-color: var(--w-border);
  background: var(--w-surface-subtle);
  box-shadow: none;
}

[data-theme="dark"] .athlete-tabs {
  border-color: var(--w-border);
  background: var(--w-surface);
  box-shadow: none;
}

[data-theme="dark"] .athlete-tab.is-active {
  background: var(--w-surface-subtle);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.athlete-filter-panel {
  padding: var(--w-space-4);
  margin-bottom: var(--w-space-5);
}

.athlete-filter-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(120px, 0.8fr) minmax(120px, 0.8fr) auto;
  gap: var(--w-space-3);
  align-items: end;
}

.athlete-filter-form label {
  display: grid;
  gap: var(--w-space-1);
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
  font-weight: 750;
}

.athlete-quick-ranges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--w-space-2);
  margin-top: var(--w-space-3);
}

.athlete-quick-range {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-pill);
  padding: 0 13px;
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
  font-weight: 750;
  text-decoration: none;
}

.athlete-quick-range.is-active,
.athlete-quick-range:hover {
  border-color: rgba(249, 115, 22, 0.35);
  background: var(--w-primary-soft);
  color: var(--w-primary-hover);
}

.athlete-profile-layout {
  display: block;
}

.athlete-results-panel,
.athlete-side-block,
.athlete-analytics-card {
  padding: var(--w-space-5);
  min-width: 0;
}

.athlete-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--w-space-3);
  margin-bottom: var(--w-space-4);
}

.athlete-section-head h2,
.athlete-side-block h2,
.athlete-analytics-card h2 {
  margin: 0;
}


.athlete-results-list {
  display: grid;
}

/* Заголовок года — группирует финиши. Прижат к своей группе снизу, оторван
   от предыдущей сверху, чтобы читался как заголовок, а не как ещё одна строка. */
.athlete-result-year {
  position: sticky;
  /* Липнет под sticky-шапкой сайта (.wave-nav min-height: 64px), а не под неё. */
  top: 64px;
  z-index: 2;
  display: flex;
  align-items: baseline;
  gap: var(--w-space-3);
  padding: var(--w-space-5) 0 var(--w-space-1);
  background: var(--w-surface);
}

.athlete-results-list > .athlete-result-year:first-child {
  padding-top: var(--w-space-2);
}

.athlete-result-year__num {
  color: var(--w-text-muted);
  font-size: var(--w-text-md);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.athlete-result-year__line {
  flex: 1;
  align-self: center;
  height: 1px;
  background: var(--w-border);
}

/* Первая строка после года — без верхнего бордюра и плотнее к заголовку. */
.athlete-result-year + .athlete-result-item {
  border-top: none;
  padding-top: var(--w-space-3);
}

.athlete-result-item {
  position: relative;
  display: grid;
  grid-template-columns: 48px auto minmax(0, 1fr) auto;
  column-gap: var(--w-space-3);
  row-gap: 0;
  border-top: 1px solid var(--w-border);
  padding: var(--w-space-5) 48px var(--w-space-5) 0;
  transition: background-color 160ms ease, opacity 160ms ease;
}

/* Десктоп: дата | иконка | (название / мета) | результат. Название и мета —
   два ряда одной колонки; дата, иконка и время центрируются по обоим. */
.athlete-result-date {
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: center;
}

.athlete-result-kind {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
}

.athlete-result-main {
  grid-column: 3;
  grid-row: 1;
  align-self: end;
}

.athlete-result-meta {
  grid-column: 3;
  grid-row: 2;
  align-self: start;
}

.athlete-result-score {
  grid-column: 4;
  grid-row: 1 / 3;
  align-self: center;
}

.athlete-result-item.has-details {
  cursor: pointer;
}

/* Подсветка строки — «плавающая» пилюля: с воздухом по бокам (не впритык к
   тексту) и по вертикали (не касается разделителей), со скруглением. */
.athlete-result-item::after {
  content: "";
  position: absolute;
  inset: 6px calc(-1 * var(--w-space-3));
  z-index: 0;
  border-radius: var(--w-radius-lg);
  background: transparent;
  transition: background-color 160ms ease;
  pointer-events: none;
}

.athlete-result-item > * {
  position: relative;
  z-index: 1;
}

/* В раскрытом виде подсветка не нужна — иначе она тянется на всю высоту строки
   (вместе с панелью деталей) и «подтекает» оранжевым из-под подложки. */
.athlete-result-item.is-open::after {
  display: none;
}

/* Лёгкий нейтральный отклик на любую строку — список ощущается цельным.
   Порядок правил важен: кликабельные (.has-details) идут последними, чтобы их
   оранжевая подсветка перебивала нейтральную/незавершённую при равной
   специфичности. */
.athlete-result-item:hover::after {
  background: rgba(15, 23, 42, 0.035);
}

[data-theme="dark"] .athlete-result-item:hover::after {
  background: rgba(255, 255, 255, 0.04);
}

.athlete-result-item.has-details:hover::after {
  background: rgba(255, 237, 213, 0.6);
}

[data-theme="dark"] .athlete-result-item.has-details:hover::after {
  background: rgba(251, 146, 60, 0.12);
}

.athlete-result-item.is-unfinished .athlete-result-title,
.athlete-result-item.is-unfinished .athlete-result-date,
.athlete-result-item.is-unfinished .athlete-result-meta,
.athlete-result-item.is-unfinished .athlete-result-score,
.athlete-result-item.is-unfinished .athlete-result-kind {
  opacity: 0.68;
}

.athlete-result-date {
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
  font-weight: 750;
  line-height: 1.12;
  white-space: nowrap;
}

.athlete-result-title {
  color: var(--w-text);
  font-size: var(--w-text-lg);
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
}

.athlete-result-title:hover {
  color: var(--w-primary-hover);
}

.athlete-result-meta {
  margin-top: var(--w-space-1);
  font-size: var(--w-text-sm);
  font-weight: 650;
}

.athlete-result-meta span + span::before {
  content: "·";
  margin-right: 0.35rem;
  color: var(--w-text-soft);
}

.athlete-result-titlerow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--w-space-2);
}

.athlete-result-score {
  justify-self: end;
  text-align: right;
}

.athlete-result-score strong {
  display: block;
  color: var(--w-text);
  font-family: var(--w-font-mono);
  font-size: var(--w-text-xl);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.athlete-result-score span {
  display: block;
  margin-top: 2px;
  color: var(--w-text-muted);
  font-family: var(--w-font-mono);
  font-size: var(--w-text-sm);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Единица темпа (/км, /100 м) после значения — мельче и светлее самого числа. */
.athlete-result-pace em {
  margin-left: 4px;
  color: var(--w-text-soft);
  font-size: var(--w-text-xs);
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Бейдж силы результата относительно поля («Быстрее N%») — пилюля без «·». */
.athlete-result-percent::before {
  content: none !important;
}

.athlete-result-percent {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.5rem;
  border-radius: var(--w-radius-pill, 999px);
  font-size: var(--w-text-xs);
  font-weight: 800;
  background: #f1f5f9;
  color: #475569;
}

.athlete-result-percent.is-mid {
  background: #e0f2fe;
  color: #0369a1;
}

.athlete-result-percent.is-strong {
  background: #d1fae5;
  color: #047857;
}

.athlete-result-percent.is-elite {
  background: #fef3c7;
  color: #b45309;
}

[data-theme="dark"] .athlete-result-percent {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
}

[data-theme="dark"] .athlete-result-percent.is-mid {
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
}

[data-theme="dark"] .athlete-result-percent.is-strong {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
}

[data-theme="dark"] .athlete-result-percent.is-elite {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

/* Медаль за призовое место — золото/серебро/бронза. */
.athlete-result-medal {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.5rem;
  border-radius: var(--w-radius-pill, 999px);
  font-size: var(--w-text-xs);
  font-weight: 850;
  white-space: nowrap;
}

.athlete-result-medal--1 {
  background: #fef3c7;
  color: #92400e;
}

.athlete-result-medal--2 {
  background: #e2e8f0;
  color: #475569;
}

.athlete-result-medal--3 {
  background: #fde4cf;
  color: #9a3412;
}

[data-theme="dark"] .athlete-result-medal--1 {
  background: rgba(245, 158, 11, 0.22);
  color: #fcd34d;
}

[data-theme="dark"] .athlete-result-medal--2 {
  background: rgba(148, 163, 184, 0.22);
  color: #cbd5e1;
}

[data-theme="dark"] .athlete-result-medal--3 {
  background: rgba(217, 119, 6, 0.22);
  color: #fdba74;
}

.athlete-result-kind {
  position: relative;
  display: inline-flex;
  flex: none;
}

.athlete-result-kind .sport-chip {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  justify-content: center;
  background: rgba(255, 255, 255, 0.72);
}

.athlete-relay-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(249, 115, 22, 0.28);
  border-radius: 50%;
  background: var(--w-primary-soft);
  color: var(--w-primary-hover);
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1;
}

.athlete-details-indicator {
  position: absolute;
  top: var(--w-space-5);
  right: 4px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(219, 227, 236, 0.95);
  background: rgba(255, 255, 255, 0.88);
  color: var(--w-text-muted);
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.athlete-details-indicator svg {
  width: 12px;
  height: 12px;
  transition: transform 180ms ease;
}

.athlete-result-item.has-details:hover .athlete-details-indicator {
  border-color: rgba(249, 115, 22, 0.36);
  background: var(--w-primary-soft);
  color: var(--w-primary-hover);
}

.athlete-result-item.has-details.is-open .athlete-details-indicator svg {
  transform: rotate(180deg);
}

/* Тёмная тема: кружок иконки вида спорта, стрелка-каретка и бейдж мест имели
   светлый фон — переводим на тёмные поверхности. */
[data-theme="dark"] .athlete-result-kind .sport-chip {
  background: var(--w-surface-subtle);
}

[data-theme="dark"] .athlete-details-indicator {
  border-color: var(--w-border);
  background: var(--w-surface-subtle);
}

[data-theme="dark"] .athlete-result-item.has-details:hover .athlete-details-indicator {
  border-color: rgba(251, 146, 60, 0.4);
  background: var(--w-primary-soft);
}

.athlete-details-panel {
  display: none;
  /* На всю ширину строки: от левого края до правого, гася правый паддинг,
     зарезервированный под шеврон (шеврон теперь закреплён сверху). */
  grid-column: 1 / -1;
  grid-row: 3;
  margin-right: -48px;
  min-width: 0;
  border-radius: var(--w-radius-lg);
  background: var(--w-surface-subtle);
  padding: var(--w-space-4);
}

/* min-width:0 нужен, чтобы грид/флекс-предки могли сжаться, и тогда у кругов
   и таблицы сплитов срабатывал свой overflow-x: auto (а не распирал страницу). */
.athlete-details-section {
  min-width: 0;
}

.athlete-details-panel.is-open {
  display: grid;
  gap: var(--w-space-5);
}

.athlete-details-section__title {
  margin: 0 0 var(--w-space-3);
  color: var(--w-text-soft);
  font-size: var(--w-text-xs);
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Заголовок секции уже задаёт отступ — убираем собственные верхние поля блоков. */
.athlete-details-section .athlete-relative-gauges,
.athlete-details-section .athlete-splits-table {
  margin-top: 0;
}

.athlete-details-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--w-space-3);
  color: var(--w-text);
  font-size: var(--w-text-sm);
}

.athlete-detail-team {
  border: 1px solid rgba(219, 227, 236, 0.82);
  border-radius: var(--w-radius-lg);
  background: rgba(255, 255, 255, 0.62);
  padding: 0.72rem 0.8rem;
}

[data-theme="dark"] .athlete-detail-team {
  border-color: var(--w-border);
  background: var(--w-surface);
}

.athlete-detail-team span {
  margin: 0;
  color: var(--w-text-soft);
  font-size: var(--w-text-xs);
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
}

.athlete-detail-team strong {
  margin: 0;
  color: var(--w-text);
  font-size: var(--w-text-md);
  font-weight: 820;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.athlete-detail-team {
  display: grid;
  gap: 0.28rem;
}

.athlete-detail-team strong {
  overflow-wrap: anywhere;
}

.athlete-splits-table {
  overflow-x: auto;
  margin-top: var(--w-space-3);
}

.athlete-splits-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--w-text-sm);
}

.athlete-splits-table th,
.athlete-splits-table td {
  border-bottom: 1px solid var(--w-border);
  padding: 0.45rem 0.5rem;
  text-align: left;
  white-space: nowrap;
}

.athlete-side-panel {
  display: grid;
  gap: var(--w-space-4);
}

.athlete-activity-summary {
  display: flex;
  align-items: baseline;
  gap: var(--w-space-3);
  margin-top: var(--w-space-5);
}

.athlete-activity-summary strong {
  color: var(--w-text);
  font-size: 3rem;
  line-height: 0.9;
}

.athlete-activity-summary span,
.athlete-side-block p {
  color: var(--w-text-muted);
  font-weight: 650;
}

.athlete-month-strip {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 6px;
  margin-top: var(--w-space-5);
}

.athlete-month-dot {
  height: 16px;
  border-radius: var(--w-radius-sm);
}

.level-0 {
  background: var(--w-surface-subtle);
}

.level-1 {
  background: var(--w-primary-soft);
}

.level-2 {
  background: #fed7aa;
}

.level-3 {
  background: var(--w-primary);
}

/* Тёмная тема: --w-primary-soft даёт тёмно-коричневый level-1 и ломает шкалу.
   Делаем плавный амбер→оранжевый рамп (монотонно по светлоте, без «грязи»). */
[data-theme="dark"] .level-1 {
  background: #b3713a;
}

[data-theme="dark"] .level-2 {
  background: #dd8b3e;
}

.athlete-best-list,
.athlete-relative-list {
  display: grid;
  gap: var(--w-space-3);
  margin-top: var(--w-space-5);
}

.athlete-record-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--w-space-3);
  margin-top: var(--w-space-5);
}

/* Свернуть длинные списки: веб — 5 рекордов / 2 старта, мобайл — 2 / 1.
   Развёрнутое состояние (.is-expanded) показывает всё. */
.athlete-record-grid:not(.is-expanded) > .athlete-record-card:nth-child(n + 6),
.athlete-relative-list:not(.is-expanded) > .athlete-relative-item:nth-child(n + 3) {
  display: none;
}

.athlete-show-more {
  display: inline-flex;
  align-items: center;
  gap: var(--w-space-2);
  margin-top: var(--w-space-4);
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-pill);
  background: transparent;
  color: var(--w-text-muted);
  font: inherit;
  font-size: var(--w-text-sm);
  font-weight: 750;
  cursor: pointer;
}

.athlete-show-more:hover {
  color: var(--w-text);
  border-color: var(--w-border-strong);
}

.athlete-show-more svg {
  width: 16px;
  height: 16px;
  transition: transform 160ms ease;
}

.athlete-record-grid.is-expanded ~ .athlete-show-more svg,
.athlete-relative-list.is-expanded ~ .athlete-show-more svg {
  transform: rotate(180deg);
}

@media (max-width: 720px) {
  .athlete-record-grid:not(.is-expanded) > .athlete-record-card:nth-child(n + 3),
  .athlete-relative-list:not(.is-expanded) > .athlete-relative-item:nth-child(n + 2) {
    display: none;
  }
}

@media (min-width: 721px) {
  .athlete-show-more.only-mobile {
    display: none;
  }
}

.athlete-record-card {
  --accent: var(--sport-default);
  display: block;
  border-radius: var(--w-radius-lg);
  background: var(--w-surface-subtle);
  padding: var(--w-space-4);
  box-shadow: inset 3px 0 0 0 var(--accent);
  color: inherit;
  text-decoration: none;
  transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.athlete-record-card:hover {
  background: var(--w-surface);
  box-shadow: inset 3px 0 0 0 var(--accent), 0 10px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.athlete-record-card.sport-accent-running {
  --accent: var(--sport-running);
}

.athlete-record-card.sport-accent-swim-ow,
.athlete-record-card.sport-accent-swim-pool {
  --accent: var(--sport-swim-ow);
}

.athlete-record-card.sport-accent-cycling {
  --accent: var(--sport-cycling);
}

.athlete-record-card.sport-accent-triathlon {
  --accent: var(--sport-triathlon);
}

.athlete-record-card__sport {
  display: flex;
  align-items: center;
  gap: var(--w-space-2);
  color: var(--w-text-muted);
  font-size: var(--w-text-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.athlete-record-card__dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: var(--w-radius-pill);
  background: var(--accent);
}

.athlete-record-card__dist {
  margin: var(--w-space-2) 0;
  font-weight: 850;
}

.athlete-record-card__time {
  font-size: var(--w-text-2xl);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--accent);
}

.athlete-record-card__meta {
  margin-top: var(--w-space-2);
  color: var(--w-text-soft);
  font-size: var(--w-text-xs);
  font-weight: 700;
}

.athlete-best-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: var(--w-space-3);
  align-items: center;
  border-radius: var(--w-radius-lg);
  background: var(--w-surface-subtle);
  color: inherit;
  padding: var(--w-space-3);
  text-decoration: none;
  transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.athlete-best-item:hover {
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.athlete-best-item strong,
.athlete-best-item small {
  display: block;
}

.athlete-best-item strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--w-text);
  font-size: var(--w-text-md);
  line-height: 1.16;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.athlete-best-item small {
  margin-top: 2px;
  color: var(--w-text-muted);
  font-weight: 650;
}

.athlete-best-item b {
  color: var(--w-primary-hover);
  font-size: var(--w-text-lg);
}

.athlete-analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--w-space-5);
}

.athlete-analytics-card--wide {
  grid-column: 1 / -1;
}

.athlete-analytics-group > .athlete-section-head {
  margin-bottom: var(--w-space-6);
  padding-bottom: var(--w-space-4);
  border-bottom: 1px solid var(--w-border-strong);
}

.athlete-analytics-total {
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
  font-weight: 650;
}

.athlete-analytics-total b {
  color: var(--w-text);
  font-variant-numeric: tabular-nums;
}

.athlete-analytics-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--w-space-6) var(--w-space-8);
}

/* Если остался один виджет (нет «Любимых дистанций») — пончик на всю ширину.
   Модификатор ставит шаблон, чтобы не зависеть от :has() (нет в старых браузерах). */
.athlete-analytics-pair--single {
  grid-template-columns: minmax(0, 1fr);
}

.athlete-widget-divider {
  height: 1px;
  background: var(--w-border);
  margin: var(--w-space-6) 0;
}

.athlete-analytics-widget {
  min-width: 0;
}

.athlete-analytics-widget h3 {
  margin: 0;
  color: var(--w-text);
  font-size: var(--w-text-xs);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.athlete-widget-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--w-space-3);
  margin-bottom: var(--w-space-4);
}

.athlete-widget-hint {
  color: var(--w-text-muted);
  font-size: var(--w-text-xs);
  font-weight: 650;
}

/* --- старты по годам: вертикальные столбцы --- */
.athlete-year-bars {
  display: flex;
  align-items: flex-end;
  justify-content: safe center;
  gap: var(--w-space-3);
  height: 184px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.athlete-year-bar {
  flex: 1 1 0;
  min-width: 30px;
  max-width: 64px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: var(--w-space-2);
}

.athlete-year-bar__val {
  font-size: var(--w-text-sm);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.athlete-year-bar__track {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
}

.athlete-year-bar__track i {
  display: block;
  width: 100%;
  min-height: 6px;
  border-radius: 7px 7px 4px 4px;
  background: linear-gradient(180deg, var(--w-primary) 0%, #fdba74 100%);
  transition: filter 0.15s ease;
}

.athlete-year-bar.is-peak .athlete-year-bar__track i {
  background: linear-gradient(180deg, var(--w-primary-hover) 0%, var(--w-primary) 100%);
}

.athlete-year-bar:hover .athlete-year-bar__track i {
  filter: brightness(1.05) saturate(1.08);
}

.athlete-year-bar__year {
  color: var(--w-text-muted);
  font-size: var(--w-text-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.athlete-year-bars.is-dense {
  gap: var(--w-space-1);
}

.athlete-year-bars.is-dense .athlete-year-bar__val {
  font-size: var(--w-text-xs);
}

.athlete-year-bars.is-dense .athlete-year-bar__year {
  font-size: 0.66rem;
}

/* --- виды спорта: donut --- */
.athlete-donut-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--w-space-5) var(--w-space-6);
}

.athlete-donut {
  position: relative;
  flex: 0 0 auto;
}

.athlete-donut__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.athlete-donut__center b {
  font-size: var(--w-text-2xl);
  font-weight: 850;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.athlete-donut__center span {
  margin-top: 2px;
  color: var(--w-text-muted);
  font-size: var(--w-text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.athlete-donut-legend {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--w-space-3);
}

.athlete-donut-legend__row {
  display: flex;
  align-items: baseline;
  gap: var(--w-space-3);
  font-size: var(--w-text-sm);
}

.athlete-donut-legend__dot {
  flex: 0 0 auto;
  align-self: center;
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.athlete-donut-legend__name {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.athlete-donut-legend__leader {
  flex: 1 1 auto;
  align-self: baseline;
  min-width: 16px;
  margin: 0 var(--w-space-1);
  border-bottom: 2px dotted var(--w-border-strong);
}

.athlete-donut-legend__num {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.athlete-donut-legend__pct {
  width: 42px;
  text-align: right;
  color: var(--w-text-muted);
  font-size: var(--w-text-xs);
  font-weight: 650;
}

/* --- календарь активности: тепловая карта --- */
.athlete-heatmap {
  display: grid;
  grid-template-columns: 44px repeat(12, 1fr);
  gap: 6px;
  align-items: center;
}

.athlete-heatmap__mh {
  text-align: center;
  color: var(--w-text-muted);
  font-size: 0.66rem;
  font-weight: 700;
}

.athlete-heatmap__yl {
  color: var(--w-text-muted);
  font-size: var(--w-text-xs);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.athlete-heatmap__cell {
  height: 26px;
  border-radius: 6px;
}

.athlete-heatmap.is-dense .athlete-heatmap__cell {
  height: 18px;
}

.athlete-heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--w-space-2);
  margin-top: var(--w-space-4);
  color: var(--w-text-muted);
  font-size: var(--w-text-xs);
  font-weight: 650;
}

.athlete-heatmap-legend i {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.athlete-progress-select {
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-md);
  background: var(--w-surface);
  color: var(--w-text);
  padding: 0.4rem 0.6rem;
  font-weight: 700;
  font-size: var(--w-text-sm);
}

.athlete-progress-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--w-space-6);
  margin-top: var(--w-space-5);
}

.athlete-progress-panel {
  display: flex;
  flex-direction: column;
  gap: var(--w-space-3);
}

.athlete-progress-panel__title {
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.athlete-progress-panel__title em {
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
  color: var(--w-text-soft);
}

.athlete-progress-canvas {
  position: relative;
  min-height: 240px;
  max-height: 300px;
}

.athlete-progress-canvas canvas {
  display: block;
  max-width: 100%;
}

@media (max-width: 720px) {
  .athlete-progress-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.athlete-relative-item {
  display: grid;
  gap: var(--w-space-2);
  padding: var(--w-space-3) 0;
  border-top: 1px solid var(--w-border);
}

.athlete-relative-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.athlete-relative-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--w-space-3);
  flex-wrap: wrap;
}

.athlete-relative-head strong {
  color: var(--w-text);
}

.athlete-relative-head small {
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
  font-weight: 650;
}

.athlete-relative-head small b {
  color: var(--w-text);
  font-weight: 700;
}

/* Дуги-спидометры: на старт по три дуги (категория / абсолют / общий зачёт). */
.athlete-relative-gauges {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--w-space-2);
  margin-top: var(--w-space-3);
}

.athlete-gauge {
  position: relative;
  text-align: center;
  max-width: 160px;
  margin: 0 auto;
}

.athlete-gauge__svg {
  position: relative;
}

.athlete-gauge__svg svg {
  display: block;
  width: 100%;
  height: auto;
}

.athlete-gauge__band {
  fill: none;
  stroke-width: 12;
}

.athlete-gauge__band--low {
  stroke: var(--w-tier-low-band);
}

.athlete-gauge__band--mid {
  stroke: var(--w-tier-mid-band);
}

.athlete-gauge__band--strong {
  stroke: var(--w-tier-strong-band);
}

.athlete-gauge__band--elite {
  stroke: var(--w-tier-elite-band);
}

.athlete-gauge__marker {
  fill: var(--w-surface);
  stroke: var(--w-tier-low);
  stroke-width: 4;
}

.athlete-gauge.is-mid .athlete-gauge__marker {
  stroke: var(--w-tier-mid);
}

.athlete-gauge.is-strong .athlete-gauge__marker {
  stroke: var(--w-tier-strong);
}

.athlete-gauge.is-elite .athlete-gauge__marker {
  stroke: var(--w-tier-elite);
}

.athlete-gauge__center {
  position: absolute;
  left: 0;
  right: 0;
  top: 46%;
  transform: translateY(-50%);
}

.athlete-gauge__lbl {
  display: block;
  font-size: 9px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--w-text-soft);
}

.athlete-gauge__num {
  display: block;
  font-size: 27px;
  font-weight: 800;
  line-height: 1.05;
  color: var(--w-text);
}

.athlete-gauge__tier {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--w-tier-low);
}

.athlete-gauge.is-mid .athlete-gauge__tier {
  color: var(--w-tier-mid);
}

.athlete-gauge.is-strong .athlete-gauge__tier {
  color: var(--w-tier-strong);
}

.athlete-gauge.is-elite .athlete-gauge__tier {
  color: var(--w-tier-elite);
}

.athlete-gauge__cap {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.25;
  color: var(--w-text-muted);
}

.athlete-gauge__cap b {
  display: block;
  color: var(--w-text);
  font-size: 12px;
  font-weight: 700;
}

.athlete-gauge__cap span {
  display: block;
}

/* География стартов — города из адресов, чипом с числом стартов. */
.athlete-geo-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--w-space-2);
  margin-top: var(--w-space-3);
}

.athlete-geo-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--w-space-2);
  padding: var(--w-space-2) var(--w-space-3);
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-pill);
  background: var(--w-surface-subtle);
  color: var(--w-text);
  font-size: var(--w-text-sm);
  font-weight: 600;
}

.athlete-geo-chip b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--w-radius-pill);
  background: var(--w-surface);
  color: var(--w-text-muted);
  font-size: var(--w-text-xs);
  font-weight: 700;
}

/* Командные / эстафетные старты — отдельный блок, по строке на сегмент атлета. */
.athlete-relay-list {
  display: grid;
  gap: var(--w-space-2);
  margin-top: var(--w-space-3);
}

.athlete-relay-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--w-space-3);
  padding: var(--w-space-3) var(--w-space-4);
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-lg);
  background: var(--w-surface);
  color: var(--w-text);
  text-decoration: none;
}

.athlete-relay-item:hover {
  border-color: var(--w-border-strong);
}

.athlete-relay-info {
  min-width: 0;
}

.athlete-relay-info strong {
  display: block;
  color: var(--w-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.athlete-relay-info small {
  display: block;
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
}

.athlete-relay-seg {
  text-align: right;
  white-space: nowrap;
}

.athlete-relay-seg__name {
  display: block;
  color: var(--w-text);
  font-size: var(--w-text-sm);
  font-weight: 700;
}

.athlete-relay-seg__metrics {
  display: flex;
  justify-content: flex-end;
  gap: var(--w-space-2);
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
}

.athlete-relay-seg__metrics strong {
  color: var(--w-text);
}

.athlete-relative-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--w-space-3);
  margin-top: var(--w-space-2);
}

.athlete-relative-legend span {
  display: inline-flex;
  align-items: center;
  gap: var(--w-space-1);
  color: var(--w-text-muted);
  font-size: var(--w-text-xs);
  font-weight: 650;
}

.athlete-relative-legend span::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: var(--w-radius-pill);
  background: var(--w-tier-low);
}

.athlete-relative-legend .is-elite::before {
  background: var(--w-tier-elite);
}

.athlete-relative-legend .is-strong::before {
  background: var(--w-tier-strong);
}

.athlete-relative-legend .is-mid::before {
  background: var(--w-tier-mid);
}

.athlete-relative-legend .is-low::before {
  background: var(--w-tier-low);
}

.athlete-podium {
  display: grid;
  gap: var(--w-space-2);
  margin-top: var(--w-space-4);
}

.athlete-podium__item {
  --accent: var(--sport-default);
  display: grid;
  grid-template-columns: 26px auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--w-space-3);
  padding: var(--w-space-3) var(--w-space-4);
  border-radius: var(--w-radius-lg);
  background: var(--w-surface-subtle);
  color: var(--w-text);
  font-weight: 750;
}

.athlete-podium__item.sport-accent-running {
  --accent: var(--sport-running);
}

.athlete-podium__item.sport-accent-swim-ow,
.athlete-podium__item.sport-accent-swim-pool {
  --accent: var(--sport-swim-ow);
}

.athlete-podium__item.sport-accent-cycling {
  --accent: var(--sport-cycling);
}

.athlete-podium__item.sport-accent-triathlon {
  --accent: var(--sport-triathlon);
}

.athlete-podium__item.is-lead {
  padding: var(--w-space-4);
  background: color-mix(in srgb, var(--accent) 9%, var(--w-surface));
  box-shadow: inset 3px 0 0 0 var(--accent);
}

.athlete-podium__rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--w-radius-pill);
  border: 1px solid var(--w-border);
  background: var(--w-surface);
  color: var(--w-text-soft);
  font-size: var(--w-text-sm);
  font-variant-numeric: tabular-nums;
}

.athlete-podium__item.is-lead .athlete-podium__rank {
  width: 30px;
  height: 30px;
  border-color: transparent;
  background: var(--accent);
  color: #fff;
  font-size: var(--w-text-md);
}

.athlete-podium__dot {
  width: 9px;
  height: 9px;
  border-radius: var(--w-radius-pill);
  background: var(--accent);
}

.athlete-podium__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.athlete-podium__count {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  color: var(--w-text);
  font-variant-numeric: tabular-nums;
}

.athlete-podium__count b {
  font-size: var(--w-text-lg);
}

.athlete-podium__item.is-lead .athlete-podium__count b {
  font-size: var(--w-text-2xl);
  color: var(--accent);
}

.athlete-podium__count small {
  color: var(--w-text-soft);
  font-weight: 700;
  font-size: var(--w-text-sm);
}

.competitions-index-page {
  width: min(var(--w-public-content), 100% - 2rem);
  margin: 0 auto;
  padding: 32px 0 72px;
}

.competitions-index-hero {
  padding-bottom: var(--w-space-6);
}

.competitions-index-kicker {
  margin-bottom: var(--w-space-3);
  color: var(--w-primary-hover);
  font-size: var(--w-text-sm);
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.competitions-index-title {
  max-width: 820px;
  margin: 0;
  color: var(--w-text);
  font-size: clamp(2.5rem, 6vw, 4.75rem);
  font-weight: 780;
  letter-spacing: 0;
  line-height: 1.02;
}

.competitions-index-subtitle {
  max-width: 720px;
  margin: var(--w-space-4) 0 0;
  color: var(--w-text-muted);
  font-size: var(--w-text-lg);
  font-weight: 650;
  line-height: 1.55;
}

.competitions-filter-toggle {
  display: none;
}

.competitions-filter-form {
  display: grid;
  grid-template-columns: minmax(260px, 1.35fr) minmax(170px, 0.75fr) minmax(220px, 1fr) auto;
  align-items: end;
  gap: var(--w-space-3);
  margin-top: var(--w-space-6);
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-lg);
  background: var(--w-surface);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.06);
  padding: var(--w-space-4);
}

.competitions-filter-field {
  display: grid;
  gap: var(--w-space-2);
  min-width: 0;
  margin: 0;
}

.competitions-filter-field span {
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
  font-weight: 800;
}

.competitions-filter-submit {
  min-width: 112px;
}

.competitions-index-results {
  margin-top: var(--w-space-5);
}

.competitions-index-results__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--w-space-3);
  margin-bottom: var(--w-space-3);
}

.competitions-index-results__head h2 {
  margin: 0;
  color: var(--w-text);
  font-size: var(--w-text-2xl);
  font-weight: 780;
  letter-spacing: 0;
}

.competitions-index-results__head span {
  color: var(--w-text-soft);
  font-size: var(--w-text-sm);
  font-weight: 850;
}

.competition-list-grid {
  display: grid;
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-lg);
  background: var(--w-surface);
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.competition-list-card {
  border-bottom: 1px solid var(--w-border);
}

.competition-list-card:last-child {
  border-bottom: 0;
}

.competition-list-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) auto 28px;
  align-items: center;
  gap: var(--w-space-5);
  min-height: 118px;
  padding: var(--w-space-4) var(--w-space-5);
  color: var(--w-text);
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.competition-list-row:hover {
  background: rgba(255, 237, 213, 0.48);
  color: var(--w-text);
}

[data-theme="dark"] .competition-list-row:hover {
  background: rgba(251, 146, 60, 0.1);
}

.competition-list-date {
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
  font-weight: 750;
  line-height: 1.35;
  white-space: nowrap;
}

.competition-list-main {
  min-width: 0;
  padding: var(--w-space-3) 0;
}

.competition-title {
  display: block;
  overflow: hidden;
  color: var(--w-text);
  font-size: var(--w-text-lg);
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.competition-location {
  display: block;
  overflow: hidden;
  margin-top: 0.35rem;
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.competition-stage-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--w-space-3);
}

.competition-stage-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-pill);
  background: var(--w-surface-subtle);
  color: var(--w-text-muted);
  padding: 0 0.55rem;
  font-size: var(--w-text-xs);
  font-weight: 700;
}

.competition-stage-chip--more {
  border-color: var(--w-border);
  background: var(--w-surface-subtle);
  color: var(--w-text-muted);
}

.competition-list-arrow {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--w-text-soft);
}

.competition-list-arrow svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.competition-list-row:hover .competition-list-arrow {
  color: var(--w-primary-hover);
}

.competition-list-empty {
  border: 1px dashed var(--w-border-strong);
  border-radius: var(--w-radius-lg);
  color: var(--w-text-muted);
  padding: var(--w-space-5);
}

.competition-show-page {
  width: min(var(--w-public-content), calc(100% - 2rem));
  margin: calc(-1 * var(--w-space-5)) auto 0;
  padding: 0 0 72px;
}

.competition-profile-hero {
  padding: 0 0 var(--w-space-5);
}

.competition-profile-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  border-bottom: 1px solid rgba(219, 227, 236, 0.78);
  background: linear-gradient(180deg, #fbfcfe 0%, var(--w-bg) 100%);
  color: var(--w-text);
  padding: 36px max(1rem, calc((100vw - var(--w-public-content)) / 2)) 40px;
}

.competition-profile-title-row {
  margin-top: var(--w-space-3);
}

.competition-back-link {
  width: fit-content;
  display: flex;
  align-items: center;
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  transition: color 160ms ease;
}

.competition-back-link:hover {
  color: var(--w-primary-hover);
}

.competition-hero-title {
  margin: 0;
  color: var(--w-text);
  font-size: clamp(1.75rem, 2.6vw, 2.5rem);
  font-weight: 780;
  line-height: 1.04;
  letter-spacing: 0;
}

.competition-profile-head > .competition-kind-chip {
  width: fit-content;
  margin-top: var(--w-space-3);
}

.competition-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--w-space-4);
  margin-top: var(--w-space-4);
}

.competition-hero-meta__item {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: var(--w-space-2);
  color: var(--w-text-muted);
  font-size: var(--w-text-md);
  font-weight: 650;
}

.competition-hero-meta__item svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  color: var(--w-text-muted);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.competition-hero-meta__item a {
  color: var(--w-text);
  text-decoration-color: rgba(194, 65, 12, 0.34);
  text-underline-offset: 3px;
}

.competition-hero-meta__item a:hover {
  color: var(--w-primary-hover);
}

[data-theme="dark"] .competition-profile-head {
  border-bottom-color: var(--w-border);
  background: linear-gradient(180deg, #111827 0%, var(--w-bg) 100%);
}

[data-theme="dark"] .competition-hero-meta__item {
  color: var(--w-text-muted);
}

.competition-section-tabs {
  width: max-content;
  max-width: 100%;
  display: inline-flex;
  gap: 4px;
  margin: var(--w-space-5) 0 var(--w-space-6);
  border: 1px solid rgba(219, 227, 236, 0.86);
  border-radius: var(--w-radius-pill);
  background: rgba(241, 244, 248, 0.78);
  padding: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.competition-section-tab {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--w-radius-pill);
  padding: 0 18px;
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
  font-weight: 780;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.competition-section-tab:hover {
  color: var(--w-text);
}

.competition-section-tab.is-active {
  background: rgba(255, 255, 255, 0.94);
  color: var(--w-text);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] .competition-section-tabs {
  border-color: var(--w-border);
  background: var(--w-surface);
  box-shadow: none;
}

[data-theme="dark"] .competition-section-tab.is-active {
  background: var(--w-surface-subtle);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.competition-content-shell {
  display: block;
}

.competition-content-block {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

[data-theme="dark"] .competition-content-block {
  background: transparent;
}

.competition-content-block__head {
  display: grid;
  gap: var(--w-space-4);
  margin-bottom: var(--w-space-5);
}

.competition-content-title {
  margin: 0;
  color: var(--w-text);
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  font-weight: 780;
  line-height: 1.02;
  letter-spacing: 0;
}

.competition-stage-scroll {
  display: flex;
  gap: var(--w-space-2);
  justify-content: flex-start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  padding: 0 0 0.35rem;
}

.competition-stage-scroll::-webkit-scrollbar {
  height: 6px;
}

.competition-stage-scroll::-webkit-scrollbar-thumb {
  background: rgba(122, 127, 135, 0.35);
  border-radius: 999px;
}

.competition-stage-btn {
  min-height: 38px;
  flex: 0 0 auto;
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-pill);
  background: var(--w-surface);
  color: var(--w-text-muted);
  padding: 0 15px;
  font: inherit;
  font-size: var(--w-text-sm);
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.competition-stage-btn:hover {
  border-color: var(--w-text-muted);
  color: var(--w-text);
}

.competition-stage-btn.is-active {
  border-color: var(--w-text);
  background: var(--w-text);
  color: var(--w-surface);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

.competition-results-filters {
  display: grid;
  grid-template-columns: minmax(150px, 0.75fr) minmax(180px, 1fr) minmax(240px, 1.4fr) auto;
  align-items: end;
  gap: var(--w-space-3);
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-lg);
  background: var(--w-surface);
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.04);
  padding: var(--w-space-4);
  margin-bottom: var(--w-space-5);
}

.competition-results-filters--group {
  grid-template-columns: minmax(180px, 1fr) minmax(240px, 1.7fr) auto;
}

.competition-filter-field {
  display: flex;
  flex-direction: column;
  gap: var(--w-space-2);
  margin: 0;
}

.competition-filter-field span {
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
  font-weight: 800;
}

.competition-filter-field--search {
  min-width: 0;
}

.competition-filter-submit {
  min-width: 116px;
}

.competition-results-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--w-space-2);
}

.competition-results-table {
  display: grid;
  gap: var(--w-space-2);
}

.competition-results-head,
.competition-result-row {
  display: grid;
  grid-template-columns: 76px minmax(220px, 1fr) 92px minmax(132px, 0.75fr) 132px 44px;
  align-items: center;
  gap: var(--w-space-3);
}

.competition-results-head {
  padding: 0 var(--w-space-4) var(--w-space-1);
  color: var(--w-text-soft);
  font-size: var(--w-text-xs);
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.competition-result-card {
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-lg);
  padding: 0;
  background: var(--w-surface);
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.competition-result-card:hover {
  border-color: var(--w-border-strong);
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.06);
}

[data-theme="dark"] .competition-result-card {
  border-color: var(--w-border);
  background: var(--w-surface);
}

.competition-result-row {
  min-height: 78px;
  padding: var(--w-space-3) var(--w-space-4);
}

.competition-result-rank {
  color: var(--w-text);
  font-size: var(--w-text-xl);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.competition-result-person {
  min-width: 0;
}

.competition-result-secondary,
.competition-result-pace,
.competition-result-places {
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
  font-weight: 750;
}

.competition-result-secondary {
  margin-top: 0.18rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.competition-result-value {
  color: var(--w-text);
  font-family: var(--w-font-mono);
  font-size: var(--w-text-xl);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.competition-result-name {
  color: var(--w-text);
  font-size: var(--w-text-md);
  font-weight: 800;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.competition-result-name a {
  color: inherit;
  text-decoration-color: rgba(249, 115, 22, 0.34);
  text-underline-offset: 3px;
}

.competition-result-name a:hover {
  color: var(--w-link);
}

.competition-result-bib {
  color: var(--w-text-muted);
  font-family: var(--w-font-mono);
  font-size: var(--w-text-md);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.competition-result-score {
  display: grid;
  justify-items: start;
  gap: 0.18rem;
}

.competition-result-pace {
  font-family: var(--w-font-mono);
  font-variant-numeric: tabular-nums;
}

.competition-result-places {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  white-space: nowrap;
}

.competition-result-action {
  display: flex;
  justify-content: center;
}

.competition-result-action:empty {
  display: none;
}

.competition-details-toggle {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--w-border);
  border-radius: 50%;
  background: var(--w-surface);
  color: var(--w-text-muted);
  padding: 0;
  font: inherit;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.competition-details-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
  transition: transform 160ms ease;
}

.competition-details-toggle:hover,
.competition-details-toggle[aria-expanded="true"] {
  border-color: rgba(249, 115, 22, 0.34);
  background: var(--w-primary-soft);
  color: var(--w-link);
}

.competition-details-toggle.is-open svg {
  transform: rotate(180deg);
}

.competition-result-details-panel {
  display: none;
  border-top: 1px solid var(--w-border);
  background: var(--w-surface-subtle);
  padding: var(--w-space-4);
}

.competition-result-details-panel.is-open {
  display: block;
}

[data-theme="dark"] .competition-result-details-panel {
  border-color: var(--w-border);
}

.competition-empty-state {
  border: 1px dashed var(--w-border-strong);
  border-radius: var(--w-radius-lg);
  padding: var(--w-space-5);
  text-align: center;
  color: var(--w-text-muted);
}

.competition-list-empty h3 {
  margin: 0 0 var(--w-space-1);
  font-size: var(--w-text-lg);
}

.competition-list-empty p {
  margin: 0;
  color: var(--w-text-muted);
}

.competition-result-raw {
  display: grid;
  gap: var(--w-space-1);
  margin-bottom: var(--w-space-3);
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
  font-weight: 700;
}

.competition-result-raw span {
  font-size: var(--w-text-xs);
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.competition-result-raw b {
  color: var(--w-text);
  font-weight: 750;
  line-height: 1.45;
}

.competition-detail-table-wrap {
  overflow-x: auto;
}

.competition-detail-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--w-text);
  font-size: var(--w-text-sm);
}

.competition-detail-table th,
.competition-detail-table td {
  border-bottom: 1px solid var(--w-border);
  padding: 0.55rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

.competition-detail-table th {
  color: var(--w-text-muted);
  font-weight: 800;
}

.competition-detail-table tr:last-child td {
  border-bottom: 0;
}

.competition-stat-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: stretch;
  gap: var(--w-space-4);
}

.competition-stat-cell {
  grid-column: span 6;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.competition-stat-cell--narrow {
  grid-column: span 4;
}

.competition-stat-cell--wide {
  grid-column: span 8;
}

.competition-stat-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  border: 1px solid var(--w-border);
  border-radius: var(--w-radius-lg);
  background: var(--w-surface);
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.04);
  padding: var(--w-space-4);
}

.competition-stat-card__title {
  margin: 0 0 var(--w-space-3);
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.competition-stat-card__chart {
  position: relative;
  flex: 1 1 auto;
  min-height: 220px;
  max-height: 320px;
}

.competition-stat-card__chart canvas {
  display: block;
  max-width: 100%;
}

.competition-stat-fallback {
  display: flex;
  flex: 1 1 auto;
  min-height: 220px;
  flex-direction: column;
  justify-content: center;
  gap: var(--w-space-3);
}

.competition-stat-fallback__lead {
  margin: 0;
  color: var(--w-text);
  font-size: var(--w-text-xl);
  font-weight: 850;
  letter-spacing: 0;
}

.competition-stat-fallback__text {
  max-width: 34rem;
  margin: 0;
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
  font-weight: 650;
  line-height: 1.5;
}

.competition-stat-summary {
  display: grid;
  gap: var(--w-space-2);
  margin-top: var(--w-space-1);
  padding-top: var(--w-space-2);
  border-top: 1px solid var(--w-border);
}

.competition-stat-summary--metrics {
  gap: var(--w-space-3);
}

.competition-stat-summary__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--w-space-3);
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
  font-weight: 750;
}

.competition-stat-summary__row span {
  display: inline-flex;
  align-items: center;
  gap: var(--w-space-2);
}

.competition-stat-summary__row b {
  color: var(--w-text);
  font-size: var(--w-text-xl);
  font-variant-numeric: tabular-nums;
}

.competition-stat-legend {
  display: grid;
  gap: var(--w-space-2);
  margin-top: var(--w-space-3);
}

.competition-stat-legend__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--w-space-3);
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
  font-weight: 700;
}

.competition-stat-legend__row span {
  display: inline-flex;
  align-items: center;
  gap: var(--w-space-2);
}

.competition-stat-legend__row b {
  color: var(--w-text);
  font-variant-numeric: tabular-nums;
}

.competition-stat-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: var(--w-radius-pill);
}

.competition-stat-dot--female {
  background: var(--w-chart-series-b);
}

.competition-stat-dot--male {
  background: var(--w-chart-series-a);
}

.competition-stat-dot--mixed {
  background: var(--w-chart-series-c);
}

.competition-stat-dot--unknown {
  background: var(--w-chart-series-d);
}

@media (max-width: 768px) {
  #main-content {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .wave-nav {
    min-height: 58px;
  }

  .wave-nav-links {
    display: none;
    margin-left: 0;
  }

  /* Ссылки скрыты на мобиле — переключатель темы прижимаем вправо сам. */
  .wave-theme-toggle {
    margin-left: auto;
  }

  .home-shell {
    overflow-x: hidden;
    padding: var(--w-space-8) var(--w-space-4) 56px;
    width: 100%;
    max-width: 100vw;
  }

  .home-hero,
  .home-section,
  .home-search {
    width: 100%;
    max-width: calc(100vw - 2rem);
  }

  .home-hero-main {
    margin-top: var(--w-space-6);
  }

  .home-title {
    font-size: 2.45rem;
    max-width: calc(100vw - 2rem);
    overflow-wrap: anywhere;
  }

  .home-subtitle {
    margin: var(--w-space-5) 0 var(--w-space-6);
    max-width: calc(100vw - 2rem);
    font-size: var(--w-text-md);
    overflow-wrap: anywhere;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    border-top: 1px solid rgba(219, 227, 236, 0.92);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 -12px 32px rgba(15, 23, 42, 0.08);
    backdrop-filter: saturate(180%) blur(18px);
    padding-bottom: env(safe-area-inset-bottom);
  }

  [data-theme="dark"] .mobile-bottom-nav {
    background: rgba(24, 28, 34, 0.9);
    border-top-color: var(--w-border);
  }

  .wave-scroll-top {
    right: var(--w-space-4);
    bottom: calc(88px + env(safe-area-inset-bottom));
    width: 42px;
    height: 42px;
  }

  .mobile-bottom-nav__item {
    min-height: 66px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    color: var(--w-text-muted);
    font-family: var(--w-font-sans);
    font-size: var(--w-text-xs);
    font-weight: 750;
    line-height: 1;
    transition: color 160ms ease;
  }

  .mobile-bottom-nav__item svg {
    width: 22px;
    height: 22px;
    box-sizing: content-box;
    border-radius: var(--w-radius-lg);
    padding: 4px;
    transition: background-color 160ms ease, color 160ms ease;
  }

  .mobile-bottom-nav__item.is-active {
    color: var(--w-primary-hover);
  }

  .mobile-bottom-nav__item.is-active svg {
    background: var(--w-primary-soft);
  }

  .home-search {
    min-height: 58px;
  }

  .home-search-icon {
    display: none;
  }

  .home-search-btn {
    width: 64px;
  }

  .home-search-input {
    font-size: var(--w-text-md);
  }

  .home-query-chips a {
    min-height: 32px;
    padding: 0 12px;
    font-size: var(--w-text-sm);
  }

  .home-section {
    margin-top: 56px;
    padding-top: 36px;
  }

  .home-section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--w-space-2);
  }

  .home-section-head a {
    align-self: flex-end;
  }

  .home-competition-row {
    grid-template-columns: 1fr;
    gap: var(--w-space-2);
    min-height: 0;
    padding: var(--w-space-4) 0;
  }

  .home-competition-title,
  .home-competition-location > span {
    white-space: normal;
  }

  .home-suggest-item {
    align-items: flex-start;
  }

  .home-suggest-kind {
    display: none;
  }

  .search-page-shell {
    width: min(100% - 2rem, var(--w-public-content));
    padding: var(--w-space-8) 0 56px;
  }

  .search-page-title {
    font-size: 2.45rem;
  }

  .search-page-form {
    align-items: stretch;
    flex-direction: column;
    padding: var(--w-space-2);
  }

  .search-page-form .home-search-icon {
    display: none;
  }

  .search-page-input {
    min-height: 48px;
    padding-inline: var(--w-space-2);
    font-size: var(--w-text-md);
  }

  .search-page-submit {
    width: 100%;
    min-height: 48px;
  }

  .search-results-grid {
    grid-template-columns: 1fr;
    gap: var(--w-space-8);
  }

  .search-result-row,
  .search-result-row--athlete {
    grid-template-columns: 40px minmax(0, 1fr) 28px;
    min-height: 72px;
  }

  .search-result-avatar,
  .search-result-sport {
    width: 40px;
    height: 40px;
  }

  .search-result-kind {
    display: none;
  }

  .wave-page-shell {
    padding-inline: 0.2rem;
  }

  .wave-filter-card {
    border-radius: 14px;
    padding: 0.8rem;
  }

  .athletes-index-page {
    width: min(100% - 2rem, var(--w-public-content));
    padding: var(--w-space-8) 0 56px;
  }

  .athletes-index-title {
    font-size: 2.45rem;
  }

  .athletes-search-form {
    min-height: 58px;
  }

  .athletes-search-input {
    font-size: var(--w-text-md);
  }

  .athletes-search-submit {
    width: 64px;
  }

  .athlete-list-row {
    grid-template-columns: 40px minmax(0, 1fr) auto 28px;
    gap: var(--w-space-3);
    min-height: 72px;
    padding: 0 var(--w-space-4);
  }

  .athlete-list-sports {
    gap: var(--w-space-1);
  }

  .athlete-list-avatar {
    width: 40px;
    height: 40px;
  }

  .competitions-index-page {
    width: min(100% - 2rem, var(--w-public-content));
    padding: var(--w-space-8) 0 56px;
  }

  .competitions-index-title {
    font-size: 2.45rem;
  }

  .competitions-index-subtitle {
    font-size: var(--w-text-md);
  }

  .competitions-filter-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--w-space-2);
    width: 100%;
    margin-top: var(--w-space-5);
    padding: var(--w-space-3) var(--w-space-4);
    border: 1px solid var(--w-border);
    border-radius: var(--w-radius-lg);
    background: var(--w-surface);
    color: var(--w-text);
    font-family: var(--w-font-sans);
    font-size: var(--w-text-sm);
    font-weight: 750;
  }

  .competitions-filter-form {
    display: none;
    grid-template-columns: 1fr;
    margin-top: var(--w-space-3);
    padding: var(--w-space-3);
  }

  .competitions-filter-form.is-expanded {
    display: grid;
  }

  .competitions-filter-submit {
    width: 100%;
  }

  .competition-list-row {
    grid-template-columns: 1fr 28px;
    align-items: start;
    gap: var(--w-space-3);
    min-height: 0;
    padding: var(--w-space-4);
  }

  .competition-list-date {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
  }

  .competition-list-main {
    grid-column: 1 / -1;
    padding: 0;
  }

  .competition-title,
  .competition-location {
    white-space: normal;
  }

  .competition-list-row .competition-kind-chip {
    grid-column: 1 / 2;
  }

  .competition-list-arrow {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    justify-self: end;
  }

  .athlete-list-grid {
    grid-template-columns: 1fr;
  }

  .athlete-profile-shell {
    width: min(100% - 2rem, var(--w-public-content));
    padding-bottom: 40px;
  }

  .athlete-profile-hero {
    padding: 0 0 var(--w-space-8);
  }

  .athlete-profile-head {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--w-space-5);
    padding: var(--w-space-8) max(1rem, calc((100vw - var(--w-public-content)) / 2));
  }

  .athlete-profile-person {
    align-items: flex-start;
    width: 100%;
    gap: var(--w-space-4);
  }

  .athlete-profile-avatar {
    width: 72px;
    height: 72px;
    font-size: var(--w-text-xl);
  }

  .athlete-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--w-space-3);
  }

  .athlete-analytics-grid,
  .athlete-analytics-pair {
    grid-template-columns: minmax(0, 1fr);
  }

  .athlete-analytics-pair > .athlete-analytics-widget + .athlete-analytics-widget {
    margin-top: var(--w-space-6);
    padding-top: var(--w-space-6);
    border-top: 1px solid var(--w-border);
  }

  .athlete-donut-row {
    flex-direction: column;
    align-items: center;
  }

  .athlete-donut-legend {
    width: 100%;
  }

  .athlete-metric-card {
    min-height: 112px;
  }

  .athlete-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .athlete-tab {
    flex: 1 0 max-content;
    min-height: 40px;
    padding: 0 var(--w-space-4);
    font-size: var(--w-text-sm);
  }

  .athlete-filter-form {
    grid-template-columns: 1fr;
  }

  .athlete-profile-layout {
    grid-template-columns: 1fr;
  }

  /* Шапка панели: заголовок сверху, ниже — счётчик слева и кнопка справа
     в один ряд, без right-aligned мешанины из переносов. */
  .athlete-section-head {
    flex-direction: column;
    align-items: stretch;
    gap: var(--w-space-2);
  }

  .athlete-results-actions {
    justify-content: space-between;
  }

  /* Мобила: [иконка | (дата / название / мета)], время — отдельной колонкой
     справа на всю высоту. Высоту рядов задают название и мета (а не время),
     поэтому отступы между датой/названием/метой одинаковые во всех строках. */
  .athlete-result-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: var(--w-space-3);
    row-gap: var(--w-space-1);
    padding-right: 40px;
  }

  .athlete-result-kind {
    grid-column: 1;
    grid-row: 2 / 4;
    align-self: start;
  }

  .athlete-result-date {
    grid-column: 2;
    grid-row: 1;
  }

  .athlete-result-main {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
  }

  /* Мета — на полную ширину контента (под названием и временем), поэтому
     город не обрезается и не переносится. */
  .athlete-result-meta {
    grid-column: 2 / -1;
    grid-row: 3;
    align-self: start;
  }

  /* Время занимает только ряды даты и названия (не растягивает строку и не
     лезет на мету), верх — у даты. */
  .athlete-result-score {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: start;
  }

  /* На узком экране крупное время съедает ширину названия — чуть уменьшаем. */
  .athlete-result-score strong {
    font-size: var(--w-text-lg);
  }

  /* Подложка деталей — на всю ширину строки (гасим правый паддинг под шеврон). */
  .athlete-details-panel {
    grid-column: 1 / -1;
    grid-row: 4;
    margin-right: -40px;
  }

  .athlete-heatmap {
    grid-template-columns: 34px repeat(12, 1fr);
    gap: 4px;
  }

  .athlete-heatmap__cell {
    height: 20px;
  }

  /* Круги «позиция в поле» не влезают втроём на узкий экран — кладём в
     горизонтальный скролл-ряд, листается свайпом. */
  .athlete-relative-gauges {
    display: flex;
    grid-template-columns: none;
    gap: var(--w-space-3);
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .athlete-relative-gauges::-webkit-scrollbar {
    display: none;
  }

  /* База чуть меньше половины, чтобы третий круг выглядывал краем — сразу
     понятно, что ряд листается вбок. */
  .athlete-relative-gauges .athlete-gauge {
    flex: 0 0 42%;
    max-width: none;
    scroll-snap-align: start;
  }

  /* На узком экране дуги ужимаются — возвращаем тексту нормальный размер. */
  .athlete-gauge__num {
    font-size: 20px;
  }

  .athlete-gauge__tier {
    font-size: 11px;
  }

  .athlete-relay-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .athlete-relay-seg {
    grid-column: 1 / -1;
    text-align: left;
  }

  .athlete-relay-seg__metrics {
    justify-content: flex-start;
  }

  .competition-hero-meta {
    flex-direction: column;
    gap: var(--w-space-2);
  }

  .competition-profile-head {
    padding: var(--w-space-8) max(1rem, calc((100vw - var(--w-public-content)) / 2));
  }

  .competition-profile-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .competition-content-block__head {
    align-items: stretch;
    flex-direction: column;
  }

  .competition-section-tabs {
    width: 100%;
  }

  .competition-section-tab {
    flex: 1 1 0;
  }

  .competition-stage-scroll {
    justify-content: flex-start;
    width: 100%;
  }

  .competition-results-filters {
    grid-template-columns: 1fr;
  }

  .competition-filter-submit {
    width: 100%;
  }

  .competition-stat-cell,
  .competition-stat-cell--narrow,
  .competition-stat-cell--wide {
    grid-column: 1 / -1;
  }

  .competition-results-head {
    display: none;
  }

  .competition-result-row {
    grid-template-columns: 56px minmax(0, 1fr) 40px;
    gap: var(--w-space-3);
    align-items: start;
    min-height: 0;
    padding: var(--w-space-4);
  }

  .competition-result-rank {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    font-size: var(--w-text-xl);
  }

  .competition-result-person {
    grid-column: 2 / 3;
    min-width: 0;
  }

  .competition-result-name {
    white-space: normal;
  }

  .competition-result-bib {
    grid-column: 2 / 3;
    font-size: var(--w-text-sm);
  }

  .competition-result-bib::before {
    content: "Номер ";
    color: var(--w-text-soft);
    font-family: var(--w-font-sans);
  }

  .competition-result-score {
    grid-column: 2 / 3;
    justify-items: start;
  }

  .competition-result-value {
    font-size: var(--w-text-lg);
  }

  .competition-result-places {
    grid-column: 2 / 3;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--w-space-2);
  }

  .competition-result-action {
    grid-column: 3 / 4;
    grid-row: 1 / 3;
    justify-content: flex-end;
  }
}

/* ---------------------------------------------------------------- */
/* Footer + предложить соревнование                                  */
/* ---------------------------------------------------------------- */

.wave-footer {
  margin-top: var(--w-space-8);
  border-top: 1px solid var(--w-border);
  background: var(--w-surface-subtle);
}

.wave-footer__inner {
  width: min(var(--w-public-content), calc(100% - 2rem));
  margin-inline: auto;
  padding: var(--w-space-6) 0;
  display: flex;
  flex-direction: column;
  gap: var(--w-space-3);
}

.wave-footer__suggest {
  margin: 0;
  color: var(--w-text-soft);
  font-size: var(--w-text-sm);
}

.wave-footer__suggest-link {
  border: none;
  background: none;
  padding: 0;
  margin-left: var(--w-space-1);
  color: var(--w-primary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.wave-footer__suggest-link:hover {
  color: var(--w-primary-hover);
  text-decoration: underline;
}

.wave-footer__bottom {
  display: flex;
  align-items: center;
  gap: var(--w-space-2);
  color: var(--w-text-muted);
  font-size: var(--w-text-sm);
}

.wave-footer__brand {
  font-weight: 600;
  color: var(--w-text-soft);
}

.wave-footer__sep {
  color: var(--w-text-muted);
}

@media (max-width: 768px) {
  .wave-footer {
    margin-bottom: calc(64px + env(safe-area-inset-bottom));
  }
}
