/* =========================================================================
 * Страницы: лента клипов, просмотр видео, канал, чаты, студия и т.д.
 * ========================================================================= */

/* ---------- Лента клипов ---------- */
body.page-feed { overflow: hidden; }
.feed { position: relative; height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h)); display: flex; flex-direction: column; }
.feed-tabs { display: flex; justify-content: center; gap: var(--s2); padding: var(--s1) 0 0; flex-shrink: 0; }
.feed-tab { height: 40px; padding: 0 20px; border-radius: var(--r-pill); color: var(--text-2); font-weight: 600; font-size: 14px; transition: background-color var(--dur) var(--ease-soft), color var(--dur) var(--ease-soft), transform 0.18s var(--ease-soft); }
.feed-tab:hover { background: var(--hover); color: var(--text); }
.feed-tab:active { transform: scale(0.96); }
.feed-tab.active { background: var(--active-bg); color: var(--active-ink); }
.feed-stage { position: relative; flex: 1; min-height: 0; display: flex; }
.feed-scroller { flex: 1; min-width: 0; height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.feed-scroller::-webkit-scrollbar { display: none; }
.slide { height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: flex; align-items: center; justify-content: center; gap: var(--s4); padding: var(--s4) 0; position: relative; }
.slide-empty { display: block; }
.player {
  position: relative; height: 100%; aspect-ratio: 9 / 16; max-width: calc(100vw - 32px);
  border-radius: var(--r-card); overflow: hidden; background: var(--media-bg); color: #fff;
  isolation: isolate; transform: translateZ(0); box-shadow: var(--shadow-card);
  user-select: none; -webkit-user-select: none;
}
.player video, .player .p-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.player.landscape video, .player.landscape .p-poster { object-fit: contain; }
/* «Развернуть» под широким кадром — как в приложении */
.p-expand {
  position: absolute; left: 50%; top: 60%; transform: translateX(-50%); z-index: 2;
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px;
  border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 13px; font-weight: 600;
}
.p-expand:hover { background: rgba(255, 255, 255, 0.26); }
.feed.clean .p-expand { opacity: 0; pointer-events: none; }
/* Строка звука: «Оригинальный звук · автор» → страница звука */
.p-sound { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; margin-top: 8px; font-size: 13px; font-weight: 600; color: #fff; }
.p-sound span { min-width: 0; }
.p-sound:hover span { text-decoration: underline; }
.feed.feed-list .feed-tabs { display: none; }
.p-tap { position: absolute; inset: 0; z-index: 1; cursor: pointer; }
.p-top { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 2; display: flex; gap: var(--s2); align-items: center; }
.p-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; color: #fff; background: rgba(0, 0, 0, 0.3); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: background-color var(--dur) var(--ease-soft), transform 0.18s var(--ease-soft); }
.p-btn:active { transform: scale(0.92); }
.p-btn:hover { background: rgba(0, 0, 0, 0.55); }
.p-speed { padding: 3px 10px; border-radius: var(--r-pill); background: rgba(0, 0, 0, 0.5); font-weight: 700; font-size: 13px; }
.p-paused { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; font-size: 72px; pointer-events: none; text-shadow: 0 2px 12px rgba(0,0,0,0.5); }
.p-paused[hidden] { display: none; }
.p-cap { position: absolute; left: 0; right: 0; bottom: 22px; z-index: 2; padding: 0 var(--s4); text-shadow: 0 1px 3px rgba(0,0,0,0.8); pointer-events: none; }
.p-cap a, .p-cap button, .p-cap .p-desc { pointer-events: auto; }
.p-author { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s2); }
.p-name { font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-name .bi { font-size: 13px; }
.p-follow { height: 32px; padding: 0 14px; border-radius: var(--r-pill); background: #fff; color: #0f0f0f; font-weight: 600; font-size: 13px; text-shadow: none; flex-shrink: 0; }
.p-follow.on { background: rgba(255,255,255,0.22); color: #fff; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.p-title { font-size: 15px; line-height: 21px; font-weight: 600; }
.p-desc { font-size: 14px; line-height: 20px; margin-top: 4px; opacity: 0.92; cursor: pointer; }
.p-desc a { color: #fff; font-weight: 600; }
.p-progress { position: absolute; left: 14px; right: 14px; bottom: 6px; height: 14px; z-index: 3; cursor: pointer; display: flex; align-items: flex-end; }
.p-bar { width: 100%; height: 4px; border-radius: var(--r-pill); overflow: hidden; background: rgba(255,255,255,0.3); transition: height 0.2s var(--ease-soft); }
.p-progress:hover .p-bar { height: 6px; }
.p-bar span { display: block; height: 100%; width: 0; background: #fff; border-radius: var(--r-pill); }
.p-heart { position: absolute; z-index: 4; font-size: 88px; color: var(--liked); transform: translate(-50%, -50%); animation: heart 0.8s var(--ease) forwards; pointer-events: none; }
@keyframes heart { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 30% { transform: translate(-50%, -50%) scale(0.95); } 100% { opacity: 0; transform: translate(-50%, -120%) scale(1); } }

.acts { align-self: flex-end; display: flex; flex-direction: column; gap: var(--s4); padding-bottom: var(--s2); }
.act { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; min-width: 48px; }
.act .circle { width: 52px; height: 52px; border-radius: 50%; background: var(--surface-solid); box-shadow: var(--shadow-card); display: grid; place-items: center; font-size: 22px; transition: background-color var(--dur) var(--ease-soft), transform 0.24s var(--ease-soft); }
.act:hover .circle { transform: translateY(-2px); }
.act:active .circle { transform: scale(0.92); }
.act-like.on .bi { color: var(--liked); }
.act-save.on .bi { color: var(--saved); }
.act-n { max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed.clean .p-cap, .feed.clean .p-top, .feed.clean .acts, .feed.clean .feed-tabs { opacity: 0; pointer-events: none; }

.feed-nav { position: absolute; right: var(--s5); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: var(--s3); z-index: 5; }
.feed-nav .icon-btn { width: 54px; height: 54px; background: var(--surface-solid); box-shadow: var(--shadow-card); font-size: 22px; }
.feed-nav .icon-btn:hover { background: var(--surface-solid); transform: translateY(-2px); }
.feed-nav .icon-btn:disabled { opacity: 0.3; }

.feed-side { display: none; width: 420px; flex-shrink: 0; margin: var(--s4) var(--s5) var(--s4) 0; border-radius: var(--r-card); background: var(--surface-solid); box-shadow: var(--shadow-card); position: relative; overflow: hidden; }
.feed.side-open .feed-side { display: block; animation: side 0.42s var(--ease-soft); }
@keyframes side { from { opacity: 0; transform: translateX(24px); } }
.feed.side-open .feed-nav { right: calc(420px + var(--s5) + var(--s5)); }
.feed-side-body { height: 100%; overflow-y: auto; padding: var(--s5); }
.feed-side .cmts-head { padding-right: 40px; margin-bottom: var(--s4); }
.feed-side-close { position: absolute; top: 16px; right: 12px; z-index: 2; }
.speed-row { display: flex; gap: 6px; padding: 0 var(--s4) var(--s2); }
.speed-row .chip { height: 30px; padding: 0 10px; }

.feed-posts { display: none; flex: 1; min-height: 0; overflow-y: auto; padding: var(--s4) var(--s4) var(--s7); }
.feed.show-posts .feed-stage { display: none; }
.feed.show-posts .feed-posts { display: block; }
.modal-comments .modal-head { position: absolute; right: 0; top: 0; z-index: 2; padding: var(--s3); }
.modal-comments .modal-body { padding-top: var(--s4); min-height: 60vh; }
.modal-comments .cmts-head { padding-right: 44px; }

@media (max-width: 1100px) {
  .feed.side-open .feed-nav { display: none; }
  .feed-side { width: 360px; }
}
@media (max-width: 767px) {
  body.page-feed .app-header { display: none; }
  body.page-feed .app-main { padding-top: 0; padding-bottom: 0; }
  .feed { height: calc(100vh - var(--tabbar-h)); height: calc(100dvh - var(--tabbar-h) - env(safe-area-inset-bottom)); background: #000; }
  .feed.show-posts { background: transparent; }
  .feed-tabs { position: absolute; top: calc(env(safe-area-inset-top) + 10px); left: 0; right: 0; z-index: 10; gap: var(--s2); padding: 0; pointer-events: none; }
  .feed-tab { pointer-events: auto; background: rgba(0,0,0,0.22); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); height: 34px; padding: 0 16px; color: rgba(255,255,255,0.85); font-size: 14px; }
  .feed-tab:hover { background: rgba(0,0,0,0.32); color: #fff; }
  .feed-tab.active { background: #fff; color: #0f0f0f; }
  .feed.show-posts .feed-tabs { position: static; padding: var(--s3) 0 var(--s2); }
  .feed.show-posts .feed-tab { color: var(--text-2); background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .feed.show-posts .feed-tab.active { color: var(--active-ink); background: var(--active-bg); }
  .slide { padding: 0; }
  .slide-empty { background: var(--mesh), var(--bg); padding-top: 56px; }
  .player { width: 100%; height: 100%; max-width: none; aspect-ratio: auto; border-radius: 0; }
  .p-top { top: calc(env(safe-area-inset-top) + 52px); }
  .p-play { display: none; }
  .p-cap { right: 72px; bottom: 18px; }
  .acts { position: absolute; right: 6px; bottom: 16px; z-index: 3; gap: var(--s3); padding: 0; color: #fff; }
  .act .circle { background: none; box-shadow: none; width: 44px; height: 40px; font-size: 28px; text-shadow: 0 1px 4px rgba(0,0,0,0.6); }
  .act:hover .circle { background: none; transform: none; }
  .act-n { text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
  .feed-nav { display: none; }
  .feed-posts { padding: var(--s3) var(--s4) var(--s6); }
}

/* ---------- Посты ---------- */
.posts-col { max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--s4); }
.posts-col-left { margin: 0; }
.posts-list { display: flex; flex-direction: column; gap: var(--s4); }
.post { display: flex; gap: var(--s3); padding: var(--s5); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow-card); animation: rise 0.45s var(--ease-soft) both; }
.post-main { flex: 1; min-width: 0; }
.post-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.post-name { font-weight: 700; font-size: 15px; }
.post-meta a:hover { text-decoration: underline; }
.post-pin { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); margin-left: auto; }
.post-text { margin-top: 4px; font-size: 15px; line-height: 22px; overflow-wrap: anywhere; }
.post-actions { display: flex; align-items: center; gap: 2px; margin: var(--s2) 0 -6px -10px; }
.post-actions .btn-sm { gap: 6px; font-weight: 500; }
.post-actions .liked .bi { color: var(--liked); }
.post-compose-btn { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s2) var(--s2) var(--s3); border-radius: var(--r-pill); text-align: left; width: 100%; color: var(--text-2); font-size: 15px; background: var(--surface); box-shadow: var(--shadow-card); transition: transform var(--dur) var(--ease-soft); }
.post-compose-btn > span:first-of-type { flex: 1; }
.post-compose-btn:hover { transform: translateY(-1px); }
.post-comments { margin-top: var(--s6); }
.composer-row { display: flex; gap: var(--s3); }
.mention-pop { min-width: 220px; }

/* ---------- Вход и регистрация ---------- */
.auth { min-height: calc(100vh - var(--header-h) - 120px); display: flex; align-items: flex-start; justify-content: center; padding: var(--s7) var(--s4); }
.auth-card { width: 100%; max-width: 440px; padding: 40px var(--s7) var(--s6); border-radius: 36px; background: var(--surface); box-shadow: var(--shadow-pop); animation: rise 0.55s var(--ease-soft) both; }
.auth-logo { width: 46px; height: 46px; margin: 0 auto var(--s4); }
.auth-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--active-bg); color: var(--active-ink); display: grid; place-items: center; font-size: 26px; margin: 0 auto var(--s4); }
.auth-card h1 { font-size: 26px; line-height: 34px; font-weight: 700; letter-spacing: -0.02em; text-align: center; }
.auth-sub { color: var(--text-2); text-align: center; margin: var(--s1) 0 var(--s5); }
.auth-foot { text-align: center; margin-top: var(--s5); color: var(--text-2); }
.auth-or { display: flex; align-items: center; gap: var(--s3); margin: var(--s5) 0 var(--s4); color: var(--text-3); font-size: 13px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-social { display: flex; flex-direction: column; align-items: center; gap: var(--s3); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); color: var(--text-2); }
.avatar-pick { display: flex; align-items: center; gap: var(--s4); padding: var(--s3); border: 1px dashed var(--border-strong); border-radius: var(--r-pill); margin-bottom: var(--s4); cursor: pointer; }
.avatar-pick:hover { background: var(--hover); }
.avatar-pick img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--chip); }
.avatar-pick > span { display: flex; flex-direction: column; }
.input-code { font-size: 22px; letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; }
.g-recaptcha { margin-bottom: var(--s4); }
@media (max-width: 767px) {
  .auth { padding: var(--s4); }
  .auth-card { padding: var(--s6) var(--s5) var(--s5); border-radius: 32px; }
}

/* ---------- Канал ---------- */
.ch-cover { aspect-ratio: 6.2 / 1; border-radius: var(--r-card); overflow: hidden; background: var(--skeleton); margin-bottom: var(--s5); }
.ch-cover img { width: 100%; height: 100%; object-fit: cover; }
.channel .flash { margin-bottom: var(--s3); }
.ch-head { display: flex; gap: var(--s6); align-items: center; margin-bottom: var(--s6); }
.ch-avatar { width: 160px; height: 160px; }
.ch-info { flex: 1; min-width: 0; padding-top: var(--s1); }
.ch-name { font-size: 34px; line-height: 42px; font-weight: 700; letter-spacing: -0.025em; display: flex; align-items: center; flex-wrap: wrap; gap: 0 4px; overflow-wrap: anywhere; }
.ch-name .verified { font-size: 20px; }
.ch-meta { display: flex; flex-wrap: wrap; gap: 0 6px; color: var(--text-2); font-size: 14px; line-height: 20px; margin-top: var(--s2); }
.ch-meta > * + *::before { content: "·"; margin-right: 6px; color: var(--text-3); }
.ch-stat:hover { color: var(--text); text-decoration: underline; }
.ch-desc { display: flex; align-items: center; gap: 4px; max-width: 100%; color: var(--text-2); margin-top: var(--s2); text-align: left; }
.ch-desc:hover { color: var(--text); }
.ch-desc .clamp-1 { min-width: 0; }
.ch-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s5); }
.ch-tabs { margin: 0 -6px var(--s5); padding: 6px; position: sticky; top: calc(var(--header-h) + 4px); z-index: 10; width: fit-content; max-width: calc(100% + 12px); border-radius: var(--r-pill); background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.ch-subhead { margin-bottom: var(--s4); }
.ch-mod { margin-top: var(--s6); }
.ch-mod-row { display: flex; gap: var(--s2); flex-wrap: wrap; }
.repost-head { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.repost-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repost-del { align-self: flex-start; margin-left: -8px; }
.pl-card { display: block; min-width: 0; }
.pl-thumb .thumb-ph { font-size: 36px; }
/* Плейлисты — карточки 16:9, как в приложении (это обложка подборки, а не ролик) */
.pl-thumb { aspect-ratio: 16 / 9; }
.ch-playlists { margin-bottom: var(--s4); }
.ch-playlists .shelf-head { margin-bottom: var(--s3); }
.shelf-link { color: inherit; }
.pl-row-shelf { grid-auto-columns: minmax(220px, 260px); }
@media (max-width: 767px) { .pl-row-shelf { grid-auto-columns: 40%; } }
.about-text { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 767px) {
  .ch-cover { aspect-ratio: 3.2 / 1; margin: 0 0 var(--s4); border-radius: var(--r-thumb); }
  .ch-head { gap: var(--s4); margin-bottom: var(--s5); align-items: flex-start; }
  .ch-avatar { width: 76px; height: 76px; }
  .ch-name { font-size: 23px; line-height: 30px; }
  .ch-name .verified { font-size: 16px; }
  .ch-meta { font-size: 13px; }
  .ch-actions .btn { flex: 1 1 auto; }
  .ch-actions .btn-icon { flex: 0 0 40px; }
  .ch-tabs { margin: 0 0 var(--s4); max-width: 100%; }
}

/* ---------- Поиск и обзор ---------- */
.search-page-form { margin-bottom: var(--s4); }
.search-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s5); }
.search-head .chips { flex: 1; min-width: 0; }
.search-results { max-width: 1280px; }
.search-list { display: flex; flex-direction: column; gap: var(--s4); margin-bottom: var(--s6); }
.search-chans { display: flex; flex-direction: column; gap: var(--s2); margin-bottom: var(--s6); }
.chan-row { display: flex; align-items: center; gap: var(--s4); padding: var(--s3) var(--s4); border-radius: var(--r-card); transition: background-color var(--dur) var(--ease-soft), box-shadow var(--dur) var(--ease-soft); }
@media (hover: hover) { .chan-row:hover { background: var(--surface); box-shadow: var(--shadow-card); } }
.chan-row .avatar { width: 56px; height: 56px; }
.chan-row.big .avatar { width: 136px; height: 136px; }
.chan-row.big .chan-av { width: min(500px, 42%); display: flex; justify-content: center; flex-shrink: 0; }
.chan-text { flex: 1; min-width: 0; }
.chan-name { font-size: 18px; line-height: 26px; font-weight: 600; }
.chan-desc { margin-top: 4px; }
.recent-chip { padding-right: 4px; }
.recent-chip button { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); }
.recent-chip button:hover { background: var(--hover); color: var(--text); }
.recent-chips { flex-wrap: wrap; overflow: visible; }
.authors-row { display: flex; gap: var(--s4); overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.authors-row::-webkit-scrollbar { display: none; }
.author-tile { width: 128px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: var(--s4) var(--s2); border-radius: var(--r-card); transition: background-color var(--dur) var(--ease-soft), box-shadow var(--dur) var(--ease-soft), transform 0.3s var(--ease-soft); }
@media (hover: hover) { .author-tile:hover { background: var(--surface); box-shadow: var(--shadow-card); transform: translateY(-2px); } }
.author-tile > span:first-of-type { font-weight: 600; max-width: 100%; }
@media (max-width: 767px) {
  .chan-row.big .avatar { width: 64px; height: 64px; }
  .chan-row.big .chan-av { width: auto; }
  .chan-name { font-size: 16px; line-height: 22px; }
  .search-head { flex-wrap: nowrap; }
  .search-head [data-sort] span { display: none; }
}

/* ---------- Подписки, сохранённое ---------- */
.subs-row { display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none; margin-bottom: var(--s6); }
.subs-row::-webkit-scrollbar { display: none; }
.subs-ch { width: 92px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; text-align: center; padding: var(--s3) 4px; border-radius: var(--r-card); transition: background-color var(--dur) var(--ease-soft); }
.subs-ch:hover { background: var(--hover); }
.subs-ch span { max-width: 100%; }
.saved-ico { color: var(--saved); font-size: 0.8em; vertical-align: 1px; }

/* ---------- Уведомления, активность ---------- */
.notif-group { margin: var(--s4) 0 var(--s1); color: var(--text-2); font-size: 14px; }
.notif { align-items: center; }
.notif-av { position: relative; flex-shrink: 0; }
.notif-ico { position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--accent); color: var(--on-accent); border: 2px solid var(--bg); }
.notif-ico.t-like { background: var(--liked); color: #fff; }
.notif-text { font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.notif-text b { font-weight: 600; }
.notif.unread .notif-text::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-left: 8px; vertical-align: 2px; }
.notif.unread { background: transparent; }
.notif-thumb { width: 38px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--skeleton); flex-shrink: 0; }
.act-card { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.act-card .thumb { aspect-ratio: 9 / 16; }
.act-card .thumb-badge .bi-heart-fill { color: var(--liked); }
.act-card .thumb-badge .bi-bookmark-fill { color: var(--saved); }
.act-who { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); min-width: 0; }
@media (max-width: 767px) { .notif-page .page-head > div { width: 100%; justify-content: space-between; } }

/* ---------- Плейлист ---------- */
.pl-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: var(--s5); align-items: start; }
.pl-hero { position: sticky; top: calc(var(--header-h) + var(--s5)); padding: var(--s5); display: flex; flex-direction: column; gap: var(--s2); }
.pl-hero-thumb { margin-bottom: var(--s2); aspect-ratio: 16 / 9; }
.pl-name { font-size: 24px; line-height: 32px; font-weight: 700; overflow-wrap: anywhere; }
.pl-owner { display: flex; align-items: center; gap: var(--s2); font-weight: 600; }
.pl-desc { color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.pl-actions { display: flex; gap: var(--s2); margin-top: var(--s2); }
.pl-actions .btn-primary { flex: 1; }
.pl-list { display: flex; flex-direction: column; }
.pl-row { display: flex; align-items: center; gap: var(--s3); padding: var(--s2); border-radius: 20px; transition: background-color var(--dur) var(--ease-soft); }
.pl-row:hover { background: var(--hover); }
.pl-row .thumb { width: 72px; flex-shrink: 0; border-radius: 14px; }
.pl-row .hcard-text { padding-right: 0; }
.pl-n { width: 24px; text-align: center; color: var(--text-2); flex-shrink: 0; }
@media (max-width: 900px) {
  .pl-layout { grid-template-columns: 1fr; }
  .pl-hero { position: static; }
}
@media (max-width: 767px) {
  .pl-row .thumb { width: 60px; }
  .pl-n { display: none; }
}

/* ---------- Чаты ---------- */
body.page-chats { overflow: hidden; }
.chats { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: var(--s4); padding: var(--s2) var(--s5) var(--s5) var(--s2); height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h)); animation: rise 0.5s var(--ease-soft) both; }
.chats-list { display: flex; flex-direction: column; min-height: 0; border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow-card); overflow: hidden; }
.chats-list-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s4) var(--s3) var(--s2) var(--s5); }
.chats-list-head h1 { font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -0.02em; }
.chats-search { display: flex; align-items: center; gap: var(--s2); margin: 0 var(--s4) var(--s3); padding: 0 var(--s4); height: 42px; border-radius: var(--r-pill); background: var(--chip); color: var(--text-2); }
.chats-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); }
.chats-items { flex: 1; overflow-y: auto; padding: 0 var(--s2) var(--s3); }
.chat-item { display: flex; align-items: center; gap: var(--s3); padding: 10px var(--s3); border-radius: 20px; transition: background-color var(--dur) var(--ease-soft); }
.chat-item:hover { background: var(--hover); }
.chat-item.active { background: var(--active-bg); }
.chat-item-text { flex: 1; min-width: 0; }
.chat-item-top, .chat-item-bottom { display: flex; align-items: center; gap: var(--s2); }
.chat-item-name { flex: 1; font-weight: 600; font-size: 15px; }
.chat-item-time { font-size: 12px; color: var(--text-2); flex-shrink: 0; }
.chat-item-last { flex: 1; font-size: 13px; color: var(--text-2); }
.chat-item.unread .chat-item-last { color: var(--text); font-weight: 600; }
.chat-unread { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; flex-shrink: 0; }
.chat-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow-card); overflow: hidden; }
.chat-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: var(--s3); text-align: center; padding: var(--s5); }
.chat-empty > .bi { width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; font-size: 44px; color: var(--active-ink); background: var(--active-bg); margin-bottom: var(--s2); }
.chat-empty h3 { font-size: 20px; font-weight: 700; }
.chat-head { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); }
.chat-back { display: none; }
.chat-head-user { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s3); }
.chat-msgs { flex: 1; overflow-y: auto; padding: var(--s5) var(--s6); display: flex; flex-direction: column; gap: 6px; }
.chat-start { margin: auto; display: flex; flex-direction: column; align-items: center; gap: var(--s2); text-align: center; }
.msg-older { align-self: center; margin-bottom: var(--s3); }
.msg-day { align-self: center; margin: var(--s3) 0 var(--s2); font-size: 12px; color: var(--text-2); }
.msg-day span { padding: 5px 12px; border-radius: var(--r-pill); background: var(--chip); }
.msg-system { align-self: center; font-size: 12px; color: var(--text-2); text-align: center; max-width: 80%; margin: var(--s2) 0; }
.msg { display: flex; align-items: center; gap: 4px; max-width: min(560px, 80%); align-self: flex-start; animation: rise 0.32s var(--ease-soft) both; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.bubble { padding: 9px 16px 7px; border-radius: 22px 22px 22px 8px; background: var(--chip); min-width: 60px; overflow-wrap: anywhere; }
.msg.mine .bubble { background: var(--accent); color: var(--on-accent); border-radius: 22px 22px 8px 22px; }
.msg.mine .bubble a.text-link { color: inherit; text-decoration: underline; }
.bubble.has-media { padding: 4px 4px 6px; }
.bubble.has-media .msg-text, .bubble.has-media .msg-meta, .bubble.has-media .msg-quote { margin-left: 8px; margin-right: 8px; }
.msg-text { font-size: 15px; line-height: 21px; }
.msg-meta { font-size: 11px; opacity: 0.6; text-align: right; margin-top: 2px; white-space: nowrap; }
.msg-img { max-width: 100%; max-height: 360px; border-radius: 18px; cursor: zoom-in; }
.msg-video { max-width: 100%; max-height: 360px; border-radius: 18px; background: #000; }
.msg-audio { display: flex; align-items: center; gap: var(--s2); }
.msg-audio audio { height: 36px; max-width: 260px; }
.msg-quote { border-left: 3px solid currentColor; padding: 2px 8px; margin-bottom: 6px; font-size: 13px; opacity: 0.85; display: flex; flex-direction: column; }
.msg .link-card { margin: 4px 0; background: var(--chip); color: var(--text); }
.msg.mine .link-card { background: rgba(127, 127, 127, 0.18); color: inherit; }
.msg-more { opacity: 0; flex-shrink: 0; }
.msg:hover .msg-more, .msg-more[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .msg-more { display: none; } }
.chat-compose { padding: var(--s2) var(--s4) calc(var(--s4) + env(safe-area-inset-bottom)); }
.chat-bar { display: flex; align-items: center; gap: var(--s3); padding: 4px 4px 8px var(--s2); }
.chat-bar > .bi { font-size: 18px; color: var(--link); }
.chat-bar-text { flex: 1; min-width: 0; font-size: 13px; }
.chat-bar-title { font-weight: 600; color: var(--link); }
.chat-bar-sub { color: var(--text-2); }
.chat-form { display: flex; align-items: flex-end; gap: var(--s2); }
.chat-form textarea { flex: 1; min-width: 0; resize: none; max-height: 160px; padding: 11px 20px; border-radius: 22px; border: 1px solid transparent; background: var(--chip); outline: 0; font-size: 15px; line-height: 20px; transition: border-color var(--dur) var(--ease-soft), background-color var(--dur) var(--ease-soft); }
.chat-form textarea:focus { border-color: var(--border-strong); background: var(--surface-solid); }
.chat-send { background: var(--accent); color: var(--on-accent); }
.chat-send:hover { background: var(--accent); opacity: 0.85; }
.chat-send:disabled { background: var(--chip); color: var(--text-3); opacity: 1; }
.modal-media .modal-body { padding: 0 var(--s3) var(--s3); }
.lightbox img { max-width: 100%; max-height: 78vh; margin: 0 auto; border-radius: 20px; }
@media (max-width: 900px) { .chats { grid-template-columns: 300px minmax(0, 1fr); gap: var(--s3); padding-right: var(--s3); } }
@media (max-width: 767px) {
  .chats { grid-template-columns: 1fr; padding: 0 var(--s3) var(--s3); height: calc(100dvh - var(--header-h) - var(--tabbar-h) - var(--s4) - env(safe-area-inset-bottom)); }
  .chats-list { background: transparent; box-shadow: none; border-radius: 0; }
  .chats-list-head { padding-left: var(--s3); }
  .chats-search { margin-left: var(--s2); margin-right: var(--s2); }
  .chat-pane { display: none; }
  body.chat-open .chats-list { display: none; }
  body.chat-open .chat-pane { display: flex; }
  body.chat-open .app-header, body.chat-open .app-tabbar { display: none; }
  body.chat-open .app-main { padding-top: 0; padding-bottom: 0; }
  body.chat-open .chats { height: 100dvh; padding: 0; }
  body.chat-open .chat-pane { border-radius: 0; box-shadow: none; background: transparent; }
  .chat-back { display: inline-grid; }
  .chat-msgs { padding: var(--s3); }
  .msg { max-width: 86%; }
}

/* ---------- Загрузка ---------- */
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s2); text-align: center; min-height: 380px; padding: var(--s6) var(--s4); border: 2px dashed var(--border-strong); border-radius: 36px; background: var(--surface); cursor: pointer; transition: background-color var(--dur) var(--ease-soft), border-color var(--dur) var(--ease-soft), transform var(--dur) var(--ease-soft); }
.drop:hover, .drop.over { border-color: var(--accent); }
.drop.over { transform: scale(1.01); }
.drop-icon { width: 104px; height: 104px; border-radius: 50%; background: var(--active-bg); color: var(--active-ink); display: grid; place-items: center; font-size: 40px; margin-bottom: var(--s3); }
.up-form { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s6); }
.up-side { align-self: start; position: sticky; top: calc(var(--header-h) + var(--s4)); }
.up-video { aspect-ratio: 9 / 16; max-height: 60vh; margin: 0 auto; background: #000; border-radius: var(--r-card); overflow: hidden; }
.up-hint { padding: var(--s3) var(--s4) 0; }
.up-video video { width: 100%; height: 100%; object-fit: contain; }
.up-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--s3); position: sticky; bottom: var(--s3); padding: var(--s3) var(--s3) var(--s3) var(--s5); border-radius: var(--r-pill); background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow-card); }
.up-progress { display: flex; align-items: center; gap: var(--s3); width: min(320px, 50%); }
.up-progress .meter { flex: 1; }
.seg { display: inline-flex; padding: 4px; border-radius: var(--r-pill); background: var(--chip); }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 18px; transition: background-color var(--dur) var(--ease-soft), color var(--dur) var(--ease-soft); border-radius: var(--r-pill); font-weight: 600; font-size: 14px; }
.seg input:checked + span { background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow-card); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.tags-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 48px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 24px; background: var(--input-bg); cursor: text; }
.tags-input:focus-within { border-color: var(--accent); }
.tags-input input { flex: 1; min-width: 140px; border: 0; outline: 0; background: transparent; font-size: 15px; padding: 4px; }
.tag { display: inline-flex; align-items: center; gap: 2px; height: 30px; padding: 0 4px 0 12px; border-radius: var(--r-pill); background: var(--active-bg); color: var(--active-ink); font-size: 14px; font-weight: 500; }
.tag button { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); }
.tag button:hover { background: var(--hover); color: var(--text); }
.cover-row { display: flex; gap: var(--s4); align-items: center; flex-wrap: wrap; }
.cover-preview { width: 108px; aspect-ratio: 9 / 16; border-radius: 18px; background: var(--chip); display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.cover-preview img { width: 100%; height: 100%; object-fit: contain; background: var(--media-bg); }
.cover-tools { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: var(--s3); }
.cover-tools input[type=range] { width: 100%; accent-color: var(--accent); }
@media (max-width: 900px) {
  .up-form { grid-template-columns: 1fr; }
  .up-side { position: static; order: -1; }
  .up-foot { bottom: calc(var(--tabbar-h) + var(--s4) + env(safe-area-inset-bottom)); }
}

/* ---------- Студия ---------- */
.studio-period { margin-bottom: var(--s4); }
.studio-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--s4); margin-top: var(--s4); }
.studio-thumb { width: 96px; height: 54px; border-radius: 12px; object-fit: cover; background: var(--skeleton); flex-shrink: 0; }
.studio-vid { display: flex; align-items: center; gap: var(--s3); min-width: 220px; font-weight: 500; }
@media (max-width: 900px) { .studio-grid { grid-template-columns: 1fr; } }

