/* ==========================================================================
   LAYOUT: страницы SPA (главная, разделы, карточки, блог…), мега-меню, мобильное меню, футер
   Владелец: frontend-core. Фичи подключаются после (components.css идёт последним и может переопределять).
   Брейкпоинты: 375 (мобильный), 768 (планшет), 1100 (появляется строка меню), 1280+ (десктоп).
   ========================================================================== */

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   ОБЛАСТЬ СТРАНИЦ
   ========================================================================== */
.page-view[hidden],
.site-footer[hidden] {
  display: none !important;
}

.page-view {
  min-height: 100vh;
  padding-top: var(--chrome-height);
  outline: none;
}

.page-view.view-enter {
  animation: view-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* View Transitions API: шапка остаётся на месте, контент плавно сменяется */
::view-transition-old(root) { animation: vt-out 0.18s ease both; }
::view-transition-new(root) { animation: vt-in 0.3s ease both; }
::view-transition-group(site-header) { animation-duration: 0s; }

@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

/* ==========================================================================
   ГЛАВНОЕ МЕНЮ + ВЫПАДАЮЩИЕ ПАНЕЛИ (десктоп ≥1280px) — в одной строке с логотипом
   ========================================================================== */
.main-nav {
  flex: 1 1 0; /* базис 0: меню занимает ровно остаток строки, поэтому fitNav() считает ширину стабильно */
  min-width: 0;
  align-self: stretch;
}

body.mode-map .main-nav {
  display: none;
}

.main-nav-list {
  list-style: none;
  display: flex;
  align-items: stretch;
  gap: 0.1rem;
  height: 100%;
  --nav-pad: 0.65rem;
}

.nav-item { position: relative; }

/* на 1280–1439px строка меню плотнее, чтобы все разделы помещались рядом с поиском */
@media (max-width: 1439px) {
  .main-nav-list { --nav-pad: 0.5rem; }
  .nav-link { font-size: 0.86rem; }
}

/* Что не влезло по ширине, fitNav() (js/core/layout.js) переносит в «Ещё ▾» */
.nav-item.is-overflow,
.nav-item[hidden] { display: none; }

.nav-more-btn {
  background: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

.nav-more { margin-left: auto; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  height: 100%;
  padding: 0 var(--nav-pad);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  transition: color var(--transition-fast);
}

.nav-link::after {
  content: '';
  position: absolute;
  left: var(--nav-pad);
  right: var(--nav-pad);
  bottom: 0;
  height: 2px;
  background: var(--accent-primary);
  transform: scaleX(0);
  transition: transform var(--transition-fast);
}

.nav-item:hover > .nav-link,
.nav-item.is-open > .nav-link,
.nav-item.is-current > .nav-link { color: var(--text-strong); }

.nav-item:hover > .nav-link::after,
.nav-item.is-open > .nav-link::after,
.nav-item.is-current > .nav-link::after { transform: scaleX(1); }

.caret {
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--transition-fast);
}

.nav-item.is-open .caret { transform: rotate(-135deg) translateY(-1px); }

/* Выпадающая панель: подразделы корня в 1–3 колонки, под колонкой пункта меню */
.mega {
  position: absolute;
  left: 0;
  top: 100%;
  width: max-content;
  max-width: min(720px, 92vw);
  background: rgba(var(--bg-rgb), 0.98);
  border: 1px solid var(--border-glass);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.6);
  max-height: calc(100vh - var(--chrome-height) - 24px);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
}

.nav-more .mega { left: auto; right: 0; }

.nav-item.is-open .mega {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.mega-inner {
  display: grid;
  grid-template-columns: repeat(var(--cols, 1), minmax(220px, 1fr));
  gap: 0.1rem 1.25rem;
  padding: 0.85rem 1rem 0.9rem;
}

.mega-link {
  display: block;
  padding: 0.42rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  color: var(--text-secondary);
  text-decoration: none;
}

.mega-link:hover, .mega-link:focus-visible { background: rgba(var(--fg-rgb), 0.07); color: var(--accent-gold-light); }

.mega-all {
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: 0.4rem;
  padding: 0.5rem 0.6rem 0;
  border-top: 1px solid rgba(var(--fg-rgb), 0.08);
  align-self: stretch;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--accent-gold);
  text-decoration: none;
}

.mega-all:hover { color: var(--accent-gold-light); }

/* ==========================================================================
   МОБИЛЬНОЕ ПОЛНОЭКРАННОЕ МЕНЮ
   ========================================================================== */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 700;
  background: var(--bg-dark);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
}

