/* =====================================================
   NekoNest — Premium Redesign 2025–2026
   Design System: Glassmorphism · Gradient Borders · Neon Premium
   ===================================================== */

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

button {
  font: inherit;
  color: inherit;
}

button:active {
  transform: none;
}

/* Убираем нативную браузерную обводку (outline) с кнопок вкладок
   навигации (шапка/боковая панель) — при клике мышью/тапом браузер по
   умолчанию рисует свою рамку вокруг сфокусированной кнопки, и она
   накладывалась поверх уже существующей подсветки активной вкладки
   (см. .nav-tab.active box-shadow ниже), давая двойной эффект "рамка
   вокруг кнопки". Доступность для клавиатурной навигации не теряем —
   :focus-visible всё равно показывает outline, когда фокус получен
   через Tab, а не клик мышью/тапом. */
.nav-tab:focus,
.nav-dropdown-toggle:focus,
.notif-bell-btn:focus {
  outline: none;
}
.nav-tab:focus-visible,
.nav-dropdown-toggle:focus-visible,
.notif-bell-btn:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

:root {
  --poster-min-width: 165px;
  /* Core palette — нейтральный тёплый почти-чёрный (без синего подтона,
     который был в исходной bg:#06080f), в стиле референса. */
  --bg:           #0e0e0e;
  --bg-card:      #161616;
  --bg-card2:     #1c1c1c;
  --bg-input:     #141414;
  --bg-glass:     rgba(22, 22, 22, 0.72);
  --bg-glass2:    rgba(28, 28, 28, 0.60);

  /* Brand colors — минималистичная чёрно-белая палитра без неона.
     Имена переменных (--green/--blue/--purple) оставлены прежними: их
     используют ~194 места по всему файлу через var(...), переименование
     самого токена добавило бы риск без функциональной пользы — меняется
     только то, какой цвет каждое имя хранит. Все три акцента теперь —
     оттенки серого/белого, свечения убраны (glow-переменные близки к
     прозрачным, чтобы не ломать места, где они складываются в box-shadow). */
  --green:        #e8e8e8;
  --green-dim:    #b8b8b8;
  --green-dark:   #2a2a2a;
  --green-mid:    #e8e8e8;
  --green-glow:   rgba(232, 232, 232, 0.06);
  --green-faint:  rgba(232, 232, 232, 0.04);

  /* Secondary & accent */
  --blue:         #cfcfcf;
  --blue-glow:    rgba(207, 207, 207, 0.05);
  --purple:       #a8a8a8;
  --purple-glow:  rgba(168, 168, 168, 0.05);

  /* Premium gradients — приглушены до градаций серого, без цветных переливов */
  --grad-primary:   linear-gradient(135deg, #e8e8e8 0%, #cfcfcf 50%, #a8a8a8 100%);
  --grad-card:      linear-gradient(145deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
  --grad-glow:      radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.04) 0%, transparent 70%);
  --grad-hero:      radial-gradient(ellipse at 50% 40%, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 50%, transparent 80%);

  /* Text — нейтральный тёплый серый, без цветных подтонов */
  --text:         #f0f0f0;
  --text-muted:   #8a8a8a;
  --text-dim:     #55555a;

  /* Borders */
  --border:       rgba(255, 255, 255, 0.06);
  --border-hl:    rgba(255, 255, 255, 0.2);
  --border-blue:  rgba(255, 255, 255, 0.14);

  /* Effects — тени остаются чисто чёрными (глубина), свечения убраны */
  --radius:       12px;
  --radius-sm:    8px;
  --radius-xs:    5px;
  --shadow:       0 8px 40px rgba(0,0,0,0.9);
  --shadow-card:  0 4px 24px rgba(0,0,0,0.7), 0 1px 0 rgba(255,255,255,0.03);
  --shadow-glow:  0 0 0 rgba(0,0,0,0);

  --seal-color:   rgba(255, 255, 255, 0.02);

  /* Транзишны */
  --t-fast:  0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --t-med:   0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow:  0.4s  cubic-bezier(0.4, 0, 0.2, 1);
  --t-spring: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  /* Премиальный ease-out для появления карточек (AniList/Linear/Apple-style) */
  --ease-premium: cubic-bezier(0.22, 1, 0.36, 1);
  --t-reveal: 0.6s var(--ease-premium);

  /* Высота нижней мобильной навигации (.mobile-bottom-nav), без safe-area.
     Панель — "плавающий остров" с внешним отступом снизу 18px (см.
     .mobile-bottom-nav ниже) + сама капсула .mobile-nav-items: 10px
     (padding-top капсулы) + 10px (padding-top кнопки) + 24px (иконка,
     увеличена под более крупную панель) + 4px (gap) + 16px (строка
     текста) + 10px (padding-bottom кнопки) + 10px (padding-bottom
     капсулы) ≈ 84px + 18px внешнего отступа = ~102px round up к 104px
     с запасом. Раньше в mobileListsPopup/mobileSettingsPopup было
     захардкожено bottom:70px — число "на глаз", разошедшееся с реальной
     высотой навигации и оставлявшее пустую полосу под попапами (см.
     соответствующие правила ниже). Задаём высоту переменной один раз
     здесь и используем и в самой навигации (min-height, чтобы будущие
     правки размеров кнопки не разошлись с этим числом снова), и в
     bottom обоих попапов — так они гарантированно точно стыкуются с
     реальной навигацией, а не с приблизительной оценкой. */
  --mobile-nav-height: 104px;
}

/* Бейджи статуса/оценки/времени выхода (.card-list-badge, .card-rating-badge,
   .schedule-card-status/-badge/-time — все читают --card-badge-font/padding)
   и плашка "сейчас смотрите" (.season-current-badge, --season-current-badge-*)
   ТЕПЕРЬ адаптируются к текущему размеру постера (--poster-min-width,
   выставляется js/poster-settings.js: 138px/165px/248px для уровней
   Маленький/Стандарт/Большой). clamp() держит нижнюю/верхнюю границу,
   чтобы текст не схлопнулся в кашу на самом маленьком уровне и не раздулся
   непропорционально на самом большом — внутри границ размер линейно
   следует за шириной постера через calc().
   --poster-min-width по умолчанию 165px (Стандарт) — те же самые числа,
   что были здесь захардкожены раньше, поэтому на уровне 2 внешний вид
   не меняется, меняется только поведение при переключении уровня.
   Рейтинг (--card-rating-badge-font) сделан чуть крупнее статуса —
   на 1px больше на любом уровне размера постера. */
:root {
  --poster-min-width: 165px;
  --card-badge-font: clamp(9px, calc(var(--poster-min-width, 165px) * 0.061), 12px);
  --card-badge-padding: clamp(4px, calc(var(--poster-min-width, 165px) * 0.024), 6px)
                         clamp(10px, calc(var(--poster-min-width, 165px) * 0.075), 15px);
  --card-rating-badge-font: clamp(10px, calc(var(--poster-min-width, 165px) * 0.067), 13px);
  --season-current-badge-font: clamp(8px, calc(var(--poster-min-width, 165px) * 0.052), 11px);
  --season-current-badge-padding: clamp(5px, calc(var(--poster-min-width, 165px) * 0.036), 8px)
                                   clamp(5px, calc(var(--poster-min-width, 165px) * 0.03), 7px)
                                   clamp(4px, calc(var(--poster-min-width, 165px) * 0.03), 6px);
}

/* На мобильном (≤768px) постеры каталога/каруселей теперь используют
   ту же --poster-min-width (auto-fill+minmax), что и десктоп — стандартный
   размер постера одинаков на обеих платформах, меняется лишь количество
   карточек в ряд. --mobile-poster-cols больше не участвует в размере
   постера (используется только для .schedule-card в разделе «Расписание»).
   Отдельный медиа-запрос с фиксированными 9px/4px 11px для бейджей не
   нужен — он бы жёстко перекрывал адаптивный расчёт выше. */

html { scroll-behavior: smooth; overflow-x: hidden; max-width: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  max-width: 100%;
  /* Компенсация высоты .site-header, который теперь position:fixed
     (см. .site-header) и больше не занимает место в потоке — без этого
     отступа весь контент страницы заезжал бы под шапку. 84px (верхняя
     строка) + 46px (нижняя строка вкладок) = 130px, совпадает с
     .header-inner--top/--bottom height. На мобильном (@media
     max-width:768px ниже) переопределяется на 60px — там нижняя строка
     скрыта. */
  padding-top: 130px;
  /* Subtle noise texture overlay — нейтральные серые пятна вместо цветных */
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(255,255,255,0.02) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.02) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 90%, rgba(255,255,255,0.015) 0%, transparent 50%);
}

a { color: var(--green); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: #ffffff; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--green-dim);
  border-radius: 3px;
}
* { scrollbar-width: thin; scrollbar-color: var(--green-dim) transparent; }

/* ===== JUTSU SEALS DECO ===== */
.jutsu-seals {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.seal {
  position: absolute;
  font-size: 120px;
  font-family: serif;
  color: var(--seal-color);
  animation: sealFloat 20s ease-in-out infinite;
  user-select: none;
}

.seal:nth-child(1) { top: 5%;  left: 3%;  animation-delay: 0s;    font-size: 140px; }
.seal:nth-child(2) { top: 20%; right: 4%; animation-delay: -4s;   font-size: 100px; }
.seal:nth-child(3) { top: 55%; left: 1%;  animation-delay: -8s;   font-size: 160px; }
.seal:nth-child(4) { top: 70%; right: 2%; animation-delay: -12s;  font-size: 90px; }
.seal:nth-child(5) { top: 85%; left: 40%; animation-delay: -6s;   font-size: 110px; }
.seal:nth-child(6) { top: 35%; left: 48%; animation-delay: -16s;  font-size: 80px; }

@keyframes sealFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.5; }
  50%       { transform: translateY(-20px) rotate(5deg); opacity: 1; }
}

/* ===== PARTICLE CANVAS ===== */
#particleCanvas { display: none; }

#cssParticles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.css-particle {
  position: absolute;
  border-radius: 50%;
  animation: cssParticleFloat linear infinite;
  will-change: transform;
}

@keyframes cssParticleFloat {
  0%   { transform: translateY(0) translateX(0); }
  25%  { transform: translateY(-30px) translateX(15px); }
  50%  { transform: translateY(-15px) translateX(-10px); }
  75%  { transform: translateY(-40px) translateX(5px); }
  100% { transform: translateY(0) translateX(0); }
}

/* ===================================================================
   HEADER — Premium glassmorphism navbar
   =================================================================== */
.site-header {
  /* position:fixed вместо sticky — sticky здесь ненадёжен, т.к.
     overflow-x:hidden на <html> (см. правило html{} чуть выше в этом
     файле) в части браузеров превращает html в собственный скролл-контейнер,
     из-за чего шапка внутри <body> перестаёт "прилипать" при скролле
     страницы. fixed крепится к вьюпорту напрямую и не зависит от этого.
     Компенсация высоты шапки, чтобы контент не заезжал под неё, —
     через padding-top на body (см. правило body{} выше: --header-height /
     --header-height-mobile). */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
  background: rgba(14, 14, 18, 0.75);
  backdrop-filter: blur(min(28px, var(--pf-cap, 999px))) saturate(190%);
  -webkit-backdrop-filter: blur(min(28px, var(--pf-cap, 999px))) saturate(190%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: translate(0, 0);
}

/* ── Слайд-переход при переключении шапка↔боковая панель ──────────
   "Вариант 3 — Слайд (укатывание)" из демо, выбранный пользователем:
   при отпускании панели на краю экрана шапка сначала уезжает целиком
   в СТОРОНУ СТЯГИВАНИЯ (за пределы экрана), затем — уже в новой
   раскладке (горизонтальной/боковой) — выезжает обратно с той же
   стороны. Реализация в два шага из js/header-dock.js:
     1) html.header-dock-transitioning-out + html.header-dock-slide-*
        — уезжает translate() к соответствующему краю;
     2) сразу после смены классов header-dock-left/right (уже с новым
        layout/шириной) — html.header-dock-transitioning-in с тем же
        html.header-dock-slide-* — стартует с translate() у того же
        края и едет обратно к translate(0,0).
   transition стоит только на время самого перехода (через класс
   html.header-dock-anim), чтобы не задевать перетаскивание (drag)
   ручкой самой панели, ресайз окна и обычную загрузку страницы —
   там же анимации не нужны, а быть готовым мгновенно откликаться
   гораздо важнее. */
html.header-dock-anim .site-header {
  transition: transform 0.42s cubic-bezier(0.65,0,0.35,1), opacity 0.3s ease;
}
html.header-dock-transitioning-out.header-dock-slide-left .site-header,
html.header-dock-transitioning-in.header-dock-slide-left .site-header {
  transform: translateX(-110%);
  opacity: 0.4;
}
html.header-dock-transitioning-out.header-dock-slide-right .site-header,
html.header-dock-transitioning-in.header-dock-slide-right .site-header {
  transform: translateX(110%);
  opacity: 0.4;
}
html.header-dock-transitioning-out.header-dock-slide-top .site-header,
html.header-dock-transitioning-in.header-dock-slide-top .site-header {
  transform: translateY(-110%);
  opacity: 0.4;
}

.header-inner {
  max-width: 1680px;
  margin: 0 auto;
  padding: 0 32px;
  height: 84px;
  display: flex;
  align-items: center;
  gap: 24px;
}

/* ── HEADER — two-row layout (nav variant 4) ──────────────
   Верхняя строка: лого + поиск + (spacer) + уведомления + аккаунт.
   Нижняя строка: вкладки навигации (Главная/Каталог/Расписание/Чат/
   Мои списки), отдельной полосой под верхней, разделены border-top.
   .header-inner остаётся общим контейнером ширины/паддингов для
   обеих строк — переопределяем только высоту и вертикальные отступы. */
.header-inner--top {
  height: 62px;
  gap: 20px;
}
.header-inner--bottom {
  height: 46px;
  padding-top: 0;
  padding-bottom: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.header-top-spacer { flex: 1 1 auto; min-width: 12px; }
.header-top-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
/* В новой двухстрочной раскладке поиск больше не должен растягиваться
   на всю доступную ширину верхней строки (там уже есть spacer) —
   ограничиваем разумной шириной, как в остальных полях интерфейса. */
.header-inner--top .search-wrap { flex: 0 1 420px; }
/* Вкладки в нижней строке распределены по левому краю без обёртки
   .header-nav в pill-контейнер — сама строка уже визуально выделена
   border-top, поэтому убираем лишний фон/паддинг пилюли. Сама кнопка
   при этом растянута на всю высоту строки (для удобного клика), но
   визуальную заливку (hover/active) сажаем на компактную скруглённую
   "таблетку" по центру — единый радиус для обоих состояний, чтобы
   hover не выглядел острым прямоугольником рядом со скруглённым лого
   и активной вкладкой. */
.header-inner--bottom .header-nav {
  background: none;
  border: none;
  padding: 0;
  height: 100%;
  gap: 6px;
  gap: 4px;
}
.header-inner--bottom .nav-tab {
  padding: 0 15px;
  padding: 0 13px;
  height: 32px;
  align-self: center;
  border-radius: 999px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.1px;
  border-radius: 8px;
}
.header-inner--bottom .nav-dropdown { height: 100%; display: flex; align-items: center; }

/* ── LOGO ── */
.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
}

.logo-icon-wrap {
  width: 64px;
  height: 64px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Квадратная карточка (фон/border/скругление) убрана — теперь это
     просто позиционирующий контейнер, силуэт кота держится на
     контурном drop-shadow из .logo-svg без всякой подложки под ним.
     Внешний размер (64px) и внутренний отступ (9px) оставлены как
     были, чтобы сам кот не изменился в размере — раньше он занимал
     64-9*2=46px внутри рамки, сейчас занимает те же ~46px, просто
     без рамки вокруг. */
  padding: 9px;
  box-sizing: border-box;
}

/* Прежний hover карточки (посветление фона) больше не применим —
   фона нет. Анимация перенесена на саму иконку — см. .logo:hover
   .logo-svg ниже. */

.logo-svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* ВАРИАНТ 2: кот остаётся чёрным (как в оригинале), но получает
     тонкую белую обводку по контуру через слоёный drop-shadow —
     этого достаточно, чтобы силуэт отделился от тёмного фона шапки
     без всякой подложки-карточки под ним. */
  filter:
    drop-shadow(1px 0 0 #fff)
    drop-shadow(-1px 0 0 #fff)
    drop-shadow(0 1px 0 #fff)
    drop-shadow(0 -1px 0 #fff)
    drop-shadow(0 0 4px rgba(232,232,232,0.18));
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), filter var(--t-med);
  transform-origin: 50% 85%;
}

/* Новая hover-анимация вместо посветления фона (фона больше нет):
   кот слегка "навостряется" — покачивается из стороны в сторону,
   как будто прислушался, с лёгким приседанием на итоге, и обводка
   на пике становится ярче. transform-origin смещён к низу силуэта
   (хвост/лапы), чтобы покачивание шло от опоры, а не от центра. */
.logo:hover .logo-svg {
  animation: logoEarPerk 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes logoEarPerk {
  0%   { transform: rotate(0deg)   scale(1); }
  30%  { transform: rotate(-7deg)  scale(1.05);
         filter:
           drop-shadow(1px 0 0 #fff) drop-shadow(-1px 0 0 #fff)
           drop-shadow(0 1px 0 #fff) drop-shadow(0 -1px 0 #fff)
           drop-shadow(0 0 10px rgba(232,232,232,0.5)); }
  60%  { transform: rotate(5deg)   scale(1.05);
         filter:
           drop-shadow(1px 0 0 #fff) drop-shadow(-1px 0 0 #fff)
           drop-shadow(0 1px 0 #fff) drop-shadow(0 -1px 0 #fff)
           drop-shadow(0 0 10px rgba(232,232,232,0.5)); }
  100% { transform: rotate(0deg)   scale(1.02);
         filter:
           drop-shadow(1px 0 0 #fff) drop-shadow(-1px 0 0 #fff)
           drop-shadow(0 1px 0 #fff) drop-shadow(0 -1px 0 #fff)
           drop-shadow(0 0 6px rgba(232,232,232,0.3)); }
}

/* Цвета самой иконки — привязаны к переменным темы, чтобы хексагон
   и буква "A" перекрашивались вместе с остальным интерфейсом. */
.logo-hex-outer { fill: var(--green-faint); stroke: var(--green); }
.logo-hex-inner { stroke: var(--green-dim); }
.logo-letter    { stroke: var(--green); }
.logo-dot       { fill: var(--green); }

.logo-text {
  font-family: 'Orbitron', monospace;
  font-size: 21px;
  font-weight: 900;
  background: var(--grad-primary);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: opacity var(--t-med);
}

.logo:hover .logo-text {
  opacity: 0.85;
}

.logo-text .char {
  display: inline-block;
}

/* ── SEARCH ── */
.search-wrap {
  flex: 1 1 0;
  min-width: 200px;
  max-width: 480px;
  position: relative;
  display: flex;
  align-items: center;
}
/* Внутри flex-контейнеров min-width по умолчанию auto (равен ширине
   содержимого), из-за чего .search-input мог распирать .search-wrap и
   текст/плейсхолдер вылезал за рамку поля вместо обрезки многоточием. */
.search-wrap .search-input { min-width: 0; }

/* ── Кнопка-ссылка на Telegram-канал ──
   Квадратная кнопка с мягким скруглением, диагональным градиентом
   и статичной тенью-свечением в цвет бренда — без анимаций наведения. */
.telegram-link-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-left: 10px;
  flex-shrink: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, #37AEE2 0%, #1E96C8 100%);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(55, 174, 226, 0.4);
  transition: none;
}
.telegram-link-btn svg {
  width: 23px;
  height: 23px;
  margin-top: -1px;
}
.telegram-link-btn:hover {
  background: linear-gradient(135deg, #37AEE2 0%, #1E96C8 100%);
  transform: none !important;
}
.telegram-link-btn:active {
  transform: none;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-wrap::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.45)' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 1;
}

.search-input {
  width: 100%;
  min-width: 0;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.11);
  color: #fff;
  padding: 8px 16px 8px 38px;
  border-radius: 999px;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  outline: none;
  transition: border-color var(--t-med), box-shadow var(--t-med), background var(--t-med);
  letter-spacing: -0.1px;
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  height: 40px;
  /* Длинный ввод/плейсхолдер обрезается многоточием вместо вылезания
     за рамки поля — text-overflow работает и на value, и на ::placeholder. */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-input::placeholder { color: rgba(255, 255, 255, 0.38); }

.search-input:focus {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.08),
    0 4px 20px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* ══════════════════════════════════════════════════════
   NAV — Apple Segmented Control Aesthetic
   NAV — redesigned for desktop
   ══════════════════════════════════════════════════════ */
.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  gap: 2px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  /* Pill container background */
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 13px;
  padding: 3px;
}

.nav-tab {
  background: transparent;
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.65);
  padding: 6px 14px;
  border-radius: 999px;
  border: none;
  color: rgba(168,168,168,0.75);
  padding: 7px 13px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  letter-spacing: -0.1px;
  font-size: 12px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  letter-spacing: 0.8px;
  white-space: nowrap;
  transition:
    background var(--t-med),
    color var(--t-med),
    border-color var(--t-med),
    box-shadow var(--t-med),
    transform var(--t-fast);
  position: relative;
  overflow: hidden;
  text-transform: none;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

/* Icon inside nav-tab */
.nav-tab-icon {
  width: 14px;
  height: 14px;
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  transition: filter var(--t-med);
}

/* Hover state */
/* Hover state — мягкая заливка без рамки (вариант 1 из превью) */
.nav-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  color: #e8e8e8;
  background: rgba(255,255,255,0.06);
}

/* Нажатое состояние (в момент клика) */
/* Нажатое состояние (в момент клика) — заливка чуть плотнее, без рамки,
   чтобы клик ощущался физически, но кнопка не "прыгала" (transform не
   трогаем, см. правило ниже про translateY/scale). */
.nav-tab:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.14);
  background: rgba(255,255,255,0.11);
}

.nav-tab:active,
.nav-dropdown-toggle:active,
.notif-bell-btn:active {
  transform: none;
  top: auto;
}

/* Active / selected state — Apple Glass Segment pill */
/* Active / selected state — заливка + тонкая акцентная линия по нижнему
   краю кнопки (не рамка-прямоугольник — она спорила со скруглённым
   лого/интерфейсом рядом, см. правку по фидбеку со скриншотом). */
.nav-tab.active {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  background: rgba(255,255,255,0.09);
  color: var(--green);
  font-weight: 800;
  box-shadow: inset 0 -2px 0 0 #e8e8e8;
}

.nav-tab.active:hover {
  background: rgba(255, 255, 255, 0.24);
  background: rgba(255,255,255,0.12);
}

.nav-tab.active .nav-tab-icon {
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.6));
  filter: drop-shadow(0 0 6px rgba(232,232,232,0.7));
}

/* ── NAV DROPDOWN ── */
.nav-dropdown { position: relative; }

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.nav-dropdown-arrow {
  transition: transform var(--t-fast);
  opacity: 0.5;
  margin-left: -2px;
}

.nav-dropdown-toggle.active .nav-dropdown-arrow,
.nav-dropdown:has(.nav-dropdown-menu.is-shown) .nav-dropdown-arrow {
  transform: rotate(180deg);
  opacity: 0.9;
}

/* Account button special style */
.nav-account-btn {
  gap: 8px;
  background: transparent;
  border: none;
  border-radius: 10px;
  padding: 5px 14px 5px 6px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: rgba(168,168,168,0.75);
  transition: background var(--t-med), color var(--t-med);
}
.nav-account-btn:hover {
  background: rgba(255,255,255,0.07);
  color: #e8e8e8;
}
.nav-account-btn:active {
  transform: none;
}
.nav-account-avatar {
  width: 24px;
  height: 24px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(200, 200, 210, 0.15));
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: linear-gradient(135deg, rgba(232,232,232,0.2), rgba(168,168,168,0.2));
  border: 1px solid rgba(232,232,232,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color var(--t-med), box-shadow var(--t-med);
}
.nav-account-btn:hover .nav-account-avatar,
.nav-account-btn.active .nav-account-avatar {
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  border-color: rgba(232,232,232,0.6);
  box-shadow: 0 0 10px rgba(232,232,232,0.25);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: none;
}
/* Вариант с загруженным фото профиля вместо иконки-заглушки —
   тот же кружок, но с реальной картинкой (object-fit:cover,
   чтобы не искажалась при непропорциональных фото). */
.nav-account-avatar--img {
  background: none;
  overflow: hidden;
}
.nav-account-avatar--img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.nav-account-avatar:has(.nf-av),
.nav-account-avatar.has-frame {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.nav-tab.nav-account-btn,
.nav-account-btn,
.nav-account-btn:has(.nf-av),
.nav-account-btn.has-frame,
#tabAccount,
#tabAccount:has(.nf-av) {
  overflow: visible !important;
}


/* ── DROPDOWN MENU ──
   Оформление синхронизировано с .notif-dropdown (боксом истории
   уведомлений) — тот же полупрозрачный белый бордер, тот же радиус
   через var(--radius) и та же тень с лёгким white-glow, чтобы оба
   попапа выглядели как один и тот же компонент. */
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 210px;
  background: rgba(17, 17, 17, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius);
  box-shadow:
    0 16px 48px rgba(0,0,0,0.7),
    0 0 0 1px rgba(232,232,232,0.05) inset,
    0 0 30px rgba(232,232,232,0.06);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  z-index: 200;
  backdrop-filter: blur(min(24px, var(--pf-cap, 999px)));
  /* Появление И закрытие через один и тот же transition на opacity+
     transform — тот же формат/механика, что и у аккордеона "Мои
     списки" в боковой (docked) панели (см. html.header-dock-left/right
     #navListsDropdown #navListsMenu в этом файле): там тоже единый
     transition на весь блок целиком, без keyframe-анимации. Раньше
     здесь была одностороняя @keyframes dropdownIn (только на
     появление) + мгновенный display:none на закрытие — попап
     появлялся плавно, а закрывался резким скачком. transition в обе
     стороны даёт симметричное поведение, как в сайдбаре. */
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  transition: opacity var(--t-med), transform var(--t-med);
}

.nav-dropdown-menu.is-shown {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.nav-dropdown-menu.hidden {
  /* display:none применяется JS-ом с задержкой (после окончания
     transition закрытия, см. closeListsDropdown/toggleListsDropdown в
     js/ui.js) — если бы .hidden добавлялся в тот же момент, что и
     снятие .is-shown, display:none оборвал бы transition мгновенно,
     точно так же, как раньше ломало закрытие аккордеона в сайдбаре.
     pointer-events:none — подстраховка на переходный кадр между
     снятием .is-shown и фактической простановкой .hidden, чтобы попап
     не перехватывал клики, пока дожидается конца анимации. */
  pointer-events: none;
}
.nav-dropdown-menu.hidden:not(.is-shown) { display: none; }

/* ── "Мои списки" в ОБЫЧНОМ (не docked) режиме шапки — тот же стиль
   и та же анимация раскрытия/закрытия, что у аккордеона в боковой
   (docked) панели (см. html.header-dock-left/right #navListsDropdown
   #navListsMenu ниже в файле). Само меню остаётся всплывающим попапом
   (position:absolute) — иначе раскрытие "на месте" распирало бы
   горизонтальную строку вкладок по высоте и ломало разметку шапки —
   но содержимое анимируется тем же приёмом grid-template-rows 0fr→1fr,
   и оформлено той же "вложенной карточкой" (фон + зелёная полоса
   слева), что и в боковой панели. Никакого scale/translateY и
   никакого построчного slide-каскада для пунктов — только
   opacity+grid-template-rows на родителе, как в accordion-версии.
   #navListsDropdown/#navListsMenu И #navAccountDropdown/#navAccountMenu —
   оба меню используют один и тот же аккордеон-стиль/анимацию (см.
   правку по просьбе пользователя: меню аккаунта приведено к тому же
   формату, что и "Мои списки" — общий селектор ниже покрывает оба
   через .nav-dropdown-menu вместо привязки к одному #navListsMenu). */
html:not(.header-dock-left):not(.header-dock-right) #navListsDropdown #navListsMenu,
html:not(.header-dock-left):not(.header-dock-right) #navAccountDropdown #navAccountMenu {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  opacity: 0;
  transform: none;
  padding: 0;
  transition:
    grid-template-rows var(--t-med),
    opacity var(--t-med);
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow:
    0 16px 48px rgba(0,0,0,0.7),
    0 0 0 1px rgba(232,232,232,0.05) inset,
    0 0 30px rgba(232,232,232,0.06);
  backdrop-filter: blur(min(24px, var(--pf-cap, 999px)));
}
html:not(.header-dock-left):not(.header-dock-right) #navListsDropdown #navListsMenu.is-shown,
html:not(.header-dock-left):not(.header-dock-right) #navAccountDropdown #navAccountMenu.is-shown {
  grid-template-rows: 1fr;
  opacity: 1;
}
html:not(.header-dock-left):not(.header-dock-right) #navListsDropdown #navListsMenu .nav-dropdown-menu-inner,
html:not(.header-dock-left):not(.header-dock-right) #navAccountDropdown #navAccountMenu .nav-dropdown-menu-inner {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 2px;
  padding: 6px 0;
  background: rgba(255,255,255,0.035);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--green);
}
html:not(.header-dock-left):not(.header-dock-right) #navListsDropdown #navListsMenu .nav-dropdown-item,
html:not(.header-dock-left):not(.header-dock-right) #navAccountDropdown #navAccountMenu .nav-dropdown-item {
  padding: 8px 12px 8px 16px;
  animation: none !important;
  transform: none !important;
  opacity: 1 !important;
}
html:not(.header-dock-left):not(.header-dock-right) #navListsDropdown #navListsMenu .nav-dropdown-section-title,
html:not(.header-dock-left):not(.header-dock-right) #navAccountDropdown #navAccountMenu .nav-dropdown-section-title {
  padding-left: 16px;
}

/* Section label inside dropdown */
.nav-dropdown-section-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(232,232,232,0.35);
  padding: 8px 14px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 4px;
}

.nav-dropdown-item {
  background: transparent;
  border: none;
  color: rgba(176,176,176,0.7);
  padding: 7px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
  display: flex;
  align-items: center;
  width: 100%;
}

.ndi-label {
  flex: 1;
}

.nav-dropdown-item:hover {
  background: rgba(255,255,255,0.05);
  color: #e0e0e0;
}

.nav-dropdown-item.active {
  background: rgba(232,232,232,0.08);
  color: var(--green);
}

/* Count badge — right-aligned */
.nav-dropdown-item .tab-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Rajdhani', sans-serif;
  color: rgba(176,176,176,0.5);
  min-width: 18px;
  text-align: right;
}
.nav-dropdown-item.active .tab-count {
  color: rgba(232,232,232,0.7);
}
.nav-dropdown-item:hover .tab-count {
  color: rgba(212,212,212,0.7);
}

/* ===== MAIN ===== */
.main-content {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  padding: 36px 24px 72px;
  position: relative;
  z-index: 1;
}

/* .hero-block, .hero-chakra-ring и связанный @keyframes chakraPulse
   удалены вместе с HTML-элементом #heroBlock (см. index.html —
   приветствие заменено полноэкранным hero-banner, см. секцию
   HERO BANNER в конце файла). @keyframes fadeUp ниже используется
   по всему сайту (.featured-block и др.) — её не трогаем. */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== FEATURED SECTION ===== */
.featured-block {
  margin-top: 48px;
  animation: fadeUp 0.7s ease 0.2s both;
}

.featured-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.featured-title {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: #f5f5f7;
  text-transform: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
}

.featured-title-icon {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}

.featured-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.02) 100%);
  opacity: 1;
}

.featured-loader {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
  font-family: 'Rajdhani', sans-serif;
  padding: 20px 0;
}
.featured-loader.hidden { display: none; }

.mini-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spinRing 0.8s linear infinite;
  flex-shrink: 0;
}

.featured-grid {
  grid-template-columns: repeat(auto-fill, var(--poster-min-width, 165px));
  justify-content: center;
}

/* =====================================================
   GRID CAROUSEL — горизонтальная лента-карусель для сеток
   на главной («Продолжить просмотр», «Лучшее по просмотрам»
   и т.п.), тот же визуальный язык (viewport + затемнённые
   стрелки по краям), что и .schedule-day-carousel в разделе
   «Расписание», но поверх обычных .anime-card/.anime-grid,
   а не .schedule-card.

   Разметка: .grid-carousel (позиционирующий родитель для стрелок)
     └─ .grid-carousel-track (сам .anime-grid/.featured-grid —
        JS переключает grid → flex-ряд через этот класс, добавляя
        overflow-x:auto и убирая grid-раскладку)
     └─ .grid-carousel-arrow.prev/.next (кнопки листания, скрыты
        на тач-устройствах — там просто свайп пальцем)
   ===================================================== */
/* ==========================================================================
   КАТАЛОГ / ГЛАВНАЯ / РАСПИСАНИЕ: ГОРИЗОНТАЛЬНЫЕ КАРУСЕЛИ (DESKTOP + MOBILE)
   Затухание карточек ровно под размер карточки (165px) без зазоров и рамок
   ========================================================================== */

.grid-carousel,
.schedule-day-carousel {
  position: relative;
  isolation: isolate;
}

/* Отключаем любые внешние накладки, чтобы не было зазоров сверху/снизу */
.grid-carousel::before,
.grid-carousel::after,
.schedule-day-carousel::before,
.schedule-day-carousel::after {
  display: none !important;
}

/* ─────────────────────────────────────────────────────────────
   1. ПЛАВНОЕ ЗАТУХАНИЕ КАРТОЧЕК НА КРАЯХ ТРЕКА (Mask Image)
   Динамические CSS-переменные --fade-left-w и --fade-right-w
   ───────────────────────────────────────────────────────────── */
.grid-carousel.has-portal-left.has-portal-right > .grid-carousel-track,
.grid-carousel.has-portal-left.has-portal-right > .anime-grid,
.grid-carousel.has-portal-left.has-portal-right > .featured-grid,
.grid-carousel.has-portal-left.has-portal-right > .continue-watching-grid,
.schedule-day-carousel.has-portal-left.has-portal-right > .schedule-day-list {
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    rgba(0, 0, 0, 0.08) calc(var(--fade-left-w, var(--poster-min-width, 165px)) * 0.18),
    rgba(0, 0, 0, 0.35) calc(var(--fade-left-w, var(--poster-min-width, 165px)) * 0.42),
    rgba(0, 0, 0, 0.75) calc(var(--fade-left-w, var(--poster-min-width, 165px)) * 0.72),
    black var(--fade-left-w, var(--poster-min-width, 165px)),
    black calc(100% - var(--fade-right-w, var(--poster-min-width, 165px))),
    rgba(0, 0, 0, 0.75) calc(100% - var(--fade-right-w, var(--poster-min-width, 165px)) * 0.72),
    rgba(0, 0, 0, 0.35) calc(100% - var(--fade-right-w, var(--poster-min-width, 165px)) * 0.42),
    rgba(0, 0, 0, 0.08) calc(100% - var(--fade-right-w, var(--poster-min-width, 165px)) * 0.18),
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    rgba(0, 0, 0, 0.08) calc(var(--fade-left-w, var(--poster-min-width, 165px)) * 0.18),
    rgba(0, 0, 0, 0.35) calc(var(--fade-left-w, var(--poster-min-width, 165px)) * 0.42),
    rgba(0, 0, 0, 0.75) calc(var(--fade-left-w, var(--poster-min-width, 165px)) * 0.72),
    black var(--fade-left-w, var(--poster-min-width, 165px)),
    black calc(100% - var(--fade-right-w, var(--poster-min-width, 165px))),
    rgba(0, 0, 0, 0.75) calc(100% - var(--fade-right-w, var(--poster-min-width, 165px)) * 0.72),
    rgba(0, 0, 0, 0.35) calc(100% - var(--fade-right-w, var(--poster-min-width, 165px)) * 0.42),
    rgba(0, 0, 0, 0.08) calc(100% - var(--fade-right-w, var(--poster-min-width, 165px)) * 0.18),
    transparent 100%
  );
}

.grid-carousel.has-portal-left:not(.has-portal-right) > .grid-carousel-track,
.grid-carousel.has-portal-left:not(.has-portal-right) > .anime-grid,
.grid-carousel.has-portal-left:not(.has-portal-right) > .featured-grid,
.grid-carousel.has-portal-left:not(.has-portal-right) > .continue-watching-grid,
.schedule-day-carousel.has-portal-left:not(.has-portal-right) > .schedule-day-list {
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    rgba(0, 0, 0, 0.08) calc(var(--fade-left-w, var(--poster-min-width, 165px)) * 0.18),
    rgba(0, 0, 0, 0.35) calc(var(--fade-left-w, var(--poster-min-width, 165px)) * 0.42),
    rgba(0, 0, 0, 0.75) calc(var(--fade-left-w, var(--poster-min-width, 165px)) * 0.72),
    black var(--fade-left-w, var(--poster-min-width, 165px)),
    black 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    rgba(0, 0, 0, 0.08) calc(var(--fade-left-w, var(--poster-min-width, 165px)) * 0.18),
    rgba(0, 0, 0, 0.35) calc(var(--fade-left-w, var(--poster-min-width, 165px)) * 0.42),
    rgba(0, 0, 0, 0.75) calc(var(--fade-left-w, var(--poster-min-width, 165px)) * 0.72),
    black var(--fade-left-w, var(--poster-min-width, 165px)),
    black 100%
  );
}

.grid-carousel.has-portal-right:not(.has-portal-left) > .grid-carousel-track,
.grid-carousel.has-portal-right:not(.has-portal-left) > .anime-grid,
.grid-carousel.has-portal-right:not(.has-portal-left) > .featured-grid,
.grid-carousel.has-portal-right:not(.has-portal-left) > .continue-watching-grid,
.schedule-day-carousel.has-portal-right:not(.has-portal-left) > .schedule-day-list {
  mask-image: linear-gradient(
    to right,
    black 0%,
    black calc(100% - var(--fade-right-w, var(--poster-min-width, 165px))),
    rgba(0, 0, 0, 0.75) calc(100% - var(--fade-right-w, var(--poster-min-width, 165px)) * 0.72),
    rgba(0, 0, 0, 0.35) calc(100% - var(--fade-right-w, var(--poster-min-width, 165px)) * 0.42),
    rgba(0, 0, 0, 0.08) calc(100% - var(--fade-right-w, var(--poster-min-width, 165px)) * 0.18),
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    black 0%,
    black calc(100% - var(--fade-right-w, var(--poster-min-width, 165px))),
    rgba(0, 0, 0, 0.75) calc(100% - var(--fade-right-w, var(--poster-min-width, 165px)) * 0.72),
    rgba(0, 0, 0, 0.35) calc(100% - var(--fade-right-w, var(--poster-min-width, 165px)) * 0.42),
    rgba(0, 0, 0, 0.08) calc(100% - var(--fade-right-w, var(--poster-min-width, 165px)) * 0.18),
    transparent 100%
  );
}

/* ─────────────────────────────────────────────────────────────
   2. МОБИЛЬНАЯ ВЕРСИЯ: без масок для свободного нативного свайпа
   ───────────────────────────────────────────────────────────── */
@media (max-width: 768px), (pointer: coarse) and (max-width: 900px) {
  .grid-carousel > .grid-carousel-track,
  .grid-carousel > .anime-grid,
  .grid-carousel > .featured-grid,
  .grid-carousel > .continue-watching-grid,
  .schedule-day-carousel > .schedule-day-list {
    mask-image: none !important;
    -webkit-mask-image: none !important;
  }
}

.grid-carousel > .anime-grid,
.grid-carousel > .featured-grid,
.grid-carousel > .seasons-grid,
.grid-carousel > .continue-watching-grid,
.grid-carousel-track.anime-grid,
.grid-carousel-track.featured-grid,
.grid-carousel-track.seasons-grid,
.grid-carousel-track.continue-watching-grid {
  display: flex !important;
  justify-content: flex-start !important;
  grid-template-columns: none !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: auto;
  scroll-snap-type: none;
  padding: 2px 2px 10px;
  margin: -2px -2px -10px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
  gap: 20px;
}
@media (max-width: 768px) {
  .grid-carousel > .anime-grid,
  .grid-carousel > .featured-grid,
  .grid-carousel > .seasons-grid,
  .grid-carousel > .continue-watching-grid,
  .grid-carousel-track.anime-grid,
  .grid-carousel-track.featured-grid,
  .grid-carousel-track.seasons-grid,
  .grid-carousel-track.continue-watching-grid {
    gap: 12px;
  }
}
.grid-carousel-track.anime-grid::-webkit-scrollbar,
.grid-carousel-track.featured-grid::-webkit-scrollbar,
.grid-carousel-track.seasons-grid::-webkit-scrollbar,
.grid-carousel-track.continue-watching-grid::-webkit-scrollbar,
.grid-carousel > .anime-grid::-webkit-scrollbar,
.grid-carousel > .featured-grid::-webkit-scrollbar,
.grid-carousel > .continue-watching-grid::-webkit-scrollbar {
  display: none;
}

.grid-carousel-track > .anime-card,
.grid-carousel-track > .cw-card,
.grid-carousel-track > .skeleton-card,
.grid-carousel > * > .anime-card,
.grid-carousel > * > .cw-card,
.grid-carousel > * > .skeleton-card {
  flex: 0 0 var(--poster-min-width, 165px) !important;
  width: var(--poster-min-width, 165px) !important;
  scroll-snap-align: none;
}

.grid-carousel-track img,
.schedule-day-list img,
.hero-slide img {
  -webkit-user-drag: none;
  user-select: none;
}

.grid-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  cursor: pointer;
  color: #fff;
  z-index: 5;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-fast), transform var(--t-fast);
}
.grid-carousel-arrow:active {
  transform: translateY(-50%) scale(0.92);
}
.grid-carousel-arrow svg {
  width: 22px;
  height: 22px;
  color: #fff;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.8));
  transition: transform var(--t-fast), color var(--t-fast);
}
.grid-carousel-arrow.prev {
  left: 6px;
  justify-content: center;
}
.grid-carousel-arrow.prev svg { margin-left: 0; }
.grid-carousel-arrow.next {
  right: 6px;
  justify-content: center;
}
.grid-carousel-arrow.next svg { margin-right: 0; }
.grid-carousel-arrow:hover {
  background: transparent;
  border: none;
  box-shadow: none;
}
.grid-carousel-arrow:hover svg {
  color: #fff;
  transform: scale(1.2);
}

.grid-carousel:hover .grid-carousel-arrow.can-scroll { opacity: 1; visibility: visible; }

@media (hover: none) {
  .grid-carousel-arrow { display: none; }
}

/* Раньше на мобильном карточки карусели принудительно растягивались под
   ширину экрана, поделённую на --mobile-poster-cols (2 колонки по
   умолчанию) — из-за этого постеры в «Продолжить просмотр» и похожих
   каруселях получались заметно КРУПНЕЕ, чем такие же постеры на ПК
   (там ширина = --poster-min-width, обычно 165px). Теперь на мобильном
   карточки карусели везде используют ту же --poster-min-width, что и на
   десктопе — стандартный размер постера одинаков на обеих платформах,
   меняется только количество видимых в ряд карточек (больше на широком
   экране, меньше на узком), а не сам размер постера. */
.grid-carousel-track > .anime-card,
.grid-carousel-track > .cw-card {
  width: var(--poster-min-width, 165px);
}

/* ── Skeleton cards ── */
@keyframes skeletonShimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton-card {
  position: relative;
  width: var(--poster-min-width, 165px);
  aspect-ratio: 178 / 296;
  border-radius: 20px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
  flex: 0 0 var(--poster-min-width, 165px);
  pointer-events: none;
  animation: skeletonFadeIn 0.3s ease-out;
}

.skeleton-poster {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.03) 100%
  );
  background-size: 800px 100%;
  animation: skeletonShimmer 1.5s infinite linear;
}

.skeleton-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 50px;
  height: 22px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.skeleton-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
}

.skeleton-title {
  height: 13px;
  width: 80%;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
}

.skeleton-meta {
  height: 10px;
  width: 55%;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

/* ===== LOADER ===== */
.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 100px 20px;
}
.loader.hidden { display: none; }

/* Loader: Вариант 3 · Эквалайзер из preview.
   Пять вертикальных полос плавно поднимаются/опускаются с задержкой. */
.cat-scan-spinner {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  width: 54px;
  height: 46px;
}
.cat-scan-spinner .loader-bar {
  display: block;
  width: 6px;
  height: 12px;
  background: linear-gradient(#fff, #5a5a5a);
  border-radius: 3px;
  animation: v3wave 1s ease-in-out infinite;
}
.cat-scan-spinner .loader-bar:nth-child(1){ animation-delay: 0s; }
.cat-scan-spinner .loader-bar:nth-child(2){ animation-delay: .12s; }
.cat-scan-spinner .loader-bar:nth-child(3){ animation-delay: .24s; }
.cat-scan-spinner .loader-bar:nth-child(4){ animation-delay: .36s; }
.cat-scan-spinner .loader-bar:nth-child(5){ animation-delay: .48s; }
@keyframes v3wave {
  0%, 100% { height: 12px; opacity: .5; }
  50% { height: 46px; opacity: 1; }
}


.loader-text {
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  animation: pulse 1.5s ease infinite;
  font-family: 'Rajdhani', sans-serif;
}

@keyframes pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* ===== ERROR BANNER ===== */
.error-banner {
  background: rgba(11, 11, 11, 0.9);
  border: 1px solid rgba(255, 100, 100, 0.2);
  border-left: 3px solid #ff6060;
  color: #ff9999;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  animation: slideDown 0.3s ease;
  backdrop-filter: blur(8px);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.error-banner.hidden { display: none; }

.error-close {
  background: transparent;
  border: none;
  color: #ff6060;
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
}

/* ===== SECTION TITLE ===== */
.section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  font-family: 'Rajdhani', sans-serif;
}
.section-title.hidden { display: none; }
.section-title span { color: var(--green); }

/* ===== LIST SECTION ===== */
.list-header {
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.list-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 60px;
  height: 2px;
  background: var(--grad-primary);
  border-radius: 2px;
}

.list-page-title {
  font-size: 22px;
  font-weight: 700;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: 'Orbitron', monospace;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.list-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  letter-spacing: 1px;
}

/* =====================================================
   ANIME GRID & CARDS — premium glassmorphism
   ===================================================== */
.anime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--poster-min-width, 165px));
  gap: 20px;
  justify-content: center;
  position: relative;
  z-index: 1;
}

/* ── ANIME CARD ── */
.anime-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: visible;
  cursor: pointer;
  aspect-ratio: 178 / 296;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-x pan-y;
  /* Появление (opacity/transform) — премиальный ease-out без отскока.
     border-color/box-shadow используют свою длительность, она же
     применяется при выходе из :hover (см. .anime-card:hover ниже). */
  transition:
    opacity var(--t-reveal),
    transform var(--t-reveal),
    border-color var(--t-med),
    box-shadow var(--t-med);
  position: relative;
  /* content-visibility: auto — главная оптимизация для больших списков
     (каталог, «Мои списки» на сотни/тысячи карточек). Браузер полностью
     пропускает layout/style/paint для карточек, которые сейчас не видны
     на экране (и не близко к нему), и досчитывает их только когда они
     реально попадают в область скролла. contain-intrinsic-size обязателен
     в паре с ним: до первого реального рендера карточки браузер должен
     знать её примерный размер (иначе высота "невидимых" карточек
     схлопнется в 0 и скролл будет дёргаться/скакать). Значение с
     ключевым словом auto означает "используй последний фактически
     отрендеренный размер этой карточки, а до первого рендера — размер
     из aspect-ratio (178/296) при типичной ширине постера ~165px".
     contain: layout style paint входит в content-visibility автоматически,
     отдельно его указывать не нужно. */
  content-visibility: auto;
  contain-intrinsic-size: auto 165px auto 275px;
  /* will-change НЕ ставим здесь — постоянный GPU-слой на КАЖДОЙ карточке
     конфликтует с content-visibility:auto и вызывает мерцание при скролле
     вверх на мобильном. GPU-слой создаётся браузером автоматически только
     во время активного transition/animation — это оптимально. */
  opacity: 0;
  transform: translateY(32px) scale(0.94);
  background-image: var(--grad-card);
}

/* Карточка вошла в кадр — показываем её */
.anime-card.card-in {
  opacity: 1;
  transform: none;
  /* После завершения анимации appearance убираем opacity/transform из transition,
     чтобы при скролле ВВЕРХ браузер не запускал их повторно (content-visibility:auto
     перерисовывает карточки при повторном входе в viewport, что вызывает мерцание).
     border-color/box-shadow остаются для hover-эффектов. */
  transition:
    border-color var(--t-med),
    box-shadow var(--t-med);
}

/* Одноразовая подсветка карточки при возврате «Назад» с детальной страницы
   аниме — общая для .anime-card везде на сайте (поиск/каталог/«Мои
   списки»/«Другие сезоны» на странице тайтла, см. _restoreByCard в
   js/ui.js). Через box-shadow, а не background: постер обычно занимает
   почти всю площадь карточки, поэтому подсветка фона была бы почти не
   видна — светящаяся обводка поверх постера видна независимо от
   содержимого. */
[data-anime-id].card-return-highlight {
  animation: card-return-flash 2.2s ease-out;
}
@keyframes card-return-flash {
  0%   { box-shadow: 0 0 0 2px var(--green), 0 0 24px var(--green-glow); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) {
  [data-anime-id].card-return-highlight { animation: none !important; }
}

/* Для избранных карточек — рамка/свечение убраны по просьбе
   пользователя (используется только .card-fav-caption ниже как
   текстовый индикатор статуса). */

@media (prefers-reduced-motion: reduce) {
  .anime-card,
  .anime-card.card-in,
  .anime-card:hover {
    transition: none !important;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .card-poster {
    transition: none !important;
    opacity: 1 !important;
  }
  .skeleton-poster,
  .skeleton-title,
  .skeleton-meta {
    animation: none !important;
  }
  html.site-theme-switching,
  html.site-theme-switching *,
  html.site-theme-switching *::before,
  html.site-theme-switching *::after {
    transition: none !important;
  }
}

/* На мобильных — короче дистанция движения и быстрее транзишены,
   чтобы каскад из много карточек не "тормозил" восприятие на слабых
   GPU и не упирался в 60fps */
@media (max-width: 768px) {
  .anime-card {
    transform: translateY(14px) scale(0.97);
    transition:
      opacity 0.4s var(--ease-premium),
      transform 0.4s var(--ease-premium),
      border-color var(--t-med),
      box-shadow var(--t-med);
  }
  /* Карточка уже показана — убираем opacity/transform из transition,
     чтобы при скролле ВВЕРХ они не запускались повторно и не вызывали
     мерцание на мобильном. */
  .anime-card.card-in {
    transform: none;
    transition:
      border-color var(--t-med),
      box-shadow var(--t-med);
  }
  .anime-card:hover {
    transform: none;
  }
}


/* Gradient border glow on hover via ::before */
.anime-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(232,232,232,0) 0%, rgba(207,207,207,0) 50%, rgba(168,168,168,0) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  transition: background var(--t-med);
  pointer-events: none;
  z-index: 2;
}

/* Top shimmer line */
.anime-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad-primary);
  opacity: 0;
  transition: opacity var(--t-med);
  z-index: 3;
}

/* Hover-эффекты на карточке — ТОЛЬКО на десктопе с настоящей мышью */
@media (hover: hover) and (pointer: fine) {
  .anime-card:hover {
    border-color: rgba(255, 255, 255, 0.24);
    box-shadow: none;
    transform: none;
  }
  .anime-card:hover::before {
    background: linear-gradient(135deg, rgba(232, 232, 232, 0.5), rgba(207, 207, 207, 0.3), rgba(168, 168, 168, 0.2));
  }
  .anime-card:hover:not(.is-favorites2)::after {
    opacity: 1;
  }
  .anime-card:hover .card-title {
    color: var(--green);
  }
  .anime-card:active {
    transform: none !important;
  }
}

/* На мобильных устройствах и тач-экранах при зажатии/нажатии карточка АБСОЛЮТНО НЕПОДВИЖНА:
   никаких сдвигов, подергиваний или масштабирования */
@media (max-width: 768px), (hover: none), (pointer: coarse) {
  .anime-card,
  .anime-card.card-in,
  .anime-card:hover,
  .anime-card:active,
  .anime-card:focus,
  .anime-card:focus-visible {
    transform: none !important;
    transition:
      border-color var(--t-med),
      box-shadow var(--t-med) !important;
    outline: none;
    /* Disable content-visibility on mobile: causes 1px card jumps on back-navigation */
    content-visibility: visible;
    contain-intrinsic-size: none;
  }
  /* Disable card-return-highlight on touch: causes card to visually jerk for 2s */
  [data-anime-id].card-return-highlight {
    animation: none !important;
  }
  .anime-card:hover .card-poster,
  .anime-card .card-poster,
  .anime-card .card-poster-wrap {
    transform: none !important;
  }
  /* Градиентная рамка */
  .anime-card:active::before {
    background: linear-gradient(135deg, rgba(232,232,232,0.5), rgba(207,207,207,0.3), rgba(168,168,168,0.2));
  }
  /* Шиммер-линия сверху */
  .anime-card:not(.is-favorites2):active::after {
    opacity: 1;
  }
  /* Зелёный текст названия */
  .anime-card:active .card-title {
    color: var(--green);
  }
  /* Виньетка на постере */
  .anime-card:active .card-poster-wrap::after {
    opacity: 1;
  }
  /* Тень и рамка */
  .anime-card:active {
    transform: none !important;
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6);
  }
}


/* ── Золотая обводка для любимых аниме ── */

/* Рамка рисуется через position:fixed-like элемент с отрицательным inset
   который не обрезается contain/overflow родителя */
.anime-card.is-favorite {
  --fav-active: 1;
}

/* Золотая рамка и свечение убраны по просьбе пользователя — статус
   "Любимое" на карточке теперь обозначает только .card-fav-caption
   (текстовая подпись под названием) и сердечко .card-fav-star на
   постере, без border/drop-shadow вокруг всей карточки. */

/* Золотая обводка слева — индикатор "Любимое". Внутри теперь сердечко
   (символ поменяли местами со звёздочкой "Избранного" по просьбе пользователя),
   позиция и цвет (золотой, левый угол) остались прежними. */
.card-fav-star {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 16px;
  color: #ffd700;
  text-shadow: 0 0 12px rgba(255,185,0,1), 0 0 6px rgba(255,185,0,0.9), 0 1px 4px rgba(0,0,0,1);
  z-index: 4;
  pointer-events: none;
  line-height: 1;
  filter: drop-shadow(0 0 5px rgba(255,165,0,1));
}

/* ── Сиреневая обводка + сердечко для второй независимой метки
   "Избранное" (favorites2) — визуально отличается от золотого "Любимого",
   обе метки могут быть активны на одной карточке одновременно. ── */
/* Сиреневая рамка/свечение/анимация "Избранного" тоже убраны по той же
   просьбе — статус теперь обозначает только .card-fav-caption и
   сердечко .card-fav2-heart, без обводки вокруг карточки. */

/* Комбо-рамка (оба статуса сразу) тоже убрана — при одновременном
   "Любимое" + "Избранное" карточка больше не получает своей отдельной
   border/filter/animation; статус виден через оба сердечка на постере
   и объединённый каптион "Любимое · Избранное" ниже. */

/* keyframes fav2-card-pulse и combo-glow-pulse, которые раньше рисовали
   пульсацию для .anime-card в каталоге, .detail-meta/.poster-glow-wrap/
   .detail-widget-frame на странице аниме и .season-card в "Других
   сезонах" — везде убраны как часть одной и той же серии правок
   (обводка/свечение статуса заменена на текстовый каптион). Ни то, ни
   другое нигде больше не используется, поэтому сами декларации удалены
   вместе с последним применением, а не оставлены мёртвым кодом. */

/* Фиолетовая звёздочка для "Избранное" — стоит на той же позиции,
   что и золотое сердечко "Любимого" (bottom: 8px, left: 8px). */
.card-fav2-heart {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 16px;
  color: #c084fc;
  text-shadow: 0 0 8px rgba(255,185,0,0.9), 0 0 12px rgba(157,78,221,1), 0 0 6px rgba(157,78,221,0.9), 0 1px 4px rgba(0,0,0,1);
  z-index: 4;
  pointer-events: none;
  line-height: 1;
  filter: drop-shadow(0 0 4px rgba(255,185,0,0.8)) drop-shadow(0 0 5px rgba(157,78,221,1));
}

/* Когда на карточке активны оба значка (Любимое + Избранное),
   золотое сердечко сдвигается чуть левее фиолетовой звезды,
   чтобы они не перекрывали друг друга. */
.anime-card.is-favorite.is-favorites2 .card-fav-star {
  right: 26px;
}

/* ── Подпись-каптион под названием (вариант 5 из демо-подборки,
   fx-caption) — тонкая линия + мелкий капс-текст статуса под
   card-title. Не заменяет золотую/сиреневую обводку карточки выше,
   а дополняет её — обводка остаётся как есть, каптион просто даёт
   то же самое ещё и текстом, для доступности и на случай, когда
   человек листает список без цвета (например, дальтонизм). Три
   варианта текста/цвета — под каждое из трёх состояний карточки. ── */
.card-fav-caption {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.card-fav-caption .fav-caption-line {
  width: 14px;
  height: 1.5px;
  flex: none;
}
.card-fav-caption .fav-caption-text {
  font-size: 9.5px;
  font-weight: 700;
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* «Любимое» — золотая версия, использует тот же #ffd700, что и
   рамка/сердечко is-favorite выше. */
.anime-card.is-favorite:not(.is-favorites2) .card-fav-caption .fav-caption-line {
  background: #ffd700;
}
.anime-card.is-favorite:not(.is-favorites2) .card-fav-caption .fav-caption-text {
  color: #ffd700;
}

/* «Избранное» — сиреневая версия, тот же #c084fc, что и рамка/звезда
   is-favorites2 выше. */
.anime-card.is-favorites2:not(.is-favorite) .card-fav-caption .fav-caption-line {
  background: #c084fc;
}
.anime-card.is-favorites2:not(.is-favorite) .card-fav-caption .fav-caption-text {
  color: #c084fc;
}

/* Комбо (оба статуса сразу) — линия и текст «Любимое · Избранное»
   получают тот же переливающийся золото↔фиолетовый градиент, что
   раньше использовался в обводке карточки (обводка теперь убрана,
   но палитра/анимация combo-border-spin осталась узнаваемой парой
   цветов «оба статуса сразу» и здесь, в каптионе). */
.anime-card.is-favorite.is-favorites2 .card-fav-caption .fav-caption-line {
  background: linear-gradient(90deg, #ffd700, #ff9d00, #9d4edd, #c084fc);
  background-size: 200% 100%;
  animation: combo-border-spin 2s linear infinite;
}
.anime-card.is-favorite.is-favorites2 .card-fav-caption .fav-caption-text {
  background: linear-gradient(90deg, #ffd700, #ff9d00, #9d4edd, #c084fc, #ffd700);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: combo-border-spin 2s linear infinite;
}

/* ── Poster ── */
.card-poster-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-card2);
  border-radius: 20px;
  /* Изолируем композитинг постера от blur-слоя родительской .anime-card
     (та анимирует свой собственный filter:blur при появлении).
     Без изоляции два независимых blur-слоя на время перехода
     накладываются друг на друга и дают "рваную" цветную кайму
     по краю карточки в момент загрузки постера. */
  isolation: isolate;
  /* Принудительно выносим скруглённую маску (overflow:hidden +
     border-radius) на свой собственный GPU-композитный слой ЗАРАНЕЕ,
     отдельно от слоя самого <img>. Без этого, пока крупное изображение
     ещё декодируется/растеризуется, браузер периодически пересчитывает
     маску ВМЕСТЕ с недодекодированным содержимым — и на скруглённой
     кромке на 1-2 секунды виден "рваный" цветной шум (edge bleeding).
     translateZ(0) форсирует отдельный слой именно для маски, так что
     она стабильна независимо от состояния decode картинки внутри. */
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.card-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition:
    transform 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.4s ease-out;
  will-change: transform;
  /* Отдельный композитный слой для самой картинки — декодирование
     крупного постера больше не пересчитывает слой маски-обёртки. */
  transition: opacity 0.4s ease-out;
  border-radius: 20px;
  display: block;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  transform: translateZ(0);
}

.anime-card:hover .card-poster { transform: translateZ(0); }
.anime-card:hover .card-poster {
  transform: translateZ(0);
}

/* Виньетка при наведении отключена по запросу пользователя */
.card-poster-wrap::after {
  display: none !important;
}
.anime-card:hover .card-poster-wrap::after { opacity: 0 !important; }

/* Класс добавляется через JS (wireCardPosterLoad) сразу после
   фактической загрузки <img>, чтобы избежать "скачка"/мигания —
   постер плавно проявляется, когда реально готов к показу.
   (Раньше тут также был filter:blur(8px)→blur(0), но второй
   независимый blur-переход поверх blur-перехода самой .anime-card
   создавал артефакт цветных пикселей по контуру карточки на момент
   загрузки — поэтому теперь у постера только fade по opacity.) */
.card-poster.poster-loaded {
  opacity: 1;
}

.card-poster-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a1a1a;
  font-size: 52px;
}

/* Вариант "рейтинг справа сверху" — отдельного затемнения на весь
   низ постера больше нет: подложка для текста теперь только внутри
   .card-body (см. ниже), а сам постер остаётся ярче и виднее выше
   текстового блока. .card-overlay оставлен как класс (на случай
   других ссылок), но больше ничего не рисует. */
.card-overlay {
  display: none;
}

/* ── List badge ──
   Личный статус («Смотрю» / «Просмотрено» и т.п.) — сверху СЛЕВА,
   капсулой (полностью скруглённые края), с отступом от края постера.
   Рейтинг (.card-rating-badge ниже) — тоже слева, второй строкой под
   статусом (не в правом углу), так что оба бейджа образуют одну
   вертикальную колонку на одной стороне постера.

   ── Milk glass ──
   Тот же материал, что и у нижней мобильной навигации
   (.mobile-nav-items): светлое молочно-белое полупрозрачное стекло,
   сильный blur+saturate, тонкая белая обводка и мягкий верхний блик
   через inset box-shadow. Цвет роли (розовый/голубой/оранжевый/...)
   остаётся только в цвете ТЕКСТА — капсула для всех статусов
   одинаковая, не разноцветная сплошная заливка.

   У нижней навигации под стеклом всегда тёмный фон приложения, поэтому
   14%-й молочный тон там достаточно контрастен сам по себе. Постер же
   бывает светлым/пёстрым в любом месте (как раз под левым верхним
   углом) — то же самое стекло на светлом фрагменте картинки становится
   почти нечитаемым. Поэтому фон — двухслойный: снизу тонкая ПОСТОЯННАЯ
   тёмная подложка (не зависит от blur, гарантирует минимальный
   контраст всегда), сверху сам молочный стеклянный слой поверх неё —
   капсула остаётся стеклянной по ощущению, но не проваливается в
   белый/бежевый постер. */
.card-list-badge {
  position: absolute;
  top: 14px; left: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: var(--card-badge-font, 10.5px);
  font-weight: 800;
  letter-spacing: 0.3px;
  padding: var(--card-badge-padding, 5px 14px);
  border-radius: 999px;
  text-transform: uppercase;
  background:
    linear-gradient(rgba(240,240,245,0.12), rgba(240,240,245,0.12)),
    rgba(14,14,20,0.85);
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow:
    0 6px 18px -2px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.2);
  /* Текст держит контраст сам по себе, а не только за счёт фона —
     двойная тень (тесная тёмная + более широкая мягкая) читается и
     на светлом, и на тёмном фрагменте постера под капсулой. */
  text-shadow:
    0 1px 2px rgba(0,0,0,0.9),
    0 0 10px rgba(0,0,0,0.5);
  z-index: 4;
  /* Страховка от переполнения на узкой/компактной карточке (уровень
     "Маленький" в настройках размера постера) при длинном статусе
     ("Просмотрено", "Избранное"…) — обрезаем многоточием вместо
     растягивания капсулы за пределы постера. */
  max-width: calc(100% - 28px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  /* Точка-индикатор слева от текста (::before ниже) — капсула теперь
     flex-контейнер, чтобы точка и текст были на одной строке с ровным
     зазором вместо inline-обтекания. */
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Точка-индикатор статуса — то единственное визуальное отличие от
   .card-rating-badge (который остаётся справа без точки), кроме цвета
   текста. currentColor означает, что точка автоматически берёт тот же
   цвет роли, что и сам текст (.badge-watching/.badge-watched/...) ниже
   — не нужно дублировать палитру ролей ещё раз для точки отдельно. */
.card-list-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  box-shadow: 0 0 4px currentColor;
}

/* Цвет роли — у текста внутри общей стеклянной капсулы. Тона взяты
   светлее и чуть более насыщенными, чем раньше, чтобы держать контраст
   поверх подложки из .card-list-badge выше даже на ярких постерах. */
.badge-watching   { color: #ffc2e3; }
.badge-watched    { color: #8fe3ff; }
.badge-planned    { color: #ffcd9c; }
.badge-favorite   { color: #ffabc4; }
.badge-favorites2 { color: #e8b8f5; }
.badge-dropped    { color: #e0e0d8; }

/* ── Rating badge ──
   Раньше жил в правом верхнем углу, отдельно от статуса (.card-list-badge)
   слева — теперь оба бейджа на одной, левой стороне: статус сверху,
   рейтинг сразу под ним. top задан фиксированным отступом от верха
   постера (не "под статусом" через margin/flow), потому что сам статус
   рисуется на absolute-позиционировании — так рейтинг не завязан на
   реальную высоту капсулы статуса и не съезжает, если у неё когда-нибудь
   изменится padding/font-size.
   Если статуса нет (card-poster-wrap:not(:has(.card-list-badge))) —
   рейтинг поднимается на место статуса, чтобы не оставлять пустой
   верхний левый угол.

   Тот же Milk glass материал (с той же тёмной подложкой под стеклом
   для контраста на светлых постерах), что и у .card-list-badge выше
   и у нижней навигации (.mobile-nav-items) — оба бейджа читаются как
   одна семья. */
.card-rating-badge {
  position: absolute;
  top: 50px; left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background:
    linear-gradient(rgba(240,240,245,0.12), rgba(240,240,245,0.12)),
    rgba(14,14,20,0.85);
  border: 1px solid rgba(255,255,255,0.3);
  color: #ffd23f;
  font-size: var(--card-rating-badge-font, 11px);
  font-weight: 800;
  padding: var(--card-badge-padding, 5px 14px);
  border-radius: 999px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  letter-spacing: 0.2px;
  text-shadow:
    0 1px 2px rgba(0,0,0,0.9),
    0 0 10px rgba(0,0,0,0.5);
  box-shadow:
    0 6px 18px -2px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.2);
  z-index: 4;
  max-width: calc(100% - 28px);
}

/* Если личного статуса нет — рейтинг сам поднимается наверх, на то же
   место (top: 14px), где иначе была бы капсула статуса, вместо того
   чтобы оставаться подвешенным на 50px над пустым углом постера. */
.card-poster-wrap:not(:has(.card-list-badge)) .card-rating-badge {
  top: 14px;
}

/* ── Card body ──
   Вариант "рейтинг справа сверху": .card-body больше не отдельный
   блок под постером — он лежит поверх нижней части постера
   (position:absolute), а тёмная подложка есть ТОЛЬКО за самим
   текстом (через градиент на этом же элементе), а не на весь низ
   постера — так картинка остаётся виднее/ярче выше текста, и статус/
   рейтинг-бейджи в углах не спорят с отдельной сплошной плашкой. */
.card-body {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  padding: 22px 13px 12px;
  border-radius: 0 0 20px 20px;
  background: linear-gradient(to top, rgba(6,6,8,0.94) 0%, rgba(6,6,8,0.7) 65%, transparent 100%);
  pointer-events: none;
}

.card-title {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  line-height: 1.35;
  transition: color var(--t-fast);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.15px;
  margin-bottom: 5px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}

.card-meta-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
  overflow: hidden;
  white-space: nowrap;
}

.card-meta-year {
  font-size: 11.5px;
  color: rgba(255,255,255,0.7);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  flex-shrink: 0;
  font-weight: 500;
}

.card-meta-type {
  font-size: 11.5px;
  color: rgba(255,255,255,0.7);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  font-weight: 500;
}

.card-meta-year + .card-meta-type::before {
  content: '·';
  margin-right: 6px;
  opacity: 0.5;
}

.card-meta-views {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  font-family: 'Rajdhani', sans-serif;
  margin-top: 3px;
  letter-spacing: 0.3px;
}

/* =====================================================
   «STREAK GOLD» — стиль карточек блока «Продолжить просмотр»
   (.cw-card, вешается на .anime-card только в js/continue-watching.js).
   Отличия от обычной карточки: крупнее и контрастнее плашки
   статус+рейтинг поверх постера, и вместо простой строки
   "Серия N · время" — полноширинный прогресс-бар просмотра серии.
   Другие карточки (каталог, «Мои списки», История) используют
   .card-list-badge/.card-rating-badge/.history-card-meta как раньше
   и этим блоком не затрагиваются.
   ===================================================== */
/* Раньше здесь был захардкожен собственный, более крупный размер
   (11px / 6px 14px) для обеих капсул — из-за этого статус и рейтинг в
   «Продолжить просмотр» были заметно крупнее, чем на тех же карточках
   в остальных блоках (каталог, «Лучшее по рейтингу» и т.п.), хотя
   постер физически того же размера. Теперь font-size/padding берутся
   из тех же адаптивных переменных --card-badge-font/--card-badge-padding
   (см. :root выше) — единый размер во всех блоках, который вместе с тем
   продолжает подстраиваться под уровень размера постера. Уникальными для
   .cw-card остаются только позиция (top/left) и более тёмная тень. */
.anime-card.cw-card .card-list-badge {
  top: 12px;
  left: 12px;
  box-shadow:
    0 2px 2px rgba(0,0,0,0.6),
    0 6px 14px -4px rgba(0,0,0,0.6);
}

.anime-card.cw-card .card-rating-badge {
  top: 54px;
  left: 12px;
  right: auto;
  box-shadow:
    0 2px 2px rgba(0,0,0,0.6),
    0 6px 14px -4px rgba(0,0,0,0.6);
}

.anime-card.cw-card .card-poster-wrap:not(:has(.card-list-badge)) .card-rating-badge {
  top: 12px;
}

.cw-card-meta {
  margin-top: 6px;
}

.cw-progress-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  margin-bottom: 6px;
}

/* Общее число серий тайтла неизвестно (ни в записи истории, ни после
   фоновой дозагрузки, см. _cwFetchEpisodesCount в continue-watching.js)
   — трек остаётся без .cw-progress-fill внутри. Едва заметная штриховка
   вместо пустой ровной полоски: иначе выглядит как "не отрисовался
   прогресс", хотя на самом деле процент посчитать не из чего. */
.cw-progress-track:empty {
  background: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.05) 0px,
    rgba(255,255,255,0.05) 3px,
    transparent 3px,
    transparent 6px
  );
}

.cw-progress-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #f5afd7, #ffd23f);
  transition: width 0.4s ease;
}

.cw-ep-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
}

.cw-ep {
  color: var(--green-dim);
  font-weight: 600;
  letter-spacing: 0.3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex-shrink: 1;
}

.cw-time {
  color: var(--text-muted);
  flex-shrink: 0;
  letter-spacing: 0.2px;
}

/* =====================================================
   ANIME CARD TOOLTIP (hover-превью при наведении на карточку)
   Тот же дизайн-язык, что и у самих карточек/детальной
   страницы — Rajdhani/Orbitron, бренд-зелёный --green,
   пилюли жанров в духе .genre-tag.

   ── Milk glass ──
   Тот же материал, что у .card-list-badge/.card-rating-badge на
   карточках и у нижней мобильной навигации: светлое молочно-белое
   полупрозрачное стекло, сильный blur+saturate, тонкая белая обводка.
   Раньше у тултипа был отдельный тёмный градиентный фон плюс цветная
   (золотая для "Любимого", фиолетовая для "Избранного") обводка —
   теперь материал всегда один и тот же независимо от статуса, статус
   виден по бейджам/тексту внутри самой карточки детали, а не по рамке
   тултипа. */
#animeCardTooltip {
  font-family: 'Rajdhani', sans-serif;
  color: var(--text);
  background:
    linear-gradient(rgba(240,240,245,0.14), rgba(240,240,245,0.14)),
    rgba(10,10,14,0.55);
  border: 1px solid rgba(255,255,255,0.22);
    linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%),
    rgba(14, 16, 24, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(180%);
  -webkit-backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(180%);
  overflow: hidden;
  isolation: isolate;
  pointer-events: none;
  contain: paint;
  transform: translate3d(0, 0, 0);
  will-change: opacity, transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.tt-glowline {
  height: 2px;
  border-radius: 2px;
  background: var(--grad-primary);
  opacity: 0.7;
}

.tt-body {
  padding: 14px 16px 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.tt-poster {
  position: relative;
  flex-shrink: 0;
  width: 88px;
  height: 124px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0,0,0,0.6);
  border: 1px solid var(--border);
  background: rgba(18, 20, 28, 0.95);
  contain: paint;
}
.tt-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tt-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 1;
}
.tt-poster::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 60%, rgba(0,0,0,0.5));
}

.tt-info { flex: 1; min-width: 0; }

.tt-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 7px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tt-score {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.tt-score-star { font-size: 20px; color: #ffd700; line-height: 1; }
.tt-score-num {
  font-size: 19px;
  font-weight: 800;
  font-family: 'Orbitron', monospace;
  letter-spacing: 0.5px;
  color: var(--green);
}
.tt-score-num.is-mid  { color: #ffd700; }
.tt-score-num.is-low  { color: #ff7070; }

.tt-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
/* ── Milk glass пилюли ──
   Тот же материал, что у .card-list-badge/.card-rating-badge на
   карточках: молочно-белое полупрозрачное стекло (двухслойный фон —
   тонкая молочная плёнка поверх постоянной тёмной подложки), сильный
   blur+saturate, тонкая белая обводка. Раньше у этих пилюль фон был
   просто плоской полупрозрачной заливкой без blur — сама "оболочка"
   не была стеклянной, только цвет текста менялся по роли. Теперь
   стеклянный именно фон/обводка каждой пилюли, а цвет роли (год/тип
   нейтральный, статус онгоинг/анонс/вышел — свой, жанры — зелёный)
   остаётся только в цвете текста поверх одного и того же стекла. */
/* ── Milk glass пилюли ──
   Тот же материал, что у .card-list-badge/.card-rating-badge на
   карточках: молочно-белое полупрозрачное стекло (двухслойный фон —
   тонкая молочная плёнка поверх постоянной тёмной подложки), сильный
   blur+saturate, тонкая белая обводка. Раньше у этих пилюль фон был
   просто плоской полупрозрачной заливкой без blur — сама "оболочка"
   не была стеклянной, только цвет текста менялся по роли. Теперь
   стеклянный именно фон/обводка каждой пилюли.
   Цвет текста — через переменные темы (--text-muted/--green/--blue),
   НЕ захардкоженные hex: сайт поддерживает несколько цветовых тем
   (см. js/site-themes.js), которые переопределяют эти переменные
   (например, "cyber-blue" красит --text-muted в синеватый). Раньше
   тут стояли фиксированные hex-цвета — из-за этого пилюли переставали
   подстраиваться под активную тему и оттенок "плыл" по сравнению с
   остальным текстом на странице, использующим те же переменные. */
.tt-meta-pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  font-family: 'Rajdhani', sans-serif;
  color: var(--text-muted);
  background:
    linear-gradient(rgba(240,240,245,0.16), rgba(240,240,245,0.16)),
    rgba(10,10,14,0.45);
  border: 1px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 4px 12px -2px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.15);
    0 2px 8px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.12);
  border-radius: var(--radius-xs);
  padding: 2px 8px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
}
.tt-status-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-family: 'Rajdhani', sans-serif;
  background:
    linear-gradient(rgba(240,240,245,0.16), rgba(240,240,245,0.16)),
    rgba(10,10,14,0.45);
  border: 1px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 4px 12px -2px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.15);
    0 2px 8px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 2px 10px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
}
.tt-status-airing  { color: var(--green); }
.tt-status-announce{ color: var(--blue); }
.tt-status-done    { color: var(--text-muted); }

.tt-genres { display: flex; flex-wrap: wrap; gap: 5px; }
.tt-genre-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--green-dim);
  background:
    linear-gradient(rgba(240,240,245,0.16), rgba(240,240,245,0.16)),
    rgba(10,10,14,0.45);
  border: 1px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 4px 12px -2px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.15);
    0 2px 8px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 2px 11px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
}

.tt-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--border);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 100px 20px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 2.2;
  animation: fadeUp 0.4s ease both;
}
.empty-state.hidden { display: none; }
.empty-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.3; color: var(--green); }
.empty-state-img {
  display: block;
  margin: 0 auto;
  max-width: 220px;
  width: 100%;
  height: auto;
  opacity: 0.85;
  border-radius: 12px;
}

/* ===== DETAIL SECTION ===== */
#detailSection.hidden { display: none; }
#listsSection.hidden { display: none; }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  padding: 4px 0;
  min-height: auto;
  border-radius: 0;
  cursor: pointer;
  font-size: 15px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Rajdhani', sans-serif;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: none;
  margin-bottom: 24px;
  transition: color var(--t-fast), opacity var(--t-fast);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 2;
}

.back-btn:hover {
  color: #ffffff;
  border-color: transparent;
  background: none;
  box-shadow: none;
}

.detail-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: start;
  animation: fadeUp 0.45s ease both;
}

.detail-poster-col {
  position: sticky;
  top: 88px;
}

.poster-glow-wrap { position: relative; }

.poster-glow-wrap::after {
  content: '';
  position: absolute;
  inset: -10px;
  background: radial-gradient(circle at center, rgba(232,232,232,0.1) 0%, transparent 70%);
  pointer-events: none;
  border-radius: var(--radius);
  animation: posterPulse 4s ease infinite;
}

@keyframes posterPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.detail-poster {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.28);
  display: block;
  object-fit: cover;
  aspect-ratio: 2/3;
  background: var(--bg-card2);
  position: relative;
  z-index: 1;
  transition: box-shadow var(--t-med);
  box-shadow:
    0 8px 40px rgba(0,0,0,0.7),
    inset 0 1px 0 rgba(255,255,255,0.12);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-tap-highlight-color: transparent;
}

.detail-poster:hover {
  box-shadow: 0 0 40px rgba(232,232,232,0.18), 0 8px 40px rgba(0,0,0,0.7);
}

/* =====================================================
   DETAIL POSTER FLIP — переворот фото тайтла на странице
   аниме (рядом с плеером): на обратной стороне — жанры,
   статус, краткое описание и просмотры.
   ===================================================== */
.poster-glow-wrap {
  perspective: 1600px;
}

.detail-poster-flip {
  position: relative;
  width: 100%;
  aspect-ratio: 2/3;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0.1, 0.2, 1);
  will-change: transform;
  cursor: pointer;
  /* backface-visibility на самом контейнере не даёт промежуточным углам
     поворота (когда проекция элемента по ширине почти равна нулю)
     "терять" hover и тут же ловить его заново — именно это вызывало
     дёрганье на полпути переворота. */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Триггер поворота управляется только через JS-класс is-flipped
   (с debounce 200мс), чтобы исключить дёрганье при быстром движении мыши.
   CSS :hover намеренно убран — вместо него mouseenter/mouseleave в detail.js */
.detail-poster-flip.is-flipped {
  transform: rotateY(180deg);
}

@media (prefers-reduced-motion: reduce) {
  .detail-poster-flip { transition: none !important; }
}

.detail-poster-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius);
}

.detail-poster-face-front {
  transform: rotateY(0deg);
  background: var(--bg-card2);
}

/* ── Poster flip hint ── */
.poster-flip-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  z-index: 10;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.poster-flip-hint.pfh-hidden {
  opacity: 0;
  pointer-events: none;
}

.pfh-arrow {
  width: 36px;
  height: 36px;
  color: var(--green, #e8e8e8);
  filter: drop-shadow(0 0 8px rgba(232,232,232,0.7));
  animation: pfh-spin 1.8s ease-in-out infinite;
}

.pfh-arrow svg {
  width: 100%;
  height: 100%;
}

.pfh-text {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 8px rgba(232,232,232,0.8), 0 1px 4px rgba(0,0,0,0.9);
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.55);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(232,232,232,0.25);
  backdrop-filter: blur(4px);
}

@keyframes pfh-spin {
  0%   { transform: rotate(0deg) scale(1); }
  30%  { transform: rotate(15deg) scale(1.1); }
  60%  { transform: rotate(-10deg) scale(0.95); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Hide hint on mobile (flip is disabled there) */
@media (max-width: 768px) {
  .poster-flip-hint { display: none; }
}



.detail-poster-face-front .detail-poster {
  width: 100%;
  height: 100%;
}

/* Бейдж статуса просмотра ("СМОТРЮ"/"ПРОСМОТРЕНО"/...) на постере
   detail-страницы — та же "молочно-стеклянная" капсула, что и
   .card-list-badge на обычных карточках каталога/поиска (см. buildCard()
   в js/search.js и подробный комментарий у .card-list-badge выше):
   полупрозрачная светлая подложка с сильным blur+saturate, тонкая белая
   обводка, мягкий верхний блик, точка-индикатор слева от текста — цвет
   роли (розовый/голубой/оранжевый/...) остаётся только в цвете текста и
   точки (см. .badge-watching/.badge-watched/... выше), а не сплошной
   цветной заливкой капсулы. "Любимое"/"Избранное" сюда намеренно НЕ
   попадают — на этой странице статус уже виден через активную кнопку
   "ЛЮБИМОЕ"/"ИЗБРАННОЕ" в левой панели (см. applyDetailFavoriteGlow в
   js/detail.js), а оценка не дублируется здесь вовсе — она уже показана
   в блоке .dpb-score под описанием. */
.detail-poster-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 4;
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 6px 15px;
  border-radius: 999px;
  text-transform: uppercase;
  background:
    linear-gradient(rgba(240,240,245,0.16), rgba(240,240,245,0.16)),
    rgba(10,10,14,0.45);
  border: 1px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  box-shadow:
    0 6px 18px -2px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.2);
  text-shadow:
    0 1px 2px rgba(0,0,0,0.9),
    0 0 10px rgba(0,0,0,0.5);
  max-width: calc(100% - 28px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Точка-индикатор — тот же приём, что и у .card-list-badge::before,
   currentColor подхватывает цвет роли текущего статуса автоматически. */
.detail-poster-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  box-shadow: 0 0 4px currentColor;
}

/* Цвет роли — берём из тех же общих классов .badge-watching/.badge-watched/
   .badge-planned/.badge-dropped, что и .card-list-badge на карточках
   каталога (см. определения этих классов выше), чтобы палитра статусов
   была единой на всём сайте и не дублировалась второй раз здесь. */

.detail-poster-face-back {
  transform: rotateY(180deg);
  background: var(--bg-card2);
  background-image: var(--grad-card);
  border: 1px solid var(--border-hl);
  box-shadow: 0 8px 40px rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  padding: 16px;
  overflow: hidden;
  font-family: 'Rajdhani', sans-serif;
  gap: 12px;
}

/* ── Top: status badge ── */
.dpb-top {
  display: flex;
  align-items: center;
}

/* ── Milk glass ──
   Тот же материал, что у .genre-tag/.tt-status-pill/.card-list-badge:
   молочно-белое полупрозрачное стекло, сильный blur+saturate, тонкая
   белая обводка. Цвет роли (онгоинг/анонс/вышел) — через переменные
   темы (--green/--blue/--text-muted), не хардкод, чтобы подстраивался
   под активную цветовую тему сайта (см. js/site-themes.js). */
.dpb-status {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 6px;
  background:
    linear-gradient(rgba(240,240,245,0.16), rgba(240,240,245,0.16)),
    rgba(10,10,14,0.45);
  border: 1px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  box-shadow:
    0 4px 12px -2px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.15);
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
}
.dpb-status.is-airing   { color: var(--green); }
.dpb-status.is-announce { color: var(--blue); }
.dpb-status.is-done     { color: var(--text-muted); }

/* ── Score block ── */
.dpb-score-block {
  display: flex;
  align-items: baseline;
  gap: 6px;
  position: relative;
  padding: 12px 14px 14px;
  background: var(--scbg, rgba(232,232,232,0.06));
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  overflow: hidden;
}

.dpb-score-num {
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--sc, #e8e8e8);
  line-height: 1;
  text-shadow: 0 0 20px color-mix(in srgb, var(--sc, #e8e8e8) 50%, transparent);
}

.dpb-score-outof {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dim);
  padding-bottom: 2px;
}

/* thin accent line at bottom of score block */
.dpb-score-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  max-width: 100%;
  background: linear-gradient(90deg, var(--sc, #e8e8e8), transparent);
  border-radius: 0 2px 2px 0;
}

/* ── Divider ── */
.dpb-divider {
  height: 1px;
  background: var(--border);
  flex-shrink: 0;
}

/* ── Info rows ── */
.dpb-rows {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.dpb-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.dpb-row-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.dpb-row-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: right;
}

/* CSS :hover для poster flip убран — переворот управляется только через JS.
   Тач-устройства используют клик (см. wireDetailPosterFlip в detail.js) */

/* ── Золотая/сиреневая обводка постера и инфо-виджета для
   Любимого/Избранного убрана по просьбе пользователя — статус на
   странице аниме и так виден через активную кнопку "ЛЮБИМОЕ"/
   "ИЗБРАННОЕ" в левой панели (см. .list-btn.active ниже), отдельного
   свечения вокруг постера/виджетов больше нет. */

.detail-meta {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
  font-size: 13px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-family: 'Rajdhani', sans-serif;
  backdrop-filter: blur(min(12px, var(--pf-cap, 999px)));
  transition: border-color var(--t-med), box-shadow var(--t-med);
}

/* Золотая/сиреневая/комбо обводка инфо-виджета убрана по той же
   просьбе — .detail-meta теперь всегда с обычной нейтральной рамкой
   (см. базовое правило .detail-meta выше), независимо от статуса. */

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  transition: background var(--t-fast);
}
.meta-row:last-child { border-bottom: none; }
.meta-row:hover { background: rgba(232,232,232,0.04); }

.meta-label { color: var(--text-muted); letter-spacing: 0.8px; font-weight: 700; text-transform: uppercase; font-size: 10px; }
.meta-value { color: var(--green); font-weight: 700; text-align: right; font-size: 12px; }

/* ── My list buttons — Modern Glass & Vibrant Accents Redesign ── */
.my-list-btns {
  margin-top: 18px;
  width: 100%;
}

.my-list-label {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: none;
  border: none;
  padding: 0;
  width: 100%;
  cursor: default;
  text-align: left;
  user-select: none;
  -webkit-user-select: none;
}

.my-list-label-content {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.my-list-label-content::before {
  content: '';
  display: block;
  width: 14px;
  height: 2px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.my-list-title-text {
  white-space: nowrap;
}

/* Бейдж активного статуса при свёрнутом виде на мобильных */
.my-list-active-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: none;
  padding: 2px 6px;
  border-radius: 20px;
  background: rgba(6, 182, 212, 0.16);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: #22d3ee;
  white-space: nowrap;
  flex-shrink: 0;
  animation: fadeIn 0.25s ease;
}

.my-list-active-badge.hidden {
  display: none !important;
}

/* Стрелка-индикатор раскрытия: на десктопе скрыта */
.my-list-toggle-arrow {
  display: none;
}

.my-list-row {
  display: flex;
  flex-direction: column;
}

.my-list-row-inner {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* ── Карточки статусов (.list-btn) ── */
.list-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 14px;
  min-height: 48px;
  border-radius: 13px;
  cursor: pointer;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.015) 100%),
    rgba(16, 18, 24, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.15px;
  color: rgba(255, 255, 255, 0.75);
  text-transform: none;
  text-align: left;
  outline: none;
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    color 0.2s ease,
    box-shadow 0.22s ease,
    transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}

/* Иконка статуса слева */
.list-btn .btn-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.6);
  transition: all 0.22s ease;
}

.list-btn .btn-icon svg {
  display: block;
  transition: transform 0.2s ease;
}

/* Название статуса */
.list-btn .btn-label {
  flex: 1 1 auto;
  position: relative;
  z-index: 1;
  line-height: 1.25;
}

/* Индикатор чекбокса справа */
.list-btn .btn-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: auto;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.22s ease, transform 0.26s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.list-btn .btn-check svg {
  display: block;
}

/* Интерактивность при тапе / клике */
.list-btn:active {
  transform: scale(0.975);
}

@media (hover: hover) {
  .list-btn:hover {
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.03) 100%),
      rgba(20, 23, 32, 0.85);
    border-color: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
  }
  .list-btn:hover .btn-icon {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    transform: scale(1.05);
  }
}

/* Активное общее состояние */
.list-btn.active {
  color: #ffffff;
}

.list-btn.active .btn-check {
  opacity: 1;
  transform: scale(1);
}

/* ══════════════════════════════════════════════════════
   ИНДИВИДУАЛЬНЫЕ ЦВЕТОВЫЕ СТИЛИ СТАТУСОВ
   ══════════════════════════════════════════════════════ */

/* 1. Смотрю (Watching) — Cyan / Teal Neon */
.list-btn[data-status="watching"] .btn-icon {
  color: #22d3ee;
}
.list-btn[data-status="watching"].active {
  background:
    linear-gradient(135deg, rgba(6, 182, 212, 0.18) 0%, rgba(6, 182, 212, 0.04) 100%),
    rgba(12, 22, 30, 0.82);
  border-color: rgba(6, 182, 212, 0.45);
  box-shadow: 0 4px 18px rgba(6, 182, 212, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.list-btn[data-status="watching"].active .btn-icon {
  background: rgba(6, 182, 212, 0.2);
  border-color: rgba(6, 182, 212, 0.45);
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.35);
}
.list-btn[data-status="watching"] .btn-check {
  background: linear-gradient(135deg, #06b6d4, #0284c7);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.6);
}

/* 2. Просмотрено (Watched) — Royal Indigo / Purple */
.list-btn[data-status="watched"] .btn-icon {
  color: #a78bfa;
}
.list-btn[data-status="watched"].active {
  background:
    linear-gradient(135deg, rgba(139, 92, 246, 0.18) 0%, rgba(139, 92, 246, 0.04) 100%),
    rgba(20, 15, 32, 0.82);
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow: 0 4px 18px rgba(139, 92, 246, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.list-btn[data-status="watched"].active .btn-icon {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.45);
  color: #c4b5fd;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.35);
}
.list-btn[data-status="watched"] .btn-check {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.6);
}

/* 3. Буду смотреть (Planned) — Warm Amber */
.list-btn[data-status="planned"] .btn-icon {
  color: #fbbf24;
}
.list-btn[data-status="planned"].active {
  background:
    linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(245, 158, 11, 0.04) 100%),
    rgba(28, 20, 10, 0.82);
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.list-btn[data-status="planned"].active .btn-icon {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fde68a;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
}
.list-btn[data-status="planned"] .btn-check {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}

/* 4. Любимое (Favorite) — Rose / Hot Pink */
.list-btn[data-status="favorite"] .btn-icon {
  color: #fb7185;
}
.list-btn[data-status="favorite"].active {
  background:
    linear-gradient(135deg, rgba(244, 63, 94, 0.18) 0%, rgba(244, 63, 94, 0.04) 100%),
    rgba(30, 14, 20, 0.82);
  border-color: rgba(244, 63, 94, 0.45);
  box-shadow: 0 4px 18px rgba(244, 63, 94, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.list-btn[data-status="favorite"].active .btn-icon {
  background: rgba(244, 63, 94, 0.2);
  border-color: rgba(244, 63, 94, 0.45);
  color: #fecdd3;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.35);
}
.list-btn[data-status="favorite"] .btn-check {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.6);
}

/* 5. Избранное (Favorites 2) — Radiant Gold */
.list-btn[data-status="favorites2"] .btn-icon {
  color: #facc15;
}
.list-btn[data-status="favorites2"].active {
  background:
    linear-gradient(135deg, rgba(234, 179, 8, 0.18) 0%, rgba(234, 179, 8, 0.04) 100%),
    rgba(28, 24, 10, 0.82);
  border-color: rgba(234, 179, 8, 0.45);
  box-shadow: 0 4px 18px rgba(234, 179, 8, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.list-btn[data-status="favorites2"].active .btn-icon {
  background: rgba(234, 179, 8, 0.2);
  border-color: rgba(234, 179, 8, 0.45);
  color: #fef08a;
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.35);
}
.list-btn[data-status="favorites2"] .btn-check {
  background: linear-gradient(135deg, #eab308, #ca8a04);
  color: #0f172a;
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.6);
}

/* 6. Заброшено (Dropped) — Crimson Muted / Coral */
.list-btn[data-status="dropped"] .btn-icon {
  color: #f87171;
}
.list-btn[data-status="dropped"].active {
  background:
    linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.03) 100%),
    rgba(28, 14, 14, 0.82);
  border-color: rgba(239, 68, 68, 0.42);
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.list-btn[data-status="dropped"].active .btn-icon {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.38);
  color: #fca5a5;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.35);
}
.list-btn[data-status="dropped"] .btn-check {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.55);
}

/* ===== DETAIL INFO ===== */
.detail-info-col { min-width: 0; }

/* ── Общая карточка-виджет ──
   Обрамляет ВЕСЬ блок аниме единой плашкой: постер, таймер,
   кнопки списка слева + заголовок, жанры, описание и панель
   плеера справа — в общем стиле сайта (тот же фон/рамка/
   скругление, что у .detail-meta и .anime-card), вместо
   "голых" элементов прямо на фоне страницы. */
.detail-widget-frame {
  background:
    linear-gradient(rgba(240,240,245,0.05), rgba(240,240,245,0.05)),
    var(--bg-glass);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(min(24px, var(--pf-cap, 999px))) saturate(180%);
  -webkit-backdrop-filter: blur(min(24px, var(--pf-cap, 999px))) saturate(180%);
  box-shadow:
    0 8px 32px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.12);
  transition: border-color var(--t-med), box-shadow var(--t-med);
}

/* Золотая/фиолетовая подсветка виджета плеера для Любимого/Избранного
   убрана по той же просьбе — .detail-widget-frame больше не получает
   свою рамку/свечение от статуса (applyDetailFavoriteGlow в
   js/detail.js по-прежнему навешивает классы is-favorite/is-favorites2
   на этот элемент, они просто ничего здесь не рисуют). */

/* Внутренний контейнер заголовка/жанров/описания — больше не
   несёт своей рамки/фона, эту роль теперь играет .detail-widget-frame
   целиком; оставлен только как смысловая группировка + отступ
   перед панелью плеера. */
.detail-info-card {
  margin-bottom: 28px;
}

.detail-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 14px;
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 1px;
}

.detail-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

/* ── Milk glass ──
   Тот же материал, что у .tt-genre-tag в тултипе и у
   .card-list-badge/.card-rating-badge на карточках: молочно-белое
   полупрозрачное стекло (двухслойный фон — тонкая молочная плёнка
   поверх постоянной тёмной подложки), сильный blur+saturate, тонкая
   белая обводка. Цвет текста — через переменную темы (--green-dim),
   не хардкод, чтобы жанры подстраивались под активную цветовую тему
   сайта (см. js/site-themes.js), как и остальной текст. */
.genre-tag {
  background:
    linear-gradient(rgba(240,240,245,0.16), rgba(240,240,245,0.16)),
    rgba(10,10,14,0.45);
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--green-dim);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-family: 'Rajdhani', sans-serif;
  transition: all var(--t-fast);
  backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  box-shadow:
    0 4px 12px -2px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.15);
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
}
.genre-tag:hover {
  background:
    linear-gradient(rgba(240,240,245,0.24), rgba(240,240,245,0.24)),
    rgba(10,10,14,0.45);
  border-color: rgba(255,255,255,0.45);
  color: var(--green);
  transform: none !important;
}

.detail-desc {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.9;
  margin-bottom: 0;
}

/* ── Галерея случайных кадров под описанием ─────────────── */
.detail-screenshots { margin-top: 18px; }
.detail-screenshots.hidden { display: none; }

.shot-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}

.shot-thumb {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card2);
  padding: 0;
  cursor: pointer;
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.shot-thumb:hover {
  border-color: var(--green);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.5), 0 0 0 1px rgba(232,232,232,0.08);
}
.shot-thumb:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.shot-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot-ep-badge {
  position: absolute;
  right: 5px; bottom: 5px;
  background: rgba(10,10,10,0.82);
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 2px 7px;
  border-radius: 20px;
  border: 1px solid rgba(232,232,232,0.2);
}

/* ── BB-code элементы в описании аниме ─────────────────── */
/* Имена персонажей/людей */
.desc-character {
  color: #b8b8b8;
  font-weight: 600;
  background: rgba(200,200,200,0.08);
  border-bottom: 1px solid rgba(200,200,200,0.35);
  padding: 0 3px;
  border-radius: 3px;
  cursor: default;
  transition: background .15s;
}
.desc-character:hover {
  background: rgba(200,200,200,0.16);
}
/* Названия аниме/манги в описании */
.desc-anime-link {
  color: #c0c0c0;
  font-weight: 600;
  border-bottom: 1px dashed rgba(192,192,192,0.4);
  padding: 0 2px;
  border-radius: 3px;
}
/* Ссылки */
.desc-link {
  color: #b8b8b8;
  text-decoration: none;
  border-bottom: 1px solid rgba(200,200,200,0.3);
}
.desc-link:hover { border-bottom-color: #b8b8b8; }
/* Спойлеры */
.desc-spoiler {
  display: inline-block;
  cursor: pointer;
  user-select: none;
}
.desc-spoiler-label {
  font-size: 11px;
  color: #b0b0b0;
  background: rgba(176,176,176,0.12);
  border: 1px solid rgba(176,176,176,0.3);
  border-radius: 4px;
  padding: 1px 7px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.desc-spoiler-text {
  display: none;
  margin-left: 6px;
  color: var(--text-muted);
}
.desc-spoiler.open .desc-spoiler-text { display: inline; }
.desc-spoiler.open .desc-spoiler-label { color: #d0d0d0; }

/* ===== COUNTDOWN ===== */
/* ── Milk glass ──
   Тот же материал, что у .genre-tag/.list-btn/.card-list-badge:
   молочно-белое полупрозрачное стекло, сильный blur+saturate, тонкая
   белая обводка. Раньше фон был плоским зелёным градиентом почти без
   блюра — левая зелёная полоса (border-left) сохранена как акцент,
   отличающий именно таймер от остальных стеклянных блоков. */
.detail-countdown {
  background:
    linear-gradient(rgba(240,240,245,0.1), rgba(240,240,245,0.1)),
    rgba(10,10,14,0.5);
  border: 1px solid rgba(255,255,255,0.28);
  border-left: 3px solid var(--green);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-top: 28px;
  margin-bottom: 22px;
  backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  box-shadow:
    0 4px 12px -2px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.15);
}
.countdown-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.countdown-timer { display: flex; align-items: flex-end; gap: 0; margin-bottom: 10px; }
.cd-unit { display: flex; flex-direction: column; align-items: center; width: 56px; }
.cd-num {
  font-size: 34px;
  font-weight: 800;
  color: var(--green);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}
.cd-lbl { font-size: 9px; color: var(--text-muted); letter-spacing: 0.8px; text-transform: uppercase; margin-top: 5px; font-weight: 700; }
.cd-sep { font-size: 26px; font-weight: 700; color: rgba(232,232,232,0.3); line-height: 1; padding-bottom: 18px; width: 16px; text-align: center; }
.countdown-date { font-size: 12px; color: var(--text-muted); opacity: 0.6; }
.cd-already { font-size: 28px; font-weight: 800; color: var(--green); letter-spacing: 0.5px; }

/* ===== PLAYER ===== */
.player-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  transition: box-shadow var(--t-med);
}
.player-wrap:not(.hidden) { box-shadow: 0 0 40px rgba(232,232,232,0.05); }
.player-wrap.hidden { display: none; }

.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg-card2);
}

.player-ep-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.player-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
}

.video-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

/* Nav btn */
.nav-btn {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  letter-spacing: 1px;
  transition: all var(--t-fast);
}
.nav-btn:hover { border-color: var(--border-hl); color: var(--green); }

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none; /* FIX: не перехватываем клики под тостом */
}

.toast {
  pointer-events: auto; /* сами тосты можно кликать (если нужно) */
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green);
  color: var(--text);
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7), 0 0 20px rgba(232,232,232,0.06);
  animation: toastIn 0.35s ease both;
  min-width: 230px;
  max-width: 360px;
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
}

.toast.toast--error {
  border-left-color: #ff3366;
}

.toast.toast--warn {
  border-left-color: #ffb800;
}

.toast.toast--success {
  border-left-color: #00ffb3;
}

.toast.toast--info {
  border-left-color: rgba(255, 255, 255, 0.45);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

.toast.fade-out { animation: toastOut 0.3s ease both; }

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(40px); }
}

/* ===== EPISODES SECTION ===== */
.episodes-section { margin-top: 8px; }
.episodes-section.hidden { display: none; }

.episodes-heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 14px;
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 2.5px;
  text-transform: uppercase;
}

.episodes-grid { display: block; }

.video-controls {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.dub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.dub-tab {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 14px;
  font-size: 12px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.dub-tab:hover { border-color: var(--border-hl); color: var(--green); }
.dub-tab.active { background: rgba(232,232,232,0.08); border-color: rgba(232,232,232,0.4); color: var(--green); }

.player-pill {
  background: var(--bg-card2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 14px;
  font-size: 11px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--t-fast);
}
.player-pill:hover { border-color: var(--border-hl); color: var(--green); }
.player-pill.active { background: var(--green); color: #000; border-color: var(--green); }

.player-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.player-row-label, .selector-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
}

.episodes-grid-inner { position: relative; padding: 14px 0 6px; }
.ep-track-line { position: absolute; top: 27px; left: 14px; right: 14px; height: 2px; background: var(--border); border-radius: 2px; pointer-events: none; }
.ep-track-fill { position: absolute; left: 0; top: 0; height: 100%; background: var(--green); border-radius: 2px; opacity: 0.3; transition: width 0.35s cubic-bezier(0.34,1.56,0.64,1); }

.ep-dots-row { display: flex; flex-wrap: wrap; gap: 5px; position: relative; z-index: 1; }

.ep-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-card2);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 10px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  flex-shrink: 0;
}
.ep-btn:hover { border-color: var(--border-hl); color: var(--green); transform: scale(1.25); z-index: 2; }
.ep-btn.active { background: rgba(232,232,232,0.1); border-color: var(--green); color: var(--green); font-weight: 700; transform: scale(1.3); box-shadow: 0 0 0 3px rgba(232,232,232,0.1); z-index: 3; }
.ep-btn.ep-seen { background: rgba(232,232,232,0.03); border-color: rgba(232,232,232,0.1); }
.ep-btn.ep-seen::after { content: ''; position: absolute; bottom: 2px; right: 2px; width: 4px; height: 4px; background: var(--green); border-radius: 50%; opacity: 0.6; }

.ep-nav-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.ep-active-label { font-size: 10px; color: var(--text-muted); letter-spacing: 2px; text-transform: uppercase; font-family: 'Rajdhani', sans-serif; font-weight: 700; }
.ep-active-num { font-size: 24px; font-weight: 700; color: var(--green); font-family: 'Rajdhani', sans-serif; line-height: 1; min-width: 32px; }
.ep-total { font-size: 11px; color: var(--text-muted); font-family: 'Rajdhani', sans-serif; font-weight: 600; opacity: 0.5; }
.ep-arrow { width: 28px; height: 28px; border-radius: var(--radius-xs); background: var(--bg-card2); border: 1px solid var(--border); color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 13px; transition: all var(--t-fast); margin-left: auto; font-family: monospace; }
.ep-arrow + .ep-arrow { margin-left: 4px; }
.ep-arrow:hover { border-color: var(--border-hl); color: var(--green); }
.ep-arrow:active { transform: scale(0.88); }
.ep-arrow:disabled { opacity: 0.2; cursor: default; }

.no-video-msg { padding: 28px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-muted); font-size: 14px; text-align: center; font-family: 'Rajdhani', sans-serif; letter-spacing: 1px; }
.no-video-msg.hidden { display: none; }

/* ===== SEASONS ===== */
.seasons-section { margin-top: 28px; }
.seasons-section.hidden { display: none; }

.seasons-heading {
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* Тот же размер карточек, что и в основном каталоге (.anime-grid,
   --poster-min-width — 165px по умолчанию), для единообразия постеров
   по всему сайту. Блок теперь горизонтальная карусель (см. .grid-carousel
   в style.css / initGridCarousel в js/utils.js, вызывается из
   loadAndRenderSeasons() в js/detail.js), поэтому лишние тайтлы одной
   франшизы уходят не в перенос строк, а в горизонтальную прокрутку. */
.seasons-grid { display: grid; grid-template-columns: repeat(auto-fill, var(--poster-min-width, 165px)); gap: 14px; }

/* Карточки внутри — обычные .anime-card (см. buildCard() в js/search.js
   и рендер в loadAndRenderSeasons() в js/detail.js), поэтому весь их
   внешний вид (постер, капсулы статуса/рейтинга, подпись "Любимое"/
   "Избранное", ховер- и тап-эффекты) наследуется автоматически и не
   дублируется здесь. Ниже — только то немногое, что специфично именно
   для карточки сезона и накладывается ПОВЕРХ обычной карточки: обводка
   текущего открытого сезона, нижняя плашка "Сейчас смотрите" и метка
   порядка просмотра. */

/* ===== ТЕКУЩИЙ СЕЗОН (выделение в блоке "Другие сезоны") ===== */
.anime-card.is-current-season {
  border: 2px solid var(--green) !important;
  box-shadow: none !important;
}
.anime-card.is-current-season:hover {
  border-color: var(--green) !important;
  box-shadow: none !important;
}

/* ===== СЕЙЧАС СМОТРИТЕ — нижняя полоса нового формата =====
   z-index выше, чем у .card-body (2) — иначе градиентная подложка
   названия карточки (которая тоже лежит внизу поверх постера, см.
   .card-body) перекрывает эту плашку и делает надпись нечитаемой. */
.season-current-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 8, 6, 0.82);
  backdrop-filter: blur(min(10px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(10px, var(--pf-cap, 999px)));
  color: #e8e8e8;
  font-family: 'Rajdhani', sans-serif;
  font-size: var(--season-current-badge-font, 9px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  text-align: center;
  padding: var(--season-current-badge-padding, 7px 6px 6px);
  border-radius: 0 0 var(--radius) var(--radius);
  z-index: 5;
  border-top: 1px solid rgba(232,232,232,0.25);
  box-shadow: 0 -4px 16px rgba(232,232,232,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  overflow: hidden;
}

/* Живая точка-индикатор */
.season-current-badge::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  background: #e8e8e8;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px #e8e8e8, 0 0 12px rgba(232,232,232,0.6);
  animation: scb-dot-pulse 1.6s ease-in-out infinite;
}

/* Анимированная полоска-сканер */
.season-current-badge::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(232,232,232,0.12), transparent);
  animation: scb-scan 2.4s linear infinite;
  pointer-events: none;
}

@keyframes scb-dot-pulse {
  0%, 100% { opacity: 1;   box-shadow: 0 0 6px #e8e8e8, 0 0 12px rgba(232,232,232,0.6); }
  50%       { opacity: 0.4; box-shadow: 0 0 2px #e8e8e8, 0 0 4px  rgba(232,232,232,0.2); }
}
@keyframes scb-scan {
  0%   { left: -60%; }
  100% { left: 140%; }
}

/* Карточка текущего сезона: название/год/тип (.card-body) обычно лежат
   градиентной подложкой прямо на нижнем крае постера (см. .card-body в
   основных стилях .anime-card) — там же снизу теперь садится и плашка
   "Сейчас смотрите". Поднимаем текст выше плашки, добавляя ему запас
   снизу размером в высоту самой плашки, чтобы название и метаданные не
   перекрывались и оставались читаемыми одновременно с плашкой. */
.anime-card.is-current-season .card-body {
  padding-bottom: 34px;
}

/* Если у карточки одновременно есть бейдж "сейчас смотрите" — прячем
   рейтинг-звёздочку в углу постера, чтобы не перекрывались (нижняя
   плашка и так занимает всю ширину постера). Плашка — сосед .card-body,
   а не потомок .card-poster-wrap (см. loadAndRenderSeasons в
   js/detail.js), поэтому проверяем :has() на уровне самой карточки. */
.anime-card:has(.season-current-badge) .card-rating-badge { display: none; }

/* Метка порядка просмотра ("Сезон 1", "Фильм" и т.п. — из viewing_order,
   см. loadAndRenderSeasons() в js/detail.js), показывается над названием
   карточки только когда источник данных её прислал. */
.season-order-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--green-dim);
  margin-bottom: 3px;
}

/* ===== IMPORT NAV BUTTON ===== */
.nav-tab-import {
  border-color: rgba(232,232,232,0.2);
  color: var(--green-dim);
  background: rgba(232,232,232,0.04);
}
.nav-tab-import:hover {
  background: rgba(232,232,232,0.1);
  border-color: var(--border-hl);
  color: var(--green);
}

/* =====================================================
   MODAL — premium glassmorphism
   ===================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 12, 0.78);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(min(18px, var(--pf-cap, 999px))) saturate(1.2);
  animation: fadeIn 0.25s ease;
}
.modal-overlay.hidden { display: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== Flat card (вариант 6): без объёма и свечения,
   акцентный бордер слева вместо рамки со всех сторон ===== */
.modal-box {
  background: #131313;
  border: none;
  border-left: 3px solid rgba(255,255,255,0.7);
  border-radius: 4px;
  width: 100%;
  max-width: 480px;
  margin: 20px;
  box-shadow: none;
  animation: slideUp 0.35s cubic-bezier(0.34, 1.3, 0.64, 1);
  overflow: hidden;
  position: relative;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  position: relative;
}

.modal-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 700;
  background: none;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: var(--text);
  background-clip: initial;
  color: var(--text);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.modal-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  border-radius: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--t-fast), transform var(--t-fast);
  line-height: 1;
  box-shadow: none;
}
.modal-close:hover {
  color: #ffffff;
  background: transparent;
  transform: scale(1.15);
}
.modal-close:active {
  transform: scale(0.92);
  color: rgba(255, 255, 255, 0.8);
}

/* Текстовая кнопка "Закрыть" — не круглая, не вращается на hover.
   Размеры жёстко зафиксированы (height/min-width), чтобы догрузка
   веб-шрифта или любой другой reflow не могли сдвинуть кнопку. */
.modal-close-text {
  position: static;
  font-family: 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 0 20px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted);
  width: auto;
  height: 38px;
  min-width: 96px;
  box-sizing: border-box;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.modal-close-text:hover {
  color: var(--green);
  background: rgba(232,232,232,0.1);
  border-color: rgba(232,232,232,0.3);
  transform: translateY(-2px);
}

.modal-body { padding: 24px 26px; }
.modal-desc { font-size: 13px; color: var(--text-muted); line-height: 1.7; margin-bottom: 18px; }

.import-field { margin-bottom: 14px; }
.import-label {
  display: block;
  font-size: 10px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.import-input {
  width: 100%;
  background: #0c0c0c;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-family: 'Rajdhani', sans-serif;
  outline: none;
  transition: border-color var(--t-med), background var(--t-med);
}
.import-input:focus { border-color: rgba(232,232,232,0.4); background: #0e0e0e; }
.import-input::placeholder { color: var(--text-muted); }

.import-status {
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}
.import-status.hidden { display: none; }
.import-status--loading { background: rgba(207,207,207,0.07); border: 1px solid rgba(207,207,207,0.2); color: #cfcfcf; }
.import-status--success { background: rgba(232,232,232,0.07); border: 1px solid rgba(232,232,232,0.2); color: var(--green); }
.import-status--error   { background: rgba(255,60,60,0.07);  border: 1px solid rgba(255,60,60,0.2);  color: #ff6b6b; }
.import-status--info    { background: rgba(232,232,232,0.04); border: 1px solid var(--border); color: var(--text-muted); }

.modal-actions { display: flex; gap: 10px; }

/* .import-btn — единая "первичная" кнопка (Сохранить / Импорт /
   Экспорт / Очистить данные и т.п.) по всему сайту: общий вид,
   тактильный отклик на нажатие (лёгкое сжатие) и мягко-зелёное
   подтверждение через класс .saved (см. showSavedFeedback() в
   js/utils.js) — как в согласованном демо "Variant 1 + Save button". */
.import-btn {
  flex: 1;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.9);
  color: #0c0c0c;
  padding: 12px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.import-btn:hover {
  background: #fff;
  border-color: #fff;
}
.import-btn:active { transform: scale(0.98); }
.import-btn.saved {
  background: #cdeecb;
  border-color: #cdeecb;
  color: #0c0c0c;
  box-shadow: 0 8px 24px rgba(160,230,150,0.25);
}
/* .cleared — тот же тактильный flash-паттерн, что .saved, но для
   разрушительных действий (удаление данных): нейтрально-красный
   вместо зелёного, чтобы не читаться как "успех/похвала". Используется
   только на кнопке "Очистить выбранные" (runClear в js/import-export.js). */
.import-btn.cleared {
  background: rgba(255,60,60,0.22) !important;
  border-color: rgba(255,60,60,0.45) !important;
  color: #ff8080 !important;
  box-shadow: 0 8px 24px rgba(255,60,60,0.18);
}

.import-cancel {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted);
  padding: 12px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all var(--t-fast);
}
.import-cancel:hover { border-color: rgba(232,232,232,0.25); color: var(--green); background: rgba(232,232,232,0.04); }

/* ===== FOOTER ===== */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 44px 24px 32px;
  font-size: 12px;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 1px;
  background: rgba(14, 15, 24, 0.58);
  backdrop-filter: blur(min(28px, var(--pf-cap, 999px))) saturate(190%);
  -webkit-backdrop-filter: blur(min(28px, var(--pf-cap, 999px))) saturate(190%);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-logo {
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  font-weight: 900;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 2.5px;
}

/* --- Три колонки: ресурсы / инфо о сайте / поддержка ---
   Используется max-width контейнер, чтобы на широких экранах колонки не
   растягивались во всю ширину, а держались ближе друг к другу, как на
   референсе. */
.footer-inner--grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(180px, 260px) minmax(220px, 320px);
  justify-content: space-between;
  gap: 32px 40px;
  text-align: left;
  align-items: start;
}

.footer-col-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text);
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.footer-link-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer-link-list a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12.5px;
  letter-spacing: .5px;
  transition: color var(--t-fast);
}

.footer-link-list a:hover {
  color: var(--text);
}

.footer-social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.footer-social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(180%);
  -webkit-backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(180%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
  transform: none !important;
}

.footer-social-icon svg {
  width: 20px;
  height: 20px;
  color: #37AEE2;
  transition: color var(--t-fast);
}

.footer-social-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transform: none !important;
}

.footer-social-icon:hover svg {
  color: #58c8fa;
}

.footer-social-icon:active {
  transform: none !important;
  opacity: 0.85;
}

.footer-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 230px;
}

.footer-disclaimer-badge {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', monospace;
  font-weight: 900;
  font-size: 13px;
  color: var(--text-dim);
}

.footer-disclaimer p {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-dim);
  letter-spacing: .3px;
}

.footer-contact-line {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-top: 12px;
}

.footer-contact-line a {
  color: var(--green-dim);
  text-decoration: none;
}

.footer-contact-line a:hover {
  color: var(--text);
  text-decoration: underline;
}

.footer-bottom {
  max-width: 1100px;
  margin: 28px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  text-align: center;
}

@media (max-width: 860px) {
  .footer-inner--grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-col:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .footer-inner--grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }
  .footer-disclaimer {
    max-width: none;
  }
}


/* ── CATALOG: iOS Large Title Header ── */
#catalogSection .list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
#catalogSection .list-header::after {
  display: none !important;
}
#catalogSection .list-page-title {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Rajdhani', sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.4px;
  text-transform: none;
  background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0.76) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}
#catalogSection .list-subtitle,
#catalogSection #catalogSubtitle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 1px solid rgba(255, 255, 255, 0.24);
  color: rgba(255, 255, 255, 0.75);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Rajdhani', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  margin: 0;
}
@media (max-width: 600px) {
  #catalogSection .list-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 18px;
    padding-bottom: 14px;
  }
  #catalogSection .list-page-title {
    font-size: 22px;
  }
}

/* =====================================================
   FILTER PANEL — iOS Glassmorphism & Fluid Animation
   ===================================================== */
.filter-wrap {
  margin: 0 0 28px 0;
  position: relative;
  z-index: 50;
}

.filter-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.03) 100%),
    rgba(18, 20, 26, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--green);
  font-family: 'Rajdhani', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 11px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(min(24px, var(--pf-cap, 999px))) saturate(190%);
  -webkit-backdrop-filter: blur(min(24px, var(--pf-cap, 999px))) saturate(190%);
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.filter-toggle-btn:hover {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.06) 100%),
    rgba(26, 29, 38, 0.72);
  border-color: rgba(255, 255, 255, 0.28);
  border-top-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}
.filter-toggle-btn:active {
  transform: scale(0.96);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.filter-toggle-btn svg {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}
.filter-toggle-btn.open {
  background:
    linear-gradient(135deg, rgba(74, 222, 128, 0.2) 0%, rgba(34, 197, 94, 0.08) 100%),
    rgba(18, 24, 22, 0.7);
  border-color: rgba(74, 222, 128, 0.35);
  border-top-color: rgba(255, 255, 255, 0.35);
  color: var(--green);
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.filter-toggle-btn.open:hover {
  box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.filter-toggle-btn.open svg {
  transform: rotate(180deg);
}

.filter-panel {
  margin-top: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%),
    rgba(18, 20, 26, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 24px;
  padding: 24px 26px 20px;
  position: relative;
  z-index: 50;
  backdrop-filter: blur(min(28px, var(--pf-cap, 999px))) saturate(190%) contrast(105%);
  -webkit-backdrop-filter: blur(min(28px, var(--pf-cap, 999px))) saturate(190%) contrast(105%);
  box-shadow:
    0 20px 50px -10px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.3);
  transform-origin: top center;
  box-sizing: border-box;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px 22px;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.filter-label {
  font-family: 'Rajdhani', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: rgba(255, 255, 255, 0.52);
  text-transform: uppercase;
  margin-left: 2px;
}

.filter-select {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%),
    rgba(12, 13, 18, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  color: #f3f3f6;
  font-family: 'Rajdhani', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13.5px;
  padding: 10px 14px;
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  outline: none;
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.12);
}
.filter-select:focus {
  border-color: rgba(74, 222, 128, 0.5);
  border-top-color: rgba(74, 222, 128, 0.65);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.04) 100%),
    rgba(15, 17, 24, 0.65);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.16), inset 0 1px 2px rgba(0, 0, 0, 0.2);
}
.filter-select option {
  background: #181920;
  color: #f0f0f5;
  padding: 8px;
}

.filter-year-row { display: flex; align-items: center; gap: 8px; }
.filter-year-input {
  width: 80px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%),
    rgba(12, 13, 18, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  color: #f3f3f6;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13.5px;
  padding: 10px 12px;
  border-radius: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
}
.filter-year-input:focus {
  border-color: rgba(74, 222, 128, 0.5);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.16);
}
.filter-year-sep { color: var(--text-muted); font-size: 12px; }

.filter-tags-input {
  width: 100%;
  box-sizing: border-box;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%),
    rgba(12, 13, 18, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  color: #f3f3f6;
  font-family: 'Rajdhani', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13.5px;
  padding: 10px 14px;
  border-radius: 14px;
  outline: none;
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.filter-tags-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}
.filter-tags-input:focus {
  border-color: rgba(74, 222, 128, 0.5);
  border-top-color: rgba(74, 222, 128, 0.65);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.04) 100%),
    rgba(15, 17, 24, 0.65);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.16), inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.filter-tags-selected { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background:
    linear-gradient(135deg, rgba(74, 222, 128, 0.2) 0%, rgba(34, 197, 94, 0.1) 100%),
    rgba(15, 20, 18, 0.55);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  color: #4ade80;
  font-family: 'Rajdhani', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  backdrop-filter: blur(min(12px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(12px, var(--pf-cap, 999px)));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.filter-tag-remove { background: none; border: none; color: #4ade80; cursor: pointer; font-size: 11px; padding: 0; line-height: 1; opacity: 0.75; transition: opacity var(--t-fast); }
.filter-tag-remove:hover { opacity: 1; }

/* Genre picker */
.genre-picker { position: relative; }
.genre-picker-btn {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%),
    rgba(12, 13, 18, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.7);
  font-family: 'Rajdhani', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.12);
}
.genre-picker-btn:hover {
  border-color: rgba(255, 255, 255, 0.26);
  color: #fff;
}
.genre-picker-btn.has-selection {
  border-color: rgba(74, 222, 128, 0.4);
  color: #4ade80;
}
.genre-picker-btn.open {
  border-color: rgba(74, 222, 128, 0.5);
  border-top-color: rgba(74, 222, 128, 0.65);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.16);
}
.genre-picker-btn-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.genre-picker-chevron { flex-shrink: 0; opacity: 0.7; transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1); }
.genre-picker-btn.open .genre-picker-chevron { transform: rotate(180deg); }

.genre-picker-popup {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: rgba(22, 24, 32, 0.94);
  backdrop-filter: blur(min(32px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(32px, var(--pf-cap, 999px))) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 18px;
  z-index: 500;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: iosPopIn 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes iosPopIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.genre-picker-search-wrap { padding: 10px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.genre-picker-search {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: 'Rajdhani', sans-serif;
  outline: none;
  transition: border-color var(--t-fast);
}
.genre-picker-search:focus { border-color: rgba(74, 222, 128, 0.5); }
.genre-picker-list { max-height: 240px; overflow-y: auto; padding: 6px; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 3px; scrollbar-width: thin; scrollbar-color: var(--green-dim) transparent; }
.genre-picker-list::-webkit-scrollbar { width: 4px; }
.genre-picker-list::-webkit-scrollbar-thumb { background: var(--green-dim); border-radius: 4px; }
.genre-picker-item { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 7px 10px; font-size: 12.5px; font-family: 'Rajdhani', sans-serif; color: var(--text); cursor: pointer; border-radius: 8px; user-select: none; transition: background var(--t-fast), color var(--t-fast); }
.genre-picker-item:hover { background: rgba(255, 255, 255, 0.08); color: #4ade80; }
.genre-picker-item.checked { color: #4ade80; }
.genre-picker-checkbox { flex-shrink: 0; position: relative; width: 16px; height: 16px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 5px; background: rgba(255, 255, 255, 0.04); transition: background var(--t-fast), border-color var(--t-fast); }
.genre-picker-item.checked .genre-picker-checkbox { background: var(--green); border-color: var(--green); }
.genre-picker-item.checked .genre-picker-checkbox::after { content: ''; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid var(--bg); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.genre-picker-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.genre-picker-empty { grid-column: 1 / -1; padding: 16px 8px; text-align: center; font-size: 12px; font-family: 'Rajdhani', sans-serif; color: var(--text-muted); }
.genre-picker-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.genre-picker-clear,
.genre-picker-done { font-family: 'Rajdhani', sans-serif; font-size: 12px; font-weight: 700; border-radius: 8px; padding: 7px 14px; cursor: pointer; transition: all var(--t-fast); }
.genre-picker-clear { background: transparent; border: 1px solid rgba(255, 255, 255, 0.12); color: var(--text-muted); }
.genre-picker-clear:hover { border-color: #ff6b6b; color: #ff6b6b; }
.genre-picker-done {
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.24), rgba(34, 197, 94, 0.12));
  border: 1px solid rgba(74, 222, 128, 0.35);
  color: #4ade80;
}
.genre-picker-done:hover { background: rgba(74, 222, 128, 0.25); }

@media (max-width: 600px) {
  .genre-picker-list { grid-template-columns: 1fr; }
}

/* Custom Select Dropdowns */
.custom-select {
  position: relative;
}
.custom-select-popup {
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--green-dim) transparent;
}
.custom-select-popup::-webkit-scrollbar {
  width: 4px;
}
.custom-select-popup::-webkit-scrollbar-thumb {
  background: var(--green-dim);
  border-radius: 4px;
}
.custom-select-list {
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.custom-select-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: 'Rajdhani', sans-serif;
  color: var(--text);
  cursor: pointer;
  border-radius: 8px;
  user-select: none;
  transition: background var(--t-fast), color var(--t-fast);
}
.custom-select-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #4ade80;
}
.custom-select-item.selected {
  color: #4ade80;
  font-weight: 700;
  background: rgba(74, 222, 128, 0.1);
}
.custom-select-item-text {
  flex: 1;
}
.custom-select-item-icon,
.custom-select-check {
  display: none;
}

/* Filter actions */
.filter-actions { display: flex; gap: 10px; margin-top: 22px; align-items: center; }

.filter-apply-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background:
    linear-gradient(135deg, rgba(74, 222, 128, 0.28) 0%, rgba(34, 197, 94, 0.14) 100%),
    rgba(15, 25, 20, 0.7);
  border: 1px solid rgba(74, 222, 128, 0.36);
  border-top: 1px solid rgba(255, 255, 255, 0.32);
  color: #4ade80;
  font-family: 'Rajdhani', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 11px 26px;
  border-radius: 14px;
  cursor: pointer;
  backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}
.filter-apply-btn:hover {
  background:
    linear-gradient(135deg, rgba(74, 222, 128, 0.38) 0%, rgba(34, 197, 94, 0.2) 100%),
    rgba(18, 30, 24, 0.75);
  border-color: rgba(74, 222, 128, 0.5);
  border-top-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}
.filter-apply-btn:active {
  transform: scale(0.96);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.filter-reset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.03) 100%),
    rgba(20, 22, 28, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 1px solid rgba(255, 255, 255, 0.26);
  color: var(--text-muted);
  padding: 11px 16px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 14px;
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px))) saturate(180%);
  -webkit-backdrop-filter: blur(min(16px, var(--pf-cap, 999px))) saturate(180%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}
.filter-reset-btn:hover {
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.06) 100%),
    rgba(28, 30, 38, 0.7);
  transform: translateY(-1px);
}
.filter-reset-btn:active {
  transform: scale(0.95);
}

@media (max-width: 600px) {
  .filter-grid { grid-template-columns: 1fr; gap: 14px; }
  .filter-panel { padding: 20px 16px 16px; border-radius: 20px; }
  .filter-toggle-btn { width: 100%; justify-content: center; }
  .filter-actions { flex-wrap: wrap; }
  .filter-apply-btn { flex: 1; justify-content: center; }
}

/* =====================================================
   SCHEDULE — Apple iOS / Liquid Glass Redesign
   ===================================================== */
#scheduleSection .list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
#scheduleSection .list-header::after {
  display: none !important;
}
#scheduleSection .list-page-title {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Rajdhani', sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.4px;
  text-transform: none;
  background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0.78) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}
#scheduleSection .list-subtitle {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Rajdhani', sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
}

.schedule-days { display: flex; flex-direction: column; gap: 32px; }
.schedule-day-block { display: flex; flex-direction: column; gap: 14px; }

.schedule-day-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  color: #fff;
  padding: 0 4px;
  cursor: default;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Rajdhani', sans-serif;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.schedule-day-label { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.schedule-day-today { color: #fff; }

.schedule-today-badge {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.16);
  border: 1px solid rgba(74, 222, 128, 0.32);
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  border-radius: 999px;
  padding: 2.5px 9px;
  text-transform: uppercase;
  vertical-align: middle;
}

.schedule-day-stat {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2px;
  text-transform: none;
  color: rgba(255, 255, 255, 0.55);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
}

.schedule-day-count {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  border-radius: 999px;
  padding: 3px 12px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Rajdhani', sans-serif;
}

.schedule-empty-day { padding: 8px 4px; color: rgba(255, 255, 255, 0.45); font-size: 13px; font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif; }

/* ── Карусель ── */
.schedule-day-carousel { position: relative; isolation: isolate; }

.schedule-day-list {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: auto;
  scroll-snap-type: none;
  padding: 4px 4px 10px;
  margin: -4px -4px -10px;
  scrollbar-width: none;
}
.schedule-day-list::-webkit-scrollbar { display: none; }

.schedule-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.schedule-arrow:active { transform: translateY(-50%) scale(0.92); }
.schedule-arrow svg {
  width: 20px;
  height: 20px;
  color: #fff;
  margin: 0 !important;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.8));
  transition: transform 0.2s ease, color 0.2s ease;
}
.schedule-arrow-prev { left: 2px; }
.schedule-arrow-next { right: 2px; }
.schedule-arrow:hover {
  background: transparent;
  border: none;
  box-shadow: none;
}
.schedule-arrow:hover svg {
  color: #fff;
  transform: scale(1.2);
}
.schedule-day-carousel:hover .schedule-arrow.can-scroll { opacity: 1; visibility: visible; }

@media (hover: none) {
  .schedule-arrow { display: none !important; }
}

.schedule-card {
  flex: 0 0 auto;
  width: var(--poster-min-width, 165px);
  aspect-ratio: 178 / 296;
  scroll-snap-align: start;
  cursor: pointer;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(16, 18, 24, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.5);
  transition: border-color var(--t-med), box-shadow var(--t-med);
  transform: none !important;
}

/* Gradient border glow on hover via ::before — идентично .anime-card */
.schedule-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(232, 232, 232, 0) 0%, rgba(207, 207, 207, 0) 50%, rgba(168, 168, 168, 0) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  transition: background var(--t-med);
  pointer-events: none;
  z-index: 2;
}

/* Top shimmer line — идентично .anime-card */
.schedule-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad-primary);
  opacity: 0;
  transition: opacity var(--t-med);
  z-index: 3;
}

@media (hover: hover) and (pointer: fine) {
  .schedule-card:hover {
    border-color: rgba(255, 255, 255, 0.24);
    box-shadow: none;
    transform: none !important;
  }
  .schedule-card:hover::before {
    background: linear-gradient(135deg, rgba(232, 232, 232, 0.5), rgba(207, 207, 207, 0.3), rgba(168, 168, 168, 0.2));
  }
  .schedule-card:hover::after {
    opacity: 1;
  }
  .schedule-card:hover .schedule-card-title {
    color: var(--green);
  }
  .schedule-card:hover .schedule-card-poster img {
    filter: brightness(1.06);
  }
}

.schedule-card:active {
  transform: none !important;
}

.schedule-card-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #0d0f14;
  overflow: hidden;
}
.schedule-card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 0.3s ease;
}
.schedule-card:hover .schedule-card-poster img {
  filter: brightness(1.06);
}
.schedule-card-poster-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 20px;
}
.schedule-card-poster::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 11, 16, 0.95) 0%, rgba(10, 11, 16, 0.6) 45%, transparent 75%);
  pointer-events: none;
  z-index: 2;
}

/* ── Столбец бейджей ── */
.schedule-card-stack {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  max-width: calc(100% - 20px);
}

.schedule-card-time,
.schedule-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Rajdhani', sans-serif;
  font-weight: 700;
  letter-spacing: 0.3px;
  border-radius: 999px;
  padding: 3.5px 10px;
  background: rgba(14, 16, 22, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(190%);
  -webkit-backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(190%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.schedule-card-time {
  font-size: 11px;
  color: #ffffff;
}
.schedule-card-badge {
  font-size: 10px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.sched-badge-new {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.35);
}
.sched-badge-soon {
  color: #fb923c;
  background: rgba(251, 146, 60, 0.18);
  border-color: rgba(251, 146, 60, 0.35);
}
.schedule-card-status {
  display: inline-flex;
  align-items: center;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background:
    linear-gradient(rgba(240,240,245,0.12), rgba(240,240,245,0.12)),
    rgba(14,14,20,0.85);
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow:
    0 6px 18px -2px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.2);
  text-shadow:
    0 1px 2px rgba(0,0,0,0.9),
    0 0 10px rgba(0,0,0,0.5);
  backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  gap: 6px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  /* Цвет — только текст и точка, не фон */
}
/* Точка-индикатор */
.schedule-card-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  box-shadow: 0 0 4px currentColor;
}
/* Цвета по статусу — идентично .badge-* на главной */
.schedule-card-status[data-status="watching"]  { color: #ffc2e3; }
.schedule-card-status[data-status="watched"]   { color: #8fe3ff; }
.schedule-card-status[data-status="planned"]   { color: #ffcd9c; }
.schedule-card-status[data-status="dropped"]   { color: #e0e0d8; }
.schedule-card-status[data-status="favorite"]  { color: #ffabc4; }
.schedule-card-status[data-status="favorites2"]{ color: #e8b8f5; }

/* Описание карточки */
.schedule-card-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 16px 12px 12px;
  pointer-events: none;
}
.schedule-card-title {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--t-fast);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}
.schedule-card-sub {
  margin-top: 4px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
}

.schedule-row--return-highlight,
.schedule-card--return-highlight {
  animation: schedule-row-return-flash 2.2s ease-out;
}
@keyframes schedule-row-return-flash {
  0%   { box-shadow: 0 0 0 2px rgba(232,232,232,0.5); border-color: rgba(232,232,232,0.5); }
  100% { box-shadow: 0 0 0 0 rgba(232,232,232,0); }
}

@media (max-width: 768px) {
  #scheduleSection .list-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 14px;
  }
  #scheduleSection .list-page-title {
    font-size: 22px;
  }
  .schedule-days { gap: 24px; }
  .schedule-day-header { font-size: 13.5px; }
  .schedule-card-title { font-size: 12px; }
  .schedule-day-list {
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    gap: 10px;
  }
}
@media (max-width: 480px) {
  .schedule-card-title { font-size: 11.5px; }
}

/* Skeleton */
.schedule-day-block-skel { gap: 12px; }
.schedule-day-header-skel { display: flex; justify-content: space-between; align-items: center; padding: 0 4px; }
.schedule-day-header-skel-title { width: 130px; height: 16px; border-radius: 6px; background: rgba(255,255,255,0.06); }
.schedule-day-header-skel-count { width: 36px; height: 16px; border-radius: 999px; background: rgba(255,255,255,0.06); }
.schedule-row-skel { display: flex; gap: 14px; overflow: hidden; padding: 4px 4px 10px; margin: -4px -4px -10px; }
.schedule-row-skel-poster { flex: 0 0 auto; width: var(--poster-min-width, 165px); aspect-ratio: 178 / 296; border-radius: 18px; background: rgba(255,255,255,0.04); }
@media (max-width: 768px) {
  .schedule-row-skel-poster { width: 132px; }
}
@media (max-width: 480px) {
  .schedule-row-skel-poster { width: 116px; }
}

/* ── Статистика дня ─────────────────────────────────── */
.schedule-day-label { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

/* ── Бейджи эпизодов ─────────────────────────────────── */
.sched-ep-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 1px 7px;
  border-radius: 5px;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
}
.sched-badge-new {
  color: #1a1a1a;
  background: var(--green);
  animation: sched-pulse 2s ease-in-out infinite;
}
.sched-badge-soon {
  color: var(--green);
  background: rgba(232,232,232,0.12);
  border: 1px solid rgba(232,232,232,0.35);
}
@keyframes sched-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.7; }
}

/* ── Статус пользователя ─────────────────────────────── */
.sched-user-status {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--green);
  padding: 1px 7px;
  border-radius: 5px;
  background: rgba(232,232,232,0.08);
  border: 1px solid rgba(232,232,232,0.2);
  white-space: nowrap;
  vertical-align: middle;
}

/* ──────────────────────────────────────────────────────
   NOTIF POSTER PREVIEW — popup при наведении на постер
   уведомления в дропдауне колокольчика
   ────────────────────────────────────────────────────── */
.notif-poster-preview {
  position: fixed;
  width: 160px;
  height: 226px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-hl);
  box-shadow: 0 16px 48px rgba(0,0,0,0.8), 0 0 30px rgba(232,232,232,0.2);
  background: var(--bg-input);
  pointer-events: none;
  opacity: 0;
  transform: scale(0.88);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 99999;
}
.notif-poster-preview.visible { opacity: 1; transform: scale(1); }
.notif-poster-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 600px) { .notif-poster-preview { display: none; } }

/* =====================================================
   БЛОКИРОВКА СКРОЛЛА СТРАНИЦЫ ПОД ОВЕРЛЕЯМИ/ПОПАПАМИ
   (см. js/utils.js: lockBodyScroll/unlockBodyScroll)
   ===================================================== */
/* position:fixed вместо простого overflow:hidden — на iOS Safari
   overflow:hidden на body тач-скролл не останавливает, если фон
   под попапом длиннее экрана (страница листается "сквозь" попап).
   width:100% обязателен: у fixed-элемента пропадает ширина body,
   вычислявшаяся раньше из нормального потока, из-за чего контент
   схлопнулся бы по горизонтали. top выставляется в JS (= -scrollY
   на момент блокировки), чтобы страница не прыгала к началу. */
.body-scroll-locked {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
}

/* =====================================================
   AUTH GATE — flat card
   (тот же плоский стиль, что у .modal-box / "Редактировать
   профиль": без объёма и свечения, акцентный бордер слева,
   прямые углы, белая кнопка действия — см. .import-btn выше.)
   ===================================================== */
/* Блокировка скролла теперь идёт через .body-scroll-locked (см. выше) —
   класс оставлен пустой заглушкой на случай старых ссылок на селектор. */
.auth-locked {}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(2, 4, 12, 0.78);
  backdrop-filter: blur(min(18px, var(--pf-cap, 999px))) saturate(1.2);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease;
}
.auth-gate.hidden { display: none; }

/* Крестик закрытия #authGate — модалка входа теперь необязательная
   (гость может её закрыть и остаться без аккаунта), см. closeAuthGate()
   в js/auth.js. .auth-box уже position:relative — просто кладём кнопку
   поверх неё в правый верхний угол, как обычный .modal-close, только
   абсолютно спозиционированный (у .auth-box нет .modal-header, в
   отличие от остальных модалок сайта, где .modal-close лежит внутри
   flex-хедера). Внутри .auth-box есть overflow:hidden, но т.к. крестик
   расположен в пределах видимой области (top/right с достаточным
   отступом от края), это его не обрезает. */
.auth-gate-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
}
.auth-gate-close.hidden { display: none; }

.auth-box {
  background: #131313;
  border: none;
  border-left: 3px solid rgba(255,255,255,0.7);
  border-radius: 4px;
  width: 100%;
  max-width: 420px;
  margin: 20px;
  padding: 32px 28px;
  box-shadow: none;
  animation: slideUp 0.35s cubic-bezier(0.34, 1.3, 0.64, 1);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.auth-logo { display: flex; justify-content: center; margin-bottom: 16px; }
.auth-logo .logo-svg {
  width: 56px;
  height: 56px;
  filter:
    drop-shadow(1px 0 0 #fff)
    drop-shadow(-1px 0 0 #fff)
    drop-shadow(0 1px 0 #fff)
    drop-shadow(0 -1px 0 #fff);
}

/* Глазик показать/скрыть пароль — есть у обоих password-полей формы. */
.auth-field {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  width: 100%;
  box-sizing: border-box;
}
.auth-field .auth-input {
  display: block;
  width: 100%;
  margin: 0 !important;
  margin-bottom: 0 !important;
  padding-right: 46px !important;
  box-sizing: border-box;
}
.auth-field input.auth-input,
.auth-form-side .auth-field .auth-input {
  margin: 0 !important;
  margin-bottom: 0 !important;
}
.auth-toggle-eye {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--t-med);
  line-height: 1;
  z-index: 2;
  box-sizing: border-box;
}
.auth-toggle-eye:hover { color: var(--text); }
.auth-toggle-eye:active { transform: translateY(-50%) scale(0.92) !important; color: var(--text); }
.auth-toggle-eye svg { width: 18px; height: 18px; display: block; flex-shrink: 0; margin: 0; padding: 0; }

/* Индикатор надёжности пароля — раскрывается плавно только в режиме
   регистрации (класс .show переключается в switchAuthMode()). */
.auth-strength-wrap {
  height: 0;
  opacity: 0;
  overflow: hidden;
  margin-bottom: 0;
  transition: height var(--t-med), opacity var(--t-med), margin var(--t-med);
}
.auth-strength-wrap.show { height: 40px; opacity: 1; margin-bottom: 12px; }
.auth-strength-track { display: flex; gap: 5px; margin-bottom: 6px; }
.auth-strength-seg {
  flex: 1;
  height: 4px;
  border-radius: 3px;
  background: rgba(255,255,255,0.08);
  transition: background var(--t-med), box-shadow var(--t-med);
}
.auth-strength-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.auth-strength-label b { font-weight: 700; transition: color var(--t-med); }

/* Строка "пароли совпадают/не совпадают" под полем повтора пароля. */
.auth-match-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  height: 0;
  opacity: 0;
  overflow: hidden;
  margin-bottom: 0;
  transition: height var(--t-med), opacity var(--t-med), margin var(--t-med);
}
.auth-match-row.show { height: 18px; opacity: 1; margin-bottom: 12px; }
.auth-match-row svg { width: 14px; height: 14px; flex-shrink: 0; }
.auth-match-row.ok { color: #7ee787; }
.auth-match-row.bad { color: #ff8a8a; }

/* Лёгкая тряска поля повтора пароля при несовпадении. */
@keyframes authShake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
.auth-shake { animation: authShake 0.5s; }

.auth-tabs {
  display: flex;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 24px;
  background: rgba(0,0,0,0.2);
  padding: 3px;
  gap: 2px;
}

.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px;
  cursor: pointer;
  font-size: 11px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: all var(--t-med);
  border-radius: 4px;
}
.auth-tab:hover { color: var(--green); background: rgba(255,255,255,0.05); }
.auth-tab.active { color: #0c0c0c; background: rgba(255,255,255,0.9); }

.auth-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 700;
  background: none;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: var(--text);
  background-clip: initial;
  color: var(--text);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.auth-subtitle { font-size: 13px; color: var(--text-muted); line-height: 1.7; margin-bottom: 20px; }

.auth-input {
  width: 100%;
  background: #0c0c0c;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  padding: 12px 16px;
  margin-bottom: 12px;
  transition: border-color var(--t-med), background var(--t-med);
}
.auth-input:focus { outline: none; border-color: rgba(232,232,232,0.4); background: #0e0e0e; }
.auth-input::placeholder { color: var(--text-muted); }

.auth-error {
  font-size: 12.5px;
  color: #ff6b6b;
  background: rgba(255,60,60,0.07);
  border: 1px solid rgba(255,60,60,0.2);
  border-radius: 6px;
  padding: 10px 16px;
  margin-bottom: 12px;
  text-align: left;
}
.auth-error.hidden { display: none; }

/* Кнопка "Войти" — тот же .import-btn, что "Сохранить" в редактировании
   профиля: сплошная белая заливка, тёмный текст. */
.auth-submit-btn {
  width: 100%;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.9);
  color: #0c0c0c;
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), transform 0.15s;
}
.auth-submit-btn:hover {
  background: #fff;
  border-color: #fff;
}
.auth-submit-btn:active { transform: scale(0.98); }
.auth-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* =====================================================
   AUTH GATE — "Split Panel" (вариант 2 редизайна)
   Двухпанельная витрина: слева брендовая сторона с лого,
   заголовком, статами и жанрами; справа — форма входа/
   регистрации. На узких экранах левая панель скрывается
   и остаётся только форма (см. .auth-box.v2 в медиа-запросе
   ниже) — .auth-gate-close и вся логика js/auth.js не меняются,
   меняется только разметка/стили самой карточки.
   ===================================================== */
.auth-box.v2 {
  max-width: 820px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  text-align: left;
  overflow: hidden;
  animation: authBoxIn 0.5s cubic-bezier(0.22,1,0.36,1);
}
@keyframes authBoxIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-visual {
  position: relative;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(160deg, #181818 0%, #0c0c0c 100%);
  border-right: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
}
.auth-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse at 50% 30%, black 0%, transparent 75%);
  pointer-events: none;
  animation: authVisualGrid 20s linear infinite;
}
@keyframes authVisualGrid {
  from { background-position: 0 0, 0 0; }
  to { background-position: 26px 26px, 26px 26px; }
}
/* Мягкое дышащее свечение сверху панели. */
.auth-visual::after {
  content: '';
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 340px;
  height: 260px;
  background: radial-gradient(ellipse, rgba(255,255,255,0.06) 0%, transparent 65%);
  pointer-events: none;
  animation: authVisualGlow 6s ease-in-out infinite;
}
@keyframes authVisualGlow {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.auth-visual-top { position: relative; z-index: 1; }
.auth-visual-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; }
.auth-visual-brand img {
  width: 30px;
  height: 30px;
  animation: authLogoFloat 4s ease-in-out infinite;
}
@keyframes authLogoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.auth-visual-brand span {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 800;
  letter-spacing: 2px;
  font-size: 14px;
  color: var(--text);
}
.auth-visual-headline {
  font-family: 'Rajdhani', sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.3px;
  color: var(--text);
  margin-bottom: 12px;
}
.auth-visual-headline .accent { color: var(--green); }
.auth-visual-desc { font-size: 13px; color: var(--text-muted); line-height: 1.7; max-width: 260px; }

.auth-visual-bottom { position: relative; z-index: 1; }
.auth-visual-stats { display: flex; gap: 22px; margin-bottom: 18px; }
.auth-visual-stat b {
  display: block;
  font-family: 'Rajdhani', sans-serif;
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
}
.auth-visual-stat span {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.auth-visual-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.auth-visual-chip {
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-muted);
  background: rgba(255,255,255,0.03);
  animation: authChipFloat 5s ease-in-out infinite;
}
.auth-visual-chip:nth-child(2) { animation-delay: 0.4s; }
.auth-visual-chip:nth-child(3) { animation-delay: 0.8s; }
.auth-visual-chip:nth-child(4) { animation-delay: 1.2s; }
@keyframes authChipFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.auth-form-side { padding: 36px 32px; display: flex; flex-direction: column; justify-content: center; }
.auth-form-side .auth-tabs { margin-bottom: 20px; }
.auth-form-side .auth-title { font-size: 16px; margin-bottom: 6px; }
.auth-form-side .auth-subtitle { font-size: 12.5px; margin-bottom: 18px; }
.auth-form-side form > .auth-input:last-of-type { margin-bottom: 12px; }
.auth-form-side .auth-field .auth-input { margin: 0 !important; margin-bottom: 0 !important; }

@media (max-width: 768px) {
  #authGate.auth-gate {
    position: fixed !important;
    inset: 0 !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 99998 !important;
    background: rgba(2, 4, 12, 0.72) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
  }
  .auth-box.v2 {
    grid-template-columns: 1fr;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 22px 22px 0 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    border-bottom: none !important;
    max-height: min(88vh, calc(100vh - 20px)) !important;
    max-height: min(88dvh, calc(100dvh - 20px)) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 0 16px calc(24px + env(safe-area-inset-bottom, 0px)) !important;
    animation: xpSheetUp 0.32s cubic-bezier(0.22, 1, 0.36, 1) !important;
    touch-action: pan-y !important;
    background: rgba(18, 20, 28, 0.95) !important;
    backdrop-filter: blur(28px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.22) !important;
  }
  .auth-box.v2::before {
    content: '' !important;
    display: block !important;
    flex-shrink: 0 !important;
    width: 36px !important;
    height: 4px !important;
    border-radius: 2px !important;
    background: rgba(255, 255, 255, 0.28) !important;
    margin: 8px auto 6px !important;
    cursor: grab;
    touch-action: none;
  }
  .auth-visual { display: none; }
  .auth-form-side { padding: 12px 6px 16px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-box.v2,
  .auth-visual::before,
  .auth-visual::after,
  .auth-visual-brand img,
  .auth-visual-chip {
    animation: none;
  }
}

#accountEmail {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}

/* ===== CATALOG LOAD MORE ===== */
.catalog-more-wrap {
  display: flex;
  justify-content: center;
  padding: 40px 20px 24px;
  width: 100%;
  box-sizing: border-box;
}

.catalog-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 32px;
  background: rgba(240, 240, 245, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 30px;
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--t-med);
  width: 100%;
  max-width: 520px;
  backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(200%);
  will-change: backdrop-filter;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform: none !important;
}

.catalog-more-btn:hover {
  background: rgba(240, 240, 245, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transform: none !important;
}

.catalog-more-btn:active {
  transform: none !important;
  opacity: 0.85;
}

.catalog-more-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.catalog-more-btn svg {
  color: var(--green);
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.catalog-more-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.catalog-more-count {
  font-size: 12px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.18);
  color: var(--green);
  border-radius: 20px;
  padding: 2px 12px;
  margin-left: 2px;
}

.catalog-more-hint {
  font-size: 12px;
  color: rgba(232, 232, 232, 0.75);
  opacity: 0.9;
  letter-spacing: 0.3px;
  margin-left: 4px;
}

/* ===== BACKGROUND SETTINGS =====
   Вкладки Цвет/Картинка/Градиент — тот же sliding-pill компонент,
   что и приватность списков (см. .pill-toggle/.pill-btn выше).
   Класс .bg-tab-btn оставлен пустым как "мостик" на случай, если
   где-то в JS ещё встречается селектор '.bg-tab-btn' — сам вид и
   поведение теперь полностью определяются .pill-btn. */
.bg-tab-btn { min-height: 44px; touch-action: manipulation; -webkit-tap-highlight-color: rgba(232,232,232,0.12); }

.bg-preset {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--t-fast);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.bg-preset:hover { border-color: var(--green); transform: scale(1.14); box-shadow: 0 0 10px rgba(232,232,232,0.2); }

/* ===== SITE THEMES (палитры цвета интерфейса) ===== */
/* Плавный переход цвета при переключении темы — вешается на <html>
   на короткое время в js/site-themes.js. Затрагивает переменные,
   от которых зависят фон/акценты/бордеры/тени по всему сайту, чтобы
   смена палитры не была резким "миганием". */
/* Основной путь — View Transitions (см. _stRunSmooth в site-themes.js):
   старый и новый вид страницы мягко растворяются друг в друге. */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.55s;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  mix-blend-mode: normal;
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}
/* Фолбэк для браузеров без View Transitions — короткий transition
   цвета на время смены. */
html.site-theme-switching,
html.site-theme-switching body,
html.site-theme-switching *,
html.site-theme-switching *::before,
html.site-theme-switching *::after {
  transition: background-color 0.5s ease, background-image 0.5s ease,
              border-color 0.5s ease, color 0.5s ease,
              box-shadow 0.5s ease, fill 0.5s ease, stroke 0.5s ease !important;
}

.site-theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.site-theme-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 14px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.2);
  cursor: pointer;
  text-align: left;
  transition: all var(--t-fast);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.site-theme-card:hover {
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.03);
  transform: translateY(-2px);
}
.site-theme-card.is-active {
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green), 0 0 16px rgba(232,232,232,0.15);
}

.site-theme-swatch {
  display: flex;
  gap: 5px;
}
.site-theme-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
}

.site-theme-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.2px;
}

.site-theme-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green);
  color: #06080f;
  opacity: 0;
  transform: scale(0.6);
  transition: all var(--t-fast);
}
.site-theme-card.is-active .site-theme-check {
  opacity: 1;
  transform: scale(1);
}

/* =====================================================
   MODAL TABS (IMPORT/EXPORT/CLEAR)
   ===================================================== */
.modal-box--wide { max-width: 560px; }

/* .modal-tabs/.modal-tab — теперь используют общий .pill-toggle/
   .pill-btn (см. блок PILL TOGGLE ниже); классы остаются как
   разметочные хуки для margin/border-bottom страницы Импорт/Экспорт,
   без своих display/цвет/фон правил, чтобы не конфликтовать с
   .pill-toggle/.pill-btn. Full-width вариант — там же, вместе с
   .import-subtabs. */
.modal-tabs {
  margin: 0 20px 0;
  padding: 0 6px 6px;
  border-bottom: 1px solid rgba(232,232,232,0.07);
  background: rgba(0,0,0,0.15);
}

.modal-panel { }
.modal-panel.hidden { display: none; }

/* Import sub-tabs — теперь используют общий .pill-toggle/.pill-btn
   (см. блок PILL TOGGLE ниже); .import-subtabs/.import-subtab остаются
   как разметочные классы-хуки (без своих display/цвет/фон правил,
   чтобы не конфликтовать с .pill-toggle/.pill-btn), плюс full-width
   вариант ниже вместе с .modal-tabs. */

/* File drop zone */
.file-drop-zone {
  border: 2px dashed rgba(232,232,232,0.15);
  border-radius: 18px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--t-med);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 14px;
  color: var(--text-muted);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  background: rgba(0,0,0,0.2);
  backdrop-filter: blur(8px);
}
.file-drop-zone:hover { border-color: rgba(232,232,232,0.4); background: rgba(232,232,232,0.04); color: var(--green); }
.file-drop-zone.drag-over { border-color: var(--green); background: rgba(232,232,232,0.08); color: var(--green); box-shadow: 0 0 30px rgba(232,232,232,0.1); }
.file-drop-zone.has-file { border-color: var(--green-dim); background: rgba(232,232,232,0.06); color: var(--green); }

/* Clear options */
.clear-list-options { display: flex; flex-direction: column; gap: 8px; }
.clear-option { display: flex; align-items: center; gap: 10px; font-size: 14px; font-family: 'Rajdhani', sans-serif; font-weight: 600; color: var(--text); cursor: pointer; padding: 10px 16px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.06); transition: background var(--t-fast), border-color var(--t-fast); }
.clear-option:hover { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.1); }
.clear-option input[type="checkbox"] { accent-color: var(--green); width: 16px; height: 16px; cursor: pointer; }

/* Tab count badges */
.tab-count { font-size: 11px; font-weight: 700; color: var(--green-dim); margin-left: 3px; font-family: 'Rajdhani', sans-serif; vertical-align: middle; }
.nav-tab.active .tab-count { color: var(--green); }
.nav-dropdown-item.active .tab-count, .nav-dropdown-toggle.active .tab-count { color: var(--green); }

/* =====================================================
   RESPONSIVE
   ===================================================== */
/* Вкладки нижней строки теперь в отдельном ряду под лого/поиском, а не
   стеснены с ними в одну линию — им хватает места гораздо дольше, чем в
   однострочной раскладке. Прячем только ближе к точке перехода на
   мобильную нижнюю панель (.mobile-bottom-nav берёт на себя роль
   навигации ниже 768px — см. @media(max-width:768px) ниже). */
@media (max-width: 860px) {
  .header-inner--bottom { display: none; }
}

@media (max-width: 860px) {
  .detail-layout { grid-template-columns: 1fr; }
  .detail-poster-col { position: static; display: grid; grid-template-columns: 160px 1fr; gap: 18px; align-items: start; }
  .poster-glow-wrap { width: 160px; }
  .detail-widget-frame { padding: 20px; }
}

@media (max-width: 560px) {
  .header-inner { gap: 12px; }
  .logo-text { font-size: 14px; letter-spacing: 1px; }
  /* Тот же стандартный размер постера, что на ПК (--poster-min-width).
     minmax(X, 1fr) растягивал бы колонки, чтобы заполнить всю ширину
     строки — на десктопе с кучей колонок это растяжение незаметно на
     глаз, но на мобильном при всего 2 колонках лишняя ширина экрана
     делится между ними, и постер получается заметно крупнее заданного
     размера. Фиксируем ширину колонки строго в --poster-min-width
     (без 1fr) и justify-content:center — свободное место делится
     поровну между краями строки, и ряд карточек стоит по центру
     контейнера, а не прижат к левому краю. */
  .anime-grid { grid-template-columns: repeat(auto-fill, var(--poster-min-width, 165px)); justify-content: center; gap: 10px; }
  .seasons-grid { grid-template-columns: repeat(auto-fill, var(--poster-min-width, 165px)); justify-content: center; gap: 10px; }
  .detail-poster-col { grid-template-columns: 1fr; }
  .poster-glow-wrap { width: 100%; max-width: 210px; margin: 0 auto; }
  .detail-title { font-size: 22px; }
}

/* ===== UTIL ===== */
.hidden { display: none !important; }

/* =====================================================
   MOBILE BOTTOM NAV — "плавающий остров" (pill), iOS-стекло
   Обёртка .mobile-bottom-nav сама больше не рисует фон/бордер/тень —
   это делает внутренний .mobile-nav-items, оформленный как отдельная
   скруглённая капсула, отступающая от края экрана. Так высота и
   позиция обёртки (--mobile-nav-height, от которой считают bottom
   попапов "Списки"/"Ещё" чуть ниже) не меняются — снаружи ничего не
   разъезжается, меняется только то, что внутри неё нарисовано.

   Капсула сделана светлой полупрозрачной (в духе iOS UITabBar /
   Control Center — тонкое молочное стекло, а не тёмная плашка), с
   сильным blur+saturate, чтобы цвет реально брался из контента под
   панелью, а не был декоративной подкраской.

   .mobile-nav-indicator — скользящая "таблетка" активной вкладки.
   Она позиционируется через inline left/width, которые вычисляет
   JS в конце файла (по offsetLeft/offsetWidth активной кнопки), а
   CSS отвечает только за transition — тем самым исходная разметка
   и все 4 существующих обработчика (setMobileActive/toggleMobileLists/
   toggleMobileSettings/их close-варианты) остаются без изменений:
   индикатор следит за классом .active через MutationObserver, а не
   встраивается в каждую функцию переключения по отдельности. */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  min-height: var(--mobile-nav-height);
  padding: 8px 14px calc(env(safe-area-inset-bottom, 8px) + 8px);
  box-sizing: border-box;
  background: transparent !important;
  pointer-events: none;
}

.mobile-nav-items {
  pointer-events: auto;
  position: relative;
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 100%;
  max-width: 440px;
  margin: 0 auto;
  background: rgba(18, 20, 28, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 6px 8px;
  backdrop-filter: blur(min(36px, var(--pf-cap, 999px))) saturate(190%);
  -webkit-backdrop-filter: blur(min(36px, var(--pf-cap, 999px))) saturate(190%);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: border-radius 0.25s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

/* ── Слияние капсулы навигации с попапом "Ещё" / "Списки" ── */
.mobile-bottom-nav.settings-open .mobile-nav-items,
.mobile-bottom-nav.lists-open .mobile-nav-items,
.mobile-bottom-nav.sheet-open .mobile-nav-items {
  border-radius: 0 0 28px 28px;
  border-top-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* Скользящий индикатор в стиле Apple pill — легкое стекло без серой заплатки */
.mobile-nav-indicator {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 0;
  width: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px))) saturate(180%);
  -webkit-backdrop-filter: blur(min(16px, var(--pf-cap, 999px))) saturate(180%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: left 0.35s cubic-bezier(0.32, 0.72, 0, 1), width 0.35s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.2s ease;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}
.mobile-nav-indicator.ready { opacity: 1; }

.mobile-nav-btn {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.52);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Rajdhani', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: -0.1px;
  padding: 7px 12px;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.15s ease;
  min-width: 54px;
}
.mobile-nav-btn svg {
  width: 22px;
  height: 22px;
  transition: color 0.2s ease, transform 0.2s ease;
}
.mobile-nav-btn.active {
  color: #ffffff;
  font-weight: 600;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.35);
}
.mobile-nav-btn.active svg {
  color: #ffffff;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.45));
}
.mobile-nav-btn:active {
  transform: scale(0.92);
  opacity: 0.8;
}

/* ── Мобильный попап "Ещё" (#mobileSettingsPopup) ──
   Вариант "полное слияние" (тот же язык, что и Вариант 1 в референсе
   стеклянных попапов): попап и капсула нижней навигации — один и тот
   же стеклянный материал без видимого шва между ними. Попап растёт
   прямо из капсулы .mobile-nav-items: тот же полупрозрачный фон,
   тот же blur/saturate, та же ширина и боковые отступы (14px, как у
   .mobile-bottom-nav), только скруглены исключительно верхние углы —
   низ переходит в капсулу навигации без зазора. Стык отмечен только
   тонкой внутренней чертой сверху у самой навигации (см.
   .mobile-bottom-nav.settings-open .mobile-nav-items ниже), а не
   тенью или границей между двумя блоками.

   Раньше каждая группа пунктов была отдельной карточкой (фон + рамка +
   radius + padding:4px + margin-bottom:6px), из-за чего даже группа
   из одной кнопки ("Импорт / Экспорт") занимала столько же места по
   вертикали, сколько группа из четырёх — на невысоких экранах попап
   выходил за верх видимой области. Теперь все пункты живут в одном
   .msp-list без обёрток на каждую группу (только текстовые лейблы
   .msp-label как разделители), а сам .msp-list — со своим скроллом
   и max-height, так что попап физически не может вылезти за экран:
   при нехватке места скроллится список, а не съезжает контейнер. */
.mobile-settings-popup {
  position: fixed;
  bottom: calc(var(--mobile-nav-height) - 8px + env(safe-area-inset-bottom, 0px));
  left: 14px;
  right: 14px;
  max-width: 440px;
  margin: 0 auto;
  z-index: 950;
  background: rgba(18, 20, 28, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  border-bottom: none;
  border-radius: 28px 28px 0 0;
  padding: 14px 10px 8px;
  backdrop-filter: blur(min(36px, var(--pf-cap, 999px))) saturate(190%);
  -webkit-backdrop-filter: blur(min(36px, var(--pf-cap, 999px))) saturate(190%);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  box-sizing: border-box;
  max-height: calc(100vh - var(--mobile-nav-height) - env(safe-area-inset-bottom, 0px) - env(safe-area-inset-top, 0px) - 24px);
  max-height: calc(100dvh - var(--mobile-nav-height) - env(safe-area-inset-bottom, 0px) - env(safe-area-inset-top, 0px) - 24px);
  display: flex;
  flex-direction: column;
  transform: translateY(110%);
  opacity: 0;
  visibility: hidden;
  transition:
    transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
    opacity   0.22s ease,
    visibility 0s linear 0.32s;
}
.mobile-settings-popup.popup--open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  transition:
    transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
    opacity   0.18s ease,
    visibility 0s linear 0s; /* при открытии — сразу visible */
}
/* Текст/иконки внутри попапа переведены с --text-muted/--border (эти
   переменные расчитаны на контраст с почти непрозрачным тёмным фоном
   rgba(15,15,15,0.98), который был раньше) на фиксированные rgba(255..)
   — на светлом просвечивающем стекле .mobile-settings-popup они на
   некоторых фонах-подложках проседали по контрасту. Ровно те же тона,
   что использует стеклянная нижняя навигация для своих надписей. */
.msp-title {
  font-size: 10px;
  color: rgba(240, 240, 245, 0.55);
  letter-spacing: 1.5px;
  font-weight: 700;
  margin-bottom: 6px;
  text-align: center;
  flex-shrink: 0;
}
/* Хват для свайпа вниз — визуальный сигнал "потяни, чтобы закрыть",
   общий для .mobile-lists-popup и .mobile-settings-popup. Сама логика
   перетаскивания навешивается через initSwipeToClose() (см. ниже в
   index.html) на весь попап, полоска — просто индикатор, не единственная
   зона захвата, поэтому у неё увеличенная зона тапа через padding. */
.mobile-popup-draghandle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0 8px;
  margin: -6px 0 0;
  flex-shrink: 0;
  cursor: grab;
  touch-action: none;
}
.mobile-popup-draghandle::before {
  content: '';
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(240, 240, 245, 0.32);
}
.mobile-popup-draghandle:active { cursor: grabbing; }
.msp-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0; /* позволяет flex-ребёнку сжиматься и реально скроллиться */
  padding: 2px 2px 4px;
}
.msp-label {
  font-size: 9px;
  color: rgba(240, 240, 245, 0.4);
  letter-spacing: 1px;
  font-weight: 700;
  padding: 8px 8px 3px;
}
.msp-label:first-child { padding-top: 2px; }
.msp-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  background: none;
  border: none;
  color: #fff;
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 8px;
  border-radius: 9px;
  cursor: pointer;
  text-align: left;
  transition: background var(--t-fast);
}
.msp-item svg { flex-shrink: 0; color: rgba(240, 240, 245, 0.65); }
.msp-item:hover, .msp-item:active { background: rgba(255,255,255,0.08); }
.msp-item-label { display: flex; align-items: center; gap: 6px; }
/* Тонкий разделитель перед "Выйти из аккаунта" вместо отдельной
   карточки с фоном/рамкой — кнопка по-прежнему явно выделена цветом
   (.msp-danger) и своим hover-фоном. */
.msp-sep { height: 1px; background: rgba(255,255,255,0.14); margin: 6px 4px 4px; }
.msp-item.msp-danger { color: #ff8a8a; }
.msp-item.msp-danger svg { color: #ff8a8a; }
.msp-item.msp-danger:hover, .msp-item.msp-danger:active { background: rgba(255,80,80,0.12); }
.msp-close {
  flex-shrink: 0;
  width: 100%;
  margin-top: 6px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(240, 240, 245, 0.7);
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 9px;
  border-radius: 10px;
  cursor: pointer;
}
.msp-close:hover, .msp-close:active { background: rgba(255,255,255,0.14); }

/* =====================================================
   MOBILE "МОИ СПИСКИ" POPUP (#mobileListsPopup) — редизайн
   =====================================================
   Геометрия и материал popup'а — точная копия .mobile-settings-popup
   выше (тот же принцип "полного слияния" со стеклянной нижней
   навигацией: попап растёт из капсулы .mobile-nav-items без видимого
   шва, скруглены только верхние углы, снизу — без границы/тени,
   которая выдала бы стык). Раньше это был отдельный тёмный непрозрачный
   попап (rgba(15,15,15,0.98)), визуально никак не связанный с
   навигацией под ним — теперь оба мобильных попапа ("Списки" и "Ещё")
   говорят на одном языке материала. См. .mobile-bottom-nav.lists-open
   .mobile-nav-items выше — тот же модификатор, что снимает верхнее
   скругление капсулы, пока список открыт. */
.mobile-lists-popup {
  position: fixed;
  bottom: calc(var(--mobile-nav-height) - 8px + env(safe-area-inset-bottom, 0px));
  left: 14px;
  right: 14px;
  max-width: 440px;
  margin: 0 auto;
  z-index: 950;
  background: rgba(18, 20, 28, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  border-bottom: none;
  border-radius: 28px 28px 0 0;
  padding: 14px 10px 8px;
  backdrop-filter: blur(min(36px, var(--pf-cap, 999px))) saturate(190%);
  -webkit-backdrop-filter: blur(min(36px, var(--pf-cap, 999px))) saturate(190%);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  box-sizing: border-box;
  max-height: calc(100vh - var(--mobile-nav-height) - env(safe-area-inset-bottom, 0px) - env(safe-area-inset-top, 0px) - 24px);
  max-height: calc(100dvh - var(--mobile-nav-height) - env(safe-area-inset-bottom, 0px) - env(safe-area-inset-top, 0px) - 24px);
  display: flex;
  flex-direction: column;
  transform: translateY(110%);
  opacity: 0;
  visibility: hidden;
  transition:
    transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
    opacity   0.22s ease,
    visibility 0s linear 0.32s;
}
.mobile-lists-popup.popup--open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  transition:
    transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
    opacity   0.18s ease,
    visibility 0s linear 0s;
}
.mobile-lists-popup.dragging,
.mobile-settings-popup.dragging {
  transition: none !important;
}
/* Ряды-карточки и текст переведены с --text/--text-muted/--border (эти
   переменные рассчитаны на контраст с почти непрозрачным тёмным фоном,
   который был раньше) на фиксированные rgba(255..) — те же тона, что и
   в .mobile-settings-popup/.mobile-nav-items, чтобы оба попапа и
   навигация читались как один материал. */
.mlp-title {
  font-size: 10px;
  color: rgba(240, 240, 245, 0.55);
  letter-spacing: 1.5px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  flex-shrink: 0;
}
.mlp-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 4px;
}
.mlp-close {
  flex-shrink: 0;
  width: 100%;
  margin-top: 10px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(240, 240, 245, 0.7);
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 9px;
  border-radius: 10px;
  cursor: pointer;
}
.mlp-close:hover, .mlp-close:active { background: rgba(255,255,255,0.14); }

.mlp-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

/* Оверлеи (затемнение под попапами) — анимированы через opacity.
   pointer-events:none в скрытом состоянии так не нужны (visibility делает то же). */
.mobile-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 940;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity   0.25s ease,
    visibility 0s linear 0.25s;
}
.mobile-popup-overlay.popup--open {
  opacity: 1;
  visibility: visible;
  transition:
    opacity   0.2s ease,
    visibility 0s linear 0s;
}

/* =====================================================
   СЕТКА 2×N (мои списки)
   ===================================================== */
.mlp-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.mlp-grid2-bottom { margin-top: 8px; }
.mlp-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  padding: 12px 12px 11px;
  cursor: pointer;
  text-align: left;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.mlp-tile:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.26); }
.mlp-tile:active { background: rgba(255,255,255,0.14); }
.mlp-tile-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mlp-tile-icobox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 7px;
}
.mlp-tile-icobox svg {
  width: 13px;
  height: 13px;
}
.mlp-tile-icobox-small {
  width: 20px;
  height: 20px;
  border-radius: 6px;
}
.mlp-tile-icobox-small svg { width: 12px; height: 12px; }
.mlp-ico-blue   { background: rgba(55,138,221,0.18);  color: #6fb2ef; }
.mlp-ico-amber  { background: rgba(239,159,39,0.18);  color: #f3b752; }
.mlp-ico-green  { background: rgba(93,202,165,0.18);  color: #6fd6b0; }
.mlp-ico-pink   { background: rgba(212,83,126,0.18);  color: #e281a4; }
.mlp-ico-yellow { background: rgba(240,199,60,0.2);   color: #f4d26e; }
.mlp-ico-red    { background: rgba(226,75,74,0.18);   color: #ea8584; }
.mlp-ico-gray   { background: rgba(255,255,255,0.1);  color: rgba(240,240,245,0.7); }
.mlp-tile-count {
  font-family: 'Orbitron', monospace;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.mlp-tile-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  color: rgba(240,240,245,0.85);
  margin-top: 6px;
}
.mlp-tile-small {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 11px 12px;
}
.mlp-tile-small .mlp-tile-name { margin-top: 0; }
.mlp-tile-count-inline {
  position: relative;
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  font-weight: 700;
  color: rgba(240,240,245,0.55);
}

/* ── Mobile header ── */
@media (max-width: 768px) {
  .mobile-bottom-nav { display: block; }

  /* ── Мобильное сворачивание списка статусов ("Добавить в список") ── */
  /* На мобильном 6 кнопок статуса занимают слишком много высоты в первой
     складке экрана (под постером), поэтому они свёрнуты по умолчанию в
     аккуратную стеклянную карточку-раскрывашку. При клике на неё плавно
     выезжает весь список через transition grid-template-rows 0fr→1fr (не
     через max-height — так высота никогда не дёргается и идеально равна
     высоте контента).
     Внутренний .my-list-row-inner сдвигается вниз и плавно проявляется,
     создавая нативное ощущение раскрытия карточки. При этом внутрь
     .my-list-row-inner положен contain:paint, чтобы дочерние элементы с
     transform не вылезали за пределы контейнера в закрытом состоянии, пока
     0fr их не сжимает. Класс .is-open ставится/снимается в JS по
     клику на #myListToggle (см. js/detail.js). */
  .my-list-label {
    cursor: pointer;
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%),
      rgba(18, 20, 26, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 0;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.12s ease;
  }
  .my-list-label:active {
    transform: scale(0.985);
  }
  .my-list-btns.is-open .my-list-label {
    border-color: rgba(255, 255, 255, 0.22);
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%),
      rgba(22, 25, 34, 0.85);
  }
  .my-list-toggle-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.75);
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, color 0.2s ease;
  }
  .my-list-btns.is-open .my-list-toggle-arrow {
    transform: rotate(180deg);
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
  }
  .my-list-row {
    display: grid;
    grid-template-rows: 0fr;
    overflow: hidden;
    transition: grid-template-rows 0.38s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: grid-template-rows;
  }
  .my-list-row-inner {
    min-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px) translateZ(0);
    padding-top: 0;
    transition:
      opacity 0.28s ease,
      transform 0.38s cubic-bezier(0.16, 1, 0.3, 1),
      padding-top 0.38s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
    contain: paint;
  }
  .my-list-btns.is-open .my-list-row {
    grid-template-rows: 1fr;
  }
  .my-list-btns.is-open .my-list-row-inner {
    opacity: 1;
    transform: translateY(0) translateZ(0);
    padding-top: 10px;
  }


  /* На мобильном тосты (напр. "Добавлено в список") всплывали поверх
     нижней плавающей навигации (.mobile-bottom-nav) в правом нижнем
     углу — правило ниже поднимает контейнер тостов над навигацией
     (высота --mobile-nav-height + небольшой зазор), с учётом
     safe-area на iPhone, и центрирует их по ширине экрана, а не
     жмёт в правый угол, где на мобильном для этого мало места. */
  .toast-container {
    bottom: calc(var(--mobile-nav-height) + 12px + env(safe-area-inset-bottom, 0px));
    right: 12px;
    left: 12px;
    align-items: center;
  }
  .toast { width: 100%; max-width: 360px; }

  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 800;
    backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(180%);
    background: rgba(6, 8, 15, 0.94);
    backdrop-filter: blur(min(28px, var(--pf-cap, 999px))) saturate(190%);
    -webkit-backdrop-filter: blur(min(28px, var(--pf-cap, 999px))) saturate(190%);
    background: rgba(14, 14, 18, 0.75);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  html, body {
    overflow-x: clip !important;
    max-width: 100vw !important;
    width: 100% !important;
  }
  body {
    padding-top: 60px;
    position: relative;
  }
  .header-inner { padding: 8px 14px; gap: 10px; height: 60px; }
  .header-inner--top { height: 60px; }
  .header-inner--bottom { display: none !important; }
  .logo-icon-wrap, .logo-svg { width: 44px; height: 44px; }
  .header-nav { display: none !important; }
  .logo-text { font-size: 15px; }
  .search-wrap { flex: 1; min-width: 0; }
  .search-input { font-size: 16px; padding: 8px 12px; height: 38px; }
  .search-input { font-size: 16px; padding: 8px 12px 8px 38px !important; height: 38px; }

  /* ── Защита от авто-приближения (zoom) на iPhone при фокусе на поля ввода ──
     iOS Safari автоматически увеличивает масштаб экрана при тапе в поле ввода,
     если его font-size < 16px. Устанавливаем 16px для поиска, фильтра каталога,
     списков, окна логина/регистрации, формы смены пароля, профиля и друзей. */
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="search"],
  input[type="tel"],
  input[type="number"],
  input[type="date"],
  input[type="url"],
  textarea,
  select,
  .search-input,
  .filter-tags-input,
  .filter-year-input,
  .genre-picker-search,
  .filter-select,
  .auth-input,
  .friends-search-input,
  .sup-input,
  .sup-textarea,
  .import-input,
  .chat-input,
  .cmt-input,
  .cmt-textarea {
    font-size: 16px !important;
  }
  .telegram-link-btn { width: 34px; height: 34px; margin-left: 8px; border-radius: 10px; }
  .telegram-link-btn svg { width: 19px; height: 19px; }

  /* На мобильном колокольчик уведомлений и кнопка аккаунта переезжают
     в нижнюю навигацию/попап "Ещё" (#mobileBottomNav, #notifBellBtnMobile
     в мобильном попапе настроек) — здесь, в верхней строке, они только
     отнимают ширину у поля поиска. Схлопываем блок до нулевого размера
     (а не display:none!) и прячем содержимое визуально — .notif-bell-wrapper
     должен ОСТАТЬСЯ в layout, а не выпасть из него: js/notifications.js
     монтирует #notifDropdown как её потомка (_ensureDropdown()), и хотя на
     мобильном сам дропдаун переключается на position:fixed (см. .notif-dropdown
     в @media max-width:768px ниже в файле), fixed-потомок всё равно не
     рендерится, если предок имеет display:none — тогда мобильная кнопка
     "Уведомления" в попапе "Ещё" переставала открывать список. */
  .header-top-spacer { display: none !important; }
  .header-top-right {
    width: 0;
    min-width: 0;
    max-width: 0;
    gap: 0;
    flex-shrink: 0;
  }
  .header-top-right > *:not(.notif-bell-wrapper) { display: none !important; }
  .notif-bell-btn { display: none !important; }
  .main-content {
    padding: 16px 12px calc(var(--mobile-nav-height, 74px) + env(safe-area-inset-bottom, 16px) + 24px) !important;
    overflow-x: clip !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  .site-footer {
    overflow-x: clip !important;
    max-width: 100% !important;
    box-sizing: border-box;
    padding-bottom: calc(var(--mobile-nav-height, 74px) + env(safe-area-inset-bottom, 16px) + 24px) !important;
  }
  .grid-carousel {
    overflow-x: clip !important;
    max-width: 100% !important;
  }
  .grid-carousel-track.anime-grid,
  .grid-carousel-track.featured-grid,
  .grid-carousel-track.seasons-grid,
  .grid-carousel-track.continue-watching-grid {
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
  }

  /* Grid — тот же стандартный размер постера, что на ПК (--poster-min-width,
     165px по умолчанию). minmax(X, 1fr) растягивал бы колонки на всю
     ширину строки — на мобильном с малым числом колонок (обычно 2) это
     сильно раздувало постер по сравнению с десктопом. Фиксированная
     ширина колонки (без 1fr) держит постер ровно на заданном размере;
     justify-content:center делит свободный остаток экрана поровну по
     краям строки, так что ряд карточек стоит по центру, а не прижат
     влево. .featured-grid остаётся justify-content:start — это трек
     горизонтальной карусели (см. .grid-carousel-track ниже), там
     карточки должны идти строго от левого края ленты. */
  .anime-grid { grid-template-columns: repeat(auto-fill, var(--poster-min-width, 165px)); justify-content: center; gap: 12px; width: 100%; box-sizing: border-box; }
  .featured-grid { grid-template-columns: repeat(auto-fill, var(--poster-min-width, 165px)); justify-content: center; width: 100%; box-sizing: border-box; }
  .seasons-grid { grid-template-columns: repeat(auto-fill, var(--poster-min-width, 165px)); justify-content: center; gap: 12px; width: 100%; box-sizing: border-box; }

  /* Cards */
  .anime-card { overflow: hidden; min-width: 0; max-width: 100%; }
  .card-title { font-size: 12px; }
  .card-body { padding: 18px 10px 9px; }

  /* Section headers */
  .featured-block, .list-section { overflow-x: clip; max-width: 100%; }
  .featured-header, .list-header { padding: 0 12px; margin-bottom: 14px; }
  .featured-title, .section-title { font-size: 11px; white-space: normal; letter-spacing: 1px; line-height: 1.3; }
  .featured-line { flex-shrink: 1; min-width: 8px; }

  /* Modals */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-box, .modal-box--wide { width: 100%; max-width: 100%; border-radius: 28px 28px 0 0; max-height: 90vh; overflow-y: auto; margin: 0; padding: 20px 16px 32px; }
  .modal-header { margin-bottom: 16px; }

  /* ── Мобильные окна из "Ещё" (.modal-overlay--sheet) — то же "полное
     слияние" со стеклянной нижней навигацией, что и у #mobileListsPopup/
     #mobileSettingsPopup (см. .mobile-lists-popup/.mobile-settings-popup
     выше). Класс .modal-overlay--sheet стоит только на тех 6 модалках,
     что открываются из пунктов попапа "Ещё" (Фон, Размер постеров, Темы
     сайта, Приватность, Поддержка, Импорт/Экспорт — см. index.html) —
     не на все .modal-overlay подряд: трейлер и лайтбокс картинок — это
     полноэкранный просмотр медиа с уже своей мобильной адаптацией
     (крестик скрыт и т.п.), а не карточка настроек, превращать их в
     "лист снизу" не нужно и визуально неверно.

     На десктопе класс ничего не меняет (сработает уже существующий
     общий .modal-box, отцентрированный) — этот блок целиком внутри
     @media(max-width:768px). Слияние даёт JS: пока любая такая модалка
     открыта, #mobileBottomNav получает класс .sheet-open (см.
     initModalSheetMerge в конце index.html) — тот же принцип, что и у
     .settings-open/.lists-open для двух других мобильных попапов, только
     общий на все 6 модалок разом (не пришлось бы дублировать вызов в
     каждой из ~15 open/close функций по всем файлам). */
  .modal-overlay--sheet .modal-box,
  .modal-overlay--sheet .modal-box--wide {
    background: rgba(240, 240, 245, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-bottom: none;
    border-radius: 26px 26px 0 0;
    backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(200%);
    -webkit-backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(200%);
    box-shadow: 0 -6px 30px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.18);
    /* Подтягиваем низ листа вплотную к верху капсулы .mobile-nav-items —
       тот же расчёт отступа, что и у .mobile-lists-popup/.mobile-settings-popup. */
    margin-bottom: calc(var(--mobile-nav-height) - 8px + env(safe-area-inset-bottom, 0px));
    max-height: calc(100vh - var(--mobile-nav-height) - env(safe-area-inset-bottom, 0px) - env(safe-area-inset-top, 0px) - 24px);
    max-height: calc(100dvh - var(--mobile-nav-height) - env(safe-area-inset-bottom, 0px) - env(safe-area-inset-top, 0px) - 24px);
  }
  .modal-overlay--sheet .modal-header,
  .modal-overlay--sheet .modal-body {
    background: none;
    border-color: rgba(255, 255, 255, 0.14);
  }
  .modal-overlay--sheet .modal-title { color: #fff; }
  .modal-overlay--sheet .modal-close,
  .modal-overlay--sheet .modal-close-text {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: rgba(240, 240, 245, 0.75);
  }

  /* Лайтбокс скриншотов: на мобильном крестик закрытия скрыт — закрытие
     идёт по тапу на фон (closeImageLightboxOutside, уже навешан в
     разметке) или системным жестом "назад", как в остальных мобильных
     bottom-sheet модалках проекта. Сам .lightbox-close остаётся в DOM
     и в disk/desktop-раскладке работает как прежде — тут только
     мобильный @media его прячет. */
  .lightbox-close { display: none; }

  /* Detail page */
  .detail-widget-frame { padding: 14px; }
  .detail-layout { grid-template-columns: 1fr !important; gap: 18px; }
  /* ── Мобильный инфо-блок — Вариант D ───────────────────────────────
     Постер нормального размера (пропорция 2:3, ширина 120px) и текст
     идут одной строкой. Таймер — отдельным блоком с рамкой во всю
     ширину под этой строкой (не помещался компактно узкой колонкой
     рядом с текстом, поэтому вынесен вниз как самостоятельный блок). */
  .detail-poster-col {
    position: static;
    display: grid;
    grid-template-columns: 165px minmax(0, 1fr);
    grid-auto-rows: auto;
    column-gap: 14px;
    row-gap: 4px;
    align-items: start;
  }
  .poster-glow-wrap {
    grid-column: 1;
    grid-row: 1;
    width: 165px;
    align-self: start;
  }
  /* Постер сохраняет нормальные пропорции постера (2:3 от ширины). */
  .detail-poster-flip {
    width: 100%;
  }
  #detailMeta { display: none !important; }
  .mobile-detail-info { grid-column: 2; grid-row: 1; min-width: 0; }
  /* Таймер — отдельный блок с рамкой во всю ширину, под постером
     и текстом (не в узкой колонке рядом с постером). */
  #detail-countdown {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 10px 0 0;
    width: 100%;
    box-sizing: border-box;
  }
  #myListBtns { grid-column: 1 / -1; grid-row: 3; width: 100%; box-sizing: border-box; margin-top: 10px; }
  .detail-title { font-size: 20px; }
  .detail-meta { font-size: 13px; }

  /* Флип на мобильном: задняя сторона скрыта, курсор обычный */
  .detail-poster-flip { cursor: default; }
  .detail-poster-face-back { display: none !important; }

  /* Мобильный инфо-блок рядом с постером — без фона/рамки */
  .mobile-detail-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: 'Rajdhani', sans-serif;
    padding-top: 2px;
    min-width: 0;
  }
  .mobile-detail-info .mdi-status {
    display: inline-block;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    margin-right: 6px;
    vertical-align: middle;
  }
  .mobile-detail-info .mdi-status.is-airing   { background: rgba(232,232,232,0.12); color: var(--green); border: 1px solid rgba(232,232,232,0.28); }
  .mobile-detail-info .mdi-status.is-announce { background: rgba(168,168,168,0.12); color: #a8a8a8;     border: 1px solid rgba(168,168,168,0.28); }
  .mobile-detail-info .mdi-status.is-done     { background: rgba(207,207,207,0.10); color: #cfcfcf;      border: 1px solid rgba(207,207,207,0.24); }
  .mobile-detail-info .mdi-score {
    display: inline-block;
    font-size: 19px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.5px;
    vertical-align: middle;
  }
  .mobile-detail-info .mdi-score span { font-size: 10px; font-weight: 600; color: var(--text-dim); margin-left: 2px; }
  .mobile-detail-info .mdi-rows { display: flex; flex-direction: column; gap: 3px; margin-top: 2px; min-width: 0; }
  .mobile-detail-info .mdi-row-line { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 100%; }
  .mobile-detail-info .mdi-row-line b { color: var(--text); font-weight: 700; }
  .mobile-detail-info .mdi-row-line .mdi-sep { color: var(--text-dim); margin: 0 4px; }

  /* Schedule — стандартный размер постера наследуется из базового
     .schedule-card (--poster-min-width), override под колонки убран
     по той же причине, что и в @media(max-width:768px) выше. */
  .schedule-day-header { font-size: 13px; }

  /* Filters */
  .filter-grid { grid-template-columns: 1fr; gap: 12px; }
  .filter-panel { padding: 16px; }
  .filter-select { font-size: 14px; width: 100%; box-sizing: border-box; }
  .filter-actions { flex-wrap: wrap; }
  .filter-apply-btn { flex: 1; justify-content: center; }

  /* Player — на мобильных растягиваем на всю ширину экрана без боковых отступов */
  .player-wrap {
    border-radius: 0;
    margin-left: -12px;
    margin-right: -12px;
    margin-bottom: 16px;
  }
  /* Новый плеер-блок (.npb) — растягиваем на всю ширину экрана, компенсируя
     боковой padding РОДИТЕЛЯ .detail-widget-frame. Сама .detail-widget-frame
     теперь full-bleed (компенсирует .main-content своим отрицательным
     margin — см. блок "Мобильная адаптация" ниже по файлу), поэтому .npb
     достаточно компенсировать только padding рамки, а не сумму с
     .main-content. У .detail-widget-frame боковой padding разный на разных
     брейкпоинтах: 16px на ≤768px и 12px на ≤480px → -16px и -12px. */
  .npb {
    border-radius: 0;
    margin-left: -16px;
    margin-right: -16px;
    margin-bottom: 16px;
  }

  /* BG modal */
  #bgModal .modal-box { padding-bottom: 40px; }
}

@media (max-width: 480px) {
  /* .detail-widget-frame здесь получает padding: 14px 12px (см. блок
     "Мобильная адаптация" ниже по файлу) — боковой padding 12px вместо
     16px на 768px, поэтому компенсация плеера тоже меньше. */
  .npb {
    margin-left: -12px;
    margin-right: -12px;
  }
}

@media (max-width: 380px) {
  .anime-grid { grid-template-columns: repeat(auto-fill, var(--poster-min-width, 165px)); justify-content: center; gap: 8px; }
  .seasons-grid { grid-template-columns: repeat(auto-fill, var(--poster-min-width, 165px)); justify-content: center; gap: 8px; }
  .logo-text { display: none; }
  .mobile-nav-btn { font-size: 9px; padding: 6px 8px; min-width: 44px; }
}

@media (max-width: 768px) and (orientation: landscape) {
  .mobile-bottom-nav { display: none; }
  .header-nav { display: flex !important; }
  .main-content { padding: 12px 12px 0 !important; overflow-x: clip; }
  .player-wrap { margin-left: -12px; margin-right: -12px; }
  .npb { border-radius: 0; margin-left: -16px; margin-right: -16px; }
  .detail-widget-frame { margin-left: -12px; margin-right: -12px; }
}

/* Mobile countdown — самостоятельный блок с рамкой во всю ширину,
   под постером и текстом (узкая колонка рядом с постером не годилась —
   таймер туда не помещался аккуратно). Обводка и фон как на десктопе,
   но компактнее: меньше padding и меньше размер цифр. */
@media (max-width: 768px) {
  .detail-countdown {
    background: linear-gradient(135deg, var(--green-faint) 0%, rgba(232,232,232,0.02) 100%);
    border: 1px solid rgba(232,232,232,0.2);
    border-left: 3px solid var(--green);
    border-radius: var(--radius);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 7px;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    margin: 10px 0 0;
  }
  .countdown-label { font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0; white-space: nowrap; }
  .countdown-timer { display: flex; flex-wrap: nowrap; align-items: baseline; gap: 6px; margin-bottom: 0; }
  .cd-unit { display: inline-flex; flex-direction: row; align-items: baseline; width: auto; min-width: 0; flex: 0 0 auto; }
  .cd-num { font-size: 15px; font-weight: 800; font-family: 'Orbitron', monospace; letter-spacing: -0.2px; color: var(--green); }
  .cd-lbl { font-size: 10px; margin: 0 0 0 1px; letter-spacing: 0; text-transform: none; color: var(--text-muted); font-weight: 700; }
  .cd-sep { display: none; }
  .countdown-date { display: none; }
  .cd-already { font-size: 13px !important; font-weight: 800; color: var(--green) !important; white-space: nowrap; }
}

/* Мобильные переопределения панели селекторов (озвучка/плеер/серия) —
   см. блок ниже, после .npb-similar-grid: перенесены туда специально,
   чтобы гарантированно идти ПОСЛЕ базовых правил .npb-selectors/
   .npb-dd-btn в каскаде (при одинаковой специфичности побеждает то,
   что физически ниже в файле, а не то, что внутри @media). */

/* =====================================================
   LOGO ANIMATIONS
   ===================================================== */
@keyframes logoEnter {
  0%   { transform: rotate(0deg) scale(1); }
  40%  { transform: rotate(18deg) scale(1.22); filter: drop-shadow(0 0 30px rgba(232,232,232,1)) drop-shadow(0 0 10px rgba(207,207,207,0.9)); }
  70%  { transform: rotate(12deg) scale(1.16); }
  100% { transform: rotate(15deg) scale(1.18); filter: drop-shadow(0 0 24px rgba(232,232,232,1)) drop-shadow(0 0 8px rgba(207,207,207,0.8)); }
}

@keyframes logoHoverSpin {
  0%   { transform: rotate(0deg)   scale(1.1);  filter: drop-shadow(0 0 16px rgba(232,232,232,0.8)); }
  25%  { transform: rotate(8deg)   scale(1.2);  filter: drop-shadow(0 0 32px rgba(232,232,232,1)) drop-shadow(0 0 10px rgba(207,207,207,0.9)); }
  50%  { transform: rotate(0deg)   scale(1.12); filter: drop-shadow(0 0 20px rgba(232,232,232,0.9)); }
  75%  { transform: rotate(-8deg)  scale(1.2);  filter: drop-shadow(0 0 32px rgba(232,232,232,1)) drop-shadow(0 0 10px rgba(207,207,207,0.9)); }
  100% { transform: rotate(0deg)   scale(1.1);  filter: drop-shadow(0 0 16px rgba(232,232,232,0.8)); }
}

/* =====================================================
   NEW PLAYER BLOCK (.npb-*)
   ===================================================== */
.npb {
  background:
    linear-gradient(rgba(240,240,245,0.06), rgba(240,240,245,0.06)),
    rgba(16,16,16,0.6);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow:
    0 0 40px rgba(232,232,232,0.04),
    inset 0 1px 0 rgba(255,255,255,0.1);
  backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(180%);
  -webkit-backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(180%);
}
.npb.hidden { display: none; }

.npb-tabs { display: flex; background: rgba(13, 13, 13, 0.5); border-bottom: 1px solid rgba(255,255,255,0.14); }
.npb-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 22px;
  height: 46px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
  white-space: nowrap;
}
.npb-tab:hover { color: var(--green); background: rgba(232,232,232,0.04); }
.npb-tab.active { color: var(--green); border-bottom-color: var(--green); background: rgba(232,232,232,0.06); }

.npb-tab-content { display: none; }
.npb-tab-content.active { display: block; }

/* ── Оверлей поверх видео (селекторы озвучки/плеера + серии) ──────────
   Раньше .npb-selectors и .npb-eps-row шли отдельными блоками ПЕРЕД
   .npb-iframe-wrap в обычном потоке документа — то есть над плеером,
   а не поверх него. Теперь оба лежат внутри .npb-overlay, который
   абсолютно позиционирован поверх верхней части iframe (как в примере:
   строка выбора озвучки/плеера прямо на кадре видео), не занимая места
   в потоке и не сдвигая сам плеер вниз. */
.npb-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  pointer-events: none;
}
.npb-overlay > * { pointer-events: auto; }

/* iOS-style "стекло": сильный blur+saturate, полупрозрачная светлая
   заливка вместо тёмной сплошной, тонкая светлая обводка по всему
   периметру (не только снизу) + мягкая внешняя тень — тот же материал,
   что у .npb-ep/.hero-badge (milk glass), но чуть светлее и с более
   выраженным скруглением, раз панель теперь плавает поверх видео. */
.npb-selectors {
  display: inline-flex;
  flex-wrap: wrap;
  /* inline-flex вместо flex — раньше контейнер растягивался на всю
     ширину .npb-overlay (то есть на всю ширину видео), даже когда
     дропдаунам не нужно столько места: получалась широкая тёмная
     плашка с большими пустыми промежутками между пунктами. Теперь
     ширина панели равна сумме её содержимого — компактная плашка
     слева, заканчивается сразу после последнего пункта/кнопки.
     flex-wrap подстраховывает узкие экраны: если контенту не хватает
     места по горизонтали, лишние пункты уходят на вторую строку той же
     плашки, а не обрезаются многоточием. */
  max-width: calc(100% - 20px);
  align-items: stretch;
  gap: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.03)),
    rgba(20,20,24,0.42);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 14px;
  backdrop-filter: blur(min(22px, var(--pf-cap, 999px))) saturate(180%);
  -webkit-backdrop-filter: blur(min(22px, var(--pf-cap, 999px))) saturate(180%);
  box-shadow: 0 8px 24px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.14);
  position: relative;
  margin: 10px 10px 0;
  overflow: visible;
}
.npb-selectors + .npb-eps-row { margin-top: 6px; }
.npb-select-wrap { position: relative; display: flex; align-items: center; border-right: 1px solid rgba(255,255,255,0.14); flex: 0 0 auto; min-width: 0; }
.npb-select-wrap:last-child { border-right: none; }
/* Крайние ячейки повторяют скругление .npb-selectors, иначе кнопка
   внутри перекрывала бы скруглённые углы родителя прямыми краями. */
.npb-selectors > .npb-select-wrap:first-child,
.npb-selectors > .npb-dd-wrap:first-child { border-top-left-radius: 14px; border-bottom-left-radius: 14px; overflow: hidden; }
.npb-selectors > .npb-select-wrap:last-child,
.npb-selectors > .npb-dd-wrap:last-child,
.npb-selectors > .npb-trailer-btn:last-child { border-top-right-radius: 14px; border-bottom-right-radius: 14px; overflow: hidden; }
.npb-select-sub { flex: 0 0 auto; }
.npb-select-sub::after { display: none; }
.npb-sub-input { padding-right: 42px !important; color: var(--text-muted) !important; cursor: default !important; width: 130px; }

/* ── Кастомный дропдаун озвучки/плеера (замена нативного <select>) ──
   Нативный <select>/<option> не даёт полностью управлять цветом
   выделения/hover пункта через CSS — браузер подмешивает свою системную
   палитру (белая подсветка активного пункта, синий/серый hover), из-за
   чего список получался чёрно-белым и выбивался из общей серо-чёрной
   темы сайта. Здесь список — обычный <div> с ролью listbox, целиком
   раскрашенный CSS-переменными темы (--bg-card/--border/--green), так
   что при смене темы сайта (site-themes.js) дропдаун меняется вместе
   с остальным интерфейсом. */
.npb-dd { position: relative; width: 100%; }
.npb-dd-wrap { flex: 0 0 auto; position: relative; z-index: 1; }
/* Пока список открыт (floating, z-index:9999 в body) — кнопка должна
   оставаться кликабельной поверх него, иначе при плотной геометрии
   верхний край списка может перекрыть нижний край кнопки, и повторный
   клик "для закрытия" улетает в список вместо кнопки (см. _npbToggleDropdown). */
.npb-dd-wrap.is-open { z-index: 10000; }
.npb-dd-btn { position: relative; z-index: 1; }
.npb-dd-btn {
  width: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 12px 32px 12px 16px;
  cursor: pointer;
  outline: none;
  text-align: left;
  white-space: nowrap;
}
.npb-dd-btn .npb-dd-star { flex: 0 0 auto; }
.npb-dd-btn .npb-dd-label { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.npb-select-wrap::after,
.npb-dd-wrap::after { content: ''; position: absolute; right: 12px; top: 50%; transform: translateY(-50%) rotate(0deg); width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid var(--text-muted); pointer-events: none; transition: transform var(--t-fast); }
.npb-dd-wrap.is-open::after { transform: translateY(-50%) rotate(180deg); }

.npb-dd-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 40;
  margin-top: 6px;
  /* iOS action-sheet: сильный blur вместо сплошной заливки — фон/видео
     позади списка просвечивает размытым пятном, как во всех системных
     всплывающих меню на iPhone. */
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)),
    rgba(28,28,32,0.6);
  backdrop-filter: blur(min(24px, var(--pf-cap, 999px))) saturate(180%);
  -webkit-backdrop-filter: blur(min(24px, var(--pf-cap, 999px))) saturate(180%);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 12px;
  box-shadow: 0 12px 34px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.12);
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
  display: none;
}
.npb-dd-wrap.is-open .npb-dd-list { display: block; }
/* Список "телепортируется" в <body> при открытии (см. JS,
   _npbOpenDropdown) — родительский .npb имеет overflow:hidden (нужен
   для скруглённых углов плеера и вкладок), и абсолютно позиционированный
   список внутри него физически обрезался бы этим overflow, даже с
   большим z-index (z-index не спасает от clipping предком). Пока список
   лежит в body, ему нужны собственные fixed-координаты, которые JS
   выставляет через getBoundingClientRect() кнопки — .npb-dd-list--floating
   только переключает position/margin, конкретные top/left/width каждый
   раз считаются в JS.
   ВАЖНО: правило .npb-dd-wrap.is-open .npb-dd-list выше требует, чтобы
   список был ПОТОМКОМ .npb-dd-wrap — а после телепорта в body это уже
   не так (список лежит рядом, в body). Поэтому видимость floating-списка
   задаётся отдельно, напрямую по классу --floating, а не через предка.
   Исключение — дропдаун серий (.npb-dd-ep-panel): там "плавающим"
   элементом является панель целиком (список + поиск над ним), поэтому
   .npb-dd-list внутри неё не должен сам иметь position:absolute/
   display:none — эту логику берёт на себя .npb-dd-ep-panel ниже. */
.npb-dd-ep-panel .npb-dd-list {
  position: static;
  display: block;
  margin-top: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: transparent;
  max-height: 280px;
}
.npb-dd-list.npb-dd-list--floating {
  display: block;
  /* position:fixed → position:absolute (координаты документа): список
     теперь "приклеен" к кнопке через нормальный поток документа и сам
     едет вместе со страницей при скролле, а не остаётся висеть на месте
     экрана пока страница уезжает из-под него (см. _npbPositionFloatingList
     в index.html — там же был убран слушатель scroll, он больше не
     нужен). */
  position: absolute;
  margin-top: 0;
  /* Ниже и хедера (.site-header: z-index 100), и мобильной нижней
     навигации (.mobile-bottom-nav: z-index 900) — список никогда не
     должен визуально перекрывать ни верхнюю, ни нижнюю панель. Верхнюю
     границу список и так не пересекает (открывается вниз от кнопки),
     а нижнюю не пересекает благодаря _npbFloatingBottomLimit() в JS —
     z-index здесь только подстраховка на случай пограничных случаев. */
  z-index: 60;
}
.npb-dd-list::-webkit-scrollbar { width: 4px; }
.npb-dd-list::-webkit-scrollbar-thumb { background: var(--border-hl); border-radius: 2px; }

/* Панель дропдауна серий — обёртка над (опциональным) полем поиска и
   самим списком. У обычных дропдаунов (озвучка/плеер) плавает и
   позиционируется сам .npb-dd-list; у серий, когда их >100, плавает эта
   панель целиком, чтобы поиск оставался прилипшим к верху списка и не
   прокручивался вместе с пунктами. */
.npb-dd-ep-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 40;
  margin-top: 6px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)),
    rgba(28,28,32,0.6);
  backdrop-filter: blur(min(24px, var(--pf-cap, 999px))) saturate(180%);
  -webkit-backdrop-filter: blur(min(24px, var(--pf-cap, 999px))) saturate(180%);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 12px;
  box-shadow: 0 12px 34px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.12);
  overflow: hidden;
  display: none;
}
.npb-dd-wrap.is-open .npb-dd-ep-panel { display: flex; flex-direction: column; }
.npb-dd-ep-panel.npb-dd-list--floating {
  display: flex;
  flex-direction: column;
  /* См. комментарий у .npb-dd-list.npb-dd-list--floating выше — та же
     замена fixed → absolute, чтобы панель ехала вместе со страницей. */
  position: absolute;
  margin-top: 0;
  right: auto;
  box-sizing: border-box;
  /* Тот же z-index, что и у обычного плавающего списка выше — ниже и
     хедера, и нижней навигации. */
  z-index: 60;
  overflow: hidden;
}
.npb-dd-ep-search-wrap {
  display: none;
  flex: 0 0 auto;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  padding: 8px;
}
.npb-dd-ep-search-wrap.is-visible { display: block; }
.npb-dd-ep-search {
  width: 100%;
  box-sizing: border-box;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px;
  outline: none;
}
.npb-dd-ep-search::placeholder { color: var(--text-muted); font-weight: 500; }
.npb-dd-ep-search:focus { border-color: var(--border-hl); }


.npb-dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 14px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  background: transparent;
  transition: background var(--t-fast), color var(--t-fast);
  white-space: nowrap;
}
.npb-dd-item:hover { background: rgba(232,232,232,0.07); }
.npb-dd-item.is-active { color: var(--green); background: rgba(232,232,232,0.05); }
.npb-dd-item.is-active::before {
  content: '';
  flex: 0 0 auto;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--green);
}
.npb-dd-item:not(.is-active)::before { content: ''; flex: 0 0 auto; width: 5px; }
.npb-dd-item-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Звёздочка избранного — на кнопке дропдауна и на каждом пункте списка.
   Приглушённо-серая (--text-muted) в обычном виде, золотая (тот же
   акцент, что у .tt-score-star — рейтинговая звезда) когда отмечена,
   чтобы "избранное" читалось как явный, узнаваемый статус, а не просто
   ещё один серый элемент среди прочих. */
.npb-dd-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  flex: 0 0 auto;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: var(--text-dim, var(--text-muted));
  cursor: pointer;
  padding: 0;
  transition: color var(--t-fast), background var(--t-fast);
}
.npb-dd-star svg { width: 13px; height: 13px; display: block; }
.npb-dd-star:hover { color: var(--text-muted); background: rgba(232,232,232,0.08); transform: none; }
.npb-dd-star.is-fav { color: #ffd700; }
.npb-dd-star.is-fav:hover { color: #ffe550; }
.npb-dd-btn .npb-dd-star.is-fav svg { filter: drop-shadow(0 0 4px rgba(255,215,0,0.35)); }

/* Пользователь без аккаунта (гость) — скрываем звёздочки выбора любимой озвучки и плеера */
/* Пользователь без аккаунта (гость) — строго скрываем:
   1. Пункты меню аккаунта (Профиль, Друзья, Выйти, Импорт, Админ-панель)
   2. Кнопки жалоб (на комментарии, в профиле, на аватар) и модалку жалобы
   3. Мобильные пункты сообщества
   4. Звёздочки любимой озвучки и плеера */
body.is-guest #tabProfile,
body.is-guest #tabFriends,
body.is-guest #tabImportDivider,
body.is-guest #tabImport,
body.is-guest #tabLogoutDivider,
body.is-guest #tabLogout,
body.is-guest #tabAdminPanel,
body.is-guest .profile-report-btn,
body.is-guest .profile-avatar-flag-btn,
body.is-guest .site-cmt-report-btn,
body.is-guest #reportModal,
body.is-guest #mobileCommunityLabel,
body.is-guest #mobileLogoutDivider,
body.is-guest .npb-dd-star,
body.is-guest #npbDubStar,
body.is-guest #npbPlayerStar {
  display: none !important;
}

/* Галочка "просмотрено" в дропдауне серий — та же геометрия, что
   .npb-dd-star, но не кликабельна сама по себе (статус, не переключатель;
   переключается через ПКМ на пункте/кнопке, см. onContextMenu в JS) и не
   отображает ничего, пока серия не просмотрена — пустое место той же
   ширины, чтобы подписи в списке не "прыгали" по горизонтали между
   просмотренными и непросмотренными пунктами. */
.npb-dd-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--green);
  cursor: default;
}
.npb-dd-check svg { width: 12px; height: 12px; display: block; }
.npb-dd-check.is-done { background: rgba(120, 230, 180, 0.16); }
.npb-dd-item .npb-dd-check { width: 18px; height: 18px; }
.npb-dd-item .npb-dd-check svg { width: 11px; height: 11px; }
.npb-sub-btn { position: absolute; right: 0; top: 0; bottom: 0; width: 40px; display: flex; align-items: center; justify-content: center; background: rgba(20, 20, 20, 0.8); border: none; border-left: 1px solid var(--border); color: var(--text-muted); cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
.npb-sub-btn:hover { background: rgba(232,232,232,0.08); color: var(--green); }

.npb-trailer-btn {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  background: rgba(232,232,232,0.06);
  border: none;
  border-left: 1px solid var(--border);
  color: var(--green);
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
}
.npb-trailer-btn:hover { background: rgba(232,232,232,0.14); color: var(--text); }
.npb-trailer-btn.hidden { display: none; }
.npb-trailer-btn svg { flex: 0 0 auto; }

.npb-eps-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 10px 16px 12px;
  max-height: 140px;
  overflow-y: auto;
}
.npb-eps-row::-webkit-scrollbar { width: 4px; }
.npb-eps-row::-webkit-scrollbar-thumb { background: var(--border-hl); border-radius: 2px; }

/* Сетка серий теперь скрыта визуально — выбор серии происходит через
   .npb-dd-wrap--ep дропдаун в строке селекторов (см. .npb-dd-check
   ниже). Кнопки .npb-ep остаются в DOM и полностью рабочими (клики,
   классы active/ep-seen, querySelector по data-ep) — на них держится
   вся логика автоотметки/истории/баннера "Следующая серия"; дропдаун
   просто кликает нужную кнопку программно. position:absolute +
   0×0 вместо display:none — иначе клик по скрытой кнопке в некоторых
   браузерах может вести себя иначе (например, не фокусируется), плюс
   элемент остаётся измеримым для getBoundingClientRect(), если он вдруг
   понадобится где-то ещё. */
.npb-eps-row--hidden {
  position: absolute;
  width: 0;
  height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
  max-height: 0;
  border: none;
  opacity: 0;
  pointer-events: none;
}

.npb-ep {
  min-width: 36px;
  height: 36px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  /* Milk glass — тот же материал, что у карточек статистики/профиля и
     .hero-badge: молочно-белый полупрозрачный слой поверх тёмной
     подложки, сильный blur+saturate, тонкая светлая обводка вместо
     плоской непрозрачной заливки. */
  background:
    linear-gradient(rgba(240,240,245,0.08), rgba(240,240,245,0.08)),
    rgba(18,18,24,0.55);
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(min(14px, var(--pf-cap, 999px))) saturate(180%);
  -webkit-backdrop-filter: blur(min(14px, var(--pf-cap, 999px))) saturate(180%);
  color: var(--text-muted);
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
}
.npb-ep:hover { border-color: var(--border-hl); color: var(--green); transform: scale(1.12); }
.npb-ep.active {
  background:
    linear-gradient(rgba(240,240,245,0.16), rgba(240,240,245,0.16)),
    linear-gradient(135deg, rgba(232,232,232,0.15), rgba(207,207,207,0.1));
  border-color: var(--green);
  color: var(--green);
  font-weight: 900;
  transform: scale(1.15);
  box-shadow: 0 0 14px rgba(232,232,232,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
}
.npb-ep.ep-seen { background: linear-gradient(rgba(240,240,245,0.05), rgba(240,240,245,0.05)), rgba(10,10,14,0.4); border-color: rgba(232,232,232,0.2); }
.npb-ep.ep-seen::after { content: ''; position: absolute; bottom: 3px; right: 3px; width: 5px; height: 5px; background: var(--green); border-radius: 50%; opacity: 0.7; }

.npb-iframe-wrap { position: relative; width: 100%; padding-top: 56.25%; background: #000; }
.npb-iframe-wrap .video-iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }

.npb-empty-msg { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 60px 20px; color: var(--text-muted); font-family: 'Rajdhani', sans-serif; font-size: 14px; letter-spacing: 1px; }
.npb-similar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 14px; padding: 18px; }

/* ── Мобильные переопределения панели селекторов ──────────────────
   Намеренно расположены здесь, ПОСЛЕ всех базовых .npb-selectors/
   .npb-dd-btn/.npb-dd-wrap правил выше — при одинаковой специфичности
   класса каскад CSS отдаёт приоритет правилу, которое физически ниже
   в файле, а @media само по себе приоритет не поднимает. Если эти
   блоки лежат раньше базовых правил, базовые их перебивают и мобильные
   переопределения визуально не действуют, хотя формально применяются
   (это уже случалось с flex-wrap/padding/font-size здесь). */

/* Кнопка трейлера на узких экранах — оставляем только иконку, иначе
   вместе с тремя дропдаунами (озвучка/плеер/серия) она распирает
   .npb-selectors и текст обрезается. На самых узких экранах текст
   подписей (изначально "Озвучка ..."/"Плеер ..."/"Серия N") всё равно
   не поместится целиком в одну строку рядом со всеми тремя дропдаунами
   — поэтому вместо переноса на 2 строки все три сжимаются в одну через
   flex: 1 1 0 + min-width: 0, а длинные названия обрезаются многоточием
   (.npb-dd-label уже имеет text-overflow: ellipsis). */
@media (max-width: 480px) {
  .npb-trailer-btn { padding: 0 12px; }
  .npb-trailer-btn span { display: none; }
  .npb-selectors { display: flex; flex-wrap: nowrap; width: 100%; max-width: none; }
  .npb-select-wrap, .npb-dd-wrap { flex: 1 1 0; min-width: 0; }
  .npb-dd-wrap--ep { border-right: none; }
  .npb-trailer-btn { flex: 0 0 auto; }
}

/* Компактная панель селекторов на телефоне — на узких экранах строка
   озвучка/плеер/серия занимает 2 строки (см. правило выше) и вместе с
   обычной высотой кнопок (padding 12px + font 13px) перекрывает заметную
   часть видео 16:9, включая центр, где плеер показывает свои собственные
   сообщения ("недоступен в вашем регионе" и т.п.). Здесь уменьшаем
   высоту и шрифт панели специально под мобильный размер, не трогая
   десктопную. Список (.npb-dd-item и внутренности) уменьшаем в той же
   пропорции, что и кнопку — иначе при открытии список выглядит крупнее
   самой кнопки, которая его открыла. */
@media (max-width: 480px) {
  .npb-overlay { top: 0; }
  .npb-selectors { margin: 3px 3px 0; border-radius: 9px; }
  .npb-selectors > .npb-select-wrap:first-child,
  .npb-selectors > .npb-dd-wrap:first-child { border-top-left-radius: 9px; border-bottom-left-radius: 9px; }
  .npb-selectors > .npb-select-wrap:last-child,
  .npb-selectors > .npb-dd-wrap:last-child,
  .npb-selectors > .npb-trailer-btn:last-child { border-top-right-radius: 9px; border-bottom-right-radius: 9px; }
  .npb-dd-btn { padding: 10px 24px 10px 11px; font-size: 13.5px; gap: 6px; line-height: 1.3; width: 100%; min-width: 0; }
  .npb-dd-wrap::after { right: 8px; border-left-width: 4.5px; border-right-width: 4.5px; border-top-width: 5px; }
  .npb-dd-btn .npb-dd-star, .npb-dd-btn .npb-dd-check { width: 17px; height: 17px; }
  .npb-dd-btn .npb-dd-star svg { width: 11px; height: 11px; }
  .npb-dd-btn .npb-dd-check svg { width: 10px; height: 10px; }
  .npb-trailer-btn { padding: 0 10px; }
  .npb-selectors + .npb-eps-row { margin-top: 3px; }

  /* Выпадающий список — тот же масштаб, что и кнопка выше. */
  .npb-dd-item { padding: 10px 12px 10px 12px; font-size: 13.5px; }
  .npb-dd-item .npb-dd-star, .npb-dd-item .npb-dd-check { width: 18px; height: 18px; }
  .npb-dd-item .npb-dd-star svg { width: 11px; height: 11px; }
  .npb-dd-item .npb-dd-check svg { width: 10px; height: 10px; }

  /* Поле поиска серии — тот же масштаб текста, что у пунктов списка,
     иначе на телефоне оно выглядит непропорционально крупным рядом с
     компактными "Серия N" ниже. */
  .npb-dd-ep-search-wrap { padding: 6px; }
  .npb-dd-ep-search { font-size: 12.5px; padding: 5px 8px; }
}

/* ── Модалка трейлера ─────────────────────────────────────
   Переиспользует .modal-overlay/.modal-box целиком (см. правила
   .modal-* выше) — здесь только то, что специфично для содержимого. */
.trailer-modal-box { max-width: 720px; }
.trailer-modal-body { padding: 16px 20px 20px; }
.trailer-picker-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.trailer-pill {
  padding: 7px 16px;
  border-radius: 20px;
  background: rgba(232,232,232,0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--t-fast);
}
.trailer-pill:hover { border-color: rgba(232,232,232,0.3); color: var(--green); }
.trailer-pill.active {
  background: linear-gradient(135deg, rgba(232,232,232,0.15), rgba(207,207,207,0.08));
  border-color: var(--green);
  color: var(--green);
}
.trailer-iframe-wrap { border-radius: var(--radius-sm); overflow: hidden; }

/* ── Лайтбокс случайных кадров ────────────────────────────
   #imgLightboxModal переиспользует .modal-overlay для фона/центрирования,
   но .lightbox-box сам по себе (не .modal-box) — контент важнее рамки.

   Лайтбокс для кадров из серий аниме:
   - Плавное зум-приближение (scale/opacity) из точки клика миниатюры
   - Фиксированная удобная круглая кнопка закрытия в правом верхнем углу
   - Адаптация под десктоп и мобильные устройства (safe-area)
   ===================================================== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 6, 8, 0.94);
  backdrop-filter: blur(min(24px, var(--pf-cap, 999px))) saturate(180%);
  -webkit-backdrop-filter: blur(min(24px, var(--pf-cap, 999px))) saturate(180%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  padding: 0;
  margin: 0;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}
.lightbox-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.lightbox-overlay.is-closing {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease-in;
}

/* Кнопка закрытия — чистый крестик без оболочки/пилюли */
.lightbox-close-btn {
  position: fixed;
  top: max(16px, env(safe-area-inset-top, 16px));
  right: max(16px, env(safe-area-inset-right, 16px));
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 0;
  background: transparent !important;
  border: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100005;
  transition: color 0.15s, opacity 0.15s;
  padding: 0;
}
.lightbox-close-btn:hover {
  background: transparent !important;
  border: none !important;
  color: #ffffff;
  transform: none;
}
.lightbox-close-btn:active {
  transform: none;
  opacity: 0.7;
}
.lightbox-close-btn svg {
  width: 26px;
  height: 26px;
  stroke-width: 2.2;
}

/* Контейнер кадра — на всю ширину экрана */
.lightbox-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100vw;
  max-width: 100vw;
  max-height: 100vh;
  transform: scale(0.7);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease;
  pointer-events: auto;
  cursor: pointer;
  padding: 0;
  margin: 0;
}
.lightbox-overlay.is-open .lightbox-container {
  transform: scale(1);
  opacity: 1;
}
.lightbox-overlay.is-closing .lightbox-container {
  transform: scale(0.75);
  opacity: 0;
  transition: transform 0.22s ease-in, opacity 0.2s ease-in;
}

/* Карточка картинки — во всю ширину */
.lightbox-img-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  max-width: 100vw;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.9);
  background: transparent;
  cursor: default;
}

/* Сама картинка — 100% ширины экрана */
.lightbox-img {
  display: block;
  width: 100vw;
  max-width: 100vw;
  height: auto;
  max-height: 84vh;
  object-fit: contain;
  border-radius: 0;
  cursor: default;
  transition: filter 0.3s ease;
}

/* Спиннер предзагрузки высокого разрешения */
.lightbox-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  z-index: 2;
  transition: opacity 0.2s ease;
}
.lightbox-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Подпись под кадром */
.lightbox-caption {
  color: rgba(255, 255, 255, 0.9);
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-align: center;
  background: rgba(18, 20, 26, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(min(14px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(14px, var(--pf-cap, 999px)));
  padding: 6px 18px;
  border-radius: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
}

@media (min-width: 1200px) {
  .lightbox-container {
    width: 100%;
    max-width: min(96vw, 1500px);
  }
  .lightbox-img-card {
    width: 100%;
    max-width: min(96vw, 1500px);
    border-radius: 12px;
  }
  .lightbox-img {
    width: 100%;
    max-width: min(96vw, 1500px);
    border-radius: 12px;
  }
}

@media (max-width: 768px) {
  .lightbox-close-btn {
    top: max(12px, env(safe-area-inset-top, 12px));
    right: max(12px, env(safe-area-inset-right, 12px));
    width: 42px;
    height: 42px;
  }
  .lightbox-img {
    width: 100vw;
    max-width: 100vw;
    max-height: 82vh;
    border-radius: 0;
  }
  .lightbox-img-card {
    width: 100vw;
    max-width: 100vw;
    border-radius: 0;
  }
  .lightbox-caption {
    font-size: 13px;
    padding: 5px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox-overlay,
  .lightbox-container,
  .lightbox-close-btn {
    transition: opacity 0.15s ease !important;
    transform: none !important;
  }
}

/* =====================================================
   COMMENTS (.cmts-*)
   ===================================================== */
.cmts-section {
  max-width: 1200px;
  margin: 0 auto 48px;
  padding: 0 24px;
  margin-top: 64px;
  position: relative;
}

.cmts-section::before {
  content: '';
  display: block;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(232,232,232,0.4) 20%, rgba(232,232,232,0.6) 50%, rgba(232,232,232,0.4) 80%, transparent 100%);
  margin-bottom: 44px;
  border-radius: 2px;
  box-shadow: 0 0 14px rgba(232,232,232,0.25), 0 0 30px rgba(232,232,232,0.08);
}
.cmts-section.hidden { display: none; }

/* ── Анимация раскрытия / закрытия блока комментариев ──
   Управляется через max-height + opacity + transform, чтобы переход был
   плавным "аккордеоном", а не резким display:none/block.
   .cmts-section больше не получает .hidden во время анимации — вместо
   этого JS навешивает .cmts-anim-open / .cmts-anim-closing (см. js/comments.js). */
.cmts-section {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-8px);
  transition:
    max-height 0.45s cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 0.32s ease,
    transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1),
    margin-top 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.cmts-section.cmts-anim-open {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .cmts-section { transition: opacity 0.2s ease; transform: none !important; }
}

.cmts-toggle-wrap { max-width: 1200px; margin: 64px auto 0; padding: 0 24px; display: flex; justify-content: center; }
.cmts-toggle-wrap.hidden { display: none; }

.cmts-toggle-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  /* Тот же iOS-эффект "стекла", что и у нижней мобильной навигации
     (.mobile-nav-items): почти прозрачный светлый фон, всю яркость и
     цвет вытягивает backdrop-filter из контента позади кнопки. */
  background: rgba(240, 240, 245, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 30px;
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--t-med);
  width: 100%;
  max-width: 520px;
  justify-content: center;
  backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(200%);
  will-change: backdrop-filter;
  box-shadow: 0 16px 40px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.18);
}
.cmts-toggle-btn:hover { background: rgba(240, 240, 245, 0.2); border-color: rgba(255, 255, 255, 0.35); box-shadow: 0 16px 40px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.28); }
.cmts-toggle-btn svg { color: var(--green); flex-shrink: 0; }
.cmts-toggle-btn .cmts-toggle-chevron {
  margin-left: 2px;
  transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
  flex-shrink: 0;
}
.cmts-toggle-btn.is-open .cmts-toggle-chevron { transform: rotate(180deg); }
.cmts-toggle-count { font-size: 12px; font-weight: 800; background: rgba(255,255,255,0.18); color: var(--green); border-radius: 20px; padding: 2px 12px; }
.cmts-toggle-spoiler { font-size: 12px; color: rgba(232,232,232,0.75); opacity: 0.9; letter-spacing: 0.3px; }

#commentsToggleWrap + #commentsSection,
#commentsToggleWrap ~ #commentsSection { margin-top: 24px; }

.cmts-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid rgba(232,232,232,0.1); }
.cmts-title { display: flex; align-items: center; gap: 10px; font-family: 'Orbitron', monospace; font-size: 14px; font-weight: 700; color: var(--text); margin: 0; }
.cmts-title svg { color: var(--green); flex-shrink: 0; }
.cmts-count { font-family: 'Rajdhani', sans-serif; font-size: 12px; font-weight: 800; background: rgba(232,232,232,0.1); color: var(--green); border-radius: 20px; padding: 2px 12px; }
.cmts-source { font-family: 'Rajdhani', sans-serif; font-size: 12px; color: var(--text-muted); letter-spacing: 1px; opacity: 0.7; }

.cmts-list { display: flex; flex-direction: column; gap: 14px; }

.cmt-card {
  display: flex;
  gap: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px 18px;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
  opacity: 0;
  transform: translateY(12px);
  animation: cmtIn 0.35s ease forwards;
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
@keyframes cmtIn { to { opacity: 1; transform: translateY(0); } }
.cmt-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.cmt-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; background: linear-gradient(135deg, #242424, #161616); border: 2px solid rgba(232,232,232,0.18); display: flex; align-items: center; justify-content: center; font-family: 'Orbitron', monospace; font-size: 14px; font-weight: 700; color: var(--green); overflow: hidden; }
.cmt-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cmt-avatar:has(.nf-av),
.cmt-avatar.cmt-avatar--framed { background: none !important; border: none !important; overflow: visible !important; box-shadow: none !important; }
.cmt-avatar .nf-av,
.site-cmt-avatar-link .nf-av { overflow: visible !important; }


.cmt-body { flex: 1; min-width: 0; }
.cmt-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.cmt-name { font-family: 'Rajdhani', sans-serif; font-size: 14.5px; font-weight: 700; color: #f4f4f6; letter-spacing: 0.3px; }
.cmt-date { font-size: 11.5px; color: rgba(255, 255, 255, 0.45); }
.cmt-score { display: flex; align-items: center; gap: 3px; font-size: 11px; font-family: 'Rajdhani', sans-serif; font-weight: 700; color: #f9c74f; }
.cmt-score svg { width: 11px; height: 11px; }
.cmt-text { font-size: 14px; line-height: 1.65; color: rgba(240, 240, 245, 0.85); word-break: break-word; }

.cmt-footer { display: flex; align-items: center; gap: 14px; margin-top: 10px; flex-wrap: wrap; }

.cmt-votes { display: flex; align-items: center; gap: 8px; }
.cmt-vote {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 6px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  line-height: 1;
  transition: all var(--t-fast);
}
.cmt-vote svg { width: 15px; height: 15px; flex-shrink: 0; transition: transform var(--t-fast), stroke var(--t-fast), fill var(--t-fast); }
.cmt-vote--like {
  color: rgba(255, 255, 255, 0.82);
  background: transparent !important;
  border: none !important;
}
.cmt-vote--like:hover { color: #ffffff; }
.cmt-vote--like:hover svg { transform: scale(1.18); }
.cmt-vote--like.active {
  background: transparent !important;
  border: none !important;
  color: #4ade80 !important;
}
.cmt-vote--like.active svg {
  stroke: #4ade80;
  fill: #4ade80;
}
.cmt-vote--dislike {
  color: rgba(255, 255, 255, 0.55);
  background: transparent !important;
  border: none !important;
}
.cmt-vote--dislike:hover { color: #ff6b6b; }
.cmt-vote--dislike:hover svg { transform: scale(1.18); }
.cmt-vote--dislike.active {
  background: transparent !important;
  border: none !important;
  color: #ff6b6b !important;
}
.cmt-vote--dislike.active svg {
  stroke: #ff6b6b;
  fill: #ff6b6b;
}

.cmt-replies-btn { display: inline-flex; align-items: center; gap: 5px; background: none; border: none; color: rgba(232,232,232,0.5); font-family: 'Rajdhani', sans-serif; font-size: 12px; font-weight: 600; cursor: pointer; padding: 3px 0; transition: color var(--t-fast); }
.cmt-replies-btn:hover { color: var(--green); }

.cmt-replies { margin-top: 12px; padding-left: 14px; border-left: 2px solid rgba(232,232,232,0.08); display: flex; flex-direction: column; gap: 10px; }
.cmt-reply { display: flex; gap: 10px; opacity: 0; transform: translateX(-6px); animation: cmtReplyIn 0.25s ease forwards; }
@keyframes cmtReplyIn { to { opacity: 1; transform: translateX(0); } }
.cmt-avatar--sm { width: 30px !important; height: 30px !important; font-size: 11px !important; }
.cmt-reply .cmt-text { font-size: 13px; }

.cmt-mention { color: var(--green); font-weight: 600; opacity: 0.85; }

/* ── Спойлер внутри текста комментария ── [спойлер="..."]...[/спойлер] ──
   Рендерится как inline-блок: кнопка-переключатель + скрытый текст,
   который плавно раскрывается через max-height (см. js/comments.js). */
.cmt-spoiler {
  display: block;
  margin: 8px 0;
}
.cmt-spoiler-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: rgba(232,232,232,0.06);
  border: 1px solid rgba(232,232,232,0.22);
  border-radius: 20px;
  color: var(--green);
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.cmt-spoiler-toggle:hover { background: rgba(232,232,232,0.11); border-color: rgba(232,232,232,0.4); }
.cmt-spoiler-toggle .cmt-spoiler-chevron {
  flex-shrink: 0;
  margin-left: 2px;
  transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.cmt-spoiler[data-spoiler-open="1"] .cmt-spoiler-chevron { transform: rotate(180deg); }
.cmt-spoiler[data-spoiler-open="1"] .cmt-spoiler-toggle { background: rgba(232,232,232,0.1); border-color: rgba(232,232,232,0.35); }

.cmt-spoiler-body {
  display: block;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.4s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.3s ease;
}
.cmt-spoiler-body--open { opacity: 1; }
.cmt-spoiler-body-inner {
  display: block;
  margin-top: 8px;
  padding: 10px 14px;
  background: rgba(232,232,232,0.03);
  border-left: 2px solid rgba(232,232,232,0.25);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #a8a8a8;
}
@media (prefers-reduced-motion: reduce) {
  .cmt-spoiler-body { transition: opacity 0.2s ease; }
  .cmt-spoiler-toggle .cmt-spoiler-chevron { transition: none; }
}

@keyframes cmtSpin { to { transform: rotate(360deg); } }
.cmt-spin { animation: cmtSpin 0.8s linear infinite; display: inline-block; }

.cmts-loader { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 32px; color: var(--text-muted); font-family: 'Rajdhani', sans-serif; font-size: 14px; }
.cmts-loader.hidden { display: none; }
.cmts-spinner { width: 20px; height: 20px; border: 2px solid rgba(232,232,232,0.1); border-top-color: var(--green); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.cmts-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px; color: var(--text-muted); font-family: 'Rajdhani', sans-serif; font-size: 14px; }
.cmts-empty.hidden { display: none; }

.cmts-load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 32px auto 16px;
  padding: 14px 32px;
  background: rgba(240, 240, 245, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 30px;
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--t-med);
  width: 100%;
  max-width: 520px;
  box-sizing: border-box;
  backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(200%);
  will-change: backdrop-filter;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform: none !important;
}
.cmts-load-more:hover {
  background: rgba(240, 240, 245, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transform: none !important;
}
.cmts-load-more:active {
  transform: none !important;
  opacity: 0.85;
}
.cmts-load-more.hidden { display: none !important; }

@media (max-width: 600px) {
  .cmts-section { padding: 0 12px; }
  .cmt-card { padding: 12px; gap: 10px; }
  .cmt-avatar { width: 32px; height: 32px; font-size: 12px; }
}

/* ═══════════════════════════════════════════════════
   SITE COMMENTS (свои комментарии NekoNest — .site-cmt-*)
   ═══════════════════════════════════════════════════ */

/* Второй заголовок ("с YummyAnime") — визуально отделяем от своего блока */
.cmts-header--secondary {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid rgba(232,232,232,0.1);
}

/* Форма отправки */
.site-cmt-form { margin-bottom: 24px; }
.site-cmt-form.hidden { display: none; }

.site-cmt-textarea,
.cmt-textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  background: rgba(232,232,232,0.04);
  border: 1px solid rgba(232,232,232,0.14);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  padding: 12px 14px;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.site-cmt-textarea:focus,
.cmt-textarea:focus {
  outline: none;
  border-color: var(--green);
  background: rgba(232,232,232,0.06);
}

.site-cmt-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.site-cmt-submit-btn {
  background: var(--green);
  color: #0a0a0a;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 26px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: opacity var(--t-fast), transform var(--t-fast);
}
.site-cmt-submit-btn:hover { opacity: 0.88; }
.site-cmt-submit-btn:active { transform: scale(0.97); }
.site-cmt-submit-btn:disabled { opacity: 0.5; cursor: default; }

.site-cmt-cancel-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(232,232,232,0.18);
  border-radius: var(--radius-sm);
  padding: 9px 20px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--t-fast);
}
.site-cmt-cancel-btn:hover { background: rgba(232,232,232,0.06); color: var(--text); }

.site-cmt-error {
  color: #ff5050;
  font-size: 12.5px;
  font-family: 'Rajdhani', sans-serif;
  margin-top: 8px;
}
.site-cmt-error.hidden { display: none; }

.site-cmt-guest {
  padding: 16px;
  margin-bottom: 24px;
  background: rgba(232,232,232,0.03);
  border: 1px dashed rgba(232,232,232,0.15);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: 'Rajdhani', sans-serif;
  font-size: 13.5px;
  text-align: center;
}
.site-cmt-guest.hidden { display: none; }
.site-cmt-guest a { color: var(--green); font-weight: 700; text-decoration: underline; cursor: pointer; }

/* Список своих комментариев — минимальный отступ снизу перед вторичным заголовком */
.site-cmts-list { margin-bottom: 4px; }

/* Бейдж "вы" рядом с именем автора своего же комментария */
.site-cmt-mine-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #0a0a0a;
  background: var(--green);
  border-radius: 20px;
  padding: 1px 8px;
}

/* Кнопки голосования — теперь кликабельные (в отличие от read-only YummyAnime) */
.site-cmt-vote-btn {
  background: transparent !important;
  font: inherit;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all var(--t-fast);
}
.site-cmt-vote-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  transition: transform var(--t-fast), stroke var(--t-fast), fill var(--t-fast);
}
.site-cmt-vote-btn.cmt-vote--like {
  color: rgba(255, 255, 255, 0.82);
  background: transparent !important;
  border: none !important;
}
.site-cmt-vote-btn.cmt-vote--like:hover { color: #ffffff; }
.site-cmt-vote-btn.cmt-vote--like:hover svg { transform: scale(1.18); }
.site-cmt-vote-btn.cmt-vote--like.active {
  background: transparent !important;
  border: none !important;
  color: #4ade80 !important;
}
.site-cmt-vote-btn.cmt-vote--like.active svg {
  stroke: #4ade80;
  fill: #4ade80;
}

.site-cmt-vote-btn.cmt-vote--dislike {
  color: rgba(255, 255, 255, 0.55);
  background: transparent !important;
  border: none !important;
}
.site-cmt-vote-btn.cmt-vote--dislike:hover { color: #ff6b6b; }
.site-cmt-vote-btn.cmt-vote--dislike:hover svg { transform: scale(1.18); }
.site-cmt-vote-btn.cmt-vote--dislike.active {
  background: transparent !important;
  border: none !important;
  color: #ff6b6b !important;
}
.site-cmt-vote-btn.cmt-vote--dislike.active svg {
  stroke: #ff6b6b;
  fill: #ff6b6b;
}

/* Кнопка удаления своего комментария */
.site-cmt-delete-btn { color: rgba(255,80,80,0.55); }
.site-cmt-delete-btn:hover { color: #ff5050; }

/* Форма ответа под конкретным комментарием */
.site-cmt-reply-form { margin-top: 12px; }
.site-cmt-reply-form .site-cmt-textarea { min-height: 56px; font-size: 13px; }
.site-cmt-reply-form .site-cmt-form-actions { margin-top: 8px; }
.site-cmt-reply-form .site-cmt-submit-btn { padding: 7px 20px; font-size: 12px; }
.site-cmt-reply-form .site-cmt-cancel-btn { padding: 7px 16px; font-size: 12px; }

.site-cmt-replies { margin-top: 12px; padding-left: 14px; border-left: 2px solid rgba(232,232,232,0.08); display: flex; flex-direction: column; gap: 10px; }
.site-cmt-replies.hidden { display: none; }
.site-cmt-replies .cmt-card { padding: 10px; }
.site-cmt-replies .cmt-avatar { width: 30px; height: 30px; font-size: 11px; }

/* Аватар в своих комментариях — кликабелен, ведёт на профиль автора */
.site-cmt-avatar-link { cursor: pointer; transition: opacity var(--t-fast), transform var(--t-fast); }
.site-cmt-avatar-link:hover { opacity: 0.85; transform: scale(1.05); }

/* Кнопки голосования во время запроса — не дёргают карточку, просто гасим клики */
.site-cmt-vote-btn:disabled { opacity: 0.6; cursor: default; pointer-events: none; }

@media (max-width: 600px) {
  .site-cmt-form-actions { flex-wrap: wrap; }
}

/* ═══════════════════════════════════════════════════
   ИСТОРИЯ ПРОСМОТРОВ
   ═══════════════════════════════════════════════════ */

/* Кнопка очистки истории */
.history-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 18px;
}

.history-clear-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  /* Milk glass, красный оттенок — тот же принцип, что у карточек
     статистики/профиля (молочный слой + тёмная подложка + сильный
     blur+saturate), но с красным тоном вместо нейтрального молочного,
     чтобы сохранить смысл «опасного» действия. */
  background:
    linear-gradient(rgba(255,110,110,0.14), rgba(255,110,110,0.14)),
    rgba(30,8,8,0.35);
  border: 1px solid rgba(255,120,120,0.35);
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(16px, var(--pf-cap, 999px))) saturate(200%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: #ff8888;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: all var(--t-fast);
}
.history-clear-btn:hover {
  background:
    linear-gradient(rgba(255,110,110,0.22), rgba(255,110,110,0.22)),
    rgba(30,8,8,0.4);
  border-color: rgba(255,140,140,0.55);
  color: #ffaaaa;
}
.history-clear-btn svg { flex-shrink: 0; }

/* Мета-строка внутри карточки истории (время + серия) */
.history-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
}

.history-ep {
  font-size: 12px;
  color: var(--green-dim);
  font-weight: 600;
  letter-spacing: 0.3px;
}

.history-time {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}

/* Разделитель в выпадающем меню nav */
.nav-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 8px;
}

/* Пункт «История» — немного выделяем цветом */
.nav-dropdown-item--history {
  color: var(--green-dim) !important;
}
.nav-dropdown-item--history:hover {
  color: var(--green) !important;
}

/* Пункты «Импорт» / «Настройки» в меню аккаунта */
.nav-dropdown-item--import,
.nav-dropdown-item--settings,
.nav-dropdown-item--support {
  justify-content: flex-start;
}

/* Адаптив */
@media (max-width: 600px) {
  .history-actions { margin-bottom: 12px; }
  .history-clear-btn { font-size: 12px; padding: 7px 14px; }
}

/* ════════════════════════════════════════════════════
   NOTIFICATIONS — кнопка в шапке + тост-уведомления
   ════════════════════════════════════════════════════ */

/* ── Кнопка «Проверить» в навбаре ── */
/* ── Кнопка-колокольчик ── */
.notif-bell-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: rgba(168,168,168,0.75);
  cursor: pointer;
  transition: background var(--t-med), color var(--t-med);
  flex-shrink: 0;
}
.notif-bell-btn:hover {
  background: rgba(255,255,255,0.07);
  color: #e8e8e8;
}
.notif-bell-btn:active {
  transform: none;
}
.notif-bell-btn.has-unread {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--green);
}
.notif-bell-btn svg {
  display: block;
  flex-shrink: 0;
}

/* ── Бейдж непрочитанных ── */
.notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  background: #e63946;
  border: 2px solid var(--bg, #0a0e1a);
  border-radius: 99px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}

/* ── Обёртка кнопки-колокольчика ── */
.notif-bell-wrapper {
  position: relative;
  flex-shrink: 0;
}

/* ── Оверлей-подложка мобильного нижнего листа уведомлений ──
   Настоящий элемент с hit-area (а не просто нарисованное затемнение),
   как системный бэкдроп шита на iOS: лежит между страницей и листом,
   физически перехватывает тап "мимо" и сам его закрывает — событие
   гасится здесь и не доходит до карточек аниме/чего угодно позади.
   Только для мобильной раскладки (см. _positionDropdownDesktop,
   js/notifications.js — на десктопе остаётся display:none). */
.notif-dropdown-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99998; /* на 1 меньше .notif-dropdown (99999) — лист поверх */
  background: rgba(2, 4, 12, 0.001); /* видимое затемнение рисует сам .notif-dropdown, эта подложка нужна только для hit-area */
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.notif-dropdown-overlay--visible {
  display: block;
  opacity: 1;
  pointer-events: all;
}

/* ── Дропдаун история уведомлений ──
   ФИКС мобильного бага: раньше жил внутри .notif-bell-wrapper и держался
   под колокольчиком через position:absolute от неё (position:relative).
   На мобильном .notif-dropdown переключается на position:fixed (см. @media
   ниже), но .notif-bell-wrapper лежит внутри .site-header, а у шапки на
   мобильном есть backdrop-filter (см. @media max-width:768px у
   .site-header) — backdrop-filter, как и transform, создаёт новый
   containing block для потомков с position:fixed. Из-за этого весь
   fixed-дропдаун позиционировался не от экрана, а от 60-пиксельной шапки:
   bottom:0 означало "низ шапки", а не "низ экрана", и лист улетал вверх и
   обрезался вместо того чтобы выехать снизу.
   Теперь элемент монтируется в document.body (js/notifications.js,
   _ensureDropdown()) — там нет ни transform, ни backdrop-filter, так что
   position:fixed считается от реального viewport на любой ширине экрана.
   На десктопе (>768px, где эта схема остаётся popup-ом под колокольчиком,
   а не нижним листом) координаты top/right взамен CSS от родителя теперь
   считает JS через getBoundingClientRect() — см. _positionDropdownDesktop()
   в js/notifications.js, вызывается при каждом открытии и при resize. */
.notif-dropdown {
  position: fixed;
  z-index: 200;
  width: 320px;
  max-height: 420px;
  /* У "Мои списки" реальный фон задаётся более специфичным селектором
     #navListsDropdown #navListsMenu (см. ~строка 712) и там #000
     (чистый чёрный), а не rgba(17,17,17,0.95), которое было здесь —
     та rgba и давала заметно светлее итоговый цвет (17,17,17 против
     9,9,9 по факту рендера с учётом box-shadow/border). Ставим тот же
     чистый #000, без backdrop-filter (панель монтируется в body, а не
     внутри тёмной шапки — см. комментарий у _ensureDropdown() в
     js/notifications.js, — так что blur размывал бы яркую картинку
     страницы позади и всё равно давал светлее). */
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius);
  box-shadow:
    0 16px 48px rgba(0,0,0,0.7),
    0 0 0 1px rgba(232,232,232,0.05) inset,
    0 0 30px rgba(232,232,232,0.06);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  overflow: hidden;
}
.notif-dropdown--open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}
/* Обёртка вокруг заголовка+списка (см. HTML-шаблон в _ensureDropdown(),
   js/notifications.js) — введена, чтобы в docked-режиме (боковая панель)
   #notifDropdown как grid-контейнер имел ровно ОДНОГО прямого ребёнка
   (см. подробный комментарий у html.header-dock-* #notifDropdown ниже
   в файле). В обычном/мобильном режиме (здесь) просто прозрачно
   продолжает ту же flex-колонку, что раньше держал сам .notif-dropdown
   — .notif-dropdown__list использует flex:1 и рассчитывает на
   непосредственного flex-родителя. */
.notif-dropdown__inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* Узкий 320px popup, растущий из точки клика, на телефоне неудобен и на
   самых маленьких экранах (320-360px) может вылезать за край даже с
   JS-коррекцией. Вместо этого превращаем его в нижний лист на весь
   экран — тот же приём, что уже использует .modal-box на мобильном
   (см. его правила в @media max-width:768px). inset здесь
   полностью перебивает top/right, выставленные в базовом правиле выше
   (и возможный инлайн top/right от _positionDropdownDesktop() —
   на мобильном она их сама сбрасывает в '', так что конфликта нет). */
@media (max-width: 768px) {
  .notif-dropdown {
    z-index: 99999;
    inset: auto 0 0 0;
    width: auto;
    max-height: min(78vh, calc(100vh - 24px));
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    /* Тот же приём "бесконечного box-shadow", что и у тур-спотлайта —
       рисует затемнение всего экрана позади листа одним свойством,
       без дополнительного DOM-узла под подложку-оверлей. */
    box-shadow:
      0 0 0 9999px rgba(2, 4, 12, 0.72),
      0 -8px 40px rgba(0,0,0,0.6);
  }
  .notif-dropdown--open {
    transform: translateY(0);
  }
  .notif-dropdown__header { padding: 8px 16px 12px; flex-shrink: 0; cursor: grab; touch-action: none; }
  .notif-dropdown__header:active { cursor: grabbing; }
  .notif-dropdown__list { max-height: none; padding-bottom: env(safe-area-inset-bottom, 12px); }
  .notif-dropdown__handle {
    display: block !important;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.28);
    margin: 8px auto 0;
    flex-shrink: 0;
    touch-action: none;
    cursor: grab;
  }
  .notif-dropdown__handle:active { cursor: grabbing; }
}
/* Хэндл — часть нижнего листа, на десктопе (обычный popup под
   колокольчиком) его быть не должно, поэтому по умолчанию скрыт и
   показывается только внутри мобильного @media выше. */
.notif-dropdown__handle { display: none; }

.notif-dropdown__header {
  display: flex;
  align-items: center;
  padding: 13px 14px 11px;
  border-bottom: 1px solid rgba(232,232,232,0.10);
  flex-shrink: 0;
  gap: 0;
}
.notif-dropdown__title {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--green);
  flex: 1;
}
.notif-dropdown__actions {
  display: flex;
  align-items: center;
  gap: 2px;
}
.notif-dropdown__clear {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.notif-dropdown__clear:hover {
  color: #e63946;
  background: rgba(230,57,70,0.12);
}
.notif-dropdown__refresh {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s, opacity 0.15s;
}
.notif-dropdown__refresh:hover {
  color: var(--green);
  background: rgba(232,232,232,0.10);
}
.notif-dropdown__refresh:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.notif-dropdown__refresh svg {
  transition: transform 0.5s ease;
}
.notif-dropdown__refresh--spinning svg {
  animation: notif-spin 0.8s linear infinite;
}
@keyframes notif-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.notif-dropdown__list {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  padding: 6px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(232,232,232,0.2) transparent;
}
.notif-dropdown__list::-webkit-scrollbar { width: 4px; }
.notif-dropdown__list::-webkit-scrollbar-thumb { background: rgba(232,232,232,0.2); border-radius: 2px; }

.notif-dropdown__empty {
  padding: 28px 16px;
  text-align: center;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  color: var(--text-dim);
  opacity: 0.6;
}

.notif-dropdown__item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px 10px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  animation: notifItemIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
  /* Тот же переходный набор, что у .nav-dropdown-item (меню "Мои
     списки") — фон и полоска анимируются вместе на hover. */
  transition:
    background 0.18s ease,
    color 0.18s ease;
}
.notif-dropdown__item:last-child { border-bottom: none; }
.notif-dropdown__item:hover { background: rgba(255,255,255,0.03); }

/* Белая полоска слева — в отличие от .nav-dropdown-item::before (там
   она только на hover), здесь видна ПОСТОЯННО у каждого уведомления,
   как метка-акцент непрочитанной записи; на hover чуть ярче/крупнее
   для отклика на наведение, тем же 0.22s pop-переходом, что в меню
   "Мои списки". */
.notif-dropdown__item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 2px;
  border-radius: 2px;
  background: #e8e8e8;
  opacity: 0.65;
  transform: scaleY(1);
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
.notif-dropdown__item:hover::before {
  opacity: 1;
  transform: scaleY(1.15);
}
.notif-dropdown__item--clickable:hover {
  background: rgba(232, 232, 232, 0.07);
}
.notif-dropdown__item--removing {
  animation: notifItemOut 0.28s cubic-bezier(0.55, 0, 1, 0.45) both !important;
  pointer-events: none;
  overflow: hidden;
}

@keyframes notifItemIn {
  from {
    opacity: 0;
    transform: translateX(18px);
    max-height: 0;
  }
  to {
    opacity: 1;
    transform: translateX(0);
    max-height: 120px;
  }
}
@keyframes notifItemOut {
  from {
    opacity: 1;
    transform: translateX(0);
    max-height: 120px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  to {
    opacity: 0;
    transform: translateX(24px);
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
}

.notif-dropdown__item-icon { display: none; }
.notif-dropdown__item-poster {
  width: 36px;
  height: 50px;
  object-fit: cover;
  border-radius: 5px;
  flex-shrink: 0;
}
.notif-dropdown__item-content { flex: 1; min-width: 0; }
.notif-dropdown__item-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 3px;
}
.notif-dropdown__item-label--premiere { color: #d8d8d8; }
.notif-dropdown__item-label--message { color: var(--blue); }
.notif-dropdown__item-label--friend { color: #a0a0a0; }
.notif-dropdown__item-label--support { color: #00ffe0; font-weight: 800; }
/* Аватар человека (сообщение/заявка в друзья) — круглый, в отличие от
   прямоугольного постера аниме, чтобы визуально не путать "это человек"
   с "это тайтл", как и везде в остальном UI (chat-convo-avatar и т.д.).
   ВАЖНО: .notif-dropdown__item-poster по умолчанию 36×50 (портретный
   постер аниме) — одного border-radius:50% на прямоугольнике недостаточно,
   он даёт растянутый по вертикали овал, а не круг. Явно переопределяем
   width/height в квадрат, чтобы получился настоящий круг, как у аватарок
   в остальном UI. */
.notif-dropdown__item--person .notif-dropdown__item-poster {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}
.notif-dropdown__item-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.notif-dropdown__item-body {
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  /* Было var(--text-dim) — тёмно-серый (#55555a), читался почти
     нечитаемым на тёмном фоне панели. Белый, как заголовок записи. */
  color: var(--text);
  opacity: 0.75;
}
.notif-dropdown__item-ago {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  /* То же самое — было var(--text-dim) + opacity:0.55 (двойное
     затемнение), теперь белый с одной лёгкой opacity для иерархии. */
  color: var(--text);
  opacity: 0.6;
  flex-shrink: 0;
  white-space: nowrap;
  margin-top: 3px;
}

/* ── Контейнер тостов (в стиле iOS: снизу справа на ПК, сверху как Dynamic Island на мобильных) ── */
#notifToastContainer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99998;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
}

/* ── Один тост (iOS Frosted Glass Squircle) ── */
.notif-toast {
  pointer-events: all;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 360px;
  background: rgba(22, 22, 26, 0.82);
  backdrop-filter: blur(min(32px, var(--pf-cap, 999px))) saturate(190%);
  -webkit-backdrop-filter: blur(min(32px, var(--pf-cap, 999px))) saturate(190%);
  border: 0.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08), 0 2px 8px rgba(0, 0, 0, 0.3);
  padding: 10px 14px 12px 14px;
  opacity: 0;
  transform: translateY(16px) scale(0.94);
  filter: blur(4px);
  transition: opacity 0.38s cubic-bezier(0.16, 1, 0.3, 1), transform 0.38s cubic-bezier(0.16, 1, 0.3, 1), filter 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  user-select: none;
}
.notif-toast--in {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0px);
}
.notif-toast--out {
  opacity: 0;
  transform: translateY(12px) scale(0.92);
  filter: blur(4px);
}
.notif-toast--clickable {
  cursor: pointer;
}
.notif-toast--clickable:hover {
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: 0 18px 45px -6px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.12);
  transform: translateY(-2px) scale(1.01);
}

/* Шапка уведомления (iOS Header) */
.notif-toast__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 2px;
}
.notif-toast__app {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.notif-toast__app-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 5px;
  background: linear-gradient(135deg, rgba(0,255,224,0.25), rgba(10,132,255,0.3));
  color: #00ffe0;
  flex-shrink: 0;
}
.notif-toast--message .notif-toast__app-icon {
  background: linear-gradient(135deg, rgba(10,132,255,0.25), rgba(94,92,230,0.3));
  color: #0a84ff;
}
.notif-toast--friend_request .notif-toast__app-icon {
  background: linear-gradient(135deg, rgba(48,209,88,0.25), rgba(0,255,224,0.3));
  color: #30d158;
}
.notif-toast--premiere .notif-toast__app-icon {
  background: linear-gradient(135deg, rgba(255,214,10,0.25), rgba(255,159,10,0.3));
  color: #ffd60a;
}
.notif-toast__app-name {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
}
.notif-toast__dot {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
}
.notif-toast__category {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-toast__header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.notif-toast__time {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}
.notif-toast__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: rgba(255, 255, 255, 0.65);
  width: 18px;
  height: 18px;
  border-radius: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  padding: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  transition: color 0.18s ease;
  transform: none !important;
}
.notif-toast__close:hover {
  background: rgba(255, 255, 255, 0.25);
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #ffffff;
  transform: scale(1.08);
  transform: none !important;
}

/* Основное тело тоста */
.notif-toast__body-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.notif-toast__poster-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.notif-toast__poster {
  width: 44px;
  height: 58px;
  object-fit: cover;
  border-radius: 8px;
  border: 0.5px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
}
.notif-toast--message .notif-toast__poster,
.notif-toast--friend_request .notif-toast__poster {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}
.notif-toast__content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.notif-toast__title {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Rajdhani', sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-toast__body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Rajdhani', sans-serif;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Мобильная адаптация тостов (iOS Top Banner) ── */
@media (max-width: 600px) {
  #notifToastContainer {
    top: calc(12px + env(safe-area-inset-top, 0px));
    bottom: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(calc(100vw - 20px), 390px);
    flex-direction: column;
    gap: 8px;
  }
  .notif-toast {
    width: 100%;
    transform: translateY(-24px) scale(0.94);
  }
  .notif-toast--in {
    transform: translateY(0) scale(1);
  }
  .notif-toast--out {
    transform: translateY(-20px) scale(0.92);
  }
}

/* ── Затемнение при выходе из аккаунта ── */
#logoutOverlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
#logoutOverlay.is-visible {
  opacity: 0.55;
  pointer-events: all;
}


/* ════════════════════════════════════════════════════════
   Анимация перехода между страницами/секциями
   (Главная / Каталог / Расписание / Мои списки / История / Деталка)
   ════════════════════════════════════════════════════════ */
@keyframes pageSectionIn {
  from { opacity: 0; transform: translateY(14px) scale(0.99); }
  to   { opacity: 1; transform: none; }
}

.page-section-enter {
  animation: pageSectionIn 0.38s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

/* ── Исключение для страниц со "стеклянными" элементами ──
   Пока родитель анимирует transform, Chromium временно не досчитывает
   backdrop-filter у стеклянных потомков (.friend-card, .cmts-toggle-btn)
   на полную — эффект "доезжает" только когда анимация останавливается.
   У этих секций транслируем только opacity (совместимо с
   backdrop-filter с первого кадра), без сдвига/масштаба, которые эту
   деградацию и вызывают. #settingsSection сюда больше не входит — её
   карточки настроек больше не "стеклянные" (см. .settings-row выше). */
@keyframes pageSectionInFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
#friendsSection.page-section-enter,
#detailSection.page-section-enter {
  animation-name: pageSectionInFade;
}

@media (prefers-reduced-motion: reduce) {
  .page-section-enter { animation: none; }
}

/* ══════════════════════════════════════════════════════
   iOS Swipe-to-Back & Mobile Page Slide Transitions
   ══════════════════════════════════════════════════════ */
.swipe-back-active {
  position: fixed !important;
  top: 60px !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: calc(100dvh - 60px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  z-index: 80 !important;
  background: var(--bg, #0e0e0e) !important;
  box-shadow: -14px 0 32px rgba(0, 0, 0, 0.65) !important;
  margin: 0 !important;
  padding: 16px 12px calc(var(--mobile-nav-height, 74px) + env(safe-area-inset-bottom, 16px) + 24px) !important;
  box-sizing: border-box !important;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
}

.swipe-back-under {
  display: block !important;
  position: fixed !important;
  top: 60px !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: calc(100dvh - 60px) !important;
  overflow-y: hidden !important;
  overflow-x: hidden !important;
  pointer-events: none !important;
  z-index: 50 !important;
  margin: 0 !important;
  padding: 16px 12px calc(var(--mobile-nav-height, 74px) + env(safe-area-inset-bottom, 16px) + 24px) !important;
  box-sizing: border-box !important;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
}

.swipe-back-scrim {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 65;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: opacity;
}

/* Во время свайпа назад скрываем подвал сайта, чтобы он не проступал */
body.is-swiping-back .site-footer {
  display: none !important;
}
body.is-swiping-back .main-content {
  z-index: 70 !important;
}

@media (max-width: 768px) {
  @keyframes pageSlideInRight {
    from {
      transform: translate3d(100%, 0, 0);
      opacity: 1;
    }
    to {
      transform: translate3d(0, 0, 0);
      opacity: 1;
    }
  }

  /* На мобильных детальная страница и страницы настроек плавно въезжают справа */
  #detailSection.page-section-enter,
  .settings-page.page-section-enter {
    animation: pageSlideInRight 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards !important;
  }
}

/* ── Бегущая полоса-индикатор перехода сверху (под хедером) ── */
.top-progress-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  z-index: 101;
}

.top-progress-bar__fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 40%;
  border-radius: 0 4px 4px 0;
  background: var(--grad-primary);
  box-shadow: 0 0 10px rgba(232,232,232,0.7), 0 0 2px rgba(232,232,232,0.9);
  transform: translateX(-100%);
}

.top-progress-bar.is-active {
  opacity: 1;
}

.top-progress-bar.is-active .top-progress-bar__fill {
  animation: topProgressRun 0.62s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes topProgressRun {
  0%   { transform: translateX(-100%); }
  55%  { transform: translateX(130%); }
  100% { transform: translateX(280%); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .top-progress-bar.is-active .top-progress-bar__fill { animation: none; }
}

/* ===== WATCHING-NOW BADGE: Сейчас смотрите — reduced motion fallback ===== */
@media (prefers-reduced-motion: reduce) {
  .season-current-badge::before { animation: none; opacity: 1; }
  .season-current-badge::after  { animation: none; display: none; }
}
/* ====================================================
   SUPPORT MODAL
   ==================================================== */

/* Кнопка поддержки в дропдауне */
.nav-dropdown-item--support {
  color: var(--text);
}
.nav-dropdown-item--support:hover {
  background: var(--green-faint);
}

/* ── Категории ── */
.sup-field { margin-bottom: 18px; }
.sup-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .7px; margin-bottom: 8px; }
.sup-required { color: var(--green); }

/* ── Тип обращения — sliding-pill (.pill-toggle/.pill-thumb/.pill-btn)
   Анимированный ползунок-слайдер, точно такой же, как на странице «Приватность»
   (.privacy-row-options) и в модалках настроек. ── */
.sup-cat-toggle.pill-toggle {
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
  box-sizing: border-box;
}
.sup-cat-toggle.pill-toggle .pill-thumb {
  display: block !important;
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  background: var(--green);
  border-radius: 7px;
  transition: transform 0.32s cubic-bezier(.22, 1, .36, 1), width 0.32s cubic-bezier(.22, 1, .36, 1);
  z-index: 0;
  pointer-events: none;
}
.sup-cat-toggle.pill-toggle .pill-btn {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 8px;
  text-align: center;
  white-space: nowrap;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: none !important;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 1;
  border-radius: 7px;
  transition: color var(--t-fast);
}
.sup-cat-toggle.pill-toggle .pill-btn:hover {
  color: var(--text);
}
.sup-cat-toggle.pill-toggle .pill-btn.active {
  color: var(--bg-card);
  background: none !important;
}
@media (max-width: 480px) {
  .sup-cat-toggle.pill-toggle .pill-btn {
    padding: 8px 4px;
    font-size: 12px;
    gap: 4px;
  }
  .sup-cat-toggle.pill-toggle .pill-btn svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
  }
}
@media (max-width: 360px) {
  .sup-cat-toggle.pill-toggle .pill-btn {
    padding: 7px 2px;
    font-size: 11px;
    gap: 3px;
  }
}

/* ── Textarea ── */
.sup-textarea {
  width: 100%;
  min-height: 120px;
  max-height: 220px;
  resize: vertical;
  background: var(--bg-input);
  border: 1px solid var(--border-hl);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.55;
  padding: 12px 14px;
  box-sizing: border-box;
  transition: border-color .18s;
  outline: none;
}
.sup-textarea:focus { border-color: var(--green-dim); }
.sup-textarea::placeholder { color: var(--text-muted); }

.sup-char-count {
  text-align: right;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Drop zone — то же "стекло" (blur + полупрозрачный чёрный), что
   .file-drop-zone на странице Импорт/Экспорт: там, где под контентом
   виден фон сайта (постер/картинка), сплошная непрозрачная заливка
   выглядит инородно рядом с остальными страницами настроек. ── */
.sup-drop-zone {
  border: 1.5px dashed rgba(232,232,232,0.15);
  border-radius: 10px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: rgba(0,0,0,0.2);
  backdrop-filter: blur(8px);
  transition: all var(--t-med);
  font-size: 13px;
  color: var(--text-muted);
}
.sup-drop-zone:hover, .sup-drop-zone.drag-over {
  border-color: var(--green-dim);
  background: rgba(232,232,232,0.04);
  color: var(--green);
}
.sup-drop-zone.drag-over {
  border-color: var(--green);
  background: rgba(232,232,232,0.08);
  box-shadow: 0 0 30px rgba(232,232,232,0.1);
}

/* ── File list ── */
.sup-file-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }

.sup-file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
}
.sup-file-icon { color: var(--green-dim); flex-shrink: 0; }
.sup-file-name { flex: 1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup-file-size { color: var(--text-muted); flex-shrink: 0; }
.sup-file-remove {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 13px; padding: 0 2px;
  transition: color .15s;
}
.sup-file-remove:hover { color: #ff5c5c; }

/* ── Cooldown bar ── */
.sup-cooldown {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(168,168,168,0.07);
  border: 1px solid rgba(168,168,168,0.2);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12px;
  color: #a8a8a8;
  margin-bottom: 12px;
}
.sup-cooldown.hidden { display: none; }

/* ── Status ── */
.sup-status {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 10px;
}
.sup-status.hidden { display: none; }
.sup-status--ok    { background: rgba(232,232,232,0.06); border: 1px solid rgba(232,232,232,0.2); color: var(--green); }
.sup-status--error { background: rgba(255,70,70,0.07); border: 1px solid rgba(255,70,70,0.25); color: #ff6b6b; }

/* Кнопка «Отправить» теперь — .import-btn, та же единая первичная
   кнопка (сплошной светлый фон, тёмный текст), что «Сохранить» на
   странице «Приватность» и «Импортировать»/«Экспортировать» — общий
   стиль по всему сайту (см. .import-btn выше в файле). Отдельного
   .sup-submit-btn больше не нужно. */

/* ── Spinner inside button ── */
.sup-spinner {
  width: 13px; height: 13px;
  border: 2px solid rgba(10,10,10,0.25);
  border-top-color: #06080f;
  border-radius: 50%;
  display: inline-block;
  animation: supSpin .7s linear infinite;
}
@keyframes supSpin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════
   NAV HOVER ANIMATIONS — красивые эффекты на навбар
   ═══════════════════════════════════════════════════════════ */

/* Рамка вокруг ВСЕГО контейнера .header-nav при наведении на любую
   вкладку внутри него убрана по правке — визуально выглядела как
   "обводка появляется вокруг всех кнопок сразу", хотя пользователь
   наводил только на одну; каждая кнопка и так подсвечивается сама по
   себе через .nav-tab:hover (см. основной блок выше), общая рамка
   вокруг группы была лишней. */
.header-nav {
  transition: box-shadow 0.3s ease;
}

/* ── nav-tab: ripple-слой + плавный slide иконки ── */
.nav-tab {
  transition:
    background 0.22s ease,
    color 0.22s ease,
    box-shadow 0.22s ease !important;
}

/* Псевдоэлемент-полоска снизу убран — подсветка активной/наведённой
   вкладки теперь идёт рамкой (inset box-shadow, см. .nav-tab:hover /
   .nav-tab.active в основном блоке), а не подчёркиванием. */
.nav-tab::after { display: none; }

/* Наведение теперь меняет только цвет/фон/тень (см. правило .nav-tab:hover
   в основном блоке выше) — без translateY и без letter-spacing, чтобы
   ни ширина, ни позиция кнопки не менялись и панель не «дёргалась» */

/* Иконка: мягкая подсветка без увеличения (transform: none) */
.nav-tab:hover .nav-tab-icon {
  filter: drop-shadow(0 0 4px rgba(232,232,232,0.5));
  transform: none;
  transition: filter 0.22s ease;
}
.nav-tab-icon {
  transition: filter 0.22s ease;
}

/* ── Кнопки «Главная» / «Каталог» / «Расписание» ── */
#tabHome:hover       { color: #e8e8e8; }
#tabCatalog:hover    { color: #cfcfcf; }
#tabSchedule:hover   { color: #cfcfcf; }

#tabHome:hover::after       { background: linear-gradient(90deg, rgba(232,232,232,0), #e8e8e8, rgba(232,232,232,0)); }
#tabCatalog:hover::after    { background: linear-gradient(90deg, rgba(207,207,207,0), #cfcfcf, rgba(207,207,207,0)); }
#tabSchedule:hover::after   { background: linear-gradient(90deg, rgba(207,207,207,0), #cfcfcf, rgba(207,207,207,0)); }

/* ── Мои списки: toggle ── */
#tabLists:hover { color: #e0e0e0; }
#tabLists:hover::after { background: linear-gradient(90deg, rgba(224,224,224,0), #e0e0e0, rgba(224,224,224,0)); }

/* стрелка дропдауна плавно */
.nav-dropdown-arrow {
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), opacity 0.2s ease !important;
}

/* ── Dropdown menu: красивые item-анимации ── */

/* Каждый item получает slide + fade при появлении.
   ВАЖНО: раньше задержки считались через :nth-child(N) от ВСЕХ детей
   .nav-dropdown-menu — а среди них вперемешку лежат ещё <div class=
   "nav-dropdown-divider"> (разделители) и пункты, скрытые гостю/юзеру
   через class="hidden" (tabProfile, tabFriends, tabImport и т.д., см.
   updateGuestUI() в js/auth.js). Эти элементы всё равно физически
   остаются в DOM и занимают номера в общем счёте nth-child, поэтому
   реальная позиция «Поддержки»/«Инструкция/FAQ» у гостя — 11-я и 12-я,
   а правил animation-delay было задано только до :nth-child(10) —
   дальше анимация появления пропадала (и заодно съезжала у «Выйти»,
   14-й по счёту).
   Чиним через :nth-child(N of .nav-dropdown-item) — этот синтаксис
   (селектор уровня 4) считает позицию ТОЛЬКО среди элементов с классом
   .nav-dropdown-item, полностью игнорируя разделители-<div> и не
   завязываясь на то, кто из пунктов сейчас скрыт. Работает в
   Chrome/Edge 111+, Safari 9+, Firefox 113+.

   ВАЖНО: этот блок — только для ОБЫЧНОГО (не docked/боковой) режима
   шапки, где меню всплывает попапом. В боковой (docked) панели у
   пунктов свой, отдельный каскад через transition (см. html.header-
   dock-left/right #navListsDropdown ... .nav-dropdown-item ниже,
   строка ~13500) — если не исключить здесь docked-режим явно, это
   правило тоже совпадает (оно не завязано на html.header-dock-*) и
   запускает keyframe-анимацию dropItemIn сразу по снятию .hidden, ещё
   ДО того как аккордеон успевает раскрыться — в доке .hidden снимается
   сразу при открытии (см. js/ui.js: toggleListsDropdown). Результат —
   анимация в боковой панели выглядела резкой/сломанной, потому что
   этот keyframe и docked-transition конфликтовали за одни и те же
   opacity/transform на одних и тех же элементах. */
html.header-dock-left .nav-dropdown-menu:not(.hidden) .nav-dropdown-item,
html.header-dock-right .nav-dropdown-menu:not(.hidden) .nav-dropdown-item {
  animation: none !important;
}
/* "Мои списки" (#navListsMenu) И меню аккаунта (#navAccountMenu) в
   ОБЫЧНОМ режиме используют grid-accordion (см. правило выше,
   ~строка 683) вместо построчного keyframe-каскада — пункты следуют
   за opacity родителя целиком, без собственной анимации, тем же
   способом, что и в боковой (docked) панели. Построчный slide-каскад
   dropItemIn остаётся только для остальных .nav-dropdown-menu (если
   появятся), оба явно исключены здесь через :not(#navListsMenu):
   not(#navAccountMenu). */
html:not(.header-dock-left):not(.header-dock-right) .nav-dropdown-menu:not(#navListsMenu):not(#navAccountMenu):not(.hidden) .nav-dropdown-item {
  animation: dropItemIn 0.22s cubic-bezier(0.16,1,0.3,1) both;
}
html:not(.header-dock-left):not(.header-dock-right) .nav-dropdown-menu:not(#navListsMenu):not(#navAccountMenu):not(.hidden) .nav-dropdown-item:nth-child(1 of .nav-dropdown-item)  { animation-delay: 0.02s; }
html:not(.header-dock-left):not(.header-dock-right) .nav-dropdown-menu:not(#navListsMenu):not(#navAccountMenu):not(.hidden) .nav-dropdown-item:nth-child(2 of .nav-dropdown-item)  { animation-delay: 0.05s; }
html:not(.header-dock-left):not(.header-dock-right) .nav-dropdown-menu:not(#navListsMenu):not(#navAccountMenu):not(.hidden) .nav-dropdown-item:nth-child(3 of .nav-dropdown-item)  { animation-delay: 0.08s; }
html:not(.header-dock-left):not(.header-dock-right) .nav-dropdown-menu:not(#navListsMenu):not(#navAccountMenu):not(.hidden) .nav-dropdown-item:nth-child(4 of .nav-dropdown-item)  { animation-delay: 0.11s; }
html:not(.header-dock-left):not(.header-dock-right) .nav-dropdown-menu:not(#navListsMenu):not(#navAccountMenu):not(.hidden) .nav-dropdown-item:nth-child(5 of .nav-dropdown-item)  { animation-delay: 0.14s; }
html:not(.header-dock-left):not(.header-dock-right) .nav-dropdown-menu:not(#navListsMenu):not(#navAccountMenu):not(.hidden) .nav-dropdown-item:nth-child(6 of .nav-dropdown-item)  { animation-delay: 0.17s; }
html:not(.header-dock-left):not(.header-dock-right) .nav-dropdown-menu:not(#navListsMenu):not(#navAccountMenu):not(.hidden) .nav-dropdown-item:nth-child(7 of .nav-dropdown-item)  { animation-delay: 0.20s; }
html:not(.header-dock-left):not(.header-dock-right) .nav-dropdown-menu:not(#navListsMenu):not(#navAccountMenu):not(.hidden) .nav-dropdown-item:nth-child(8 of .nav-dropdown-item)  { animation-delay: 0.23s; }
html:not(.header-dock-left):not(.header-dock-right) .nav-dropdown-menu:not(#navListsMenu):not(#navAccountMenu):not(.hidden) .nav-dropdown-item:nth-child(9 of .nav-dropdown-item)  { animation-delay: 0.26s; }
html:not(.header-dock-left):not(.header-dock-right) .nav-dropdown-menu:not(#navListsMenu):not(#navAccountMenu):not(.hidden) .nav-dropdown-item:nth-child(10 of .nav-dropdown-item) { animation-delay: 0.29s; }
html:not(.header-dock-left):not(.header-dock-right) .nav-dropdown-menu:not(#navListsMenu):not(#navAccountMenu):not(.hidden) .nav-dropdown-item:nth-child(11 of .nav-dropdown-item) { animation-delay: 0.32s; }
html:not(.header-dock-left):not(.header-dock-right) .nav-dropdown-menu:not(#navListsMenu):not(#navAccountMenu):not(.hidden) .nav-dropdown-item:nth-child(12 of .nav-dropdown-item) { animation-delay: 0.35s; }
html:not(.header-dock-left):not(.header-dock-right) .nav-dropdown-menu:not(#navListsMenu):not(#navAccountMenu):not(.hidden) .nav-dropdown-item:nth-child(13 of .nav-dropdown-item) { animation-delay: 0.38s; }
html:not(.header-dock-left):not(.header-dock-right) .nav-dropdown-menu:not(#navListsMenu):not(#navAccountMenu):not(.hidden) .nav-dropdown-item:nth-child(14 of .nav-dropdown-item) { animation-delay: 0.41s; }

@keyframes dropItemIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Hover на пункте дропдауна: бирюзовая полоска слева + slide счётчика */
.nav-dropdown-item {
  position: relative;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    transform 0.18s cubic-bezier(0.34,1.56,0.64,1),
    padding-left 0.18s ease !important;
}

.nav-dropdown-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 2px;
  border-radius: 2px;
  background: #e8e8e8;
  opacity: 0;
  transform: scaleY(0);
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.34,1.56,0.64,1);
}

.nav-dropdown-item:hover::before {
  opacity: 1;
  transform: scaleY(1);
}

.nav-dropdown-item:hover {
  padding-left: 16px;
}

/* Счётчик: pop-анимация при hover */
.nav-dropdown-item .tab-count {
  transition: color 0.18s ease, transform 0.22s cubic-bezier(0.34,1.56,0.64,1), background 0.18s ease !important;
  display: inline-block;
}
.nav-dropdown-item:hover .tab-count {
  transform: scale(1.1);
  color: #e8e8e8!important;
}

/* История — особый цвет полоски */
.nav-dropdown-item--history::before { background: #cfcfcf; }
.nav-dropdown-item--history:hover { color: #cfcfcf!important; }

/* Настройки */
.nav-dropdown-item--settings::before { background: #b8b8b8; }
.nav-dropdown-item--settings:hover { color: #b8b8b8!important; }

/* Поддержка / FAQ */
.nav-dropdown-item--support::before { background: #e0e0e0; }
.nav-dropdown-item--support:hover { color: #e0e0e0!important; }

/* Импорт */
.nav-dropdown-item--import::before { background: #a0a0a0; }
.nav-dropdown-item--import:hover { color: #a0a0a0!important; }

/* Выйти */
.nav-dropdown-item:last-of-type::before { background: #f87171; }

/* ── Колокольчик уведомлений ── */
.notif-bell-btn {
  transition: background 0.2s ease, color 0.2s ease !important;
}
.notif-bell-btn:hover {
  transform: none;
}
/* Анимация звонка при наведении */
.notif-bell-btn:hover svg {
  animation: bellRing 0.5s cubic-bezier(0.36,0.07,0.19,0.97) both;
}
@keyframes bellRing {
  0%   { transform: rotate(0deg); }
  15%  { transform: rotate(-18deg); }
  30%  { transform: rotate(14deg); }
  45%  { transform: rotate(-10deg); }
  60%  { transform: rotate(7deg); }
  75%  { transform: rotate(-4deg); }
  100% { transform: rotate(0deg); }
}

/* ── Аккаунт: аватар светится при hover ── */
/* ── Аккаунт: чистый аватар без свечения ── */
.nav-account-avatar {
  transition: border-color 0.22s ease, box-shadow 0.22s ease !important;
  transition: border-color 0.22s ease !important;
  box-shadow: none !important;
}
.nav-account-btn:hover .nav-account-avatar {
  border-color: rgba(232,232,232,0.7);
  box-shadow: 0 0 10px rgba(232,232,232,0.25);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: none !important;
}

/* ===== СТРАНИЦА СТАТИСТИКИ ===== */

.stats-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 0 60px;
}

/* Главные числа — тот же стиль карточки, что и .profile-hero-card во
   вкладке профиля (см. подробности там): тонкий градиентный фон, число
   окрашено общим фирменным градиентом через background-clip:text вместо
   плоского зелёного, акцентная полоска сверху и лёгкий подъём карточки
   при наведении. */
.stats-hero-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
@media (max-width: 600px) {
  .stats-hero-row { grid-template-columns: repeat(2, 1fr); }
}
.stats-hero-card {
  /* Milk glass — тот же материал, что у .card-list-badge на постерах:
     тонкая тёмная подложка (держит контраст на пёстром фоне позади
     страницы) + молочно-белый полупрозрачный слой поверх, сильный
     blur+saturate и тонкая светлая обводка вместо сплошной непрозрачной
     заливки. */
  background:
    linear-gradient(rgba(240,240,245,0.07), rgba(240,240,245,0.07)),
    rgba(10,10,14,0.35);
  border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  border-radius: var(--radius);
  padding: 17px 10px 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
/* Тонкая акцентная полоска сверху — перекликается с .nav-tab.active,
   тот же приём, что и у .profile-hero-card::before. */
.stats-hero-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad-primary);
  opacity: 0.55;
}
.stats-hero-card:hover {
  border-color: rgba(255,255,255,0.24);
  box-shadow: 0 10px 24px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.1);
}
.stats-hero-num {
  font-family: 'Orbitron', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}
.stats-hero-label {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* Подзаголовок блока */
.stats-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  margin-bottom: 10px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
}

/* Строка списков — единый pill-переключатель, тот же стиль и разметка,
   что и .profile-lists-tabs/.profile-list-tab во вкладке профиля: общая
   капсула-контейнер с лёгким фоном вместо отдельной рамки на каждом
   списке, активная вкладка подсвечена заливкой + нижней линией. */
.stats-lists-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 22px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 13px;
  padding: 3px;
  width: fit-content;
  max-width: 100%;
}
.stats-list-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: none;
  color: rgba(168,168,168,0.75);
  font-size: 12px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 7px 13px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-med), color var(--t-med), box-shadow var(--t-med);
  position: relative;
  overflow: hidden;
}
.stats-list-pill:hover { color: #e8e8e8; background: rgba(255,255,255,0.06); }
.stats-list-pill.active {
  background: rgba(255,255,255,0.09);
  color: var(--green);
  font-weight: 800;
  box-shadow: inset 0 -2px 0 0 #e8e8e8;
}
.stats-list-pill.active:hover { background: rgba(255,255,255,0.12); }
.stats-list-name { font-weight: 700; font-family: 'Rajdhani', sans-serif; }
.stats-list-count {
  font-family: 'Orbitron', monospace;
  font-size: 10.5px;
  opacity: 0.75;
}
.stats-list-pill.active .stats-list-count { color: var(--green); opacity: 1; }

/* Двухколоночный блок */
.stats-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 700px) {
  .stats-two-col { grid-template-columns: 1fr; }
}

/* Карточка — тот же Milk glass материал, что у .stats-hero-card и у
   .card-list-badge на постерах: полупрозрачный молочный слой + blur
   поверх тёмной подложки вместо сплошного непрозрачного фона. */
.stats-card {
  background:
    linear-gradient(rgba(240,240,245,0.06), rgba(240,240,245,0.06)),
    rgba(10,10,14,0.35);
  border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.stats-card--full { grid-column: 1 / -1; }
.stats-card-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  margin-bottom: 16px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
}
.stats-card canvas { width: 100% !important; display: block; }

/* Факты — SVG иконки */
.stats-facts {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.stats-fact {
  display: flex;
  align-items: center;
  gap: 12px;
}
.stats-fact-ico {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: rgba(232,232,232,0.06);
  border: 1px solid rgba(232,232,232,0.12);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
}
.stats-fact-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  line-height: 1.2;
}
.stats-fact-key {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* Активность по дням */
.stats-activity-row {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
}
.stats-act-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  height: 100%;
}
.stats-act-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  padding: 0 4px;
}
.stats-act-bar {
  width: 100%;
  background: linear-gradient(180deg, #e8e8e8 0%, #cfcfcf 100%);
  border-radius: 4px 4px 0 0;
  opacity: 0.7;
  min-height: 4px;
  transition: opacity var(--t-fast);
}
.stats-act-bar-wrap:hover .stats-act-bar { opacity: 1; }
.stats-act-count {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  font-family: 'Rajdhani', sans-serif;
}
.stats-act-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* Стрик просмотров */
.stats-streak-card {
  /* Лёгкий акцентный подсвет поверх молочного стекла — отличает
     карточку-достижение от обычных карточек данных (.stats-card),
     тем же зелёным токеном, что уже использует .stats-fact-ico. */
  background:
    linear-gradient(180deg, var(--green-faint) 0%, transparent 60%),
    linear-gradient(rgba(240,240,245,0.06), rgba(240,240,245,0.06)),
    rgba(10,10,14,0.35);
}
.stats-streak-card--broken {
  /* Стрик прерван — приглушаем акцентный подсвет, оставляя обычную
     стеклянную карточку, чтобы состояние явно читалось как «не активно». */
  background:
    linear-gradient(rgba(240,240,245,0.06), rgba(240,240,245,0.06)),
    rgba(10,10,14,0.35);
}
.stats-streak-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.stats-streak-main {
  display: flex;
  align-items: center;
  gap: 14px;
}
.stats-streak-flame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--green-faint);
  border: 1px solid var(--border-hl);
  color: var(--green);
}
.stats-streak-flame--dim {
  background: rgba(110, 110, 110, 0.08);
  border-color: var(--border);
  color: var(--text-muted);
}
.stats-streak-main > div { display: flex; flex-direction: column; }
.stats-streak-num {
  font-family: 'Orbitron', 'Rajdhani', monospace;
  font-size: 30px;
  font-weight: 700;
  color: var(--green);
  line-height: 1.15;
}
.stats-streak-num--dim { color: var(--text-muted); }
.stats-streak-unit {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.stats-streak-main--dim .stats-streak-unit {
  text-transform: none;
  letter-spacing: normal;
  font-size: 13px;
  max-width: 220px;
}
.stats-streak-best {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  padding-left: 16px;
  border-left: 1px solid var(--border);
}
.stats-streak-best-val {
  font-family: 'Orbitron', 'Rajdhani', monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.stats-streak-best-key {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .stats-streak-best {
    border-left: none;
    padding-left: 0;
    align-items: flex-start;
    text-align: left;
  }
}

/* Пустое состояние */
.stats-empty-hint {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Пункт меню Статистика */
.nav-dropdown-item--stats {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ══════════════════════════════════════════════════════
   ДРУЗЬЯ — поиск людей + браузинг случайных профилей
   ══════════════════════════════════════════════════════ */

/* Никнейм при первом входе показывается ПОВЕРХ auth-gate (z-index:5000
   у .auth-gate) — стандартный .modal-overlay (z-index:1000) для этого
   недостаточен, иначе модалка оказалась бы невидимой под экраном входа. */
#nicknameModal { z-index: 5100; }
#userBannedNoticeModal { z-index: 9999; }

.friends-search-row {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 28px;
  max-width: 420px;
}
.friends-search-icon {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  pointer-events: none;
}
.friends-search-input {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(232,232,232,0.12);
  color: var(--text);
  padding: 12px 16px 12px 42px;
  border-radius: 14px;
  font-size: 14px;
  font-family: 'Rajdhani', sans-serif;
  outline: none;
  transition: border-color var(--t-med), box-shadow var(--t-med), background var(--t-med);
  backdrop-filter: blur(8px);
}
.friends-search-input:focus {
  border-color: rgba(232,232,232,0.4);
  box-shadow: 0 0 0 3px rgba(232,232,232,0.07);
  background: rgba(232,232,232,0.02);
}
.friends-search-input::placeholder { color: var(--text-muted); }

/* Затемнение блока браузинга, пока активен поиск — фокус на результатах */
.friends-dimmed { opacity: 0.28; pointer-events: none; filter: blur(1px); transition: opacity var(--t-med), filter var(--t-med); }
#friendsBrowseBlock { transition: opacity var(--t-med), filter var(--t-med); }

.friend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  position: relative;
  z-index: 1;
}

.friend-card {
  /* Тот же iOS-эффект "стекла", что и у нижней мобильной навигации
     (.mobile-nav-items) и кнопки .cmts-toggle-btn: почти прозрачный
     светлый фон, всю яркость/цвет вытягивает backdrop-filter из
     контента позади карточки. */
  background: rgba(240, 240, 245, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 22px 16px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 14px 32px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.14);
  backdrop-filter: blur(min(24px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(24px, var(--pf-cap, 999px))) saturate(200%);
  will-change: backdrop-filter;
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
/* Тонкое сияние сверху карточки — перекликается с .profile-header::before */
.friend-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-glow);
  pointer-events: none;
}
.friend-card:hover {
  background: rgba(240, 240, 245, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.22);
}

/* Кольцевая рамка вокруг аватара — как .profile-avatar-wrap в профиле */
.friend-card-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  padding: 3px;
  border-radius: 50%;
  background: var(--grad-primary);
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
  z-index: 1;
}
.friend-card-avatar-wrap:has(.nf-av) {
  padding: 0;
  background: none;
  box-shadow: none;
}

.friend-card-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', monospace;
  font-size: 20px;
  font-weight: 700;
  color: #051018;
  flex-shrink: 0;
}
.friend-card-avatar--img { padding: 0; overflow: hidden; box-shadow: none; border: 2px solid var(--bg-card); }
.friend-card-avatar--img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.friend-card-body { z-index: 1; }

.friend-card-nickname {
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.3px;
  word-break: break-word;
  line-height: 1.3;
  text-shadow: 0 0 18px rgba(232,232,232,0.1);
}

.friend-card-joined {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.4px;
  margin-top: 4px;
}

.friend-card-you-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  background: var(--grad-primary);
  color: #0c0c0c;
  border: 1px solid rgba(232,232,232,0.4);
  box-shadow: 0 2px 10px rgba(232,232,232,0.18);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 3px 8px;
  border-radius: 999px;
}

.friend-card-skel {
  cursor: default;
  pointer-events: none;
}
.friend-card-skel::before,
.friend-card-skel::after { content: ''; display: block; border-radius: 999px; background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%); background-size: 200% 100%; animation: skelShimmer 1.4s ease-in-out infinite; }
.friend-card-skel::before { width: 58px; height: 58px; }
.friend-card-skel::after  { width: 70%; height: 12px; margin-top: 4px; }
@keyframes skelShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.friends-more-wrap { display: flex; justify-content: center; margin-top: 24px; }

/* ── Саб-табы "Люди / Мои друзья" (js/friends.js) ── */
.friends-subtabs {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.friends-subtab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 10px 4px 12px;
  margin-bottom: -1px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.friends-subtab:hover { color: var(--text); }
.friends-subtab.active { color: var(--green); border-bottom-color: var(--green); }
.friends-subtab-badge {
  background: var(--green);
  color: #051018;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 999px;
  font-family: 'Orbitron', monospace;
}
.friends-subtab-badge.hidden { display: none; }

/* ── Grid skeleton-состояние (первичная загрузка) ── */
.friend-grid--loading { pointer-events: none; }

/* ── Кнопки статуса дружбы на карточке (добавить / заявка / друзья) ── */
.friend-card-action { width: 100%; margin-top: 2px; }
.friend-action-row { display: flex; gap: 8px; width: 100%; }

.friend-action-btn {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg-glass2);
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast), transform var(--t-fast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.friend-action-btn:hover { transform: none; }
.friend-action-btn:active { transform: none; }

.friend-action-btn--add {
  border-color: rgba(232,232,232,0.3);
  background: rgba(232,232,232,0.06);
  color: var(--green);
}
.friend-action-btn--add:hover { background: rgba(232,232,232,0.12); border-color: var(--green); }

.friend-action-btn--pending {
  color: var(--text-muted);
  cursor: pointer;
}
.friend-action-btn--pending:hover { border-color: rgba(255,120,120,0.3); color: #ff9b9b; }

.friend-action-btn--friends {
  border-color: rgba(232,232,232,0.18);
  color: var(--green-dim);
  cursor: pointer;
}
.friend-action-btn--friends:hover { border-color: rgba(255,120,120,0.35); color: #ff9b9b; background: rgba(255,80,80,0.06); }

.friend-action-btn--accept {
  border-color: rgba(232,232,232,0.35);
  background: rgba(232,232,232,0.1);
  color: var(--green);
  flex: 1;
}
.friend-action-btn--accept:hover { background: rgba(232,232,232,0.18); }

.friend-action-btn--decline {
  flex: 0 0 auto;
  width: 38px;
  color: var(--text-muted);
}
.friend-action-btn--decline:hover { border-color: rgba(255,90,90,0.4); color: #ff8080; background: rgba(255,80,80,0.08); }

.friend-action-btn--skel {
  display: block;
  height: 34px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: skelShimmer 1.4s ease-in-out infinite;
  cursor: default;
  pointer-events: none;
}

/* ── Мобильная версия карточки — горизонтальная плашка ──
   На узких экранах вертикальная карточка-сетка (как в профиле)
   тратит много места впустую и заставляет много скроллить.
   На мобильном карточка становится строкой: аватар слева, ник +
   дата посередине, кнопка действия справа — тот же список
   помещается компактнее и читается быстрее одним столбцом. */
@media (max-width: 768px) {
  .friend-grid { grid-template-columns: 1fr; gap: 10px; }

  .friend-card {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
  }

  .friend-card-avatar-wrap { padding: 2.5px; }
  .friend-card-avatar { width: 46px; height: 46px; font-size: 16px; }

  .friend-card-body { flex: 1; min-width: 0; }
  .friend-card-nickname { font-size: 13.5px; }
  .friend-card-joined { margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .friend-card-action {
    width: auto;
    flex-shrink: 0;
    margin-top: 0;
    min-width: 128px;
    max-width: 138px;
  }
  .friend-action-btn { padding: 8px 8px; font-size: 11px; white-space: normal; line-height: 1.25; }
  .friend-action-row { gap: 6px; }

  .friend-card-you-badge {
    position: static;
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
    flex-shrink: 0;
  }
  .friend-card-nickname { display: flex; align-items: center; flex-wrap: wrap; }

  .friend-card-skel {
    flex-direction: row;
    align-items: center;
    padding: 12px 14px;
    gap: 12px;
  }
  .friend-card-skel::before { width: 46px; height: 46px; flex-shrink: 0; }
  .friend-card-skel::after { margin-top: 0; width: 50%; }
}

/* ══════════════════════════════════════════════════════
   ЧАТ — личные сообщения между друзьями (js/chat.js)
   ══════════════════════════════════════════════════════ */

/* ── Список диалогов — "Telegram Classic": строки-полоски с тонким
   разделителем, начинающимся от края аватара (не от края экрана),
   без карточных рамок/теней. ── */
.chat-convo-list {
  display: flex;
  flex-direction: column;
}

.chat-convo-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 6px;
  margin: 0 -6px;
  cursor: pointer;
  position: relative;
  transition: background var(--t-fast);
  border-radius: var(--radius-sm);
}
.chat-convo-row:hover { background: rgba(255,255,255,0.04); }
.chat-convo-row:active { background: rgba(255,255,255,0.07); }

/* Разделитель между строками — начинается после аватара (50px + gap 13px
   + отступ строки 6px = 69px), как классическая линия списка чатов в
   Telegram, а не полноширинная граница карточки. */
.chat-convo-row::after {
  content: '';
  position: absolute;
  left: 69px;
  right: -6px;
  bottom: 0;
  height: 1px;
  background: var(--border);
}
.chat-convo-row:last-child::after { display: none; }

/* Аватар — без кольцевой рамки-градиента вокруг (в отличие от карточного
   стиля друзей/профиля): в списке чатов Telegram сам круг аватара несёт
   цвет, без дополнительной оправы. */
.chat-convo-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.chat-convo-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', monospace;
  font-size: 18px;
  font-weight: 800;
  color: #0a0a0a;
  flex-shrink: 0;
}
.chat-convo-avatar--img { padding: 0; overflow: hidden; }
.chat-convo-avatar--img img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }

.chat-convo-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.chat-convo-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.chat-convo-nickname {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  font-family: 'Orbitron', monospace;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-convo-row--unread .chat-convo-nickname { color: var(--text); }
.chat-convo-time {
  font-size: 11.5px;
  color: var(--text-dim);
  flex-shrink: 0;
  font-family: 'Rajdhani', sans-serif;
}
.chat-convo-row--unread .chat-convo-time { color: var(--green); font-weight: 700; }

.chat-convo-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.chat-convo-preview {
  font-size: 13.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.chat-convo-row--unread .chat-convo-preview { color: #d6d6d6; }
.chat-convo-preview-prefix { color: var(--text-dim); }

.chat-convo-unread-badge {
  flex-shrink: 0;
  background: var(--green);
  color: #0a0a0a;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', monospace;
}

/* Skeleton-строки при первичной загрузке списка диалогов */
.chat-convo-row--skel {
  height: 74px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: skelShimmer 1.4s ease-in-out infinite;
}
.chat-convo-row--skel::after { display: none; }

/* ── Открытая переписка ── */
.chat-thread {
  display: flex;
  flex-direction: column;
  background: transparent;
  border-radius: var(--radius);
  overflow: hidden;
}

.chat-thread-header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.035) 0%, rgba(255,255,255,0.01) 100%),
    var(--bg-glass);
  backdrop-filter: blur(min(14px, var(--pf-cap, 999px)));
  flex-shrink: 0;
}

.chat-back-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  margin-left: -8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--t-fast), background var(--t-fast);
  flex-shrink: 0;
}
.chat-back-btn:hover { color: var(--green); background: rgba(232,232,232,0.06); }

.chat-thread-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 4px 10px 4px 4px;
  margin-left: 4px;
  border-radius: 999px;
  transition: background var(--t-fast);
  min-width: 0;
}
.chat-thread-header-info:hover { background: rgba(232,232,232,0.05); }

/* Аватар собеседника в шапке переписки — чистый цветной круг без оправы,
   тот же язык, что .chat-convo-avatar в списке диалогов. */
.chat-thread-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.chat-thread-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  font-weight: 800;
  color: #0a0a0a;
  flex-shrink: 0;
}
.chat-thread-avatar--img { padding: 0; overflow: hidden; }
.chat-thread-avatar--img img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }

.chat-thread-nickname {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  font-family: 'Orbitron', monospace;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-thread-header-skel {
  width: 140px;
  height: 20px;
  margin-left: 12px;
  border-radius: var(--radius-xs);
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: skelShimmer 1.4s ease-in-out infinite;
}

/* Прокручиваемая область сообщений. Раньше здесь стоял отдельный
   max-height в vh — но этот блок и так сидит внутри уже жёстко
   ограниченного flex-родителя: .chat-page-shell (height в vh/dvh,
   см. выше) → #chatBody → .chat-thread (flex:1) — каждое звено
   min-height:0, чтобы flex мог сжиматься, а не растягивать страницу.
   Задавать здесь ЕЩЁ и свой max-height в vh было ошибкой: vh считается
   от высоты всего окна браузера, а не от уже отмеренного доступного
   пространства внутри .chat-page-shell, поэтому на большинстве экранов
   эти два числа не совпадали, и .chat-thread-messages останавливался
   раньше, чем родитель реально мог ему выделить — снизу, перед формой
   ввода, оставался пустой зазор (тот же эффект отдельно чинили на
   мобильном, см. @media 640px ниже). flex:1 без max-height сам заполняет
   ровно то, что дал родитель — min-height остаётся низом на случай
   совсем маленького окна. */
.chat-thread-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  min-height: 340px;
  scroll-behavior: smooth;
}
.chat-thread-messages::-webkit-scrollbar { width: 6px; }
.chat-thread-messages::-webkit-scrollbar-track { background: transparent; }
.chat-thread-messages::-webkit-scrollbar-thumb { background: rgba(232,232,232,0.15); border-radius: 999px; }
.chat-thread-messages::-webkit-scrollbar-thumb:hover { background: rgba(232,232,232,0.3); }

/* Сами пузыри (.chat-msg-row) рендерятся не прямым потомком
   .chat-thread-messages, а лежат во вложенном #chatMessagesInner
   (см. js/chat.js: _buildChatThreadHTML) — это нужно, чтобы вставлять
   сообщения через insertAdjacentHTML('beforeend', ...) в конец истории,
   не трогая при этом #chatLoadMoreWrap, который в разметке идёт перед
   ним. Поэтому flex-контейнер должен быть именно здесь: align-self на
   .chat-msg-row--mine/--theirs действует только у ПРЯМОГО flex-ребёнка,
   а без этого блока #chatMessagesInner был обычным block-контейнером,
   и все сообщения растягивались на всю ширину независимо от автора. */
#chatMessagesInner {
  display: flex;
  flex-direction: column;
}

.chat-thread-empty {
  margin: auto;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  padding: 20px;
}

.chat-load-more-wrap { display: flex; justify-content: center; padding-bottom: 14px; }

.chat-date-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 18px 0 14px;
}
.chat-date-divider:first-child { margin-top: 0; }
.chat-date-divider span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  background: var(--bg-glass2);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 999px;
  text-transform: capitalize;
}

/* ── Сообщения ── */
.chat-msg-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  max-width: 78%;
  animation: chatMsgIn 0.2s var(--ease-premium) both;
}
@keyframes chatMsgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.chat-msg-row--grouped { margin-top: -6px; }

.chat-msg-row--theirs { align-self: flex-start; }
.chat-msg-row--mine { align-self: flex-end; margin-left: auto; }

.chat-msg-bubble {
  padding: 9px 13px 8px;
  border-radius: 16px;
  position: relative;
  word-break: break-word;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 6px 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}

.chat-msg-row--theirs .chat-msg-bubble {
  background:
    linear-gradient(145deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%),
    var(--bg-glass2);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-msg-row--theirs.chat-msg-row--grouped .chat-msg-bubble { border-bottom-left-radius: 16px; }

.chat-msg-row--mine .chat-msg-bubble {
  background: var(--grad-primary);
  border: 1px solid rgba(232,232,232,0.3);
  border-bottom-right-radius: 4px;
  box-shadow: 0 3px 14px rgba(232,232,232,0.1);
}
.chat-msg-row--mine.chat-msg-row--grouped .chat-msg-bubble { border-bottom-right-radius: 16px; }

.chat-msg-row--failed .chat-msg-bubble {
  background: rgba(255,80,80,0.08);
  border-color: rgba(255,90,90,0.35);
}

.chat-msg-row--mine .chat-msg-text { color: #101010; }
.chat-msg-row--mine .chat-msg-time { color: rgba(16,16,16,0.6); }
.chat-msg-row--mine .chat-msg-link { color: #0a3d5c; }
.chat-msg-row--mine .chat-msg-link:hover { color: #051018; }

.chat-msg-text {
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
  white-space: pre-wrap;
}
.chat-msg-link { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.chat-msg-link:hover { color: var(--green); }

.chat-msg-time {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: auto;
  font-family: 'Rajdhani', sans-serif;
}

/* ── Ответ на сообщение (reply) ── */

/* Кнопка "Ответить" рядом с пузырём — для "чужих" сообщений идёт справа
   от пузыря (к центру экрана), для "моих" — слева от пузыря (тоже к
   центру, а не к правому краю экрана, где ей было бы тесно). Порядок
   в разметке одинаковый (кнопка всегда после .chat-msg-bubble), поэтому
   сторона регулируется через order, а не дублированием HTML-шаблона. */
.chat-msg-row--mine .chat-msg-reply-btn { order: -1; }

.chat-msg-reply-btn {
  align-self: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-glass2);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity var(--t-fast), transform var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.chat-msg-row:hover .chat-msg-reply-btn {
  opacity: 1;
  transform: scale(1);
}
.chat-msg-reply-btn:hover { color: var(--green); border-color: rgba(232,232,232,0.35); }

/* Тач-устройства не имеют надёжного :hover — там кнопка видна всегда,
   иначе на телефоне до неё было бы вообще не добраться. */
@media (hover: none), (pointer: coarse) {
  .chat-msg-reply-btn { opacity: 1; transform: scale(1); }
}

/* Плашка-цитата ВНУТРИ пузыря (сверху текста сообщения) — своя цветовая
   полоска слева, кликабельна (переход к оригиналу), кроме варианта
   --missing (оригинал удалён/недоступен — не кликабельна). */
.chat-msg-reply-quote {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  padding: 5px 9px;
  margin-bottom: 2px;
  border-left: 2px solid var(--green);
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  transition: background var(--t-fast);
}
.chat-msg-reply-quote:hover { background: rgba(255,255,255,0.09); }
.chat-msg-row--mine .chat-msg-reply-quote { border-left-color: rgba(232,232,232,0.55); background: rgba(0,0,0,0.18); }
.chat-msg-row--mine .chat-msg-reply-quote:hover { background: rgba(0,0,0,0.26); }

.chat-msg-reply-quote--missing {
  cursor: default;
  border-left-color: var(--text-muted);
  font-style: italic;
}
.chat-msg-reply-quote--missing:hover { background: rgba(255,255,255,0.05); }

.chat-msg-reply-quote-author {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--green);
  font-family: 'Rajdhani', sans-serif;
}
.chat-msg-row--mine .chat-msg-reply-quote-author { color: var(--green); opacity: 0.9; }
.chat-msg-reply-quote-text {
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-msg-row--mine .chat-msg-reply-quote-text { color: rgba(232,232,232,0.75); }
.chat-msg-reply-quote--missing .chat-msg-reply-quote-text { color: var(--text-muted); font-style: italic; }

/* Кратковременная подсветка сообщения, к которому проскроллили по клику
   на цитату (см. _chatScrollToMessage) — чтобы было видно, что именно
   нашлось, а не просто "экран куда-то дёрнулся". */
.chat-msg-row--highlight .chat-msg-bubble {
  animation: chatReplyHighlight 1.4s ease;
}
@keyframes chatReplyHighlight {
  0%   { box-shadow: 0 0 0 2px var(--green); }
  70%  { box-shadow: 0 0 0 2px var(--green); }
  100% { box-shadow: 0 0 0 0px transparent; }
}

/* Плашка-цитата НАД полем ввода — показывает, на что сейчас отвечают,
   пока сообщение ещё не отправлено. */
.chat-reply-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  margin: 0 14px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  background: var(--bg-glass2);
  animation: fadeUp 0.15s ease both;
}
.chat-reply-bar-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-left: 2px solid var(--green);
  padding-left: 9px;
}
.chat-reply-bar-author {
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  font-family: 'Rajdhani', sans-serif;
}
.chat-reply-bar-text {
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-reply-bar-close {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--t-fast), background var(--t-fast);
}
.chat-reply-bar-close:hover { color: #ff9b9b; background: rgba(255,80,80,0.08); }

/* Skeleton-баблы во время загрузки истории */
.chat-thread-messages--loading { justify-content: flex-start; gap: 10px; }
.chat-msg-skel {
  height: 38px;
  border-radius: 16px;
  max-width: 55%;
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.07) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: skelShimmer 1.4s ease-in-out infinite;
}
.chat-msg-skel--theirs { align-self: flex-start; width: 52%; }
.chat-msg-skel--mine { align-self: flex-end; width: 38%; }

/* ── Форма отправки ──
   align-items: center — кнопка отправки всегда выровнена по вертикальному
   центру textarea, а не прижата к его нижнему краю. При однострочном
   тексте (самый частый случай) высота textarea и кнопки почти совпадают,
   но не точь-в-точь (border/padding textarea против фиксированных
   width/height кнопки) — на flex-end эта небольшая разница читалась как
   заметный сдвиг самолётика вверх относительно поля ввода. При росте
   textarea на несколько строк (см. автовысота в js/chat.js) center держит
   кнопку по центру всего блока — привычное поведение мессенджеров,
   вместо приклеивания к нижней кромке. */
.chat-thread-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%),
    var(--bg-glass);
  flex-shrink: 0;
}

.chat-thread-input {
  flex: 1;
  resize: none;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(232,232,232,0.12);
  border-radius: 18px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: 'Rajdhani', sans-serif;
  color: var(--text);
  outline: none;
  max-height: 120px;
  line-height: 1.4;
  backdrop-filter: blur(8px);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.chat-thread-input:focus {
  border-color: rgba(232,232,232,0.4);
  box-shadow: 0 0 0 3px rgba(232,232,232,0.07);
  background: rgba(232,232,232,0.02);
}
.chat-thread-input::placeholder { color: var(--text-muted); }

/* Кнопка отправки — без фона, видна только сама иконка-стрелка. Кликабельная
   область (width/height) намеренно больше самой иконки внутри неё (26px
   иконка в 40px кнопке) — без круглого фона глазу не за что зацепиться,
   чтобы понять реальные границы хитбокса, поэтому оставляем прежний размер
   зоны клика/тапа, просто он больше не отрисован визуально. Свечение теперь
   висит на самой SVG через drop-shadow (а не на ::before вокруг круга,
   которого больше нет) — так glow повторяет силуэт стрелки, а не пустой
   прозрачный квадрат кнопки. */
.chat-send-btn {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--green);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--t-fast), opacity var(--t-fast), color var(--t-med);
}
.chat-send-btn svg {
  position: relative;
  width: 26px;
  height: 26px;
  transform: rotate(-40deg);
  filter: drop-shadow(0 0 6px var(--green-glow));
  transition: transform var(--t-med), filter var(--t-med);
  animation: sendIconGlowPulse 2.6s ease-in-out infinite;
}
.chat-send-btn:hover {
  color: var(--blue);
  transform: scale(1.1);
}
.chat-send-btn:hover svg {
  transform: rotate(-25deg) scale(1.05);
  filter: drop-shadow(0 0 10px var(--blue-glow));
}
.chat-send-btn:active { transform: scale(0.92); }
.chat-send-btn:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
}
.chat-send-btn:disabled svg { animation-play-state: paused; filter: none; }
/* Проигрывается на #chatSendBtn через JS в момент отправки (см.
   _chatSendMessage: sendBtn.classList.add('chat-send-btn--sent')) — сама
   кнопка тут же становится disabled, так что класс безопасно снять по
   концу анимации, не заботясь о повторном клике поверх неё. Базовый
   rotate(-40deg) сохраняется как стартовая точка полёта, а не сбрасывается
   в 0 — иначе стрелка "дёрнулась" бы обратно в горизонталь на кадре 0%. */
.chat-send-btn--sent svg { animation: chatSendFly 0.45s cubic-bezier(0.34, 1.3, 0.64, 1); }

@keyframes sendIconGlowPulse {
  0%, 100% { filter: drop-shadow(0 0 6px var(--green-glow)); }
  50%      { filter: drop-shadow(0 0 11px var(--green-glow)); }
}
@keyframes chatSendFly {
  0%   { transform: rotate(-40deg) translate(0, 0) scale(1);         opacity: 1; }
  40%  { transform: rotate(-40deg) translate(9px, -9px) scale(0.75); opacity: 0; }
  41%  { transform: rotate(-40deg) translate(-9px, 9px) scale(0.75); opacity: 0; }
  100% { transform: rotate(-40deg) translate(0, 0) scale(1);         opacity: 1; }
}

@media (max-width: 640px) {
  /* Область сообщений — flex:1 из базового правила (см. выше), без
     собственного max-height: она заполняет ровно то пространство, что
     ей выделяет родительская flex-цепочка (.chat-page-shell → #chatBody
     → .chat-thread), от шапки до формы ввода. На мобильном страница
     чата к тому же занимает почти весь экран (см. .chat-page-shell в
     @media 768px выше), так что здесь это единственный растягиваемый
     блок между двумя фиксированными по высоте элементами — если бы он
     останавливался раньше их границы, под последним сообщением был бы
     пустой зазор перед формой. min-height оставляем как подстраховку на
     случай очень маленького вьюпорта. */
  .chat-thread-messages { min-height: 280px; padding: 14px 12px; }
  .chat-msg-row { max-width: 88%; }
  .chat-thread-header { padding: 10px 12px; }
  /* Нижний паддинг формы учитывает системную safe-area (домашний индикатор
     на iPhone и т.п.) тем же приёмом, что и .mobile-bottom-nav выше —
     иначе фон формы обрывается раньше системной области, оставляя под
     полем ввода пустую полосу до самого края экрана. */
  .chat-thread-form { padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .chat-convo-row { padding: 9px 6px; gap: 11px; }
  .chat-convo-row::after { left: 61px; }
  .chat-convo-avatar { width: 44px; height: 44px; font-size: 15px; }
}

/* ══════════════════════════════════════════════════════
   ЧАТ — #chatSection как отдельная страница (открывается через
   switchTab('chat'), тем же способом, что #profileSection/
   #friendsSection выше, см. js/ui.js: switchTab). Само содержимое
   (.chat-convo-*, .chat-thread-*, .chat-msg-*) уже стилизовано выше —
   этот блок задаёт только высоту самой страницы и внутреннюю
   структуру, чтобы список диалогов/сообщений скроллился сам, а не
   растягивал всю страницу сайта вниз.

   Раньше эта высота бралась "бесплатно" от .chat-overlay-panel
   (модалка с max-height:840px, position:fixed на весь экран) —
   теперь #chatSection лежит в обычном потоке <main class="main-content">
   вместе с остальными страницами, поэтому высоту нужно задавать явно:
   calc(100vh - ...) с вычетом header'а и внешних отступов страницы
   (см. .main-content: padding 36px 24px 72px). На мобильном вместо
   header'а внизу экрана — .mobile-bottom-nav (--mobile-nav-height),
   поэтому вычитается она, а не header. */
.chat-page-shell {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  height: calc(100dvh - 200px);
  min-height: 420px;
  max-height: 780px;
  background: linear-gradient(155deg, rgba(16,16,16,0.98) 0%, rgba(12,12,12,0.97) 100%);
  border-radius: 24px;
  box-shadow: 0 32px 90px rgba(0,0,0,0.92);
  overflow: hidden;
  position: relative;
}
/* Тонкое сияние сверху панели — тот же приём, что у .profile-header::before,
   чтобы чат визуально был частью того же дизайн-языка, что профиль/друзья. */
.chat-page-shell::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-glow);
  pointer-events: none;
  z-index: 0;
}
.chat-page-shell > * { position: relative; z-index: 1; }

/* #chatSection/#chatBody заполняют .chat-page-shell по высоте.
   #chatBody — сам скроллящийся контейнер для экрана "список диалогов"
   (.chat-convo-list + блок "Начать новый диалог" вместе, как единое
   целое). Экран "открытая переписка" (.chat-thread) вместо этого сам
   управляет собственным скроллом через свой дочерний
   .chat-thread-messages (flex:1, min-height:0) — шапка переписки и
   форма ввода снизу должны оставаться на месте, а не уезжать вместе
   с историей сообщений, поэтому у .chat-thread здесь принудительно
   overflow:hidden, а не auto. */
#chatSection,
#chatBody {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
#chatBody { overflow-y: auto; padding: 0 28px 24px; }
.chat-page-shell .chat-thread { flex: 1; min-height: 0; overflow: hidden; margin: 0 -28px; }
.chat-page-shell .list-header { padding: 24px 28px 18px; flex-shrink: 0; }

@media (max-width: 768px) {
  .chat-page-shell {
    height: calc(100vh - var(--mobile-nav-height) - env(safe-area-inset-bottom, 0px) - env(safe-area-inset-top, 0px) - 96px);
    height: calc(100dvh - var(--mobile-nav-height) - env(safe-area-inset-bottom, 0px) - env(safe-area-inset-top, 0px) - 96px);
    border-radius: 18px;
  }
  #chatBody { padding: 0 16px 18px; }
  .chat-page-shell .chat-thread { margin: 0 -16px; }
  .chat-page-shell .list-header { padding: 18px 16px 14px; }
}

/* ══════════════════════════════════════════════════════
   ПРОФИЛЬ — свой и чужой
   ══════════════════════════════════════════════════════ */
.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  position: relative;
  padding: 22px 24px;
  border-radius: 18px;
  /* Milk glass — тот же материал, что у .profile-hero-card/.stats-card
     и .card-list-badge на постерах: молочно-белый полупрозрачный слой
     поверх тёмной подложки, сильный blur+saturate, тонкая светлая
     обводка вместо сплошной заливки. */
  background:
    linear-gradient(rgba(240,240,245,0.07), rgba(240,240,245,0.07)),
    rgba(10,10,14,0.35);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  overflow: hidden;
}
/* Тонкое сияние сверху карточки — перекликается с --grad-glow сайта */
.profile-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-glow);
  pointer-events: none;
}

.profile-avatar-lg {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', monospace;
  font-size: 28px;
  font-weight: 700;
  color: #051018;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(232,232,232,0.15);
}

.profile-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  padding: 3px;
  border-radius: 50%;
  background: var(--grad-primary);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.profile-avatar-lg--img { padding: 0; overflow: hidden; box-shadow: none; border: 2px solid var(--bg-card); }
.profile-avatar-lg--img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.profile-avatar-edit-btn {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-hl);
  color: var(--green);
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,0.45);
  transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}
.profile-avatar-edit-btn:hover { background: rgba(232,232,232,0.1); transform: none; }

.profile-bio {
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
  margin-top: 9px;
  max-width: 46ch;
  white-space: pre-wrap;
  word-break: break-word;
}
.profile-bio--empty { color: var(--text-muted); font-style: italic; }

.profile-header-info { flex: 1; min-width: 160px; position: relative; }

.profile-nickname {
  font-family: 'Orbitron', monospace;
  font-size: 21px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  text-shadow: 0 0 24px rgba(232,232,232,0.12);
}

.profile-you-tag {
  font-family: 'Rajdhani', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #0c0c0c;
  background: var(--grad-primary);
  border: 1px solid rgba(232,232,232,0.4);
  padding: 3px 11px;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(232,232,232,0.18);
}

.profile-joined {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.profile-joined::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green-dim);
  opacity: 0.6;
  flex-shrink: 0;
}

.profile-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(232,232,232,0.05);
  border: 1px solid rgba(232,232,232,0.16);
  color: var(--text);
  font-size: 12px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 9px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
  position: relative;
}
.profile-back-btn:hover { color: var(--green); background: rgba(232,232,232,0.12); border-color: rgba(232,232,232,0.4); transform: none; }
.profile-back-btn:active { transform: none; }

/* ── Действия в шапке чужого профиля (написать / добавить в друзья / заявка) ── */
.profile-action-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-msg-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(232,232,232,0.3);
  background: rgba(232,232,232,0.06);
  color: var(--green);
  font-family: 'Rajdhani', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 9px 16px;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.profile-msg-btn:hover { background: rgba(232,232,232,0.14); border-color: var(--green); transform: none; }
.profile-msg-btn:active { transform: none; }
.profile-msg-btn svg { flex-shrink: 0; }

.profile-hero-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
@media (max-width: 700px) {
  .profile-hero-row { grid-template-columns: repeat(2, 1fr); }
}

.profile-hero-card {
  /* Milk glass — тот же материал, что у .stats-hero-card и
     .card-list-badge на постерах: молочно-белый полупрозрачный слой
     поверх тёмной подложки, сильный blur+saturate, тонкая светлая
     обводка вместо сплошной непрозрачной заливки. */
  background:
    linear-gradient(rgba(240,240,245,0.07), rgba(240,240,245,0.07)),
    rgba(10,10,14,0.35);
  border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  border-radius: var(--radius);
  padding: 17px 10px 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
/* Тонкая акцентная полоска сверху — перекликается с .nav-tab.active */
.profile-hero-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad-primary);
  opacity: 0.55;
}
.profile-hero-card:hover {
  border-color: rgba(255,255,255,0.24);
  box-shadow: 0 10px 24px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.1);
}

.profile-hero-num {
  font-family: 'Orbitron', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.profile-hero-label {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.profile-top-genre {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background:
    linear-gradient(rgba(240,240,245,0.05), rgba(240,240,245,0.05)),
    rgba(10,10,14,0.3);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(min(14px, var(--pf-cap, 999px))) saturate(180%);
  -webkit-backdrop-filter: blur(min(14px, var(--pf-cap, 999px))) saturate(180%);
  border-radius: 999px;
}
.profile-top-genre b { color: var(--text); font-weight: 600; }

.profile-lists-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 22px;
  /* Milk glass, более лёгкая версия (капсула-навигация, не карточка
     данных) — тот же принцип, что у .profile-header/.stats-card. */
  background:
    linear-gradient(rgba(240,240,245,0.04), rgba(240,240,245,0.04)),
    rgba(10,10,14,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px))) saturate(180%);
  -webkit-backdrop-filter: blur(min(16px, var(--pf-cap, 999px))) saturate(180%);
  border-radius: 13px;
  padding: 3px;
  width: fit-content;
  max-width: 100%;
}

.profile-list-tab {
  background: transparent;
  border: none;
  color: rgba(168,168,168,0.75);
  font-size: 12px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 7px 13px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background var(--t-med),
    color var(--t-med),
    box-shadow var(--t-med);
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

/* Hover state — мягкая заливка без рамки, как у .nav-tab:hover */
.profile-list-tab:hover { color: #e8e8e8; background: rgba(255,255,255,0.06); }

.profile-list-tab:active {
  background: rgba(255,255,255,0.11);
  transform: none;
}

/* Active / selected state — заливка + акцентная линия по нижнему краю,
   как у .nav-tab.active */
.profile-list-tab.active {
  background: rgba(255,255,255,0.09);
  color: var(--green);
  font-weight: 800;
  box-shadow: inset 0 -2px 0 0 #e8e8e8;
}
.profile-list-tab.active:hover { background: rgba(255,255,255,0.12); }

.profile-list-tab-count {
  font-family: 'Orbitron', monospace;
  font-size: 10.5px;
  opacity: 0.75;
}
.profile-list-tab.active .profile-list-tab-count { color: var(--green); opacity: 1; }

/* Вкладка скрытого приватностью списка — замочек вместо счётчика,
   приглушённый цвет, но всё ещё кликабельна (показывает пояснение) */
.profile-list-tab--locked { color: rgba(168,168,168,0.5); }
.profile-list-tab--locked:hover { color: rgba(168,168,168,0.75); background: rgba(255,255,255,0.04); }
.profile-list-tab--locked.active {
  color: rgba(168,168,168,0.75);
  background: rgba(255,255,255,0.05);
  box-shadow: inset 0 -2px 0 0 rgba(168,168,168,0.4);
}
.profile-list-tab-lock { opacity: 0.8; flex-shrink: 0; }

/* Экран "список скрыт настройками приватности" внутри профиля —
   переиспользует .empty-state, добавляет только компактный отступ
   (замочек-иконка внутри уже задаёт вертикальный ритм через margin) */
.empty-state--locked { padding: 60px 20px; }

/* Skeleton-заглушка на время первого запроса профиля */
.profile-header--skel { pointer-events: none; }
.profile-skel-block,
.profile-skel-line {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: skelShimmer 1.4s ease-in-out infinite;
  border-radius: 10px;
}
.profile-skel-line { border-radius: 6px; }

/* Пункт меню "Мой профиль" в дропдауне аккаунта */
.nav-dropdown-item--profile {
  color: var(--text-muted);
  display: flex;
  align-items: center;
}
.nav-dropdown-item--profile.active,
.nav-dropdown-item--profile:hover { color: var(--green); }

/* Бейдж числа входящих заявок в друзья на пункте "Друзья" в дропдауне
   аккаунта (десктоп: #friendsAccountBadge) и в мобильном попапе "Ещё"
   (#friendsAccountBadgeM) — та же акцентная "пилюля", что и
   .friends-subtab-badge внутри самой вкладки "Друзья" (см. выше), чтобы
   новая заявка была заметна ещё до открытия вкладки. */
.nav-dropdown-item-friends-badge {
  background: var(--green);
  color: #051018;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 999px;
  font-family: 'Orbitron', monospace;
}
.nav-dropdown-item-friends-badge.hidden { display: none; }

@media (max-width: 640px) {
  .profile-header { gap: 14px; padding: 16px 16px; border-radius: 16px; }
  .profile-avatar-lg { width: 60px; height: 60px; font-size: 22px; }
  .profile-nickname { font-size: 17px; }
}
.nav-dropdown-item--stats.active,
.nav-dropdown-item--stats:hover { color: var(--green); }

/* ══════════════════════════════════════════════════════
   ФИКС: промахи кликов из-за hover-анимаций на тач-устройствах
   ══════════════════════════════════════════════════════
   На мобильных/планшетах браузер симулирует :hover в момент тапа.
   Если у элемента на :hover меняется transform (сдвиг/масштаб),
   кнопка визуально "уезжает" из-под пальца ещё до того, как палец
   поднят — из-за этого тап срабатывает мимо неё (эффект тот же, что
   и с translateX на .back-btn/.list-btn/.nav-dropdown-item выше,
   только там сдвиг убран совсем, а здесь — только для touch).
   (hover: none) — у устройства нет настоящего mouse-hover (телефон,
   планшет). На обычной мыши правило не действует, весь визуал
   ховера остаётся как был. */
@media (hover: none), (pointer: coarse) {
  .genre-tag:hover,
  .ep-btn:hover,
  .bg-preset:hover,
  .npb-ep:hover,
  .modal-close:hover,
  .modal-close-text:hover,
  .import-btn:hover,
  .filter-apply-btn:hover,
  .auth-submit-btn:hover,
  .catalog-more-btn:hover,
  .nav-tab:hover,
  .notif-bell-btn:hover,
  .nav-account-btn:hover,
  .nav-account-btn:hover .nav-account-avatar,
  .friend-card:hover,
  .profile-avatar-edit-btn:hover,
  .profile-back-btn:hover,
  .profile-msg-btn:hover,
  .chat-anime-card:hover,
  .chat-anime-card:focus-visible {
    transform: none !important;
  }
}

/* ── Карточка аниме в сообщении чата ──────────────────────
   Дорисовывается асинхронно в .chat-anime-card-slot (см.
   js/chat.js: _chatEnrichBubbleWithAnimeMention), когда в тексте
   сообщения распознано название аниме. Слот — прямой flex-ребёнок
   .chat-msg-bubble (flex-wrap: wrap, см. выше), поэтому карточка
   получает flex-basis: 100%, чтобы гарантированно уйти на новую
   строку под текстом и временем, а не втиснуться в свободное место
   рядом с ними. */
.chat-anime-card-slot {
  flex-basis: 100%;
  order: 99;
}
.chat-anime-card-slot:empty { display: none; }

.chat-anime-card {
  display: flex;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  margin-top: 2px;
  padding: 7px;
  border-radius: 10px;
  border: 1px solid var(--border-hl);
  background: var(--grad-card), var(--bg-glass2);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.chat-anime-card:hover,
.chat-anime-card:focus-visible {
  border-color: var(--green);
  background: var(--grad-card), rgba(232,232,232,0.08);
  transform: translateY(-1px);
}
.chat-anime-card:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.chat-msg-row--mine .chat-anime-card { border-color: rgba(232,232,232,0.3); background: var(--grad-card), rgba(0,0,0,0.16); }
.chat-msg-row--mine .chat-anime-card:hover { background: var(--grad-card), rgba(0,0,0,0.24); }

.chat-anime-card-poster {
  position: relative;
  flex-shrink: 0;
  width: 46px;
  height: 64px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-input);
}
.chat-anime-card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.chat-anime-card-poster-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 15px;
}
.chat-anime-card-score {
  position: absolute;
  left: 3px;
  bottom: 3px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 700;
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 0.02em;
  color: #06080f;
  background: var(--green);
  line-height: 1.5;
}

.chat-anime-card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 0;
}
.chat-anime-card-tag {
  align-self: flex-start;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--green);
  background: var(--green-faint);
  border: 1px solid var(--border);
}
.chat-anime-card-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.chat-anime-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'Rajdhani', sans-serif;
}

@media (max-width: 560px) {
  .chat-anime-card-poster { width: 40px; height: 56px; }
  .chat-anime-card-title { font-size: 12.5px; }
}



/* TOP BANNER (статичная картинка над шапкой) и HERO-приветствие
   удалены — их роль теперь играет полноэкранный HERO BANNER ниже
   (герой-слайдер «Сейчас выходит», см. секцию HERO BANNER дальше
   по файлу и js/now-airing.js). */

/* =====================================================
   HERO BANNER — полноэкранный герой на главной («Сейчас выходит»)
   Заменяет собой старый статичный .top-banner и приветственный
   .hero-block. Контент — карусель онгоингов из расписания выхода
   серий (см. js/now-airing.js: loadNowAiring), рендерится в
   #airingTrack тем же движком навигации, что и раньше был у
   компактного .airing-block (стрелки/точки/автоплей/свайп не
   менялись — см. now-airing.js).
   ===================================================== */
.hero-banner {
  position: relative;
  width: 100%;
  margin: 0 0 32px;
  /* Выходит на всю ширину окна, а не только колонки контента —
     .page-content обычно имеет max-width/padding, здесь их компенсируем. */
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  width: 100vw;
}

#searchSection > #nowAiringBlock.hero-banner {
  margin-top: -64px;
  margin-bottom: 32px;
}

.hero-banner-slider {
  position: relative;
  width: 100vw !important;
  margin: 0;
  height: 520px;
  overflow: hidden;
  background: var(--bg);
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-banner-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.6s var(--ease-premium);
  will-change: transform;
}

.hero-slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: default;
}

.hero-slide-bg {
  position: absolute;
  inset: 0;
  /* Фирменный градиент-заглушка вместо плоского цвета: если постер
     реально не загрузится ни по одному из URL-кандидатов (см.
     wirePosterImgFallback в js/now-airing.js — при полном провале
     .hero-slide-bg-blur получает opacity:0, и тогда становится виден
     именно этот фон), баннер не превращается в голый тёмный
     прямоугольник без единого акцента, а сохраняет узнаваемый вид
     сайта — тот же розовый акцент (var(--green)), что и подсветка
     шапки/кнопок, просто в приглушённом виде. */
  background:
    radial-gradient(ellipse 80% 60% at 15% 20%, rgba(232,232,232,0.28) 0%, transparent 62%),
    radial-gradient(ellipse 70% 55% at 90% 85%, rgba(207,207,207,0.1) 0%, transparent 60%),
    linear-gradient(160deg, var(--bg-card) 0%, var(--bg) 75%);
  overflow: hidden;
}

/* Почему тут два разных <img>, а не один растянутый на всю ширину:
   постеры, которые сюда подставляются (js/now-airing.js →
   posterUrls(anime, 'full')), — это карточные постеры аниме (обычно
   ~225–600px по высоте), а не отдельные широкоформатные backdrop-арты
   — у API их нет ни в каком размере (см. комментарий у posterUrl() в
   js/utils.js: набор size-ключей — fullsize/big/huge/medium/small/mega,
   все варианты ОДНОГО И ТОГО ЖЕ вертикального постера, без исключения).
   Раньше единственный <img class="hero-slide-bg-img"> с object-fit:
   cover растягивал эту узкую картинку на всю ширину блока (обычно
   ~1600–1920px) при высоте всего 440px — апскейл на ~1.1–1.4× по
   каждой оси, из-за которого на плавных заливках (кожа, небо, вода)
   становится заметна мягкость/мыло: физически не хватает исходных
   пикселей, чтобы прорисовать такую площадь резко.
   Решение — не пытаться замаскировать растяжение (фильтрами/шумом),
   а честно развести две роли по разным слоям:
   1) .hero-slide-bg-blur — та же картинка, тоже растянута на всю
      ширину, но с задачей быть РАЗМЫТЫМ атмосферным фоном, а не
      резким изображением — blur(48px) полностью скрывает апскейл-
      артефакты, потому что этот слой сознательно не претендует на
      чёткость (тот же приём, что blurred album art в Spotify/Apple
      Music или backdrop в Apple TV);
   2) .hero-slide-poster-frame — тот же постер ЕЩЁ РАЗ, но уже как
      компактная карточка в натуральных для постера пропорциях
      (aspect-ratio: 2/3), которая никогда не растягивается шире
      своего реального разрешения — там же, где раньше картинка была
      единственным (и единственно мыльным) источником резкости. */
.hero-slide-bg-blur {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
  filter: blur(48px) saturate(1.25) brightness(0.6);
  transform: scale(1.18);
  transition: opacity 0.4s var(--t-med);
}

/* Компактная резкая карточка постера — natural aspect-ratio, никогда
   не растягивается. Скрыта на мобильных (см. медиа-запросы ниже): при
   высоте баннера 310–370px и тексте на всю ширину экрана карточке
   попросту негде поместиться, не перекрыв заголовок/жанры. */
.hero-slide-poster-frame {
  position: absolute;
  top: 50%;
  right: clamp(24px, 5vw, 80px);
  transform: translateY(-50%);
  height: 84%;
  aspect-ratio: 2 / 3;
  border-radius: 22px;
  overflow: hidden;
  z-index: 1;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  background: var(--bg-card);
}

.hero-slide-poster-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.4s var(--t-med);
}

/* Затемнение низа карточки постера — чтобы плашка обратного отсчёта
   (.hero-countdown ниже) не терялась на светлом кадре обложки. */
.hero-slide-poster-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 45%);
  pointer-events: none;
}

/* ── Countdown-плашка «через N ч/мин» прямо на постере (десктоп) ──
   Две ячейки часы/минуты, живое обновление раз в минуту через
   _updateAiringCountdowns() в js/now-airing.js. Показывается только
   когда известна точная дата следующей серии (nextTs !== null) —
   иначе плашки просто нет в разметке. */
.hero-countdown {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  display: flex;
  gap: 8px;
}

.hero-countdown-box {
  flex: 1;
  text-align: center;
  background: rgba(16, 16, 22, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 8px 4px 7px;
  backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(180%);
  -webkit-backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(180%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.hero-countdown-box .n {
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}

.hero-countdown-box .l {
  display: block;
  margin-top: 3px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
}

/* Горизонтальный градиент слева направо — под текстом плотный тёмный
   фон, справа картинка открывается почти полностью. Плюс лёгкая
   тень снизу, чтобы бейджи/кнопки не терялись на светлых кадрах.
   Средняя точка градиента сдвинута чуть левее (было 48%/72%, стало
   42%/64%) — карточка постера справа уже сама по себе тёмная рамка с
   тенью, ей не нужно дополнительное затемнение от fade поверх, а тексту
   слева нужен чуть больший запас плотного фона, раз теперь справа
   есть ещё один заметный визуальный объект (карточка), с которым
   заголовок должен не конкурировать за внимание. */
.hero-slide-fade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--bg) 0%, rgba(10,10,10,0.92) 22%, rgba(10,10,10,0.6) 42%, rgba(10,10,10,0.15) 64%, transparent 80%),
    linear-gradient(to top, rgba(10,10,10,0.75) 0%, transparent 30%, transparent 70%, rgba(10,10,10,0.3) 100%);
  pointer-events: none;
}

.hero-slide-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 14px;
  height: 100%;
  max-width: min(640px, 54%);
  padding: 0 0 0 clamp(24px, 6vw, 96px);
}

.hero-slide-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #fff;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  padding: 5px 14px;
  border-radius: 999px;
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Короткая описательная строка под заголовком */
.hero-slide-desc {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.5;
  max-width: 460px;
}

.hero-slide-title {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  font-weight: 800;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.6px;
  color: #fff;
  cursor: pointer;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* Тень небольшая и с запасом по краям: overflow:hidden (нужен для
     line-clamp) обрезал широкую тень по прямоугольнику — было видно «квадрат». */
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
  padding: 10px 14px;
  margin: -10px -14px;
  transition: opacity 0.2s ease;
}

.hero-slide-title:hover { opacity: 0.85; }

.hero-slide-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-genre-chip {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 5px 13px;
  border-radius: 999px;
  backdrop-filter: blur(min(14px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(14px, var(--pf-cap, 999px)));
  transition: all 0.2s ease;
}
.hero-genre-chip:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.28);
}

/* Ряд бейджей-пилюль: ★ рейтинг / год / тип / эпизод */
.hero-slide-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: rgba(18, 18, 24, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 14px;
  border-radius: 999px;
  backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(180%);
  -webkit-backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(180%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.hero-badge-score {
  color: #ffd76a;
  background: rgba(255, 215, 106, 0.15);
  border-color: rgba(255, 215, 106, 0.35);
  font-weight: 700;
}

.hero-slide-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.hero-slide-btn-play {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: #000;
  background: #ffffff;
  border: none;
  padding: 12px 26px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.24);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, opacity 0.2s ease;
}

.hero-slide-btn-play:hover {
  opacity: 0.92;
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
}

.hero-slide-btn-play:active {
  transform: scale(0.96);
}

.hero-slide-btn-play svg { flex-shrink: 0; }

.hero-slide-btn-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-slide-btn-info:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.32);
  transform: scale(1.05);
}

.hero-slide-btn-info:active {
  transform: scale(0.94);
}

/* ── Apple-style индикаторы и стрелки ── */
.hero-banner-dots {
  position: absolute;
  left: clamp(24px, 6vw, 96px);
  bottom: 28px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 7px;
}

.airing-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  padding: 0;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1), background 0.35s ease;
}

.airing-dot:hover { background: rgba(255, 255, 255, 0.55); }

.airing-dot.active {
  width: 28px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.6);
}

.hero-banner-arrows {
  position: absolute;
  right: clamp(24px, 6vw, 96px);
  bottom: 24px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-banner-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: transparent;
  border: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-banner-arrow svg {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.8));
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.hero-banner-arrow:hover {
  background: transparent;
  border: none;
  box-shadow: none;
  transform: scale(1.2);
}

.hero-banner-arrow:active {
  transform: scale(0.92);
}

/* ── Адаптив: планшет ── */
@media (max-width: 860px) {
  .hero-banner-slider { height: 370px; }
  /* Раньше 88% — почти вся ширина баннера, карточке справа было негде
     поместиться. Сужаем до 68%, освобождая полосу под уменьшенную
     карточку постера (см. .hero-slide-poster-frame ниже) вместо того,
     чтобы полностью убирать картинку из этого брейкпоинта — тот же баг
     "на телефоне виден только смытый фон", просто на чуть более широком
     экране (телефон в горизонтальной ориентации, фаблет и т.п.). */
  .hero-slide-content { max-width: 68%; padding-left: clamp(20px, 5vw, 48px); }
  .hero-slide-title { font-size: clamp(24px, 4.4vw, 34px); }
  /* Раньше здесь стоял display:none. Возвращаем карточку, но заметно
     компактнее десктопной версии (82% высоты блока → фиксированные
     220px) — на 370px высоты блока такая карточка помещается в правой
     трети без наложения на текст, который выше сужен до 68%. */
  .hero-slide-poster-frame {
    right: clamp(16px, 4vw, 32px);
    height: 220px;
  }
  .hero-slide-fade {
    background:
      linear-gradient(90deg, var(--bg) 0%, rgba(10,10,10,0.92) 30%, rgba(10,10,10,0.5) 60%, rgba(10,10,10,0.15) 85%, transparent 100%),
      linear-gradient(to top, rgba(10,10,10,0.75) 0%, transparent 30%, transparent 70%, rgba(10,10,10,0.3) 100%);
  }
}

/* ── Адаптив: мобильный ── */
@media (max-width: 768px) {
  .hero-banner { margin-bottom: 28px; }
  #searchSection > #nowAiringBlock.hero-banner {
    margin-top: -16px;
    margin-left: -12px !important;
    margin-right: -12px !important;
    width: calc(100% + 24px) !important;
    left: auto !important;
    right: auto !important;
    margin-bottom: 28px;
  }
  .hero-banner-slider {
    width: 100% !important;
    height: 400px;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
  /* Раньше здесь была маленькая карточка (132px) в углу сверху справа,
     а весь остальной баннер занимал только размытый .hero-slide-bg-blur
     — по факту получалось "чёткий кусочек в углу + смытое пятно вокруг".
     Вместо этого сам постер теперь и есть фон блока целиком: та же
     .hero-slide-poster-frame растягивается на весь .hero-slide-bg через
     position: absolute; inset: 0 (перекрывая исходные top/right/height/
     aspect-ratio из базовых стилей — object-fit: cover на img ниже не
     даёт картинке искажаться при любых пропорциях баннера). Десктопных
     стилей это не касается: правило живёт только внутри ≤768px. */
  .hero-slide-poster-frame {
    display: block;
    position: absolute;
    inset: 0;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    transform: none;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    border-radius: 0;
    box-shadow: none;
    z-index: 0;
  }
  .hero-slide-poster-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Постеры аниме физически небольшие (обычно не шире ~400-500px
       даже в максимальном качестве, отдаваемом API — см. комментарий
       у posterUrls() в js/utils.js), а здесь растягиваются на весь
       экран телефона: на retina-дисплеях (DPR 2-3x) это заметный
       апскейл, дающий мыльную/пикселизованную картинку (см. скриншот
       бага). Само разрешение исходника увеличить нельзя — вместо
       этого лёгким contrast+saturate компенсируем часть потерянной
       чёткости на глаз: плоские апскейленные заливки читаются
       контрастнее, линии не выглядят настолько смытыми. Небольшие
       значения намеренно — больше начинает "печь" цвета и терять
       естественность на светлых кадрах.
    */
    filter: contrast(1.1) saturate(1.15);
    /* Та же логика кадрирования лица/верха постера, что и у блюр-слоя
       (.hero-slide-bg-blur ниже: object-position: center 22%) — большинство
       обложек аниме держат самое важное (лица персонажей) в верхней трети,
       а не по центру кадра. */
    object-position: center 22%;
  }
  /* Раньше единственным видимым слоем картинки был размытый фон, теперь
     его роль занял сам чёткий постер (см. .hero-slide-poster-frame выше,
     z-index: 0), а блюр-слой прячем — он оставался бы виден краями под/
     вокруг растянутого постера, если бы их пропорции не совпали ровно
     1-в-1, и тогда получилась бы двойная картинка (чёткая поверх смытой).
     Полностью не убираем через display:none, а через opacity — тот же
     wirePosterImgFallback в js/now-airing.js уже трогает opacity этого
     img при ошибке загрузки (img.style.opacity = '0'), инлайновый стиль
     иначе конфликтовал бы с display в другом свойстве. */
  .hero-slide-bg-blur { opacity: 0; }
  /* Текст был поднят и прижат к верху под маленькую карточку в углу
     (padding-top: 172px) — теперь, когда постер во весь баннер, такой
     верхний отступ уже ничем не оправдан. Но и унаследованный с десктопа
     justify-content: center (см. базовые стили .hero-slide-content) тоже
     не годится: при центрировании текст попадает примерно на 32-68%
     высоты блока, а плотная (читаемая) часть градиента ниже начинается
     только с ~68% — верхние строки (эйброу+заголовок) оказались бы на
     почти незатемнённом постере. Прижимаем блок к низу (flex-end) — так
     весь текст сосредоточен в нижней трети, там же, где градиент даёт
     максимальное затемнение, а верхние ~2/3 постера остаются открыты и
     нетронуты затемнением. */
  .hero-slide-content {
    max-width: 100%;
    padding: 0 18px 48px;
    justify-content: flex-end;
    gap: 10px;
  }
  /* Раньше градиент был ослаблен наверху специально для того, чтобы
     смытый .hero-slide-bg-blur вообще проступал сквозь затемнение (см.
     старый комментарий) — теперь фон не размыт, а чёткий постер во весь
     кадр, и цель ровно противоположная: верх постера (где обычно лицо
     персонажа) должен остаться максимально нетронутым и читаемым как
     картинка, а плотное затемнение нужно ТОЛЬКО в нижней части блока —
     там, где сидит текст (эйброу/заголовок/бейджи), иначе он потеряется
     на светлом или пёстром кадре. Поэтому верхние ~55% почти прозрачны
     (лёгкая дымка для однородности), а к низу градиент быстро уходит в
     var(--bg) — та же сплошная заливка, что и общий фон сайта вокруг
     баннера, чтобы низ блока визуально сливался со страницей. */
  .hero-slide-fade {
    background: linear-gradient(180deg,
      rgba(10,10,10,0.05) 0%,
      rgba(10,10,10,0.18) 35%,
      rgba(10,10,10,0.62) 55%,
      rgba(10,10,10,0.92) 78%,
      var(--bg) 100%);
  }
  .hero-slide-title { font-size: 22px; -webkit-line-clamp: 2; }
  .hero-badge { font-size: 12px; padding: 5px 11px; }
  .hero-slide-btn-play { padding: 12px 24px; font-size: 14px; }
  .hero-slide-btn-info { width: 42px; height: 42px; }
  .hero-banner-controls { right: 18px; bottom: 16px; }
  .hero-banner-arrows { display: none; }
  .hero-countdown { display: none; }
}

@media (max-width: 480px) {
  .hero-banner-slider { height: 380px; }
  .hero-slide-genres { display: none; }
  .hero-slide-badges { gap: 7px; }
  .hero-badge { font-size: 11px; padding: 4px 10px; }
}

/* ===== ПРИВАТНОСТЬ СПИСКОВ (js/privacy-settings.js) ===== */
.privacy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.privacy-row:last-child { border-bottom: none; }

.privacy-row-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

.privacy-row-options {
  /* .pill-toggle делает display:inline-flex сам — обёртка только
     позиционирует блок внутри строки. */
}

@media (max-width: 520px) {
  .privacy-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .privacy-row-options { width: 100%; }
  .privacy-row-options.pill-toggle { display: flex; }
  .privacy-row-options .pill-btn { flex: 1; text-align: center; }
}

/* =====================================================
   PILL TOGGLE — единый sliding-pill сегментированный
   переключатель (2+ кнопок-вариантов на одну группу).

   Используется везде, где раньше были свои варианты
   ("privacy-option-btn", "bg-tab-btn" и т.п.): приватность
   списков, вкладки настройки фона (Цвет/Картинка/Градиент)
   и любые новые подобные переключатели — чтобы вид и
   анимация были одинаковыми по всему сайту.

   Разметка:
     <div class="pill-toggle" data-pill-group>
       <div class="pill-thumb"></div>
       <button class="pill-btn active" data-value="...">Label</button>
       <button class="pill-btn" data-value="...">Label</button>
     </div>
   Логика скольжения — общая функция initPillToggle() в js/ui.js.
   ===================================================== */
.pill-toggle {
  position: relative;
  display: inline-flex;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
  flex-wrap: nowrap;
}
.pill-toggle::-webkit-scrollbar { display: none; }
.pill-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  background: var(--green);
  border-radius: 7px;
  transition: transform 0.32s cubic-bezier(.22,1,.36,1), width 0.32s cubic-bezier(.22,1,.36,1);
  z-index: 0;
  pointer-events: none;
}
.pill-btn {
  position: relative;
  z-index: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--t-fast);
}
.pill-btn:hover { color: var(--text); }
.pill-btn.active { color: var(--bg-card); }

/* Full-width вариант — вкладки на всю ширину страницы (не строка
   лейбл+пилл, как приватность списков): подвкладки импорта и
   ИМПОРТ/ЭКСПОРТ/ОЧИСТКА на странице Импорт/Экспорт. Кнопки делят
   ширину поровну через flex:1, сам .pill-toggle растягивается на всю
   ширину вместо inline-flex по контенту. */
.import-subtabs.pill-toggle,
.modal-tabs.pill-toggle {
  display: flex;
  width: 100%;
}
.import-subtabs.pill-toggle .pill-btn,
.modal-tabs.pill-toggle .pill-btn {
  flex: 1;
  text-align: center;
  justify-content: center;
}
.modal-tabs.pill-toggle .pill-btn {
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 11px 10px;
}


/* =====================================================
   BACKGROUND SETTINGS — VARIANT 1 / LARGE PREVIEW TILES
   Scoped to #bgModal so other dialogs keep their existing UI.
   ===================================================== */
#bgModal .bg-settings-modal {
  box-shadow: 0 30px 80px rgba(0,0,0,0.55);
}

#bgModal .bg-settings-body {
  padding: 22px 22px 20px;
}

/* #bgModal больше не существует в разметке (заменена страницей
   #bgSection, см. ниже) — блок ниже мёртвый CSS, оставлен только
   для истории и не влияет на вид сайта. */
#bgModal .bg-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  margin-bottom: 20px;
}

#bgModal .bg-settings-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

#bgModal .bg-color-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
#bgModal #bgColorPicker {
  width: 56px;
  height: 42px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: none;
  flex: 0 0 auto;
}
#bgModal .bg-color-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#bgModal .v1-dropzone {
  border: 2px dashed rgba(255,255,255,0.14);
  border-radius: 16px;
  padding: 26px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--t-fast);
  background: rgba(255,255,255,0.015);
  margin-bottom: 22px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}
#bgModal .v1-dropzone:hover,
#bgModal .v1-dropzone.is-dragover {
  border-color: rgba(232,232,232,0.4);
  background-color: rgba(255,255,255,0.03);
}
#bgModal .v1-dropzone svg {
  width: 30px;
  height: 30px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
#bgModal .v1-dropzone .main {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 4px;
}
#bgModal .v1-dropzone .sub {
  font-size: 11.5px;
  color: var(--text-dim);
  letter-spacing: .5px;
}
#bgModal .v1-dropzone .selected-file {
  display: inline-block;
  font-size: 11px;
  color: #fff;
  text-shadow: 0 1px 4px #000;
  padding: 6px 12px;
  background: rgba(0,0,0,.55);
  border-radius: 6px;
  font-weight: 700;
}

#bgModal .section-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

#bgModal .v1-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}
#bgModal .v1-preset-tile {
  position: relative;
  aspect-ratio: 4 / 3;
  min-width: 0;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--t-fast);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
#bgModal .v1-preset-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(232,232,232,0.4);
}
#bgModal .v1-preset-tile.selected {
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green), 0 8px 20px rgba(0,0,0,0.4);
}
#bgModal .v1-preset-tile .tag {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  padding: 16px 8px 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .5px;
  text-align: center;
  color: #fff;
}
#bgModal .v1-preset-tile .check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--green);
  color: #0c0c0c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  opacity: 0;
  transform: scale(.6);
  transition: all var(--t-fast);
}
#bgModal .v1-preset-tile.selected .check {
  opacity: 1;
  transform: scale(1);
}

#bgModal .v1-url-row {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}
#bgModal .v1-url-row input {
  flex: 1;
  min-width: 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 13px;
  font-family: 'Rajdhani', sans-serif;
  transition: all var(--t-fast);
}
#bgModal .v1-url-row input:focus {
  outline: none;
  border-color: rgba(232,232,232,0.35);
  background: rgba(255,255,255,0.03);
}
#bgModal .v1-url-row input::placeholder { color: var(--text-dim); }
#bgModal .v1-url-row button {
  background: var(--green);
  border: 1px solid var(--green);
  color: #0c0c0c;
  padding: 0 22px;
  border-radius: 10px;
  font-weight: 800;
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 1px;
  font-size: 12.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--t-fast);
}
#bgModal .v1-url-row button:hover {
  background: #fff;
  border-color: #fff;
}

#bgModal .v1-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
#bgModal .v1-chip-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
#bgModal .v1-chip-row > span {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 70px;
  font-weight: 600;
}
#bgModal .v1-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
#bgModal .v1-chip {
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
}
#bgModal .v1-chip:hover {
  border-color: rgba(255,255,255,0.25);
  color: var(--text);
}
#bgModal .v1-chip.selected {
  background: var(--green);
  border-color: var(--green);
  color: #0c0c0c;
}

#bgModal .v1-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
#bgModal .v1-slider-row > span:first-child {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 70px;
  font-weight: 600;
}
#bgModal .v1-slider-track {
  flex: 1;
  position: relative;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  min-width: 80px;
}
#bgModal .v1-slider-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: var(--green);
  border-radius: 4px;
  pointer-events: none;
}
#bgModal .v1-slider-track input[type="range"] {
  position: absolute;
  inset: -8px 0;
  width: 100%;
  height: 20px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
#bgModal .v1-slider-thumb {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translate(-50%,-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(232,232,232,0.15);
  pointer-events: none;
  transition: left .08s ease;
}
#bgModal .v1-slider-val {
  font-size: 12px;
  color: var(--text);
  font-weight: 700;
  min-width: 34px;
  text-align: right;
}

#bgModal .v1-gradient-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
#bgModal .v1-gradient-grid > div {
  min-height: 60px;
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--t-fast);
  display: flex;
  align-items: flex-end;
  padding: 6px;
  background-clip: padding-box;
}
#bgModal .v1-gradient-grid > div:hover {
  border-color: var(--green);
  transform: translateY(-2px);
}
#bgModal .v1-gradient-grid > div span {
  font-size: 10px;
  color: #fff;
  text-shadow: 0 1px 3px #000;
  font-weight: 600;
}

#bgModal .bg-settings-footer {
  border-top: 1px solid var(--border);
  padding: 16px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#bgModal .bg-settings-footer .btn-reset {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted);
  padding: 11px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all var(--t-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}
#bgModal .bg-settings-footer .btn-reset:hover {
  border-color: rgba(232,232,232,0.25);
  color: var(--green);
  background: rgba(232,232,232,0.04);
}
#bgModal .bg-settings-footer .btn-close-text {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 0 22px;
  border-radius: 10px;
  background: var(--green);
  border: 1px solid var(--green);
  color: #0c0c0c;
  height: 40px;
  min-width: 96px;
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all var(--t-fast);
}
#bgModal .bg-settings-footer .btn-close-text:hover {
  background: #fff;
  border-color: #fff;
}

@media (max-width: 520px) {
  #bgModal .v1-presets { grid-template-columns: repeat(2, 1fr); }
  #bgModal .v1-gradient-grid { grid-template-columns: repeat(2, 1fr); }
  #bgModal .v1-chip-row { align-items: flex-start; }
}

/* =====================================================
   ОТДЕЛЬНАЯ СТРАНИЦА «НАСТРОЙКИ» (#settingsSection)
   =====================================================
   Открывается по нажатию «Настройки» в мобильном попапе «Ещё»
   (см. #mobileSettingsPopup) — полноценная вкладка switchTab('settings'),
   а не ещё один попап. Вариант «Классический»: тот же язык, что и
   у .msp-list/.msp-item (см. mobile popup выше) — компактные строки
   с лейблами-разделителями групп вместо отдельных карточек на
   каждую группу, без лишнего воздуха. Токены (--bg-card, --border,
   --radius-*, --text-muted и т.д.) — те же переменные :root, что
   использует остальной сайт, новых не вводится.

   На десктопе вкладка не нужна (там настройки живут в выпадающем
   меню «Аккаунт» и открывают модалки напрямую) — .settings-page
   ограничена max-width и центрируется, чтобы не расползаться на
   широком экране, но по умолчанию открывается только с мобильной
   нижней навигации. */

.settings-page {
  max-width: 640px;
  margin: 0 auto;
  padding-bottom: 24px;
}

/* ── Верхняя панель: «Назад» + заголовок ──
   Тот же паттерн, что у .list-header (см. #listsSection) — но с
   кнопкой назад слева, т.к. это отдельная страница, а не подраздел
   с фильтрами. Без лишних элементов, как просили: ни поиска, ни
   счётчиков, ни экшенов справа. */
.settings-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 2px 20px;
}
.settings-back {
  width: auto;
  height: auto;
  padding: 4px 6px 4px 0;
  flex-shrink: 0;
  border-radius: 0;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  cursor: pointer;
  box-shadow: none;
  transition: color var(--t-fast), opacity var(--t-fast);
}
.settings-back:hover { background: none; border-color: transparent; color: #ffffff; }
.settings-back svg { width: 20px; height: 20px; }
.settings-topbar h1 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text);
}

/* ── Список настроек — компактные строки, разделённые тонкой
   линией, без отдельной рамки/фона на каждую (см. .v1-row в
   исходном сравнении вариантов). Группы разделены только текстовым
   лейблом .settings-group-label, как у .msp-label в попапе «Ещё». ── */
.settings-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--text-dim);
  padding: 0 6px 8px;
  margin-top: 18px;
}
.settings-group-label:first-child { margin-top: 4px; }

/* Группа = заголовок + карточка со строками внутри. Раньше карточка
   была "стеклянной" (backdrop-filter) как .mobile-nav-items/.friend-card/
   .cmts-toggle-btn, но над фоном с background-attachment:fixed
   (см. js/bg-settings.js) первая отрисовка размытия у backdrop-filter
   заметно запаздывала относительно появления самой страницы — эффект
   выглядел как "стекло долго загружается". Сохраняем ту же группировку
   строк в карточки, но обычным непрозрачным фоном без backdrop-filter. */
.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  border-radius: 0;
  position: relative;
  transition: background var(--t-slow), box-shadow var(--t-slow), border-color var(--t-slow), opacity var(--t-slow);
}
.settings-group-label + .settings-row,
#settingsRowPerfScroll {
  border-top: 1px solid var(--border);
  border-radius: 14px 14px 0 0;
}
/* Последняя строка каждой группы — закрывает карточку снизу.
   ВНЕШНИЙ ВИД: Фон / Размер постов → Размер постов.
   ИНТЕРФЕЙС: Анимации / Компактный режим → Компактный режим.
   УВЕДОМЛЕНИЯ: Звуки / Вибрация / Предпросмотр → Предпросмотр.
   ПРИВАТНОСТЬ: Приватность списков / Смена пароля → Смена пароля.
   ДАННЫЕ: только Импорт/Экспорт → сама и первая, и последняя. */
.settings-row[onclick*="'poster'"],
#settingsRowCompact,
#settingsRowNotifPreview,
#settingsRowChangePassword,
#settingsRowImportExport,
#settingsRowPerfFps {
  border-radius: 0 0 14px 14px;
  margin-bottom: 8px;
}
#settingsRowImportExport {
  border-radius: 14px;
}
/* Свечение по краям вместо смены фона — box-shadow с мягким размытием,
   z-index поднимает строку над соседями по группе (иначе тень легла бы
   позади них, т.к. строки идут вплотную без зазора). inset-обводка
   добавляет тонкий видимый край, внешнее свечение — сам "glow". */
.settings-row:hover {
  z-index: 1;
  opacity: 1;
  border-color: rgba(232,232,232,0.3);
  box-shadow: 0 0 0 1px rgba(232,232,232,0.12);
}
.settings-row:active {
  opacity: 1;
  box-shadow: 0 0 0 1px rgba(232,232,232,0.18);
}

.settings-row-icon {
  width: 32px; height: 32px;
  flex-shrink: 0;
  border-radius: 9px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.settings-row-icon svg { width: 16px; height: 16px; }

.settings-row-text { flex: 1; min-width: 0; }
.settings-row-title {
  font-family: 'Rajdhani', sans-serif;
  background: transparent;
}
.settings-switch:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

@media (max-width: 520px) {
  .settings-page { padding-left: 4px; padding-right: 4px; }
}

/* ── Десктопная версия страницы «Настройки» ──
   Карточки-группы (стекло, скругления, разбивка на секции) теперь общие
   для мобильной и десктопной версий (см. .settings-row/.settings-group-label
   выше) — здесь только увеличиваются размеры контейнера/заголовка/отступов
   под больший экран, ничего не переопределяя по сути оформления. */
@media (min-width: 861px) {
  .settings-page {
    max-width: 820px;
    padding: 8px 0 48px;
  }

  .settings-topbar {
    padding: 4px 2px 28px;
  }
  .settings-topbar h1 {
    font-size: 26px;
  }
  .settings-back {
    width: auto; height: auto;
  }

  .settings-group-label {
    padding: 0 4px 10px;
    margin-top: 28px;
    font-size: 12px;
    letter-spacing: 1.8px;
  }
  .settings-group-label:first-child { margin-top: 0; }

  .settings-row {
    padding: 15px 18px;
  }

  .settings-row-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
  }
  .settings-row-icon svg { width: 17px; height: 17px; }
  .settings-row-title { font-size: 15px; }
  .settings-row-desc { font-size: 12.5px; }
}

/* =====================================================
   ПРЕДПОЧТЕНИЯ СО СТРАНИЦЫ «НАСТРОЙКИ» (js/settings-page.js)
   =====================================================
   Два переключателя ("Анимации", "Компактный режим") применяются
   глобально через класс на <html>, проставляемый/снимаемый из
   _applySettingsPrefs() — тот же принцип, что системный
   prefers-reduced-motion чуть выше по файлу, только под ручным
   управлением пользователя, а не настройками ОС. Это позволяет любому
   месту сайта, использующему .page-section-enter/карточные отступы,
   учитывать настройку "бесплатно", без точечных правок в каждом файле. */

/* «Анимации» выключены — то же самое, что делает системный
   prefers-reduced-motion для .page-section-enter (см. правило выше),
   плюс отключаем ключевые hover/переходные transition по сайту,
   которые могли бы ощущаться как «анимация», а не просто моментальная
   реакция на клик.

   ВАЖНО: раньше здесь стояло transition-duration/animation-duration:
   0.001ms !important — это НЕ отключает анимацию, а только сжимает её
   длительность почти до нуля. Анимация физически продолжает
   проигрываться (со всеми промежуточными кадрами transform/opacity),
   просто очень быстро — на мобильных, где кадр рендерится медленнее,
   чем 0.001ms, браузер физически не успевает отрисовать все кадры
   к сроку и на глаз это выглядит как "всё резко дёргается/ускоряется",
   а не как отсутствие анимации. Плюс transition-duration/
   animation-duration не действуют на CSS scroll-driven анимации и на
   некоторые JS-анимации, управляемые напрямую через requestAnimationFrame
   (тем не менее используем ту же стратегию, что и системный
   prefers-reduced-motion выше по файлу — animation: none / transition:
   none — это реально убирает анимацию, а не проигрывает её без остатка
   времени). */
html.settings-no-animations .page-section-enter { animation: none !important; }
html.settings-no-animations,
html.settings-no-animations * {
  transition: none !important;
  animation: none !important;
  scroll-behavior: auto !important;
}
/* Побочный эффект (ожидаемый, не баг): кольцо-таймер обратного отсчёта
   у баннера "Далее — серия" (.tor-ring-fg, см. index.html) визуально
   стягивается через inline transition на stroke-dashoffset — при
   включённой настройке "Без анимаций" transition: none !important выше
   переопределяет и этот inline-transition тоже, поэтому кольцо перестаёт
   двигаться (сразу показывает пустое состояние вместо плавного
   заполнения). Секундный счётчик рядом (· 5с) продолжает тикать как
   обычно — он на setInterval, а не на CSS-анимации — и автопереход на
   следующую серию срабатывает по расписанию как всегда. Это тот же
   компромисс, что и у спиннеров загрузки (.cat-scan-spinner/.cmts-spinner)
   чуть выше по файлу: сама функция не ломается, просто теряется
   визуальное движение — что и является целью этой настройки. */

/* «Компактный режим» — сжимает вертикальные/горизонтальные отступы по
   ВСЕМУ сайту (не только каталогу/настройкам, как было раньше — прежняя
   версия трогала всего 5 узких селекторов, из-за чего режим ощущался
   как "работает не везде": карточки на большинстве экранов, шапка,
   секции контента, детальная страница, списки, модалки и т.д. оставались
   с обычными отступами). Не трогает размер постеров (за это отвечает
   отдельная настройка «Размер постов») и не трогает шрифты — только
   «воздух»: gap, padding, margin. Правила ниже не заменяют базовые
   значения (в т.ч. мобильные @media (max-width:768px) чуть выше по
   файлу) целиком, а уменьшают их — специфичность класса на <html>
   (0-2-0 у всех правил ниже) выше, чем у голых селекторов внутри
   @media (0-1-0), поэтому это работает и поверх мобильной раскладки. */

/* ── Сетки карточек — везде, где на сайте есть anime-grid/featured-grid/
   seasons-grid (главная, каталог, поиск, список, сезоны на детальной
   странице), а не только на двух местах, как было раньше. */
html.settings-compact .anime-grid,
html.settings-compact .featured-grid,
html.settings-compact .seasons-grid {
  gap: 10px;
}

/* ── Карточка аниме — внутренние отступы текста, не сам постер. */
html.settings-compact .card-body {
  padding: 16px 9px 9px;
}
html.settings-compact .card-title {
  margin-bottom: 2px;
}

/* ── Шапка сайта — чуть ниже и без лишнего воздуха вокруг лого/поиска.
   Desktop и mobile — РАЗНЫЕ базовые высоты (84px / 60px, см. .header-inner
   и его мобильный @media(max-width:768px) override выше по файлу),
   поэтому компактные значения тоже заданы раздельно: единое число здесь
   либо не сжало бы десктоп заметно, либо — что хуже — увеличило бы уже
   сжатую мобильную шапку вместо того чтобы уменьшить её ещё. */
html.settings-compact .header-inner {
  height: 64px;
}
html.settings-compact .header-inner--top {
  height: 50px;
}
html.settings-compact .header-inner--bottom {
  height: 38px;
}
/* .site-header теперь position:fixed (см. .site-header выше) — при
   уменьшении её высоты в компактном режиме отступ body тоже нужно
   пересчитать, иначе под шапкой останется пустой зазор высотой в
   разницу (130px обычный - 88px компактный = 42px на десктопе). */
html.settings-compact body {
  padding-top: 88px;
}
@media (max-width: 768px) {
  html.settings-compact .header-inner,
  html.settings-compact .header-inner--top {
    height: 50px;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  html.settings-compact body {
    padding-top: 50px;
  }
}

/* ── Основной контент и секции — заголовки блоков ("Продолжить
   просмотр", "Новинки" и т.п.) ближе к контенту под ними, сами секции
   с меньшим отступом друг от друга. */
html.settings-compact .main-content {
  padding-top: 12px !important;
}
html.settings-compact .featured-header,
html.settings-compact .list-header {
  margin-bottom: 8px;
}
html.settings-compact .featured-block,
html.settings-compact .list-section {
  margin-bottom: 20px;
}

/* ── Детальная страница тайтла — карточка плеера/описания и общая
   раскладка чуть плотнее. */
html.settings-compact .detail-widget-frame {
  padding: 10px;
}
html.settings-compact .detail-layout {
  gap: 14px;
}
html.settings-compact .detail-poster-col {
  gap: 8px 10px;
}

/* ── Списки (Мои списки / попап "Ещё") и настройки — уже было, оставлено
   как есть, просто теперь часть куда более широкого набора правил. */
html.settings-compact .settings-row {
  padding-top: 8px;
  padding-bottom: 8px;
}
html.settings-compact .settings-group-label {
  padding-top: 12px;
  padding-bottom: 5px;
}
html.settings-compact .msp-item {
  padding: 6px 8px;
}

/* ── Расписание — горизонтальные карусели серий по дням. */
html.settings-compact .schedule-days {
  gap: 18px;
}
html.settings-compact .schedule-day-block {
  gap: 8px;
}

/* ── Фильтры каталога/поиска. */
html.settings-compact .filter-panel {
  padding: 10px;
}
html.settings-compact .filter-grid {
  gap: 8px;
}

/* ── Модальные окна (в т.ч. мобильные bottom-sheet) — чуть меньше
   внутренних отступов сверху/снизу, сама модалка не сжимается по
   ширине/контенту, чтобы не терять читаемость. */
html.settings-compact .modal-box,
html.settings-compact .modal-box--wide {
  padding-top: 14px;
  padding-bottom: 18px;
}
html.settings-compact .modal-header {
  margin-bottom: 10px;
}

/* ── Нижняя мобильная навигация — чуть меньше в компактном режиме:
   меньше иконка, меньше внутренние отступы кнопки и капсулы. Высота
   пересчитана по той же формуле, что и обычная (см. комментарий у
   --mobile-nav-height в :root), просто с уменьшенными числами:
   14 (внешний отступ, было 18) + 7+7 (padding-top капсулы+кнопки,
   было 10+10) + 20 (иконка, было 24) + 4 (gap) + 14 (текст, было 16)
   + 7+7 (padding-bottom кнопки+капсулы) ≈ 66 + 14 = 80px. Меняем саму
   CSS-переменную (не только .mobile-bottom-nav) — от неё также
   считают свою позицию попапы "Списки"/"Ещё" и высоту скролл-
   контейнеров (см. использования --mobile-nav-height выше по файлу),
   поэтому они автоматически подстраиваются под уменьшенную панель. */
html.settings-compact {
  --mobile-nav-height: 80px;
}
html.settings-compact .mobile-bottom-nav {
  padding: 6px 12px calc(env(safe-area-inset-bottom, 6px) + 6px);
}
html.settings-compact .mobile-nav-items {
  padding: 7px 6px;
}
html.settings-compact .mobile-nav-btn {
  gap: 3px;
  padding: 7px 8px;
  font-size: 9px;
  min-width: 48px;
}
html.settings-compact .mobile-nav-btn svg {
  width: 20px;
  height: 20px;
}
html.settings-compact .mobile-nav-indicator {
  top: 7px;
  bottom: 7px;
}

/* =====================================================
   ОТДЕЛЬНАЯ СТРАНИЦА «ФОН ПРИЛОЖЕНИЯ» (#bgSection)
   =====================================================
   Внутренняя разметка (.bg-tabs/.v1-dropzone/.v1-presets/.v1-chips/
   .v1-slider-* и .v1-gradient-grid) — теми же классами и вёрсткой, что
   раньше жили в #bgModal .bg-settings-modal. Правила ниже — точная
   копия прежних #bgModal-скоупнутых стилей, просто под #bgSection
   вместо #bgModal (сам мод
   вместо #bgModal (сам модальный оверлей и его футер с "Закрыть"
   больше не нужны — это отдельная вкладка с кнопкой "Назад" наверху,
   как и у #settingsSection). */

/* Стеклянная «пилюля»-карточка вокруг всех настроек фона — тот же вид,
   что у .settings-page-section на странице «Размер постов». */
#bgSection .bg-page-body {
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%),
    rgba(14,16,22,0.65);
  backdrop-filter: blur(min(36px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(36px, var(--pf-cap, 999px))) saturate(200%);
  border: 1px solid rgba(255,255,255,0.13);
  border-top: 1px solid rgba(255,255,255,0.26);
  box-shadow: 0 14px 36px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.16);
  padding: 24px 26px;
  margin-bottom: 24px;
}
#bgSection .bg-page-body > .bg-page-reset {
  align-self: center;
  margin: 28px auto 4px;
}
@media (max-width: 520px) {
  #bgSection .bg-page-body { padding: 18px 16px; }
}

#bgSection .bg-tabs {
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  margin-bottom: 20px;
}
/* Вид и анимация вкладок теперь полностью в .pill-toggle/.pill-thumb/
   .pill-btn (см. общий блок PILL TOGGLE выше) — .bg-tab-btn ниже
   только чуть увеличивает тач-зону под мобильный формат страницы. */
#bgSection .bg-tab-btn { min-height: 40px; }

#bgSection .bg-settings-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

#bgSection .bg-color-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
#bgSection #bgColorPicker {
  width: 56px;
  height: 42px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: none;
  flex: 0 0 auto;
}
#bgSection .bg-color-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#bgSection .v1-dropzone {
  border: 2px dashed rgba(255,255,255,0.14);
  border-radius: 16px;
  padding: 26p
  padding: 26px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--t-fast);
  background: rgba(255,255,255,0.015);
  margin-bottom: 22px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}
#bgSection .v1-dropzone:hover,
#bgSection .v1-dropzone.is-dragover {
  border-color: rgba(232,232,232,0.4);
  background-color: rgba(255,255,255,0.03);
}
#bgSection .v1-dropzone svg {
  width: 30px;
  height: 30px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
#bgSection .v1-dropzone .main {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 4px;
}
#bgSection .v1-dropzone .sub {
  font-size: 11.5px;
  color: var(--text-dim);
  letter-spacing: .5px;
}
#bgSection .v1-dropzone .selected-file {
  display: inline-block;
  font-size: 11px;
  color: #fff;
  text-shadow: 0 1px 4px #000;
  padding: 6px 12px;
  background: rgba(0,0,0,.55);
  border-radius: 6px;
  font-weight: 700;
}

#bgSection .section-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

#bgSection .v1-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}
#bgSection .v1-preset-tile {
  position: relative;
  aspect-ratio: 4 / 3;
  min-width: 0;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--t-fast);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
#bgSection .v1-preset-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(232,232,232,0.4);
}
#bgSection .v1-preset-tile.selected {
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green), 0 8px 20px rgba(0,0,0,0.4);
}
#bgSection .v1-preset-tile .tag {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  padding: 16px 8px 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .5px;
  text-align: center;
  color: #fff;
}
#bgSection .v1-preset-tile .check {
  position: absol
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--green);
  color: #0c0c0c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  opacity: 0;
  transform: scale(.6);
  transition: all var(--t-fast);
}
#bgSection .v1-preset-tile.selected .check {
  opacity: 1;
  transform: scale(1);
}

#bgSection .v1-url-row {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}
#bgSection .v1-url-row input {
  flex: 1;
  min-width: 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 13px;
  font-family: 'Rajdhani', sans-serif;
  transition: all var(--t-fast);
}
#bgSection .v1-url-row input:focus {
  outline: none;
  border-color: rgba(232,232,232,0.35);
  background: rgba(255,255,255,0.03);
}
#bgSection .v1-url-row input::placeholder { color: var(--text-dim); }
#bgSection .v1-url-row button {
  background: var(--green);
  border: 1px solid var(--green);
  color: #0c0c0c;
  padding: 0 22px;
  border-radius: 10px;
  font-weight: 800;
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 1px;
  font-size: 12.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--t-fast);
}
#bgSection .v1-url-row button:hover {
  background: #fff;
  border-color: #fff;
}

#bgSection .v1-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
#bgSection .v1-chip-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
#bgSection .v1-chip-row > span {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 70px;
  font-weight: 600;
}
/* Вид и sliding-анимация самих кноп
/* Вид и sliding-анимация самих кнопок (.v1-chips) теперь полностью
   в .pill-toggle/.pill-thumb/.pill-btn (см. общий блок PILL TOGGLE) —
   тот же компонент, что и вкладки Цвет/Картинка/Градиент выше и
   строки приватности списков, чтобы все переключатели на сайте
   выглядели и анимировались одинаково. */
#bgSection .v1-chips.pill-toggle { flex-wrap: nowrap; }

#bgSection .v1-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
#bgSection .v1-slider-row > span:first-child {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 70px;
  font-weight: 600;
}
#bgSection .v1-slider-track {
  flex: 1;
  position: relative;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  min-width: 80px;
}
#bgSection .v1-slider-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: var(--green);
  border-radius: 4px;
  pointer-events: none;
}
#bgSection .v1-slider-track input[type="range"] {
  position: absolute;
  inset: -8px 0;
  width: 100%;
  height: 20px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
#bgSection .v1-slider-thumb {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translate(-50%,-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(232,232,232,0.15);
  pointer-events: none;
  transition: left .08s ease;
}
#bgSection .v1-slider-val {
  font-size: 12px;
  color: var(--text);
  font-weight: 700;
  min-width: 34px;
  text-align: right;
}

#bgSection .v1-gradient-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
#bgSection .v1-gradient-grid > div {
  min-height: 60px;
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--t-fast);
  display: flex;
  align-items: flex-end;
  padding: 6px;
  background-clip: padding-box;
}
#bgSection .v1-gradient-grid > div:hover {
  border-color: var(--green);
  transform: translateY(-2px);
}
#bgSection .v1-gradient-grid > div span {
  font-size: 10px;
  color: #fff;
  text-shadow: 0 1px 3px #000;
  font-weight: 600;
}

/* Кнопка "Сбросить фон" — вместо футера модалки, простая полноширинная
   строка внизу страницы в том же duotone-стиле, что .btn-reset раньше.
   .settings-page-reset — тот же класс без привязки к #bgSection, чтобы
   его могли использовать и остальные отдельные страницы настроек
   (размер постов, темы сайта) — см. .settings-page-reset ниже. */
/* Кнопка "Сбросить фон" — стеклянная пилюля идентично кнопке "Загрузить ещё" в каталоге (.catalog-more-btn) */
#bgSection .bg-page-reset,
.settings-page-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 32px;
  margin: 28px auto 0;
  background: rgba(240, 240, 245, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 30px;
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--t-med);
  width: 100%;
  max-width: 520px;
  backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(200%);
  will-change: backdrop-filter;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform: none !important;
}

#bgSection .bg-page-reset svg,
.settings-page-reset svg {
  width: 16px;
  height: 16px;
  transition: transform var(--t-med), color var(--t-med);
}

#bgSection .bg-page-reset:hover,
.settings-page-reset:hover {
  background: rgba(240, 240, 245, 0.22);
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--green);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transform: none !important;
}

#bgSection .bg-page-reset:hover svg,
.settings-page-reset:hover svg {
  transform: rotate(-180deg);
  color: var(--green);
}

#bgSection .bg-page-reset:active,
.settings-page-reset:active {
  transform: none !important;
  opacity: 0.85;
}

@media (max-width: 520px) {
  #bgSection .v1-presets { grid-template-columns: repeat(2, 1fr); }
  #bgSection .v1-gradient-grid { grid-template-columns: repeat(2, 1fr); }
  #bgSection .v1-chip-row { align-items: flex-start; }
}

/* =====================================================
   ОТДЕЛЬНЫЕ СТРАНИЦЫ: РАЗМЕР ПОСТОВ / ТЕМЫ САЙТА /
   ПРИВАТНОСТЬ / ИМПОРТ-ЭКСПОРТ
   =====================================================
   Те же самые контролы, что раньше жили в соответствующих модалках
   (.import-*, .site-theme-*, .privacy-row-*, слайдер размера постов) —
   разметка и id перенесены без изменений, поэтому вся логика в
   poster-settings.js/site-themes.js/privacy-settings.js/import-export.js
   работает без единой правки. Ниже — только вёрстка "тела страницы"
   вместо тела модалки (без .modal-box/.modal-header/футера). */

.settings-page-section {
  padding: 4px 6px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.settings-page-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  background: rgba(0,255,220,0.04);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green-dim);
  padding: 10px 14px;
  border-radius: 4px;
}
.settings-page-desc.warn {
  background: rgba(255,60,60,0.05);
  border: 1px solid rgba(255,60,60,0.2);
  border-left: 3px solid #ff6b6b;
  color: #ff9999;
}

/* Размер постов — sliding-pill переключатель из трёх кнопок вместо
   прежнего <input type="range"> (см. .pill-toggle/.pill-thumb/.pill-btn
   и #posterSizeToggle в index.html, initPillToggle в js/ui.js).
   Full-width вариант того же .pill-toggle, что и .import-subtabs/
   .modal-tabs, но БЕЗ их margin/border-bottom/фона — тут переключатель
   уже лежит в обычном .settings-page-section с собственными отступами. */
#posterSizeTog
#posterSizeToggle.pill-toggle {
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
  position: relative;
  box-sizing: border-box;
}
#posterSizeToggle.pill-toggle .pill-thumb {
  display: block !important;
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  border-radius: 7px;
  transition: transform 0.32s cubic-bezier(.22, 1, .36, 1), width 0.32s cubic-bezier(.22, 1, .36, 1);
  z-index: 0;
  pointer-events: none;
}
#posterSizeToggle.pill-toggle .pill-btn {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 8px;
  text-align: center;
  white-space: nowrap;
  position: relative;
  z-index: 1;
  border-radius: 7px;
  background: none !important;
  transition: color var(--t-fast), transform 0.12s ease;
}
#posterSizeToggle.pill-toggle .pill-btn:active {
  transform: scale(0.97);
}
@media (max-width: 480px) {
  #posterSizeToggle.pill-toggle .pill-btn {
    padding: 8px 4px;
    font-size: 12px;
  }
}
.poster-size-row { display: flex; flex-direction: column; gap: 10px; }
.poster-size-row-top {
  display: flex; justify-content: space-between; align-items: baseline;
}
.poster-size-row-top span:first-child {
  font-size: 12px; color: var(--text-muted); letter-spacing: 0.5px;
}
#posterSizeLabel {
  font-size: 14px; color: var(--green); font-weight: 700;
  font-family: 'Rajdhani', sans-serif;
}
.poster-size-row-bottom {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-muted);
}
.poster-size-row-bottom span:last-child { text-align: right; }

/* Импорт/экспорт-страница переиспользует .modal-tabs/.modal-panel и
   т.д. из старой модалки — им не нужен .modal-box вокруг, чтобы
   работать, эти классы уже не зависят от родителя-оверлея. */
#importExportSection .modal-tabs { margin-bottom: 4px; }
#importExportSection .modal-panel { padding: 0; }
#importExportSection .modal-body { padding: 0; }

/* ====================================================
   NekoNest — СИСТЕМА УРОВНЕЙ, XP И РЕЙТИНГА (LEADERBOARD)
   Apple iOS Glassmorphism · Монохром (Белый, Чёрный, Серый)
   ==================================================== */

/* ── 1. Виджет уровня и опыта в Профиле ── */
.profile-xp-card {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(190%);
  -webkit-backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 20px 24px;
  margin: 18px 0 24px 0;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  position: relative;
  overflow: hidden;
}

.profile-xp-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  pointer-events: none;
}

.profile-xp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.profile-xp-badges {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pxp-lvl-tag {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1.2px;
  padding: 5px 14px;
  border-radius: 12px;
  text-transform: uppercase;
  backdrop-filter: blur(min(10px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(10px, var(--pf-cap, 999px)));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.pxp-rank-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  backdrop-filter: blur(min(10px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(10px, var(--pf-cap, 999px)));
}

.pxp-rank-tag:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.profile-xp-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pxp-total-xp {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}

.pxp-total-xp b {
  color: #ffffff;
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 700;
}

.pxp-hist-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(min(12px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(12px, var(--pf-cap, 999px)));
}

.pxp-hist-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.profile-xp-bar-wrap {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
}

.profile-xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffffff 0%, rgba(255, 255, 255, 0.65) 100%);
  border-radius: 10px;
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.35);
}

.profile-xp-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 9px;
}

/* ── 2. Секция Рейтинга (Leaderboard) ── */
#leaderboardSection {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

.leaderboard-header {
  margin-bottom: 24px;
}

.leaderboard-title-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.leaderboard-badge-icon {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(min(20px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(20px, var(--pf-cap, 999px)));
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.leaderboard-title {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 4px 0;
  letter-spacing: -0.4px;
}

.leaderboard-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
}

/* Карточка текущего пользователя в топе */
.my-lb-card {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(190%);
  -webkit-backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 20px;
  padding: 16px 20px;
  margin-bottom: 28px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.my-lb-card-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.my-lb-rank-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  backdrop-filter: blur(min(10px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(10px, var(--pf-cap, 999px)));
}

.my-lb-rank-num {
  font-family: 'Rajdhani', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
}

.my-lb-rank-lbl {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  margin-top: 2px;
  letter-spacing: 0.5px;
}

.my-lb-avatar-wrap {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
}

.my-lb-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.my-lb-avatar-letter {
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
}

.my-lb-info {
  flex: 1;
  min-width: 220px;
}

.my-lb-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.my-lb-nick {
  font-weight: 700;
  font-size: 15px;
  color: #ffffff;
}

.my-lb-lvl-badge {
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 2px 8px;
  border-radius: 8px;
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 0.5px;
}

.my-lb-bar-wrap {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 4px;
}

.my-lb-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffffff, rgba(255, 255, 255, 0.6));
  border-radius: 6px;
  transition: width 0.5s ease;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.my-lb-bar-legend {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}

.my-lb-total-xp {
  color: #ffffff;
  font-weight: 600;
}

.my-lb-actions {
  margin-left: auto;
}

.my-lb-history-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.9);
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  backdrop-filter: blur(min(12px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(12px, var(--pf-cap, 999px)));
}

.my-lb-history-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

.my-lb-card-guest {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px;
}

.my-lb-guest-icon {
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.my-lb-guest-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.my-lb-guest-text strong {
  color: #ffffff;
  f
  font-size: 14px;
}

.my-lb-guest-text span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
}

.my-lb-login-btn {
  background: #ffffff;
  color: #0d1424;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 18px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
  box-shadow: none;
}

.my-lb-login-btn:hover {
  background: #e8ecf2;
  transform: none;
  box-shadow: none;
}

/* ── 3. Подиум Топ-3 (Стеклянный монохром iOS) ── */
.lb-podium-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  margin: 28px 0 36px 0;
  padding: 0 8px;
}

.podium-col {
  flex: 1;
  max-width: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.podium-col:hover {
  transform: translateY(-5px);
}

.podium-badge {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 3px 10px;
  border-radius: 8px;
  margin-bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-transform: uppercase;
}

.podium-badge--1 {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.25);
}

.podium-badge--2 {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.85);
}

.podium-badge--3 {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.65);
}

.podium-avatar-wrap {
  position: relative;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.podium-rank-1 .podium-avatar-wrap {
  width: 80px;
  height: 80px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.podium-rank-2 .podium-avatar-wrap {
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
}

.podium-rank-3 .podium-avatar-wrap {
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.podium-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.podium-avatar-txt {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 22px;
}

.podium-place-circle {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 800;
  font-size: 12px;
  background: rgba(20, 20, 25, 0.9);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.podium-rank-1 .podium-place-circle {
  background: #ffffff;
  color: #0d1424;
  border-color: #ffffff;
}

.podium-nick {
  font-weight: 700;
  font-size: 14px;
  color: #ffffff;
  text-align: center;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 2px;
}

.podium-lvl {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 2px;
}

.podium-xp {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 10px;
}

.podium-pedestal {
  width: 100%;
  border-radius: 16px 16px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(min(24px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(24px, var(--pf-cap, 999px)));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.podium-rank-1 .podium-pedestal {
  height: 115px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom: none;
}

.podium-rank-2 .podium-pedestal {
  height: 85px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom: none;
}

.podium-rank-3 .podium-pedestal {
  height: 65px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.005) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: none;
}

.podium-pedestal-num {
  font-family: 'Rajdhani', sans-serif;
  font-size: 34px;
  font-weight: 900;
  opacity: 0.18;
  color: #ffffff;
}

/* ── 4. Список Топ-100 (Таблица iOS Glass) ── */
.lb-list-wrap {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(190%);
  -webkit-backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.lb-list-header {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.45);
}

.lb-col-rank { width: 55px; text-align: center; }
.lb-col-user { flex: 1; min-width: 140px; }
.lb-col-lvl  { width: 100px; text-align: center; }
.lb-col-xp   { width: 130px; text-align: right; }

.lb-row {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s ease, transform 0.15s ease;
  cursor: pointer;
}

.lb-row:last-child {
  border-bottom: none;
}

.lb-row:hover {
  background: rgba(255, 255, 255, 0.07);
}

.lb-row-me {
  background: rgba(255, 255, 255, 0.07);
  border-left: 3px solid #ffffff;
}

.lb-rank-badge {
  display: inline-block;
  min-width: 24px;
  padding: 2px 6px;
  border-radius: 8px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.05);
}

.lb-rank-first {
  background: linear-gradient(135deg, #ffd700, #ffb300);
  color: #3a2800;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.55);
  border: 1px solid rgba(255, 215, 0, 0.6);
}

.lb-rank-second {
  background: linear-gradient(135deg, #e8e8e8, #b0b0b0);
  color: #1a1a1a;
  box-shadow: 0 0 8px rgba(192, 192, 192, 0.4);
  border: 1px solid rgba(192, 192, 192, 0.5);
}

.lb-rank-third {
  background: rgba(205, 130, 60, 0.22);
  color: #e8a96a;
  border: 1px solid rgba(205, 130, 60, 0.4);
}

/* ── Строки топ-3: особая рамка слева и фон ── */
.lb-row-top1 {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.08) 0%, transparent 60%);
  border-left: 3px solid #ffd700 !important;
}

.lb-row-top2 {
  background: linear-gradient(90deg, rgba(192, 192, 192, 0.07) 0%, transparent 60%);
  border-left: 3px solid #c0c0c0 !important;
}

.lb-row-top3 {
  background: linear-gradient(90deg, rgba(205, 130, 60, 0.07) 0%, transparent 60%);
  border-left: 3px solid #cd823c !important;
}

.lb-row-top1:hover {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.14) 0%, rgba(255, 255, 255, 0.04) 60%);
}

.lb-row-top2:hover {
  background: linear-gradient(90deg, rgba(192, 192, 192, 0.13) 0%, rgba(255, 255, 255, 0.04) 60%);
}

.lb-row-top3:hover {
  background: linear-gradient(90deg, rgba(205, 130, 60, 0.13) 0%, rgba(255, 255, 255, 0.04) 60%);
}

/* ── Аватары топ-3: цветная кольцевая рамка ── */
.lb-av-top1 {
  border: 2px solid #ffd700 !important;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.45), 0 0 20px rgba(255, 215, 0, 0.15);
}

.lb-av-top2 {
  border: 2px solid #c0c0c0 !important;
  box-shadow: 0 0 8px rgba(192, 192, 192, 0.35), 0 0 16px rgba(192, 192, 192, 0.12);
}

.lb-av-top3 {
  border: 2px solid #cd823c !important;
  box-shadow: 0 0 8px rgba(205, 130, 60, 0.35), 0 0 16px rgba(205, 130, 60, 0.12);
}

/* ── Корона для 1-го места ── */
.lb-crown {
  font-size: 13px;
  margin-right: 4px;
  vertical-align: middle;
  filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.7));
  display: inline-block;
}

.lb-col-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lb-row-av-wrap {
  width: 36px;
  height: 36px;
  border-r
... [truncated for diff preview]
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
}

.lb-row-av-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lb-row-av-txt {
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.lb-row-nick-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.lb-row-nick {
  font-weight: 600;
  font-size: 14px;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-row-you-tag {
  font-size: 10px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 1px 7px;
  border-radius: 6px;
}

.lb-lvl-tag {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 2px 9px;
  border-radius: 8px;
}

.lb-xp-num {
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.lb-xp-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
  margin-left: 2px;
}

.lb-empty-state {
  text-align: center;
  padding: 48px 20px;
  color: rgba(255, 255, 255, 0.45);
}

.lb-empty-icon {
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-empty-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.lb-empty-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

/* ── 5. Плавающий тост +XP (iOS Capsule) ── */
.xp-toast-container {
  position: fixed;
  bottom: 84px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
}

.xp-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(20, 20, 24, 0.88);
  backdrop-filter: blur(min(25px, var(--pf-cap, 999px))) saturate(180%);
  -webkit-backdrop-filter: blur(min(25px, var(--pf-cap, 999px))) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 9px 16px;
  color: #ffffff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  opacity: 0;
  transform: translateY(12px) scale(0.95);
  transition: all 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.xp-toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.xp-toast.hide {
  opacity: 0;
  transform: translateY(-8px) scale(0.95);
}

.xp-toast-icon {
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.xp-toast-body {
  display: flex;
  flex-direction: column;
}

.xp-toast-amount {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 800;
  font-size: 14px;
  color: #ffffff;
}

.xp-toast-src {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
}

/* ── 6. Модалка истории XP (iOS Glass Sheet) ── */
.xp-modal {
  max-width: 520px;
  width: 95%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: rgba(20, 20, 25, 0.88);
  backdrop-filter: blur(min(35px, var(--pf-cap, 999px))) saturate(190%);
  -webkit-backdrop-filter: blur(min(35px, var(--pf-cap, 999px))) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.xp-hist-body {
  overflow-y: auto;
  padding: 16px 20px;
  max-height: 60vh;
}

.xp-hist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 8px;
}

.xp-hist-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.xp-hist-source {
  font-weight: 700;
  font-size: 13px;
  color: #ffffff;
}

.xp-hist-detail {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

.xp-hist-date {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
}

.xp-hist-amount {
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
}

.xp-hist-empty {
  text-align: center;
  padding: 40px 20px;
  color: rgba(255, 255, 255, 0.45);
}

.xp-hist-empty-icon {
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── 7. Поздравление Level Up (Apple Glass Pop) ── */
.level-up-overlay {
  z-index: 10000;
  background: rgba(10, 10, 14, 0.75);
  backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(180%);
  -webkit-backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(180%);
}

.level-up-card {
  position: relative;
  background: rgba(25, 25, 30, 0.85);
  backdrop-filter: blur(min(40px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(40px, var(--pf-cap, 999px))) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 26px;
  padding: 36px 30px 28px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  overflow: hidden;
}

.level-up-anim .level-up-card {
  animation: levelUpPop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.2) forwards;
}

@keyframes levelUpPop {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.level-up-icon-wrap {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.level-up-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffffff;
  margin: 0 0 14px 0;
}

.level-up-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: #ffffff;
  margin: 0 auto 16px;
  border: 4px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.35);
}

.level-up-badge-lbl {
  font-size: 9px;
  font-weight: 900;
  color: #0d1424;
  letter-spacing: 1px;
}

.level-up-badge-num {
  font-family: 'Rajdhani', sans-serif;
  font-size: 36px;
  font-weight: 900;
  color: #0d1424;
  line-height: 1;
}

.level-up-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
  margin: 0 0 22px 0;
}

.level-up-btn {
  background: #ffffff;
  color: #0d1424;
  font-weight: 800;
  font-size: 14px;
  padding: 11px 32px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(255, 255, 255, 0.25);
  transition: transform 0.2s, box-shadow 0.2s;
}

.level-up-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(255, 255, 255, 0.4);
}

/* ── 8. Мобильная адаптивность рейтинга ── */
@media (max-width: 600px) {
  #leaderboardSection {
    padding: 16px 12px 90px;
  }
  .leaderboard-title {
    font-size: 20px;
  }
  .lb-podium-wrap {
    gap: 8px;
    margin: 18px 0 28px;
  }
  .podium-avatar-wrap {
    width: 52px;
    height: 52px;
  }
  .podium-rank-1 .podium-badge {
    margin-bottom: 32px !important;
  }
  .podium-rank-1 .podium-avatar-wrap {
    width: 64px;
    height: 64px;
    margin-bottom: 22px !important;
  }
  .podium-nick {
    font-size: 12px;
    max-width: 85px;
  }
  .podium-rank-1 .podium-pedestal { height: 80px; }
  .podium-rank-2 .podium-pedestal { height: 60px; }
  .podium-rank-3 .podium-pedestal { height: 46px; }
  .lb-col-lvl { display: none; }
  .lb-col-rank { width: 40px; }
  .lb-list-header, .lb-row { padding: 10px 12px; }
  .my-lb-card { padding: 14px 14px; }
  .my-lb-actions { width: 100%; margin-top: 8px; }
  .my-lb-history-btn { width: 100%; justify-content: center; }
  .xp-toast-container { bottom: 74px; right: 14px; }
}

/* =========================================================
   LEADERBOARD — Apple iOS 17 / Liquid Glass Redesign
   ========================================================= */

/* ── Секция-контейнер ── */
#leaderboardSection {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px 90px;
}

/* ── Заголовок: iOS Large Title ── */
.leaderboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.leaderboard-title-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.leaderboard-badge-icon {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0.04) 100%),
    rgba(18,20,28,0.7);
  border: 1px solid rgba(255,255,255,0.18);
  border-top: 1px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
}

.leaderboard-title {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Rajdhani', sans-serif;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0 0 4px 0;
  background: linear-gradient(180deg, #ffffff 0%, rgba(255,255,255,0.72) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.leaderboard-subtitle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-top: 1px solid rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.7);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  box-shadow: 0 4px 12px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.12);
  margin: 0;
}

/* ── Сезонный блок Leaderboard (цикл 14 дней) ── */
.lb-season-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%),
    rgba(18,20,28,0.7);
  border: 1px solid rgba(255,255,255,0.16);
  border-top: 1px solid rgba(255,255,255,0.28);
  border-radius: 18px;
  backdrop-filter: blur(min(24px, var(--pf-cap, 999px))) saturate(180%);
  -webkit-backdrop-filter: blur(min(24px, var(--pf-cap, 999px))) saturate(180%);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.18);
  min-width: 250px;
}

.lb-season-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lb-season-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.95);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  backdrop-filter: blur(min(10px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(10px, var(--pf-cap, 999px)));
}

.lb-season-pill svg {
  width: 12px;
  height: 12px;
  color: #ff9800;
  flex-shrink: 0;
}

.lb-season-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
}

.lb-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00e676;
  box-shadow: 0 0 8px rgba(0,230,118,0.8);
  display: inline-block;
  animation: lbPulseGreen 2s infinite ease-in-out;
}

@keyframes lbPulseGreen {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.lb-season-dates {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
}

.lb-season-dates svg {
  color: #ffb347;
  flex-shrink: 0;
}

.lb-season-timer {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: rgba(255,255,255,0.65);
}

.lb-season-timer strong {
  color: #ffffff;
  font-weight: 700;
}

.lb-season-timer svg {
  color: rgba(255,255,255,0.5);
  flex-shrink: 0;
}

/* Информационная плашка с правилами сезона */
.lb-season-info-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  margin-bottom: 24px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%),
    rgba(14,16,22,0.5);
  border: 1px solid rgba(255,255,255,0.12);
  border-top: 1px solid rgba(255,255,255,0.22);
  backdrop-filter: blur(min(20px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(20px, var(--pf-cap, 999px)));
  box-shadow: 0 4px 16px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.14);
}

.lb-season-info-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  border-top: 1px solid rgba(255,255,255,0.26);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffd700;
  flex-shrink: 0;
}

.lb-season-info-text {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255,255,255,0.78);
}

.lb-season-info-text strong {
  color: #ffffff;
  font-weight: 600;
}

.lb-season-info-text em {
  font-style: normal;
  color: #ffffff;
  font-weight: 600;
}

/* Сезонный бейдж очков на карточке пользователя — формат в точности как .my-lb-lvl-badge */
.my-lb-season-pts-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.9);
  padding: 2px 9px;
  border-radius: 999px;
  letter-spacing: 0.3px;
  backdrop-filter: blur(min(10px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(10px, var(--pf-cap, 999px)));
}

.my-lb-season-pts-badge svg {
  width: 11px;
  height: 11px;
  color: #ffd700;
  flex-shrink: 0;
}

.lb-crown {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffd700;
  margin-right: 5px;
  vertical-align: middle;
}
.lb-crown svg {
  width: 13px;
  height: 13px;
  display: block;
}

.podium-season-tag {
  font-size: 11px;
  opacity: 0.65;
  font-weight: 500;
  margin-left: 2px;
}

/* ── Карточка текущего пользователя ── */
.my-lb-card {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%),
    rgba(14,16,22,0.6);
  backdrop-filter: blur(min(40px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(40px, var(--pf-cap, 999px))) saturate(200%);
  border: 1px solid rgba(255,255,255,0.14);
  border-top: 1px solid rgba(255,255,255,0.26);
  border-radius: 22px;
  padding: 18px 22px;
  margin-bottom: 32px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.18);
  position: relative;
  overflow: hidden;
}
.my-lb-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  pointer-events: none;
}

.my-lb-rank-badge {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.04) 100%);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 14px;
  backdrop-filter: blur(min(12px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(12px, var(--pf-cap, 999px)));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
  padding: 8px 12px;
}

.my-lb-rank-num {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-size: 22px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
}

.my-lb-rank-lbl {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 9px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 3px;
}

.my-lb-nick {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: #ffffff;
}

.my-lb-lvl-badge {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  border-top: 1px solid rgba(255,255,255,0.28);
  color: rgba(255,255,255,0.9);
  padding: 2px 9px;
  border-radius: 999px;
  letter-spacing: 0.3px;
  backdrop-filter: blur(min(10px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(10px, var(--pf-cap, 999px)));
}

.my-lb-bar-wrap {
  height: 5px;
  background: rgba(255,255,255,0.07);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 5px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
}

.my-lb-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffffff 0%, rgba(255,255,255,0.55) 100%);
  border-radius: 6px;
  transition: width 0.7s cubic-bezier(0.2,0.8,0.2,1);
  box-shadow: 0 0 10px rgba(255,255,255,0.35);
}

.my-lb-history-btn {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.03) 100%);
  border: 1px solid rgba(255,255,255,0.18);
  border-top: 1px solid rgba(255,255,255,0.28);
  color: rgba(255,255,255,0.9);
  padding: 8px 16px;
  border-radius: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  backdrop-filter: blur(min(14px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(14px, var(--pf-cap, 999px)));
  box-shadow: 0 4px 14px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.18);
}

.my-lb-history-btn:hover {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.32);
  color: #ffffff;
}

/* ── Подиум Топ-3 ── */
.lb-podium-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  margin: 32px 0 40px;
  padding: 0 4px;
}

.podium-col {
  flex: 1;
  max-width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.2,0.8,0.2,1);
}

.podium-col:hover {
  transform: translateY(-6px);
}

/* Бейдж места над аватаром */
.podium-badge {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 22px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 10;
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
}

.podium-rank-1 .podium-badge {
  margin-bottom: 42px !important;
  font-size: 11.5px;
  padding: 5px 15px;
  letter-spacing: 0.8px;
}

.podium-rank-2 .podium-badge,
.podium-rank-3 .podium-badge {
  margin-bottom: 34px !important;
  font-size: 11px;
  padding: 4px 13px;
  letter-spacing: 0.7px;
  position: relative;
  z-index: 10;
}

.podium-badge--1 {
  background:
    linear-gradient(135deg, rgba(255,215,0,0.32) 0%, rgba(255,180,0,0.18) 100%),
    rgba(20,16,2,0.85);
  border: 1.5px solid rgba(255,215,0,0.85);
  border-top: 1.5px solid rgba(255,245,150,1);
  color: #fff275;
  box-shadow: 0 4px 18px rgba(255,215,0,0.35), 0 0 14px rgba(255,215,0,0.25), inset 0 1px 0 rgba(255,255,255,0.35);
}

.podium-badge--2 {
  background:
    linear-gradient(135deg, rgba(200,200,210,0.18) 0%, rgba(160,160,175,0.08) 100%),
    rgba(14,14,20,0.8);
  border: 1px solid rgba(200,200,210,0.5);
  border-top: 1px solid rgba(220,220,230,0.7);
  color: #e2e2ec;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
}

.podium-badge--3 {
  background:
    linear-gradient(135deg, rgba(205,130,60,0.18) 0%, rgba(180,100,40,0.08) 100%),
    rgba(14,10,6,0.8);
  border: 1px solid rgba(205,130,60,0.45);
  border-top: 1px solid rgba(230,160,80,0.65);
  color: #e5a478;
  box-shadow: inset 0 1px 0 rgba(255,200,120,0.25);
}

/* Аватары */
.podium-avatar-wrap {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  margin-bottom: 18px;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.2);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.podium-rank-1 .podium-avatar-wrap {
  width: 84px;
  height: 84px;
  margin-bottom: 28px !important;
  border: 2px solid rgba(255,215,0,0.8);
  box-shadow: 0 0 24px rgba(255,215,0,0.25), 0 10px 30px rgba(0,0,0,0.5);
}

.podium-rank-2 .podium-avatar-wrap {
  border: 2px solid rgba(200,200,215,0.55);
  box-shadow: 0 0 14px rgba(200,200,215,0.15), 0 8px 20px rgba(0,0,0,0.4);
  margin-bottom: 24px !important;
}

.podium-rank-3 .podium-avatar-wrap {
  border: 2px solid rgba(205,130,60,0.45);
  box-shadow: 0 0 12px rgba(205,130,60,0.12), 0 8px 20px rgba(0,0,0,0.4);
  margin-bottom: 24px !important;
}

.podium-place-circle {
  position: absolute;
  bottom: -5px;
  right: -5px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-weight: 900;
  font-size: 12px;
  background: rgba(18,20,28,0.92);
  color: rgba(255,255,255,0.85);
  border: 1.5px solid rgba(255,255,255,0.22);
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.podium-rank-1 .podium-place-circle {
  background: #ffd700;
  color: #3a2800;
  border: none;
  box-shadow: 0 0 10px rgba(255,215,0,0.5);
}

.podium-nick {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-weight: 700;
  font-size: 13.5px;
  color: #ffffff;
  text-align: center;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 3px;
}

.podium-lvl {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  margin-bottom: 2px;
}

.podium-xp {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  margin-bottom: 12px;
}

/* Постаменты */
.podium-pedestal {
  width: 100%;
  border-radius: 18px 18px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(min(28px, var(--pf-cap, 999px))) saturate(180%);
  -webkit-backdrop-filter: blur(min(28px, var(--pf-cap, 999px))) saturate(180%);
  border: 1px solid rgba(255,255,255,0.1);
  border-bottom: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14);
  position: relative;
  overflow: hidden;
}

.podium-pedestal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  pointer-events: none;
}

.podium-rank-1 .podium-pedestal {
  height: 120px;
  background: linear-gradient(180deg, rgba(255,215,0,0.1) 0%, rgba(255,215,0,0.02) 100%);
  border-color: rgba(255,215,0,0.22);
}

.podium-rank-2 .podium-pedestal {
  height: 88px;
  background: linear-gradient(180deg, rgba(200,200,215,0.08) 0%, rgba(200,200,215,0.01) 100%);
  border-color: rgba(200,200,215,0.15);
}

.podium-rank-3 .podium-pedestal {
  height: 66px;
  background: linear-gradient(180deg, rgba(205,130,60,0.07) 0%, rgba(205,130,60,0.01) 100%);
  border-color: rgba(205,130,60,0.12);
}

.podium-pedestal-num {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-size: 38px;
  font-weight: 900;
  opacity: 0.14;
  color: #ffffff;
  letter-spacing: -1px;
}

/* ── Список Топ-100 ── */
.lb-list-wrap {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%),
    rgba(12,14,20,0.6);
  backdrop-filter: blur(min(36px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(36px, var(--pf-cap, 999px))) saturate(200%);
  border: 1px solid rgba(255,255,255,0.11);
  border-top: 1px solid rgba(255,255,255,0.2);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.16);
  position: relative;
}

.lb-list-wrap::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  pointer-events: none;
}

.lb-list-header {
  display: flex;
  align-items: center;
  padding: 14px 22px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.38);
}

.lb-row {
  display: flex;
  align-items: center;
  padding: 13px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.18s ease;
  cursor: pointer;
}

.lb-row:last-child {
  border-bottom: none;
}

.lb-row:hover {
  background: rgba(255,255,255,0.06);
}

.lb-row-me {
  background:
    linear-gradient(90deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 60%) !important;
  border-left: 2.5px solid rgba(255,255,255,0.7) !important;
}

/* Ранговые бейджи */
.lb-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  padding: 3px 7px;
  border-radius: 999px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 12px;
  font-weight: 800;
  color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}

.lb-rank-first {
  background: linear-gradient(135deg, rgba(255,215,0,0.25), rgba(200,160,0,0.15));
  border: 1px solid rgba(255,215,0,0.5);
  color: #ffd700;
  box-shadow: 0 0 12px rgba(255,215,0,0.2);
}

.lb-rank-second {
  background: linear-gradient(135deg, rgba(220,220,230,0.18), rgba(160,160,175,0.1));
  border: 1px solid rgba(200,200,215,0.4);
  color: #d4d4e0;
  box-shadow: 0 0 8px rgba(200,200,215,0.12);
}

.lb-rank-third {
  background: linear-gradient(135deg, rgba(205,130,60,0.2), rgba(160,100,40,0.1));
  border: 1px solid rgba(205,130,60,0.38);
  color: #d4956a;
}

/* Строки топ-3 */
.lb-row-top1 {
  background: linear-gradient(90deg, rgba(255,215,0,0.07) 0%, transparent 55%);
  border-left: 2.5px solid rgba(255,215,0,0.6) !important;
}

.lb-row-top2 {
  background: linear-gradient(90deg, rgba(200,200,215,0.06) 0%, transparent 55%);
  border-left: 2.5px solid rgba(200,200,215,0.45) !important;
}

.lb-row-top3 {
  background: linear-gradient(90deg, rgba(205,130,60,0.06) 0%, transparent 55%);
  border-left: 2.5px solid rgba(205,130,60,0.4) !important;
}

.lb-row-top1:hover { background: linear-gradient(90deg, rgba(255,215,0,0.12) 0%, rgba(255,255,255,0.03) 55%); }
.lb-row-top2:hover { background: linear-gradient(90deg, rgba(200,200,215,0.1) 0%, rgba(255,255,255,0.03) 55%); }
.lb-row-top3:hover { background: linear-gradient(90deg, rgba(205,130,60,0.1) 0%, rgba(255,255,255,0.03) 55%); }

/* Аватары в строках */
.lb-row-av-wrap {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.14);
  flex-shrink: 0;
  background: rgba(255,255,255,0.05);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.my-lb-avatar-wrap:has(.nf-av),
.lb-row-av-wrap:has(.nf-av) {
  overflow: visible;
  background: none;
  border: none;
  box-shadow: none;
}
.podium-avatar-wrap:has(.nf-av) {
  border: none !important;
  box-shadow: none !important;
  overflow: visible;
  background: none;
}
.podium-avatar-wrap:has(.nf-av) .podium-place-circle {
  display: none !important;
}


.lb-av-top1 {
  border: 1.5px solid rgba(255,215,0,0.7) !important;
  box-shadow: 0 0 10px rgba(255,215,0,0.3) !important;
}

.lb-av-top2 {
  border: 1.5px solid rgba(200,200,215,0.6) !important;
  box-shadow: 0 0 8px rgba(200,200,215,0.2) !important;
}

.lb-av-top3 {
  border: 1.5px solid rgba(205,130,60,0.55) !important;
  box-shadow: 0 0 8px rgba(205,130,60,0.18) !important;
}

.lb-row-nick {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: #ffffff;
}

.lb-row-you-tag {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.4px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.85);
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lb-lvl-tag {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 3px 10px;
  border-radius: 999px;
  backdrop-filter: blur(min(10px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(10px, var(--pf-cap, 999px)));
}

.lb-xp-num {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.lb-xp-label {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  margin-left: 2px;
}

/* ── Мобильная адаптация ── */
@media (max-width: 600px) {
  #leaderboardSection {
    padding: 20px 14px 90px;
  }
  .leaderboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
  }
  .lb-season-card {
    width: 100%;
    min-width: 0;
  }
  .lb-season-info-bar {
    padding: 10px 14px;
    gap: 10px;
  }
  .leaderboard-title {
    font-size: 24px;
  }
  .lb-podium-wrap {
    gap: 8px;
    margin: 20px 0 30px;
  }
  .podium-avatar-wrap {
    width: 54px;
    height: 54px;
  }
  .podium-rank-1 .podium-badge {
    margin-bottom: 32px !important;
  }
  .podium-rank-2 .podium-badge,
  .podium-rank-3 .podium-badge {
    margin-bottom: 26px !important;
  }
  .podium-rank-1 .podium-avatar-wrap {
    width: 68px;
    height: 68px;
    margin-bottom: 22px !important;
  }
  .podium-rank-2 .podium-avatar-wrap,
  .podium-rank-3 .podium-avatar-wrap {
    margin-bottom: 18px !important;
  }
  .podium-nick {
    font-size: 11.5px;
    max-width: 88px;
  }
  .podium-rank-1 .podium-pedestal { height: 86px; }
  .podium-rank-2 .podium-pedestal { height: 64px; }
  .podium-rank-3 .podium-pedestal { height: 50px; }
  .lb-col-lvl { display: none; }
  .lb-col-rank { width: 42px; }
  .lb-col-xp { width: 90px; }
  .lb-list-header, .lb-row { padding: 11px 14px; }
  .my-lb-card { padding: 16px 16px; }
  .my-lb-actions { width: 100%; margin-top: 10px; }
  .my-lb-history-btn { width: 100%; justify-content: center; }
}



/* =========================================================
   MOBILE — «Другие сезоны» всегда являются горизонтальной
   каруселью. На мобильном ниже по файлу старые правила
   .seasons-grid (CSS Grid + justify-content:center) переопределяли
   базовый flex-трек, из-за чего первый сезон мог оказаться
   частично за левой границей и его нельзя было вернуть свайпом.
   ПК-версию не затрагиваем.
   ========================================================= */
@media (max-width: 768px) {
  #seasonsCarousel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: visible;
  }

  #seasonsGrid.seasons-grid {
    display: flex !important;
    flex-direction: row;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: auto !important;
    overflow-y: hidden;
    gap: 12px;
    padding-left: 2px;
    padding-right: 12px;
    margin-left: -2px;
    margin-right: -2px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
    scroll-padding-left: 2px;
  }

  #seasonsGrid.seasons-grid > .anime-card {
    flex: 0 0 var(--poster-min-width, 165px) !important;
    width: var(--poster-min-width, 165px) !important;
    min-width: var(--poster-min-width, 165px);
    max-width: var(--poster-min-width, 165px);
    scroll-snap-align: start;
  }
}

/* ===================================================================
   HEADER DOCKING — перенос шапки в боковую панель (Windows-style)
   ===================================================================
   Ручка (#headerDockHandle) в верхней строке шапки: зажали и потянули
   к левому/правому краю экрана — вся .site-header становится вертикальной
   панелью у этого края. Класс на <html> (.header-dock-left/--right)
   переключает раскладку, .header-dock-style-{full|compact|icons}
   переключает плотность вкладок внутри неё. Логика — js/header-dock.js.
   Только для десктопа: на мобильном ручка и вся эта раскладка скрыты
   (см. @media max-width:768px в самом низу блока), там уже есть своя
   нижняя навигация. ================================================= */

/* ── Ручка переноса — в потоке верхней строки шапки, слева от лого ── */
.header-dock-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 44px;
  flex-shrink: 0;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: grab;
  color: rgba(232,232,232,0.35);
  transition: color var(--t-med), background var(--t-med);
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}
.header-dock-handle:hover {
  color: rgba(232,232,232,0.75);
  background: rgba(255,255,255,0.05);
}
.header-dock-handle:active {
  cursor: grabbing;
  background: rgba(255,255,255,0.09);
}
.header-dock-handle-dots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  width: 10px;
}
.header-dock-handle-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

/* Во время активного перетаскивания — курсор "grabbing" по всему
   документу (не только над ручкой), чтобы жест выглядел цельным, и
   отключаем text-selection, которое иначе мешало бы драгу мышью. */
html.header-dock-dragging,
html.header-dock-dragging * {
  cursor: grabbing !important;
  user-select: none !important;
}

/* ── Drop-зоны у краёв экрана (появляются только во время драга) ── */
.header-dock-zones {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease;
}
.header-dock-zones.is-active {
  opacity: 1;
  visibility: visible;
}
.header-dock-zone {
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(232,232,232,0.05);
  border: 2px dashed rgba(232,232,232,0.25);
  backdrop-filter: blur(6px);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.header-dock-zone--left,
.header-dock-zone--right {
  top: 0;
  bottom: 0;
  width: 110px;
}
.header-dock-zone--left { left: 0; border-width: 0 2px 0 0; }
.header-dock-zone--right { right: 0; border-width: 0 0 0 2px; }
.header-dock-zone--top {
  top: 0;
  left: 110px;
  right: 110px;
  height: 110px;
  border-width: 0 0 2px 0;
  /* Зона возврата наверх нужна только когда панель уже закреплена сбоку —
     js/header-dock.js добавляет .is-possible именно в этом случае,
     иначе зона остаётся невидимой и некликабельной. */
  opacity: 0;
  pointer-events: none;
}
html.header-dock-left .header-dock-zone--top,
html.header-dock-right .header-dock-zone--top {
  opacity: 1;
}
.header-dock-zone-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(232,232,232,0.55);
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: center;
  padding: 0 12px;
}
.header-dock-zone-hint svg { width: 26px; height: 26px; opacity: 0.7; }
.header-dock-zone.is-hover {
  background: rgba(232,232,232,0.14);
  border-color: rgba(232,232,232,0.6);
}
.header-dock-zone.is-hover .header-dock-zone-hint { color: #f0f0f0; }
.header-dock-zone.is-hover .header-dock-zone-hint svg { opacity: 1; }

/* ── Переключатель стилей (full/icons) убран по правке — теперь всегда
   используется только "full" (иконка + подпись), сама кнопка-переключатель
   больше нигде не показывается, в т.ч. и в боковом режиме (см. правило
   html.header-dock-left/-right .header-dock-style-switch ниже). Разметка
   и JS оставлены как есть — просто больше никогда не показываются. ── */
.header-dock-style-switch {
  display: none !important;
  gap: 4px;
  padding: 4px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
}
.header-dock-style-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 26px;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: rgba(168,168,168,0.6);
  cursor: pointer;
  transition: background var(--t-med), color var(--t-med);
}
.header-dock-style-btn:hover { color: #e0e0e0; background: rgba(255,255,255,0.06); }
.header-dock-style-btn.active { color: var(--green); background: rgba(255,255,255,0.1); }

/* ===================================================================
   БОКОВОЙ РЕЖИМ — общий каркас (слева и справа)
   =================================================================== */
html.header-dock-left,
html.header-dock-right {
  --dock-width-full: 232px;
  --dock-width-icons: 68px;
}
html.header-dock-left.header-dock-style-full,
html.header-dock-right.header-dock-style-full { --dock-width: var(--dock-width-full); }
html.header-dock-left.header-dock-style-icons,
html.header-dock-right.header-dock-style-icons { --dock-width: var(--dock-width-icons); }

/* Шапка целиком становится вертикальной колонкой у нужного края,
   растянутой на всю высоту экрана. */
html.header-dock-left .site-header,
html.header-dock-right .site-header {
  top: 0;
  bottom: 0;
  width: var(--dock-width);
  height: 100vh;
  border-bottom: none;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;      /* Firefox */
  -ms-overflow-style: none;   /* старый Edge/IE */
  background: rgba(14, 14, 18, 0.75) !important;
  backdrop-filter: blur(min(28px, var(--pf-cap, 999px))) saturate(190%) !important;
  -webkit-backdrop-filter: blur(min(28px, var(--pf-cap, 999px))) saturate(190%) !important;
}
html.header-dock-left .site-header::before,
html.header-dock-right .site-header::before {
  display: none !important;
}
html.header-dock-left .site-header::-webkit-scrollbar,
html.header-dock-right .site-header::-webkit-scrollbar {
  display: none; /* Chrome/Safari/новый Edge */
  width: 0;
  height: 0;
}
html.header-dock-left .site-header {
  left: 0;
  right: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.4), inset -1px 0 0 rgba(255, 255, 255, 0.06);
}
html.header-dock-right .site-header {
  right: 0;
  left: auto;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.4), inset 1px 0 0 rgba(255, 255, 255, 0.06);
}

/* Обе строки (top/bottom) складываются одна под другой, во всю ширину
   колонки, вместо изначального горизонтального flex-ряда. */
html.header-dock-left .header-inner,
html.header-dock-right .header-inner {
  flex-direction: column;
  align-items: stretch;
  height: auto;
  width: 100%;
  padding: 14px 12px;
  gap: 14px;
}
html.header-dock-left .header-inner--top,
html.header-dock-right .header-inner--top {
  height: auto;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
html.header-dock-left .header-inner--bottom,
html.header-dock-right .header-inner--bottom {
  height: auto;
  border-top: none;
  flex: 1 1 auto;
}

/* Внутри верхней строки: ручка сверху по центру, затем лого, затем
   поиск на всю ширину, затем уведомления/аккаунт друг под другом на
   всю ширину колонки (telegram переносится ниже, под .header-nav —
   см. _headerDockMoveTelegramBtn в js/header-dock.js). */
html.header-dock-left .header-inner--top,
html.header-dock-right .header-inner--top {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}
html.header-dock-left .header-dock-handle,
html.header-dock-right .header-dock-handle {
  align-self: center;
  width: 44px;
  height: 18px;
  order: -1;
}
html.header-dock-left .header-dock-handle-dots,
html.header-dock-right .header-dock-handle-dots {
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: 1fr;
  width: 28px;
}
html.header-dock-left .logo,
html.header-dock-right .logo {
  justify-content: center;
  gap: 8px;
}
/* Баг: в самой широкой из плотностей ("full", --dock-width-full: 232px)
   надпись "NekoNest" рядом с иконкой не помещалась в одну строку —
   буква "T" переносилась на вторую. Уменьшаем иконку логотипа и шрифт
   текста именно в боковом режиме, и явно запрещаем перенос строки. В
   "icons" текст лого скрыт вовсе (см. .header-dock-style-icons ниже),
   так что здесь достаточно поправить только "full" — единственную
   плотность, где текст лого вообще виден. */
html.header-dock-left.header-dock-style-full .logo-icon-wrap,
html.header-dock-right.header-dock-style-full .logo-icon-wrap,
html.header-dock-left.header-dock-style-full .logo-svg,
html.header-dock-right.header-dock-style-full .logo-svg {
  width: 40px;
  height: 40px;
}
html.header-dock-left.header-dock-style-full .logo-text,
html.header-dock-right.header-dock-style-full .logo-text {
  font-size: 16px;
  letter-spacing: 1px;
  white-space: nowrap;
}
html.header-dock-left .search-wrap,
html.header-dock-right .search-wrap {
  flex: 1 1 auto !important;
  width: 100%;
}
html.header-dock-left .header-top-spacer,
html.header-dock-right .header-top-spacer {
  display: none;
}
html.header-dock-left .header-top-right,
html.header-dock-right .header-top-right {
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  gap: 6px;
}

/* Строка вкладок становится вертикальным списком на всю ширину колонки.
   height:auto вместо унаследованного .header-inner--bottom .header-nav
   {height:100%} (это правило для горизонтальной шапки) — иначе список
   вкладок растягивался бы на всю (гибкую, flex:1 1 auto) высоту нижней
   секции панели, оставляя пустой хвост после последней вкладки, вместо
   того чтобы список занимал ровно столько места, сколько нужно его
   содержимому. */
html.header-dock-left .header-nav,
html.header-dock-right .header-nav {
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  height: auto;
  gap: 3px;
}
html.header-dock-left .header-inner--bottom .nav-tab,
html.header-dock-right .header-inner--bottom .nav-tab {
  width: 100%;
  height: 40px;
  justify-content: flex-start;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.1px;
  transition: color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}
html.header-dock-left .header-inner--bottom .nav-tab:hover,
html.header-dock-right .header-inner--bottom .nav-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
html.header-dock-left .header-inner--bottom .nav-tab:active,
html.header-dock-right .header-inner--bottom .nav-tab:active {
  transform: scale(0.98);
}
html.header-dock-left .header-inner--bottom .nav-tab.active,
html.header-dock-right .header-inner--bottom .nav-tab.active {
  color: #fff;
  font-weight: 700;
}
html.header-dock-left .header-inner--bottom .nav-tab.active .nav-tab-icon,
html.header-dock-right .header-inner--bottom .nav-tab.active .nav-tab-icon {
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.7));
}
/* БАГ: базовое правило .header-inner--bottom .nav-dropdown (для обычной
   горизонтальной шапки) задаёт height:100% + align-items:center, чтобы
   дропдаун-кнопка (например "Мои списки") центрировалась по высоте
   узкой строки вкладок. В боковом (вертикальном) режиме .header-nav
   этого правила никто не перекрывал — в результате #navListsDropdown/
   #navAccountDropdown растягивались на всю оставшуюся высоту колонки
   вкладок (100% от auto-высоты flex-контейнера) и центрировали кнопку
   внутри себя, создавая пустой промежуток сверху и снизу вместо того,
   чтобы стоять вплотную к соседним вкладкам. Сбрасываем обратно к
   обычному потоковому блоку, как у .nav-tab по соседству. */
html.header-dock-left .header-inner--bottom .nav-dropdown,
html.header-dock-right .header-inner--bottom .nav-dropdown {
  height: auto;
  /* БАГ (найден через диагностику): базовое правило (строка ~318,
     .header-inner--bottom .nav-dropdown { display:flex } — для обычной
     горизонтальной шапки) остаётся горизонтальным flex-рядом и в docked-
     режиме, потому что до этой правки переопределялись только height/
     align-items/flex-shrink, а flex-direction — нет. В итоге кнопка
     #tabLists и раскрытое меню #navListsMenu вставали БОК О БОК как два
     элемента одной строки (меню сжималось до трети ширины панели и
     вылезало вправо), а не друг под другом — визуально выглядело как
     всплывающий попап сбоку, хотя JS уже переключал только .is-open/
     .hidden без position:fixed. flex-direction:column — весь фикс. */
  flex-direction: column;
  align-items: stretch;
  flex-shrink: 0;
}
html.header-dock-left .nav-dropdown,
html.header-dock-right .nav-dropdown {
  width: 100%;
}
html.header-dock-left .header-inner--bottom .nav-dropdown-toggle,
html.header-dock-right .header-inner--bottom .nav-dropdown-toggle,
html.header-dock-left .header-top-right .nav-dropdown-toggle,
html.header-dock-right .header-top-right .nav-dropdown-toggle {
  width: 100%;
  justify-content: flex-start;
}
/* В боковой панели кнопка аккаунта — такой же прямоугольник как колокольчик */
html.header-dock-left .nav-account-btn,
html.header-dock-right .nav-account-btn {
  border-radius: 10px;
  height: 40px;
  padding: 0 12px;
  gap: 7px;
  color: rgba(168,168,168,0.75);
}
html.header-dock-left .nav-account-btn:hover,
html.header-dock-right .nav-account-btn:hover {
  background: rgba(255,255,255,0.07);
  color: #e8e8e8;
}
html.header-dock-left .nav-dropdown-arrow,
html.header-dock-right .nav-dropdown-arrow {
  margin-left: auto;
}

/* ── "Мои списки" и меню аккаунта в боковой (docked) панели —
   раскрываются НА МЕСТЕ, аккордеоном прямо под кнопкой, раздвигая
   остальные вкладки вниз, вместо всплывающего попапа сбоку. Оба меню
   используют один и тот же общий селектор (.nav-dropdown в docked-
   режиме), чтобы формат анимации/позиционирования гарантированно
   совпадал и не расходился при будущих правках одного из двух мест
   по отдельности — тот же паттерн, что уже применён для попап-режима
   выше (см. #navListsMenu/#navAccountMenu, ~строка 712). Тот же приём
   grid-template-rows 0fr→1fr, что и у "Добавить в список" на странице
   аниме (.my-list-row/.my-list-btns.is-open), см. js/ui.js:
   toggleListsDropdown()/toggleAccountDropdown() — там же переключается
   класс .is-open.
   Оформление раскрытого списка — "вложенная карточка": собственный
   фон + вертикальная полоса-акцент слева (.nav-dropdown-menu-inner
   ниже), чтобы список читался как явное подменю под кнопкой. */
html.header-dock-left #navListsDropdown #navListsMenu,
html.header-dock-right #navListsDropdown #navListsMenu,
html.header-dock-left #navAccountDropdown #navAccountMenu,
html.header-dock-right #navAccountDropdown #navAccountMenu {
  position: static !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  display: grid !important;
  grid-template-rows: 0fr;
  overflow: hidden;
  opacity: 0 !important;
  visibility: visible !important;
  transform: none !important;
  /* Один простой transition на весь блок сразу — высота (через grid-
     template-rows) и прозрачность анимируются вместе, синхронно, без
     отдельной покадровой игры с каждым пунктом списка по очереди.
     Раньше здесь был построчный каскад (каждый .nav-dropdown-item со
     своей transition-delay) — он оказался хрупким: другое, не-docked
     правило в файле (.nav-dropdown-menu:not(.hidden) .nav-dropdown-item,
     см. ~7700) тоже совпадало в боковом режиме и запускало свою
     keyframe-анимацию поверх, и общая картина выглядела рваной/
     резкой. Один transition на контейнер — надёжнее: анимировать
     нечему конфликтовать, поведение одинаково предсказуемо что при
     открытии, что при закрытии. */
  transition:
    grid-template-rows var(--t-med),
    opacity var(--t-med);
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0;
  margin: 0;
  min-width: 0;
  width: 100%;
  animation: none !important;
}
/* .hidden всё ещё используется как ГОСТЕВАЯ/начальная защита (display:
   none) — снимаем его сразу при открытии в JS вместе с .is-open, но на
   случай рассинхронизации оставляем display:none приоритетнее grid. */
html.header-dock-left #navListsDropdown #navListsMenu.hidden,
html.header-dock-right #navListsDropdown #navListsMenu.hidden,
html.header-dock-left #navAccountDropdown #navAccountMenu.hidden,
html.header-dock-right #navAccountDropdown #navAccountMenu.hidden {
  display: none !important;
}
html.header-dock-left #navListsDropdown.is-open #navListsMenu,
html.header-dock-right #navListsDropdown.is-open #navListsMenu,
html.header-dock-left #navAccountDropdown.is-open #navAccountMenu,
html.header-dock-right #navAccountDropdown.is-open #navAccountMenu {
  grid-template-rows: 1fr !important;
  opacity: 1 !important;
  border: none !important;
  box-shadow: none !important;
}
html.header-dock-left #navListsDropdown #navListsMenu .nav-dropdown-menu-inner,
html.header-dock-right #navListsDropdown #navListsMenu .nav-dropdown-menu-inner,
html.header-dock-left #navAccountDropdown #navAccountMenu .nav-dropdown-menu-inner,
html.header-dock-right #navAccountDropdown #navAccountMenu .nav-dropdown-menu-inner {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  background: transparent !important;
  border-radius: var(--radius-sm);
  border: none !important;
  border-left: none !important;
  box-shadow: none !important;
  transition: margin var(--t-med), padding var(--t-med);
}
html.header-dock-left #navListsDropdown.is-open #navListsMenu .nav-dropdown-menu-inner,
html.header-dock-right #navListsDropdown.is-open #navListsMenu .nav-dropdown-menu-inner,
html.header-dock-left #navAccountDropdown.is-open #navAccountMenu .nav-dropdown-menu-inner,
html.header-dock-right #navAccountDropdown.is-open #navAccountMenu .nav-dropdown-menu-inner {
  margin: 2px 0 4px;
  padding: 6px 0;
  background: rgba(255, 255, 255, 0.05) !important;
  border: none !important;
  border-left: none !important;
  box-shadow: none !important;
}
/* Пункты списка — с чуть меньшим отступом слева, чем в обычной колонке
   вкладок, т.к. вложенность теперь и так читается по полосе-акценту
   и фону самой карточки. Никакой собственной анимации/transition у
   пунктов больше нет — они просто следуют за прозрачностью родителя
   (#navListsMenu/#navAccountMenu выше), который уже анимирует opacity
   целиком. */
html.header-dock-left #navListsDropdown #navListsMenu .nav-dropdown-item,
html.header-dock-right #navListsDropdown #navListsMenu .nav-dropdown-item,
html.header-dock-left #navAccountDropdown #navAccountMenu .nav-dropdown-item,
html.header-dock-right #navAccountDropdown #navAccountMenu .nav-dropdown-item {
  width: 100%;
  padding: 8px 12px 8px 16px;
  border-radius: 8px;
  animation: none !important;
  transition: none !important;
  transform: none !important;
  opacity: 1 !important;
}
html.header-dock-left #navListsDropdown #navListsMenu .nav-dropdown-section-title,
html.header-dock-right #navListsDropdown #navListsMenu .nav-dropdown-section-title,
html.header-dock-left #navAccountDropdown #navAccountMenu .nav-dropdown-section-title,
html.header-dock-right #navAccountDropdown #navAccountMenu .nav-dropdown-section-title {
  padding-left: 16px;
}
/* Стрелка поворачивается при раскрытии автоматически — тот же
   :has()-селектор чуть выше (строка ~600) уже реагирует на снятие
   .hidden с #navListsMenu/#navAccountMenu, отдельное правило не
   нужно. */

/* Выпадающее меню "Мои списки"/аккаунта в ОБЫЧНОМ (не-docked) режиме
   шапки — раскрывается вбок (наружу от панели), а не вниз поверх
   соседних вкладок, иначе перекрывало бы само себя в узкой колонке.
   БАГ (история): раньше это было чистым position:absolute от
   .nav-dropdown (left/right: calc(100% + 8px)) — координата верная по
   смыслу, но физически выносит меню ЗА пределы узкой колонки панели.
   Пока панель резала overflow-x, меню целиком обрезалось (невидимо и
   некликабельно). Когда обрезку убрали, вместо этого сама панель
   обзавелась горизонтальным скроллбаром ради этого вылезающего
   контента — то же самое меню стало нужно "доскроливать" вбок.
   Фикс — .header-dock-menu-fixed: js/ui.js (_positionDockDropdownMenu)
   навешивает этот класс и inline top/left|right, посчитанные через
   getBoundingClientRect() самой кнопки-триггера, при каждом открытии
   меню в ОБЫЧНОМ (не-docked) режиме. position:fixed считает координаты
   от viewport, а не от .nav-dropdown/.site-header. Тот же паттерн уже
   используется в js/notifications.js для #notifDropdown
   (_positionDropdownDesktop) — тут переиспользуем его для консистентности.
   В docked-режиме этот класс больше не навешивается ни для списков,
   ни для аккаунта (оба теперь раскрываются on-place аккордеоном выше),
   но правило ниже оставлено как есть — оно применяется только вне
   .header-dock-left/.header-dock-right и никак не пересекается с
   docked-правилами. */
.nav-dropdown-menu.header-dock-menu-fixed {
  position: fixed;
}
/* Страховка: списки и аккаунт-меню никогда не должны становиться
   fixed-попапом ВНУТРИ docked-режима, даже если класс
   .header-dock-menu-fixed случайно остался бы на #navListsMenu/
   #navAccountMenu (например, из старой сессии/кэша, когда аккаунт
   ещё раскрывался попапом) — в боковой панели оба меню теперь всегда
   on-place аккордеон. Специфичность ID-селектора выше класса, поэтому
   это правило гарантированно побеждает предыдущее. */
html.header-dock-left #navListsDropdown #navListsMenu.header-dock-menu-fixed,
html.header-dock-right #navListsDropdown #navListsMenu.header-dock-menu-fixed,
html.header-dock-left #navAccountDropdown #navAccountMenu.header-dock-menu-fixed,
html.header-dock-right #navAccountDropdown #navAccountMenu.header-dock-menu-fixed {
  position: static !important;
}

/* ── Уведомления в боковой (docked) панели — тот же on-place accordion,
   что и "Мои списки"/аккаунт выше. Колокольчик (.notif-bell-wrapper)
   растягивается на всю ширину колонки, как обычная вкладка/toggle, а
   #notifDropdown (JS-ом перемещённый в #notifDockAnchor внутри неё, см.
   _placeDropdownForMode в js/notifications.js) раскрывается вниз, тоже
   через grid-template-rows 0fr→1fr. .is-open здесь навешивается прямо
   на .notif-bell-wrapper (а не на отдельный контейнер типа #navAccount
   Dropdown), потому что .notif-bell-wrapper и есть единственная
   постоянная обёртка кнопки — см. _openDropdown/_closeDropdown. */
html.header-dock-left .notif-bell-wrapper,
html.header-dock-right .notif-bell-wrapper {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  position: static;
}
html.header-dock-left .notif-bell-btn,
html.header-dock-right .notif-bell-btn {
  width: 100%;
  height: 40px;
  justify-content: flex-start;
  padding: 0 12px;
  gap: 7px;
}
/* Стрелка раскрытия — тот же .nav-dropdown-arrow, что у "Мои списки"/
   аккаунта, но здесь её нет в статичной разметке (кнопка изначально
   рисуется одинаково для всех режимов шапки, а стрелка нужна только в
   docked) — рисуем псевдоэлементом вместо правки HTML под один режим. */
html.header-dock-left .notif-bell-btn::after,
html.header-dock-right .notif-bell-btn::after {
  content: '';
  width: 10px;
  height: 10px;
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0.5;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform var(--t-fast), opacity var(--t-fast);
}
html.header-dock-left .notif-bell-wrapper.is-open .notif-bell-btn::after,
html.header-dock-right .notif-bell-wrapper.is-open .notif-bell-btn::after {
  transform: rotate(180deg);
  opacity: 0.9;
}
/* Счётчик-бейдж — в горизонтальной/попап-версии абсолютно позиционирован
   поверх иконки (кружок в углу); в docked-строке кнопка ведёт себя как
   обычная вкладка с текстовым лейблом слева и счётчиком справа (тот же
   .tab-count паттерн, что у "Мои списки"), кружок здесь неуместен. */
html.header-dock-left .notif-bell-btn .notif-badge,
html.header-dock-right .notif-bell-btn .notif-badge {
  position: static;
  margin-left: auto;
  order: 2;
}
html.header-dock-left #notifDockAnchor,
html.header-dock-right #notifDockAnchor {
  width: 100%;
}
html.header-dock-left #notifDropdown,
html.header-dock-right #notifDropdown {
  position: static !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  width: 100% !important;
  max-height: none !important;
  display: grid !important;
  grid-template-rows: 0fr;
  /* ИСТОРИЯ БАГА (для будущих правок — оставляю оба захода, чтобы не
     наступить на те же грабли снова):
     1) Раньше здесь у #notifDropdown было ДВА прямых ребёнка —
        .notif-dropdown__header и .notif-dropdown__list. grid-template-
        rows описывает только ОДНУ явную строку, поэтому второй ребёнок
        уходил в неявную строку с grid-auto-rows:auto (по содержимому),
        не подчинявшуюся 0fr — список никогда не схлопывался до нуля,
        отсюда пустой блок после закрытия панели.
     2) Промежуточный фикс (grid-auto-rows: 0fr/1fr) решал схлопывание,
        но создавал НОВЫЙ баг: с двумя строками по 1fr в открытом
        состоянии доступное пространство делится ПОПОЛАМ между
        заголовком и списком — заголовок (который явно меньше половины)
        растягивался на свою долю, оставляя пустую щель под собой перед
        началом списка.
     Правильное решение — структурное, как у #navAccountMenu/
     #navListsMenu: header и list теперь обёрнуты в единственного
     прямого ребёнка .notif-dropdown__inner (см. HTML-шаблон в
     _ensureDropdown(), js/notifications.js) — grid-контейнеру снова
     ровно ОДНА явная строка с ровно ОДНИМ элементом, схлопывание
     0fr→1fr работает предсказуемо, без auto-строк и без деления
     пространства пополам. */
  min-height: 0;
  overflow: hidden;
  opacity: 0 !important;
  transform: none !important;
  pointer-events: none;
  transition:
    grid-template-rows var(--t-med),
    opacity var(--t-med);
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
}
html.header-dock-left .notif-bell-wrapper.is-open #notifDropdown,
html.header-dock-right .notif-bell-wrapper.is-open #notifDropdown {
  grid-template-rows: 1fr !important;
  opacity: 1 !important;
  pointer-events: auto;
}
/* Единственный прямой ребёнок #notifDropdown — держит и заголовок, и
   список вместе одним flex-блоком, тем же паттерном, что
   .nav-dropdown-menu-inner у "Мои списки"/аккаунта. min-height:0 —
   без него браузер считал бы высоту grid-строки по min-content этого
   блока (в т.ч. паддинги/border-bottom заголовка внутри) и не
   схлопывал бы её до нуля даже при grid-template-rows: 0fr. */
html.header-dock-left #notifDropdown .notif-dropdown__inner,
html.header-dock-right #notifDropdown .notif-dropdown__inner {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
html.header-dock-left #notifDropdown .notif-dropdown__header,
html.header-dock-right #notifDropdown .notif-dropdown__header {
  flex-shrink: 0;
  overflow: hidden;
  border-bottom: none;
}
html.header-dock-left #notifDropdown .notif-dropdown__list,
html.header-dock-right #notifDropdown .notif-dropdown__list {
  min-height: 0;
  overflow: hidden auto;
  max-height: 320px;
  margin: 2px 0 4px;
  padding: 6px 0;
  background: #000;
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--green);
}
html.header-dock-left #notifDropdown .notif-dropdown__handle,
html.header-dock-right #notifDropdown .notif-dropdown__handle {
  display: none;
}

/* Кнопка Telegram — в боковом режиме js/header-dock.js физически
   переносит .telegram-link-btn из .header-inner--top (где она обычно
   стоит рядом с полем поиска) в .header-inner--bottom, сразу после
   .header-nav — то есть НИЖЕ всего списка вкладок, а не между поиском
   и вкладками, как получалось бы просто по исходному порядку в DOM.
   Стилизуем её здесь как обычную строку панели, тем же паттерном, что
   и .header-dock-style-switch чуть ниже. */
html.header-dock-left .header-inner--bottom .telegram-link-btn,
html.header-dock-right .header-inner--bottom .telegram-link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40px;
  margin-left: 0;
  margin-top: 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, #37AEE2 0%, #1E96C8 100%);
  box-shadow: 0 4px 14px rgba(55, 174, 226, 0.4);
  color: #fff;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, background 0.25s ease;
  flex-shrink: 0;
}
html.header-dock-left .header-inner--bottom .telegram-link-btn:hover,
html.header-dock-right .header-inner--bottom .telegram-link-btn:hover {
  background: linear-gradient(135deg, #3bb5eb 0%, #209fd3 100%);
  box-shadow: 0 6px 20px rgba(55, 174, 226, 0.65), 0 0 15px rgba(55, 174, 226, 0.35);
  transform: translateY(-1px);
}
html.header-dock-left .header-inner--bottom .telegram-link-btn:active,
html.header-dock-right .header-inner--bottom .telegram-link-btn:active {
  transform: scale(0.98);
}

/* Переключатель стилей (full/icons) полностью убран по правке —
   панель в боковом режиме всегда использует только "full". */
html.header-dock-left .header-dock-style-switch,
html.header-dock-right .header-dock-style-switch {
  display: none !important;
}

/* Сдвигаем контент страницы вбок вместо отступа сверху — тот же
   принцип, что и padding-top на body в обычном режиме (см. правило
   body{} в начале файла), но теперь margin по нужной стороне. */
html.header-dock-left body,
html.header-dock-right body {
  padding-top: 0;
}
html.header-dock-left .main-content,
html.header-dock-right .main-content {
  max-width: none;
}
html.header-dock-left body { margin-left: var(--dock-width); }
html.header-dock-right body { margin-right: var(--dock-width); }

/* .hero-banner обычно растягивается на всю ширину ОКНА трюком
   left:50%/margin:-50vw/width:100vw (компенсация padding у родителя) —
   в боковом режиме окно визуально уже, т.к. часть его занята панелью
   (см. margin-left/right на body выше), поэтому тот же трюк должен
   мерить не от 50% окна, а от 50% реально оставшейся полосы контента.
   Пересчитываем через calc() с учётом --dock-width и стороны панели. */
html.header-dock-left .hero-banner {
  width: calc(100vw - var(--dock-width));
  left: 50%;
  margin-left: calc(-50vw + var(--dock-width) / 2);
  margin-right: calc(-50vw + var(--dock-width) / 2);
}
html.header-dock-right .hero-banner {
  width: calc(100vw - var(--dock-width));
  left: 50%;
  margin-left: calc(-50vw + var(--dock-width) / 2);
  margin-right: calc(-50vw + var(--dock-width) / 2);
}

/* Слайдер внутри баннера жёстко задан как 100vw !important — в боковом
   режиме сам .hero-banner уже уже на ширину панели, и слайдер шире
   своего родителя вылезает за правый край окна и обрезается (справа
   пропадает карточка с таймером/постером). Тянем его на 100% ширины
   баннера, а лишнее убираем, чтобы ничего не выходило за окно. */
html.header-dock-left .hero-banner,
html.header-dock-right .hero-banner {
  max-width: calc(100vw - var(--dock-width));
  box-sizing: border-box;
}
html.header-dock-left .hero-banner .hero-banner-slider,
html.header-dock-right .hero-banner .hero-banner-slider {
  width: 100% !important;
  max-width: 100% !important;
}
@media (max-width: 768px) {
  html.header-dock-left .hero-banner,
  html.header-dock-right .hero-banner { max-width: none; }
  html.header-dock-left .hero-banner .hero-banner-slider,
  html.header-dock-right .hero-banner .hero-banner-slider { width: 100vw !important; max-width: 100vw !important; }
}

/* ===================================================================
   ПЛОТНОСТЬ ВКЛАДОК В БОКОВОМ РЕЖИМЕ — два варианта
   =================================================================== */

/* Вариант 1 "full" (по умолчанию) — иконка + полная подпись в столбик,
   как исходная строка вкладок, просто повёрнутая в вертикальный список.
   Никаких доп. правил не нужно — это и есть базовое поведение выше. */

/* Вариант 2 "icons" (был "3" — средний вариант "compact", иконка +
   сокращённая подпись помельче, убрали по правке) — только иконки по
   центру, подписи скрыты, ширина панели минимальна
   (--dock-width-icons). Подсказка показывается через нативный title у
   самих кнопок (уже задан в HTML атрибутом title). */
html.header-dock-style-icons .header-inner--bottom .nav-tab span,
html.header-dock-style-icons .header-inner--bottom .nav-dropdown-toggle span,
html.header-dock-style-icons .nav-dropdown-arrow,
html.header-dock-style-icons .logo-text,
html.header-dock-style-icons #accountEmail {
  display: none;
}
html.header-dock-style-icons .header-inner--bottom .nav-tab,
html.header-dock-style-icons .header-inner--bottom .nav-dropdown-toggle {
  justify-content: center;
  padding: 0;
  height: 38px;
}
html.header-dock-style-icons .nav-account-btn { justify-content: center; }
html.header-dock-style-icons .logo { justify-content: center; }
html.header-dock-style-icons .header-inner--bottom .telegram-link-btn { width: 38px; height: 38px; margin-left: auto; margin-right: auto; }
/* В режиме только-иконок выпадающее меню всё равно раскрывается вбок
   с полными подписями — иначе там просто нечего было бы читать. */
html.header-dock-style-icons .nav-dropdown-menu .ndi-label,
html.header-dock-style-icons .nav-dropdown-item span,
html.header-dock-style-icons .nav-dropdown-section-title {
  display: initial;
}

/* ===================================================================
   МОБИЛЬНЫЙ — вся эта фича недоступна, у мобильного своя нижняя
   навигация (.mobile-bottom-nav). Прячем ручку/зоны и на всякий случай
   сбрасываем боковой режим визуально, даже если он остался сохранён в
   localStorage с более широкого окна.

   ВТОРАЯ ЛИНИЯ ОБОРОНЫ: основная защита — на уровне JS
   (js/header-dock.js, _headerDockApply() не навешивает классы
   header-dock-* на <html> при window.innerWidth <= 768). Но этот блок
   всё равно должен сам по себе гасить ВСЕ свойства бокового режима на
   мобильном через !important, на случай рассинхронизации/старого
   закэшированного JS — а не только позиционирование .site-header, как
   было раньше. Правила бокового режима выше в файле стоят позже в
   каскаде, чем обычные мобильные правила (~строка 5705,
   .mobile-bottom-nav / .header-inner--bottom{display:none}), поэтому
   без явных !important здесь они "перебивали" бы обычную мобильную
   раскладку. =========================================================
*/
@media (max-width: 768px) {
  /* Чисто десктопные элементы управления — не должны быть видны на
     мобильном вообще, независимо от того, навешены ли классы
     header-dock-* на <html>. */
  .header-dock-handle,
  .header-dock-zones,
  .header-dock-style-switch {
    display: none !important;
  }

  /* .site-header — возвращаем в обычный мобильный горизонтальный вид
     (это уже было и раньше). */
  html.header-dock-left .site-header,
  html.header-dock-right .site-header {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    bottom: auto !important;
    width: 100% !important;
    height: auto !important;
    flex-direction: row !important;
    border: none !important;
    border-right: none !important;
    border-left: none !important;
    overflow: visible !important;
  }
  html.header-dock-left body,
  html.header-dock-right body {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-top: 60px !important;
  }
  html.header-dock-left .main-content,
  html.header-dock-right .main-content {
    max-width: none;
  }

  /* .header-inner — обратно в обычную мобильную горизонтальную строку
     вместо вертикальной колонки бокового режима. */
  html.header-dock-left .header-inner,
  html.header-dock-right .header-inner {
    flex-direction: row !important;
    align-items: center !important;
    height: 60px !important;
    width: auto !important;
    padding: 8px 14px !important;
    gap: 10px !important;
  }
  html.header-dock-left .header-inner--top,
  html.header-dock-right .header-inner--top {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    height: 60px !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
  }
  /* На мобильном вкладки идут через .mobile-bottom-nav, а не через
     .header-nav / .header-inner--bottom — этот блок должен остаться
     display:none, как в обычной мобильной раскладке (см. ~строка 5756),
     а не превращаться в видимую вертикальную колонку вкладок. */
  html.header-dock-left .header-inner--bottom,
  html.header-dock-right .header-inner--bottom {
    display: none !important;
  }
  html.header-dock-left .header-nav,
  html.header-dock-right .header-nav {
    display: none !important;
  }

  /* Лого/текст — обычный мобильный вид, без центрирования и сжатой
     ширины бокового режима. */
  html.header-dock-left .logo,
  html.header-dock-right .logo {
    justify-content: flex-start !important;
  }
  html.header-dock-left .logo-icon-wrap,
  html.header-dock-right .logo-icon-wrap,
  html.header-dock-left .logo-svg,
  html.header-dock-right .logo-svg {
    width: 44px !important;
    height: 44px !important;
  }
  html.header-dock-left .logo-text,
  html.header-dock-right .logo-text {
    display: inline !important;
    font-size: 15px !important;
    white-space: nowrap !important;
  }

  /* Поиск — снова обычный растягивающийся инпут в строке, а не
     full-width блок боковой колонки. */
  html.header-dock-left .search-wrap,
  html.header-dock-right .search-wrap {
    flex: 1 1 auto !important;
    width: auto !important;
  }
  html.header-dock-left .header-top-spacer,
  html.header-dock-right .header-top-spacer {
    display: none !important;
  }
  html.header-dock-left .header-top-right,
  html.header-dock-right .header-top-right {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    gap: 0 !important;
    flex-shrink: 0 !important;
    justify-content: flex-start !important;
  }

  /* .hero-banner — обратно на обычный full-bleed трюк без поправки на
     ширину боковой панели (на мобильном панели нет вообще). */
  html.header-dock-left .hero-banner,
  html.header-dock-right .hero-banner {
    width: 100vw !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
  }

  /* Меню аккаунта — на мобильном раскрывается вниз (если вообще
     раскрывается через этот десктопный компонент), никогда вбок за
     пределы экрана. Настоящая мобильная навигация — это
     #mobileListsPopup/#mobileSettingsPopup, не эти дропдауны. */
  html.header-dock-left .nav-dropdown-menu,
  html.header-dock-right .nav-dropdown-menu {
    top: calc(100% + 10px) !important;
    left: auto !important;
    right: 0 !important;
  }
}

/* =========================================================
   DETAIL PAGE — Apple iOS 17 / Liquid Glass Redesign
   ========================================================= */

/* ── Кнопка «Назад» (чистый текст без пилюли/фона) ── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 22px;
  padding: 4px 0;
  border-radius: 0;
  background: none;
  border: none;
  border-top: none;
  color: rgba(255,255,255,0.85);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: color 0.15s, opacity 0.15s;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

.back-btn:hover {
  background: none;
  border: none;
  border-color: transparent;
  box-shadow: none;
  color: #ffffff;
}

.back-btn:active {
  background: none;
  opacity: 0.7;
}

/* ── Главный виджет-фрейм ── */
.detail-widget-frame {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.01) 100%),
    rgba(12,14,20,0.72);
  border: 1px solid rgba(255,255,255,0.14);
  border-top: 1px solid rgba(255,255,255,0.24);
  border-radius: 26px;
  padding: 28px;
  backdrop-filter: blur(min(40px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(40px, var(--pf-cap, 999px))) saturate(200%);
  box-shadow:
    0 20px 60px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.18);
  position: relative;
  overflow: hidden;
}

.detail-widget-frame::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  pointer-events: none;
}

/* ── Постер ── */
.detail-poster {
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow:
    0 16px 48px rgba(0,0,0,0.7),
    inset 0 1px 0 rgba(255,255,255,0.12);
}

.detail-poster:hover {
  box-shadow:
    0 0 32px rgba(255,255,255,0.12),
    0 16px 48px rgba(0,0,0,0.7);
}

/* ── Информационная таблица (detail-meta) ── */
.detail-meta {
  margin-top: 20px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.01) 100%),
    rgba(14,16,22,0.6);
  border: 1px solid rgba(255,255,255,0.12);
  border-top: 1px solid rgba(255,255,255,0.22);
  border-radius: 18px;
  overflow: hidden;
  backdrop-filter: blur(min(24px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(24px, var(--pf-cap, 999px))) saturate(200%);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.14);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Rajdhani', sans-serif;
}

.meta-row {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background 0.15s;
}

.meta-row:hover {
  background: rgba(255,255,255,0.04);
}

.meta-label {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255,255,255,0.4);
}

.meta-value {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  text-align: right;
}



/* ── Заголовок аниме ── */
.detail-title {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.2;
  background: linear-gradient(180deg, #ffffff 0%, rgba(255,255,255,0.8) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

/* ── Жанры ── */
.genre-tag {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding: 5px 13px;
  border-radius: 999px;
  color: rgba(255,255,255,0.75);
  background:
    linear-gradient(rgba(255,255,255,0.1), rgba(255,255,255,0.04)),
    rgba(14,16,22,0.5);
  border: 1px solid rgba(255,255,255,0.16);
  border-top: 1px solid rgba(255,255,255,0.28);
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px))) saturate(180%);
  -webkit-backdrop-filter: blur(min(16px, var(--pf-cap, 999px))) saturate(180%);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.12);
  text-shadow: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
}

.genre-tag:hover {
  background:
    linear-gradient(rgba(255,255,255,0.18), rgba(255,255,255,0.07)),
    rgba(14,16,22,0.5);
  border-color: rgba(255,255,255,0.32);
  color: #ffffff;
  transform: none !important;
}

/* ── Описание ── */
.detail-desc {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 14.5px;
  line-height: 1.75;
  color: rgba(255,255,255,0.65);
}

/* ── Скриншоты ── */
.shot-thumb {
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.shot-thumb:hover {
  border-color: rgba(255,255,255,0.3);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 28px rgba(0,0,0,0.5);
}

/* ── Оборотная сторона постера ── */
.detail-poster-face-back {
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.14);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%),
    rgba(12,14,20,0.88);
  backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(200%);
  box-shadow: 0 16px 48px rgba(0,0,0,0.7);
}

.dpb-status {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 4px 12px;
  border-radius: 999px;
  background:
    linear-gradient(rgba(255,255,255,0.1), rgba(255,255,255,0.04)),
    rgba(14,16,22,0.6);
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
}

.dpb-score-block {
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.01) 100%),
    rgba(14,16,22,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  box-shadow: 0 8px 24px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
}

.dpb-score-num {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-size: 40px;
  font-weight: 900;
  letter-spacing: -2px;
}

.dpb-row-label {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.38);
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.dpb-row-value {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.82);
}

/* ── Мобильная адаптация ── */
@media (max-width: 768px) {
  .back-btn {
    margin-bottom: 16px;
    font-size: 14px;
    padding: 4px 0;
  }
  /* Full-bleed: рамка растягивается до самых краёв экрана отрицательным
     margin, компенсирующим боковой padding .main-content (12px, см.
     @media max-width:768px у .main-content выше по файлу). Внутренний
     padding остаётся прежним — контент (заголовок, жанры, описание)
     не прилипает к краю экрана. Скругления и border оставлены как есть:
     раз рамка теперь по ширине равна экрану, углы уже не "обрезаются"
     видимой областью — они просто уходят в самые углы экрана. */
  .detail-widget-frame {
    padding: 18px 16px;
    margin-left: -12px;
    margin-right: -12px;
    border-radius: 20px;
  }
  .detail-title {
    font-size: 22px;
  }
  .detail-desc {
    font-size: 14px;
  }
  .meta-row {
    padding: 9px 14px;
  }
}

@media (max-width: 480px) {
  .detail-widget-frame {
    padding: 14px 12px;
    margin-left: -12px;
    margin-right: -12px;
  }
  .detail-title {
    font-size: 20px;
  }
  .list-btn {
    padding: 10px 14px;
    font-size: 12.5px;
  }
}


/* =========================================================
   LISTS SECTION — Apple iOS 17 / Liquid Glass Redesign
   ========================================================= */

/* ── Заголовок секции ── */
#listsSection .list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

#listsSection .list-header::after {
  display: none !important;
}

#listsSection .list-page-title {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Rajdhani', sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.4px;
  text-transform: none;
  background: linear-gradient(180deg, #ffffff 0%, rgba(255,255,255,0.76) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

#listsSection .list-subtitle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-top: 1px solid rgba(255,255,255,0.24);
  color: rgba(255,255,255,0.72);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Rajdhani', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  box-shadow: 0 4px 12px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.15);
  margin: 0;
  margin-top: 6px;
}

/* ── Мобильная адаптация заголовка ── */
@media (max-width: 600px) {
  #listsSection .list-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 18px;
    padding-bottom: 14px;
  }
  #listsSection .list-page-title {
    font-size: 22px;
  }
}


/* =========================================================
   HISTORY SECTION — Apple iOS 17 / Liquid Glass Redesign
   ========================================================= */

/* ── Заголовок ── */
#historySection .list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

#historySection .list-header::after {
  display: none !important;
}

#historySection .list-page-title {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Rajdhani', sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.4px;
  text-transform: none;
  background: linear-gradient(180deg, #ffffff 0%, rgba(255,255,255,0.76) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

#historySection .list-subtitle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-top: 1px solid rgba(255,255,255,0.24);
  color: rgba(255,255,255,0.72);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Rajdhani', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  box-shadow: 0 4px 12px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.15);
  margin: 0;
  margin-top: 6px;
}

/* ── Кнопка «Очистить историю» ── */
.history-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 22px;
}

.history-clear-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255,90,90,0.14) 0%, rgba(255,60,60,0.05) 100%),
    rgba(20,10,10,0.55);
  border: 1px solid rgba(255,100,100,0.28);
  border-top: 1px solid rgba(255,140,140,0.4);
  color: rgba(255,130,130,0.9);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(200%);
  box-shadow: 0 4px 14px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
}

.history-clear-btn:hover {
  background:
    linear-gradient(135deg, rgba(255,90,90,0.22) 0%, rgba(255,60,60,0.1) 100%),
    rgba(20,10,10,0.55);
  border-color: rgba(255,120,120,0.5);
  color: #ffaaaa;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35), 0 0 16px rgba(255,80,80,0.1);
}

/* ── Мобильная адаптация ── */
@media (max-width: 600px) {
  #historySection .list-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 18px;
    padding-bottom: 14px;
  }
  #historySection .list-page-title {
    font-size: 22px;
  }
  .history-clear-btn {
    font-size: 12px;
    padding: 8px 14px;
  }
}


/* =========================================================
   STATISTICS SECTION — Apple iOS 17 / Liquid Glass Redesign
   ========================================================= */

/* ── Контейнер страницы ── */
#statsSection .stats-page,
.stats-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px 80px;
}

/* ── Заголовок ── */
#statsSection .list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

#statsSection .list-header::after {
  display: none !important;
}

#statsSection .list-page-title {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Rajdhani', sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.4px;
  text-transform: none;
  background: linear-gradient(180deg, #ffffff 0%, rgba(255,255,255,0.76) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

#statsSection .list-subtitle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-top: 1px solid rgba(255,255,255,0.24);
  color: rgba(255,255,255,0.72);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Rajdhani', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  box-shadow: 0 4px 12px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.15);
  margin: 0;
  margin-top: 6px;
}

/* ── Главные KPI карточки ── */
.stats-hero-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.stats-hero-card {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%),
    rgba(14,16,22,0.65);
  border: 1px solid rgba(255,255,255,0.13);
  border-top: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(200%);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.18);
  transition: transform 0.2s cubic-bezier(0.2,0.8,0.2,1), border-color 0.2s, box-shadow 0.2s;
}

.stats-hero-card::before {
  display: none !important;
}

.stats-hero-card:hover {
  border-color: rgba(255,255,255,0.28);
  box-shadow: 0 16px 40px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.24);
}

.stats-hero-num {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.15;
  color: #ffffff;
  background: linear-gradient(180deg, #ffffff 0%, rgba(255,255,255,0.82) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stats-hero-label {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Секционные карточки ── */
.stats-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.stats-card {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.01) 100%),
    rgba(12,14,20,0.65);
  border: 1px solid rgba(255,255,255,0.12);
  border-top: 1px solid rgba(255,255,255,0.22);
  border-radius: 22px;
  padding: 22px 24px;
  margin-bottom: 18px;
  backdrop-filter: blur(min(36px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(36px, var(--pf-cap, 999px))) saturate(200%);
  box-shadow: 0 16px 40px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.14);
  position: relative;
  overflow: hidden;
}

.stats-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  pointer-events: none;
}

.stats-card-title {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 18px;
}

/* ── Интересные факты ── */
.stats-facts {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stats-fact {
  display: flex;
  align-items: center;
  gap: 14px;
}

.stats-fact-ico {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.03) 100%),
    rgba(20,22,30,0.6);
  border: 1px solid rgba(255,255,255,0.16);
  border-top: 1px solid rgba(255,255,255,0.26);
  color: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(min(14px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(14px, var(--pf-cap, 999px)));
  box-shadow: 0 4px 12px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.18);
}

.stats-fact-val {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 15.5px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
}

.stats-fact-key {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ── Активность по дням недели ── */
.stats-activity-row {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  gap: 10px;
  height: 130px;
  padding: 10px 0;
}

.stats-act-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  height: 100%;
}

.stats-act-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  padding: 0 4px;
}

.stats-act-bar {
  width: 100%;
  max-width: 24px;
  margin: 0 auto;
  background: linear-gradient(180deg, #ffffff 0%, rgba(255,255,255,0.35) 100%);
  border-radius: 999px;
  min-height: 6px;
  box-shadow: 0 0 14px rgba(255,255,255,0.2);
  transition: opacity 0.2s, transform 0.2s;
}

.stats-act-bar-wrap:hover .stats-act-bar {
  opacity: 1;
  transform: scaleY(1.04);
  box-shadow: 0 0 18px rgba(255,255,255,0.4);
}

.stats-act-count {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  margin-top: 6px;
}

.stats-act-label {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 3px;
}

/* ── Стрик просмотров ── */
.stats-streak-card {
  background:
    linear-gradient(135deg, rgba(255,149,0,0.08) 0%, rgba(255,59,48,0.02) 100%),
    rgba(14,16,22,0.65);
}

.stats-streak-flame {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255,149,0,0.22) 0%, rgba(255,59,48,0.1) 100%),
    rgba(25,12,8,0.6);
  border: 1px solid rgba(255,149,0,0.35);
  border-top: 1px solid rgba(255,180,50,0.55);
  color: #ff9500;
  box-shadow: 0 0 20px rgba(255,149,0,0.25), inset 0 1px 0 rgba(255,200,80,0.3);
}

.stats-streak-num {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
  line-height: 1.15;
}

.stats-streak-unit {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stats-streak-best-val {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
}

.stats-streak-best-key {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Мобильная адаптация ── */
@media (max-width: 600px) {
  #statsSection .list-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 18px;
    padding-bottom: 14px;
  }
  #statsSection .list-page-title {
    font-size: 22px;
  }
  .stats-hero-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .stats-hero-card {
    padding: 16px 10px;
    border-radius: 16px;
  }
  .stats-hero-num {
    font-size: 22px;
  }
  .stats-two-col {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .stats-card {
    padding: 18px 16px;
    border-radius: 18px;
  }
}


/* =========================================================
   PROFILE SECTION — Apple iOS 17 / Liquid Glass Redesign
   ========================================================= */

/* ── Шапка профиля ── */
.profile-header {
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%),
    rgba(14,16,22,0.68);
  backdrop-filter: blur(min(40px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(40px, var(--pf-cap, 999px))) saturate(200%);
  border: 1px solid rgba(255,255,255,0.13);
  border-top: 1px solid rgba(255,255,255,0.26);
  box-shadow: 0 16px 40px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.18);
  padding: 24px 26px;
  position: relative;
  overflow: hidden;
}

.profile-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  pointer-events: none;
}

/* Аватар */
.profile-avatar-wrap {
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.profile-avatar-lg {
  border: 2px solid rgba(255,255,255,0.25);
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-weight: 800;
}

.profile-avatar-edit-btn {
  color: rgba(255, 255, 255, 0.95);
  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.24) 0%,
      rgba(255, 255, 255, 0.08) 46%,
      rgba(255, 255, 255, 0.14) 100%),
    rgba(20, 24, 34, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-top-color: rgba(255, 255, 255, 0.52);
  border-bottom-color: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px))) saturate(180%);
  -webkit-backdrop-filter: blur(min(16px, var(--pf-cap, 999px))) saturate(180%);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06);
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.profile-avatar-edit-btn:hover {
  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.34) 0%,
      rgba(255, 255, 255, 0.14) 46%,
      rgba(255, 255, 255, 0.20) 100%),
    rgba(20, 24, 34, 0.55);
  border-color: rgba(255, 255, 255, 0.38);
  border-top-color: rgba(255, 255, 255, 0.65);
  color: #ffffff;
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.40),
    0 0 12px rgba(255, 255, 255, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transform: none;
}

.profile-avatar-edit-btn:active {
  transform: none;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* Никнейм и инфо */
.profile-nickname {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: #ffffff;
  background: linear-gradient(180deg, #ffffff 0%, rgba(255,255,255,0.8) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
}

.profile-you-tag {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 3px 10px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  backdrop-filter: blur(min(10px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(10px, var(--pf-cap, 999px)));
}

.profile-joined {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 12px;
  color: rgba(255,255,255,0.48);
}

.profile-joined::before {
  background: rgba(255,255,255,0.4);
}

.profile-bio {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 13.5px;
  color: rgba(255,255,255,0.7);
  line-height: 1.5;
}

/* Кнопки действий (редактировать / назад) */
.profile-back-btn,
.profile-msg-btn {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: rgba(255,255,255,0.9);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.03) 100%),
    rgba(20,22,30,0.6);
  border: 1px solid rgba(255,255,255,0.16);
  border-top: 1px solid rgba(255,255,255,0.28);
  border-radius: 999px;
  padding: 9px 18px;
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  box-shadow: 0 4px 14px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.18);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.profile-back-btn:hover,
.profile-msg-btn:hover {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.32);
  color: #ffffff;
}

/* ── Карточка уровня и опыта ── */
.profile-xp-card {
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%),
    rgba(14,16,22,0.65);
  backdrop-filter: blur(min(36px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(36px, var(--pf-cap, 999px))) saturate(200%);
  border: 1px solid rgba(255,255,255,0.13);
  border-top: 1px solid rgba(255,255,255,0.26);
  box-shadow: 0 14px 36px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.16);
  padding: 20px 24px;
}

.profile-xp-card::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
}

.pxp-lvl-tag {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  border-top: 1px solid rgba(255,255,255,0.32);
  padding: 5px 14px;
}

.pxp-rank-tag {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  padding: 5px 14px;
}

.pxp-rank-tag:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.3);
  color: #ffffff;
}

.pxp-total-xp {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
}

.pxp-total-xp b {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-size: 15px;
  font-weight: 800;
}

.pxp-hist-btn {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 6px 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  border-top: 1px solid rgba(255,255,255,0.26);
}

.pxp-hist-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
}

.profile-xp-bar-wrap {
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
}

.profile-xp-bar-fill {
  border-radius: 999px;
  background: linear-gradient(90deg, #ffffff 0%, rgba(255,255,255,0.65) 100%);
  box-shadow: 0 0 12px rgba(255,255,255,0.4);
}

.profile-xp-footer {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 11px;
  color: rgba(255,255,255,0.45);
}

/* ── Главные KPI карточки профиля ── */
.profile-hero-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.profile-hero-card {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%),
    rgba(14,16,22,0.65);
  border: 1px solid rgba(255,255,255,0.13);
  border-top: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(200%);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.18);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.profile-hero-card::before {
  display: none !important;
}

.profile-hero-card:hover {
  border-color: rgba(255,255,255,0.28);
  box-shadow: 0 16px 40px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.24);
}

.profile-hero-num {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.15;
  color: #ffffff;
  background: linear-gradient(180deg, #ffffff 0%, rgba(255,255,255,0.82) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.profile-hero-label {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Плашка «Любимый жанр» */
.profile-top-genre {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-top: 1px solid rgba(255,255,255,0.24);
  color: rgba(255,255,255,0.65);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 12px;
  font-weight: 500;
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  box-shadow: 0 4px 12px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.14);
  margin-bottom: 22px;
}

.profile-top-genre b {
  color: #ffffff;
  font-weight: 700;
}

/* ── Вкладки списков профиля ── */
.profile-lists-tabs {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 4px;
  backdrop-filter: blur(min(20px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(20px, var(--pf-cap, 999px)));
  gap: 3px;
  margin-bottom: 22px;
}

.profile-list-tab {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  padding: 8px 14px;
  border-radius: 10px;
  color: rgba(255,255,255,0.65);
}

.profile-list-tab:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.08);
}

.profile-list-tab.active {
  background: rgba(255,255,255,0.16);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
}

.profile-list-tab.active:hover {
  background: rgba(255,255,255,0.2);
}

.profile-list-tab-count {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255,255,255,0.1);
  padding: 2px 7px;
  border-radius: 999px;
  color: rgba(255,255,255,0.8);
}

.profile-list-tab.active .profile-list-tab-count {
  background: rgba(255,255,255,0.22);
  color: #ffffff;
}

/* ── Мобильная адаптация профиля ── */
@media (max-width: 640px) {
  .profile-header {
    padding: 18px 16px;
    border-radius: 18px;
    gap: 14px;
  }
  .profile-nickname {
    font-size: 20px;
  }
  .profile-hero-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .profile-hero-card {
    padding: 16px 10px;
    border-radius: 16px;
  }
  .profile-hero-num {
    font-size: 22px;
  }
  .profile-xp-card {
    padding: 16px 16px;
    border-radius: 18px;
  }
}


/* =========================================================
   FRIENDS SECTION — Apple iOS 17 / Liquid Glass Redesign
   ========================================================= */

/* ── Заголовок ── */
#friendsSection .list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

#friendsSection .list-header::after {
  display: none !important;
}

#friendsSection .list-page-title {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Rajdhani', sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.4px;
  text-transform: none;
  background: linear-gradient(180deg, #ffffff 0%, rgba(255,255,255,0.76) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

#friendsSection .list-subtitle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-top: 1px solid rgba(255,255,255,0.24);
  color: rgba(255,255,255,0.72);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Rajdhani', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(16px, var(--pf-cap, 999px)));
  box-shadow: 0 4px 12px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.15);
  margin: 0;
  margin-top: 6px;
}

/* ── Саб-табы «Люди / Мои друзья» ── */
.friends-subtabs {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 4px;
  backdrop-filter: blur(min(20px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(20px, var(--pf-cap, 999px)));
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  width: fit-content;
}

.friends-subtab {
  border: none !important;
  border-radius: 10px;
  padding: 8px 18px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  color: rgba(255,255,255,0.65);
  margin-bottom: 0;
  transition: background 0.2s, color 0.2s;
}

.friends-subtab:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.08);
}

.friends-subtab.active {
  background: rgba(255,255,255,0.16);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
}

.friends-subtab-badge {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255,255,255,0.2);
  color: #ffffff;
  padding: 2px 7px;
  border-radius: 999px;
}

/* ── Строка поиска друзей ── */
.friends-search-row {
  max-width: 440px;
  margin-bottom: 26px;
}

.friends-search-input {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%),
    rgba(14,16,22,0.65);
  border: 1px solid rgba(255,255,255,0.13);
  border-top: 1px solid rgba(255,255,255,0.24);
  border-radius: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 14px;
  color: #ffffff;
  padding: 12px 16px 12px 42px;
  backdrop-filter: blur(min(20px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(20px, var(--pf-cap, 999px)));
  box-shadow: 0 4px 14px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.12);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.friends-search-input:focus {
  border-color: rgba(255,255,255,0.32);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.1);
}

.friends-search-input::placeholder {
  color: rgba(255,255,255,0.4);
}

.friends-search-icon {
  color: rgba(255,255,255,0.45);
}

/* Заголовок блока людей */
#friendsBrowseTitle,
.stats-section-title {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255,255,255,0.48);
}

/* ── Сетка и карточки людей ── */
.friend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 16px;
}

.friend-card {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%),
    rgba(14,16,22,0.65);
  border: 1px solid rgba(255,255,255,0.13);
  border-top: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px;
  padding: 22px 14px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(200%);
  box-shadow: 0 12px 30px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.16);
  transition: transform 0.2s cubic-bezier(0.2,0.8,0.2,1), border-color 0.2s, box-shadow 0.2s;
}

.friend-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  pointer-events: none;
}

.friend-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,0.28);
  box-shadow: 0 16px 36px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.22);
}

/* Аватар */
.friend-card-avatar-wrap {
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.friend-card-avatar {
  width: 60px;
  height: 60px;
  border: 2px solid rgba(255,255,255,0.25);
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-weight: 800;
  font-size: 21px;
}

/* Тексты карточки */
.friend-card-nickname {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.2px;
  text-shadow: none;
  line-height: 1.25;
}

.friend-card-joined {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-top: 3px;
}

.friend-card-you-badge {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.24);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  backdrop-filter: blur(min(10px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(10px, var(--pf-cap, 999px)));
  border-radius: 999px;
  padding: 2px 8px;
}

/* Кнопки действий на карточке */
.friend-action-btn {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1px;
  border-radius: 12px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,0.14);
  border-top: 1px solid rgba(255,255,255,0.24);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
  backdrop-filter: blur(min(12px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(12px, var(--pf-cap, 999px)));
  box-shadow: 0 2px 8px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.14);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.friend-action-btn:hover {
  transform: none;
}

.friend-action-btn--add {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.22);
  border-top-color: rgba(255,255,255,0.35);
  color: #ffffff;
}

.friend-action-btn--add:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.38);
  color: #ffffff;
}

.friend-action-btn--friends {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
}

.friend-action-btn--pending {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
}

/* Мобильная адаптация */
@media (max-width: 768px) {
  .friend-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .friend-card {
    flex-direction: row;
    align-items: center;
    text-align: left;
    padding: 12px 14px;
    border-radius: 16px;
    gap: 12px;
  }
  .friend-card-avatar {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }
  .friend-card-action {
    width: auto;
    flex-shrink: 0;
    margin-top: 0;
  }
  .friend-action-btn {
    width: auto;
    padding: 7px 14px;
  }
}


/* =========================================================
   SETTINGS SECTION — Apple iOS 17 / Liquid Glass Redesign
   ========================================================= */

/* ── Контейнер настроек ── */
#settingsSection .settings-page,
.settings-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 10px 16px 60px;
}

/* ── Верхний бар с кнопкой назад и заголовком ── */
.settings-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0 28px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 24px;
}

.settings-back {
  width: auto;
  height: auto;
  padding: 6px 10px 6px 0;
  flex-shrink: 0;
  border-radius: 0;
  background: none;
  border: none;
  border-top: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  transition: color 0.15s, opacity 0.15s;
}

.settings-back:hover {
  background: none;
  border: none;
  border-color: transparent;
  color: #ffffff;
  transform: none;
}

.settings-back:active {
  transform: none;
  opacity: 0.7;
}

.settings-back svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.4;
}

.settings-topbar h1 {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Rajdhani', sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: #ffffff;
  background: linear-gradient(180deg, #ffffff 0%, rgba(255,255,255,0.8) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

/* ── Заголовки секций (iOS Grouped Header) ── */
.settings-group-label {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255,255,255,0.45);
  padding: 0 16px 8px;
  margin-top: 26px;
}

.settings-group-label:first-of-type,
.settings-group-label:first-child {
  margin-top: 4px;
}

/* ── Строки настроек (iOS Grouped List) ── */
.settings-row {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%),
    rgba(14,16,22,0.65);
  backdrop-filter: blur(min(36px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(36px, var(--pf-cap, 999px))) saturate(200%);
  border-left: 1px solid rgba(255,255,255,0.13);
  border-right: 1px solid rgba(255,255,255,0.13);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  border-top: none;
  padding: 14px 18px;
  gap: 14px;
  transition: background 0.15s, opacity 0.15s;
  box-shadow: none;
}

.settings-row:hover {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.04) 100%),
    rgba(14,16,22,0.65);
  border-color: rgba(255,255,255,0.2);
  box-shadow: none;
  opacity: 1;
}

.settings-row:active {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.06) 100%),
    rgba(14,16,22,0.65);
  box-shadow: none;
  opacity: 1;
}

/* Первая строка группы — верхнее скругление и верхний блик */
.settings-group-label + .settings-row,
#settingsRowPerfScroll {
  border-top: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px 20px 0 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
}

/* Последняя строка группы — нижнее скругление */
.settings-row[onclick*="'poster'"],
#settingsRowCompact,
#settingsRowNotifPreview,
#settingsRowChangePassword,
#settingsRowImportExport,
#settingsRowPerfFps {
  border-radius: 0 0 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.13);
  margin-bottom: 12px;
}

/* Единственная строка в группе */
#settingsRowImportExport {
  border-radius: 20px;
  border-top: 1px solid rgba(255,255,255,0.25);
  border-bottom: 1px solid rgba(255,255,255,0.13);
}

/* ── Иконка строки ── */
.settings-row-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0.03) 100%),
    rgba(25,27,36,0.6);
  border: 1px solid rgba(255,255,255,0.18);
  border-top: 1px solid rgba(255,255,255,0.3);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
  backdrop-filter: blur(min(12px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(12px, var(--pf-cap, 999px)));
}

.settings-row-icon svg {
  width: 18px;
  height: 18px;
}

/* ── Тексты ── */
.settings-row-title {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.2px;
  background: transparent;
}

.settings-row-desc {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 12px;
  color: rgba(255,255,255,0.48);
  margin-top: 2px;
}

.settings-row-value {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.48);
}

.settings-row-chevron {
  color: rgba(255,255,255,0.3);
}

/* ── iOS Toggle Switch ── */
.settings-switch {
  position: relative !important;
  display: inline-block !important;
  flex-shrink: 0 !important;
  width: 50px !important;
  height: 30px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.16) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35) !important;
  cursor: pointer !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  transition: background 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.25s, box-shadow 0.25s !important;
}

.settings-switch::after {
  content: '' !important;
  position: absolute !important;
  top: 2px !important;
  left: 2px !important;
  width: 24px !important;
  height: 24px !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.2) !important;
  transition: transform 0.25s cubic-bezier(0.2, 0.85, 0.32, 1.2), background 0.2s !important;
}

.settings-switch.on {
  background: #34c759 !important;
  border-color: #34c759 !important;
  box-shadow: 0 0 14px rgba(52, 199, 89, 0.35) !important;
}

.settings-switch.on::after {
  transform: translateX(20px) !important;
  background: #ffffff !important;
}

.settings-switch:focus-visible {
  outline: 2px solid #34c759 !important;
  outline-offset: 2px !important;
}

/* ── Подстраницы настроек (Фон, Темы и т.д.) ── */
.settings-page-section {
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%),
    rgba(14,16,22,0.65);
  backdrop-filter: blur(min(36px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(36px, var(--pf-cap, 999px))) saturate(200%);
  border: 1px solid rgba(255,255,255,0.13);
  border-top: 1px solid rgba(255,255,255,0.26);
  box-shadow: 0 14px 36px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.16);
  padding: 24px 26px;
  margin-bottom: 24px;
}

.settings-page-desc {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 13.5px;
  color: rgba(255,255,255,0.65);
  line-height: 1.55;
}

.settings-page-reset {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 999px;
  padding: 9px 18px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  border-top: 1px solid rgba(255,255,255,0.26);
  color: rgba(255,255,255,0.85);
  backdrop-filter: blur(min(14px, var(--pf-cap, 999px)));
  -webkit-backdrop-filter: blur(min(14px, var(--pf-cap, 999px)));
  box-shadow: 0 4px 12px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.15);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.settings-page-reset:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
  color: #ffffff;
}

/* ── Мобильная адаптация ── */
@media (max-width: 600px) {
  .settings-topbar {
    gap: 12px;
    padding-bottom: 20px;
    margin-bottom: 18px;
  }
  .settings-topbar h1 {
    font-size: 22px;
  }
  .settings-back {
    width: auto;
    height: auto;
  }
  .settings-row {
    padding: 12px 14px;
    gap: 12px;
  }
  .settings-row-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }
  .settings-row-title {
    font-size: 14px;
  }
}








body::before { left: 0; border-left: none; }
body::after { right: 0; border-right: none; }

/* Prevent horizontal scroll from side panels if scrollbar takes space */
body { overflow-x: hidden; }


/* ===== MOBILE DETAIL WIDGET - UPGRADED LOOK ===== */
@media (max-width: 768px) {
  /* The main card frame */
  .detail-widget-frame {
    background:
      linear-gradient(160deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.01) 60%),
      rgba(10, 11, 18, 0.82) !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
    border-top: 1px solid rgba(255,255,255,0.22) !important;
    border-radius: 24px !important;
    backdrop-filter: blur(min(40px, var(--pf-cap, 999px))) saturate(180%) !important;
    -webkit-backdrop-filter: blur(min(40px, var(--pf-cap, 999px))) saturate(180%) !important;
    box-shadow:
      0 20px 60px rgba(0,0,0,0.6),
      0 4px 16px rgba(0,0,0,0.4),
      inset 0 1px 0 rgba(255,255,255,0.14) !important;
    overflow: hidden;
    position: relative;
  }

  /* Glowing top accent line */
  .detail-widget-frame::before {
    content: '';
    position: absolute;
    top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    pointer-events: none;
    border-radius: 999px;
  }

  /* Poster column on mobile: horizontal layout */
  .detail-poster-col {
    --detail-poster-w: clamp(150px, 42vw, 190px);
    display: grid;
    grid-template-columns: var(--detail-poster-w) minmax(0, 1fr) !important;
    column-gap: 14px !important;
    row-gap: 0 !important;
    align-items: start;
  }

  /* Poster shadow/glow upgrade */
  .poster-glow-wrap {
    width: var(--detail-poster-w) !important;
    max-width: none !important;
    grid-column: 1;
    grid-row: 1;
    border-radius: 16px;
    box-shadow:
      0 12px 40px rgba(0,0,0,0.7),
      0 4px 16px rgba(0,0,0,0.5);
  }

  .detail-poster {
    border-radius: 14px;
    width: 100%;
    object-fit: cover;
    display: block;
  }

  /* Mobile info panel (status + score + rows) */
  .mobile-detail-info {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 4px;
    min-width: 0;
  }

  /* Top line: status badge + score */
  .mobile-detail-info .mdi-top-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  /* Status badge upgrade */
  .mobile-detail-info .mdi-status {
    display: inline-block;
    font-size: 9px !important;
    font-weight: 800 !important;
    letter-spacing: 0.8px !important;
    text-transform: uppercase;
    padding: 4px 10px !important;
    border-radius: 999px !important;
    backdrop-filter: blur(min(12px, var(--pf-cap, 999px)));
    -webkit-backdrop-filter: blur(min(12px, var(--pf-cap, 999px)));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 2px 8px rgba(0,0,0,0.3);
  }
  .mobile-detail-info .mdi-status.is-airing {
    background: rgba(100, 220, 150, 0.12) !important;
    color: var(--green) !important;
    border: 1px solid rgba(100,220,150,0.35) !important;
  }
  .mobile-detail-info .mdi-status.is-announce {
    background: rgba(100,160,255,0.12) !important;
    color: #7eb8ff !important;
    border: 1px solid rgba(100,160,255,0.3) !important;
  }
  .mobile-detail-info .mdi-status.is-done {
    background: rgba(180,180,190,0.1) !important;
    color: #aaa !important;
    border: 1px solid rgba(180,180,190,0.25) !important;
  }

  /* Score - bigger, bolder */
  .mobile-detail-info .mdi-score {
    font-size: 26px !important;
    font-weight: 900 !important;
    color: var(--text) !important;
    letter-spacing: -1px;
    line-height: 1;
  }
  .mobile-detail-info .mdi-score span {
    font-size: 11px !important;
    color: var(--text-dim) !important;
    font-weight: 600;
  }

  /* Meta rows */
  .mobile-detail-info .mdi-rows {
    display: flex;
    flex-direction: column;
    gap: 4px !important;
    margin-top: 4px !important;
  }

  .mobile-detail-info .mdi-row-line {
    font-size: 12.5px !important;
    color: rgba(255,255,255,0.55) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile-detail-info .mdi-row-line b {
    color: rgba(255,255,255,0.88) !important;
    font-weight: 700;
  }
  .mobile-detail-info .mdi-row-line .mdi-sep {
    color: rgba(255,255,255,0.2) !important;
    margin: 0 5px;
  }

  /* Countdown timer - more compact and sleek */
  #detail-countdown {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 14px !important;
    width: 100%;
    box-sizing: border-box;
    background:
      linear-gradient(135deg, rgba(100,220,150,0.06) 0%, rgba(10,11,18,0.4) 100%) !important;
    border: 1px solid rgba(100,220,150,0.2) !important;
    border-left: 3px solid var(--green) !important;
    border-radius: 14px !important;
    backdrop-filter: blur(min(12px, var(--pf-cap, 999px))) !important;
    -webkit-backdrop-filter: blur(min(12px, var(--pf-cap, 999px))) !important;
    padding: 10px 14px !important;
  }

  .countdown-label {
    font-size: 9.5px;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    font-weight: 700;
  }

  .countdown-timer {
    font-size: 15px !important;
    font-weight: 800;
    color: var(--text);
    margin-top: 1px;
  }
}

/* === Mobile detail info panel - fill height nicely === */
@media (max-width: 768px) {
  /* Stretch info to full height of the grid cell (poster height) */
  .mobile-detail-info {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    height: auto !important;
    min-height: 170px;
    gap: 8px !important;
    padding-top: 0 !important;
  }

  /* Top block: status + score */
  .mdi-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
  }

  /* Score bigger */
  .mobile-detail-info .mdi-score {
    font-size: 28px !important;
    font-weight: 900 !important;
    letter-spacing: -1.5px;
    line-height: 1;
    display: block;
    margin-top: 2px;
  }
  .mobile-detail-info .mdi-score span {
    font-size: 12px !important;
    color: rgba(255,255,255,0.4) !important;
    font-weight: 500;
    margin-left: 1px;
  }

  /* Thin divider line */
  .mdi-divider {
    flex: 1;
    min-height: 12px;
    max-height: 28px;
    display: flex;
    align-items: center;
  }
  .mdi-divider::after {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0.15), rgba(255,255,255,0.04));
    border-radius: 99px;
  }

  /* Bottom rows */
  .mdi-rows {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 5px !important;
    margin-top: 0 !important;
  }

  .mobile-detail-info .mdi-row-line {
    font-size: 12.5px !important;
    color: rgba(255,255,255,0.5) !important;
    line-height: 1.4;
    white-space: normal !important;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .mobile-detail-info .mdi-row-line b {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 700;
  }

  /* Views row — smaller, muted */
  .mobile-detail-info .mdi-views {
    font-size: 11.5px !important;
    color: rgba(255,255,255,0.35) !important;
  }

  /* Status pill */
  .mobile-detail-info .mdi-status {
    display: inline-block;
    font-size: 9px !important;
    font-weight: 800 !important;
    letter-spacing: 1px !important;
    text-transform: uppercase;
    padding: 4px 12px !important;
    border-radius: 999px !important;
    align-self: flex-start;
  }

  /* Make the poster-col grid keep height consistent */
  .detail-poster-col {
    align-items: stretch !important;
  }

  /* Poster fills its cell height */
  .poster-glow-wrap {
    align-self: stretch !important;
    display: flex;
    flex-direction: column;
  }

  .detail-poster-flip {
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .detail-poster-face-front {
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .detail-poster {
    flex: 1;
    object-fit: cover;
    min-height: 0;
    width: 100%;
    border-radius: 14px;
  }
}

.detail-alt-titles {
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 8px;
  line-height: 1.4;
}

.alt-title-sep {
  color: rgba(255,255,255,0.15);
  margin: 0 4px;
}

/* === NEW MOBILE PILLS DESIGN === */
@media (max-width: 768px) {
  .mdi-divider {
    display: none !important;
  }
  
  .mdi-info-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
  }

  .mdi-pills-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
    margin-bottom: 2px;
  }

  .mdi-pill {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 6px;
    padding: 3px 6px;
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
  
  .mdi-pill b {
    color: rgba(255,255,255,0.9);
    font-weight: 700;
  }
  
  .mdi-pill-age {
    background: rgba(255, 200, 60, 0.1);
    color: #ffc83c;
    border-color: rgba(255, 200, 60, 0.2);
    font-weight: 700;
  }
  
  .mobile-detail-info .mdi-primary-meta {
    font-size: 12.5px !important;
    color: rgba(255,255,255,0.8) !important;
    font-weight: 500;
  }
}

@media (min-width: 769px) {
  .mobile-detail-info {
    display: none !important;
  }
}


/* === GLASS CAPSULE FOR STATUS === */
.mobile-detail-info .mdi-status,
.dpb-status {
  background: rgba(255, 255, 255, 0.12) !important;
  backdrop-filter: blur(min(12px, var(--pf-cap, 999px))) saturate(180%);
  -webkit-backdrop-filter: blur(min(12px, var(--pf-cap, 999px))) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  color: #fff !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.15) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  border-radius: 999px !important;
  font-weight: 800 !important;
  letter-spacing: 1px !important;
}


/* === FIX POSTER BACK OVERFLOW SQUISH === */
.dpb-score-block {
  flex-shrink: 0 !important;
}

.dpb-top {
  flex-shrink: 0 !important;
}

.dpb-rows {
  overflow-y: auto;
  flex: 1;
  scrollbar-width: none; /* Firefox */
  padding-right: 4px; /* Give text breathing room from edge */
}
.dpb-rows::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* Reduce gap slightly so it fits better without scrolling when possible */
.detail-poster-face-back {
  gap: 10px !important;
}
.dpb-rows {
  gap: 7px !important;
}
.dpb-row-label {
  font-size: 9.5px !important;
}
.dpb-row-val {
  font-size: 11px !important;
}

/* ====================================================
   NekoNest — Модальное окно библиотеки и магазина рамок
   ==================================================== */
#frameLibraryModal.modal-overlay {
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#frameLibraryModal .modal-box,
.modal-box.frame-shop-modal {
  width: min(1040px, 95vw) !important;
  max-width: 1040px !important;
  min-width: 0 !important;
  height: min(780px, calc(100vh - 50px)) !important;
  max-height: calc(100vh - 50px) !important;
  padding: 0 !important;
  margin: auto !important;
  background: #131313 !important;
  border: none !important;
  border-left: 3px solid rgba(255, 255, 255, 0.7) !important;
  border-radius: 14px !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  position: relative !important;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8), 0 0 1px 1px rgba(255, 255, 255, 0.08) !important;
}

#frameLibraryModal .modal-header {
  padding: 16px 22px;
  margin: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: #131313;
}

#frameLibraryModal .modal-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #f0f0f0;
  font-family: 'Rajdhani', sans-serif;
  margin: 0;
}

#frameLibraryModal .modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted, #888);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}

#frameLibraryModal .modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.frame-shop-back-btn {
  display: none;
}

.frame-shop-body {
  display: grid;
  grid-template-columns: 310px 1fr;
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.frame-shop-side {
  padding: 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  min-height: 0;
  background: #101010;
}

.frame-shop-glass {
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)), rgba(14, 16, 22, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
}

.frame-shop-stage {
  padding: 36px 0 34px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 170px;
  overflow: visible;
}

.frame-shop-glass-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  position: relative;
  z-index: 2;
}

.frame-shop-nick {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #f0f0f0;
  margin-top: 10px;
  word-break: break-all;
}

.frame-shop-tags {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 6px;
  flex-wrap: wrap;
}

.frame-shop-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

.frame-shop-tag--lv {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.frame-shop-state {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted, #8a8a8a);
  min-height: 18px;
}
.frame-shop-state b {
  color: #f0f0f0;
}

.frame-shop-ctx {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
}

.frame-shop-ctx figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-top: 16px;
  font-size: 10.5px;
  color: var(--text-muted, #8a8a8a);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 600;
  margin: 0;
}

.frame-shop-bal {
  border-radius: 14px;
  background: #141414;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 14px;
}

.frame-shop-bal small {
  display: block;
  color: var(--text-muted, #8a8a8a);
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-weight: 600;
}

.frame-shop-bal b {
  font-family: 'Orbitron', monospace;
  font-size: 22px;
  font-weight: 700;
  display: block;
  margin: 3px 0 2px;
  color: #f0f0f0;
  font-variant-numeric: tabular-nums;
}

.frame-shop-bal b i {
  font-style: normal;
  font-size: 12px;
  color: var(--text-muted, #8a8a8a);
  margin-left: 4px;
}

.frame-shop-bar {
  height: 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin: 8px 0 6px;
}

.frame-shop-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #888, #fff);
  border-radius: 5px;
  transition: width 0.4s ease;
}

.frame-shop-bal p {
  font-size: 11.5px;
  color: var(--text-muted, #8a8a8a);
  line-height: 1.35;
  margin: 0;
}

.frame-shop-btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.4px;
  background: rgba(232, 232, 232, 0.05);
  border: 1px solid rgba(232, 232, 232, 0.16);
  color: #f0f0f0;
  width: 100%;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s, transform 0.15s;
  font-family: 'Rajdhani', sans-serif;
  margin-top: 10px;
}

.frame-shop-btn:hover:not(:disabled) {
  color: #fff;
  background: rgba(232, 232, 232, 0.12);
  border-color: rgba(232, 232, 232, 0.4);
  transform: translateY(-1px);
}

.frame-shop-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
}

.frame-shop-btn--pri {
  background: #e8e8e8;
  color: #0e0e0e !important;
  border-color: transparent;
}

.frame-shop-btn--pri:hover:not(:disabled) {
  background: #ffffff;
  color: #0e0e0e !important;
}

.frame-shop-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  background: #131313;
}

.frame-shop-tabs {
  display: flex;
  gap: 6px;
  padding: 14px 20px 10px;
  overflow-x: auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.frame-shop-tab {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: 8px;
  color: rgba(168, 168, 168, 0.75);
  display: inline-flex;
  gap: 7px;
  align-items: center;
  white-space: nowrap;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Rajdhani', sans-serif;
  transition: background 0.2s, color 0.2s;
}

.frame-shop-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.frame-shop-tab.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 800;
  box-shadow: inset 0 -2px 0 #fff;
}

.frame-shop-tab em {
  font-style: normal;
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  opacity: 0.75;
}

.frame-shop-scroll {
  overflow-y: auto;
  flex: 1;
  padding: 4px 20px 28px;
}

.frame-shop-grp {
  margin-top: 18px;
}
.frame-shop-grp:first-child {
  margin-top: 12px;
}

.frame-shop-grp h3 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  color: #f0f0f0;
  margin-bottom: 10px;
}

.frame-shop-grp h3 em {
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.2px;
  text-transform: none;
  color: var(--text-muted, #8a8a8a);
  font-size: 12.5px;
}

.frame-shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.frame-shop-card {
  background: #181818;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  cursor: pointer;
  overflow: visible;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}

.frame-shop-card:hover {
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateY(-2px);
  background: #1e1e1e;
}

.frame-shop-card.sel {
  border-color: rgba(255, 255, 255, 0.6);
  background: #202020;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.1);
}

.frame-shop-card.lock .nf-av {
  filter: grayscale(0.9) brightness(0.65);
}

.frame-shop-card .nf-av {
  margin: 22px 0 24px;
}

.frame-shop-card-name,
.frame-shop-card .nm {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #f0f0f0;
  margin-bottom: 4px;
  position: relative;
  z-index: 2;
}

.frame-shop-card-desc,
.frame-shop-card .ds {
  font-size: 12px;
  color: var(--text-muted, #8a8a8a);
  line-height: 1.3;
  margin-bottom: 12px;
  flex: 1;
}

.frame-shop-card .frame-shop-btn {
  width: 100%;
  margin-top: auto;
}

.frame-shop-chip,
.frame-shop-card .chip {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f0f0f0;
}

.frame-shop-chip.frame-shop-chip--lk,
.frame-shop-chip.lk {
  background: transparent;
  color: var(--text-dim, #666);
  border-color: rgba(255, 255, 255, 0.08);
}

.frame-shop-chip.on {
  background: rgba(232, 232, 232, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.frame-shop-card .xp,
.frame-shop-card .frame-shop-xp {
  font-family: 'Orbitron', monospace;
  font-size: 11.5px;
}

.frame-shop-empty {
  color: var(--text-muted, #8a8a8a);
  margin-top: 14px;
  font-size: 13.5px;
}

.frame-shop-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #0f0f0f;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 14px 20px;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  transform: translateY(115%);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 10;
}

.frame-shop-sheet.open {
  transform: none;
}

.frame-shop-sheet p {
  margin: 0;
  font-size: 14px;
  color: #f0f0f0;
  font-weight: 600;
}

.frame-shop-sheet p small {
  display: block;
  color: var(--text-muted, #8a8a8a);
  font-size: 12.5px;
  margin-top: 2px;
  font-weight: 400;
}

.frame-shop-sheet div {
  display: flex;
  gap: 8px;
}

.frame-shop-sheet .frame-shop-btn {
  width: auto;
  min-width: 100px;
  margin-top: 0;
}

/* Кнопка открытия библиотеки в профиле */
.profile-frames-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.3px;
}
.profile-frames-btn svg {
  flex-shrink: 0;
}

/* ====================================================
   Адаптивность под мобильные телефоны (<768px и <500px)
   Полноэкранная отдельная страница для библиотеки рамок
   ==================================================== */
@media (max-width: 768px) {
  #frameLibraryModal.modal-overlay:not(.hidden) {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    width: 100vw !important;
    height: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    padding: 0 !important;
    margin: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    background: #111111 !important;
    z-index: 10000 !important;
    overflow: hidden !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  #frameLibraryModal .modal-box,
  #frameLibraryModal .modal-box.frame-shop-modal,
  .modal-box.frame-shop-modal {
    position: relative !important;
    width: 100% !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    border-top: none !important;
    border-left: none !important;
    box-shadow: none !important;
    background: #111111 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    animation: framePageEnter 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
    touch-action: auto !important;
  }

  #frameLibraryModal .modal-box::before,
  #frameLibraryModal .modal-box.frame-shop-modal::before {
    display: none !important;
    content: none !important;
  }

  #frameLibraryModal .modal-header,
  .frame-shop-header {
    padding: max(12px, env(safe-area-inset-top, 0px)) 14px 12px 14px !important;
    background: #151515 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35) !important;
    min-height: calc(52px + env(safe-area-inset-top, 0px)) !important;
  }

  .frame-shop-back-btn {
    display: none !important;
  }

  #frameLibraryModal .modal-title {
    font-size: 15px !important;
    letter-spacing: 0.5px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex: 1 !important;
    text-align: left !important;
    justify-content: flex-start !important;
    gap: 7px !important;
    margin: 0 !important;
  }

  #frameLibraryModal .modal-close,
  .frame-shop-close-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .frame-shop-body {
    grid-template-columns: 1fr !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
    background: #111111 !important;
  }

  /* Компактный горизонтальный превью-блок на мобилках */
  .frame-shop-side {
    padding: 12px 14px !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    flex-shrink: 0 !important;
    gap: 10px !important;
    overflow-y: visible !important;
    background: #141414 !important;
  }

  .frame-shop-glass {
    display: grid !important;
    grid-template-columns: auto 1fr !important;
    align-items: center !important;
    text-align: left !important;
    gap: 12px !important;
    padding: 10px 12px !important;
    background: #191919 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 12px !important;
  }

  .frame-shop-stage {
    padding: 6px !important;
    min-height: 0 !important;
    grid-column: 1 !important;
    overflow: visible !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .frame-shop-stage .nf-av {
    --s: 66px !important;
    width: 66px !important;
    height: 66px !important;
    margin: 6px 4px !important;
  }

  .frame-shop-glass-info {
    grid-column: 2 !important;
    align-items: flex-start !important;
    padding-left: 2px !important;
    min-width: 0 !important;
  }

  .frame-shop-nick {
    font-size: 15px !important;
    font-weight: 700 !important;
    margin-top: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
  }

  .frame-shop-tags {
    margin-top: 4px !important;
    gap: 4px !important;
    display: flex !important;
    flex-wrap: wrap !important;
  }
  .frame-shop-tag {
    font-size: 10px !important;
    padding: 2px 7px !important;
    border-radius: 6px !important;
  }

  .frame-shop-state {
    margin-top: 4px !important;
    font-size: 11.5px !important;
    min-height: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
  }

  .frame-shop-glass-info .frame-shop-btn {
    height: 28px !important;
    padding: 0 12px !important;
    font-size: 11.5px !important;
    margin-top: 6px !important;
    width: auto !important;
    border-radius: 8px !important;
  }

  .frame-shop-ctx {
    display: none !important;
  }

  .frame-shop-bal {
    padding: 10px 12px !important;
    border-radius: 12px !important;
    background: #191919 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 4px 8px !important;
  }
  .frame-shop-bal small {
    display: inline !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: 0.8px !important;
    text-transform: uppercase !important;
    color: var(--text-muted, #8a8a8a) !important;
  }
  .frame-shop-bal b {
    display: inline !important;
    font-size: 17px !important;
    margin: 0 !important;
    font-family: 'Orbitron', monospace !important;
    font-weight: 700 !important;
  }
  .frame-shop-bar {
    width: 100% !important;
    margin: 4px 0 2px !important;
    height: 4px !important;
  }
  .frame-shop-bal p {
    font-size: 10.5px !important;
    width: 100% !important;
    line-height: 1.35 !important;
    margin: 0 !important;
  }

  /* Каталог на мобилке */
  .frame-shop-main {
    flex: 1 !important;
    min-height: 0 !important;
    overflow: visible !important;
    background: #111111 !important;
  }
  .frame-shop-tabs {
    padding: 8px 12px !important;
    gap: 6px !important;
    position: sticky !important;
    top: 0 !important;
    background: #111111 !important;
    z-index: 5 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35) !important;
  }
  .frame-shop-tabs::-webkit-scrollbar {
    display: none !important;
  }
  .frame-shop-tab {
    padding: 6px 12px !important;
    font-size: 11.5px !important;
    border-radius: 8px !important;
    flex-shrink: 0 !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
  }
  .frame-shop-tab.active {
    background: rgba(255, 255, 255, 0.14) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: #fff !important;
    box-shadow: none !important;
  }
  .frame-shop-scroll {
    padding: 8px 12px calc(48px + env(safe-area-inset-bottom, 0px)) !important;
    overflow-y: visible !important;
  }
  .frame-shop-grp {
    margin-top: 14px !important;
  }
  .frame-shop-grp h3 {
    font-size: 12.5px !important;
    margin-bottom: 8px !important;
  }
  .frame-shop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  .frame-shop-card {
    padding: 10px 8px 10px !important;
    border-radius: 12px !important;
    background: #181818 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    min-width: 0 !important;
  }
  .frame-shop-card .nf-av {
    --s: 54px !important;
    width: 54px !important;
    height: 54px !important;
    margin: 14px 0 16px !important;
  }
  .frame-shop-card-name,
  .frame-shop-card .nm {
    font-size: 13px !important;
    font-weight: 700 !important;
    margin-bottom: 2px !important;
    position: relative !important;
    z-index: 2 !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .frame-shop-card-desc,
  .frame-shop-card .ds {
    font-size: 10.5px !important;
    line-height: 1.25 !important;
    margin-bottom: 8px !important;
    min-height: 26px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }
  .frame-shop-card .frame-shop-btn {
    height: 32px !important;
    font-size: 11px !important;
    padding: 0 6px !important;
    border-radius: 8px !important;
    margin-top: auto !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    width: 100% !important;
  }

  .frame-shop-sheet {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)) 16px !important;
    border-radius: 16px 16px 0 0 !important;
    background: #181818 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.8) !important;
    z-index: 10005 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    align-items: stretch !important;
  }
  .frame-shop-sheet p {
    font-size: 13.5px !important;
    line-height: 1.35 !important;
  }
  .frame-shop-sheet div {
    display: flex !important;
    gap: 10px !important;
    width: 100% !important;
  }
  .frame-shop-sheet .frame-shop-btn {
    flex: 1 !important;
    height: 38px !important;
    font-size: 13px !important;
    border-radius: 10px !important;
    margin-top: 0 !important;
  }
}

@keyframes framePageEnter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ====================================================
   Аватар-рамки: отображение украшений и анимаций на всех размерах
   ==================================================== */
.nf-av .nf-o,
.nf-av .nf-g,
.nf-av::after {
  display: block;
}

.nf-xs .nf-o,
.nf-xs .nf-g,
.nf-xs::after {
  display: block !important;
}

/* Контекстные превью в модалке рамок: центрирование и видимость украшений */
.frame-shop-ctx figure .nf-av {
  overflow: visible !important;
}

/* Предотвращение обрезки рамок в кнопке аккаунта, шапке профиля и чатах */
.nav-tab.nav-account-btn,
.nav-account-btn,
#tabAccount,
.nav-account-avatar,
.nav-account-avatar--img:has(.nf-av),
.chat-convo-avatar:has(.nf-av),
.chat-thread-avatar:has(.nf-av),
.chat-msg-avatar:has(.nf-av),
.profile-avatar-wrap:has(.nf-av) {
  overflow: visible !important;
}

.profile-avatar-wrap:has(.nf-av) {
  padding: 0 !important;
  background: none !important;
  box-shadow: none !important;
}




/* ===== DYNAMIC / PARALLAX APP BACKGROUND ===== */
.app-dynamic-bg {
  position: fixed;
  inset: -30px;
  z-index: -1;
  pointer-events: none;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  background-color: #020b0e;
  transition: opacity var(--t-med);
}

/* На мобильных устройствах, тач-экранах или узких экранах (<=768px):
   фон ВСЕГДА полностью статичен, без смещений, без inset: -30px */
@media (max-width: 768px), (hover: none), (pointer: coarse) {
  .app-dynamic-bg {
    inset: 0 !important;
    transform: none !important;
    will-change: auto !important;
  }
  .bg-pc-only-row {
    display: none !important;
  }
}

/* Если пользователь выключил "Динамичный фон" в настройках */
html.settings-no-dynamic-bg .app-dynamic-bg {
  inset: 0 !important;
  transform: none !important;
  will-change: auto !important;
}


/* ── «Очистить выбранные» — стеклянная пилюля, как «Сбросить фон»,
   только с красным акцентом (разрушительное действие). ── */
#importExportSection .modal-actions--center { justify-content: center; }
#importExportSection .clear-glass-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 32px;
  width: 100%;
  max-width: 520px;
  background: rgba(255, 90, 90, 0.10);
  border: 1px solid rgba(255, 120, 120, 0.28);
  border-radius: 30px;
  color: #ff8f8f;
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(200%);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: background var(--t-med), border-color var(--t-med), color var(--t-med), opacity var(--t-med);
}
#importExportSection .clear-glass-btn svg { width: 16px; height: 16px; }
#importExportSection .clear-glass-btn:hover {
  background: rgba(255, 90, 90, 0.18);
  border-color: rgba(255, 130, 130, 0.45);
  color: #ffb0b0;
}
#importExportSection .clear-glass-btn:active { opacity: 0.85; }
#importExportSection .clear-glass-btn.cleared {
  background: rgba(255, 90, 90, 0.24);
  border-color: rgba(255, 130, 130, 0.5);
  color: #ffb0b0;
}

/* ── Автоскрытие верхней панели при скролле вниз (только ПК, только
   верхняя панель — не боковая). Управляется js/header-autohide.js. ── */
@media (min-width: 769px) {
  html:not(.header-dock-left):not(.header-dock-right) .site-header {
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
    will-change: transform;
  }
  html.header-autohide:not(.header-dock-left):not(.header-dock-right) .site-header {
    transform: translateY(-100%);
    box-shadow: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  html:not(.header-dock-left):not(.header-dock-right) .site-header { transition: none; }
}

/* ── Телефон: пункты «Динамичный фон» и «Скрывать верхнюю панель» —
   только для ПК, на узком экране скрыты. «Язык интерфейса» (первая
   строка) и «Компактный режим» (последняя) остаются одной общей
   карточкой, как «Внешний вид» — скругления берутся из базовых правил
   (первая строка — сверху, последняя — снизу). ── */
@media (max-width: 768px) {
  #settingsRowDynamicBg,
  #settingsRowAutoHideHeader { display: none !important; }
}

/* ==========================================================
   GLASS DROPDOWNS: "Мои списки" и меню аккаунта
   Тот же рецепт стекла, что у верхней панели навигации
   (.site-header: rgba(14,14,18,.75) + blur(28px) saturate(190%)).

   ВАЖНО: backdrop-filter у родителя делает его "backdrop root", и
   blur у вложенного меню перестаёт видеть страницу под ним (меню
   выходит за пределы шапки). Поэтому стекло шапки вынесено в
   ::before — сама шапка больше не backdrop root, а выпадающие меню
   (потомки шапки) размывают реальный фон страницы.
   ========================================================== */
.site-header {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: rgba(14, 14, 18, 0.75);
  -webkit-backdrop-filter: blur(min(28px, var(--pf-cap, 999px))) saturate(190%);
  backdrop-filter: blur(min(28px, var(--pf-cap, 999px))) saturate(190%);
}

/* Верхняя (не docked) панель: плавающие меню-стекло */
html:not(.header-dock-left):not(.header-dock-right) #navListsDropdown #navListsMenu,
html:not(.header-dock-left):not(.header-dock-right) #navAccountDropdown #navAccountMenu {
  background: rgba(14, 14, 18, 0.75);
  -webkit-backdrop-filter: blur(min(28px, var(--pf-cap, 999px))) saturate(190%);
  backdrop-filter: blur(min(28px, var(--pf-cap, 999px))) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
html:not(.header-dock-left):not(.header-dock-right) #navListsDropdown #navListsMenu .nav-dropdown-menu-inner,
html:not(.header-dock-left):not(.header-dock-right) #navAccountDropdown #navAccountMenu .nav-dropdown-menu-inner {
  background: transparent;
  border-left: 2px solid transparent;
}

/* Docked (боковая) панель: раскрытый аккордеон — прозрачное стекло
   вместо сплошного #000 */
html.header-dock-left #navListsDropdown.is-open #navListsMenu .nav-dropdown-menu-inner,
html.header-dock-right #navListsDropdown.is-open #navListsMenu .nav-dropdown-menu-inner,
html.header-dock-left #navAccountDropdown.is-open #navAccountMenu .nav-dropdown-menu-inner,
html.header-dock-right #navAccountDropdown.is-open #navAccountMenu .nav-dropdown-menu-inner {
  background: rgba(255, 255, 255, 0.05) !important;
  border: none !important;
  border-left: none !important;
  box-shadow: none !important;
}

/* ==========================================================
   GLASS: окно уведомлений (#notifDropdown) — тот же рецепт, что у
   верхней панели и меню «Мои списки»/аккаунта выше. Только десктоп:
   на мобильном (<=768px) это bottom-sheet со своим затемнением.
   Окно вынесено в <body> (см. _ensureDropdown в js/notifications.js),
   поэтому blur видит реальный фон страницы.
   ========================================================== */
@media (min-width: 769px) {
  .notif-dropdown {
    background: rgba(14, 14, 18, 0.75);
    -webkit-backdrop-filter: blur(min(28px, var(--pf-cap, 999px))) saturate(190%);
    backdrop-filter: blur(min(28px, var(--pf-cap, 999px))) saturate(190%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow:
      0 16px 48px rgba(0, 0, 0, 0.45),
      inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }
  /* Docked-панель: раскрытый список — прозрачное стекло вместо #000 */
  html.header-dock-left #notifDropdown .notif-dropdown__list,
  html.header-dock-right #notifDropdown .notif-dropdown__list {
    background: rgba(255, 255, 255, 0.05);
  }
}

/* ==========================================================
   1) Кнопки «Сбросить фон / размер / тему» — без hover-эффекта:
      не увеличиваются, иконка не вращается, цвета не меняются.
   ========================================================== */
#bgSection .bg-page-reset:hover,
.settings-page-reset:hover {
  background: rgba(240, 240, 245, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text);
  transform: none !important;
  scale: none !important;
}
#bgSection .bg-page-reset:hover svg,
.settings-page-reset:hover svg {
  transform: none !important;
  color: inherit;
}

/* ==========================================================
   2) Баннер «Смотреть сейчас» — стекло, без hover-увеличения.
   ========================================================== */
.hero-slide-btn-play {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  -webkit-backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(190%);
  backdrop-filter: blur(min(20px, var(--pf-cap, 999px))) saturate(190%);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: none;
}
.hero-slide-btn-play:hover {
  opacity: 1;
  transform: none;
  background: rgba(255, 255, 255, 0.14);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.hero-slide-btn-play:active { transform: none; opacity: 0.85; }

/* ==========================================================
   3) Мобильная нижняя панель: индикатор активной вкладки.
      В покое — статичная плоская плашка (как в Telegram).
      Стеклянная «линза» + анимация — только пока идёт переход на
      другую вкладку (класс .moving ставит initMobileNavIndicator).
   ========================================================== */
.mobile-nav-indicator {
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
  margin-top: 0;
  margin-bottom: 0;
  transition:
    transform 0.45s cubic-bezier(0.32, 0.72, 0, 1),
    width 0.45s cubic-bezier(0.32, 0.72, 0, 1),
    margin 0.3s ease,
    background 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    opacity 0.2s ease;
}
.mobile-nav-indicator.moving {
  margin-top: -3px;
  margin-bottom: -3px;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
  -webkit-backdrop-filter: blur(min(10px, var(--pf-cap, 999px))) saturate(220%) brightness(1.15);
  backdrop-filter: blur(min(10px, var(--pf-cap, 999px))) saturate(220%) brightness(1.15);
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.35),
    0 0 0 3px rgba(255, 255, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(255, 255, 255, 0.14);
}

/* Кнопка «Сбросить размер/тему» — тот же размер и вид, что «Сбросить фон»
   (поздний блок .settings-page-reset делал её меньше). */
body .settings-page-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 32px;
  margin: 28px auto 0;
  background: rgba(240, 240, 245, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 30px;
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  width: 100%;
  max-width: 520px;
  -webkit-backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(200%);
  backdrop-filter: blur(min(30px, var(--pf-cap, 999px))) saturate(200%);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
body .settings-page-reset svg { width: 16px; height: 16px; }

/* ==========================================================
   Верхняя панель навигации: скользящий индикатор активной вкладки.
   В покое — плоская статичная плашка; пока идёт переход на другую
   вкладку (.moving) — стеклянная «линза», как в мобильной панели.
   В docked-режиме (боковая панель) индикатор не используется.
   ========================================================== */
.header-nav { position: relative; }
.header-nav .nav-tab,
.header-nav .nav-dropdown-toggle { position: relative; z-index: 1; }

.header-nav-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
  transition:
    transform 0.45s cubic-bezier(0.32, 0.72, 0, 1),
    width 0.45s cubic-bezier(0.32, 0.72, 0, 1),
    height 0.45s cubic-bezier(0.32, 0.72, 0, 1),
    background 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    opacity 0.2s ease;
}
.header-nav-indicator.ready { opacity: 1; }
.header-nav-indicator.moving {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
  -webkit-backdrop-filter: blur(min(10px, var(--pf-cap, 999px))) saturate(220%) brightness(1.15);
  backdrop-filter: blur(min(10px, var(--pf-cap, 999px))) saturate(220%) brightness(1.15);
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.35),
    0 0 0 2px rgba(255, 255, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(255, 255, 255, 0.14);
}
/* Подсветку активной вкладки рисует индикатор (как в верхней, так и в боковой панели) —
   у самой кнопки убираем фон/рамку/тень (цвет и жирность текста остаются). */
.header-nav .nav-tab.active,
.header-nav .nav-tab.active:hover {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}


/* ====================================================================
   ПРОИЗВОДИТЕЛЬНЫЙ РЕЖИМ (js/perf-mode.js ставит html.perf-lite)
   Анимации, стекло и тени остаются на месте — режим лишь удешевляет
   их расчёт. Обычный режим этим блоком не затрагивается.

   Что делает (от самого тяжёлого к лёгкому):
   1. Большое стекло (шапка, окна, панели) — blur не больше 12px
      (--pf-cap подставляется во все backdrop-filter выше по файлу).
   2. Стекло на мелочи и на повторяющихся элементах (бейджи, таблетки,
      теги, карточки друзей/комментариев, строки настроек) снимается:
      у них и так тёмная полупрозрачная заливка, а каждый такой слой —
      отдельный проход видеокарты. Вложенное стекло внутри стекла вообще
      не видит фон страницы, так что там blur был чистой потерей.
   3. Анимации, которые на каждом кадре заставляли пересчитывать
      раскладку (height / left) или перерисовывать фон
      (background-position), переписаны на transform или идут
      «ступеньками» — выглядят так же, но стоят в разы дешевле.
   4. Бесконечные анимации вне экрана — на паузе (.pf-off).
   5. Длинный рейтинг рисуется только в видимой части.
   ==================================================================== */

html.perf-lite { --pf-cap: 12px; }

/* Размытый атмосферный фон баннера: 48px → 20px. Слой огромный и и так
   сознательно «мыльный», разницы на глаз почти нет. */
html.perf-lite .hero-slide-bg-blur {
  filter: blur(20px) saturate(1.25) brightness(0.6);
}

/* ── 2. Снимаем стекло с мелочи и повторяющихся элементов ── */
html.perf-lite .tt-meta-pill,
html.perf-lite .tt-status-pill,
html.perf-lite .tt-genre-tag,
html.perf-lite .genre-tag,
html.perf-lite .filter-tag,
html.perf-lite .filter-select,
html.perf-lite .filter-year-input,
html.perf-lite .filter-tags-input,
html.perf-lite .season-current-badge,
html.perf-lite .schedule-today-badge,
html.perf-lite .schedule-day-count,
html.perf-lite .schedule-card-time,
html.perf-lite .schedule-card-badge,
html.perf-lite .schedule-card-status,
html.perf-lite .hero-slide-eyebrow,
html.perf-lite .hero-genre-chip,
html.perf-lite .hero-badge,
html.perf-lite .hero-slide-btn-info,
html.perf-lite .npb-ep,
html.perf-lite .dpb-status,
html.perf-lite .dpb-score-block,
html.perf-lite .detail-poster-badge,
html.perf-lite .detail-meta,
html.perf-lite .mobile-detail-info .mdi-status,
html.perf-lite .pxp-lvl-tag,
html.perf-lite .pxp-rank-tag,
html.perf-lite .pxp-hist-btn,
html.perf-lite .my-lb-rank-badge,
html.perf-lite .my-lb-lvl-badge,
html.perf-lite .my-lb-history-btn,
html.perf-lite .lb-lvl-tag,
html.perf-lite .lb-row-you-tag,
html.perf-lite .podium-badge,
html.perf-lite .podium-place-circle,
html.perf-lite .leaderboard-badge-icon,
html.perf-lite .leaderboard-subtitle,
html.perf-lite .profile-you-tag,
html.perf-lite .profile-top-genre,
html.perf-lite .profile-avatar-edit-btn,
html.perf-lite .stats-fact-ico,
html.perf-lite .friend-card,
html.perf-lite .friend-card-you-badge,
html.perf-lite .friend-action-btn,
html.perf-lite .friends-search-input,
html.perf-lite .cmt-card,
html.perf-lite .settings-row,
html.perf-lite .settings-row-icon,
html.perf-lite .footer-social-icon,
html.perf-lite .list-subtitle,
html.perf-lite .lightbox-loader,
html.perf-lite .pfh-text,
html.perf-lite .file-drop-zone,
html.perf-lite .sup-drop-zone,
html.perf-lite .chat-thread-input,
html.perf-lite .error-banner {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  will-change: auto;
}

/* ── 3. Анимации: тот же вид, но без пересчёта раскладки ── */

/* Полоски загрузки «эквалайзер» меняли height (= layout на каждый кадр
   у каждой из 5 полосок). Теперь тот же размах через scaleY. */
html.perf-lite .cat-scan-spinner .loader-bar {
  height: 46px;
  transform-origin: 50% 100%;
  transform: scaleY(0.26);
  animation-name: pfWaveLite;
}
@keyframes pfWaveLite {
  0%, 100% { transform: scaleY(0.26); opacity: 0.5; }
  50%      { transform: scaleY(1);    opacity: 1; }
}

/* Блик-сканер на бейдже сезона двигал left (layout). Теперь transform. */
html.perf-lite .season-current-badge::after {
  left: 0;
  animation-name: pfScanLite;
}
@keyframes pfScanLite {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(233%); }
}

/* Скелетоны и блики двигали background-position (перерисовка каждый
   кадр). Идём ступеньками ~15 к/с — на глаз та же волна, нагрузка
   на перерисовку в 4 раза ниже. */
html.perf-lite [class*="skel"],
html.perf-lite [class*="skel"]::after,
html.perf-lite [class*="skel"]::before {
  animation-timing-function: steps(20, end) !important;
}

/* Мелкие бесконечные анимации не держим в отдельных слоях заранее */
html.perf-lite .css-particle { will-change: auto; }
html.perf-lite #cssParticles { contain: strict; }

/* ── 4. Бесконечные анимации вне экрана ставятся на паузу (perf-mode.js) ── */
html.perf-lite .pf-off,
html.perf-lite .pf-off *,
html.perf-lite .pf-off::before,
html.perf-lite .pf-off::after,
html.perf-lite .pf-off *::before,
html.perf-lite .pf-off *::after {
  animation-play-state: paused !important;
}

/* ── 5. Длинный рейтинг: считаем только то, что на экране ── */
html.perf-lite .lb-row {
  content-visibility: auto;
  contain-intrinsic-size: auto 64px;
}

/* ── 6. Заморозка анимаций при скролле страницы ── */
html.is-scrolling * {
  animation-play-state: paused !important;
}
/* Индикаторы загрузки продолжают вращаться во время скролла */
html.is-scrolling .cat-scan-spinner *,
html.is-scrolling .loader-bar,
html.is-scrolling .spinner,
html.is-scrolling [class*="spin"],
html.is-scrolling .lightbox-loader,
html.is-scrolling .header-spinner {
  animation-play-state: running !important;
}

/* ════════════════════════════════════════════════════════════════════
   РЕЖИМ «МИНИМАЛЬНЫЙ» (html.perf-minimal)
   Максимальное ускорение для слабого железа без видеокарты:
   1. Полное отключение живого backdrop-filter — замена на быстрое
      непрозрачное/плотное стекло с нулевой нагрузкой на GPU;
   2. Упрощение тяжёлых размытых многослойных теней (box-shadow);
   3. Отключение фоновых частиц и размытия баннера.
   ==================================================================== */

html.perf-minimal,
html.perf-minimal * {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Плотное фальшивое матовое стекло для основных панелей сайта */
html.perf-minimal .site-header {
  background: rgba(14, 16, 24, 0.97) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45) !important;
}

html.perf-minimal .nav-dropdown-menu,
html.perf-minimal .mobile-nav-panel,
html.perf-minimal .mobile-bottom-nav,
html.perf-minimal .modal-content,
html.perf-minimal .settings-page-card,
html.perf-minimal .profile-page-card,
html.perf-minimal .catalog-filter-bar,
html.perf-minimal .comments-drawer,
html.perf-minimal .cmt-sheet,
html.perf-minimal .catalog-more-btn,
html.perf-minimal .cmt-expand-btn,
html.perf-minimal .bg-page-reset,
html.perf-minimal .bg-page-apply-btn,
html.perf-minimal .chat-thread-container,
html.perf-minimal .chat-input-bar,
html.perf-minimal .detail-glass-card,
html.perf-minimal .notification-dropdown,
html.perf-minimal .user-menu-dropdown,
html.perf-minimal .frame-shop-modal,
html.perf-minimal .frame-shop-glass,
html.perf-minimal .profile-xp-card,
html.perf-minimal .profile-hero-card,
html.perf-minimal .stats-hero-card {
  background: rgba(16, 18, 27, 0.96) !important;
}

html.perf-minimal .hero-slide-content {
  background: transparent !important;
}

/* Тултип информации и стеклянные карточки в минимальном режиме:
   плотный, непрозрачный фон, чтобы текст оставался чётким и читаемым без GPU-размытия */
html.perf-minimal #animeCardTooltip {
  background: rgba(16, 18, 27, 0.97) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7) !important;
}

html.perf-minimal .detail-widget-frame {
  background: rgba(14, 16, 22, 0.97) !important;
}

html.perf-minimal .settings-row {
  background: rgba(18, 20, 28, 0.96) !important;
}

html.perf-minimal .genre-tag,
html.perf-minimal .tt-genre-tag,
html.perf-minimal .tt-status-pill,
html.perf-minimal .hero-badge {
  background: rgba(28, 32, 44, 0.95) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
}

/* Упрощение многослойных и тяжёлых размытых теней */
html.perf-minimal .card,
html.perf-minimal .schedule-card,
html.perf-minimal .hero-slide,
html.perf-minimal .modal-box,
html.perf-minimal .settings-row,
html.perf-minimal .nav-btn {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35) !important;
}

html.perf-minimal .card:hover,
html.perf-minimal .schedule-card:hover {
  box-shadow: none !important;
}

/* Разгрузка баннера и фона */
html.perf-minimal .hero-slide-bg-blur {
  display: none !important;
}
html.perf-minimal #cssParticles {
  display: none !important;
}

/* ── Строка «Производительность» в настройках ── */
#settingsRowPerf {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  border-radius: 20px;
  border-top: 1px solid rgba(255,255,255,0.25);
  border-bottom: 1px solid rgba(255,255,255,0.13);
  margin-bottom: 12px;
  cursor: default;
}
#settingsRowPerfScroll {
  border-top: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px 20px 0 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
}
#settingsRowPerfFps {
  border-radius: 0 0 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.13);
  margin-bottom: 12px;
}
#settingsRowPerf .perf-seg {
  display: flex;
  width: 100%;
  margin-top: 12px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06);
}
#settingsRowPerf .perf-seg button {
  flex: 1 1 0;
  min-width: 0;
  padding: 10px 4px;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.62);
  font: 600 12.5px/1.2 -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s, color 0.2s;
}
#settingsRowPerf .perf-seg button + button {
  border-left: 1px solid rgba(255,255,255,0.12);
}
#settingsRowPerf .perf-seg button[aria-pressed="true"] {
  background: #34c759;
  color: #06210f;
  font-weight: 700;
}
#settingsRowPerf .perf-seg button:focus-visible {
  outline: 2px solid #34c759;
  outline-offset: -2px;
}
@media (max-width: 480px) {
  #settingsRowPerf .perf-seg {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  #settingsRowPerf .perf-seg button {
    padding: 9px 4px;
    font-size: 11.5px;
  }
  #settingsRowPerf .perf-seg button:nth-child(2) {
    border-right: none;
  }
  #settingsRowPerf .perf-seg button:nth-child(3),
  #settingsRowPerf .perf-seg button:nth-child(4) {
    border-top: 1px solid rgba(255,255,255,0.12);
  }
  #settingsRowPerf .perf-seg button:nth-child(3) {
    border-left: none;
  }
}

/* ── Языковой переключатель (Language Switcher) ── */
.lang-seg {
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.lang-seg button {
  padding: 6px 14px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  font: 700 12px/1.2 -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.lang-seg button + button {
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.lang-seg button.active,
.lang-seg button[aria-pressed="true"] {
  background: #34c759;
  color: #06210f;
  font-weight: 700;
}

/* ── Счётчик кадров (FPS Meter) ── */
.nn-fps-meter {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 999999;
  display: none;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(13, 15, 23, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  color: #34c759;
  font: 700 12px/1.2 -apple-system, BlinkMacSystemFont, 'SF Mono', Consolas, monospace;
  pointer-events: none;
  user-select: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.nn-fps-meter.active {
  display: inline-flex;
}
.nn-fps-meter .nn-fps-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}
.nn-fps-meter.fps-good { color: #34c759; }
.nn-fps-meter.fps-mid  { color: #ffd60a; }
.nn-fps-meter.fps-low  { color: #ff453a; }

@media (max-width: 768px) {
  .nn-fps-meter {
    bottom: auto;
    top: calc(env(safe-area-inset-top, 0px) + 68px);
    right: 12px;
    padding: 3px 8px;
    font-size: 10.5px;
  }
}


/* ====================================================================
   Стеклянные кнопки профиля: «Рамки», «Редактировать профиль»,
   «История XP», «Добавить в друзья», «Люди», а также кнопка-карандаш смены аватара
   — один общий вид в стиле сайта (liquid glass):
   светлая прозрачная заливка с бликом сверху, яркая верхняя кромка,
   внутренний блик и мягкая тень. Без hover-смещения (никакого сдвига вверх).
   ==================================================================== */
.profile-action-group .profile-back-btn,
.profile-action-group .profile-msg-btn,
button.pxp-hist-btn,
button.my-lb-history-btn,
.profile-avatar-edit-btn {
  color: rgba(255, 255, 255, 0.95);
  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.22) 0%,
      rgba(255, 255, 255, 0.07) 46%,
      rgba(255, 255, 255, 0.12) 100%),
    rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-top-color: rgba(255, 255, 255, 0.45);
  border-bottom-color: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px))) saturate(180%);
  -webkit-backdrop-filter: blur(min(16px, var(--pf-cap, 999px))) saturate(180%);
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.40),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: background 0.2s, border-color 0.2s, color 0.2s,
              box-shadow 0.2s;
}

.profile-action-group .profile-back-btn:hover,
.profile-action-group .profile-msg-btn:hover,
button.pxp-hist-btn:hover,
button.my-lb-history-btn:hover,
.profile-avatar-edit-btn:hover {
  color: #ffffff;
  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.32) 0%,
      rgba(255, 255, 255, 0.11) 46%,
      rgba(255, 255, 255, 0.18) 100%),
    rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.34);
  border-top-color: rgba(255, 255, 255, 0.6);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08);
  transform: none;
}

.profile-action-group .profile-back-btn:active,
.profile-action-group .profile-msg-btn:active,
button.pxp-hist-btn:active,
button.my-lb-history-btn:active,
.profile-avatar-edit-btn:active {
  transform: none;
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* «История XP» — той же формы-пилюли, что и две кнопки выше */
button.pxp-hist-btn,
button.my-lb-history-btn {
  border-radius: 999px;
  padding: 7px 16px;
}

/* Круглая стеклянная кнопка смены аватара */
.profile-avatar-edit-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =====================================================================
   GLASS MODALS — единый «стеклянный» материал для модальных окон
   ---------------------------------------------------------------------
   Окна: вход/регистрация (#authGate), никнейм (#nicknameModal),
   редактирование профиля (#editProfileModal), история XP
   (#xpHistoryModal), библиотека рамок (#frameLibraryModal).

   Материал тот же, что у карточек профиля/статистики и нижней навигации:
   полупрозрачная тёмная подложка + светлый градиентный блик, сильный
   blur + saturate, тонкая белая обводка и верхний блик через inset
   box-shadow. Фон сайта (обои) просвечивает сквозь окно.

   Правила:
   • Блок стоит В КОНЦЕ файла и перекрывает «плоскую карточку» (#131313 +
     белая полоса слева) из .modal-box / .auth-box.
   • Вложенные карточки внутри стекла БЕЗ своего backdrop-filter
     (вложенный blur не видит фон страницы) — только полупрозрачная
     заливка.
   • Blur ограничен var(--pf-cap) — как везде, чтобы работал режим
     производительности (js/perf-mode.js).
   ===================================================================== */
:root {
  --gm-fill:
    linear-gradient(145deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.035) 42%, rgba(255,255,255,0.07) 100%),
    rgba(18, 19, 26, 0.50);
  --gm-border: rgba(255, 255, 255, 0.16);
  --gm-blur: blur(min(34px, var(--pf-cap, 999px))) saturate(190%);
  --gm-shadow:
    0 30px 80px -10px rgba(0, 0, 0, 0.60),
    0 8px 24px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05),
    inset 0 0 0 1px rgba(255, 255, 255, 0.025);
  --gm-inner-fill: rgba(255, 255, 255, 0.055);
  --gm-inner-border: rgba(255, 255, 255, 0.11);
  --gm-inner-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
  --gm-field-fill: rgba(255, 255, 255, 0.06);
  --gm-field-border: rgba(255, 255, 255, 0.14);
}

/* ── 1. Оверлеи: мягкое затемнение, обои под стеклом видны ───────────── */
#authGate,
#nicknameModal.modal-overlay,
#editProfileModal.modal-overlay,
#xpHistoryModal.modal-overlay,
#frameLibraryModal.modal-overlay,
#reportModal.modal-overlay,
#adminMessageModal.modal-overlay,
#adminPunishModal.modal-overlay,
#passwordRecoveryModal.modal-overlay,
#userBannedNoticeModal.modal-overlay {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(60, 70, 110, 0.18), transparent 70%),
    rgba(4, 6, 14, 0.48);
  backdrop-filter: blur(min(14px, var(--pf-cap, 999px))) saturate(1.25);
  -webkit-backdrop-filter: blur(min(14px, var(--pf-cap, 999px))) saturate(1.25);
}

/* ── 2. Сами окна ─────────────────────────────────────────────────────── */
#authGate .auth-box,
#nicknameModal .modal-box,
#editProfileModal .modal-box,
#xpHistoryModal .modal.xp-modal,
#reportModal .modal-box,
#adminMessageModal .modal-box,
#adminPunishModal .modal-box,
#passwordRecoveryModal .modal-box,
#userBannedNoticeModal .modal-box,
.report-modal-box,
.admin-modal-box {
  background: var(--gm-fill) !important;
  backdrop-filter: var(--gm-blur) !important;
  -webkit-backdrop-filter: var(--gm-blur) !important;
  border: 1px solid var(--gm-border) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.28) !important;
  border-left: 1px solid var(--gm-border) !important;
  border-radius: 26px !important;
  box-shadow: var(--gm-shadow) !important;
}

/* Библиотека рамок: у неё в базовых стилях всё через !important */
#frameLibraryModal .modal-box.frame-shop-modal {
  background: var(--gm-fill) !important;
  backdrop-filter: var(--gm-blur) !important;
  -webkit-backdrop-filter: var(--gm-blur) !important;
  box-shadow: var(--gm-shadow) !important;
}
@media (min-width: 769px) {
  #frameLibraryModal .modal-box.frame-shop-modal {
    border: 1px solid var(--gm-border) !important;
    border-left: 1px solid var(--gm-border) !important;
    border-radius: 28px !important;
  }
}

/* Окно XP — чуть прозрачнее прежних 88% непрозрачности */
#xpHistoryModal .modal.xp-modal { background: var(--gm-fill); }

/* ── 3. Шапки: прозрачные, с тонкой стеклянной линией ─────────────────── */
#nicknameModal .modal-header,
#editProfileModal .modal-header,
#xpHistoryModal .modal-header,
#frameLibraryModal .modal-header,
#frameLibraryModal .frame-shop-header,
#reportModal .modal-header,
#adminMessageModal .modal-header,
#adminPunishModal .modal-header,
#passwordRecoveryModal .modal-header {
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0)) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10) !important;
}
#nicknameModal .modal-header,
#editProfileModal .modal-header,
#xpHistoryModal .modal-header,
#reportModal .modal-header,
#adminMessageModal .modal-header,
#adminPunishModal .modal-header,
#passwordRecoveryModal .modal-header { padding: 18px 24px; }

#nicknameModal .modal-title,
#editProfileModal .modal-title,
#xpHistoryModal .modal-title,
#frameLibraryModal .modal-title,
#reportModal .modal-title,
#adminMessageModal .modal-title,
#adminPunishModal .modal-title,
#passwordRecoveryModal .modal-title,
#authGate .auth-title {
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}

/* ── 4. Кнопка закрытия: единый минималистичный крестик без капсулы ──── */
#authGate .modal-close,
#nicknameModal .modal-close,
#editProfileModal .modal-close,
#xpHistoryModal .modal-close,
#frameLibraryModal .modal-close,
#reportModal .modal-close,
#adminMessageModal .modal-close,
#adminPunishModal .modal-close,
#passwordRecoveryModal .modal-close {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  color: rgba(255, 255, 255, 0.58) !important;
  box-shadow: none !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: color 0.18s ease, transform 0.18s ease !important;
}
#authGate .modal-close:hover,
#nicknameModal .modal-close:hover,
#editProfileModal .modal-close:hover,
#xpHistoryModal .modal-close:hover,
#frameLibraryModal .modal-close:hover,
#reportModal .modal-close:hover,
#adminMessageModal .modal-close:hover,
#adminPunishModal .modal-close:hover,
#passwordRecoveryModal .modal-close:hover {
  background: transparent !important;
  border: none !important;
  color: #ffffff !important;
  transform: scale(1.15) !important;
}
#authGate .modal-close:active,
#nicknameModal .modal-close:active,
#editProfileModal .modal-close:active,
#xpHistoryModal .modal-close:active,
#frameLibraryModal .modal-close:active,
#reportModal .modal-close:active,
#adminMessageModal .modal-close:active,
#adminPunishModal .modal-close:active,
#passwordRecoveryModal .modal-close:active {
  transform: scale(0.92) !important;
  color: rgba(255, 255, 255, 0.8) !important;
}
#frameLibraryModal .modal-close { width: 32px; height: 32px; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; }

/* ── 5. Поля ввода ────────────────────────────────────────────────────── */
#authGate .auth-input,
#nicknameModal .auth-input,
#editProfileModal .auth-input,
#changePasswordModal .auth-input,
#editProfileModal .sup-textarea,
#reportModal .admin-textarea,
#adminMessageModal .admin-textarea,
#adminPunishModal .admin-input,
#adminPunishModal .admin-select,
#passwordRecoveryModal .auth-input {
  background: var(--gm-field-fill);
  border: 1px solid var(--gm-field-border);
  border-radius: 14px;
  color: #f4f4f7;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
#authGate .auth-input,
#nicknameModal .auth-input,
#editProfileModal .auth-input,
#changePasswordModal .auth-input { padding: 13px 16px; }
#editProfileModal .sup-textarea { padding: 13px 16px; }

#authGate .auth-input:focus,
#nicknameModal .auth-input:focus,
#editProfileModal .auth-input:focus,
#changePasswordModal .auth-input:focus,
#editProfileModal .sup-textarea:focus,
#adminPunishModal .admin-input:focus,
#adminPunishModal .admin-select:focus,
#adminMessageModal .admin-textarea:focus,
#reportModal .admin-textarea:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.18),
    0 0 0 3px rgba(255, 255, 255, 0.08);
}
#authGate .auth-input::placeholder,
#nicknameModal .auth-input::placeholder,
#changePasswordModal .auth-input::placeholder,
#editProfileModal .sup-textarea::placeholder { color: rgba(255, 255, 255, 0.40); }

/* Подписи полей и подсказки */
#editProfileModal .import-label { color: rgba(255, 255, 255, 0.55); }
#editProfileModal .modal-body p { color: rgba(255, 255, 255, 0.5) !important; }

/* Иконка календаря в date-input — светлая, а не чёрная */
#editProfileModal input[type="date"] { color-scheme: dark; }

/* Ошибка — красное стекло */
#authGate .auth-error,
#nicknameModal .auth-error,
#editProfileModal .auth-error {
  background: rgba(255, 70, 70, 0.12);
  border: 1px solid rgba(255, 90, 90, 0.30);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ── 6. Кнопки: основная — светлое стекло, вторичная — прозрачное ─────── */
#authGate .auth-submit-btn,
#nicknameModal .auth-submit-btn,
#editProfileModal .import-btn {
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(232,232,240,0.80));
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 14px;
  color: #0c0c10;
  box-shadow:
    0 10px 26px -6px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(0, 0, 0, 0.08);
  transition: background 0.18s, box-shadow 0.18s, transform 0.15s;
}
#authGate .auth-submit-btn:hover,
#nicknameModal .auth-submit-btn:hover,
#editProfileModal .import-btn:hover {
  background: linear-gradient(180deg, #ffffff, rgba(240,240,247,0.92));
  box-shadow:
    0 14px 30px -6px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 #fff,
    inset 0 -1px 0 rgba(0, 0, 0, 0.06);
}
/* Сохраняем «зелёный flash» после сохранения профиля */
#editProfileModal .import-btn.saved {
  background: linear-gradient(180deg, #d9f3d6, #bfe6bb);
  border-color: #cdeecb;
}

#editProfileModal .import-cancel {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
}
#editProfileModal .import-cancel:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.30);
  color: #fff;
}

/* ── 7. Вход: левая брендовая панель и переключатель Вход/Регистрация ── */
#authGate .auth-box.v2 { border-radius: 28px; }

#authGate .auth-visual {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255,255,255,0.10), transparent 60%),
    linear-gradient(160deg, rgba(255,255,255,0.06), rgba(255,255,255,0.01));
  border-right: 1px solid rgba(255, 255, 255, 0.10);
}

#authGate .auth-tabs {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 16px;
  padding: 4px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.25);
}
#authGate .auth-tab { border-radius: 12px; }
#authGate .auth-tab.active {
  color: #fff;
  background: linear-gradient(180deg, rgba(255,255,255,0.26), rgba(255,255,255,0.12));
  border: 1px solid rgba(255, 255, 255, 0.26);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

#authGate .auth-visual-chip {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

/* ── 8. История XP: строки — стеклянные плашки ────────────────────────── */
#xpHistoryModal .xp-hist-item {
  background: var(--gm-inner-fill);
  border: 1px solid var(--gm-inner-border);
  border-radius: 16px;
  box-shadow: var(--gm-inner-shadow);
  transition: background 0.18s, border-color 0.18s;
}
#xpHistoryModal .xp-hist-item:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.20);
}

/* ── 9. Библиотека рамок ──────────────────────────────────────────────── */
#frameLibraryModal .frame-shop-body { background: transparent !important; }

#frameLibraryModal .frame-shop-side {
  background: rgba(255, 255, 255, 0.025) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.10) !important;
}
#frameLibraryModal .frame-shop-main { background: transparent !important; }

#frameLibraryModal .frame-shop-glass,
#frameLibraryModal .frame-shop-bal {
  background:
    linear-gradient(145deg, rgba(255,255,255,0.10), rgba(255,255,255,0.03)),
    rgba(255, 255, 255, 0.02) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 20px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 10px 28px -12px rgba(0, 0, 0, 0.5) !important;
}

#frameLibraryModal .frame-shop-tabs {
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}
#frameLibraryModal .frame-shop-tab { border-radius: 12px; border: 1px solid transparent; }
#frameLibraryModal .frame-shop-tab:hover { background: rgba(255, 255, 255, 0.08); }
#frameLibraryModal .frame-shop-tab.active {
  background: linear-gradient(180deg, rgba(255,255,255,0.20), rgba(255,255,255,0.08));
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 4px 12px rgba(0, 0, 0, 0.25);
}

#frameLibraryModal .frame-shop-tag {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
#frameLibraryModal .frame-shop-tag--lv { background: rgba(255, 255, 255, 0.16); }

#frameLibraryModal .frame-shop-card {
  background:
    linear-gradient(160deg, rgba(255,255,255,0.09), rgba(255,255,255,0.025)),
    rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.13);
}
#frameLibraryModal .frame-shop-card:hover {
  background:
    linear-gradient(160deg, rgba(255,255,255,0.14), rgba(255,255,255,0.05)),
    rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 14px 30px -14px rgba(0, 0, 0, 0.6);
}
#frameLibraryModal .frame-shop-card.sel {
  background:
    linear-gradient(160deg, rgba(255,255,255,0.18), rgba(255,255,255,0.07)),
    rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 0 22px rgba(255, 255, 255, 0.10);
}

#frameLibraryModal .frame-shop-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
#frameLibraryModal .frame-shop-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.38);
}
#frameLibraryModal .frame-shop-btn--pri {
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(232,232,240,0.80));
  border-color: rgba(255, 255, 255, 0.55);
  color: #0c0c10;
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
#frameLibraryModal .frame-shop-btn--pri:hover:not(:disabled) {
  background: linear-gradient(180deg, #fff, rgba(240,240,247,0.92));
}

#frameLibraryModal .frame-shop-bar { background: rgba(255, 255, 255, 0.10); }

/* Нижняя шторка подтверждения покупки — стекло плотнее, чтобы читался текст */
#frameLibraryModal .frame-shop-sheet {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.03)),
    rgba(16, 17, 24, 0.84);
  backdrop-filter: blur(min(24px, var(--pf-cap, 999px))) saturate(170%);
  -webkit-backdrop-filter: blur(min(24px, var(--pf-cap, 999px))) saturate(170%);
  border-top: 1px solid rgba(255, 255, 255, 0.20);
  box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

/* Мобильная версия библиотеки рамок: остаётся полноэкранной «страницей»,
   но тоже на стекле (оверлей полупрозрачный + blur поверх обоев). */
@media (max-width: 768px) {
  #frameLibraryModal.modal-overlay:not(.hidden) {
    background: rgba(8, 9, 16, 0.55) !important;
    backdrop-filter: blur(min(22px, var(--pf-cap, 999px))) saturate(1.3) !important;
    -webkit-backdrop-filter: blur(min(22px, var(--pf-cap, 999px))) saturate(1.3) !important;
  }
  #frameLibraryModal .modal-box.frame-shop-modal {
    background: var(--gm-fill) !important;
  }
  #frameLibraryModal .frame-shop-body { background: transparent !important; }
  #frameLibraryModal .frame-shop-side { background: rgba(255, 255, 255, 0.03) !important; }
}

/* ── 10. Запасной вариант без поддержки backdrop-filter ───────────────── */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #authGate .auth-box,
  #nicknameModal .modal-box,
  #editProfileModal .modal-box,
  #xpHistoryModal .modal.xp-modal,
  #frameLibraryModal .modal-box.frame-shop-modal {
    background: rgba(24, 25, 32, 0.96) !important;
  }
}

/* =====================================================================
   GLASS MODALS — мобильная версия и фиксы (≤768px)
   ---------------------------------------------------------------------
   • Окно XP: overflow:hidden — раньше прямоугольная шапка вылезала за
     скруглённые углы («острые углы»). На телефоне — нижний лист, как у
     панели уведомлений (.notif-dropdown): прижат к низу, скругление
     только сверху, хэндл, затемнение, свайп вниз закрывает.
   • Профиль / никнейм: на телефоне это уже нижние листы (.modal-box
     {border-radius:28px 28px 0 0}) — возвращаем им скругление только
     сверху (общий стеклянный блок выше скруглял все 4 угла).
   • Библиотека рамок: убираем остатки сплошного #111/#181818.
   ===================================================================== */

/* Углы окна XP — на всех экранах */
#xpHistoryModal .modal.xp-modal { overflow: hidden; }
#xpHistoryModal .modal-header { border-radius: 26px 26px 0 0; }

@keyframes xpSheetUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

@media (max-width: 768px) {

  /* ── История XP: нижний лист, как «Уведомления» ───────────────────── */
  #xpHistoryModal.modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  #xpHistoryModal .modal.xp-modal {
    width: 100%;
    max-width: 100%;
    margin: 0;
    max-height: min(78vh, calc(100vh - 24px));
    max-height: min(78dvh, calc(100dvh - 24px));
    border-radius: 22px 22px 0 0;
    border-bottom: none;
    box-shadow:
      0 -8px 40px rgba(0, 0, 0, 0.55),
      inset 0 1px 0 rgba(255, 255, 255, 0.26);
    animation: xpSheetUp 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    touch-action: pan-y;
  }
  /* Хэндл — та же полоска 36×4, что у .notif-dropdown__handle */
  #xpHistoryModal .modal.xp-modal::before {
    content: '';
    display: block;
    flex-shrink: 0;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.28);
    margin: 8px auto 0;
  }
  #xpHistoryModal .modal-header {
    margin-bottom: 0;
    padding: 10px 16px 12px;
    border-radius: 0;
    background: none !important;
    cursor: grab;
  }
  #xpHistoryModal .modal-close {
    display: none !important;
  }
  #xpHistoryModal .xp-hist-body {
    flex: 1;
    min-height: 0;
    max-height: none;
    padding: 12px 14px calc(16px + env(safe-area-inset-bottom, 0px));
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  /* ── Профиль / никнейм: нижний лист со скруглением только сверху ──── */
  #editProfileModal.modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  #editProfileModal .modal-box {
    width: 100%;
    max-width: 100%;
    margin: 0;
    max-height: min(85vh, calc(100vh - 24px));
    max-height: min(85dvh, calc(100dvh - 24px));
    border-radius: 22px 22px 0 0;
    border-bottom: none;
    box-shadow:
      0 -8px 40px rgba(0, 0, 0, 0.55),
      inset 0 1px 0 rgba(255, 255, 255, 0.26);
    animation: xpSheetUp 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    touch-action: pan-y;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
  #editProfileModal .modal-box::before {
    content: '';
    display: block;
    flex-shrink: 0;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.28);
    margin: 8px auto 0;
  }
  #editProfileModal .modal-header {
    margin-bottom: 0;
    padding: 10px 16px 12px;
    border-radius: 0;
    background: none !important;
    cursor: grab;
  }

  #nicknameModal .modal-box {
    border-radius: 26px 26px 0 0;
    border-bottom: none;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }

  /* ── Библиотека рамок: убираем сплошные тёмные плашки ─────────────── */
  #frameLibraryModal .frame-shop-header {
    background: linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.02)) !important;
    box-shadow: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
  }
  #frameLibraryModal .frame-shop-back-btn {
    display: none !important;
  }

  #frameLibraryModal .frame-shop-tabs {
    background: rgba(255, 255, 255, 0.03) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10) !important;
    box-shadow: none !important;
  }
  #frameLibraryModal .frame-shop-tab {
    background: rgba(255, 255, 255, 0.07) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 12px !important;
  }
  #frameLibraryModal .frame-shop-tab.active {
    background: linear-gradient(180deg, rgba(255,255,255,0.24), rgba(255,255,255,0.10)) !important;
    border-color: rgba(255, 255, 255, 0.30) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
  }

  #frameLibraryModal .frame-shop-card {
    background:
      linear-gradient(160deg, rgba(255,255,255,0.10), rgba(255,255,255,0.03)),
      rgba(255, 255, 255, 0.015) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 20px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.13) !important;
  }
  #frameLibraryModal .frame-shop-card.sel {
    background:
      linear-gradient(160deg, rgba(255,255,255,0.18), rgba(255,255,255,0.07)),
      rgba(255, 255, 255, 0.03) !important;
    border-color: rgba(255, 255, 255, 0.55) !important;
  }

  #frameLibraryModal .frame-shop-sheet {
    background:
      linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.03)),
      rgba(16, 17, 24, 0.90) !important;
    border-radius: 22px 22px 0 0 !important;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #xpHistoryModal .modal.xp-modal { animation: none; }
}

/* =====================================================================
   УВЕДОМЛЕНИЯ — мобильный нижний лист на том же стекле, что и на ПК
   ---------------------------------------------------------------------
   На десктопе .notif-dropdown уже стеклянный (блок @media(min-width:769px)
   выше), на телефоне оставался чёрным #000. Материал тот же: тёмная
   полупрозрачная подложка + blur/saturate + тонкая белая обводка и
   верхний блик. Затемнение экрана за листом по-прежнему рисует
   «бесконечный» box-shadow из базового мобильного правила — оставлен.
   Лист рисуется поверх этой тени, но сама тень под лист не заходит, поэтому
   подложка чуть плотнее, чем на ПК (0.78 против 0.75).
   ===================================================================== */
@media (max-width: 768px) {
  .notif-dropdown {
    background:
      linear-gradient(145deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.03) 45%, rgba(255,255,255,0.06) 100%),
      rgba(14, 14, 18, 0.78);
    -webkit-backdrop-filter: blur(min(28px, var(--pf-cap, 999px))) saturate(190%);
    backdrop-filter: blur(min(28px, var(--pf-cap, 999px))) saturate(190%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-bottom: none;
    border-radius: 22px 22px 0 0;
    box-shadow:
      0 0 0 9999px rgba(2, 4, 12, 0.60),
      0 -8px 40px rgba(0, 0, 0, 0.45),
      inset 0 1px 0 rgba(255, 255, 255, 0.22);
  }
  .notif-dropdown__header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0));
  }
  .notif-dropdown__refresh,
  .notif-dropdown__clear {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  }
  .notif-dropdown__item { border-bottom-color: rgba(255, 255, 255, 0.07); }
  .notif-dropdown__list { background: transparent; }
}

/* =====================================================================
   СТЕКЛО: таймер выхода серии и кнопки «Добавить в список»
   ---------------------------------------------------------------------
   • Таймер: тот же стеклянный материал, что у модальных окон (светлый
     градиентный блик + тёмная полупрозрачная подложка + тонкая обводка
     и верхний блик). Толстая полоса слева (3px) убрана.
   • Кнопки .list-btn: вариант «Одна панель» — шесть строк собраны в один
     стеклянный блок с линиями-разделителями; активная строка подкрашена
     цветом статуса (--c = rgb-тройка) и получает цветную полоску слева.
   • Hover и нажатие больше НИЧЕГО не двигают и не увеличивают:
     убраны translateY(-1px), scale(1.05) у иконки и scale(0.975) при
     нажатии. Состояния меняются только цветом/яркостью.
   • Панель собрана из самих кнопок (у каждой — своя часть рамки и
     скругления, а градиент растянут на всю высоту блока через
     background-size 100% 600%), а не из рамки на .my-list-row-inner:
     на телефоне этот контейнер сворачивается (grid 0fr + overflow +
     contain:paint), и рамка на нём ломала бы анимацию.
   • Без backdrop-filter: блок лежит внутри .detail-widget-frame
     (у него свой blur), вложенный blur ничего бы не показал.
   ===================================================================== */

/* ── Таймер ───────────────────────────────────────────────────────────── */
.detail-countdown,
#detail-countdown {
  background:
    linear-gradient(145deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.035) 45%, rgba(255,255,255,0.07) 100%),
    rgba(18, 19, 26, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-left: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 20px !important;
  backdrop-filter: blur(min(24px, var(--pf-cap, 999px))) saturate(190%) !important;
  -webkit-backdrop-filter: blur(min(24px, var(--pf-cap, 999px))) saturate(190%) !important;
  box-shadow:
    0 14px 36px -10px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05) !important;
}
@media (max-width: 768px) {
  #detail-countdown { border-radius: 16px !important; }
}

/* ── Кнопки списков: «Одна панель» ────────────────────────────────────── */
.list-btn[data-status="watching"]   { --c: 6, 182, 212; }
.list-btn[data-status="watched"]    { --c: 139, 92, 246; }
.list-btn[data-status="planned"]    { --c: 245, 158, 11; }
.list-btn[data-status="favorite"]   { --c: 244, 63, 94; }
.list-btn[data-status="favorites2"] { --c: 234, 179, 8; }
.list-btn[data-status="dropped"]    { --c: 239, 68, 68; }

/* Позиция строки в общем градиенте (6 строк по 20%) */
.list-btn:nth-of-type(1) { --by: 0%; }
.list-btn:nth-of-type(2) { --by: 20%; }
.list-btn:nth-of-type(3) { --by: 40%; }
.list-btn:nth-of-type(4) { --by: 60%; }
.list-btn:nth-of-type(5) { --by: 80%; }
.list-btn:nth-of-type(6) { --by: 100%; }

.my-list-row-inner { gap: 0; }

.list-btn {
  --pb: rgba(255, 255, 255, 0.16);   /* рамка панели */
  --dv: rgba(255, 255, 255, 0.09);   /* линия между строками */
  gap: 12px;
  min-height: 50px;
  padding: 9px 16px 9px 14px;
  margin: 0;
  border-radius: 0;
  border-width: 0 1px 0 1px;
  border-style: solid;
  background-color: rgba(18, 19, 26, 0.42);
  background-image: linear-gradient(145deg, rgba(255,255,255,0.11) 0%, rgba(255,255,255,0.035) 100%);
  background-size: 100% 600%;
  background-position: 0 var(--by);
  background-repeat: no-repeat;
  box-shadow: none;
  /* transform не анимируется — строка не двигается и не масштабируется */
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
/* Рамка/линии: !important, чтобы hover и .active из базовых правил
   не перекрашивали границы */
.list-btn[data-status] {
  border-left-color: var(--pb) !important;
  border-right-color: var(--pb) !important;
  border-top-color: var(--dv) !important;
  border-bottom-color: var(--pb) !important;
}
.list-btn + .list-btn { border-top-width: 1px; }
.list-btn:nth-of-type(1) {
  border-top-width: 1px;
  border-radius: 20px 20px 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26);
}
.list-btn:nth-of-type(1)[data-status] { border-top-color: var(--pb) !important; }
.list-btn:nth-of-type(6) {
  border-bottom-width: 1px;
  border-radius: 0 0 20px 20px;
}

/* Иконка без плитки */
.list-btn .btn-icon,
.list-btn[data-status].active .btn-icon {
  width: 22px;
  height: 22px;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.list-btn .btn-icon svg { width: 18px; height: 18px; }

/* Галочка: только прозрачность, без «выскакивания» масштабом */
.list-btn .btn-check,
.list-btn.active .btn-check { transform: none; transition: opacity 0.2s ease; }

/* Hover: только цвет, без движения и увеличения */
@media (hover: hover) {
  .list-btn:hover {
    background-color: rgba(70, 72, 84, 0.42);
    color: #fff;
    transform: none;
    box-shadow: none;
  }
  .list-btn:nth-of-type(1):hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26); }
  .list-btn:hover .btn-icon { transform: none; }
}
/* Нажатие: без сжатия, лёгкое осветление */
.list-btn:active { transform: none; filter: brightness(1.15); }

/* Активная строка: цветной градиент слева направо + полоска слева */
.list-btn[data-status].active {
  background-color: rgba(18, 19, 26, 0.42);
  background-image:
    linear-gradient(90deg, rgba(var(--c), 0.26) 0%, rgba(var(--c), 0.05) 100%),
    linear-gradient(145deg, rgba(255,255,255,0.11) 0%, rgba(255,255,255,0.035) 100%);
  background-size: 100% 100%, 100% 600%;
  background-position: 0 0, 0 var(--by);
  box-shadow: inset 3px 0 0 rgba(var(--c), 0.95);
}
.list-btn:nth-of-type(1)[data-status].active {
  box-shadow: inset 3px 0 0 rgba(var(--c), 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.26);
}
@media (hover: hover) {
  .list-btn[data-status].active:hover {
    background-color: rgba(18, 19, 26, 0.42);
    background-image:
      linear-gradient(90deg, rgba(var(--c), 0.34) 0%, rgba(var(--c), 0.09) 100%),
      linear-gradient(145deg, rgba(255,255,255,0.11) 0%, rgba(255,255,255,0.035) 100%);
    box-shadow: inset 3px 0 0 rgba(var(--c), 0.95);
  }
  .list-btn:nth-of-type(1)[data-status].active:hover {
    box-shadow: inset 3px 0 0 rgba(var(--c), 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.26);
  }
}

/* =====================================================================
   ФИЛЬТР: кнопки не двигаются при hover/нажатии + единый формат
   «Скрыть фильтр» (.filter-toggle-btn.open) и «Искать» (.filter-apply-btn)
   ---------------------------------------------------------------------
   • Убраны translateY(-1px) при hover и scale(0.95/0.96) при нажатии у
     toggle / apply / reset. Состояния меняются только цветом.
   • «Скрыть фильтр» и «Искать» — один формат: капсула, тот же шрифт,
     размер, паддинги и зелёное стекло. Иконка у «Скрыть фильтр» больше
     не переворачивается (стояла вверх ногами рядом с «Искать»); открыт
     или закрыт фильтр, показывает текст кнопки.
   • «Раскрыть фильтр» (закрытое состояние) остаётся нейтральным стеклом,
     но той же формы и размера.
   • Сброс — круглая кнопка той же высоты.
   • transition без transform (раньше был all).
   ===================================================================== */
.filter-toggle-btn,
.filter-apply-btn,
.filter-reset-btn {
  box-sizing: border-box;
  min-height: 42px;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}
.filter-toggle-btn:hover,
.filter-toggle-btn:active,
.filter-apply-btn:hover,
.filter-apply-btn:active,
.filter-reset-btn:hover,
.filter-reset-btn:active {
  transform: none;
}
.filter-toggle-btn.open svg { transform: none; }

/* Общий формат «Скрыть фильтр» / «Искать» */
.filter-toggle-btn,
.filter-apply-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 24px;
  border-radius: 999px;
  font-family: 'Rajdhani', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  line-height: 1.2;
  white-space: nowrap;
}
.filter-toggle-btn.open,
.filter-apply-btn {
  background:
    linear-gradient(135deg, rgba(74, 222, 128, 0.24) 0%, rgba(34, 197, 94, 0.09) 100%),
    rgba(18, 24, 22, 0.62);
  border: 1px solid rgba(74, 222, 128, 0.38);
  border-top: 1px solid rgba(255, 255, 255, 0.34);
  color: #f2fff6;
  backdrop-filter: blur(min(24px, var(--pf-cap, 999px))) saturate(190%);
  -webkit-backdrop-filter: blur(min(24px, var(--pf-cap, 999px))) saturate(190%);
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.filter-toggle-btn.open svg,
.filter-apply-btn svg { color: #4ade80; }
.filter-toggle-btn.open:hover,
.filter-apply-btn:hover {
  background:
    linear-gradient(135deg, rgba(74, 222, 128, 0.34) 0%, rgba(34, 197, 94, 0.14) 100%),
    rgba(18, 24, 22, 0.62);
  border-color: rgba(74, 222, 128, 0.52);
  border-top-color: rgba(255, 255, 255, 0.45);
  color: #fff;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
/* Закрытое состояние «Раскрыть фильтр»: hover без подъёма и без смены тени */
.filter-toggle-btn:not(.open):hover {
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Сброс — круг той же высоты */
.filter-reset-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  flex-shrink: 0;
}

/* =====================================================================
   ЧАТ ВРЕМЕННО УБРАН ИЗ НАВИГАЦИИ
   ---------------------------------------------------------------------
   Скрыта вкладка «Чат» в верхней панели (ПК, #tabChat) и пункт «Чат» в
   мобильном меню «Ещё». js/auth.js (updateGuestUI) снимает класс .hidden
   после входа, поэтому прячем через display:none !important — так вкладка
   не появляется и для вошедших пользователей.
   Разметка и логика чата не тронуты. Чтобы вернуть вкладку, удалите этот
   блок целиком.
   ===================================================================== */
#tabChat,
.msp-item[onclick*="switchTab('chat')"] {
  display: none !important;
}

/* =====================================================================
   СТАТИСТИКА — вариант «Бенто»
   ---------------------------------------------------------------------
   Разметка строится в js/stats.js (_buildStatsHTML). Плитки — это
   .stats-card (то же стекло, что у остальных карточек статистики) с
   классами sb-*: сетка 4 колонки, плитки разного размера. Классы sb-*
   используются только на странице «Статистика», вкладка статистики в
   профиле их не трогает.
   ===================================================================== */
.sb-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(92px, auto);
  gap: 14px;
  margin-bottom: 16px;
}
.sb-grid > .sb-cell {
  margin: 0;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.sb-s2 { grid-column: span 2; }
.sb-s4 { grid-column: span 4; }
.sb-r2 { grid-row: span 2; }

.sb-lab {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.sb-lab--mb { margin-bottom: 14px; }
.sb-big {
  margin-top: 6px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.5px;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.sb-big--xl { font-size: 38px; margin: 10px 0 6px; }
.sb-dim { font-size: 12px; color: rgba(255, 255, 255, 0.5); }
.sb-stars { margin-top: 4px; font-size: 14px; letter-spacing: 2px; color: #facc15; }

/* Крупная плитка времени — зелёный оттенок стекла */
.sb-time {
  background:
    linear-gradient(160deg, rgba(74, 222, 128, 0.22), rgba(74, 222, 128, 0.03) 60%),
    rgba(12, 14, 20, 0.65);
  border-color: rgba(74, 222, 128, 0.25);
}

/* Кольцевая диаграмма жанров */
.sb-donut { display: flex; align-items: center; gap: 22px; }
.sb-dn {
  width: 130px;
  height: 130px;
  flex-shrink: 0;
  border-radius: 50%;
  -webkit-mask: radial-gradient(closest-side, transparent 62%, #000 64%);
  mask: radial-gradient(closest-side, transparent 62%, #000 64%);
}
.sb-lg { min-width: 0; flex: 1; }
.sb-lg div { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12.5px; color: rgba(255, 255, 255, 0.8); }
.sb-lg i { width: 10px; height: 10px; flex-shrink: 0; border-radius: 3px; }
.sb-lg span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-lg b { font-size: 12px; color: rgba(255, 255, 255, 0.55); }

/* Факты внутри плитки — без лишних отступов */
.sb-cell .stats-facts { margin: 0; }

/* Столбики по году выхода */
.sb-yrs { display: flex; align-items: flex-end; gap: 6px; height: 140px; }
.sb-yr {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}
.sb-yr i {
  display: block;
  width: 100%;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.15));
}
.sb-yr.top { color: #fff; }
.sb-yr.top i { background: linear-gradient(180deg, #4ade80, rgba(74, 222, 128, 0.25)); }
.sb-yr em { height: 14px; font-style: normal; line-height: 14px; white-space: nowrap; }

@media (max-width: 680px) {
  .sb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .sb-s2, .sb-s4 { grid-column: span 2; }
  .sb-r2 { grid-row: auto; }
  .sb-big { font-size: 26px; }
  .sb-big--xl { font-size: 32px; }
  .sb-donut { flex-direction: column; align-items: flex-start; gap: 14px; }
  .sb-lg { width: 100%; }
}

/* =====================================================================
   СТАТИСТИКА — варианты блоков «Стрик» и «Активность по дням»
   (js/stats-variants.js). Классы sv-*.
   ===================================================================== */
.sv-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.sv-head .sv-title { margin: 0; }
.sv-sub { margin: 4px 0 0; font-size: 11px; color: rgba(255,255,255,.45); letter-spacing: .5px; }

.sv-peak { margin: 16px 0 0; font-size: 13px; color: rgba(255,255,255,.6); }
.sv-peak b { color: #fff; font-weight: 700; }

/* ── Стрик: тепловая карта ── */
.sv-heat { display: flex; gap: 26px; align-items: center; }
.sv-heat-side { display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; min-width: 130px; }
.sv-heat-num { display: flex; flex-direction: column; }
.sv-heat-num b { font-size: 36px; font-weight: 800; line-height: 1.05; color: #fff; }
.sv-heat-num span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: rgba(255,255,255,.5); }
.sv-heat-mini { font-size: 11.5px; color: rgba(255,255,255,.5); }
.sv-heat-mini b { color: #fff; }
.sv-heat-map { flex: 1; min-width: 0; }
.sv-heat-months { display: grid; margin: 0 0 4px 26px; font-size: 10px; color: rgba(255,255,255,.4); height: 12px; }
.sv-heat-months span { white-space: nowrap; }
.sv-heat-wrap { display: flex; gap: 6px; }
.sv-heat-days { display: grid; grid-template-rows: repeat(7, 1fr); width: 20px; font-size: 9.5px; color: rgba(255,255,255,.4); gap: 3px; }
.sv-heat-days span { display: flex; align-items: center; }
.sv-heat-grid { flex: 1; display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, auto); gap: 3px; min-width: 0; }
.sv-hc { display: block; aspect-ratio: 1; border-radius: 4px; background: rgba(255,255,255,.07); min-width: 0; }
.sv-hc.l1 { background: rgba(255,149,0,.28); }
.sv-hc.l2 { background: rgba(255,149,0,.5); }
.sv-hc.l3 { background: rgba(255,149,0,.75); }
.sv-hc.l4 { background: #ffb340; box-shadow: 0 0 8px rgba(255,149,0,.5); }
.sv-hc.future { background: transparent; }
.sv-hc.today { outline: 1.5px solid rgba(255,255,255,.7); outline-offset: 1px; }
.sv-heat-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 8px; font-size: 10px; color: rgba(255,255,255,.4); }
.sv-heat-legend .sv-hc { width: 11px; height: 11px; aspect-ratio: auto; }

/* ── Активность: плитки ── */
.sv-tiles { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.sv-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 4px 12px; border-radius: 16px; background: rgba(74,222,128,var(--a)); border: 1px solid rgba(255,255,255,.1); }
.sv-tile-l { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: rgba(255,255,255,.6); }
.sv-tile b { font-size: 24px; font-weight: 800; color: #fff; line-height: 1.2; font-variant-numeric: tabular-nums; }
.sv-tile em { font-style: normal; font-size: 10.5px; color: rgba(255,255,255,.5); }
.sv-tile.top { border-color: rgba(74,222,128,.7); box-shadow: 0 0 18px rgba(74,222,128,.25); }
.sv-tile.top .sv-tile-l { color: #fff; }

@media (max-width: 680px) {
  .sv-heat { flex-direction: column; align-items: stretch; gap: 16px; }
  .sv-heat-side { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 12px; }
  .sv-tiles { gap: 5px; }
  .sv-tile { padding: 10px 2px 8px; border-radius: 12px; }
  .sv-tile b { font-size: 17px; }
  .sv-tile em { display: none; }
}


/* Статистика внутри профиля — того же размера и центрирования (max-width: 900px),
   что и на отдельной странице «Статистика». */
.profile-stats-panel .stats-page.profile-stats-bento {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 0 60px;
}

/* ===== Мобильная версия: Библиотека рамок — непрозрачные шапка и вкладки ===== */
@media (max-width: 768px) {
  #frameLibraryModal .frame-shop-header {
    background: rgba(14, 18, 28, 0.96) !important;
    backdrop-filter: blur(18px) saturate(1.2) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.2) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
  }
  #frameLibraryModal .frame-shop-tabs {
    background: rgba(14, 18, 28, 0.96) !important;
    backdrop-filter: blur(18px) saturate(1.2) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.2) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
  }
  /* прокрутка внутри окна не «протекает» на страницу под ним */
  .modal-overlay,
  .modal-overlay .modal-box,
  .modal-overlay .modal,
  .modal-overlay .modal-body {
    overscroll-behavior: contain;
  }
}


/* ===== Страница аниме: убрана вся «пилюля» вокруг контента =====
   Общая карточка .detail-widget-frame (стеклянная плашка вокруг постера,
   описания, плеера и «Других сезонов») больше ничего не рисует: ни рамки,
   ни фона, ни тени, ни blur, ни верхней блик-линии. Отступы (padding)
   оставлены, чтобы раскладка не сдвинулась. !important — чтобы перебить
   мобильные и perf-minimal правила выше. */
.detail-widget-frame,
html.perf-minimal .detail-widget-frame {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.detail-widget-frame::before,
.detail-widget-frame::after {
  display: none !important;
}
/* ==========================================================
   NEKONEST — MODERATION, COMPLAINTS & ADMIN PANEL STYLES
   ========================================================== */

/* Badge in account menu / header */
.admin-badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  background: #ff3366;
  color: #fff;
  box-shadow: 0 0 10px rgba(255, 51, 102, 0.5);
  line-height: 1;
}

/* ==========================================================
   ADMIN / MODERATION PANEL (Clean Cyberpunk Glassmorphism)
   ========================================================== */
.admin-page {
  max-width: 980px !important;
}

.admin-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 4px 2px 20px;
}

.admin-topbar-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-topbar-title-wrap h1 {
  margin: 0;
  font-family: 'Rajdhani', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.admin-role-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

.admin-role-pill.role-admin {
  background: rgba(255, 42, 109, 0.18);
  border: 1px solid rgba(255, 42, 109, 0.45);
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  color: #ff4d88;
}

.admin-role-pill.role-mod {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
}

/* Sub-navigation tabs: sleek glass pill container matching site navigation */
.admin-subnav {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 18px 0 24px;
  padding: 4px;
  background: rgba(14, 18, 26, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  backdrop-filter: blur(min(24px, var(--pf-cap, 999px))) saturate(190%);
  -webkit-backdrop-filter: blur(min(24px, var(--pf-cap, 999px))) saturate(190%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.admin-subnav::-webkit-scrollbar { display: none; }

.admin-subnav .pill-thumb,
.admin-pill-thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.22) 0%,
      rgba(255, 255, 255, 0.08) 50%,
      rgba(255, 255, 255, 0.14) 100%),
    rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-top-color: rgba(255, 255, 255, 0.45);
  border-radius: 9px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.32s cubic-bezier(.22, 1, .36, 1), width 0.32s cubic-bezier(.22, 1, .36, 1);
  z-index: 0;
  pointer-events: none;
}

.admin-subnav-btn {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  color: rgba(255, 255, 255, 0.65);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  transform: none !important;
  outline: none;
}

.admin-subnav-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
  transform: none !important;
}

/* Fallback static active button (if JS sliding thumb isn't active yet) */
.admin-subnav-btn.active {
  color: #ffffff;
  font-weight: 700;
  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.22) 0%,
      rgba(255, 255, 255, 0.08) 50%,
      rgba(255, 255, 255, 0.14) 100%),
    rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-top-color: rgba(255, 255, 255, 0.45);
  border-radius: 9px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.admin-subnav.pill-toggle .admin-subnav-btn.active {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

/* Admin container / Section */
.admin-page-section {
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%),
    rgba(14, 16, 22, 0.65);
  backdrop-filter: blur(min(36px, var(--pf-cap, 999px))) saturate(200%);
  -webkit-backdrop-filter: blur(min(36px, var(--pf-cap, 999px))) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-top: 1px solid rgba(255, 255, 255, 0.26);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  padding: 24px 26px;
  margin-bottom: 24px;
}

/* Filters bar: clean glass container */
.admin-filters-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
  padding: 14px 18px;
  background: rgba(14, 18, 26, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.admin-filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-filter-label {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.45);
  min-width: 55px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.admin-filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-chip {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.65);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Rajdhani', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  transform: none !important;
  outline: none;
}

.admin-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  transform: none !important;
}

/* Clean active chip: white frosted glass slider, NO CYAN */
.admin-chip.active {
  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.24) 0%,
      rgba(255, 255, 255, 0.08) 50%,
      rgba(255, 255, 255, 0.15) 100%),
    rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-top-color: rgba(255, 255, 255, 0.5);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

/* Report Cards */
.admin-reports-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-report-card {
  padding: 20px 22px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%), rgba(14, 18, 26, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 18px;
  backdrop-filter: blur(min(28px, var(--pf-cap, 999px))) saturate(180%);
  -webkit-backdrop-filter: blur(min(28px, var(--pf-cap, 999px))) saturate(180%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.admin-report-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%), rgba(14, 18, 26, 0.75);
}

.admin-report-header,
.admin-rep-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.admin-report-tags,
.admin-rep-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-type-pill {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.report-status-badge {
  padding: 4px 10px;
  border-radius: 8px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.report-status-badge.status-new {
  background: rgba(255, 77, 106, 0.18);
  border: 1px solid rgba(255, 77, 106, 0.45);
  color: #ff4d6a;
}

.report-status-badge.status-in_progress {
  background: rgba(255, 184, 0, 0.18);
  border: 1px solid rgba(255, 184, 0, 0.45);
  color: #ffb800;
}

.report-status-badge.status-resolved {
  background: rgba(0, 255, 179, 0.16);
  border: 1px solid rgba(0, 255, 179, 0.45);
  color: #00ffb3;
}

.report-status-badge.status-rejected {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.45);
}

.admin-report-time,
.admin-rep-date {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

/* User Inspector Links in Report Cards */
.admin-report-info-grid {
  display: flex;
  gap: 20px;
  margin: 6px 0 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.ar-lbl {
  color: rgba(255, 255, 255, 0.45);
  font-family: 'Rajdhani', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 6px;
}

/* Styled interactive link-button for users (fixes unstyled white boxes) */
.admin-link-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  padding: 3px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  line-height: 1.35;
  transition: all 0.2s ease;
  transform: none !important;
  outline: none;
}

.admin-link-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.32);
  color: #ffffff;
  transform: none !important;
}

.admin-report-reason,
.admin-rep-reason {
  font-size: 14.5px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 8px;
}

.admin-report-details,
.admin-rep-details {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 0, 0.35);
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 10px;
  border-left: 3px solid rgba(255, 255, 255, 0.25);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
}

.report-content-preview,
.admin-rep-snapshot {
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 8px;
  margin-bottom: 12px;
  backdrop-filter: blur(10px);
}

.rc-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 4px;
}

.rc-comment-text {
  font-style: italic;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 4px;
}

.rc-meta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.report-actions-row,
.admin-rep-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ==========================================================
   GLASS BUTTONS: Clean, rock-solid, no shifting, no glowing halos
   ========================================================== */
.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Rajdhani', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  backdrop-filter: blur(min(16px, var(--pf-cap, 999px))) saturate(180%);
  -webkit-backdrop-filter: blur(min(16px, var(--pf-cap, 999px))) saturate(180%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  transform: none !important;
  outline: none;
}

/* Absolute prohibition on button shifting on hover or click */
.admin-btn:hover,
.admin-btn:active,
.admin-btn:focus {
  transform: none !important;
}

.admin-btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 10px;
}

/* Primary Glass Button (Frost/White) - NO CYAN */
.admin-btn-primary {
  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.2) 0%,
      rgba(255, 255, 255, 0.06) 100%),
    rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-top-color: rgba(255, 255, 255, 0.45);
  color: #ffffff;
}

.admin-btn-primary:hover {
  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.3) 0%,
      rgba(255, 255, 255, 0.1) 100%),
    rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: rgba(255, 255, 255, 0.6);
  color: #ffffff;
}

/* Danger Glass Button (Coral/Ruby Glass) - clean, no glowing aura */
.admin-btn-danger {
  background:
    linear-gradient(180deg,
      rgba(255, 77, 106, 0.2) 0%,
      rgba(255, 77, 106, 0.06) 100%),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 77, 106, 0.35);
  border-top-color: rgba(255, 120, 150, 0.55);
  color: #ff758f;
}

.admin-btn-danger:hover {
  background:
    linear-gradient(180deg,
      rgba(255, 77, 106, 0.32) 0%,
      rgba(255, 77, 106, 0.12) 100%),
    rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 77, 106, 0.55);
  border-top-color: rgba(255, 140, 170, 0.75);
  color: #ffffff;
}

/* Success Glass Button (Emerald Glass) - clean, no glowing aura */
.admin-btn-success {
  background:
    linear-gradient(180deg,
      rgba(0, 230, 118, 0.18) 0%,
      rgba(0, 230, 118, 0.05) 100%),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(0, 230, 118, 0.32);
  border-top-color: rgba(100, 255, 180, 0.5);
  color: #5cf2a3;
}

.admin-btn-success:hover {
  background:
    linear-gradient(180deg,
      rgba(0, 230, 118, 0.28) 0%,
      rgba(0, 230, 118, 0.1) 100%),
    rgba(255, 255, 255, 0.06);
  border-color: rgba(0, 230, 118, 0.55);
  border-top-color: rgba(120, 255, 190, 0.7);
  color: #ffffff;
}

/* Outline / Neutral Glass Button (Dismiss / Reject) */
.admin-btn-outline,
.admin-btn-muted {
  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.12) 0%,
      rgba(255, 255, 255, 0.04) 100%),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.75);
}

.admin-btn-outline:hover,
.admin-btn-muted:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

/* Ghost Glass Button (Cancel / Link) */
.admin-btn-ghost {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-top-color: rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}

.admin-btn-ghost:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.30);
}

/* User search & inspection */
.admin-search-box {
  position: relative;
  margin-bottom: 20px;
}

.admin-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

.admin-search-input {
  width: 100%;
  padding: 14px 16px 14px 46px;
  background: rgba(14, 18, 26, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  color: #ffffff;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.admin-search-input:focus {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(14, 18, 26, 0.85);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08), inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

.admin-user-search-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.admin-user-search-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

/* NO transform on user search row hover */
.admin-user-search-row:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
}

.admin-user-row-avatar-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-user-row-info {
  flex: 1;
}

.admin-user-row-nick {
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.3px;
}

.admin-user-row-id {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  font-family: monospace;
}

/* User Card Details */
.admin-profile-fullcard {
  padding: 26px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.02) 100%), rgba(14, 18, 26, 0.72);
  backdrop-filter: blur(min(32px, var(--pf-cap, 999px))) saturate(190%);
  -webkit-backdrop-filter: blur(min(32px, var(--pf-cap, 999px))) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 20px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.ap-header {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
}

.ap-avatar-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ap-main-info {
  flex: 1;
}

.ap-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ap-nickname {
  margin: 0;
  font-family: 'Rajdhani', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
}

.ap-role-tag {
  padding: 3px 10px;
  border-radius: 999px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.ap-role-tag.role-admin {
  background: rgba(255, 42, 109, 0.2);
  border: 1px solid rgba(255, 42, 109, 0.45);
  color: #ff4d88;
}

.ap-role-tag.role-mod {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.ap-role-tag.role-user {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
}

.ap-email-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.65);
}

.ap-meta-sub {
  margin-top: 4px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.4);
}

.ap-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 18px 0;
  padding: 16px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  backdrop-filter: blur(8px);
}

.ap-stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ap-stat-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.ap-stat-val {
  font-size: 13.5px;
  color: #ffffff;
}

.ap-toolbar,
.ap-actions-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-select-sm,
.ap-role-select {
  padding: 8px 14px;
  background: var(--gm-field-fill);
  border: 1px solid var(--gm-field-border);
  border-radius: 12px;
  color: #fff;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

.admin-select-sm option,
.ap-role-select option {
  background: #0f141f;
  color: #fff;
}

/* Audit table */
.admin-audit-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.admin-audit-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  font-size: 13px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  word-break: break-word;
}

.audit-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.audit-actor-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.audit-actor {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.3px;
}

.audit-arrow {
  color: rgba(255, 255, 255, 0.35);
  font-size: 12px;
}

.audit-target {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.7);
}

.audit-target strong {
  color: #ffffff;
}

.audit-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.85);
}

.audit-badge--danger {
  background: rgba(255, 51, 102, 0.18);
  border-color: rgba(255, 51, 102, 0.45);
  color: #ff4d88;
}

.audit-badge--warn {
  background: rgba(255, 179, 0, 0.16);
  border-color: rgba(255, 179, 0, 0.45);
  color: #ffc107;
}

.audit-badge--success {
  background: rgba(0, 230, 153, 0.16);
  border-color: rgba(0, 230, 153, 0.45);
  color: #00e699;
}

.audit-badge--info {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.audit-badge--role {
  background: rgba(147, 112, 219, 0.18);
  border-color: rgba(147, 112, 219, 0.45);
  color: #b197fc;
}

.audit-time {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
  font-family: 'Rajdhani', monospace;
  margin-left: auto;
}

.audit-details,
.admin-audit-details {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 8px 12px;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  line-height: 1.45;
  box-sizing: border-box;
  max-width: 100%;
  width: 100%;
}

.audit-details code,
.admin-audit-details code {
  font-family: monospace;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.75);
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.audit-details strong,
.admin-audit-details strong {
  color: #ffffff;
}

.audit-details em,
.admin-audit-details em {
  color: rgba(255, 255, 255, 0.9);
  font-style: normal;
}

/* Official Support Profile Card */
.profile-support-card {
  margin-top: 24px;
  padding: 26px 22px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  text-align: center;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.profile-support-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.profile-support-desc {
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 18px;
}

.profile-support-start-chat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Modals & Forms */
.report-modal-box,
.admin-modal-box {
  max-width: 480px;
}

.report-section-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.report-preview-wrap {
  margin-bottom: 16px;
}

.report-preview-box {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
}

.report-preview-author {
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}

.report-preview-text {
  font-style: italic;
  color: rgba(255, 255, 255, 0.78);
}

.report-reasons-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report-reason-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.report-reason-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}

/* Checked reason state without glowing box-shadow */
.report-reason-item:has(input:checked) {
  background: rgba(255, 42, 109, 0.14);
  border-color: rgba(255, 42, 109, 0.55);
}

.report-reason-item input[type="radio"] {
  accent-color: #ff3366;
  width: 16px;
  height: 16px;
}

.report-reason-label {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.9);
}

.admin-input,
.admin-select,
.admin-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--gm-field-fill);
  border: 1px solid var(--gm-field-border);
  border-radius: 14px;
  color: #f4f4f7;
  font-size: 13.5px;
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.22);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.admin-input:focus,
.admin-select:focus,
.admin-textarea:focus {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08), inset 0 2px 6px rgba(0, 0, 0, 0.22);
}

.admin-select option {
  background: #0f141f;
  color: #fff;
}

.admin-checkbox-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #ffffff;
  cursor: pointer;
}

.admin-checkbox-label input[type="checkbox"] {
  accent-color: #ffffff;
  width: 16px;
  height: 16px;
}

.admin-checkbox-hint {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.45);
  margin-left: 24px;
}

.admin-modal-desc {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 14px;
}

.admin-loading,
.admin-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 20px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13.5px;
}

.admin-spinner {
  width: 26px;
  height: 26px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

/* Button on comment cards */
.site-cmt-report-btn {
  color: rgba(255, 255, 255, 0.35);
  margin-left: auto;
}

.site-cmt-report-btn:hover {
  color: #ff4d6a;
}

/* Buttons in profile */
.profile-report-btn {
  border-color: rgba(255, 77, 106, 0.3);
  color: rgba(255, 255, 255, 0.7);
}

.profile-report-btn:hover {
  border-color: rgba(255, 77, 106, 0.7);
  color: #ff4d6a;
}

.profile-avatar-flag-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  z-index: 2;
}

.profile-avatar-flag-btn:hover {
  background: rgba(255, 51, 102, 0.3);
  border-color: #ff4d79;
  color: #ff4d79;
}

/* ==========================================================
   ADMIN PANEL: Mobile Responsive Adaptations
   ========================================================== */
@media (max-width: 768px) {
  #adminSection {
    padding-bottom: 95px !important; /* space for mobile bottom dock */
  }

  .admin-page-section {
    padding: 16px 14px;
    border-radius: 16px;
  }

  .admin-topbar {
    margin-bottom: 14px;
  }

  .admin-topbar-title-wrap h1 {
    font-size: 20px;
  }

  .admin-subnav {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    padding: 3px;
    gap: 3px;
    margin: 12px 0 18px;
    overflow-x: auto;
  }

  .admin-subnav-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 4px;
    font-size: 12px;
    justify-content: center;
    gap: 5px;
    text-align: center;
  }

  .admin-filters-bar {
    padding: 12px 14px;
    border-radius: 14px;
  }

  .admin-filter-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .admin-chip {
    padding: 5px 12px;
    font-size: 12px;
  }

  .admin-report-card {
    padding: 14px 14px;
    border-radius: 14px;
  }

  .admin-report-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .admin-report-info-grid {
    flex-direction: column;
    gap: 8px;
  }

  .report-actions-row,
  .admin-rep-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .report-actions-row .admin-btn,
  .admin-rep-actions .admin-btn {
    width: 100%;
    justify-content: center;
  }

  .admin-audit-row {
    padding: 12px 14px;
    gap: 8px;
  }

  .audit-row-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .audit-time {
    margin-left: 0;
  }

  .ap-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .ap-name-row {
    justify-content: center;
  }

  .ap-email-row {
    justify-content: center;
  }

  .ap-meta-row {
    justify-content: center;
  }

  .ap-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .ap-toolbar .admin-btn {
    width: 100%;
    justify-content: center;
  }

  .ap-role-dropdown-wrap {
    width: 100%;
  }

  .admin-select-sm {
    width: 100%;
  }

  .admin-modal-box {
    max-width: 95vw;
    padding: 18px 16px;
    margin: 12px;
  }
}

@media (max-width: 420px) {
  .admin-subnav-btn {
    font-size: 11px;
    padding: 7px 2px;
    gap: 3px;
  }

  .admin-subnav-btn svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
  }

  .admin-chip {
    padding: 4px 10px;
    font-size: 11.5px;
  }
}

/* ── Окно жалобы на пользователя (#reportModal) — мобильный нижний лист (аналог Редактировать профиль) ──── */
@media (max-width: 768px) {
  #reportModal.modal-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  #reportModal .modal-box,
  #reportModal .report-modal-box {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    max-height: min(88vh, calc(100vh - 20px)) !important;
    max-height: min(88dvh, calc(100dvh - 20px)) !important;
    border-radius: 22px 22px 0 0 !important;
    border-bottom: none !important;
    box-shadow:
      0 -8px 40px rgba(0, 0, 0, 0.65),
      inset 0 1px 0 rgba(255, 255, 255, 0.26) !important;
    animation: xpSheetUp 0.32s cubic-bezier(0.22, 1, 0.36, 1) !important;
    touch-action: pan-y;
    padding: 0 0 calc(24px + env(safe-area-inset-bottom, 0px)) !important;
    display: flex !important;
    flex-direction: column !important;
    background: var(--gm-fill) !important;
    backdrop-filter: var(--gm-blur) !important;
    -webkit-backdrop-filter: var(--gm-blur) !important;
  }

  /* Полоска-хэндл сверху */
  #reportModal .modal-box::before {
    content: '' !important;
    display: block !important;
    flex-shrink: 0 !important;
    width: 36px !important;
    height: 4px !important;
    border-radius: 2px !important;
    background: rgba(255, 255, 255, 0.28) !important;
    margin: 8px auto 0 !important;
  }

  #reportModal .modal-header {
    margin-bottom: 0 !important;
    padding: 10px 16px 12px !important;
    border-radius: 0 !important;
    background: none !important;
    cursor: grab;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  #reportModal .modal-title {
    font-size: 14.5px !important;
    font-family: 'Rajdhani', sans-serif !important;
    font-weight: 700 !important;
    letter-spacing: 0.6px !important;
    text-transform: uppercase !important;
    color: #ffffff !important;
    margin: 0 !important;
  }

  #reportModal .modal-close {
    background: none !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.7) !important;
    padding: 4px !important;
    cursor: pointer;
  }

  #reportModal .modal-body {
    flex: 1 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    padding: 14px 16px 8px !important;
  }

  #reportModal .report-preview-box {
    background: var(--gm-field-fill) !important;
    border: 1px solid var(--gm-field-border) !important;
    border-radius: 14px !important;
    padding: 11px 14px !important;
    font-size: 13px !important;
    color: rgba(255, 255, 255, 0.9) !important;
    margin-bottom: 14px !important;
  }

  #reportModal .report-section-label {
    font-family: 'Rajdhani', sans-serif !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.8px !important;
    text-transform: uppercase !important;
    color: rgba(255, 255, 255, 0.55) !important;
    margin-bottom: 8px !important;
  }

  #reportModal .report-reasons-wrap {
    display: flex !important;
    flex-direction: column !important;
    gap: 7px !important;
    margin-bottom: 14px !important;
  }

  #reportModal .report-reason-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 10px 14px !important;
    background: var(--gm-field-fill) !important;
    border: 1px solid var(--gm-field-border) !important;
    border-radius: 12px !important;
    transition: background 0.18s ease, border-color 0.18s ease !important;
  }

  #reportModal .report-reason-item:has(input:checked) {
    background: rgba(255, 255, 255, 0.10) !important;
    border-color: rgba(255, 255, 255, 0.38) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
  }

  #reportModal .report-reason-item input[type="radio"] {
    accent-color: #ffffff !important;
    width: 17px !important;
    height: 17px !important;
    margin: 0 !important;
  }

  #reportModal .report-reason-label {
    font-size: 13px !important;
    color: rgba(255, 255, 255, 0.9) !important;
  }

  #reportModal .admin-textarea {
    width: 100% !important;
    box-sizing: border-box !important;
    background: var(--gm-field-fill) !important;
    border: 1px solid var(--gm-field-border) !important;
    border-radius: 12px !important;
    color: #fff !important;
    font-size: 13px !important;
    padding: 10px 14px !important;
    min-height: 72px !important;
    resize: none !important;
  }

  #reportModal .modal-actions {
    display: flex !important;
    gap: 10px !important;
    margin-top: 16px !important;
    width: 100% !important;
  }

  #reportModal #reportSubmitBtn {
    flex: 1 !important;
    min-height: 44px !important;
    padding: 12px 14px !important;
    border-radius: 14px !important;
    background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(232,232,240,0.80)) !important;
    border: 1px solid rgba(255, 255, 255, 0.55) !important;
    color: #0c0c10 !important;
    font-family: 'Rajdhani', sans-serif !important;
    font-size: 12.5px !important;
    font-weight: 800 !important;
    letter-spacing: 1.2px !important;
    text-transform: uppercase !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 10px 24px -4px rgba(0, 0, 0, 0.45), inset 0 1px 0 #ffffff !important;
  }

  #reportModal #reportSubmitBtn:active {
    transform: scale(0.98) !important;
  }

  #reportModal .modal-actions .admin-btn-ghost {
    flex: 1 !important;
    min-height: 44px !important;
    padding: 12px 14px !important;
    border-radius: 14px !important;
    background: rgba(255, 255, 255, 0.07) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    color: rgba(255, 255, 255, 0.72) !important;
    font-family: 'Rajdhani', sans-serif !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10) !important;
  }

  #reportModal .modal-actions .admin-btn-ghost:active {
    transform: scale(0.98) !important;
  }
}

/* =====================================================
   MOBILE DETAIL INFO — аккуратная «стеклянная» раскладка
   (статус + возраст, оценка с полоской, мета, рейтинги, студия, просмотры)
   ===================================================== */
@media (max-width: 768px) {
  .mobile-detail-info {
    gap: 10px !important;
    min-height: 0;
    justify-content: space-between !important;
  }
  .mobile-detail-info .mdi-head { gap: 8px; }
  .mobile-detail-info .mdi-chips {
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  }
  .mobile-detail-info .mdi-status {
    padding: 5px 11px !important;
    font-size: 9.5px !important;
  }
  .mobile-detail-info .mdi-age {
    font-family: 'Rajdhani', sans-serif;
    font-size: 10.5px; font-weight: 800; letter-spacing: .5px; line-height: 1;
    padding: 5px 8px; border-radius: 999px;
    color: #ffc83c;
    background: rgba(255,200,60,.10);
    border: 1px solid rgba(255,200,60,.28);
  }

  .mobile-detail-info .mdi-score-wrap { display: flex; flex-direction: column; gap: 7px; }
  .mobile-detail-info .mdi-score {
    font-size: 34px !important;
    margin-top: 0 !important;
    text-shadow: 0 2px 14px rgba(0,0,0,.45);
  }
  .mobile-detail-info .mdi-score span { font-size: 13px !important; margin-left: 2px; }
  .mobile-detail-info .mdi-bar {
    display: block; height: 3px; border-radius: 99px;
    background: rgba(255,255,255,.10); overflow: hidden;
  }
  .mobile-detail-info .mdi-bar i {
    display: block; height: 100%; border-radius: 99px;
    box-shadow: 0 0 8px currentColor;
  }

  .mobile-detail-info .mdi-info-block { gap: 8px; margin-top: 0; }
  .mobile-detail-info .mdi-primary-meta {
    font-size: 13px !important;
    color: rgba(255,255,255,.85) !important;
    font-weight: 600;
    letter-spacing: .2px;
    display: block !important;
    -webkit-line-clamp: unset;
  }

  .mobile-detail-info .mdi-rates {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  }
  .mobile-detail-info .mdi-rate,
  .mobile-detail-info .mdi-studio {
    display: flex; flex-direction: column; gap: 3px; min-width: 0;
    padding: 7px 10px; border-radius: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
    border: 1px solid rgba(255,255,255,.09);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
  }
  .mobile-detail-info .mdi-lbl {
    font-family: 'Rajdhani', sans-serif;
    font-size: 9.5px; font-weight: 700; line-height: 1;
    letter-spacing: 1.2px; text-transform: uppercase;
    color: rgba(255,255,255,.42);
  }
  .mobile-detail-info .mdi-rate b,
  .mobile-detail-info .mdi-studio b {
    font-family: 'Rajdhani', sans-serif;
    font-size: 15px; font-weight: 700; line-height: 1.15;
    color: rgba(255,255,255,.95);
  }
  .mobile-detail-info .mdi-studio b {
    font-size: 13.5px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }

  .mobile-detail-info .mdi-views {
    display: flex !important; align-items: center; gap: 6px;
    font-size: 11.5px !important;
    color: rgba(255,255,255,.4) !important;
    -webkit-line-clamp: unset;
  }
  .mobile-detail-info .mdi-views svg { flex-shrink: 0; opacity: .8; }
}

/* Просмотры — читаемая «стеклянная» плашка */
@media (max-width: 768px) {
  .mobile-detail-info .mdi-views {
    align-self: flex-start;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px !important;
    color: rgba(255,255,255,.72) !important;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.14);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
    line-height: 1;
  }
  .mobile-detail-info .mdi-views svg { opacity: 1; color: #fff; }
  .mobile-detail-info .mdi-views b {
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px; font-weight: 700; color: #fff; letter-spacing: .3px;
  }
}

/* ══════════════════════════════════════════════════════
   ПРОФИЛЬ: СТАТУС
   ══════════════════════════════════════════════════════ */
.profile-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 4px 0 6px 0;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
  color: var(--text-primary, #f0f0f5);
  max-width: 100%;
  word-break: break-word;
}
.profile-status-badge .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00e5ff;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.85);
  flex-shrink: 0;
}
.profile-status-badge .status-text {
  line-height: 1.3;
  font-style: italic;
  opacity: 0.95;
}

@media (max-width: 768px) {
  .profile-status-badge {
    font-size: 12px;
    padding: 3px 10px;
  }
}

/* ══════════════════════════════════════════════════════
   ЕДИНЫЙ ФОРМАТ ВСЕХ МОБИЛЬНЫХ ОКОН / ШТОРОК (BOTTOM SHEETS)
   ══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* 0. Все скрытые модальные окна ВСЕГДА скрыты с высшим приоритетом */
  .modal-overlay.hidden,
  .modal-overlay--sheet.hidden,
  #authGate.auth-gate.hidden,
  #frameLibraryModal.hidden,
  #reportModal.hidden,
  #xpHistoryModal.hidden,
  #editProfileModal.hidden,
  #nicknameModal.hidden,
  #passwordRecoveryModal.hidden,
  #adminMessageModal.hidden,
  #adminPunishModal.hidden,
  #levelUpModal.hidden,
  #trailerModal.hidden,
  #imgLightboxModal.hidden {
    display: none !important;
  }

  /* 1. Все открытые модальные оверлеи прижимаются строго к низу экрана */
  .modal-overlay:not(#frameLibraryModal):not(.hidden),
  .modal-overlay--sheet:not(.hidden),
  #authGate.auth-gate:not(.hidden),
  #reportModal.modal-overlay:not(.hidden),
  #xpHistoryModal.modal-overlay:not(.hidden),
  #editProfileModal.modal-overlay:not(.hidden),
  #nicknameModal.modal-overlay:not(.hidden),
  #passwordRecoveryModal.modal-overlay:not(.hidden),
  #adminMessageModal.modal-overlay:not(.hidden),
  #adminPunishModal.modal-overlay:not(.hidden),
  #levelUpModal.modal-overlay:not(.hidden),
  #trailerModal.modal-overlay:not(.hidden) {
    position: fixed !important;
    inset: 0 !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 99998 !important;
    background: rgba(2, 4, 12, 0.74) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
  }

  /* 2. Все внутренние карточки модальных окон — единый формат шторки, как Уведомления */
  .modal-overlay:not(#frameLibraryModal) .modal-box,
  .modal-overlay:not(#frameLibraryModal) .modal-box--wide,
  .modal-overlay--sheet .modal-box,
  .modal-overlay--sheet .modal-box--wide,
  .modal-overlay .modal.xp-modal,
  .modal-overlay .report-modal-box,
  .modal-overlay .admin-modal-box,
  #authGate .auth-box,
  #authGate .auth-box.v2,
  #trailerModal .modal-box,
  #passwordRecoveryModal .modal-box,
  #nicknameModal .modal-box,
  #adminMessageModal .modal-box,
  #adminPunishModal .modal-box,
  #levelUpModal .modal-box,
  #editProfileModal .modal-box {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    margin-bottom: 0 !important;
    bottom: 0 !important;
    max-height: min(88vh, calc(100vh - 20px)) !important;
    max-height: min(88dvh, calc(100dvh - 20px)) !important;
    height: auto !important;
    border-radius: 22px 22px 0 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    border-bottom: none !important;
    background: rgba(18, 20, 28, 0.95) !important;
    backdrop-filter: blur(28px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.22) !important;
    animation: xpSheetUp 0.30s cubic-bezier(0.22, 1, 0.36, 1) !important;
    touch-action: pan-y !important;
    padding: 0 16px calc(24px + env(safe-area-inset-bottom, 0px)) !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* 3. Единая полоска-хэндл (36×4px) сверху для всех шторок */
  .modal-overlay:not(#frameLibraryModal) .modal-box::before,
  .modal-overlay .modal.xp-modal::before,
  .modal-overlay .report-modal-box::before,
  #authGate .auth-box::before,
  #authGate .auth-box.v2::before {
    content: '' !important;
    display: block !important;
    flex-shrink: 0 !important;
    width: 36px !important;
    height: 4px !important;
    border-radius: 2px !important;
    background: rgba(255, 255, 255, 0.32) !important;
    margin: 8px auto 6px !important;
    cursor: grab;
    touch-action: none;
  }

  /* 4. Единая шапка модальных окон */
  .modal-overlay:not(#frameLibraryModal) .modal-header,
  .modal-overlay--sheet .modal-header {
    margin-bottom: 0 !important;
    padding: 8px 0 12px !important;
    border-radius: 0 !important;
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-shrink: 0 !important;
    cursor: grab;
    touch-action: none;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
  }

  /* 5. Заголовок модалки */
  .modal-overlay:not(#frameLibraryModal) .modal-title,
  .modal-overlay--sheet .modal-title {
    font-size: 14.5px !important;
    font-family: 'Rajdhani', sans-serif !important;
    font-weight: 700 !important;
    letter-spacing: 0.7px !important;
    text-transform: uppercase !important;
    color: #ffffff !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
  }

  /* 6. Кнопка закрытия */
  .modal-overlay:not(#frameLibraryModal) .modal-close,
  .modal-overlay--sheet .modal-close,
  #authGate .auth-gate-close {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: rgba(255, 255, 255, 0.75) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    transition: background 0.15s, color 0.15s !important;
  }

  .modal-overlay .modal-close:hover,
  .modal-overlay .modal-close:active {
    background: rgba(255, 255, 255, 0.16) !important;
    color: #ffffff !important;
  }

  /* 7. Тело модалки и скролл */
  .modal-overlay:not(#frameLibraryModal) .modal-body,
  .modal-overlay--sheet .modal-body {
    background: transparent !important;
    border: none !important;
    padding: 12px 0 6px !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
  }

  /* 8. Состояние плавного перетаскивания шторки */
  .modal-box.sheet--dragging,
  .report-modal-box.sheet--dragging,
  .modal.xp-modal.sheet--dragging,
  .auth-box.sheet--dragging,
  #mobileListsPopup.sheet--dragging,
  #mobileSettingsPopup.sheet--dragging,
  .notif-dropdown.sheet--dragging {
    transition: none !important;
    will-change: transform !important;
  }
}