/* ---------- Настройки ---------- */
.set-hero { display: flex; gap: var(--s4); align-items: flex-start; margin-bottom: var(--s5); }
.set-hero .row-icon { width: 52px; height: 52px; font-size: 22px; background: var(--active-bg); color: var(--active-ink); }
.set-hero p { margin-top: 4px; }
.set-steps { padding-left: 20px; color: var(--text-2); line-height: 24px; margin: var(--s3) 0 var(--s4); }
.qr-box { background: #fff; padding: var(--s4); border-radius: var(--r-card); width: fit-content; margin: 0 auto var(--s3); }
.qr-box img { width: 220px; height: 220px; }
.code-inline { padding: 2px 8px; border-radius: 8px; background: var(--chip); font-size: 13px; word-break: break-all; }
.recovery { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s2); padding: var(--s5); border-radius: var(--r-card); background: var(--chip); margin-bottom: var(--s4); font-variant-numeric: tabular-nums; text-align: center; font-size: 15px; }
.tg-code { font-size: 32px; font-weight: 700; letter-spacing: 0.2em; text-align: center; margin: var(--s5) 0 var(--s2); font-variant-numeric: tabular-nums; }
.settings { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: var(--s7); max-width: 1040px; margin: 0 auto; }
.settings-nav { position: sticky; top: calc(var(--header-h) + var(--s5)); align-self: start; display: flex; flex-direction: column; gap: 4px; }
.settings-nav a { display: flex; align-items: center; gap: var(--s3); height: 44px; padding: 0 var(--s4); border-radius: var(--r-pill); font-size: 14px; font-weight: 500; transition: background-color var(--dur) var(--ease-soft); }
.settings-nav a:hover { background: var(--hover); }
.settings-nav a.active { background: var(--active-bg); color: var(--active-ink); font-weight: 600; }
.settings-nav .bi { font-size: 18px; width: 20px; text-align: center; }
.settings-main .section { scroll-margin-top: calc(var(--header-h) + var(--s4)); }
.profile-edit { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s5); align-items: start; }
.avatar-edit { position: relative; width: 112px; height: 112px; }
.avatar-edit img { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; background: var(--chip); }
.avatar-edit label { position: absolute; right: 0; bottom: 0; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); cursor: pointer; border: 3px solid var(--surface-solid); }
.cover-edit { aspect-ratio: 6.2 / 1; border-radius: var(--r-card); background: var(--chip); overflow: hidden; display: grid; place-items: center; color: var(--text-2); margin-bottom: var(--s3); }
.cover-edit img { width: 100%; height: 100%; object-fit: cover; }
.theme-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.theme-pick label { cursor: pointer; }
.theme-pick input { position: absolute; opacity: 0; pointer-events: none; }
.theme-card { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s2) var(--s2) var(--s3); border-radius: var(--r-card); border: 2px solid var(--border); font-weight: 600; font-size: 14px; text-align: center; transition: border-color var(--dur) var(--ease-soft); }
.theme-pick input:checked + .theme-card { border-color: var(--accent); }
.theme-sw { height: 64px; border-radius: 18px; border: 1px solid var(--border); display: flex; gap: 4px; padding: 8px; }
.theme-sw.dark { background: #0f0f0f; } .theme-sw.light { background: linear-gradient(135deg, #d6e6fb, #cff3e6 55%, #e2f6cf); }
.theme-sw.system { background: linear-gradient(90deg, #fff 50%, #0f0f0f 50%); }
.theme-sw i { display: block; height: 10px; border-radius: var(--r-pill); flex: 1; align-self: flex-end; }
.theme-sw.dark i { background: #3f3f3f; } .theme-sw.light i { background: #fff; } .theme-sw.system i { background: #888; }
.st-week { display: flex; align-items: flex-end; gap: var(--s2); height: 120px; margin: var(--s3) 0 var(--s1); }
.st-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; font-size: 11px; color: var(--text-2); }
.st-day span.b { width: 100%; max-width: 36px; background: var(--chip-hover); border-radius: 10px 10px 4px 4px; min-height: 2px; }
.st-day.today span.b { background: var(--accent); }
@media (max-width: 860px) {
  .settings { grid-template-columns: 1fr; gap: var(--s4); }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--s4)); padding: 0 var(--s4); }
  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-nav a { flex-shrink: 0; background: var(--chip); height: 38px; }
  .settings-nav a.active { background: var(--active-bg); color: var(--active-ink); }
  .profile-edit { grid-template-columns: 1fr; justify-items: start; }
}

