/* ============================================================
   APP LAYOUT — 3-column desktop, single-column mobile
   ============================================================ */

/* Override body for app page */
body {
  font-family: var(--font-body);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  overflow-x: hidden;
}

/* On desktop, we isolate scrolling to the feed/sidebars */
@media (min-width: 701px) {
  body {
    height: 100vh;
    overflow: hidden;
  }
}

/* Allow landing-page ambient glow to show through */
body::after {
  display: block;
}

/* ============================================================
   LEFT SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  border-right: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
  display: none;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px 12px;
  gap: 4px;
}

/* Logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  padding: 8px 12px 20px;
  text-decoration: none;
}

.sidebar-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  filter: invert(1) brightness(1.2);
  transition: opacity 0.3s ease;
}

.sidebar-logo:hover .sidebar-logo-img {
  opacity: 0.8;
}

/* Nav links */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  color: var(--fg);
  text-decoration: none;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.2px;
  transition: background 0.18s, color 0.18s;
  position: relative;
  white-space: nowrap;
}

.sidebar-link svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  stroke-width: 1.8;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-link.active {
  font-weight: 700;
}

.sidebar-link.active svg {
  stroke-width: 2.4;
}

/* Badge for notifications */
.nav-badge {
  position: absolute;
  top: 6px;
  left: 26px;
  min-width: 16px;
  height: 16px;
  border-radius: 99px;
  background: var(--accent);
  color: #080b08;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* Post button */
.sidebar-post-btn {
  margin: 16px 8px 0;
  padding: 14px 0;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #080b08;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.sidebar-post-btn:hover {
  opacity: 0.9;
}

/* User card at bottom */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  border-radius: var(--radius-pill);
  margin-top: auto;
  cursor: pointer;
  transition: background 0.18s;
}

.sidebar-user:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line2);
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.2;
}

.sidebar-user-handle {
  font-size: 12px;
  color: var(--muted2);
  font-weight: 400;
}

.sidebar-user-more svg {
  width: 18px;
  height: 18px;
  color: var(--muted2);
}

/* ============================================================
   CENTER FEED
   ============================================================ */
.feed {
  margin-left: 260px;
  margin-right: 350px;
  flex: 1;
  min-width: 0;
  max-width: 720px;
  position: relative;
}

@media (min-width: 701px) {
  .feed {
    margin-top: 1em;
    margin-bottom: 1em;
    height: calc(100vh - 2rem);
    overflow-y: auto;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: 32px;
    scrollbar-width: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  }

  .feed::-webkit-scrollbar {
    display: none;
  }
}

.feed::-webkit-scrollbar {
  display: none;
}

/* On very wide screens, we keep it dead-center and let sidebars stay fixed at corners or follow */
@media (min-width: 1400px) {
  .feed {
    margin-left: auto;
    margin-right: auto;
    flex: none;
    width: 720px;
  }
}

/* Feed header with tabs */
.feed-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
}

@media (min-width: 701px) {
  .feed-header {
    border-top-left-radius: 32px;
    border-top-right-radius: 32px;
  }
}

@media (max-width: 700px) {
  .feed-tabs {
    padding: 10px 16px;
  }
}

.feed-tabs {
  display: flex;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

.feed-tab {
  padding: 16px 4px;
  margin-right: 24px;
  background: none;
  border: none;
  color: var(--muted2);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: color 0.2s, background 0.2s;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
}

.feed-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--fg);
}

.feed-tab.active {
  color: var(--fg);
  font-weight: 700;
}

.feed-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 8px);
  height: 4px;
  border-radius: 99px;
  background: var(--accent);
}

/* ── Trending & Following Section Styles (Center Feed) ── */
.trending-center-wrap,
.following-center-wrap {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.trending-header {
  padding: 20px 16px;
  border-bottom: 4px solid var(--bg2);
  display: flex;
  align-items: center;
  gap: 12px;
}

.trending-header h2 {
  font-family: var(--font-header);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--fg);
}

.trending-item {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.2s;
}

.trending-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.trending-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.trending-cat {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.trending-topic {
  font-size: 16px;
  font-weight: 800;
  color: var(--fg);
  margin: 2px 0;
}

.trending-posts {
  font-size: 13px;
  color: var(--muted);
}

.empty-state {
  padding: 60px 40px;
  text-align: center;
  max-width: 440px;
  margin: 0 auto;
}

.empty-state h2 {
  font-family: var(--font-header);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.8px;
  margin-bottom: 16px;
  color: var(--fg);
}

.empty-state p {
  color: var(--muted2);
  line-height: 1.6;
  margin-bottom: 32px;
  font-size: 16px;
}

/* ============================================================
   COMPOSE BOX
   ============================================================ */
.compose {
  display: flex;
  padding: 16px 16px 12px;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.compose-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line2);
  flex-shrink: 0;
}

