/* ================================================
   css/style.css — Основные стили приложения "Smart World Travel"
   ================================================ */

/* ---- Сплэш-экран при запуске ---- */
.splash-screen {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px;
  background: var(--bg);
  transition: opacity 0.4s ease;
}
.splash-screen--hide { opacity: 0; pointer-events: none; }
.splash-screen__logo {
  width: 96px; height: 96px; border-radius: 50%;
  animation: splash-pop 0.5s ease;
}
.splash-screen__name {
  font-size: 22px; font-weight: 800;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.splash-screen__tagline {
  font-size: 14px; color: var(--muted);
  text-align: center; padding: 0 24px;
}
@keyframes splash-pop {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
/* ================================================
   ================================================ */

/* ---------- ПЕРЕМЕННЫЕ ---------- */
:root {
  /* Цвета — тема "Тропический закат" */
  --bg:        #0d1117;       /* Фон страницы */
  --surface:   #161b22;       /* Фон панелей */
  --card-bg:   #1c2128;       /* Фон карточек */
  --border:    #30363d;       /* Границы */
  --accent:    #f97316;       /* Оранжевый — главный акцент */
  --accent2:   #fb923c;       /* Светло-оранжевый */
  --teal:      #2dd4bf;       /* Бирюзовый — второстепенный */
  --text:      #e6edf3;       /* Основной текст */
  --muted:     #7d8590;       /* Второстепенный текст */
  --success:   #3fb950;       /* Зелёный — успех */
  --error:     #f85149;       /* Красный — ошибка */
  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 20px;
  --shadow:    0 4px 24px rgba(0,0,0,0.4);

  /* Полноэкранный режим на разных телефонах: высота шапки + отступы под "чёлку"/статус-бар/home-индикатор */
  --header-row: 62px;             /* строка шапки: логотип, кнопки */
  --header-h:   62px;             /* вся шапка; на телефоне + полоса вкладок (см. АДАПТИВ) */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);
}

/* Светлая тема — по умолчанию (html[data-theme="light"]); тёмную можно выбрать кнопкой в профиле */
:root[data-theme="light"] {
  --bg:        #f3f4f6;
  --surface:   #ffffff;
  --card-bg:   #ffffff;
  --border:    #d0d7de;
  --text:      #1f2328;
  --muted:     #656d76;
  --success:   #1a7f37;
  --error:     #cf222e;
  --shadow:    0 4px 24px rgba(0,0,0,0.12);
}
:root[data-theme="light"] .header { background: rgba(255,255,255,0.92); }
:root[data-theme="light"] .feed { background: var(--bg); }
/* Поля вокруг видео (лента, просмотр из профиля, превью загрузки) — тоже белые */
:root[data-theme="light"] .reel,
:root[data-theme="light"] .profile-player,
:root[data-theme="light"] .profile-player__video,
:root[data-theme="light"] .upload-preview { background: #fff; }
:root[data-theme="light"] .profile-player__close { background: rgba(0,0,0,0.45); }
:root[data-theme="light"] .profile-player__close:hover { background: rgba(0,0,0,0.6); }
:root[data-theme="light"] .main .page-back:not(.page-back--floating) { background: rgba(255,255,255,0.9); box-shadow: 0 2px 10px rgba(0,0,0,0.12); }

/* ---------- СБРОС ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: hidden; width: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  overflow-x: hidden;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* В полях ввода выделение и копирование должны работать как обычно */
input, textarea, [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img, video { max-width: 100%; display: block; }

/* ---------- УТИЛИТЫ ---------- */
.hidden { display: none !important; }

/* ---------- ШАПКА ---------- */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: calc(var(--header-h) + var(--safe-top));
  padding-top: var(--safe-top);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  background: rgba(13,17,23,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  max-width: 1100px;
  margin: 0 auto;
  height: var(--header-row);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 32px;
}

/* Логотип */
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex-shrink: 0;
}
.logo__icon { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.logo__text {
  font-size: 22px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

/* Навигация */
.nav {
  display: flex;
  gap: 4px;
  flex: 1;
}
.nav__link {
  padding: 6px 16px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  transition: all .2s;
}
.nav__link:hover {
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
}
.nav__link--active,
.nav__link.active {
  color: var(--accent);
  background: rgba(249,115,22,0.12);
}
.nav__link { display: inline-flex; align-items: center; gap: 6px; }
.nav__icon { font-size: 15px; line-height: 1; }

/* Блок авторизации в шапке */
.header__auth {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 50px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
}
.user-chip__avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900; color: #fff;
  object-fit: cover;
}

/* ---------- ГЛОБУС + ТРИ ПОЛОСКИ РЯДОМ ---------- */
.header__icons {
  display: flex;
  align-items: center;
  gap: 0.5cm;
  flex-shrink: 0;
}

.lang-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.lang-btn:hover { background: var(--card-bg); }
.lang-dropdown {
  position: fixed;
  top: calc(var(--header-h) + var(--safe-top) + 8px);
  right: 60px;
  z-index: 1200;
  min-width: 150px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.lang-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  border: none;
  background: none;
  color: var(--text);
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.lang-dropdown-item:hover { background: var(--card-bg); }

.hamburger {
  display: flex;
  width: 34px; height: 34px;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ---------- БУРГЕР-МЕНЮ (bottom sheet) ---------- */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000; /* выше элементов управления Leaflet (у карты они на z-index ~1000) */
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.menu-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 100vh;
  max-height: 100dvh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  padding: 8px 0 calc(24px + var(--safe-bottom));
  animation: sheetUp .25s ease;
}
@keyframes sheetUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.menu-sheet__handle {
  width: 40px; height: 4px;
  background: var(--border);
  border-radius: 4px;
  margin: 8px auto 12px;
}
.menu-sheet__item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 24px;
  background: none;
  border: none;
  text-align: left;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.menu-sheet__item:hover { background: var(--card-bg); }
.menu-sheet__icon { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.menu-sheet__divider { height: 1px; background: var(--border); margin: 6px 0; }
.menu-sheet__item--premium { color: #f4b942; }
.menu-sheet__item--premium:hover { background: rgba(244,185,66,0.12); }
.menu-sheet__badge { font-size: 12px; margin-left: 2px; }
.menu-sheet__legal { display: flex; justify-content: center; gap: 6px; padding: 10px 14px 4px; font-size: 12px; color: var(--muted); }
.menu-sheet__legal a { color: var(--muted); text-decoration: none; }
.menu-sheet__legal a:hover { text-decoration: underline; }
.register-consent { font-size: 12px; color: var(--muted); text-align: center; margin: 4px 0 10px; }
.register-consent a { color: var(--accent); }

.cookie-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 500;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  max-width: 480px;
  margin: 0 auto;
}
.cookie-banner p { flex: 1; min-width: 200px; font-size: 13px; margin: 0; }
.cookie-banner a { color: var(--accent); }
.cookie-banner .btn { flex-shrink: 0; }
.cookie-banner__actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ---------- ПОДСКАЗКА «УСТАНОВИТЬ ПРИЛОЖЕНИЕ» ---------- */
.install-banner {
  position: fixed;
  left: 12px; right: 12px; bottom: 12px;
  z-index: 490;
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}
.install-banner__icon { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; }
.install-banner__text { flex: 1; min-width: 160px; display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.install-banner__text b { font-size: 14px; color: var(--text); }
.install-banner__actions { display: flex; gap: 8px; flex-shrink: 0; margin-left: auto; }

/* ---------- PREMIUM ---------- */
.premium-features {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.premium-features li {
  font-size: 14px;
  font-weight: 600;
  padding: 12px 14px;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
}
.premium-price {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 20px;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}
.premium-price__amount { font-size: 22px; font-weight: 900; color: #f4b942; }
.premium-price__note { font-size: 12px; color: var(--muted); }
.menu-sheet__user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 24px 14px;
  font-weight: 800;
  cursor: pointer;
}

/* Панель комментариев — тот же bottom sheet, но выше и со скроллом */
.menu-sheet--comments {
  max-height: 75vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}
.comments-sheet__header {
  text-align: center;
  font-weight: 800;
  font-size: 15px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.comments-sheet__list {
  overflow-y: auto;
  padding: 16px 24px;
  flex: 1;
}
.comments-sheet__form {
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

/* ---------- КНОПКИ ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all .2s;
  white-space: nowrap;
}
.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  box-shadow: 0 4px 14px rgba(249,115,22,0.3);
}
.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(249,115,22,0.4);
}
.btn--ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn--ghost:hover { color: var(--text); border-color: var(--accent); }
.btn--danger { background: var(--error); color: #fff; }
.btn--sm { padding: 5px 14px; font-size: 13px; }
.btn--wide { width: 100%; }
/* Кнопки-ссылки партнёров без логотипа: длинный текст переносится как обычный (а не вылезает за кнопку) */
a.btn--wide:not(:has(img)) { display: block; white-space: normal; text-align: center; line-height: 1.35; }
@media (max-width: 400px) {
  a.btn--large { padding-left: 12px; padding-right: 12px; font-size: 15px; }
}
.btn--large { padding: 12px 24px; font-size: 16px; }
.btn--brand {
  background: #fff;
  color: #333;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.btn--brand:hover { transform: translateY(-1px); }
.btn__brand-logo { height: 20px; width: auto; }
.btn__brand-logo-chip {
  display: inline-flex;
  align-items: center;
  background: #0a2540;
  padding: 5px 9px;
  border-radius: 6px;
}

/* ---------- ОСНОВНАЯ ОБЛАСТЬ ---------- */
.main {
  margin-top: calc(var(--header-h) + var(--safe-top));
  min-height: calc(100vh - var(--header-h) - var(--safe-top));
  min-height: calc(100dvh - var(--header-h) - var(--safe-top));
}

/* ---------- СТРАНИЦЫ ---------- */
.page { display: block; }
#pageFeed.page { display: flex; flex-direction: column; }

/* ---------- ВЫПАДАЮЩЕЕ МЕНЮ ЛОГОТИПА: ЛЕНТА + КАТЕГОРИИ ---------- */
.logo-dropdown {
  position: fixed;
  top: calc(var(--header-h) + var(--safe-top) + 8px);
  left: 20px;
  z-index: 101;
  min-width: 180px;
  max-height: calc(100vh - 90px);
  max-height: calc(100dvh - 90px);
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.logo-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  border: none;
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: all .15s;
}
.logo-dropdown-item:hover { background: var(--card-bg); color: var(--text); }
.logo-dropdown-item__icon { display: flex; width: 16px; height: 16px; flex-shrink: 0; }
.logo-dropdown-item--active { background: var(--accent); color: #fff; }
.logo-dropdown-divider { height: 1px; background: var(--border); margin: 6px 4px; }

/* ---------- ЛЕНТА: ПОЛНОЭКРАННЫЕ ВИДЕО (Reels-стиль) ---------- */
/* Лента прибита к экрану под шапкой (а не считается через 100vh/100dvh — в приложении
   высота экрана «плавает» из-за системных панелей, и видео при листании не доезжали до верха).
   Каждое видео = ровно высота ленты (.reel { height: 100% }), поэтому останавливается точно */
.feed {
  position: fixed;
  top: calc(var(--header-h) + var(--safe-top));
  left: 0; right: 0; bottom: 0;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  background: #000;
}

/* ---------- ЛОАДЕР ---------- */
.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 80px 0;
  color: var(--muted);
}
.spinner {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- ПУСТАЯ ЛЕНТА ---------- */
.empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}
.empty__icon { font-size: 60px; margin-bottom: 16px; }
.empty h2 { font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.empty p { margin-bottom: 24px; }

/* ---------- СТРАНИЦА ЗАГРУЗКИ ---------- */
.upload-page {
  max-width: 620px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}
.upload-page__header { margin-bottom: 32px; }
.upload-page__header--home { padding-top: 8px; }

/* Лента предложений — полноэкранные карточки (Reels-стиль), без заголовка страницы — как у видео */
/* Лента предложений — во всю ширину экрана, без боковых полей у карточек (2 карточки на экран) */
#pageDeals .upload-page { padding-left: 0; padding-right: 0; }
#pageDeals .upload-page__header--home { padding-left: 16px; padding-right: 16px; }
#pageDeals .deals-list { gap: 0; }
#pageDeals .deal-card { border-radius: 0; border-left: none; border-right: none; }

.page-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  margin-bottom: 16px;
}
.page-back:hover { border-color: var(--accent); color: var(--accent); }
/* Стрелка «назад» в приложении закреплена под шапкой и не уезжает при прокрутке;
   её место в потоке занимает отступ у следующего элемента.
   На отдельных страницах (privacy, terms, shop…) шапки нет — там стрелка остаётся на месте */
.main .page-back:not(.page-back--floating) {
  position: fixed;
  z-index: 90;
  top: calc(var(--header-h) + var(--safe-top) + 12px);
  left: max(calc(20px + var(--safe-left)), calc(50% - 290px));
  background: rgba(28,33,40,0.85);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
.main .page-back:not(.page-back--floating) + * { margin-top: 24px; }
/* Отдельные страницы (shop, privacy, terms, delete-account): шапки нет — стрелка закреплена у верха экрана */
body > .upload-page .page-back {
  position: fixed;
  z-index: 90;
  top: calc(var(--safe-top) + 12px);
  left: calc(12px + var(--safe-left));
  background: rgba(28,33,40,0.85);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
body > .upload-page .page-back + * { margin-top: 24px; }
:root[data-theme="light"] body > .upload-page .page-back { background: rgba(255,255,255,0.9); box-shadow: 0 2px 10px rgba(0,0,0,0.12); }

/* ---------- КАРТА ПУТЕШЕСТВЕННИКОВ ---------- */
.map-container {
  width: 100%;
  height: calc(100vh - var(--header-h) - var(--safe-top));
  height: calc(100dvh - var(--header-h) - var(--safe-top));
}
.page-back--floating {
  position: fixed;
  top: calc(var(--header-h) + var(--safe-top) + 16px);
  right: 16px;
  z-index: 1100;
  background: rgba(0,0,0,0.6);
  border-color: transparent;
  color: #fff;
}
.map-locate-btn {
  position: fixed;
  bottom: 50px;
  right: 16px;
  z-index: 1100;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border: none;
  color: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.map-filter-btn {
  position: fixed;
  top: calc(var(--header-h) + var(--safe-top) + 16px);
  left: 62px;
  z-index: 1100;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  border: none;
  color: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.map-filter-dropdown {
  position: fixed;
  top: 126px;
  left: 62px;
  z-index: 1100;
  min-width: 210px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.map-filter-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  border: none;
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: all .15s;
  width: 100%;
  text-align: left;
}
.map-filter-item:hover { background: var(--card-bg); color: var(--text); }

/* Кнопки категорий в форме новой метки — вместо выпадающего списка */
.marker-category-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.marker-category-btn {
  padding: 8px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.marker-category-btn:hover { background: var(--card-bg); }
.marker-category-btn--active { background: var(--accent); border-color: var(--accent); color: #fff; }
.map-filter-item--active { background: var(--accent); color: #fff; }
.map-filter-divider { height: 1px; background: var(--border); margin: 6px 4px; }
/* Приложение из Google Play без оплаты Google Play Billing: без цен и кнопок покупки (правила Google Play) */
.is-twa:not(.has-billing) .premium-price,
.is-twa:not(.has-billing) #premiumJoinArea:empty,
.is-twa:not(.has-billing) .region-pack-card__price,
.is-twa:not(.has-billing) .region-pack-card__features,
.is-twa:not(.has-billing) .region-pack-card__btn,
.is-twa:not(.has-billing) .region-packs-note,
.is-twa:not(.has-billing) #regionpacksHeader p { display: none !important; }
.is-twa .shop-link { display: none !important; }
.region-pack-card__owned { text-align: center; font-weight: 800; font-size: 14px; color: #3fb950; padding: 8px 0 2px; }

.upload-rules-note {
  margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; text-align: center;
  font-size: 13px; font-weight: 700; color: var(--muted);
  background: var(--card-bg); border: 1px solid var(--border);
}
.profile-danger__btn { color: #f87171; border-color: rgba(248,113,113,0.4); }
.btn--delete { background: #dc2626; color: #fff; border: none; }
.btn--delete:hover { background: #b91c1c; }
.map-marker-icon {
  width: 30px;
  height: 30px;
}
.map-pin-teardrop {
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 0;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  transform: rotate(-45deg);
  box-shadow: 0 3px 6px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}
.map-pin-teardrop--found { background: linear-gradient(135deg, #22c55e, #0ea5e9); }
.map-pin-teardrop--unesco { background: linear-gradient(135deg, #facc15, #f97316); }
.map-pin-teardrop span {
  transform: rotate(45deg);
  font-size: 14px;
  line-height: 1;
}
.map-marker-icon--avatar img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  box-shadow: 0 2px 4px rgba(0,0,0,0.6);
}
.map-download-btn {
  position: fixed;
  bottom: 104px;
  right: 16px;
  z-index: 1100;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.map-download-progress {
  position: fixed;
  bottom: 50px;
  left: 16px;
  right: 76px;
  z-index: 1100;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  text-align: center;
}
.map-user-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #4285F4;
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px rgba(66,133,244,0.35);
}

/* Тёмная тема для попапов Leaflet */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--card-bg);
  color: var(--text);
}
.leaflet-popup-content a { color: var(--accent); }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.map-popup-comments-btn {
  margin-top: 6px;
  padding: 5px 10px;
  border-radius: 20px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.map-popup-delete-btn {
  margin-top: 6px;
  margin-left: 6px;
  padding: 5px 10px;
  border-radius: 20px;
  border: none;
  background: var(--error);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- ПРОФИЛЬ ПОЛЬЗОВАТЕЛЯ ---------- */
.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  margin-bottom: 24px;
}
.profile-avatar-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  cursor: pointer;
}
.profile-avatar, .profile-avatar--fallback {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
}
.profile-avatar--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  font-size: 34px;
  font-weight: 900;
  color: #fff;
}
.profile-avatar-edit {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 3px solid var(--bg);
}
.profile-username { font-size: 18px; font-weight: 800; }

.profile-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.profile-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.profile-stat b { font-size: 18px; font-weight: 900; }
.profile-stat span { font-size: 12px; color: var(--muted); }
.profile-header__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* ---------- РЕЙТИНГ ПУТЕШЕСТВЕННИКОВ ---------- */
.rating-total { font-size: 13px; color: var(--muted); text-align: center; margin: 0 0 12px; }
.rating-list { display: flex; flex-direction: column; gap: 6px; }
.rating-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--card-bg);
}
.rating-row__place {
  width: 24px;
  flex-shrink: 0;
  text-align: center;
  font-weight: 900;
  color: var(--muted);
}
.rating-row--1 .rating-row__place { color: #ffd700; }
.rating-row--2 .rating-row__place { color: #c0c0c0; }
.rating-row--3 .rating-row__place { color: #cd7f32; }
.rating-row__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
}
.rating-row__info { flex: 1; min-width: 0; }
.rating-row__username { font-weight: 700; font-size: 14px; }
.rating-row__count { font-size: 13px; font-weight: 800; color: var(--accent); flex-shrink: 0; }
.rating-load-more { margin-top: 10px; }

/* ---------- РЕГИОНАЛЬНЫЕ ПАКЕТЫ ---------- */
.region-packs-perks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  background: rgba(244, 185, 66, 0.1);
  border: 1px solid rgba(244, 185, 66, 0.3);
}
.region-packs-perks p { font-size: 13px; font-weight: 700; margin: 0; }

.planner-result {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  border: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.6;
}
.planner-result strong { color: var(--accent); }

/* ---------- ЛЕНТА ПРЕДЛОЖЕНИЙ ПАРТНЁРОВ — компактные карточки (2 на экран) ---------- */
.deals-list { display: flex; flex-direction: column; gap: 14px; }
.deal-card {
  position: relative;
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  border: 1px solid var(--border);
  overflow: hidden;
}
.deal-card__link { color: inherit; text-decoration: none; }

/* Картинка — показываем целиком (Instagram-style), без обрезки; пустые поля
   заполняем размытой увеличенной копией того же фото */
.deal-card__media { position: relative; width: 100%; aspect-ratio: 16/9; overflow: hidden; background: var(--surface); }
.deal-card__img-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(20px) brightness(0.55);
  transform: scale(1.15);
}
.deal-card__img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.deal-card__body { padding: 12px 14px; }
.deal-card__title { display: inline-block; font-weight: 800; font-size: 15px; margin-bottom: 4px; text-decoration: underline; text-underline-offset: 2px; }
.deal-card__desc { font-size: 13px; color: var(--muted); line-height: 1.4; }

/* Столбик иконок поверх картинки — как reel__actions у видео */
.deal-card__actions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.deal-card__action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0;
  border: none;
  background: none;
  color: #fff;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.deal-card__action svg { filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); }
.deal-card__action span { filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); }
.deal-card__action-icon { font-size: 20px; line-height: 1; }
.deal-card__action span:last-child { font-size: 11px; font-weight: 700; }

.deep-link-highlight { outline: 3px solid var(--primary, #ff5a5f); outline-offset: -3px; transition: outline-color 1.8s ease; }
.reel.deep-link-highlight { outline-offset: 0; }
.region-packs-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.region-pack-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--card-bg);
}
.region-pack-card--world {
  border: 1px solid #f4b942;
  background: linear-gradient(135deg, rgba(244,185,66,0.1), var(--card-bg));
}
.region-pack-card__head { display: flex; align-items: center; gap: 12px; }
.region-pack-card__info { flex: 1; min-width: 0; }
.region-pack-card__name { font-weight: 800; font-size: 15px; }
.region-pack-card__count { font-size: 12px; color: var(--muted); margin-top: 2px; }
.region-pack-card__price { font-weight: 900; font-size: 16px; color: #f4b942; flex-shrink: 0; }
.region-pack-card__features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.region-pack-card__features li { font-size: 13px; color: var(--muted); }
.region-pack-card__btn { align-self: stretch; }
.region-pack-card__info--link { background: none; border: none; text-align: left; padding: 0; cursor: pointer; font-family: inherit; color: inherit; }
.region-pack-card__info--link:hover .region-pack-card__name { color: var(--accent); }

/* ---------- Список стран региона (с подсветкой, где уже есть видео) ---------- */
.region-countries-view { margin-bottom: 16px; }
.region-countries-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.region-countries-title { font-weight: 800; font-size: 17px; }
.region-countries-grid { display: flex; flex-direction: column; gap: 6px; }
.region-country {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  font-family: inherit; text-align: left; cursor: default;
}
.region-country--active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); cursor: pointer; }
.region-country--active:hover { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.region-country__flag { font-size: 18px; flex-shrink: 0; }
.region-country__name { flex: 1; font-size: 14px; font-weight: 600; }
.region-country__count { font-size: 12px; font-weight: 800; color: var(--muted); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.region-country--active .region-country__count { color: var(--accent); }
.region-packs-note { font-size: 12px; color: var(--muted); text-align: center; }

.profile-section-title { font-size: 16px; font-weight: 800; margin-bottom: 12px; }
.profile-videos { display: flex; flex-direction: column; gap: 2px; }
.profile-video-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  margin-bottom: 8px;
}
.profile-video-row__icon { font-size: 22px; flex-shrink: 0; }

/* Мои видео — сетка 2 в ряд, вертикальные превью как в Shorts */
.profile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; border-radius: var(--radius-sm); overflow: hidden; }
.profile-tile { position: relative; aspect-ratio: 9 / 16; background: var(--card-bg); cursor: pointer; overflow: hidden; }
.profile-tile video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; display: block; }
.profile-tile::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 40%;
  background: linear-gradient(transparent, rgba(0,0,0,0.75)); pointer-events: none;
}
.profile-tile__views {
  position: absolute; left: 8px; bottom: 6px; z-index: 1;
  color: #fff; font-size: 13px; font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
.profile-tile__flag { position: absolute; left: 6px; top: 5px; font-size: 16px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6)); }
.profile-tile__delete {
  position: absolute; right: 5px; top: 5px; z-index: 1;
  width: 28px; height: 28px; border-radius: 50%; border: none;
  background: rgba(0,0,0,0.5); color: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.profile-tile__delete:hover { background: var(--error); }

/* Просмотр своих видео из профиля: вертикальное листание, как Shorts */
.profile-player { position: fixed; inset: 0; z-index: 1900; background: #000; }
.profile-player__feed {
  height: 100%; overflow-y: auto;
  scroll-snap-type: y mandatory; overscroll-behavior: contain;
  scrollbar-width: none;
}
.profile-player__feed::-webkit-scrollbar { display: none; }
.profile-player__slide {
  position: relative; height: 100%;
  scroll-snap-align: start; scroll-snap-stop: always;
  display: flex; align-items: center; justify-content: center;
}
.profile-player__video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.profile-player__paused {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 56px; color: rgba(255,255,255,0.85); pointer-events: none;
}
.profile-player__caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 40px 16px calc(var(--safe-bottom) + 18px);
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.profile-player__title { font-weight: 800; font-size: 15px; }
.profile-player__desc {
  font-size: 13px; margin-top: 4px; opacity: 0.9;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.profile-player__close {
  position: absolute; z-index: 1; top: calc(var(--safe-top) + 14px); right: 14px;
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.15); color: #fff; font-size: 18px; cursor: pointer;
}
.profile-player__close:hover { background: rgba(255,255,255,0.28); }
.profile-video-row__info { min-width: 0; }
.profile-video-row__title {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-video-row__stats { font-size: 12px; color: var(--muted); margin-top: 2px; }
.profile-video-row__delete {
  margin-left: auto;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.profile-video-row__delete:hover { background: rgba(248,81,73,0.15); color: var(--error); }

/* ---------- ПРАВОВЫЕ СТРАНИЦЫ (privacy.html, terms.html) ---------- */
.legal { padding-bottom: 40px; }
.legal h2 {
  font-size: 17px;
  font-weight: 800;
  margin: 28px 0 10px;
}
.legal h2:first-child { margin-top: 0; }
.legal p { color: var(--muted); margin-bottom: 4px; }
.legal a { color: var(--accent); }
.upload-page__header h1 {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.5px;
}
.upload-page__header p { color: var(--muted); margin-top: 6px; }

.upload-box {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

/* Зона перетаскивания */
.upload-drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  margin: 24px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  position: relative;
}
.upload-drop:hover,
.upload-drop.dragover {
  border-color: var(--accent);
  background: rgba(249,115,22,0.05);
}
.upload-drop__icon { font-size: 48px; margin-bottom: 12px; }
.upload-drop__text { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.upload-drop__hint { font-size: 13px; color: var(--muted); }
.upload-drop__input {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer; width: 100%;
}

/* Разделитель "или" между выбором файла и записью с камеры */
.upload-alt {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 24px 20px;
}
.upload-alt__line { flex: 1; height: 1px; background: var(--border); }
.upload-alt__text { font-size: 12px; color: var(--muted); }

#recordBtn { margin: 0 24px 24px; width: calc(100% - 48px); }

/* Запись видео с камеры */
.record-preview-wrap {
  position: relative;
  margin: 24px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  aspect-ratio: 9 / 12;
  max-height: 480px;
}
.record-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}
.record-progress {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: rgba(255,255,255,0.2);
  z-index: 2;
}
.record-progress__fill {
  height: 100%;
  width: 0%;
  background: var(--error);
  transition: width 1s linear;
}
.record-indicator {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 5px 12px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
}
.record-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--error);
  animation: recordPulse 1s infinite;
}
@keyframes recordPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .3; }
}
.record-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.7);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 15px;
  cursor: pointer;
}
.record-controls {
  display: flex;
  justify-content: center;
  padding: 4px 0 18px;
}
.record-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.record-btn__inner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--error);
  transition: all .2s;
}
.record-btn--recording .record-btn__inner {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}
.social-hint {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
}

.record-hint {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  padding-bottom: 20px;
}

/* Превью выбранного видео */
.upload-preview {
  margin: 24px 24px 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  position: relative;
}
.upload-preview__video { width: 100%; max-height: 300px; object-fit: contain; }
.upload-preview__reset {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,0.7);
  border: none; color: #fff;
  padding: 4px 10px; border-radius: 50px;
  font-size: 13px; cursor: pointer;
  font-family: inherit;
}
.upload-preview__reset:hover { background: var(--error); }

/* Обрезка видео: два ползунка на одной дорожке */
.upload-trim { margin: 16px 24px 0; }
.upload-trim__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.upload-trim__head .form-label { margin-bottom: 0; }
.upload-trim__time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.upload-trim__time--bad { color: var(--error); }
.upload-trim__slider { position: relative; height: 36px; }
.upload-trim__track {
  position: absolute; left: 11px; right: 11px; top: 50%;
  height: 6px; margin-top: -3px; border-radius: 3px; background: var(--border);
}
.upload-trim__range { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--accent); }
.upload-trim__slider input[type=range] {
  position: absolute; left: 0; top: 0; width: 100%; height: 36px; margin: 0;
  background: none; pointer-events: none;
  -webkit-appearance: none; appearance: none;
}
.upload-trim__slider input[type=range]::-webkit-slider-runnable-track { height: 36px; background: transparent; }
.upload-trim__slider input[type=range]::-moz-range-track { height: 36px; background: transparent; }
.upload-trim__slider input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto;
  width: 22px; height: 22px; margin-top: 7px; border-radius: 50%;
  background: #fff; border: 3px solid var(--accent); cursor: grab;
}
.upload-trim__slider input[type=range]::-moz-range-thumb {
  pointer-events: auto; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 3px solid var(--accent); cursor: grab;
}
.upload-trim__hint { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Форма загрузки */
.upload-form { padding: 24px; }

/* ---------- ФОРМ-ЭЛЕМЕНТЫ ---------- */
.form-group { margin-bottom: 18px; position: relative; }
.form-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.form-label__icon { display: flex; flex-shrink: 0; }
.required { color: var(--error); }
.form-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--muted); }
.form-textarea { resize: vertical; min-height: 90px; }
.password-field { position: relative; }
.password-field .form-input { padding-right: 42px; }
.password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 8px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: .7;
}
.password-toggle:hover { opacity: 1; }
.form-counter {
  position: absolute; right: 0; top: 0;
  font-size: 12px; color: var(--muted);
}
.form-msg { margin: 12px 0; min-height: 20px; }
.msg-error   { color: var(--error);   font-size: 14px; font-weight: 600; }
.msg-success { color: var(--success); font-size: 14px; font-weight: 600; }

/* Прогресс-бар загрузки */
.upload-progress {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.progress-bar {
  flex: 1; height: 6px;
  background: var(--border);
  border-radius: 6px; overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--teal));
  border-radius: 6px;
  transition: width .3s;
}
.progress-label { font-size: 13px; font-weight: 700; color: var(--accent); min-width: 36px; }

/* ---------- ТОСТЫ ---------- */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: toastIn .3s ease;
  pointer-events: auto;
  max-width: 320px;
}
.toast--success { border-color: var(--success); color: var(--success); }
.toast--error   { border-color: var(--error);   color: var(--error);   }
.toast--info    { border-color: var(--accent);   color: var(--accent);  }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- ЧАТ ---------- */
.chat-rooms__list { display: flex; flex-direction: column; gap: 8px; }
.chat-rooms__label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 14px 4px 2px; }
.chat-room-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 14px 16px; border-radius: var(--radius);
  background: var(--card-bg); border: 1px solid var(--border);
  font-family: inherit; color: var(--text); cursor: pointer; text-align: left;
}
.chat-room-row:hover { border-color: var(--accent); }
.chat-room-row__title { font-weight: 800; font-size: 15px; }
.chat-room-row__meta { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.chat-rooms__pick { margin-top: 22px; }
.chat-rules { font-size: 13px; color: var(--muted); line-height: 1.5; margin-top: 4px; }
.chat-blocked-link {
  margin-top: 14px; background: none; border: none; padding: 0;
  font-family: inherit; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer;
}
.chat-blocked-link:hover { color: var(--accent); }
.chat-blocked-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; }

/* Комната: во весь экран под шапкой — сверху название, в середине сообщения, снизу поле ввода */
.chat-room {
  position: fixed;
  top: calc(var(--header-h) + var(--safe-top));
  left: 0; right: 0; bottom: 0;
  display: flex; justify-content: center;
  background: var(--bg);
}
.chat-room__inner { width: 100%; max-width: 720px; display: flex; flex-direction: column; min-height: 0; }
.chat-room__head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.chat-room__back {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--card-bg); color: var(--text); cursor: pointer;
}
.chat-room__title { flex: 1; min-width: 0; font-weight: 900; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Кнопка автоперевода в заголовке: включён — оранжевая обводка, выключен — бледная */
.chat-room__tr {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; cursor: pointer;
  border: 1px solid var(--border); background: var(--card-bg); font-size: 18px; line-height: 1;
  opacity: .45; filter: grayscale(1);
}
.chat-room__tr--on { opacity: 1; filter: none; border-color: var(--accent); background: rgba(249,115,22,0.12); }
.chat-msg__tr {
  display: block; margin-top: 3px; padding: 0; border: none; background: none; cursor: pointer;
  font-family: inherit; font-size: 11.5px; font-weight: 700; color: var(--muted); text-align: left;
}
.chat-msg__tr:hover { color: var(--accent); }
/* Под заголовком: слева столбик тем, справа сообщения + поле ввода */
.chat-room__body { flex: 1; min-height: 0; display: flex; }
.chat-room__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-topics {
  width: 56px; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 0 calc(8px + var(--safe-bottom));
  overflow-y: auto; scrollbar-width: none;
  background: var(--surface); border-right: 1px solid var(--border);
}
.chat-topics::-webkit-scrollbar { display: none; }
.chat-topic {
  position: relative; flex-shrink: 0;
  width: 44px; height: 44px; border-radius: 12px;
  border: none; background: transparent; cursor: pointer;
  font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.chat-topic:hover { background: var(--card-bg); }
.chat-topic--active { background: rgba(249,115,22,0.15); }
.chat-topic--active::before {
  content: ''; position: absolute; left: -6px; top: 10px; bottom: 10px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.chat-msg__topic { font-size: 11px; margin-right: 4px; }
.chat-room__messages {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 4px 8px; display: flex; flex-direction: column; gap: 3px;
}
.chat-room__hint { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 16px; }
.chat-room__hint--start { padding: 4px 16px 12px; font-size: 12px; }

/* Длинные сообщения — почти во всю ширину (отступ ~1 мм), короткие остаются компактными */
.chat-msg { display: flex; align-items: flex-end; gap: 6px; max-width: 100%; cursor: pointer; }
.chat-msg__bubble { min-width: 0; }
.chat-msg--head { margin-top: 8px; }
.chat-msg--mine { align-self: flex-end; flex-direction: row-reverse; }
/* Аватар — внутри карточки, внизу слева, в одной строке со временем */
.chat-msg__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.chat-msg__foot .chat-msg__time { margin-top: 0; margin-left: auto; }
.chat-msg__avatar {
  width: 22px; height: 22px; font-size: 11px !important; border-radius: 50%; flex-shrink: 0; object-fit: cover;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 900; font-size: 13px;
}
.chat-msg__avatar--space { visibility: hidden; }
.chat-msg__bubble {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 16px 16px 16px 4px; padding: 7px 12px 5px; min-width: 60px;
}
/* Свои сообщения — такие же, как у всех (белые / тёмные по теме), только справа */
.chat-msg--mine .chat-msg__bubble { border-radius: 16px 16px 4px 16px; }
.chat-msg__name { font-size: 12px; font-weight: 800; color: var(--accent); margin-bottom: 1px; }
.chat-msg__badge { font-size: 11px; }
.chat-msg__text { font-size: 15px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-msg__time { font-size: 10.5px; color: var(--muted); text-align: right; margin-top: 2px; }

.chat-room__composer {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 12px calc(10px + var(--safe-bottom));
  border-top: 1px solid var(--border); background: var(--surface);
}
.chat-room__input {
  flex: 1; resize: none; max-height: 120px;
  padding: 10px 14px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font-family: inherit; font-size: 15px; line-height: 1.35;
}
.chat-room__input:focus { outline: none; border-color: var(--accent); }
.chat-room__send {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; border: none; cursor: pointer;
  background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center;
}
.chat-room__send:disabled { opacity: .5; cursor: default; }
.chat-room__login { padding: 12px 16px calc(12px + var(--safe-bottom)); border-top: 1px solid var(--border); background: var(--surface); }
.chat-action--danger { color: var(--error); }

/* ---------- АДАПТИВ ---------- */
@media (max-width: 600px) {
  .logo__text { font-size: 18px; }
  .nav__link  { padding: 6px 10px; font-size: 13px; }

  /* На мобильном кнопки шапки прячем — Видео / Канал / Чат и вход есть в бургер-меню,
     так под видео остаётся больше экрана */
  .nav { display: none; }
  .header__auth { display: none; }
  .header__inner { justify-content: space-between; }
  .hamburger { display: flex; }
}
