/* Верх левой колонки: зум + подложка — оболочка без толстой рамки (одна «волосная» кромка) */

/* Компактно: ~2rem как кнопки «+» областей и .form-actions в конструкторе */
.map-control {
  position: absolute;
  /* Выше canvas OpenLayers внутри #map (см. .content_subtop z-index ~12k — здесь только слои карты) */
  z-index: 15001;
  top: 10px;
  left: 10px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 8px;
  border: none;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 4px 14px rgba(0, 0, 0, 0.18);
}

/* Кнопка поиска в тулбаре карты */
.map-btn-search {
  /* В .map-btn иконки задаются через background-image */
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20fill='%23e2e8f0'%20d='M10%204a6%206%200%201%200%204.47%2010.03l3.25%203.24a1%201%200%200%200%201.41-1.41l-3.24-3.25A6%206%200%200%200%2010%204zm0%202a4%204%200%201%201%200%208%204%204%200%200%201%200-8z'/%3E%3C/svg%3E");
  background-size: 22px 22px; /* +10% к стандартным 20px */
}

/* Подсветка как "активная" */
.map-btn-search[aria-pressed="true"] {
  outline: 2px solid rgba(251, 202, 31, 0.65);
  outline-offset: 1px;
}

/* «Моё местоположение» — цель / точка на карте */
.map-btn-my-location {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Ccircle%20cx='12'%20cy='12'%20r='3.2'%20fill='%234285F4'/%3E%3Ccircle%20cx='12'%20cy='12'%20r='8'%20fill='none'%20stroke='%23e2e8f0'%20stroke-width='1.6'/%3E%3Cpath%20fill='none'%20stroke='%23e2e8f0'%20stroke-width='1.6'%20stroke-linecap='round'%20d='M12%203v2M12%2019v2M3%2012h2M19%2012h2'/%3E%3C/svg%3E");
  background-size: 22px 22px;
}

/* Поиск по карте (Nominatim): строка справа сверху */
.map-search {
  position: absolute;
  z-index: 15001;
  top: 10px;
  left: 56px; /* рядом с .map-control */
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 6px;
  padding: 6px;
  width: min(520px, calc(100vw - 24px - 56px));
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 10px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 4px 14px rgba(0, 0, 0, 0.18);
}

.map-search__input {
  width: 100%;
  min-width: 140px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  outline: none;
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  font-size: 0.9rem;
}

.map-search__input::placeholder {
  color: rgba(248, 250, 252, 0.65);
}

.map-search__btn {
  height: 32px;
  padding: 0 10px;
  border: none;
  border-radius: 8px;
  background: rgba(251, 202, 31, 0.92);
  color: #000;
  font-weight: 800;
  cursor: pointer;
}

.map-search__btn:hover {
  background: rgba(251, 202, 31, 1);
}

.map-search__clear {
  height: 32px;
  width: 32px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.map-search__clear:hover {
  background: rgba(248, 113, 113, 0.35);
}

.map-search__status {
  grid-column: 1 / -1;
  min-height: 14px;
  opacity: 0.9;
}

/* Вложенные карты (редактор гонки, боковая панель карточки) — уже основной карты */
.map-search--embedded {
  width: min(360px, calc(100% - 72px));
}

/* Сворачиваемые панели каталога на карте — только мобильная вёрстка (см. mobile-layout.css) */
.map-mobile-panel-rail,
.map-mobile-panel-collapse {
  display: none;
}

/* Правая колонка: подсказка / карточка (конструктор каталога на add_marsh) */
.map-route-side {
  position: absolute;
  right: 10px;
  top: 10px;
  /* Поверх .ol-viewport / canvas, иначе пустой/тонкий блок календаря визуально «пропадает» под карту */
  z-index: 15000;
  pointer-events: auto;
  margin: 0;
  max-width: min(320px, calc(100vw - 24px));
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

/* Каталог маршрутов: список справа + карточка выбранного */
.map-route-side.map-route-side--catalog {
  top: 10px;
  bottom: 10px;
  width: min(340px, calc(100vw - 20px));
  max-width: min(340px, calc(100vw - 20px));
  align-items: stretch;
  min-height: 0;
}

.map-route-side.map-route-side--catalog.map-route-side--detail-open .catalog-route-list-panel {
  flex: 0 1 auto;
  max-height: min(38vh, 280px);
}

.catalog-route-list-panel {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(calc(100vh - 120px), 720px);
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 0.55rem 0.6rem 0.65rem;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 8px 28px rgba(0, 0, 0, 0.28);
  box-sizing: border-box;
}

.catalog-route-list-panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-bottom: 0.35rem;
}

.catalog-route-list-panel__toolbar {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  margin-bottom: 0.35rem;
}

.catalog-route-list-panel__search {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  box-sizing: border-box;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.25);
  color: #f8fafc;
}

.catalog-route-list-panel__search::placeholder {
  color: rgba(248, 250, 252, 0.45);
}

.catalog-route-list-panel__search:focus {
  outline: 2px solid rgba(251, 202, 31, 0.55);
  outline-offset: 1px;
}

.catalog-route-list-panel__refresh {
  flex: 0 0 auto;
  width: auto;
  box-sizing: border-box;
  padding: 0.32rem 0.55rem;
  font-size: 0.78rem;
  line-height: 1.2;
  white-space: nowrap;
}

.catalog-route-list-panel__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.2;
}

.catalog-route-list-panel__count {
  opacity: 0.75;
  white-space: nowrap;
}

.catalog-route-list-panel__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.catalog-route-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;
}

.catalog-route-list-panel__empty {
  margin: 0.35rem 0 0;
  opacity: 0.85;
}

.catalog-route-list__item {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  width: 100%;
  margin: 0 0 0.35rem;
  padding: 0.45rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.catalog-route-list__item:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(251, 202, 31, 0.35);
}

.catalog-route-list__item--active {
  background: rgba(251, 202, 31, 0.14);
  border-color: rgba(251, 202, 31, 0.55);
}

.catalog-route-list__item:focus-visible {
  outline: 2px solid rgba(251, 202, 31, 0.75);
  outline-offset: 2px;
}

.catalog-route-list__dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  margin-top: 0.35rem;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.35);
}

.catalog-route-list__dot--easy {
  background: #22c55e;
}

.catalog-route-list__dot--medium {
  background: #eab308;
}

.catalog-route-list__dot--hard {
  background: #b91c1c;
}

.catalog-route-list__main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.catalog-route-list__name {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-route-list__meta {
  line-height: 1.2;
  opacity: 0.88;
}

.catalog-route-list__fav {
  flex-shrink: 0;
  color: #facc15;
  font-size: 0.85rem;
  line-height: 1;
  margin-top: 0.2rem;
}

/* Страница гонок: шире и на всю высоту области карты */
.map-route-side.map-route-side--races {
  top: 10px;
  bottom: 10px;
  width: min(420px, calc(100vw - 20px));
  max-width: min(420px, calc(100vw - 20px));
  align-items: stretch;
  min-height: 0;
}

.catalog-route-side-panel {
  padding: 0.65rem 0.75rem 0.75rem;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 8px 28px rgba(0, 0, 0, 0.28);
}

/* Карточка маршрута: по умолчанию только шапка; координаты/описание — по кнопке */
#catalogRouteSideDetail.catalog-route-side-panel--detail {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.catalog-route-side-panel__mobile-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 30px;
  padding: 0;
  margin: 0 4px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
}

.catalog-route-side-panel__mobile-toggle:focus-visible {
  outline: 2px solid rgba(251, 202, 31, 0.75);
  outline-offset: 2px;
}

.catalog-route-side-panel__mobile-toggle-icon {
  display: block;
  transition: transform 0.22s ease;
}

#catalogRouteSideDetail:not([hidden]):not(.catalog-route-side-panel--detail-expanded) {
  max-height: 6.75rem;
  overflow: hidden;
}

#catalogRouteSideDetail:not([hidden]).catalog-route-side-panel--detail-expanded {
  max-height: min(85vh, 640px);
  overflow: hidden;
}

#catalogRouteSideDetail:not([hidden]):not(.catalog-route-side-panel--detail-expanded) .catalog-route-side-panel__body {
  flex: 0 0 0;
  min-height: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  margin: 0;
  padding: 0;
}

#catalogRouteSideDetail:not([hidden]).catalog-route-side-panel--detail-expanded .catalog-route-side-panel__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 1;
  pointer-events: auto;
  padding-top: 0.2rem;
}

#catalogRouteSideDetail.catalog-route-side-panel--detail-expanded .catalog-route-side-panel__mobile-toggle-icon {
  transform: rotate(180deg);
}

.race-events-panel {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 0.6rem 0.7rem 0.7rem;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 8px 28px rgba(0, 0, 0, 0.22);
}

.race-events-panel__head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  margin-bottom: 0.45rem;
}

.race-events-panel__title {
  font-weight: 700;
  color: #f8fafc;
}

/* В духе основной кнопки сайта (.but): жёлтый фон, чёрный текст, чёрная обводка */
.race-events-year-cal-btn {
  margin: 0;
  padding: 0.45em 0.95em;
  border-radius: 0.32em;
  border: 3px solid #000;
  background: #fbca1f;
  color: #000;
  font-family: inherit;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0.1em 0.1em rgba(0, 0, 0, 0.35);
  text-decoration: none;
}

.race-events-year-cal-btn:hover {
  transform: translate(-0.04em, -0.04em);
  box-shadow: 0.12em 0.12em rgba(0, 0, 0, 0.38);
  color: #000;
  background: #fbca1f;
}

.race-events-year-cal-btn:active {
  transform: translate(0.04em, 0.04em);
  box-shadow: 0.06em 0.06em rgba(0, 0, 0, 0.35);
  color: #000;
}

.race-events-panel__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 0.1rem;
}

/* Скрытие списка/календаря: дублируем [hidden], т.к. в редких случаях стили могут перебивать display */
.race-events-panel__pane--hidden {
  display: none !important;
}

.race-events-panel__list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Полноэкранный календарь на 12 месяцев (компактная карточка по центру) */
.race-year-cal-modal {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.65rem;
  box-sizing: border-box;
}

.race-year-cal-modal[hidden] {
  display: none !important;
}

.race-year-cal-modal__backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(2, 6, 23, 0.62);
  cursor: pointer;
}

.race-year-cal-modal__sheet {
  position: relative;
  z-index: 1;
  flex: 0 1 auto;
  width: min(96vw, 1480px);
  height: calc(100vh - 14px);
  max-height: calc(100vh - 14px);
  max-width: 96vw;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.97);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  /* Компактный масштаб: сетка года и раскрытый месяц (один и тот же лист) */
  zoom: 0.85;
}

.race-year-cal-modal__sheet--expanded-month {
  width: min(96vw, 1480px);
  height: calc(100vh - 14px);
  max-height: calc(100vh - 14px);
}

.race-year-cal-modal__toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.3rem 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(2, 6, 23, 0.35);
}

.race-year-cal-modal__toolbar-grow {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.race-year-cal-modal__toolbar-month {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  flex: 1;
}

.race-year-cal-modal__back-year {
  flex-shrink: 0;
  margin: 0;
  padding: 0.18rem 0.42rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}

.race-year-cal-modal__back-year:hover {
  background: rgba(255, 255, 255, 0.12);
}

.race-year-cal-modal__month-head {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 800;
  color: #f8fafc;
  text-transform: capitalize;
  min-width: 0;
  flex: 1;
}

.race-year-cal-modal__nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}

.race-year-cal-modal__year {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #f8fafc;
  min-width: 3.5rem;
  text-align: center;
}

.race-year-cal-modal__nav-btn {
  margin: 0;
  padding: 0.12rem 0.32rem;
  min-width: 1.65rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
}

.race-year-cal-modal__nav-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.race-year-cal-modal__close {
  margin: 0;
  padding: 0.08rem 0.42rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.2);
  color: #f8fafc;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.race-year-cal-modal__close:hover {
  background: rgba(248, 113, 113, 0.25);
  border-color: rgba(248, 113, 113, 0.45);
}

/* Фильтр региона: кастомный вид под модалку года (не «стандартный» Bootstrap-select) */
.race-year-cal-modal__filters-wrap {
  flex-shrink: 0;
  padding: 0.38rem 0.5rem 0.42rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(251, 202, 31, 0.09) 0%, rgba(2, 6, 23, 0.58) 42%, rgba(15, 23, 42, 0.72) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.race-year-cal-subtop-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.42rem 0.55rem;
  min-width: 0;
}

.race-year-cal-region-filter__label {
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #f8fafc;
  background: none;
  border: none;
  box-shadow: none;
}

.race-year-cal-region-select-wrap {
  position: relative;
  flex: 1 1 12rem;
  min-width: 10rem;
  max-width: min(26rem, 100%);
}

.race-year-cal-region-select-wrap::after {
  content: '';
  position: absolute;
  right: 0.62rem;
  top: 50%;
  width: 0;
  height: 0;
  margin-top: -2px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid rgba(248, 250, 252, 0.92);
  pointer-events: none;
  opacity: 0.95;
}

select.race-year-cal-region-select {
  width: 100%;
  margin: 0;
  display: block;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  padding: 0.5rem 2.4rem 0.5rem 0.88rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: linear-gradient(155deg, rgba(51, 65, 85, 0.55) 0%, rgba(15, 23, 42, 0.96) 45%, rgba(2, 6, 23, 0.98) 100%);
  color: #fffbeb;
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.28;
  letter-spacing: 0.015em;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 4px 14px rgba(0, 0, 0, 0.28);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    color 0.15s ease;
}

select.race-year-cal-region-select:hover {
  border-color: rgba(255, 255, 255, 0.52);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 6px 18px rgba(0, 0, 0, 0.34);
}

select.race-year-cal-region-select:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.75);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 0 2px rgba(255, 255, 255, 0.22),
    0 6px 20px rgba(0, 0, 0, 0.38);
}

select.race-year-cal-region-select option {
  background: #0f172a;
  color: #f1f5f9;
  font-weight: 600;
}

.race-year-cal-region-reset {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: linear-gradient(165deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.98) 100%);
  color: #f8fafc;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 2px 8px rgba(0, 0, 0, 0.25);
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.12s ease;
}

.race-year-cal-region-reset:hover {
  border-color: rgba(255, 255, 255, 0.55);
  color: #ffffff;
}

.race-year-cal-region-reset:active {
  transform: scale(0.96);
}

.race-year-cal-region-reset__icon {
  display: block;
}

.race-year-cal-subtop-filters__note {
  flex: 1 1 10rem;
  min-width: 0;
  line-height: 1.35;
  opacity: 0.82;
  font-size: 0.68rem;
}

.race-year-cal-modal__grid {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0.28rem 0.35rem 0.4rem;
}

