:root {
  --bg: #f5f5f7;
  --card: rgba(255, 255, 255, 0.78);
  --text: #1d1d1f;
  --subtext: #6e6e73;
  --line: rgba(0, 0, 0, 0.08);
  --white: #ffffff;
  --black: #111111;
  --blue: #0071e3;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 100%);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { border: none; background: none; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 14px 16px;
  outline: none;
  color: var(--text);
}
textarea { resize: vertical; min-height: 120px; }

.container { width: min(1200px, calc(100% - 40px)); margin: 0 auto; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: rgba(255,255,255,0.72);
  border-bottom: 1px solid var(--line);
}
.nav {
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 24px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 18px;
  line-height: 1;
  justify-self: start;
}
.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  background: var(--black);
  font-size: 14px;
}
.nav-links {
  display: flex;
  align-items: center;
  justify-self: center;
  gap: 28px;
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  color: var(--subtext);
  border-bottom: 2px solid transparent;
  line-height: 1;
  transition: .25s;
}
.nav-links a.active, .nav-links a:hover {
  color: var(--black);
  border-bottom-color: var(--black);
}
.nav-links a.has-unread {
  position: relative;
}
.nav-links a.has-unread::after {
  content: "";
  position: absolute;
  top: 9px;
  right: -8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d70015;
  box-shadow: 0 0 0 2px rgba(255,255,255,.92);
}
.nav-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-self: end;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 999px;
  line-height: 1;
  transition: .25s ease;
  cursor: pointer;
}
.btn:hover { transform: translateY(-1px); }
.btn-dark { background: var(--black); color: white; }
.btn-light { background: white; border: 1px solid var(--line); color: var(--text); }
.btn-full { width: 100%; }
.admin-entry-btn { white-space: nowrap; }

.hero { padding: 78px 0 48px; }
.hero-inner { max-width: 860px; text-align: center; }
.hero-tag {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.88);
  color: var(--subtext);
  font-size: 14px;
  margin-bottom: 22px;
}
.small-tag { margin-bottom: 8px; }
.hero h1, .detail-body h1, .auth-copy h1, .publish-card h1, .profile-hero h1 {
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}
.hero-desc, .profile-desc { color: var(--subtext); font-size: 18px; max-width: 700px; margin: 18px auto 28px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.layout,
.page-grid,
.publish-page,
.message-page,
.auth-wrap {
  display: grid;
  gap: 24px;
}
.layout { grid-template-columns: 1.8fr .9fr; padding-bottom: 48px; }
.page-grid { grid-template-columns: 1.6fr .85fr; padding: 34px 0 48px; }
.publish-page { grid-template-columns: 1.5fr .8fr; padding: 34px 0 48px; }
.message-page {
  grid-template-columns: 360px 1fr;
  padding: 34px 0 48px;
  min-height: calc(100vh - 120px);
  height: calc(100vh - 120px);
  overflow: hidden;
}
.auth-wrap { grid-template-columns: 1.1fr .9fr; align-items: center; min-height: calc(100vh - 100px); padding: 32px 0 56px; }
.profile-page { padding: 34px 0 48px; }

.section-card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,.65);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.tabs {
  display: flex;
  gap: 10px;
  padding: 12px;
}
.tab {
  color: var(--subtext);
  border-radius: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 4px 12px;
  cursor: pointer;
  transition: .25s;
}
.tab.active, .tab:hover {
  background: transparent;
  color: var(--black);
  box-shadow: none;
  border-bottom-color: var(--black);
}