body.menu-open .mobile-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.mm-head {
  height: var(--header-height);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  border-bottom: 1px solid rgba(var(--fg-rgb), 0.08);
}

.mm-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem 3rem;
  -webkit-overflow-scrolling: touch;
}

.mm-modes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.mm-mode {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.8rem 0.4rem;
  background: rgba(var(--fg-rgb), 0.06);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-strong);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.mm-mode span { font-size: 1.3rem; }

.mm-search { margin-bottom: 1rem; }

.acc-root, .acc-sub, .mm-extra { list-style: none; }

.acc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(var(--fg-rgb), 0.07);
}

.acc-row a {
  flex: 1;
  padding: 0.85rem 0;
  color: var(--text-strong);
  text-decoration: none;
  font-size: 1.02rem;
  font-weight: 500;
}

.acc-item.depth-0 > .acc-row a { font-family: var(--font-heading); font-size: 1.2rem; }
.acc-item.depth-1 > .acc-row a { font-size: 0.98rem; color: var(--text-secondary); }
.acc-item.depth-2 > .acc-row a, .acc-item.depth-3 > .acc-row a { font-size: 0.92rem; color: var(--text-muted); }
.acc-item.acc-all > .acc-row a { font-size: 0.88rem; font-weight: 600; color: var(--accent-gold); }

.acc-toggle {
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  color: var(--accent-gold);
  font-size: 1.2rem;
  cursor: pointer;
}

.acc-sub { padding-left: 1rem; }
.acc-sub[hidden] { display: none; }

.mm-extra {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 1rem;
}

.mm-extra a {
  display: block;
  padding: 0.5rem 0;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.92rem;
}

.mm-lang { margin-top: 1.25rem; display: flex; justify-content: center; }
.mm-lang .lang-switch { display: flex; }

/* ==========================================================================
   ОБЩИЕ ЭЛЕМЕНТЫ СТРАНИЦ
   ========================================================================== */
.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.breadcrumbs li + li::before {
  content: '›';
  margin-right: 0.5rem;
  color: rgba(var(--fg-rgb), 0.3);
}

.breadcrumbs a { color: var(--text-secondary); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent-gold-light); text-decoration: underline; }
.breadcrumbs [aria-current] { color: var(--text-main); }

.page-head {
  padding: 2rem 0 1.25rem;
  background: radial-gradient(900px 260px at 15% 0%, rgba(200, 16, 46, 0.14), transparent 70%);
}

.page-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  line-height: 1.15;
  color: var(--text-strong);
  margin-top: 0.6rem;
}

.page-lead {
  max-width: 62ch;
  margin-top: 0.6rem;
  color: var(--text-secondary);
  font-size: 1.02rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--text-strong);
}

.section-link {
  color: var(--accent-gold);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.section-link:hover { color: var(--accent-gold-light); }

.home-section { padding-top: 3rem; padding-bottom: 0.5rem; }
.home-section:last-of-type { padding-bottom: 3rem; }

.entry-h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--text-strong);
  margin: 0 0 1rem;
}

.entry-h2.mt { margin-top: 2.5rem; }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.empty-icon { font-size: 2.5rem; opacity: 0.7; margin-bottom: 0.5rem; }
.empty-state .btn { margin-top: 1rem; }

.notice {
  background: rgba(var(--fg-rgb), 0.1);
  border: 1px solid rgba(var(--fg-rgb), 0.35);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  color: #d6f3fa;
}

.chip-mini {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-full);
  background: rgba(var(--fg-rgb), 0.1);
  color: var(--text-main);
  border: 1px solid rgba(var(--fg-rgb), 0.12);
}

.chip-gold { background: rgba(200, 16, 46, 0.18); color: var(--accent-gold-light); border-color: var(--border-glow); }
.chip-muted { background: transparent; color: var(--text-muted); }

.dot-sep { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.5; margin: 0 0.45rem; vertical-align: middle; }

.input, .select {
  width: 100%;
  background: rgba(var(--fg-rgb), 0.06);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-strong);
  font: inherit;
  font-size: 0.95rem;
  padding: 0.7rem 0.9rem;
}

.select { width: auto; padding: 0.5rem 0.8rem; font-size: 0.85rem; }
.select option { background: var(--surface); color: var(--text-strong); }
textarea.input { resize: vertical; min-height: 7rem; }
.input:focus, .select:focus { outline: none; border-color: var(--accent-gold); box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.2); }