.race-year-cal-banner {
  flex-shrink: 0;
  margin: 0 0 0.32rem;
  padding: 0.25rem 0.35rem;
  border-radius: 6px;
  background: rgba(251, 202, 31, 0.12);
  border: 1px solid rgba(251, 202, 31, 0.35);
  color: rgba(248, 250, 252, 0.95);
  font-size: 0.7rem;
}

.race-year-cal-year-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 0.28rem 0.32rem;
  flex: 1;
  min-height: 0;
  align-content: stretch;
  overflow: hidden;
}

@media (max-width: 1280px) {
  .race-year-cal-year-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .race-year-cal-year-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .race-year-cal-year-grid {
    grid-template-columns: 1fr;
  }
}

.race-year-cal-month {
  container-type: inline-size;
  container-name: race-month;
  min-width: 0;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0.22rem 0.28rem 0.3rem;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(2, 6, 23, 0.35);
}

.race-year-cal-month__title {
  margin: 0 0 0.18rem;
  font-size: 0.65rem;
  font-weight: 800;
  color: #f8fafc;
  text-transform: capitalize;
}

button.race-year-cal-month__title.race-year-cal-month__expand {
  display: block;
  width: 100%;
  cursor: pointer;
  text-align: left;
  font: inherit;
  font-size: 0.65rem;
  font-weight: 800;
  border: 1px solid rgba(251, 202, 31, 0.28);
  background: rgba(251, 202, 31, 0.1);
  border-radius: 5px;
  padding: 0.1rem 0.22rem;
  color: #fefce8;
}

button.race-year-cal-month__expand:hover {
  background: rgba(251, 202, 31, 0.22);
  border-color: rgba(251, 202, 31, 0.45);
}

/* Сетка дней на всю ширину карточки месяца */
.race-year-cal-month__weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.05rem 0.06rem;
  margin-bottom: 0.08rem;
}

.race-year-cal-month__wd {
  font-size: 0.5rem;
  font-size: clamp(0.45rem, 5.5cqi, 0.58rem);
  font-weight: 700;
  color: rgba(226, 232, 240, 0.55);
  text-align: center;
  text-transform: lowercase;
  min-width: 0;
}

.race-year-cal-month__days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.05rem 0.06rem;
  width: 100%;
  flex: 1;
  min-height: 0;
  align-content: stretch;
}

.race-year-cal-day-cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.race-year-cal-day-cell--pad {
  pointer-events: none;
  opacity: 0.25;
}

.race-year-cal-day-cell--today .race-year-cal-day__main {
  border-color: rgba(251, 202, 31, 0.85);
  box-shadow: inset 0 0 0 1px rgba(251, 202, 31, 0.2);
  color: #fbca1f;
}

.race-year-cal-day-cell--has-race .race-year-cal-day__main {
  cursor: pointer;
  background: rgba(251, 202, 31, 0.22);
  border-color: rgba(251, 202, 31, 0.45);
  color: #fffbeb;
}

.race-year-cal-day-cell--has-race .race-year-cal-day__main:hover {
  background: rgba(251, 202, 31, 0.38);
  border-color: rgba(251, 202, 31, 0.55);
}

.race-year-cal-day__marks {
  position: absolute;
  bottom: 2px;
  right: 2px;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 3px;
  pointer-events: none;
  z-index: 1;
}

.race-year-cal-day__reg-dot,
.race-year-cal-day__paid-dot {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.5);
}

.race-year-cal-day__reg-dot {
  background: #facc15;
}

.race-year-cal-day__paid-dot {
  background: #22c55e;
}

.race-year-cal-with-legend {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.race-year-cal-with-legend > .race-year-cal-year-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.race-year-cal-with-legend > .race-year-cal-exp {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.race-year-cal-legend {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem 1rem;
  margin-top: 0.35rem;
  padding: 0.4rem 0.35rem 0.25rem;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  font-size: clamp(0.52rem, 3.2cqi, 0.68rem);
  font-weight: 600;
  color: rgba(203, 213, 225, 0.9);
  line-height: 1.35;
}

.race-year-cal-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  max-width: 100%;
}

.race-year-cal-legend__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.45);
}

.race-year-cal-legend__dot--reg {
  background: #facc15;
}

.race-year-cal-legend__dot--paid {
  background: #22c55e;
}

.race-year-cal-legend__text {
  min-width: 0;
}

.race-year-cal-day-cell--today.race-year-cal-day-cell--has-race .race-year-cal-day__main {
  border-color: rgba(251, 202, 31, 0.9);
  box-shadow: inset 0 0 0 1px rgba(251, 202, 31, 0.28);
  color: #fbca1f;
}

.race-year-cal-day__main {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  flex: 1;
  min-height: 0;
  aspect-ratio: 1;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.45);
  color: rgba(248, 250, 252, 0.9);
  font-size: 0.55rem;
  font-size: clamp(0.5rem, 7.5cqi, 0.75rem);
  font-weight: 700;
  line-height: 1;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Один раскрытый месяц: крупные ячейки, число сверху, превью гонок */
.race-year-cal-exp {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.race-year-cal-exp__weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.06rem 0.08rem;
}

.race-year-cal-exp__wd {
  font-size: 0.58rem;
  font-weight: 700;
  color: rgba(226, 232, 240, 0.55);
  text-align: center;
  text-transform: lowercase;
  min-width: 0;
}

.race-year-cal-exp__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: minmax(6.5rem, auto);
  gap: 0.28rem 0.32rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.race-year-cal-exp-cell {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(2, 6, 23, 0.42);
  overflow: hidden;
}

.race-year-cal-exp-cell--pad {
  border-color: transparent;
  background: transparent;
  pointer-events: none;
}

.race-year-cal-exp-cell--today {
  border-color: rgba(251, 202, 31, 0.75);
  box-shadow: inset 0 0 0 1px rgba(251, 202, 31, 0.18);
}

.race-year-cal-exp-cell--has-race {
  border-color: rgba(251, 202, 31, 0.28);
}

.race-year-cal-exp-cell--has-reminder {
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.55);
  border-color: rgba(56, 189, 248, 0.42);
}

.race-year-cal-exp-cell--has-reminder .race-year-cal-exp-cell__num::after {
  content: '';
  display: inline-block;
  width: 0.35rem;
  height: 0.35rem;
  margin-left: 0.22rem;
  border-radius: 50%;
  vertical-align: 0.12em;
  background: rgba(56, 189, 248, 0.95);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.35);
}

.race-year-cal-exp-cell__day-label {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  min-width: 0;
}

.race-year-cal-exp-cell__reg-dot {
  flex-shrink: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #facc15;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.45);
}

.race-year-cal-exp-cell__paid-dot {
  flex-shrink: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.45);
}

.race-year-cal-exp-cell__head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0.12rem 0.28rem 0.08rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.55);
}

.race-year-cal-exp-cell__head--with-menu {
  justify-content: space-between;
  gap: 0.2rem;
}

button.race-year-cal-exp-day-menu-btn {
  flex-shrink: 0;
  margin: 0;
  padding: 0 0.18rem;
  min-width: 1.35rem;
  height: 1.35rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(2, 6, 23, 0.35);
  color: rgba(248, 250, 252, 0.82);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
}

button.race-year-cal-exp-day-menu-btn:hover {
  border-color: rgba(251, 202, 31, 0.45);
  color: #fefce8;
}

.race-year-cal-exp-cell__num {
  font-size: clamp(0.95rem, 2.8vw, 1.25rem);
  font-weight: 800;
  line-height: 1;
  color: #f8fafc;
}

.race-year-cal-exp-cell--today .race-year-cal-exp-cell__num {
  color: #fbca1f;
}

.race-year-cal-exp-cell__previews {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.1rem 0 0.16rem;
  align-items: stretch;
  overflow: auto;
}

.race-year-cal-exp-more {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 1.65rem;
  border-radius: 6px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  font-size: 0.65rem;
  font-weight: 800;
  color: rgba(248, 250, 252, 0.85);
  background: rgba(0, 0, 0, 0.15);
  box-sizing: border-box;
}

.race-year-cal-prev {
  position: relative;
  width: 100%;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  /* Прямоугольник как обложка в списке: на всю ширину дня, ниже по высоте */
  height: clamp(2.05rem, 4.6vw, 2.45rem);
}

button.race-year-cal-prev--tile {
  margin: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

button.race-year-cal-prev--tile:hover {
  border-color: rgba(251, 202, 31, 0.55);
  box-shadow: 0 0 0 1px rgba(251, 202, 31, 0.25), 0 4px 14px rgba(0, 0, 0, 0.45);
  transform: translateY(-1px);
}

button.race-year-cal-prev--tile:focus-visible {
  outline: 2px solid rgba(251, 202, 31, 0.85);
  outline-offset: 2px;
}

button.race-year-cal-prev--tile:active {
  transform: translateY(0);
}

.race-year-cal-prev__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.race-year-cal-prev__reg-dot {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #facc15;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.55);
  z-index: 3;
  pointer-events: none;
}

.race-year-cal-prev__paid-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.55);
  z-index: 3;
  pointer-events: none;
}

.race-year-cal-prev__title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.18rem 0.32rem 0.14rem;
  font-size: clamp(0.52rem, 1.65vw, 0.62rem);
  font-weight: 700;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.98);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85), 0 0 10px rgba(0, 0, 0, 0.45);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.35) 65%, transparent 100%);
  max-height: 2.55em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  box-sizing: border-box;
}

/* Оверлей подробного просмотра гонки (список + календарь) */
.race-detail-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 21000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  box-sizing: border-box;
}

/* «Мой календарь» .user-planned-cal-modal = 28500 — карточка гонки должна быть поверх */
/* «Результаты» #user_race_results_modal = 28680 (user_race_results_modal.css) — поверх календаря и карточки */
#user_planned_race_detail.race-detail-preview-overlay {
  z-index: 28650;
}

.race-detail-preview-overlay[hidden] {
  display: none !important;
}

.race-detail-preview-overlay__backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(2, 6, 23, 0.55);
  cursor: pointer;
}

/* Лист + колонка «Карта» снаружи листа (в зазоре до боковой панели) */
.race-detail-preview-overlay__cluster {
  position: relative;
  z-index: 1;
  display: inline-flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.45rem;
  max-width: calc(100vw - 1rem);
  box-sizing: border-box;
}

/* Колонка карты по высоте как лист с информацией о гонке */
.race-detail-preview-overlay__cluster:has(.race-detail-preview-overlay__map-edge:not([hidden])) {
  align-items: stretch;
}

.race-detail-preview-overlay__map-edge {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  align-self: stretch;
  padding-top: 0;
}

.race-detail-preview-overlay__map-edge .race-detail-preview-map-rail {
  padding-top: 0;
}

.race-detail-preview-overlay__map-edge[hidden] {
  display: none !important;
}

.race-detail-preview-overlay__sheet {
  position: relative;
  z-index: 1;
  width: min(572px, calc(100vw - 1rem));
  /* Фиксированная высота листа вне страницы «Гонки»: не дёргается при смене вкладок / подгрузке карты */
  height: min(88vh, 700px);
  max-height: min(88vh, 700px);
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

/* Карта «Гонки»: кластер (лист + кнопка карты) совпадает по вертикали с панелью #raceEventsPanel — top/height на .race-detail-preview-overlay__cluster (JS) */
body.page-races-map #race_detail_preview.race-detail-preview-overlay {
  align-items: stretch;
  justify-content: center;
  padding: 0 8px;
}

body.page-races-map #race_detail_preview .race-detail-preview-overlay__cluster {
  position: fixed;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  margin: 0;
  box-sizing: border-box;
  align-items: stretch;
  gap: 0.5rem;
}

body.page-races-map #race_detail_preview .race-detail-preview-overlay__sheet {
  position: relative;
  left: auto;
  right: auto;
  transform: none;
  top: auto;
  bottom: auto;
  flex: 0 0 min(572px, calc(100vw - 16px));
  width: min(572px, calc(100vw - 16px));
  max-height: none;
  height: 100%;
  min-height: 0;
  margin: 0;
  border-radius: 12px;
  box-sizing: border-box;
}

.race-detail-preview-overlay__head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(2, 6, 23, 0.4);
}

.race-detail-preview-overlay__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #f8fafc;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.race-detail-preview-overlay__close {
  flex-shrink: 0;
  margin: 0;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.2);
  color: #f8fafc;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.race-detail-preview-overlay__close:hover {
  background: rgba(248, 113, 113, 0.25);
}

.race-detail-preview-overlay__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: visible;
  padding: 0.42rem 0.5rem 0.52rem;
}

.race-detail-preview-layout {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  min-height: 0;
}

.race-detail-preview-layout__body-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
}

.race-detail-preview-layout[data-race-detail-tabs='1']
  .race-detail-preview-layout__tabs-col
  > .race-detail-preview__main
  + .race-detail-preview-tabs__bar {
  margin-top: 0.45rem;
}

/* Левая колонка: только обложка + текст/вкладки (без карты) */
.race-detail-preview-layout[data-race-detail-tabs='1'] .race-detail-preview-layout__tabs-col {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Ряд: [вся форма с информацией] | [кнопка «Карта» + отдельная карточка карты] */
.race-detail-preview-map-split {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-height: 0;
}

.race-detail-preview-info-surface {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.race-detail-preview-map-split--map-open .race-detail-preview-info-surface {
  flex: 1 1 34%;
  max-width: none;
}

/* Правая колонка: только карта (кнопка + панель), вне блока .race-detail-preview-info-surface */
.race-detail-preview-map-dock {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.5rem;
  min-width: 0;
  align-self: stretch;
}

.race-detail-preview-map-split--map-open .race-detail-preview-map-dock,
.race-detail-preview-overlay--side-map-open .race-detail-preview-overlay__map-edge .race-detail-preview-map-dock {
  flex: 1 1 auto;
  min-width: min(420px, calc(100vw - 1.5rem));
  min-height: 0;
  height: 100%;
}

.race-detail-preview-map-rail {
  flex: 0 0 auto;
  width: 3.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 0.35rem;
  align-self: flex-start;
}

.race-detail-preview-map-rail__btn {
  appearance: none;
  box-sizing: border-box;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  margin: 0;
  padding: 0.22rem;
  width: 3.1rem;
  height: 3.1rem;
  min-width: 3.1rem;
  min-height: 3.1rem;
  max-width: none;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: linear-gradient(165deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.99) 100%);
  color: rgba(248, 250, 252, 0.95);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 10px 28px rgba(0, 0, 0, 0.42);
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  line-height: 1.1;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease,
    background 0.16s ease;
}

.race-detail-preview-map-rail__btn:hover {
  border-color: rgba(251, 202, 31, 0.55);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 12px 32px rgba(0, 0, 0, 0.48);
  transform: translateY(-1px);
}

.race-detail-preview-map-rail__btn:focus-visible {
  outline: 2px solid #fbca1f;
  outline-offset: 3px;
}

.race-detail-preview-map-rail__btn[aria-expanded='true'] {
  border-color: rgba(251, 202, 31, 0.75);
}

.race-detail-preview-map-rail__ico {
  display: flex;
  color: rgba(251, 202, 31, 0.95);
}

.race-detail-preview-map-rail__lbl {
  display: block;
  max-width: 4.2em;
  text-align: center;
}

/* Пока открыта карта — квадратная кнопка скрыта (вернуть — «Скрыть» в шапке карточки) */
.race-detail-preview-map-split--map-open .race-detail-preview-map-rail,
.race-detail-preview-overlay--side-map-open .race-detail-preview-map-rail {
  display: none;
}

/* Карточка «окно» с картой */
.race-detail-preview-map-pane {
  box-sizing: border-box;
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.race-detail-preview-map-pane[hidden] {
  display: none !important;
}

.race-detail-preview-map-split--map-open .race-detail-preview-map-pane:not([hidden]),
.race-detail-preview-overlay--side-map-open .race-detail-preview-map-pane:not([hidden]) {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92) 0%, rgba(15, 23, 42, 0.78) 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35) inset,
    0 14px 38px rgba(0, 0, 0, 0.38);
  overflow: hidden;
}