.feed .tabs { margin-bottom: 18px; }
.composer { padding: 20px; margin-bottom: 18px; }
.composer-top { display: flex; gap: 14px; align-items: flex-start; }
.composer-main {
  flex: 1;
  display: grid;
  gap: 12px;
}
.composer-bottom {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.composer-tools { display: flex; gap: 10px; flex-wrap: wrap; }
.composer-tools button {
  border: 1px solid var(--line);
  background: white;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--subtext);
  cursor: pointer;
}
.composer-tools button:hover { color: var(--text); }
.visually-hidden { display: none; }
.composer-image-preview,
.post-thumbnail-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.composer-image-preview[hidden] { display: none; }
.preview-thumb,
.post-thumb {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  overflow: hidden;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
}
.preview-thumb img,
.post-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.thumb-overflow-tag {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: white;
  color: var(--subtext);
  font-size: 13px;
  line-height: 1.4;
}
.sample-media {
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 10px;
  color: white;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  overflow: hidden;
}
.sample-media::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(0,0,0,.28));
}
.sample-media > span {
  position: relative;
  z-index: 1;
}
.media-library {
  background:
    radial-gradient(circle at 24% 18%, rgba(255,255,255,.52), transparent 28%),
    linear-gradient(135deg, #9bb6d9 0%, #607a9d 46%, #2d425b 100%);
}
.media-desk {
  background:
    radial-gradient(circle at 72% 24%, rgba(255,255,255,.44), transparent 26%),
    linear-gradient(135deg, #d8c2a5 0%, #a47c5a 54%, #674530 100%);
}
.media-light {
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,.62), transparent 22%),
    linear-gradient(135deg, #f0dca8 0%, #d1ae59 52%, #8f6e22 100%);
}
.media-food {
  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,.28), transparent 22%),
    linear-gradient(135deg, #ffcb8e 0%, #da7d43 50%, #8b3d17 100%);
}
.media-tray {
  background:
    radial-gradient(circle at 70% 18%, rgba(255,255,255,.28), transparent 20%),
    linear-gradient(135deg, #bfd7a3 0%, #6f9969 48%, #2f5b43 100%);
}
.media-wireframe {
  background:
    linear-gradient(0deg, rgba(255,255,255,.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px),
    linear-gradient(135deg, #7a8fa6 0%, #41556e 52%, #16202d 100%);
  background-size: 18px 18px, 18px 18px, auto;
}

.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0; font-weight: 600;
  color: #23324f;
  background: linear-gradient(135deg, #dfe7f5, #c8d6f2);
  overflow: hidden;
}
.avatar.large { width: 54px; height: 54px; }
.avatar.xlarge { width: 86px; height: 86px; font-size: 28px; }
.avatar-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.avatar-upload-shell {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.avatar-upload-copy {
  display: grid;
  gap: 8px;
}
.avatar-upload-preview {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
}
.soft-badge.badge-alert {
  color: #d70015;
  border-color: rgba(215,0,21,.16);
  background: rgba(215,0,21,.06);
}

.post-list { display: flex; flex-direction: column; gap: 0; }
.x-stream {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.post, .comment-item, .detail-post { padding: 18px 20px; }
.post-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; gap: 12px; }
.post-user { display: flex; gap: 12px; align-items: flex-start; }
.post-user h3 { font-size: 15px; margin-bottom: 0; }
.post-user p { font-size: 13px; color: var(--subtext); }
.post-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.handle, .meta-time { color: var(--subtext); font-size: 14px; font-weight: 400; }
.meta-dot { color: var(--subtext); }
.inline-handle { font-size: 14px; font-weight: 400; }
.more-btn { font-size: 20px; color: var(--subtext); cursor: pointer; padding: 4px 8px; border-radius: 999px; }
.more-btn:hover { background: rgba(0,0,0,.06); }
.post-content h2 { font-size: 21px; line-height: 1.35; letter-spacing: -.02em; margin-bottom: 8px; font-weight: 600; }
.post-content p, .detail-body p, .comment-text { color: var(--subtext); }
.post-body-copy { font-size: 16px; line-height: 1.7; }
.post-thumbnail-strip {
  margin-top: 14px;
  max-height: 80px;
  overflow: hidden;
}
.detail-gallery {
  display: grid;
  grid-template-columns: 1.35fr .95fr;
  gap: 12px;
  margin: 18px 0;
}
.detail-gallery-stack {
  display: grid;
  gap: 12px;
}
.media-card {
  min-height: 148px;
  border-radius: 24px;
  border: 1px solid var(--line);
}
.media-card.large { min-height: 308px; }
.detail-gallery-strip {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.detail-thumb {
  width: 104px;
  height: 104px;
  border-radius: 20px;
  overflow: hidden;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.92);
}
.detail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.detail-thumb-overflow {
  min-height: 104px;
  display: inline-flex;
  align-items: center;
}
.post-footer { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.action-btn {
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--subtext);
  cursor: pointer;
  transition: .2s;
}
.action-btn:hover { color: var(--text); background: rgba(0,0,0,.06); transform: none; }
.like-btn.liked,
.action-btn.active-action {
  color: var(--black);
  background: transparent;
  box-shadow: inset 0 -2px 0 var(--black);
}
.x-post {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  border-bottom: 1px solid var(--line);
  transition: background .2s ease;
}
.x-post:hover { background: rgba(0,0,0,.035); }
.x-post:last-child { border-bottom: none; }
.x-actions .action-btn { min-width: 58px; }
.post-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.empty-state {
  padding: 28px 20px;
  border: 1px dashed var(--line);
  border-radius: 20px;
  color: var(--subtext);
  background: rgba(255,255,255,.72);
}

.sidebar { display: flex; flex-direction: column; gap: 18px; }
.side-block { padding: 22px; }
.side-block h3 { font-size: 18px; margin-bottom: 14px; }
.side-block ul { list-style: none; }
.side-block li { padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--subtext); }
.side-block li:last-child { border-bottom: none; }
.tag-list { display: flex; gap: 10px; flex-wrap: wrap; }
.tag-list span, .soft-badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--line);
  color: var(--subtext);
  font-size: 14px;
}
.profile-mini { display: flex; align-items: center; gap: 14px; }
.profile-name { font-weight: 600; }
.profile-id { color: var(--subtext); font-size: 14px; }

.auth-page { min-height: calc(100vh - 72px); }
.auth-card { padding: 12px; }
.auth-panel { display: none; padding: 10px 14px 16px; }
.auth-panel.active { display: block; }
.auth-form { display: grid; gap: 14px; }
.auth-form label, .publish-form label { display: grid; gap: 8px; font-weight: 500; }
.input-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.code-btn {
  min-width: 148px;
  min-height: 50px;
  border-radius: 16px;
  white-space: nowrap;
}
.code-btn:disabled {
  cursor: not-allowed;
  opacity: .7;
}
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.feature-card { padding: 20px; }
.feature-card h3 { margin-bottom: 8px; }
.feature-card p { color: var(--subtext); }

.comment-box, .publish-card, .profile-hero, .profile-tabs-wrap, .user-hero, .user-tabs-wrap, .settings-card { padding: 24px; }
.detail-main { display: flex; flex-direction: column; gap: 18px; }
.x-detail-page .detail-main { border-top: 1px solid var(--line); }
.detail-focus { padding-top: 20px; }
.detail-body h1 { font-size: clamp(28px, 4vw, 44px); margin-bottom: 18px; }
.detail-body p { font-size: 17px; margin-bottom: 16px; }
.comment-list { display: flex; flex-direction: column; gap: 0; }
.x-reply-box {
  padding: 18px 20px 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}
.comment-item { margin: 0; }
.comment-text { margin: 12px 0 0 54px; }
.comment-actions { display: flex; gap: 8px; margin-top: 10px; margin-left: 44px; }
.comment-actions button { color: var(--subtext); cursor: pointer; }

.profile-hero,
.user-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
.profile-main { display: flex; align-items: center; gap: 20px; }
.profile-tools { display: flex; gap: 12px; flex-wrap: wrap; }
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}
.stat-card { padding: 24px; text-align: center; }
.stat-card strong { display: block; font-size: 32px; letter-spacing: -.02em; }
.stat-card span { color: var(--subtext); }
.stat-card-button {
  width: 100%;
  cursor: pointer;
}
.stat-card-button:hover {
  transform: translateY(-2px);
}
.profile-tabs-wrap .tabs { margin: -12px -12px 12px; }
.compact-list { gap: 12px; }
.post-simple {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.post-simple:last-child { border-bottom: none; }
.post-simple-body {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}
.post-simple-content {
  flex: 1;
  min-width: 0;
}
.post-simple-media {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.post-simple-media .post-thumb {
  width: 56px;
  height: 56px;
  border-radius: 14px;
}
.post-simple h3 { margin-bottom: 4px; font-size: 18px; }
.post-simple p { color: var(--subtext); font-size: 14px; }
.post-simple .handle { margin-left: 6px; }

.panel-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.conversation-list {
  padding: 22px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  align-self: stretch;
  overflow: hidden;
}
.conversation-list #conversation-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.conversation-item {
  width: 100%;
  text-align: left;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 18px;
  cursor: pointer;
  transition: .2s;
}
.conversation-item:hover, .conversation-item.active { background: rgba(255,255,255,.9); }
.conversation-item p { color: var(--subtext); font-size: 14px; }
.conversation-copy {
  flex: 1;
  min-width: 0;
}
.conversation-copy h3 {
  font-size: 16px;
  margin-bottom: 4px;
}
.conversation-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.unread-dot {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #d93025;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.chat-panel {
  padding: 22px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  align-self: stretch;
  overflow: hidden;
}
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.chat-body {
    flex: 1;
    height: 0;
    min-height: 0;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    padding: 22px 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
.chat-thread {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 16px;
}
.bubble-row { display: flex; }
.bubble-row.right { justify-content: flex-end; }
.bubble {
  max-width: 72%;
  padding: 12px 16px;
  border-radius: 18px;
  background: white;
  border: 1px solid var(--line);
}
.bubble-row.right .bubble { background: var(--black); color: white; border-color: transparent; }
.bubble p { margin-bottom: 8px; }
.bubble-time {
  display: block;
  font-size: 12px;
  opacity: .68;
}
.chat-empty {
  padding: 28px 0;
  color: var(--subtext);
}
.chat-empty-title {
  font-size: 18px;
  color: var(--text);
  margin-bottom: 6px;
}
.chat-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  flex: 0 0 auto;
}
.chat-input-row textarea { min-height: 68px; }

.publish-card { min-height: 720px; }
.publish-form { display: grid; gap: 18px; margin-top: 18px; }
.publish-textarea { min-height: 280px; }
.upload-row, .publish-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.publish-media-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 24px;
  border: 1px dashed rgba(0, 0, 0, 0.14);
  background: rgba(255,255,255,.58);
}
.publish-upload-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.publish-preview-hint {
  color: var(--subtext);
  font-size: 14px;
}
.publish-image-preview .preview-thumb {
  width: 96px;
  height: 96px;
  border-radius: 18px;
}
.feed-summary,
.form-meta-hint,
.side-note {
  color: var(--subtext);
  font-size: 14px;
}
.feed-summary {
  margin: 0 0 14px;
}
.form-meta-row,
.publish-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.publish-meta-row {
  color: var(--subtext);
  font-size: 14px;
}
.tag-filter-pill {
  cursor: pointer;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 8px 0;
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
}
.active-tag {
  background: transparent;
  color: var(--black);
  border-bottom-color: var(--black);
}
.avatar-link {
  display: inline-flex;
  border-radius: 50%;
}
.author-link {
  color: var(--text);
  font-weight: 600;
}
.author-link:hover {
  text-decoration: underline;
}
.btn-small {
  min-height: 36px;
  padding: 8px 14px;
  font-size: 14px;
}
.inline-action-group,
.detail-author-actions,
.manage-actions,
.user-card-actions,
.user-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.follow-list {
  display: grid;
  gap: 14px;
}
.user-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.user-card:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.user-card-compact {
  padding-top: 0;
}
.user-card-main {
  display: flex;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.user-card-copy {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 4px;
}
.user-card-copy p {
  color: var(--subtext);
  font-size: 14px;
}
.user-card-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.manage-actions {
  justify-content: flex-end;
}
.profile-following-card {
  margin-bottom: 22px;
}
.posts-page {
  padding: 34px 0 48px;
}
.posts-browser-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  margin-bottom: 18px;
}
.posts-browser-meta {
  text-align: right;
}
.feed-browser-tabs {
  position: sticky;
  top: 88px;
  z-index: 35;
  margin-bottom: 18px;
  backdrop-filter: blur(20px);
  background: rgba(255,255,255,.84);
}
.posts-topic-panel {
  padding: 18px 24px;
  margin-bottom: 18px;
}
.posts-topic-tags-row {
  gap: 18px;
}
.posts-feed-card {
  overflow: hidden;
}
.user-page {
  padding: 34px 0 48px;
}
.user-layout {
  display: grid;
  grid-template-columns: 1.5fr .85fr;
  gap: 24px;
}
.user-tabs-wrap .tabs {
  margin: -12px -12px 12px;
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.info-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.78);
}
.info-item label {
  display: block;
  margin-bottom: 6px;
  color: var(--subtext);
  font-size: 13px;
}
.about-stack {
  display: grid;
  gap: 14px;
}
.about-card {
  padding: 20px;
}
.about-card h3 {
  margin-bottom: 10px;
}
.related-link {
  display: inline-flex;
  padding: 6px 0;
}
.related-link:hover {
  color: var(--text);
}

