:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: rgba(0,113,227,0.08);
  --like: #ff375f;
  --danger: #d70015;
  --line: rgba(0,0,0,0.08);
  --input: #f5f5f7;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.04);
  --radius: 18px;
  --cat: #f5a623;
  --cat-dark: #d4861a;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #86868b;
    --accent: #0a84ff;
    --accent-hover: #3d9bff;
    --accent-soft: rgba(10,132,255,0.16);
    --like: #ff375f;
    --danger: #ff453a;
    --line: rgba(255,255,255,0.12);
    --input: #2c2c2e;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

/* ---------- каркас ---------- */
.shell {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 280px;
  gap: 24px;
  padding: 0 16px;
}
.side {
  position: sticky; top: 0;
  height: 100vh;
  padding: 20px 0;
  display: flex; flex-direction: column; gap: 4px;
}
.main { padding: 20px 0 100px; min-width: 0; }
.aside { position: sticky; top: 0; height: 100vh; padding: 20px 0; overflow-y: auto; }

.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 24px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text); padding: 6px 12px 18px;
  cursor: pointer; user-select: none;
}
.logo .kitten-logo { width: 38px; height: 38px; border-radius: 50%; transition: transform .3s cubic-bezier(.3,1.6,.5,1); box-shadow: 0 2px 8px rgba(245,166,35,.35); }
.logo:hover .kitten-logo { transform: rotate(-12deg) scale(1.12); }

.nav a {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 14px; border-radius: 14px;
  color: var(--text); font-size: 17px; font-weight: 500;
  position: relative;
}
.nav a:hover { background: var(--card); }
.nav a.active { font-weight: 700; background: var(--card); }
.nav svg { width: 24px; height: 24px; flex: none; }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: var(--like); color: #fff;
  font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
}
.nav .badge { margin-left: auto; }
.side .me {
  margin-top: auto; display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 14px; color: var(--text);
}
.side .me:hover { background: var(--card); }
.side .me .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .me .u { color: var(--text-3); font-size: 13px; }

.tabbar { display: none; }

@media (max-width: 1020px) {
  .shell { grid-template-columns: 220px minmax(0, 1fr); }
  .aside { display: none; }
}
@media (max-width: 700px) {
  .shell { grid-template-columns: minmax(0,1fr); padding: 0 12px; }
  .side { display: none; }
  .main { padding: 12px 0 calc(90px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: flex; justify-content: space-around;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--card) 85%, transparent);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--line);
  }
  .tabbar a { padding: 8px 12px; color: var(--text-2); position: relative; }
  .tabbar a.active { color: var(--accent); }
  .tabbar svg { width: 26px; height: 26px; }
  .tabbar .badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; line-height: 16px; font-size: 10px; padding: 0 4px; }
  .mobile-top { display: flex !important; }
}
.mobile-top {
  display: none; align-items: center; justify-content: space-between;
  padding: 4px 4px 12px;
}
.mobile-top .logo { padding: 0; font-size: 22px; }

/* ---------- элементы ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}
.page-title { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin: 4px 4px 16px; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.spacer { height: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 980px; cursor: pointer;
  padding: 9px 18px; font-weight: 600; font-size: 15px;
  background: var(--accent); color: #fff;
  transition: transform .15s, background .15s, opacity .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.secondary { background: var(--accent-soft); color: var(--accent); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--line); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn svg { width: 20px; height: 20px; }
.btn.block { width: 100%; padding: 13px; }
.icon-btn {
  border: 0; background: transparent; cursor: pointer; color: var(--text-2);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 980px; font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s, transform .15s;
}
.icon-btn:hover { background: var(--accent-soft); color: var(--accent); }
.icon-btn:active { transform: scale(.9); }
.icon-btn svg { width: 20px; height: 20px; }

.input, textarea.input {
  width: 100%; border: 1px solid transparent; outline: none;
  background: var(--input); border-radius: 12px;
  padding: 12px 14px; font-size: 16px;
  transition: border-color .15s, background .15s;
}
.input:focus { border-color: var(--accent); background: var(--card); }
textarea.input { resize: none; min-height: 44px; line-height: 1.4; }
label.field { display: block; margin-bottom: 12px; }
label.field span { display: block; font-size: 13px; color: var(--text-2); margin: 0 0 6px 4px; }

.avatar {
  flex: none; border-radius: 50%; object-fit: cover;
  background: linear-gradient(135deg, #ffd29d, #f5a623);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; overflow: hidden;
}
.avatar.sq { border-radius: 28%; background: linear-gradient(135deg, #8ec5ff, #0071e3); }
.admin-mark { color: var(--accent); font-size: 13px; margin-left: 2px; }

/* ---------- композер ---------- */
.composer textarea { border: 0; background: transparent; padding: 8px 0; font-size: 17px; }
.composer textarea:focus { background: transparent; }
.composer .tools { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 6px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.thumbs .t { position: relative; width: 84px; height: 84px; border-radius: 12px; overflow: hidden; background: var(--input); }
.thumbs .t img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .t button {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 14px; line-height: 22px; padding: 0;
}
.thumbs .t.loading::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 24px; height: 24px;
  border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- пост ---------- */
.post { padding: 14px 16px 8px; animation: pop-in .35s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.post .head { display: flex; align-items: center; gap: 10px; }
.post .who { min-width: 0; flex: 1; }
.post .who a.name { color: var(--text); font-weight: 600; }
.post .who .meta { color: var(--text-3); font-size: 13px; }
.post .who .meta a { color: var(--text-3); }
.post .body { margin: 10px 0 4px; white-space: pre-wrap; word-wrap: break-word; font-size: 16px; }
.post .body a { word-break: break-all; }
.post .actions { display: flex; gap: 4px; margin: 4px -8px 0; }
.post .actions .liked { color: var(--like); }
.post .actions .liked svg { fill: var(--like); }
.post .actions .like-btn:hover { background: rgba(255,55,95,.1); color: var(--like); }

.gallery { display: grid; gap: 4px; margin: 10px -16px 6px; overflow: hidden; position: relative; }
.gallery img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; background: var(--input); }
.gallery.n1 img { max-height: 560px; }
.gallery.n2 { grid-template-columns: 1fr 1fr; aspect-ratio: 2/1.1; }
.gallery.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 3/2; }
.gallery.n3 img:first-child { grid-row: span 2; }
.gallery.n4, .gallery.n5, .gallery.n6 { grid-template-columns: 1fr 1fr; aspect-ratio: 1; }
.gallery.n5 img:first-child { grid-column: span 2; }
.gallery.n6 { grid-template-columns: 1fr 1fr 1fr; aspect-ratio: 3/2; }