.race-detail-preview-map-pane__head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  margin-bottom: 7px;
  padding: 0.36rem 0.55rem 6px 0.55rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(2, 6, 23, 0.45);
}

.race-detail-preview-map-pane__title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(248, 250, 252, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.race-detail-preview-map-pane__collapse {
  flex-shrink: 0;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.28rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.7);
  color: rgba(248, 250, 252, 0.92);
  cursor: pointer;
  transition:
    border-color 0.14s ease,
    background 0.14s ease;
}

.race-detail-preview-map-pane__collapse:hover {
  border-color: rgba(251, 202, 31, 0.45);
  background: rgba(30, 41, 59, 0.9);
}

.race-detail-preview-map-pane__collapse:focus-visible {
  outline: 2px solid #fbca1f;
  outline-offset: 2px;
}

.race-detail-preview-map-pane:not([hidden]) .race-detail-map-objects__layers {
  box-sizing: border-box;
  width: calc(100% - 0.84rem);
  max-width: 100%;
  margin: 0 auto 0.45rem !important;
}

.race-detail-preview-map-pane:not([hidden]) .race-detail-map-objects {
  flex: 0 0 auto;
  box-sizing: border-box;
  /* 100% + боковые margin в колонке flex даёт перекос вправо; inset через calc + auto */
  width: calc(100% - 0.84rem);
  max-width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 0;
  height: auto;
  position: relative;
  margin: 0 auto 0.45rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.28);
}

.race-detail-preview-overlay--side-map-open .race-detail-preview-overlay__map-edge {
  flex: 1 1 auto;
  min-width: 0;
  align-items: stretch;
  justify-content: stretch;
}

.race-detail-preview-overlay--side-map-open .race-detail-preview-overlay__cluster {
  width: min(1180px, calc(100vw - 1rem));
  max-width: calc(100vw - 1rem);
}

body.page-races-map #race_detail_preview.race-detail-preview-overlay--side-map-open .race-detail-preview-overlay__cluster {
  width: min(1180px, calc(100vw - 16px));
  max-width: calc(100vw - 16px);
}

@media (max-width: 680px) {
  .race-detail-preview-map-split {
    flex-direction: column;
    gap: 0.45rem;
  }

  .race-detail-preview-map-split--map-open .race-detail-preview-info-surface {
    flex: 1 1 auto;
  }

  .race-detail-preview-map-split .race-detail-preview-map-dock,
  .race-detail-preview-overlay__map-edge .race-detail-preview-map-dock {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    flex-direction: row;
    justify-content: flex-end;
    align-items: flex-start;
  }

  .race-detail-preview-map-split:not(.race-detail-preview-map-split--map-open) .race-detail-preview-map-rail,
  .race-detail-preview-overlay:not(.race-detail-preview-overlay--side-map-open)
    .race-detail-preview-overlay__map-edge
    .race-detail-preview-map-rail {
    width: auto;
    padding-top: 0;
  }

  .race-detail-preview-map-split--map-open .race-detail-preview-map-dock,
  .race-detail-preview-overlay--side-map-open .race-detail-preview-overlay__map-edge .race-detail-preview-map-dock {
    flex-direction: column;
    width: 100%;
    margin-top: 0;
  }

  .race-detail-preview-map-pane:not([hidden]) .race-detail-map-objects {
    width: calc(100% - 0.84rem);
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    aspect-ratio: 1 / 1;
    min-height: 0;
  }

  .race-detail-preview-overlay--side-map-open .race-detail-preview-overlay__cluster {
    width: min(572px, calc(100vw - 1rem));
    max-width: calc(100vw - 1rem);
  }

  body.page-races-map #race_detail_preview.race-detail-preview-overlay--side-map-open .race-detail-preview-overlay__cluster {
    width: min(572px, calc(100vw - 16px));
    max-width: calc(100vw - 16px);
  }
}

/* Вкладки: тот же паттерн, что .content-subtop-mode-toggle (карта / режимы) */
.race-detail-preview-tabs__bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  padding: 0.25rem;
  margin: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.55);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03),
    0 8px 20px rgba(0, 0, 0, 0.18);
}

.race-detail-preview-tabs__btn {
  flex: 1;
  margin: 0;
  padding: 0.3rem 0.42rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition:
    background 0.14s ease,
    color 0.14s ease,
    border-color 0.14s ease,
    box-shadow 0.14s ease;
}

.race-detail-preview-tabs__btn:hover:not(.race-detail-preview-tabs__btn--active) {
  color: rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.race-detail-preview-tabs__btn:focus-visible {
  outline: 2px solid #fbca1f;
  outline-offset: 2px;
}

.race-detail-preview-tabs__btn--active {
  color: #000;
  background: rgba(251, 202, 31, 0.95);
  border-color: rgba(0, 0, 0, 0.7);
  box-shadow: 0.05em 0.05em rgba(0, 0, 0, 0.2);
}

.race-detail-preview-tabs__btn--active:hover {
  color: #000;
  background: rgba(251, 202, 31, 1);
}

.race-detail-preview-tabs__panels {
  flex: 1;
  min-height: 0;
  margin-top: 0.4rem;
  padding: 0.45rem 0.5rem 0.52rem;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.82) 0%, rgba(15, 23, 42, 0.48) 100%);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.race-detail-preview-tabs__panel[hidden] {
  display: none !important;
}

.race-detail-preview-tabs__panel:not([hidden]) {
  display: block;
}

.race-detail-preview-overlay .race-detail-preview-tabs__panel > p {
  margin: 0;
  padding: 0.55rem 0.45rem;
  text-align: center;
  font-size: 0.68rem;
  line-height: 1.35;
  color: rgba(203, 213, 225, 0.82);
  border-radius: 7px;
  border: 1px dashed rgba(148, 163, 184, 0.26);
  background: rgba(2, 6, 23, 0.4);
}

.race-detail-preview-tab-panel__title {
  margin: 0 0 0.35rem;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(248, 250, 252, 0.92);
}

.race-detail-preview__top {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  min-width: 0;
}

/* Во всю ширину листа: компенсируем padding .race-detail-preview-overlay__body */
.race-detail-preview__cover-strip {
  margin-left: -0.5rem;
  margin-right: -0.5rem;
  width: calc(100% + 1rem);
  max-height: 12rem;
  overflow: hidden;
  border-bottom: 1px solid rgba(0, 0, 0, 0.35);
  background: rgba(2, 6, 23, 0.75);
  box-sizing: border-box;
}

.race-detail-preview__cover-full {
  display: block;
  width: 100%;
  height: clamp(7rem, 28vw, 12rem);
  max-height: 12rem;
  object-fit: cover;
}

.race-detail-preview__top-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.race-detail-preview__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem 0.42rem;
  align-items: center;
}

.race-detail-preview__facts--one-row {
  flex-wrap: nowrap;
  gap: 0.32rem;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 0.08rem;
  margin-inline: -0.02rem;
}

.race-detail-preview__facts--one-row::-webkit-scrollbar {
  height: 5px;
}

.race-detail-preview__facts--one-row::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 4px;
}

.race-detail-preview__fact {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 0.28rem;
  max-width: 100%;
  padding: 0.12rem 0.42rem;
  margin: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.55);
  font-size: 0.62rem;
  font-weight: 650;
  line-height: 1.35;
  color: rgba(248, 250, 252, 0.88);
  box-sizing: border-box;
}

.race-detail-preview__fact-lbl {
  flex-shrink: 0;
  font-weight: 800;
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(251, 202, 31, 0.78);
}

.race-detail-preview__facts--one-row .race-detail-preview__fact {
  flex: 0 0 auto;
  max-width: unset;
  white-space: nowrap;
}

.race-detail-preview__main {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.race-detail-preview__section--about {
  margin: 0;
  padding: 0.38rem 0.45rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(2, 6, 23, 0.28);
}

.race-detail-preview__dates {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 750;
  line-height: 1.3;
  color: rgba(248, 250, 252, 0.94);
}

.race-detail-preview__meta {
  margin: 0;
}

/* Слева: статус + номер заявки (+ чипы); справа: отмена регистрации */
.race-detail-preview__me-reg-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin: 0.32rem 0 0;
  min-width: 0;
  padding: 0.22rem 0.4rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.45);
  /* Как у .race-detail-preview__receipt-missing-btn */
  font: inherit;
  font-size: 0.85rem;
  line-height: 1.35;
}

.race-detail-preview__me-reg-bar__left {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.race-detail-preview__me-reg-bar__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.race-detail-preview__me-reg-bar__status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
}

.race-detail-preview__me-reg-bar__receipt-ok {
  flex-shrink: 0;
  font: inherit;
  font-size: inherit;
  line-height: inherit;
  font-weight: 650;
  color: rgba(167, 243, 208, 0.95);
  padding: 0.04rem 0.38rem;
  border-radius: 5px;
  border: 1px solid rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.12);
  white-space: nowrap;
}

.race-detail-preview__me-reg-bar__status {
  flex-shrink: 0;
  font: inherit;
  font-size: inherit;
  line-height: inherit;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #10b981;
  padding: 0.04rem 0.38rem;
  border-radius: 5px;
  border: 1px solid rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.12);
  white-space: nowrap;
}

.race-detail-preview__me-reg-bar__id {
  font: inherit;
  font-size: inherit;
  line-height: inherit;
  font-weight: 500;
  color: rgba(226, 232, 240, 0.9);
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.race-detail-preview__me-reg-bar__id-num {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fde68a;
  letter-spacing: 0.03em;
}

.race-detail-preview__me-reg-bar .race-detail-preview__me-reg--paid,
.race-detail-preview__me-reg-bar .race-detail-preview__me-reg--waitlist {
  flex-shrink: 0;
  margin: 0;
  padding: 0.1rem 0.32rem;
  border-radius: 5px;
  font: inherit;
  font-size: inherit;
  line-height: inherit;
  font-weight: 750;
  border-width: 1px;
}

.race-detail-preview__me-reg-bar .race-detail-preview__reg-cancel-btn {
  flex: 0 0 auto;
  align-self: center;
  margin: 0;
  padding: 0.12rem 0.42rem;
  border-radius: 6px;
  border-width: 1px;
  font: inherit;
  font-size: inherit;
  line-height: inherit;
  font-weight: 650;
  box-shadow: none;
}

.race-detail-preview__payment-hint {
  margin: 0 0 0.35rem;
  padding: 0.38rem 0.45rem;
  border-radius: 8px;
  border: 1px dashed rgba(251, 202, 31, 0.35);
  background: rgba(251, 202, 31, 0.06);
  font-size: 0.74rem !important;
  line-height: 1.42;
}

.race-detail-preview__me-reg--paid {
  margin: 0;
  padding: 0.28rem 0.45rem;
  border-radius: 8px;
  font-weight: 800;
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(74, 222, 128, 0.48);
  line-height: 1.35;
}

.race-detail-preview__me-reg--waitlist {
  margin: 0;
  padding: 0.28rem 0.45rem;
  border-radius: 8px;
  font-weight: 800;
  color: #0f172a;
  background: rgba(251, 191, 36, 0.88);
  border: 1px solid rgba(245, 158, 11, 0.65);
  line-height: 1.35;
}

.race-detail-preview__reg {
  margin: 0;
}

.race-detail-preview__reg a {
  color: #fde68a;
  font-weight: 700;
}

.race-detail-preview__results {
  margin: 0.45rem 0 0;
}

.race-detail-preview__results-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem !important;
  padding: 0.26rem 0.65rem !important;
  text-decoration: none;
}

.race-detail-preview__reg-actions {
  margin: 0.25rem 0 0;
}

.race-detail-preview__reg-open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.28rem 0.65rem;
  border-radius: 8px;
  border: 2px solid #000;
  background: rgba(251, 202, 31, 0.95);
  color: #0f172a;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0.06em 0.06em rgba(0, 0, 0, 0.28);
}

.race-detail-preview__reg-open-btn:hover {
  filter: brightness(1.03);
}

.race-detail-preview__reg-open-btn:focus-visible {
  outline: 2px solid #fbca1f;
  outline-offset: 2px;
}

.race-detail-preview__reg-cancel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.28rem 0.65rem;
  border-radius: 8px;
  border: 2px solid rgba(248, 113, 113, 0.55);
  background: rgba(127, 29, 29, 0.45);
  color: #fecaca;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.race-detail-preview__reg-cancel-btn:hover {
  filter: brightness(1.08);
}

.race-detail-preview__reg-cancel-btn:focus-visible {
  outline: 2px solid #f87171;
  outline-offset: 2px;
}

.race-detail-preview__receipt-pending {
  margin: 0.28rem 0 0.45rem;
}

.race-detail-preview__receipt-missing-btn {
  display: inline;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  color: #fbca1f;
  font: inherit;
  font-size: 0.85rem;
  line-height: 1.35;
  text-decoration: underline;
  cursor: pointer;
  text-align: left;
}

.race-detail-preview__receipt-missing-btn:hover {
  color: #fde68a;
}

.race-detail-preview__receipt-missing-btn:focus-visible {
  outline: 2px solid #fbca1f;
  outline-offset: 2px;
}

/* Как .route-description-editable: переносы, эмодзи, ссылки, абзацы */
.race-detail-preview__desc {
  margin-top: 0;
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif, 'Segoe UI Emoji',
    'Apple Color Emoji', 'Noto Color Emoji', emoji;
}

.race-detail-preview__desc p {
  margin: 0 0 0.55rem;
}

.race-detail-preview__desc p:last-child {
  margin-bottom: 0;
}

/* Как в contenteditable: абзацы через <div>…</div> */
.race-detail-preview__desc > div {
  margin: 0 0 0.4rem;
}

