/* Вертикальная лента трейлеров — мобильная вёрстка */
/* Палитра снята с kion.ru: чистый чёрный, монохромный интерфейс
   и фирменный градиент малиновый → пурпурный на акцентах. */
:root {
  --bg: #000;
  --surface: #1c1c1e;
  --surface-2: #252525;
  --fill: rgba(255, 255, 255, .1);
  --fill-strong: rgba(255, 255, 255, .15);
  --fg: #fafafa;
  --muted: rgba(250, 250, 250, .6);

  --accent: #e30045;        /* верх фирменного градиента KION */
  --accent-2: #8f0050;      /* середина */
  --accent-3: #400040;      /* низ, глубокий пурпур */
  --brand-gradient: linear-gradient(135deg, #ff0a4b 0%, #d10046 45%, #8f0050 100%);

  --glass: rgba(255, 255, 255, .12);
  --glass-strong: rgba(255, 255, 255, .2);
  --radius: 12px;
  --radius-pill: 18px;
  --bar-h: 56px;      /* шапка */
  --tabbar-h: 62px;   /* нижняя навигация */
  --ball-d: calc(var(--tabbar-h) * .66);  /* шар активной вкладки, доля снята с образца */
  --tabbar-gap: 10px;  /* панель плавающая — снизу под ней остаётся просвет */
  /* Насколько иконка активной вкладки опущена относительно центра шара. В образце она
     стоит ровно по центру, но там иконка занимает треть шара, а у нас — больше половины,
     и вплотную к верхнему краю она читается высоко. Небольшой сдвиг вниз это уравновешивает. */
  --tab-icon-drop: 3px;
  /* сколько места навигация занимает снизу: по этой мере отступает всё остальное,
     иначе содержимое подлезает под панель */
  --tabbar-space: calc(var(--tabbar-h) + var(--safe-b) + var(--tabbar-gap));
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* классы ниже задают display:flex — без этого атрибут hidden их не прячет */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overscroll-behavior: none;
}

body { display: flex; align-items: center; justify-content: center; overflow: hidden; }

button, input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* ------------------------------------------------------------ каркас */
.phone {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #050505;
}

@media (min-width: 760px) {
  body { background: radial-gradient(120% 100% at 50% 0%, var(--accent-3) 0%, #17000f 42%, #000 75%); }
  .phone {
    width: 420px;
    height: min(100dvh - 40px, 900px);
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .08);
  }
}

/* --------------------------------------------------------- верхняя панель */
.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 30;
  height: calc(var(--bar-h) + var(--safe-t));
  padding: var(--safe-t) 12px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .55), transparent);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }

.brand {
  display: flex;
  align-items: center;
  margin-top: calc(var(--safe-t) / 2);
}
.brand img {
  height: 17px;
  width: auto;
  display: block;
  filter: drop-shadow(0 1px 6px rgba(0, 0, 0, .55));
}
@media (max-width: 359px) { .brand img { height: 15px; } }


.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .35);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: pointer;
}
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; }


/* ------------------------------------------- нижняя навигация */
/* ------------------------------------------------------------------ нижняя навигация

   Плавающая «пилюля» с шаром: активная вкладка поднимается из полосы шариком,
   который переезжает между вкладками. Пропорции сняты с образца покадрово —
   диаметр шара 0.66 высоты полосы, центр шара на 0.10 высоты ниже её верхнего
   края, то есть наружу торчит примерно треть шара.

   Шар — отдельный элемент, а не фон кнопки: кнопки стоят на месте, ездит он один.
   Ширина шага задаётся долями (--tabs), поэтому число вкладок можно менять,
   ничего не пересчитывая. */
.tabbar {
  position: absolute;
  left: 12px; right: 12px;
  bottom: calc(var(--safe-b) + var(--tabbar-gap));
  z-index: 30;
  height: var(--tabbar-h);
  display: flex;
  border-radius: calc(var(--tabbar-h) * .38);
  background: rgba(22, 22, 24, .82);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
}

/* Светлый вариант — как в образце. Включается классом на той же полосе. */
.tabbar.is-light {
  background: rgba(255, 255, 255, .94);
  border-color: rgba(0, 0, 0, .06);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .28);
}
.tabbar.is-light .tabbar-btn { color: rgba(20, 20, 22, .55); }
.tabbar.is-light .tabbar-btn:not(.is-active):active { color: #141416; }

.tab-ball {
  position: absolute;
  top: calc(var(--ball-d) / -2 + var(--tabbar-h) * .10);
  left: 0;
  width: calc(100% / var(--tabs, 3));
  height: var(--ball-d);
  display: grid;
  place-items: center;
  pointer-events: none;
  /* Лёгкий перелёт за цель и возврат — так двигался шар в образце: основной
     ход около 0.16 с, потом столько же на «дозвон» с перелётом примерно на 7%. */
  transform: translateX(calc(var(--tab-i, 0) * 100%));
  transition: transform .32s cubic-bezier(.34, 1.36, .48, 1);
  /* Просим отдельный слой: иначе анимация считается в главном потоке, а при возврате
     в ленту он занят запуском видео — шар успевал «прыгнуть» на место целиком. */
  will-change: transform;
}
.tab-ball::before {
  content: "";
  width: var(--ball-d); height: var(--ball-d);
  border-radius: 50%;
  /* блик сверху слева поверх фирменного градиента — в образце шар объёмный,
     а не плоский кружок */
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .45), transparent 52%),
    var(--brand-gradient);
  box-shadow:
    0 6px 16px rgba(227, 0, 69, .5),
    0 2px 6px rgba(0, 0, 0, .35),
    inset 0 -3px 8px rgba(0, 0, 0, .22);
}
/* Свечение, растекающееся от шара внутрь полосы. */
.tab-ball::after {
  content: "";
  position: absolute;
  top: 55%; left: 50%;
  width: calc(var(--ball-d) * 2.1); height: calc(var(--ball-d) * 1.5);
  transform: translate(-50%, 0);
  /* Свечение — мягкий градиент без filter: размытие заставляло перерисовывать шар
     на каждом кадре и удерживало его анимацию в главном потоке. */
  background: radial-gradient(ellipse at center, rgba(227, 0, 69, .34), rgba(227, 0, 69, .12) 45%, transparent 70%);
  z-index: -1;
}