/* ---------- Админка ---------- */
.admin-user { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.admin-actions { display: flex; gap: var(--s2); flex-wrap: wrap; }
.admin-tags { white-space: normal; }
.admin-sheet .row { border-radius: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }

/* ---------- Аналитика сайта ---------- */
.analytics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); margin-bottom: var(--s5); }
.analytics-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.analytics-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.analytics-head .section-title { margin: 0; }
.analytics-period { width: auto; min-height: 32px; padding-top: 4px; padding-bottom: 4px; font-size: 13px; }
.chart-box { position: relative; height: 240px; }
.a-list { display: flex; flex-direction: column; }
.a-list .list-item { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--border); }
.a-list .list-item:last-child { border-bottom: 0; }
.list-item-info { flex: 1; min-width: 0; }
.list-item-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item-subtitle { font-size: 12px; color: var(--text-2); }
.list-item-value { font-variant-numeric: tabular-nums; font-weight: 600; }
.loading { color: var(--text-2); }
.stat-change.positive { color: var(--success); } .stat-change.negative { color: var(--danger); }
.status-badge, .level-badge { display: inline-block; padding: 1px 8px; border-radius: var(--r-pill); background: var(--chip); font-size: 12px; font-weight: 600; }
.status-badge.error, .level-badge.level-error, .level-badge.level-critical { color: var(--danger); }
.log-message { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-small { font-size: 15px; line-height: 22px; }
@media (max-width: 1000px) { .analytics-grid, .analytics-grid.three { grid-template-columns: 1fr; } }
.status-badge.status-500, .status-badge.status-400 { color: var(--danger); }

/* ---------- Юридические страницы ---------- */
.legal { max-width: 780px; line-height: 1.65; font-size: 15px; }
.legal h1 { font-size: 28px; line-height: 36px; font-weight: 700; margin-bottom: var(--s2); }
.legal h2 { font-size: 18px; line-height: 26px; font-weight: 700; margin: var(--s5) 0 var(--s2); }
.legal p, .legal li { color: var(--text); margin-bottom: var(--s2); }
.legal a { color: var(--link); }
.msg.mine .link-card .lc-meta { color: inherit; opacity: 0.7; }
@media (max-width: 767px) {
  .ch-actions { flex-wrap: nowrap; margin-left: calc(-72px - var(--s4)); width: calc(100% + 72px + var(--s4)); }
  .ch-actions .btn { min-width: 0; padding: 0 12px; overflow: hidden; text-overflow: ellipsis; }
}
.settings-main, .settings-nav { min-width: 0; }
@media (max-width: 600px) {
  .settings-group .row { flex-wrap: wrap; row-gap: var(--s2); }
  .settings-group .row .row-text { min-width: 60%; }
  .theme-pick { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); }
  .theme-card { font-size: 12px; }
}
.settings-group .row:has(input[type=time]) .row-text { flex-basis: 100%; }
.up-form .seg { align-self: flex-start; }
@media (max-width: 767px) { .modal-comments .cmts-title { font-size: 18px; line-height: 24px; } }

