/* ==========================================================================
   КОМПОНЕНТЫ: МОДАЛЬНЫЕ ОКНА, МАРШРУТНЫЙ ЯЩИК, СЕТКА КАТАЛОГА, ВИДЖЕТ ЧАСОВ
   ========================================================================== */

/* ==========================================================================
   1. МОДАЛЬНОЕ ОКНО ПОДРОБНОЙ ИНФОРМАЦИИ О МЕСТЕ
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 14, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-smooth);
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.place-modal-card {
  background: var(--surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  max-width: 860px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg), var(--glow-gold);
  position: relative;
  transform: translateY(30px) scale(0.97);
  transition: all var(--transition-smooth);
  scrollbar-width: thin;
  scrollbar-color: var(--accent-gold) var(--surface-2);
}

.modal-backdrop.open .place-modal-card {
  transform: translateY(0) scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(var(--fg-rgb), 0.1);
  border: 1px solid var(--border-glass);
  color: var(--text-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  background: var(--accent-red);
  transform: rotate(90deg);
}

/* Шапка модального окна с галереей */
.modal-hero-cover {
  position: relative;
  height: 340px;
  width: 100%;
  overflow: hidden;
}

.modal-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 18, 20, 0.1) 0%, rgba(20, 18, 20, 0.95) 100%);
  display: flex;
  align-items: flex-end;
  padding: 2rem 2.5rem;
}

.modal-hero-titles h2 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  color: #fff;
  line-height: 1.2;
}

.modal-hero-mari {
  color: var(--accent-gold);
  font-size: 1rem;
  font-style: italic;
  display: block;
  margin-top: 0.35rem;
}

/* Контентная часть модального окна */
.modal-body {
  padding: 2rem 2.5rem;
}

.modal-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(var(--fg-rgb), 0.08);
}

.info-chip {
  background: rgba(var(--fg-rgb), 0.04);
  border: 1px solid rgba(var(--fg-rgb), 0.07);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.info-chip-icon {
  color: var(--accent-gold);
  font-size: 1.2rem;
  margin-top: 2px;
}

.info-chip-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-chip-val {
  font-size: 0.9rem;
  color: var(--text-strong);
  font-weight: 500;
  margin-top: 2px;
}

.modal-section-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--text-strong);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-text {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.75rem;
}

.modal-tip-box {
  background: rgba(200, 16, 46, 0.1);
  border-left: 4px solid var(--accent-gold);
  padding: 1.15rem 1.4rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 2rem;
}

.modal-tip-box h4 {
  color: var(--accent-gold-light);
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.modal-tip-box p {
  color: #f1f3f5;
  font-size: 0.9rem;
  line-height: 1.5;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(var(--fg-rgb), 0.08);
}

/* ==========================================================================
   2. БОКОВОЙ ПЛАНИРОВЩИК МАРШРУТА (ROUTE DRAWER)
   ========================================================================== */
.route-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 10, 0.7);
  backdrop-filter: blur(12px);
  z-index: 600;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-smooth);
}

.route-drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.route-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-left: 1px solid var(--border-glass);
  box-shadow: -15px 0 50px rgba(0, 0, 0, 0.7);
  z-index: 601;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-smooth);
}

.route-drawer-backdrop.open .route-drawer {
  transform: translateX(0);
}

.drawer-header {
  padding: 1.5rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(var(--fg-rgb), 0.08);
}

.drawer-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--text-strong);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Предустановленные быстрые маршруты */
.preset-routes-block {
  background: rgba(var(--fg-rgb), 0.03);
  border: 1px solid rgba(var(--fg-rgb), 0.08);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.preset-title {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.preset-pill-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.preset-pill {
  background: rgba(var(--fg-rgb), 0.05);
  border: 1px solid rgba(var(--fg-rgb), 0.08);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preset-pill:hover {
  background: rgba(200, 16, 46, 0.15);
  border-color: var(--accent-gold);
}

.preset-pill span.sub {
  font-size: 0.75rem;
  color: var(--accent-gold);
}

/* Список выбранных точек маршрута */
.route-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.route-item-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: rgba(var(--fg-rgb), 0.04);
  border: 1px solid rgba(var(--fg-rgb), 0.08);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  position: relative;
  transition: all var(--transition-fast);
}

.route-item-card:hover {
  background: rgba(var(--fg-rgb), 0.08);
  border-color: rgba(var(--fg-rgb), 0.15);
}

.route-item-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.route-item-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.route-item-details {
  flex: 1;
  min-width: 0;
}

.route-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.route-item-cat {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.route-item-del-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.route-item-del-btn:hover {
  color: var(--accent-red);
  background: rgba(200, 16, 46, 0.1);
}

.route-empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.route-empty-state p {
  font-size: 0.9rem;
  margin-top: 0.75rem;
}

/* Статистика маршрута внизу ящика */
.drawer-footer {
  padding: 1.5rem 1.75rem;
  border-top: 1px solid rgba(var(--fg-rgb), 0.08);
  background: rgba(var(--bg-rgb), 0.95);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.route-stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.route-stat-box {
  display: flex;
  flex-direction: column;
}

.route-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.route-stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-gold-light);
}
#route-total-duration { color: var(--accent-emerald); }

/* ==========================================================================
   3. КАТАЛОГ В РЕЖИМЕ СЕТКИ (GRID CATALOG VIEW)
   ========================================================================== */
.catalog-grid-view {
  position: fixed;
  inset: 0;
  padding-top: calc(var(--header-height) + 5rem);
  padding-bottom: 3rem;
  padding-left: 2rem;
  padding-right: 2rem;
  overflow-y: auto;
  z-index: 20;
  background: var(--bg-dark);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all var(--transition-smooth);
}

.catalog-grid-view.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.catalog-grid-container {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
}

.place-card-grid {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-smooth);
  cursor: pointer;
}

.place-card-grid:hover {
  transform: translateY(-6px);
  border-color: var(--accent-gold);
  box-shadow: var(--shadow-lg), var(--glow-gold);
}

.place-card-grid-img-wrap {
  position: relative;
  height: 200px;
  width: 100%;
  overflow: hidden;
}

.place-card-grid-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.place-card-grid:hover .place-card-grid-img {
  transform: scale(1.06);
}

.place-card-grid-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(var(--bg-rgb), 0.85);
  border: 1px solid var(--border-glass);
  color: var(--accent-gold);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  backdrop-filter: blur(8px);
}

.place-card-grid-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.place-card-grid-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--text-strong);
  margin-bottom: 0.35rem;
}

.place-card-grid-mari {
  font-size: 0.8rem;
  color: var(--accent-gold);
  font-style: italic;
  margin-bottom: 0.75rem;
}

.place-card-grid-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.place-card-grid-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(var(--fg-rgb), 0.06);
}

/* ==========================================================================
   4. ДИАЛОГ ЧАСОВ 12 АПОСТОЛОВ
   ========================================================================== */