.tabbar-btn {
  flex: 1 1 0;                 /* равные доли — шаг шара считается от них же */
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  z-index: 1;
}
/* Подписи в этом варианте не показываются — они остаются для читалок экрана
   (у каждой кнопки есть aria-label, так что смысл не теряется). */
.tab-label {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.tabbar-btn svg {
  width: 24px; height: 24px;
  fill: currentColor;
  transition: transform .32s cubic-bezier(.34, 1.36, .48, 1),
              color .2s ease, opacity .16s ease;
}
/* Иконка активной вкладки поднимается внутрь шара. */
.tabbar-btn.is-active { color: #fff; }
.tabbar-btn.is-active svg {
  transform: translateY(calc(var(--tabbar-h) / -2 + var(--tabbar-h) * .10 + var(--tab-icon-drop)));
}
/* Пока шар в пути, иконки в нём нет: в образце она исчезает на время перелёта
   и проявляется уже на месте. */
.tabbar.is-moving .tabbar-btn.is-active svg {
  opacity: 0;
  transform: translateY(calc(var(--tabbar-h) / -2 + var(--tabbar-h) * .10 + var(--tab-icon-drop))) scale(.5);
}
.tabbar-btn:not(.is-active):active svg { transform: scale(.88); }

@media (prefers-reduced-motion: reduce) {
  .tab-ball, .tabbar-btn svg { transition-duration: .01ms; }
}

/* у профиля вместо иконки — аватар, если он загружен */
#profile-btn .avatar-img {
  display: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: center/cover no-repeat;
}
#profile-btn.has-avatar .avatar-img { display: block; }
#profile-btn.has-avatar .avatar-placeholder { display: none; }
#profile-btn.is-authed .avatar-img { box-shadow: 0 0 0 1.5px var(--accent); }

/* Звук переехал в колонку — первой иконкой над лайком */
.sound-rail .sound-ic { display: grid; place-items: center; }
.sound-rail .sound-ic svg { width: 26px; height: 26px; fill: #fff; }
.sound-rail .ic-sound { display: none; }
.sound-rail.is-on .ic-sound { display: block; }
.sound-rail.is-on .ic-muted { display: none; }
.sound-label { font-size: 10px; letter-spacing: -.02em; }

.profile-sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 42;
  height: 88%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 18px 18px 0 0;
  animation: slideUp .22s ease;
}
.profile-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 16px calc(var(--safe-b) + 20px);
}

.auth-tabs { display: flex; gap: 6px; background: var(--fill); border-radius: var(--radius); padding: 4px; margin-bottom: 16px; }
.auth-tab {
  flex: 1; padding: 9px; border: 0; border-radius: 9px;
  background: none; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer;
}
.auth-tab.is-active { background: var(--brand-gradient); color: #fff; }

.profile-form label, .upload-box label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.profile-form label small {
  display: block;
  font-size: 11.5px;
  color: rgba(250, 250, 250, .42);
  margin-top: 2px;
  line-height: 1.3;
}
.profile-form input, .profile-form textarea, .upload-box input, .upload-box textarea, .upload-box select {
  width: 100%;
  margin-top: 6px;
  padding: 12px 13px;
  border: 0;
  border-radius: var(--radius);
  background: var(--fill);
  color: var(--fg);
  font: inherit;
  outline: none;
}
.upload-box input, .upload-box textarea, .upload-box select { margin: 0 0 10px; }
.upload-box textarea, .profile-form textarea { resize: vertical; min-height: 76px; }
.profile-form .cta, .upload-box .cta { margin-top: 4px; }
.profile-hint { font-size: 13px; color: var(--muted); line-height: 1.4; margin: 14px 0 0; }

.profile-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.profile-avatar { position: relative; cursor: pointer; text-align: center; }
.profile-avatar-img {
  display: grid; place-items: center;
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--fill) center/cover no-repeat;
  font-size: 26px; font-weight: 700;
}
.profile-avatar-edit { display: block; font-size: 11px; color: var(--accent); margin-top: 4px; }
.profile-id b { display: block; font-size: 18px; }
.profile-id .dim { font-size: 13px; color: var(--muted); }
.profile-id .level { margin-top: 6px; font-size: 13px; font-weight: 600; }

