/* ========================================
   CSS VARIABLES — Design System
   ======================================== */
/* Шрифт Oswald подключается в HTML (preconnect + link на fonts.googleapis.com). */

:root {
  /* Palette */
  --bg:           #F5F5DC;
  --bg-card:      #FFFFFF;
  --bg-cream:     #FFFDF5;
  --bg-hover:     #EDE9D5;
  --primary:      #2F4F4F;
  --primary-light:#e8f0f0;
  --secondary:    #800020;
  --secondary-light:#f5e8ea;
  --accent:       #2F4F4F;
  --accent-warm:  #A52A2A;
  --text:         #3E2723;
  --text-mid:     #6B4C42;
  --text-muted:   #9E7B6E;
  --border:       #D2B48C;
  --border-light: #EBD9C2;

  /* Shadows */
  --shadow-xs:  0 1px 3px rgba(62,39,35,0.08);
  --shadow-sm:  0 2px 8px rgba(62,39,35,0.1);
  --shadow-md:  0 6px 24px rgba(62,39,35,0.14);
  --shadow-lg:  0 16px 48px rgba(62,39,35,0.2);

  /* Fonts — единый UI-шрифт Oswald (+ системный запасной) */
  --font-head:  'Oswald', system-ui, sans-serif;
  --font-body:  'Oswald', system-ui, sans-serif;
  --font-serif: 'Oswald', system-ui, sans-serif;

  /* Radius */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 100px;
}

/* ========================================
   RESET & BASE
   ======================================== */

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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ========================================
   LAYOUT
   ======================================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
  width: 100%;
}

.page-wrapper {
  flex: 1;
  padding-bottom: 64px;
}

/* ========================================
   HEADER
   ======================================== */

.site-header {
  background: var(--bg);
  border-bottom: none;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: none;
}

/* Нижняя линия шапки: только над полосой с nav (beta на мобильной — под линией) */
.site-header-main {
  border-bottom: 1px solid var(--border-light);
}

.site-header-beta-mobile {
  display: none;
}

@media (max-width: 768px) {
  .site-header-beta-mobile {
    display: block;
  }

  .site-header-beta-mobile-inner {
    text-align: right;
    padding: 4px 0 8px;
    line-height: 1;
  }
}

.navbar {
  display: flex;
  align-items: center;
  height: 64px;
  gap: 24px;
}

/* Строка «бренд + город + beta»: на широких — display:contents (элементы в ряду navbar); beta в nav только на desktop */
.navbar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

/* 404 и прочие минимальные шапки: одна строка на всю ширину */
.navbar--minimal .navbar-brand-row {
  width: 100%;
}

@media (min-width: 769px) {
  .navbar--main .navbar-brand-row,
  .navbar--simple .navbar-brand-row {
    display: contents;
  }

  .navbar--main .navbar-brand { order: 1; }
  .navbar--main .city-switcher { order: 2; }
  .navbar--main .navbar-nav { order: 3; }
  .navbar--main .navbar-search { order: 4; }
  .navbar--main .navbar-brand-row .navbar-beta-badge { order: 5; }

  .navbar--simple .navbar-brand { order: 1; }
  .navbar--simple .navbar-nav { order: 2; }
  .navbar--simple .navbar-brand-row .navbar-beta-badge { order: 3; }
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.navbar-logo {
  width: 38px; height: 38px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.navbar-logo img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.navbar-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.3px;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}

.navbar-nav a {
  display: block;
  padding: 7px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-mid);
  text-decoration: none;
  border-radius: var(--r-pill);
  transition: all 0.2s;
  font-family: var(--font-head);
  letter-spacing: 0.2px;
}

.navbar-nav a:hover { color: var(--primary); background: var(--primary-light); }
.navbar-nav a.active {
  color: var(--primary);
  /*background: var(--secondary-light);*/
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.navbar-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: none;
  border-radius: var(--r-pill);
  padding: 8px 16px;
  transition: all 0.2s;
}

.navbar-search:focus-within {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(47,79,79,0.12);
  background: var(--bg-card);
}

.search-icon { font-size: 14px; color: var(--text-muted); }

.navbar-search input {
  border: none; background: transparent;
  font-family: var(--font-body);
  font-size: 14px; color: var(--text);
  outline: none; width: 200px;
}

.navbar-search input::placeholder { color: var(--text-muted); }

/* Beta — терминальный стиль: моноширинный, цвет бренда */
.navbar-beta-badge {
  flex-shrink: 0;
  align-self: center;
  font-family:
    ui-monospace,
    "Cascadia Code",
    "Segoe UI Mono",
    "JetBrains Mono",
    Consolas,
    "Courier New",
    Courier,
    monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  color: var(--primary);
  line-height: 1;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  box-shadow: none;
  text-shadow: none;
  -webkit-font-smoothing: antialiased;
}

.navbar-beta-badge--trailing {
  margin-left: auto;
}

/* Две копии beta: в navbar (desktop) и под линией шапки (mobile) */
@media (max-width: 768px) {
  .navbar-beta-badge--in-navbar {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .navbar-beta-badge--under-header {
    display: none !important;
  }
}

.navbar-beta-badge--under-header {
  display: inline-block;
  vertical-align: baseline;
}

/* ========================================
   PAGE HERO
   ======================================== */

.page-hero {
  padding: 32px 0 16px;
  /* Фиксированная ширина под длину «сентябрь 2026» (≈8+пробел+4) + запас */
  --hero-month-slot-w: 288px;
}

/* Слот под «Сентябрь 2026» и т.п.: 8 букв + пробел + 4 цифры года + поля; кнопки ‹ › не смещаются при смене месяца */
.hero-month-row {
  display: grid;
  grid-template-columns: 36px minmax(0, var(--hero-month-slot-w, 288px)) 36px;
  gap: 8px;
  align-items: center;
  width: fit-content;
  max-width: 100%;
}

.hero-month-title-wrap {
  min-width: 0;
  width: 100%;
  max-width: min(var(--hero-month-slot-w, 288px), calc(100vw - 120px));
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-hero .hero-month-title-wrap h1 {
  margin: 0;
  width: 100%;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.hero-nav-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--bg-hover);
  color: var(--text-mid);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding-bottom: 1px;
}

.hero-nav-btn:hover {
  background: var(--primary);
  color: white;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-hero h1 {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.subtitle {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-head);
  letter-spacing: 0.3px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-filters-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--r-pill);
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}

.btn-filters-toggle:hover {
  background: var(--primary);
  filter: brightness(0.94);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-filters-icon { font-size: 16px; }

.view-switcher {
  display: flex;
  background: var(--bg-card);
  border: none;
  border-radius: var(--r-pill);
  padding: 3px;
  gap: 2px;
}

.view-btn {
  padding: 7px 16px;
  border: none;
  border-radius: var(--r-pill);
  background: transparent;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
  cursor: pointer;
  transition: all 0.2s;
}

.view-btn.active {
  background: var(--secondary);
  color: white;
}

/* ========================================
   FILTERS PANEL
   ======================================== */

.filters-panel {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: visible;
  max-height: 500px;
  transition: max-height 0.35s ease, opacity 0.3s ease, margin 0.3s ease;
  margin-bottom: 20px;
  opacity: 1;
}

.filters-panel.collapsed {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  box-shadow: none;
  overflow: hidden;
  pointer-events: none;
}

.filters-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 20px 24px;
  align-items: flex-end;
  overflow: visible;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-label {
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.filter-input, .filter-select {
  padding: 10px 14px;
  border: none;
  border-radius: var(--r-md);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: all 0.2s;
  min-width: 160px;
  cursor: pointer;
}

.filter-input:focus, .filter-select:focus {
  border-color: var(--secondary);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(47,79,79,0.1);
}

.filter-actions { flex-direction: row; align-items: flex-end; gap: 8px; margin-left: auto; }

.btn-apply {
  padding: 10px 22px;
  background: var(--secondary);
  color: white;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-apply:hover { background: var(--primary); transform: translateY(-1px); }

.btn-clear {
  padding: 10px 18px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-clear:hover { color: var(--primary); background: var(--primary-light); }

.filter-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 6px;
  line-height: 1.35;
}

/* Выпадающий мультивыбор (как компактный select) */
.filter-multiselect {
  position: relative;
  min-width: 180px;
  max-width: 280px;
}

.filter-multiselect-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  cursor: pointer;
}

.filter-multiselect-trigger span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-multiselect-chevron {
  flex-shrink: 0;
  font-size: 10px;
  opacity: 0.65;
}

.filter-multiselect-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 80;
  background: var(--bg-card);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  padding: 8px 10px 10px;
  max-height: min(280px, 55vh);
  display: flex;
  flex-direction: column;
  min-width: 260px;
}

.filter-multiselect-panel.hidden {
  display: none !important;
}

.filter-multiselect-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0 0 8px;
  line-height: 1.35;
}

.filter-multiselect-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}