.race-detail-preview__desc > div:last-child {
  margin-bottom: 0;
}

.race-detail-preview__desc a {
  color: #7dd3fc;
  text-decoration: underline;
}

.race-detail-preview__desc a:hover {
  color: #bae6fd;
}

.race-detail-preview__desc strong,
.race-detail-preview__desc b {
  font-weight: 700;
}

.race-detail-preview__desc em,
.race-detail-preview__desc i {
  font-style: italic;
}

.race-detail-preview__desc u {
  text-decoration: underline;
}

.race-detail-preview__desc ul,
.race-detail-preview__desc ol {
  margin: 0.35rem 0 0.55rem;
  padding-left: 1.35rem;
}

.race-detail-preview__desc li {
  margin: 0.2rem 0;
}

.race-detail-preview__desc blockquote {
  margin: 0.45rem 0;
  padding: 0.35rem 0.55rem;
  border-left: 3px solid rgba(251, 202, 31, 0.55);
  background: rgba(2, 6, 23, 0.35);
  border-radius: 0 6px 6px 0;
}

.race-detail-preview__desc hr {
  margin: 0.55rem 0;
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
}

.race-detail-preview__section--about > .race-detail-preview__nodesc {
  margin: 0;
}

.race-detail-preview__desc img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.race-detail-preview__nodesc {
  margin: 0;
  opacity: 0.85;
}

.race-events-row__plan-btn {
  margin: 0;
  padding: 0.18rem 0.45rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.55);
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.12s ease;
}

.race-events-row__plan-btn:hover {
  background: rgba(251, 202, 31, 0.18);
  border-color: rgba(251, 202, 31, 0.55);
  color: #fff8e6;
}

.race-events-row__plan-btn:active {
  transform: scale(0.96);
}

.race-events-row__plan-btn:focus-visible {
  outline: 2px solid rgba(251, 202, 31, 0.75);
  outline-offset: 2px;
}

.race-events-row__plan-btn--active {
  border-color: rgba(251, 202, 31, 0.72);
  background: rgba(251, 202, 31, 0.28);
  color: #0f172a;
}

.race-events-row__plan-btn--active:hover {
  background: rgba(251, 202, 31, 0.4);
  border-color: rgba(251, 202, 31, 0.9);
  color: #0f172a;
}

.race-events-row {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  min-height: 4.5rem;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.12),
    0 4px 14px rgba(0, 0, 0, 0.18);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.race-events-row:hover {
  border-color: rgba(251, 202, 31, 0.42);
  box-shadow:
    0 0 0 1px rgba(251, 202, 31, 0.12),
    0 6px 22px rgba(0, 0, 0, 0.28);
}

.race-events-row:hover::after {
  background: linear-gradient(
    165deg,
    rgba(0, 0, 0, 0.4) 0%,
    rgba(0, 0, 0, 0.14) 44%,
    rgba(251, 202, 31, 0.1) 100%
  );
}

.race-events-row__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.race-events-row__bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.race-events-row::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    165deg,
    rgba(0, 0, 0, 0.52) 0%,
    rgba(0, 0, 0, 0.22) 42%,
    rgba(0, 0, 0, 0.38) 100%
  );
}

.race-events-row__body {
  position: relative;
  z-index: 2;
  padding: 0.45rem 0.55rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.race-events-row__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.race-events-row__title {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.98);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75), 0 0 12px rgba(0, 0, 0, 0.35);
}

.race-events-row__date {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.race-events-row__meta {
  margin-top: 0.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  align-items: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

/* Нижняя строка: чип области по ширине текста, кнопки справа (без растягивания чипа до кнопок) */
.race-events-row__region-line {
  margin-top: 0.28rem;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  justify-content: space-between;
  text-align: left;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.race-events-row__region-line .race-events-row__actions {
  margin-left: 0;
  flex-shrink: 0;
}

.race-events-row__region {
  padding: 0.06rem 0.32rem;
  border-radius: 4px;
  border: 1px solid rgba(251, 202, 31, 0.35);
  background: rgba(251, 202, 31, 0.12);
  font-weight: 700;
  font-size: 0.65rem;
  color: #fef9c3 !important;
}

.race-events-row__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  margin-left: auto;
}

.race-events-row__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.55);
  color: rgba(255, 255, 255, 0.95);
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.12s ease;
}

.race-events-row__icon-btn:hover {
  background: rgba(251, 202, 31, 0.18);
  border-color: rgba(251, 202, 31, 0.55);
  color: #fff8e6;
}

.race-events-row__icon-btn:active {
  transform: scale(0.96);
}

.race-events-row__icon-btn:focus-visible {
  outline: 2px solid rgba(251, 202, 31, 0.75);
  outline-offset: 2px;
}

.race-events-row__icon-svg {
  width: 16px;
  height: 16px;
  display: block;
}

.race-events-row__icon-btn--pin .race-events-row__icon-svg {
  width: 17px;
  height: 17px;
  margin-bottom: 1px;
}

.race-location-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.race-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.28rem 0.55rem;
  border-radius: 10px;
  border: 2px solid #000;
  background: rgba(251, 202, 31, 0.95);
  color: #000;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.1;
  cursor: pointer;
  box-shadow: 0.08em 0.08em rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.race-btn-primary:hover {
  background: rgba(251, 202, 31, 1);
  transform: translate(-0.04em, -0.04em);
  box-shadow: 0.12em 0.12em rgba(0, 0, 0, 0.38);
}

.race-btn-primary:active {
  transform: translate(0.04em, 0.04em);
  box-shadow: 0.06em 0.06em rgba(0, 0, 0, 0.35);
}

.race-btn-primary:disabled,
.race-btn-primary[disabled] {
  cursor: not-allowed;
  transform: none;
  box-shadow: 0.04em 0.04em rgba(0, 0, 0, 0.22);
  border-color: rgba(0, 0, 0, 0.42);
  /* Чуть приглушённый жёлтый: видно, что это та же кнопка, но неактивна */
  background: rgba(234, 201, 96, 0.82);
  color: rgba(15, 23, 42, 0.72);
  opacity: 0.94;
  filter: saturate(0.72) brightness(0.96);
}

.race-btn-primary:disabled:hover,
.race-btn-primary[disabled]:hover,
.race-btn-primary:disabled:active,
.race-btn-primary[disabled]:active {
  background: rgba(234, 201, 96, 0.82);
  color: rgba(15, 23, 42, 0.72);
  transform: none;
  box-shadow: 0.04em 0.04em rgba(0, 0, 0, 0.22);
  filter: saturate(0.72) brightness(0.96);
}

.race-events-row__reg-btn {
  border: 0;
  border-radius: 999px;
  background: #f5c84c;
  color: #111;
  padding: 2px 10px;
  font-size: 12px;
  line-height: 18px;
  cursor: pointer;
}

.race-events-row__reg-btn:hover {
  filter: brightness(0.98);
}

.race-events-row__reg-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  vertical-align: middle;
}

.race-events-row__reg--paid {
  border-radius: 8px;
  padding: 2px 10px;
  font-size: 12px;
  line-height: 18px;
  font-weight: 800;
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.22);
  border: 1px solid rgba(74, 222, 128, 0.5);
}

.race-events-row__reg--waitlist {
  border-radius: 8px;
  padding: 2px 10px;
  font-size: 12px;
  line-height: 18px;
  font-weight: 800;
  color: #0f172a;
  background: rgba(251, 191, 36, 0.9);
  border: 1px solid rgba(245, 158, 11, 0.55);
}

.race-participant-reg-modal__dialog {
  max-width: 520px;
}

.race-participant-reg-done-modal__dialog {
  max-width: 520px;
}

.race-participant-reg-done-modal__body {
  padding: 0 2px 4px;
}

.race-participant-reg-modal__body {
  padding: 12px 14px;
}

.race-participant-reg-modal__payment {
  white-space: pre-wrap;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  line-height: 1.45;
}

.race-participant-class-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.race-participant-class-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.race-participant-class-quota {
  color: rgba(203, 213, 225, 0.75);
  font-weight: 650;
  white-space: nowrap;
}

.race-participant-class-waitlist {
  color: rgba(251, 191, 36, 0.92);
  font-weight: 650;
  white-space: nowrap;
}

/* Компактная вторичная кнопка под списком классов (~вдвое меньше общего .race-btn-secondary) */
.race-btn-secondary.race-participant-class-expand-btn {
  align-self: flex-start;
  margin-top: 0.35rem;
  padding: 0.14rem 0.32rem;
  border-radius: 6px;
  border-width: 1px;
  border-color: rgba(255, 255, 255, 0.14);
  font-family: system-ui, "Segoe UI", Roboto, sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  box-shadow: 0.03em 0.03em rgba(0, 0, 0, 0.18);
}

.race-btn-secondary.race-participant-class-expand-btn:hover {
  transform: translate(-0.02em, -0.02em);
  box-shadow: 0.05em 0.05em rgba(0, 0, 0, 0.22);
}

.race-btn-secondary.race-participant-class-expand-btn:active {
  transform: translate(0.02em, 0.02em);
  box-shadow: 0.02em 0.02em rgba(0, 0, 0, 0.16);
}

.race-participant-class-list.race-participant-class-list--collapsed {
  gap: 6px;
}

.race-participant-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.race-participant-field label {
  display: block;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  margin-bottom: 4px;
}

.race-participant-field input,
.race-participant-field select {
  width: 100%;
  height: 34px;
  border-radius: 10px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(20, 20, 20, 0.6);
  color: #fff;
}

.race-participant-field input:focus,
.race-participant-field select:focus {
  outline: none;
  border-color: rgba(245, 200, 76, 0.7);
  box-shadow: 0 0 0 3px rgba(245, 200, 76, 0.15);
}

.race-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.35rem 0.6rem;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  background: rgba(148, 163, 184, 0.35);
  color: rgba(255, 255, 255, 0.95);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.1;
  cursor: pointer;
  box-shadow: 0.08em 0.08em rgba(0, 0, 0, 0.28);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.race-btn-secondary:hover {
  background: rgba(148, 163, 184, 0.48);
  transform: translate(-0.04em, -0.04em);
  box-shadow: 0.12em 0.12em rgba(0, 0, 0, 0.32);
}

.race-btn-secondary:active {
  transform: translate(0.04em, 0.04em);
  box-shadow: 0.06em 0.06em rgba(0, 0, 0, 0.28);
}

.race-reg-section {
  padding: 0.45rem 0.55rem;
}

.race-reg-section + .race-reg-section {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.race-reg-classes,
.race-protocol-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.28rem 0.45rem;
}

.race-protocol-cols__hint {
  line-height: 1.45;
}

