/* ==============================
   ПРОДАКШЕН CSS – Мінімалізм + Ідеально вирівняні іконки (2025)
================================ */
:root {
  --p: #1e40af;
  --s: #3b82f6;
  --g: #10b981;
  --r: #ef4444;
  --bg: #f8fafc;
  --card: #fff;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
}

/* БАЗОВІ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 14px;
  line-height: 1.5;
  font-size: 15px;
}

/* ЗАГОЛОВОК — Ф5 (8.111): скоуп #mainInterface — h1 живе лише в index.php,
   без скоупу бив по будь-якому h1 у shell-сторінках, що вантажать style.css */
#mainInterface h1 {
  text-align: center;
  color: var(--p);
  font-size: 1.95rem;
  font-weight: 700;
  margin-bottom: 8px;
}
#mainInterface h1 small {
  display: block;
  font-size: 1rem;
  color: var(--muted);
  margin-top: 6px;
  font-weight: 500;
}
#meetMeta {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 400;
  margin-top: 2px;
  letter-spacing: 0.01em;
  opacity: 0.85;
}
#meetMeta .deadline-badge {
  display: inline-block;
  background: #fde047;
  color: #000;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 6px;
  border: 1px solid #eab308;
  opacity: 1;
  letter-spacing: 0;
}
#meetMeta .deadline-badge--expired {
  background: #fecaca;
  border-color: #dc2626;
  color: #000;
}