.filter-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
  min-width: 0;
  font-family: var(--font-body);
}

.filter-type-check-row .filter-type-check-label {
  min-width: 0;
}

.organizer-filter-avatar-wrap {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg);
}

.organizer-filter-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.organizer-filter-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--secondary-light);
  color: var(--secondary);
  font-weight: 700;
  font-size: 12px;
}

.organizer-filter-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.event-type-filter-icon-wrap {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.event-type-filter-icon-wrap--in-summary {
  width: 20px;
  height: 20px;
}

.event-type-filter-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}

.event-type-filter-icon--summary {
  width: 16px;
  height: 16px;
}

.event-type-filter-summary-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.event-type-filter-summary-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========================================
   CALENDAR SECTION
   ======================================== */

.calendar-section {
  background: transparent;
  border-radius: 0;
  border: none;
  box-shadow: none;
  padding: 0;
  margin-bottom: 48px;
}

/* FullCalendar overrides */
.fc { font-family: var(--font-body) !important; }

.fc-theme-standard td, .fc-theme-standard th {
  border-color: var(--border-light) !important;
}
.fc-theme-standard .fc-scrollgrid { border-color: var(--border-light) !important; }

.fc-header-toolbar {
  margin-bottom: 0 !important;
  align-items: center !important;
  padding-bottom: 0 !important;
}

/* Скрываем заголовок — он теперь в hero */
.fc-toolbar-title { display: none !important; }

/* Скрываем chunk с заголовком полностью */
.fc-toolbar-chunk:first-child { display: none !important; }


.fc-prev-button, .fc-next-button {
  background: var(--bg) !important;
  border: none !important;
  color: var(--text-mid) !important;
  width: 34px !important; height: 34px !important;
  border-radius: 50% !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: none !important;
  transition: all 0.15s !important;
  font-size: 13px !important;
}

.fc-prev-button:hover, .fc-next-button:hover {
  background: var(--bg-hover) !important;
  color: var(--text) !important;
}

.fc-button-primary {
  background: var(--bg) !important;
  color: var(--text-mid) !important;
  border: none !important;
  border-radius: var(--r-md) !important;
  padding: 8px 16px !important;
  font-family: var(--font-head) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-transform: none !important;
  box-shadow: none !important;
  transition: all 0.2s !important;
  letter-spacing: 0.2px !important;
}

.fc-button-primary:hover {
  background: var(--secondary-light) !important;
  color: var(--secondary) !important;
}

.fc-button-primary:not(:disabled).fc-button-active,
.fc-button-primary:not(:disabled):active {
  background: var(--secondary) !important;
  color: white !important;
  border-color: var(--secondary) !important;
}

.fc-col-header-cell { background: var(--bg-hover) !important; }

/* Скруглённые углы у сетки */
.fc-scrollgrid { border-radius: var(--r-md) !important; overflow: hidden !important; border-color: var(--border-light) !important; }
.fc .fc-scrollgrid-section-header .fc-scroller { border-radius: var(--r-md) var(--r-md) 0 0 !important; overflow: hidden !important; }

/* Отступ между тулбаром и сеткой */
#calendar .fc-view-harness { margin-top: 16px; }

.fc-col-header-cell-cushion {
  font-family: var(--font-head) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  color: var(--text-muted) !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  text-decoration: none !important;
  padding: 12px 4px !important;
}

.fc-daygrid-day { background: transparent !important; transition: background 0.15s; }
.fc-daygrid-day-frame { background-color: var(--bg-cream) !important; min-height: 100%; position: relative; }
.fc-daygrid-day:hover { background: var(--bg-hover) !important; }

/*
 * Сетка dayGrid (месяц): приглушение только зоны событий (.fc-daygrid-day-events), не всей ячейки.
 * margin-top у events — зазор до абсолютных harness (padding не сдвигает top:0 у плашек; иначе наезжают на число).
 */
#calendar.fc .fc-daygrid-body .fc-daygrid-day-top {
  flex-shrink: 0;
  min-height: 36px;
}
#calendar.fc .fc-daygrid-body .fc-daygrid-day-events {
  position: relative;
  margin-top: 8px;
}
#calendar.fc .fc-daygrid-body .fc-daygrid-day:not(.fc-day-today) .fc-daygrid-day-events::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  background: rgba(62, 39, 35, 0.11);
  transition: opacity 0.22s ease;
  border-radius: var(--r-sm);
}
#calendar.fc .fc-daygrid-body .fc-daygrid-day:not(.fc-day-today):hover .fc-daygrid-day-events::after,
#calendar.fc .fc-daygrid-body .fc-daygrid-day:not(.fc-day-today):active .fc-daygrid-day-events::after {
  opacity: 0;
}

/* «Сегодня»: тот же вертикальный ритм, что у соседей (.fc-daygrid-day-top без отдельного min-height).
   z-index — плашки (absolute) не перекрывают число. */
#calendar.fc .fc-daygrid-body .fc-day-today .fc-daygrid-day-top {
  position: relative;
  z-index: 40;
}
#calendar.fc .fc-daygrid-body .fc-day-today .fc-daygrid-day-bottom {
  position: relative;
  z-index: 40;
}

/*
 * Десктоп: высоты строк недель задаёт script.js (текущая неделя выше); contentHeight ≈ сумма строк.
 * Прокрутка — у всей страницы, без обрезки harness и без отдельного скролла внутри календаря.
 */