.level-bar { height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.level-bar i { display: block; height: 100%; background: var(--brand-gradient); }
.level-hint { font-size: 12px; color: var(--muted); margin: 6px 0 16px; }

.profile-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.profile-stats div { background: var(--fill); border-radius: var(--radius); padding: 10px 6px; text-align: center; }
.profile-stats b { display: block; font-size: 17px; }
.profile-stats span { font-size: 11px; color: var(--muted); }

.upload-box {
  background: rgba(255, 255, 255, .05);
  border: 1px dashed rgba(255, 255, 255, .18);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 20px;
}
.upload-pick { display: block; margin-bottom: 10px; }
.upload-pick span {
  display: block;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--fill);
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-sub { margin: 4px 0 10px; font-size: 15px; }
.my-videos { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.my-video { display: flex; align-items: center; gap: 10px; background: var(--fill); border-radius: var(--radius); padding: 8px; }
.my-poster { flex: 0 0 auto; width: 44px; height: 62px; border-radius: 8px; background: #000 center/cover no-repeat; }
.my-info { flex: 1; min-width: 0; }
.my-info b { display: block; font-size: 14px; margin-bottom: 4px; }
.my-note { font-size: 12px; color: #ffbdc9; margin-top: 4px; }
.my-meta { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.my-open {
  flex: 0 0 auto; width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  color: var(--fg); text-decoration: none; cursor: pointer;
}
.v-status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.v-status.wait { background: rgba(255, 214, 10, .18); color: #ffd60a; }
.v-status.ok { background: rgba(48, 209, 88, .18); color: #30d158; }
.v-status.bad { background: rgba(227, 0, 69, .2); color: #ff8aa5; }

#logout-btn { max-width: none; }

/* ------------------------------------------------------------- лента */
.feed {
  height: 100%;
  overflow-y: auto;
  /* pan-y — вертикальный скролл остаётся за браузером, горизонтальные жесты наши */
  touch-action: pan-y;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  outline: none;
}
.feed::-webkit-scrollbar { display: none; }
.feed { scrollbar-width: none; }

.slide {
  position: relative;
  height: 100%;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  background: #000;
  display: block;
}

.slide-bg {
  position: absolute; top: -10%; right: -10%; bottom: -10%; left: -10%;
  background-size: cover;
  background-position: center;
  filter: blur(38px) saturate(1.3) brightness(.55);
  transform: scale(1.15);
}

.slide video, .slide .ad-media {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  background: transparent;
}

/* Удержание для паузы и 2× — наш жест, а не «сохранить видео».
   Без этого iOS на долгом нажатии показывает своё меню поверх ленты и подсвечивает
   ролик, а Android предлагает скачать. Гасим на самом видео: прозрачный слой сверху
   меню не отменяет — Safari смотрит на элемент под пальцем. */
.slide, .slide video, .slide .ad-media, .slide-bg, .slide .poster-mini {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}
.slide.is-cover video, .slide.is-cover .ad-media { object-fit: cover; }

.shade-top {
  position: absolute; top: 0; left: 0; right: 0; height: 160px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .5), transparent);
  pointer-events: none;
}
.shade-bottom {
  position: absolute; bottom: 0; left: 0; right: 0; height: 62%;
  background: linear-gradient(to top, rgba(0, 0, 0, .92) 12%, rgba(0, 0, 0, .55) 45%, transparent);
  pointer-events: none;
}

.tap-layer {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 5;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* Удержание в правой половине — 2× */
.speed-badge {
  position: absolute;
  top: calc(var(--safe-t) + var(--bar-h) + 12px);
  left: 50%;
  z-index: 22;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, .62);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -8px);
  transition: opacity .16s ease, transform .16s ease;
}
.speed-badge svg { width: 17px; height: 17px; fill: #fff; }
.slide.is-boosted .speed-badge { opacity: 1; transform: translate(-50%, 0); }
.slide.is-boosted .progress i { background: var(--brand-gradient); }

.progress {
  position: absolute;
  top: calc(var(--safe-t) + var(--bar-h) - 4px);
  left: 12px; right: 12px;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .2);
  z-index: 20;
  overflow: hidden;
}
.progress i { display: block; height: 100%; width: 0; background: #fff; border-radius: 3px; }

.play-badge {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 8;
  display: grid; place-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s;
}
.play-badge.show { opacity: 1; }
.play-badge svg { width: 76px; height: 76px; fill: rgba(255, 255, 255, .9); filter: drop-shadow(0 4px 16px rgba(0, 0, 0, .6)); }

/* --------------------------------------------------------- правая колонка */
/* Колонка опущена почти к полосе категорий — чтобы всё доставалось большим пальцем,
   а «Смотреть» оказалась в самой удобной точке экрана. */
.rail {
  position: absolute;
  right: 8px;
  bottom: calc(var(--tabbar-space) + 10px);
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}
.rail-btn {
  width: 58px;
  background: none; border: 0; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .7));
}
.rail-btn svg { width: 32px; height: 32px; fill: #fff; transition: transform .18s; }
.rail-btn span {
  max-width: 58px;
  font-size: 11px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rail-btn.share-btn span { font-size: 10px; letter-spacing: -.02em; }

/* Кнопка перехода — четвёртой в колонке, фирменным цветом */
.rail-btn.watch-btn { text-decoration: none; }
.rail-btn.watch-btn .watch-ic {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--brand-gradient);
  box-shadow: 0 6px 18px rgba(227, 0, 69, .45);
}
.rail-btn.watch-btn .watch-ic svg { width: 24px; height: 24px; margin-left: 2px; }
.rail-btn.watch-btn > span:last-child {
  font-size: 10.5px;
  font-weight: 700;
  max-width: 62px;
}
.rail-btn.watch-btn:active .watch-ic { transform: scale(.92); }
.rail-btn:active svg { transform: scale(.85); }
.rail-btn.liked svg { fill: var(--accent); animation: pop .3s ease; }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* --------------------------------------------------------------- низ слайда */
.bottom {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(var(--tabbar-space) + 8px);
  z-index: 14;
  padding: 0 14px;
}
/* Текст сужаем, чтобы не заезжал под правую колонку */
.bottom .desc-box, .bottom h2 { padding-right: 62px; }
/* колонка теперь длиннее, поэтому раскрытое описание ограничиваем чуть строже */
.desc-box.open .desc { max-height: 30vh; }
.slide.ad .bottom .desc-box, .slide.ad .bottom h2 { padding-right: 0; }
.slide.ad h2 {
  margin: 0 0 4px;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 700;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .8);
}
/* Автор ролика над описанием */
.slide-author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  text-decoration: none;
  color: #fff;
}
.slide-author .author-pic {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  background-size: cover;
  background-position: center;
  font-size: 13px; font-weight: 700;
  border: 1.5px solid rgba(255, 255, 255, .5);
}
.slide-author b { font-size: 14px; font-weight: 700; text-shadow: 0 1px 8px rgba(0, 0, 0, .8); }
.slide-author:active { opacity: .7; }
.slide-author.is-site { cursor: default; }
.author-pic.site { background: rgba(0, 0, 0, .45); border-color: rgba(255, 255, 255, .3); }
.author-pic.site img { width: 20px; height: 20px; object-fit: contain; }

/* Описание: две строки + «ещё». Раскрывается по тапу, видео не прерывается. */
.desc-box { margin: 0 0 4px; cursor: pointer; }
.tag-link { color: #8fc7ff; font-weight: 600; }
/* Обрезаем по высоте, а не через -webkit-box: тот делает ссылки-хэштеги
   flex-элементами и съедает пробелы между ними. */
.desc {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.38;
  color: rgba(255, 255, 255, .82);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .7);
  max-height: 2.76em;   /* ровно две строки */
  overflow: hidden;
}
.desc-box.open .desc {
  max-height: 34vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
}
.desc-box.open .desc::-webkit-scrollbar { width: 3px; }
.desc-box.open .desc::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .25); border-radius: 3px; }
.desc-toggle {
  margin-top: 3px;
  padding: 2px 0;
  border: 0;
  background: none;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  opacity: .8;
  cursor: pointer;
}

.ad-sub {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.35;
  color: rgba(255, 255, 255, .85);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .7);
}

.cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  padding: 14px 16px;
  border: 0; border-radius: var(--radius);
  background: var(--brand-gradient);
  color: #fff;
  font-size: 16px; font-weight: 700;
  letter-spacing: .01em;
  text-decoration: none;
  box-shadow: 0 8px 26px rgba(227, 0, 69, .38);
  cursor: pointer;
}
.cta:active { transform: scale(.98); }
.cta svg { width: 18px; height: 18px; fill: #fff; }

/* --------------------------------------------------------------- эндкард */
.endcard {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  z-index: 25;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px 24px calc(var(--tabbar-space) + 24px);
  background:
    radial-gradient(120% 70% at 50% 108%, rgba(227, 0, 69, .28) 0%, rgba(64, 0, 64, .3) 45%, transparent 75%),
    rgba(0, 0, 0, .82);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  text-align: center;
  animation: fade .25s ease;
}
.endcard.show { display: flex; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.endcard .poster-mini {
  width: 124px; height: 176px;
  border-radius: 16px;
  background: #17171c center/cover no-repeat;
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .7);
  display: grid; place-items: center;
  font-size: 40px;
}
.endcard h3 { margin: 4px 0 0; font-size: 22px; }
.endcard p { margin: 0; color: var(--muted); font-size: 14px; }
.endcard .cta { max-width: 320px; padding: 16px; font-size: 17px; }
.btn-ghost {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; max-width: 320px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 0;
  background: var(--fill);
  color: var(--fg);
  font-weight: 600;
  cursor: pointer;
}
.btn-ghost:active { background: var(--fill-strong); }
.btn-ghost svg { width: 18px; height: 18px; fill: currentColor; }
.endcard .next-hint { font-size: 12.5px; color: rgba(255, 255, 255, .45); margin-top: 6px; }

/* ------------------------------------------------------------- реклама */
.ad-label {
  position: absolute;
  top: calc(var(--safe-t) + var(--bar-h) + 6px);
  left: 12px;
  z-index: 20;
  font-size: 11px; font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .85);
  background: rgba(0, 0, 0, .45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  padding: 4px 9px;
  border-radius: 6px;
}
.slide.ad .cta { background: #fff; color: #101010; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
.slide.ad .cta svg { fill: #101010; }

/* «Поиск»: контейнер прокрутки — сверху категории, под ними плитки */
.grid-view {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 12;
  overflow-y: auto;
  touch-action: pan-y;
  overscroll-behavior: contain;
  background: #050505;
  padding-top: calc(var(--safe-t) + var(--bar-h));
  padding-bottom: calc(var(--tabbar-space) + 8px);
  scrollbar-width: none;
}
.tiles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 2px;
}
.grid-view::-webkit-scrollbar { display: none; }

/* height:0 + padding-bottom вместо aspect-ratio: строки грида иначе схлопываются */
.tile {
  position: relative;
  display: block;
  width: 100%;
  height: 0;
  padding: 0 0 177.8%;
  border: 0;
  overflow: hidden;
  background: #111116;
  cursor: pointer;
}
.tile img {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  /* иначе Chrome начинает нативное перетаскивание картинки и съедает свайп */
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}
.tile-fallback { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-items: center; font-size: 26px; opacity: .6; }
.tile::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 55%;
  background: linear-gradient(to top, rgba(0, 0, 0, .8), transparent);
  pointer-events: none;
}
.tile-play {
  position: absolute; top: 6px; right: 6px;
  width: 15px; height: 15px;
  fill: rgba(255, 255, 255, .9);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .8));
}
.tile-title {
  position: absolute;
  left: 6px; right: 6px; bottom: 6px;
  z-index: 2;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.22;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .9);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tile:active { opacity: .75; }