/* Стилизованные контролы полей регистрации (не «голый» Bootstrap) */
.race-protocol-select {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  border: 1px solid rgba(100, 116, 139, 0.45);
  border-radius: 999px;
  background-color: rgba(15, 23, 42, 0.92);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%2394a3b8' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round' d='M2.5 4.25L6 7.75l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  background-size: 0.55rem;
  color: rgba(248, 250, 252, 0.96);
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  line-height: 1.25;
  padding: 0.3rem 1.45rem 0.3rem 0.68rem;
  min-width: 6.75rem;
  max-width: 9.25rem;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.race-protocol-select:hover {
  border-color: rgba(245, 200, 76, 0.42);
}

.race-protocol-select:focus {
  outline: none;
  border-color: rgba(245, 200, 76, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 2px rgba(245, 200, 76, 0.2);
}

.race-protocol-select--compact {
  min-width: 5.1rem;
  max-width: 6.6rem;
  padding: 0.24rem 1.2rem 0.24rem 0.52rem;
  font-size: 0.58rem;
}

.race-protocol-select--modal {
  display: block;
  width: 100%;
  max-width: none;
  min-width: 0;
}

.race-protocol-input {
  margin: 0;
  border: 1px solid rgba(100, 116, 139, 0.38);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.65);
  color: rgba(248, 250, 252, 0.98);
  font-size: 0.64rem;
  line-height: 1.3;
  padding: 0.26rem 0.48rem;
  min-height: 1.75rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.race-protocol-input::placeholder {
  color: rgba(148, 163, 184, 0.65);
}

.race-protocol-input:focus {
  outline: none;
  border-color: rgba(245, 200, 76, 0.55);
  box-shadow: 0 0 0 2px rgba(245, 200, 76, 0.16);
}

.race-protocol-textarea {
  display: block;
  width: 100%;
  margin: 0.32rem 0 0;
  border: 1px solid rgba(100, 116, 139, 0.35);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.55);
  color: rgba(248, 250, 252, 0.96);
  font-size: 0.64rem;
  line-height: 1.35;
  padding: 0.38rem 0.48rem;
  resize: vertical;
  min-height: 4rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.race-protocol-textarea::placeholder {
  color: rgba(148, 163, 184, 0.6);
}

.race-protocol-textarea:focus {
  outline: none;
  border-color: rgba(245, 200, 76, 0.55);
  box-shadow: 0 0 0 2px rgba(245, 200, 76, 0.14);
}

.race-protocol-textarea--compact {
  min-height: 3.2rem;
  font-size: 0.6rem;
  padding: 0.3rem 0.42rem;
}

.race-protocol-col {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.38rem 0.42rem;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  user-select: none;
  flex: 1 1 auto;
  min-width: 0;
}

.race-protocol-col-row {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.34rem 0.48rem 0.38rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: linear-gradient(155deg, rgba(30, 41, 59, 0.55), rgba(15, 23, 42, 0.42));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.race-protocol-col-row__main {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
}

.race-protocol-col-row__main .race-protocol-select {
  flex: 0 0 auto;
}

.race-protocol-col-listopts {
  width: 100%;
  padding: 0.12rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.race-protocol-col-listopts__details {
  margin: 0;
  padding: 0.12rem 0 0;
}

.race-protocol-col-listopts__sum {
  list-style: none;
  cursor: pointer;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(186, 198, 216, 0.88);
  padding: 0.18rem 0;
  user-select: none;
}

.race-protocol-col-listopts__sum::-webkit-details-marker {
  display: none;
}

.race-protocol-col-listopts__sum::before {
  content: '';
  display: inline-block;
  width: 0.28rem;
  height: 0.28rem;
  margin-right: 0.35rem;
  border-right: 1.5px solid rgba(148, 163, 184, 0.75);
  border-bottom: 1.5px solid rgba(148, 163, 184, 0.75);
  transform: rotate(45deg) translateY(-0.06rem);
  transition: transform 0.18s ease;
}

.race-protocol-col-listopts__details[open] .race-protocol-col-listopts__sum::before {
  transform: rotate(225deg) translateY(-0.02rem);
}

.race-protocol-custom--compact {
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.race-protocol-custom__title {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(186, 198, 216, 0.82);
  margin: 0 0 0.28rem;
}

.race-protocol-custom__add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  margin-top: 0.28rem;
  padding: 0;
  border-radius: 10px;
  border: 1px dashed rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.35);
  color: rgba(226, 232, 240, 0.92);
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.race-protocol-custom__add:hover {
  border-color: rgba(245, 200, 76, 0.55);
  background: rgba(245, 200, 76, 0.1);
  color: rgba(254, 249, 195, 0.98);
}

.race-protocol-custom-row {
  margin-top: 0.22rem;
  padding: 0.28rem 0.38rem;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(2, 6, 23, 0.4);
}

.race-protocol-custom-row__head {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.38rem;
  min-width: 0;
}

.race-protocol-custom-row__name {
  flex: 1 1 auto;
  min-width: 0;
}

.race-protocol-custom-row__type {
  flex: 0 0 auto;
}

.race-protocol-custom-row__del {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: rgba(127, 29, 29, 0.35);
  color: rgba(254, 226, 226, 0.92);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.race-protocol-custom-row__del:hover {
  background: rgba(185, 28, 28, 0.55);
}

.race-protocol-custom-row__del:active {
  transform: scale(0.94);
}

.race-protocol-custom-row__listopts {
  margin-top: 0.28rem;
  padding-top: 0.22rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.race-protocol-custom-row__list-details {
  margin: 0;
}

.race-protocol-custom-row__list-sum {
  list-style: none;
  cursor: pointer;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(186, 198, 216, 0.78);
  padding: 0.12rem 0;
  user-select: none;
}

.race-protocol-custom-row__list-sum::-webkit-details-marker {
  display: none;
}

.race-protocol-custom-row__list-sum::before {
  content: '';
  display: inline-block;
  width: 0.26rem;
  height: 0.26rem;
  margin-right: 0.32rem;
  border-right: 1.5px solid rgba(148, 163, 184, 0.65);
  border-bottom: 1.5px solid rgba(148, 163, 184, 0.65);
  transform: rotate(45deg) translateY(-0.04rem);
  transition: transform 0.18s ease;
}

.race-protocol-custom-row__list-details[open] .race-protocol-custom-row__list-sum::before {
  transform: rotate(225deg) translateY(-0.02rem);
}

.race-reg-class {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.32rem 0.38rem;
  padding: 0.32rem 0.4rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
  cursor: default;
  user-select: none;
  min-width: 0;
}

.race-reg-classes-hint {
  font-size: 0.68rem;
  line-height: 1.38;
  color: rgba(226, 232, 240, 0.78);
  margin: 0 0 0.5rem;
  padding: 0.42rem 0.5rem;
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.race-reg-classes-hint strong {
  color: rgba(250, 250, 250, 0.98);
  font-weight: 800;
}

.race-reg-class__fields {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.3rem;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-end;
}

.race-reg-field {
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  padding: 0.06rem 0.26rem 0.06rem 0.22rem;
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.48);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.race-reg-field__lbl {
  font-size: 0.52rem;
  font-weight: 800;
  color: rgba(203, 213, 225, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* Узкая колонка квоты (до 3 цифр) */
.race-reg-field--quota {
  padding-left: 0.14rem;
  padding-right: 0.14rem;
  gap: 0.16rem;
}

.race-reg-field--quota .race-reg-class__quota.form-control,
.race-reg-field--quota .race-reg-custom-row__quota.form-control {
  width: 2.55rem;
  max-width: 2.75rem;
  min-width: 2rem;
}

.race-reg-field--waitlist {
  padding-left: 0.14rem;
  padding-right: 0.14rem;
  gap: 0.16rem;
}

.race-reg-field--waitlist .race-reg-class__waitlist.form-control,
.race-reg-field--waitlist .race-reg-custom-row__waitlist.form-control {
  width: 2.55rem;
  max-width: 2.75rem;
  min-width: 2rem;
}

.race-reg-class__label {
  flex: 0 1 4.25rem;
  min-width: 2.6rem;
  max-width: 32%;
}

.race-reg-class__chk {
  cursor: pointer;
  flex-shrink: 0;
}

.race-reg-class__fee,
.race-reg-class__quota,
.race-reg-class__waitlist,
.race-reg-bib-ranges__input {
  width: 4.25rem;
  max-width: 5rem;
  flex: 0 0 auto;
}

/* Скрыть системные стрелки number у цены/квоты (ввод с клавиатуры) */
.race-reg-class__fee[type='number']::-webkit-inner-spin-button,
.race-reg-class__fee[type='number']::-webkit-outer-spin-button,
.race-reg-class__quota[type='number']::-webkit-inner-spin-button,
.race-reg-class__quota[type='number']::-webkit-outer-spin-button,
.race-reg-class__waitlist[type='number']::-webkit-inner-spin-button,
.race-reg-class__waitlist[type='number']::-webkit-outer-spin-button,
.race-reg-custom-row__fee[type='number']::-webkit-inner-spin-button,
.race-reg-custom-row__fee[type='number']::-webkit-outer-spin-button,
.race-reg-custom-row__quota[type='number']::-webkit-inner-spin-button,
.race-reg-custom-row__quota[type='number']::-webkit-outer-spin-button,
.race-reg-custom-row__waitlist[type='number']::-webkit-inner-spin-button,
.race-reg-custom-row__waitlist[type='number']::-webkit-outer-spin-button,
#race_custom_class_fee[type='number']::-webkit-inner-spin-button,
#race_custom_class_fee[type='number']::-webkit-outer-spin-button,
#race_custom_class_quota[type='number']::-webkit-inner-spin-button,
#race_custom_class_quota[type='number']::-webkit-outer-spin-button,
#race_custom_class_waitlist[type='number']::-webkit-inner-spin-button,
#race_custom_class_waitlist[type='number']::-webkit-outer-spin-button,
.race-reg-bib-ranges__input[type='number']::-webkit-inner-spin-button,
.race-reg-bib-ranges__input[type='number']::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.race-reg-class__fee[type='number'],
.race-reg-class__quota[type='number'],
.race-reg-class__waitlist[type='number'],
.race-reg-custom-row__fee[type='number'],
.race-reg-custom-row__quota[type='number'],
.race-reg-custom-row__waitlist[type='number'],
#race_custom_class_fee[type='number'],
#race_custom_class_quota[type='number'],
#race_custom_class_waitlist[type='number'],
.race-reg-bib-ranges__input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Цена / квота: ниже по высоте, умеренное скругление, фон как у тёмных полей формы */
.race-reg-class__fee.form-control,
.race-reg-class__quota.form-control,
.race-reg-class__waitlist.form-control,
.race-reg-custom-row__fee.form-control,
.race-reg-custom-row__quota.form-control,
.race-reg-custom-row__waitlist.form-control,
.race-reg-bib-ranges__input.form-control {
  box-sizing: border-box;
  min-height: 0;
  height: 1.52rem;
  padding: 0.08rem 0.4rem;
  line-height: 1.15;
  font-size: 0.66rem;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.55);
  color: #f1f5f9;
}

.race-reg-class__fee.form-control::placeholder,
.race-reg-class__quota.form-control::placeholder,
.race-reg-class__waitlist.form-control::placeholder,
.race-reg-custom-row__fee.form-control::placeholder,
.race-reg-custom-row__quota.form-control::placeholder,
.race-reg-custom-row__waitlist.form-control::placeholder,
.race-reg-bib-ranges__input.form-control::placeholder {
  color: rgba(148, 163, 184, 0.85);
}

.race-reg-class__fee.form-control:focus,
.race-reg-class__quota.form-control:focus,
.race-reg-class__waitlist.form-control:focus,
.race-reg-custom-row__fee.form-control:focus,
.race-reg-custom-row__quota.form-control:focus,
.race-reg-custom-row__waitlist.form-control:focus,
.race-reg-bib-ranges__input.form-control:focus {
  outline: none;
  border-color: rgba(251, 202, 31, 0.55);
  box-shadow: 0 0 0 2px rgba(251, 202, 31, 0.2);
  background: rgba(30, 41, 59, 0.72);
  color: #f8fafc;
}

/* Модалка «Добавить класс»: те же поля стоимость / квота / очередь */
#race_custom_class_fee.form-control,
#race_custom_class_quota.form-control,
#race_custom_class_waitlist.form-control {
  box-sizing: border-box;
  min-height: 0;
  height: 1.58rem;
  padding: 0.12rem 0.48rem;
  line-height: 1.2;
  font-size: 0.78rem;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.55);
  color: #f1f5f9;
}

#race_custom_class_fee.form-control::placeholder,
#race_custom_class_quota.form-control::placeholder,
#race_custom_class_waitlist.form-control::placeholder {
  color: rgba(148, 163, 184, 0.85);
}

#race_custom_class_fee.form-control:focus,
#race_custom_class_quota.form-control:focus,
#race_custom_class_waitlist.form-control:focus {
  outline: none;
  border-color: rgba(251, 202, 31, 0.55);
  box-shadow: 0 0 0 2px rgba(251, 202, 31, 0.2);
  background: rgba(30, 41, 59, 0.72);
  color: #f8fafc;
}

.race-acc {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.18);
  overflow: hidden;
}

.race-acc + .race-acc {
  margin-top: 0.45rem;
}

.race-acc__sum {
  list-style: none;
  cursor: pointer;
  padding: 0.45rem 0.55rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.race-acc__sum::-webkit-details-marker {
  display: none;
}

.race-acc__sum::after {
  content: '▾';
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(248, 250, 252, 0.92);
  font-weight: 900;
  line-height: 1;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

details.race-acc[open] > summary.race-acc__sum::after {
  transform: rotate(180deg);
  background: rgba(251, 202, 31, 0.18);
  border-color: rgba(251, 202, 31, 0.35);
}

.race-acc__title {
  font-weight: 900;
  font-size: 0.88rem;
  color: rgba(248, 250, 252, 0.95);
}

.race-acc > *:not(summary) {
  padding: 0.5rem 0.55rem 0.6rem;
}

.race-reg-custom__adder {
  display: flex;
  align-items: center;
  margin-top: 0.28rem;
}

.race-reg-custom__adder .race-protocol-custom__add {
  margin-top: 0;
}

.race-reg-custom__list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.race-reg-custom-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.32rem 0.38rem;
  padding: 0.32rem 0.4rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
  cursor: default;
  min-width: 0;
}

.race-reg-custom-row__name {
  font-weight: 800;
  color: rgba(248, 250, 252, 0.96);
  font-size: 0.62rem;
  flex: 0 1 3.6rem;
  max-width: 28%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.race-reg-custom-row__fields {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.3rem;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-end;
}

.race-reg-custom-row__fee,
.race-reg-custom-row__quota,
.race-reg-custom-row__waitlist {
  width: 4.25rem;
  max-width: 5rem;
}

.race-reg-class__fee:disabled,
.race-reg-class__quota:disabled,
.race-reg-class__waitlist:disabled,
.race-reg-custom-row__fee:disabled,
.race-reg-custom-row__quota:disabled,
.race-reg-custom-row__waitlist:disabled,
.race-reg-bib-ranges__input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.race-reg-bib-ranges {
  margin-top: 0.35rem;
}

.race-reg-bib-ranges__list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.race-reg-bib-ranges__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  padding: 0.35rem 0.4rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.race-reg-bib-ranges__class {
  min-width: 5.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: rgba(248, 250, 252, 0.96);
}

.race-reg-bib-ranges__fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
}

.race-reg-bib-ranges__field {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
}

.race-reg-bib-ranges__edge-lbl {
  font-size: 0.58rem;
  color: rgba(226, 232, 240, 0.75);
  white-space: nowrap;
}

.race-reg-bib-ranges--manual {
  opacity: 0.55;
  pointer-events: none;
}

.race-reg-bib-ranges--manual .race-reg-bib-ranges__class,
.race-reg-bib-ranges--manual .race-reg-bib-ranges__edge-lbl {
  color: rgba(148, 163, 184, 0.95);
}

.race-reg-bib-ranges--manual .race-reg-bib-ranges__row {
  background: rgba(30, 41, 59, 0.35);
  border-color: rgba(255, 255, 255, 0.05);
}

.race-reg-class__chk,
.race-protocol-col__chk {
  margin: 0;
}

.race-reg-class__label,
.race-protocol-col__label {
  color: rgba(248, 250, 252, 0.96);
  font-weight: 700;
  font-size: 0.62rem;
}

.race-cover-pick {
  display: grid;
  gap: 0.4rem;
}

.race-cover-preview {
  width: 100%;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.12);
}

.race-cover-preview--head {
  height: 100%;
  width: 100%;
  border-radius: 0;
  border: none;
  position: absolute;
  inset: 0;
}

.race-cover-head {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.35rem;
}

.race-cover-head__frame {
  position: relative;
  height: 140px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.12);
}

.race-cover-head__tools {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.race-cover-head__zoom-btn {
  width: 27px;
  height: 27px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.72);
  color: rgba(255, 255, 255, 0.92);
  font-weight: 900;
  font-size: 18px;
  line-height: 0;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
}

.race-cover-head__zoom-btn:hover {
  background: rgba(15, 23, 42, 0.9);
}

.race-cover-head__pick {
  width: 27px;
  height: 27px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.72);
  color: rgba(255, 255, 255, 0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.race-cover-head__pick:hover {
  background: rgba(15, 23, 42, 0.9);
}

.race-cover-head__pick svg {
  width: 14px;
  height: 14px;
  display: block;
}

.race-cover-head__file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.race-form-status--error {
  color: rgba(254, 242, 242, 0.98);
  background: rgba(185, 28, 28, 0.78);
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.race-form-status--ok {
  color: rgba(240, 253, 244, 0.98);
  background: rgba(21, 128, 61, 0.62);
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
}

.race-form-status--muted {
  opacity: 0.92;
}

.race-modal--minimized .route-desc-link-modal__backdrop {
  display: none;
}

.race-modal--minimized {
  pointer-events: none;
}

.race-modal--minimized .route-desc-link-modal__dialog {
  position: fixed;
  right: 12px;
  bottom: 12px;
  width: min(360px, calc(100vw - 24px));
  max-height: 150px;
  overflow: hidden;
  z-index: 14000;
  pointer-events: auto;
}

.race-modal--minimized .race-modal__head-row,
.race-modal--minimized .route-desc-link-modal__title {
  margin-bottom: 0.35rem;
}

.race-modal--minimized .race-modal__head-row .route-desc-link-modal__title {
  margin-bottom: 0;
}

.race-modal--minimized .race-cover-head,
.race-modal--minimized .route-description-editor,
.race-modal--minimized .route-desc-link-modal__actions {
  display: none;
}

.race-modal--minimized .race-modal__row,
.race-modal--minimized .form-group {
  margin-bottom: 0.35rem !important;
}

.race-cover-head__preview {
  display: grid;
  gap: 0.25rem;
}

.race-cover-head__controls {
  display: grid;
  gap: 0.25rem;
}

.race-cover-head__note {
  opacity: 0.9;
}

.race-location-pin {
  width: 14px;
  height: 14px;
  transform: translateY(-10px);
}

.race-location-pin__dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: rgba(251, 202, 31, 0.95);
  border: 2px solid rgba(0, 0, 0, 0.85);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.race-events-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.06);
}

.race-events-row__reg a {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: underline;
}

.race-modal__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.race-modal .race-marsh-cat-toggle {
  flex-wrap: wrap;
  row-gap: 0.35rem;
}

.race-marsh-cat-group--locked .race-marsh-cat-toggle {
  pointer-events: none;
  opacity: 0.78;
}

/* Модалка гонки: шире, ограниченная по высоте; слева обложка и поля, справа описание на всю высоту */
.race-modal.route-desc-link-modal:not(.race-modal--minimized) {
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.85rem;
}


.race-modal:not(.race-modal--minimized) .route-desc-link-modal__dialog.race-modal__dialog .form-control,
.race-modal:not(.race-modal--minimized) .route-desc-link-modal__dialog.race-modal__dialog .form-select {
  font-size: 0.86rem;
}

.race-modal:not(.race-modal--minimized) .route-desc-link-modal__dialog.race-modal__dialog .form-control {
  padding-top: 0.28rem;
  padding-bottom: 0.28rem;
}

.race-modal:not(.race-modal--minimized) .race-modal__col--description .route-description-editable {
  padding: 0.4rem 0.55rem;
  min-height: 5.25rem;
}

/* Переключатель «Описание / Регистрация»: кнопки на всю площадь внутри рамки, общая нижняя полоса */
.race-modal:not(.race-modal--minimized) .race-modal__tabs {
  display: flex;
  align-items: stretch;
  width: 100%;
  margin: 0 0 0.5rem;
  padding: 0;
  box-sizing: border-box;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-bottom: 2px solid rgba(51, 65, 85, 0.98);
  background: rgba(2, 6, 23, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.race-modal .race-modal__tabs button.race-modal__tab-btn {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  font: inherit;
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  margin: 0;
  padding: calc(0.55rem * 0.7) calc(0.5rem * 0.7) calc(0.58rem * 0.7);
  /* кегль не уменьшаем вместе с кнопкой — иначе длинные подписи нечитаемы */
  font-size: 0.82rem;
  line-height: 1.28;
  font-weight: 800;
  letter-spacing: 0.01em;
  border: none;
  border-radius: 0;
  background: transparent;
  color: rgba(203, 213, 225, 0.92);
  box-shadow: none;
  border-bottom: 2px solid transparent;
  box-sizing: border-box;
  min-height: max(calc(2.75rem * 0.7), 2.15rem);
}

.race-modal .race-modal__tabs button.race-modal__tab-btn:focus-visible {
  outline: 2px solid rgba(251, 202, 31, 0.8);
  outline-offset: -2px;
}

.race-modal .race-modal__tabs button.race-modal__tab-btn:first-of-type {
  border-right: 1px solid rgba(148, 163, 184, 0.22);
}

/* Активная вкладка: жёлтая полоса через ::after — всегда видна, не зависит от hover */
.race-modal .race-modal__tabs button.race-modal__tab-btn.race-modal__tab-btn--active {
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.65);
  border-bottom-color: transparent;
}

.race-modal .race-modal__tabs button.race-modal__tab-btn.race-modal__tab-btn--active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(251, 202, 31, 0.98);
  pointer-events: none;
  z-index: 2;
  border-radius: 1px 1px 0 0;
}

.race-modal .race-modal__tabs button.race-modal__tab-btn.race-modal__tab-btn--active:hover {
  color: #fff;
  background: rgba(30, 41, 59, 0.75);
}

.race-modal .race-modal__tabs button.race-modal__tab-btn.race-modal__tab-btn--active:hover::after {
  background: rgba(253, 224, 71, 1);
}

.race-modal .race-modal__tabs button.race-modal__tab-btn:not(.race-modal__tab-btn--active):hover {
  color: rgba(248, 250, 252, 0.98);
  background: rgba(255, 255, 255, 0.06);
}

.race-modal__tab-panel {
  border-radius: 12px;
  margin-top: 0;
  padding-top: 0.45rem;
}

/* Галочка «Загрузка чека» — как в таблице маршалов (.organizer-marshals-view__flag-chk / __flag-lab) */
.race-modal label.race-reg-payment-receipt {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0;
  padding: 0.15rem 0 0;
  cursor: pointer;
  font: inherit;
  max-width: 100%;
  box-sizing: border-box;
}

.race-modal .race-reg-payment-receipt__txt {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.35;
}

.race-modal .race-reg-payment-receipt-chk {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0.12rem 0 0;
  flex-shrink: 0;
  accent-color: #fbca1f;
  cursor: pointer;
}

.race-modal .race-reg-payment-receipt-chk:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.race-pick-bar {
  position: fixed;
  left: 50%;
  bottom: 12px;
  width: min(420px, calc(100vw - 24px));
  transform: translateX(-50%);
  z-index: 20500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.5rem 0.65rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
}

.race-pick-bar[hidden] {
  display: none !important;
}

.race-pick-bar__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(248, 250, 252, 0.96);
  font-weight: 800;
  font-size: 0.82rem;
}

.race-pick-bar__cancel {
  flex-shrink: 0;
  width: 2.1rem;
  height: 2.1rem;
  margin: 0;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(251, 202, 31, 0.92);
  color: #000;
  font-weight: 900;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.race-pick-bar__cancel:hover {
  background: rgba(251, 202, 31, 1);
}

.race-pick-bar__cancel:active {
  transform: scale(0.98);
}

.race-modal:not(.race-modal--minimized) .route-desc-link-modal__dialog.race-modal__dialog {
  width: min(920px, calc(100vw - 20px));
  max-width: min(920px, calc(100vw - 20px));
  max-height: min(78vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0.65rem 0.85rem;
}

/* Карта «Гонки» (races_map): форма от низа Subtop до низа вьюпорта — те же отступы, что у .content_subtop + .content_mid (style.css) */
body.page-races-map .race-modal.route-desc-link-modal:not(.race-modal--minimized) {
  align-items: stretch;
  justify-content: center;
  padding: 0 10px;
}

body.page-races-map .race-modal:not(.race-modal--minimized) .route-desc-link-modal__dialog.race-modal__dialog {
  position: fixed;
  top: calc(68px + 38px + 5px);
  bottom: 0;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  max-height: none;
  height: auto;
  margin: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  padding-bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
}

.race-modal:not(.race-modal--minimized) .race-modal__head-row {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.4rem;
}

.race-modal:not(.race-modal--minimized) .race-modal__head-row .route-desc-link-modal__title {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.race-modal__fill-from-btn {
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(147, 197, 253, 0.98);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  white-space: nowrap;
}

.race-modal__fill-from-btn:hover {
  color: rgba(191, 219, 254, 1);
}

.race-modal__fill-from-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.race-modal--minimized .race-modal__fill-from-btn {
  display: none;
}

.race-fill-template-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.52);
  border-radius: inherit;
}

.race-fill-template-overlay[hidden] {
  display: none !important;
}

.race-fill-template-overlay__panel {
  width: min(420px, calc(100% - 8px));
  max-height: min(72vh, 560px);
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.99);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.race-fill-template-overlay__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.race-fill-template-overlay__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #f8fafc;
}

.race-fill-template-overlay__close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.9);
  color: #e2e8f0;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.race-fill-template-overlay__close:hover {
  background: rgba(51, 65, 85, 0.95);
}