@media (min-width: 769px) {
  #calendar.cal-week-layout-desktop .fc-scrollgrid {
    overflow: visible !important;
  }
  #calendar.cal-week-layout-desktop .fc-scrollgrid-section-body .fc-scroller {
    overflow-y: visible !important;
    overflow-x: visible !important;
  }
  #calendar.cal-week-layout-desktop .fc-daygrid-day-frame {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
  }
  #calendar.cal-week-layout-desktop .fc-view-harness {
    max-height: none !important;
    overflow: visible !important;
  }
  #calendar.cal-week-layout-desktop .fc-daygrid-body tr.cal-week-row--compact td.fc-daygrid-day,
  #calendar.cal-week-layout-desktop .fc-daygrid-body tr.cal-week-row--current td.fc-daygrid-day {
    vertical-align: top !important;
    box-sizing: border-box !important;
  }
  #calendar.cal-week-layout-desktop .fc-daygrid-body tr.cal-week-row--compact .fc-daygrid-day-frame,
  #calendar.cal-week-layout-desktop .fc-daygrid-body tr.cal-week-row--current .fc-daygrid-day-frame {
    min-height: 0 !important;
    height: 100% !important;
    box-sizing: border-box !important;
  }
  /* Без flex-grow: иначе блок событий растягивается на всю высоту ячейки, а плашки и «Ещё» прижаты
     к верху — под «Ещё» остаётся большая пустота. FullCalendar задаёт высоту зоны сегментов сам
     (inline / внутренняя вёрстка); flex: 0 1 auto сохраняет ширину ряда без лишнего хвоста. */
  #calendar.cal-week-layout-desktop .fc-daygrid-body .fc-daygrid-day-events {
    flex: 0 1 auto !important;
    min-height: 0 !important;
    margin-top: 8px !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
  #calendar.cal-week-layout-desktop .fc-daygrid-day-bottom {
    margin-top: 0 !important;
    flex-shrink: 0 !important;
  }
  #calendar.cal-week-layout-desktop .fc-daygrid-event:not(.fc-donate-event) {
    min-height: 44px !important;
  }
}

/* Узкий десктоп: больше плашек + «Ещё» в ячейку (см. dayMaxEventRows при width ≤ 1100 в script.js) */
@media (min-width: 769px) and (max-width: 1100px) {
  #calendar.cal-week-layout-desktop .fc-daygrid-day-number {
    padding: 4px 5px !important;
    margin: 2px !important;
  }
  #calendar.cal-week-layout-desktop .fc-day-today .fc-daygrid-day-number {
    margin: 2px !important;
  }
  #calendar.cal-week-layout-desktop .fc-event {
    padding: 2px 5px !important;
    margin: 1px 1px !important;
    font-size: 10px !important;
  }
  #calendar.cal-week-layout-desktop .fc-daygrid-event:not(.fc-donate-event) {
    padding-top: 3px !important;
    padding-bottom: 3px !important;
  }
  #calendar.cal-week-layout-desktop .fc-month-event-club-side {
    width: 30px;
    height: 30px;
  }
  #calendar.cal-week-layout-desktop .fc-month-event-club-aside {
    padding: 2px 4px 2px 1px;
  }
  #calendar.cal-week-layout-desktop .fc-daygrid-more-link {
    font-size: 10px !important;
    padding: 1px 4px !important;
    margin: 0 1px !important;
    line-height: 1.2 !important;
  }
  #calendar.cal-week-layout-desktop .fc-club-pill {
    gap: 4px !important;
    font-size: 10px !important;
  }
  #calendar.cal-week-layout-desktop .fc-club-avatar {
    width: 18px !important;
    height: 18px !important;
  }
}

.fc-daygrid-day-number {
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--text-mid) !important;
  text-decoration: none !important;
  padding: 6px 8px !important;
  font-family: var(--font-head) !important;
}

.fc-day-today { background: rgba(47,79,79,0.05) !important; }
.fc-day-today .fc-daygrid-day-number {
  color: white !important;
  background: var(--secondary) !important;
  border-radius: 50% !important;
  width: 28px !important; height: 28px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 4px !important;
  font-weight: 400 !important;
}

.fc-day-other .fc-daygrid-day-number { color: var(--border) !important; }

/* Event pills: заливка везде; акцентная левая граница — только месячная сетка + popover «ещё» (см. ниже) */
.fc-event {
  border: none !important;
  border-left: none !important;
  border-radius: var(--r-sm) !important;
  padding: 3px 7px !important;
  margin: 1px 2px !important;
  cursor: pointer !important;
  transition: all 0.15s !important;
  font-size: 11px !important;
  background: var(--secondary-light) !important;
}