/* ==========================================================================
   СКЕЛЕТОНЫ ЗАГРУЗКИ
   ========================================================================== */
.skel {
  background: linear-gradient(100deg, rgba(var(--fg-rgb), 0.05) 30%, rgba(var(--fg-rgb), 0.11) 50%, rgba(var(--fg-rgb), 0.05) 70%);
  background-size: 300% 100%;
  animation: skel-shimmer 1.4s linear infinite;
  border-radius: var(--radius-sm);
}

@keyframes skel-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.skel-hero { height: min(62vh, 520px); border-radius: 0; }
.skel-title { height: 2.4rem; width: min(420px, 70%); margin: 2rem 0 1.5rem; }
.skel-line { height: 0.9rem; margin: 0.7rem 0.9rem; }
.skel-line.short { width: 55%; }
.skel-img { height: 180px; border-radius: var(--radius-md) var(--radius-md) 0 0; }
.skel-card { background: var(--bg-card); border-radius: var(--radius-md); overflow: hidden; padding-bottom: 1rem; }
.page-skel { padding-top: 1rem; }
.initial-skeleton { min-height: 60vh; }

/* ==========================================================================
   ГЛАВНАЯ: HERO-СЛАЙДЕР
   ========================================================================== */
.hero {
  position: relative;
  min-height: min(78vh, 640px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #0e0c0e;
}

.hero-slides, .hero-slide, .hero-img, .hero-shade { position: absolute; inset: 0; }

.hero-slide { opacity: 0; transition: opacity 1s ease; }
.hero-slide.is-active { opacity: 1; }
.hero-fallback { background: radial-gradient(circle at 70% 20%, #3a1018, #0b0b0d 70%); }

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  transition: transform 8s ease-out;
}

.hero-slide.is-active .hero-img { transform: scale(1); }

.hero-shade {
  background:
    linear-gradient(90deg, rgba(11, 11, 13, 0.9) 0%, rgba(11, 11, 13, 0.55) 50%, rgba(11, 11, 13, 0.2) 100%),
    linear-gradient(180deg, rgba(11, 11, 13, 0.25) 0%, rgba(11, 11, 13, 0.2) 55%, rgba(11, 11, 13, 0.95) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding-top: 3.5rem;
  padding-bottom: 4.5rem;
}

.hero-kicker {
  color: var(--accent-gold);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  line-height: 1.08;
  color: #fff;
  margin: 0.5rem 0 0.9rem;
  max-width: 14em;
  text-shadow: 0 3px 20px rgba(0, 0, 0, 0.5);
}

.hero-lead { max-width: 52ch; color: var(--text-secondary); font-size: clamp(0.95rem, 2vw, 1.12rem); }

/* Крупное поле поиска hero: фокус/ввод открывает поиск (js/features/search.js), без него Enter ведёт на #/search */
.hero-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 640px;
  margin-top: 1.5rem;
  padding: 0.35rem 0.35rem 0.35rem 1.1rem;
  background: rgba(var(--bg-rgb), 0.84);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.hero-search:focus-within { border-color: var(--accent-gold); box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.22); }
.hero-search-ico { display: flex; flex-shrink: 0; color: var(--accent-gold); }
.hero-search-ico .ico { width: 22px; height: 22px; }

.hero-search-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  color: var(--text-strong);
  font: inherit;
  font-size: 1.05rem;
  padding: 0.7rem 0.25rem;
}

.hero-search-input::placeholder { color: var(--text-muted); }
.hero-search-input::-webkit-search-cancel-button { display: none; }
.hero-search-input:focus { outline: none; }
.hero-search-btn { flex-shrink: 0; padding: 0.7rem 1.5rem; }

/* Плитки-намерения: Посмотреть / Поесть / Переночевать / С детьми / На карте */
.intents {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.6rem;
  max-width: 640px;
  margin-top: 0.9rem;
}

.intent {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.65rem 0.3rem;
  background: rgba(var(--bg-rgb), 0.72);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-strong);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  text-decoration: none;
  transition: border-color var(--transition-fast), transform var(--transition-fast), color var(--transition-fast);
}

.intent:hover { border-color: var(--accent-gold); color: var(--accent-gold-light); transform: translateY(-2px); }
.intent-ico { display: flex; color: var(--accent-gold); }
.intent-ico .ico { width: 24px; height: 24px; }

.hero-timer { margin-top: 1rem; }
.hero-timer:empty { display: none; }