.race-fill-template-overlay__hint {
  margin: 0 0 0.5rem;
  line-height: 1.35;
}

.race-fill-template-overlay__list {
  flex: 1 1 auto;
  min-height: 120px;
  max-height: 42vh;
  overflow-y: auto;
  margin: 0 -0.15rem;
  padding: 0 0.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.race-fill-template-overlay__row {
  display: block;
  width: 100%;
  text-align: left;
  margin: 0;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(30, 41, 59, 0.55);
  color: #e2e8f0;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.3;
  cursor: pointer;
}

.race-fill-template-overlay__row:hover {
  border-color: rgba(251, 202, 31, 0.35);
  background: rgba(30, 41, 59, 0.85);
}

.race-fill-template-overlay__row--selected {
  border-color: rgba(251, 202, 31, 0.75);
  box-shadow: 0 0 0 1px rgba(251, 202, 31, 0.25);
}

.race-fill-template-overlay__row-title {
  font-weight: 600;
  color: #f8fafc;
}

.race-fill-template-overlay__row-meta {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.95);
}

.race-fill-template-overlay__empty {
  padding: 0.75rem 0.35rem;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(148, 163, 184, 0.95);
}

.race-fill-template-overlay__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.65rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.race-modal:not(.race-modal--minimized) #raceForm {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.race-modal:not(.race-modal--minimized) .race-modal__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.55rem 1rem;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
}

.race-modal:not(.race-modal--minimized) .race-modal__col {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.2rem;
}

.race-modal:not(.race-modal--minimized) .race-modal__col::-webkit-scrollbar {
  width: 10px;
}

.race-modal:not(.race-modal--minimized) .race-modal__col::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 10px;
}

.race-modal:not(.race-modal--minimized) .race-modal__col::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.26);
}

.race-modal:not(.race-modal--minimized) .race-modal__footer {
  flex: 0 0 auto;
  margin-top: 0.45rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.race-modal:not(.race-modal--minimized) .race-modal__footer .route-desc-link-modal__actions .btn,
.race-modal:not(.race-modal--minimized) .race-modal__footer .route-desc-link-modal__actions .but {
  padding: 0.35rem 0.6rem;
  font-size: 0.78rem;
  line-height: 1.1;
  border-radius: 10px;
}

/* Кнопки футера в один размер (Отмена/Сохранить) */
.race-modal:not(.race-modal--minimized) .race-modal__footer #race_cancel_btn,
.race-modal:not(.race-modal--minimized) .race-modal__footer #race_save_btn {
  height: 34px;
  box-sizing: border-box;
}

.race-modal:not(.race-modal--minimized) .race-modal__footer #race_cancel_btn {
  height: 32px;
}

.race-modal:not(.race-modal--minimized) .race-modal__footer .route-desc-link-modal__actions .btn {
  border-radius: 8px;
}

/* Укоротить поля даты/длительности визуально */
#race_start_date,
#race_duration_days,
#race_registration_start_date {
  max-width: 14rem;
}

#race_duration_days {
  max-width: 8.5rem;
}

.race-modal:not(.race-modal--minimized) .race-modal__col--main > .form-group.mb-2:last-child {
  margin-bottom: 0 !important;
}

.race-modal:not(.race-modal--minimized) .race-cover-head {
  margin-bottom: 0;
  gap: 0.3rem;
}

.race-modal:not(.race-modal--minimized) .race-cover-head__frame {
  height: 118px;
}

.race-modal:not(.race-modal--minimized) .race-modal__col--main .form-group.mb-2 {
  margin-bottom: 0.42rem !important;
}

/* Правая колонка: вкладки фиксированы сверху, прокрутка только у содержимого вкладок */
.race-modal:not(.race-modal--minimized) .race-modal__col--description {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.race-modal:not(.race-modal--minimized) .race-modal__tab-panels-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-right: 0.15rem;
}

.race-modal:not(.race-modal--minimized) .race-modal__tab-panels-scroll::-webkit-scrollbar {
  width: 10px;
}

.race-modal:not(.race-modal--minimized) .race-modal__tab-panels-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 10px;
}

.race-modal:not(.race-modal--minimized) .race-modal__tab-panels-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.26);
}

.race-modal:not(.race-modal--minimized) #race_tab_panel_desc.race-modal__tab-panel,
.race-modal:not(.race-modal--minimized) #race_tab_panel_reg.race-modal__tab-panel {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  box-sizing: border-box;
}

.race-modal:not(.race-modal--minimized) .race-modal__description-group {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 0 !important;
}

.race-modal__position-group {
  flex: 0 0 auto;
  margin-top: 0.55rem;
}

/* Свернутый блок «Положения»: без лишней линии под заголовком */
details.race-acc.race-modal__position-acc:not([open]) > summary.race-acc__sum {
  border-bottom: none;
}

.race-modal__schedule-group {
  flex: 0 0 auto;
  margin-top: 0.45rem;
}

details.race-acc.race-modal__schedule-acc:not([open]) > summary.race-acc__sum {
  border-bottom: none;
}

.race-modal__schedule-acc.race-acc > *:not(summary) {
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
}

