/* Корефаны: ночной неон. Тёмный фон, розовое и голубое свечение, плавные анимации */
:root {
  --bg: #0b0912;
  --panel: #15111f;
  --panel-2: #211a31;
  --fg: #f4efff;
  --muted: #9e93b8;
  --line: #2c2340;
  --accent: #ff4fd8;          /* неоновый розовый */
  --accent-2: #3ee6ff;        /* неоновый голубой */
  --accent-ink: #1a0717;
  --glow: 0 0 18px rgba(255, 79, 216, .55);
  --glow-2: 0 0 18px rgba(62, 230, 255, .5);
  --ok: #5ef0a0;
  --danger: #ff7a8a;
  --font-logo: "Rubik Mono One", "Arial Black", sans-serif;
  --font-body: "Manrope", "Segoe UI", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
/* iPhone: не увеличивать текст самому и не вылезать вбок за экран */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: hidden; }
/* Убираем «айфоновский» вид полей (свои тени, скругления и внутренние отступы), чтобы везде было одинаково */
input, textarea, button { -webkit-appearance: none; appearance: none; }
input[type=checkbox] { -webkit-appearance: auto; appearance: auto; }
body { background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 15px; line-height: 1.5; min-height: 100vh; }
/* Размытые неоновые пятна на фоне */
body::before {
  content: ""; position: fixed; inset: -15%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40vmax 40vmax at 10% 10%, rgba(255, 79, 216, .16), transparent 60%),
    radial-gradient(45vmax 45vmax at 90% 90%, rgba(62, 230, 255, .12), transparent 60%),
    radial-gradient(25vmax 25vmax at 80% 15%, rgba(140, 90, 255, .10), transparent 60%);
  animation: drift 36s ease-in-out infinite alternate;
}
/* Пятна света медленно плывут */
@keyframes drift {
  50% { transform: translate3d(5%, -4%, 0) scale(1.08); }
  100% { transform: translate3d(-4%, 5%, 0) scale(1.02); }
}
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* iPhone приближает страницу, если шрифт в поле меньше 16px, и края экрана уезжают.
   На телефонах во всех полях ввода ставим 16px, чтобы такого не было */
@media (max-width: 700px) {
  input, textarea, select { font-size: 16px; }
}

/* Тонкие тёмные полосы прокрутки вместо стандартных серых со стрелками — везде на сайте.
   Chrome при scrollbar-width рисует свои полосы со стрелками и игнорирует настройки ниже,
   поэтому scrollbar-width задаём только Firefox (у него нет ::-webkit-scrollbar) */
@supports (-moz-appearance: none) { * { scrollbar-width: thin; scrollbar-color: #3a2f52 transparent; } }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3a2f52; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
::-webkit-scrollbar-button { display: none; }

.loading { padding: 40px 16px; text-align: center; color: var(--muted); }

/* Заготовки, пока грузится: мерцают, как тусклый неон */
.skeleton { padding: 0; text-align: left; }
.sk-top { height: 52px; margin: 10px 16px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); }
.sk-body { max-width: 1100px; margin: 0 auto; padding: 28px 16px; display: grid; gap: 28px; }
.sk {
  border-radius: 12px; background: linear-gradient(100deg, var(--panel) 30%, #2a1f3d 50%, var(--panel) 70%);
  background-size: 250% 100%; animation: shimmer 1.4s linear infinite;
}
.sk-cover { height: clamp(230px, 38vw, 400px); border-radius: 20px; box-shadow: 0 0 30px rgba(255, 79, 216, .12); }
.sk-grid { column-width: 210px; column-gap: 10px; }
.sk-grid .sk { margin-bottom: 10px; break-inside: avoid; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }

/* Полоса прогресса при загрузке файлов */
.progress { height: 8px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.progress i {
  display: block; height: 100%; width: 0; border-radius: inherit; transition: width .4s ease;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent)); background-size: 200% 100%;
  box-shadow: 0 0 12px rgba(255, 79, 216, .8); animation: shimmer 1.2s linear infinite;
}
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* Шапка */
/* Шапка — парящая неоновая капсула. Сама полоса шапки прозрачная, лента видна вокруг капсулы */
.top { position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top, 0px); pointer-events: none; }
.top .wrap { padding-block: 10px 8px; }
.capsule {
  pointer-events: auto; display: flex; align-items: center; gap: 6px; height: 52px; padding: 0 6px 0 20px;
  border-radius: 999px; border: 1px solid rgba(255, 79, 216, .45);
  background: rgba(21, 17, 31, .82); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 0 0 1px rgba(255, 79, 216, .08), 0 8px 30px rgba(0, 0, 0, .45), 0 0 22px rgba(255, 79, 216, .18);
  transition: box-shadow .3s, border-color .3s, background .3s;
  animation: capsule-in .5s cubic-bezier(.2, 1.2, .4, 1) both;
}
body.scrolled .capsule { border-color: rgba(255, 79, 216, .7); box-shadow: 0 0 0 1px rgba(255, 79, 216, .15), 0 10px 34px rgba(0, 0, 0, .55), 0 0 30px rgba(255, 79, 216, .32); background: rgba(21, 17, 31, .92); }
@keyframes capsule-in { from { opacity: 0; transform: translateY(-10px) scale(.98); } }
.logo { font-family: var(--font-logo); font-size: 17px; letter-spacing: .02em; text-decoration: none; margin-right: auto; white-space: nowrap; text-shadow: 0 0 8px rgba(255, 79, 216, .8), 0 0 22px rgba(255, 79, 216, .45); animation: flicker 9s 3s infinite; }
/* Иногда логотип мигает, как старая вывеска */
@keyframes flicker { 0%, 94%, 100% { opacity: 1; } 94.5% { opacity: .35; } 95.2% { opacity: 1; } 96% { opacity: .5; } 96.6% { opacity: 1; } }
.logo span { color: var(--accent-2); text-shadow: var(--glow-2); }
/* Разделы с иконками. Под активным едет розовая подсветка .nav-ind */
.nav { position: relative; display: flex; gap: 2px; align-items: center; }
.nav a { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; white-space: nowrap; transition: color .25s; }
.nav a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s, filter .25s; }
.nav a:hover { color: var(--fg); }
.nav a:hover svg { transform: translateY(-2px) scale(1.08); }
.nav a.on { color: #fff; }
.nav a.on svg { color: var(--accent); filter: drop-shadow(0 0 6px rgba(255, 79, 216, .9)); }
.nav-ind {
  position: absolute; left: 0; top: 0; height: 40px; border-radius: 999px; pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 79, 216, .22), rgba(138, 60, 255, .18));
  box-shadow: inset 0 0 0 1px rgba(255, 79, 216, .55), 0 0 18px rgba(255, 79, 216, .35);
  transition: transform .45s cubic-bezier(.5, 1.4, .4, 1), width .45s cubic-bezier(.5, 1.4, .4, 1), opacity .25s;
}
.nav .nav-badge { margin-left: 0; }
.cta-up {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px 0 12px; margin-left: 6px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none; white-space: nowrap; box-shadow: var(--glow);
  transition: box-shadow .2s, transform .15s;
}
.cta-up svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.cta-up:hover { box-shadow: 0 0 28px rgba(255, 79, 216, .85); transform: translateY(-1px); }
.me-link { display: inline-flex; padding: 3px; border-radius: 50%; text-decoration: none; transition: box-shadow .2s; }
.me-link .ava { width: 38px; height: 38px; }
.me-link:hover { box-shadow: 0 0 0 2px var(--accent-2), var(--glow-2); }
.me-m { display: none; text-decoration: none; }
/* На средних экранах подписи прячем, остаются иконки */
@media (max-width: 1060px) { .nav a { padding: 0 12px; } .cta-up span { display: none; } .cta-up { padding: 0 12px; } }
@media (max-width: 900px) { .nav a { font-size: 0; gap: 0; padding: 0 12px; } .nav a svg { width: 20px; height: 20px; } }

