/* ============================================================
   PULSE — Main Stylesheet (cleaned)
   Order:
     1. :root / theme + base
     2. Sidebar
     3. Topbar / header
     4. Main content / Feed
     5. Right panel
     6. Mobile bottom bar
     7. Responsive
     8. Modals, search, profile, extras
   ============================================================ */

/* ========== 1. THEME + BASE ========== */
:root {
  --bg: #f5f7fb;
  --bg-card: #ffffff;
  --bg-hover: #e8ecef;
  --border: #dce1e6;
  --text: #1a1f26;
  --text-muted: #6b7680;
  --accent: #00b4e4;
  --accent-hover: #0096c7;
  --green: #00c853;
  --dropdown-bg: #ffffff;
  --shadow: 0 8px 30px rgba(0,0,0,0.12);
  --sidebar-w: 310px;
  --badge-text: #ffffff;
  --fs-base: 15px;
}
html[data-font-size="small"] { --fs-base: 13px; }
html[data-font-size="medium"] { --fs-base: 15px; }
html[data-font-size="large"] { --fs-base: 17px; }
html {
  font-size: var(--fs-base);
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-text-size-adjust: 100%;
}

[data-theme="dark"] {
  --bg: #0b0f14;
  --bg-card: #12171e;
  --bg-hover: #1a222d;
  --border: #1e2630;
  --text: #e8edf2;
  --text-muted: #8b98a5;
  --accent: #00c2ff;
  --accent-hover: #00a8e0;
  --green: #00d68f;
  --dropdown-bg: #1a222d;
  --shadow: 0 8px 30px rgba(0,0,0,0.45);
  --badge-text: #000000;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
a { cursor: pointer; }
input, select, textarea { font-size: 16px !important; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  width: 100%;
  margin: 0;
  display: block; /* flex body mobile scrollni buzardi */
  font-size: 1rem;
  overflow-x: hidden;
  overflow-y: auto;
  touch-action: manipulation;
  transition: background 0.25s, color 0.25s;
}
/* Modal ochiq bo'lsa scroll qulflanadi — faqat class orqali */
body.modal-open,
html.modal-open {
  overflow: hidden !important;
  touch-action: none;
}
.app {
  display: flex;
  max-width: 1360px;
  margin: 0 auto;
  min-height: 100vh;
  width: 100%;
}

/* ========== 2. SIDEBAR ========== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  padding-top: max(12px, env(safe-area-inset-top, 0px));
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(calc(-50% - 525px));
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: background 0.25s, transform 0.3s ease;
}
.sidebar.open { transform: translateX(0) !important; }

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  padding: 8px 12px 14px;
  letter-spacing: -0.02em;
}
.logo i { font-size: 26px; }
.logo-mark { display: inline-flex; color: var(--accent); line-height: 0; }
.logo-text { color: var(--accent); }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-weight: 700;
}
.nav-item i { width: 22px; text-align: center; font-size: 18px; }
.nav-item .badge {
  background: #3b82f6;
  color: #fff;
  font-size: 11px;
  border-radius: 10px;
  padding: 1px 6px;
  margin-left: 6px;
}

.create-btn {
  width: 100%;
  border: none;
  background: linear-gradient(135deg, #00d4ff 0%, #00a0e3 55%, #0088cc 100%);
  color: #fff;
  border-radius: 999px;
  padding: 13px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  margin: 16px 0;
  box-shadow: 0 8px 22px rgba(0, 176, 228, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.create-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 40%, transparent);
}
.create-btn-ghost {
  background: transparent !important;
  color: var(--accent) !important;
  border: 1.5px solid color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: none !important;
  margin-top: 8px;
}

.online-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
  min-height: 70px;
  overflow: hidden;
}
[data-theme="dark"] .online-box {
  background: color-mix(in srgb, var(--bg-card) 92%, #0a0e14);
  box-shadow: 0 4px 18px rgba(0,0,0,.22);
}
.online-box .ob-left { min-width: 0; flex: 1; }
.online-box .ob-title { display: flex; align-items: center; gap: 7px; margin-bottom: 2px; }
.online-box .ob-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }
.online-box .ob-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,.22);
  flex-shrink: 0;
}
.online-box .ob-num {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.online-box .ob-sub { font-size: 0.7rem; color: var(--text-muted); margin-top: 1px; }
.online-box .ob-wave {
  flex-shrink: 0;
  color: var(--accent);
  line-height: 0;
  width: 64px;
  max-width: 64px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.online-box .ob-wave svg { display: block; width: 64px; height: 28px; max-width: 100%; }

.sidebar-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.theme-cycle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.theme-cycle-btn:hover { background: var(--bg-hover); }
.theme-cycle-btn i { color: var(--accent); font-size: 0.95rem; }
.sidebar-tools .lang-switch { margin: 0; flex-shrink: 0; }

.lang-switch {
  display: inline-flex;
  gap: 4px;
  background: var(--bg-hover, #f1f5f9);
  border-radius: 999px;
  padding: 3px;
  margin: 10px 0;
}
.lang-btn {
  min-width: 40px;
  text-align: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
}
.lang-btn.active { background: #2563eb; color: #fff; }
.sidebar-lang { margin: 8px 4px; }

.sidebar-footer {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
  padding: 0 4px 8px;
}
.sidebar-footer a { color: var(--text-muted); text-decoration: none; }
.sidebar-footer a:hover { color: var(--accent); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 90;
}
.sidebar-overlay.show {
  display: block !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* ========== 3. TOPBAR ========== */
.main-wrap {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  padding-top: max(10px, env(safe-area-inset-top, 0px));
  padding-bottom: 10px;
  min-height: 52px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 12px;
}

.mobile-brand { display: none; align-items: center; gap: 10px; }
.mobile-brand .logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
}
.hamburger {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hamburger:hover { background: var(--bg-hover); }

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  color: inherit;
  position: relative;
}
.brand-link .brand-wave {
  color: #3b82f6;
  flex-shrink: 0;
  width: 28px;
  height: 14px;
}
.brand-link .brand-name {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
  color: #0f172a;
  line-height: 1;
}
html.dark .brand-link .brand-name,
[data-theme="dark"] .brand-link .brand-name { color: #f8fafc; }
.brand-premium {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 2px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #3b82f6;
  line-height: 1;
  white-space: nowrap;
  position: relative;
  top: -7px;
}
.brand-premium .bp-star { font-size: 8px; line-height: 1; }

.search-box {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.search-box i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}
.search-box input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 11px 18px 11px 44px;
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.search-box input:focus { border-color: var(--accent); }

.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}
.top-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: transparent;
  border: none;
  color: #1a1f26;
  font-size: 17px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  box-shadow: none !important;
}
.top-btn:hover { background: var(--bg-hover); color: #1a1f26; }
[data-theme="dark"] .top-btn { color: var(--text); }
[data-theme="dark"] .top-btn:hover { color: var(--text); }
a.top-btn:hover, a.top-btn:focus, a.top-btn:active {
  text-decoration: none !important;
}
.top-btn .badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #3b82f6;
  color: #fff;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  font-weight: 700;
}