.paw-burst {
  position: absolute; pointer-events: none; z-index: 5;
  width: 110px; height: 110px; margin: -55px 0 0 -55px;
  animation: paw 0.9s cubic-bezier(.2,1.5,.4,1) forwards;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,.3));
}
@keyframes paw {
  0% { transform: scale(0) rotate(-30deg); opacity: 0; }
  30% { transform: scale(1.15) rotate(8deg); opacity: 1; }
  60% { transform: scale(1) rotate(0); opacity: 1; }
  100% { transform: scale(1.3) translateY(-30px); opacity: 0; }
}
.heart-pop { animation: heart .45s cubic-bezier(.2,1.8,.4,1); }
@keyframes heart { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }

.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: 100%; z-index: 30; min-width: 190px;
  background: var(--card); border-radius: 14px; padding: 6px;
  box-shadow: 0 10px 40px rgba(0,0,0,.18); border: 1px solid var(--line);
  animation: pop-in .18s ease both;
}
.menu button {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 10px 12px; border-radius: 9px; cursor: pointer; font-size: 15px;
}
.menu button:hover { background: var(--input); }
.menu button.danger { color: var(--danger); }

/* ---------- комментарии ---------- */
.comments { border-top: 1px solid var(--line); margin: 8px -16px 0; padding: 10px 16px 4px; }
.comment { display: flex; gap: 10px; padding: 6px 0; animation: pop-in .25s ease both; }
.comment .bubble { background: var(--input); border-radius: 16px; padding: 8px 12px; min-width: 0; }
.comment .bubble a.name { color: var(--text); font-weight: 600; font-size: 14px; }
.comment .bubble .txt { white-space: pre-wrap; word-wrap: break-word; }
.comment .sub { font-size: 12px; color: var(--text-3); margin: 2px 0 0 12px; }
.comment .sub button { border: 0; background: none; color: var(--text-3); cursor: pointer; font-size: 12px; padding: 0 0 0 8px; }
.comment-form { display: flex; gap: 8px; align-items: flex-end; padding: 8px 0; }