/* Аватар: фото или первая буква имени */
.ava { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-weight: 700; color: #15121c; flex: none; overflow: hidden; }
.ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ava.big { width: 76px; height: 76px; font-size: 30px; box-shadow: 0 0 0 2px var(--accent), var(--glow); }

main.wrap { padding-block: 28px 64px; display: grid; gap: 28px; animation: fade .35s ease both; }
h1 {
  font-family: var(--font-logo); font-weight: 400; font-size: clamp(22px, 4vw, 32px); margin: 0; line-height: 1.15;
  background: linear-gradient(90deg, var(--fg) 30%, var(--accent) 75%, var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
h2 { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; font-weight: 700; }
.sub { color: var(--muted); margin: 6px 0 0; }
.sub a { color: var(--accent-2); }

/* Сетка фото и видео: каждое фото в своих пропорциях, без обрезки */
.grid { column-width: 210px; column-gap: 10px; }
.tile {
  display: block; width: 100%; margin: 0 0 10px; break-inside: avoid;
  position: relative; border: 0; padding: 0; border-radius: 10px; overflow: hidden; background: var(--panel); cursor: pointer;
  animation: rise .5s ease both; animation-delay: calc(var(--i, 0) * 45ms);
  transition: transform .2s, box-shadow .2s;
}
.tile:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px rgba(255, 79, 216, .5), 0 8px 30px rgba(255, 79, 216, .25); }
.tile img { width: 100%; height: auto; display: block; }
.tile .play { position: absolute; right: 8px; top: 8px; background: rgba(0, 0, 0, .6); border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 700; color: var(--accent-2); }
.tile .noimg { display: grid; place-items: center; aspect-ratio: 4 / 3; color: var(--muted); font-size: 28px; }
.tile .rc { position: absolute; left: 8px; bottom: 8px; background: rgba(0, 0, 0, .6); border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 700; }
/* Обложка ленты */
.cover {
  position: relative; display: grid; align-items: end; overflow: hidden;
  height: clamp(320px, 46vw, 560px); border-radius: 20px; border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255, 79, 216, .35), rgba(62, 230, 255, .18)), var(--panel);
  box-shadow: var(--glow); animation: rise .5s ease both;
}
/* Слайды обложки: фото целиком (cs-fg) поверх своей размытой копии (cs-bg), смена — заезд сбоку */
.cover-slide { position: absolute; inset: 0; overflow: hidden; transform: translateX(100%); transition: transform .9s cubic-bezier(.7, 0, .2, 1); cursor: pointer; }
.cover-slide.on { transform: none; }
.cs-bg { position: absolute; inset: -8%; width: 116%; height: 116%; object-fit: cover; filter: blur(28px) brightness(.55) saturate(1.3); }
.cs-fg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cover-slide.on .cs-fg { animation: ken 6s ease-out both; }
@keyframes ken { from { transform: scale(1.06); } to { transform: scale(1); } }
.cover-dots { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 2; display: flex; gap: 6px; pointer-events: none; }
.cover-dots i { width: 6px; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .35); transition: width .3s, background .3s, box-shadow .3s; }
.cover-dots i.on { width: 18px; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.cover-in { pointer-events: none; }
@media (max-width: 700px) { .cover { height: min(118vw, 66vh); border-radius: 16px; } }
.cover > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(1.15) contrast(1.05); }
.cover::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(to top, rgba(11, 9, 18, .96) 8%, rgba(11, 9, 18, .35) 55%, rgba(255, 79, 216, .18)); }
.cover-in { position: relative; z-index: 2; padding: clamp(18px, 4vw, 34px); display: grid; gap: 10px; }
.cover-kicker { margin: 0; font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--accent-2); text-shadow: var(--glow-2); }
.cover-title { font-size: clamp(30px, 6vw, 54px); color: #ffe6fb; background: none; text-shadow: 0 0 10px var(--accent), 0 0 30px rgba(255, 79, 216, .6); }
.stats { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.stats b { display: block; font-family: var(--font-logo); font-weight: 400; font-size: 22px; line-height: 1.2; text-shadow: 0 0 12px rgba(62, 230, 255, .5); }
.stats span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.month { display: grid; gap: 10px; }
.month + .month { margin-top: 18px; }
.empty { color: var(--muted); background: var(--panel); border: 1px dashed var(--line); border-radius: 12px; padding: 28px 20px; text-align: center; }
.empty a { color: var(--accent); font-weight: 600; }

/* Корефаны-постеры */
.posters { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.poster {
  position: relative; display: grid; align-items: end; aspect-ratio: 3 / 4; max-width: 100%; overflow: hidden;
  border-radius: 16px; text-decoration: none; border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255, 79, 216, .35), rgba(62, 230, 255, .2)), var(--panel);
  animation: rise .5s ease both; animation-delay: calc(var(--i, 0) * 60ms);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.poster > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.poster::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(11, 9, 18, .95) 12%, rgba(11, 9, 18, .2) 60%, rgba(255, 79, 216, .12)); }
.poster:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--glow); }
.poster:hover > img { transform: scale(1.06); }
.poster-in { position: relative; z-index: 1; display: grid; gap: 4px; padding: 16px; }
.poster-in .ava { box-shadow: 0 0 0 2px var(--accent); margin-bottom: 6px; }
.poster-in b { font-family: var(--font-logo); font-weight: 400; font-size: 18px; line-height: 1.2; color: #ffe6fb; text-shadow: 0 0 10px rgba(255, 79, 216, .8); overflow-wrap: anywhere; }
.poster-in span { font-size: 13px; color: var(--muted); }
@media (max-width: 700px) { .posters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .poster-in { padding: 12px; } .poster-in b { font-size: 15px; } }

/* Список корефанов */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.person { display: flex; gap: 12px; align-items: center; padding: 14px; background: var(--panel); border-radius: 12px; text-decoration: none; border: 1px solid var(--line); transition: border-color .2s, box-shadow .2s, transform .2s; animation: rise .45s ease both; }
.person:hover { border-color: var(--accent); box-shadow: var(--glow); transform: translateY(-2px); }
.person b { display: block; }
.person span { color: var(--muted); font-size: 13px; }
.head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }

/* Профиль корефана */
.profile { display: flex; gap: clamp(16px, 4vw, 36px); align-items: center; flex-wrap: wrap; padding: clamp(16px, 3vw, 28px); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; animation: rise .45s ease both; }
.profile .ava.big { width: clamp(86px, 18vw, 128px); height: clamp(86px, 18vw, 128px); font-size: clamp(34px, 7vw, 52px); box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent), 0 0 30px rgba(255, 79, 216, .6); }
.pinfo { display: grid; gap: 8px; min-width: 0; flex: 1 1 260px; }
.pinfo .sub { margin: 0; }
.pinfo .stats { margin-top: 6px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display: inline-grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; padding: 8px 14px 8px 10px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-weight: 700; font-size: 14px; animation: rise .45s ease both; }
.badge i { grid-row: span 2; font-style: normal; font-size: 22px; }
.badge small { font-weight: 500; font-size: 12px; color: var(--muted); }
.badge.gold { border-color: var(--accent); box-shadow: 0 0 16px rgba(255, 79, 216, .35); }