/* Avatar + online + premium */
.avatar-wrap {
  position: relative;
  display: inline-block;
  cursor: pointer;
}
.avatar-wrap.pc-only { margin-left: 4px; }
.user-avatar,
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  display: block;
}

/* Online status — single compact green dot */
.online-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  background: #22c55e;
  border: 1px solid var(--bg-card, #fff);
  border-radius: 50%;
  z-index: 5;
  box-shadow: none;
  animation: none;
  pointer-events: none;
  display: block;
  box-sizing: border-box;
}
.online-dot .online-dot { display: none !important; }
.post-header .online-dot,
.list-item .online-dot,
.create-post .online-dot {
  border-width: 1px;
  bottom: 1px;
  right: 1px;
}
/* Katta profil avatari: yarmi ichida, yarmi tashqarida */
.pf-avatar-wrap .online-dot,
.pf-avatar-box .online-dot,
.big-avatar-wrap .online-dot,
.profile-card .online-dot,
.rp-av-wrap .online-dot {
  width: 14px;
  height: 14px;
  bottom: 5px;
  right: 10px;
  border-width: 1.5px;
}

/* Premium ✦ — chap yuqori (chat tomon), fon yo'q */
.premium-star,
.premium-plus {
  position: absolute;
  top: -2px;
  left: -2px;
  right: auto;
  z-index: 7;
  border: none !important;
  background: none !important;
  box-shadow: none !important;
  color: #3b82f6 !important;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  display: block !important;
  pointer-events: none;
  text-shadow: 0 0 2px #fff, 0 0 3px #fff, 0 1px 2px rgba(255,255,255,.9);
}
.pf-avatar-wrap .premium-star,
.pf-avatar-box .premium-star,
.big-avatar-wrap .premium-star {
  top: 3px;
  left: 4px;
  right: auto;
  font-size: 18px;
}
.post-header .premium-star,
.avatar-wrap .premium-star {
  top: -3px;
  left: -2px;
  right: auto;
  font-size: 14px;
}
.nick-premium { display: none !important; }

/* Avatar wrap overflow — belgi kesilmasin */
.avatar-wrap,
.post-header .avatar-wrap,
.pf-avatar-wrap,
.pf-avatar-box,
.big-avatar-wrap {
  overflow: visible !important;
}

.presence-status,
.dx-th-status {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.2;
}
.presence-status.on,
.dx-th-status.on { color: #22c55e; font-weight: 600; }
.presence-status.off,
.dx-th-status.off { color: var(--text-muted); font-weight: 400; }

.avatar-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--dropdown-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  min-width: 180px;
  box-shadow: var(--shadow);
  z-index: 60;
  overflow: hidden;
  animation: dropIn 0.18s ease;
}
.avatar-menu.show { display: block; }
.avatar-menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
  padding: 12px 16px;
  cursor: pointer;
  text-align: left;
}
.avatar-menu button:hover { background: var(--bg-hover); }
.avatar-menu button.danger { color: #f85149; }
.avatar-menu button i { width: 18px; text-align: center; }

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ========== 4. MAIN / FEED ========== */
.content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  padding: 18px 20px 40px;
  align-items: start;
  width: 100%;
}
.content.content-full { grid-template-columns: minmax(0, 1fr); }

.feed {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  transition: background 0.25s, border-color 0.25s;
}

/* Flat feed posts */
.feed .card.post,
.profile-feed .card.post,
.feed-list .card.post {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--border);
  margin: 0;
  box-shadow: none;
  background: var(--bg-card);
  padding: 12px 16px 10px;
}

