:root {
  --bg: #000000;
  --bg-elevated: #16181c;
  --bg-hover: #080808;
  --border: #2f3336;
  --text: #e7e9ea;
  --text-muted: #71767b;
  --accent: #1d9bf0;
  --accent-dim: #1a8cd8;
  --green: #00ba7c;
  --pink: #f91880;
  --w-purple: #28004e;
  --w-mint: #1df2ba;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --feed-width: 600px;
  --sidebar-width: 275px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-size: 0.85em;
  background: var(--bg-elevated);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.app {
  display: flex;
  justify-content: center;
  min-height: 100vh;
  max-width: 1300px;
  margin: 0 auto;
}

.sidebar {
  width: var(--sidebar-width);
  padding: 0 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.sidebar-right {
  width: 350px;
  flex-shrink: 0;
  padding: 0 0 0 24px;
}

.right-rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 100vh;
  overflow-y: auto;
  padding: 8px 0 24px;
  scrollbar-width: none;
}

.right-rail::-webkit-scrollbar {
  display: none;
}

#sidebar-auth {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
}

.rail-login-card {
  padding: 16px;
}

.rail-login-card.hidden {
  display: none;
}

.rail-login-text {
  margin: 0 0 12px;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
}

.rail-login-btn {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}

.rail-login-btn:hover {
  opacity: 0.9;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: 100%;
  padding: 12px;
  margin-bottom: 2px;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s;
}

.brand:hover {
  background: var(--bg-elevated);
  text-decoration: none;
}

.brand-logo {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px;
  border-radius: 999px;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.2;
  transition: background 0.15s;
}

.nav-item:hover {
  background: var(--bg-elevated);
  text-decoration: none;
}

.nav-item.active {
  font-weight: 700;
}

.nav-item.active .nav-icon svg {
  stroke-width: 2.25;
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  color: var(--text);
}

.nav-icon svg {
  width: 26px;
  height: 26px;
  display: block;
}

.nav-label {
  flex: 1;
  min-width: 0;
}

.feed-column {
  width: var(--feed-width);
  min-height: 100vh;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.feed-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  background: rgba(0, 0, 0, 0.65);
  border-bottom: 1px solid var(--border);
}

.feed-header h1 {
  padding: 12px 16px 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.feed-header-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.feed-header-top h1 {
  padding-top: 12px;
  padding-bottom: 0;
}

.back-btn {
  margin: 8px 0 0 8px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
}

.back-btn:hover { background: var(--bg-elevated); }
.back-btn.hidden { display: none; }

.feed-tabs.hidden { display: none; }

.feed-tabs {
  display: flex;
  height: 53px;
}

.tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  position: relative;
}

.tab.active { color: var(--text); font-weight: 700; }

.tab.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(56px, 80%);
  height: 4px;
  background: var(--accent);
  border-radius: 999px;
}

.tab[data-feed-filter="native"] {
  font-size: 0.88rem;
}

.tab:disabled { opacity: 0.4; cursor: not-allowed; }