.apostles-dialog-card {
  max-width: 600px;
}

.apostles-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.timeline-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(var(--fg-rgb), 0.04);
  border: 1px solid rgba(var(--fg-rgb), 0.08);
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-sm);
}

.timeline-slot.next-up {
  background: rgba(200, 16, 46, 0.15);
  border-color: var(--accent-gold);
}

.timeline-time {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-strong);
}

.timeline-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(var(--fg-rgb), 0.1);
  color: var(--text-muted);
}

.timeline-slot.next-up .timeline-tag {
  background: var(--accent-primary);
  color: #fff;
  font-weight: 700;
}

/* ==========================================================================
   АДАПТИВНОСТЬ ДЛЯ МОДАЛЬНЫХ ОКОН
   ========================================================================== */
@media (max-width: 640px) {
  .place-modal-card {
    max-height: 95vh;
  }

  .modal-hero-cover {
    height: 220px;
  }

  .modal-hero-overlay {
    padding: 1.25rem 1.5rem;
  }

  .modal-hero-titles h2 {
    font-size: 1.5rem;
  }

  .modal-body {
    padding: 1.5rem 1.25rem;
  }

  .route-drawer {
    max-width: 100%;
  }

  .catalog-grid-view {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ==========================================================================
   ===== ЭТАП 2: интерактивные фичи (js/features/*) =====
   ========================================================================== */

[hidden] { display: none !important; }

/* ==========================================================================
   5. МИКРОВЗАИМОДЕЙСТВИЯ (a11y.js → 'fx'): ripple, scroll-reveal, плавные картинки
   ========================================================================== */
.fx-host { overflow: hidden; }
.fx-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0);
  opacity: 0.9;
  pointer-events: none;
  animation: fx-ripple 0.65s ease-out forwards;
}
.btn-primary .fx-ripple { background: rgba(11, 11, 13, 0.25); }
@keyframes fx-ripple { to { transform: scale(1); opacity: 0; } }

/* scroll-reveal: прячем только то, что ниже первого экрана; состояние «показано» не фиксируем анимацией (hover остаётся рабочим) */
.reveal { opacity: 0; }
.reveal.is-revealed { opacity: 1; animation: yo-reveal 0.55s cubic-bezier(0.16, 1, 0.3, 1) var(--rd, 0ms) backwards; }
@keyframes yo-reveal { from { opacity: 0; transform: translateY(18px); } }

/* картинки: мягкое появление после skeleton */
.fx-img { opacity: 0; transition: opacity 0.45s ease; background: linear-gradient(110deg, #181416 30%, #1d2433 50%, #181416 70%); background-size: 200% 100%; animation: fx-shimmer 1.4s linear infinite; }
.fx-img.is-loaded { opacity: 1; animation: none; background: none; }
@keyframes fx-shimmer { to { background-position: -200% 0; } }

/* карточки и плитки: аккуратный подъём */
.entry-card, .cat-tile, .pn-link, .fact-card, .dist-item { will-change: auto; }
.entry-card:focus-within { border-color: var(--border-glow); box-shadow: var(--shadow-lg); }
.cat-tile { transition: transform var(--transition-smooth), box-shadow var(--transition-smooth); }
.cat-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg), var(--glow-gold); }
.btn:focus-visible, .chip:focus-visible, .icon-btn:focus-visible, .map-action-pill:focus-visible, .link-btn:focus-visible,
.fav-btn:focus-visible, .lb-btn:focus-visible, .lb-nav:focus-visible, .a11y-fab:focus-visible, .sp-item:focus-visible {
  outline: 2px solid var(--accent-gold-light);
  outline-offset: 2px;
}
.btn { position: relative; }

html.a11y-no-motion .reveal, html.a11y-no-motion .fx-img { opacity: 1; animation: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .fx-img { opacity: 1; animation: none; }
  .fx-ripple { display: none; }
}

/* ==========================================================================
   6. ИЗБРАННОЕ: сердечко на карточках, страница #/favorites
   ========================================================================== */
.fav-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 3;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(var(--bg-rgb), 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(var(--fg-rgb), 0.28);
  color: var(--text-strong);
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.fav-btn svg { fill: transparent; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; transition: fill var(--transition-fast); }
.fav-btn:hover { transform: scale(1.1); background: rgba(200, 16, 46, 0.75); border-color: transparent; }
.fav-btn.is-on { color: #ff4d6d; border-color: rgba(255, 77, 109, 0.6); }
.fav-btn.is-on svg { fill: currentColor; }
.fav-btn.is-pop { animation: fav-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes fav-pop { 0% { transform: scale(1); } 40% { transform: scale(1.4); } 100% { transform: scale(1); } }
.tl-entry .fav-btn, .rail-card .fav-btn { top: 0.5rem; right: 0.5rem; }

#fav-count.is-bump, #btn-favorites.is-bump { animation: fav-bump 0.5s ease; }
@keyframes fav-bump { 30% { transform: scale(1.3); } 100% { transform: scale(1); } }

.entry-card.is-leaving { opacity: 0; transform: scale(0.94); transition: opacity 0.25s ease, transform 0.25s ease; pointer-events: none; }
.fav-actions { margin: 1rem 0 1.25rem; }
.fav-page .toolbar-count { margin-bottom: 0.8rem; }
.fav-shared { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1rem; }
.fav-shared .entry-actions { margin-bottom: 0; }
.fav-clear { margin-left: auto; }
.fav-page .section-head.mt { margin-top: 2.5rem; }

/* ==========================================================================
   7. «ОТКРЫТО СЕЙЧАС» и фильтры каталога / туров
   ========================================================================== */
.hrs-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.18rem 0.6rem 0.18rem 0.5rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  white-space: nowrap;
}
.hrs-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.hrs-open, .hrs-always { color: #4ade80; background: rgba(74, 222, 128, 0.12); border-color: rgba(74, 222, 128, 0.35); }
.hrs-closing { color: #fbbf24; background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.4); }
.hrs-closed { color: #fca5a5; background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.35); }
.hrs-open .hrs-dot, .hrs-always .hrs-dot { animation: pulse-dot 1.8s infinite; }
.map-popup-hours .hrs-badge { font-size: 0.7rem; }
.entry-card:not(.rail-card) > .entry-card-body > .card-badges { padding-right: 2.6rem; } /* место под сердечко избранного (в строчной раскладке оно над текстом) */
.card-badges .hrs-badge { font-size: 0.68rem; padding: 0.1rem 0.5rem 0.1rem 0.4rem; }

.is-filtered-out { display: none !important; }
.flt-row { margin-bottom: 0.25rem; align-items: center; }
.flt-status { font-size: 0.8rem; color: var(--text-muted); }
.flt-status.is-busy { animation: fx-blink 1.2s ease infinite; }
@keyframes fx-blink { 50% { opacity: 0.45; } }
.flt-empty { color: var(--text-muted); font-size: 0.92rem; padding: 1rem 0; }
.chip[aria-pressed="true"] { background: var(--accent-primary); color: #fff; border-color: var(--accent-primary); font-weight: 600; }
.chip { position: relative; cursor: pointer; }
.is-busy .chip { opacity: 0.7; }

.trs-panel { display: grid; gap: 0.8rem; margin-bottom: 1rem; padding: 1rem 1.1rem; background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: var(--radius-md); }
.trs-group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; }
.trs-label { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); min-width: 6.5rem; }
.trs-tail { justify-content: space-between; }
.tour-cta { position: relative; z-index: 2; margin-top: 0.7rem; align-self: flex-start; padding: 0.55rem 1.1rem; font-size: 0.82rem; }

/* ==========================================================================
   8. ПОИСК: палитра (Ctrl+K)
   ========================================================================== */
.search-pal { position: fixed; inset: 0; z-index: 1400; display: flex; justify-content: center; align-items: flex-start; padding: 8vh 1rem 1rem; opacity: 0; transition: opacity 0.2s ease; }
.search-pal.is-open { opacity: 1; }
.search-pal-backdrop { position: absolute; inset: 0; background: rgba(5, 7, 10, 0.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.search-pal-panel {
  position: relative;
  width: min(680px, 100%);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), var(--glow-gold);
  overflow: hidden;
  transform: translateY(-10px) scale(0.985);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.search-pal.is-open .search-pal-panel { transform: none; }
.search-pal-field { display: flex; align-items: center; gap: 0.7rem; padding: 0.85rem 1rem; border-bottom: 1px solid rgba(var(--fg-rgb), 0.08); color: var(--text-muted); }
.search-pal-input { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--text-strong); font-size: 1.05rem; font-family: inherit; padding: 0.2rem 0; }
.search-pal-input::placeholder { color: var(--text-muted); }
.search-pal-clear, .search-pal-esc { background: rgba(var(--fg-rgb), 0.08); border: 1px solid var(--border-glass); color: var(--text-secondary); border-radius: var(--radius-sm); padding: 0.2rem 0.5rem; font-size: 0.74rem; cursor: pointer; }
.search-pal-clear:hover, .search-pal-esc:hover { background: rgba(var(--fg-rgb), 0.16); color: var(--text-strong); }
.search-pal-filters { display: flex; gap: 0.4rem; padding: 0.6rem 1rem; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid rgba(var(--fg-rgb), 0.06); }
.search-pal-filters::-webkit-scrollbar { display: none; }
.search-pal-filters .chip { white-space: nowrap; padding: 0.3rem 0.8rem; font-size: 0.8rem; }
.search-pal-body { overflow-y: auto; padding: 0.4rem 0.5rem 0.8rem; flex: 1; scrollbar-width: thin; }
.sp-group { padding: 0.4rem 0; }
.sp-group-title { display: flex; justify-content: space-between; align-items: center; padding: 0.4rem 0.6rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); }
.sp-count { font-size: 0.7rem; color: var(--text-muted); font-weight: 400; }
.sp-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.2rem 0.6rem 0.4rem; }
.sp-item { display: flex; align-items: center; gap: 0.8rem; padding: 0.5rem 0.6rem; border-radius: var(--radius-sm); text-decoration: none; color: var(--text-main); border: 1px solid transparent; }
.sp-item.is-active { background: rgba(200, 16, 46, 0.14); border-color: rgba(200, 16, 46, 0.4); }
.sp-thumb { width: 46px; height: 46px; border-radius: var(--radius-sm); object-fit: cover; background: var(--surface-2); flex: none; }
.sp-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sp-title { font-weight: 600; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-meta { font-size: 0.78rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-go { color: var(--text-muted); font-size: 0.9rem; opacity: 0; }
.sp-item.is-active .sp-go { opacity: 1; }
.search-pal mark, .sp-title mark { background: rgba(200, 16, 46, 0.3); color: var(--accent-gold-light); border-radius: 3px; padding: 0 1px; }
.sp-empty { padding: 1.6rem 1rem; text-align: center; color: var(--text-muted); font-size: 0.92rem; }
.search-pal-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.6rem 1rem; border-top: 1px solid rgba(var(--fg-rgb), 0.08); font-size: 0.75rem; color: var(--text-muted); }
.search-pal-all { color: var(--accent-gold-light); text-decoration: none; font-weight: 600; white-space: nowrap; }
.search-pal-all:hover { text-decoration: underline; }
.sp-group-title .link-btn { font-size: 0.72rem; }
body.search-open { overflow: hidden; }

/* ==========================================================================
   9. ЛАЙТБОКС ГАЛЕРЕИ
   ========================================================================== */
.lb { position: fixed; inset: 0; z-index: 1500; display: flex; flex-direction: column; opacity: 0; transition: opacity 0.22s ease; user-select: none; -webkit-user-select: none; }
.lb.is-open { opacity: 1; }
.lb-backdrop { position: absolute; inset: 0; background: rgba(4, 6, 9, 0.94); }
.lb-top { position: relative; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.8rem 1rem; color: #fff; }
.lb-counter { font-size: 0.9rem; font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.lb-tools { display: flex; gap: 0.4rem; align-items: center; }
.lb-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 0.7rem; border-radius: var(--radius-full); background: rgba(255, 255, 255, 0.1); border: 1px solid var(--border-glass); color: #fff; font-size: 1.05rem; text-decoration: none; cursor: pointer; transition: background var(--transition-fast); }
.lb-btn:hover { background: rgba(255, 255, 255, 0.22); }
.lb-close:hover { background: var(--accent-red); }
.lb-entry { font-size: 0.82rem; font-weight: 600; background: var(--accent-primary); color: #fff; border-color: var(--accent-primary); }
.lb-entry:hover { background: var(--accent-primary-hover); }
.lb-stage { position: relative; z-index: 2; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; cursor: zoom-in; }
.lb.is-zoomed .lb-stage { cursor: grab; }
.lb-stage.is-grabbing { cursor: grabbing; }
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center center; will-change: transform; touch-action: none; }
.lb-img.is-loading { opacity: 0.35; }
.lb-img.lb-from-right { animation: lb-in-r 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.lb-img.lb-from-left { animation: lb-in-l 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes lb-in-r { from { opacity: 0; margin-left: 40px; } }
@keyframes lb-in-l { from { opacity: 0; margin-left: -40px; } }
.lb-spinner { position: absolute; width: 38px; height: 38px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.2); border-top-color: var(--accent-gold); animation: lb-spin 0.8s linear infinite; pointer-events: none; }
@keyframes lb-spin { to { transform: rotate(360deg); } }
.lb-nav { position: absolute; top: 50%; z-index: 4; transform: translateY(-50%); width: 52px; height: 72px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--border-glass); color: #fff; font-size: 2rem; cursor: pointer; border-radius: var(--radius-md); transition: background var(--transition-fast); }
.lb-nav:hover { background: rgba(255, 255, 255, 0.2); }
.lb-prev { left: 0.8rem; }
.lb-next { right: 0.8rem; }
.lb-bottom { position: relative; z-index: 3; padding: 0.5rem 1rem 0.9rem; display: flex; flex-direction: column; gap: 0.6rem; align-items: center; }
.lb-caption { color: var(--text-secondary); font-size: 0.9rem; text-align: center; max-width: 80ch; }
.lb-thumbs { display: flex; gap: 0.4rem; max-width: 100%; overflow-x: auto; padding: 0.2rem; scrollbar-width: thin; }
.lb-thumb { flex: none; width: 58px; height: 44px; padding: 0; border-radius: var(--radius-sm); overflow: hidden; border: 2px solid transparent; background: #141214; cursor: pointer; opacity: 0.55; transition: opacity var(--transition-fast), border-color var(--transition-fast); }
.lb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-thumb:hover { opacity: 0.9; }
.lb-thumb.is-active { opacity: 1; border-color: var(--accent-gold); }
body.lb-open { overflow: hidden; }
.zoomable { cursor: zoom-in; }

@media (max-width: 640px) {
  .lb-nav { width: 40px; height: 56px; font-size: 1.6rem; }
  .lb-prev { left: 0.3rem; }
  .lb-next { right: 0.3rem; }
  .lb-thumb { width: 48px; height: 36px; }
  .search-pal { padding: 0.5rem; }
  .search-pal-panel { max-height: calc(100vh - 1rem); max-height: calc(100dvh - 1rem); }
  .search-pal-foot .search-pal-hint { display: none; }
  .search-pal-foot { justify-content: flex-end; }
}

/* ==========================================================================
   10. КОНСТРУКТОР МАРШРУТА (шторка) — расширения route-planner.js
   ========================================================================== */
.preset-card { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.75rem 0.85rem; background: rgba(var(--fg-rgb), 0.05); border: 1px solid rgba(var(--fg-rgb), 0.08); border-radius: var(--radius-sm); }
.preset-card + .preset-card { margin-top: 0.5rem; }
.preset-card-name { font-weight: 600; font-size: 0.9rem; color: var(--text-strong); }
.preset-card .sub { font-size: 0.75rem; color: var(--accent-emerald); } /* время и длина прогулки — зелёным, а не тревожным красным */
.preset-card-desc { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.45; }
.preset-card-btns { display: flex; gap: 0.5rem; margin-top: 0.35rem; }
.preset-card-btns .btn { flex: 1; padding: 0.45rem 0.6rem; font-size: 0.78rem; }

.rp-tools { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.rp-tools:empty { display: none; }
.rp-tools .btn { flex: 1 1 auto; padding: 0.5rem 0.8rem; font-size: 0.8rem; }
.rp-tools .btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.route-item-grip { color: var(--text-muted); cursor: grab; font-size: 1.1rem; letter-spacing: -0.2em; padding: 0.3rem 0.1rem; touch-action: none; user-select: none; -webkit-user-select: none; }
.route-item-grip:active { cursor: grabbing; }
.route-item-card.is-ghost, .route-row.is-ghost { opacity: 0.35; border-style: dashed; }
.route-item-card.is-chosen { box-shadow: var(--shadow-lg); border-color: var(--accent-gold); }
.route-item-name { display: block; color: var(--text-strong); text-decoration: none; }
.route-item-name:hover { color: var(--accent-gold-light); }
.route-item-leg { margin-left: 0.4rem; color: var(--accent-emerald); }
.route-item-leg.is-warn { color: #fca5a5; }
.route-item-move { display: flex; flex-direction: column; gap: 2px; }
.route-item-move button { background: rgba(var(--fg-rgb), 0.06); border: 1px solid transparent; color: var(--text-muted); font-size: 0.6rem; line-height: 1; padding: 0.22rem 0.4rem; border-radius: 4px; cursor: pointer; }
.route-item-move button:hover:not(:disabled) { color: var(--text-strong); background: rgba(var(--fg-rgb), 0.16); }
.route-item-move button:disabled { opacity: 0.25; cursor: default; }
.route-empty-title { font-size: 1rem; color: var(--text-strong); font-weight: 600; margin-top: 0.5rem; }
.route-summary { color: var(--accent-emerald); font-size: 0.95rem; margin-bottom: 1rem; }
.route-row .route-item-grip { margin-right: -0.3rem; }

/* ==========================================================================
   11. ДОСТУПНОСТЬ: кнопка и панель
   ========================================================================== */
.a11y-fab {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 450;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(var(--bg-rgb), 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  color: var(--text-strong);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}
.a11y-fab:hover, .a11y-fab[aria-expanded="true"] { background: var(--accent-primary); color: #fff; transform: scale(1.06); }
.a11y-panel {
  position: fixed;
  left: 1rem;
  bottom: 4.2rem;
  z-index: 451;
  width: min(300px, calc(100vw - 2rem));
  padding: 0.9rem 1rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: a11y-in 0.2s ease;
}
@keyframes a11y-in { from { opacity: 0; transform: translateY(8px); } }
.a11y-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; color: var(--text-strong); }
.a11y-x { background: none; border: none; color: var(--text-muted); font-size: 1rem; cursor: pointer; padding: 0.2rem 0.4rem; }
.a11y-x:hover { color: var(--text-strong); }
.a11y-row { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.65rem 0.4rem; background: none; border: none; border-bottom: 1px solid rgba(var(--fg-rgb), 0.07); color: var(--text-main); font-size: 0.9rem; text-align: left; cursor: pointer; border-radius: 0; }
.a11y-row:hover { background: rgba(var(--fg-rgb), 0.04); }
.a11y-row:focus-visible { outline: 2px solid var(--accent-gold-light); outline-offset: -2px; }
.a11y-switch, .clock-switch-ui { position: relative; width: 40px; height: 22px; flex: none; border-radius: 11px; background: rgba(var(--fg-rgb), 0.2); transition: background var(--transition-fast); }
.a11y-switch::after, .clock-switch-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform var(--transition-fast); }
.a11y-row[aria-checked="true"] .a11y-switch { background: var(--accent-primary); }
.a11y-row[aria-checked="true"] .a11y-switch::after { transform: translateX(18px); background: #161416; }
.a11y-reset { margin-top: 0.7rem; }
.a11y-hint { margin-top: 0.4rem; font-size: 0.72rem; color: var(--text-muted); }
/* футер: нижний отступ под плавающие кнопки (a11y слева, «вверх» справа), пока футер виден — кнопка a11y приглушается */
.site-footer { padding-bottom: 4.75rem; }
html.footer-in-view .a11y-fab:not(:hover):not(:focus-visible):not([aria-expanded="true"]) { opacity: 0.6; }
.a11y-fab { transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast), opacity var(--transition-fast); }
@media (max-width: 899px) {
  body.mode-map .a11y-fab { bottom: auto; top: calc(var(--header-height) + 0.5rem); left: 0.6rem; width: 40px; height: 40px; }
  body.mode-map .a11y-panel { bottom: auto; top: calc(var(--header-height) + 3.4rem); left: 0.6rem; }
}
@media (max-width: 480px) { .a11y-fab { width: 42px; height: 42px; left: 0.6rem; bottom: 0.6rem; } .a11y-panel { left: 0.6rem; bottom: 3.8rem; } }

/* контраст: компоненты фич */
html.a11y-contrast a:not(.btn):not(.chip):not(.lb-btn):not(.cat-tile):not(.entry-card-media):not(.sp-item):not(.pn-link):not(.nav-link):not(.photo-link):not(.hist-img) { text-decoration: underline; text-underline-offset: 3px; }
html.a11y-contrast .chip, html.a11y-contrast .btn-secondary, html.a11y-contrast .fav-btn, html.a11y-contrast .hrs-badge { border-color: var(--text-strong); }
html.a11y-contrast .entry-card, html.a11y-contrast .fact-card, html.a11y-contrast .hist-card, html.a11y-contrast .ph-item { border-color: rgba(var(--fg-rgb), 0.55); }
html.a11y-contrast .sp-meta, html.a11y-contrast .fact-note, html.a11y-contrast .city-hint, html.a11y-contrast .photo-cap { color: #e1e5ea; }
html.a11y-contrast .hrs-open, html.a11y-contrast .hrs-always { color: #86efac; }
html.a11y-contrast .hrs-closed { color: #fecaca; }
html.a11y-bigfont .map-popup-inner { width: 300px; }
html.a11y-bigfont .map-panel { width: 320px; }

/* ==========================================================================
   12. ЧАСЫ «12 АПОСТОЛОВ»: статус, напоминание
   ========================================================================== */
.clock-live { color: #ff6b6b; font-weight: 700; }
.clock-widget-chip.is-live { border-color: var(--accent-red); }
.timeline-slot.is-past { opacity: 0.55; }
.timeline-desc { font-size: 0.85rem; color: var(--text-secondary); }
.clock-notify { margin: 0 0 1.25rem; padding: 0.9rem 1rem; background: rgba(var(--fg-rgb), 0.04); border: 1px solid rgba(var(--fg-rgb), 0.08); border-radius: var(--radius-md); }
.clock-switch { display: flex; align-items: center; gap: 0.8rem; cursor: pointer; color: var(--text-strong); font-size: 0.92rem; }
.clock-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.clock-switch input:checked + .clock-switch-ui { background: var(--accent-primary); }
.clock-switch input:checked + .clock-switch-ui::after { transform: translateX(18px); background: #161416; }
.clock-switch input:focus-visible + .clock-switch-ui { outline: 2px solid var(--accent-gold-light); outline-offset: 2px; }
.clock-notify-note { margin-top: 0.5rem; font-size: 0.76rem; color: var(--text-muted); }

/* ==========================================================================
   13. ОБРАТНАЯ СВЯЗЬ
   ========================================================================== */
.yo-ff { max-width: 720px; }
.ff-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.ff-select { width: 100%; }
.ff-req { color: var(--accent-gold); font-style: normal; }
.ff-meta { display: flex; justify-content: space-between; gap: 1rem; min-height: 1.1rem; }
.ff-counter { color: var(--text-muted); margin-left: auto; font-variant-numeric: tabular-nums; }
.ff-counter.is-warn { color: #fbbf24; }
.field-error { color: #ff8a8a; font-size: 0.78rem; min-height: 1em; }
.input.is-invalid { border-color: #ff6b6b; box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.18); }
.ff-note { font-size: 0.78rem; color: var(--text-muted); }
.ff-actions { display: flex; gap: 0.8rem; align-items: center; }
.ff-spin { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(11, 11, 13, 0.3); border-top-color: #0e0c0e; animation: lb-spin 0.7s linear infinite; }
.btn.is-loading .ff-spin { display: inline-block; }
.btn:disabled { opacity: 0.7; cursor: progress; transform: none; }
.ff-success { text-align: center; padding: 2.5rem 1rem; max-width: 560px; margin: 1.5rem 0; background: var(--bg-card); border: 1px solid var(--border-glow); border-radius: var(--radius-md); outline: none; animation: a11y-in 0.4s ease; }
.ff-ok-ico { width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: #0e0c0e; background: linear-gradient(135deg, #4ade80, #22c55e); box-shadow: 0 0 30px rgba(74, 222, 128, 0.35); }
.ff-success p { color: var(--text-secondary); margin-bottom: 1.2rem; }
@media (max-width: 640px) { .ff-row { grid-template-columns: 1fr; } }

/* ==========================================================================
   14. РАЗДЕЛ «О ГОРОДЕ» (#/city)
   ========================================================================== */
.city-page { padding-bottom: 3rem; }
.city-intro { max-width: 78ch; margin-bottom: 1.2rem; }
.city-prose p { color: var(--text-secondary); }
.city-postal { margin-top: 0.7rem; }
.city-nav { position: sticky; top: var(--chrome-height); z-index: 60; margin: 0 -1.5rem 1.5rem; padding: 0.65rem 1.5rem; background: rgba(var(--bg-rgb), 0.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid rgba(var(--fg-rgb), 0.07); }
.city-nav .chip-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.city-nav .chip-row::-webkit-scrollbar { display: none; }
.city-nav .chip { white-space: nowrap; }
.city-block { margin-top: 3rem; scroll-margin-top: calc(var(--chrome-height) + 4.5rem); }
.city-hint { margin: -0.6rem 0 0.9rem; font-size: 0.82rem; color: var(--text-muted); }
.city-nomap { padding: 2rem 1rem; text-align: center; color: var(--text-muted); }

/* факты */
.facts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.fact-card { padding: 1.3rem 1.2rem; background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: var(--radius-md); transition: transform var(--transition-smooth), border-color var(--transition-smooth); }
.fact-card:hover { transform: translateY(-4px); border-color: var(--border-glow); }
.fact-value { display: flex; align-items: baseline; gap: 0.4rem; flex-wrap: wrap; font-family: var(--font-heading); }
.fact-num { font-size: clamp(2rem, 4.2vw, 2.9rem); font-weight: 700; color: var(--accent-gold-light); line-height: 1.1; font-variant-numeric: tabular-nums; }
.fact-unit { font-size: 1rem; color: var(--text-secondary); }
.fact-label { margin-top: 0.4rem; color: var(--text-strong); font-weight: 600; }
.fact-note { margin-top: 0.2rem; font-size: 0.8rem; color: var(--text-muted); }

/* история */
.hist { position: relative; }
.hist-ctrl { display: flex; gap: 0.4rem; }
.hist-ctrl .icon-btn:disabled { opacity: 0.35; cursor: default; }
.hist-track { overflow-x: auto; overflow-y: hidden; padding: 0.5rem 0 1.4rem; scroll-snap-type: x proximity; cursor: grab; scrollbar-width: thin; outline: none; -webkit-overflow-scrolling: touch; }
.hist-track:focus-visible { outline: 2px solid var(--accent-gold-light); outline-offset: 4px; border-radius: var(--radius-md); }
.hist-track.is-dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; -webkit-user-select: none; }
.hist-list { list-style: none; display: flex; gap: 1rem; width: max-content; padding: 0 0.25rem; position: relative; }
.hist-list::before { content: ''; position: absolute; left: 0; right: 0; top: 2.6rem; height: 2px; background: linear-gradient(90deg, transparent, rgba(200, 16, 46, 0.6) 6%, rgba(200, 16, 46, 0.6) 94%, transparent); }
.hist-item { position: relative; flex: none; width: min(290px, 78vw); scroll-snap-align: center; display: flex; flex-direction: column; }
.hist-year { font-family: var(--font-heading); font-size: 1.7rem; font-weight: 700; color: var(--accent-gold-light); line-height: 1; margin-bottom: 0.75rem; transition: color var(--transition-fast), transform var(--transition-fast); transform-origin: left bottom; }
.hist-dot { position: absolute; left: 0; top: 2.6rem; width: 14px; height: 14px; margin-top: -6px; border-radius: 50%; background: var(--bg-dark); border: 3px solid var(--accent-gold); transition: transform var(--transition-fast), background var(--transition-fast); }
.hist-card { margin-top: 1.1rem; flex: 1; display: flex; flex-direction: column; gap: 0.5rem; padding: 0.9rem; background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: var(--radius-md); transition: border-color var(--transition-smooth), transform var(--transition-smooth), box-shadow var(--transition-smooth); }
.hist-item.is-active .hist-year { color: var(--text-strong); transform: scale(1.12); }
/* длинные подписи («XII–V тыс. до н. э.», «1941–1945») мельче, но на той же высоте строки — точки ленты не «прыгают» */
.hist-year.is-long { font-size: 1.2rem; line-height: 1.4167; white-space: nowrap; }
.hist-item.is-active .hist-dot { background: var(--accent-primary); transform: scale(1.35); }
.hist-item.is-active .hist-card { border-color: var(--border-glow); transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.hist-img { display: block; border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 16 / 10; background: var(--surface); }
.hist-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.hist-img:hover img { transform: scale(1.06); }
.hist-title { font-family: var(--font-heading); font-size: 1.1rem; color: var(--text-strong); line-height: 1.25; }
.hist-text { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.55; }
.hist-card .link-sm { margin-left: 0; margin-top: auto; }
.hist-progress { height: 3px; background: rgba(var(--fg-rgb), 0.1); border-radius: 2px; overflow: hidden; }
.hist-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-red), var(--accent-primary-hover)); transform-origin: left; transform: scaleX(0.04); transition: transform 0.15s linear; }

/* символика */
.sym-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.2rem; }
.sym-panel { display: grid; grid-template-columns: minmax(200px, 340px) minmax(0, 1fr); gap: 2rem; align-items: start; padding: 1.4rem; background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: var(--radius-md); }
.sym-figure { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; }
.sym-stage { position: relative; display: inline-block; max-width: 100%; border-radius: var(--radius-sm); background: rgba(var(--fg-rgb), 0.04); padding: 0.6rem; }
.sym-img { display: block; max-width: 100%; max-height: 360px; width: auto; height: auto; border-radius: 6px; }
.sym-hot { position: absolute; padding: 0; margin: 0; background: transparent; border: 2px solid transparent; border-radius: 10px; cursor: pointer; transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast); }
.sym-frame { position: relative; display: inline-block; line-height: 0; }
.sym-hot.is-active { background: rgba(200, 16, 46, 0.22); border-color: var(--accent-gold); box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.2), 0 0 22px rgba(200, 16, 46, 0.45); }
.sym-hot:hover { border-color: rgba(200, 16, 46, 0.6); }
.sym-title { font-family: var(--font-heading); font-size: 1.6rem; color: var(--text-strong); }
.sym-adopted { font-size: 0.82rem; color: var(--accent-gold); margin: 0.2rem 0 0.8rem; }
.sym-parts-title { margin: 1.1rem 0 0.5rem; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); }
.sym-caption { margin-top: 0.9rem; min-height: 3.2rem; padding: 0.8rem 1rem; border-radius: var(--radius-sm); border-left: 3px solid rgba(var(--fg-rgb), 0.2); background: rgba(var(--fg-rgb), 0.04); color: var(--text-muted); font-size: 0.92rem; transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast); }
.sym-caption.is-shown { border-left-color: var(--accent-gold); background: rgba(200, 16, 46, 0.1); color: var(--text-main); }
.sym-caption strong { color: var(--accent-gold-light); }

/* районы */
.dist-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.2rem; align-items: stretch; }
.dist-layout.no-map { grid-template-columns: 1fr; }
.dist-map, .tr-map { min-height: 380px; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border-glass); background: var(--bg-hero); position: relative; z-index: 0; }
.dist-list { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; max-height: 460px; overflow-y: auto; scrollbar-width: thin; }
.dist-layout.no-map .dist-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); max-height: none; }
.dist-item { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 0.25rem; padding: 0.85rem 1rem; background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: var(--radius-md); color: var(--text-main); cursor: pointer; transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast); }
.dist-item:hover { transform: translateX(3px); border-color: rgba(var(--fg-rgb), 0.3); }
.dist-item.is-active { border-color: var(--accent-gold); background: rgba(200, 16, 46, 0.1); }
.dist-name { font-family: var(--font-heading); font-size: 1.05rem; color: var(--text-strong); }
.dist-text { font-size: 0.84rem; color: var(--text-secondary); line-height: 1.5; }

/* как добраться */
.tr-tabs { margin-bottom: 1.2rem; }
.tr-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.4rem; align-items: start; padding: 1.4rem; background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: var(--radius-md); }
.tr-layout.has-map { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.tr-title { font-family: var(--font-heading); font-size: 1.5rem; color: var(--text-strong); margin-bottom: 0.6rem; }
.tr-sub { margin: 1.2rem 0 0.5rem; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); }
.tr-prices { display: grid; gap: 0.35rem; }
.tr-prices > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0.75rem; background: rgba(var(--fg-rgb), 0.04); border-radius: var(--radius-sm); }
.tr-prices dt { color: var(--text-secondary); }
.tr-prices dd { color: var(--accent-gold-light); font-weight: 700; white-space: nowrap; }
.tr-points { list-style: none; display: grid; gap: 0.4rem; }
.tr-point { display: flex; align-items: center; gap: 0.7rem; width: 100%; text-align: left; padding: 0.5rem 0.7rem; background: rgba(var(--fg-rgb), 0.04); border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--text-strong); cursor: pointer; font-size: 0.9rem; }
.tr-point:hover { border-color: var(--border-glow); background: rgba(200, 16, 46, 0.08); }
.tr-popup a { color: var(--accent-gold-light); }
.leaflet-container .tr-popup a { color: var(--accent-gold-light); }

/* телефоны */
.ph-filter { display: block; max-width: 420px; margin-bottom: 1rem; }
.ph-groups { display: grid; gap: 1.4rem; }
.ph-group-title { font-family: var(--font-heading); font-size: 1.15rem; color: var(--text-strong); margin-bottom: 0.6rem; }
.ph-emergency .ph-group-title { color: #ff8a8a; }
.ph-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.7rem; }
.ph-item { padding: 0.85rem 1rem; background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: var(--radius-md); }
.ph-emergency .ph-item { border-color: rgba(255, 107, 107, 0.35); }
.ph-title { color: var(--text-secondary); font-size: 0.88rem; margin-bottom: 0.35rem; }
.ph-nums { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; }
.ph-num-wrap { display: inline-flex; align-items: center; gap: 0.35rem; }
.ph-num { color: var(--text-strong); font-family: var(--font-heading); font-size: 1.35rem; font-weight: 700; text-decoration: none; }
.ph-num:hover { color: var(--accent-gold-light); }
.ph-emergency .ph-num { color: #ff9a9a; }
.ph-copy { background: rgba(var(--fg-rgb), 0.08); border: 1px solid var(--border-glass); color: var(--text-secondary); border-radius: var(--radius-sm); width: 30px; height: 30px; cursor: pointer; font-size: 0.9rem; transition: background var(--transition-fast), color var(--transition-fast); }
.ph-copy:hover { background: rgba(var(--fg-rgb), 0.18); color: var(--text-strong); }
.ph-copy.is-done { background: #22c55e; color: #0e0c0e; border-color: #22c55e; }
.ph-addr { margin-top: 0.4rem; font-size: 0.82rem; color: var(--text-muted); }

/* культура / Марий Эл */
.city-rich { position: relative; max-width: 80ch; }
.city-rich.is-collapsed { max-height: 15rem; overflow: hidden; }
.city-rich.is-collapsed::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 5rem; background: linear-gradient(180deg, transparent, var(--bg-dark)); pointer-events: none; }
.city-more { margin-top: 0.6rem; font-size: 0.9rem; }

@media (max-width: 899px) {
  .sym-panel { grid-template-columns: minmax(0, 1fr); gap: 1.2rem; padding: 1rem; }
  .dist-layout { grid-template-columns: 1fr; }
  .dist-map, .tr-map { min-height: 300px; }
  .tr-layout.has-map { grid-template-columns: 1fr; }
  .city-nav { margin: 0 -1rem 1.2rem; padding: 0.55rem 1rem; }
  .dist-list { max-height: none; }
}

/* --- «О городе»: дополнения под реальные данные (интро с видео, группы фактов, «Знаете ли вы?», полный текст истории) --- */
.city-intro { display: block; }
.city-intro.has-video { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 2rem; align-items: start; max-width: none; }
.city-intro-text { min-width: 0; max-width: 78ch; }
.city-intro .city-rich { max-width: none; }
.city-intro .city-rich.is-collapsed { max-height: 13rem; }
.city-video { min-width: 0; }
.city-video .video-lite { width: 100%; }
.facts-groups { margin-bottom: 1rem; }
.facts-more { margin-top: 0.9rem; font-size: 0.92rem; }
.fact-card { min-width: 0; }
.fact-label { overflow-wrap: anywhere; }
.trivia { display: grid; gap: 1rem; }
.trivia-card { position: relative; padding: 1.6rem 1.6rem 1.6rem 2rem; background: linear-gradient(135deg, rgba(200, 16, 46, 0.12), rgba(200, 16, 46, 0.08)); border: 1px solid var(--border-glow); border-radius: var(--radius-md); min-height: 9rem; }
.trivia-card::before { content: '“'; position: absolute; left: 0.6rem; top: -0.2rem; font-family: var(--font-heading); font-size: 4.5rem; color: rgba(200, 16, 46, 0.35); line-height: 1; }
.trivia-card.is-swap { animation: yo-reveal 0.45s cubic-bezier(0.16, 1, 0.3, 1); }
.trivia-n { display: block; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-gold); margin-bottom: 0.5rem; }
.trivia-text { font-family: var(--font-heading); font-size: clamp(1.1rem, 2.4vw, 1.45rem); line-height: 1.45; color: var(--text-strong); }
.trivia-ctrl { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.trivia-count { margin-left: auto; font-size: 0.85rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.hist-full { margin-top: 1.2rem; border: 1px solid var(--border-glass); border-radius: var(--radius-md); background: var(--bg-card); }
.hist-full summary { cursor: pointer; padding: 0.85rem 1.1rem; color: var(--accent-gold-light); font-weight: 600; }
.hist-full .prose { padding: 0 1.1rem 1.1rem; max-width: 80ch; }
.sym-panel.no-figure { grid-template-columns: minmax(0, 1fr); }
.sym-panel .prose p { color: var(--text-secondary); }
@media (max-width: 899px) { .city-intro.has-video { grid-template-columns: 1fr; gap: 1.2rem; } }

.sym-panel > *, .tr-layout > *, .dist-layout > * { min-width: 0; }
.sym-parts { flex-wrap: wrap !important; overflow: visible !important; }
.sym-parts .chip { white-space: normal; text-align: left; }
.sym-panel .prose { overflow-wrap: anywhere; }
.tr-layout .prose { overflow-wrap: anywhere; }
.trs-panel { grid-template-columns: minmax(0, 1fr); }
.trs-group { min-width: 0; }
.trs-group .chip-row { flex-wrap: wrap !important; overflow: visible !important; min-width: 0; }
.trs-label { flex: 0 0 auto; }

/* ==========================================================================
   15. ТЕГИ (js/features/tags.js)
   ========================================================================== */
.is-tag-hidden { display: none !important; }
.tag-row { margin: 0.25rem 0 0.6rem; align-items: center; }
.tag-chip { font-size: 0.82rem; padding: 0.3rem 0.75rem; text-decoration: none; }
.tag-chip > span[aria-hidden] { opacity: 0.55; margin-right: 0.1rem; }
.tag-row .flt-empty { flex-basis: 100%; }
.tag-more { border-style: dashed; }
.entry-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1.1rem 0 0.4rem; }
.entry-tags .tag-chip { color: var(--text-secondary); }
@media (max-width: 480px) {
  .tag-row:not(:has(.tag-more[aria-expanded="true"])) { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 0.2rem; }
  .tag-row::-webkit-scrollbar { display: none; }
  .tag-row .chip { white-space: nowrap; flex: none; }
}
.notice-translation { display: flex; gap: 0.5rem; align-items: baseline; }

/* ==========================================================================
   16. ЧИСТКА И УПРОЩЕНИЕ: смещение над нижней панелью, фильтры раздела, карта списка, мини-таймер «12 апостолов»
   ========================================================================== */
/* Нижняя панель вкладок мобильной версии: ядро (layout.css) поднимает над ней .a11y-fab, .a11y-panel, тосты, «наверх» и карту
   через --tabbar-h (на body.has-tabbar, с учётом safe-area). Здесь — фиксированные элементы фич: сцена 3D-полёта (flyover.css)
   считает высоту экрана за вычетом --tabbar-h, а плашка маршрута и панель слоёв лежат внутри карты, которая заканчивается над панелью. */

/* Фильтры страницы раздела: чипы, «Сбросить», переключатель «Список / На карте» */
.flt-row { gap: 0.45rem; }
.flt-row.chip-row { flex-wrap: wrap; overflow: visible; } /* на телефоне ряд фильтров переносится, а не прокручивается: кнопка «Метки» и переключатель вида всегда на виду */
.flt-row .chip { flex: none; white-space: nowrap; }
.tag-toggle { border-style: dashed; }
.tag-toggle.is-active { border-style: solid; background: var(--accent-primary); color: #fff; border-color: var(--accent-primary); font-weight: 600; }
.flt-row .flt-reset { font-size: 0.85rem; padding: 0.4rem 0.5rem; }
.flt-view { display: inline-flex; margin-left: auto; padding: 2px; border: 1px solid var(--border-glass); border-radius: var(--radius-full); background: rgba(var(--fg-rgb), 0.04); }
.flt-view-btn {
  display: inline-flex; align-items: center; gap: 0.35rem; min-height: 36px; padding: 0.3rem 0.95rem;
  border: 0; border-radius: var(--radius-full); background: transparent; color: var(--text-secondary);
  font: inherit; font-size: 0.86rem; cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.flt-view-btn:hover { color: var(--text-strong); }
.flt-view-btn.is-active { background: var(--accent-primary); color: #fff; font-weight: 600; }
.flt-view-btn:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 2px; }
.catalog-map { margin: 0.5rem 0 1.5rem; }
.catalog-map-canvas {
  position: relative; z-index: 0; isolation: isolate; /* панели Leaflet не должны перекрывать шапку и вкладки */
  height: min(68vh, 560px); min-height: 340px;
  border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border-glass); background: var(--bg-hero);
}
.catalog-map-note { margin: 0.5rem 0 0; font-size: 0.8rem; color: var(--text-muted); }
@media (max-width: 560px) {
  .flt-view { margin-left: 0; width: 100%; }
  .flt-view-btn { flex: 1; justify-content: center; }
  .catalog-map-canvas { height: 62vh; min-height: 320px; }
}

/* Мини-таймер «До шествия 12 апостолов» (js/features/apostles-clock.js): карточка, hero главной */
.apostles-mini {
  display: flex; align-items: center; gap: 0.9rem; padding: 0.8rem 1.1rem;
  background: var(--bg-card); border: 1px solid var(--border-glow); border-radius: var(--radius-md);
}
.apostles-mini-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-red); animation: pulse-dot 1.8s infinite; }
.apostles-mini.is-live .apostles-mini-dot { background: #4ade80; }
.apostles-mini-text { display: flex; flex-direction: column; min-width: 0; }
.apostles-mini-label { font-size: 0.78rem; color: var(--text-muted); }
.apostles-mini-time { font-family: var(--font-heading); font-size: 1.5rem; line-height: 1.15; color: var(--accent-gold-light); font-variant-numeric: tabular-nums; }
.apostles-mini-btn { flex: none; margin-left: auto; padding: 0.5rem 1rem; font-size: 0.85rem; }
.apostles-mini--entry { margin: 1rem 0; }
.apostles-mini--hero {
  display: inline-flex; max-width: 100%; margin-top: 1rem; padding: 0.4rem 0.45rem 0.4rem 0.95rem; gap: 0.7rem;
  background: rgba(var(--bg-rgb), 0.58); border-color: rgba(var(--fg-rgb), 0.16); border-radius: var(--radius-full);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.apostles-mini--hero .apostles-mini-text { flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 0.1rem 0.55rem; }
.apostles-mini--hero .apostles-mini-label { color: rgba(var(--fg-rgb), 0.85); }
.apostles-mini--hero .apostles-mini-time { font-family: var(--font-body); font-size: 1.05rem; font-weight: 700; }
.apostles-mini--hero .apostles-mini-btn { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
@media (max-width: 480px) {
  .apostles-mini { gap: 0.6rem; padding: 0.7rem 0.8rem; }
  .apostles-mini-time { font-size: 1.25rem; }
  .apostles-mini--hero { border-radius: var(--radius-md); }
}

/* Избранное (js/features/favorites.js): маршруты через ваши места, «похожие места» после добавления в избранное */
.fav-routes-lead { margin: -0.4rem 0 1rem; }
.fav-routes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.85rem; }
.fav-routes-grid .preset-card + .preset-card { margin-top: 0; }
.fav-route-card .preset-card-name { font-size: 1rem; }
.fav-route-card .sub { font-size: 0.82rem; font-weight: 600; }
.fav-route-stops { margin: 0.2rem 0 0; padding-left: 1.3rem; font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5; }
.fav-route-card .preset-card-btns { margin-top: auto; padding-top: 0.5rem; }

.fav-suggest {
  position: fixed; z-index: 990; left: 1rem; bottom: 4.6rem; width: min(340px, calc(100vw - 2rem));
  padding: 0.8rem; background: rgba(var(--bg-rgb), 0.96); border: 1px solid var(--border-glass); border-radius: var(--radius-md);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  opacity: 0; transform: translateY(16px); transition: opacity 0.22s ease, transform 0.22s ease;
}
.fav-suggest.is-open { opacity: 1; transform: none; }
.fav-suggest-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.55rem; }
.fav-suggest-head strong { display: block; color: var(--text-strong); font-size: 0.95rem; }
.fav-suggest-kicker { display: block; font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 250px; }
.fav-suggest-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.fav-suggest-item { position: relative; }
.fav-suggest-item > a { display: flex; align-items: center; gap: 0.65rem; padding: 0.35rem 2.6rem 0.35rem 0.35rem; border-radius: var(--radius-sm); color: inherit; text-decoration: none; }
.fav-suggest-item > a:hover { background: rgba(var(--fg-rgb), 0.06); }
.fav-suggest-item img, .fav-suggest-noimg { flex: none; width: 52px; height: 52px; border-radius: var(--radius-sm); object-fit: cover; background: var(--surface-2, rgba(var(--fg-rgb), 0.08)); }
.fav-suggest-title { display: block; font-size: 0.88rem; color: var(--text-strong); line-height: 1.25; }
.fav-suggest-type { display: block; font-size: 0.74rem; color: var(--text-muted); }
.fav-suggest-item .fav-btn { top: 50%; right: 0.2rem; width: 32px; height: 32px; transform: translateY(-50%); }
@media (max-width: 767px) {
  body.has-tabbar .fav-suggest { bottom: calc(var(--tabbar-h) + 3.8rem); }
}
@media (max-width: 480px) {
  .fav-suggest { left: 0.6rem; right: 0.6rem; width: auto; }
}