/* Формы */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: grid; gap: 14px; max-width: 640px; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=date], textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 79, 216, .15); outline: none; }
/* Поля для текста сами растут под текст (autoGrow в app.js), полоса прокрутки появляется только на максимуме */
textarea { min-height: 70px; max-height: 300px; resize: none; overflow-y: hidden; }
.btn { border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px; padding: 10px 16px; cursor: pointer; font-weight: 600; transition: box-shadow .2s, transform .1s, border-color .2s; }
.btn:hover { border-color: var(--accent-2); box-shadow: var(--glow-2); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: var(--glow); }
.btn.primary:hover { box-shadow: 0 0 28px rgba(255, 79, 216, .85); }
.btn.danger { color: var(--danger); border-color: currentColor; background: transparent; }
.btn.danger:hover { box-shadow: 0 0 16px rgba(255, 122, 138, .45); }
.btn:disabled { opacity: .5; cursor: default; box-shadow: none; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.msg { font-size: 14px; color: var(--muted); margin: 0; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--ok); }

.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 26px 16px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color .2s, box-shadow .2s, color .2s; }
.drop:hover, .drop.over { border-color: var(--accent); color: var(--fg); box-shadow: inset 0 0 30px rgba(255, 79, 216, .15); }
.picked { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.picked div { aspect-ratio: 1; border-radius: 8px; background: var(--panel-2) center / cover; display: grid; place-items: center; font-size: 12px; color: var(--muted); animation: rise .3s ease both; }

/* Отметки людей */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--panel-2); border: 1px solid transparent; cursor: pointer; text-decoration: none; font-size: 14px; transition: border-color .2s, box-shadow .2s; }
.chip .ava { width: 24px; height: 24px; font-size: 12px; }
.chip:hover { border-color: var(--line); }
.chip[aria-pressed="true"] { border-color: var(--accent); background: rgba(255, 79, 216, .15); box-shadow: 0 0 12px rgba(255, 79, 216, .35); }