.follower-row {
  cursor: pointer;
  padding: 18px 20px;
}
.follower-row .post-user {
  align-items: center;
}
.follower-row h3 {
  font-size: 16px;
}
.follower-row .handle {
  font-size: 14px;
}

.post[data-post-id] {
  cursor: pointer;
}
.post[data-post-id] .action-btn,
.post[data-post-id] .more-btn,
.post[data-post-id] .tag-filter-pill,
.post[data-post-id] .avatar-link,
.post[data-post-id] .author-link,
.post[data-post-id] .post-title-link {
  position: relative;
  z-index: 1;
}

.settings-page {
  padding: 34px 0 48px;
}
.settings-page-narrow {
  max-width: 860px;
}
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1.45fr) minmax(280px, .85fr);
  gap: 24px;
  align-items: start;
}
.settings-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.settings-form-stack {
  display: grid;
  gap: 16px;
}
.readonly-input {
  background: rgba(242, 242, 247, 0.95);
  color: #7b7b83;
  cursor: not-allowed;
}
.phone-inline-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}
.settings-action-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.phone-card {
  max-width: 720px;
  margin: 0 auto;
}

.app-toast-layer {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 300;
  pointer-events: none;
}
.app-toast {
  min-width: 220px;
  max-width: min(92vw, 480px);
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(17, 17, 17, 0.88);
  color: #fff;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease;
}
.app-toast.show {
  opacity: 1;
  transform: translateY(0);
}
.app-toast[data-type="success"] {
  background: rgba(24, 36, 23, 0.92);
}
.app-toast[data-type="warning"] {
  background: rgba(71, 48, 11, 0.92);
}
.app-toast[data-type="error"] {
  background: rgba(81, 20, 20, 0.94);
}

