#feed {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--c-bg);
  overflow: hidden;
}

.feed__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 10px;
  flex-shrink: 0;
  background: rgba(8,8,8,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--c-border);
  position: relative;
  z-index: 5;
}

.feed__logo { font-family: var(--ff-display); font-weight: 800; font-size: 22px; letter-spacing: -1px; color: var(--c-text); line-height: 1; }
.feed__logo em { font-style: normal; color: var(--c-accent); }

.feed__topbar-right { display: flex; align-items: center; gap: 4px; }

.feed__icon-btn {
  width: 38px; height: 38px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--c-muted); cursor: pointer;
  transition: all 0.2s var(--ease-out);
  position: relative; background: none; border: none;
}
.feed__icon-btn:hover { background: var(--c-surface); color: var(--c-text); }
.feed__icon-btn i { font-size: 18px; }

.feed__notif-dot {
  position: absolute; top: 7px; right: 7px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--c-danger); border: 1.5px solid var(--c-bg);
}

.feed__tabs {
  display: flex; align-items: center; gap: 0;
  padding: 0 20px; border-bottom: 1px solid var(--c-border);
  flex-shrink: 0; overflow-x: auto; scrollbar-width: none;
  background: var(--c-bg);
}
.feed__tabs::-webkit-scrollbar { display: none; }

.feed__tab {
  padding: 12px 16px; font-size: 13px; font-weight: 500;
  color: var(--c-muted); border: none; background: none;
  cursor: pointer; position: relative; white-space: nowrap;
  transition: color 0.2s; flex-shrink: 0;
}
.feed__tab.is-active { color: var(--c-text); }
.feed__tab.is-active::after {
  content: ''; position: absolute; bottom: 0; left: 16px; right: 16px;
  height: 2px; background: var(--c-accent); border-radius: var(--r-full);
}

.feed__scroll {
flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 90px;
    width: 100%;
    height: 100%;
    display: block;
    padding: 0.8rem;
}
.feed__scroll::-webkit-scrollbar { display: none; }

/* ═══ MASONRY LAYOUT - CSS GRID ═══ */
.feed__list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 4px;
  width: 100%;
}

@media (min-width: 640px)  { .feed__list { grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 8px; } }
@media (min-width: 1024px) { .feed__list { grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 10px; } }
@media (min-width: 1400px) { .feed__list { grid-template-columns: repeat(5, 1fr); gap: 12px; padding: 12px; } }

.feed__list .post {
  display: block;
  break-inside: avoid;
  width: 100%;
}

/* ═══ SKELETON ═══ */
.feed__skeleton {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 4px;
  width: 100%;
}
@media (min-width: 640px)  { .feed__skeleton { grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 8px; } }
@media (min-width: 1024px) { .feed__skeleton { grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 10px; } }
@media (min-width: 1400px) { .feed__skeleton { grid-template-columns: repeat(5, 1fr); gap: 12px; padding: 12px; } }

.skel-card { 
  break-inside: avoid; 
  margin-bottom: 0;
  background: var(--c-bg); 
  display: block;
}

.skel-media { 
  width: 100%; 
  background: var(--c-surface2); 
  animation: skelShimmer 1.5s ease-in-out infinite; 
}

.skel-card:nth-child(3n+1) .skel-media { aspect-ratio: 3/4; }
.skel-card:nth-child(3n+2) .skel-media { aspect-ratio: 4/5; }
.skel-card:nth-child(3n) .skel-media { aspect-ratio: 1/1; }
.skel-body { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.skel-line { height: 10px; border-radius: var(--r-full); background: var(--c-surface2); animation: skelShimmer 1.5s ease-in-out infinite; }
.skel-line.short { width: 55%; }
.skel-line.xshort { width: 35%; }
.skel-avatar { width: 32px; height: 32px; border-radius: 0.5rem; background: var(--c-surface2); animation: skelShimmer 1.5s ease-in-out infinite; flex-shrink: 0; }
.skel-row { display: flex; align-items: center; gap: 10px; }

@keyframes skelShimmer { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ═══ USER LIST ═══ */
.feed__user-list { display: flex; flex-direction: column; }
.feed__user-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; gap: 12px; border-bottom: 1px solid var(--c-border); }
.feed__user-row-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; cursor: pointer; }
.feed__user-row-avatar { width: 44px; height: 44px; border-radius: var(--r-full); background: var(--c-surface2); overflow: hidden; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.feed__user-row-avatar img { width: 100%; height: 100%; object-fit: cover; }
.feed__user-row-avatar i { font-size: 18px; color: var(--c-muted2); }
.feed__user-row-info { flex: 1; min-width: 0; }
.feed__user-row-name { font-family: var(--ff-display); font-size: 14px; font-weight: 700; color: var(--c-text); display: flex; align-items: center; gap: 5px; }
.feed__user-row-verified { color: var(--c-accent); font-size: 12px; }
.feed__user-row-handle { font-size: 13px; color: var(--c-muted); }
.feed__user-row-bio { font-size: 12px; color: var(--c-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed__user-row-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.feed__user-follow-btn { height: 34px; padding: 0 16px; border: none; border-radius: var(--r-sm); background: var(--c-accent); color: var(--c-bg); font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; font-family: var(--ff-display); }
.feed__user-follow-btn.is-following { background: var(--c-surface3); color: var(--c-text); border: 1px solid var(--c-border2); }
.feed__user-remove-btn { width: 34px; height: 34px; border-radius: var(--r-sm); border: 1px solid var(--c-border2); background: var(--c-surface2); color: var(--c-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.feed__user-remove-btn:hover { color: var(--c-danger); border-color: var(--c-danger); }

/* ═══ EMPTY / SIGN-IN ═══ */
.feed__empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 80px 40px; text-align: center; color: var(--c-muted); }
.feed__empty i { font-size: 40px; opacity: 0.3; }
.feed__empty h3 { font-family: var(--ff-display); font-size: 17px; font-weight: 600; color: var(--c-text); }
.feed__empty p { font-size: 13px; font-weight: 300; line-height: 1.6; max-width: 260px; }
.feed__signin-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: var(--r-sm); background: var(--c-accent); color: #080808; border: none; font-family: var(--ff-display); font-size: 13px; font-weight: 700; cursor: pointer; margin-top: 14px; transition: all 0.2s var(--ease-out); }
.feed__signin-btn i { font-size: 16px; }
.feed__signin-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 28px rgba(184, 245, 61, 0.3); }
.feed__signin-btn:active { transform: scale(0.98); }

.feed__topics-banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin: 12px 16px; background: var(--c-surface2); border: 1px solid var(--c-border); border-radius: 12px; font-size: 13px; color: var(--c-text); }
.feed__topics-banner i { font-size: 16px; color: var(--c-accent); }
.feed__topics-banner span { flex: 1; font-family: var(--ff-body); }
.feed__topics-banner button { padding: 8px 16px; border-radius: 8px; background: var(--c-accent); color: #080808; border: none; font-family: var(--ff-display); font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }

@media (min-width: 768px) {
  #feed {
    max-width: 1500px;
    margin: var(--sp-10) auto 0;
    border-radius: 28px 28px 0 0;
    border: 1px solid var(--c-border2);
    border-bottom: none;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
  }
}