/* ---------- Звуки: галерея и страница звука ---------- */
.snd-search { margin-bottom: var(--s4); }
.snd-search .search-box { width: 100%; }
.snd-tabs { margin-bottom: var(--s4); }
.snd-genres { margin-bottom: var(--s3); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.snd-genres::-webkit-scrollbar { display: none; }
.snd-row { padding: 8px 4px; gap: var(--s3); }
.snd-cover { position: relative; width: 56px; height: 56px; border-radius: 16px; overflow: hidden; flex-shrink: 0; background: var(--chip); }
.snd-cover img { width: 100%; height: 100%; object-fit: cover; }
.snd-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 24px; background: rgba(0, 0, 0, 0.3); }
.snd-fav.on { color: var(--text); }
.snd-head { display: flex; gap: var(--s5); align-items: flex-start; margin-bottom: var(--s6); }
.snd-cover-lg { width: 160px; height: 160px; border-radius: 36px; box-shadow: var(--shadow-card); }
.snd-cover-lg .snd-play { font-size: 44px; }
.snd-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: var(--s2); }
.snd-title { font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.snd-author { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 600; align-self: flex-start; }
.snd-actions { display: flex; gap: var(--s2); margin-top: var(--s2); }
.snd-grid-title { margin-bottom: var(--s3); }
@media (max-width: 767px) {
  .snd-head { gap: var(--s4); margin-bottom: var(--s5); }
  .snd-cover-lg { width: 112px; height: 112px; }
  .snd-title { font-size: 20px; line-height: 26px; }
  .snd-grid { margin: 0 calc(-1 * var(--s4)); }
}
.explore-sounds { margin-bottom: var(--s5); padding: var(--s3) var(--s4); }

/* =========================================================================
 * Горизонтальные видео (short=False): карточки 16:9 в духе YouTube,
 * строки поиска и «Похожих», страница просмотра. В app.css .thumb — 9:16,
 * здесь превью видео переводится в 16:9. Токены — с запасными значениями,
 * чтобы блок жил и с текущим app.css, и с редизайном (ветка site-rounded).
 * ========================================================================= */
.grid-videos { display: grid; gap: var(--s7) var(--s4); grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-videos.compact { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s5) var(--s4); }
.grid-videos:not([hidden]) + .mix-clips { margin-top: var(--s6); }
@media (min-width: 2000px) { .grid-videos { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); } }