/* Цитаты и шутки */
.tab { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 6px 14px; cursor: pointer; font-weight: 600; color: var(--muted); transition: all .2s; }
.tab[aria-pressed="true"] { background: var(--panel-2); color: var(--fg); border-color: var(--accent); box-shadow: 0 0 12px rgba(255, 79, 216, .3); }
.quotes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; align-items: start; }
.quote { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 12px; border-top: 3px solid var(--accent); box-shadow: 0 -6px 20px -10px rgba(255, 79, 216, .6); animation: rise .45s ease both; }
.quote.joke { border-top-color: var(--accent-2); box-shadow: 0 -6px 20px -10px rgba(62, 230, 255, .6); }
.quote .kind { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.quote .qtext { margin: 0; font-size: 19px; line-height: 1.35; font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; }
.quote .qmeta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.link-btn { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; font-size: 12px; text-decoration: underline; }
.link-btn:hover { color: var(--danger); }

/* Реакции */
.reacts { display: flex; gap: 6px; flex-wrap: wrap; }
.react { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 4px 10px; cursor: pointer; font-size: 16px; line-height: 1.2; transition: border-color .2s, box-shadow .2s, transform .1s; }
.react:active { transform: scale(.9); }
.react span { font-size: 13px; font-weight: 700; color: var(--muted); }
.react[aria-pressed="true"] { border-color: var(--accent); background: rgba(255, 79, 216, .15); box-shadow: 0 0 14px rgba(255, 79, 216, .45); }
.react[aria-pressed="true"] span { color: var(--fg); }
.react.pop { animation: pop .35s ease; }

/* Комментарии */
.comments { display: grid; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; }
.comments h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.c-count:not(:empty) { color: var(--accent); background: rgba(255, 79, 216, .15); border-radius: 999px; padding: 0 8px; font-size: 12px; letter-spacing: 0; box-shadow: 0 0 10px rgba(255, 79, 216, .35); }
.c-list { display: grid; gap: 10px; }
.c-empty { margin: 0; font-size: 14px; color: var(--muted); }
.c-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: start; animation: rise .35s ease both; animation-delay: calc(var(--i, 0) * 40ms); }
.c-item > a { text-decoration: none; }
.c-item .ava { width: 30px; height: 30px; font-size: 13px; }
.c-bubble { background: var(--panel-2); border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; padding: 8px 12px; min-width: 0; }
.c-item.mine .c-bubble { border-color: rgba(255, 79, 216, .45); background: linear-gradient(135deg, rgba(255, 79, 216, .16), var(--panel-2) 70%); }
.c-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 12px; }
.c-head span { color: var(--muted); }
.c-head .link-btn { margin-left: auto; }
.c-text { margin: 2px 0 0; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.c-item.new { animation: pop-in .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.c-item.new .c-bubble { animation: glow-pulse 1.4s ease; }
.c-item.bye { animation: bye .28s ease forwards; }

.c-form { position: sticky; bottom: -20px; display: flex; gap: 8px; align-items: flex-end; padding: 10px 0 20px; background: var(--panel); }
.c-form .pill textarea { max-height: 120px; }
.c-form .c-send { width: 44px; height: 44px; }
.c-send {
  flex: none; display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); box-shadow: var(--glow); transition: transform .15s, box-shadow .2s, opacity .2s;
}
.c-send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.c-send:hover:not(:disabled) { transform: scale(1.08); box-shadow: 0 0 26px rgba(255, 79, 216, .9); }
.c-send:disabled { opacity: .35; box-shadow: none; cursor: default; }
.c-send.flying svg { animation: fly .6s ease-in-out infinite; }

@keyframes pop-in { from { opacity: 0; transform: translateY(14px) scale(.9); } }
@keyframes glow-pulse { 0% { box-shadow: 0 0 0 rgba(255, 79, 216, 0); } 30% { box-shadow: 0 0 24px rgba(255, 79, 216, .75); } 100% { box-shadow: 0 0 0 rgba(255, 79, 216, 0); } }
@keyframes bye { to { opacity: 0; transform: translateX(30px) scale(.95); } }
@keyframes fly { 45% { transform: translate(8px, -8px) scale(.7); opacity: 0; } 55% { transform: translate(-8px, 8px) scale(.7); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* ---------- Мессенджер v2: два окна, пузыри как в Telegram ---------- */
body.chats-page main.wrap { padding-block: 4px 16px; gap: 0; animation: none; }
.chat-layout {
  display: grid; grid-template-columns: 320px minmax(0, 1fr);
  height: calc(var(--vvh, 100dvh) - 90px - env(safe-area-inset-top, 0px));
  border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: var(--panel);
  box-shadow: 0 0 30px rgba(255, 79, 216, .08);
}
.chat-side { border-right: 1px solid var(--line); overflow-y: auto; padding: 14px 10px; display: flex; flex-direction: column; gap: 10px; }
.cs-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.cs-head h1 { font-size: 22px; }
.icon-btn { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; border-radius: 50%; font-size: 18px; }
.chat-panel { display: grid; gap: 10px; padding: 12px; border-radius: 14px; background: var(--panel-2); animation: rise .25s ease both; }
.label-sm { margin: 0; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.chat-side .chat-list { gap: 2px; }
.chat-side .chat-row { border-color: transparent; background: transparent; padding: 10px; }
.chat-side .chat-row:hover { background: var(--panel-2); transform: none; box-shadow: none; border-color: transparent; }
.chat-side .chat-row.active { background: linear-gradient(135deg, rgba(255, 79, 216, .2), rgba(138, 60, 255, .14)); border-color: rgba(255, 79, 216, .5); }
.chat-side.no-anim .chat-row { animation: none; }
.chat-main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pick-main { display: grid; place-items: center; }
.pick { text-align: center; color: var(--muted); }
.pick span { font-size: 54px; display: block; filter: drop-shadow(0 0 16px rgba(255, 79, 216, .6)); animation: float 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
.chat-main .chat-head { padding: 10px 16px; background: rgba(21, 17, 31, .9); z-index: 2; }
.chat-main .composer { padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background: rgba(21, 17, 31, .92); }
@media (min-width: 861px) { .chat-head .back { display: none; } }

/* Фон переписки: неоновые точки и мягкие пятна, как обои в Telegram */
.chat-main .msgs {
  display: block; padding: 14px 16px; overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 79, 216, .10), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(62, 230, 255, .08), transparent 45%),
    radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1.2px) 0 0 / 18px 18px,
    #0d0a15;
}
.msgs-in { display: flex; flex-direction: column; gap: 2px; max-width: 760px; min-height: 100%; margin: 0 auto; justify-content: flex-end; }

/* Пузыри: подряд идущие склеиваются, «хвостик» только у последнего в блоке */
.msgs-in .msg { max-width: min(80%, 520px); }
.msgs-in .msg:not(.run) { margin-top: 10px; }
.msgs-in .bubble { border-radius: 18px; padding: 7px 12px 7px; }
.msgs-in .msg:not(.mine) .bubble { background: #221b31; border-color: #2e2542; }
.msgs-in .msg:not(.mine).run .bubble { border-top-left-radius: 6px; }
.msgs-in .msg:not(.mine):not(.tail) .bubble { border-bottom-left-radius: 6px; }
.msgs-in .msg:not(.mine).tail .bubble { border-bottom-left-radius: 4px; }
.msgs-in .msg.mine .bubble { border-radius: 18px; }
.msgs-in .msg.mine.run .bubble { border-top-right-radius: 6px; }
.msgs-in .msg.mine:not(.tail) .bubble { border-bottom-right-radius: 6px; }
.msgs-in .msg.mine.tail .bubble { border-bottom-right-radius: 4px; }
.msgs-in .m-ava { visibility: hidden; align-self: flex-end; }
.msgs-in .msg.tail .m-ava { visibility: visible; }

/* Время и галочки внутри пузыря, в правом нижнем углу */
.m-meta { float: right; display: inline-flex; align-items: center; gap: 3px; margin: 7px 0 -5px 10px; font-size: 11px; line-height: 1; opacity: .7; white-space: nowrap; }
.m-meta time { display: inline; margin: 0; opacity: 1; }
.m-meta.on-img { float: none; position: absolute; right: 18px; bottom: 12px; padding: 3px 7px; border-radius: 999px; background: rgba(0, 0, 0, .55); opacity: 1; color: #fff; }
.msgs-in .bubble { position: relative; }
.tick { font-style: normal; font-size: 12px; letter-spacing: -3px; padding-right: 3px; transition: color .3s, text-shadow .3s; }
.tick.read { color: #8ff4ff; text-shadow: 0 0 6px rgba(62, 230, 255, .9); }

/* Только эмодзи — крупно, без пузыря */
.msgs-in .msg.jumbo .bubble { background: none !important; border: 0; box-shadow: none !important; padding: 0; }
.msg.jumbo .m-text { font-size: 48px; line-height: 1.1; }
.msg.jumbo .m-meta { float: none; display: flex; justify-content: flex-end; margin: 2px 0 0; color: var(--muted); }
.msg.jumbo.new .m-text { display: inline-block; animation: jumbo-pop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes jumbo-pop { 0% { transform: scale(.2) rotate(-20deg); opacity: 0; } 60% { transform: scale(1.25) rotate(8deg); } 100% { transform: none; opacity: 1; } }

/* Полоска «Новые сообщения» */
.new-sep { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; color: var(--accent); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.new-sep::before, .new-sep::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); box-shadow: 0 0 6px var(--accent); }

/* Кнопка «вниз» со счётчиком новых */
.to-bottom {
  position: absolute; right: 18px; bottom: 84px; z-index: 3; width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; border: 1px solid rgba(255, 79, 216, .5); background: rgba(21, 17, 31, .92); color: var(--fg);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .5), 0 0 14px rgba(255, 79, 216, .3); animation: rise .25s ease both;
}
.to-bottom svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.to-bottom .tb-count { position: absolute; top: -6px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-style: normal; font-weight: 800; box-shadow: var(--glow); }
.to-bottom.pop { animation: pop .35s ease; }

/* Свайп для ответа: справа появляется значок ↩ */
.msgs-in .msg { position: relative; }
.msgs-in .msg::after { content: "↩"; position: absolute; right: -34px; top: 50%; transform: translateY(-50%) scale(.5); opacity: 0; font-size: 18px; color: var(--accent-2); transition: opacity .15s, transform .15s; }
.msgs-in .msg.swiping::after { opacity: 1; transform: translateY(-50%) scale(1); }

/* Кто в сети: зелёная точка на аватарке */
.ava-wrap { position: relative; display: inline-flex; flex: none; }
.ava-wrap.is-online::after { content: ""; position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: #3ddc84; border: 2px solid var(--panel); box-shadow: 0 0 8px rgba(61, 220, 132, .8); animation: pop .4s ease; }
#chSub.online { color: #3ddc84; }

/* Телефон: список и переписка — отдельные экраны */
@media (max-width: 860px) {
  .chat-layout { display: block; height: auto; border: 0; border-radius: 0; background: none; box-shadow: none; overflow: visible; }
  .chat-side { border: 0; padding: 0; overflow: visible; }
  .pick-main { display: none; }
  body.in-chat .chat-side { display: none; }
  /* Открытая переписка на телефоне — на весь экран, как в Telegram: без верхней капсулы,
     прибита к видимой части экрана. Когда выезжает клавиатура, чат сжимается над ней, а не уезжает вверх */
  body.in-chat { overflow: hidden; }
  body.in-chat .top { display: none; }
  body.in-chat .chat-layout {
    position: fixed; left: 0; right: 0; top: var(--vvt, 0px); z-index: 15;
    display: flex; height: var(--vvh, 100dvh); margin: 0; background: var(--bg);
  }
  body.in-chat .chat-main { flex: 1; }
  body.in-chat .chat-main .chat-head { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
  /* С открытой клавиатурой нижний отступ под «полоску» iPhone не нужен */
  body.in-chat.kb-open .chat-main .composer { padding-bottom: 8px; }
  body.chats-page:not(.in-chat) main.wrap { padding-block: 10px 24px; }
  .chat-side .chat-row { background: var(--panel); border-color: var(--line); }
  .msgs-in .msg { max-width: 86%; }
  .to-bottom { right: 12px; }
}

/* Плашка «новое на сайте» */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 60; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px);
  padding: 10px 10px 10px 18px; border-radius: 999px; background: rgba(21, 17, 31, .95); backdrop-filter: blur(10px);
  border: 1px solid var(--accent); box-shadow: var(--glow); font-weight: 600; font-size: 14px;
  animation: toast-in .4s cubic-bezier(.2, 1.4, .4, 1) both;
}
.toast span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast button { flex: none; border: 0; border-radius: 999px; padding: 6px 14px; background: var(--accent); color: var(--accent-ink); font-weight: 700; cursor: pointer; }
.toast.out { animation: toast-out .3s ease forwards; }
@media (max-width: 700px) { .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 30px) scale(.9); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, 20px); } }

/* ---------- Мессенджер ---------- */

/* Счётчик непрочитанных в меню */
.nav-badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-size: 11px; font-style: normal; font-weight: 800; vertical-align: 1px;
  box-shadow: 0 0 10px rgba(255, 79, 216, .8); animation: pop .4s ease;
}
.bn-ico { position: relative; display: block; }
.bn-ico .nav-badge { position: absolute; top: -6px; right: -12px; margin: 0; }
.top-m { color: var(--muted); }
.top-m svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Аватарки общих чатов и групп */
.chat-ava { color: var(--accent-ink); font-weight: 800; font-size: 14px; }
.chat-ava.general { background: radial-gradient(circle at 30% 30%, #ff8ae6, var(--accent)); font-family: var(--font-logo); font-weight: 400; box-shadow: 0 0 12px rgba(255, 79, 216, .6); }
.chat-ava.group { background: linear-gradient(135deg, var(--accent-2), #8c5aff); }

/* Список чатов */
.chat-panel { animation: rise .3s ease both; }
.chat-list { display: grid; gap: 6px; }
.chat-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); text-decoration: none;
  animation: rise .4s ease both; animation-delay: calc(var(--i, 0) * 40ms); transition: border-color .2s, box-shadow .2s, transform .2s;
}
.chat-row:hover { border-color: var(--accent); box-shadow: var(--glow); transform: translateX(3px); }
.chat-row .ava { width: 46px; height: 46px; font-size: 18px; }
.cr-main { display: grid; min-width: 0; }
.cr-main b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-main span { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row.unread .cr-main span { color: var(--fg); }
.cr-side { display: grid; justify-items: end; gap: 4px; }
.cr-side time { font-size: 12px; color: var(--muted); }
.cr-badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-style: normal; font-weight: 800; box-shadow: 0 0 12px rgba(255, 79, 216, .8); }

/* Переписка на весь экран */
body.in-chat main.wrap { padding-block: 0; gap: 0; animation: none; }
body.in-chat .bnav { display: none; }
body.in-chat { padding-bottom: 0; }
.chat { display: flex; flex-direction: column; height: calc(var(--vvh, 100dvh) - 70px - env(safe-area-inset-top, 0px)); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.chat-head .back { padding: 8px 12px; }
.ch-who { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; text-decoration: none; }
.ch-who > div { display: grid; min-width: 0; }
.ch-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-who span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.add-ppl { padding: 10px 0; display: grid; gap: 8px; border-bottom: 1px solid var(--line); animation: rise .25s ease both; }

.msgs { flex: 1; overflow-y: auto; padding: 16px 2px; display: flex; flex-direction: column; gap: 4px; overscroll-behavior: contain; }
.msgs-empty { margin: auto; color: var(--muted); }
.day-sep { display: flex; justify-content: center; margin: 14px 0 8px; }
.day-sep span { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--panel); border: 1px solid var(--line); padding: 3px 12px; border-radius: 999px; }

.msg { display: flex; gap: 8px; align-items: flex-end; max-width: min(78%, 560px); }
.msg:not(.run) { margin-top: 8px; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.m-ava { width: 30px; flex: none; text-decoration: none; }
.m-ava .ava { width: 30px; height: 30px; font-size: 13px; }
.m-body { display: grid; gap: 3px; min-width: 0; position: relative; }
.msg.mine .m-body { justify-items: end; }
.m-name { font-size: 12px; font-weight: 700; color: var(--accent-2); padding-left: 12px; }
.bubble {
  position: relative; background: var(--panel-2); border: 1px solid var(--line); border-radius: 18px 18px 18px 6px;
  padding: 8px 12px 6px; cursor: pointer; min-width: 0; max-width: 100%; transition: box-shadow .2s;
}
.msg.run .bubble { border-radius: 6px 18px 18px 6px; }
.msg.mine .bubble {
  border-radius: 18px 18px 6px 18px; border-color: transparent; color: #fff;
  background: linear-gradient(135deg, #d63ab4, #8a3cff); box-shadow: 0 0 16px rgba(255, 79, 216, .25);
}
.msg.mine.run .bubble { border-radius: 18px 6px 6px 18px; }
.msg.active .bubble { box-shadow: 0 0 0 2px var(--accent-2), var(--glow-2); }
.m-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; }
.m-text a { color: var(--accent-2); }
.msg.mine .m-text a { color: #dffbff; }
.bubble time { display: block; text-align: right; font-size: 11px; opacity: .6; margin-top: 2px; }
.m-img { display: block; max-width: min(100%, 320px); max-height: 360px; border-radius: 12px; margin: 2px 0 4px; cursor: zoom-in; object-fit: cover; }
.m-img-pending { padding: 30px 20px; font-size: 14px; }
.m-reply {
  display: grid; text-align: left; width: 100%; margin-bottom: 6px; padding: 4px 10px; border: 0; border-left: 3px solid var(--accent-2);
  border-radius: 6px; background: rgba(0, 0, 0, .25); cursor: pointer; font-size: 13px; color: inherit;
}
.m-reply b { color: var(--accent-2); font-size: 12px; }
.m-reply span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }
.msg.mine .m-reply { border-left-color: #fff; } .msg.mine .m-reply b { color: #fff; }

.m-reacts { display: flex; gap: 4px; flex-wrap: wrap; }
.m-reacts:empty { display: none; }
.m-react { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 1px 8px; font-size: 13px; cursor: pointer; }
.m-react[aria-pressed="true"] { border-color: var(--accent); background: rgba(255, 79, 216, .18); box-shadow: 0 0 10px rgba(255, 79, 216, .4); }
.m-react.pop { animation: pop .35s ease; }

/* Меню действий над сообщением */
.m-actions {
  display: none; position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 5;
  gap: 2px; padding: 4px; border-radius: 999px; background: rgba(21, 17, 31, .97); border: 1px solid var(--accent); box-shadow: var(--glow);
  white-space: nowrap;
}
.msg.mine .m-actions { left: auto; right: 0; }
.msg.active .m-actions { display: flex; animation: pop-in .25s cubic-bezier(.2, 1.4, .4, 1) both; }
.m-actions button { border: 0; background: none; border-radius: 999px; padding: 4px 8px; cursor: pointer; font-size: 18px; }
.m-actions button[data-mact="reply"], .m-actions button[data-mact="del"] { font-size: 13px; font-weight: 700; }
.m-actions button:hover { background: var(--panel-2); }
.m-actions .danger { color: var(--danger); }

/* Анимации сообщений */
.msg.new { animation: msg-in .4s cubic-bezier(.2, 1.3, .4, 1) both; }
.msg.mine.new .bubble { animation: glow-pulse 1.2s ease; }
.msg.pending { opacity: .55; }
.msg.pending .bubble { background: linear-gradient(100deg, #8a3cff 30%, #d63ab4 50%, #8a3cff 70%); background-size: 250% 100%; animation: shimmer 1.2s linear infinite; }
.msg.failed .bubble { background: var(--panel-2); border: 1px solid var(--danger); }
.m-fail { display: block; font-size: 12px; color: var(--danger); }
.msg.bye { animation: bye .28s ease forwards; }
.msg.flash .bubble { animation: flash 1.2s ease; }
@keyframes msg-in { from { opacity: 0; transform: translateY(16px) scale(.92); } }
@keyframes flash { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 3px var(--accent-2), 0 0 26px rgba(62, 230, 255, .7); } }

/* Поле ввода */
.composer { border-top: 1px solid var(--line); padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; }
.reply-bar { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-left: 3px solid var(--accent-2); background: var(--panel); border-radius: 8px; animation: rise .2s ease both; }
.reply-bar div { display: grid; min-width: 0; flex: 1; font-size: 13px; }
.reply-bar b { color: var(--accent-2); font-size: 12px; }
.reply-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.comp-row { display: flex; align-items: flex-end; gap: 8px; width: 100%; }
/* Поле и обе кнопки ровно 44px.
   Рамку рисует обёртка .pill, а само поле внутри прозрачное и без рамки:
   так Safari на iPhone не может сделать поле выше или ниже кнопок своими настройками */
.pill {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center;
  min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 22px; background: var(--bg);
  transition: border-color .2s, box-shadow .2s;
}
.pill:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 79, 216, .15); }
.pill textarea, .pill textarea:focus {
  flex: 1 1 auto; width: 100%; min-width: 0; margin: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; outline: none;
  height: 42px; min-height: 42px; padding: 11px 0; line-height: 20px;
}
.comp-row .pill textarea { max-height: 140px; }
.comp-row .c-send { width: 44px; height: 44px; }
.attach { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--panel-2); color: var(--accent-2); cursor: pointer; transition: box-shadow .2s, border-color .2s; }
.attach:hover { border-color: var(--accent-2); box-shadow: var(--glow-2); }
.attach svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }

/* Фото на весь экран */
/* Фото из чата на весь экран: всегда целиком помещается в окно, и высокие скриншоты тоже */
.lightbox { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(6, 4, 10, .96); backdrop-filter: blur(8px); cursor: zoom-out; animation: fade .2s ease both; }
.lightbox img {
  display: block; width: auto; height: auto; object-fit: contain;
  max-width: calc(100vw - 32px); max-height: calc(var(--vvh, 100dvh) - 32px);
  border-radius: 8px; animation: zoom .25s ease both; box-shadow: 0 0 60px rgba(255, 79, 216, .25);
}
.lightbox .lb-close { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px; z-index: 1; }
.lightbox.out { animation: toast-out .2s ease forwards; }

@media (max-width: 700px) {
  .chat { height: calc(var(--vvh, 100dvh) - 70px - env(safe-area-inset-top, 0px)); }
  .msg { max-width: 86%; }
  .top-m { margin-right: 4px; }
}

/* Плашка Netlify в правом нижнем углу (около 190×55): пока она есть, поднимаем свои кнопки над ней */
body.has-nl-badge .composer { padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }
body.has-nl-badge .c-form { padding-bottom: 76px; }
body.has-nl-badge .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 700px) {
  body.has-nl-badge { padding-bottom: calc(124px + env(safe-area-inset-bottom, 0px)); }
  body.has-nl-badge .bnav { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
  body.has-nl-badge .toast { bottom: calc(140px + env(safe-area-inset-bottom, 0px)); }
  body.in-chat.has-nl-badge { padding-bottom: 0; }
}

.push-on { font-weight: 700; color: var(--ok); text-shadow: 0 0 10px rgba(94, 240, 160, .5); }

/* ---------- Новые анимации ---------- */

/* Пока открыт просмотр фото, страница под ним не прокручивается */
body.viewer-open { overflow: hidden; }

/* Большое сердце при двойном касании по фото */
.big-heart {
  position: absolute; left: 50%; top: 50%; z-index: 3; pointer-events: none;
  font-size: clamp(90px, 22vw, 160px); line-height: 1;
  filter: drop-shadow(0 0 24px rgba(255, 79, 216, .9));
  animation: big-heart 1s cubic-bezier(.2, 1.3, .4, 1) forwards;
}
@keyframes big-heart {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.2); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  35% { transform: translate(-50%, -50%) scale(.95); }
  70% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -80%) scale(1.1); }
}