/* ---------- профиль ---------- */
.cover {
  height: 150px; margin: -16px -16px 0; border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(120deg, #ffe0b2 0%, #ffb74d 40%, #ff8a65 100%);
  position: relative; overflow: hidden;
}
@media (prefers-color-scheme: dark) {
  .cover { background: linear-gradient(120deg, #3a2a12 0%, #6b4513 50%, #7a2e1d 100%); }
}
.cover .cover-cat { position: absolute; right: 22px; bottom: -4px; cursor: pointer; }
.profile-head { display: flex; align-items: flex-end; gap: 14px; margin-top: -44px; position: relative; }
.profile-head .avatar { border: 4px solid var(--card); }
.profile-head .acts { margin-left: auto; display: flex; gap: 8px; padding-bottom: 6px; flex-wrap: wrap; justify-content: flex-end; }
.profile h1 { font-size: 24px; margin: 10px 0 0; letter-spacing: -0.02em; }
.profile .handle { color: var(--text-3); }
.profile .bio { margin: 10px 0; white-space: pre-wrap; }
.stats { display: flex; gap: 18px; margin-top: 10px; }
.stats a, .stats span { color: var(--text-2); }
.stats b { color: var(--text); }

.seg { display: flex; background: var(--input); border-radius: 12px; padding: 3px; margin-bottom: 12px; }
.seg a { flex: 1; text-align: center; padding: 8px; border-radius: 9px; color: var(--text-2); font-weight: 600; font-size: 14px; }
.seg a.active { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 4px; color: var(--text); border-radius: 12px; }
a.list-item:hover { background: var(--input); }
.list-item .t { font-weight: 600; }
.list-item .s { color: var(--text-3); font-size: 13px; }

/* ---------- сообщения ---------- */
.chat { display: flex; flex-direction: column; height: calc(100vh - 40px); background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chat-head .back { display: none; }
.chat-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 3px; }
.msg { max-width: 75%; position: relative; padding: 8px 13px; border-radius: 20px; white-space: pre-wrap; word-wrap: break-word; animation: pop-in .2s ease both; }
.msg.in { align-self: flex-start; background: var(--input); border-bottom-left-radius: 6px; }
.msg.out { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.msg.out a { color: #fff; text-decoration: underline; }
.msg img { border-radius: 14px; margin: 2px -7px 4px; max-height: 320px; cursor: zoom-in; }
.msg .time { font-size: 11px; opacity: .6; margin-left: 8px; float: right; margin-top: 6px; }
.day-sep { align-self: center; font-size: 12px; color: var(--text-3); margin: 10px 0 6px; }
.typing { font-size: 13px; color: var(--text-3); padding: 0 16px 4px; height: 20px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px; border-top: 1px solid var(--line); }
.chat-form textarea { max-height: 140px; }
@media (max-width: 700px) {
  .chat { position: fixed; inset: 0; z-index: 60; border-radius: 0; height: auto; }
  .chat-head .back { display: inline-flex; }
  .chat-form { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
}

/* ---------- авторизация ---------- */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
}
.auth .box { width: 100%; max-width: 400px; text-align: center; }
.auth h1 { font-size: 40px; letter-spacing: -0.03em; margin: 8px 0 4px; }
.auth .lead { color: var(--text-2); font-size: 17px; margin: 0 0 24px; }
.auth form { text-align: left; }
.auth .switch { margin-top: 16px; color: var(--text-2); }
.auth .switch button { border: 0; background: none; color: var(--accent); cursor: pointer; font-weight: 600; }
.auth .hero-cat { margin: 0 auto; cursor: pointer; height: 200px; display: flex; justify-content: center; align-items: flex-end; }
.form-error { color: var(--danger); font-size: 14px; margin: -4px 4px 10px; min-height: 0; }

/* ---------- пустые состояния / загрузка ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--text-2); }
.empty .kitten { margin: 0 auto 10px; }
.empty h3 { color: var(--text); margin: 0 0 6px; font-size: 19px; }
.loader { display: grid; place-items: center; padding: 40px; }


/* ---------- уведомления ---------- */
.notif { display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px; border-bottom: 1px solid var(--line); color: var(--text); }
.notif:last-child { border-bottom: 0; }
.notif.unread { background: var(--accent-soft); border-radius: 12px; padding: 12px 10px; }
.notif .ico { font-size: 20px; width: 24px; text-align: center; }

/* ---------- админка ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat-grid .card { margin: 0; }
.stat-grid .v { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-grid .l { font-size: 13px; color: var(--text-2); }
.report { border-bottom: 1px solid var(--line); padding: 12px 0; }
.report:last-child { border-bottom: 0; }
.report .quote { background: var(--input); border-radius: 10px; padding: 8px 12px; margin: 8px 0; white-space: pre-wrap; word-wrap: break-word; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--input); color: var(--text-2); }
.tag.red { background: rgba(255,59,48,.12); color: var(--danger); }

/* ---------- модалки, тосты, лайтбокс ---------- */
.modal-bg {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.4);
  display: grid; place-items: center; padding: 16px; animation: fade .2s ease both;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--card); border-radius: 22px; padding: 22px; width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto; animation: pop-in .25s cubic-bezier(.2,.9,.3,1.2) both; }
.modal h2 { margin: 0 0 14px; font-size: 21px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.lightbox { position: fixed; inset: 0; z-index: 110; background: rgba(0,0,0,.92); display: grid; place-items: center; cursor: zoom-out; animation: fade .15s ease both; }
.lightbox img { max-width: 96vw; max-height: 94vh; border-radius: 6px; }

#toasts { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: rgba(29,29,31,.94); color: #fff; padding: 11px 18px; border-radius: 14px; font-size: 14px; animation: pop-in .25s ease both; max-width: 90vw; }
.toast.err { background: var(--danger); }

#confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 300; }

/* ---------- коты ---------- */
.walking-cat {
  position: fixed; bottom: 0; left: 0; z-index: 40; width: 64px; height: 120px;
  cursor: pointer; will-change: transform;
}
@media (max-width: 700px) { .walking-cat { bottom: calc(62px + env(safe-area-inset-bottom)); width: 52px; height: 96px; } }
.kitten-waddle { display: block; width: 100%; height: 100%; transform-origin: 50% 100%; animation: waddle .42s ease-in-out infinite alternate; }
.kitten-waddle svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 6px 6px rgba(0,0,0,.18)); }
.kitten-waddle img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 6px rgba(0,0,0,.18)); user-select: none; -webkit-user-drag: none; }
.walking-cat.sitting .kitten-waddle { animation: hop .5s ease-in-out infinite alternate; }
@keyframes waddle { 0% { transform: rotate(-8deg) translateY(0); } 50% { transform: rotate(0) translateY(-7px); } 100% { transform: rotate(8deg) translateY(0); } }
@keyframes hop { to { transform: translateY(-5px) scaleY(1.03); } }