.new-posts-banner {
  position: sticky;
  top: 106px;
  z-index: 9;
  background: var(--accent);
  color: #fff;
  text-align: center;
  padding: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.new-posts-banner:hover { background: var(--accent-dim); }
.new-posts-banner.hidden { display: none; }

.feed { min-height: 200px; }
.feed.hidden { display: none; }

.search-view,
.thread-view,
.users-view,
.stats-view,
.notifications-view,
.profile-view {
  min-height: 200px;
}

.search-view.hidden,
.thread-view.hidden,
.users-view.hidden,
.stats-view.hidden,
.profile-view.hidden { display: none; }

.users-list-header {
  padding: 12px 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  display: grid;
  gap: 10px;
}

.users-search {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.users-search:focus {
  outline: 2px solid rgba(29, 155, 240, 0.35);
  border-color: var(--accent);
}

.stats-section {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.stats-section:last-child {
  border-bottom: none;
}

.stats-section-title {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stats-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
}

.stat-note {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.stats-meta {
  margin: 12px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.stats-trends-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.stats-trend-item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 0;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.stats-trend-item:hover,
.stats-trend-item:focus-visible {
  color: var(--accent);
  outline: none;
}

.stats-trend-rank {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.stats-trend-tag {
  font-weight: 600;
}

.stats-trend-count {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.stats-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Login modal — X-style overlay */
.login-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px;
  overflow-y: auto;
}

.login-modal.hidden {
  display: none;
}

body.login-modal-open {
  overflow: hidden;
}

.login-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(91, 112, 131, 0.4);
}

.login-modal-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 600px;
  margin: auto;
  background: var(--bg);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
}

.login-modal-close {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-modal-close:hover {
  background: rgba(231, 233, 234, 0.1);
}

.login-modal-body {
  padding: 48px 80px 40px;
}

.login-modal-logo {
  display: flex;
  justify-content: center;
}

.login-modal-logo svg {
  width: 40px;
  height: 40px;
}

.login-modal-title {
  margin: 20px 0 0;
  font-size: 1.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.login-modal-subtitle {
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.login-error {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(244, 33, 46, 0.1);
  border: 1px solid rgba(244, 33, 46, 0.25);
  color: #f4212e;
  font-size: 0.88rem;
  line-height: 1.4;
}

.login-form {
  margin-top: 28px;
  display: grid;
  gap: 12px;
}

.login-field {
  display: block;
}

.login-field input {
  width: 100%;
  height: 56px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.login-field input::placeholder {
  color: var(--text-muted);
}

.login-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.login-input-wrap {
  position: relative;
  display: block;
}

.login-input-wrap input {
  padding-right: 64px;
}

.login-password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.login-password-toggle:hover {
  background: rgba(29, 155, 240, 0.1);
}

.login-submit {
  margin-top: 8px;
  height: 52px;
  border: none;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}

.login-submit:hover:not(:disabled) {
  opacity: 0.9;
}

.login-submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

.login-modal-hint {
  margin: 24px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.login-modal-hint strong {
  color: var(--text);
  font-weight: 600;
}

.login-inline-link {
  color: var(--accent);
  text-decoration: none;
}

.login-inline-link:hover {
  text-decoration: underline;
}

@media (max-width: 700px) {
  .login-modal-body {
    padding: 48px 32px 32px;
  }
}

.sidebar-auth {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
}

.sidebar-auth-link,
.rail-footer-link {
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
}

.sidebar-auth-link:hover,
.rail-footer-link:hover {
  text-decoration: underline;
  color: var(--text-muted);
}

.sidebar-auth-btn,
.rail-footer-btn {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  cursor: pointer;
}

.rail-footer-static {
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.3;
  white-space: nowrap;
}

.sidebar-auth-sep {
  display: none;
}

.footer-meta {
  margin: 0;
  display: inline;
}

.nav-item.hidden {
  display: none;
}

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.nav-badge.hidden {
  display: none;
}

.notifications-view {
  min-height: 200px;
}

.notifications-view.hidden {
  display: none;
}

.notifications-list {
  display: grid;
}

.notification-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.notification-item:hover,
.notification-item:focus-visible {
  background: var(--bg-hover);
  outline: none;
}

.notification-item--unread {
  background: rgba(29, 155, 240, 0.06);
}

.notification-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.notification-line {
  display: block;
  line-height: 1.4;
}

.notification-line strong {
  margin-right: 4px;
}

.notification-action {
  color: var(--text-muted);
}

.notification-time {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.notification-preview {
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.notification-toast.hidden {
  display: none;
}

@media (max-width: 640px) {
  .stats-grid,
  .stats-grid-3 {
    grid-template-columns: 1fr;
  }
}

.user-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  color: inherit;
  text-decoration: none;
}

.user-card:hover,
.user-card:focus-visible {
  background: var(--bg-hover);
  outline: none;
}

.user-card-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
}

.user-card-stats {
  display: flex;
  gap: 16px;
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.user-card-stats strong {
  color: var(--text);
}

.profile-header {
  border-bottom: 1px solid var(--border);
}

.profile-banner {
  height: 200px;
  background: linear-gradient(135deg, var(--w-purple), #1a1a2e 55%, var(--w-mint));
  background-size: cover;
  background-position: center;
}

.profile-main {
  padding: 12px 16px 0;
  position: relative;
}

.profile-avatar-wrap {
  margin-top: -36px;
  margin-bottom: 12px;
}

.avatar-lg,
.avatar-fallback.avatar-lg {
  width: 84px;
  height: 84px;
  border: 4px solid var(--bg);
  font-size: 2rem;
}

.profile-display-name {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
}

.profile-handle {
  color: var(--text-muted);
  margin-top: 2px;
}

.profile-bio {
  margin-top: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.profile-stats strong {
  color: var(--text);
}

.profile-tabs {
  margin-top: 0;
}

.profile-tabs.feed-tabs {
  border-top: 1px solid var(--border);
}

.profile-posts .post,
.profile-posts .empty {
  border-bottom: 1px solid var(--border);
}

.post-avatar-link,
.profile-link {
  color: inherit;
  text-decoration: none;
}

.post-avatar-link:hover,
.profile-link:hover {
  text-decoration: underline;
}

.post-header .profile-link {
  display: inline;
}

.search-section h2 {
  padding: 12px 16px 8px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

.actor-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.actor-card:hover,
.actor-card:focus-visible {
  background: var(--bg-hover);
  outline: none;
}

.actor-description {
  margin-top: 4px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.actor-meta {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.post-text mark,
.actor-body mark,
.actor-header mark {
  background: rgba(29, 155, 240, 0.25);
  color: var(--text);
  border-radius: 2px;
  padding: 0 2px;
}

.post {
  cursor: pointer;
}

.post:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.thread-conversation {
  --thread-avatar: 40px;
  --thread-gutter: 16px;
  --thread-rail-x: calc(var(--thread-gutter) + var(--thread-avatar) / 2 - 1px);
  padding-top: 4px;
}

.thread-item {
  position: relative;
}

.thread-item > .post.in-thread {
  border-bottom: none;
  padding: 10px var(--thread-gutter) 0;
  background: transparent;
  grid-template-columns: var(--thread-avatar) 1fr;
  gap: 12px;
  animation: none;
  position: relative;
}

.thread-item > .post.in-thread:hover {
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.thread-item--focal > .post.in-thread {
  padding-top: 12px;
  padding-bottom: 4px;
  cursor: default;
}

.thread-conversation.has-ancestors .thread-item--focal > .post.in-thread {
  border-top: 1px solid var(--border);
}

.thread-item--focal > .post.in-thread:hover {
  background: transparent;
}

.thread-item[data-connect="true"] > .post.in-thread::after {
  content: "";
  position: absolute;
  left: var(--thread-rail-x);
  top: calc(var(--thread-gutter) + var(--thread-avatar) + 4px);
  bottom: 0;
  width: 2px;
  background: var(--border);
  pointer-events: none;
  z-index: 0;
}

.thread-item .post-avatar-link,
.thread-item .avatar,
.thread-item .avatar-fallback {
  position: relative;
  z-index: 1;
}

.thread-item--ancestor > .post.in-thread {
  padding: 12px var(--thread-gutter) 0;
  cursor: pointer;
}

.thread-item--ancestor > .post.in-thread:hover {
  background: rgba(231, 233, 234, 0.03);
}

.thread-item--ancestor .post-text {
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.3125;
  white-space: pre-wrap;
}

.thread-item--ancestor .post-actions {
  max-width: 425px;
  margin-top: 8px;
  padding-bottom: 8px;
}

.thread-item--focal .post-text {
  font-size: 1.0625rem;
  line-height: 1.4;
}

.thread-item--focal .post-actions {
  margin-top: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  max-width: 100%;
}

.thread-replies-list {
  padding-bottom: 24px;
}

.thread-item--reply > .post.in-thread {
  padding-top: 12px;
}

.thread-item--reply .post-actions {
  max-width: 425px;
}

.thread-nested {
  margin-left: 0;
}

.thread-empty-state {
  padding: 32px 16px 48px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  border-top: 1px solid var(--border);
}

.thread-blocked {
  padding: 12px 16px 12px calc(var(--thread-gutter) + var(--thread-avatar) + 12px);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
}

.post.is-focal {
  background: transparent;
}

.reply-context {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  cursor: pointer;
}

.reply-context:hover {
  color: var(--accent);
  text-decoration: underline;
}

.thread-root {
  border-bottom: 1px solid var(--border);
}

.thread-focal .post,
.thread-root .post {
  cursor: default;
}

.thread-focal .post:hover,
.thread-root .post:hover { background: transparent; }

.thread-ancestors {
  border-bottom: 1px solid var(--border);
}

.thread-ancestor {
  position: relative;
  padding-left: 16px;
  border-left: 2px solid var(--border);
  margin-left: 28px;
}

.thread-ancestor .post {
  cursor: pointer;
  opacity: 0.85;
}

.thread-ancestor .post:hover {
  opacity: 1;
  background: var(--bg-hover);
}

.thread-ancestor:last-child {
  padding-bottom: 4px;
}

.thread-replies {
  padding-bottom: 24px;
}

.thread-branch {
  position: relative;
  margin-left: 28px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}

.thread-branch .thread-branch {
  margin-left: 12px;
}

.thread-branch > .post.is-reply .avatar,
.thread-branch > .post.compact .avatar,
.thread-branch > .post.is-reply .avatar-fallback,
.thread-branch > .post.compact .avatar-fallback {
  width: 32px;
  height: 32px;
}

.thread-empty {
  padding: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.loading, .empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--text-muted);
}

.post {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  animation: fadeIn 0.35s ease;
}

.post:hover { background: var(--bg-hover); }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.post.is-new {
  animation: highlight 1.2s ease;
}

@keyframes highlight {
  0% { background: rgba(29, 155, 240, 0.15); }
  100% { background: transparent; }
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-elevated);
}

.avatar-fallback {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--w-purple), var(--w-mint));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
}

.post-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  line-height: 1.2;
}

.post-header-main {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.post-delete-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: -4px -4px 0 0;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.post-delete-btn svg {
  width: 16px;
  height: 16px;
}

.post-delete-btn:hover {
  color: #f4212e;
  background: rgba(244, 33, 46, 0.1);
}

.post-delete-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.display-name {
  font-weight: 700;
  color: var(--text);
}

.handle, .dot, .time, a.post-permalink.time {
  color: var(--text-muted);
  font-size: 0.9rem;
}

a.post-permalink.time {
  text-decoration: none;
}

a.post-permalink.time:hover {
  text-decoration: underline;
}

.w-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--w-purple);
  color: var(--w-mint);
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
}

.post-text {
  margin-top: 4px;
  font-size: 0.95rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-text a { word-break: break-all; }

.post-images {
  margin-top: 12px;
  display: grid;
  gap: 2px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.post-images.count-1 { grid-template-columns: 1fr; }
.post-images.count-2 { grid-template-columns: 1fr 1fr; }
.post-images.count-3,
.post-images.count-4 { grid-template-columns: 1fr 1fr; }

.post-images img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  display: block;
  background: var(--bg-elevated);
}

.post-embed {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-elevated);
  color: inherit;
  text-decoration: none;
  transition: background 0.15s;
}

.post-embed:hover {
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
}

.embed-thumb {
  width: 120px;
  min-height: 80px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg);
}

.embed-body {
  padding: 12px 14px 12px 0;
  min-width: 0;
}

.embed-domain {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.embed-title {
  display: block;
  font-size: 0.95rem;
  line-height: 1.35;
  color: var(--text);
}

.embed-description {
  margin-top: 6px;
  font-size: 0.85rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.post-actions {
  display: flex;
  justify-content: space-between;
  max-width: 425px;
  margin-top: 12px;
  color: var(--text-muted);
}

.action {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  min-width: 0;
}

button.action {
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.action svg { width: 18px; height: 18px; }

.action.replies:hover,
.reply-btn:hover { color: var(--accent); }
.action.reposts:hover { color: var(--green); }
.like-btn {
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
}
.action.likes:hover,
.like-btn:hover { color: var(--pink); }
.post.is-liked .like-btn {
  color: var(--pink);
}

.post.is-replying .reply-btn {
  color: var(--accent);
}

.reply-compose {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.reply-compose.hidden {
  display: none;
}

.reply-compose-inner {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: start;
}

.reply-compose-main {
  display: grid;
  gap: 10px;
}

.reply-input {
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  line-height: 1.4;
  resize: vertical;
}

.reply-input:focus {
  outline: 2px solid rgba(29, 155, 240, 0.35);
  border-color: var(--accent);
}

.reply-compose-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.reply-cancel,
.reply-submit {
  padding: 8px 16px;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.reply-cancel {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

.reply-cancel:hover {
  background: var(--bg-hover);
}

.reply-submit {
  border: none;
  background: var(--accent);
  color: #fff;
}

.reply-submit:hover:not(:disabled) {
  filter: brightness(1.05);
}

.reply-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.reply-error {
  margin: 0;
  font-size: 0.85rem;
  color: #f4212e;
}

.post-compose-wrap {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.post-compose-wrap.hidden {
  display: none;
}

.post-compose {
  padding: 12px 16px 16px;
}

.post-compose-inner {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: start;
}

.post-compose-main {
  display: grid;
  gap: 10px;
}

.post-compose-input {
  width: 100%;
  min-height: 84px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1.15rem;
  line-height: 1.45;
  resize: none;
}

.post-compose-input::placeholder {
  color: var(--muted);
}

.post-compose-input:focus {
  outline: none;
}

.post-compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.post-compose-count {
  font-size: 0.85rem;
  color: var(--muted);
}

.post-compose-count.is-near-limit {
  color: #f4212e;
}

.post-compose-submit {
  padding: 8px 18px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.post-compose-submit:hover:not(:disabled) {
  filter: brightness(1.05);
}

.post-compose-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.post-compose-error {
  margin: 0;
  color: #f4212e;
  font-size: 0.9rem;
}

.post-compose-error.hidden {
  display: none;
}

.nav-post {
  width: 100%;
  text-align: left;
  cursor: pointer;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
}

.nav-post .nav-label {
  font-weight: 700;
}

@media (min-width: 1100px) {
  .nav-post {
    margin-top: 4px;
    padding: 12px 16px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    justify-content: center;
  }

  .nav-post .nav-icon {
    display: none;
  }

  .nav-post .nav-label {
    text-align: center;
    width: 100%;
  }

  .nav-post:hover {
    filter: brightness(1.05);
    background: var(--accent);
  }
}

.load-more-wrap {
  padding: 16px;
  text-align: center;
}

.load-more-wrap.hidden { display: none; }

.load-more-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 10px 24px;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.load-more-btn:hover { background: rgba(29, 155, 240, 0.1); }

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 42px;
  padding: 0 16px;
  background: var(--bg-elevated);
  border: 1px solid transparent;
  border-radius: 999px;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  cursor: text;
}

.search-box:focus-within {
  background: var(--bg);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.search-box input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  outline: none;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

.search-clear svg {
  width: 14px;
  height: 14px;
}

.search-clear.hidden {
  display: none;
}

.search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
}

.search-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.rail-card {
  background: var(--bg-elevated);
  border-radius: 16px;
  overflow: hidden;
}

.rail-card h2 {
  font-size: 1.25rem;
  font-weight: 800;
  padding: 12px 16px;
  line-height: 1.25;
}

.rail-card-more {
  display: block;
  padding: 16px;
  color: var(--accent);
  font-size: 0.9375rem;
  text-decoration: none;
  transition: background 0.15s;
}

.rail-card-more:hover {
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
}

.card {
  background: var(--bg-elevated);
  border-radius: 16px;
  margin-bottom: 16px;
  overflow: hidden;
}

.card h2 {
  font-size: 1.25rem;
  font-weight: 800;
  padding: 12px 16px;
}

.trends-list {
  list-style: none;
}

.trends-list li {
  padding: 12px 16px;
  transition: background 0.15s;
}

.trend-item {
  cursor: pointer;
}

.trend-item:hover,
.trend-item:focus-visible {
  background: rgba(255, 255, 255, 0.03);
  outline: none;
}

.trend-item-static,
.trend-item-empty {
  cursor: default;
}

.trend-item-static:hover,
.trend-item-empty:hover {
  background: transparent;
}

.trends-loading {
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: default;
}

.trend-meta {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.trends-list strong {
  display: block;
  margin-top: 2px;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.3;
}

.trend-count {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.3;
}

.rail-footer {
  padding: 4px 0 0;
}

.rail-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
}

.nav-item.hidden {
  display: none;
}

@media (max-width: 1100px) {
  .sidebar-right { display: none; }
}

@media (max-width: 900px) {
  .sidebar-left { display: none; }
  .feed-column {
    width: 100%;
    border: none;
  }
}