.fc-event.ev-outdoor { background: #e8f0e8 !important; }
.fc-event.ev-virtual { background: #ede8f5 !important; }
.fc-event.ev-camp    { background: #f0ebe0 !important; }
.fc-event.ev-other   { background: #f5ede8 !important; }

/* Гонки — заметнее остальных: «клетка»; золотая левая кромка только в месячной сетке */
.fc-event.ev-race {
  background: repeating-linear-gradient(
    -45deg,
    #fff9e6,
    #fff9e6 4px,
    #ffefd0 4px,
    #ffefd0 8px
  ) !important;
  border-left: none !important;
  box-shadow: none !important;
  font-weight: 700 !important;
}
.fc-event.ev-race .fc-event-title {
  font-weight: 800 !important;
  color: #3d2914 !important;
}
.fc-event.ev-race .fc-event-time {
  color: #5c4018 !important;
  font-weight: 600 !important;
}

/* Бревет: коричнево-оливковая «важная» плашка; левая кромка — только в месячной сетке */
.fc-event.ev-brevet {
  background: repeating-linear-gradient(
    -45deg,
    #e8ebe4,
    #e8ebe4 4px,
    #dde5d8 4px,
    #dde5d8 8px
  ) !important;
  border-left: none !important;
  box-shadow: none !important;
  font-weight: 700 !important;
}
.fc-event.ev-brevet .fc-event-title {
  font-weight: 800 !important;
  color: #2c3528 !important;
}
.fc-event.ev-brevet .fc-event-time {
  color: #3d4a38 !important;
  font-weight: 600 !important;
}

.fc-list-event.ev-race td {
  background: repeating-linear-gradient(
    -45deg,
    #fff9e6,
    #fff9e6 4px,
    #ffefd0 4px,
    #ffefd0 8px
  ) !important;
  border-left: none !important;
  box-shadow: none !important;
}
.fc-list-event.ev-race:hover td {
  background: repeating-linear-gradient(
    -45deg,
    #fff4d6,
    #fff4d6 4px,
    #ffecc0 4px,
    #ffecc0 8px
  ) !important;
}

.fc-list-event.ev-brevet td {
  background: repeating-linear-gradient(
    -45deg,
    #e8ebe4,
    #e8ebe4 4px,
    #dde5d8 4px,
    #dde5d8 8px
  ) !important;
  border-left: none !important;
  box-shadow: none !important;
}
.fc-list-event.ev-brevet:hover td {
  background: repeating-linear-gradient(
    -45deg,
    #dfe6d8,
    #dfe6d8 4px,
    #d2dccc 4px,
    #d2dccc 8px
  ) !important;
}

/* Левая акцентная граница — только месячная сетка и popover «ещё N» (не список, не прочие виды) */
.fc-dayGridMonth-view .fc-daygrid-event.fc-event:not(.fc-donate-event),
.fc-popover .fc-event:not(.fc-donate-event) {
  border-left: 3px solid var(--secondary) !important;
}
.fc-dayGridMonth-view .fc-daygrid-event.fc-event.ev-outdoor:not(.fc-donate-event),
.fc-popover .fc-event.ev-outdoor:not(.fc-donate-event) {
  border-left-color: #2f4f4f !important;
}
.fc-dayGridMonth-view .fc-daygrid-event.fc-event.ev-virtual:not(.fc-donate-event),
.fc-popover .fc-event.ev-virtual:not(.fc-donate-event) {
  border-left-color: #6b4a8a !important;
}
.fc-dayGridMonth-view .fc-daygrid-event.fc-event.ev-camp:not(.fc-donate-event),
.fc-popover .fc-event.ev-camp:not(.fc-donate-event) {
  border-left-color: #8b6914 !important;
}
.fc-dayGridMonth-view .fc-daygrid-event.fc-event.ev-other:not(.fc-donate-event),
.fc-popover .fc-event.ev-other:not(.fc-donate-event) {
  border-left-color: #a52a2a !important;
}
.fc-dayGridMonth-view .fc-daygrid-event.fc-event.ev-race:not(.fc-donate-event),
.fc-popover .fc-event.ev-race:not(.fc-donate-event) {
  border-left: 4px solid #c9a227 !important;
  box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.45), 0 2px 10px rgba(201, 162, 39, 0.2) !important;
}
.fc-dayGridMonth-view .fc-daygrid-event.fc-event.ev-brevet:not(.fc-donate-event),
.fc-popover .fc-event.ev-brevet:not(.fc-donate-event) {
  border-left: 4px solid #5a6b52 !important;
  box-shadow: 0 0 0 1px rgba(90, 107, 82, 0.4), 0 2px 10px rgba(62, 80, 58, 0.18) !important;
}

.fc-event:hover {
  filter: brightness(0.95) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 8px rgba(62,39,35,0.15) !important;
}

.fc-event-title {
  font-weight: 600 !important;
  font-size: 11px !important;
  color: var(--text) !important;
  font-family: var(--font-body) !important;
}

.fc-event-time {
  font-size: 10px !important;
  color: var(--text-muted) !important;
  font-weight: 500 !important;
}

/* Клуб в плашке календаря (ride_outdoor / ride_virtual + join channels) */
.fc-club-pill {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  min-width: 0 !important;
  font-weight: 600 !important;
  font-size: 11px !important;
  color: var(--text) !important;
  font-family: var(--font-body) !important;
}

.fc-club-avatar {
  width: 22px !important;
  height: 22px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  flex-shrink: 0 !important;
  display: block !important;
}

.fc-club-label {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.fc-month-event-pill {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  min-width: 0;
}

.fc-month-event-club-aside {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  padding: 3px 6px 3px 2px;
  box-sizing: border-box;
}

.fc-month-event-club-side {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.fc-month-event-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.fc-month-event-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.fc-month-event-row--meta {
  flex-shrink: 0;
}

.fc-month-event-row--organizer {
  min-height: 1.15em;
}

.fc-month-event-time {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
}

.fc-month-event-type-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.fc-month-event-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: 10px;
  line-height: 1.2;
}

/* Двухстрочная плашка: чуть больше воздуха по вертикали */
.fc-daygrid-event:not(.fc-donate-event) {
  padding-top: 4px !important;
  padding-bottom: 4px !important;
}

.fc-daygrid-event-dot { display: none !important; }

/* List view */
.fc-list { border-radius: var(--r-md) !important; overflow: hidden !important; }
.fc-list-day-cushion { background: var(--bg-hover) !important; }

.fc-list-day-text, .fc-list-day-side-text {
  color: var(--primary) !important;
  font-family: var(--font-head) !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.8px !important;
  text-decoration: none !important;
}

.fc-list-event td { background: var(--bg-card) !important; border-color: var(--border-light) !important; }
.fc-list-event:hover td { background: var(--bg-hover) !important; cursor: pointer !important; }
.fc-list-event-dot { border-color: var(--secondary) !important; }
.fc-list-event-time { color: var(--text-muted) !important; font-size: 13px !important; }
.fc-list-event-title a {
  color: var(--text) !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  text-decoration: none !important;
  font-family: var(--font-body) !important;
}

/* ========================================
   LIST SECTION
   ======================================== */

.hidden { display: none !important; }

.events-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Day group */
.day-group { margin-bottom: 24px; }

/* Список: прошедшие даты — аккордеон (свёрнуто по умолчанию, любая ширина) */
.list-past-wrap {
  margin-bottom: 4px;
}

.list-past-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 0 12px;
  margin: 0 0 4px;
  box-sizing: border-box;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-light);
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.list-past-toggle:hover,
.list-past-toggle:focus-visible {
  color: var(--primary);
  outline: none;
}

.list-past-toggle-label {
  flex: 1;
  min-width: 0;
}

.list-past-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  opacity: 0.85;
  transition: transform 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.list-past-chevron-svg {
  display: block;
}

.list-past-wrap.is-open .list-past-chevron {
  transform: rotate(180deg);
  color: var(--primary);
  opacity: 1;
}

.list-past-wrap:not(.is-open) .list-past-panel {
  display: none;
}

.list-past-wrap.is-open .list-past-panel {
  display: block;
}

.day-label {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--primary);
  padding: 12px 0 8px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 8px;
}

.event-row {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: none;
  border-radius: var(--r-md);
  padding: 16px 20px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
  gap: 16px;
}

.event-row:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.event-row-time {
  flex-shrink: 0;
  width: 60px;
  text-align: center;
}

.event-row-time .time-big {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.5px;
}

.event-row-time .time-period {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2px;
}

.event-row-sep {
  width: 1px;
  align-self: stretch;
  min-height: 36px;
  background: var(--border-light);
  flex-shrink: 0;
}

.event-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.event-row-club {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.event-row-club-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
  box-shadow: var(--shadow-xs);
}

.event-row-club-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-head);
  letter-spacing: -0.2px;
  min-width: 0;
}

.event-row-dist {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
}

.event-row-meta-dot {
  color: var(--border);
  font-weight: 400;
  user-select: none;
  margin: 0 2px;
}

.event-row-meta {
  display: flex;
  align-items: center;
  gap: 6px 8px;
  margin-top: 0;
  flex-wrap: wrap;
}

.event-type-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-head);
  letter-spacing: 0.3px;
}

.event-type-tag-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

/* Плашки типа в списке и на «Ближайшие» — те же заливки, что у .fc-event.ev-* (без левой кромки) */
.event-type-tag.tag-outdoor,
.up-card-tag.tag-outdoor {
  background: #e8f0e8;
  color: #1e3d3d;
  box-shadow: none;
}

.event-type-tag.tag-virtual,
.up-card-tag.tag-virtual {
  background: #ede8f5;
  color: #3d2d52;
  box-shadow: none;
}

.event-type-tag.tag-camp,
.up-card-tag.tag-camp {
  background: #f0ebe0;
  color: #4a3d10;
  box-shadow: none;
}

.event-type-tag.tag-other,
.up-card-tag.tag-other {
  background: #f5ede8;
  color: #5c2418;
  box-shadow: none;
}

.event-type-tag.tag-race,
.up-card-tag.tag-race {
  background: repeating-linear-gradient(-45deg, #fff9e6, #fff9e6 4px, #ffefd0 4px, #ffefd0 8px);
  color: #3d2914;
  font-weight: 800;
  box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.28);
}