@keyframes viewInRight { from { opacity: .2; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes viewInLeft { from { opacity: .2; transform: translateX(-22px); } to { opacity: 1; transform: none; } }
.view-enter-right { animation: viewInRight .2s ease; }
.view-enter-left { animation: viewInLeft .2s ease; }

.grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 2;
  padding: 60px 20px;
}

/* --------------------------------------------------------- категории */
/* Живут в разделе «Поиск» прямо над плитками и прилипают к верху при прокрутке. */
.genres {
  position: sticky;
  top: 0;
  z-index: 14;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(0, 0, 0, .92);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.genres::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  border: 0;
  background: var(--fill);
  color: var(--muted);
  padding: 8px 15px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.chip:active { background: var(--fill-strong); }
.chip.is-active {
  background: var(--brand-gradient);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(227, 0, 69, .35);
}

/* ----------------------------------------------------------- комментарии */
.sheet-backdrop { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 40; background: rgba(0, 0, 0, .5); }
.sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 41;
  height: 68%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 18px 18px 0 0;
  animation: slideUp .22s ease;
  padding-bottom: var(--safe-b);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* На странице автора .phone тянется по содержимому, а лист лежит вне неё — поэтому
   «низ» и «88% высоты» он считал от всей длинной страницы и на широком экране
   растекался на все 1500 пикселей, тогда как сама страница идёт колонкой в 420.
   Привязываем его к окну и повторяем ширину колонки. Центрируем отступами, а не
   сдвигом: transform занят анимацией выезда. */
body.author-page .profile-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  margin-inline: auto;
  height: min(88dvh, 780px);
}
@media (min-width: 760px) {
  body.author-page .profile-sheet { max-width: 420px; }
}

/* Строки «Логин / Почта / С нами с» и кнопки внизу — в одну меру с формой,
   иначе значение улетает к дальнему краю. */
body.author-page .profile-body > * { max-width: 100%; }
.settings-actions { display: grid; gap: 10px; margin-top: 4px; }
.settings-actions .btn-ghost { max-width: none; }
.sheet-head {
  position: relative;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  text-align: center;
}
.sheet-grip {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  width: 36px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .25);
}
.sheet-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.sheet-close { position: absolute; right: 10px; top: 10px; background: var(--fill); }
.sheet-body { flex: 1; overflow-y: auto; padding: 10px 16px 4px; }

.comment { display: flex; gap: 10px; padding: 10px 0; }
.avatar {
  flex: 0 0 auto;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700; color: #fff;
  background-size: cover;
  background-position: center;
}
.comment-user { flex: 0 0 auto; text-decoration: none; color: inherit; display: block; }
.comment-user b { color: var(--fg); }
.comment-user:active { opacity: .6; }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: baseline; gap: 8px; }
.comment-head b { font-size: 13px; font-weight: 600; }
.comment-head time { font-size: 11px; color: rgba(255, 255, 255, .4); }
.comment p { margin: 2px 0 0; font-size: 14px; line-height: 1.35; word-break: break-word; }
.comments-empty { text-align: center; color: rgba(255, 255, 255, .45); padding: 36px 12px; font-size: 14px; }

.sheet-form { padding: 8px 12px 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.sheet-form input {
  width: 100%;
  border: 0;
  background: rgba(255, 255, 255, .08);
  border-radius: 12px;
  padding: 11px 13px;
  outline: none;
}
.sheet-form input::placeholder { color: rgba(255, 255, 255, .4); }
#comment-name { margin-bottom: 8px; font-size: 13px; }
.comment-input-row { display: flex; gap: 8px; align-items: center; }
.send-btn {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border: 0; border-radius: 50%;
  background: var(--brand-gradient);
  display: grid; place-items: center;
  cursor: pointer;
}
.send-btn svg { width: 20px; height: 20px; fill: #fff; }

/* ------------------------------------------------- страница автора */
body.author-page { display: block; overflow: auto; }
body.author-page .phone { height: auto; min-height: 100dvh; overflow: visible; }
@media (min-width: 760px) {
  body.author-page { display: flex; align-items: flex-start; padding: 20px 0; }
  body.author-page .phone { height: auto; min-height: 0; }
}

.back-btn { position: absolute; right: 12px; top: calc(var(--safe-t) + 9px); }
.back-btn svg { width: 20px; height: 20px; fill: none; }

.author-body {
  padding: calc(var(--safe-t) + var(--bar-h) + 12px) 16px calc(var(--safe-b) + 28px);
}
.author-head { text-align: center; margin-bottom: 18px; }
.author-avatar {
  display: grid; place-items: center;
  width: 92px; height: 92px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--fill) center/cover no-repeat;
  font-size: 34px; font-weight: 700;
}
.author-head h1 { margin: 0; font-size: 22px; }
.author-nick { color: var(--muted); font-size: 14px; margin-top: 2px; }
.author-bio { margin: 10px 0 0; font-size: 14px; color: rgba(250, 250, 250, .82); }
.author-level {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--fill);
  font-size: 13.5px;
  font-weight: 600;
}