.create-post { display: flex; gap: 12px; }
.create-post .avatar-wrap { flex-shrink: 0; }
.create-post .avatar { width: 44px; height: 44px; }
.create-post-body { flex: 1; min-width: 0; }
.create-post-body input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 15px;
  outline: none;
  padding: 8px 0 14px;
}
.create-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  padding: 7px 10px;
  border-radius: 10px;
  cursor: pointer;
}
.action-btn:hover { background: var(--bg-hover); color: var(--text); }
.impulse-btn {
  margin-left: auto;
  background: linear-gradient(135deg, #00d4ff, #00a8e0);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.post { position: relative; }
.post-body { margin-left: 52px; }
.post-stats { margin-left: 52px; }

.post-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.post-header .avatar-wrap { flex-shrink: 0; position: relative; }
.post-header .avatar { width: 42px; height: 42px; }
.post-user { flex: 1; min-width: 0; }
.post-user .name {
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
}
.post-user .meta { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

.post-menu-wrap { position: relative; flex-shrink: 0; }
.post-menu-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  line-height: 1;
}
.post-menu-btn:hover { background: var(--bg-hover); color: var(--text); }
.post-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: var(--dropdown-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  min-width: 180px;
  box-shadow: var(--shadow);
  z-index: 30;
  overflow: hidden;
  animation: dropIn 0.18s ease;
}
.post-dropdown.show { display: block; }
.post-dropdown button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
  padding: 12px 16px;
  cursor: pointer;
  text-align: left;
}
.post-dropdown button:hover { background: var(--bg-hover); }
.post-dropdown button i { width: 18px; text-align: center; font-size: 14px; }
.post-dropdown button.danger { color: #f85149; }

.post-content {
  font-size: 15px;
  line-height: 1.55;
  margin-bottom: 8px;
  word-wrap: break-word;
}
.post-content.clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.read-more {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-bottom: 10px;
}
.read-more:hover { text-decoration: underline; }

.post-stats {
  display: flex;
  gap: 28px;
  color: var(--text-muted);
  align-items: center;
  margin-top: 10px;
  padding-top: 2px;
  flex-wrap: wrap;
}
.post-stats span {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.post-stats span:hover { color: var(--accent); }
.post-stats .bookmark { margin-left: auto; }
.post-stats-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 22px;
  padding-right: 4px;
}
.like-btn.liked,
.like-btn.liked i { color: #f43f5e; }
.like-count { cursor: pointer; margin-left: 2px; }
.like-count:hover { text-decoration: underline; }
.save-btn.saved i { color: var(--text); }
.save-btn:hover { opacity: 0.8; }
.views-count { margin-left: auto; margin-right: 12px; color: var(--text-muted); font-size: 15px; }

/* Feed tabs */
.feed-tabs {
  display: flex;
  gap: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg);
  position: sticky;
  top: 52px;
  z-index: 40;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg-card) 88%, transparent);
  box-shadow: 0 1px 0 var(--border);
}
.feed-tab {
  flex: 1;
  text-align: center;
  padding: 14px 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  position: relative;
  background: transparent;
  border: none;
}
.feed-tab.active { color: var(--accent); }
.feed-tab.active::after {
  content: '';
  position: absolute;
  left: 16%;
  right: 16%;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--accent);
}

.hash-link { color: var(--accent); text-decoration: none; }
.hash-link:hover { text-decoration: underline; }
.size15 { font-size: 15px; }
.accent { color: var(--accent); }

/* Carousel / double-tap */
.carousel {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  margin-top: 6px;
}
.dbl-heart {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transform: scale(.4);
}
.dbl-heart.show { animation: heartPop .8s ease forwards; }
.dbl-heart i {
  font-size: 80px;
  color: #fff;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.4));
}
@keyframes heartPop {
  0% { opacity: 0; transform: scale(.3); }
  15% { opacity: 1; transform: scale(1.2); }
  30% { transform: scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: scale(1); }
}

/* Likers stack */
.likers-stack {
  display: block;
  position: relative;
  width: 36px;
  height: 32px;
  margin-left: -52px;
  cursor: pointer;
  flex-shrink: 0;
}
.likers-stack .liker-av {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg-card);
  background: var(--bg-hover);
  box-sizing: border-box;
}
.likers-stack .liker-av:only-child { left: 8px; top: 6px; z-index: 1; }
.likers-stack .liker-av:nth-child(1):nth-last-child(2) { left: 0; top: 6px; z-index: 2; }
.likers-stack .liker-av:nth-child(2):nth-last-child(1) { left: 14px; top: 6px; z-index: 1; }
.likers-stack .liker-av:nth-child(1):nth-last-child(3) { left: 8px; top: 0; z-index: 3; }
.likers-stack .liker-av:nth-child(2):nth-last-child(2) { left: 0; top: 12px; z-index: 2; }
.likers-stack .liker-av:nth-child(3):nth-last-child(1) { left: 16px; top: 12px; z-index: 1; }
.likers-stack:hover .liker-av { border-color: var(--accent); }

.comment-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 2px 50px;
  padding: 6px 12px;
  background: var(--bg-hover);
  border-radius: 18px;
  cursor: pointer;
  max-width: calc(100% - 50px);
  transition: background 0.15s;
  box-sizing: border-box;
}
.comment-preview:hover {
  background: color-mix(in srgb, var(--bg-hover) 80%, var(--accent) 8%);
}
.comment-preview .cp-av {
  width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.comment-preview .cp-body {
  flex: 1; min-width: 0; font-size: 13px; line-height: 1.3;
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.comment-preview .cp-name { font-weight: 600; margin-right: 4px; }
.comment-preview .cp-pin { color: var(--accent); font-size: 11px; margin-right: 4px; }
.comment-preview .cp-text { color: var(--text-muted); }

/* Sensitive */
.post-body-wrap { position: relative; }
.post.is-sensitive { position: relative; overflow: hidden; }
.post.is-sensitive .post-header,
.post.is-sensitive .post-body,
.post.is-sensitive .post-stats,
.post.is-sensitive .carousel,
.post.is-sensitive .post-content {
  filter: blur(28px);
  transform: scale(1.04);
  pointer-events: none;
  user-select: none;
}
.post.is-sensitive .sensitive-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: block;
  margin: 0;
  padding: 0;
  border-radius: inherit;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.22);
  overflow: hidden;
}
.post.is-sensitive .sensitive-overlay canvas.sens-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.sensitive-reveal {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 22;
  border: none;
  border-radius: 999px;
  padding: 11px 18px;
  background: rgba(20, 20, 24, 0.82);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
  pointer-events: auto;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.sensitive-reveal:active { transform: translate(-50%, -50%) scale(0.97); }

/* Repost */
.repost-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 2px;
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.3;
}
.repost-label .ri {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-size: 11px;
  flex-shrink: 0;
}
.repost-label a { color: inherit; text-decoration: none; font-weight: 700; }
.repost-label a:hover { color: var(--accent); }
.post.is-repost .post-header { padding-top: 6px; }