.hero-captions { position: relative; height: 2.2rem; margin-top: 1.25rem; }

.hero-caption {
  position: absolute;
  left: 0;
  top: 0;
  max-width: 100%;
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  background: rgba(var(--bg-rgb), 0.7);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(10px);
  color: var(--text-strong);
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.hero-caption.is-active { opacity: 1; pointer-events: auto; transform: none; }
.hero-caption-label { color: var(--accent-gold); font-weight: 700; margin-right: 0.35rem; }

.hero-controls {
  position: absolute;
  z-index: 3;
  right: 1.5rem;
  bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hero-arrow {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(var(--bg-rgb), 0.65);
  border: 1px solid var(--border-glass);
  color: var(--text-strong);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.hero-arrow:hover { border-color: var(--accent-gold); color: var(--accent-gold); }
.hero-dots { display: flex; gap: 0.45rem; }

.hero-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.hero-dot.is-active { background: var(--accent-primary); transform: scale(1.4); }

/* ==========================================================================
   КАРТОЧКИ И СЕТКИ
   ========================================================================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card-grid-wide { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }

.entry-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition-smooth), border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

.entry-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-lg);
}

.entry-card-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface);
}

.entry-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.entry-card:hover .entry-card-img { transform: scale(1.05); }

.img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
}

.img-failed { object-fit: cover; background: var(--surface); }

.entry-card-rank {
  position: absolute;
  left: 0.75rem;
  bottom: 0.5rem;
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}

.entry-card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.4rem;
  padding: 1rem 1.1rem 1.1rem;
}

.card-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.card-badges:empty { display: none; }

.entry-card-title { font-family: var(--font-heading); font-size: 1.15rem; line-height: 1.25; color: var(--text-strong); }
.entry-card-title a { color: inherit; text-decoration: none; }
.entry-card-title a::after { content: ''; position: absolute; inset: 0; } /* вся карточка кликабельна */

.entry-card-summary {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.entry-card-meta {
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.entry-card-addr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.card-price { color: var(--accent-gold-light); }

/* Слот 3D-полёта на главной (между ТОП-10 и остальным): пустой не занимает места */
.home-flyover { margin-top: 3rem; }
.home-flyover:empty { display: none; }

/* Горизонтальная лента ТОП-10 */
.rail-wrap { position: relative; }

.rail {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.5rem 0 1rem;
  scrollbar-width: none;
}

.rail::-webkit-scrollbar { display: none; }
.rail-card { flex: 0 0 min(300px, 78vw); scroll-snap-align: start; }

.rail-btn {
  position: absolute;
  top: 38%;
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(var(--bg-rgb), 0.9);
  border: 1px solid var(--border-glass);
  color: var(--text-strong);
  font-size: 1.5rem;
  cursor: pointer;
  display: none;
}

.rail-btn:hover { border-color: var(--accent-gold); color: var(--accent-gold); }
.rail-prev { left: -1.2rem; }
.rail-next { right: -1.2rem; }

@media (hover: hover) and (min-width: 1100px) { .rail-btn { display: block; } }

/* Плитки категорий «Открой Марий Эл» */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

.tile-grid-sm { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.85rem; padding-bottom: 0.5rem; }

.cat-tile {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  text-decoration: none;
  border: 1px solid var(--border-glass);
  background: var(--surface);
}

.tile-grid-sm .cat-tile { aspect-ratio: 16 / 10; }

.cat-tile-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.cat-tile:hover .cat-tile-img { transform: scale(1.07); }
.cat-tile-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 11, 13, 0.05) 30%, rgba(11, 11, 13, 0.88) 100%); }
.cat-tile-text { position: absolute; left: 1rem; right: 1rem; bottom: 0.9rem; display: flex; flex-direction: column; }
.cat-tile-title { font-family: var(--font-heading); font-size: 1.2rem; color: #fff; line-height: 1.2; overflow-wrap: anywhere; hyphens: auto; }
.tile-grid-sm .cat-tile-title { font-size: 1.02rem; }
.cat-tile-count { font-size: 0.78rem; color: var(--accent-gold-light); margin-top: 0.15rem; }

/* ==========================================================================
   РАЗДЕЛ КАТАЛОГА: ТУЛБАР, ЧИПЫ
   ========================================================================== */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin: 1rem 0 1.5rem;
}

.toolbar-slot:empty { display: none; }
.toolbar-slot { margin-bottom: 1rem; }
.toolbar-right { display: flex; align-items: center; gap: 0.9rem; margin-left: auto; }
.toolbar-count { font-size: 0.85rem; color: var(--text-muted); }

.chip-row { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.subnav { margin: 0.25rem 0 0; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  background: rgba(var(--fg-rgb), 0.06);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.chip:hover { color: var(--text-strong); border-color: rgba(var(--fg-rgb), 0.3); }
.chip.is-active { background: var(--accent-primary); color: #fff; border-color: var(--accent-primary); font-weight: 600; }
.chip-count { font-size: 0.72rem; opacity: 0.7; }
.more-wrap { display: flex; justify-content: center; margin: 2rem 0 1rem; }

/* ==========================================================================
   КАРТОЧКА ОБЪЕКТА
   ========================================================================== */
.entry-hero {
  position: relative;
  min-height: min(56vh, 480px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #0e0c0e;
}

.entry-hero.no-cover { min-height: 260px; background: radial-gradient(circle at 80% 0%, #3a1018, #0b0b0d 70%); }
.entry-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.entry-hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 11, 13, 0.35) 0%, rgba(11, 11, 13, 0.25) 40%, rgba(11, 11, 13, 0.96) 100%);
}

.entry-hero-inner { position: relative; z-index: 2; padding-top: 3rem; padding-bottom: 2rem; }
.entry-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.9rem 0 0.6rem; }

.entry-title {
  font-family: var(--font-heading);
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  line-height: 1.12;
  color: var(--text-strong);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55);
}

.entry-mari { color: var(--accent-gold); font-style: italic; margin-top: 0.3rem; }
.entry-lead { max-width: 62ch; color: var(--text-main); font-size: 1.05rem; margin-top: 0.7rem; }

.entry-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 2.5rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
  align-items: start;
}

.entry--page .entry-layout { grid-template-columns: minmax(0, 1fr); max-width: 860px; }
.entry--page .entry-aside:empty { display: none; }

.entry-aside {
  position: sticky;
  top: calc(var(--chrome-height) + 1rem);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Блок «главное» под заголовком: адрес, часы, телефон, «В маршрут», «Яндекс.Карты» */
.entry-quick {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.15rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
}

.eq-list { list-style: none; display: flex; flex-wrap: wrap; gap: 0.55rem 1.75rem; }
.eq-row { display: grid; grid-template-columns: 1.3rem minmax(0, 1fr); column-gap: 0.55rem; align-items: start; font-size: 0.95rem; color: var(--text-strong); min-width: 0; }
.eq-ico { display: flex; padding-top: 0.2rem; color: var(--accent-gold); }
.eq-ico .ico { width: 18px; height: 18px; }
.eq-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.eq-val { overflow-wrap: anywhere; }
.eq-val a { color: var(--accent-gold-light); font-weight: 600; text-decoration: none; }
.eq-val a:hover { text-decoration: underline; }
.eq-btns { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.eq-btns .btn { padding: 0.6rem 1.15rem; font-size: 0.88rem; }
.eq-btns .btn .ico { width: 16px; height: 16px; }

.entry-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.5rem; }
.entry-actions .btn { padding: 0.6rem 1.05rem; font-size: 0.86rem; }
.btn[aria-pressed="true"] { border-color: var(--accent-gold); color: var(--accent-gold-light); }

.prose { font-size: 1.04rem; line-height: 1.75; color: var(--text-secondary); max-width: 72ch; }
.prose > * + * { margin-top: 1.1em; }
.prose h2, .prose h3, .prose h4 { font-family: var(--font-heading); color: var(--text-strong); line-height: 1.25; margin-top: 1.8em; }
.prose h2 { font-size: 1.6rem; }
.prose h3 { font-size: 1.3rem; }
.prose h4 { font-size: 1.1rem; }
.prose a { color: var(--accent-gold-light); text-underline-offset: 3px; }
.prose a:hover { color: var(--text-strong); }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li + li { margin-top: 0.35em; }
.prose strong { color: var(--text-strong); }
.prose img { display: block; max-width: 100%; height: auto; border-radius: var(--radius-md); margin: 1.4rem 0; }
.prose blockquote {
  background: rgba(200, 16, 46, 0.1);
  border-left: 4px solid var(--accent-gold);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1rem 1.25rem;
  color: #f1f3f5;
}
.prose table { width: 100%; border-collapse: collapse; font-size: 0.92rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border-glass); padding: 0.5rem 0.75rem; text-align: left; }
.prose code { background: rgba(var(--fg-rgb), 0.1); padding: 0.1em 0.4em; border-radius: 4px; }
.prose hr { border: none; border-top: 1px solid var(--border-glass); }

.entry-section { margin-top: 2.5rem; }

.entry-credits { margin-top: 0.6rem; font-size: 0.8rem; color: var(--text-muted); }
.entry-credits a { color: inherit; text-decoration: underline; }
.entry-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.6rem; }
.gallery-item { display: block; aspect-ratio: 4 / 3; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.gallery-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.gallery-item:hover .gallery-img { transform: scale(1.06); }

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
}

.contact-title { font-family: var(--font-heading); font-size: 1.15rem; color: var(--text-strong); margin-bottom: 0.75rem; }
.contact-list { list-style: none; display: flex; flex-direction: column; gap: 0.7rem; }

.contact-list li {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  grid-template-areas: 'ico label' 'ico val';
  column-gap: 0.4rem;
  font-size: 0.9rem;
}

.contact-ico { grid-area: ico; }
.contact-label { grid-area: label; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.contact-val { grid-area: val; color: var(--text-strong); word-break: break-word; }
.contact-val a { color: var(--accent-gold-light); }
.link-sm { font-size: 0.8rem; margin-left: 0.4rem; color: var(--accent-gold); }
.hours-badge:not(:empty) { margin-left: 0.5rem; }

.entry-map:empty { display: none; }
.entry-map { border-radius: var(--radius-md); overflow: hidden; min-height: 220px; border: 1px solid var(--border-glass); }
.entry-related:empty { display: none; }

.prevnext {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  padding-top: 1rem;
  padding-bottom: 2.5rem;
}

.pn-link {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition-fast);
}

.pn-link:hover { border-color: var(--accent-gold); }
.pn-next { flex-direction: row-reverse; text-align: right; grid-column: 2; }
.pn-prev { grid-column: 1; }
.pn-img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0; }
.pn-text { display: flex; flex-direction: column; min-width: 0; }
.pn-dir { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-gold); }
.pn-title { font-family: var(--font-heading); color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Прогресс чтения блога */
.read-progress { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 150; pointer-events: none; }
.read-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-red), var(--accent-primary-hover)); transform-origin: left; transform: scaleX(0); }

