/* SkiSport - alpine theme for the public pages.
 *
 * The colours live in palette.css, which base.html links just before this
 * file and the admin links too; the schedule, the cards and the protocols all
 * draw from those same few variables. Loading this stylesheet without
 * palette.css leaves every var() unresolved, so the two always ship together.
 */

* { box-sizing: border-box; }

/* Filtering hides rows with the `hidden` attribute, and .sched-row/.filters
   set display themselves - an author `display:` beats the UA rule for
   [hidden], so without this every "hidden" row stays on screen. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  /* Keeps the dark footer at the bottom of the window on short pages (the
     login form, an empty schedule) instead of leaving it floating mid-screen. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------------------------------------------------------------- header */

header.site {
  position: relative;
  background:
    radial-gradient(900px 300px at 78% -40%, rgba(120, 190, 255, .38), transparent 70%),
    linear-gradient(135deg, var(--night), var(--night-2) 55%, var(--accent));
  color: #fff;
  padding: 16px 20px 26px;
}
/* Snow ridge biting into the bottom of the header. Drawn in the page
   background colour so the header looks like sky behind peaks. */
header.site::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 26px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 60' preserveAspectRatio='none'%3E%3Cpath fill='%23eef4fa' d='M0 60V46L100 30L180 46L280 22L380 44L480 26L580 48L680 28L780 46L880 24L980 44L1080 30L1200 44V60Z'/%3E%3C/svg%3E") bottom/100% 100% no-repeat;
  pointer-events: none;
}
header.site a { color: #fff; text-decoration: none; }
.bar { max-width: 1120px; margin: 0 auto; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
/* Знак крупнее слова: в шапке высотой 80px марка 26px читалась мельче
   всего, что под ней (заголовок страницы 28px, заголовок героя 34px), а
   свободного места по бокам с запасом. Выше поднимать не стоит — шапка
   тут фон, спорить с заголовком ей нечем. */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 23px; letter-spacing: .4px; }
.brand svg { display: block; }
/* Меню — своей строкой под маркой и поиском. flex-basis: 100% заставляет его
   перенестись целиком, а не растечься остатком первой строки, а flex-end
   равняет пункты по правому краю — под поиском, а не под логотипом. */
.bar nav {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  flex-basis: 100%; justify-content: flex-end;
}
.bar nav a, .bar nav button {
  padding: 7px 12px; border-radius: 8px; opacity: .92; font: inherit;
}
.bar nav a:hover, .bar nav button:hover { background: rgba(255, 255, 255, .16); opacity: 1; }
.bar nav button { background: none; border: none; color: #fff; cursor: pointer; }

/* Кнопка меню для телефона. В разметке она hidden, показывает её nav.js —
   без скрипта меню и так открыто, а кнопка, которая ничего не делает, хуже
   отсутствующей. На широком экране скрыта совсем. */
.navtoggle {
  display: none;
  position: relative;
  margin-left: auto;
  /* 44x44 - палец, а не курсор: меньше этого по нему промахиваются. */
  min-width: 44px; min-height: 44px;
  align-items: center; justify-content: center;
  padding: 0 11px;
  border: 0; border-radius: 10px;
  background: rgba(255, 255, 255, .14);
  color: #fff; cursor: pointer;
}
.navtoggle:hover { background: rgba(255, 255, 255, .24); }
.navtoggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.navtoggle__bars { display: block; width: 22px; height: 16px; position: relative; }
.navtoggle__bars i {
  position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px;
  background: currentColor;
  transition: transform .28s cubic-bezier(.2, .8, .3, 1), opacity .18s linear;
}
.navtoggle__bars i:nth-child(1) { top: 0; }
.navtoggle__bars i:nth-child(2) { top: 7px; }
.navtoggle__bars i:nth-child(3) { top: 14px; }
/* Три полоски складываются в крестик — то же движение, что и у самого меню. */
.navtoggle[aria-expanded="true"] .navtoggle__bars i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navtoggle[aria-expanded="true"] .navtoggle__bars i:nth-child(2) { opacity: 0; }
.navtoggle[aria-expanded="true"] .navtoggle__bars i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.navtoggle__badge { position: absolute; top: -5px; right: -5px; }

/* ------------------------------------------------- выпадающая группа в шапке

   Три страницы про сам комплекс под одной кнопкой. Панель полупрозрачная и с
   размытием подложки — не ради моды: шапка стоит поверх обложки страницы, и
   непрозрачная плашка над ней выглядит заплаткой, а размытая читается как
   стекло поверх той же картинки. Там, где backdrop-filter не поддерживается
   (старые Firefox), @supports ниже возвращает плотный фон: полупрозрачность
   без размытия — это нечитаемый текст на пёстром, а не «чуть хуже».

   Раскрывается тремя способами, и все три нужны разным устройствам:
   наведение — мышь, :focus-within — клавиатура без скриптов,
   [data-open] — касание, которое ставит nav.js. Первые два выключаются, как
   только скрипт объявил себя ([data-enhanced]): иначе нажатие на кнопку под
   курсором закрывало бы панель и тут же открывало её обратно наведением. */

.menu { position: relative; }
.menu__button {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 8px;
  font: inherit; color: inherit;
  background: none; border: 0; cursor: pointer;
  opacity: .92;
}
.menu__button:hover { background: rgba(255, 255, 255, .16); opacity: 1; }
.menu__button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.menu__chev { transition: transform .22s cubic-bezier(.2, .8, .3, 1); }

.menu__panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 45;
  min-width: 272px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(9, 32, 56, .72);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 20px 44px rgba(6, 22, 40, .45);
  /* Закрытое состояние. Двигаем transform и opacity — они не трогают
     раскладку; visibility переключается в конце перехода, чтобы закрытая
     панель не перехватывала нажатия и не ловила фокус табом. */
  transform-origin: top right;
  transform: translateY(-8px) scale(.97);
  opacity: 0;
  visibility: hidden;
  transition:
    transform .22s cubic-bezier(.2, .8, .3, 1),
    opacity .16s ease,
    visibility 0s linear .22s;
}
/* Мостик между кнопкой и панелью: без него курсор, идущий вниз, пересекает
   десять пустых пикселей, панель закрывается на полпути, и попасть в неё
   можно только по диагонали через кнопку. */
.menu__panel::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -12px; height: 12px;
}
.menu:not([data-enhanced]):hover .menu__panel,
.menu:not([data-enhanced]):focus-within .menu__panel,
.menu[data-open="true"] .menu__panel {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
  transition:
    transform .22s cubic-bezier(.2, .8, .3, 1),
    opacity .16s ease,
    visibility 0s;
}
.menu:not([data-enhanced]):hover .menu__chev,
.menu:not([data-enhanced]):focus-within .menu__chev,
.menu[data-open="true"] .menu__chev { transform: rotate(180deg); }

.bar nav .menu__panel a {
  display: block;
  padding: 9px 12px;
  border-radius: 9px;
  line-height: 1.3;
  opacity: 1;
}
.bar nav .menu__panel a span {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .66);
}
.bar nav .menu__panel a:hover { background: rgba(255, 255, 255, .14); }
.bar nav .menu__panel a:hover span { color: rgba(255, 255, 255, .82); }
/* Заголовок группы нужен только там, где панель разворачивается в столбец
   меню и теряет кнопку, — то есть на телефоне. */
.menu__label { display: none; }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .menu__panel { background: #0b2138; }
}

/* ------------------------------------------------- полоса «идёт сейчас» */

/* Единственное место на публичной части сайта, где что-то мигает. Право на это
   у неё есть ровно потому, что она недолговечна: полоса живёт, пока приезжают
   времена, и исчезает сама через четверть часа тишины. Мигающий элемент,
   висящий всегда, — это баннер. */