/* Stats share card */
.pulse-stats-card {
  margin: 8px 0 4px;
  background: radial-gradient(ellipse at 50% 18%, #1e3a5f 0%, #0a0e17 55%, #05070c 100%);
  border-radius: 18px;
  padding: 22px 16px 16px;
  text-align: center;
  color: #e8eef8;
  border: 1px solid rgba(59,130,246,.35);
  box-shadow: 0 0 28px rgba(37,99,235,.2), inset 0 0 40px rgba(37,99,235,.06);
}
.pulse-stats-card .psc-brand { font-size: 13px; font-weight: 700; color: #60a5fa; margin-bottom: 14px; }
.pulse-stats-card .psc-av {
  width: 84px; height: 84px; border-radius: 50%; object-fit: cover;
  border: 3px solid #3b82f6; box-shadow: 0 0 20px rgba(59,130,246,.5);
}
.pulse-stats-card .psc-name { font-size: 18px; font-weight: 800; margin-top: 12px; color: #fff; }
.pulse-stats-card .psc-un { font-size: 13px; color: #94a3b8; }
.pulse-stats-card .psc-title { color: #60a5fa; font-size: 13px; margin: 10px 0 14px; font-weight: 600; }
.pulse-stats-card .psc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; text-align: left; }
.pulse-stats-card .psc-grid div {
  background: rgba(15,23,42,.65);
  border: 1px solid rgba(59,130,246,.25);
  border-radius: 12px; padding: 10px 12px;
}
.pulse-stats-card .psc-grid b { display: block; font-size: 17px; color: #fff; }
.pulse-stats-card .psc-grid span { font-size: 11px; color: #94a3b8; }
.pulse-stats-card .psc-wave {
  height: 26px; margin: 14px 0 6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 30'%3E%3Cpath d='M0 20 Q25 5 50 18 T100 15 T150 20 T200 12' fill='none' stroke='%233b82f6' stroke-width='2'/%3E%3C/svg%3E") center/contain no-repeat;
}
.pulse-stats-card .psc-foot { font-size: 12px; color: #94a3b8; }
.pulse-stats-card .psc-foot small { color: #64748b; }

/* ========== 5. RIGHT PANEL ========== */
.right-col {
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  overflow-x: hidden;
  display: none;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 72px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
@media (min-width: 1001px) {
  .right-col,
  .right-panel { display: flex; }
}
.right-col::-webkit-scrollbar { width: 5px; }
.right-col::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.section-title a {
  color: var(--accent);
  font-size: 12px;
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.list-item .avatar-wrap { position: relative; flex-shrink: 0; }
.list-item .avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.list-item .info { flex: 1; min-width: 0; }
.list-item .info .name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item .info .meta { font-size: 11px; color: var(--text-muted); }

.follow-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--accent);
  border-radius: 16px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.follow-btn:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.close-x {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 4px;
}
.channel-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.trend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.trend-item i { color: var(--accent); font-size: 14px; }
.trend-item .info { flex: 1; }
.trend-item .title { font-size: 13px; font-weight: 600; }
.trend-item .count { font-size: 11px; color: var(--text-muted); }

/* ========== 6. MOBILE BOTTOM BAR ========== */
.bottom-bar {
  display: none;
  position: fixed;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(0);
  width: min(420px, calc(100% - 28px));
  background: color-mix(in srgb, var(--bg-card, #fff) 88%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid color-mix(in srgb, var(--border, #e5e7eb) 70%, transparent);
  border-radius: 28px;
  padding: 6px 8px;
  z-index: 1000;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 8px 28px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.06);
  transition: transform .34s cubic-bezier(.22,1,.36,1), opacity .3s ease, visibility .3s;
  will-change: transform, opacity;
}
.bottom-bar.bb-hidden {
  transform: translateX(-50%) translateY(130%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
[data-theme="dark"] .bottom-bar {
  background: color-mix(in srgb, #1a1b22 82%, transparent);
  border-color: rgba(255,255,255,.08);
  box-shadow: 0 10px 32px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.25);
}

html[data-bottom-bar="classic"] .bottom-bar {
  left: 0; right: 0; bottom: 0;
  transform: none;
  width: 100%;
  max-width: none;
  border-radius: 0;
  border: none;
  border-top: 1px solid var(--border, #e5e7eb);
  background: var(--bg-card, #fff);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
}
html[data-bottom-bar="classic"] .bottom-bar.bb-hidden {
  transform: translateY(110%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
[data-theme="dark"] html[data-bottom-bar="classic"] .bottom-bar,
html[data-bottom-bar="classic"][data-theme="dark"] .bottom-bar {
  background: var(--bg-card, #1a1b22);
  border-top-color: var(--border, rgba(255,255,255,.08));
}

.bottom-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 9px;
  font-weight: 500;
  padding: 4px 6px;
  min-width: 48px;
  position: relative;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.bottom-item span:not(.badge) {
  line-height: 1.1;
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bottom-item i { font-size: 1.25rem; font-weight: 400; }
.bottom-item.active { color: var(--accent); }
.bottom-item .badge {
  position: absolute;
  top: 2px;
  left: 50%;
  right: auto;
  transform: translateX(6px);
  min-width: 17px;
  height: 17px;
  line-height: 17px;
  border-radius: 999px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 700;
  background: #3b82f6;
  color: #fff;
  text-align: center;
  box-sizing: border-box;
  z-index: 2;
}

.bottom-item.create-center {
  margin-top: -18px;
  color: #fff;
  min-width: 58px;
}
html[data-bottom-bar="classic"] .bottom-item.create-center { margin-top: -10px; }
.create-fab {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: #1a9fff;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(26, 159, 255, 0.45);
  cursor: pointer;
  text-decoration: none;
  position: relative;
  z-index: 2;
}
.create-fab .fab-pulse { color: #fff; display: block; }
.create-fab:active { transform: scale(0.92); }

.side-create-fab {
  display: none;
  position: fixed;
  right: 16px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), var(--accent-hover, #1d4ed8));
  color: #fff;
  border: none;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  z-index: 1001;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 45%, transparent);
  cursor: pointer;
  text-decoration: none;
  opacity: 0;
  transform: scale(.6) translateY(12px);
  pointer-events: none;
  transition: opacity .28s ease, transform .32s cubic-bezier(.22,1,.36,1);
}
.side-create-fab.sc-show {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}
.side-create-fab:active { transform: scale(.92); }
html[data-bottom-bar="classic"] .side-create-fab { display: none !important; }

/* ========== 7. RESPONSIVE ========== */
@media (max-width: 1200px) {
  .sidebar { left: 0; transform: none; }
  .app { max-width: none; }
}
@media (max-width: 1000px) {
  .content { grid-template-columns: 1fr !important; }
  .right-col, .right-panel { display: none !important; }
}
@media (max-width: 768px) {
  .sidebar {
    left: 0;
    transform: translateX(-100%);
    width: 280px;
    padding-bottom: 100px;
  }
  .sidebar.open { transform: translateX(0); }
  .main-wrap {
    margin-left: 0;
    padding-bottom: 78px;
    max-width: none;
  }
  .bottom-bar { display: flex !important; }
  .topbar {
    padding: 10px 12px;
    padding-top: max(8px, env(safe-area-inset-top, 0px));
    padding-bottom: 8px;
  }
  .content { padding: 12px 0; }
  .search-box { display: none; }
  .mobile-brand { display: flex; }
  .top-actions .pc-only { display: none; }
  .top-actions .mobile-only { display: flex; }

  .mobile-brand .brand-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
  }
  .mobile-brand .brand-wave { color: #00a8e0; }
  .mobile-brand .brand-name {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #0b1b2b;
  }
  [data-theme="dark"] .mobile-brand .brand-name { color: #e8edf2; }
  .brand-premium { font-size: 7px; top: -6px; letter-spacing: 0.1em; }

  .top-actions .top-btn { color: #0b1b2b; width: 40px; height: 40px; }
  [data-theme="dark"] .top-actions .top-btn { color: var(--text); }

  .post-body { margin-left: 50px; }
  .post-stats { margin-left: 50px; gap: 28px; margin-top: 8px; padding-bottom: 4px; }
  .comment-preview { margin-left: 50px; max-width: calc(100% - 50px); }

  .feed-tabs {
    top: calc(54px + env(safe-area-inset-top, 0px));
    background: var(--bg-card);
  }
  .profile-tabs {
    top: calc(54px + env(safe-area-inset-top, 0px));
  }
  .feed .card.post,
  .profile-feed .card.post {
    padding: 12px 14px 8px;
  }
  .feed-composer,
  .pc-only-composer { display: none !important; }

  html[data-bottom-bar="ios"] .side-create-fab { display: flex; }
  html[data-bottom-bar="ios"] body,
  html[data-bottom-bar="ios"] .main-wrap { padding-bottom: 24px !important; }
  html[data-bottom-bar="classic"] body,
  html[data-bottom-bar="classic"] .main-wrap { padding-bottom: 72px !important; }
}
@media (min-width: 769px) {
  .top-actions .mobile-only { display: none; }
  .comment-preview { margin-left: 52px; max-width: calc(100% - 52px); }
  .feed .card.create-post.feed-composer {
    border-radius: 16px;
    border: 1px solid var(--border);
    margin: 12px 0;
  }
}
@media (max-width: 380px) {
  .brand-link .brand-name { font-size: 14px; }
  .brand-premium { font-size: 7px; top: -6px; }
  .pf-btn { font-size: 11px; padding: 8px 4px; gap: 4px; }
  .pf-name { font-size: 18px; }
  .pf-avatar-wrap, .pf-avatar { width: 64px; height: 64px; }
}

/* ========== 8. MODALS / SEARCH / PROFILE / EXTRAS ========== */
.comment-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1500;
  align-items: flex-end;
  justify-content: center;
}
.comment-modal.show { display: flex; }
.comment-modal-box {
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.25s ease;
}
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.comment-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}
.comment-modal-header button {
  background: none; border: none; color: var(--text); font-size: 20px; cursor: pointer;
}
.comment-modal-list { flex: 1; overflow-y: auto; padding: 12px 16px; }
.comment-item { display: flex; gap: 10px; margin-bottom: 14px; }
.comment-item img {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.comment-body { font-size: 14px; line-height: 1.4; }
.comment-modal-form {
  display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border);
}
.comment-modal-form input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 10px 14px;
  color: var(--text);
  outline: none;
  font-size: 14px;
}
.comment-modal-form button {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-weight: 700;
  cursor: pointer;
}
@media (min-width: 769px) {
  .comment-modal { align-items: center; }
  .comment-modal-box { border-radius: 16px; max-height: 70vh; }
}

/* Post modal */
.post-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1600;
  align-items: flex-end;
  justify-content: center;
}
.post-modal.show { display: flex; }
.post-modal-box {
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: auto;
  padding: 0 0 20px;
  animation: slideUp .25s ease;
}
.post-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  position: sticky;
  top: 0;
  background: var(--bg-card);
}
.post-modal-header button {
  background: none; border: none; color: var(--text); font-size: 20px; cursor: pointer;
}
.pm-title, .pm-body, .pm-custom {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  padding: 12px 18px;
  outline: none;
  font-size: 15px;
  box-sizing: border-box;
}
.pm-body { resize: none; min-height: 80px; }
.pm-section-label {
  padding: 10px 18px 4px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.pm-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 18px 10px; }
.pm-tag {
  font-size: 12px;
  background: var(--bg-hover);
  padding: 5px 12px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}
.pm-tag input { accent-color: var(--accent); }
.pm-tag:has(input:checked) {
  background: color-mix(in srgb, var(--accent) 25%, transparent);
  color: var(--accent);
  font-weight: 600;
}
.pm-preview { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 18px 8px; }
.pm-actions { display: flex; justify-content: space-between; align-items: center; padding: 8px 18px; }

.post-compose { padding-bottom: 24px; }
.pm-back { background: none; border: none; color: var(--text); font-size: 18px; cursor: pointer; }
.pm-big-body {
  width: 100%;
  min-height: 180px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 17px;
  line-height: 1.45;
  padding: 16px 18px;
  outline: none;
  resize: none;
  box-sizing: border-box;
}
.pm-counter { text-align: right; padding: 0 18px 8px; font-size: 12px; color: var(--text-muted); }
.pm-hint { padding: 0 18px 12px; font-size: 13px; color: var(--text-muted); margin: 0; }
.pm-media-row { display: flex; gap: 8px; padding: 0 18px 8px; }
.pm-media-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.pm-sensitive {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 18px 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, #3b82f6 8%, var(--bg));
  border: 1px solid color-mix(in srgb, #3b82f6 25%, var(--border));
  font-size: 14px;
  font-weight: 600;
}
.pm-switch { margin-left: auto; position: relative; width: 44px; height: 26px; }
.pm-switch input { opacity: 0; width: 0; height: 0; }
.pm-slider {
  position: absolute; inset: 0;
  background: #cbd5e1;
  border-radius: 26px;
  cursor: pointer;
  transition: .2s;
}
.pm-slider::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
}
.pm-switch input:checked + .pm-slider { background: #3b82f6; }
.pm-switch input:checked + .pm-slider::before { transform: translateX(18px); }
.pm-sw-label { font-size: 12px; color: var(--text-muted); font-weight: 500; min-width: 70px; }
.pm-publish {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 36px);
  margin: 0 18px;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: #3b82f6;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.pm-publish:hover { filter: brightness(1.05); }
@media (min-width: 769px) {
  .post-modal { align-items: center; }
  .post-modal-box { border-radius: 16px; max-height: 80vh; }
}

/* Toast */
.toast-success {
  background: color-mix(in srgb, var(--green) 20%, var(--bg-card));
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 12px;
  font-weight: 600;
  transition: opacity .4s;
}

/* Profile */
.profile-card .profile-stats { display: flex; justify-content: center; gap: 24px; }
.profile-card .stat { text-align: center; }
.profile-card .stat .num { font-size: 18px; font-weight: 700; }
.profile-card .stat .label { font-size: 14px; color: var(--text-muted); }

.profile-tabs {
  display: flex;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 0 0 12px;
  background: var(--bg-card);
  position: sticky;
  top: 52px;
  z-index: 30;
}
.profile-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  border-top: 2px solid transparent;
  margin-top: -1px;
}
.profile-tab i { font-size: 18px; }
.profile-tab.active { color: var(--text); border-top-color: var(--text); }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}
.photo-grid-item {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 4px;
  background: var(--bg-hover);
  cursor: pointer;
  position: relative;
}
.photo-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 0 2px 12px;
}
@media (min-width: 768px) {
  .video-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}
.video-grid .photo-grid-item,
.video-grid > a,
.video-grid > div {
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #0f0f12;
}

.media-subtabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin: 8px 12px 12px;
  background: var(--bg-hover, #f1f5f9);
  border-radius: 14px;
}
.media-subtabs a {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
}
.media-subtabs a.active {
  background: #fff;
  color: #2563eb;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
[data-theme="dark"] .media-subtabs a.active,
body.dark .media-subtabs a.active {
  background: var(--bg-card, #1e293b);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.stats-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
}
.stats-item .num { font-size: 22px; font-weight: 700; }
.stats-item .label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.pf-card { padding: 18px 16px 16px !important; text-align: left !important; }
.pf-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pf-info { flex: 1; min-width: 0; }
.pf-name {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pf-handle { margin-top: 4px; font-size: 15px; color: var(--text-muted); }
.pf-counts { margin-top: 10px; font-size: 14px; color: var(--text-muted); }
.pf-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 76px;
  height: 76px;
  overflow: visible;
}
.pf-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.pf-bio { margin-top: -16px; font-size: 15px; font-weight: 600; color: var(--text); }
.pf-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 14px;
  color: #3b82f6;
  text-decoration: none;
  word-break: break-all;
}
.pf-stats-row {
  display: flex !important;
  justify-content: space-around !important;
  gap: 8px;
  margin: 18px 0 14px !important;
  text-align: center;
}
.pf-stats-row .num { font-weight: 800; font-size: 20px; color: var(--text); }
.pf-stats-row .label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.pf-actions { display: flex; gap: 8px; width: 100%; }
.pf-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card, #fff);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
}
.pf-btn i { font-size: 12px; opacity: 0.85; }
.pf-btn-primary { background: #3b82f6; border-color: #3b82f6; color: #fff; }

/* Share sheet */
.share-overlay { align-items: flex-end; background: rgba(0,0,0,.45); }
.share-overlay.show { display: flex; }
.share-sheet {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  background: var(--bg-card, #fff);
  border-radius: 20px 20px 0 0;
  padding: 18px 18px 28px;
  box-shadow: 0 -8px 40px rgba(0,0,0,.12);
  max-height: 92vh;
  overflow-y: auto;
  animation: shareUp .28s ease;
}
@keyframes shareUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@media (min-width: 768px) {
  .share-overlay { align-items: center; }
  .share-sheet { border-radius: 20px; margin: 24px; max-width: 380px; }
}
.share-sheet-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.share-title { font-size: 18px; font-weight: 700; color: var(--text); }
.share-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; line-height: 1.35; }
.share-close {
  width: 36px; height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--bg-hover, #f3f4f6);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.share-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-hover, #f5f5f7);
  border-radius: 14px;
  margin-bottom: 20px;
}
.share-av { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.share-name { font-weight: 700; font-size: 15px; color: var(--text); }
.share-handle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.share-qr-wrap { display: flex; justify-content: center; margin: 8px 0 12px; }
.share-qr {
  width: 220px; height: 220px;
  background: #fff;
  border-radius: 12px;
  padding: 8px;
  box-sizing: border-box;
}
.share-qr-label { text-align: center; font-weight: 700; font-size: 18px; color: var(--text); }
.share-qr-hint { text-align: center; font-size: 13px; color: var(--text-muted); margin: 6px 0 22px; }
.share-actions { display: flex; justify-content: space-around; gap: 12px; padding: 0 12px; }
.share-act {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
}
.share-act i {
  font-size: 22px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-hover, #f3f4f6);
}
.share-act:active i { transform: scale(0.95); }

/* Followers list */
.fl-overlay {
  align-items: flex-end;
  background: rgba(0,0,0,.45);
  z-index: 200;
}
.fl-overlay.show { display: flex; }
.fl-sheet {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-card, #fff);
  border-radius: 16px 16px 0 0;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  animation: shareUp .25s ease;
}
@media (min-width: 768px) {
  .fl-overlay { align-items: center; }
  .fl-sheet { border-radius: 16px; max-height: 80vh; }
}
.fl-handle {
  width: 36px; height: 4px; border-radius: 4px;
  background: #d1d5db; margin: 8px auto 4px;
}
.fl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 10px;
}
.fl-back {
  width: 36px; height: 36px;
  border: none; background: none;
  color: var(--text); font-size: 18px; cursor: pointer;
}
.fl-title { font-weight: 700; font-size: 16px; }
.fl-tabs { display: flex; border-bottom: 1px solid var(--border); }
.fl-tab {
  flex: 1;
  border: none;
  background: none;
  padding: 12px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.fl-tab.active { color: var(--text); border-bottom-color: var(--text); }
.fl-search-wrap {
  margin: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-hover, #f3f4f6);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text-muted);
}
.fl-search-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  color: var(--text);
  font-size: 14px;
}
.fl-sort-row { padding: 0 14px 8px; }
.fl-sort-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
}
.fl-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 20px;
  -webkit-overflow-scrolling: touch;
}
.fl-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: inherit;
}
.fl-row:active { background: var(--bg-hover); }
.fl-user {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.fl-av {
  width: 48px; height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.fl-meta { flex: 1; min-width: 0; }
.fl-un {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fl-nm {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fl-act { flex-shrink: 0; margin-left: auto; }
.fl-follow {
  border: none;
  background: #3b82f6;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
}
.fl-msg {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--bg-hover, #f3f4f6);
  color: var(--text, #0f172a);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.fl-loading, .fl-empty {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 14px;
}
.fl-sort-overlay {
  align-items: flex-end;
  background: rgba(0,0,0,.4);
  z-index: 220;
}
.fl-sort-overlay.show { display: flex; }
.fl-sort-sheet {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-card, #fff);
  border-radius: 16px 16px 0 0;
  padding: 8px 16px 28px;
}
.fl-sort-title {
  font-weight: 700;
  font-size: 16px;
  text-align: center;
  margin: 8px 0 16px;
}
.fl-sort-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 4px;
  font-size: 15px;
  cursor: pointer;
  border-top: 1px solid var(--border);
}
.fl-sort-opt input { width: 18px; height: 18px; accent-color: #3b82f6; }

/* Search */
.search-hero { padding: 14px 14px 0 !important; margin-bottom: 12px; }
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-hover, #f3f4f6);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text-muted);
}
.search-input-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 16px;
  color: var(--text);
}
.search-clear {
  border: none;
  background: var(--border);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.search-tabs {
  display: flex;
  gap: 4px;
  margin-top: 12px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.search-tab {
  flex: 1;
  min-width: 70px;
  border: none;
  background: none;
  padding: 12px 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.search-tab.active { color: var(--text); border-bottom-color: #3b82f6; }
.search-status {
  text-align: center;
  color: var(--text-muted);
  padding: 24px 12px;
  font-size: 14px;
}
.search-section { margin-bottom: 16px; }
.search-sec-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 8px 4px 10px;
}
.search-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: 14px;
  margin-bottom: 6px;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  position: relative;
}
.search-user img {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover;
}
.su-meta { flex: 1; min-width: 0; }
.su-name { font-weight: 700; font-size: 15px; }
.su-handle { font-size: 13px; color: var(--text-muted); }
.su-bio {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.su-online {
  width: 10px; height: 10px; border-radius: 50%;
  background: #22c55e;
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
}
.search-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.search-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}
.search-tag i { color: var(--accent); font-size: 12px; }
.search-tag em {
  font-style: normal;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
}
.search-post {
  display: flex;
  gap: 12px;
  padding: 12px;
  margin-bottom: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
}
.sp-av { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.sp-body { flex: 1; min-width: 0; }
.sp-head { font-size: 13px; margin-bottom: 4px; }
.sp-head span { color: var(--text-muted); font-weight: 400; }
.sp-text { font-size: 14px; line-height: 1.4; color: var(--text); }
.sp-stats { margin-top: 6px; font-size: 12px; color: var(--text-muted); }

/* Verification badges */
.v-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin-left: 2px;
  flex-shrink: 0;
  line-height: 0;
}
.v-badge img {
  display: block;
  width: 14px;
  height: 14px;
  object-fit: contain;
}
.v-badge.v-lg img { width: 16px; height: 16px; }

/* Likers modal */
.likers-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,.45);
  align-items: flex-end;
  justify-content: center;
}
.likers-modal.show { display: flex; }
.likers-sheet {
  width: 100%;
  max-width: 420px;
  max-height: 70vh;
  background: var(--bg-card);
  border-radius: 18px 18px 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.likers-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 16px;
}
.likers-sheet-head button {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
}
.likers-list { overflow-y: auto; padding: 8px 0; flex: 1; }
.likers-list .liker-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
}
.likers-list .liker-row:hover { background: var(--bg-hover); }
.likers-list .liker-row img {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
}
.likers-list .liker-row .lr-name { font-weight: 600; font-size: 15px; }
.likers-list .liker-row .lr-user { font-size: 13px; color: var(--text-muted); }

/* AJAX nav progress */
#pulse-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
#pulse-progress.show { opacity: 1; }
#pulse-progress .pulse-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00b4e4, #00c2ff, #7c5cff);
  box-shadow: 0 0 8px rgba(0,180,228,.55);
  border-radius: 0 2px 2px 0;
}
html.pulse-nav-busy,
html.pulse-nav-busy body { cursor: progress; }
html.pulse-nav-busy .main-wrap > .content { pointer-events: none; }

/* Premium required sheet (gifts) */
.gf-prem-bg { z-index: 2200; }
.gf-prem-sheet { text-align: center; padding: 18px 20px 24px !important; max-width: 360px; }
.gf-prem-icon {
  width: 56px; height: 56px; margin: 8px auto 12px; border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff;
  font-size: 26px; line-height: 56px;
  box-shadow: 0 8px 24px rgba(37,99,235,.35);
}
.gf-prem-text { margin: 8px 8px 20px; font-size: 14px; line-height: 1.45; color: var(--text-muted, #6b7280); }
.gf-prem-actions { display: flex; gap: 10px; justify-content: center; align-items: stretch; }
.gf-prem-actions .gf-cancel,
.gf-prem-actions .gf-prem-buy {
  flex: 1; text-align: center; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; border-radius: 12px; font-weight: 700; font-size: 14px;
}
.gf-prem-buy { background: #3b82f6 !important; color: #fff !important; border: none; }


/* Notification / deep-link — postni ajratib ko'rsatish */
.post.pulse-hl,
.card.post.pulse-hl {
  position: relative;
  z-index: 2;
  animation: pulsePostIn 1.1s ease;
  box-shadow:
    0 0 0 2px rgba(59, 130, 246, 0.85),
    0 0 0 6px rgba(59, 130, 246, 0.18),
    0 12px 32px rgba(37, 99, 235, 0.16);
  border-radius: 12px;
  background: color-mix(in srgb, #3b82f6 12%, var(--bg-card, #fff));
}
@keyframes pulsePostIn {
  0% {
    transform: scale(0.985);
    box-shadow:
      0 0 0 0 rgba(59, 130, 246, 0.55),
      0 0 0 0 rgba(59, 130, 246, 0.2);
    background: color-mix(in srgb, #3b82f6 14%, var(--bg-card, #fff));
  }
  45% {
    transform: scale(1.01);
    box-shadow:
      0 0 0 3px rgba(59, 130, 246, 0.9),
      0 0 0 10px rgba(59, 130, 246, 0.12),
      0 14px 36px rgba(37, 99, 235, 0.2);
  }
  100% {
    transform: scale(1);
    box-shadow:
      0 0 0 2px rgba(59, 130, 246, 0.55),
      0 0 0 6px rgba(59, 130, 246, 0.1),
      0 8px 24px rgba(37, 99, 235, 0.1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .post.pulse-hl, .card.post.pulse-hl { animation: none; }
}


/* Feed infinite scroll loader */
.feed-load-more {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 12px 28px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}
.feed-load-more.show { display: flex; }
.feed-load-spin {
  width: 22px; height: 22px;
  border: 2.5px solid color-mix(in srgb, #3b82f6 25%, transparent);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: feedSpin .7s linear infinite;
}
@keyframes feedSpin { to { transform: rotate(360deg); } }


/* Comment highlight in modal */
.comment-item.cm-hl {
  animation: cmHlIn 1.4s ease;
  background: color-mix(in srgb, #3b82f6 16%, var(--bg-card, #fff)) !important;
  border-radius: 14px;
  box-shadow:
    0 0 0 2px rgba(59,130,246,.75),
    0 8px 24px rgba(37,99,235,.18) !important;
  position: relative;
  z-index: 2;
}
@keyframes cmHlIn {
  0% {
    background: color-mix(in srgb, #3b82f6 28%, var(--bg-card, #fff));
    transform: scale(0.97);
    box-shadow: 0 0 0 0 rgba(59,130,246,.5);
  }
  40% {
    transform: scale(1.02);
    box-shadow: 0 0 0 4px rgba(59,130,246,.35);
  }
  100% {
    background: color-mix(in srgb, #3b82f6 16%, var(--bg-card, #fff));
    transform: scale(1);
    box-shadow: 0 0 0 2px rgba(59,130,246,.55);
  }
}


/* Like heart pop — 3 marta, sekin */
.like-btn.like-pop i,
.like-btn .like-pop-icon,
i.like-pop-icon {
  animation: likePop 1.9s ease !important;
  color: #f43f5e !important;
  transform-origin: center center;
  display: inline-block;
}
@keyframes likePop {
  0%   { transform: scale(1); }
  12%  { transform: scale(1.65); }
  24%  { transform: scale(1); }
  40%  { transform: scale(1.55); }
  52%  { transform: scale(1); }
  68%  { transform: scale(1.45); }
  82%  { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.pulse-scroll-top {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #00d4ff, #2563eb);
  color: #fff;
  font-size: 18px;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(37,99,235,.35);
  cursor: pointer;
}
@media (min-width: 900px) {
  .pulse-scroll-top { display: none !important; }
}
/* create-fab o'rniga scroll-top ko'rinsin (bottom bar yashiringanda) */
.bottom-bar.bb-hidden ~ .pulse-scroll-top,
body:has(.bottom-bar.bb-hidden) .pulse-scroll-top {
  display: flex;
}

