/* ═══════════════════════════════════════════════════════
   Кимпиньтяо — CSS  |  Syne + DM Sans  |  Dark Emerald
   ═══════════════════════════════════════════════════════ */

:root {
  /* Palette */
  --bg:          #050f0a;
  --bg-2:        #0a1a10;
  --bg-3:        #0f2218;
  --glass:       rgba(15,34,24,0.7);
  --glass-hover: rgba(20,50,35,0.8);
  --border:      rgba(80,200,120,0.15);
  --border-h:    rgba(80,200,120,0.35);

  --accent:      #30c97a;
  --accent-2:    #1e8f55;
  --accent-dark: #0d5533;
  --accent-glow: rgba(48,201,122,0.35);

  --text:        #e4f0e8;
  --text-2:      #8aaF96;
  --text-3:      #4d7560;

  --danger:      #e05252;
  --warning:     #f0a830;
  --info:        #4ab8e0;
  --verified:    #30c97a;

  /* Layout */
  --topbar-h:    58px;
  --nav-h:       66px;
  --radius:      22px;
  --radius-sm:   14px;
  --radius-xs:   8px;

  /* Typography */
  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  /* Shadows */
  --shadow:      0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:   0 12px 48px rgba(0,0,0,0.6);
  --shadow-accent: 0 0 20px var(--accent-glow);
}

/* ─── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  height: 100%;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
button { font-family: var(--font-body); cursor: pointer; border: none; outline: none; }
input, textarea { font-family: var(--font-body); outline: none; }
a { color: var(--accent); text-decoration: none; }
.hidden { display: none !important; }

/* ─── Auth ─────────────────────────────────────────────────── */
.auth-screen {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: var(--bg);
  overflow: hidden;
}

.auth-bg-orbs { position: absolute; inset: 0; pointer-events: none; }
.orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.25;
  animation: orbFloat 8s ease-in-out infinite;
}
.orb-1 { width: 400px; height: 400px; background: var(--accent); top: -100px; left: -100px; animation-delay: 0s; }
.orb-2 { width: 300px; height: 300px; background: #1a6640; bottom: -80px; right: -60px; animation-delay: 3s; }
.orb-3 { width: 200px; height: 200px; background: var(--accent-2); top: 50%; left: 60%; animation-delay: 1.5s; }

@keyframes orbFloat {
  0%, 100% { transform: translate(0,0) scale(1); }
  50%       { transform: translate(20px, 30px) scale(1.1); }
}

.auth-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 380px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 32px;
  padding: 36px 28px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.5s cubic-bezier(0.16,1,0.3,1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-logo {
  display: flex; align-items: center; gap: 8px;
  justify-content: center; margin-bottom: 6px;
}
.logo-text {
  font-family: var(--font-display); font-size: 2rem; font-weight: 800;
  background: linear-gradient(135deg, #6ee7a0, var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.logo-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: var(--shadow-accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.4)} }

.auth-tagline { text-align: center; color: var(--text-2); font-size: 0.9rem; margin-bottom: 28px; }

.field-wrap {
  position: relative; margin-bottom: 12px;
}
.field-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); font-size: 0.9rem; pointer-events: none;
}
.field {
  width: 100%; padding: 14px 16px 14px 42px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.2s, background 0.2s;
}
.field:focus { border-color: var(--accent); background: rgba(48,201,122,0.08); }
.field::placeholder { color: var(--text-3); }

.field-eye {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  background: none; color: var(--text-3); font-size: 0.9rem;
  transition: color 0.2s;
}
.field-eye:hover { color: var(--text); }

.auth-error {
  background: rgba(224,82,82,0.15);
  border: 1px solid rgba(224,82,82,0.4);
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  color: #f87171; font-size: 0.88rem;
  margin-bottom: 12px;
  animation: shake 0.3s ease;
}
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }

.auth-buttons { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }

/* ─── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.95rem;
  transition: all 0.18s;
  border: none; cursor: pointer;
}
.btn:active { transform: scale(0.97); }
.btn-full { width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #020a05;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 6px 24px var(--accent-glow); filter: brightness(1.08); }

.btn-ghost {
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); border-color: var(--border-h); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #c94242; }

.btn-sm { padding: 8px 16px; font-size: 0.85rem; border-radius: var(--radius-xs); }
.btn-icon { padding: 10px; border-radius: var(--radius-xs); }

/* ─── App Shell ────────────────────────────────────────────── */
.app {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
}

/* Topbar */
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center;
  padding: 0 16px;
  background: rgba(5,15,10,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 50;
}
.topbar-logo {
  font-family: var(--font-display); font-weight: 800; font-size: 1.25rem;
  background: linear-gradient(135deg, #6ee7a0, var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-right: auto;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.online-pill {
  display: flex; align-items: center; gap: 5px;
  background: rgba(48,201,122,0.12);
  border: 1px solid rgba(48,201,122,0.25);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.8rem; color: var(--accent); font-weight: 500;
}
.online-dot-live {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.5s ease-in-out infinite;
}

.icon-btn {
  position: relative;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  transition: all 0.2s;
}
.icon-btn:hover { background: var(--glass-hover); color: var(--text); border-color: var(--border-h); }

.avatar-btn { overflow: hidden; padding: 0; }
.avatar-xs {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: white; font-weight: 700;
  overflow: hidden;
}
.avatar-xs img { width: 100%; height: 100%; object-fit: cover; }

/* Badge */
.badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--danger);
  color: white; font-size: 10px; font-weight: 700;
  border-radius: 20px; padding: 2px 5px;
  border: 2px solid var(--bg);
  line-height: 1;
  min-width: 18px; text-align: center;
}
.nav-badge { position: absolute; top: 4px; right: calc(50% - 20px); }