.race-schedule-rows {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.race-schedule-row {
  display: grid;
  grid-template-columns: minmax(3.35rem, 4.25rem) minmax(4.35rem, 5.3rem) 1fr auto;
  gap: 0.35rem 0.45rem;
  align-items: start;
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.race-schedule-row:last-of-type {
  border-bottom: none;
}

.race-schedule-row__field {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.race-schedule-row__lbl {
  font-size: 0.62rem;
  font-weight: 750;
  color: rgba(226, 232, 240, 0.88);
  letter-spacing: 0.02em;
}

.race-schedule-row__field--desc {
  grid-column: 3 / 4;
}

.race-schedule-row__dm {
  width: 100%;
  max-width: 4.1rem;
  text-align: center;
}

.race-schedule-row__dm,
.race-schedule-row__time,
.race-schedule-row__desc {
  font-size: 0.72rem;
  padding: 0.18rem 0.28rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(2, 6, 23, 0.35);
  color: #f8fafc;
}

.race-schedule-row__time {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.race-schedule-row__desc {
  width: 100%;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  resize: none;
  line-height: 1.35;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  overflow-x: hidden;
  overflow-y: hidden;
  max-height: 16rem;
}

.race-schedule-row__rm {
  flex-shrink: 0;
  margin: 0;
  padding: 0 0.3rem;
  border: none;
  background: transparent;
  color: rgba(248, 250, 252, 0.85);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  align-self: start;
}

.race-schedule-row__rm:hover {
  color: #fbca1f;
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 520px) {
  .race-schedule-row {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }

  .race-schedule-row__field--desc {
    grid-column: 1 / -1;
  }

  .race-schedule-row__rm {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    justify-self: end;
  }
}

.race-modal__schedule-acc .race-btn-primary,
.race-modal__position-acc .race-btn-primary {
  margin: 0.41rem 0.34rem 0.45rem 0.34rem;
  border-radius: 6px;
  padding-top: 0.24rem;
  padding-bottom: 0.24rem;
  min-height: 1.86rem;
  font-size: 0.66rem;
  box-sizing: border-box;
}

/* Положения: без лишнего padding у каждой строки DOM внутри details (иначе огромные зазоры) */
.race-modal__position-acc.race-acc > *:not(summary) {
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
}

.race-modal__position-acc .race-modal__position-hint {
  padding-top: 0.32rem;
  margin-bottom: 0.2rem !important;
}

.race-modal__position-acc .race-position-existing-list,
.race-modal__position-acc .race-position-pending-list {
  margin-bottom: 0 !important;
}

.race-modal__position-acc .race-position-existing__item,
.race-modal__position-acc .race-position-pending__item {
  padding: 0;
  gap: 0.22rem 0.35rem;
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.race-modal__position-acc .race-position-pending__item {
  padding-left: 0.05rem;
  padding-right: 0.05rem;
}

.race-modal__position-acc .race-position-existing__link {
  line-height: 1.15;
}

.race-modal__position-acc .race-position-pending__name {
  line-height: 1.15;
}

.race-position-existing-list {
  margin: 0;
  padding: 0;
}

.race-position-existing__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.race-position-existing__item:last-child {
  border-bottom: none;
}

.race-position-existing__link {
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
}

.race-position-pending-list {
  margin: 0;
  padding: 0;
}

.race-position-pending__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  padding: 0.35rem 0.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.race-position-pending__item:last-child {
  border-bottom: none;
}

.race-position-pending__name {
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
}

.race-position-pending__rm {
  flex-shrink: 0;
  margin: 0;
  padding: 0 0.35rem;
  border: none;
  background: transparent;
  color: rgba(248, 250, 252, 0.85);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
}

.race-position-pending__rm:hover {
  color: #fbca1f;
  background: rgba(255, 255, 255, 0.06);
}

.race-position-existing__rm {
  margin-left: 0.25rem;
}

.race-detail-preview__position-title {
  letter-spacing: 0.04em;
}

.race-detail-preview-tabs__panels .race-detail-preview__position-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.race-detail-preview__position-list .race-detail-preview__position-item {
  margin-bottom: 0;
}

.race-detail-preview-overlay .race-detail-preview__position-item a {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.4rem 0.5rem 0.4rem 0.42rem;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-left: 2px solid rgba(251, 202, 31, 0.72);
  background: rgba(30, 41, 59, 0.72);
  color: #f8fafc;
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.28;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.race-detail-preview-overlay .race-detail-preview__position-item a::before {
  content: '';
  flex-shrink: 0;
  width: 1.22rem;
  height: 1.22rem;
  border-radius: 5px;
  background: rgba(251, 202, 31, 0.12);
  border: 1px solid rgba(251, 202, 31, 0.26);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23fbbf24' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='16' y1='13' x2='8' y2='13'/%3E%3Cline x1='16' y1='17' x2='8' y2='17'/%3E%3Cpolyline points='10 9 9 9 8 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 11px 11px;
}

.race-detail-preview-overlay .race-detail-preview__position-item a:hover {
  background: rgba(51, 65, 85, 0.85);
  border-color: rgba(251, 202, 31, 0.32);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}

.race-detail-preview-overlay .race-detail-preview__position-item a:focus-visible {
  outline: 2px solid rgba(251, 202, 31, 0.55);
  outline-offset: 1px;
}

.race-detail-preview-tabs__panels .race-detail-preview__schedule-board {
  margin-top: 0;
}

.race-detail-preview__schedule-title {
  letter-spacing: 0.06em;
  margin: 0 0 0.5rem;
  font-weight: 800;
  color: rgba(248, 250, 252, 0.92);
}

.race-detail-preview__schedule-board {
  display: flex;
  flex-direction: column;
  gap: 0.26rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.race-detail-preview__schedule-row {
  display: grid;
  /* Фикс. ширины: иначе у каждой строки своя сетка с auto — описание «прыгает» по горизонтали */
  grid-template-columns: 3rem 6.35rem minmax(0, 1fr);
  column-gap: 0.45rem;
  row-gap: 0.28rem;
  align-items: center;
  padding: 0.38rem 0.45rem;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(30, 41, 59, 0.55);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}

.race-detail-preview__schedule-row:nth-child(even) {
  background: rgba(30, 41, 59, 0.42);
}

.race-detail-preview__schedule-date,
.race-detail-preview__schedule-time {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: stretch;
  box-sizing: border-box;
  min-height: 1.15rem;
  min-width: 0;
  padding: 0.08rem 0.22rem;
  font-size: 0.58rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1.15;
  color: #fef08a;
  border-radius: 4px;
  border: 1px solid rgba(251, 202, 31, 0.24);
  background: rgba(251, 202, 31, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.race-detail-preview__schedule-txt,
.race-detail-preview__schedule-txt.text-light.text-sm {
  grid-column: 3;
  justify-self: stretch;
  text-align: left;
  min-width: 0;
  margin: 0;
  line-height: 1.38;
  white-space: pre-wrap;
  color: rgba(248, 250, 252, 0.95);
  font-size: 0.72rem;
}

@media (max-width: 420px) {
  .race-detail-preview__schedule-row {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.35rem;
    row-gap: 0.26rem;
  }

  .race-detail-preview__schedule-date,
  .race-detail-preview__schedule-time {
    justify-content: flex-start;
    justify-self: stretch;
  }

  .race-detail-preview__schedule-txt {
    grid-column: 1 / -1;
    padding-top: 0.06rem;
  }
}

.race-modal:not(.race-modal--minimized) .race-modal__col--description .route-description-editor {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Описание гонки: панель формата и поле — один блок, компактные кнопки */
.race-modal:not(.race-modal--minimized) .race-modal__description-group .route-description-editor--race-modal {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  overflow: visible;
  background: rgba(15, 23, 42, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.race-modal:not(.race-modal--minimized)
  .race-modal__description-group
  .route-description-editor--race-modal
  .route-description-toolbar {
  margin-top: 0;
  margin-bottom: 0;
  padding: 0.18rem 0.28rem;
  gap: 0.2rem;
  border-radius: 9px 9px 0 0;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(2, 6, 23, 0.45);
  box-shadow: none;
}

.race-modal:not(.race-modal--minimized)
  .race-modal__description-group
  .route-description-editor--race-modal
  .route-description-toolbar
  .route-desc-cmd.route-desc-toolbar-btn {
  width: 1.38rem;
  min-width: 1.38rem;
  height: 1.38rem;
  border-radius: 5px;
}

.race-modal:not(.race-modal--minimized)
  .race-modal__description-group
  .route-description-editor--race-modal
  .route-description-toolbar
  .route-desc-cmd__ico
  svg {
  width: 11px;
  height: 11px;
}

.race-modal:not(.race-modal--minimized)
  .race-modal__description-group
  .route-description-editor--race-modal
  .route-description-toolbar
  .route-desc-toolbar-btn--emoji
  .route-desc-cmd__emoji {
  font-size: 0.76rem;
}

.race-modal:not(.race-modal--minimized)
  .race-modal__description-group
  .route-description-editor--race-modal
  .route-description-editable {
  flex: 1 1 auto;
  min-height: 6rem;
  height: auto !important;
  max-height: none !important;
  margin-top: 0;
  padding: 0.38rem 0.5rem;
  border-radius: 0 0 9px 9px !important;
  border: none !important;
  box-shadow: none !important;
  background: rgba(2, 6, 23, 0.28);
  /* Bootstrap .form-control задаёт тёмный цвет — для тёмной модалки нужен светлый текст */
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc;
  caret-color: #f8fafc;
}

.race-modal:not(.race-modal--minimized)
  .race-modal__description-group
  .route-description-editor--race-modal
  .route-description-editable:focus {
  border: none !important;
  box-shadow: inset 0 0 0 1px rgba(251, 202, 31, 0.45) !important;
}

.race-modal:not(.race-modal--minimized)
  .race-modal__description-group
  .route-description-editor--race-modal
  .route-desc-emoji-panel {
  margin-top: 0.28rem;
  max-width: 100%;
}

.race-modal:not(.race-modal--minimized)
  .race-modal__description-group
  .route-description-editor--race-modal
  .route-desc-emoji-tab {
  font-size: 0.62rem;
  padding: 0.12rem 0.26rem;
}

.race-modal:not(.race-modal--minimized)
  .race-modal__description-group
  .route-description-editor--race-modal
  .route-desc-emoji-item {
  font-size: 0.82rem;
  padding: 0.18rem 0.28rem;
}

.race-modal--minimized .race-modal__col--description {
  display: none !important;
}

.race-modal--minimized .race-modal__grid {
  display: block;
  overflow: hidden;
}

.race-modal--minimized #raceForm {
  display: block;
  min-height: 0;
}

/* Модалка «Ссылка» поверх окна гонки (оба fixed, z-index выше родителя #race_modal) */
#race_desc_link_modal.race-desc-link-modal--nested {
  z-index: 13150;
}

@media (max-width: 680px) {
  .race-modal:not(.race-modal--minimized) .race-modal__grid {
    grid-template-columns: 1fr;
  }

  .race-modal:not(.race-modal--minimized)
    .race-modal__description-group
    .route-description-editor--race-modal
    .route-description-editable {
    flex: 0 1 auto;
    min-height: 9rem;
    max-height: min(48vh, 360px);
  }
}

@media (max-width: 520px) {
  .race-modal__row {
    grid-template-columns: 1fr;
  }
}

/* Сабтоп: фильтры гонок (период + область на карте) */
.race-subtop-filters {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-left: 0.25rem;
  min-width: 0;
}

.race-subtop-filters__label {
  white-space: nowrap;
  font-weight: 600;
}

/* Текст периода и кнопка календаря — рядом, без «пустой полки» между ними */
.race-period-field {
  display: inline-flex;
  align-items: center;
  gap: calc(0.22rem + 5px);
}

.race-period-display {
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 0;
  flex: 0 1 auto;
}

.race-period-calendar-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.race-period-open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.4rem;
  line-height: 0;
}

.race-period-open-btn__icon {
  display: block;
}

.race-month-popover {
  position: fixed;
  z-index: 12600;
  min-width: 15rem;
  padding: 0.45rem 0.5rem 0.55rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  zoom: 0.85;
}

.race-month-popover__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.race-month-nav {
  min-width: 1.75rem;
  font-size: 1.15rem;
  line-height: 1;
  text-decoration: none;
}

.race-month-popover__year {
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.race-month-popover__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem;
}

.race-month-cell {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.28rem 0.15rem;
  min-height: 2rem;
  touch-action: none;
}

.race-month-cell--in-range {
  background: rgba(251, 202, 31, 0.35);
  border-color: rgba(251, 202, 31, 0.85);
  color: #0f172a;
}

/* Одинаковая кнопка-крестик: сброс периода и сброс области на карте */
.race-filter-icon-x-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: calc(0.25rem * 0.8) calc(0.3rem * 0.8);
  line-height: 0;
  min-width: 0;
}

.race-filter-icon-x-btn__icon {
  display: block;
}

.race-subtop-filters__sep {
  display: inline-block;
  width: 1px;
  height: 1.1rem;
  margin: 0 0.15rem;
  background: rgba(255, 255, 255, 0.22);
  vertical-align: middle;
}

/* Две отдельные кнопки с промежутком — как «Выбрать месяцы» и сброс периода, не btn-group */
.race-filter-draw-area-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.race-filter-draw-area-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: calc(2.1rem * 0.8);
  /* −20% к прежним отступам кнопки и типичной вертикали btn-sm */
  padding: calc(0.25rem * 0.8) calc(0.45rem * 0.8);
  line-height: 0;
}

.race-filter-draw-area-btn__icon {
  width: calc(24px * 0.8);
  height: calc(24px * 0.8);
  display: block;
  flex-shrink: 0;
  max-width: none;
  object-fit: contain;
  object-position: center;
  /* Крупный PNG ужимается до 24×24: pixelated даёт «ломаные» края; auto — нормальное сглаживание */
  image-rendering: auto;
}

#race_filter_draw_area.is-active {
  background: rgba(251, 202, 31, 0.32);
  border-color: rgba(251, 202, 31, 0.75);
  color: #0f172a;
}

/* «Добавить маршрут»: компактно; «прыжок» как у .but, амплитуда ~+10% */
.catalog-add-route-btn {
  display: inline-block;
  margin: 0;
  padding: 0.32rem 0.65rem;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.72rem;
  line-height: 1.2;
  color: #000;
  background: #fbca1f;
  border: 2px solid #000;
  border-radius: 6px;
  box-shadow: 0.1em 0.1em #000;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.content-subtop-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Как у сложности / избранного: высота 26px, не толще соседних контролов */
.content-subtop-filters > .catalog-add-route-btn,
.content-subtop-actions .catalog-add-route-btn {
  padding: 0.15rem 0.45rem;
  font-size: 0.68rem;
  line-height: 1.15;
  border-width: 1px;
  border-radius: 6px;
  box-shadow: 0.08em 0.08em #000;
  box-sizing: border-box;
  flex-shrink: 0;
}

.content-subtop-filters > .catalog-add-route-btn.catalog-add-route-btn--icon,
.content-subtop-actions .catalog-add-route-btn.catalog-add-route-btn--icon {
  padding: 0;
  min-width: 26px;
  width: 26px;
  height: 26px;
}

.content-subtop-filters > .catalog-add-route-btn--icon svg,
.content-subtop-actions .catalog-add-route-btn--icon svg {
  width: 1.05rem;
  height: 1.05rem;
}

.content-subtop-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03),
    0 8px 20px rgba(0, 0, 0, 0.18);
}

.content-subtop-mode-toggle__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.55rem;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.78rem;
  line-height: 1.1;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.88);
  background: transparent;
  border: 1px solid transparent;
}

.content-subtop-mode-toggle__item:hover {
  color: rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.content-subtop-mode-toggle__item--active {
  color: #000;
  background: rgba(251, 202, 31, 0.95);
  border-color: rgba(0, 0, 0, 0.7);
}

.content-subtop-mode-toggle__item--active:hover {
  color: #000;
  background: rgba(251, 202, 31, 1);
}

.catalog-add-route-btn--icon {
  padding: 0.32rem 0.55rem;
  min-width: 2.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.catalog-add-route-btn--icon svg {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
}

/* Подсказка справа от кнопки (кнопка слева в subtop — не уезжает за край экрана) */
.catalog-add-route-btn--icon[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 0.35rem);
  right: auto;
  top: 50%;
  padding: 0.2rem 0.45rem;
  font-size: 0.68rem;
  line-height: 1.2;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translateY(-50%) translateX(-4px);
  pointer-events: none;
  white-space: nowrap;
  z-index: 13000;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.catalog-add-route-btn--icon[data-tooltip]:hover::after,
.catalog-add-route-btn--icon[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.catalog-add-route-btn:hover {
  transform: translate(-0.055em, -0.055em);
  box-shadow: 0.165em 0.165em #000;
}

.catalog-add-route-btn:active {
  transform: translate(0.055em, 0.055em);
  box-shadow: 0.055em 0.055em #000;
}

.catalog-route-side-panel__head {
  margin-bottom: 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Название + компактные кнопки (звезда, карандаш, крест) в одной строке */
.catalog-route-side-panel__title-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 0.4rem;
  min-width: 0;
  width: 100%;
}

.catalog-route-side-panel__title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
  color: #f8fafc;
}

.catalog-route-side-panel__title-actions {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.22rem;
  margin-top: 0.06rem;
}

/* Звезда избранного: без квадратной подложки, крупнее */
.catalog-route-side-panel__title-actions .catalog-route-side-panel__head-tool-btn.catalog-route-favorite-btn {
  width: auto;
  min-width: 1.78rem;
  min-height: 1.78rem;
  border: none !important;
  background: transparent !important;
  border-radius: 0;
}

.catalog-route-side-panel__title-actions .catalog-route-side-panel__head-tool-btn.catalog-route-favorite-btn .catalog-route-favorite-btn__svg {
  width: 1.41rem;
  height: 1.41rem;
}

/* Карандаш как крест: та же подложка и белая иконка */
.catalog-route-side-panel__title-actions .catalog-route-side-panel__edit-btn.route-area-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.48rem;
  height: 1.48rem;
  min-width: 1.48rem;
  min-height: 0;
  padding: 0 !important;
  border-radius: 6px;
  line-height: 0;
  font-size: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.08) !important;
  border: none !important;
}

.catalog-route-side-panel__title-actions .catalog-route-side-panel__edit-btn.route-area-icon-btn svg {
  width: 0.72rem;
  height: 0.72rem;
  fill: currentColor;
}

.catalog-route-side-panel__title-actions .catalog-route-side-panel__edit-btn.route-area-icon-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14) !important;
}

.catalog-route-side-panel__title-actions .catalog-route-side-panel__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.48rem;
  height: 1.48rem;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 6px;
  font-size: 1.05rem;
  line-height: 1;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.catalog-route-side-panel__title-actions .catalog-route-side-panel__close:hover {
  background: rgba(248, 113, 113, 0.35);
  color: #fff;
}

.catalog-route-side-panel__section {
  margin-top: 0.5rem;
}

.catalog-route-side-panel__label {
  margin-bottom: 0.2rem;
  opacity: 0.85;
}

.catalog-route-side-panel__coords {
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.catalog-route-side-panel__desc {
  max-height: 12rem;
  overflow: auto;
  line-height: 1.45;
}

.catalog-route-side-panel__desc a {
  color: #fde68a;
}

/* Редактор объектов гонки (полноэкранный litebox) */
.race-mo-litebox {
  position: fixed;
  inset: 0;
  z-index: 28500;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}
.race-mo-litebox[hidden] {
  display: none !important;
}
.race-mo-litebox__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}
.race-mo-litebox__sheet {
  position: relative;
  z-index: 1;
  margin: auto;
  width: min(100vw - 16px, 1180px);
  height: min(100vh - 16px, 720px);
  max-height: calc(100vh - 16px);
  display: flex;
  flex-direction: column;
  background: #1a1d24;
  border-radius: 10px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
/* Перебиваем глобальный `header { background: linear-gradient… }` из style.css */
.race-mo-litebox__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  text-align: left;
  box-shadow: none;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.65);
}
.race-mo-litebox__title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #f8fafc;
}
.race-mo-litebox__close {
  border: none;
  background: transparent;
  color: #cbd5e1;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}
.race-mo-litebox__close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.race-mo-litebox__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;
  gap: 0;
}
.race-mo-litebox__side {
  width: min(360px, 38vw);
  min-width: 260px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

.race-mo-litebox__side-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 10px 12px;
  box-sizing: border-box;
}