/* =====================================================
   EDIT-OVERRIDE UI (adm/club)
===================================================== */
.edit-override-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  border: 1.5px solid #16a34a;
  color: #052e16;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-weight: 600;
}
.edit-override-banner i { color: #16a34a; font-size: 18px; }

.bulk-override-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: #fffbeb;
  border: 1.5px solid #f59e0b;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
}
.bulk-override-bar__label {
  flex: 1;
  min-width: 220px;
  color: #78350f;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.bulk-override-bar__label i { color: #d97706; }
/* 8.139: одна кнопка-перемикач (render.js updateBulkEditBtn) — колір наступної дії */
:where(#mainInterface, [data-view="editorhost"]) button.js-bulk-edit.is-closed { background: var(--g); }
:where(#mainInterface, [data-view="editorhost"]) button.js-bulk-edit.is-open   { background: var(--r); }

/* 8.147: перемикач редагування клубу — лише іконка замка (8.148: відкритий зелений /
   закритий червоний), квадрат у висоту кнопок .s; стан для читачів екрана — role=switch + aria-checked */
.club-edit-toggle {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #fca5a5;
  background: #fef2f2;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  color: #b91c1c;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.club-edit-toggle:hover:not(:disabled) { background: #fee2e2; transform: none; }
.club-edit-toggle:disabled { opacity: 0.75; cursor: not-allowed; }
.club-edit-toggle[data-state="on"] { border-color: #22c55e; color: #15803d; background: #f0fdf4; }
.club-edit-toggle[data-state="on"]:hover:not(:disabled) { background: #dcfce7; }
.club-edit-toggle:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}
/* 8.147: кнопки-піктограми на картці клубу (посилання, експорт .lef) — квадрат 36×36 */
:where(#mainInterface, [data-view="editorhost"]) button.s.s-ico { width: 36px; padding: 0; }

/* TOOLBAR */
.toolbar {
  padding: 16px;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,.08);
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  align-items: center;
}

/* УНІФІКОВАНІ КНОПКИ + ІКОНКИ — Ф5 (8.111): скоуп :where(#mainInterface,
   [data-view="editorhost"], .modal) — 3 контейнери, що ЄДИНІ хостять editor-DOM
   (index.php toolbar/tabs · workspace.php editor-таби · усі editor-модалки,
   .modal клас винятково editor-only, перевірено). :where() = нульова
   специфічність, каскад .g/.r/.s-модифікаторів нижче не зламаний. Раніше bare
   button{} каскадив на ВЕСЬ документ і ламав SaaS-шелл (8.87, 8.98 .imp-tab). */
:where(#mainInterface, [data-view="editorhost"], .modal) button,
:where(#mainInterface, [data-view="editorhost"], .modal) input[type="file"] {
  height: 44px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all .22s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;                    /* відстань між іконкою і текстом */
  white-space: nowrap;
}
:where(#mainInterface, [data-view="editorhost"], .modal) button { background: var(--p); color: #fff; }
:where(#mainInterface, [data-view="editorhost"], .modal) button:hover { background: #1e3a8a; transform: translateY(-1px); }
:where(#mainInterface, [data-view="editorhost"], .modal) button.g { background: var(--g); }
:where(#mainInterface, [data-view="editorhost"], .modal) button.g:hover { background: #059669; }
:where(#mainInterface, [data-view="editorhost"], .modal) button.r { background: var(--r); }
:where(#mainInterface, [data-view="editorhost"], .modal) button.r:hover { background: #dc2626; }
:where(#mainInterface, [data-view="editorhost"], .modal) button.s { height: 36px; font-size: 13.5px; padding: 0 16px; }

/* УСІ ІКОНКИ – однаковий розмір і вирівнювання (.modal svg/.modal i вже
   скоуповані класом — без змін) */
:where(#mainInterface, [data-view="editorhost"]) button svg,
:where(#mainInterface, [data-view="editorhost"]) button img,
:where(#mainInterface, [data-view="editorhost"]) button i,
.modal svg,
.modal i,
.entry-actions svg,
:where(#mainInterface, [data-view="editorhost"]) summary svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
}
/* FA іконки — розмір через font-size */
:where(#mainInterface, [data-view="editorhost"]) button i,
.modal i { width: auto; height: auto; font-size: 15px; display: inline; }

/* Статус */
#status {
  font-weight: 700;
  color: var(--p);
  font-size: 15px;
  min-width: 180px;
  text-align: center;
}

/* ТАБИ */
.tab {
  display: flex;
  background: var(--p);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(30,64,175,.22);
}
.tab button {
  flex: 1;
  padding: 16px;
  background: none;
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 15px;
  transition: .25s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.tab button.active {
  background: #1e3a8a;
  box-shadow: inset 0 4px 8px rgba(0,0,0,.2);
}
.tab button svg { width: 19px; height: 19px; }

/* КОНТЕНТ ТАБІВ */
.tabcontent {
  display: none;
  padding: 20px;
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,.09);
}
.tabcontent.active { display: block; }
/* a11y (UX-рев'ю #1): видимий focus-ring — кнопки редактора + заголовки клубів
   (Ф5/8.111: скоуп — див. коментар вище) */
:where(#mainInterface, [data-view="editorhost"], .modal) button:focus-visible,
:where(#mainInterface, [data-view="editorhost"], .modal) summary.club-header:focus-visible { outline: 2px solid var(--p); outline-offset: 2px; }
/* Feature A — кнопка «Подати заявку» (клуб): активна = зелена, подано = сіра */
#submitEntryBtn { background:#16a34a; border-color:#16a34a; color:#fff; }
#submitEntryBtn:hover:not(.submitted):not(:disabled) { background:#15803d; }
#submitEntryBtn.submitted { background:#94a3b8; border-color:#94a3b8; color:#fff; cursor:default; }
/* 8.133: без дистанцій подавати нічого — кнопка неактивна й так виглядає */
#submitEntryBtn:disabled:not(.submitted) { opacity:.5; cursor:not-allowed; transform:none; }

/* КЛУБИ – випадаючі списки */
.clubs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}
@media (min-width: 601px) {
  .clubs-grid > details[data-club-code][open] {
    grid-column: 1 / -1;
    order: -1;
  }
}
/* Ф5 (8.111) — скоуп :where(#mainInterface, [data-view="editorhost"], .modal):
   .modal додано заради .inv-set-pro-panel модалки запрошення (прибрана в 8.141);
   лишається для <details> в інших модалках редактора. */
:where(#mainInterface, [data-view="editorhost"], .modal) details {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
:where(#mainInterface, [data-view="editorhost"]) summary.club-header {
  background: #f8fafc;
  padding: 15px 18px;
  font-weight: 700;
  font-size: 15.5px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  gap: 10px;
}
:where(#mainInterface, [data-view="editorhost"]) summary.club-header::after {
  content: "";
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2364748b'%3E%3Cpath d='M8.7 6.3l4.65 4.65L18 6.3l1.4 1.4-6.35 6.35L6.7 7.7 8.1 6.3z'/%3E%3C/svg%3E") center/contain no-repeat;
  transition: transform .28s ease;
  flex-shrink: 0;
}
:where(#mainInterface, [data-view="editorhost"]) details[open] summary.club-header::after {
  transform: rotate(180deg);
}

.club-body { padding: 16px; }
.athlete-item {
  padding: 12px 0;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.athlete-name { font-weight: 700; font-size: 15px; }
.athlete-info { font-size: 0.94rem; color: var(--muted); margin-top: 3px; }

/* МОДАЛКА */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 14px;
}
.modal.active { display: flex; }

.modal-content {
  background: #fff;
  border-radius: 14px;
  width: 95%;
  max-width: 740px;
  max-height: 95vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 70px rgba(0,0,0,.42);
}
.modal-header {
  padding: 18px 24px;
  background: var(--p);
  color: #fff;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h2 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-header h2 svg { width: 22px; height: 22px; }
.close {
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  font-size: 22px;
  cursor: pointer;
  opacity: 0.85;
  line-height: 1;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: opacity .2s, background .2s;
}
.close:hover { opacity: 1; background: rgba(255,255,255,.15); }

.modal-body { padding: 22px; flex: 1; overflow-y: auto; }
.modal-footer {
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1.5px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 14px;
}
.modal-footer button {
  min-width: 130px;
  height: 46px;
  padding: 0 28px;
  font-weight: 700;
  border-radius: 10px;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}
.modal-footer button:first-child { background: var(--s); }
.modal-footer button:last-child { background: #94a3b8; }
.modal-footer button.r,
.modal-footer button.r:first-child,
.modal-footer button.r:last-child { background: var(--r); color: #fff; }
.modal-footer button.r:hover { background: #dc2626; }

/* ФОРМИ В МОДАЛЦІ */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
  margin-bottom: 20px;
}
.grid label {
  font-weight: 700;
  font-size: 14.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.grid label svg { width: 17px; height: 17px; opacity: 0.8; }

.grid input, .grid select {
  padding: 11px 14px;
  border: 1.8px solid #cbd5e1;
  border-radius: 9px;
  font-size: 15.5px;
  width: 100%;
  transition: all .2s;
}
.grid input:focus, .grid select:focus, .time-input:focus {
  outline: none;
  border-color: var(--s);
  box-shadow: 0 0 0 4px rgba(59,130,246,.18);
}

/* Дистанції в модалці */
.event-grid {
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  margin-top: 8px;
}
.event-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1.4px solid #e2e8f0;
  font-size: 14px;
  transition: background .2s;
}
.event-row:hover { background: #eef2ff; }
.event-row label {
  flex: 1;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 8px;
}
.event-row label svg { width: 17px; height: 17px; opacity: 0.85; }
.time-input {
  width: 90px;
  padding: 6px 4px;
  text-align: center;
  border: 1.6px solid #cbd5e1;
  border-radius: 7px;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  font-size: 14.5px;
  color: var(--p);
}

/* ================================
   PILL КНОПКИ — стать і роль тренера
================================ */
.pill-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.pill-btn {
  height: 32px;
  padding: 0 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: all .18s ease;
  white-space: nowrap;
}
.pill-btn:hover {
  border-color: var(--s);
  color: var(--s);
  transform: none;
}

/* Стать — активний стан */
.pill-btn--active {
  background: #eff6ff;
  border-color: #93c5fd;
  color: var(--p);
}

/* Стать — гендерні кольори */
.pill-btn--male.pill-btn--active   { background:#eff6ff; border-color:#93c5fd; color:#3b82f6; }
.pill-btn--female.pill-btn--active { background:#fdf2f8; border-color:#f9a8d4; color:#ec4899; }

/* Роль — активні стани з кольорами */
.pill-btn--head.pill-btn--active  { background:#dbeafe; border-color:#93c5fd;  color:#1e40af; }
.pill-btn--coach.pill-btn--active { background:#dcfce7; border-color:#86efac;  color:#15803d; }
.pill-btn--staff.pill-btn--active { background:#fef9c3; border-color:#fde047;  color:#854d0e; }
.pill-btn--doctor.pill-btn--active{ background:#fce7f3; border-color:#f9a8d4;  color:#9d174d; }

/* ================================
   ТРЕНЕРСЬКИЙ ШТАБ — модалка клубу
================================ */

/* Рядок тренера у списку */
.coach-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
}
.coach-row-name {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.coach-row-gender {
  font-size: 12px;
  color: var(--muted);
}

/* Бейдж ролі */
.coach-badge {
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.coach-badge--headcoach { background: #dbeafe; color: #1e40af; }
.coach-badge--coach     { background: #dcfce7; color: #15803d; }
.coach-badge--staff     { background: #fef9c3; color: #854d0e; }
.coach-badge--doctor    { background: #fce7f3; color: #9d174d; }

/* Форма додавання тренера */
.coach-add-form {
  background: #eff6ff;
  border: 1.5px dashed #93c5fd;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 10px;
}
.coach-add-form .grid {
  margin-bottom: 10px;
}

/* Рядок: Стать + Роль + кнопка */
.coach-form-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.coach-form-row > div { flex: 1; min-width: 100px; }
.coach-form-row > div:last-child { flex: 0 0 auto; }

.coach-form-row select {
  padding: 9px 10px;
  border: 1.8px solid #cbd5e1;
  border-radius: 9px;
  font-size: 14px;
  width: 100%;
  background: var(--card);
  color: var(--text);
}

/* ================================
   ВКЛАДКА ДИСТАНЦІЇ — адаптивна сітка */
.events-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

/* summary — перенос довгого тексту назви дистанції (Ф5/8.111: скоуп) */
:where(#mainInterface, [data-view="editorhost"], .modal) details summary {
  white-space: normal;
  word-break: break-word;
}

/* ================================
   ДИСТАНЦІЇ В МОДАЛЦІ — класи
   (замість inline стилів в modal.js)
================================ */

/* Блок сесії у режимі "За програмою" */
.ev-session-block {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}
.ev-session-hdr {
  background: var(--p);
  color: #fff;
  padding: 7px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
}
.ev-session-events {
  padding: 4px 0;
}

/* Двоколоночна сітка у модалці */
.events-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.events-column { min-width: 0; }

/* Група стилів (В.С., БРАС тощо) */
.style-group {
  margin-bottom: 20px;
  break-inside: avoid;
}
.style-header {
  margin: 0 0 10px;
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}
.style-events {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Рядок дистанції */
.event-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1.5px solid transparent;
  transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.event-row:hover { background-color: #f0f9ff; }

/* Зелений glow — вікова група підходить */
.event-row--match {
  background-color: rgba(34,197,94,0.07) !important;
  border-color: #86efac !important;
  box-shadow: 0 0 6px rgba(34,197,94,0.22);
}
.event-row--match:hover { background-color: rgba(34,197,94,0.12) !important; }

/* Червоний glow — вікова група не підходить */
.event-row--miss {
  background-color: rgba(239,68,68,0.07) !important;
  border-color: #fca5a5 !important;
  box-shadow: 0 0 6px rgba(239,68,68,0.22);
}
.event-row--miss:hover { background-color: rgba(239,68,68,0.12) !important; }

.event-row-label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 500;
}
.event-row-label input[type="checkbox"] { cursor: pointer; flex-shrink: 0; }
.event-row .time-input { margin-top: 0; }

/* Рядок: назва дистанції + age-badge в одному рядку */
.ev-name-inline {
  display: flex;
  flex-direction: row;
  align-items: center;
  min-width: 0;
  flex: 1;
  gap: 6px;
  flex-wrap: wrap;
}
.ev-name-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.event-name-warn { color: #dc2626; }

/* time-input */
.time-input {
  width: 80px;
  padding: 4px 6px;
  text-align: center;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: 13px;
  color: var(--p);
  flex-shrink: 0;
}
.time-input:focus {
  outline: none;
  border-color: var(--s);
  box-shadow: 0 0 0 3px rgba(59,130,246,.18);
}
/* R7/В2: плейсхолдер-час (з імпорту результатів) — зелена підказка, поки дистанція не обрана */
.time-input--ph { border-color: #86efac; }
.time-input--ph::placeholder { color: #16a34a; opacity: 0.85; font-style: italic; font-weight: 700; }

/* ТАБИ — FA іконки */
.tab button i {
  font-size: 17px;
  flex-shrink: 0;
}
.tab button .tab-text { display: inline; }

/* ================================
   ДОПОМІЖНІ КЛАСИ З index.html
================================ */

/* ================================
   HERO SCREEN — стартова сторінка
================================ */
.hero-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #00001e; /* базовий фон під canvas */
  z-index: 9999;
  padding: 16px;
  overflow: hidden;
}

/* Matrix canvas — абсолютний фон під карткою */
#matrixBg {
  position: absolute;
  inset: 0;
  display: block;
  z-index: 0;
}

.hero-card {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 24px;
  box-shadow: 0 24px 64px rgba(30, 64, 175, 0.30);
  padding: 40px 36px 28px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(59,130,246,.35);
}
.hero-icon i { font-size: 32px; color: #fff; }

.hero-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--p);
  letter-spacing: -.02em;
  margin-bottom: 6px;
}

.hero-sub {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 20px;
}

.hero-divider {
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--p), var(--s));
  border-radius: 2px;
  margin-bottom: 22px;
}



.hero-btn {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity .15s, transform .1s;
  margin-bottom: 20px;
}
.hero-btn:hover  { opacity: .9; transform: translateY(-1px); }
.hero-btn:active { transform: translateY(0); opacity: 1; }

/* 8.129: повідомлення входу в картці (замість alert/confirm) */
.hero-msg {
  width: 100%;
  text-align: left;
  font-size: 13px;
  line-height: 1.45;
  border-radius: 10px;
  padding: 9px 12px;
  margin: 0 0 14px;
}
.hero-msg--err  { background: #fef2f2; border: 1.5px solid #fecaca; color: #b91c1c; }
.hero-msg--info { background: #eff6ff; border: 1.5px solid #bfdbfe; color: #1e40af; }
.hero-msg a { color: inherit; font-weight: 700; white-space: nowrap; }
.hero-msg[hidden] { display: none; }   /* клас не перекриває [hidden] (пастка 8.86) */

/* 8.129: смужка «Ви увійшли як …» — людина вже в акаунті */
.hero-session {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
  text-align: left;
}
.hero-session[hidden] { display: none; }
.hero-session-who {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #166534;
}
.hero-session-who i { color: #16a34a; }
.hero-session-who b { overflow-wrap: anywhere; }
.hero-session-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: #16a34a;
  border-radius: 10px;
  padding: 10px 14px;
  text-decoration: none;
  transition: opacity .15s;
}
.hero-session-btn:hover { opacity: .9; }

/* Акаунт (організатори і кабінети клубів) — головна дія на index.php (8.130) */
.hero-orgrow {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.hero-orgsep {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.hero-reglink {
  font-size: 13px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-bottom: 8px;
}
.hero-reglink:hover { color: var(--p, #1e40af); }
span.hero-reglink, span.hero-reglink:hover { text-decoration: none; color: var(--muted); text-align: center; }   /* 8.202: підказка, не посилання */


/* 8.130: головна без ?meet= — лише акаунти; пояснення для клубів */
.hero-note {
  width: 100%;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  text-align: left;
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.hero-note i { color: var(--s, #3b82f6); margin-top: 2px; }
.hero-btn--link { text-decoration: none; margin-bottom: 4px; }

.hero-version {
  font-size: 12px;
  color: #94a3b8;
}

@media (max-width: 480px) {
  .hero-card { padding: 32px 20px 24px; border-radius: 20px; }
  .hero-title { font-size: 1.3rem; }
}

/* Stats у toolbar */
#stats {
  margin-right: 20px;
  font-weight: 600;
  color: #334155;
  font-size: 14px;
}

/* ==============================
   READ-ONLY BANNER — клубний режим після дедлайну
================================ */
.readonly-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1.5px solid #f59e0b;
  border-radius: 10px;
  color: #78350f;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 2px 6px rgba(245,158,11,0.15);
}
.readonly-banner i { font-size: 18px; color: #d97706; flex-shrink: 0; }
.readonly-banner b { color: #78350f; font-weight: 700; }

/* Бейдж вікової групи — використовується у modal, events tab, stats, schedule */
.age-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  background: #f0f9ff;
  border: 1px solid #bfdbfe;
  color: var(--muted);
  border-radius: 4px;
  white-space: nowrap;
  vertical-align: middle;
  line-height: 1.5;
}
/* Events tab (events-grid): мастерс-змагання мають до 12+ вікових груп в одній події —
   nowrap ламає ширину картки (виходить за межі, зносить сторінку по горизонталі).
   Дозволяємо перенос лише тут (8.117), інші вживання (modal/stats/schedule) не чіпані. */
.events-grid .age-badge {
  white-space: normal;
  max-width: 100%;
}
/* Matched age badge — зелений */
.age-badge--match {
  background: #f0fdf4;
  border-color: #86efac;
  color: #15803d;
}
/* Non-matched age badge — червоний (не використовується зараз, резерв) */
.age-badge--miss {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* Заголовок секції в модалці */
.modal-section-title {
  margin: 20px 0 8px;
  color: var(--p);
  font-weight: 700;
  font-size: 1rem;
}

/* Модалки зменшеної ширини */
.modal-content--sm { max-width: 480px; }
.modal-content--md { max-width: 520px; }

/* Модалка спортсмена — ширша для видимості вікових груп */
#editModal .modal-content { max-width: 860px; }

/* Input uppercase */
.input-uppercase { text-transform: uppercase; }

/* Список вибору учасника */
.choose-athlete-list {
  max-height: 420px;
  overflow-y: auto;
  margin-top: 14px;
}

/* Кнопка + Позиція в естафеті */
.btn-add-position { margin-top: 10px; }

/* ================================
   ІНВАСПОРТ БЛОК
================================ */
.disability-wrap { margin: 20px 0 0; }

.disability-toggle-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 4px;
}

.disability-radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}
.disability-radio-label--active { color: var(--p); }

.disability-block {
  display: none;
  margin-top: 12px;
  padding: 16px;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: 10px;
}

.disability-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.disability-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.disability-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
  display: block;
}

.disability-select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
  font-size: 14px;
}

.disability-toggles-row {
  display: flex;
  gap: 32px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Toggle switch */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  user-select: none;
}
.toggle-shell {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.toggle-input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background: #cbd5e1;
  transition: background 0.2s;
}
.toggle-thumb {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ================================
   РЕСПОНСИВ — tablet ≤ 768px
================================ */
@media (max-width: 768px) {
  body { padding: 10px; font-size: 14px; }
  h1 { font-size: 1.4rem; }
  h1 small { font-size: 0.85rem; }

  .clubs-grid { grid-template-columns: 1fr; }

  .events-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Дистанції в модалці — 1 колонка на планшеті */
  .events-modal-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .tab button {
    font-size: 13px;
    padding: 12px 6px;
    gap: 5px;
  }
  .tab button i { font-size: 16px; }
}

/* ================================
   РЕСПОНСИВ — mobile ≤ 480px
================================ */
@media (max-width: 480px) {
  body { padding: 8px; }
  h1 { font-size: 1.15rem; }
  h1 small { font-size: 0.78rem; }

  /* Toolbar — сітка 3 колонки: кнопка = іконка над підписом (8.251: було по кнопці в рядок — шапка займала понад пів першого екрана);
     лічильники, статус і «Подати заявку» / «Створити акаунт» — на всю ширину */
  .toolbar {
    padding: 8px;
    gap: 6px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: stretch;
    margin-bottom: 12px;
  }
  .toolbar #stats, .toolbar #status, .toolbar #submitEntryBtn, .toolbar #clubAccountBtn { grid-column: 1 / -1; }
  .toolbar button,
  .toolbar input[type="text"] {
    width: 100%;
    justify-content: center;
  }
  .toolbar button {
    height: 56px;
    padding: 6px 4px;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    line-height: 1.15;
    white-space: normal;
    text-align: center;
  }
  .toolbar button i { font-size: 17px; }
  .toolbar #submitEntryBtn, .toolbar #clubAccountBtn { flex-direction: row; height: 44px; font-size: 14px; white-space: nowrap; }
  #stats { margin-right: 0; text-align: center; font-size: 12.5px; line-height: 1.35; }
  #status { min-width: unset; font-size: 12.5px; }

  /* Таби — іконка + мінімальний підпис (8.250: 11 px замість 9) */
  .tab button {
    font-size: 11px;
    padding: 10px 4px;
    gap: 3px;
    flex-direction: column;
  }
  .tab button i { font-size: 18px; }
  .tab button .tab-text { font-size: 11px; }

  .tabcontent { padding: 12px 10px; }
  .clubs-grid { grid-template-columns: 1fr; gap: 10px; }
  .events-grid { grid-template-columns: 1fr; gap: 12px; }

  /* Модалка — bottom sheet */
  .modal {
    align-items: flex-end;
    padding: 0;
  }
  .modal-content {
    width: 100%;
    max-width: 100%;
    max-height: 85vh; /* Safari: URL-bar ~60px з'їдає ~6vh, 85 = безпечний ліміт */
    border-radius: 20px 20px 0 0;
  }
  .modal-header {
    padding: 14px 16px;
    border-radius: 20px 20px 0 0;
    flex-shrink: 0;
  }
  .modal-header h2 { font-size: 1.2rem; }
  .modal-body {
    padding: 14px 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain; /* не передавати скрол на body */
    flex: 1;
  }
  .modal-footer {
    padding: 12px 16px;
    gap: 10px;
    flex-shrink: 0;
  }
  .modal-footer button {
    flex: 1;
    min-width: unset;
    height: 48px;
    padding: 0 12px;
    font-size: 14px;
  }

  /* Форма в модалці — 1 колонка */
  .grid {
    grid-template-columns: 1fr;
    gap: 10px 0;
  }
  .grid input, .grid select {
    font-size: 16px;
    padding: 10px 12px;
  }

  /* Disability на мобільному */
  .disability-grid { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .disability-select { font-size: 16px; padding: 8px 6px; }   /* 8.250 */
  .disability-toggles-row { gap: 20px; }

  /* modal-content--sm і --md на мобільному — повна ширина */
  .modal-content--sm,
  .modal-content--md { max-width: 100%; }

  /* Event grid у модалці — 1 колонка, label перенос */
  .events-modal-grid { grid-template-columns: 1fr; gap: 0; }
  .event-row { padding: 5px 4px; gap: 6px; }
  .event-row-label { font-size: 12.5px; }
  .event-row-label span { white-space: normal; word-break: break-word; }
  .time-input { width: 88px; font-size: 16px; padding: 6px 6px; }   /* 8.250: 16 px — iOS не збільшує сторінку при фокусі */

  /* Форма тренера — вертикально на мобільному */
  .coach-form-row { flex-direction: column; gap: 8px; }
  .coach-form-row > div { min-width: unset; width: 100%; }

  button { height: 44px; font-size: 14px; }
  button.s { height: 40px; font-size: 13px; padding: 0 12px; }   /* 8.250: ціль дотику ≥ 40 px */
  /* 8.250: поля вводу — 16 px (у компонентів свої розміри → !important); бейдж вікової групи — 12 px */
  input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]), select, textarea { font-size: 16px !important; }
  .age-badge { font-size: 12px; }
  button.club-edit-toggle, button.s.s-ico, button.s.r { min-width: 40px; }   /* 8.250: іконки-кнопки (замок, експорт, видалити) — ціль ≥ 40 px */
  button.club-edit-toggle { width: 40px; height: 40px; }

  /* Звіти — мобільний */
  .rep-dd-panel { max-height: 200px; }
}

/* ======================================================
   ВКЛАДКА «ЗВІТИ» — картки (стиль club-card, без розкриття)
====================================================== */

/* Картка звіту — дзеркалить details */
.rep-card {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: visible;          /* dropdown-панель виходить за межі */
  background: var(--card);
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}

/* Заголовок картки — дзеркалить summary.club-header */
.rep-card-header {
  background: #f8fafc;
  padding: 15px 18px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1.5px solid var(--border);
  border-radius: 12px 12px 0 0;
}
.rep-card-header i { color: var(--s); font-size: 16px; }

/* ── Поле з лейблом ───────────────────────────────── */
.rep-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rep-field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── Рядок master-чекбокс + кнопка Друк ──────────── */
.rep-master-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* ── Master-чекбокс ───────────────────────────────── */
.rep-check--master {
  padding: 4px 0;
  flex: 1;
}
.rep-master-row .rep-check--master {
  border-bottom: none;
  margin-bottom: 0;
}

/* ── Грід вкладки Звіти (desktop: 2 картки поруч) ── */
.rep-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 700px) {
  .rep-grid { grid-template-columns: 1fr; }
}

/* ── Роздільник ───────────────────────────────────── */
.rep-sep {
  border-top: 1px solid var(--border);
  margin: 8px 0;
}

/* ── Inline-grid чекбоксів ────────────────────────── */
.rep-inline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 2px 4px;
}
.rep-inline-grid--wide {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* ── Окремий чекбокс у гриді ──────────────────────── */
.rep-check {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: background .1s;
}
.rep-check:hover { background: rgba(59,130,246,.07); }
.rep-check input[type="checkbox"] { accent-color: var(--s); flex-shrink: 0; }
.rep-check span { line-height: 1.3; }

/* ── Перемикач-опція (toggle) ─────────────────────── */
.rep-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  padding: 5px 0;
}
.rep-toggle input[type="checkbox"] { accent-color: var(--s); width: 16px; height: 16px; }

/* ── Режим клубу: два стовпці ─────────────────────── */
.clubs-grid--full {
  display: block;
  width: 100%;
}
.club-mode-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.club-mode-col {
  padding: 0 16px 16px;
}
.club-mode-col:first-child {
  border-right: 1.5px solid var(--border);
}
.club-mode-col-hdr {
  font-size: 13px;
  font-weight: 700;
  padding: 10px 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 6px;
}
@media (max-width: 600px) {
  .club-mode-cols { grid-template-columns: 1fr; }
  .club-mode-col:first-child { border-right: none; border-bottom: 1.5px solid var(--border); }
}

/* ================================
   ТАБЛИЦЯ/КАРТКИ УЧАСНИКІВ
   desktop: таблиця, mobile: картки
================================ */
.ath-table-wrap { display: block; }
.ath-cards-wrap { display: none; }

@media (max-width: 480px) {
  .ath-table-wrap { display: none; }
  .ath-cards-wrap { display: block; }
}

.ath-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.ath-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.ath-card-name { font-weight: 700; font-size: 15px; line-height: 1.3; }
.ath-card-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.ath-card-dists { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.ath-card-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ================================
   Вік не відповідає AGEGROUP
================================ */
.age-warning {
  background: #fef2f2 !important;
  border-color: #f87171 !important;
}
.age-warning:hover {
  background: #fee2e2 !important;
}

/* ================================
   QUEUE — badge на кнопці
================================ */
.queue-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}

/* flex-обгортка заголовку клубу (name + small + badge) */
.club-header-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.club-header-text {
  flex: 1;
  min-width: 0;
}

/* badge у заголовку <summary> */
.queue-badge-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
  box-sizing: border-box;
}

/* ================================
   QUEUE MODAL — список заявок
================================ */
.queue-club-label {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.queue-loading,
.queue-empty,
.queue-error {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
  font-size: 0.9rem;
}
.queue-error { color: #b91c1c; }

.queue-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  background: var(--card);
  transition: opacity .2s;
}
.queue-card-info { flex: 1; min-width: 0; }
.queue-card-name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-card-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 3px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.q-meta-item { display: inline; }
.q-time { opacity: 0.7; }
.q-entries {
  font-size: 0.75rem;
  color: #3b82f6;
  margin-top: 4px;
  line-height: 1.4;
}

.queue-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.q-btn-approve {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background .15s;
}
.q-btn-approve:hover { background: #059669; }

.q-btn-reject {
  height: 34px;
  width: 34px;
  padding: 0;
  font-size: 14px;
  background: #f1f5f9;
  color: #64748b;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.q-btn-reject:hover { background: #fef2f2; color: #ef4444; border-color: #fca5a5; }

@media (max-width: 520px) {
  .queue-card { flex-direction: column; align-items: flex-start; }
  .queue-card-actions { width: 100%; justify-content: flex-end; }
  .q-btn-approve { flex: 1; justify-content: center; }
}

/* ══════════════════════════════════════════════════
   SCHEDULE MODAL — Програма змагань (v2.23)
   ══════════════════════════════════════════════════ */

/* Ширина модалки */
#scheduleDialog .modal-content { max-width: 1100px; }

/* Meet meta info */
.sched-meta {
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.sched-meta-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--p);
  line-height: 1.35;
  margin-bottom: 5px;
}
.sched-meta-sub {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--muted);
}
.sched-meta-sub span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Sessions grid — 2 колонки (1 колонка якщо одна сесія) */
.sched-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-content: start;
}
.sched-grid--single { grid-template-columns: 1fr; }
.sched-grid--single .sched-session { max-width: 100%; }

/* Empty state */
.schedule-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
  font-size: 0.88rem;
}
.schedule-empty i {
  font-size: 2rem;
  display: block;
  margin-bottom: 10px;
  opacity: .4;
}

/* Session card */
.sched-session {
  border-radius: 12px;
  border: 1.5px solid var(--border);
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: box-shadow .15s ease, transform .15s ease;
}
.sched-session:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}
.sched-session-hdr {
  background: linear-gradient(135deg, var(--p) 0%, color-mix(in srgb, var(--p) 75%, #000) 100%);
  color: #fff;
  padding: 10px 14px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.sched-session-hdr-title {
  font-weight: 700;
  font-size: 0.81rem;
  line-height: 1.3;
}
.sched-session-hdr-date {
  font-size: 0.75rem;
  opacity: .88;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.14);
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

/* Event row */
.sched-ev {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  transition: background .1s;
}
.sched-ev:last-child { border-bottom: none; }
.sched-ev:hover      { background: var(--bg); }

.sched-ev-num    { color: var(--muted); font-size: 0.73rem; font-weight: 700; min-width: 22px; }
.sched-ev-dist   { font-weight: 800; font-size: 0.84rem; min-width: 40px; color: var(--text); }
/* Рядок: назва стилю + вік поряд */
.sched-ev-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sched-ev-stroke { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sched-ev-gender {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.77rem;
  font-weight: 700;
  flex-shrink: 0;
}
.sched-ev-gender.f { color: #ec4899; }
.sched-ev-gender.m { color: #3b82f6; }

.sched-ev-age {
  font-size: 0.7rem;
  color: var(--muted);
  flex: 0 1 auto;
  min-width: 0;
  white-space: normal;
  word-spacing: 1px;
  line-height: 1.4;
}

/* =====================================================
   CSV IMPORT — стилі модалки та прев'ю
===================================================== */
.csv-import-hint {
  margin-top: 10px;
  padding: 10px 12px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  color: #075985;
  font-size: 0.82rem;
  line-height: 1.5;
}
.csv-import-hint i { color: #0284c7; margin-right: 6px; }
.csv-import-hint code {
  background: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Лічильник дистанцій у модалці — multi-line (per-session) */
.entries-counter {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 0.85rem;
  color: #475569;
  padding: 4px 10px;
  background: #f1f5f9;
  border-radius: 6px;
}
.entries-counter .counter-line {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}
.entries-counter .counter-line b {
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.entries-counter .counter-line--full b {
  color: #dc2626;
}

.entries-counter.is-full {
  background: #fef2f2;
  border: 1px solid #fecaca;
}

/* Підказка для введення часу (модалка спортсмена) */
.time-input-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 12px;
  padding: 8px 12px;
  background: #fef9c3;
  border: 1px solid #fde047;
  border-radius: 8px;
  color: #713f12;
  font-size: 0.82rem;
  line-height: 1.5;
}
.time-input-hint i { color: #ca8a04; flex-shrink: 0; }
.time-input-hint b { color: #422006; }
.time-input-hint code {
  background: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.92em;
  font-weight: 600;
  color: #422006;
}

.csv-import-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 10px;
}
.csv-chip {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
.csv-chip--ok   { background: #f0fdf4; border-color: #86efac; color: #166534; }
.csv-chip--warn { background: #fffbeb; border-color: #fcd34d; color: #78350f; }
.csv-chip--dup  { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }

.csv-import-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.csv-preview-wrap {
  max-height: 50vh;
  overflow: auto;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--card);
}
.csv-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.csv-preview-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg);
  padding: 9px 10px;
  text-align: left;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 1.5px solid var(--border);
  z-index: 1;
}
.csv-preview-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.csv-preview-table tbody tr:last-child td { border-bottom: none; }
.csv-row--ok   { background: #fff; }
.csv-row--warn { background: #fffbeb; }
.csv-row--dup  { background: #fef2f2; opacity: 0.85; }

.csv-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
}
.csv-status--ok   { background: #dcfce7; color: #166534; }
.csv-status--warn { background: #fef3c7; color: #78350f; }
.csv-status--dup  { background: #fecaca; color: #991b1b; }

@media (max-width: 600px) {
  .csv-preview-table { font-size: 0.78rem; }
  .csv-preview-table thead th,
  .csv-preview-table td { padding: 6px 7px; }
  .csv-preview-wrap { max-height: 42vh; }
}

/* Mobile ≤600px: single column + більші touch-цілі */
@media (max-width: 600px) {
  #scheduleDialog .modal-content { max-width: 100%; }
  .sched-grid { grid-template-columns: 1fr; gap: 10px; }
  .sched-meta { padding: 10px 12px; }
  .sched-meta-title { font-size: 0.95rem; }
  .sched-meta-sub { gap: 10px; font-size: 0.78rem; }

  .sched-session-hdr { padding: 11px 13px; }
  .sched-session-hdr-title { font-size: 0.86rem; }
  .sched-session-hdr-date  { font-size: 0.76rem; }

  .sched-ev {
    padding: 9px 12px;
    gap: 10px;
    font-size: 0.86rem;
  }
  .sched-ev-num  { font-size: 0.78rem; min-width: 26px; }
  .sched-ev-dist { font-size: 0.9rem;  min-width: 48px; }
  .sched-ev-age  { font-size: 0.74rem; }
}

/* =====================================================
   K3.3 — embed-режим (index.php у iframe-секції workspace.php).
   Активується лише при ?embed=1 (body.embed). Ховає дубль-хром:
   великий <h1>-титул дублює workspace topbar. Решта (toolbar, таби,
   контент) лишається — це робочі функції редактора.
===================================================== */
body.embed h1 { display: none; }
body.embed #mainInterface { padding-top: 10px; }

/* =====================================================
   U1 — уніфікована модалка імпорту (CSV реєстр ФПУ + LENEX заявки).
   Вкладки .imp-tab*; LENEX-прев'ю .imp-* (порт T3a — спільні для
   index.php і workspace.php, бо style.css вантажиться в обох).
===================================================== */
.imp-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 20px; margin-top: 4px; }
.imp-tab { border: none; background: none; border-bottom: 2px solid transparent; border-radius: 0;
  height: auto; padding: 10px 14px; font: inherit; font-size: 0.84rem; font-weight: 400;
  color: var(--muted); cursor: pointer; transition: none; }
.imp-tab:hover { background: none; color: var(--p); transform: none; }
.imp-tab.on { border-bottom-color: var(--p); color: var(--p); font-weight: 700; background: none; }
/* вкладка-секція: відновлює flex-ланцюг .modal-content→.modal-body (скрол+footer) */
.imp-pane { display: flex; flex: 1; min-height: 0; flex-direction: column; }
.imp-pane > .modal-body { min-height: 0; }
.imp-err { color: #991b1b; background: #fef2f2; border: 1px solid #fca5a5;
  border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; font-size: 0.84rem; }
.imp-file { display: block; margin-bottom: 14px; }
.imp-file span { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 5px; }
.imp-file input[type=file] { width: 100%; font: inherit; font-size: 0.84rem; }
.imp-hint { color: var(--muted); font-size: 0.84rem; margin: 6px 2px; }
.imp-sum { font-size: 0.86rem; line-height: 1.6; padding: 10px 12px; background: var(--bg);
  border-radius: 9px; margin-bottom: 12px; }
.imp-ok  { color: #166534; font-weight: 700; }
.imp-bad { color: #991b1b; font-weight: 700; }
.imp-drop { margin-bottom: 12px; font-size: 0.84rem; }
.imp-drop summary { cursor: pointer; color: #78350f; font-weight: 600; }
.imp-drop ul { margin: 6px 0 0; padding-left: 20px; color: var(--muted); }
.imp-tbl { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.imp-tbl th { text-align: left; font-weight: 700; color: var(--muted); font-size: 0.72rem;
  padding: 6px 6px; border-bottom: 1.5px solid var(--border); }
.imp-tbl td { padding: 7px 6px; border-bottom: 1px solid var(--border); }
.imp-c { text-align: center; }
.imp-mut { color: var(--muted); }
.imp-mono { font-family: ui-monospace, monospace; font-size: 0.78rem; color: var(--muted); }
.imp-nm { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-new { font-size: 0.72rem; color: var(--p); background: #eff6ff; padding: 2px 8px; border-radius: 7px; }
.imp-opts { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 14px;
  padding-top: 12px; border-top: 1px solid var(--border); font-size: 0.84rem; }
.imp-opts label { display: inline-flex; align-items: center; gap: 6px; }
.imp-opts .imp-clear { margin-left: auto; }
/* R4 — розкривні клуби + чекбокси атлетів */
.imp-badge { font-size: 0.7rem; background: #fef3c7; color: #78350f; padding: 1px 7px; border-radius: 6px; vertical-align: middle; }
.imp-clubs { margin-top: 12px; max-height: 42vh; overflow-y: auto; }
.imp-club-d { border: 0.5px solid var(--border); border-radius: 8px; margin-bottom: 6px; overflow: hidden; }
.imp-club-d[open] { border-color: var(--muted); }
.imp-club-d > summary { list-style: none; cursor: pointer; padding: 9px 11px; display: flex; align-items: center; gap: 9px; }
.imp-club-d > summary::-webkit-details-marker { display: none; }
.imp-club-d > summary:hover { background: var(--bg); }
.imp-chev { color: var(--muted); font-size: 0.8rem; width: 12px; text-align: center; transition: transform .15s ease; }
.imp-club-d[open] .imp-chev { transform: rotate(90deg); }
.imp-club-sum { display: inline-flex; align-items: center; gap: 8px; font-size: 0.84rem; }
.imp-club-meta { margin-left: auto; font-size: 0.8rem; white-space: nowrap; }
.imp-ath-list { padding: 2px 10px 8px 30px; display: flex; flex-direction: column; gap: 2px; }
.imp-ath { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; padding: 2px 0; cursor: pointer; }
.imp-ath > span:first-of-type { flex: 1; }
.imp-ath-off { opacity: 0.5; }
.imp-master-row { margin-top: 12px; padding: 8px 12px; background: var(--bg); border-radius: 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.imp-master { display: inline-flex; align-items: center; gap: 8px; font-size: 0.86rem; cursor: pointer; }
.imp-toolbar { display: flex; gap: 8px; margin-top: 8px; }
.imp-tbtn { height: auto; padding: 5px 11px; font: inherit; font-size: 0.78rem; font-weight: 400;
  background: var(--card); color: var(--text); border: 0.5px solid var(--border); border-radius: 6px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: none; }
.imp-tbtn:hover { background: var(--bg); transform: none; }
.imp-clubs { margin-top: 8px; }

/* ---- Кабінет клуба: модалка «Створити акаунт» (2.2) ---- */
.ca-intro { font-size: .9rem; color: var(--muted); margin-bottom: 12px; }
.ca-msg { padding: 9px 12px; border-radius: 8px; font-size: .85rem; margin-bottom: 12px; }
.ca-msg--err  { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.ca-msg--warn { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.ca-ok { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 8px; }
.ca-ok i { color: var(--g); }
.ca-stats { font-size: .85rem; color: var(--muted); }
/* 8.131: «Новий акаунт» / «Вже маю акаунт»; скидання загальних стилів кнопок модалки — як .imp-tbtn */
.ca-tabs { display: flex; gap: 4px; background: var(--bg); border-radius: 9px; padding: 4px; margin-bottom: 14px; }
.ca-tabs[hidden] { display: none; }
.ca-tabs button { flex: 1; height: auto; border: 0; background: none; padding: 8px; border-radius: 6px;
  font: inherit; font-size: .88rem; font-weight: 600; color: var(--muted); cursor: pointer; transition: none; }
.ca-tabs button:hover { background: none; transform: none; }
.ca-tabs button.on, .ca-tabs button.on:hover { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.ca-alt { height: auto; padding: 0; border: 0; background: none; font: inherit; font-size: .85rem;
  color: var(--p); text-decoration: underline; cursor: pointer; transition: none; }
.ca-alt:hover { background: none; transform: none; }

/* ---- «Обрати з клубу» (8.133, includes/dialog_club_base.php) ---- */
.cb-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.cb-filters select, .cb-filters input { flex: 1 1 140px; min-width: 0; height: auto; padding: 8px 10px;
  border: 1.5px solid var(--border); border-radius: 8px; font: inherit; font-size: .9rem; background: #fff; }
#cbAddBtn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.cb-agefilter { display: flex; align-items: center; gap: 8px; font-size: .88rem; margin-bottom: 10px; cursor: pointer; }
.cb-agefilter input { width: 16px; height: 16px; margin: 0; flex: none; }
.cb-list { max-height: 340px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.cb-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin: 0;
  border-bottom: 1px solid var(--border); cursor: pointer; font-size: .9rem; font-weight: 400; }
.cb-row:last-child { border-bottom: 0; }
.cb-row:hover { background: var(--bg); }
.cb-row input { width: 17px; height: 17px; margin: 0; flex: none; }
.cb-row small { color: var(--muted); white-space: nowrap; }
.cb-row--in { opacity: .6; cursor: default; }
.cb-name { flex: 1; min-width: 0; }
.cb-badge { font-size: .75rem; font-weight: 600; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.cb-badge--ok   { background: #dcfce7; color: #15803d; }
.cb-badge--miss { background: #fef2f2; color: #dc2626; }
.cb-badge--in   { background: var(--bg); color: var(--muted); }
.cb-empty { text-align: center; color: var(--muted); padding: 20px; margin: 0; font-size: .9rem; }
.cb-hint { font-size: .8rem; color: var(--muted); margin: 10px 0 0; }