/* Main content */
.main-content {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0;
  scroll-behavior: smooth;
}
.main-content::-webkit-scrollbar { width: 3px; }
.main-content::-webkit-scrollbar-track { background: transparent; }
.main-content::-webkit-scrollbar-thumb { background: var(--accent-dark); border-radius: 3px; }

/* Bottom nav */
.bottom-nav {
  height: var(--nav-h);
  display: flex;
  background: rgba(5,15,10,0.9);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-btn {
  position: relative; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; color: var(--text-3);
  font-size: 0.6rem; font-weight: 600; letter-spacing: 0.02em;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.nav-btn i { font-size: 1.2rem; transition: transform 0.2s; }
.nav-btn:hover { color: var(--text-2); }
.nav-btn.active {
  color: var(--accent);
  background: rgba(48,201,122,0.08);
}
.nav-btn.active i { transform: scale(1.1); }

/* Loader */
.loader-wrap { display: flex; align-items: center; justify-content: center; padding: 60px 0; }
.loader {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--bg-3);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--border-h); }

/* ─── Avatar ───────────────────────────────────────────────── */
.avatar {
  border-radius: 50%; object-fit: cover;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-dark));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: white; flex-shrink: 0;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-40 { width: 40px; height: 40px; font-size: 1rem; }
.avatar-48 { width: 48px; height: 48px; font-size: 1.1rem; }
.avatar-56 { width: 56px; height: 56px; font-size: 1.3rem; }
.avatar-90 { width: 90px; height: 90px; font-size: 2rem; }