.event-type-tag.tag-brevet,
.up-card-tag.tag-brevet {
  background: repeating-linear-gradient(-45deg, #e8ebe4, #e8ebe4 4px, #dde5d8 4px, #dde5d8 8px);
  color: #2c3528;
  font-weight: 800;
  box-shadow: 0 0 0 1px rgba(90, 107, 82, 0.22);
}

.event-row--race,
.event-row--brevet {
  border: none;
  box-shadow: none;
  background: var(--bg-card);
}
.event-row--race .event-row-club-name,
.event-row--brevet .event-row-club-name {
  font-weight: 700;
  color: var(--primary);
}
.event-row--race:hover,
.event-row--brevet:hover {
  box-shadow: var(--shadow-md);
}

.event-row-location {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.event-row-chevron {
  color: var(--border);
  font-size: 16px;
  flex-shrink: 0;
  transition: color 0.2s;
}

.event-row:hover .event-row-chevron { color: var(--text-muted); }

/* ========================================
   UPCOMING EVENTS
   ======================================== */

.upcoming-section { margin-bottom: 48px; }

.upcoming-section.upcoming-section--mobile-hidden {
  display: none !important;
}

.upcoming-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}

.upcoming-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.upcoming-see-all {
  font-size: 14px;
  font-weight: 600;
  color: var(--secondary);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-head);
  transition: color 0.2s;
}
.upcoming-see-all:hover { color: var(--primary); }

.upcoming-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.upcoming-loading, .upcoming-empty {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--bg-card);
  border-radius: var(--r-md);
  border: 1px solid var(--border-light);
  grid-column: 1 / -1;
}

/* Upcoming Card */
.up-card {
  background: var(--bg-card);
  border: none;
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}

.up-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.up-card-img {
  height: 160px;
  background: linear-gradient(135deg, var(--bg-hover) 0%, var(--border-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.up-card-img-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.up-card-type-hero-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  object-fit: contain;
  opacity: 0.35;
  display: block;
  z-index: 0;
}

.up-card-org-logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: none;
  z-index: 1;
  border-radius: 0;
}

/* Приглушение полноэкранного логотипа светлым слоем в тон фону страницы */
.up-card-img-placeholder:has(.up-card-org-logo)::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: color-mix(in srgb, var(--bg) 48%, transparent);
  transition: opacity 0.22s ease;
}

.up-card:hover .up-card-img-placeholder:has(.up-card-org-logo)::after {
  opacity: 0;
}

@supports not (background: color-mix(in srgb, white 50%, transparent)) {
  .up-card-img-placeholder:has(.up-card-org-logo)::after {
    background: rgba(245, 245, 220, 0.48);
  }
}

.up-card-img-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(to top, rgba(62,39,35,0.35) 0%, transparent 55%);
}

.up-card-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.up-card-tag-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.up-card-tag-label {
  min-width: 0;
}

.up-card-body {
  padding: 16px 18px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.up-card-title {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
  line-height: 1.3;
}

.up-card-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.up-card-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.up-card-meta-icon-img {
  width: 15px;
  height: 15px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.up-card-action {
  display: block;
  width: 100%;
  padding: 11px;
  background: transparent;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-mid);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  margin-top: auto;
}

.up-card-action:hover {
  /* фон и текст как у .btn-register без :hover */
  background: var(--bg-hover);
  color: var(--text-mid);
}

/* ========================================
   MODAL
   ======================================== */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(30, 18, 12, 0.6);
  backdrop-filter: blur(8px);
  padding: 20px;
  overflow-y: auto;
  justify-content: center;
  align-items: flex-start;
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  max-width: 860px;
  width: 100%;
  margin: auto;
  position: relative;
  animation: modalUp 0.3s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  padding-top: 6px;
}

@keyframes modalUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: 1px solid var(--border-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text);
  z-index: 10;
  transition: all 0.2s;
  font-weight: 700;
}

.modal-close:hover {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

/* Шапка модалки: без градиента */
.modal-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  padding-right: 0;
  min-width: 0;
}

/* Запас под кнопку «закрыть», когда нет колонки с погодой (организатор у правого края) */
.modal-layout:has(.modal-sidebar--hidden) .modal-head {
  padding-right: 40px;
}

/*
 * Вариант с .modal-head-line (плашка снаружи, внутри обёртки — h2 + организатор): без сетки организатор
 * оказывается под заголовком. display:contents «поднимает» h2 и организатор в сетку .modal-head.
 * Шаблон в репозитории — .modal-head-top; это страховка для старых/мержнутых HTML.
 */
.modal-head:has(> .modal-head-line) {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, auto);
  grid-template-rows: auto auto;
  row-gap: 10px;
  column-gap: 16px;
}

.modal-head:has(> .modal-head-line) > .modal-head-line {
  display: contents;
}

.modal-head:has(> .modal-head-line) > .modal-type-badge {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
}

.modal-head:has(> .modal-head-line) .modal-organizer-head {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  align-self: center;
}

.modal-head:has(> .modal-head-line) .modal-event-title {
  grid-column: 1 / -1;
  grid-row: 2;
  align-self: start;
}

/* Строка 1: плашка слева, организатор справа (grid — без переноса «организатор» на отдельную строку как у flex-wrap) */
.modal-head-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, auto);
  align-items: center;
  column-gap: 16px;
  row-gap: 0;
  min-width: 0;
  width: 100%;
}

.modal-head-top .modal-type-badge {
  grid-column: 1;
  justify-self: start;
}

.modal-organizer-head {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  max-width: min(280px, 100%);
}

.modal-organizer-head[hidden] {
  display: none !important;
}

.modal-organizer-head-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
}

.modal-organizer-head-name {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* Тонкая «коричневая» линия между блоками */
.modal-rule {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 20px 0;
  height: 0;
  background: none;
}

/* Плашка типа — те же цвета, что у .fc-event.ev-* в календаре */
.modal-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  width: fit-content;
  flex-shrink: 0;
}

.modal-type-badge--like-calendar {
  border: none !important;
  border-left: none !important;
  color: var(--text);
  box-shadow: none;
}

.modal-type-badge--like-calendar.ev-outdoor {
  background: #e8f0e8;
  border-left: none !important;
}

.modal-type-badge--like-calendar.ev-virtual {
  background: #ede8f5;
  border-left: none !important;
}

.modal-type-badge--like-calendar.ev-camp {
  background: #f0ebe0;
  border-left: none !important;
}

.modal-type-badge--like-calendar.ev-other {
  background: #f5ede8;
  border-left: none !important;
}

.modal-type-badge--like-calendar.ev-race {
  background: repeating-linear-gradient(
    -45deg,
    #fff9e6,
    #fff9e6 4px,
    #ffefd0 4px,
    #ffefd0 8px
  );
  box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.45), 0 2px 10px rgba(201, 162, 39, 0.2);
  color: #3d2914;
  border-left: none !important;
}

.modal-type-badge--like-calendar.ev-brevet {
  background: repeating-linear-gradient(
    -45deg,
    #e8ebe4,
    #e8ebe4 4px,
    #dde5d8 4px,
    #dde5d8 8px
  );
  box-shadow: 0 0 0 1px rgba(90, 107, 82, 0.4), 0 2px 10px rgba(62, 80, 58, 0.18);
  color: #2c3528;
  border-left: none !important;
}