.vcard .thumb, .scard .thumb, .hcard .thumb, .pl-row .thumb.wide { aspect-ratio: 16 / 9; }
.vcard .thumb img, .vcard .thumb video, .scard .thumb img, .scard .thumb video,
.hcard .thumb img, .hcard .thumb video { object-fit: cover; background: transparent; }
.vcard { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; position: relative; animation: rise 0.5s var(--ease-soft, ease) both; }
.vcard:hover .thumb img { transform: scale(1.04); }
.vcard-body { display: flex; gap: var(--s3); align-items: flex-start; }
.vcard-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--chip, rgba(128, 128, 128, 0.16)); }
.vcard-text { flex: 1; min-width: 0; }
.vcard-meta > * { display: block; }
.vcard-meta a:hover { color: var(--text); }
.vcard-author { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcard .vcard-menu { margin: -6px -8px 0 0; flex-shrink: 0; }
.vcard:hover .vcard-menu, .scard:hover .vcard-menu, .hcard:hover .vcard-menu { opacity: 1; }
.vcard-body .sk-line { margin-top: 4px; }

/* Строка «Похожих» справа и очереди */
.hlist { display: flex; flex-direction: column; gap: var(--s2); }
.hcard { display: flex; gap: var(--s3); min-width: 0; position: relative; padding: 6px; margin: -6px; border-radius: 20px; transition: background-color var(--dur, .2s) var(--ease-soft, ease); }
@media (hover: hover) { .hcard:hover { background: var(--hover); } }
.hcard .thumb { width: 168px; flex-shrink: 0; border-radius: 16px; }
.hcard-text { flex: 1; min-width: 0; padding-right: 24px; }
.hcard-title { font-size: 14px; line-height: 20px; font-weight: 600; }
.hcard-meta { margin-top: 4px; font-size: 12px; line-height: 18px; color: var(--text-2); }
.hcard-meta a:hover { color: var(--text); }
.hcard[hidden] { display: none; }

/* Результат поиска: превью слева, текст справа */
.scard { display: flex; gap: var(--s5); position: relative; animation: rise 0.45s var(--ease-soft, ease) both; }
.scard .thumb { width: min(500px, 42%); flex-shrink: 0; }
.scard-text { flex: 1; min-width: 0; padding-top: 2px; padding-right: 32px; }
.scard-title { font-size: 18px; line-height: 26px; font-weight: 500; }
.scard-meta { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.scard-chan { display: flex; align-items: center; gap: var(--s2); margin: var(--s3) 0; font-size: 12px; color: var(--text-2); }
.scard-chan img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.scard-desc { font-size: 12px; color: var(--text-2); }
.scard .vcard-menu { position: absolute; top: 0; right: 0; }

/* Миниатюры горизонтальных видео в уведомлениях и плейлисте */
.notif-thumb.wide { width: 64px; height: 36px; }
.pl-row .thumb.wide { width: 128px; }

@media (max-width: 767px) {
  /* На телефоне — лента карточек во всю ширину, «автор · просмотры · дата» одной строкой */
  .grid-videos { grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
  .grid-videos > .vcard > .thumb { border-radius: var(--r-thumb, 22px); }
  .vcard-meta > * { display: inline; }
  .vcard-meta > .vcard-author + .vcard-stats::before { content: " · "; }
  .vcard-title { font-size: 15px; line-height: 21px; }
  .vcard-meta { font-size: 12px; line-height: 18px; }
  /* Канал и сохранённое — компактная сетка в две колонки, без аватара */
  .grid-videos.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4) var(--s3); }
  .grid-videos.compact > .vcard > .thumb { margin: 0; width: 100%; border-radius: var(--r-thumb, 12px); }
  .grid-videos.compact .vcard { gap: var(--s2); }
  .grid-videos.compact .vcard-avatar, .grid-videos.compact .vcard-body > a { display: none; }
  .grid-videos.compact .vcard-title { font-size: 14px; line-height: 20px; }
  .grid-videos.compact .vcard-meta > * { display: block; }
  .grid-videos.compact .vcard-meta > .vcard-author + .vcard-stats::before { content: none; }
  .grid-videos.compact .vcard-menu { width: 28px; height: 28px; font-size: 16px; margin: -4px -6px 0 0; }
  .scard { flex-direction: column; gap: var(--s3); }
  .scard .thumb { width: 100%; }
  .scard-title { font-size: 16px; line-height: 22px; font-weight: 600; }
  /* превью во всю ширину — «три точки» поверх кадра, как у карточки клипа */
  .scard .vcard-menu { top: 6px; right: 6px; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
  .pl-row .thumb.wide { width: 107px; }
}

/* ---------- Просмотр видео ---------- */
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 402px; gap: var(--s6); max-width: 1920px; margin: 0 auto; padding: var(--s3) var(--s6) var(--s7); animation: rise 0.5s var(--ease-soft, ease) both; }
.watch-main, .watch-side, .watch-bar, .watch-channel { min-width: 0; }
.watch-player { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: calc(100vh - var(--header-h) - 160px); border-radius: var(--r-card, 28px); overflow: hidden; background: var(--media-bg, #000); box-shadow: var(--shadow-card, none); isolation: isolate; }
.watch-player video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.watch-title { font-size: 22px; line-height: 30px; font-weight: 700; letter-spacing: -0.02em; margin-top: var(--s4); overflow-wrap: anywhere; }
.watch-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3) var(--s4); margin-top: var(--s3); flex-wrap: wrap; }
.watch-channel { display: flex; align-items: center; gap: var(--s3); }
.watch-channel-text { flex: 1 1 auto; min-width: 0; margin-right: var(--s3); }
.watch-channel > .btn { flex-shrink: 0; }
.watch-channel-name { font-weight: 600; font-size: 16px; line-height: 22px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.watch-actions { display: flex; gap: var(--s2); flex-wrap: wrap; }
.watch-actions .btn.liked i { color: var(--liked, currentColor); }
.watch-desc { margin-top: var(--s4); padding: var(--s4) var(--s5); border-radius: 22px; background: var(--surface, rgba(128, 128, 128, 0.16)); box-shadow: var(--shadow-card, none); font-size: 14px; line-height: 21px; }
.watch-desc-meta { font-weight: 600; }
.watch-desc-text { margin-top: 4px; white-space: normal; overflow-wrap: anywhere; }
.watch-desc-more { font-weight: 600; margin-top: 4px; }
.watch-comments { margin-top: var(--s5); }
.watch-side-chips { margin-bottom: var(--s3); }
.watch-queue { margin-bottom: var(--s4); padding: var(--s3) var(--s4); }
.watch-queue .row { padding: 6px; min-height: 0; border-radius: 16px; }
.watch-queue .row.current { background: var(--active-bg, rgba(128, 128, 128, 0.16)); }
@media (max-width: 1100px) {
  .watch { grid-template-columns: minmax(0, 1fr); max-width: 1100px; }
}
@media (max-width: 767px) {
  .watch { padding: 0 0 var(--s6); gap: var(--s4); }
  .watch-player { border-radius: 0; max-height: none; }
  .watch-main > :not(.watch-player) { margin-left: var(--s4); margin-right: var(--s4); }
  .watch-side { padding: 0 var(--s4); }
  .watch-title { font-size: 18px; line-height: 24px; }
  .watch-bar { flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
  .watch-channel .btn { margin-left: auto; }
  .watch-channel-name { max-width: none; }
  .watch-actions { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--s4)); padding: 0 var(--s4); }
  .watch-actions::-webkit-scrollbar { display: none; }
  .watch-side .hcard .thumb { width: 150px; }
}

/* Страница просмотра как в «Meet the new YouTube»: название поверх кадра,
   действия компактно в одну строку с каналом, вкладки «Похожих» — бледные пилюли */
.watch-over {
  position: absolute; left: 0; right: 0; top: 0; z-index: 1; pointer-events: none;
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4);
  padding: 18px 24px; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  transition: opacity 0.5s var(--ease-soft, ease);
}
.watch-player:not(.vp):not(:hover) .watch-over { opacity: 0; transition-delay: 2.5s; }
.watch-player.vp.idle .watch-over { opacity: 0; }
.watch-over-title { font-size: 17px; line-height: 24px; font-weight: 600; min-width: 0; }
.watch-over-meta { flex-shrink: 0; font-size: 13px; font-weight: 600; opacity: 0.9; }
/* Название и счётчики — под плеером, как на YouTube; поверх кадра — только во весь экран */
.watch-player:not(.fs) .watch-over { display: none; }
@media (min-width: 768px) {
  .watch-title { font-size: 20px; line-height: 28px; margin-top: var(--s4); }
  .watch-bar { margin-top: var(--s3); flex-wrap: nowrap; }
  .watch-actions { flex-wrap: nowrap; gap: 2px; flex-shrink: 0; }
  .watch-actions .btn { height: 36px; padding: 0 12px; background: transparent; }
  .watch-actions .btn:hover { background: var(--hover); }
  .watch-actions [data-act=save] { width: 36px; padding: 0; }
  .watch-actions [data-act=save] span { display: none; }
  .watch-actions .btn-icon { width: 36px; }
  .watch-channel-name { max-width: 220px; }
}
.watch-desc-stats + .watch-desc-cat::before { content: " · "; }
.watch-side-chips .chip { background: transparent; color: var(--text-2); }
.watch-side-chips .chip:hover { background: var(--hover); color: var(--text); }
.watch-side-chips .chip.active { background: var(--active-bg, var(--chip)); color: var(--active-ink, var(--text)); }
.watch-side-chips .chip .bi { font-size: 16px; }