.race-mo-litebox__side-actions {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.72);
  box-sizing: border-box;
}

.race-mo-litebox__side-action-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.25;
  min-height: 0;
}
.race-mo-litebox__mapcol {
  flex: 1;
  min-width: 0;
  position: relative;
}

/* Переключатель подложки в редакторе объектов гонки */
.race-mo-basemap-toggle {
  position: absolute;
  z-index: 15001;
  top: 10px;
  left: 10px;
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 10px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 4px 14px rgba(0, 0, 0, 0.18);
}

.race-mo-basemap-toggle__btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  font-size: 0.8125rem;
  line-height: 1.1;
  cursor: pointer;
  user-select: none;
}

.race-mo-basemap-toggle__btn[aria-selected="true"] {
  background: rgba(251, 202, 31, 0.92);
  border-color: rgba(251, 202, 31, 0.95);
  color: #000;
  font-weight: 800;
}

.race-mo-basemap-toggle__btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.race-mo-basemap-toggle__btn[aria-selected="true"]:hover {
  background: rgba(251, 202, 31, 1);
}
.race-mo-litebox__map {
  position: absolute;
  inset: 0;
}
/* Редактор объектов гонки: списки областей/линий и значков — отдельные карточки вместо «простого текста» */
.race-mo-litebox #race_mo_route_areas_list.route-areas-list,
.race-mo-litebox #race_mo_route_map_icons_list.route-areas-list {
  gap: 0.5rem;
  padding: 0.2rem 0.08rem 0.35rem;
  margin-top: 0.35rem;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.race-mo-litebox #race_mo_route_areas_list.route-areas-list.route-areas-list--scrollable,
.race-mo-litebox #race_mo_route_map_icons_list.route-areas-list.route-areas-list--scrollable {
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.race-mo-litebox #race_mo_route_areas_list .route-area-row,
.race-mo-litebox #race_mo_route_map_icons_list .route-area-row {
  position: relative;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem 0.4rem;
  margin: 0;
  padding: 0.48rem 0.5rem 0.48rem 0.62rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
  background: linear-gradient(155deg, rgba(51, 65, 85, 0.55), rgba(15, 23, 42, 0.92));
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.28),
    0 2px 12px rgba(0, 0, 0, 0.22);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.race-mo-litebox #race_mo_route_areas_list .route-area-row::before,
.race-mo-litebox #race_mo_route_map_icons_list .route-area-row::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(251, 202, 31, 0.95), rgba(251, 202, 31, 0.2));
  opacity: 0.85;
  pointer-events: none;
}

.race-mo-litebox #race_mo_route_areas_list .route-area-row:first-child,
.race-mo-litebox #race_mo_route_areas_list .route-area-row:last-child,
.race-mo-litebox #race_mo_route_areas_list .route-area-row:first-child:last-child,
.race-mo-litebox #race_mo_route_map_icons_list .route-area-row:first-child,
.race-mo-litebox #race_mo_route_map_icons_list .route-area-row:last-child,
.race-mo-litebox #race_mo_route_map_icons_list .route-area-row:first-child:last-child {
  border-radius: 10px;
}

.race-mo-litebox #race_mo_route_areas_list .route-area-row.route-area-row--map-hover,
.race-mo-litebox #race_mo_route_map_icons_list .route-area-row.route-area-row--map-hover {
  background: linear-gradient(155deg, rgba(71, 85, 105, 0.65), rgba(30, 41, 59, 0.95));
  border-color: rgba(251, 202, 31, 0.45);
  box-shadow:
    0 0 0 1px rgba(251, 202, 31, 0.25),
    0 2px 14px rgba(0, 0, 0, 0.28);
}

.race-mo-litebox #race_mo_route_areas_list .route-area-row.route-area-row--editing,
.race-mo-litebox #race_mo_route_map_icons_list .route-area-row.route-area-row--editing {
  background: linear-gradient(155deg, rgba(80, 64, 20, 0.42), rgba(15, 23, 42, 0.96));
  border-color: rgba(251, 202, 31, 0.55);
  box-shadow:
    inset 0 0 0 1px rgba(251, 202, 31, 0.55),
    0 0 0 1px rgba(251, 202, 31, 0.2),
    0 4px 18px rgba(251, 202, 31, 0.08);
}

.race-mo-litebox #race_mo_route_areas_list .route-area-row.route-area-row--selected,
.race-mo-litebox #race_mo_route_map_icons_list .route-area-row.route-area-row--selected {
  background: linear-gradient(155deg, rgba(51, 65, 85, 0.62), rgba(15, 23, 42, 0.94));
  border-color: rgba(251, 202, 31, 0.42);
  box-shadow:
    inset 0 0 0 1px rgba(251, 202, 31, 0.45),
    0 2px 12px rgba(0, 0, 0, 0.24);
}

.race-mo-litebox #race_mo_route_areas_list .route-area-row__name-wrap,
.race-mo-litebox #race_mo_route_map_icons_list .route-area-row__name-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.race-mo-litebox #race_mo_route_areas_list .route-area-row__name-input,
.race-mo-litebox #race_mo_route_map_icons_list .route-area-row__name-input {
  background: rgba(2, 6, 23, 0.45);
  border-color: rgba(255, 255, 255, 0.14);
}

.race-mo-litebox #race_mo_route_map_icons_list .route-map-icon-row__thumb-wrap {
  padding: 0.18rem;
  margin-right: 0.05rem;
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.race-mo-litebox #race_mo_route_map_icons_list .route-map-icon-row__thumb {
  width: 1.72rem;
  height: 1.72rem;
}

.race-mo-litebox #race_mo_route_areas_list .route-area-row.route-area-row--pending-new {
  border-style: dashed;
  border-color: rgba(251, 202, 31, 0.38);
  background: linear-gradient(155deg, rgba(51, 65, 85, 0.35), rgba(15, 23, 42, 0.78));
}

/* Слои гонки: как строки списка областей/значков (form.css .route-areas-list .route-area-row) */
.race-mo-litebox .race-mo-area-groups__list {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(2, 6, 23, 0.32);
}

.race-mo-litebox .race-mo-area-groups__item {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.28rem 0.35rem;
  padding: 0.26rem 0.4rem;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}

.race-mo-litebox .race-mo-area-groups__item:first-child {
  border-radius: 9px 9px 0 0;
}

.race-mo-litebox .race-mo-area-groups__item:last-child {
  border-bottom: none;
  border-radius: 0 0 9px 9px;
}

.race-mo-litebox .race-mo-area-groups__item:only-child {
  border-radius: 9px;
}

.race-mo-litebox .race-mo-area-groups__item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.race-mo-litebox .race-mo-area-groups__item--active {
  background: rgba(251, 202, 31, 0.12);
  box-shadow: inset 0 0 0 1px rgba(251, 202, 31, 0.55);
}

.race-mo-litebox .race-mo-area-groups__pick-zone {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  color: rgba(226, 232, 240, 0.55);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  user-select: none;
  pointer-events: none;
}

.race-mo-litebox .race-mo-area-groups__item--active .race-mo-area-groups__pick-zone {
  color: rgba(251, 202, 31, 0.95);
}

.race-mo-litebox .race-mo-area-groups__pick-ico {
  width: 0.88rem;
  height: 0.88rem;
  display: block;
  opacity: 0.92;
}

.race-mo-litebox .race-mo-area-groups__item-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 0;
}

.race-mo-litebox .race-mo-area-groups__name {
  width: 100%;
  min-height: 0;
  padding: 0.1rem 0.28rem;
  font-size: 0.76rem;
  line-height: 1.35;
  color: #f1f5f9;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
}

.race-mo-litebox .race-mo-area-groups__name:focus {
  outline: none;
  border-color: rgba(251, 202, 31, 0.55);
  box-shadow: 0 0 0 1px rgba(251, 202, 31, 0.2);
}

.race-mo-litebox .race-mo-area-groups__del {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  min-width: 1.75rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #f87171;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none !important;
  cursor: pointer;
}

.race-mo-litebox .race-mo-area-groups__del:hover:not(:disabled) {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.15);
}

.race-mo-litebox .race-mo-area-groups__del:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.race-mo-area-group-add-btn {
  padding: 0.28rem 0.55rem;
  font-size: 0.8125rem;
  line-height: 1.25;
  min-height: 0;
  border-width: 2px;
  font-weight: 800;
}

/* Превью гонки → вкладка «Объекты на карте»: список слоёв (single-select) */
.race-detail-map-objects__layers .race-detail-layers__list {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(2, 6, 23, 0.32);
}

.race-detail-map-objects__layers .race-detail-layers__item {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 0.28rem 0.4rem;
  padding: 0.32rem 0.5rem;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s ease;
}

.race-detail-map-objects__layers .race-detail-layers__item:last-child {
  border-bottom: none;
}

.race-detail-map-objects__layers .race-detail-layers__item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.race-detail-map-objects__layers .race-detail-layers__item--active {
  background: rgba(251, 202, 31, 0.18);
  color: #fde68a;
}

.race-detail-map-objects__layers .race-detail-layers__pick-zone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: rgba(226, 232, 240, 0.7);
}

.race-detail-map-objects__layers .race-detail-layers__item--active .race-detail-layers__pick-zone {
  color: #fbca1f;
}

.race-detail-map-objects__layers .race-detail-layers__pick-ico {
  width: 16px;
  height: 16px;
}

.race-detail-map-objects__layers .race-detail-layers__name {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Модалка гонки → вкладка «Объекты на карте»: краткий список слоёв */
#race_tab_panel_mapobjs .race-mapobjs-groups-summary {
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

#race_tab_panel_mapobjs .race-mapobjs-groups-summary__row {
  margin: 0;
  padding: 0.5rem 0.55rem 0.5rem 0.62rem;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(155deg, rgba(51, 65, 85, 0.35), rgba(15, 23, 42, 0.55));
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
  line-height: 1.35;
}

#race_tab_panel_mapobjs .race-mapobjs-groups-summary__row .text-light {
  font-weight: 600;
  color: #f1f5f9;
}

#race_tab_panel_mapobjs .race-mapobjs-groups-summary__row .text-muted {
  display: inline-block;
  margin-top: 0.12rem;
  font-size: 0.7rem;
}

.race-mo-litebox .race-mo-areas-toolbar--split-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  min-width: 0;
}

.race-mo-litebox .race-mo-areas-toolbar--split-row .race-mo-areas-toolbar__start {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  flex-shrink: 0;
}

.race-mo-litebox .race-mo-areas-toolbar--split-row .race-mo-route-areas-instruments {
  margin-left: auto;
  width: auto;
  flex: 0 1 auto;
  min-width: 0;
  justify-content: flex-end;
  padding-right: 0;
}

.race-mo-litebox .race-mo-areas-toolbar--split-row .race-mo-instruments-box {
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 0.35rem;
}

.race-mo-litebox .race-mo-areas-toolbar--actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
}

.race-mo-litebox .route-area-add-btn--compact {
  padding: 0.28rem 0.55rem;
  font-size: 0.8125rem;
  line-height: 1.25;
  min-height: 0;
}

.race-detail-preview-tabs__panel .race-detail-map-objects {
  box-sizing: border-box;
  width: min(100%, 72vh, 620px);
  aspect-ratio: 1 / 1;
  margin-inline: auto;
  min-height: 0;
  height: auto;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
}
.race-detail-map-objects__map {
  position: absolute;
  inset: 0;
}