.compose-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.compose-input {
  min-height: 52px;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  color: var(--fg);
  line-height: 1.5;
  outline: none;
  padding: 8px 0;
  word-wrap: break-word;
}

.compose-input:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}

.compose-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.compose-tools {
  display: flex;
  gap: 2px;
}

.compose-tool {
  background: none;
  border: none;
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--accent);
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compose-tool svg {
  width: 18px;
  height: 18px;
}

.compose-tool:hover {
  background: var(--accent-dim);
}

.compose-submit {
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #080b08;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
  letter-spacing: -0.1px;
}

.compose-submit:hover {
  opacity: 0.88;
}

/* Feed divider — "show new posts" style */
.feed-divider {
  height: 4px;
  background: var(--bg2);
  border-bottom: 1px solid var(--line);
}

/* ============================================================
   POST CARDS
   ============================================================ */
.post {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s;
  cursor: pointer;
}

.post:hover {
  background: var(--glass-bg-hover);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom-color: var(--glass-border-bright);
}

.post-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.post-body {
  flex: 1;
  min-width: 0;
}

.post-header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.post-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.1px;
  line-height: 1.2;
}

.post-verified {
  color: var(--accent);
  display: flex;
  align-items: center;
}

.post-verified svg {
  width: 15px;
  height: 15px;
}

.post-handle {
  font-size: 13px;
  color: var(--muted2);
  font-weight: 400;
}

.post-time {
  font-size: 13px;
  color: var(--muted2);
  font-weight: 400;
}

.post-time::before {
  content: '·';
  margin-right: 4px;
}

.post-more {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  transition: color 0.15s, background 0.15s;
}

.post-more:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

.post-more svg {
  width: 18px;
  height: 18px;
}

.post-text {
  margin-top: 4px;
  font-size: 14.5px;
  color: var(--fg);
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: -0.1px;
  word-wrap: break-word;
}

.post-text em {
  font-style: normal;
  color: var(--accent);
  font-weight: 500;
}

.post-text a {
  color: var(--accent);
  text-decoration: none;
}

.post-text a:hover {
  text-decoration: underline;
}

/* Post image */
.post-img {
  margin-top: 10px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  overflow: hidden;
  max-height: 300px;
}

.post-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Post actions (reply, repost, like, views, share) */
.post-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  max-width: 420px;
}

.post-action {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--muted2);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 99px;
  transition: color 0.15s, background 0.15s;
}

.post-action svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.6;
}

.post-action:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

.post-action.liked {
  color: #f43f5e;
}

.post-action.liked svg {
  fill: #f43f5e;
  stroke: #f43f5e;
}

/* ============================================================
   RIGHT SIDEBAR
   ============================================================ */
.right-bar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 350px;
  padding: 12px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;

  /* hide scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.right-bar::-webkit-scrollbar {
  display: none;
}

/* Search */
.rbar-search {
  position: relative;
  margin-bottom: 4px;
}

.rbar-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.rbar-search-icon svg {
  width: 18px;
  height: 18px;
}

.rbar-search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border-radius: var(--radius-pill);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.rbar-search-input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* Cards */
.rbar-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-xl);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.rbar-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rbar-card-title {
  font-family: var(--font-header);
  font-size: 18px;
  font-weight: 800;
  color: var(--fg);
  letter-spacing: -0.5px;
}

.rbar-dismiss {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  transition: color 0.15s;
}

.rbar-dismiss:hover {
  color: var(--fg);
}

/* Live on Meez */
.rbar-live-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}

.rbar-live-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.rbar-live-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.rbar-live-label svg {
  opacity: 1;
}

/* removed pulse-glow */

.rbar-live-topic {
  font-size: 13px;
  color: var(--fg2);
  font-weight: 500;
  letter-spacing: -0.1px;
}

.rbar-live-avatars {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.rbar-live-avatars img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg2);
}

.rbar-live-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

/* Trending list */
.rbar-trending-list {
  display: flex;
  flex-direction: column;
}