/* ==========================================================================
   ВИДЕО, ТАЙМЛАЙН, ФОРМЫ, МАРШРУТ, 404
   ========================================================================== */
.video-wrap { max-width: 960px; }
.video-lite, .video-poster {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #0e0c0e;
  border: 1px solid var(--border-glass);
  text-decoration: none;
}

.video-lite iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-lite-poster { width: 100%; height: 100%; object-fit: cover; opacity: 0.75; }

.video-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: none;
  background: rgba(200, 16, 46, 0.92);
  color: #fff;
  font-size: 1.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 0 10px rgba(200, 16, 46, 0.25);
  transition: transform var(--transition-fast);
}

.video-lite:hover .video-play, .video-poster:hover .video-play { transform: translate(-50%, -50%) scale(1.08); }
.video-lite-title { position: absolute; left: 1rem; bottom: 0.8rem; color: #fff; font-weight: 600; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8); pointer-events: none; }
.video-link { display: inline-block; margin: 0.25rem 0; color: var(--accent-gold-light); }
.video-list { display: grid; gap: 1rem; }

.timeline { list-style: none; position: relative; padding-left: 0; display: flex; flex-direction: column; gap: 1.25rem; }
.tl-item { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 1.25rem; position: relative; }
.tl-item::before { content: ''; position: absolute; left: 42px; top: 70px; bottom: -1.25rem; width: 2px; background: rgba(var(--fg-rgb), 0.1); }
.tl-item:last-child::before { display: none; }
.tl-item.is-past { opacity: 0.6; }

.tl-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 84px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(200, 16, 46, 0.28), rgba(200, 16, 46, 0.18));
  border: 1px solid var(--border-glow);
  line-height: 1.1;
}