/* Эмодзи, вылетающие из нажатой реакции */
.float-emoji {
  position: fixed; z-index: 90; pointer-events: none; font-size: 22px;
  transform: translate(-50%, 0); animation: float-up 1.1s ease-out both;
}
@keyframes float-up {
  0% { opacity: 0; transform: translate(-50%, 0) scale(.5); }
  15% { opacity: 1; transform: translate(-50%, -10px) scale(1.2); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), -90px) scale(.9) rotate(15deg); }
}

/* Меню у самого верхнего сообщения открывается вниз */
.msg.below .m-actions { bottom: auto; top: calc(100% + 6px); }

/* «Миша печатает...» с прыгающими точками */
.ch-who span.typing { color: var(--accent-2); }
.ch-who span.typing i { display: inline-block; width: 4px; height: 4px; margin-left: 3px; border-radius: 50%; background: currentColor; vertical-align: middle; animation: dot 1s infinite; }
.ch-who span.typing i:nth-child(2) { animation-delay: .15s; }
.ch-who span.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }

/* ---------- Лента постов ---------- */
.feed { display: grid; gap: 22px; width: 100%; max-width: 560px; margin: 0 auto; }
.feed-month { display: flex; align-items: center; gap: 12px; margin: 8px 0 -6px; }
.feed-month::before, .feed-month::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 79, 216, .6), transparent); }
.feed-month span { font-family: var(--font-logo); font-size: 13px; letter-spacing: .08em; color: #ffe6fb; text-shadow: 0 0 10px rgba(255, 79, 216, .8); white-space: nowrap; }
.feed-more { text-align: center; color: var(--muted); font-size: 13px; padding: 10px 0 20px; }

.post {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  animation: post-in .55s cubic-bezier(.2, 1, .3, 1) both; animation-delay: calc(var(--i, 0) * 70ms);
  transition: border-color .3s, box-shadow .3s;
}
.post:hover { border-color: rgba(255, 79, 216, .45); box-shadow: 0 0 26px rgba(255, 79, 216, .14); }
@keyframes post-in { from { opacity: 0; transform: translateY(26px) scale(.97); } }
.post-head { padding: 12px 14px; }
.post-who { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.post-who .ava { width: 38px; height: 38px; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--accent); }
.post-who div { display: grid; line-height: 1.25; }
.post-who b { font-size: 15px; }
.post-who span { font-size: 12px; color: var(--muted); }
.post-media { position: relative; background: #000; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.post-media img, .post-media video { display: block; width: 100%; max-height: 720px; object-fit: cover; }
.post-media video { object-fit: contain; background: #000; }
.post-body { padding: 10px 14px 14px; display: grid; gap: 8px; }
.post-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.post-actions .reacts { display: contents; }
.post-cbtn { margin-left: auto; }
.post-cap { margin: 0; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-cap b, .post-c b { margin-right: 4px; }
.post-people { margin: 0; font-size: 13px; color: var(--muted); }
.post-people a { color: var(--accent-2); text-decoration: none; }
.post-people a:hover { text-decoration: underline; }
.post-comments { display: grid; gap: 4px; }
.post-c { margin: 0; font-size: 14px; overflow-wrap: anywhere; animation: rise .3s ease both; }
.post-all { justify-self: start; font-size: 13px; text-decoration: none; }
.post-write {
  justify-self: stretch; text-align: left; margin-top: 4px; padding: 9px 14px; border-radius: 999px; cursor: text;
  border: 1px solid var(--line); background: var(--bg); color: var(--muted); font-size: 14px; transition: border-color .2s;
}
.post-write:hover { border-color: var(--accent); }
@media (max-width: 700px) {
  .feed { gap: 16px; }
  .post { border-radius: 14px; }
  .post-media img { max-height: 560px; }
}

/* ---------- Галерея ---------- */
.poster { cursor: pointer; font: inherit; color: inherit; text-align: left; padding: 0; }
.poster:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }
.poster[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), 0 0 30px rgba(255, 79, 216, .55); transform: translateY(-4px); }
.posters.filtered .poster[aria-pressed="false"] { opacity: .45; filter: saturate(.6); }
.posters.filtered .poster[aria-pressed="false"]:hover { opacity: .8; filter: none; }
.poster { transition: transform .25s, box-shadow .25s, border-color .25s, opacity .3s, filter .3s; }
.poster-link {
  position: absolute; top: 10px; right: 10px; z-index: 2; padding: 4px 10px; border-radius: 999px;
  background: rgba(11, 9, 18, .7); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, .15);
  color: #fff; font-size: 12px; font-weight: 600; text-decoration: none; opacity: 0; transform: translateY(-4px);
  transition: opacity .2s, transform .2s, border-color .2s;
}
.poster:hover .poster-link, .poster[aria-pressed="true"] .poster-link { opacity: 1; transform: none; }
.poster-link:hover { border-color: var(--accent-2); }
@media (hover: none) { .poster-link { opacity: 1; transform: none; } }

/* На телефоне корефаны — лента, которая листается вбок, чтобы фото были сразу под ней */
@media (max-width: 700px) {
  #posters { display: flex; overflow-x: auto; gap: 10px; padding: 6px 2px 10px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  #posters::-webkit-scrollbar { display: none; }
  #posters .poster { flex: 0 0 40%; scroll-snap-align: start; }
}
.gallery-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.gallery-head h2 { margin: 0; }
.g-count { color: var(--accent); margin-left: 4px; }
.g-reset { font-size: 13px; color: var(--accent-2); }

/* Ровная сетка из квадратов */
.grid.sq { column-width: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.grid.sq .tile { margin: 0; aspect-ratio: 1; }
.grid.sq .tile img { height: 100%; object-fit: cover; }
.grid.sq .tile .noimg { aspect-ratio: auto; height: 100%; }
@media (max-width: 700px) { .grid.sq { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; } .grid.sq .tile { border-radius: 4px; } }

/* ---------- Профиль v2 ---------- */
/* --uc / --uc2 — цвет неона человека (задаётся в style у элемента) */
.ava.big { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--uc, var(--accent)), 0 0 26px var(--uc, var(--accent)); }
.phero { position: relative; border-radius: 22px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--uc, #ff4fd8) 45%, transparent); background: var(--panel); box-shadow: 0 0 34px color-mix(in srgb, var(--uc, #ff4fd8) 18%, transparent); animation: rise .45s ease both; }
.phero-cover { position: relative; height: clamp(140px, 24vw, 230px); background: linear-gradient(135deg, color-mix(in srgb, var(--uc, #ff4fd8) 55%, #15111f), color-mix(in srgb, var(--uc2, #8a3cff) 55%, #0b0912)); }
.phero-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.phero-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--panel) 2%, transparent 60%); pointer-events: none; }
.phero-edit { position: absolute; right: 12px; top: 12px; z-index: 1; display: flex; gap: 6px; }
.phero-edit .btn { background: rgba(11, 9, 18, .7); backdrop-filter: blur(6px); padding: 7px 12px; font-size: 13px; }
.phero-in { position: relative; display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; padding: 0 22px; margin-top: -52px; z-index: 1; }
.phero-ava { position: relative; flex: none; }
.phero .ava.big { width: clamp(96px, 16vw, 132px); height: clamp(96px, 16vw, 132px); font-size: 46px; }
.ava-cam { position: absolute; right: 2px; bottom: 2px; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--panel); background: var(--uc, var(--accent)); cursor: pointer; font-size: 16px; display: grid; place-items: center; box-shadow: 0 0 12px var(--uc, var(--accent)); }
.phero-info { flex: 1 1 240px; min-width: 0; display: grid; gap: 4px; padding-bottom: 6px; }
.phero-info h1 { background: none; color: #fff; text-shadow: 0 0 14px color-mix(in srgb, var(--uc, #ff4fd8) 70%, transparent); overflow-wrap: anywhere; }
.phero-info .sub { margin: 0; }
.phero-status { margin: 0; justify-self: start; padding: 3px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; color: #fff; background: color-mix(in srgb, var(--uc, #ff4fd8) 22%, transparent); border: 1px solid color-mix(in srgb, var(--uc, #ff4fd8) 60%, transparent); }
.phero-bday { margin: 0; font-size: 14px; color: var(--muted); }
.phero-actions { display: flex; gap: 8px; padding-bottom: 10px; }
.phero-stats { padding: 16px 22px 18px; }
.phero-stats b { text-shadow: 0 0 12px color-mix(in srgb, var(--uc, #3ee6ff) 60%, transparent); }
.phero-quote { margin: 0 22px 20px; padding: 12px 16px; border-left: 3px solid var(--uc, var(--accent)); border-radius: 0 12px 12px 0; background: var(--panel-2); font-size: 16px; font-weight: 600; font-style: italic; }
.phero-quote span { font-style: normal; margin-right: 8px; }
@media (max-width: 700px) { .phero-in { margin-top: -44px; padding: 0 16px; gap: 12px; } .phero-stats { padding: 14px 16px; } .phero-quote { margin: 0 16px 16px; } }

.me-tabs { display: flex; gap: 6px; flex-wrap: wrap; position: sticky; top: calc(70px + env(safe-area-inset-top, 0px)); z-index: 5; padding: 6px 0; }
.me-tab { display: grid; gap: 16px; max-width: 720px; animation: fade .25s ease both; }
.me-tab .card { max-width: none; }
.me-tab select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--fg); font: inherit; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--fg); cursor: pointer; font-weight: 600; transition: border-color .2s, box-shadow .2s; }
.swatch span { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, var(--a), var(--b)); box-shadow: 0 0 10px var(--a); }
.swatch[aria-pressed="true"] { border-color: var(--a); box-shadow: 0 0 14px color-mix(in srgb, var(--a) 60%, transparent); }

/* Цвет неона в других местах */
.post-who .ava { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--uc, var(--accent)); }
.msgs-in .msg.mine .bubble { background: linear-gradient(135deg, var(--uc, #d63ab4), var(--uc2, #8a3cff)); box-shadow: 0 0 16px color-mix(in srgb, var(--uc, #ff4fd8) 25%, transparent); }
.msgs-in .m-name { color: var(--uc, var(--accent-2)); }
.poster-in b { text-shadow: 0 0 10px var(--uc, #ff4fd8); }
.poster-in .ava { box-shadow: 0 0 0 2px var(--uc, var(--accent)); }
.poster-status { font-style: normal; font-size: 12px; color: #fff; opacity: .85; }

/* Дни рождения */
.bday-banner { display: grid; gap: 4px; padding: 14px 18px; border-radius: 16px; border: 1px solid rgba(255, 224, 102, .5); background: linear-gradient(120deg, rgba(255, 224, 102, .14), rgba(255, 79, 216, .12)); box-shadow: 0 0 24px rgba(255, 224, 102, .15); animation: rise .45s ease both; }
.bday-banner p { margin: 0; font-weight: 600; }
.bday-banner a { color: #ffe066; }
.bday-banner .bday-cta { margin-left: 6px; color: var(--accent-2); }
.bday-soon { color: var(--muted); font-weight: 500 !important; }
.confetti { position: fixed; inset: 0; z-index: 95; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: confetti-fall 3s cubic-bezier(.3, .6, .5, 1) forwards; }
@keyframes confetti-fall { to { transform: translate(var(--x, 0), 105vh) rotate(var(--r, 360deg)); opacity: .9; } }

/* Топ месяца */
.noms { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.nom { display: flex; gap: 12px; align-items: center; padding: 16px; background: var(--panel); border-radius: 14px; text-decoration: none; border: 1px solid var(--line); transition: border-color .2s, box-shadow .2s; animation: rise .45s ease both; }
.nom:hover { border-color: var(--accent-2); box-shadow: var(--glow-2); }
.nom .t { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.nom b { display: block; font-size: 17px; }
.nom span:not(.t):not(.ava) { color: var(--muted); font-size: 13px; }
.nom.main { grid-column: 1 / -1; border-color: var(--accent); background: linear-gradient(120deg, rgba(255, 79, 216, .22), rgba(62, 230, 255, .08) 60%, var(--panel)); box-shadow: var(--glow); }
.nom.main .t { color: var(--accent); }
.nom.main b { font-family: var(--font-logo); font-weight: 400; font-size: 22px; text-shadow: 0 0 14px rgba(255, 79, 216, .6); }

/* Ползунок громкости: розовая заливка до бегунка */
.vol { gap: 8px; }
.vol b { color: var(--fg); }
.vol-row { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.vol input[type=range] {
  -webkit-appearance: none; appearance: none; flex: 1; height: 6px; border-radius: 999px; cursor: pointer;
  background: linear-gradient(90deg, var(--accent) var(--p, 40%), var(--panel-2) var(--p, 40%));
  box-shadow: 0 0 10px rgba(255, 79, 216, .3);
}
.vol input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: var(--glow); }
.vol input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: var(--glow); }

/* Аватарка в профиле */
.ava-edit { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }

/* Вход: неоновая вывеска */
.login { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px 16px; }
.login .card { width: 100%; max-width: 380px; margin-top: 18px; box-shadow: 0 0 60px rgba(255, 79, 216, .15); animation: rise .6s 1.2s ease both; }
.sign {
  margin: 0; text-align: center; font-family: var(--font-logo); font-weight: 400; letter-spacing: .04em;
  font-size: clamp(34px, 10vw, 68px); line-height: 1; color: #ffe6fb;
  text-shadow: 0 0 4px #fff, 0 0 12px var(--accent), 0 0 28px var(--accent), 0 0 60px rgba(255, 79, 216, .6);
  animation: ignite 1.4s linear both;
}
.sign .broken { animation: broken 5s 2s infinite; }
.tagline {
  margin: 0; font-size: 13px; letter-spacing: .45em; text-transform: uppercase; color: #dffbff;
  text-shadow: 0 0 6px var(--accent-2), 0 0 18px var(--accent-2);
  animation: ignite 1.4s .5s linear both;
}
@keyframes ignite {
  0% { opacity: 0; } 8% { opacity: 1; } 12% { opacity: .15; } 20% { opacity: 1; }
  24% { opacity: .3; } 34% { opacity: 1; } 38% { opacity: .6; } 46%, 100% { opacity: 1; }
}
@keyframes broken { 0%, 90%, 100% { opacity: 1; } 91% { opacity: .2; } 93% { opacity: 1; } 95% { opacity: .35; } 96% { opacity: 1; } }

/* Просмотр одного фото или видео */
.viewer { position: fixed; inset: 0; z-index: 50; overflow: hidden; background: rgba(6, 4, 10, .95); backdrop-filter: blur(6px); display: grid; grid-template-columns: minmax(0, 1fr) 320px; animation: fade .2s ease both; }
.viewer-bg { position: absolute; inset: -10%; background: center / cover no-repeat; filter: blur(40px) brightness(.45) saturate(1.5); transform: scale(1.1); pointer-events: none; }
.viewer .media { position: relative; display: grid; place-items: center; padding: 16px; min-height: 0; touch-action: pan-y; }
.viewer .media.from-right > * { animation: from-right .28s ease both; }
.viewer .media.from-left > * { animation: from-left .28s ease both; }
.viewer .info { position: relative; }
@keyframes from-right { from { opacity: 0; transform: translateX(40px); } }
@keyframes from-left { from { opacity: 0; transform: translateX(-40px); } }
.viewer .media img, .viewer .media video { max-width: 100%; max-height: calc(100vh - 32px); border-radius: 8px; box-shadow: 0 0 60px rgba(255, 79, 216, .25); animation: zoom .3s ease both; }
.viewer .info { background: var(--panel); border-left: 1px solid var(--line); padding: 20px; overflow-y: auto; display: grid; gap: 14px; align-content: start; }
.viewer .close { position: absolute; left: 16px; top: 16px; z-index: 2; }
.viewer .nav-btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; }
.viewer .prev { left: 16px; } .viewer .next { right: 336px; }
.viewer .caption { font-size: 17px; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Нижнее меню на телефоне */
.bnav { display: none; }
@media (max-width: 700px) {
  .top .nav { display: none; }
  .me-m { display: inline-flex; }
  .cta-up { display: none; }
  .capsule { height: 48px; padding: 0 4px 0 16px; }
  .logo { font-size: 15px; }
  .me-link .ava { width: 34px; height: 34px; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
  .bnav {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 6px max(6px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px));
    background: rgba(11, 9, 18, .9); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  }
  .bnav a { display: grid; justify-items: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; padding: 4px 0; transition: color .2s; }
  .bnav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .bnav a.on { color: var(--accent); }
  .bnav a.on svg { filter: drop-shadow(0 0 6px rgba(255, 79, 216, .9)); }
  .bnav a.plus { color: var(--accent-ink); }
  .bnav a.plus span { display: grid; place-items: center; width: 48px; height: 48px; margin-top: -18px; border-radius: 50%; background: var(--accent); box-shadow: var(--glow); }
  .bnav a.plus svg { stroke-width: 2.4; }
  .viewer { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .viewer .media img, .viewer .media video { max-height: 52vh; }
  .viewer .info { max-height: 48vh; border-left: 0; border-top: 1px solid var(--line); }
  .viewer .next { right: 16px; }
  .grid { column-width: 150px; column-gap: 8px; }
  .tile { margin-bottom: 8px; }
}

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes zoom { from { opacity: 0; transform: scale(.94); } }
@keyframes pop { 40% { transform: scale(1.25); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