.settings-btn { position: absolute; right: 56px; top: calc(var(--safe-t) + 9px); }
.settings-btn svg { width: 20px; height: 20px; fill: none; }

/* Просмотры на плитке — как в Instagram, слева снизу */
.tile-views {
  position: absolute;
  left: 6px; bottom: 6px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  font-weight: 700;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .9);
}
.tile-views svg { width: 12px; height: 12px; fill: #fff; }
.author-grid .tile .tile-title { left: 6px; right: 6px; bottom: 24px; }

/* Настройки профиля */
.settings-sheet { height: 82%; }
.settings-avatar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  margin-bottom: 14px;
  border-radius: var(--radius);
  background: var(--fill);
  cursor: pointer;
}
.author-avatar.sm { width: 56px; height: 56px; font-size: 22px; margin: 0; }
.settings-avatar-text b { display: block; font-size: 14px; color: var(--fg); }
.settings-avatar-text i { font-style: normal; font-size: 12px; color: var(--muted); }

.settings-meta {
  margin: 18px 0;
  border-radius: var(--radius);
  background: var(--fill);
  overflow: hidden;
}
.settings-meta div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  font-size: 13.5px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.settings-meta div:last-child { border-bottom: 0; }
.settings-meta b { font-weight: 600; color: var(--muted); }
.settings-logout { max-width: none; color: #ff8aa5; }

.author-actions { margin-bottom: 16px; }
.author-actions .cta svg { width: 20px; height: 20px; stroke: #fff; }

.author-tabs {
  display: flex;
  gap: 6px;
  background: var(--fill);
  border-radius: var(--radius);
  padding: 4px;
  margin: 4px 0 16px;
}
.author-tab {
  flex: 1;
  position: relative;
  padding: 9px 4px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.author-tab.is-active { background: var(--brand-gradient); color: #fff; }
.tab-badge {
  display: inline-block;
  min-width: 17px;
  margin-left: 5px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  vertical-align: top;
}
.author-tab.is-active .tab-badge { background: rgba(0, 0, 0, .3); }

.alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.alert {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--fill);
}
.alert.is-new { box-shadow: inset 3px 0 0 var(--accent); }
.alert-icon { font-size: 18px; line-height: 1.2; }
.alert b { display: block; font-size: 14px; margin-bottom: 3px; }
.alert p { margin: 0 0 4px; font-size: 13px; color: rgba(250, 250, 250, .75); line-height: 1.35; }
.alert time { font-size: 11.5px; color: var(--muted); }

.author-logout { margin: 12px auto 0; max-width: 340px; }

.author-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin-bottom: 20px;
}
.author-grid .tile { border-radius: 10px; }
.author-empty { text-align: center; color: var(--muted); font-size: 14px; padding: 24px 0 28px; }
.author-cta { max-width: 340px; margin: 0 auto; }

/* ------------------------------------------------------- поделиться */
.share-sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 41;
  background: var(--surface);
  border-radius: 18px 18px 0 0;
  padding-bottom: calc(var(--safe-b) + 14px);
  animation: slideUp .22s ease;
}

.share-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 16px 12px 8px;
}
.share-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 10px 4px;
  border: 0;
  border-radius: 14px;
  background: none;
  color: var(--fg);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.share-item:active { background: rgba(255, 255, 255, .07); }
.share-ic {
  width: 50px; height: 50px;
  border-radius: 50%;
  display: grid; place-items: center;
}
.share-ic svg { width: 26px; height: 26px; fill: #fff; color: #fff; }

.share-link {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 14px 0;
  padding: 6px 6px 6px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .07);
}
.share-link input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, .7);
  font-size: 13px;
  outline: none;
  text-overflow: ellipsis;
}
.btn-copy {
  flex: 0 0 auto;
  border: 0;
  border-radius: 9px;
  padding: 9px 14px;
  background: var(--brand-gradient);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

/* ----------------------------------------------------------- мелочи */
.heart-burst {
  position: absolute;
  z-index: 26;
  width: 92px; height: 92px;
  margin: -46px 0 0 -46px;
  pointer-events: none;
  fill: var(--accent);
  animation: burst .7s ease forwards;
}
@keyframes burst {
  0% { transform: scale(.3) rotate(-12deg); opacity: 0; }
  35% { transform: scale(1.15) rotate(-12deg); opacity: 1; }
  100% { transform: scale(1) rotate(-12deg) translateY(-40px); opacity: 0; }
}

.toast {
  position: absolute;
  left: 50%; bottom: calc(var(--tabbar-space) + 24px);
  transform: translateX(-50%);
  z-index: 60;
  background: rgba(20, 20, 22, .95);
  border: 1px solid rgba(255, 255, 255, .12);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  animation: fade .2s ease;
  white-space: nowrap;
}

.loader { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 29; display: flex; gap: 5px; }
.loader i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .7); animation: blink 1s infinite; }
.loader i:nth-child(2) { animation-delay: .15s; }
.loader i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