.rbar-trend {
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.15s;
}

.rbar-trend:last-child {
  border-bottom: none;
}

.rbar-trend:hover {
  background: rgba(255, 255, 255, 0.02);
}

.rbar-trend-category {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.rbar-trend-topic {
  font-size: 14px;
  color: var(--fg);
  font-weight: 700;
  letter-spacing: -0.2px;
}

.rbar-trend-posts {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 1px;
}

/* Suggestions */
.rbar-suggest-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rbar-suggest {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.rbar-suggest:last-child {
  border-bottom: none;
}

.rbar-suggest-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid var(--line2);
}

.rbar-suggest-info {
  flex: 1;
  min-width: 0;
}

.rbar-suggest-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.1px;
}

.rbar-suggest-handle {
  font-size: 12px;
  color: var(--muted2);
  font-weight: 400;
}

.rbar-follow-btn {
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: var(--fg);
  color: var(--bg);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
  letter-spacing: -0.1px;
  white-space: nowrap;
}

.rbar-follow-btn:hover {
  opacity: 0.85;
}

/* Show more link */
.rbar-show-more {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  padding: 4px 0;
  transition: opacity 0.15s;
}

.rbar-show-more:hover {
  opacity: 0.75;
}

/* Footer */
.rbar-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 12px 0 24px;
}

.rbar-footer a,
.rbar-footer span {
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 400;
}

.rbar-footer a:hover {
  text-decoration: underline;
}

/* ============================================================
   MOBILE BOTTOM NAV
   ============================================================ */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--glass-border);
  padding: 8px 0 env(safe-area-inset-bottom, 8px);
}

.mobile-nav-link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
  color: var(--muted2);
  text-decoration: none;
  transition: color 0.15s;
}

.mobile-nav-link svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.8;
}

.mobile-nav-link.active {
  color: var(--fg);
}

.mobile-nav-link.active svg {
  stroke-width: 2.4;
}

/* Floating action button */
.mobile-fab {
  display: none;
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 201;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--accent);
  color: #080b08;
  border: none;
  cursor: pointer;
  transition: transform 0.2s;
  align-items: center;
  justify-content: center;
}

.mobile-fab svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.5;
}

.mobile-fab:hover {
  transform: scale(1.08);
}

/* ============================================================
   MOBILE TOP BAR (for < 700px)
   ============================================================ */
.mobile-top-bar {
  display: none;
}

.mobile-nav-badge {
  position: absolute;
  top: 6px;
  right: 22px;
  min-width: 16px;
  height: 16px;
  border-radius: 99px;
  background: var(--accent);
  color: #080b08;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  border: 2px solid var(--bg);
}

/* ============================================================
   RESPONSIVE — < 1280px: Collapse sidebar labels
   ============================================================ */
/* Sidebar collapses handled by central design now */

/* ============================================================
   RESPONSIVE — < 1080px: Hide right sidebar
   ============================================================ */
@media (max-width: 1080px) {
  .right-bar {
    display: none;
  }

  .feed {
    margin-right: 0;
    max-width: none;
  }
}

/* ============================================================
   RESPONSIVE — < 700px: Mobile layout
   ============================================================ */
@media (max-width: 700px) {
  .sidebar {
    display: none;
  }

  .feed {
    margin: 0 auto !important;
    border-right: none;
    padding-bottom: 60px;
    max-width: 600px;
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }

  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    align-items: center;
    justify-content: space-around;
    z-index: 5000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .mobile-nav.nav-hidden {
    transform: translateY(100%);
  }

  .mobile-fab {
    display: flex;
    position: fixed;
    bottom: 72px;
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: #000;
    border: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 4900;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .mobile-fab.nav-hidden {
    transform: scale(0);
  }

  /* Adjust compose */
  .compose {
    padding: 12px;
  }

  .compose-input {
    font-size: 15px;
    min-height: 40px;
  }

  /* Post tweaks */
  .post {
    padding: 12px;
  }

  .post-text {
    font-size: 14px;
  }

  .post-actions {
    max-width: none;
  }

  /* Mobile Top Bar & Header Scroll Effect */
  .feed-header {
    position: sticky;
    top: 0;
    z-index: 1050;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .feed-header.nav-hidden {
    transform: translateY(-100%);
  }

  .mobile-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 4px;
  }

  .mobile-top-avatar-wrap {
    flex: 1;
    display: flex;
    align-items: center;
  }

  .mobile-top-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--line2);
    cursor: pointer;
  }

  .mobile-top-avatar-text {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
  }

  .mobile-top-logo {
    height: 22px;
  }

  .mobile-top-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
  }

  .mobile-upgrade {
    font-size: 14px;
    font-weight: 700;
    color: var(--fg);
  }

  .mobile-more-btn {
    background: none;
    border: none;
    color: var(--fg);
    display: flex;
    align-items: center;
    padding: 0;
    cursor: pointer;
  }

  /* Feed tabs */
  .feed-tabs {
    overflow-x: auto;
    scrollbar-width: none;
    justify-content: flex-start;
  }

  .feed-tabs::-webkit-scrollbar {
    display: none;
  }

  .feed-tab {
    font-size: 14px;
    padding: 14px 16px;
    white-space: nowrap;
    flex: none;
  }

  .feed-tab.active::after {
    width: 50px;
    bottom: 0;
  }
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
:focus-visible {
  outline: 2px solid rgba(29, 155, 240, 0.7);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--line2);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ============================================================
   MOBILE DRAWER
   ============================================================ */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drawer-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 76%;
  max-width: 320px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  z-index: 4000;
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--glass-border);
  scrollbar-width: none;
}