.modal-type-badge-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.modal-type-badge--like-calendar .modal-type-badge-icon {
  filter: none;
}

.modal-type-badge-text {
  min-width: 0;
}

.modal-event-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.3px;
  margin: 0;
  width: 100%;
  min-width: 0;
  text-align: left;
  align-self: flex-start;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.modal-meta-icon-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  margin-top: 2px;
}

/* Layout */
.modal-layout {
  display: flex;
  gap: 0;
}

.modal-main {
  flex: 1;
  padding: 28px 32px;
  min-width: 0;
}

.modal-sidebar {
  width: 220px;
  flex-shrink: 0;
  padding: 28px 24px 28px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-left: 1px solid var(--border-light);
  margin-left: 0;
  padding-left: 24px;
}

/* Meta row */
.modal-meta-row {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.modal-meta-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.modal-meta-item .meta-icon {
  font-size: 22px;
  margin-top: 2px;
}

.modal-meta-row--facts {
  margin-bottom: 20px;
  width: 100%;
  justify-content: space-between;
  gap: 8px 12px;
}

.modal-meta-row--facts .modal-meta-item {
  align-items: center;
}

.modal-meta-row--facts .modal-meta-icon-img {
  margin-top: 0;
}

.meta-label {
  font-family: var(--font-head);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.modal-meta-organizer .modal-organizer-avatar {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 36px;
  flex-shrink: 0;
  margin-top: 2px;
}

.modal-organizer-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: var(--shadow-xs);
}

.modal-sidebar--hidden {
  display: none !important;
}

.meta-value {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.modal-divider {
  height: 1px;
  background: var(--border-light);
  margin-bottom: 20px;
}

.modal-section { margin-bottom: 20px; }

.modal-section-label {
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.modal-raw-text {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-mid);
  white-space: pre-wrap;
  word-break: break-word;
}

.modal-raw-text a { color: var(--secondary); text-decoration: underline; text-underline-offset: 2px; }
.modal-raw-text a:hover { color: var(--primary); }

.modal-raw-text .tg-custom-emoji {
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
  vertical-align: -0.2em;
  object-fit: contain;
  /* Светлые монохромные глифы Telegram на кремовом фоне; без инверсии цветных */
  filter: drop-shadow(0 0 0.65px rgba(62, 39, 35, 0.42));
}

.modal-location {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--primary-light);
  border-radius: var(--r-md);
  margin-bottom: 24px;
}

.modal-location-icon {
  width: 36px; height: 36px;
  background: transparent;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.modal-location-icon-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}

.modal-location-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-head);
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.btn-register {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg-hover);
  color: var(--text-mid);
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  letter-spacing: 0.02em;
}

.btn-register:hover {
  background: var(--bg-hover);
  color: var(--text-mid);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(47, 79, 79, 0.12);
}

.btn-register:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(47, 79, 79, 0.1);
}

.btn-register-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

/* ========================================
   WEATHER BLOCK (modal)
   ======================================== */

.modal-weather {
  background: var(--primary-light);
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin-bottom: 24px;
}

.weather-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.weather-title-icon { font-size: 18px; }

.weather-title-text {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
}

.weather-body {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.weather-icon {
  flex-shrink: 0;
  border-radius: var(--r-sm);
  background: rgba(47, 79, 79, 0.08);
}

.weather-temp { flex-shrink: 0; }

.weather-temp-main {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.weather-temp-feels {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.weather-details { flex: 1; min-width: 100px; }

.weather-desc {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-mid);
  text-transform: capitalize;
}

.weather-wind {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.weather-forecast-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 10px;
  text-align: right;
}

.weather-locked {
  font-size: 14px;
  color: var(--text-muted);
  font-style: italic;
  padding: 4px 0;
}

.weather-unavailable {
  font-size: 14px;
  color: var(--text-muted);
  font-style: italic;
  padding: 4px 0;
}

/* ========================================
   FOOTER
   ======================================== */

.site-footer {
  background: var(--text);
  color: rgba(255,255,255,0.5);
  padding: 48px 0 24px;
  margin-top: 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 48px;
  margin-bottom: 36px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  margin-bottom: 10px;
}

.footer-title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 800;
  color: white;
}

.footer-brand p {
  font-size: 13px;
  line-height: 1.65;
  max-width: 240px;
}

.footer-col h4 {
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.65);
  margin-bottom: 14px;
}