.app-dialog-root[hidden] {
  display: none;
}
.app-dialog-root {
  position: fixed;
  inset: 0;
  z-index: 320;
}
.app-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 24, 0.3);
  backdrop-filter: blur(6px);
}
.app-dialog-card {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(92vw, 420px);
  transform: translate(-50%, -50%);
  padding: 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(22px);
}
.app-dialog-card h3 {
  margin-bottom: 10px;
  font-size: 22px;
}
.app-dialog-card p {
  color: var(--subtext);
}
.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

@media (max-width: 1080px) {
  .layout, .page-grid, .publish-page, .message-page, .auth-wrap, .user-layout, .settings-layout { grid-template-columns: 1fr; }
  .sidebar { order: -1; }
  .feature-grid, .profile-stats-grid, .info-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .container { width: min(100% - 24px, 1200px); }
  .nav-links { display: none; }
  .nav {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 68px;
    padding: 10px 0;
  }
  .nav-actions { grid-column: 2; }
  .hero { padding-top: 54px; }
  .hero h1, .auth-copy h1, .publish-card h1, .profile-hero h1 { font-size: 36px; }
  .hero-desc, .profile-desc { font-size: 16px; }
  .profile-hero, .user-hero, .profile-main, .chat-input-row, .chat-header, .post-simple, .panel-title-row {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }
  .composer-top { align-items: stretch; }
  .composer-main { width: 100%; }
  .detail-gallery { grid-template-columns: 1fr; }
  .media-card.large { min-height: 220px; }
  .detail-thumb {
    width: 92px;
    height: 92px;
  }
  .post-simple-body {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }
  .post-simple-media { width: 100%; }
  .input-action-row { grid-template-columns: 1fr; }
  .code-btn { width: 100%; }
  .profile-stats-grid, .feature-grid, .info-grid, .settings-form-grid { grid-template-columns: 1fr; }
  .posts-browser-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .posts-browser-meta {
    text-align: left;
  }
  .chat-body { min-height: 320px; }
  .bubble { max-width: 88%; }
  .user-card, .user-card-main {
    flex-direction: column;
    align-items: flex-start;
  }
  .phone-inline-row {
    grid-template-columns: 1fr;
  }
  .manage-actions, .user-card-actions {
    justify-content: flex-start;
  }
  .settings-action-row,
  .app-dialog-actions {
    width: 100%;
    justify-content: stretch;
  }
  .settings-action-row .btn,
  .app-dialog-actions .btn {
    width: 100%;
  }
}