.kitten { position: relative; display: inline-block; vertical-align: bottom; line-height: 0; }
.kitten img { height: 100%; width: auto; max-width: none; filter: drop-shadow(0 8px 10px rgba(0,0,0,.14)); user-select: none; -webkit-user-drag: none; }
.kitten.mood-sleep img { animation: breathe 3s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes breathe { 50% { transform: scale(1.025, .985); } }
.kitten.mood-surprised img { animation: shake .45s ease-in-out 2; }
@keyframes shake { 25% { transform: translateX(-5px) rotate(-4deg); } 75% { transform: translateX(5px) rotate(4deg); } }
.kitten-zzz { position: absolute; right: -14px; top: 4%; line-height: 1; font-weight: 800; color: var(--text-3); }
.kitten-zzz i { position: absolute; font-style: normal; opacity: 0; animation: zzz 2.4s ease-in-out infinite; }
.kitten-zzz i:nth-child(1) { font-size: 13px; }
.kitten-zzz i:nth-child(2) { font-size: 17px; animation-delay: .8s; }
.kitten-zzz i:nth-child(3) { font-size: 22px; animation-delay: 1.6s; }
.kitten-wow {
  position: absolute; right: -6px; top: 2%; width: 30px; height: 30px; border-radius: 50%;
  background: var(--like); color: #fff; font: 800 20px/30px -apple-system, sans-serif; text-align: center;
  animation: pop-in .3s cubic-bezier(.2,1.8,.4,1) both;
}

.speech {
  position: fixed; z-index: 41; background: var(--card); color: var(--text); padding: 6px 12px;
  border-radius: 14px; font-weight: 700; box-shadow: 0 6px 24px rgba(0,0,0,.18);
  animation: speech 1.4s ease forwards; pointer-events: none; white-space: nowrap;
}
@keyframes speech { 0% { opacity: 0; transform: translateY(6px) scale(.6); } 15% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }

.cat-bob { animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes zzz { 0% { opacity: 0; transform: translate(0,0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(14px,-22px); } }
.cat-spin { animation: catspin 1.1s cubic-bezier(.6,.1,.4,.9) infinite; transform-origin: 50% 50%; }
@keyframes catspin { to { transform: rotate(360deg); } }
.cat-jump { animation: jump .7s cubic-bezier(.3,1.6,.5,1); }
@keyframes jump { 40% { transform: translateY(-28px) rotate(-8deg); } }

.cat-rain {
  position: fixed; top: -80px; z-index: 250; font-size: 42px; pointer-events: none;
  animation: fall linear forwards;
}
.cat-rain img { width: auto; filter: drop-shadow(0 4px 6px rgba(0,0,0,.2)); }
.cat-rain .rain-face { border-radius: 50%; }
@keyframes fall { to { transform: translateY(calc(100vh + 120px)) rotate(540deg); } }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.toggle { appearance: none; width: 50px; height: 30px; border-radius: 15px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; flex: none; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s; }
.toggle:checked { background: #34c759; }
.toggle:checked::after { transform: translateX(20px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- котёнок-аватар и гардероб ---------- */
.kitty-av { background: none; }
.kitty-av svg { width: 100%; height: 100%; display: block; }
.cover .cover-kitty { width: 96px; height: 150px; right: 18px; bottom: -8px; }
.cover .cover-kitty svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 6px 10px rgba(0,0,0,.2)); }
.avatar-edit { position: relative; display: inline-flex; border-radius: 50%; }
.avatar-edit-badge {
  position: absolute; right: 2px; bottom: 6px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--card); box-shadow: 0 2px 8px rgba(0,0,0,.2); display: grid; place-items: center; font-size: 16px;
  transition: transform .2s cubic-bezier(.3,1.6,.5,1);
}
.avatar-edit:hover .avatar-edit-badge { transform: scale(1.2) rotate(-10deg); }

.wardrobe { padding: 0; }
.wardrobe-stage {
  position: sticky; top: 0; z-index: 5; height: 380px; background: var(--card);
  border-bottom: 1px solid var(--line); display: flex; justify-content: center;
  border-radius: var(--radius) var(--radius) 0 0;
}
.wardrobe-kitty { height: 100%; width: 100%; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.wardrobe-kitty svg { width: 100%; height: 100%; display: block; }
.dress-pop svg image, .dress-pop svg > :not(rect) { animation: dress .45s cubic-bezier(.2,1.6,.4,1); transform-origin: 50% 90%; transform-box: view-box; }
@keyframes dress { 0% { transform: scale(.94); } 50% { transform: scale(1.04) translateY(-8px); } 100% { transform: none; } }
.wardrobe-mini-wrap { position: absolute; left: 14px; bottom: 12px; text-align: center; }
.wardrobe-mini { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; border: 3px solid var(--card); box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.wardrobe-mini svg { width: 100%; height: 100%; display: block; }
.wardrobe-mini-wrap .small { background: var(--card); border-radius: 8px; padding: 0 6px; margin-top: 4px; display: inline-block; }
.wardrobe-chips { display: flex; gap: 6px; overflow-x: auto; padding: 12px 14px 4px; scrollbar-width: none; }
.wardrobe-chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 0; cursor: pointer; border-radius: 980px; padding: 8px 14px;
  background: var(--input); color: var(--text); font-weight: 600; font-size: 14px; transition: background .15s, transform .15s;
}
.chip:active { transform: scale(.94); }
.chip.active { background: var(--accent); color: #fff; }
.wardrobe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; padding: 12px 14px; }
.tile {
  border: 2px solid transparent; background: var(--input); border-radius: 16px; padding: 6px 6px 8px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px; transition: transform .15s, border-color .15s;
}
.tile:hover { transform: translateY(-2px); }
.tile:active { transform: scale(.95); }
.tile.active { border-color: var(--accent); background: var(--accent-soft); }
.tile-pic { width: 76px; height: 76px; border-radius: 50%; overflow: hidden; display: block; }
.tile-pic.full { border-radius: 14px; }
.tile-pic svg { width: 100%; height: 100%; display: block; }
.tile-name { font-size: 12px; font-weight: 600; color: var(--text); text-align: center; line-height: 1.2; }
.wardrobe-actions {
  position: sticky; bottom: 0; display: flex; gap: 8px; align-items: center; padding: 12px 14px;
  background: var(--card); box-shadow: 0 -6px 16px rgba(0,0,0,.06);
  border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius);
}
@media (max-width: 700px) {
  .wardrobe-stage { height: 260px; }
  .wardrobe-actions { bottom: calc(62px + env(safe-area-inset-bottom)); }
  .hide-narrow { display: none; }
  .wardrobe-actions .btn { padding: 9px 14px; }
}

/* ---------- злой котёнок ---------- */
.walking-cat.annoyed .kitten-waddle { animation: huff .09s linear 6 alternate; }
@keyframes huff { from { transform: translateX(-3px) rotate(-3deg); } to { transform: translateX(3px) rotate(3deg); } }
.walking-cat.angry .kitten-waddle { animation: rage .08s linear infinite alternate; }
.walking-cat.angry.fleeing .kitten-waddle { animation: flee .16s ease-in-out infinite alternate; }
@keyframes rage { from { transform: translate(-2px, 0) rotate(-2deg); } to { transform: translate(2px, -2px) rotate(2deg); } }
@keyframes flee { from { transform: rotate(-12deg) translateY(0); } to { transform: rotate(10deg) translateY(-10px); } }
.walking-cat .k-fist { animation: fist .22s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 20% 100%; }
@keyframes fist { from { transform: rotate(-14deg); } to { transform: rotate(10deg) translateY(-8px); } }
.walking-cat .k-vein { animation: vein .4s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes vein { to { transform: scale(1.3); } }
.speech.annoyed { background: #ffcc00; color: #1d1d1f; }
.speech.angry { background: #ff2d2d; color: #fff; font-size: 17px; animation-duration: 1.8s; }

/* ---------- лайки комментариев ---------- */
.comment .sub .c-like { color: var(--text-3); font-weight: 600; padding: 0 0 0 8px; display: inline-flex; align-items: center; gap: 3px; }
.comment .sub .c-like.liked { color: var(--like); }
.comment .sub .c-like svg { width: 13px; height: 13px; }
.comment .sub .c-like.liked svg { fill: var(--like); }

/* ---------- реакции на сообщения ---------- */
.msg-row { display: flex; align-items: center; gap: 6px; max-width: 82%; position: relative; animation: pop-in .2s ease both; }
.msg-row.out { align-self: flex-end; flex-direction: row-reverse; }
.msg-row.in { align-self: flex-start; }
.msg-row .msg { max-width: 100%; animation: none; user-select: text; -webkit-touch-callout: none; }
.react-btn {
  flex: none; width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer; font-size: 16px;
  background: var(--input); color: var(--text-2); opacity: 0; transition: opacity .15s, transform .15s;
}
.msg-row:hover .react-btn { opacity: 1; }
.react-btn:hover { transform: scale(1.15); }
@media (hover: none) { .react-btn { display: none; } }
.reacts { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px -4px -2px; clear: both; }
.react-chip {
  border: 0; cursor: pointer; border-radius: 980px; padding: 2px 8px; font-size: 14px; line-height: 20px;
  background: rgba(0,0,0,.08); color: inherit; display: inline-flex; gap: 3px; align-items: center;
  animation: pop-in .3s cubic-bezier(.2,1.8,.4,1) both;
}
.msg.out .react-chip { background: rgba(255,255,255,.22); }
.react-chip.mine { box-shadow: inset 0 0 0 2px currentColor; }
.react-chip b { font-size: 12px; }
.react-picker {
  position: fixed; z-index: 120; display: flex; gap: 2px; padding: 6px; border-radius: 980px;
  background: var(--card); box-shadow: 0 10px 40px rgba(0,0,0,.25); border: 1px solid var(--line);
  animation: pop-in .2s cubic-bezier(.2,1.6,.4,1) both;
}
.react-picker button {
  border: 0; background: transparent; cursor: pointer; font-size: 26px; width: 42px; height: 42px; border-radius: 50%;
  transition: transform .12s, background .12s; padding: 0;
}
.react-picker button:hover { transform: scale(1.3) translateY(-4px); }
.react-picker button.mine { background: var(--accent-soft); }

/* ================= всплывающие уведомления ================= */
.popups {
  position: fixed; top: 16px; right: 16px; z-index: 400; display: flex; flex-direction: column; gap: 10px;
  width: 360px; max-width: calc(100vw - 24px); pointer-events: none;
}
.popup {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px;
  background: var(--card);
  border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 12px 40px rgba(0,0,0,.18);
  cursor: pointer; animation: popup-in .42s cubic-bezier(.2,1.3,.4,1) both; transition: transform .2s, opacity .2s;
}
.popup.out { animation: popup-out .26s ease forwards; }
@keyframes popup-in { from { opacity: 0; transform: translateX(40px) scale(.9); } }
@keyframes popup-out { to { opacity: 0; transform: translateX(60px) scale(.95); } }
.popup b { display: block; font-size: 14px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.popup-text { font-size: 14px; color: var(--text-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.popup-emoji { width: 44px; height: 44px; border-radius: 50%; background: var(--input); display: grid; place-items: center; font-size: 24px; flex: none; }
.popup-close { border: 0; background: transparent; color: var(--text-3); font-size: 22px; cursor: pointer; padding: 0 4px; align-self: flex-start; }
@media (max-width: 700px) {
  .popups { left: 12px; right: 12px; top: calc(10px + env(safe-area-inset-top)); width: auto; }
  @keyframes popup-in { from { opacity: 0; transform: translateY(-30px) scale(.95); } }
}

/* ================= истории ================= */
.no-scroll { overflow: hidden; }
.stories-tray { display: flex; gap: 14px; overflow-x: auto; padding: 4px 4px 14px; scrollbar-width: none; }
.stories-tray::-webkit-scrollbar { display: none; }
.story-item { flex: none; border: 0; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 76px; padding: 0; color: var(--text); }
.story-name { font-size: 12px; max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-ring {
  position: relative; display: inline-grid; place-items: center; padding: 3px; border-radius: 50%;
  background: conic-gradient(from 200deg, #ffb13d, #ff375f, #bf5af2, #ff9f0a, #ffb13d);
  transition: transform .2s cubic-bezier(.3,1.6,.5,1);
}
.story-ring > .avatar { border: 3px solid var(--bg); }
.story-ring.seen { background: var(--line); }
.story-ring.none { background: transparent; }
.story-item:hover .story-ring { transform: scale(1.06); }
.story-ring.big > .avatar { border-color: var(--card); }
.story-plus {
  position: absolute; right: 0; bottom: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff;
  border: 3px solid var(--bg); display: grid; place-items: center; font-weight: 800; font-size: 16px; line-height: 1;
}
.story-viewer, .story-compose {
  position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,.94); display: grid; place-items: center;
  animation: fade .2s ease both;
}
.story-frame {
  position: relative; width: min(100vw, calc(100vh * 9 / 16)); height: min(100vh, calc(100vw * 16 / 9)); max-height: 100vh;
  background: #111; overflow: hidden; border-radius: 14px; color: #fff; user-select: none;
}
@media (max-width: 700px) { .story-frame { border-radius: 0; width: 100vw; height: 100dvh; } }
.story-media, .story-frame > video, .story-frame > img { position: absolute; inset: 0; display: grid; place-items: center; }
.story-media img, .story-media video, .story-frame > video, .story-frame > img { width: 100%; height: 100%; object-fit: contain; }
.story-bars { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 4px; z-index: 3; }
.story-bars i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.35); overflow: hidden; }
.story-bars b { display: block; height: 100%; background: #fff; }
.story-head { position: absolute; top: 22px; left: 10px; right: 10px; display: flex; align-items: center; gap: 6px; z-index: 3; }
.story-owner { display: flex; align-items: center; gap: 8px; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.story-owner span { opacity: .75; font-size: 13px; }
.story-icon { border: 0; background: rgba(0,0,0,.3); color: #fff; border-radius: 980px; padding: 6px 10px; cursor: pointer; font-size: 15px; }
.story-nav { position: absolute; top: 70px; bottom: 90px; z-index: 2; border: 0; background: transparent; cursor: pointer; }
.story-nav.prev { left: 0; width: 33%; }
.story-nav.next { right: 0; width: 67%; }
.story-caption {
  position: absolute; left: 16px; right: 16px; bottom: 150px; z-index: 3; text-align: center; font-size: 18px; font-weight: 600;
  text-shadow: 0 2px 8px rgba(0,0,0,.7); pointer-events: none; white-space: pre-wrap;
}
.story-bottom { position: absolute; left: 10px; right: 10px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 3; }
.story-quick { display: flex; justify-content: center; gap: 6px; margin-bottom: 8px; }
.story-quick button { border: 0; background: rgba(255,255,255,.14); border-radius: 50%; width: 42px; height: 42px; font-size: 22px; cursor: pointer; transition: transform .15s; }
.story-quick button:active { transform: scale(1.3); }
.story-reply, .story-caption-input {
  width: 100%; border: 1px solid rgba(255,255,255,.5); background: rgba(0,0,0,.25); color: #fff; border-radius: 980px;
  padding: 12px 16px; font-size: 16px; outline: none;
}
.story-reply::placeholder, .story-caption-input::placeholder { color: rgba(255,255,255,.7); }
.story-compose-bottom { position: absolute; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.story-compose-bottom .row { justify-content: flex-end; }
.btn.ghost.light { color: #fff; border-color: rgba(255,255,255,.4); }
.upload-progress { height: 4px; border-radius: 2px; background: rgba(127,127,127,.25); overflow: hidden; }
.upload-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* ================= звонки ================= */
.call-screen {
  position: fixed; inset: 0; z-index: 350; color: #fff; overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #3a2a5c 0%, #15102a 60%, #07060d 100%);
  animation: fade .25s ease both;
}
.call-remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; background: #000; }
.call-screen.has-remote-video .call-remote { opacity: 1; }
.call-screen.has-remote-video .call-peer { opacity: 0; pointer-events: none; }
.call-peer { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; transition: opacity .3s; padding-bottom: 120px; }
.call-peer .avatar { box-shadow: 0 20px 60px rgba(0,0,0,.5); position: relative; z-index: 1; }
.call-screen.ringing .call-peer .avatar { animation: bob 1.4s ease-in-out infinite; }
.call-name { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; z-index: 1; }
.call-status { font-size: 17px; opacity: .8; z-index: 1; font-variant-numeric: tabular-nums; }
.call-rings { position: absolute; top: 50%; left: 50%; width: 0; height: 0; margin-top: -120px; }
.call-rings i { position: absolute; left: -75px; top: -75px; width: 150px; height: 150px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); opacity: 0; }
.call-screen.ringing .call-rings i { animation: ring 2.4s ease-out infinite; }
.call-rings i:nth-child(2) { animation-delay: .8s !important; }
.call-rings i:nth-child(3) { animation-delay: 1.6s !important; }
@keyframes ring { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(2.4); opacity: 0; } }
.call-local {
  position: absolute; right: 16px; top: calc(16px + env(safe-area-inset-top)); width: 120px; height: 170px; object-fit: cover;
  border-radius: 16px; background: #222; box-shadow: 0 8px 30px rgba(0,0,0,.5); z-index: 3; touch-action: none; cursor: grab;
}
.call-local.mirror { transform: scaleX(-1); }
@media (min-width: 701px) { .call-local { width: 200px; height: 140px; } }
.call-controls {
  position: absolute; left: 0; right: 0; bottom: calc(34px + env(safe-area-inset-bottom)); z-index: 4;
  display: flex; justify-content: center; gap: 22px; flex-wrap: wrap;
}
.call-btn { border: 0; background: none; color: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.call-btn > span { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; transition: transform .15s, background .15s; }
.call-btn svg { width: 28px; height: 28px; }
.call-btn small { font-size: 12px; opacity: .85; }
.call-btn:active > span { transform: scale(.9); }
.call-btn.accept > span { background: #30d158; animation: accept-bounce 1.2s ease-in-out infinite; }
@keyframes accept-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.call-btn.decline > span { background: #ff3b30; }
.call-btn.decline svg { transform: rotate(135deg); }
.call-btn.glass > span { background: rgba(255,255,255,.18); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.call-btn.glass.off > span { background: #fff; color: #111; }
.call-screen.ended .call-status { color: #ffd60a; }
.btn.icon-only { padding: 6px 9px; }
.btn.icon-only svg { width: 17px; height: 17px; }

/* ================= рилсы ================= */
body.reels-mode .aside { display: none; }
body.reels-mode .shell { grid-template-columns: 240px minmax(0, 1fr); }
.reels-wrap { position: relative; max-width: 440px; margin: 0 auto; }
.reels-top { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 10px; }
.reels-top b { font-size: 28px; letter-spacing: -0.02em; }
.reels {
  height: calc(100vh - 100px); overflow-y: auto; scroll-snap-type: y mandatory; border-radius: 22px; background: #000;
  scrollbar-width: none; overscroll-behavior: contain;
}
.reels::-webkit-scrollbar { display: none; }
.reel { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; background: #000; overflow: hidden; color: #fff; }
.reel video { width: 100%; height: 100%; object-fit: cover; display: block; }
.reel-side { position: absolute; right: 10px; bottom: 100px; display: flex; flex-direction: column; align-items: center; gap: 14px; z-index: 2; }
.reel-side .avatar { border: 2px solid #fff; }
.reel-act {
  border: 0; background: none; color: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 13px; font-weight: 600; filter: drop-shadow(0 1px 3px rgba(0,0,0,.6));
}
.reel-act svg { width: 32px; height: 32px; }
.reel-act.liked { color: #ff375f; }
.reel-act.liked svg { fill: #ff375f; }
.reel-info {
  position: absolute; left: 0; right: 70px; bottom: 0; padding: 60px 14px calc(18px + env(safe-area-inset-bottom)); z-index: 1;
  background: linear-gradient(transparent, rgba(0,0,0,.65));
}
.reel-info a { color: #fff; }
.reel-info span { opacity: .8; font-size: 14px; }
.reel-caption { margin-top: 6px; font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.reel-caption a { color: #fff; text-decoration: underline; }
.reel-flash { position: absolute; top: 50%; left: 50%; width: 80px; height: 80px; margin: -40px; border-radius: 50%; background: rgba(0,0,0,.45); display: grid; place-items: center; opacity: 0; pointer-events: none; z-index: 3; }
.reel-flash svg { width: 40px; height: 40px; color: #fff; }
.reel-flash.show { animation: flash .7s ease forwards; }
@keyframes flash { 0% { opacity: 0; transform: scale(.6); } 25% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.2); } }
.reel-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; gap: 6px; background: linear-gradient(160deg, #2a1f47, #0d0a18); }
.reel-empty p { opacity: .8; margin: 0 0 12px; }
.reel .paw-burst { z-index: 4; }
.reel-preview { width: 100%; max-height: 50vh; border-radius: 14px; background: #000; }
@media (max-width: 700px) {
  body.reels-mode .mobile-top { display: none !important; }
  body.reels-mode .main { padding: 0; }
  .reels-wrap { position: fixed; inset: 0 0 calc(62px + env(safe-area-inset-bottom)) 0; max-width: none; z-index: 30; }
  .reels-top { position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 12px; right: 12px; z-index: 5; margin: 0; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
  .reels-top b { font-size: 22px; }
  .reels { height: 100%; border-radius: 0; }
  body.reels-mode .tabbar { background: #000; border-top-color: #222; }
  body.reels-mode .tabbar a { color: #aaa; }
  body.reels-mode .tabbar a.active { color: #fff; }
}

/* нижняя шторка */
.sheet-bg { position: fixed; inset: 0; z-index: 320; background: rgba(0,0,0,.4); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease both; }
.sheet-bg.out { animation: fade .2s ease reverse forwards; }
.sheet { width: 100%; max-width: 560px; max-height: 75vh; overflow-y: auto; background: var(--card); border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); animation: sheet-up .3s cubic-bezier(.2,1,.3,1) both; }
@keyframes sheet-up { from { transform: translateY(100%); } }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto; }
.sheet-title { text-align: center; font-weight: 700; padding-bottom: 6px; }
.sheet .comments { border-top: 0; margin: 0; padding: 0; }

/* видео в посте */
.post-video { position: relative; margin: 10px -16px 6px; background: #000; }
.post-video video { width: 100%; max-height: 600px; display: block; }
.post-video-tag { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 980px; }
.thumbs .t.video video { width: 100%; height: 100%; object-fit: cover; }
.thumbs .t .upload-progress { position: absolute; left: 6px; right: 6px; bottom: 6px; }

/* ================= групповые чаты ================= */
.group-av { background: linear-gradient(135deg, #ffd29d, #ff8fb8 60%, #bf5af2); line-height: 1; }
.group-count { color: var(--text-3); font-weight: 400; font-size: 13px; }
.group-head { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: none; cursor: pointer; color: var(--text); padding: 0; }
.msg-row.with-avatar, .msg-row.in:has(.msg-avatar-gap) { align-items: flex-end; }
.msg-avatar-gap { width: 30px; flex: none; }
.msg-sender { font-size: 13px; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.sys-msg { align-self: center; font-size: 13px; color: var(--text-2); background: var(--input); border-radius: 980px; padding: 4px 12px; margin: 6px 0; text-align: center; max-width: 90%; }
.call-log { align-self: center; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; background: var(--input); border-radius: 16px; padding: 8px 12px; margin: 6px 0; font-size: 14px; font-weight: 600; }
.call-log .time { font-size: 12px; color: var(--text-3); font-weight: 400; }
.emoji-row { display: flex; flex-wrap: wrap; gap: 4px; }
.emoji-row button { border: 2px solid transparent; background: var(--input); border-radius: 12px; width: 40px; height: 40px; font-size: 22px; cursor: pointer; }
.emoji-row button.active { border-color: var(--accent); background: var(--accent-soft); }
.picked { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.picker-results { max-height: 220px; overflow-y: auto; }
.picker-row { width: 100%; border: 0; background: none; cursor: pointer; text-align: left; }
.picker-row:hover { background: var(--input); }
.chat-head .icon-btn svg { width: 22px; height: 22px; }