.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col ul li a {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  text-decoration: none;
  transition: color 0.2s;
  font-family: var(--font-body);
}
.footer-col ul li a:hover { color: rgba(255,255,255,0.85); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-bottom p { font-size: 12px; font-family: var(--font-body); }

.footer-bottom-links { display: flex; gap: 20px; }
.footer-bottom-links a {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-bottom-links a:hover { color: rgba(255,255,255,0.7); }

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 900px) {
  .modal-layout { flex-direction: column; }
  .modal-sidebar {
    width: 100%;
    flex-direction: column;
    border-left: none;
    border-top: 1px solid var(--border-light);
    padding: 20px 32px;
    gap: 12px;
  }
  .modal-sidebar .modal-weather { width: 100%; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-brand { grid-column: span 2; }
  .navbar-search input { width: 140px; }
}

@media (max-width: 768px) {
  .container { padding: 0 16px; }

  /* Хедер — компактный, всё видно */
  .navbar { gap: 8px; height: auto; padding: 8px 0; flex-wrap: wrap; }
  .navbar-brand { flex-shrink: 0; }
  .navbar-logo { width: 30px; height: 30px; }
  .navbar-title { font-size: 2rem; }

  /* Главная: заголовок ужимается, чтобы «Велокалендарь» и город остались в одной строке */
  .navbar--main .navbar-title {
    font-size: clamp(1rem, 4.9vw, 1.55rem);
    letter-spacing: -0.28px;
  }

  .navbar--main .navbar-brand-row .navbar-brand {
    flex: 1 1 auto;
    min-width: 0;
    flex-shrink: 1;
    flex-wrap: nowrap;
  }

  .navbar--main .navbar-brand-row {
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
  }

  .navbar--main .navbar-brand-row,
  .navbar--simple .navbar-brand-row {
    flex-basis: 100%;
    width: 100%;
  }

  .navbar-brand-row .navbar-brand {
    min-width: 0;
    flex: 1 1 auto;
  }

  .navbar-beta-badge--under-header {
    font-size: 11px;
  }

  .navbar-nav { display: flex; gap: 0; }
  .navbar-nav a { padding: 5px 10px; font-size: 12px; }

  .navbar-search {
    display: flex;
    margin-left: auto;
    padding: 6px 10px;
  }
  .navbar-search input { width: 90px; font-size: 13px; }

  /* Переключатель вида — всегда видим */
  .view-switcher { display: flex; }
  .view-btn { padding: 6px 10px; font-size: 12px; }

  /* Hero: меньше зазор под шапкой и по вертикали, компактнее типографика */
  .page-wrapper { padding-top: 0; }

  .page-hero {
    --hero-month-slot-w: min(288px, calc(100vw - 88px));
    padding: 6px 0 8px;
  }

  .page-hero h1 { font-size: 1.8rem; }

  .page-hero .subtitle {
    margin-top: 2px;
    font-size: 11px;
    letter-spacing: 0.2px;
    line-height: 1.35;
  }

  .hero-month-row {
    gap: 4px;
    grid-template-columns: 30px minmax(0, var(--hero-month-slot-w, 288px)) 30px;
  }

  .hero-nav-btn {
    width: 30px;
    height: 30px;
    font-size: 17px;
    padding-bottom: 0;
  }

  /* Заголовок на всю ширину; «Фильтры» и Календарь/Список — одна строка, вправо */
  .hero-top {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .hero-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
    gap: 5px;
    min-width: 0;
  }
  .hero-actions .btn-filters-toggle {
    flex-shrink: 0;
    padding: 5px 10px;
    font-size: 11px;
    gap: 4px;
    letter-spacing: 0.15px;
  }
  .hero-actions .btn-filters-icon { font-size: 13px; }
  .hero-actions .view-switcher {
    flex-shrink: 1;
    min-width: 0;
    padding: 2px;
    gap: 1px;
  }
  .hero-actions .view-btn {
    padding: 5px 6px;
    font-size: 10px;
    white-space: nowrap;
  }

  .filters-panel {
    margin-bottom: 12px;
    border-radius: var(--r-md);
  }
  .filters-inner {
    padding: 12px 14px;
    gap: 10px;
  }
  .filter-label { font-size: 10px; letter-spacing: 0.8px; }

  .filter-input,
  .filter-select {
    padding: 7px 10px;
    font-size: 13px;
    min-width: 0;
  }
  .btn-clear {
    padding: 7px 12px;
    font-size: 12px;
  }

  .calendar-section { padding: 0; }

  .fc-toolbar-title { font-size: 1.2rem !important; }
  .fc-button-primary { padding: 6px 10px !important; font-size: 12px !important; }

  .modal-content { border-radius: var(--r-lg); }
  .modal-event-title { font-size: 1.15rem; }
  .modal-main { padding: 20px; }
  .modal-organizer-head-name { font-size: 13px; }
  /* запас под круглую кнопку «закрыть» в углу модалки */
  .modal-head { padding-right: 40px; }

  /* Плашка типа в модалке: только иконка; подпись скрыта визуально, остаётся для скринридеров */
  .modal-head .modal-type-badge {
    position: relative;
    padding: 6px;
    gap: 0;
  }
  .modal-head .modal-type-badge-icon {
    width: 13px;
    height: 13px;
  }
  .modal-head .modal-type-badge-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  .modal-meta-row { gap: 16px; }
  .modal-actions { flex-direction: column; }

  .upcoming-cards { grid-template-columns: 1fr; }

  .footer-inner { grid-template-columns: 1fr; gap: 20px; }
  .footer-brand { grid-column: 1; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}

@media (max-width: 480px) {
  .modal-meta-row { flex-direction: column; gap: 12px; }
  .modal-meta-row--facts {
    justify-content: flex-start;
  }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

:focus-visible { outline: 2px solid var(--secondary); outline-offset: 2px; }
/* ========================================
   CITY SWITCHER
   ======================================== */

.city-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.city-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px 5px 10px;
  background: var(--secondary);
  color: white;
  border: none;
  border-radius: var(--r-pill);
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.2px;
  white-space: nowrap;
  line-height: 1.4;
}

.city-btn:hover {
  background: var(--accent-warm);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.city-btn-pin { font-size: 13px; }

.city-chevron {
  font-size: 11px;
  opacity: 0.8;
  margin-left: 2px;
  transition: transform 0.2s;
}

.city-btn[aria-expanded="true"] .city-chevron {
  transform: rotate(180deg);
}

.city-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--bg-card);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  min-width: 200px;
  z-index: 300;
  overflow: hidden;
  border: 1px solid var(--border-light);
  animation: dropdownIn 0.18s ease;
}

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

.city-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border-light);
}

.city-option:last-child { border-bottom: none; }

.city-option:hover {
  background: var(--bg-hover);
}

.city-option.active {
  color: var(--secondary);
  font-weight: 700;
  background: var(--secondary-light);
}

/* На мобильном — немного компактнее */
@media (max-width: 768px) {
  .city-btn {
    font-size: 12px;
    padding: 4px 10px 4px 8px;
  }
  .city-btn-pin { display: none; }
  .city-dropdown { min-width: 170px; }
}

/* ========================================
   FEEDBACK BUTTON & MODAL
   ======================================== */

.feedback-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 210;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: var(--secondary);
  color: #fff;
  border: none;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.feedback-fab:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
  background: var(--accent-warm);
}

@media (max-width: 768px) {
  .feedback-fab {
    right: 16px;
    bottom: 16px;
    font-size: 13px;
    padding: 8px 14px;
  }
}

/* 404 и простые страницы (клубы): .feedback-fab обычно fixed — здесь inline */
.page-404 .feedback-fab.page-404-feedback-btn,
.simple-page-body .feedback-fab.page-404-feedback-btn {
  position: static;
  right: auto;
  bottom: auto;
  z-index: auto;
  text-decoration: none;
  box-sizing: border-box;
  min-width: min(280px, 100%);
  justify-content: center;
  /* выше по каскаду бьёт .simple-page-body a (color: var(--secondary) = фон кнопки) */
  color: #fff;
}

.page-404 .feedback-fab.page-404-feedback-btn:hover,
.simple-page-body .feedback-fab.page-404-feedback-btn:hover {
  color: #fff;
  text-decoration: none;
}

.page-404-feedback-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 0 16px;
  box-sizing: border-box;
}

.page-404-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
  padding: 0 16px;
}

.btn-404-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  background: var(--secondary);
  color: #fff;
  border: none;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn-404-secondary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
  background: var(--accent-warm);
  color: #fff;
}

.btn-404-secondary--muted {
  background: var(--primary);
  opacity: 0.92;
}

.btn-404-secondary--muted:hover {
  opacity: 1;
  background: var(--accent-warm);
}

@media (max-width: 480px) {
  .page-404-actions {
    flex-direction: column;
    width: 100%;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
  }

  .page-404-actions .btn-404-secondary {
    width: 100%;
  }
}

.feedback-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(30, 18, 12, 0.6);
  backdrop-filter: blur(8px);
  padding: 20px;
  overflow-y: auto;
  justify-content: center;
  align-items: center;
}

.feedback-overlay.open {
  display: flex;
}

.feedback-modal {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 420px;
  padding: 22px 24px 20px;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.feedback-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-mid);
  transition: background 0.15s;
}

.feedback-close:hover {
  background: var(--bg-hover);
}

.feedback-title {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--primary);
}

.feedback-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feedback-label {
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.feedback-textarea {
  border-radius: var(--r-md);
  border: 1px solid var(--border-light);
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  resize: vertical;
  min-height: 80px;
}

.feedback-textarea:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 2px rgba(128, 0, 32, 0.15);
}

.feedback-file-hidden {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.feedback-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--r-md);
  padding: 18px 16px;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  cursor: pointer;
}

.feedback-dropzone--drag {
  border-color: var(--secondary);
  background: var(--secondary-light);
}

.feedback-dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.feedback-dropzone-icon {
  font-size: 22px;
}

.feedback-dropzone-text {
  font-size: 13px;
  color: var(--text-muted);
}

.feedback-dropzone-btn {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--r-pill);
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 4px;
}

.feedback-dropzone-btn:hover {
  background: var(--primary);
  filter: brightness(0.94);
  transform: translateY(-1px);
}