.feed-empty {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  z-index: 12;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center; padding: 24px;
}
.empty-emoji { font-size: 52px; }
.feed-empty h2 { margin: 6px 0 0; font-size: 20px; }
.feed-empty p { margin: 0; color: var(--muted); font-size: 14px; }
.feed-empty a { color: var(--accent); }

/* ------------------------------------------------- опрос вместо ролика */
/* Спрашиваем зрителя напрямую: какие кинотеатры оплачены, какие жанры нравятся.
   Слайд обычный — его можно просто пролистнуть, ответ не обязателен. */
.slide.survey {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  background: radial-gradient(120% 80% at 50% 0%, #2a0f2a 0%, #000 62%);
}

.survey-box {
  width: 100%;
  max-width: 380px;
  padding: 22px 20px 18px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .55);
}
.survey-box.is-done { text-align: center; padding: 34px 20px; }

.survey-box h2 { margin: 0 0 6px; font-size: 20px; font-weight: 700; }
.survey-sub { margin: 0 0 16px; font-size: 14px; line-height: 1.45; color: var(--muted); }

.survey-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  max-height: 46vh;
  overflow-y: auto;
}

.survey-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass);
  background: var(--fill);
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.survey-option.is-picked {
  background: var(--brand-gradient);
  border-color: transparent;
}
.survey-check {
  width: 16px; height: 16px;
  border-radius: 5px;
  border: 1.5px solid rgba(255, 255, 255, .5);
  flex: 0 0 16px;
}
.survey-option.is-picked .survey-check {
  background: #fff;
  border-color: #fff;
  position: relative;
}
.survey-option.is-picked .survey-check::after {
  content: '';
  position: absolute; left: 5px; top: 1px;
  width: 4px; height: 9px;
  border: solid #b3003a;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.survey-foot { display: flex; align-items: center; gap: 10px; }
.survey-foot .cta { flex: 1; margin: 0; }
.survey-send[disabled] { opacity: .45; }
.survey-skip {
  padding: 10px 12px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.survey-note { margin: 12px 0 0; font-size: 12px; line-height: 1.4; color: rgba(250, 250, 250, .4); }

/* ------------------------------------------------------------------ страницы для поиска

   Содержимое, отданное сервером: его видит поисковик и зритель, у которого ещё не
   загрузился скрипт. Как только лента собрана, контейнер очищается и на его месте
   появляются слайды — поэтому здесь ровно то же, что зритель увидит дальше. */
.seo-page {
  padding: calc(var(--safe-t) + var(--bar-h) + 12px) 18px calc(var(--safe-b) + 90px);
  max-width: 720px;
  margin: 0 auto;
  color: var(--text, #fff);
  overflow-y: auto;
  scroll-snap-align: start;
  min-height: 100%;
}
.seo-page h1 { font-size: 22px; line-height: 1.25; margin: 10px 0 14px; }
.seo-page h2 { font-size: 16px; margin: 26px 0 10px; opacity: .95; }
.seo-lead { font-size: 15px; line-height: 1.55; opacity: .85; margin: 0 0 16px; }
.seo-poster {
  display: block; width: min(220px, 46%); height: auto;
  border-radius: 12px; margin: 0 0 16px;
}
.seo-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; margin: 0 0 18px; }
.seo-facts dt { opacity: .55; }
.seo-facts dd { margin: 0; }
.seo-list, .seo-links { list-style: none; padding: 0; margin: 0; }
.seo-list li, .seo-links li { padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 14px; }
.seo-page a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.seo-author { font-size: 14px; opacity: .8; margin: 16px 0 0; }
.crumbs { font-size: 13px; opacity: .6; margin-bottom: 6px; }
.crumbs a { color: inherit; }
.genre-links { display: flex; flex-wrap: wrap; gap: 8px; }
.genre-links a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px; font-size: 14px;
  background: rgba(255,255,255,.08); text-decoration: none;
}
.genre-links i { font-style: normal; opacity: .5; font-size: 12px; }

/* ------------------------------------------------------------------ правовые документы */
.legal {
  padding: calc(var(--safe-t) + var(--bar-h) + 12px) 18px calc(var(--safe-b) + 40px);
  max-width: 760px;
  margin: 0 auto;
  color: var(--text, #fff);
  overflow-y: auto;
  font-size: 15px;
  line-height: 1.6;
}
.legal h1 { font-size: 22px; line-height: 1.3; margin: 8px 0 6px; }
.legal h2 { font-size: 17px; margin: 30px 0 10px; }
.legal h3 { font-size: 15px; margin: 20px 0 8px; opacity: .9; }
.legal p, .legal li { opacity: .88; }
.legal ol, .legal ul { padding-left: 20px; margin: 10px 0; }
.legal li { margin: 6px 0; }
.legal a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.legal-date { opacity: .5; font-size: 13px; margin: 0 0 22px; }
.legal-note {
  border-left: 3px solid rgba(255,255,255,.25);
  padding: 10px 0 10px 14px;
  margin: 18px 0;
  opacity: .8;
  font-size: 14px;
}
.legal-links {
  display: flex; flex-wrap: wrap; gap: 10px 18px;
  margin-top: 40px; padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.12);
  font-size: 14px;
}
.legal-foot {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  margin-top: 34px; padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: 13px; opacity: .6;
}
.legal-foot a { color: inherit; }

/* согласие и ссылки на документы в шторке профиля */
/* Отметка о согласии на обработку данных: закон требует отдельного действия, поэтому это
   настоящий чекбокс, пустой по умолчанию, а не строчка «нажимая кнопку, вы соглашаетесь». */
.profile-check {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 4px 0 16px;
  font-size: 12px; line-height: 1.45; color: var(--muted);
  cursor: pointer;
}
.profile-form .profile-check input[type="checkbox"] {
  width: 18px; flex: 0 0 18px; height: 18px;
  margin: 1px 0 0; padding: 0;
  accent-color: #ff0a4b;
  cursor: pointer;
}
/* Ссылку на текст согласия человек должен видеть: без подчёркивания она сливается
   со строкой, и получается, что согласился он вслепую. */
.profile-check a { color: var(--fg); text-decoration: underline; text-underline-offset: 2px; }
.profile-legal-links {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  margin-top: 22px; padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: 12px; opacity: .55;
}
.profile-legal-links a { color: inherit; text-decoration: none; }

/* подвал в разделе «Поиск» — в самой ленте места нет, она занимает весь экран */
.app-foot { padding: 26px 14px 26px; }
.app-foot .legal-foot { margin-top: 0; padding-top: 0; border-top: 0; }
.app-foot-note { font-size: 12px; line-height: 1.5; opacity: .45; margin: 14px 0 0; }

/* ------------------------------------------------------------------ вход через сети

   Знаки и фирменные цвета — как на лендинге clipra: VK синий, Яндекс на белом,
   MAX единственный с градиентом, поэтому читается как отдельный, новый способ. */
.social-auth { display: grid; gap: 10px; margin-bottom: 18px; }
.social-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 14px 12px;
  border: 0; border-radius: 13px;
  font-size: 15px; font-weight: 600; font-family: inherit;
  cursor: pointer;
  transition: transform .14s ease, filter .14s ease;
}
.social-btn:active { transform: scale(.985); filter: brightness(1.08); }
.social-mark { width: 24px; height: 24px; flex: none; border-radius: 6px; display: grid; place-items: center; }
.social-mark svg { width: 14px; height: 14px; }

