/* Pulse — Liquid Glass (iOS 26) */

:root {
  --bg: #0a0a0f;
  --bg-elevated: rgba(255, 255, 255, 0.06);
  --bg-card: rgba(255, 255, 255, 0.08);
  --bg-hover: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.12);
  --border-light: rgba(255, 255, 255, 0.2);
  --text: rgba(255, 255, 255, 0.95);
  --text-muted: rgba(255, 255, 255, 0.55);
  --text-dim: rgba(255, 255, 255, 0.38);
  --accent: #0a84ff;
  --accent-hover: #409cff;
  --accent-muted: #005ecb;
  --accent-glow: rgba(10, 132, 255, 0.35);
  --danger: #ff453a;
  --success: #30d158;
  --radius: 22px;
  --radius-sm: 14px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --glass-blur: blur(40px) saturate(180%);
  --glass-bg: rgba(255, 255, 255, 0.09);
  --glass-bg-strong: rgba(28, 28, 38, 0.72);
  --glass-border: rgba(255, 255, 255, 0.16);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-family: var(--font);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 90% 55% at 15% -5%, rgba(10, 132, 255, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 45% at 95% 5%, rgba(94, 92, 230, 0.18), transparent 50%),
    radial-gradient(ellipse 55% 35% at 50% 105%, rgba(48, 209, 88, 0.1), transparent 45%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  letter-spacing: -0.01em;
}

body.page-auth {
  background-color: #07070c;
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(10, 132, 255, 0.28), transparent 55%),
    radial-gradient(ellipse 60% 50% at 100% 50%, rgba(191, 90, 242, 0.15), transparent 50%),
    radial-gradient(ellipse 50% 40% at 0% 80%, rgba(94, 92, 230, 0.12), transparent 45%);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  isolation: isolate;
  background: rgba(10, 10, 15, 0.42);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2), var(--glass-highlight);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
}

.logo:hover {
  color: var(--accent);
  text-decoration: none;
}

.logo-icon {
  display: block;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 4px 16px var(--accent-glow), var(--glass-highlight);
}

.logo-icon.large {
  width: 64px;
  height: 64px;
  border-radius: 16px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  text-decoration: none;
  position: relative;
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg-hover);
  text-decoration: none;
}

.nav-link.active {
  color: var(--accent);
  background: rgba(10, 132, 255, 0.18);
  box-shadow: var(--glass-highlight);
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: inline-block;
  background: currentColor;
  opacity: 0.9;
}