.tl-day { font-family: var(--font-heading); font-size: 1.8rem; font-weight: 700; color: var(--text-strong); }
.tl-month { font-size: 0.78rem; text-transform: uppercase; color: var(--accent-gold-light); }
.tl-year { font-size: 0.68rem; color: var(--text-muted); }
.tl-card { min-width: 0; }
.tl-entry { flex-direction: row; }
.tl-entry .entry-card-media { width: 220px; flex-shrink: 0; aspect-ratio: auto; }

.search-form { display: flex; gap: 0.6rem; margin-bottom: 1.5rem; max-width: 720px; }
.feedback-form { display: grid; gap: 1rem; max-width: 640px; margin-top: 1.5rem; }
.field { display: grid; gap: 0.35rem; font-size: 0.88rem; color: var(--text-secondary); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-status { min-height: 1.4em; font-size: 0.9rem; color: var(--text-secondary); }
.form-status.is-ok { color: var(--accent-emerald); }
.form-status.is-error { color: #ff6b6b; }

.route-list { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.5rem; max-width: 720px; }
.route-row { display: flex; align-items: center; gap: 0.85rem; padding: 0.6rem 0.8rem; background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: var(--radius-md); }
.route-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-thumb { width: 52px; height: 52px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }
.route-name { flex: 1; color: var(--text-strong); text-decoration: none; font-weight: 600; }

.slot-box { padding: 1.5rem; min-height: 120px; border: 1px dashed var(--border-glass); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; }
.slot-box:not(:empty) > a { margin: 0 auto; }

.not-found { padding-top: 4rem; padding-bottom: 5rem; text-align: left; }
.nf-code { font-family: var(--font-heading); font-size: clamp(4rem, 14vw, 8rem); line-height: 1; color: var(--accent-red); opacity: 0.85; }
.not-found .entry-actions { margin-top: 1.5rem; }

/* ==========================================================================
   ФУТЕР — КАРТА САЙТА, «НАВЕРХ»
   ========================================================================== */
.site-footer {
  margin-top: 3rem;
  background: var(--bg-deep);
  border-top: 1px solid rgba(var(--fg-rgb), 0.08);
  padding-top: 1.75rem;
}

/* components.css добавляет футеру нижний отступ 4.75rem; у компактного футера он не нужен (кнопки не перекрывают строку ©) */
#site-footer.site-footer { padding-bottom: 0; }

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1.3fr;
  gap: 2rem;
  padding-bottom: 1.25rem;
  align-items: start;
}

.footer-brand p { margin-top: 0.6rem; max-width: 34ch; font-size: 0.85rem; color: var(--text-muted); }
.footer-logo { display: flex; align-items: center; gap: 0.7rem; }
.footer-col h3 { font-family: var(--font-heading); font-size: 0.95rem; margin-bottom: 0.5rem; color: var(--text-strong); }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.3rem; }
.footer-project ul { display: grid; grid-template-columns: 1fr 1fr; gap: 0.3rem 1.25rem; }
.footer-col li a { font-size: 0.85rem; color: var(--text-muted); text-decoration: none; }
.footer-col li a:hover { color: var(--accent-gold-light); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: center; /* слева внизу стоит плавающая кнопка доступности, справа — «наверх»: строку © держим по центру */
  padding-top: 0.9rem;
  padding-bottom: 1rem;
  border-top: 1px solid rgba(var(--fg-rgb), 0.07);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-bottom a { color: var(--text-secondary); }
.footer-demo { color: var(--accent-gold); }

.to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 90;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border-glow);
  background: rgba(var(--bg-rgb), 0.9);
  color: var(--accent-gold);
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--transition-fast);
}

