.top-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.top-bar__title {
  flex: 1;
  overflow: hidden;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: transparent;
  border-radius: 50%;
}

.icon-button:active { background: var(--pressed); }

.search-shell {
  margin: 12px 14px 8px;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.search-shell input {
  width: 100%;
  color: var(--muted);
  background: transparent;
  border: 0;
  outline: 0;
  pointer-events: none;
}

.feed-tabs,
.content-tabs {
  display: grid;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.feed-tabs { grid-template-columns: 1fr 1fr; }
.content-tabs { grid-template-columns: repeat(3, 1fr); position: sticky; top: 0; z-index: 52; }
.content-tabs--two { grid-template-columns: 1fr 1fr; }

.tab-button {
  position: relative;
  min-height: 46px;
  padding: 0 8px;
  color: var(--muted);
  background: var(--surface);
  font-size: 14px;
}

.tab-button.is-active { color: var(--text); font-weight: 700; }
.tab-button.is-active::after {
  content: "";
  position: absolute;
  left: 28%;
  right: 28%;
  bottom: 0;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.post-card {
  padding: 16px 14px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.post-card__content { cursor: pointer; }
.post-card__content:active { opacity: .76; }

.author-row { display: flex; align-items: center; gap: 9px; min-width: 0; }
.author-identity { min-width: 0; flex: 1; display: flex; align-items: center; gap: 9px; padding: 0; background: transparent; text-align: left; }
.author-identity .author-meta { display: flex; flex-direction: column; }
.feed-author-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-width: 0; }
.feed-post-meta { max-width: 170px; overflow: hidden; color: var(--muted); font-size: 11px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }

.avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #202020;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}

.avatar--large { width: 38px; height: 38px; flex-basis: 38px; }
.author-meta { min-width: 0; flex: 1; }
.author-name { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.author-sub { margin-top: 1px; color: var(--muted); font-size: 12px; }

.follow-author {
  padding: 7px 11px;
  background: var(--text);
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
}

.follow-author.is-following { color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); }

.response-source {
  margin: 8px 0 0 39px;
  color: var(--muted);
  font-size: 13px;
}

.post-body-wrap { position: relative; margin: 7px 0 0 39px; }
.post-body {
  margin: 0;
  font-size: 16px;
  line-height: 25px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.post-body.is-clamped {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 8;
  overflow: hidden;
  max-height: 200px;
}

.post-body-wrap.has-fade::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 46px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--surface) 85%);
}

.image-strip {
  display: flex;
  gap: 8px;
  margin: 12px 0 0 39px;
  padding-right: 14px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}
.image-strip.is-dragging { cursor: grabbing; scroll-snap-type: none; }

.image-strip::-webkit-scrollbar { display: none; }
.image-strip__item {
  position: relative;
  flex: 0 0 82%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #ececec;
  border: 1px solid var(--line);
  border-radius: 14px;
  scroll-snap-align: start;
}
.image-strip__item:only-child { flex-basis: 100%; }
.image-strip__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-count {
  position: absolute;
  right: 9px;
  top: 9px;
  padding: 4px 7px;
  color: #fff;
  background: rgba(0,0,0,.62);
  border-radius: 999px;
  font-size: 11px;
}

.action-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  margin: 12px 0 0 34px;
}

.action-button {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #3f3f3f;
  background: transparent;
  border-radius: 10px;
  font-size: 12px;
}

.action-button:active { background: var(--pressed); }
.action-button.is-active { color: var(--text); font-weight: 700; }
.action-button.is-liked .icon { fill: var(--text); }
.action-button.is-starred .icon { fill: var(--text); }

.parent-card {
  position: relative;
  margin: 14px;
  padding: 13px 42px 13px 14px;
  background: #fafafa;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  text-align: left;
  transition: background .14s ease, transform .14s ease;
}

.floating-back {
  position: sticky;
  z-index: 90;
  top: 14px;
  width: 42px;
  height: 42px;
  margin: 14px 0 -56px 14px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 5px 18px rgba(0,0,0,.13);
  backdrop-filter: blur(12px);
  pointer-events: auto;
  touch-action: manipulation;
}
.floating-back:active { background: var(--pressed); }
.parent-card:active { background: var(--pressed); transform: scale(.995); }
.parent-card__label { color: var(--muted); font-size: 12px; }
.parent-card__text {
  display: -webkit-box;
  margin-top: 6px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 14px;
  line-height: 21px;
}
.parent-card__chevron { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); color: var(--muted); }

.bottom-nav {
  position: fixed;
  z-index: 35;
  left: 0;
  bottom: 0;
  width: 100%;
  height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255,255,255,.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.nav-button { position: relative; display: grid; place-items: center; color: var(--muted); background: transparent; }
.nav-button.is-active { color: var(--text); }
.nav-unread-dot { position: absolute; top: 18px; left: calc(50% + 8px); width: 7px; height: 7px; background: #d93025; border: 1.5px solid #fff; border-radius: 50%; }

.fab {
  position: fixed;
  z-index: 40;
  right: 18px;
  bottom: calc(var(--bottom-nav-height) + 18px + env(safe-area-inset-bottom));
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--text);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
}

.gallery-pill {
  position: fixed;
  z-index: 28;
  right: 14px;
  top: 70px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  color: #fff;
  background: rgba(17,17,17,.88);
  border-radius: 999px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity .16s ease, transform .16s ease;
}
.gallery-pill.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

.detail-dock {
  position: fixed;
  z-index: 50;
  left: 0;
  bottom: 0;
  width: 100%;
  min-height: 70px;
  display: grid;
  grid-template-columns: 92px repeat(5, 1fr);
  align-items: center;
  padding: 7px 8px 12px;
  background: rgba(255,255,255,.97);
  border-top: 1px solid var(--line);
  box-shadow: 0 -5px 20px rgba(0,0,0,.05);
  backdrop-filter: blur(14px);
}

.dock-author {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  color: var(--text);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}
.dock-author .avatar { width: 28px; height: 28px; flex-basis: 28px; }
.dock-author.is-following { color: var(--muted); }

.dock-action {
  min-width: 0;
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: #3f3f3f;
  background: transparent;
  border-radius: 10px;
}
.dock-action small { font-size: 9px; line-height: 1; }
.dock-action:active { background: var(--pressed); }
.dock-action.is-liked .icon,
.dock-action.is-starred .icon { fill: currentColor; }

.empty-state { padding: 56px 26px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 7px; color: var(--text); }

.placeholder-page { min-height: calc(100vh - var(--bottom-nav-height)); display: grid; place-items: center; padding: 28px; text-align: center; }
.placeholder-page p { color: var(--muted); line-height: 1.7; }