.nav-icon-feed { mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M4 11a9 9 0 0 1 9 9M4 4a16 16 0 0 1 16 16'/%3E%3Ccircle cx='5' cy='19' r='1'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M4 11a9 9 0 0 1 9 9M4 4a16 16 0 0 1 16 16'/%3E%3Ccircle cx='5' cy='19' r='1'/%3E%3C/svg%3E") center/contain no-repeat; }
.nav-icon-explore { mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") center/contain no-repeat; }
.nav-icon-shorts { mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Crect x='7' y='2' width='10' height='20' rx='2'/%3E%3Cpath d='M10 8l4 4-4 4'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Crect x='7' y='2' width='10' height='20' rx='2'/%3E%3Cpath d='M10 8l4 4-4 4'/%3E%3C/svg%3E") center/contain no-repeat; }
.nav-icon-group { mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E") center/contain no-repeat; }
.nav-icon-msg { mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E") center/contain no-repeat; }
.nav-icon-bell { mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3C/svg%3E") center/contain no-repeat; }
.nav-icon-search { mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") center/contain no-repeat; }
.nav-icon-user { mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E") center/contain no-repeat; }
.nav-icon-settings { mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z'/%3E%3C/svg%3E") center/contain no-repeat; }
.nav-icon-bookmark { mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='m19 21-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='m19 21-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z'/%3E%3C/svg%3E") center/contain no-repeat; }
.nav-icon-image { mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='m21 15-5-5L5 21'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='m21 15-5-5L5 21'/%3E%3C/svg%3E") center/contain no-repeat; }

.nav-badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  min-width: 18px;
  text-align: center;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.nav-badge-empty {
  display: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.search-trigger-wrap {
  position: relative;
  z-index: 3;
}

.header-icon-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  color: var(--text);
  border-radius: 14px;
  cursor: pointer;
  box-shadow: var(--glass-highlight);
  flex-shrink: 0;
  font: inherit;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.header-icon-btn .nav-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  opacity: 1;
}

.header-icon-btn:hover {
  color: var(--text);
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-icon:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.search-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  width: 320px;
  z-index: 510;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.search-input {
  width: 100%;
  padding: 12px 16px;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--bg-elevated);
  border: none;
  border-bottom: 1px solid var(--border);
}

.search-input::placeholder {
  color: var(--text-dim);
}

.search-input:focus {
  outline: none;
}

.search-results {
  max-height: 360px;
  overflow-y: auto;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.search-result-item:hover {
  background: var(--bg-hover);
  text-decoration: none;
  color: var(--text);
}

.search-result-item img {
  flex-shrink: 0;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
  box-shadow: var(--glass-highlight);
}

.user-menu-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.dropdown-arrow {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--text-muted);
}

.mobile-menu-trigger { display: none !important; }

@media (min-width: 769px) {
  .mobile-menu-trigger {
    display: none !important;
  }
}
.user-dropdown .pulses-balance { margin-left: auto; font-weight: 600; color: var(--accent); }
.user-dropdown .pulses-icon { color: var(--accent); }
.nav-icon.nav-icon-gift { font-style: normal; }

.user-menu-wrap {
  position: relative;
  z-index: 3;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  min-width: 220px;
  z-index: 510;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 6px 0;
}

.user-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--text);
  font-size: 0.9375rem;
  text-decoration: none;
}

.user-dropdown .dropdown-item:hover {
  background: var(--bg-hover);
  text-decoration: none;
  color: var(--text);
}

.user-dropdown .dropdown-item.danger {
  color: var(--danger);
}

.dropdown-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 6px 0;
}

/* Мобильное меню (мини-окно по клику на значок настроек) */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.mobile-menu-overlay[aria-hidden="false"] { opacity: 1; }
.mobile-menu-popup {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(env(safe-area-inset-bottom) + 72px);
  max-height: 70vh;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  z-index: 201;
  transform: translateY(120%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.mobile-menu-popup[aria-hidden="false"] { transform: translateY(0); }
.mobile-menu-popup-inner { overflow: auto; padding-bottom: 12px; }
.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.mobile-menu-title { font-size: 1.1rem; font-weight: 600; }
.mobile-menu-close { min-width: 44px; min-height: 44px; font-size: 1.5rem; }
.mobile-menu-nav { display: flex; flex-direction: column; padding: 8px 0; }
.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
  min-height: 48px;
}
.mobile-menu-item:hover, .mobile-menu-item:active {
  background: var(--bg-hover);
  color: var(--text);
  text-decoration: none;
}
.mobile-menu-item-pulses .pulses-balance { margin-left: auto; color: var(--accent); font-weight: 600; }
.mobile-menu-item-pulses .pulses-icon { color: var(--accent); }
.mobile-menu-item-danger { color: var(--danger); }

/* Пульсы */
.pulses-desc { color: var(--text-muted); margin: 0 0 1rem; }
.pulses-balance-block {
  background: var(--bg-page);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1rem 0;
  text-align: center;
}
.pulses-balance-label { display: block; font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.pulses-balance-value { font-size: 1.75rem; font-weight: 700; color: var(--accent); }
.pulses-history { list-style: none; padding: 0; margin: 0; }
.pulses-history-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.pulses-history-item:last-child { border-bottom: none; }
.pulses-history-label { flex: 1; }
.pulses-history-amount.positive { color: var(--success, #2e7d32); font-weight: 600; }
.pulses-history-amount.negative { color: var(--danger); font-weight: 600; }
.pulses-history-date { font-size: 0.875rem; color: var(--text-muted); }

/* Подарки — каталог */
.pulses-balance-inline { font-weight: 600; color: var(--accent); margin-bottom: 1rem; }
.pulses-earn-card .card-title { margin-bottom: 0.5rem; }
.pulses-earn-desc { color: var(--text-muted); margin: 0 0 1rem; font-size: 0.9375rem; line-height: 1.5; }
.pulses-earn-desc strong { color: var(--accent); }
.gifts-grid.gifts-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}
/* Эксклюзивы: крупнее карточки и фото для лучшего качества */
.gifts-grid.gifts-catalog.gifts-grid-exclusive {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}
.gift-card-exclusive .gift-card-visual {
  width: 116px;
  height: 116px;
}
.gift-card-exclusive .gift-card-img {
  object-fit: contain;
}
.gift-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: var(--glass-highlight);
  transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.25s ease;
}
.gift-card:hover { transform: translateY(-3px) scale(1.01); box-shadow: var(--shadow); }
.gift-card-visual {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(255,255,255,0.12), rgba(255,255,255,0.02));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}
.gift-card-emoji { font-size: 2.25rem; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2)); }
.gift-card-img { width: 100%; height: 100%; object-fit: contain; }
.gift-card-name { font-weight: 600; font-size: 0.9375rem; text-align: center; }
.gift-card-cost { font-size: 0.875rem; color: var(--accent); font-weight: 500; }
.gift-send-btn { margin-top: 0.25rem; }
.gift-card-sold { font-size: 0.8125rem; color: var(--text-muted); font-weight: 600; margin-top: 0.25rem; display: inline-block; }
.gift-card-badge { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }

.gifts-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.gifts-section-title:not(:first-child) { margin-top: 24px; }
.gifts-section-link { font-size: 0.875rem; font-weight: 500; color: var(--accent); text-decoration: none; }
.gifts-section-link:hover { text-decoration: underline; }

/* Эксклюзивный подарок — золотая рамка */
.gift-card-exclusive {
  border: 2px solid #d4af37;
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.3), 0 4px 20px rgba(212, 175, 55, 0.15);
  background: linear-gradient(145deg, rgba(212, 175, 55, 0.08) 0%, var(--bg-card) 50%);
}
.gift-card-exclusive:hover {
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.4), 0 8px 28px rgba(212, 175, 55, 0.2);
}
.gift-card-limited:not(.gift-card-exclusive) .gift-card-visual { box-shadow: inset 0 1px 0 rgba(255,255,255,0.15); }

/* Темы подарков — градиенты для карточки и круга */
.gift-card[data-theme="heart"] .gift-card-visual { background: linear-gradient(145deg, #e91e63 0%, #ad1457 100%); }
.gift-card[data-theme="star"] .gift-card-visual { background: linear-gradient(145deg, #ffc107 0%, #ff9800 100%); }
.gift-card[data-theme="gift"] .gift-card-visual { background: linear-gradient(145deg, #8bc34a 0%, #558b2f 100%); }
.gift-card[data-theme="rose"] .gift-card-visual { background: linear-gradient(145deg, #f06292 0%, #c2185b 100%); }
.gift-card[data-theme="crown"] .gift-card-visual { background: linear-gradient(145deg, #ffd700 0%, #b8860b 100%); }
.gift-card[data-theme="diamond"] .gift-card-visual { background: linear-gradient(145deg, #b39ddb 0%, #5e35b1 100%); }
.gift-card[data-theme="fire"] .gift-card-visual { background: linear-gradient(145deg, #ff5722 0%, #bf360c 100%); }
.gift-card[data-theme="music"] .gift-card-visual { background: linear-gradient(145deg, #9c27b0 0%, #4a148c 100%); }
.gift-card[data-theme="cupcake"] .gift-card-visual { background: linear-gradient(145deg, #ffab91 0%, #e64a19 100%); }
.gift-card[data-theme="cosmos"] .gift-card-visual { background: linear-gradient(145deg, #5c6bc0 0%, #1a237e 100%); }
.gift-card[data-theme="idea"] .gift-card-visual { background: linear-gradient(145deg, #fff59d 0%, #f9a825 100%); }
.gift-card[data-theme="clover"] .gift-card-visual { background: linear-gradient(145deg, #66bb6a 0%, #2e7d32 100%); }
.gift-card[data-theme="rainbow"] .gift-card-visual { background: linear-gradient(145deg, #ec407a 0%, #ab47bc 30%, #5c6bc0 60%, #26c6da 100%); }
.gift-card[data-theme="trophy"] .gift-card-visual { background: linear-gradient(145deg, #ffca28 0%, #ff8f00 100%); }
.gift-card[data-theme="ring"] .gift-card-visual { background: linear-gradient(145deg, #b0bec5 0%, #546e7a 100%); }
.gift-card[data-theme="butterfly"] .gift-card-visual { background: linear-gradient(145deg, #ce93d8 0%, #7b1fa2 100%); }
.gift-card[data-theme="sun"] .gift-card-visual { background: linear-gradient(145deg, #ffeb3b 0%, #f57f17 100%); }
.gift-card[data-theme="moon"] .gift-card-visual { background: linear-gradient(145deg, #b0bec5 0%, #37474f 100%); }
.gift-card[data-theme="chocolate"] .gift-card-visual { background: linear-gradient(145deg, #8d6e63 0%, #4e342e 100%); }
.gift-card[data-theme="bouquet"] .gift-card-visual { background: linear-gradient(145deg, #f48fb1 0%, #ad1457 100%); }
.gift-card[data-theme="default"] .gift-card-visual { background: linear-gradient(145deg, var(--accent) 0%, #4a148c 100%); }

/* Подарки в профиле */
.profile-gifts-section .card-title { margin-bottom: 1rem; }
.profile-gifts-count { font-weight: 400; color: var(--text-muted); font-size: 0.9rem; }
.profile-gifts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}
.profile-gift-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  border-radius: 14px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  transition: transform 0.15s ease;
}
.profile-gift-card:hover { transform: scale(1.02); }
.profile-gift-visual {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02));
  overflow: hidden;
}
.profile-gift-emoji { font-size: 1.75rem; line-height: 1; }
.profile-gift-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.profile-gift-info { text-align: center; width: 100%; min-width: 0; }
.profile-gift-sender {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.8125rem;
  margin-bottom: 0.25rem;
}
.profile-gift-sender:hover { color: var(--accent); text-decoration: none; }
.profile-gift-sender .user-avatar { width: 20px; height: 20px; }
.profile-gift-sender span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 80px; }
.profile-gift-name { font-size: 0.8125rem; font-weight: 500; color: var(--text-muted); display: block; }
.profile-gift-time { font-size: 0.75rem; color: var(--text-muted); }
.profile-gift-card[data-theme="heart"] .profile-gift-visual { background: linear-gradient(145deg, #e91e63 0%, #ad1457 100%); }
.profile-gift-card[data-theme="star"] .profile-gift-visual { background: linear-gradient(145deg, #ffc107 0%, #ff9800 100%); }
.profile-gift-card[data-theme="gift"] .profile-gift-visual { background: linear-gradient(145deg, #8bc34a 0%, #558b2f 100%); }
.profile-gift-card[data-theme="rose"] .profile-gift-visual { background: linear-gradient(145deg, #f06292 0%, #c2185b 100%); }
.profile-gift-card[data-theme="crown"] .profile-gift-visual { background: linear-gradient(145deg, #ffd700 0%, #b8860b 100%); }
.profile-gift-card[data-theme="diamond"] .profile-gift-visual { background: linear-gradient(145deg, #b39ddb 0%, #5e35b1 100%); }
.profile-gift-card[data-theme="fire"] .profile-gift-visual { background: linear-gradient(145deg, #ff5722 0%, #bf360c 100%); }
.profile-gift-card[data-theme="music"] .profile-gift-visual { background: linear-gradient(145deg, #9c27b0 0%, #4a148c 100%); }
.profile-gift-card[data-theme="cupcake"] .profile-gift-visual { background: linear-gradient(145deg, #ffab91 0%, #e64a19 100%); }
.profile-gift-card[data-theme="cosmos"] .profile-gift-visual { background: linear-gradient(145deg, #5c6bc0 0%, #1a237e 100%); }
.profile-gift-card[data-theme="idea"] .profile-gift-visual { background: linear-gradient(145deg, #fff59d 0%, #f9a825 100%); }
.profile-gift-card[data-theme="clover"] .profile-gift-visual { background: linear-gradient(145deg, #66bb6a 0%, #2e7d32 100%); }
.profile-gift-card[data-theme="rainbow"] .profile-gift-visual { background: linear-gradient(145deg, #ec407a 0%, #ab47bc 30%, #5c6bc0 60%, #26c6da 100%); }
.profile-gift-card[data-theme="trophy"] .profile-gift-visual { background: linear-gradient(145deg, #ffca28 0%, #ff8f00 100%); }
.profile-gift-card[data-theme="ring"] .profile-gift-visual { background: linear-gradient(145deg, #b0bec5 0%, #546e7a 100%); }
.profile-gift-card[data-theme="butterfly"] .profile-gift-visual { background: linear-gradient(145deg, #ce93d8 0%, #7b1fa2 100%); }
.profile-gift-card[data-theme="sun"] .profile-gift-visual { background: linear-gradient(145deg, #ffeb3b 0%, #f57f17 100%); }
.profile-gift-card[data-theme="moon"] .profile-gift-visual { background: linear-gradient(145deg, #b0bec5 0%, #37474f 100%); }
.profile-gift-card[data-theme="chocolate"] .profile-gift-visual { background: linear-gradient(145deg, #8d6e63 0%, #4e342e 100%); }
.profile-gift-card[data-theme="bouquet"] .profile-gift-visual { background: linear-gradient(145deg, #f48fb1 0%, #ad1457 100%); }
.profile-gift-card[data-theme="default"] .profile-gift-visual { background: linear-gradient(145deg, var(--accent) 0%, #4a148c 100%); }
/* Эксклюзив в профиле: крупнее фото, лучше видно */
.profile-gift-card[data-theme="exclusive"] .profile-gift-visual {
  width: 72px;
  height: 72px;
}
.profile-gift-card[data-theme="exclusive"] .profile-gift-img {
  object-fit: contain;
}
.profile-gift-exclusive-id {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

/* Avatars — фиксированный размер, картинка не раздувает верстку */
.user-avatar {
  border-radius: 50%;
  object-fit: cover;
  display: block;
  width: 40px;
  height: 40px;
  max-width: 100%;
  max-height: 100%;
  flex-shrink: 0;
}

.user-avatar.tiny { width: 28px; height: 28px; min-width: 28px; min-height: 28px; }
.user-avatar.small { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
.user-avatar.medium { width: 56px; height: 56px; min-width: 56px; min-height: 56px; }
.user-avatar.large { width: 96px; height: 96px; min-width: 96px; min-height: 96px; }
.user-avatar.xlarge { width: 120px; height: 120px; min-width: 120px; min-height: 120px; }

/* Main content */
.main-content {
  position: relative;
  z-index: 0;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

/* Layouts */
.layout-feed {
  display: grid;
  grid-template-columns: 280px 1fr 300px;
  gap: 24px;
  align-items: start;
}

.layout-single {
  max-width: 640px;
  margin: 0 auto;
}

.layout-profile {
  max-width: 900px;
  margin: 0 auto;
}

.layout-messages {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  height: calc(100vh - 56px - 48px);
  min-height: 400px;
  overflow: hidden;
}

@media (max-width: 1100px) {
  .layout-feed { grid-template-columns: 1fr 300px; }
  .sidebar.left { display: none; }
}

@media (max-width: 900px) {
  .layout-feed { grid-template-columns: 1fr; }
  .sidebar.right { display: none; }
  .main-nav span:not(.nav-badge) { display: none; }
  .user-name { display: none; }
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 80px;
  z-index: 0;
}

.layout-feed > .sidebar,
.layout-feed > .feed-center {
  position: relative;
  z-index: 0;
}

.sidebar-card, .card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.sidebar-title {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.sidebar-text {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.updates-card .sidebar-title {
  margin-bottom: 12px;
}
.updates-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.updates-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.updates-item:first-child {
  padding-top: 0;
}
.updates-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.updates-date {
  font-size: 0.75rem;
  color: var(--text-dim);
}
.updates-text {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.4;
}

.create-post-card {
  padding: 14px;
}

.compose-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  text-decoration: none;
  box-shadow: var(--glass-highlight);
}

.compose-preview:hover {
  border-color: var(--border-light);
  color: var(--text);
  text-decoration: none;
}

.compose-placeholder {
  font-size: 0.9375rem;
}

/* Feed */
.feed-center {
  min-width: 0;
}

.feed-header {
  margin-bottom: 20px;
}

.feed-title {
  margin: 0 0 4px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.feed-subtitle {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* Post card */
.post-card {
  padding: 0;
  margin-bottom: 16px;
  overflow: hidden;
}

.post-card .post-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 20px 0;
}

.post-author {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  flex: 1 1 auto;
  min-width: 0;
}

.post-author:hover {
  color: var(--accent);
  text-decoration: none;
}

.post-author-info {
  min-width: 0;
  overflow: hidden;
}
.post-author-name,
.post-author-username {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-author-name {
  display: block;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  color: #1d9bf0;
  font-size: 0.9em;
  font-weight: 700;
  vertical-align: middle;
}
.profile-name .verified-badge { font-size: 1rem; }

.user-tag-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-left: 0.25rem;
  vertical-align: middle;
}

.badge-scam {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  margin-left: 0.25rem;
  vertical-align: middle;
  background: linear-gradient(135deg, #f59e0b 0%, #dc2626 50%, #b91c1c 100%);
  color: #fff;
  text-shadow: 0 1px 1px rgba(0,0,0,0.2);
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.35);
  letter-spacing: 0.03em;
  animation: badge-scam-pulse 2.5s ease-in-out infinite;
}
.badge-scam .badge-scam-icon {
  font-style: normal;
  line-height: 1;
}
@keyframes badge-scam-pulse {
  0%, 100% { box-shadow: 0 1px 3px rgba(220, 38, 38, 0.35); opacity: 1; }
  50% { box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.4); opacity: 0.95; }
}
.badge-banned {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-left: 0.25rem;
  vertical-align: middle;
  background: #64748b;
  color: #fff;
}

.post-author-username {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.post-time {
  font-size: 0.8125rem;
  color: var(--text-dim);
  text-decoration: none;
}

.post-actions-dropdown {
  position: relative;
}

.post-menu-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.post-menu-btn:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.post-menu-btn::after {
  content: '⋯';
  font-size: 1.2rem;
  line-height: 1;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 6px 0;
  z-index: 10;
}

.dropdown-menu .dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  text-align: left;
  font-size: 0.9375rem;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.dropdown-menu .dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.dropdown-menu .dropdown-item.danger {
  color: var(--danger);
}

.post-body {
  padding: 8px 20px 12px;
}

.post-content-text {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.post-content-text .post-link,
.post-content-text .mention,
.post-content-text .hashtag {
  color: var(--accent);
  text-decoration: none;
}

.post-content-text .mention:hover,
.post-content-text .hashtag:hover {
  text-decoration: underline;
}

/* Фото в посте — целиком, без обрезки по высоте */
.post-image-wrap {
  margin-top: 12px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elevated);
  position: relative;
  z-index: 0;
}

.post-image-lightbox-trigger {
  display: block;
  width: 100%;
  cursor: pointer;
}

.post-image-lightbox-trigger:focus {
  outline: none;
}

.post-image {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  display: block;
  vertical-align: top;
}

.post-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 20px 16px;
  border-top: 1px solid var(--border);
}

.post-repost-line {
  padding: 6px 20px 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.post-repost-line a { color: var(--accent); text-decoration: none; }
.post-repost-line a:hover { text-decoration: underline; }
.post-repost-comment { color: var(--text-dim); font-style: italic; }

.post-pinned-badge {
  padding: 4px 20px;
  font-size: 0.75rem;
  color: var(--accent);
  background: rgba(10, 132, 255, 0.12);
  border-bottom: 1px solid var(--glass-border);
}

.post-reactions-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  position: relative;
}
.post-reaction-btn,
.post-reaction-add-btn {
  padding: 4px 8px;
  font-size: 1rem;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.post-reaction-btn:hover,
.post-reaction-add-btn:hover { background: var(--bg-hover); }
.post-reaction-btn.active { background: rgba(10, 132, 255, 0.22); }
.post-reaction-picker {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 4px;
  display: flex;
  gap: 4px;
  padding: 6px;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.post-reaction-picker[hidden] {
  display: none !important;
}
.post-reaction-picker-btn {
  padding: 4px;
  font-size: 1.2rem;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
}
.post-reaction-picker-btn:hover { background: var(--bg-hover); }

.fundraiser-list { list-style: none; margin: 0; padding: 0; }
.fundraiser-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.fundraiser-item:last-child { border-bottom: none; }
.fundraiser-title { display: block; margin-bottom: 4px; }
.fundraiser-desc { font-size: 0.85rem; color: var(--text-muted); margin: 4px 0; }
.fundraiser-progress { font-size: 0.8rem; color: var(--text-dim); margin: 4px 0 8px; }
.raffle-list { list-style: none; margin: 0; padding: 0; }
.raffle-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.raffle-item:last-child { border-bottom: none; }
.raffle-title { display: block; margin-bottom: 4px; }
.raffle-desc { font-size: 0.85rem; color: var(--text-muted); margin: 4px 0; }
.raffle-prize { font-size: 0.9rem; color: var(--accent); font-weight: 500; margin: 4px 0; }
.raffle-end { font-size: 0.8rem; color: var(--text-dim); margin: 4px 0 8px; }
.raffle-participating { font-size: 0.8125rem; color: var(--success); font-weight: 500; }
.raffle-join-btn { margin-top: 4px; }
.fundraiser-card .fundraiser-progress-wrap { margin: 12px 0; }
.fundraiser-card .fundraiser-progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.fundraiser-card .fundraiser-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.2s;
}
.admin-stat-hint { font-size: 0.85rem; color: var(--text-muted); font-weight: normal; }

.post-action {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
}

.post-action:hover {
  background: var(--bg-hover);
  color: var(--accent);
}

.post-action.active {
  color: var(--danger);
}

.post-action.active .post-action-like {
  background: var(--danger);
}

.post-action-icon {
  width: 18px;
  height: 18px;
  background: currentColor;
}

.post-action-like { mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z'/%3E%3C/svg%3E") center/contain no-repeat; }
.post-action-comment { mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E") center/contain no-repeat; }
.post-action-bookmark { mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='m19 21-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='m19 21-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z'/%3E%3C/svg%3E") center/contain no-repeat; }
.post-action-share { mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8'/%3E%3Cpolyline points='16 6 12 2 8 6'/%3E%3Cline x1='12' y1='2' x2='12' y2='15'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8'/%3E%3Cpolyline points='16 6 12 2 8 6'/%3E%3Cline x1='12' y1='2' x2='12' y2='15'/%3E%3C/svg%3E") center/contain no-repeat; }
.post-action-repost { mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M17 1l4 4-4 4'/%3E%3Cpath d='M3 11V9a4 4 0 0 1 4-4h14'/%3E%3Cpath d='M7 23l-4-4 4-4'/%3E%3Cpath d='M21 13v2a4 4 0 0 1-4 4H3'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M17 1l4 4-4 4'/%3E%3Cpath d='M3 11V9a4 4 0 0 1 4-4h14'/%3E%3Cpath d='M7 23l-4-4 4-4'/%3E%3Cpath d='M21 13v2a4 4 0 0 1-4 4H3'/%3E%3C/svg%3E") center/contain no-repeat; }

.post-action-label {
  display: none;
}
@media (min-width: 600px) {
  .post-action-label { display: inline; }
}

/* Лайтбокс для фото в постах */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  cursor: pointer;
}

.lightbox-overlay[hidden] {
  display: none;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  z-index: 1001;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox-close::after {
  content: '×';
}

.lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox-video {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #000;
}

.share-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 1001;
  font-size: 0.9375rem;
  color: var(--text);
}

.share-toast[hidden] {
  display: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius-pill);
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(180deg, #409cff 0%, var(--accent) 100%);
  color: #fff;
  box-shadow: 0 4px 16px var(--accent-glow), var(--glass-highlight);
  border-radius: var(--radius-pill);
}

.btn-primary:hover {
  background: linear-gradient(180deg, var(--accent-hover) 0%, #0077ed 100%);
  color: #fff;
}

.btn-secondary {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  color: var(--text);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  box-shadow: var(--glass-highlight);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.btn-sm { padding: 6px 12px; font-size: 0.875rem; }
.btn-block { width: 100%; }
.load-more-wrap { text-align: center; margin: 24px 0; }
.hidden-input { position: absolute; width: 0; height: 0; opacity: 0; }

/* Recommend list */
.recommend-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.recommend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.recommend-item:last-child { border-bottom: none; }

.recommend-avatar-wrap { flex-shrink: 0; }
.recommend-info { flex: 1; min-width: 0; }
.recommend-name { display: block; font-weight: 600; font-size: 0.9375rem; color: var(--text); text-decoration: none; }
.recommend-name:hover { color: var(--accent); text-decoration: none; }
.recommend-username { display: block; font-size: 0.8125rem; color: var(--text-muted); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  color: var(--text);
}

.empty-state p {
  margin: 0 0 20px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.empty-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: linear-gradient(145deg, var(--bg-elevated) 0%, var(--bg-hover) 100%);
  border-radius: 50%;
  border: 2px solid var(--border);
}

/* Profile */
.profile-cover {
  height: 200px;
  background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--border) 100%);
  background-size: cover;
  background-position: center;
  border-radius: var(--radius) var(--radius) 0 0;
  margin: -24px -24px 0;
}

.profile-inner {
  margin-top: -60px;
  position: relative;
  z-index: 1;
  padding: 0 24px 24px;
}

.profile-header {
  display: flex;
  gap: 24px;
  padding: 24px;
  flex-wrap: wrap;
}

.profile-avatar-wrap {
  flex-shrink: 0;
}

.profile-avatar-wrap .user-avatar {
  border: 4px solid var(--bg-card);
  box-shadow: var(--shadow);
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-name {
  margin: 0 0 4px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.profile-username {
  margin: 0 0 4px;
  font-size: 1rem;
  color: var(--text-muted);
}

.profile-last-seen {
  margin: 0 0 12px;
  font-size: 0.875rem;
  color: var(--text-dim);
}

.profile-online {
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.profile-bio {
  margin: 0 0 12px;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text);
}

.profile-meta {
  margin: 0 0 12px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.profile-meta a {
  color: var(--accent);
}

.profile-stats {
  margin: 0 0 16px;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.profile-stats strong {
  color: var(--text);
  margin-right: 4px;
}

.profile-stats span {
  margin-right: 20px;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Auth page */
.auth-page {
  width: 100%;
  max-width: 400px;
}

.auth-brand {
  text-align: center;
  margin-bottom: 32px;
}

.auth-brand .logo-icon {
  margin: 0 auto 16px;
}

.auth-brand h1 {
  margin: 0 0 8px;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
}

.auth-brand p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.auth-card {
  padding: 28px;
}

.auth-title {
  margin: 0 0 20px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.auth-form .form-group {
  margin-bottom: 16px;
}

.auth-form .btn {
  margin-top: 8px;
}

.auth-footer {
  margin: 20px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.9375rem;
  color: var(--text-muted);
  text-align: center;
}

/* Form */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--glass-highlight);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: rgba(10, 132, 255, 0.55);
  box-shadow: 0 0 0 3px var(--accent-glow), var(--glass-highlight);
}

.form-control::placeholder {
  color: var(--text-dim);
}

.form-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.form-check label {
  margin: 0;
}

.form-stack { display: flex; flex-direction: column; gap: 20px; }
.form-error { color: var(--danger); margin-bottom: 12px; }
.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.chosen-users-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chosen-users-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
}
.chosen-users-list .remove-participant {
  margin-left: auto;
  padding: 4px 8px;
  font-size: 1.125rem;
  line-height: 1;
}
.search-results-inline {
  position: relative;
  margin-top: 6px;
  padding: 8px 0;
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 10;
}
.search-results-inline[hidden] {
  display: none;
}
.search-result-user {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  color: var(--text);
  font-size: 0.9375rem;
  text-align: left;
  cursor: pointer;
}
.search-result-user:hover {
  background: var(--bg-hover);
}
.search-no { margin: 12px 14px; color: var(--text-muted); font-size: 0.875rem; }

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.9375rem;
}

.alert-error {
  background: rgba(199, 92, 92, 0.15);
  border: 1px solid rgba(199, 92, 92, 0.4);
  color: #e8a0a0;
}

.alert-success {
  background: rgba(107, 155, 107, 0.15);
  border: 1px solid rgba(107, 155, 107, 0.4);
  color: #a8d0a8;
}

/* Compose */
.page-heading {
  margin: 0 0 20px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.compose-author {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.compose-author-name {
  font-weight: 600;
  color: var(--text);
}

.compose-textarea {
  min-height: 120px;
  resize: vertical;
}

.compose-image-preview {
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.compose-preview-img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  display: block;
}

.compose-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

/* Comments */
.comments-section {
  margin-top: 24px;
  padding: 20px;
}

.comments-title {
  margin: 0 0 16px;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.comment-form {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.comment-form-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment-input {
  resize: none;
  min-height: 44px;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comment-item {
  display: flex;
  gap: 12px;
}

.comment-body {
  flex: 1;
  min-width: 0;
}

.comment-author {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  text-decoration: none;
}

.comment-author:hover {
  color: var(--accent);
  text-decoration: none;
}

.comment-username {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-left: 6px;
}

.comment-time {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-left: 8px;
}

.comment-content {
  margin: 4px 0 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text);
}

/* Messages */
.messages-sidebar {
  padding: 20px;
  overflow-y: auto;
  min-height: 0;
}

.messages-sidebar-title {
  margin: 0 0 16px;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.conversations-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}

.conversation-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
}

.conversation-item a:hover,
.conversation-item.active a {
  background: var(--bg-hover);
  text-decoration: none;
  color: var(--text);
}

.conversation-info {
  flex: 1;
  min-width: 0;
}

.conversation-name {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
}

.conversation-preview {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.conversation-preview:empty { display: none; }

.conversation-time {
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.conversation-avatars.group {
  display: flex;
  align-items: center;
  gap: 2px;
}
.conversation-avatars.group .user-avatar { width: 32px; height: 32px; border-radius: 50%; }

.messages-header-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.messages-header-participants {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: normal;
}

.messages-main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.messages-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.messages-back-link {
  display: none;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  margin: -8px 4px -8px -8px;
}
.messages-back-link:hover { color: var(--accent); background: var(--bg-hover); text-decoration: none; }

.messages-header-with-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.messages-header-title { flex: 1; min-width: 0; }
.messages-invite-btn { flex-shrink: 0; }

.messages-header a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}

.messages-header a:hover {
  color: var(--accent);
  text-decoration: none;
}

.messages-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.group-call-btn { min-height: 40px; white-space: nowrap; }

.messages-header-group strong { font-weight: 600; }

.conversation-participants-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  max-width: 90%;
  margin: 0;
  border-radius: 0;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 5;
  overflow: hidden;
}
.conversation-participants-panel[hidden] {
  display: none;
}
.conversation-participants-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.conversation-participants-header h3 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
}
.conversation-participants-list {
  list-style: none;
  margin: 0;
  padding: 12px 0;
  overflow-y: auto;
  flex: 1;
}
.conversation-participants-list li {
  margin: 0;
}
.conversation-participant-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  min-height: 56px;
  box-sizing: border-box;
}
.conversation-participants-list li:last-child .conversation-participant-row {
  border-bottom: none;
}
.conversation-participant-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  padding: 0;
  color: var(--text);
  text-decoration: none;
}
.conversation-participant-main:hover {
  color: var(--text);
  text-decoration: none;
}
.conversation-participant-row .user-avatar.small {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
}
.conversation-participant-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.conversation-participant-name {
  font-size: 0.9375rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conversation-participant-name em {
  color: var(--text-muted);
  font-style: normal;
  font-weight: 400;
}
.conversation-participant-username {
  font-size: 0.8125rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conversation-participant-role-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 4.5em;
  text-align: right;
}
.conversation-participant-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
}
.conversation-role-form {
  display: inline;
}
.conversation-role-form button,
.conversation-kick-btn {
  font-size: 0.8125rem;
  white-space: nowrap;
}
.conversation-kick-btn {
  flex-shrink: 0;
}

/* Комнаты */
.rooms-desc { color: var(--text-muted); margin: 0 0 1rem; }
.rooms-list { list-style: none; padding: 0; margin: 0; }
.rooms-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}
.rooms-list-item:last-child { border-bottom: none; }
.rooms-list-info { display: flex; flex-direction: column; gap: 0.25rem; }
.rooms-list-meta { font-size: 0.875rem; color: var(--text-muted); }

/* Голосовая комната (групповой звонок) */
.voice-room-layout {
  max-width: 520px;
  margin: 0 auto;
  padding: 1rem;
  padding-left: calc(1rem + env(safe-area-inset-left));
  padding-right: calc(1rem + env(safe-area-inset-right));
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
}
.voice-room-back-wrap { margin-bottom: 0.75rem; }
.voice-room-back { min-height: 44px; padding: 0.5rem 0; }
.voice-room-card { padding: 1.25rem; }
.voice-room-heading { font-size: 1.35rem; margin-bottom: 0.25rem; }
.voice-room-desc { color: var(--text-muted); margin: 0 0 1rem; font-size: 0.9375rem; }
.voice-room-participants {
  background: var(--bg-page, #f5f6f8);
  border-radius: 10px;
  padding: 1rem;
  margin: 1rem 0;
  min-height: 80px;
}
.voice-room-participant {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}
.voice-room-participant .user-avatar { flex-shrink: 0; }
.voice-room-peer-state { font-size: 0.75rem; color: var(--text-muted); margin-left: auto; }
.voice-room-actions { display: flex; align-items: center; gap: 0.75rem; margin-top: 1rem; flex-wrap: wrap; }
.voice-room-actions .btn { min-height: 44px; }

.conversation-settings-panel .conversation-settings-form {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.conversation-settings-avatar-preview {
  margin-bottom: 8px;
}
.conversation-settings-avatar-preview .user-avatar {
  display: block;
}
.conversation-header-avatar {
  margin-right: 8px;
  vertical-align: middle;
}

.messages-list {
  flex: 1;
  min-height: 0;
  padding: 16px 12px 20px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}

.message-bubble {
  display: flex;
  gap: 10px;
  max-width: 85%;
  align-items: flex-end;
}

.message-bubble.own {
  margin-left: auto;
  flex-direction: row-reverse;
}

.message-body {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: 20px 20px 20px 6px;
  padding: 10px 14px 12px;
  box-shadow: var(--glass-highlight);
}

.message-bubble.own .message-body {
  border-radius: 20px 20px 6px 20px;
  background: linear-gradient(145deg, rgba(10, 132, 255, 0.45) 0%, rgba(10, 132, 255, 0.22) 100%);
  border-color: rgba(10, 132, 255, 0.35);
  box-shadow: 0 4px 16px var(--accent-glow), var(--glass-highlight);
}

.message-bubble .user-avatar.tiny {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
}

.message-meta {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-bottom: 6px;
  line-height: 1.3;
}

.message-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 2px;
}
.message-actions .btn-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  font-size: 0;
}
.message-actions .btn-icon:hover {
  color: var(--text);
  background: var(--bg-hover);
}
.message-edit-btn::before {
  content: '\270E';
  font-size: 0.9rem;
}
.message-delete-btn::before {
  content: '\2715';
  font-size: 1rem;
}

.message-content {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--text);
  word-wrap: break-word;
}
.message-content.message-deleted {
  color: var(--text-muted);
  font-style: italic;
}

.message-content p { margin: 0; }
.message-content p + p { margin-top: 6px; }

.message-embeds {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message-embed-youtube {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight);
  max-width: 100%;
}

.message-embed-youtube iframe {
  display: block;
  width: 100%;
  border: 0;
  background: #000;
}

.message-embed-youtube:not(.message-embed-youtube-short) {
  aspect-ratio: 16 / 9;
  max-width: 320px;
}

.message-embed-youtube:not(.message-embed-youtube-short) iframe {
  height: 100%;
  min-height: 180px;
}

.message-embed-youtube-short {
  aspect-ratio: 9 / 16;
  max-width: 220px;
  margin: 0 auto;
}

.message-embed-youtube-short iframe {
  height: 100%;
  min-height: 320px;
}

.message-youtube-link {
  font-weight: 500;
}

.message-form {
  padding: 10px 12px 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--glass-border);
  background: rgba(10, 10, 15, 0.55);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  flex-shrink: 0;
  box-shadow: var(--glass-highlight);
}

.message-form-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Одна общая «таблетка» как во ВК: иконки + поле ввода внутри */
.message-input-bar {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 2px;
  padding: 6px 6px 6px 14px;
  min-height: 44px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  box-shadow: var(--glass-highlight);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.message-input-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), var(--glass-highlight);
}

.message-attachment-input {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

.message-input-bar .message-attach-btn,
.message-input-bar .message-voice-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  font-size: 1.15rem;
  cursor: pointer;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: transparent;
  border: none;
  transition: color 0.15s, background 0.15s;
}
.message-input-bar .message-attach-btn:hover,
.message-input-bar .message-voice-btn:hover {
  color: var(--accent);
  background: var(--bg-hover);
}
.message-input-bar .message-voice-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.message-input-bar .message-input {
  flex: 1;
  resize: none;
  min-height: 32px;
  max-height: 100px;
  padding: 8px 10px;
  line-height: 1.35;
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: 1rem;
  font-family: inherit;
  overflow-y: auto;
  box-sizing: border-box;
}
.message-input-bar .message-input:focus {
  outline: none;
  box-shadow: none;
}
.message-input-bar .message-input::placeholder {
  color: var(--text-dim);
  opacity: 1;
}

.message-send-btn {
  flex-shrink: 0;
  border-radius: 22px;
  padding: 10px 16px;
  font-weight: 500;
  height: 44px;
  min-height: 44px;
}
.message-form-row .btn-primary.message-send-btn {
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px var(--accent-glow);
}
.message-form-row .btn-primary.message-send-btn:hover {
  background: var(--accent-hover);
  color: #fff;
}

.message-attachment-preview {
  margin-top: 8px;
  font-size: 0.875rem;
  color: var(--text-dim);
}

.message-attachment {
  margin: 6px 0;
}

.message-media {
  display: block;
  max-width: 100%;
  border-radius: 8px;
  overflow: hidden;
}

.message-media-btn {
  padding: 0;
  border: none;
  background: none;
  display: inline-block;
  cursor: pointer;
}
.message-media-btn:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.message-image {
  max-height: 280px;
  object-fit: contain;
}

.message-video-wrap {
  position: relative;
  display: inline-block;
  max-width: 200px;
  max-height: 160px;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: #000;
}
.message-video-wrap:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.message-video-wrap .message-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-width: 200px;
  max-height: 160px;
  vertical-align: top;
}
.message-video-wrap::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -20px 0 0 -20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  opacity: 1;
  transition: opacity 0.2s;
  pointer-events: none;
}
.message-video-wrap::before {
  content: '\25B6';
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -12px 0 0 -8px;
  font-size: 20px;
  color: #fff;
  opacity: 1;
  transition: opacity 0.2s;
  pointer-events: none;
}
.message-video-wrap.playing::after,
.message-video-wrap.playing::before {
  opacity: 0;
}
.message-video-wrap.playing:hover::after,
.message-video-wrap.playing:hover::before {
  opacity: 1;
}
.message-video-wrap.playing:hover::before {
  content: '\23F8';
  margin-left: -10px;
}
@media (min-width: 480px) {
  .message-video-wrap { max-width: 240px; max-height: 180px; }
  .message-video-wrap .message-video { max-width: 240px; max-height: 180px; }
}

/* Скрыть стандартный плеер в чате — используем только кастомный */
.message-attachment audio[controls] {
  display: none !important;
}

.message-audio {
  min-width: 240px;
  max-width: 100%;
}

/* Плеер голосовых сообщений в стиле ВК: таблетка, круглая кнопка, прогресс, время */
.voice-message-player {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 200px;
  max-width: 280px;
  padding: 10px 14px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  box-shadow: var(--glass-highlight);
  flex-shrink: 0;
}
.message-bubble.own .voice-message-player {
  background: rgba(10, 132, 255, 0.25);
  border-color: rgba(10, 132, 255, 0.4);
}
.voice-message-play {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  padding: 0;
  transition: background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.voice-message-play:hover {
  background: var(--accent-hover);
}
.voice-message-play:active {
  transform: scale(0.96);
}
.voice-message-play::before {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent #fff;
  margin-left: 3px;
}
.voice-message-play.playing::before {
  width: 4px;
  height: 12px;
  border: none;
  margin-left: -5px;
  background: #fff;
  border-radius: 1px;
}
.voice-message-play.playing::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  margin-top: -6px;
  margin-left: 1px;
  width: 4px;
  height: 12px;
  background: #fff;
  border-radius: 1px;
}
.voice-message-track {
  flex: 1;
  min-width: 0;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.message-bubble.own .voice-message-track {
  background: rgba(0,0,0,0.15);
}
.voice-message-progress {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.15s linear;
}
.voice-message-time {
  flex-shrink: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  min-width: 2.8em;
}
.voice-message-player audio {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

/* Notifications */
.notifications-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.notification-item {
  border-bottom: 1px solid var(--border);
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  color: var(--text);
  text-decoration: none;
}

.notification-link:hover {
  background: var(--bg-hover);
  text-decoration: none;
  color: var(--text);
}

.notification-item.unread .notification-link {
  background: rgba(10, 132, 255, 0.1);
}

.notification-body {
  flex: 1;
  min-width: 0;
}

.notification-time {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Post single (no extra card wrapper) */
.post-single .post-card {
  margin-bottom: 0;
}

/* Settings */
.settings-card {
  padding: 28px;
}

.settings-section {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.settings-section:last-of-type {
  border-bottom: none;
}

.settings-section-title {
  margin: 0 0 16px;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.settings-avatar-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Жёсткий контейнер для аватара — не даёт картинке раздуть страницу */
.avatar-preview-box {
  width: 120px;
  height: 120px;
  min-width: 120px;
  min-height: 120px;
  max-width: 120px;
  max-height: 120px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-elevated);
  flex-shrink: 0;
}

.avatar-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.settings-avatar-row .form-hint {
  margin-top: 8px;
}

.settings-cover-row .settings-cover-preview {
  width: 100%;
  max-width: 400px;
  height: 120px;
  background: var(--bg-elevated) center/cover no-repeat;
  background-size: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
}

.settings-cover-row .form-hint {
  margin-top: 8px;
}

/* ========== Истории (как в Instagram/Telegram) ========== */
.stories-strip {
  padding: 16px 20px;
  margin-bottom: 20px;
  overflow: hidden;
}

.stories-strip-inner {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.stories-strip-inner::-webkit-scrollbar {
  display: none;
}

.story-item {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--text);
  font-size: 0.8125rem;
  text-decoration: none;
  font-family: inherit;
}

.story-item:hover {
  color: var(--text);
}

.story-avatar-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(145deg, #0a84ff, #5e5ce6, #bf5af2);
  flex-shrink: 0;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.story-avatar-wrap .user-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg);
  box-sizing: border-box;
}

.story-avatar-add {
  background: var(--glass-border);
}

.story-avatar-add .story-add-icon {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  font-weight: 600;
  border: 2px solid var(--bg);
  box-shadow: 0 2px 8px var(--accent-glow);
}

.story-username {
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Полноэкранный просмотр историй */
body.story-viewer-open {
  overflow: hidden;
}

.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-viewer[hidden] {
  display: none;
}

.story-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  cursor: pointer;
}

.story-viewer-content {
  position: relative;
  width: 100%;
  max-width: 500px;
  height: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.story-viewer-header {
  padding: 12px 16px 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.story-progress-bars {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 4px;
  padding: 12px 16px 4px;
  z-index: 2;
}

.story-progress-segment {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
}

.story-progress-segment .story-progress-fill {
  display: block;
  height: 100%;
  width: 0;
  background: #fff;
  border-radius: 2px;
  transition: width 0.1s linear;
}

.story-progress-segment.active .story-progress-fill {
  animation: story-progress 5s linear forwards;
}

.story-progress-segment.done .story-progress-fill {
  width: 100%;
}

@keyframes story-progress {
  from { width: 0; }
  to { width: 100%; }
}

.story-viewer-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  color: #fff;
  font-size: 0.9375rem;
}

.story-viewer-time {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8125rem;
  margin-left: 4px;
}

.story-viewer-footer {
  padding: 12px 16px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.story-viewer-like-bottom {
  color: #fff;
  font-size: 1.25rem;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
}

.story-viewer-like {
  color: #fff;
  font-size: 1.25rem;
  padding: 4px 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.story-viewer-like .story-like-icon {
  color: rgba(255, 255, 255, 0.9);
}

.story-viewer-like.is-liked .story-like-icon {
  color: #ff2d55;
}

.story-like-count {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.8);
}

.story-viewer-close {
  margin-left: auto;
  color: #fff;
  font-size: 1.5rem;
  padding: 4px;
}

.story-viewer-media-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.story-viewer-media {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.story-viewer-video {
  width: 100%;
}

.story-viewer-prev,
.story-viewer-next {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 25%;
  max-width: 80px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2;
}

.story-viewer-prev {
  left: 0;
}

.story-viewer-next {
  right: 0;
}

/* ——— Админ-панель: редизайн ——— */
:root {
  --admin-sidebar-bg: linear-gradient(165deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  --admin-sidebar-width: 280px;
  --admin-accent: #6366f1;
  --admin-accent-hover: #818cf8;
  --admin-card-radius: 16px;
  --admin-card-shadow: 0 4px 24px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --admin-card-shadow-hover: 0 8px 32px rgba(0,0,0,0.08);
  --admin-bg-page: #1e293b;
  --admin-bg-card: #334155;
  --admin-bg-input: #475569;
  --admin-text: #e2e8f0;
  --admin-text-muted: #94a3b8;
  --admin-border: #475569;
}

.page-admin .layout { display: none; }
body.page-admin { background: var(--admin-bg-page) !important; }
.admin-layout {
  display: flex;
  min-height: calc(100vh - var(--header-height, 56px));
  background: var(--admin-bg-page);
}
.page-admin .card { background: var(--admin-bg-card) !important; border-color: var(--admin-border); }

/* Sidebar */
.admin-sidebar {
  width: var(--admin-sidebar-width);
  flex-shrink: 0;
  background: var(--admin-sidebar-bg);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  box-shadow: 8px 0 32px rgba(0,0,0,0.15);
  position: relative;
  z-index: 10;
}
.admin-sidebar-header {
  padding: 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.admin-sidebar-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--admin-accent) 0%, #8b5cf6 100%);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
  flex-shrink: 0;
}
.admin-sidebar-title {
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  color: #fff;
}
.admin-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow-y: auto;
}
.admin-nav-group-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
  padding: 0.75rem 1rem 0.35rem;
  margin-top: 0.5rem;
}
.admin-nav-group-label:first-child { margin-top: 0; padding-top: 0; }
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.admin-nav-link:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.admin-nav-link.active {
  background: rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}
.admin-nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 6px;
  background: rgba(255,255,255,0.15);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.admin-nav-link.active .admin-nav-icon {
  background: rgba(99, 102, 241, 0.6);
}
.admin-nav-icon-users { background: rgba(99, 102, 241, 0.5); }
.admin-nav-icon-groups { background: rgba(34, 197, 94, 0.5); }
.admin-nav-icon-posts { background: rgba(249, 115, 22, 0.5); }
.admin-nav-icon-system { background: rgba(168, 85, 247, 0.5); }
.admin-nav-icon-rooms { background: rgba(14, 165, 233, 0.5); }
.admin-sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.admin-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  transition: color 0.2s;
  padding: 0.5rem 0;
}
.admin-back-link:hover { color: #fff; }

/* Main content */
.admin-main {
  flex: 1;
  min-width: 0;
  padding: 1.75rem 2rem 2.5rem;
  background: var(--admin-bg-page);
  overflow-x: auto;
}
.admin-main-inner {
  max-width: 1280px;
  margin: 0 auto;
  min-width: 0;
}
.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.admin-page-header {
  margin-bottom: 0;
}
.admin-page-title {
  font-size: 1.625rem;
  font-weight: 800;
  margin: 0 0 0.25rem;
  letter-spacing: -0.03em;
  color: var(--admin-text);
}
.admin-desc {
  font-size: 0.9375rem;
  color: var(--admin-text-muted);
  margin: 0;
  line-height: 1.5;
  max-width: 56ch;
}
.admin-search-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.admin-search-form .form-control {
  min-width: 240px;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--admin-border);
  background: var(--admin-bg-input);
  color: var(--admin-text);
  font-size: 0.9375rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.admin-search-form .form-control::placeholder { color: var(--admin-text-muted); }
.admin-search-form .form-control:focus {
  outline: none;
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.admin-search-form .btn { border-radius: 12px; padding: 0.6rem 1.1rem; font-weight: 600; }

/* Alerts */
.admin-ok {
  padding: 0.875rem 1.25rem;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.12) 0%, rgba(34, 197, 94, 0.06) 100%);
  color: #15803d;
  border-radius: 12px;
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  border: 1px solid rgba(34, 197, 94, 0.2);
}
.admin-err {
  padding: 0.875rem 1.25rem;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
  color: #b91c1c;
  border-radius: 12px;
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.admin-empty { color: var(--admin-text-muted); margin: 0.5rem 0; font-size: 0.9375rem; }

/* Cards & tables */
.admin-table-wrap {
  background: var(--admin-bg-card);
  border-radius: var(--admin-card-radius);
  box-shadow: var(--admin-card-shadow);
  border: 1px solid var(--admin-border);
  margin-bottom: 1.5rem;
  transition: box-shadow 0.2s;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.admin-table-wrap:hover { box-shadow: var(--admin-card-shadow-hover); }
.admin-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  color: var(--admin-text);
}
.admin-table th {
  text-align: left;
  padding: 1rem 1.25rem;
  background: #1e293b;
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--admin-text-muted);
  border-bottom: 1px solid var(--admin-border);
  white-space: nowrap;
}
.admin-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--admin-border);
  vertical-align: middle;
  color: var(--admin-text);
}
/* Последняя колонка (Действия) — не обрезать кнопки */
.admin-table th:last-child,
.admin-table td:last-child {
  min-width: 160px;
  white-space: nowrap;
}
.admin-table .admin-post-preview { white-space: nowrap; }
.admin-table tbody tr {
  transition: background 0.15s;
}
.admin-table tbody tr:hover {
  background: rgba(255,255,255,0.06);
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr.admin-gift-limited {
  background: linear-gradient(90deg, rgba(255, 193, 7, 0.12) 0%, transparent 100%);
}
.admin-user-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--admin-text);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}
.admin-user-link:hover { color: #a5b4fc; }
.admin-user-link .user-avatar.tiny { width: 32px; height: 32px; border-radius: 10px; }
.admin-toggle-form { margin: 0; }
.admin-inline-form { display: inline-flex; align-items: center; gap: 0.35rem; margin-left: 0.25rem; }
.admin-inline-form button { margin: 0; }
.admin-post-preview { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.875rem; color: var(--admin-text-muted); }
.admin-meta { display: block; font-size: 0.8rem; color: var(--admin-text-muted); margin-top: 0.2rem; }
.admin-tag-cell { min-width: 180px; }
.admin-tag-form { display: inline-flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.admin-tag-input { width: 88px; padding: 0.4rem 0.6rem; border-radius: 8px; border: 1px solid var(--admin-border); font-size: 0.875rem; background: var(--admin-bg-input); color: var(--admin-text); }
.admin-tag-color { width: 30px; height: 30px; padding: 0; border: 1px solid var(--admin-border); border-radius: 8px; cursor: pointer; }

.admin-subheading {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 1.5rem 0 0.75rem;
  color: var(--admin-text);
  letter-spacing: -0.02em;
}
.admin-edit-user {
  margin-top: 1.5rem;
  padding: 1.5rem 1.75rem;
  background: var(--admin-bg-card);
  border-radius: var(--admin-card-radius);
  box-shadow: var(--admin-card-shadow);
  border: 1px solid var(--admin-border);
}
.admin-user-moderation-form .form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
  margin-bottom: 1.25rem;
}
.admin-user-moderation-form .checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--admin-text);
}
.admin-user-moderation-form .form-control {
  border-radius: 12px;
  border: 1px solid var(--admin-border);
  padding: 0.6rem 1rem;
  max-width: 280px;
  background: var(--admin-bg-input);
  color: var(--admin-text);
}
.admin-group-form-wrap,
.admin-system-actions,
.admin-stats {
  background: var(--admin-bg-card);
  border-radius: var(--admin-card-radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--admin-border);
  box-shadow: var(--admin-card-shadow);
  color: var(--admin-text);
}
.admin-group-form .form-group { margin-bottom: 1.25rem; }
.admin-group-form .form-control,
.admin-group-form label { color: var(--admin-text); }
.admin-group-form .form-control {
  border-radius: 12px;
  padding: 0.65rem 1rem;
  border: 1px solid var(--admin-border);
  background: var(--admin-bg-input);
  color: var(--admin-text);
}
.page-admin .admin-main .form-control,
.page-admin .admin-main input[type="text"],
.page-admin .admin-main input[type="number"],
.page-admin .admin-main input[type="search"],
.page-admin .admin-main input[type="datetime-local"],
.page-admin .admin-main textarea,
.page-admin .admin-main select {
  background: var(--admin-bg-input);
  border-color: var(--admin-border);
  color: var(--admin-text);
}
.page-admin .admin-main label { color: var(--admin-text); }
.admin-stats-list li { color: var(--admin-text-muted); }
.admin-stats-list strong { color: #a5b4fc; }
.admin-hint { color: var(--admin-text-muted); }
.admin-system-actions .btn { margin-bottom: 0.5rem; border-radius: 12px; font-weight: 600; }
.admin-hint { font-size: 0.875rem; color: var(--admin-text-muted); margin: 0.5rem 0 0; line-height: 1.5; }
.admin-stats-list { list-style: none; padding: 0; margin: 0; }
.admin-stats-list li {
  padding: 0.5rem 0;
  font-size: 0.9375rem;
  color: var(--admin-text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--admin-border);
}
.admin-stats-list li:last-child { border-bottom: none; }
.admin-stats-list strong { color: #a5b4fc; font-size: 1.0625rem; }

.admin-table .btn-sm {
  padding: 0.4rem 0.75rem;
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 600;
}
.admin-table .btn-ghost.danger:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

@media (max-width: 768px) {
  .admin-sidebar { width: 72px; }
  .admin-sidebar-header { padding: 1rem 0.5rem; justify-content: center; }
  .admin-sidebar-title { display: none; }
  .admin-sidebar-icon { width: 34px; height: 34px; }
  .admin-nav-group-label { display: none; }
  .admin-nav-link span:not(.admin-nav-icon) { display: none; }
  .admin-nav-link { justify-content: center; padding: 0.75rem; }
  .admin-sidebar-footer { padding: 0.75rem; text-align: center; }
  .admin-back-link span:not(.admin-nav-icon) { display: none; }
  .admin-main { padding: 1rem; }
  .admin-toolbar { flex-direction: column; align-items: stretch; }
  .admin-search-form .form-control { min-width: 100%; }
}

/* Группы: список */
.groups-list { list-style: none; padding: 0; margin: 0; }
.groups-list-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.groups-list-item:last-child { border-bottom: none; }
.group-card-link { display: flex; align-items: center; gap: 1rem; flex: 1; text-decoration: none; color: inherit; }
.group-card-link:hover { color: var(--accent); }
.group-card-info { flex: 1; min-width: 0; }
.group-card-name { display: block; font-size: 1.1rem; }
.group-card-meta { font-size: 0.875rem; color: var(--text-muted); }
.group-card-desc { margin: 0.25rem 0 0; font-size: 0.9rem; color: var(--text-dim); }
.group-join-form { flex-shrink: 0; }

/* Страница группы */
.group-header { margin-bottom: 1rem; }
.group-header-top { display: flex; gap: 1.5rem; align-items: flex-start; }
.group-header-info { flex: 1; min-width: 0; }
.group-title {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  line-height: 1.3;
  word-break: break-word;
}
.group-meta { color: var(--text-muted); margin: 0 0 0.5rem; font-size: 0.9rem; }
.group-description { margin: 0.5rem 0 1rem; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.group-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.group-actions .inline-form { display: inline; }
.group-closed-hint { color: var(--text-muted); font-size: 0.9rem; margin: 0; }
.group-feed .post-card-wrap { margin-bottom: 1rem; }
.group-feed .post-card-wrap:last-child { margin-bottom: 0; }

.post-group-link { color: var(--text-muted); text-decoration: none; font-size: 0.9em; }
.post-group-link:hover { color: var(--accent); }

/* Пост от группы — название группы + автор в две строки */
.post-card-from-group .post-header {
  align-items: flex-start;
  gap: 10px;
}
.post-card-from-group .post-author {
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  gap: 10px;
}
.post-card-from-group .post-author:hover {
  color: inherit;
}
.post-card-from-group .post-author:hover .post-author-name {
  color: var(--accent);
}
.post-card-from-group .post-author-info-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.post-card-from-group .post-author-name {
  display: block;
  line-height: 1.25;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.post-card-from-group .post-group-byline {
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--text-muted);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.post-card-from-group .post-group-byline > * {
  display: inline;
  vertical-align: baseline;
}
.post-card-from-group .post-author-by-label {
  color: var(--text-dim);
  margin-right: 0.2em;
}
.post-card-from-group .post-author-by-link {
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}
.post-card-from-group .post-author-by-link:hover {
  color: var(--accent);
}
.post-card-from-group .post-author-by-sep {
  margin: 0 0.25em;
  color: var(--text-dim);
}
.post-card-from-group .post-author-by-handle {
  color: var(--text-muted);
}
.post-card-from-group .post-meta {
  align-self: flex-start;
  padding-top: 2px;
  flex-shrink: 0;
}

.group-members-card { margin-top: 1rem; }
.group-members-list { list-style: none; margin: 0; padding: 0; }
.group-member-item { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; border-top: 1px solid var(--border); }
.group-member-item:first-child { border-top: none; }
.group-member-main { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; color: inherit; flex: 1 1 auto; min-width: 0; }
.group-member-name { font-weight: 500; }
.group-member-username { font-size: 0.875rem; color: var(--text-muted); margin-left: 0.25rem; }
.group-member-role { font-size: 0.8rem; color: var(--text-muted); margin-left: 0.5rem; }
.group-member-actions { display: flex; gap: 0.25rem; flex-shrink: 0; }

.edit-group-avatar { display: flex; flex-direction: column; gap: 8px; }
.edit-group-avatar .user-avatar { display: block; }

/* Звонки с сайта (только микрофон) */
.call-layout { max-width: 420px; margin: 2rem auto; }
.call-card { text-align: center; padding: 2rem; }
.call-heading { font-size: 1.25rem; margin-bottom: 0.5rem; }
.call-status { color: var(--text-muted); margin: 0 0 1rem; }
.call-actions { margin-bottom: 0.5rem; }
.call-end-btn { min-width: 140px; }
.call-hint { font-size: 0.875rem; color: var(--text-dim); margin: 0; }
.call-hint-warn { margin-top: 0.35rem; color: var(--text-muted); }
.call-volume-wrap { margin: 1rem 0; }
.call-volume-label { display: block; font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.call-volume-slider { width: 100%; max-width: 220px; height: 6px; accent-color: var(--accent); vertical-align: middle; }
.call-volume-value { margin-left: 0.5rem; font-size: 0.9rem; color: var(--text-muted); }
.active-call-volume { display: flex; align-items: center; gap: 0.5rem; }
.call-volume-slider-inline { width: 90px; height: 6px; accent-color: var(--accent); }
.call-volume-value-inline { font-size: 0.8rem; color: var(--text-muted); min-width: 2.5rem; }

.incoming-call-modal {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.incoming-call-modal[hidden] { display: none; }
.incoming-call-modal-inner {
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 320px;
  width: 100%;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}
.incoming-call-title { margin: 0 0 1rem; font-size: 1rem; color: var(--text-muted); }
.incoming-call-user { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; }
.incoming-call-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.incoming-call-name { font-weight: 600; font-size: 1.1rem; }
.incoming-call-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.incoming-call-actions .btn { min-width: 100px; }

.active-call-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 500;
  background: rgba(10, 10, 15, 0.65);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--glass-border);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: var(--glass-highlight);
}
.active-call-bar[hidden] { display: none; }
.active-call-label { font-weight: 500; }
.active-call-warn { width: 100%; order: 2; font-size: 0.7rem; color: var(--text-dim); margin: 0.25rem 0 0; }
.active-call-end { flex-shrink: 0; }

/* Скрытый элемент для воспроизведения голоса в звонке */
.call-remote-audio {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ========== Мобильная оптимизация ========== */
html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}
body {
  overflow-x: hidden;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

@media (max-width: 768px) {
  .header-inner {
    padding: 0 12px;
    gap: 8px;
    height: 52px;
  }
  .main-nav {
    gap: 0;
    flex: 1;
    justify-content: space-around;
    min-width: 0;
  }
  .nav-link {
    padding: 10px 12px;
    min-height: 44px;
    min-width: 44px;
    justify-content: center;
  }
  .nav-link span:not(.nav-icon):not(.nav-badge) { display: none; }
  .user-name { display: none; }
  .user-menu-wrap { display: none; }
  .mobile-menu-trigger {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
  .user-menu-btn {
    padding: 6px 8px;
    min-height: 44px;
  }
  .logo-text { font-size: 1.1rem; }
  .logo-icon { width: 28px; height: 28px; }
  .main-content {
    padding: 14px 16px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom) + 72px);
  }
  .layout-feed { gap: 20px; }
  .feed-subtitle { margin-top: 4px; font-size: 0.9rem; }
  .page-heading { margin-bottom: 0.25rem; }
  .empty-state { padding: 36px 20px; }
  .empty-state h2 { font-size: 1.15rem; }
  .empty-state p { margin-bottom: 1.25rem; font-size: 0.9375rem; }
  .empty-icon { width: 72px; height: 72px; margin-bottom: 18px; }
  .empty-state .btn { min-width: 180px; }
  .layout-single,
  .layout-profile { padding: 0 4px; }
  .card,
  .sidebar-card {
    padding: 14px 16px;
    margin-bottom: 12px;
  }
  .post-card .post-header {
    padding: 14px 16px 0;
    gap: 10px;
    align-items: center;
  }
  .post-card-from-group .post-header {
    align-items: flex-start;
  }
  .post-card .post-body { padding: 12px 16px; }
  .post-card-from-group .post-author {
    gap: 10px;
    align-items: flex-start;
  }
  .post-card-from-group .post-author-info-group {
    gap: 4px;
  }
  .post-card-from-group .post-author-name {
    font-size: 0.9375rem;
  }
  .post-card-from-group .post-group-byline {
    font-size: 0.75rem;
  }
  .post-time {
    white-space: nowrap;
    font-size: 0.75rem;
  }
  .post-card .post-footer {
    padding: 12px 16px 16px;
    gap: 8px;
  }
  .post-action {
    min-height: 48px;
    min-width: 48px;
    padding: 12px;
    gap: 6px;
  }
  .post-action-icon {
    width: 22px;
    height: 22px;
  }
  .post-content-text { font-size: 1rem; }
  .btn {
    min-height: 44px;
    padding: 12px 20px;
    font-size: 1rem;
  }
  .btn-block { width: 100%; }
  .form-control {
    min-height: 48px;
    padding: 12px 14px;
    font-size: 16px;
  }
  textarea.form-control { min-height: 100px; }
  .page-heading { font-size: 1.35rem; }
  .feed-title { font-size: 1.25rem; }
  .stories-strip { padding: 12px; }
  .story-item { min-width: 64px; }
  .story-username { font-size: 0.7rem; }
  .messages-sidebar {
    border-radius: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .layout-messages {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: calc(100vh - 52px - 60px - env(safe-area-inset-bottom));
    min-height: 300px;
  }
  .messages-sidebar {
    max-height: 35vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
  }
  .messages-main { min-height: 0; }

  /* На мобильных без выбранного чата: скрыть блок «Выберите диалог слева», только список на весь экран */
  .layout-messages.messages-no-chat .messages-main {
    display: none;
  }
  .layout-messages.messages-no-chat {
    grid-template-rows: 1fr;
  }
  .layout-messages.messages-no-chat .messages-sidebar {
    max-height: none;
  }

  /* Полноэкранный чат на мобильных: скрыть список, чат на весь экран */
  .layout-messages.messages-fullscreen-chat {
    grid-template-rows: 1fr;
    height: calc(100vh - 52px - 72px - env(safe-area-inset-bottom));
    min-height: 280px;
  }
  .layout-messages.messages-fullscreen-chat .messages-sidebar {
    display: none;
  }
  .layout-messages.messages-fullscreen-chat .messages-main {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    box-shadow: none;
  }
  .messages-fullscreen-chat .messages-back-link {
    display: flex;
  }
  .messages-fullscreen-chat .messages-header-title {
    min-width: 0;
  }
  body.messages-has-chat .main-content {
    padding: 0;
    max-width: none;
  }
  .messages-list { padding: 12px 10px 16px; gap: 10px; }
  .message-bubble { max-width: 90%; }
  .message-body { padding: 10px 12px 12px; border-radius: 14px 14px 14px 4px; }
  .message-bubble.own .message-body { border-radius: 14px 14px 4px 14px; }
  .message-meta { font-size: 0.65rem; margin-bottom: 4px; }
  .message-form {
    padding: 8px 10px 10px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom) + 6px);
  }
  .message-form-row { gap: 8px; }
  .message-input-bar {
    min-height: 44px;
    padding: 6px 6px 6px 12px;
    border-radius: 22px;
  }
  .message-input-bar .message-attach-btn,
  .message-input-bar .message-voice-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    font-size: 1.1rem;
  }
  .message-input-bar .message-input {
    font-size: 16px;
    padding: 8px 8px;
  }
  .message-send-btn {
    height: 44px;
    min-height: 44px;
    padding: 10px 14px;
    font-size: 0.9375rem;
    border-radius: 22px;
  }
  .voice-message-player {
    max-width: 100%;
    padding: 8px 12px;
    gap: 10px;
    border-radius: 22px;
  }
  .voice-message-play {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
  }
  .voice-message-time { font-size: 0.75rem; }
  .conversation-item a { padding: 14px 12px; }
  .conversation-name { font-size: 0.9375rem; }
  .conversation-preview { font-size: 0.8rem; }
  .conversation-time { font-size: 0.7rem; }
  .conversation-participants-panel { width: 100%; max-width: 100%; }
  .share-toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .active-call-bar { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); padding-bottom: env(safe-area-inset-bottom); }
  .group-header-top { flex-direction: row; gap: 1rem; }
  .group-title { font-size: 1.2rem; max-height: 2.6em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-clamp: 2; }
  .group-meta { font-size: 0.85rem; }
  .group-actions { gap: 0.5rem; }
  .group-actions .btn { min-height: 44px; }
}

@media (max-width: 480px) {
  .header-inner { padding: 0 8px; }
  .main-content { padding: 12px 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom) + 72px); }
  body.messages-has-chat .main-content { padding: 0; }
  .card, .sidebar-card { padding: 12px 14px; }
  .post-card .post-header { padding: 12px 14px 0; gap: 8px; }
  .post-card .post-body { padding: 10px 14px; }
  .post-card .post-footer { padding: 10px 14px 14px; gap: 6px; }
  .post-author-name { font-size: 0.9375rem; }
  .post-author-username { font-size: 0.8125rem; }
  .post-time { font-size: 0.7rem; }
  .feed-title { font-size: 1.15rem; }
  .stories-strip-inner { gap: 12px; }
  .profile-cover-wrap { height: 140px; }
  .profile-avatar-wrap { margin-top: -50px; }
  .profile-avatar-wrap .user-avatar.xlarge { width: 90px; height: 90px; }
  .profile-name { font-size: 1.2rem; }
  .settings-section { padding: 14px 0; }
  .voice-room-actions { flex-direction: column; }
  .voice-room-actions .btn { width: 100%; min-height: 48px; }
  .voice-room-layout { padding: 0.75rem; }
  .voice-room-card { padding: 1rem; }
  .messages-header-actions .group-call-btn { min-height: 44px; padding: 8px 14px; }
  .mobile-bottom-nav a { font-size: 0.6rem; padding: 6px 2px 10px; }
  .empty-state { padding: 28px 16px; }
  .empty-icon { width: 64px; height: 64px; }
  .group-title { font-size: 1.1rem; }
  .group-header-top .user-avatar.large { width: 64px; height: 64px; }
  .post-card-from-group .post-author-name { font-size: 0.9rem; }
  .post-card-from-group .post-group-byline { font-size: 0.7rem; }
}

/* Нижняя навигация на мобильных (дублирует верхнюю для удобства) */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: rgba(10, 10, 15, 0.62);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--glass-border);
  padding: 8px 0;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35), var(--glass-highlight);
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 4px;
  }
}

.mobile-bottom-nav a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px 10px;
  min-height: 56px;
  flex: 1;
  min-width: 0;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}
.mobile-bottom-nav a span:last-of-type:not(.nav-icon):not(.nav-badge) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.mobile-bottom-nav a:hover,
.mobile-bottom-nav a:active { color: var(--text); background: var(--bg-hover); text-decoration: none; }
.mobile-bottom-nav a.active { color: var(--accent); }
.mobile-bottom-nav .nav-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.mobile-bottom-nav .nav-badge {
  position: absolute;
  top: 2px;
  right: 50%;
  transform: translate(50%, 0);
  margin-left: 6px;
  font-size: 0.6rem;
  padding: 1px 4px;
  min-width: 16px;
  text-align: center;
}
.mobile-bottom-nav .nav-link-wrap { position: relative; }

.footer-alt-link {
  text-align: center;
  padding: 8px 12px;
  margin: 0;
  font-size: 0.8125rem;
}
.footer-alt-link a { color: var(--accent); text-decoration: none; }
.footer-alt-link a:hover { text-decoration: underline; }

/* Маркет — объявления пользователей */
.market-listings {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.market-listing {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.market-listing-head { margin-bottom: 4px; }
.market-listing-seller {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.875rem;
}
.market-listing-seller:hover { color: var(--accent); text-decoration: none; }
.market-listing-username { color: var(--text-muted); font-size: 0.8125rem; }
.market-listing-image {
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elevated);
}
.market-listing-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.market-listing-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}
.market-listing-desc {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  flex-grow: 1;
}
.market-listing-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.market-listing-price { font-weight: 600; color: var(--accent); }
.market-listing-your { font-size: 0.8125rem; color: var(--text-muted); }
.market-listing-no-funds { font-size: 0.8125rem; color: var(--text-dim); }
/* Карточка подарка на маркете */
.market-listing-gift .market-listing-gift-visual {
  width: 80px; height: 80px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 8px; overflow: hidden;
  background: var(--bg-elevated);
}
.market-listing-gift .market-listing-gift-img { width: 100%; height: 100%; object-fit: contain; }
.market-listing-gift .market-listing-gift-emoji { font-size: 2rem; }
.market-listing-gift .market-listing-exclusive { border: 2px solid rgba(212, 175, 55, 0.5); }
.market-listing-gift .market-listing-title { display: flex; align-items: baseline; justify-content: center; gap: 4px; flex-wrap: wrap; margin: 0 0 4px; font-size: 1rem; }
.market-listing-exclusive-id { font-size: 0.8125rem; color: var(--text-muted); font-weight: 600; }
/* Форма «Выставить подарок» */
.market-sell-gifts { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.market-sell-gift-option { cursor: pointer; padding: 12px; text-align: center; position: relative; }
.market-sell-gift-option input { position: absolute; top: 8px; left: 8px; }
.market-sell-gift-visual { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 6px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--bg-elevated); }
.market-sell-gift-img { width: 100%; height: 100%; object-fit: contain; }
.market-sell-gift-emoji { font-size: 1.75rem; }
.market-sell-gift-name { display: block; font-weight: 600; font-size: 0.875rem; }
.market-sell-gift-id { font-size: 0.75rem; color: var(--text-muted); }
.market-sell-gift-exclusive { border: 2px solid rgba(212, 175, 55, 0.4); }
.pulses-balance-inline { font-weight: 600; color: var(--accent); }
.gifts-desc { color: var(--text-muted); margin-bottom: 12px; }

@media (min-width: 769px) {
  .main-content { padding-bottom: 24px; }
}

/* ——— Liquid Glass iOS 26: дополнительные слои ——— */
.stories-bar,
.story-ring,
.conversations-list,
.messages-panel,
.notification-item,
.comment-item,
.reaction-picker,
.post-menu-dropdown,
.share-toast {
  border-color: var(--glass-border);
}

.share-toast {
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow);
}

.lightbox-close {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--glass-border);
}

.pulses-balance-block,
.auth-card.card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}

.pulses-balance-value {
  background: linear-gradient(135deg, #409cff, #5e5ce6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.post-action-btn:hover,
.reaction-btn:hover {
  background: var(--bg-hover);
  border-radius: var(--radius-pill);
}

.mobile-bottom-nav a.active {
  color: var(--accent);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* ——— YouTube Shorts (лента + шаринг в чаты) ——— */
body.page-shorts {
  overflow: hidden;
}

body.page-shorts .main-content {
  max-width: none;
  padding: 0;
  margin: 0;
  height: calc(100dvh - 56px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.page-shorts .site-header {
  flex-shrink: 0;
}

.shorts-app {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #000;
}

.shorts-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  padding: 10px 14px 28px;
  text-align: center;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, transparent 100%);
}

.shorts-topbar-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

.shorts-topbar-hint {
  margin: 4px 0 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.75);
}

.shorts-empty {
  margin: 24px 16px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.shorts-viewer {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow-x: hidden;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  background: #000;
  scrollbar-width: none;
}

.shorts-viewer::-webkit-scrollbar {
  display: none;
}

.shorts-track {
  display: block;
}

.shorts-slide {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  height: var(--shorts-slide-h, calc(100dvh - 56px));
  min-height: var(--shorts-slide-h, calc(100dvh - 56px));
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #000;
  overflow: hidden;
}

.shorts-slide-media {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.shorts-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: #111;
  z-index: 0;
}

.shorts-poster.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.shorts-player-mount {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shorts-iframe {
  width: 100%;
  max-width: min(420px, 100vw);
  height: 100%;
  border: 0;
  background: #000;
}

.shorts-slide-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 48px 16px 20px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  pointer-events: none;
  z-index: 2;
}

.shorts-slide-overlay * {
  pointer-events: auto;
}

.shorts-slide-title {
  margin: 0 0 4px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shorts-slide-channel {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.75);
}

.shorts-slide-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.shorts-slide-actions .btn {
  min-height: 44px;
}

.shorts-loading {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  z-index: 4;
  text-align: center;
  padding: 12px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.875rem;
  pointer-events: none;
}

.shorts-loading[hidden] {
  display: none;
}

.shorts-share-overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

.shorts-share-overlay[hidden] {
  display: none;
}

.shorts-share-modal {
  width: 100%;
  max-width: 440px;
  max-height: 75vh;
  display: flex;
  flex-direction: column;
  margin: 0;
}

.shorts-share-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.shorts-share-header h2 {
  margin: 0;
  font-size: 1.125rem;
}

.shorts-share-video-title {
  margin: 0 0 12px;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.shorts-share-chats {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 120px;
  max-height: 50vh;
}

.shorts-share-chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 8px;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.shorts-share-chat-item:hover {
  background: var(--bg-hover);
}

.shorts-share-chat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.shorts-share-chat-info strong {
  font-size: 0.9375rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shorts-share-chat-info span {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.shorts-share-empty {
  padding: 16px;
  color: var(--text-muted);
  text-align: center;
}

.shorts-share-status {
  margin: 10px 0 0;
  font-size: 0.875rem;
  color: var(--accent);
  min-height: 1.25em;
}

@media (max-width: 768px) {
  body.page-shorts .main-content {
    height: calc(100dvh - 56px - 72px);
  }
  body.page-shorts .mobile-bottom-nav {
    z-index: 50;
  }
}

@supports not (backdrop-filter: blur(1px)) {
  .site-header {
    background: rgba(10, 10, 15, 0.88);
  }
  .sidebar-card,
  .card {
    background: rgba(28, 28, 38, 0.85);
  }
  .user-dropdown,
  .search-dropdown,
  .mobile-menu-popup {
    background: rgba(28, 28, 38, 0.92);
  }
  .mobile-bottom-nav {
    background: rgba(10, 10, 15, 0.92);
  }
}