/* ---------- Кастомный плеер (static/js/player.js) ----------
   Стеклянная пилюля-панель внизу кадра, зелёный прогресс бренда, иконки контурные.
   Пока видео играет и мышь стоит (.idle), панель, название и курсор прячутся. */
.vp { user-select: none; -webkit-user-select: none; }
.vp video { cursor: pointer; }
.vp.idle, .vp.idle video { cursor: none; }
.vp-ui { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.vp-center {
  position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px;
  display: grid; place-items: center; border-radius: 50%; color: #fff; font-size: 34px;
  background: rgba(0, 0, 0, 0.38); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  opacity: 0; transform: scale(0.8);
}
.vp-center.show { animation: vp-flash 0.6s var(--ease-soft, ease); }
@keyframes vp-flash { 0% { opacity: 0; transform: scale(0.8); } 25% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.15); } }
.vp-spin { position: absolute; inset: 0; display: grid; place-items: center; }
.vp-spin .spinner { margin: 0; border-color: rgba(255, 255, 255, 0.25); border-top-color: #fff; width: 44px; height: 44px; }
.vp-bar {
  position: absolute; left: 0; right: 0; bottom: 0; pointer-events: auto;
  padding: 28px 18px 16px; color: #fff;
  /* лёгкое затемнение снизу — только чтобы читались прогресс и кнопки на светлом кадре */
  background: linear-gradient(to top, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0));
  transition: opacity 0.35s var(--ease-soft, ease), transform 0.35s var(--ease-soft, ease);
}
.vp.idle .vp-bar { opacity: 0; transform: translateY(10px); pointer-events: none; }
.vp-progress { position: relative; height: 20px; margin: 0 4px 10px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.vp-progress:focus-visible { outline-offset: 0; border-radius: 6px; }
.vp-track { position: relative; width: 100%; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.3); overflow: hidden; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: height 0.2s var(--ease-soft, ease); }
.vp-progress:hover .vp-track, .vp.seeking .vp-track { height: 6px; }
.vp-buf, .vp-played { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: inherit; }
.vp-buf { background: rgba(255, 255, 255, 0.4); }
.vp-played { background: #fff; }
.vp-knob {
  position: absolute; top: 50%; left: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); transform: scale(0); transition: transform 0.2s var(--ease-soft, ease);
}
.vp-progress:hover .vp-knob, .vp.seeking .vp-knob, .vp-progress:focus-visible .vp-knob { transform: scale(1); }
.vp-tip {
  position: absolute; bottom: 24px; transform: translateX(-50%); padding: 4px 10px; border-radius: 999px;
  background: rgba(10, 14, 13, 0.7); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none;
}
.vp-row { display: flex; align-items: center; gap: 10px; }
/* Стеклянные островки: круглые кнопки и пилюли */
.vp-round, .vp-pill {
  background: rgba(20, 24, 23, 0.36); -webkit-backdrop-filter: saturate(1.5) blur(16px); backdrop-filter: saturate(1.5) blur(16px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.vp-pill { height: 48px; border-radius: 999px; display: inline-flex; align-items: center; padding: 0 5px; }
.vp-btn {
  min-width: 38px; height: 38px; padding: 0 8px; border-radius: 999px; display: inline-grid; place-items: center;
  color: #fff; font-size: 21px; font-weight: 700; transition: background-color 0.2s var(--ease-soft, ease), transform 0.15s var(--ease-soft, ease);
}
.vp-btn:hover { background: rgba(255, 255, 255, 0.16); }
.vp-btn:active { transform: scale(0.92); }
.vp-round { width: 48px; height: 48px; min-width: 48px; padding: 0; font-size: 22px; }
.vp-round:hover { background: rgba(20, 24, 23, 0.5); }
.vp-group { gap: 2px; padding: 0 6px; }
.vp-group .vp-btn { min-width: 40px; }
.vp-speed { font-size: 14px; min-width: 46px; }
.vp-vol { padding: 0 5px; }
.vp-vol .vp-btn { width: 38px; padding: 0; }
.vp-volrange {
  -webkit-appearance: none; appearance: none; width: 0; opacity: 0; height: 4px; margin: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(to right, #fff var(--v, 100%), rgba(255, 255, 255, 0.3) var(--v, 100%));
  transition: width 0.3s var(--ease-soft, ease), opacity 0.3s var(--ease-soft, ease), margin 0.3s var(--ease-soft, ease);
}
.vp-vol:hover .vp-volrange, .vp-volrange:focus-visible { width: 80px; opacity: 1; margin: 0 12px 0 4px; }
.vp-volrange::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 0; }
.vp-volrange::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 0; }
.vp-time { gap: 5px; padding: 0 18px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vp-spacer { flex: 1; }
.vp.fs { border-radius: 0; max-height: none; background: #000; }
.vp.fs .vp-bar { padding: 40px 28px 24px; }
@media (max-width: 767px) {
  .vp-bar { padding: 20px 10px 10px; }
  .vp-progress { margin-bottom: 6px; }
  .vp-row { gap: 6px; }
  .vp-round, .vp-pill { height: 38px; }
  .vp-round { width: 38px; min-width: 38px; font-size: 18px; }
  .vp-btn { min-width: 32px; height: 32px; font-size: 18px; }
  .vp-vol .vp-btn { width: 32px; }
  .vp-time { padding: 0 12px; font-size: 12px; }
  .vp-volrange { display: none; }
}

/* Загрузка: превью и обложка по выбранному типу */
.up-form.kind-video .up-video { aspect-ratio: 16 / 9; max-height: none; }
.up-form.kind-video .cover-preview { width: 192px; aspect-ratio: 16 / 9; }
.up-form.kind-video .cover-preview img { object-fit: cover; }

/* =========================================================================
 * «Как в ролике»: главная, панель чатов, подсказки поиска, мгновенные
 * уведомления, пилюля «нравится | репосты», закреплённый комментарий.
 * Появление — из размытия (blur-in) с небольшой очередью по --i.
 * ========================================================================= */
.blur-in { animation: blur-in 0.6s var(--ease-soft) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes blur-in { from { opacity: 0; filter: blur(14px); transform: translateY(14px) scale(0.985); } }
@keyframes pop-in { from { opacity: 0; filter: blur(10px); transform: translateY(-6px) scale(0.97); } }
.chats-pop.closing, .sg-pop.closing, .live-alert.closing { opacity: 0; filter: blur(6px); transform: translateY(-4px) scale(0.98); transition: opacity 0.18s var(--ease-soft), transform 0.18s var(--ease-soft), filter 0.18s var(--ease-soft); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .blur-in { animation: none; } }

/* ---------- Смешанная лента («Обзор») ---------- */
.home { padding-top: var(--s2); }
.tuner-terms { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin: 0 0 var(--s3); animation: blur-in 0.5s var(--ease-soft) both; }
.term-chip { height: 32px; padding: 0 6px 0 12px; font-size: 13px; background: var(--active-bg); color: var(--active-ink); }
.term-chip > .bi { font-size: 14px; }
.term-chip button { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.term-chip button:hover { background: var(--hover); }
.chips-sep { flex-shrink: 0; width: 1px; height: 24px; align-self: center; background: var(--border-strong); margin: 0 var(--s1); }
.home-feed > * + * { margin-top: var(--s6); }
.home-gap { margin-top: var(--s6); }
.home .grid-videos.few { grid-template-columns: repeat(auto-fill, minmax(320px, 520px)); }
.home-mix { display: grid; gap: var(--s4); grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
.home-mix[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-mix[data-n="1"] { grid-template-columns: minmax(0, 1fr); }
.home-card { display: flex; flex-direction: column; min-width: 0; padding: var(--s4); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow-card); }
.home-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin: -4px -6px var(--s3) 4px; }
.home-card-head h3 { display: flex; align-items: center; gap: var(--s2); font-size: 17px; font-weight: 700; }
.home-card-head h3 .bi { font-size: 18px; color: var(--text-2); }
.home-card-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.home-posts .home-card-body { gap: 2px; }
.hp-row { display: flex; gap: var(--s3); padding: var(--s3) var(--s2); border-radius: 18px; transition: background-color var(--dur) var(--ease-soft); }
.hp-row:hover { background: var(--hover); }
.hp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hp-meta { display: flex; align-items: baseline; gap: var(--s2); }
.hp-meta b { font-size: 14px; }
.hp-meta .t-caption { flex-shrink: 0; }
.hp-text { font-size: 14px; line-height: 20px; }
.hp-stats { display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.hp-stats .bi { font-size: 13px; }
.hp-stats span + .bi { margin-left: 10px; }
.home-clipcard .home-card-body { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); align-content: start; }
.home-clipcard .ccard { gap: 6px; }
.home-clipcard .ccard-title { font-size: 13px; line-height: 18px; }
.home-clipcard .ccard-meta, .home-clipcard .vcard-menu { display: none; }
.home-clipcard .thumb-badge, .home-cliplist .thumb-badge { left: 8px; bottom: 8px; right: auto; font-size: 11px; padding: 2px 8px; }
.home-pill { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: 22px; background: var(--btn); transition: background-color var(--dur) var(--ease-soft); }
.home-pill:hover { background: var(--btn-hover); }
.home-pill > span { display: flex; flex-direction: column; min-width: 0; }
.home-pill b { font-size: 14px; }
.home-pill .bi { font-size: 20px; color: var(--text-2); }
.home-sounds .home-card-body { justify-content: space-between; gap: var(--s3); }
.sound-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.sound-tile { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sound-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 18px; background: var(--skeleton); margin-bottom: 4px; transition: transform 0.5s var(--ease-soft); }
.sound-tile:hover img { transform: scale(1.04); }
.sound-tile-title { font-weight: 600; font-size: 14px; }
.sound-foot { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); border-radius: 20px; background: var(--btn); }
.sound-foot-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sound-foot-text b { font-size: 14px; }
.sound-play { background: var(--accent); color: var(--on-accent); width: 40px; height: 40px; font-size: 18px; }
.sound-play:hover { background: var(--accent); opacity: 0.88; }
.sound-grid { display: grid; gap: var(--s5) var(--s4); grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.sound-tile.big img { border-radius: var(--r-thumb); }
.home-continue { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--s3) var(--s5); align-items: center; }
.cw-row { display: flex; gap: var(--s3); align-items: flex-start; }
.cw-row .thumb { width: 168px; flex-shrink: 0; aspect-ratio: 16 / 9; border-radius: 16px; }
.cw-row .thumb.clip { width: 72px; aspect-ratio: 9 / 16; margin: 0 48px; }
.cw-row .thumb img { object-fit: cover; }
.cw-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, 0.35); }
.cw-bar span { display: block; height: 100%; background: #fff; }
.cw-text { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.cw-title { font-weight: 600; font-size: 14px; line-height: 19px; }
@media (max-width: 1180px) { .home-mix, .home-mix[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); } .home-mix > :last-child:nth-child(odd) { grid-column: 1 / -1; } }
.post-sk { display: flex; gap: var(--s3); padding: var(--s5); margin-bottom: var(--s3); }
.home-sk .grid-videos, .home-sk .grid-clips { animation: blur-in 0.35s var(--ease-soft) both; }
@media (max-width: 767px) {
  .home-mix, .home-mix[data-n] { grid-template-columns: minmax(0, 1fr); }
  .home-mix > :last-child:nth-child(odd) { grid-column: auto; }
  .cw-row .thumb { width: 140px; }
}

/* ---------- Панель чатов из шапки ---------- */
.chats-pop {
  position: fixed; z-index: 260; top: calc(var(--header-h) - 4px); right: var(--s4);
  width: min(420px, calc(100vw - 24px)); max-height: min(640px, calc(100vh - var(--header-h) - 16px));
  display: flex; flex-direction: column; border-radius: var(--r-card);
  background: var(--bg-elevated); box-shadow: var(--shadow-pop), inset 0 0 0 1px var(--border);
  animation: pop-in 0.32s var(--ease-soft); transform-origin: top right; overflow: hidden;
}
.chats-pop-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.chats-pop-head { display: flex; align-items: center; gap: var(--s1); padding: var(--s4) var(--s3) var(--s2) var(--s5); }
.chats-pop-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.chats-pop-head .spacer { flex: 1; }
.chats-pop-search { display: flex; align-items: center; gap: var(--s2); height: 42px; margin: 0 var(--s4) var(--s2); padding: 0 var(--s4); border-radius: var(--r-pill); background: var(--chip); color: var(--text-2); }
.chats-pop-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); }
.chats-pop-list { overflow-y: auto; padding: 0 var(--s2) var(--s3); min-height: 120px; }
.cp-row { position: relative; display: flex; align-items: center; gap: var(--s3); padding: 10px var(--s3) 10px var(--s4); border-radius: 20px; animation: blur-in 0.45s var(--ease-soft) both; animation-delay: calc(var(--i, 0) * 35ms); }
.cp-row:hover { background: var(--hover); }
.cp-dot { position: absolute; left: 4px; top: 50%; width: 7px; height: 7px; margin-top: -3px; border-radius: 50%; background: var(--accent); opacity: 0; }
.cp-row.unread .cp-dot { opacity: 1; }
.cp-row.unread .cp-last { color: var(--text); font-weight: 600; }
.cp-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cp-top { display: flex; align-items: baseline; gap: var(--s2); }
.cp-top b { font-size: 15px; }
.cp-top .t-caption { flex-shrink: 0; }
.cp-last { color: var(--text-2); font-size: 14px; }
.chats-pop-sk .cp-row { animation: none; }
.chats-pop-empty { display: flex; flex-direction: column; align-items: center; gap: var(--s2); padding: var(--s6) var(--s4); color: var(--text-2); text-align: center; }
.chats-pop-empty .bi { font-size: 28px; }
.chats-pop .dm-priv { padding: var(--s3) var(--s3) var(--s4); animation: blur-in 0.35s var(--ease-soft) both; }

/* «Кто может мне писать» */
.dm-priv-head { display: flex; align-items: center; gap: var(--s2); padding: var(--s1) var(--s2) var(--s2); font-size: 15px; font-weight: 600; color: var(--text-2); }
.dm-priv-list { display: flex; flex-direction: column; gap: 2px; }
.dm-opt { display: flex; align-items: center; gap: var(--s3); width: 100%; padding: 10px var(--s3); border-radius: 16px; text-align: left; transition: background-color var(--dur) var(--ease-soft); }
.dm-opt:hover { background: var(--hover); }
.dm-opt.active { background: var(--active-bg); color: var(--active-ink); }
.dm-opt > .bi:first-child { font-size: 20px; width: 24px; text-align: center; }
.dm-opt-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.dm-opt-text b { font-size: 15px; }
.dm-opt-check { opacity: 0; font-size: 18px; transition: opacity var(--dur) var(--ease-soft); }
.dm-opt.active .dm-opt-check { opacity: 1; }
.dm-priv-note { padding: var(--s2) var(--s3) 0; }
.dm-priv-box { padding: var(--s3); }

/* ---------- Подсказки поиска ---------- */
.header-search { position: relative; }
.sg-pop {
  position: absolute; z-index: 120; top: calc(100% + 8px);
  padding: var(--s3) var(--s2) var(--s2); border-radius: 26px;
  background: var(--bg-elevated); box-shadow: var(--shadow-pop), inset 0 0 0 1px var(--border);
  animation: pop-in 0.28s var(--ease-soft); transform-origin: top center;
}
.sg-chips { padding: 0 var(--s2) var(--s2); }
.sg-chips .chip { height: 32px; padding: 0 14px; font-size: 13px; }
.sg-list { max-height: min(420px, 60vh); overflow-y: auto; }
.sg-item { position: relative; display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 40px; padding: 6px var(--s3); border-radius: 14px; text-align: left; font-size: 14px; }
.sg-item:hover, .sg-item.active { background: var(--hover); }
.sg-ic { width: 24px; display: grid; place-items: center; color: var(--text-2); flex-shrink: 0; }
.sg-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sg-del { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--text-3); opacity: 0; }
.sg-item:hover .sg-del, .sg-item.active .sg-del { opacity: 1; }
.sg-del:hover { background: var(--press); color: var(--text); }
.sg-sep { padding: var(--s2) var(--s3) 2px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.sg-empty { padding: var(--s3); }
@media (hover: none) { .sg-del { opacity: 1; } }

/* ---------- Мгновенные уведомления ---------- */
.live-alert {
  position: fixed; z-index: 280; left: var(--s5); bottom: var(--s5); width: min(460px, calc(100vw - 24px));
  display: flex; gap: var(--s4); align-items: center; padding: var(--s3); border-radius: var(--r-card);
  background: var(--bg-elevated); box-shadow: var(--shadow-pop), inset 0 0 0 1px var(--border);
  animation: blur-in 0.5s var(--ease-soft) both;
}
.live-thumb { width: 150px; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; flex-shrink: 0; background: var(--skeleton); }
.live-thumb.clip { width: 72px; aspect-ratio: 9 / 16; }
.live-thumb img { width: 100%; height: 100%; object-fit: cover; }
.live-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.live-text b { font-size: 15px; }
.live-actions { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s2); }
.live-actions .btn { height: 36px; padding: 0 16px; }
@media (max-width: 767px) {
  .live-alert { left: 12px; right: 12px; width: auto; bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); }
  .live-thumb { width: 88px; }
  .live-alert { gap: var(--s3); }
  .live-actions { gap: 6px; }
  .live-actions .btn { padding: 0 12px; }
}