/* Frames */
.frame-10min { box-shadow: 0 0 0 3px #fbbf24, 0 0 12px rgba(251,191,36,0.4); }
.frame-100h  { box-shadow: 0 0 0 3px #a78bfa, 0 0 12px rgba(167,139,250,0.4); }
.frame-500h  { box-shadow: 0 0 0 3px #ec489a, 0 0 16px rgba(236,72,153,0.5); animation: framePulse500 2s ease-in-out infinite; }
.frame-1000h { box-shadow: 0 0 0 3px #14b8a6, 0 0 0 6px rgba(20,184,166,0.3), 0 0 20px rgba(20,184,166,0.4); animation: frameGlow1000 1.5s ease-in-out infinite; }

@keyframes framePulse500 {
  0%,100%{ box-shadow:0 0 0 3px #ec489a, 0 0 16px rgba(236,72,153,0.5); }
  50%    { box-shadow:0 0 0 3px #ec489a, 0 0 28px rgba(236,72,153,0.8); }
}
@keyframes frameGlow1000 {
  0%,100%{ box-shadow:0 0 0 3px #14b8a6, 0 0 0 6px rgba(20,184,166,0.3), 0 0 20px rgba(20,184,166,0.4); }
  50%    { box-shadow:0 0 0 3px #14b8a6, 0 0 0 6px rgba(20,184,166,0.5), 0 0 36px rgba(20,184,166,0.7); }
}

/* Online dot */
.online-wrap { position: relative; display: inline-block; }
.online-badge {
  position: absolute; bottom: 2px; right: 2px;
  width: 11px; height: 11px; border-radius: 50%;
  background: #22c55e; border: 2px solid var(--bg);
}

/* Verified badge */
.v-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); color: var(--bg);
  font-size: 9px; font-weight: 800; flex-shrink: 0;
  margin-left: 3px;
}

/* ─── Page layouts ─────────────────────────────────────────── */
.page { padding: 12px; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }

.page-section { margin-bottom: 20px; }
.section-title {
  font-family: var(--font-display); font-size: 0.75rem;
  font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 10px; padding: 0 2px;
}

/* ─── Search bar ───────────────────────────────────────────── */
.search-wrap {
  position: relative; margin-bottom: 14px;
}
.search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); font-size: 0.9rem; pointer-events: none;
}
.search-input {
  width: 100%; padding: 12px 14px 12px 40px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text); font-size: 0.9rem;
  transition: border-color 0.2s, background 0.2s;
}
.search-input:focus { border-color: var(--accent); background: rgba(48,201,122,0.06); }
.search-input::placeholder { color: var(--text-3); }

/* ─── Dialog list ──────────────────────────────────────────── */
.dialog-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.dialog-item:hover, .dialog-item:active { background: var(--glass-hover); }
.dialog-info { flex: 1; min-width: 0; }
.dialog-name {
  font-weight: 600; font-size: 0.95rem;
  display: flex; align-items: center; gap: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dialog-preview {
  color: var(--text-2); font-size: 0.82rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px;
}
.dialog-meta {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0;
}
.dialog-time { color: var(--text-3); font-size: 0.72rem; }
.unread-dot {
  background: var(--accent); color: var(--bg);
  font-size: 10px; font-weight: 700;
  border-radius: 20px; padding: 2px 6px;
  min-width: 18px; text-align: center;
}

/* ─── Chat view ────────────────────────────────────────────── */
.chat-view {
  display: flex; flex-direction: column;
  height: calc(100dvh - var(--topbar-h) - var(--nav-h));
  animation: fadeIn 0.2s ease;
}

.chat-header-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: rgba(5,15,10,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-back { color: var(--text-2); font-size: 1.1rem; padding: 6px; margin-left: -6px; background: none; }
.chat-back:hover { color: var(--accent); }
.chat-name { font-weight: 700; font-size: 1rem; }
.chat-sub  { font-size: 0.75rem; color: var(--text-2); }
.chat-header-actions { margin-left: auto; display: flex; gap: 6px; }

.messages-list {
  flex: 1; overflow-y: auto; padding: 12px 10px;
  display: flex; flex-direction: column; gap: 6px;
  -webkit-overflow-scrolling: touch;
}
.messages-list::-webkit-scrollbar { width: 3px; }
.messages-list::-webkit-scrollbar-thumb { background: var(--accent-dark); border-radius: 3px; }

.msg {
  display: flex; gap: 8px; max-width: 85%; align-items: flex-end;
  animation: msgIn 0.2s ease;
}
@keyframes msgIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }

.msg.out { align-self: flex-end; flex-direction: row-reverse; }

.msg-bubble {
  padding: 9px 14px;
  border-radius: 18px;
  position: relative;
  word-break: break-word;
}
.msg.in .msg-bubble {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.msg.out .msg-bubble {
  background: linear-gradient(135deg, var(--accent-2), var(--accent-dark));
  border-bottom-right-radius: 4px;
}

.msg-sender {
  font-size: 0.72rem; font-weight: 600;
  color: var(--accent); margin-bottom: 3px;
}
.msg-text { font-size: 0.92rem; line-height: 1.45; }
.msg-time {
  font-size: 0.67rem; color: rgba(255,255,255,0.4);
  text-align: right; margin-top: 4px;
}
.msg.out .msg-time { color: rgba(255,255,255,0.5); }

.msg-image {
  max-width: 200px; border-radius: 12px; margin-top: 5px;
  cursor: pointer; transition: opacity 0.2s;
}
.msg-image:hover { opacity: 0.9; }

.msg-audio { max-width: 220px; height: 36px; border-radius: 18px; margin-top: 5px; }

.typing-bubble {
  display: flex; gap: 4px; align-items: center;
  padding: 10px 14px;
}
.typing-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--text-2);
  animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce { 0%,80%,100%{transform:scale(0.8)} 40%{transform:scale(1.2)} }

/* Input area */
.input-area {
  padding: 10px 12px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  background: rgba(5,15,10,0.85);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  display: flex; gap: 8px; align-items: flex-end;
  flex-shrink: 0;
}
.msg-input {
  flex: 1;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 11px 16px;
  color: var(--text); font-size: 0.9rem;
  resize: none; max-height: 120px;
  line-height: 1.4;
  transition: border-color 0.2s;
}
.msg-input:focus { border-color: var(--accent); }
.msg-input::placeholder { color: var(--text-3); }

.send-btn {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--bg); font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 12px var(--accent-glow);
  transition: all 0.15s;
}
.send-btn:active { transform: scale(0.93); }

.attach-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: none; border: 1px solid var(--border);
  color: var(--text-2); display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; flex-shrink: 0;
  transition: all 0.2s;
}
.attach-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ─── Feed / Posts ─────────────────────────────────────────── */
.post-card { margin-bottom: 14px; }

.post-author {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; margin-bottom: 12px;
}
.post-author-info { flex: 1; }
.post-author-name {
  font-weight: 600; font-size: 0.9rem;
  display: flex; align-items: center; gap: 4px;
}
.post-author-time { color: var(--text-3); font-size: 0.75rem; }

.post-text {
  font-size: 0.95rem; line-height: 1.6; color: var(--text);
  margin-bottom: 12px; white-space: pre-wrap; word-break: break-word;
}
.post-image {
  width: 100%; border-radius: var(--radius-sm); margin-bottom: 12px;
  cursor: pointer; transition: opacity 0.2s;
  max-height: 400px; object-fit: cover;
}
.post-image:hover { opacity: 0.9; }

.post-actions {
  display: flex; align-items: center; gap: 6px;
  border-top: 1px solid var(--border); padding-top: 12px;
}
.post-action {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 12px; border-radius: 50px;
  background: none; border: 1px solid transparent;
  color: var(--text-2); font-size: 0.83rem; font-weight: 500;
  transition: all 0.15s;
}
.post-action:hover { background: rgba(255,255,255,0.05); border-color: var(--border); color: var(--text); }
.post-action.liked { color: var(--accent); }
.post-action.disliked { color: var(--warning); }
.post-action i { font-size: 0.85rem; }

.post-compose {
  margin-bottom: 14px; padding: 16px;
  background: var(--glass); border: 1px solid var(--border); border-radius: var(--radius);
}
.compose-row { display: flex; gap: 10px; align-items: flex-start; }
.compose-textarea {
  flex: 1; background: var(--bg-3);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px; color: var(--text); font-size: 0.9rem;
  resize: none; min-height: 60px; max-height: 160px; line-height: 1.5;
  transition: border-color 0.2s;
}
.compose-textarea:focus { border-color: var(--accent); }
.compose-textarea::placeholder { color: var(--text-3); }
.compose-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; }

/* Comments */
.comments-section { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.comment-item { display: flex; gap: 8px; margin-bottom: 10px; }
.comment-body { flex: 1; background: var(--bg-3); border-radius: var(--radius-xs); padding: 8px 12px; }
.comment-author { font-size: 0.8rem; font-weight: 600; color: var(--accent); margin-bottom: 2px; cursor: pointer; }
.comment-text { font-size: 0.88rem; color: var(--text-2); }
.comment-time { font-size: 0.7rem; color: var(--text-3); margin-top: 3px; }
.comment-input-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.comment-input {
  flex: 1; background: var(--bg-3);
  border: 1px solid var(--border); border-radius: 50px;
  padding: 9px 14px; color: var(--text); font-size: 0.85rem;
  transition: border-color 0.2s;
}
.comment-input:focus { border-color: var(--accent); }
.comment-input::placeholder { color: var(--text-3); }

/* Hashtags / mentions */
.hashtag { color: var(--accent); font-weight: 600; cursor: pointer; }
.hashtag:hover { text-decoration: underline; }
.mention { color: var(--info); font-weight: 500; cursor: pointer; }
.mention:hover { text-decoration: underline; }

/* ─── Profile ───────────────────────────────────────────────── */
.profile-banner {
  width: 100%; height: 160px; object-fit: cover;
  border-radius: var(--radius); margin-bottom: -45px;
  background: linear-gradient(135deg, var(--accent-dark), var(--bg-2));
  cursor: pointer;
}
.profile-header {
  padding: 0 16px 16px;
  border-bottom: 1px solid var(--border);
}
.profile-avatar-wrap { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 12px; }
.profile-stats {
  display: flex; gap: 6px; margin: 12px 0;
}
.stat-block {
  flex: 1; text-align: center;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 6px;
}
.stat-val { font-family: var(--font-display); font-size: 1.2rem; font-weight: 800; color: var(--accent); }
.stat-label { font-size: 0.68rem; color: var(--text-3); margin-top: 2px; }

.profile-bio { color: var(--text-2); font-size: 0.9rem; margin-bottom: 12px; }
.profile-name {
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 800;
  display: flex; align-items: center; gap: 6px; margin-bottom: 4px;
}
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* Music player */
.music-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin: 10px 0;
  background: rgba(48,201,122,0.08);
  border: 1px solid rgba(48,201,122,0.2);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.music-icon { color: var(--accent); font-size: 1.1rem; }
.music-label { font-size: 0.85rem; color: var(--text-2); flex: 1; }

/* ─── Chats list ────────────────────────────────────────────── */
.chat-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background 0.15s;
}
.chat-item:hover { background: var(--glass-hover); }
.chat-item-info { flex: 1; min-width: 0; }
.chat-item-name { font-weight: 600; font-size: 0.93rem; }
.chat-item-sub  { color: var(--text-2); font-size: 0.78rem; margin-top: 2px; }
.chat-item-badge { flex-shrink: 0; }

/* ─── Settings ───────────────────────────────────────────────── */
.settings-section { margin-bottom: 20px; }
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 6px;
  cursor: pointer; transition: all 0.15s;
}
.settings-row:hover { border-color: var(--border-h); background: var(--glass-hover); }
.settings-row.active { border-color: var(--accent); background: rgba(48,201,122,0.1); }
.settings-row-label { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.settings-row-label i { color: var(--accent); width: 18px; text-align: center; }
.settings-row-value { color: var(--text-2); font-size: 0.85rem; }

/* Toggle */
.toggle {
  width: 44px; height: 24px; border-radius: 12px;
  background: var(--bg-3); border: 1px solid var(--border);
  position: relative; cursor: pointer; transition: background 0.2s;
  flex-shrink: 0;
}
.toggle.on { background: var(--accent); border-color: var(--accent); }
.toggle-knob {
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: white;
  transition: transform 0.2s;
}
.toggle.on .toggle-knob { transform: translateX(20px); }

/* ─── Modals / Drawers ─────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: overlayIn 0.2s ease;
}
@keyframes overlayIn { from{opacity:0} to{opacity:1} }

.drawer {
  width: 100%; max-width: 480px;
  background: var(--bg-2);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 16px;
  max-height: 80dvh; overflow-y: auto;
  animation: drawerUp 0.3s cubic-bezier(0.16,1,0.3,1);
}
@keyframes drawerUp { from{transform:translateY(100%)} to{transform:translateY(0)} }

.drawer-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: var(--text-3); margin: 0 auto 16px;
}
.drawer-title {
  font-family: var(--font-display); font-weight: 800; font-size: 1.2rem;
  margin-bottom: 16px;
}

/* ─── Toast ─────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 12px); left: 50%; transform: translateX(-50%);
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 50px; padding: 10px 20px;
  font-size: 0.88rem; color: var(--text);
  box-shadow: var(--shadow);
  z-index: 500; white-space: nowrap;
  animation: toastIn 0.25s ease;
  pointer-events: none;
}
@keyframes toastIn { from{opacity:0;transform:translateX(-50%) translateY(8px)} to{opacity:1;transform:translateX(-50%) translateY(0)} }

/* ─── Lightbox ──────────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
}
.lightbox img { max-width: 96%; max-height: 90dvh; border-radius: var(--radius-sm); }

/* ─── Notification panel ────────────────────────────────────── */
.notif-item {
  display: flex; gap: 10px; padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.notif-item:last-child { border-bottom: none; }
.notif-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(48,201,122,0.12);
  border: 1px solid rgba(48,201,122,0.2);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 0.9rem; flex-shrink: 0;
}
.notif-body { flex: 1; }
.notif-text { font-size: 0.88rem; line-height: 1.4; }
.notif-time { font-size: 0.72rem; color: var(--text-3); margin-top: 3px; }
.notif-unread { background: rgba(48,201,122,0.06); }

/* ─── Empty state ───────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 48px 20px;
  color: var(--text-3);
}
.empty-state i { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.4; display: block; }
.empty-state p { font-size: 0.9rem; }

/* ─── Horizontal scroll (channels) ─────────────────────────── */
.hscroll {
  display: flex; gap: 8px;
  overflow-x: auto; padding: 4px 0 8px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.hscroll::-webkit-scrollbar { display: none; }
.pill-btn {
  flex-shrink: 0; padding: 7px 16px; border-radius: 50px;
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-2); font-size: 0.82rem; font-weight: 500;
  white-space: nowrap; cursor: pointer;
  transition: all 0.15s;
}
.pill-btn:hover, .pill-btn.active { background: rgba(48,201,122,0.12); border-color: var(--accent); color: var(--accent); }

/* ─── QR ─────────────────────────────────────────────────────── */
.qr-wrap { display: flex; justify-content: center; padding: 16px; }
.qr-wrap canvas, .qr-wrap img { border-radius: var(--radius-sm); }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (min-width: 480px) {
  .main-content { max-width: 480px; margin: 0 auto; }
}

@media (max-width: 340px) {
  .post-action { padding: 6px 9px; font-size: 0.78rem; }
  .stat-val { font-size: 1rem; }
}

/* ─── Scroll lock utility ────────────────────────────────────── */
.scroll-lock { overflow: hidden; }