.social-vk { background: #0077ff; color: #fff; }
.social-vk .social-mark { background: rgb(255 255 255 / .22); color: #fff; }

.social-yandex { background: #fff; color: #0a0a0a; }
.social-yandex .social-mark { background: none; }
.social-yandex .social-mark svg { width: 24px; height: 24px; }

.social-max { background: linear-gradient(115deg, #44ccff, #5533ee 40%, #9933dd); color: #fff; }
.social-max .social-mark { background: rgb(255 255 255 / .22); color: #fff; }

.social-btn.is-busy { pointer-events: none; opacity: .7; }
.social-hint { font-size: 12px; opacity: .55; text-align: center; margin: 2px 0 0; }
.social-or {
  display: flex; align-items: center; gap: 10px;
  margin: 6px 0 2px; font-size: 12px; opacity: .45;
}
.social-or::before, .social-or::after {
  content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.14);
}

/* ------------------------------------------------------------------ согласие на cookie

   Слой плавающий и появляется поверх содержимого: вёрстку он не двигает, смещения нет.
   Разметку создаёт скрипт, поэтому поисковик текста баннера не видит и в сниппет он
   не попадает. */
.consent {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(var(--safe-b) + 12px);
  z-index: 90;
  max-width: 560px;
  margin-inline: auto;
  padding: 16px 18px 14px;
  border-radius: 16px;
  background: rgba(24, 24, 27, .97);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 16px 44px rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  color: var(--fg);
  font-size: 13.5px;
  line-height: 1.5;
  animation: slideUp .2s ease;
}
.consent h2 { font-size: 15px; margin: 0 0 8px; }
.consent p { margin: 0 0 14px; opacity: .82; }
.consent a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

.consent-row { display: flex; flex-wrap: wrap; gap: 8px; }
.consent-btn {
  flex: 1 1 auto;
  min-height: 42px;
  padding: 10px 14px;
  border: 0; border-radius: 11px;
  background: var(--fill);
  color: var(--fg);
  font: inherit; font-weight: 600;
  cursor: pointer;
}
/* Отказ выглядит так же заметно, как согласие: разное оформление подталкивало бы к выбору */
.consent-btn.primary { background: var(--brand-gradient); color: #fff; }
.consent-btn.ghost { background: none; border: 1px solid rgba(255, 255, 255, .18); }
.consent-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.consent-cat { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; cursor: pointer; }
.consent-cat input { margin: 2px 0 0; width: auto; flex: none; }
.consent-cat b { display: block; font-size: 13.5px; }
.consent-cat i { display: block; font-style: normal; font-size: 12.5px; opacity: .62; margin-top: 2px; }
.consent-cat.is-locked { opacity: .75; cursor: default; }

@media (min-width: 760px) { .consent { max-width: 420px; } }

/* таблицы в правовых документах */
.legal-table { width: 100%; border-collapse: collapse; margin: 12px 0 18px; font-size: 13.5px; }
.legal-table th, .legal-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,.1); vertical-align: top; }
.legal-table th { font-weight: 600; opacity: .7; font-size: 12.5px; }
.legal-table code { font-size: 12.5px; overflow-wrap: anywhere; }
.legal-table small { opacity: .55; }