/* ---------- Чаты: ввод с «+», выбор клипа, карточка клипа ---------- */
.chat-input { flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 4px; padding: 4px; border-radius: 26px; background: var(--chip); border: 1px solid transparent; transition: border-color var(--dur) var(--ease-soft), background-color var(--dur) var(--ease-soft); }
.chat-input:focus-within { border-color: var(--border-strong); background: var(--surface-solid); }
.chat-form .chat-input textarea { background: transparent; border: 0; padding: 9px 4px 9px 16px; }
.chat-form .chat-input textarea:focus { background: transparent; }
.chat-input .chat-send { width: 38px; height: 38px; font-size: 16px; }
.chat-plus { background: var(--chip); }
.chat-plus .bi { transition: transform var(--dur) var(--ease-soft); }
.chat-plus[aria-expanded="true"] .bi { transform: rotate(45deg); }
.clip-pick .chips { margin-bottom: var(--s3); }
.clip-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--s3); margin-top: var(--s3); max-height: 56vh; overflow-y: auto; padding: 2px; }
.clip-pick-item { display: flex; flex-direction: column; gap: 6px; text-align: left; border-radius: 18px; padding: 4px; transition: background-color var(--dur) var(--ease-soft); }
.clip-pick-item:hover { background: var(--hover); }
.clip-pick-item .thumb { border-radius: 16px; }
.clip-pick-item .thumb.sk { aspect-ratio: 9 / 16; }
.clip-pick-title { font-size: 13px; font-weight: 600; line-height: 17px; padding: 0 2px; }
.msg .link-card { gap: var(--s3); padding: 6px 14px 6px 6px; border-radius: 18px; }
.msg .link-card.clip img { width: 46px; height: 62px; border-radius: 12px; }
.msg .link-card .lc-title { font-size: 15px; }