.feedback-dropzone-selected {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.feedback-dropzone-selected.hidden { display: none; }

.feedback-selected-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feedback-selected-remove {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--bg-hover);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.feedback-selected-remove:hover {
  background: var(--secondary-light);
  color: var(--secondary);
}

.feedback-status {
  min-height: 18px;
  font-size: 13px;
  margin-top: 4px;
}

.feedback-status--loading {
  color: var(--text-muted);
}

.feedback-status--success {
  color: var(--accent);
}

.feedback-status--error {
  color: var(--secondary);
}

.feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.feedback-btn-secondary,
.feedback-btn-primary {
  border-radius: var(--r-pill);
  padding: 8px 16px;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

.feedback-btn-secondary {
  background: transparent;
  color: var(--text-muted);
}

.feedback-btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.feedback-btn-primary {
  background: var(--secondary);
  color: #fff;
}

.feedback-btn-primary[disabled] {
  opacity: 0.7;
  cursor: default;
}

.feedback-btn-primary:not([disabled]):hover {
  background: var(--accent-warm);
}

/* ========================================
   SIMPLE PAGES & 404
   ======================================== */

.simple-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 0 64px;
}

.simple-page:has(.clubs-grid) {
  max-width: 1000px;
}

.simple-page-title {
  font-family: var(--font-head);
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 24px;
}

.simple-page-body {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.75;
}

.simple-page-body h2 {
  font-family: var(--font-head);
  font-size: 1.35rem;
  color: var(--primary);
  margin: 32px 0 12px;
}

.simple-page-body h3 {
  font-family: var(--font-head);
  font-size: 1.15rem;
  color: var(--primary);
  margin: 24px 0 8px;
}

.simple-page-body p {
  margin-bottom: 16px;
}

.simple-page-body ul,
.simple-page-body ol {
  margin: 0 0 16px 24px;
}

.simple-page-body li {
  margin-bottom: 6px;
}

.simple-page-body a {
  color: var(--secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.simple-page-body a:hover {
  color: var(--accent-warm);
}

/* ========================================
   DONATE CARD (календарь + список)
   ======================================== */

/* В месячной сетке — одна колонка дня, как плашка живого заезда, чуть выше */
.fc-daygrid-event.fc-donate-event {
  background: #e8f0e8 !important;
  border: none !important;
  border-left: 3px solid var(--primary) !important;
  border-radius: var(--r-sm) !important;
  padding: 5px 6px !important;
  margin: 1px 2px !important;
  min-height: 34px;
  max-width: 100% !important;
  width: auto !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
}

.fc-daygrid-event.fc-donate-event:hover {
  filter: brightness(0.95) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 8px rgba(62, 39, 35, 0.15) !important;
}

.fc-donate-card-inner {
  display: flex !important;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0;
  cursor: pointer;
  box-sizing: border-box;
}

.fc-donate-card-inner:hover {
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.fc-donate-heart {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff !important;
  color: var(--accent-warm) !important;
  border: 1px solid var(--border-light);
}

.fc-donate-heart svg {
  display: block;
}

/* Компактная иконка в календаре (как аватар клуба ~22px) */
.fc-donate-event .fc-donate-heart {
  width: 22px;
  height: 22px;
  border-radius: 4px;
}

.fc-donate-event .fc-donate-heart svg {
  width: 12px;
  height: 12px;
}

.fc-donate-card-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.fc-donate-card-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 12px;
  line-height: 1.25;
  color: var(--primary);
}

.fc-donate-card-sub {
  font-size: 10px;
  line-height: 1.3;
  color: var(--text-muted);
}

.fc-donate-event .fc-donate-card-title {
  font-family: var(--font-body) !important;
  font-weight: 600 !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  color: var(--text) !important;
}

.fc-donate-event .fc-donate-card-sub {
  font-size: 10px !important;
  line-height: 1.25 !important;
}

.fc-donate-card-chevron {
  flex-shrink: 0;
  font-size: 18px;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1;
}

.fc-donate-event .fc-donate-card-chevron {
  font-size: 14px;
  align-self: center;
}

.event-row.list-donate-card:hover .event-row-chevron {
  color: var(--accent-warm);
}

.fc-daygrid-event.fc-donate-event:hover .fc-donate-card-chevron {
  color: var(--text-mid);
}

/* Список: та же сетка строки, что у .event-row */
.event-row.list-donate-card {
  background: #e8f0e8;
  box-shadow: inset 0 0 0 1px rgba(47, 79, 79, 0.06);
}

.event-row.list-donate-card:hover {
  box-shadow: var(--shadow-md), inset 0 0 0 1px rgba(47, 79, 79, 0.06);
}

.event-row.list-donate-card:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

.list-donate-card__time {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
}

.list-donate-card__heart {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.list-donate-card__heart svg {
  width: 18px;
  height: 18px;
}

.list-donate-card__hint {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0;
  text-transform: none;
}

.feedback-modal.donate-modal {
  max-width: 480px;
}

.donate-modal .feedback-title {
  margin-bottom: 12px;
}

.donate-modal-text {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.6;
  margin: 0 0 18px;
}

.donate-modal-qr-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  padding: 16px;
  background: #fff;
  border-radius: var(--r-md);
  border: 1px solid var(--border-light);
}

.donate-modal-qr {
  display: block;
  width: 220px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  image-rendering: crisp-edges;
}

.donate-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Кнопка Т-Банка: как мобильная донат-плитка — фон страницы, тонкая рамка */
.donate-tbank-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border-light);
  box-shadow: none;
  box-sizing: border-box;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.donate-tbank-btn:hover {
  color: var(--text);
  text-decoration: none;
  border-color: var(--border);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.donate-tbank-btn:active {
  transform: translateY(0);
}

.donate-tbank-btn:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

.donate-tbank-btn__mark {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.donate-tbank-btn__logo {
  display: block;
  height: 28px;
  width: auto;
}

.donate-tbank-btn__label {
  letter-spacing: 0.02em;
}

/* ========================================
   CLUBS PAGE
   ======================================== */

.clubs-page-city-row {
  margin: 8px 0 28px;
  max-width: 640px;
}

.simple-page-body h2.clubs-subsection-heading {
  margin-top: 48px;
  margin-bottom: 20px;
}

.clubs-empty-note {
  font-size: 0.95rem;
  color: var(--text-mid);
  line-height: 1.55;
  margin: 0 0 24px;
}

.clubs-empty-note a {
  color: var(--primary);
  font-weight: 600;
}

.clubs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 960px;
}

.simple-page-body .club-card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.2s;
}

.club-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.club-card-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--bg-hover) 0%, var(--border-light) 100%);
  overflow: hidden;
}

.club-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.club-card-body {
  padding: 16px 18px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.club-card-name {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

.club-card-desc {
  font-size: 0.9rem;
  color: var(--text-mid);
  line-height: 1.55;
  margin: 0;
}

.clubs-cta-block {
  margin-top: 32px;
  text-align: center;
}

.clubs-cta-text {
  font-size: 0.95rem;
  color: var(--text-mid);
  margin: 0 0 16px;
  line-height: 1.5;
}

.clubs-cta-block .page-404-feedback-wrap {
  margin-top: 0;
}

@media (max-width: 768px) {
  .clubs-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}