.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--accent-primary); color: var(--text-strong); }
body.mode-map .to-top { display: none; }

/* ==========================================================================
   АДАПТИВНОСТЬ
   ========================================================================== */
@media (max-width: 1100px) {
  .entry-layout { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .entry-aside { position: static; }
  .rail-prev { left: 0.25rem; }
  .rail-next { right: 0.25rem; }
}

@media (max-width: 768px) {
  .container { padding: 0 1rem; }
  .page-head { padding-top: 1.25rem; }
  .home-section { padding-top: 2.25rem; }
  .card-grid, .card-grid-wide { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .entry-card { flex-direction: row; }
  .entry-card .entry-card-media { width: 128px; flex-shrink: 0; aspect-ratio: auto; }
  .entry-card-summary { -webkit-line-clamp: 2; }
  .rail-card, .rail-card.entry-card { flex: 0 0 78vw; flex-direction: column; }
  .rail-card .entry-card-media { width: 100%; aspect-ratio: 16 / 10; }
  .tile-grid { grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
  .tile-grid-sm { grid-template-columns: repeat(2, 1fr); }
  .cat-tile-title { font-size: 1rem; }
  .toolbar { margin: 0.75rem 0 1rem; }
  .chip-row { min-width: 0; max-width: 100%; }
  .chip-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 0.25rem; }
  .chip-row::-webkit-scrollbar { display: none; }
  .chip { white-space: nowrap; }
  .hero { min-height: 72vh; }
  .hero-content { padding-bottom: 4.5rem; }
  .hero-controls { right: 1rem; bottom: 1rem; }
  .hero-arrow { display: none; }
  .tl-item { grid-template-columns: 64px minmax(0, 1fr); gap: 0.75rem; }
  .tl-item::before { left: 32px; top: 58px; }
  .tl-date { height: 64px; }
  .tl-day { font-size: 1.4rem; }
  .tl-entry .entry-card-media { width: 128px; }
  .prevnext { grid-template-columns: minmax(0, 1fr); }
  .pn-next, .pn-prev { grid-column: 1; }
  .footer-grid { grid-template-columns: 1fr; gap: 1rem; }
  .footer-col ul, .footer-project ul { display: flex; flex-direction: row; flex-wrap: wrap; gap: 0.35rem 1.1rem; }
  .footer-col h3 { margin-bottom: 0.35rem; }
  .footer-bottom { padding-bottom: 3.75rem; justify-content: flex-start; } /* запас под плавающие кнопки */
  .site-footer { margin-top: 2.25rem; padding-top: 1.25rem; }
  .search-form { flex-direction: column; }
  .video-play { width: 60px; height: 60px; }
  .entry-hero { min-height: 46vh; }
}

@media (max-width: 600px) {
  .hero-lead { display: none; }
  .hero-content { padding-top: 2.25rem; padding-bottom: 4rem; }
  .hero-search { margin-top: 1.1rem; }
  .hero-search-input { font-size: 1rem; }
  .hero-search-btn { padding: 0.65rem 1.1rem; }
  .intents { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .eq-list { flex-direction: column; }
  .eq-btns .btn { flex: 1 1 auto; }
}

@media (max-width: 420px) {
  .entry-card .entry-card-media { width: 108px; }
  .entry-actions .btn { flex: 1 1 auto; }
}

/* ==========================================================================
   НИЖНЯЯ ПАНЕЛЬ ВКЛАДОК (мобильная версия <768px): Главная · Каталог · Карта · Поиск · Маршрут
   Высота панели — переменная --tabbar-h (с учётом safe-area): body получает такой же padding-bottom,
   плавающие элементы (наверх, тосты, кнопка доступности) поднимаются над панелью.
   ========================================================================== */
.tabbar { display: none; }

@media (max-width: 767px) {
  body.has-tabbar {
    --tabbar-h: calc(58px + env(safe-area-inset-bottom, 0px));
    padding-bottom: var(--tabbar-h);
  }

  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 95;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    height: var(--tabbar-h);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(var(--bg-rgb), 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(var(--fg-rgb), 0.1);
  }

  .tab {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    padding: 0;
    background: none;
    border: 0;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .tab .ico { width: 22px; height: 22px; }
  .tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tab:hover, .tab:focus-visible { color: var(--text-strong); }
  .tab.is-active { color: var(--accent-gold); }
  .tab.is-active::before { content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 2px; border-radius: 0 0 2px 2px; background: var(--accent-primary); }

  .tab-badge {
    position: absolute;
    top: 6px;
    left: calc(50% + 6px);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--accent-red);
    color: #fff;
    font-size: 0.64rem;
    font-weight: 700;
  }

  .tab-badge[hidden] { display: none; }

  /* плавающие элементы — над панелью вкладок */
  .to-top { bottom: calc(var(--tabbar-h) + 0.75rem); }
  .toast-container { bottom: calc(var(--tabbar-h) + 0.75rem); }
  /* кнопка и панель доступности (css/components.css) стоят внизу слева — поднимаем над панелью */
  body.has-tabbar .a11y-fab { bottom: calc(var(--tabbar-h) + 0.6rem); }
  body.has-tabbar .a11y-panel { bottom: calc(var(--tabbar-h) + 3.8rem); }
  /* карта на весь экран заканчивается над панелью */
  body.mode-map.has-tabbar .map-view-container { bottom: var(--tabbar-h); }
}

/* ==========================================================================
   КАРТА: слот #map-root занимает весь оверлей #map-view (внутри — legacy-карта или фича map.js)
   ========================================================================== */
#map-root {
  position: absolute;
  inset: 0;
}

/* Верхняя панель старой карты должна быть над панелями Leaflet (у них z-index до 700) */
#map-root .map-top-bar { z-index: 1100; }