.live {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 18px;
  padding: 12px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(214, 50, 61, .10), rgba(11, 111, 184, .10));
  border: 1px solid rgba(214, 50, 61, .28);
}
.live__dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--gate-red);
  box-shadow: 0 0 0 0 rgba(214, 50, 61, .55);
  animation: live-pulse 2s ease-out infinite;
  flex: 0 0 auto;
}
@keyframes live-pulse {
  70% { box-shadow: 0 0 0 9px rgba(214, 50, 61, 0); }
  100% { box-shadow: 0 0 0 0 rgba(214, 50, 61, 0); }
}
.live__what { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.live__what strong { color: var(--gate-red); letter-spacing: .2px; }
.live__count, .live__last { color: var(--muted); font-size: 14px; }
/* Полоса хода дня — та же мысль, что и на экране в кафе: «30 из 35» это два
   числа, которые читатель вычитает в уме, а полоса отвечает сразу. Здесь она
   маленькая и стоит перед числами: страница результатов читается вблизи, и
   главное на ней — таблица, а не ход дня. */
.live__count { display: inline-flex; align-items: center; gap: 8px; }
.live__count b { color: var(--ink); font-weight: 700; }
.live__bar {
  display: inline-block; width: 84px; height: 6px; border-radius: 999px;
  background: rgba(148, 163, 184, .3); overflow: hidden; vertical-align: middle;
}
.live__bar i { display: block; height: 100%; background: var(--gate-red); }
.live__last { margin-left: auto; }

@media (max-width: 720px) {
  /* На телефоне «последним финишировал» — самое важное в этой полосе, и
     прижимать его вправо не к чему: строка всё равно своя. */
  .live__last { margin-left: 0; width: 100%; }
}

/* Подписка на календарь: строка под фильтрами графика. */
.subscribe { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 16px; }

/* ------------------------------------------------------------------- поиск */

/* Поле в шапке. Узкое намеренно: это не главный элемент страницы, а способ
   не уходить с неё за ответом. Расширяется, когда в него встали, — так оно
   не занимает места, пока не нужно. */
/* Поиск живёт на строке с маркой и прижат к правому краю. Верхняя строка
   делится на две половины — логотип слева, поиск справа, — а меню уходит
   строкой ниже целиком (см. .bar nav ниже: flex-basis: 100%).

   Раньше поле стояло внутри меню и разрывало список ссылок надвое: слева
   пункты, справа пункты, а между ними ввод, который ни к тем, ни к другим не
   относится. */
/* Поиск — последним пунктом меню, а не отдельным углом: он не соседствует с
   разделами, он их заменяет. Прижимать его влево «auto» больше не нужно —
   всю строку меню прижимает justify-content. */
.find { display: flex; margin: 0; }

/* Кто вошёл — справа от марки. Имя ведёт в кабинет: спросив «я это я?»,
   человек чаще всего идёт именно туда. */
.whoami {
  margin: 0 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.whoami__name {
  display: block;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.15;
  color: rgba(255, 255, 255, .9);
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Роль — строкой ниже имени, мельче и курсивом: её читают краем глаза и
   только тогда, когда что-то идёт не так. Тем же цветом, но бледнее, чтобы
   она не спорила с именем за внимание. */
.whoami__role {
  display: block;
  font-size: 11px;
  font-style: italic;
  line-height: 1.15;
  color: rgba(255, 255, 255, .62);
}
.whoami__name:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.whoami form { display: flex; }
/* Кнопка-пиктограмма: площадь для пальца есть, рамки нет. */
.iconbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: rgba(255, 255, 255, .82);
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.iconbtn:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.iconbtn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Домик вместо слова «Соревнования»: тот же размер площадки, что у кнопки
   выхода, чтобы строка меню не съезжала по высоте. */
.bar nav a.nav-home {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
}
.bar .find input {
  width: 132px;
  padding: 7px 12px;
  font: inherit;
  color: #fff;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  transition: width .22s cubic-bezier(.2, .8, .3, 1), background .18s ease;
}
.bar .find input::placeholder { color: rgba(255, 255, 255, .62); }
.bar .find input:focus {
  width: 200px;
  background: rgba(255, 255, 255, .22);
  outline: 2px solid #fff;
  outline-offset: 1px;
}
/* Крестик очистки в Safari и Chrome рисуется чёрным поверх тёмного фона —
   виден как клякса. Убираем: очищается тем же способом, что и любое поле. */
.bar .find input::-webkit-search-cancel-button { display: none; }

/* На странице поиска поле уже не украшение, а инструмент — во всю ширину. */
.find--page { gap: 10px; margin-bottom: 20px; }
.find--page input {
  flex: 1 1 auto;
  padding: 11px 14px;
  font: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.find--page input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.found { list-style: none; padding: 0; margin: 0; }
.found li { padding: 10px 0; border-top: 1px solid var(--line); }
.found li:first-child { border-top: 0; }
.found .meta { display: block; margin-top: 2px; }

main { max-width: 1120px; width: 100%; margin: 26px auto 64px; padding: 0 20px; flex: 1 0 auto; }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -.2px; }
h2 { font-size: 21px; margin: 34px 0 12px; letter-spacing: -.2px; }
.sub { color: var(--muted); margin: 0 0 22px; }

/* День в расписании многодневного старта. Заголовок над таблицей, а не строка
   в ней: тренеру нужно найти глазами свой день, а не прочитать все. */
.day {
  font-size: 15px;
  font-weight: 600;
  margin: 22px 0 8px;
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

/* ------------------------------------------------------------------ hero */

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  margin-bottom: 26px;
  padding: 34px 30px 120px;
  color: #fff;
  background:
    radial-gradient(700px 260px at 15% 0%, rgba(140, 205, 255, .35), transparent 70%),
    linear-gradient(160deg, var(--night), #16456f 60%, #1c5f93);
  box-shadow: var(--shadow);
}
.hero__inner { position: relative; z-index: 2; max-width: 720px; }
.hero h1 { font-size: 34px; margin: 0 0 10px; }
.hero__lead { color: #cfe4f7; margin: 0 0 22px; font-size: 17px; max-width: 560px; }
.hero__cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }

/* Layered ridges + falling snow, both purely decorative. */
.hero__peaks { position: absolute; left: 0; right: 0; bottom: -1px; z-index: 1; pointer-events: none; }
.hero__peaks svg { display: block; width: 100%; height: 190px; }
.hero__snow {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .75;
  background-image:
    radial-gradient(2.2px 2.2px at 18% 12%, #fff, transparent),
    radial-gradient(1.6px 1.6px at 64% 28%, rgba(255,255,255,.9), transparent),
    radial-gradient(2px 2px at 84% 8%, rgba(255,255,255,.8), transparent),
    radial-gradient(1.4px 1.4px at 36% 62%, rgba(255,255,255,.75), transparent),
    radial-gradient(1.8px 1.8px at 92% 48%, rgba(255,255,255,.7), transparent);
  background-size: 320px 320px, 260px 260px, 400px 400px, 220px 220px, 300px 300px;
  animation: snowfall 26s linear infinite;
}
@keyframes snowfall {
  to {
    background-position: 40px 320px, -30px 260px, 25px 400px, -20px 220px, 15px 300px;
  }
}

.stats { display: flex; gap: 26px; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.stat { min-width: 92px; }
.stat b { display: block; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat span { color: #a9c9e4; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; }

/* countdown to the next start - the numbers tick in JS */
.countdown { margin: 4px 0 0; }
.cd-units { display: flex; gap: 8px; flex-wrap: wrap; }
.cd-unit {
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 10px;
  padding: 8px 12px;
  min-width: 62px;
  text-align: center;
  backdrop-filter: blur(2px);
}
.cd-unit b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.cd-unit span { font-size: 11px; color: #a9c9e4; text-transform: uppercase; letter-spacing: .5px; }
.hero__next { margin: 26px 0 0; }
.hero__next .meta { color: #a9c9e4; }
.hero__next a { color: #fff; }

/* -------------------------------------------------------------- controls */

.btn {
  display: inline-block; padding: 10px 18px; border-radius: 10px;
  background: var(--accent); color: #fff; text-decoration: none;
  border: none; font: inherit; cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.btn:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn.ghost:hover { background: var(--ice); }
.hero .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .5); }
.hero .btn.ghost:hover { background: rgba(255, 255, 255, .14); }

.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; white-space: nowrap; }
.tag.open { background: #d9f5e6; color: var(--ok); }
.tag.closed { background: #e5ecf3; color: var(--muted); }
.tag.live { background: #ffe6e6; color: var(--gate-red); font-weight: 600; }
/* Ярлычок-ссылка на экран для зрителей: тот же вид, что у метки «идёт», но
   на него нажимают — значит, он обязан выглядеть нажимаемым. */
a.tag.screen-link {
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  vertical-align: middle; margin-left: 10px; font-size: 14px;
}
a.tag.screen-link:hover { background: var(--gate-red); color: #fff; }
a.tag.screen-link:hover .live__dot { background: #fff; }
.tag.done { background: #e5ecf3; color: var(--muted); }

/* Discipline badge, coloured the way gates are on a slope. */
.disc {
  display: inline-block; min-width: 34px; text-align: center;
  padding: 3px 8px; border-radius: 7px;
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
  background: var(--ice); color: var(--accent-dark);
}
.disc--SL { background: #fde4e6; color: #a51b25; }
.disc--GS { background: #dce9fd; color: #10499b; }
.disc--SG { background: #d8f1ee; color: #0d6259; }
.disc--DH { background: #e6e2fb; color: #40308f; }
.disc--AC { background: #fbeed8; color: #8a5a08; }
.disc--PAR { background: #e9e9ee; color: #3c4351; }

/* --------------------------------------------------------- season strip */

.season-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.season-head h2 { margin-bottom: 0; }
.season-pick { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.season-pick a {
  padding: 5px 12px; border-radius: 999px; text-decoration: none;
  border: 1px solid var(--line); color: var(--muted); background: var(--panel); font-size: 14px;
}
.season-pick a.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.strip { padding: 26px 26px 16px; }
.strip__rail {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ice), #c9defa);
  margin: 34px 0 30px;
}
.strip__dot {
  position: absolute; top: 50%;
  width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border-radius: 50%;
  border: 3px solid var(--panel);
  background: var(--accent);
  box-shadow: 0 1px 4px rgba(10, 37, 64, .3);
  cursor: pointer;
  transition: transform .15s ease;
}
.strip__dot:hover, .strip__dot:focus-visible { transform: scale(1.35); outline: none; }
.strip__dot--past { background: #9fb3c8; }
.strip__dot--live { background: var(--gate-red); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(214, 50, 61, .5); }
  50% { box-shadow: 0 0 0 9px rgba(214, 50, 61, 0); }
}
.strip__tip {
  position: absolute; bottom: 22px; transform: translateX(-50%);
  background: var(--night); color: #fff; font-size: 13px;
  padding: 7px 11px; border-radius: 9px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .12s ease;
  z-index: 3;
}
.strip__tip.on { opacity: 1; }
.strip__ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------- filtering */

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0 0 6px; }
.chip {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 14px; cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.filters input[type=search] {
  flex: 1 1 220px; min-width: 180px;
  padding: 8px 13px; font: inherit; font-size: 15px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink);
}
.filters input[type=search]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.filter-note { color: var(--muted); font-size: 14px; margin: 10px 2px 0; }

/* -------------------------------------------------------------- schedule */

.month { margin-top: 22px; }
.month__head {
  display: flex; align-items: center; gap: 12px;
  font-weight: 700; text-transform: capitalize; color: var(--night);
  margin-bottom: 10px;
}
.month__head::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.sched-row {
  display: grid;
  grid-template-columns: 66px 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 8px;
  scroll-margin-top: 20px;
  transition: box-shadow .15s ease, transform .15s ease;
}
.sched-row:hover { box-shadow: var(--shadow); transform: translateX(2px); }
.sched-row--past { border-left-color: #a9bccf; opacity: .8; }
.sched-row--live { border-left-color: var(--gate-red); }
.sched-row.flash { animation: flash 1.4s ease; }
@keyframes flash {
  0%, 60% { background: #fff8d8; }
  100% { background: var(--panel); }
}
.date-box {
  text-align: center; background: var(--ice); border-radius: 10px; padding: 6px 4px;
  line-height: 1.1;
}
.date-box b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; color: var(--night); }
.date-box span { font-size: 12px; color: var(--muted); text-transform: uppercase; }
.sched-row h3 { margin: 0 0 3px; font-size: 17px; }
.sched-row h3 a { color: var(--ink); text-decoration: none; }
.sched-row h3 a:hover { color: var(--accent); }
.sched-row .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sched-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.sched-actions .btn { padding: 8px 14px; font-size: 15px; }

/* ----------------------------------------------------------------- cards */

.card-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow);
  border-top: 3px solid var(--accent);
}
.card h3 { margin: 0 0 6px; font-size: 18px; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.meta { color: var(--muted); font-size: 14px; }

/* --------------------------------------------------------------- profile */

/* The athlete's own page: cover, portrait across its edge, name, numbers.
   Same shape as the profile pages the audience already uses every day, which
   is the point - nobody has to be taught where their photo goes. */
.profile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 26px;
}
.profile__cover {
  position: relative;
  height: 168px;
  background:
    radial-gradient(600px 220px at 20% 0%, rgba(140, 205, 255, .38), transparent 70%),
    linear-gradient(160deg, var(--night), #16456f 60%, #1c5f93);
}
.profile__peaks { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 96px; display: block; }

.profile__id {
  display: flex;
  gap: 22px;
  align-items: flex-end;
  padding: 0 26px 18px;
  /* Pull the whole row up so the portrait straddles the cover's edge. */
  margin-top: -62px;
  flex-wrap: wrap;
  /* The cover above is positioned (it holds the ridges), and a positioned box
     paints over in-flow content whatever the source order says. Without this
     the top half of the portrait disappears behind it. */
  position: relative;
  z-index: 1;
}
.profile__who { flex: 1 1 320px; padding-bottom: 2px; }
.profile__who h1 { margin: 0 0 8px; }
.profile__chips { display: flex; gap: 7px; flex-wrap: wrap; margin: 0 0 14px; }
.profile__actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 0; }

.chip-static {
  display: inline-block; padding: 4px 11px; border-radius: 999px;
  background: var(--ice); color: var(--accent-dark); font-size: 14px;
}
.chip-static--club { background: #d9f5e6; color: var(--ok); }
.chip-static--pending { background: #fef3c7; color: var(--warn); }

/* Круглая рамка - та же, что и в настольной программе (circular_pixmap). */
.avatar {
  border-radius: 50%;
  overflow: hidden;
  background: var(--ice);
  border: 4px solid var(--panel);
  box-shadow: var(--shadow);
  flex: none;
}
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar--xl { width: 148px; height: 148px; }
.avatar--md { width: 104px; height: 104px; }
/* Inside a table row: thin ring, no shadow - forty of them down a roster with
   the full treatment reads as a wall of stickers rather than a list. */
.avatar--row { width: 34px; height: 34px; border-width: 2px; box-shadow: none; }

/* The public athlete page: the same portrait as the cabinet, smaller and
   without the cover - one face per person across the site. */
.athlete-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 22px; }
.athlete-head h1 { margin: 0 0 6px; }
.athlete-head .sub { margin: 0; }
.name-cell { display: flex; align-items: center; gap: 10px; }

.avatar-block { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.avatar-form { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0; }
/* The file input itself is never shown: browsers render it differently
   everywhere and none of them look like this site's buttons. */
.avatar-pick input[type=file] {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.avatar-pick { cursor: pointer; }
.avatar-pick .btn { padding: 7px 14px; font-size: 14px; }
.avatar-pick input:focus-visible + .btn { outline: 2px solid var(--accent); outline-offset: 2px; }
.linkish {
  background: none; border: none; padding: 0; font: inherit; font-size: 13px;
  color: var(--muted); cursor: pointer; text-decoration: underline;
}
.linkish:hover { color: var(--gate-red); }

.profile__stats {
  display: flex; gap: 0; flex-wrap: wrap; margin: 0; padding: 0; list-style: none;
  border-top: 1px solid var(--line); background: #f7fbff;
}
.pstat { flex: 1 1 130px; padding: 14px 20px; border-inline-end: 1px solid var(--line); }
.pstat:last-child { border-inline-end: none; }
.pstat b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; color: var(--night); line-height: 1.2; }
.pstat span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

/* Медаль на подиуме — медалью, а не цветной пилюлей.
 *
 * Была «таблетка» с закруглением 999px: у однозначного числа ширина от
 * padding, высота от строки, и получался овал — на месте, которое ребёнок
 * показывает родителям. Теперь круг фиксированного размера с ободком, бликом
 * и ленточкой.
 *
 * Ленточка рисуется двумя псевдоэлементами с z-index: -1 — они уходят за
 * фон самого кружка, поэтому видно только то, что торчит сверху. Никаких
 * картинок: страница результатов открывается на склоне.
 */
.medal {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-top: 9px;              /* место ленточке над кружком */
  border-radius: 50%;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  color: #5a4008;
  background: radial-gradient(circle at 34% 30%, #ffeaa8 0%, #ffd76e 45%, #e3ab2c 100%);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, .5),   /* внутренний ободок, блик */
    0 0 0 2px #cf9b23,                          /* внешний ободок */
    0 1px 2px rgba(10, 37, 64, .25);
}
.medal::before, .medal::after {
  content: "";
  position: absolute;
  top: -11px;
  width: 8px;
  height: 15px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--gate-blue), #17579f);
  z-index: -1;
}
.medal::before { left: 3px; transform: rotate(16deg); }
.medal::after { right: 3px; transform: rotate(-16deg); }

.medal--2 {
  color: #35424f;
  background: radial-gradient(circle at 34% 30%, #f4f8fc 0%, #dbe3ea 45%, #a9b8c6 100%);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, .6),
    0 0 0 2px #94a5b5,
    0 1px 2px rgba(10, 37, 64, .25);
}
.medal--3 {
  color: #5d3a19;
  background: radial-gradient(circle at 34% 30%, #ffe0c2 0%, #f0cba8 45%, #c98c53 100%);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, .5),
    0 0 0 2px #b57a45,
    0 1px 2px rgba(10, 37, 64, .25);
}
/* Лента у серебра и бронзы другого цвета — иначе три медали различаются только
   оттенком металла, а он на телефоне под солнцем почти не читается. */
.medal--2::before, .medal--2::after {
  background: linear-gradient(180deg, #8b96a3, #5d6874);
}
.medal--3::before, .medal--3::after {
  background: linear-gradient(180deg, var(--gate-red), #9c2029);
}

.tag.entry-accepted { background: #d9f5e6; color: var(--ok); }
.tag.entry-pending { background: #fef3c7; color: var(--warn); }
.tag.entry-rejected, .tag.entry-withdrawn { background: #e5ecf3; color: var(--muted); }

/* ------------------------------------------------------------ crop dialog */

.crop {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  background: rgba(10, 37, 64, .55);
}
body.crop-open { overflow: hidden; }
.crop__box {
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 22px 18px; max-width: 380px; width: 100%;
}
.crop__box h2 { margin: 0 0 6px; font-size: 20px; }
.crop__box .meta { margin: 0 0 14px; }
.crop__stage { position: relative; width: 300px; max-width: 100%; margin: 0 auto; }
/* Round, and the corners simply gone - the desktop paints them over in white
   on a white dialog, which comes to the same thing. What is inside the circle
   is exactly what gets saved. */
.crop__canvas {
  display: block; width: 100%; max-width: 100%; border-radius: 50%;
  touch-action: none; cursor: grab;
}
.crop__canvas:active { cursor: grabbing; }
.crop__ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid var(--line); pointer-events: none;
}
.crop__zoom { display: block; margin: 18px 0 4px; font-size: 14px; color: var(--muted); }
.crop__zoom input { display: block; width: 100%; margin-top: 6px; accent-color: var(--accent); }
.crop__buttons { display: flex; gap: 10px; margin-top: 14px; }

/* ---------------------------------------------------------------- tables */

/* Wide protocols scroll inside their own box; the page itself never scrolls
   sideways on a phone. */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { padding: 9px 11px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--ice); font-weight: 600; color: var(--night); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:hover td { background: #f6faff; }

/* Отставание от лидера — второй строкой под временем, приглушённо. Само по
   себе время мало что говорит: соревнование читают по разрыву. Отдельным
   столбцом на каждый заезд не сделать — их и так восемь, и таблица на
   телефоне уже прокручивается вбок. */
.gap {
  display: block;
  font-size: 12px; line-height: 1.4;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
/* Проигранное время — приглушённым красным. Цвет здесь работает как знак
   «медленнее», поэтому опережение им красить нельзя: у участника вне зачёта,
   прошедшего быстрее зачётного лидера, разрыв отрицательный, и красный сказал
   бы про него ровно обратное. */
.gap--behind { color: var(--behind); }
/* Запасное значение у var() — не перестраховка, а урок.
 *
 * Переменная объявлена в palette.css, а используется здесь: два файла, и
 * браузер кэширует их по отдельности. Стоит палитре оказаться вчерашней, как
 * var(--best) становится неизвестной, свойство отбрасывается целиком, а цвет
 * наследуется от страницы — то есть лучшее время дня печатается чёрным. Ровно
 * это и случилось.
 *
 * На боевом сайте от этого спасают отпечатки в именах файлов (collectstatic
 * даёт palette.<hash>.css, и старое имя не может остаться), но у разработчика
 * их нет. Второй аргумент var() стоит одного слова и снимает вопрос везде. */
.gap--ahead { color: var(--best, #1a7f37); }
/* Лучшее время столбца — зелёным вместе со своим нулевым разрывом. Красится
   ячейка целиком, поэтому время и «+0.00» под ним читаются как одно
   утверждение: вот от чего считают все остальные. */
.gap--leader { color: var(--best, #1a7f37); }
.protocol td.best { color: var(--best, #1a7f37); font-weight: 700; }

/* Заголовок-кнопка: упорядочить по этому столбцу. Ставится скриптом, поэтому
   в разметке этих классов нет — см. protocol.js. Выглядит как сам заголовок:
   таблица не должна превращаться в панель кнопок ради одной возможности,
   которой пользуются раз в протокол. Подсказывает её пиктограмма и курсор. */
.protocol th .sort {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0; padding: 0; border: 0; background: none;
  font: inherit; color: inherit; cursor: pointer;
}
.protocol th .sort:hover { color: var(--accent); }
.protocol th .sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sort-mark { display: inline-flex; }
.sort-icon { display: block; }
/* Упорядоченный столбец подписан цветом заголовка целиком, а не одной
   стрелкой: колонок восемь, и одна стрелка среди них теряется. */
.protocol th[aria-sort="ascending"] .sort { color: var(--accent); }

/* --------------------------------------------- протокол на узком экране */

/* Фамилия остаётся на месте, пока таблицу тянут вбок к временам. Без этого
   на телефоне видно столбец цифр и ни одного имени: колонка со временем
   уезжает от фамилии на полтора экрана, и чей это результат — не понять.
   Место и номер уходят под фамилию: они короткие, а держать закреплёнными
   три столбца значит отдать полэкрана под то, ради чего не прокручивают. */
@media (max-width: 720px) {
  /* Боковые поля панели убираются, иначе в них видно то, что проезжает под
     закреплённой колонкой: содержимое прокручивается под padding, а
     закрепиться левее его края нельзя. Заодно узкому экрану достаются
     недостающие сорок точек ширины. */
  .protocol-box { padding-left: 0; padding-right: 0; }
  .protocol th.who, .protocol td.who {
    position: sticky; left: 0; z-index: 1;
    /* Непрозрачный фон обязателен: под ячейкой проезжает содержимое. */
    background: var(--panel);
    /* Шов вместо border: рамка у sticky-ячейки уезжает вместе с прокруткой. */
    box-shadow: inset -1px 0 0 var(--line);
  }
  .protocol th.who { background: var(--ice); }
  .protocol tr:hover td.who { background: #f6faff; }
}

/* ----------------------------------------------------- ключи и адреса */

/* Токен и адрес публикации - значения, которые нужно скопировать целиком и
   ни разу не прочитать. В таблице им не место: ячейки везде nowrap (и это
   правильно - перенесённая фамилия в стартовом протоколе хуже полосы
   прокрутки), а адрес публикации - одна неразрывная строка символов на
   девяносто, так что строка таблицы от неё только уезжает вбок. Здесь
   переносится всё, и раздел помещается в экран, на котором его читают, -
   часто в телефон на парковке. */
.cred { border-top: 1px solid var(--line); padding: 14px 0; }
.cred:first-of-type { border-top: 0; padding-top: 4px; }
.cred:last-of-type { padding-bottom: 4px; }
.cred-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.cred-head .help { margin-top: 0; }
.cred-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; }
/* Общая ширина подписи - чтобы токен и адрес начинались на одной вертикали,
   а не съезжали друг относительно друга на длину слова. */
.cred-label { color: var(--muted); font-size: 14px; flex: 0 0 auto; min-width: 124px; }
/* min-width:0 - без него flex-элемент не сжимается ниже своего содержимого,
   и перенос внутри code не спасает: наружу уезжает сам блок. */
.token {
  flex: 1 1 260px; min-width: 0;
  padding: 4px 9px; border-radius: 8px;
  background: var(--ice); color: var(--night);
  font-size: 13px; line-height: 1.5;
  overflow-wrap: anywhere; word-break: break-all;
}
.cred .copy { flex: 0 0 auto; padding: 4px 12px; font-size: 13px; }

/* ----------------------------------------------------------------- forms */

form.stacked label { display: block; font-weight: 600; margin-bottom: 4px; }
form.stacked .field { margin-bottom: 16px; }
form.stacked input[type=text], form.stacked input[type=date],
form.stacked input[type=email], form.stacked input[type=password],
form.stacked input[type=number], form.stacked select, form.stacked textarea {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 16px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
form.stacked input:focus, form.stacked select:focus, form.stacked textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
/* Галочка. Разметки две: где-то флажок лежит рядом с подписью, где-то внутри
   неё (внутри — чтобы попадать по тексту, а не по пятнадцати пикселям). Обе
   должны давать одно и то же: флажок и подпись в строку, пояснение под ними.
   Простой flex по блоку это ломал на второй разметке — в строку вставали
   подпись и пояснение, то есть слова в столбик по одному слева и наезжающий
   на них серый текст справа. Перенос строк плюс пояснение во всю ширину
   разводят их правильно в обоих случаях. */
form.stacked .checkbox { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
form.stacked .checkbox > label { flex: 1 1 240px; display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
form.stacked .checkbox > .help, form.stacked .checkbox > .errors { flex: 1 0 100%; margin-top: 0; }
form.stacked .checkbox input { margin-top: 4px; flex: none; }
.help { color: var(--muted); font-size: 14px; margin-top: 4px; }
.errors { color: #b91c1c; font-size: 14px; margin-top: 4px; }
.msg { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; }
.msg.success { background: #d9f5e6; color: var(--ok); }
.msg.warning { background: #fef3c7; color: var(--warn); }
.msg.error { background: #fee2e2; color: #b91c1c; }

/* Полоса «вы сидите под чужой учётной записью».

   Единственное место на сайте с предупреждающим цветом во всю ширину — и это
   намеренно: она обязана мешать. Ошибка, от которой она защищает, тихая
   (администратор забыл, под кем вошёл, и принял чужой кабинет за свой), а
   тихие ошибки ловятся только тем, что видно не глядя.

   Не sticky: липкая полоса отъедает высоту у каждого экрана, а вспоминают о
   ней всё равно наверху страницы, где шапка. */
.acting {
  display: flex; flex-wrap: wrap; gap: 12px;
  align-items: center; justify-content: center;
  padding: 10px 20px;
  background: #fef3c7; color: var(--warn);
  border-bottom: 2px solid var(--warn);
  font-size: 15px;
}
.acting form { margin: 0; }
.acting button {
  font: inherit; cursor: pointer;
  padding: 6px 14px; border-radius: 8px;
  border: 1px solid var(--warn); background: var(--warn); color: #fff;
}
.acting button:hover { background: #92400e; border-color: #92400e; }

footer.site {
  position: relative;
  color: #b9cfe4; font-size: 14px; text-align: center;
  background: linear-gradient(160deg, var(--night), var(--night-2));
  padding: 46px 20px 26px;
  margin-top: 40px;
}
footer.site::before {
  content: "";
  position: absolute; left: 0; right: 0; top: -1px; height: 24px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 60' preserveAspectRatio='none'%3E%3Cpath fill='%23eef4fa' d='M0 0H1200V16L1080 34L980 14L880 32L780 12L680 34L580 16L480 36L380 14L280 32L180 12L80 30L0 14Z'/%3E%3C/svg%3E") top/100% 100% no-repeat;
}
footer.site a { color: #dbe9f7; }

@media (max-width: 720px) {
  main { padding: 0 14px; }
  h1 { font-size: 23px; }
  .hero { padding: 26px 20px 96px; border-radius: 16px; }
  .hero h1 { font-size: 26px; }
  .hero__peaks svg { height: 130px; }
  /* Two columns on a phone: the date keeps its own column, the actions drop
     to a line of their own. Top-aligned, or a two-line title pushes the date
     box down to the middle of the card. */
  .sched-row { grid-template-columns: 56px 1fr; align-items: start; }
  .sched-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .filters input[type=search] { flex: 1 1 100%; }
  .navtoggle { display: flex; }
  /* Выпадающее меню. Пока nav.js не выставил data-enhanced, это обычный
     список под шапкой — так страница выглядит без JavaScript. */
  /* В раскрытой панели пункты идут столбцом сверху вниз: равнение по правому
     краю там означало бы прижать их к низу. */
  .bar nav { justify-content: flex-start; }
  .bar nav[data-enhanced] {
    position: absolute;
    top: calc(100% - 20px);
    left: 12px; right: 12px;
    z-index: 40;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 0;
    padding: 8px;
    border-radius: 14px;
    /* Стекло, а не плашка: меню висит над обложкой страницы, и сквозь него
       видно, что под ним. Плотный фон — запасной вариант для браузеров без
       backdrop-filter (см. @supports ниже): полупрозрачность без размытия
       даёт нечитаемый текст на пёстром. */
    background: rgba(9, 32, 56, .82);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
    /* Светлый кант: под меню часто оказывается такая же тёмно-синяя обложка
       главной, и без него панель сливается с фоном. */
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: 0 18px 40px rgba(10, 37, 64, .45);
    /* Закрытое состояние: чуть приподнято, сжато и прозрачно. Анимируем
       transform и opacity, а не height — они не вызывают перерасчёт
       раскладки, и на телефоне это разница между «плавно» и «рывками».
       visibility в переходе, чтобы закрытое меню не ловило нажатия. */
    transform-origin: top right;
    transform: translateY(-10px) scale(.96);
    opacity: 0;
    visibility: hidden;
    transition:
      transform .26s cubic-bezier(.2, .8, .3, 1),
      opacity .2s ease,
      visibility 0s linear .26s;
  }
  .bar nav[data-enhanced][data-open="true"] {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
    transition:
      transform .26s cubic-bezier(.2, .8, .3, 1),
      opacity .2s ease,
      visibility 0s;
  }
  .bar nav[data-enhanced] a,
  .bar nav[data-enhanced] button {
    display: block; width: 100%;
    padding: 11px 14px; border-radius: 9px;
    text-align: left; font-size: 16px;
  }
  .bar nav[data-enhanced] form { display: block; }
  /* Поиск первой строкой в раскрытом меню и во всю его ширину: на телефоне
     это единственное поле ввода в шапке, и жать по нему пальцем в 132 пикселя
     неудобно. Порядок задаётся order, а не перестановкой в разметке, — там он
     стоит рядом с остальными пунктами, и без CSS список читается как список. */
  /* Поле сжимается между логотипом и кнопкой меню. 16px не про красоту: на
     меньшем шрифте Safari на айфоне подъезжает зумом к полю при фокусе и
     оставляет страницу увеличенной. */
  /* Основа 80px, а не auto: у поля поиска своя «естественная» ширина под
     двести пикселей, и с ней строка «марка + поиск + кнопка» не влезала в
     375 — поиск уезжал на второй ряд, а кнопка меню оставалась с ним. С
     маленькой основой поле занимает то, что осталось, и все трое стоят в
     одной строке. margin-left не нужен: место распределяет flex. */
  .bar .find { flex: 1 1 80px; min-width: 0; margin: 0; }
  .bar .find input { width: 100%; min-width: 0; font-size: 16px; }

  /* Группа разворачивается в тот же столбец: на телефоне выпадающее меню
     внутри выпадающего меню — это два касания там, где хватает одного, и
     промах пальцем между ними. Кнопка не нужна, панель перестаёт быть
     панелью — ни фона, ни тени, ни позиционирования. */
  /* Селектор длиннее, чем хочется, и это не педантизм: выше в этом же
     медиазапросе стоит `.bar nav[data-enhanced] button { display: block }` —
     оно превращает в строку меню любую кнопку внутри шапки, и короткое
     `.menu__button { display: none }` ему проигрывает по специфичности.
     Кнопка оставалась видимой над развёрнутым списком и делала вид, что
     что-то открывает. */
  .bar nav[data-enhanced] .menu__button { display: none; }
  .menu__panel {
    position: static;
    min-width: 0;
    padding: 0;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border: 0;
    box-shadow: none;
    transform: none;
    opacity: 1;
    visibility: visible;
    transition: none;
  }
  .menu__panel::before { content: none; }
  .menu__label {
    display: block;
    margin: 0;
    padding: 12px 14px 6px;
    font-size: 12px;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .5);
  }
  .bar nav[data-enhanced] .menu__panel > * + * { border-top: 1px solid rgba(255, 255, 255, .08); }
  .menu__panel > .menu__label + a { border-top: 0; }
  /* Пункты группы — со сдвигом и вертикальной чертой вдоль неё.
     
     Без этого они выглядели ровно как пункты верхнего уровня: подпись
     «О КОМПЛЕКСЕ SKISPORT» сообщала, где группа началась, и ничего не
     сообщала о том, где она кончилась, — «Регистрация» сразу под «Стартом
     под ключ» читалась как четвёртый пункт той же группы.
     
     Черта, а не только отступ: отступ в тёмном столбце виден плохо, а
     линия ограничивает группу с обоих концов сразу — она просто
     заканчивается. */
  .bar nav[data-enhanced] .menu__panel {
    margin-left: 14px;
    border-left: 2px solid rgba(255, 255, 255, .22);
  }
  .bar nav[data-enhanced] .menu__panel a,
  .bar nav[data-enhanced] .menu__label { padding-left: 18px; }
  /* Черта — на самой группе, а не на каждом пункте: на пунктах она рвалась
     о разделители между ними и читалась пунктиром. */
  .bar nav[data-enhanced] .menu__panel > * + * { border-top-color: rgba(255, 255, 255, .06); }
  /* Строка описания под пунктом на телефоне лишняя: там и так один пункт в
     строку, а высота списка вырастает в полтора раза. */
  .bar nav .menu__panel a span { display: none; }
  /* Тонкая линия между пунктами - список читается как список, а не как
     столбик слов. Перед первым пунктом её быть не должно. */
  .bar nav[data-enhanced] > * + * { border-top: 1px solid rgba(255, 255, 255, .08); }
  /* Пункты въезжают лесенкой — но только когда меню открывают. */
  .bar nav[data-enhanced][data-open="true"] > a,
  .bar nav[data-enhanced][data-open="true"] > form,
  .bar nav[data-enhanced][data-open="true"] > .menu {
    animation: nav-item .26s cubic-bezier(.2, .8, .3, 1) both;
  }
  .bar nav[data-enhanced][data-open="true"] > *:nth-child(1) { animation-delay: .02s; }
  .bar nav[data-enhanced][data-open="true"] > *:nth-child(2) { animation-delay: .05s; }
  .bar nav[data-enhanced][data-open="true"] > *:nth-child(3) { animation-delay: .08s; }
  .bar nav[data-enhanced][data-open="true"] > *:nth-child(4) { animation-delay: .11s; }
  .bar nav[data-enhanced][data-open="true"] > *:nth-child(5) { animation-delay: .14s; }
  .bar nav[data-enhanced][data-open="true"] > *:nth-child(6) { animation-delay: .17s; }
  .bar nav:not([data-enhanced]) { margin-left: 0; }
  /* A phone gets a shorter cover and a smaller portrait: at full size they
     between them fill the screen before the name appears. */
  .profile__cover { height: 116px; }
  .profile__peaks { height: 68px; }
  .profile__id { margin-top: -46px; padding: 0 16px 16px; gap: 14px; }
  .avatar--xl { width: 108px; height: 108px; }
  .pstat { padding: 12px 16px; }
  .pstat b { font-size: 21px; }
}

/* --- Страница человека, список переписок и сама переписка ------------- */

.chip-static--staff { background: #e7dcfb; color: #5b21b6; }
.chip-static--role { background: var(--ice); color: var(--accent-dark); }
.profile__about { margin: 0 0 10px; color: var(--muted); max-width: 60ch; }

/* Счётчик непрочитанного - и в шапке сайта, и в списке переписок. */
.badge {
  display: inline-block; min-width: 20px; padding: 1px 6px;
  border-radius: 999px; background: var(--gate-red); color: #fff;
  font-size: 12px; font-weight: 700; line-height: 18px; text-align: center;
}

.people { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.people__item { min-width: 220px; }

.threads { list-style: none; margin: 0; padding: 0; }
.threads__item + .threads__item { border-top: 1px solid var(--line); }
.threads__link {
  display: flex; align-items: center; gap: 12px; padding: 12px 4px;
  color: inherit; text-decoration: none;
}
.threads__link:hover { background: var(--bg); }
.threads__text { flex: 1 1 auto; min-width: 0; }
.threads__text b { display: block; }
/* Одна строка предпросмотра: длинное сообщение не должно ломать список. */
.threads__last {
  display: block; color: var(--muted); font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.threads__meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.threads__item--unread .threads__text b { font-weight: 700; }
.threads__item--unread .threads__last { color: var(--ink); }

.thread-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.thread-head h1 { margin: 0 0 4px; font-size: 24px; }
.thread-head h1 a { color: inherit; text-decoration: none; }
.thread-head .sub { margin: 0; }

/* Переписка растёт вниз, как в мессенджере: последнее сообщение - внизу. */
.chat { display: flex; flex-direction: column; gap: 10px; }
.bubble {
  max-width: min(560px, 82%); padding: 10px 14px; border-radius: 16px;
  background: var(--ice); align-self: flex-start;
}
.bubble--mine { background: var(--accent); color: #fff; align-self: flex-end; }
.bubble__body { margin: 0; overflow-wrap: anywhere; }
.bubble__meta { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.bubble--mine .bubble__meta { color: rgba(255, 255, 255, .75); }

.chat-form { display: flex; flex-direction: column; gap: 10px; }
.chat-form textarea { width: 100%; resize: vertical; }
.chat-form__row { display: flex; gap: 10px; flex-wrap: wrap; }

/* Ярлык, нужный только программе чтения с экрана. */
.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;
}

/* --- Аватары, согласия, юридические страницы -------------------------- */

.avatar-consent { font-size: 13px; color: var(--muted); max-width: 220px; text-align: center; }
.avatar-note { max-width: 220px; text-align: center; font-size: 13px; }
.avatar-choose { padding: 7px 14px; font-size: 14px; }

/* Без JavaScript это обычный блок на странице; скрипт делает из него диалог. */
.picker__box {
  background: var(--panel); border-radius: 14px; box-shadow: var(--shadow);
  padding: 20px; max-width: 560px; margin: 18px auto 0;
}
.picker--dialog {
  position: fixed; inset: 0; z-index: 30; display: flex;
  align-items: center; justify-content: center; padding: 16px;
  background: rgba(10, 37, 64, .45); overflow: auto;
}
.picker--dialog .picker__box { margin: auto; }
.picker__box h2 { margin-top: 0; }
.picker__grid {
  list-style: none; margin: 16px 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 12px;
}
.picker__item { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; font-size: 13px; }
.picker__item img { border-radius: 50%; border: 3px solid transparent; background: var(--ice); }
.picker__item input { position: absolute; opacity: 0; pointer-events: none; }
.picker__item input:checked + img { border-color: var(--accent); }
.picker__item input:focus-visible + img { outline: 2px solid var(--accent); outline-offset: 2px; }
.picker__buttons { display: flex; gap: 10px; flex-wrap: wrap; }

.prose h2 { margin-top: 22px; font-size: 18px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { max-width: 72ch; }
.prose ul { padding-left: 20px; }

.consent { margin-bottom: 16px; }
.consent h2 { margin-top: 0; font-size: 18px; }
.consent__state { font-weight: 600; }
.consent__state--yes { color: var(--ok); }

.site__legal { display: block; margin-top: 8px; font-size: 13px; }
.site__legal a { color: inherit; margin-right: 14px; }

/* Блок согласия в форме: текст рядом с галочкой, а не подпись мелким шрифтом. */
.consent-box { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--bg); }
.consent-box label { display: block; font-weight: 600; }
.consent-box .meta { margin: 8px 0 0; }
/* То же для форм вне form.stacked (согласия, кабинеты). */
.field.checkbox { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.field.checkbox > label { flex: 1 1 240px; display: flex; gap: 8px; align-items: flex-start; }
.field.checkbox > .help, .field.checkbox > .errors { flex: 1 0 100%; margin-top: 0; }
.field.checkbox input { flex: none; margin-top: 3px; }

/* Код привязки: поле, а не абзац. Его переписывают с экрана на экран. */
.codebox { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; }
.codebox__value {
  flex: 1 1 auto; min-width: 0;
  font-size: 22px; font-weight: 700; letter-spacing: .18em; text-align: center;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink);
}
.codebox__copy { white-space: nowrap; }

/* Поле посева в таблице заявки: узкое, чтобы не растягивать строку. */
.seedbox { width: 72px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; text-align: center; }

@keyframes nav-item {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__snow, .strip__dot--live { animation: none; }
  .btn:hover, .sched-row:hover { transform: none; }
  .sched-row.flash { animation: none; background: #fff8d8; }
  /* Меню всё равно должно открываться и закрываться - убираем движение, а не
     переход: без transition на visibility закрытое меню осталось бы кликабельным. */
  .bar nav[data-enhanced] { transform: none; transition: opacity .01s linear, visibility 0s linear .01s; }
  .bar nav[data-enhanced][data-open="true"] { transform: none; transition: opacity .01s linear, visibility 0s; }
  .bar nav[data-enhanced][data-open="true"] > a,
  .bar nav[data-enhanced][data-open="true"] > form,
  .bar nav[data-enhanced][data-open="true"] > .menu { animation: none; }
  .navtoggle__bars i { transition: none; }
  /* Точка перестаёт пульсировать, но остаётся точкой: цвет и место говорят
     то же самое, что и движение. */
  .live__dot { animation: none; }
  /* Панель группы всё равно должна открываться и закрываться — убираем
     движение, а не переход: без него закрытая панель осталась бы кликабельной
     и ловила бы фокус табом. */
  .menu__panel {
    transform: none;
    transition: opacity .01s linear, visibility 0s linear .01s;
  }
  .menu:not([data-enhanced]):hover .menu__panel,
  .menu:not([data-enhanced]):focus-within .menu__panel,
  .menu[data-open="true"] .menu__panel {
    transform: none;
    transition: opacity .01s linear, visibility 0s;
  }
  .menu__chev { transition: none; }
}

/* Официальные протоколы на странице соревнования.
   Список, а не таблица: у документа два поля, и таблица из двух колонок на
   телефоне читается хуже строки. */
.docs { list-style: none; padding: 0; margin: 0; }
.docs li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.docs li:last-child { border-bottom: 0; }
.docs a { font-weight: 600; }
/* Скрепка перед названием: сразу видно, что ссылка ведёт в файл, а не на
   страницу сайта. */
.docs a::before { content: "📄 "; }

/* -- раздел «Комплекс» ----------------------------------------------------- */
/* Единственная страница сайта в рекламном тоне. Крупнее и просторнее
   остальных: её читают не за работой, а решая, стоит ли всё это внимания. */

.hero {
  background: linear-gradient(160deg, var(--night) 0%, var(--night-2) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 40px 28px;
  margin-bottom: 26px;
}
.hero__eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 13px;
  color: var(--ice);
}
.hero__title { margin: 0 0 14px; font-size: 34px; line-height: 1.15; }
.hero__lead { margin: 0; max-width: 62ch; font-size: 18px; color: #dbe8f6; }

.parts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}
.part {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.part h2 { margin: 16px 0 8px; font-size: 21px; }
.part p { margin: 0 0 12px; }
/* Рисунок держит свою высоту, чтобы три карточки не разъезжались по строке. */
.part__art { background: var(--bg); border-radius: 10px; padding: 8px; }
.part__art svg { display: block; width: 100%; height: auto; }

.ticks { list-style: none; padding: 0; margin: 0; }
.ticks li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 15px;
}
.ticks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--ok);
  font-weight: 700;
}

/* ---------------------------------------------- снимки экранов и путь старта */

/* Снимок в рамке. Тень и светлая подложка нужны не для украшения: скриншот
   светлого интерфейса на светлой странице без границы выглядит не картинкой, а
   куском самой страницы, и читатель не понимает, где кончается сайт и
   начинается изображение. */
.shot {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 10px;
  overflow: hidden;
}
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 7px;
}
.shot figcaption { color: var(--muted); font-size: 14px; margin-top: 10px; }

/* Рейтинг и телефон рядом: телефон уже, поэтому не растягивается на равную
   долю, а стоит своей шириной. */
.shot--pair { display: flex; gap: 12px; align-items: flex-start; }
.shot--pair img { flex: 1 1 auto; }
.shot--pair .shot__phone { flex: 0 0 150px; width: 150px; }

.path { margin-bottom: 26px; }
.path > h2 { font-size: 24px; margin: 0 0 6px; }
.path__lead { color: var(--muted); margin: 0 0 20px; }
.path__steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 22px; }
/* Текст слева, снимок справа — пока хватает ширины. На телефоне обе части
   встают в колонку сами (см. медиазапрос ниже), и порядок остаётся тем же:
   сначала объяснение, потом картинка. */
.path__step {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 1.6fr);
  gap: 20px;
  align-items: start;
}
.path__text h3 { margin: 0 0 8px; font-size: 18px; color: var(--accent-dark); }
.path__text p { margin: 0; }
/* Абзацы в шаге не слипаются: пока шаг был из одного абзаца, этого не было
   видно, а из трёх — читается сплошной простынёй. */
.path__text p + p { margin-top: 10px; }

/* Техническая страница: числа крупно, таблица полей пакета не жмётся. */
.tech > h2 { font-size: 24px; margin: 28px 0 10px; }
.tech > h2:first-child { margin-top: 0; }
.tech__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin: 16px 0;
}
.tech__cell {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.tech__cell h3 { margin: 0 0 8px; font-size: 17px; color: var(--accent-dark); }
.tech__cell p { margin: 0 0 8px; }
.tech__cell p:last-child { margin-bottom: 0; }
.tech__num { font-size: 26px; font-weight: 700; color: var(--ink); }
.tech__table { width: 100%; border-collapse: collapse; }
.tech__table code, .tech code { font-size: 14px; }
.tech__back { margin-top: 26px; }

@media (max-width: 760px) {
  .path__step { grid-template-columns: 1fr; }
  /* Телефонный снимок рядом с широким на узком экране превращается в
     невидимую полоску — лучше показать один. */
  .shot--pair { flex-direction: column; }
  .shot--pair .shot__phone { flex: 0 0 auto; width: 60%; align-self: center; }
}

.claim {
  background: var(--ice);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 26px;
}
.claim > h2 { margin: 0 0 16px; font-size: 24px; }
.claim__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.claim__cell {
  background: var(--panel);
  border-radius: 10px;
  padding: 18px;
}
.claim__cell h3 { margin: 0 0 8px; font-size: 18px; color: var(--accent-dark); }
.claim__cell p { margin: 0 0 10px; }
.claim__cell p:last-child { margin-bottom: 0; }

.numbers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}
.number {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}
.number strong {
  display: block;
  font-size: 26px;
  color: var(--accent-dark);
  font-variant-numeric: tabular-nums;
}
.number span { color: var(--muted); font-size: 14px; }

.closing h2 { margin-top: 0; }

@media (max-width: 640px) {
  .hero { padding: 28px 20px; }
  .hero__title { font-size: 26px; }
  .hero__lead { font-size: 16px; }
}

/* Раздел о персональных данных на странице «Комплекс».
   Тёмный, как шапка: это единственное место рекламной страницы, где обещание
   стоит денег в случае невыполнения, и выглядеть оно должно серьёзнее
   остального. */
.privacy {
  background: var(--night);
  color: #fff;
  border-radius: var(--radius);
  padding: 30px 26px;
  margin-bottom: 26px;
}
.privacy__head h2 { margin: 0 0 8px; font-size: 24px; }
.privacy__head p { margin: 0 0 20px; max-width: 62ch; color: #cfe0f2; }
.privacy__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.privacy__cell {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  padding: 18px;
}
.privacy__cell h3 { margin: 0 0 8px; font-size: 17px; color: var(--ice); }
.privacy__cell p { margin: 0 0 10px; color: #dbe8f6; font-size: 15px; }
.privacy__cell p:last-child { margin-bottom: 0; }
.privacy__note {
  margin: 20px 0 0;
  color: #9fbcd8;
  font-size: 14px;
  max-width: 78ch;
}

/* -- страница «под ключ» --------------------------------------------------- */
/* Расчёт и заявка — одна форма: человек не должен посчитать одно, а отправить
   другое. Поэтому отдельных стилей у калькулятора нет, он свёрстан теми же
   полями, что и заявка, а от него остался только вывод сметы. */

.calc__out {
  background: var(--ice);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
}
.calc__lines { list-style: none; padding: 0; margin: 0 0 10px; }
.calc__lines li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(10, 37, 64, .14);
  font-size: 15px;
}
.calc__lines li:last-child { border-bottom: 0; }
.calc__lines b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.calc__total { margin: 0; font-size: 20px; }
.calc__total strong { color: var(--accent-dark); font-variant-numeric: tabular-nums; }

/* Календарь занятости. Сетка семь на N, а не таблица: у ячейки нет заголовка
   строки, и таблица здесь дала бы разметку без смысла. */
.cal__grid { margin: 14px 0; }
.cal__head, .cal__week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 6px;
}
.cal__head span {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
.cal__day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.cal__day b { font-size: 15px; font-variant-numeric: tabular-nums; }
.cal__day i { font-style: normal; font-size: 11px; color: var(--muted); }
.cal__day.is-busy {
  background: var(--gate-red);
  border-color: var(--gate-red);
  color: #fff;
}
.cal__day.is-busy i { color: rgba(255, 255, 255, .8); }
.cal__day.is-past { opacity: .35; }
.cal__day.is-today { border-color: var(--accent); border-width: 2px; }

.cal__legend { display: flex; gap: 10px; flex-wrap: wrap; margin: 0; }
.chip {
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.chip--busy { background: var(--gate-red); border-color: var(--gate-red); color: #fff; }
.chip--today { border-color: var(--accent); border-width: 2px; }

/* Заявка на проведение. Поля разной ширины: дата и «дней» короткие по
   природе, место и организатор длинные, формат — самый длинный, потому что в
   нём фраза, а не слово. Одинаковые колонки обрезали бы именно его. */
.book__group {
  border: 0;
  border-top: 1px solid var(--line);
  padding: 16px 0 0;
  margin: 0 0 18px;
}
.book__group:first-of-type { border-top: 0; padding-top: 0; }
.book__group legend {
  padding: 0;
  font-weight: 700;
  font-size: 15px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.book__row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
}

.field { display: block; flex: 1 1 220px; min-width: 0; }
/* 160, а не 120: в 120 подпись «Грамот с печатью» ломается на две строки. */
.field--xs { flex: 0 1 160px; }
.field--sm { flex: 0 1 180px; }
.field--wide { flex: 2 1 320px; }
.field__label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.field__hint { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
/* Галочка сюда не входит: «во всю ширину, с рамкой и отступами» — это про
   поле ввода. Флажку от этого доставалось 635 пикселей ширины, подпись
   уезжала за край, а пояснение налезало на неё. */
.field input:not([type=checkbox]), .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-sizing: border-box;
}
.field textarea { min-height: 84px; resize: vertical; }
.field input[type=checkbox] { width: auto; flex: none; margin: 3px 0 0; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

/* Галочки: квадрат слева, подпись справа, вся строка кликабельна. Подпись
   сверху и одинокий квадрат снизу — это то, как их расставляет цикл по форме,
   и выглядит это как недоделанная таблица. */
.checks { list-style: none; padding: 0; margin: 12px 0 14px; }
.checks li { margin-bottom: 2px; }
.checks label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
  font-size: 15px;
}
.checks label:hover { border-color: var(--accent); }
.checks input { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.checks input:checked + span { font-weight: 600; }

.notice {
  background: var(--ice);
  border-left: 4px solid var(--ok);
  padding: 10px 14px;
  border-radius: 6px;
}

/* Что делает команда: нумерованные шаги по порядку дня. */
.crew__steps { list-style: none; counter-reset: step; padding: 0; margin: 14px 0; }
.crew__steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 14px 46px;
  border-left: 2px solid var(--line);
  margin-left: 14px;
}
.crew__steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
.crew__steps li::before {
  content: counter(step);
  position: absolute;
  left: -15px;
  top: -2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.crew__steps b { display: block; margin-bottom: 2px; }
.crew__steps span { color: var(--muted); font-size: 15px; }

/* Что можно взять сверх комплекта. Три коротких объяснения: чекбокс в
   калькуляторе говорит «сколько», а это — «зачем». */
.extras {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.extras__item {
  background: var(--bg);
  border-radius: 10px;
  padding: 14px;
}
.extras__item b { display: block; margin-bottom: 4px; }
.extras__item span { display: block; color: var(--muted); font-size: 14px; }
/* Оговорка мельче и отделена: она не отменяет сказанного выше, но и прятать её
   нельзя — на неё сошлются, если лента выцветет к маю. */
.extras__caveat {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 13px !important;
}

/* Снимок телефона в ряду со снимками экранов: он вчетверо уже, и во всю
   колонку выглядел бы плакатом. */
.shot--phone img { max-width: 300px; margin: 0 auto; display: block; }

/* Снимок, который можно рассмотреть.
 *
 * В колонке он шириной под шестьсот точек, а внутри — таблица протокола
 * мелким текстом: разглядеть нельзя, и человек открывал картинку через
 * контекстное меню. Щелчок показывает её целиком. */
.shot--zoomable { cursor: zoom-in; }
.shot--zoomable:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.shot-zoom {
  position: fixed; inset: 0; z-index: 60; display: none;
  align-items: center; justify-content: center;
  background: rgba(10, 37, 64, .92); padding: 24px;
  opacity: 0; transition: opacity .18s ease;
  cursor: zoom-out;
}
.shot-zoom.on { opacity: 1; }
.shot-zoom img {
  max-width: 100%; max-height: 100%; border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  transform: scale(.98); transition: transform .18s ease;
}
.shot-zoom.on img { transform: scale(1); }
.shot-zoom__close {
  position: absolute; top: 14px; right: 18px;
  background: transparent; border: 0; color: #fff;
  font-size: 34px; line-height: 1; cursor: pointer;
}
@media (prefers-reduced-motion: reduce) {
  .shot-zoom, .shot-zoom img { transition: none; }
}

/* Тренировки: период и дисциплина чипами, дни — раскрывающимися блоками. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip {
  display: inline-block; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--ink); text-decoration: none; font-size: 14px;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip--on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Карточки итогов разбора. Своим именем, а не общим .stat: тот живёт в тёмной
   шапке главной, где число белое, и подложка «как в панели» делала его белым
   по белому — цифры пропадали со страницы, на которую заходят ради них. */
.totals { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.totals__cell {
  flex: 1 1 120px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 14px;
}
.totals__cell b { display: block; font-size: 24px; line-height: 1.1; }
.totals__cell span { color: var(--muted); font-size: 13px; }

.notes ul { margin: 0; padding-left: 18px; }
.notes li { margin: 6px 0; line-height: 1.5; }

.day__head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px;
  width: 100%; text-align: left; background: none; border: 0; padding: 6px 0;
  cursor: pointer; font: inherit; color: inherit;
}
.day__date { font-weight: 700; }
.day__head::before {
  content: "▸"; color: var(--muted); transition: transform .15s ease;
}
.day__head[aria-expanded="true"]::before { transform: rotate(90deg); }

/* Полоса отставания растёт при появлении: столбец с числом читается как
   число, а полоса — как расстояние между людьми.

   --share приходит из строки таблицы: доля отставания у каждого своя.
   Значение по умолчанию стоит здесь, чтобы полоса не выросла во всю ширину,
   если разметка его не задала. */
.results .bar {
  --share: 0;
  display: inline-block; height: 8px; border-radius: 4px; vertical-align: middle;
  background: var(--accent); margin-right: 8px;
  width: 0; animation: bar-grow .5s ease-out forwards;
  min-width: 2px; max-width: 110px;
}
@keyframes bar-grow { to { width: calc(var(--share) * 1.1px); } }

.th--sortable { cursor: pointer; user-select: none; }
.th--sortable[data-sorted="down"]::after { content: " ↓"; color: var(--muted); }
.th--sortable[data-sorted="up"]::after { content: " ↑"; color: var(--muted); }

.better { color: var(--best, #1a7f37); font-weight: 600; }
.worse { color: var(--warn); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .results .bar { animation: none; width: calc(var(--share) * 1.1px); }
}

/* Живые показы: движение вместо анимированных картинок.
 *
 * GIF с интерфейсом — это мегабайты ради нескольких секунд, мыльные буквы и
 * никакой возможности отключить движение. Здесь оно нарисовано разметкой и
 * стилями: единицы килобайт, буквы остаются буквами, а при системной
 * настройке «меньше движения» показ замирает на последнем кадре — то есть
 * становится обычным снимком. Все анимации бесконечные и медленные:
 * страницу читают, а не смотрят, и дёргающийся угол мешает читать. */
.demo {
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  padding: 16px 18px; margin: 18px 0;
}
.demo__head { font-weight: 700; color: var(--night); margin-bottom: 12px; }
.demo__note { color: var(--muted); font-size: 14px; margin: 12px 0 0; line-height: 1.5; }

/* Цепочка «калитка → створ → программа → экран»: подсветка бежит по звеньям. */
.demo__chain { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.demo__link {
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px;
  font-size: 13px; background: #fff; color: var(--muted);
  animation: demo-chain 2.8s infinite;
}
.demo__link[data-step="2"] { animation-delay: .28s; }
.demo__link[data-step="3"] { animation-delay: .56s; }
.demo__link[data-step="4"] { animation-delay: .84s; }
.demo__arrow { flex: 0 0 18px; height: 1px; background: var(--line); }
@keyframes demo-chain {
  0%, 8% { background: #fff; color: var(--muted); border-color: var(--line); }
  12%, 26% { background: var(--accent); color: #fff; border-color: var(--accent); }
  34%, 100% { background: #fff; color: var(--muted); border-color: var(--line); }
}

/* Строка результата: время подставляется, сумма пересчитывается. */
.demo__table { width: 100%; border-collapse: collapse; font-size: 14px; }
.demo__table th, .demo__table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.demo__table th { background: var(--ice); font-weight: 600; }
.demo__row { animation: demo-arrive 2.8s infinite; }
.demo__time, .demo__sum { display: inline-block; animation: demo-land 2.8s infinite; }
.demo__sum { animation-delay: .18s; }
@keyframes demo-arrive {
  0%, 40% { background: transparent; }
  44% { background: #cfe6fb; }
  50%, 76% { background: #e8f4ff; }
  88%, 100% { background: transparent; }
}
@keyframes demo-land {
  0%, 42% { opacity: 0; transform: translateY(-4px); }
  50%, 88% { opacity: 1; transform: none; }
  96%, 100% { opacity: 0; transform: translateY(-4px); }
}

/* Переключатель организатора и карточка соревнования с ярлычком. */
.demo__switch { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.demo__label { font-size: 14px; color: var(--ink); }
.demo__toggle {
  width: 40px; height: 22px; border-radius: 999px; background: var(--line);
  position: relative; animation: demo-switch 3.4s infinite;
}
.demo__toggle i {
  position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; animation: demo-knob 3.4s infinite;
}
@keyframes demo-switch {
  0%, 22% { background: var(--line); }
  30%, 86% { background: var(--accent); }
  94%, 100% { background: var(--line); }
}
@keyframes demo-knob {
  0%, 22% { transform: none; }
  30%, 86% { transform: translateX(18px); }
  94%, 100% { transform: none; }
}
.demo__card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: #fff; }
.demo__title { display: block; font-weight: 700; color: var(--night); }
.demo__sub { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.demo__badge {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
  background: #ffe9e9; color: #b3261e; font-size: 12px; font-weight: 600;
  opacity: 0; animation: demo-badge 3.4s infinite;
}
@keyframes demo-badge {
  0%, 22% { opacity: 0; transform: scale(.94); }
  30%, 86% { opacity: 1; transform: none; }
  94%, 100% { opacity: 0; transform: scale(.94); }
}

/* Шаги мастера: один загорается жёлтым, под ним появляется ответ и кнопка. */
.demo__steps { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.demo__step {
  border: 1px solid var(--line); border-radius: 8px; padding: 4px 12px;
  font-size: 13px; background: #fff;
}
.demo__step[data-state="ok"]::before { content: "✓ "; color: var(--best, #1a7f37); }
.demo__step[data-state="warn"] { animation: demo-warn 3.4s infinite; }
.demo__step[data-state="warn"]::before { content: "! "; color: var(--warn); }
@keyframes demo-warn {
  0%, 18% { background: #fff; border-color: var(--line); }
  26%, 86% { background: #fdf3e7; border-color: var(--warn); }
  94%, 100% { background: #fff; border-color: var(--line); }
}
.demo__answer { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.demo__bad { color: var(--warn); font-size: 14px; opacity: 0; animation: demo-badge 3.4s infinite; }
.demo__fix {
  border: 1px solid var(--accent); color: var(--accent); border-radius: 8px;
  padding: 3px 12px; font-size: 13px; opacity: 0;
  animation: demo-badge 3.4s infinite; animation-delay: .22s;
}

@media (prefers-reduced-motion: reduce) {
  /* Замирает на последнем кадре: показ становится обычным снимком. */
  .demo__link, .demo__row, .demo__time, .demo__sum, .demo__toggle,
  .demo__toggle i, .demo__badge, .demo__step[data-state="warn"],
  .demo__bad, .demo__fix { animation: none; }
  .demo__badge, .demo__bad, .demo__fix { opacity: 1; }
  .demo__toggle { background: var(--accent); }
  .demo__toggle i { transform: translateX(18px); }
  .demo__step[data-state="warn"] { background: #fdf3e7; border-color: var(--warn); }
}

/* Ярлык «идёт сейчас»: без него движение принимают за картинку и не смотрят.
   Точка мигает всегда — она и говорит, что показ живой. */
.demo__live {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 10px;
  font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: none; letter-spacing: 0;
}
.demo__live i {
  width: 7px; height: 7px; border-radius: 50%; background: #d6323d;
  animation: demo-pulse 1.4s infinite;
}
@keyframes demo-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.8); }
}

/* Ячейка, где время сменяет прочерк: обе надписи стоят одна над другой,
   поэтому строка не дёргается, когда значение появляется. */
.demo__cell { position: relative; }
.demo__wait {
  color: var(--muted); animation: demo-wait 2.8s infinite;
}
@keyframes demo-wait {
  0%, 40% { opacity: 1; }
  46%, 88% { opacity: 0; }
  96%, 100% { opacity: 1; }
}
.demo__cell .demo__time, .demo__cell .demo__sum { position: absolute; left: 8px; }

@media (prefers-reduced-motion: reduce) {
  .demo__live i { animation: none; }
  .demo__wait { animation: none; opacity: 0; }
  .demo__cell .demo__time, .demo__cell .demo__sum { position: static; }
}

/* Скорость на финише: цифры и полосы (races/parts/speed.html).
 *
 * Своё имя у каждого класса, а не `.bar` из тренировок: `.bar` уже занят
 * шапкой сайта, и такое совпадение однажды уже выкрасило цифры белым по
 * белому. Полосы отсчитаны от самой медленной строки, а не от нуля — доля
 * приходит готовой из races/speed.py. */
.speedpanel { margin: 14px 0 22px; }
.speedpanel h3 { margin: 0 0 10px; }
.speednote { max-width: 62ch; line-height: 1.55; }

.speedchart { list-style: none; margin: 14px 0 0; padding: 0; }
.speedchart__row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(80px, 3fr) auto;
  align-items: center; gap: 10px; padding: 4px 0;
}
.speedchart__who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.speedchart__bib {
  display: inline-block; min-width: 22px; padding: 0 5px; margin-right: 4px;
  border-radius: 6px; background: var(--ice); color: var(--night);
  font-size: 12px; text-align: center;
}
.speedchart__track {
  height: 10px; border-radius: 5px; background: var(--ice); overflow: hidden;
}
.speedchart__fill {
  --share: 0;
  display: block; height: 100%; border-radius: 5px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  width: 0; animation: speed-grow .6s ease-out forwards;
  min-width: 3px;
}
@keyframes speed-grow { to { width: calc(var(--share) * 1%); } }
.speedchart__value { font-variant-numeric: tabular-nums; font-weight: 600; }
.speedchart__unit { color: var(--muted); font-weight: 400; font-size: 13px; }
.speedchart__scale { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 12px 0 0; }

@media (prefers-reduced-motion: reduce) {
  .speedchart__fill { animation: none; width: calc(var(--share) * 1%); }
}

@media (max-width: 560px) {
  /* На телефоне имя и полоса не помещаются в одну строку так, чтобы полоса
     осталась полосой: имя уходит наверх, цифра остаётся рядом с полосой. */
  .speedchart__row { grid-template-columns: minmax(60px, 1fr) auto; }
  .speedchart__who { grid-column: 1 / -1; }
}
.speedhead { margin-top: 18px; }

/* «Группа ещё на трассе» — предупреждение, а не украшение: оно объясняет
   отсутствие медалей, и потерять его хуже, чем не заметить. */
.running {
  border-left: 3px solid var(--warn, #b45309); padding-left: 10px;
  margin: 8px 0 12px;
}

/* Версия в подвале: её ищут глазами, когда что-то пошло не так, и мешать
   чтению остального она не должна. */
.site__version {
  display: inline-block; margin-left: 8px; padding: 1px 7px;
  border-radius: 999px; background: rgba(255, 255, 255, .14);
  font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* Обратная связь: задача с картинки и поле-приманка.

   Приманка убрана не «display: none» — рассылки, которые поумнее, скрытые
   поля пропускают, а это поле должно выглядеть для них обычным. Поэтому оно
   вынесено за пределы экрана: человек его не видит и не наводит на него
   курсор, разметка при этом честная. */
.honey {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.captcha__frame {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  /* Знаки рисуются currentColor — рисунок сам подстраивается под тему. */
  color: var(--ink);
  user-select: none;
}

.captcha__picture { display: block; }

.captcha__question {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 6px;
}