.mobile-drawer::-webkit-scrollbar {
  display: none;
}

.mobile-drawer.active {
  transform: translateX(0);
}

.drawer-inner {
  flex: 1;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
}

.drawer-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drawer-user-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.drawer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.drawer-badge-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-badge-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  position: relative;
}

.drawer-badge-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--bg);
}

.drawer-more-icon {
  width: 20px;
  height: 20px;
  color: var(--fg);
  margin-left: 8px;
}

.drawer-user-info {
  display: flex;
  flex-direction: column;
}

.drawer-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--fg);
  line-height: 1.2;
}

.drawer-handle {
  font-size: 14px;
  color: var(--muted2);
  line-height: 1.2;
}

.drawer-stats {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.drawer-stats a {
  text-decoration: none;
  font-size: 14px;
  color: var(--muted2);
}

.drawer-stats a strong {
  color: var(--fg);
  font-weight: 700;
}

.drawer-divider {
  height: 1px;
  background: var(--line);
  margin: 16px 0;
}

.drawer-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-links a {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 0;
  text-decoration: none;
  font-size: 20px;
  font-weight: 700;
  color: var(--fg);
}

.drawer-links a svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.8;
  color: var(--fg);
}

.drawer-accordion {
  margin-top: auto;
}

.drawer-accordion-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  color: var(--fg);
  font-size: 15px;
  font-weight: 700;
  padding: 12px 0;
  font-family: inherit;
  cursor: pointer;
}

.drawer-accordion-btn svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.drawer-footer {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.drawer-theme-toggle {
  background: none;
  border: none;
  color: var(--fg);
  cursor: pointer;
  padding: 0;
}

.drawer-theme-toggle svg {
  width: 22px;
  height: 22px;
}

/* ============================================================
   COMPOSE MODAL
   ============================================================ */
.compose-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 3000;
  display: none;
  justify-content: center;
  align-items: center;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: opacity 0.3s ease;
  opacity: 0;
}

.compose-modal-backdrop.active {
  display: flex;
  opacity: 1;
}

.compose {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  padding: 16px;
  border-radius: 24px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.compose-modal-backdrop.active .compose {
  transform: scale(1);
}

.compose-modal-header {
  padding: 8px 16px;
  display: flex;
  justify-content: flex-start;
}

.compose-close {
  background: none;
  border: none;
  color: var(--fg);
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.compose-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.compose-inner-body {
  display: flex;
  padding: 12px 16px;
  gap: 12px;
}

.compose-modal-backdrop .compose-input {
  min-height: 120px;
  font-size: 20px;
}

/* ============================================================
   GUEST MODE REFINEMENTS
   ============================================================ */
.guest-restricted {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.guest-restricted::after {
  content: "Log in to interact";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--accent);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.guest-restricted:hover::after {
  opacity: 1;
}

/* ============================================================
   FEED LOADER
   ============================================================ */
.feed-loader-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
  width: 100%;
}

.feed-loader-wrapper .loader-ring {
  width: 20px;
  height: 20px;
  border: 3px solid #111;
  border-top-color: #fff;
  opacity: 1 !important;
}

/* ============================================================
   VIEW TRANSITIONS (SPA)
   ============================================================ */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.3s;
}