/* ---------- Звуки в результатах поиска ---------- */
.sound-rows { display: flex; flex-direction: column; gap: 4px; max-width: 720px; }
.sound-row { display: flex; align-items: center; gap: var(--s3); padding: var(--s2); border-radius: 20px; }
.sound-row:hover { background: var(--hover); }
.sound-row img { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; background: var(--skeleton); }
.sound-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sound-row-title { font-weight: 600; }

/* ---------- Пилюля «нравится | репосты» ---------- */
.pill-pair { display: inline-flex; align-items: center; height: 40px; border-radius: var(--r-pill); background: var(--btn); flex-shrink: 0; }
.pill-half { display: inline-flex; align-items: center; gap: 7px; height: 100%; padding: 0 16px; border-radius: var(--r-pill); font-weight: 600; font-size: 14px; transition: background-color var(--dur) var(--ease-soft); }
.pill-half:hover { background: var(--btn-hover); }
.pill-half + .pill-half { position: relative; }
.pill-half + .pill-half::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 1px; background: var(--border-strong); }
.pill-half .bi { font-size: 17px; }
.pill-half.liked .bi { color: var(--liked); }
.pill-half.reposted { color: var(--text); }
.pill-half.reposted .bi::before { font-weight: 700 !important; }
.pill-half.bump span, .pill-half.bump .bi { animation: bump 0.4s var(--ease-soft); }
@keyframes bump { 40% { transform: scale(1.18); } }

/* ---------- Закреплённый комментарий ---------- */
.cmt-pin-card { padding: var(--s4); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-card); margin-bottom: var(--s2); }
.cmt-pin-card .cmt-pinned { font-size: 13px; margin-bottom: var(--s2); }
.vp-mark {
  position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.35); z-index: 2; cursor: pointer;
  transition: transform 0.2s var(--ease-soft);
}
.vp-mark:hover { transform: scale(1.25); }
.vp-pin {
  position: absolute; bottom: 104px; width: min(360px, calc(100% - 24px)); padding: var(--s3) var(--s4);
  border-radius: 22px; background: rgba(255, 255, 255, 0.94); color: #101815;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.55);
  opacity: 0; filter: blur(8px); transform: translateY(8px) scale(0.98); pointer-events: none; cursor: pointer;
  transition: opacity 0.3s var(--ease-soft), transform 0.3s var(--ease-soft), filter 0.3s var(--ease-soft);
}
.vp-pin.show { opacity: 1; filter: none; transform: none; pointer-events: auto; }
.vp-pin-head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #56625d; margin-bottom: 6px; }
.vp-pin-row { display: flex; gap: var(--s3); }
.vp-pin-main { min-width: 0; flex: 1; }
.vp-pin-meta { display: flex; gap: var(--s2); font-size: 12px; color: #56625d; }
.vp-pin-meta b { color: #101815; }
.vp-pin-text { font-size: 15px; font-weight: 600; line-height: 20px; margin-top: 2px; }
.vp-pin-foot { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 12px; color: #56625d; }
@media (max-width: 767px) { .vp-pin { bottom: 72px; } }
.home .grid-videos { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--s6) var(--s4); }

/* ---------- Шапка: поиск и «Спросить Clipzy» (как в ролике) ----------
   Обычно: пилюля поиска + круглая кнопка с искрой. По кнопке пилюля поиска
   сжимается в круг с лупой, а кнопка раскрывается в поле ввода. */
.header-center { flex: 0 1 700px; display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.header-center .header-search { flex: 1 1 0; min-width: 46px; transition: flex 0.45s var(--ease-nav); }
.ask-form {
  flex: 0 0 46px; min-width: 46px; height: 46px; display: flex; align-items: center; overflow: hidden;
  border-radius: var(--r-pill); background: var(--surface-solid); box-shadow: var(--shadow-card); border: 1px solid transparent;
  transition: flex 0.45s var(--ease-nav), border-color var(--dur) var(--ease-soft);
}
.ask-input {
  flex: 1; width: 0; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; padding: 0;
  font-size: 15px; font-weight: 500; opacity: 0; transition: opacity 0.25s var(--ease-soft), padding 0.45s var(--ease-nav);
}
.ask-input::placeholder { color: var(--text-3); }
.ask-btn { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; font-size: 19px; color: var(--text); transition: background-color var(--dur) var(--ease-soft); }
.ask-btn:hover { background: var(--active-bg); }
.header-center.asking .header-search { flex: 0 0 46px; }
.header-center.asking .ask-form { flex: 1 1 0; border-color: var(--accent); }
.header-center.asking .ask-input { opacity: 1; padding-left: 22px; transition-delay: 0.12s, 0s; }
.header-center .search-box input { transition: opacity 0.2s var(--ease-soft); }
.header-center.asking .search-box { padding: 0; justify-content: center; cursor: pointer; }
.header-center.asking .search-box input { width: 0; flex: 0; padding: 0; opacity: 0; }
.header-center.asking .search-box button { width: 44px; height: 44px; }
.header-center.asking .sg-pop { display: none; }
@media (max-width: 767px) { .header-center { display: none; } }
.mobile-search.asking .search-box { border-color: var(--accent); }
.mobile-search.asking .sg-pop { display: none; }
.home .vcard-stats { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
