@import "tailwindcss";

:root {
  /* Synapsis Design System - Vercel-inspired Dark Theme */

  /* Base Colors */
  --background: #0a0a0a;
  --background-secondary: #111111;
  --background-tertiary: #171717;

  /* Border Colors */
  --border: #262626;
  --border-hover: #404040;

  /* Text Colors */
  --foreground: #ededed;
  --foreground-secondary: #a1a1a1;
  --foreground-tertiary: #666666;

  /* Accent - Cyan */
  --accent: #ffffff;
  --accent-hover: #f4f4f4;
  --accent-muted: rgba(255, 255, 255, 0.1);

  /* Status Colors */
  --error: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);

  /* Spacing */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Hide scrollbars globally but keep functionality */
::-webkit-scrollbar {
  display: none;
}

* {
  -ms-overflow-style: none;
  /* IE and Edge */
  scrollbar-width: none;
  /* Firefox */
}

/* Links */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--background-secondary);
  color: var(--foreground);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn:hover {
  background: var(--background-tertiary);
  border-color: var(--border-hover);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

.btn-primary:hover,
.btn-primary:link:hover,
.btn-primary:visited:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #000;
}

/* Ensure links styled as buttons don't inherit link colors */
a.btn-primary,
a.btn-primary:link,
a.btn-primary:visited {
  color: #000;
}

.btn-ghost {
  background: var(--background-tertiary);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--background-tertiary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 16px;
}

/* Inputs */
.input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--foreground);
  transition: border-color 0.15s ease;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
}

.input::placeholder {
  color: var(--foreground-tertiary);
}

/* Cards */
.card {
  background: var(--background-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

/* Dividers */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* Avatar */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--background-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--foreground-secondary);
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-row .avatar {
  flex-shrink: 0;
}

.user-row .avatar img {
  object-fit: contain;
  background: var(--background-tertiary);
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 24px;
}

/* Layout */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 16px;
}

.layout {
  display: flex;
  justify-content: center;
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
}


.sidebar {
  width: 240px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 20;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
}

.main {
  flex: 1;
  max-width: 600px;
  min-width: 0;
  min-height: 100vh;
  border-right: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.layout.hide-right-sidebar .main {
  flex: 1 !important;
  max-width: 100% !important;
  width: 100%;
}

.aside {
  width: 320px;
  flex-shrink: 0;
  padding: 16px;
  padding-bottom: 32px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

/* Thread Container */
.thread-container {
  position: relative;
  border-bottom: none;
}

.thread-container>.post {
  border-bottom: none;
  padding-bottom: 0;
}

.thread-container>.post .post-actions {
  display: none;
}

.thread-line {
  position: absolute;
  left: 35px;
  width: 2px;
  background: var(--border);
  top: 52px;
  bottom: -16px;
  z-index: 1;
}

.post.thread-parent {
  border-bottom: none;
  padding-bottom: 4px;
}

.post.thread-parent .post-content {
  color: var(--foreground-secondary);
  font-size: 14px;
}

.post.thread-parent .post-header {
  margin-bottom: 4px;
}

.post.thread-parent+.post {
  padding-top: 8px;
}

.post.embedded {
  margin-top: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background);
}

.post.embedded:hover {
  background: var(--background-secondary);
}

.post.embedded .post-link-overlay {
  border-radius: inherit;
}

/* Post */
.post {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.post:hover {
  background: var(--background-secondary);
}

.post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.post-author {
  display: flex;
  flex-direction: column;
}

.post-handle {
  font-weight: 600;
  color: var(--foreground);
}

.post-time {
  font-size: 13px;
  color: var(--foreground-tertiary);
}

.post-content {
  margin-bottom: 12px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.post-content a,
.post-content .mention-link {
  position: relative;
  z-index: 2;
}

.mention-link {
  color: var(--accent);
  font-weight: 550;
  text-decoration: none;
}

.mention-link:hover,
.mention-link:focus-visible {
  text-decoration: underline;
}

.repost-event-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 13px;
}

.repost-event-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.repost-event-text a {
  color: inherit;
  font-weight: 600;
}

.repost-event-copy {
  color: var(--foreground-secondary);
}

.repost-embed {
  margin-top: 4px;
}

.post-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.post-reason-chip {
  font-size: 12px;
  color: var(--foreground-secondary);
  background: var(--background-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px 8px;
}

.post-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.post-media-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--background-tertiary);
}

.post-media-item.audio {
  grid-column: 1 / -1;
  overflow: visible;
}

.audio-player {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 92px;
  padding: 16px;
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 10% 50%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 42%),
    var(--background-secondary);
}

.audio-player-toggle {
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--background);
  background: var(--accent);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.audio-player-toggle:hover {
  filter: brightness(1.08);
  transform: scale(1.04);
}

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

.audio-player-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
  overflow: hidden;
  color: var(--foreground);
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-player-progress {
  display: block;
  width: 100%;
  height: 4px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.audio-player-time {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  color: var(--foreground-tertiary);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.post-media-item img {
  width: 100%;
  height: auto;
  max-height: min(80vh, 900px);
  object-fit: contain;
  display: block;
}

/* Fill letterboxed image space with a glow derived from the image itself. */
.blurred-image-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #000;
  isolation: isolate;
}

.post-media-item .blurred-image-bg {
  position: absolute;
  inset: -32px;
  width: calc(100% + 64px);
  height: calc(100% + 64px);
  max-height: none;
  object-fit: cover;
  filter: blur(28px) brightness(0.48) saturate(1.15);
  pointer-events: none;
  z-index: 0;
}

.post-media-item .blurred-image-main {
  position: relative;
  z-index: 1;
}

.post-media-item video {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  display: block;
  cursor: pointer;
  background: #000;
}

/* Blurred background video effect */
.blurred-video-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #000;
}

.blurred-video-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%) scale(1.2);
  object-fit: cover;
  filter: blur(25px) brightness(0.5);
  pointer-events: none;
  z-index: 0;
}

.blurred-video-main {
  position: relative;
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  cursor: pointer;
  z-index: 1;
}

/* Override post-media-item video styles for blurred container */
.post-media-item .blurred-video-container video {
  background: transparent;
}

.video-embed-container {
  position: relative;
  padding-bottom: 56.25%;
  /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  border: 1px solid var(--border);
  background: #000;
  z-index: 2;
}

.video-embed-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.post-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.post-actions-primary,
.post-actions-secondary {
  display: flex;
  align-items: center;
  gap: 24px;
}

.post-actions-secondary {
  margin-left: auto;
}

.post-share-control {
  position: relative;
  display: flex;
}

.post-share-backdrop {
  position: fixed;
  inset: 0;
  z-index: 109;
}

.post-share-menu {
  position: absolute;
  right: -12px;
  bottom: calc(100% + 12px);
  z-index: 110;
  width: max-content;
  min-width: 230px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--background-secondary);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
}

.post-share-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.post-share-menu button:hover,
.post-share-menu button:focus-visible {
  background: var(--background-tertiary);
  outline: none;
}

.chat-share-intent {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent) 12%, var(--background));
  color: var(--foreground-secondary);
  font-size: 13px;
  text-align: center;
}

.post-action {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--foreground-tertiary);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.15s ease;
  background: none;
  border: none;
  padding: 0;
}

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

.post-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.post-action.reposted {
  color: var(--accent);
}

.post-action.delete-action:hover {
  color: #ef4444;
}

/* User rows (followers/following) */
.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  color: var(--foreground);
  transition: background 0.15s ease;
}

.user-row:hover {
  background: var(--background-secondary);
}

.user-row-content {
  min-width: 0;
}

.user-row-bio {
  color: var(--foreground-secondary);
  font-size: 13px;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Compose */
.compose {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.compose-input {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  font-size: 16px;
  border: none;
  background: transparent;
  color: var(--foreground);
  resize: none;
}

.compose-input:focus {
  outline: none;
}

.compose-input::placeholder {
  color: var(--foreground-tertiary);
}

.compose-mention-field {
  position: relative;
}

.compose-mention-suggestions {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 8px;
  right: 8px;
  max-height: 288px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.compose-mention-suggestion {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--foreground);
  text-align: left;
  cursor: pointer;
}

.compose-mention-suggestion:hover,
.compose-mention-suggestion.selected {
  background: var(--background-secondary);
}

.compose-mention-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  overflow: hidden;
  border-radius: 50%;
}

.compose-mention-avatar img,
.compose-mention-avatar .avatar-fallback {
  width: 100%;
  height: 100%;
}

.compose-mention-identity {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.compose-mention-name,
.compose-mention-handle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compose-mention-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
}

.compose-mention-handle,
.compose-mention-loading {
  color: var(--foreground-tertiary);
  font-size: 13px;
}

.compose-mention-bot {
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--foreground-secondary);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.compose-mention-loading {
  padding: 12px;
}

.compose-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.compose-footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.compose-nsfw-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--foreground-tertiary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.compose-nsfw-toggle:hover {
  background: var(--background-secondary);
  color: var(--foreground-secondary);
}

.compose-nsfw-toggle input {
  display: none;
}

.compose-nsfw-toggle input:checked+svg {
  color: var(--warning);
}

.compose-nsfw-toggle input:checked~span {
  color: var(--warning);
  font-weight: 500;
}

.compose-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.compose-media-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  align-items: flex-start;
}

.compose-media-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--background-tertiary);
  max-height: 80px;
}

.compose-media-item img {
  height: 80px;
  width: auto;
  display: block;
}

.compose-media-item video {
  height: 80px;
  width: auto;
  display: block;
}

.compose-media-item.audio {
  width: min(100%, 320px);
  max-height: none;
}

.compose-audio-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  height: 80px;
  padding: 0 38px 0 14px;
  color: var(--foreground-secondary);
  background: color-mix(in srgb, var(--accent) 8%, var(--background-tertiary));
}

.compose-audio-preview span {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compose-media-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  border: none;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}

.compose-media-button {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  color: var(--foreground-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  padding: 0;
  background: transparent;
}

.compose-media-button:hover {
  background: var(--background-tertiary);
  color: var(--accent);
}

.compose-media-input {
  display: none;
}

.compose-media-error {
  margin-top: 8px;
  color: var(--error);
  font-size: 13px;
}

/* Global post composer */
.global-compose-fab {
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 900;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  min-height: 58px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--background);
  background: var(--accent);
  box-shadow: 0 12px 34px color-mix(in srgb, var(--accent) 28%, rgba(0, 0, 0, 0.55));
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.global-compose-fab:hover {
  filter: brightness(1.08);
  transform: translateY(-2px) scale(1.03);
}

.global-compose-fab:active {
  transform: scale(0.96);
}

.global-compose-overlay {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 32px 24px;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.055), transparent 38%),
    rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(16px) saturate(0.8);
  -webkit-backdrop-filter: blur(16px) saturate(0.8);
  animation: globalComposeFadeIn 0.16s ease-out;
}

.global-compose-modal {
  position: relative;
  isolation: isolate;
  width: min(680px, 100%);
  overflow: visible;
  border: 1px solid color-mix(in srgb, var(--border-hover) 72%, transparent);
  border-radius: 26px;
  background: linear-gradient(180deg, #141414 0%, #0d0d0d 100%);
  box-shadow:
    0 36px 120px rgba(0, 0, 0, 0.78),
    0 0 0 1px rgba(255, 255, 255, 0.025) inset;
  animation: globalComposeRiseIn 0.2s ease-out;
}

.global-compose-modal::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0 12% auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.38), transparent);
}

.global-compose-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
}

.global-compose-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.global-compose-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.global-compose-heading-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

.global-compose-heading p {
  margin: 2px 0 0;
  color: var(--foreground-tertiary);
  font-size: 12px;
}

.global-compose-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--foreground-secondary);
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
}

.global-compose-close:hover {
  color: var(--foreground);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.07);
}

.global-compose-identity {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 24px 0;
}

.global-compose-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: var(--background-tertiary);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.025);
}

.global-compose-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.global-compose-identity-copy {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
}

.global-compose-identity-copy > span {
  overflow: hidden;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-compose-identity-copy small {
  overflow: hidden;
  color: var(--foreground-tertiary);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-compose-audience {
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--foreground-secondary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.025);
}

.global-compose-modal .compose {
  padding: 8px 24px 22px;
  border-bottom: 0;
}

.global-compose-modal .compose-mention-field {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 17px;
  background: rgba(0, 0, 0, 0.22);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.025) inset;
}

.global-compose-modal .compose-input {
  min-height: 142px;
  padding: 18px;
  font-size: 18px;
  line-height: 1.5;
}

.global-compose-modal .compose-mention-suggestions {
  position: relative;
  inset: auto;
  z-index: 1;
  max-height: min(272px, 36dvh);
  margin: -4px 10px 10px;
  border-color: rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  background: #101010;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
}

.global-compose-modal .compose-footer {
  margin-top: 18px;
  padding-top: 17px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.global-compose-modal .compose-actions .btn-primary {
  min-width: 88px;
  padding: 9px 20px;
  border-radius: 999px;
  font-weight: 650;
}

@keyframes globalComposeFadeIn {
  from { opacity: 0; }
}

@keyframes globalComposeRiseIn {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
}

@media (max-width: 768px) {
  .global-compose-fab {
    right: 18px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    width: 54px;
    height: 54px;
    min-height: 54px;
  }

  .global-compose-overlay {
    align-items: end;
    padding: 12px 10px max(12px, env(safe-area-inset-bottom));
  }

  .global-compose-modal {
    width: 100%;
    border-radius: 22px;
  }

  .global-compose-header {
    padding: 16px 16px 14px;
  }

  .global-compose-identity {
    padding: 16px 18px 0;
  }

  .global-compose-modal .compose {
    padding: 6px 18px 18px;
  }

  .global-compose-modal .compose-input {
    min-height: 116px;
    font-size: 17px;
  }
}

/* Keep feed autocomplete beneath the sticky navigation as the page scrolls. */
.home-feed-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 10, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Feed toggle + meta */
.feed-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.feed-toggle-btn {
  background: transparent;
  color: var(--foreground-secondary);
  border: none;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.feed-toggle-btn.active {
  color: #000;
  background: var(--accent);
}

.feed-meta {
  margin: 16px;
  border: 1px solid var(--border);
}

.feed-meta-title {
  font-weight: 600;
  margin-bottom: 8px;
}

.feed-meta-body {
  color: var(--foreground-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.feed-meta-weights {
  color: var(--foreground-tertiary);
  font-size: 12px;
  margin-top: 8px;
}

.feed-meta-foot {
  color: var(--foreground-tertiary);
  font-size: 12px;
  margin-top: 4px;
}

/* Install wizard */
.install-shell {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}

.install-hero {
  background: linear-gradient(135deg, rgba(0, 212, 170, 0.08), transparent 60%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}

.install-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.install-header h1 {
  font-size: 26px;
  margin-bottom: 6px;
}

.install-card {
  background: var(--background-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}

.install-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.install-card-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.install-card-desc {
  color: var(--foreground-secondary);
  font-size: 13px;
  margin-bottom: 12px;
}

.install-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.install-item {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--background);
}

.install-item.ok {
  border-color: rgba(34, 197, 94, 0.4);
}

.install-item.missing {
  border-color: rgba(239, 68, 68, 0.4);
}

.install-item-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.install-item-desc {
  font-size: 12px;
  color: var(--foreground-tertiary);
}

.install-item-status {
  font-size: 12px;
  color: var(--foreground-secondary);
  margin-top: 6px;
}

.install-hint {
  font-size: 12px;
  color: var(--foreground-tertiary);
  margin-bottom: 8px;
}

.install-subtitle {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--foreground-tertiary);
  letter-spacing: 1px;
  margin: 8px 0;
}

.install-status-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.install-status-row:last-child {
  border-bottom: none;
}

.install-body {
  color: var(--foreground-secondary);
  font-size: 13px;
  line-height: 1.6;
  margin: 12px 0;
}

.install-step-status {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.install-step-status.ok {
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.4);
}

.install-step-status.warn {
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.4);
}

.install-progress {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.install-progress-bar {
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--background-tertiary);
  overflow: hidden;
}

.install-progress-fill {
  height: 100%;
  background: var(--accent);
}

.install-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--foreground-tertiary);
}

.install-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.install-summary-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--foreground-tertiary);
  margin-bottom: 4px;
}

.install-summary-value {
  font-weight: 600;
}

/* Notifications */
.notifications-shell {
  max-width: 700px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.notifications-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

.notifications-header h1 {
  font-size: 22px;
  margin-bottom: 4px;
}

.notifications-header p {
  color: var(--foreground-tertiary);
  font-size: 13px;
}

.notifications-actions {
  display: flex;
  gap: 8px;
}

.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notification-row {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--background-secondary);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.notification-row:hover {
  border-color: var(--border-hover);
  background: var(--background-tertiary);
}

.notification-row.unread {
  border-color: rgba(255, 255, 255, 0.5);
}

.notification-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--background-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--foreground-secondary);
  overflow: hidden;
  flex-shrink: 0;
}

.notification-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.notification-content {
  min-width: 0;
  flex: 1;
}

.notification-message {
  font-weight: 600;
  margin-bottom: 6px;
}

.notification-post {
  color: var(--foreground-secondary);
  font-size: 13px;
  margin-bottom: 6px;
  line-height: 1.4;
}

.notification-meta {
  display: flex;
  gap: 12px;
  color: var(--foreground-tertiary);
  font-size: 12px;
}

.notification-link {
  color: var(--accent);
}

.notifications-empty {
  text-align: center;
  color: var(--foreground-tertiary);
  padding: 24px 0;
}

@media (max-width: 768px) {
  .install-header {
    flex-direction: column;
  }

  .notifications-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Admin */
.admin-shell {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.admin-header h1 {
  font-size: 24px;
  margin-bottom: 6px;
}

.admin-header p {
  color: var(--foreground-secondary);
}

.admin-card {
  background: var(--background-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.admin-tab {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--foreground-secondary);
  cursor: pointer;
}

.admin-tab.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-filters {
  display: flex;
  gap: 8px;
}

.pill {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--foreground-secondary);
  cursor: pointer;
}

.pill.active {
  background: var(--background-tertiary);
  color: var(--foreground);
}

.admin-stats {
  display: flex;
  gap: 12px;
  color: var(--foreground-tertiary);
  font-size: 12px;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--background);
}

.admin-row-main {
  flex: 1;
  min-width: 0;
}

.admin-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.admin-row-meta {
  color: var(--foreground-tertiary);
  font-size: 12px;
}

.admin-row-body {
  color: var(--foreground);
  margin-bottom: 6px;
}

.admin-row-sub {
  color: var(--foreground-tertiary);
  font-size: 12px;
}

.admin-row-target {
  margin-top: 6px;
  color: var(--foreground-secondary);
  font-size: 13px;
}

.admin-row-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-empty {
  text-align: center;
  color: var(--foreground-tertiary);
  padding: 24px 0;
}

.status-pill {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-pill.active {
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.4);
}

.status-pill.open {
  color: var(--accent);
  border-color: rgba(0, 212, 170, 0.4);
}

.status-pill.resolved {
  color: var(--foreground-tertiary);
  border-color: var(--border);
}

.status-pill.removed,
.status-pill.suspended {
  color: var(--error);
  border-color: rgba(239, 68, 68, 0.4);
}

.status-pill.silenced {
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.4);
}

.status-pill.visible {
  color: var(--foreground-tertiary);
}

@media (max-width: 768px) {
  .admin-row {
    flex-direction: column;
  }

  .admin-row-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

.compose-counter {
  font-size: 13px;
  color: var(--foreground-tertiary);
}

.compose-counter.warning {
  color: var(--warning);
}

.compose-counter.error {
  color: var(--error);
}

/* Navigation */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  color: var(--foreground);
  font-size: 15px;
  font-weight: 500;
  transition: background 0.15s ease;
}

.nav-item:hover {
  background: var(--background-tertiary);
}

.nav-item.active {
  color: var(--accent);
}

/* Logo */
.logo {
  font-family: var(--font-saira), 'Saira Condensed', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.logo-icon {
  /* Filter to convert black to cyan (#00d4aa) */
  filter: invert(69%) sepia(74%) saturate(402%) hue-rotate(115deg) brightness(95%) contrast(101%);
}

/* Responsive */
@media (max-width: 1024px) {
  .aside {
    display: none;
  }
}

@media (max-width: 768px) {
  /* Mobile-first optimizations */
  html {
    height: 100%;
  }

  body {
    font-size: 16px; /* Prevent zoom on input focus */
    overflow-x: hidden;
    height: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Layout adjustments */
  .layout {
    flex-direction: column;
    max-width: 100%;
    padding: 0;
  }

  .main {
    max-width: 100%;
    width: 100%;
    border-right: none;
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
    min-height: 100vh;
    order: 1;
  }

  /* Fixed bottom navigation - CRITICAL */
  .sidebar {
    position: fixed !important;
    bottom: 0 !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    border-right: none !important;
    border-left: none !important;
    border-bottom: none !important;
    border-top: 1px solid var(--border) !important;
    background: rgba(10, 10, 10, 0.98) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    z-index: 1000 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    order: 2;
    padding-bottom: env(safe-area-inset-bottom) !important;
  }

  .sidebar nav {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-around !important;
    align-items: center !important;
    padding: 4px 0 !important;
    min-height: 60px !important;
    width: 100% !important;
    margin: 0 !important;
  }

  .nav-item {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    padding: 8px 4px !important;
    min-height: 56px !important;
    font-size: 11px !important;
    border-radius: 0 !important;
    max-width: 100px !important;
    min-width: 60px !important;
    border: none !important;
    background: transparent !important;
    transition: none !important;
    color: var(--foreground-secondary) !important;
  }

  .nav-item svg {
    width: 24px !important;
    height: 24px !important;
  }

  .nav-item span {
    display: block !important;
    font-size: 10px !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
  }

  .nav-item:hover {
    background: transparent !important;
    border: none !important;
    color: var(--foreground-secondary) !important;
  }

  .nav-item:active {
    background: transparent !important;
    border: none !important;
  }

  .nav-item.active {
    background: transparent !important;
    color: var(--accent) !important;
    border: none !important;
  }

  .nav-item.active svg {
    color: var(--accent) !important;
  }

  .nav-item.active span {
    color: var(--accent) !important;
  }

  .logo {
    display: none !important;
  }

  /* Hide sidebar user info on mobile */
  .sidebar > div:not(nav) {
    display: none !important;
  }

  .sidebar .sidebar-user-info {
    display: none !important;
  }

  /* Show nav labels on mobile */
  .nav-label {
    display: inline !important;
  }

  /* Position notification dots correctly on mobile */
  .notification-dot {
    position: absolute !important;
    top: -2px !important;
    right: -6px !important;
  }

  /* Post optimizations */
  .post {
    padding: 16px;
  }

  .post-header {
    gap: 10px;
  }

  .post-content {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 12px;
  }

  .post.detail .post-content {
    font-size: 18px;
    line-height: 1.6;
  }

  /* Larger touch targets for actions */
  .post-actions {
    gap: 4px;
    margin-top: 12px;
  }

  .post-actions-primary {
    flex: 1;
    min-width: 0;
    justify-content: space-between;
    gap: 0;
  }

  .post-actions-secondary {
    flex-shrink: 0;
    gap: 0;
  }

  .post-actions-primary .post-action {
    flex: 1;
    min-width: 0;
    padding-inline: 4px;
  }

  .post-actions-secondary .post-action {
    min-width: 40px;
  }

  .post-action {
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: var(--radius-md);
    transition: background 0.15s ease;
  }

  .post-action:active {
    background: var(--background-tertiary);
  }

  .post-action svg {
    width: 20px;
    height: 20px;
  }

  /* Compose optimizations */
  .compose {
    padding: 16px;
  }

  .compose-input {
    font-size: 16px;
    min-height: 120px;
    padding: 12px;
  }

  .compose-footer {
    flex-wrap: wrap;
    gap: 12px;
  }

  .compose-actions {
    width: 100%;
    justify-content: space-between;
  }

  .btn {
    min-height: 44px;
    padding: 10px 20px;
    font-size: 15px;
  }

  .btn-primary {
    flex: 0;
    min-width: auto;
  }

  /* Avatar sizing */
  .avatar {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }

  .avatar-sm {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .avatar-lg {
    width: 80px;
    height: 80px;
    font-size: 28px;
  }

  /* Media grid */
  .post-media-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .post-media-item video {
    max-height: 400px;
  }

  /* User rows */
  .user-row {
    padding: 16px;
  }

  .user-card {
    padding: 16px;
  }

  /* Feed toggle */
  .feed-toggle {
    font-size: 14px;
  }

  .feed-toggle-btn {
    padding: 8px 16px;
    font-size: 14px;
  }

  /* Feed meta */
  .feed-meta {
    margin: 12px;
    padding: 12px;
  }

  /* Header sticky positioning */
  header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    background: rgba(10, 10, 10, 0.95);
  }

  header h1 {
    font-size: 20px;
    font-weight: 600;
  }

  /* Explore page */
  .explore-header {
    padding: 16px;
  }

  .explore-header h1 {
    font-size: 20px;
  }

  .explore-search {
    padding: 12px 16px;
  }

  .explore-search input {
    font-size: 16px;
  }

  .explore-tab {
    padding: 16px 12px;
    font-size: 15px;
  }

  /* Settings and admin pages */
  .install-shell,
  .admin-shell,
  .notifications-shell {
    padding: 16px 12px 80px;
  }

  /* Input fields */
  .input {
    font-size: 16px;
    padding: 12px 14px;
    min-height: 44px;
  }

  /* Container */
  .container {
    padding: 0 12px;
  }

  /* Link preview */
  .link-preview-card {
    margin-top: 12px;
    margin-bottom: 12px;
  }

  .link-preview-info {
    padding: 12px;
  }

  .link-preview-title {
    font-size: 16px;
  }

  /* Compose media */
  .compose-media-grid {
    gap: 8px;
    margin-top: 12px;
  }

  .compose-media-item {
    max-height: 100px;
  }

  .compose-media-item img,
  .compose-media-item video {
    height: 100px;
  }

  /* Thread line */
  .thread-line {
    left: 30px;
    top: 60px;
  }

  /* Notification adjustments */
  .notification-row {
    padding: 16px;
  }

  /* Admin adjustments */
  .admin-row {
    padding: 14px;
  }

  /* Better tap targets for all buttons */
  button {
    min-height: 44px;
  }

  /* Improve readability */
  .post-time,
  .user-card-handle,
  .notification-meta {
    font-size: 14px;
  }

  /* Video embeds */
  .video-embed-container {
    margin-bottom: 12px;
  }

  /* Scrolling improvements */
  .main {
    -webkit-overflow-scrolling: touch;
  }

  /* Safe area insets for notched devices */
  .main {
    padding-bottom: calc(70px + env(safe-area-inset-bottom)) !important;
  }

  /* Improve touch feedback */
  .post:active {
    background: var(--background-tertiary);
  }

  .user-row:active,
  .user-card:active {
    background: var(--background-tertiary);
  }

  /* Better button touch states */
  .btn:active {
    transform: scale(0.98);
  }

  /* Compose media button touch target */
  .compose-media-button {
    width: 44px;
    height: 44px;
  }

  /* Improve menu dropdown positioning on mobile */
  .post-menu-dropdown {
    right: 0;
    left: auto;
  }

  /* Better modal positioning on mobile */
  .modal {
    margin: 16px;
    max-width: calc(100vw - 32px);
  }

  /* Identity unlock prompt mobile fixes */
  .card {
    max-width: calc(100vw - 32px) !important;
  }

  /* Fix button sizing in modals */
  .card .btn {
    min-height: 44px !important;
    padding: 10px 16px !important;
    font-size: 15px !important;
  }

  .card .btn-primary {
    flex: 1 !important;
  }

  .card .btn-ghost {
    flex: 1 !important;
  }

  /* Improve form spacing */
  form {
    padding: 16px;
  }

  /* Better card spacing */
  .card {
    padding: 16px;
    margin: 12px;
  }

  /* Improve status pills */
  .status-pill {
    font-size: 10px;
    padding: 4px 8px;
  }

  /* Better admin filters on mobile */
  .admin-filters {
    flex-wrap: wrap;
  }

  /* Improve pill buttons */
  .pill {
    padding: 8px 14px;
    font-size: 13px;
  }

  /* Better explore content spacing */
  .explore-content {
    padding-bottom: 80px;
  }

  /* Improve notification row spacing */
  .notification-row {
    gap: 12px;
  }

  /* Better avatar in notifications */
  .notification-avatar {
    width: 44px;
    height: 44px;
  }

  /* Improve install grid on mobile */
  .install-grid {
    grid-template-columns: 1fr;
  }

  /* Better admin summary on mobile */
  .install-summary {
    grid-template-columns: 1fr;
  }

  /* Improve compose reply target */
  .compose-reply-target {
    padding: 12px;
    margin-bottom: 12px;
  }

  /* Better link preview on mobile */
  .link-preview-card.mini {
    max-height: 100px;
  }

  .link-preview-card.mini .link-preview-image {
    width: 100px;
    min-width: 100px;
    height: 100px;
  }

  .link-preview-card.mini .link-preview-image img {
    height: 100px;
  }

  /* Improve post menu button */
  .post-menu-btn {
    min-width: 44px;
    min-height: 44px;
  }

  /* Better video controls on mobile */
  video {
    max-width: 100%;
  }

  /* Improve blurred video container */
  .blurred-video-main {
    max-height: 400px;
  }

  /* Better emoji sizing on mobile */
  .post-content img.emoji,
  .compose-input img.emoji {
    height: 1.8em;
    width: 1.8em;
  }

  /* Improve post reasons chips */
  .post-reason-chip {
    font-size: 11px;
    padding: 4px 8px;
  }

  /* Better NSFW toggle */
  .compose-nsfw-toggle {
    padding: 8px 12px;
    font-size: 13px;
  }

  /* Improve character counter */
  .compose-counter {
    font-size: 14px;
    font-weight: 500;
  }

  /* Better footer spacing */
  .compose-footer-left {
    gap: 12px;
    flex-wrap: wrap;
  }

  /* Improve search section */
  .search-section {
    padding: 16px 12px;
  }

  .search-section h2 {
    font-size: 13px;
    margin-bottom: 12px;
  }

  /* Better swarm post styling */
  .swarm-post-card {
    padding: 16px;
  }

  .swarm-post-content {
    font-size: 16px;
  }

  /* Improve post detail view */
  .post.detail {
    padding: 20px 16px;
  }

  /* Better thread view on mobile */
  .thread-container {
    padding: 0;
  }

  .post.thread-parent {
    padding: 12px 16px;
  }

  /* Improve reply indicator */
  .post-reply-to {
    font-size: 14px;
    margin-bottom: 8px;
  }

  /* Better loading states */
  .explore-loading,
  .explore-empty {
    padding: 32px 16px;
  }

  /* Improve empty states */
  .admin-empty,
  .notifications-empty {
    padding: 32px 16px;
  }

  /* Chat page mobile optimizations */
  .chat-container {
    flex-direction: column;
  }

  .chat-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .chat-main {
    width: 100%;
    height: calc(100vh - 80px);
  }

  /* Better form inputs on mobile */
  textarea {
    font-size: 16px;
  }

  select {
    font-size: 16px;
    min-height: 44px;
  }

  /* Improve modal dialogs on mobile */
  dialog {
    max-width: calc(100vw - 32px);
    margin: 16px;
  }

  /* Better table responsiveness */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Improve code blocks on mobile */
  pre {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Better image handling */
  img {
    max-width: 100%;
    height: auto;
  }

  /* Improve settings pages */
  .settings-section {
    padding: 16px 12px;
  }

  /* Better profile pages */
  .profile-header {
    padding: 16px;
  }

  .profile-stats {
    flex-wrap: wrap;
    gap: 12px;
  }

  /* Improve bot pages */
  .bot-card {
    padding: 16px;
  }

  /* Better moderation pages */
  .moderation-card {
    padding: 16px;
  }

  /* Improve notification pages */
  .notifications-header {
    padding: 16px;
  }

  /* Better login/register pages */
  .auth-container {
    padding: 24px 16px;
  }

  /* Improve install pages */
  .install-header h1 {
    font-size: 24px;
  }

  /* Better admin pages */
  .admin-header h1 {
    font-size: 22px;
  }

  /* Improve tabs */
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Better dropdown menus */
  .dropdown-menu {
    max-width: calc(100vw - 32px);
  }

  /* Improve tooltips on mobile */
  [title] {
    position: relative;
  }

  /* Better focus states for accessibility */
  button:focus-visible,
  a:focus-visible,
  input:focus-visible,
  textarea:focus-visible,
  select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  /* Improve skeleton loaders */
  .skeleton {
    animation: pulse 1.5s ease-in-out infinite;
  }

  @keyframes pulse {
    0%, 100% {
      opacity: 1;
    }
    50% {
      opacity: 0.5;
    }
  }

  /* Better error states */
  .error-message {
    padding: 12px;
    font-size: 14px;
  }

  /* Improve success states */
  .success-message {
    padding: 12px;
    font-size: 14px;
  }

  /* Better warning states */
  .warning-message {
    padding: 12px;
    font-size: 14px;
  }

  /* Improve info states */
  .info-message {
    padding: 12px;
    font-size: 14px;
  }
}

/* Explore Page */
.explore-page {
  max-width: 700px;
  margin: 0 auto;
  min-height: 100vh;
}

.explore-header {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--background);
  z-index: 10;
  backdrop-filter: blur(12px);
}

.explore-header h1 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 16px;
}

.explore-search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--background-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  transition: border-color 0.15s ease;
}

.explore-search:focus-within {
  border-color: var(--accent);
}

.explore-search input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--foreground);
  font-size: 15px;
}

.explore-search input:focus {
  outline: none;
}

.explore-search input::placeholder {
  color: var(--foreground-tertiary);
}

.explore-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.explore-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--foreground-tertiary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.explore-tab:hover {
  color: var(--foreground-secondary);
}

.explore-tab.active {
  color: var(--foreground);
  border-bottom-color: var(--accent);
}

.explore-content {
  min-height: 300px;
}

.explore-loading,
.explore-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  color: var(--foreground-tertiary);
  text-align: center;
}

.explore-empty svg {
  width: 48px;
  height: 48px;
  opacity: 0.5;
}

.explore-posts,
.explore-users {
  display: flex;
  flex-direction: column;
}

.search-section {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.search-section h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.search-section .explore-posts,
.search-section .explore-users {
  background: var(--background-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
}

/* User Card */
.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  color: var(--foreground);
  transition: background 0.15s ease;
}

.user-card:hover {
  background: var(--background-secondary);
}

.user-card:last-child {
  border-bottom: none;
}

.user-card-info {
  min-width: 0;
  flex: 1;
}

.user-card-name {
  font-weight: 600;
  margin-bottom: 2px;
}

.user-card-handle {
  font-size: 13px;
  color: var(--foreground-tertiary);
}

.user-card-bio {
  font-size: 13px;
  color: var(--foreground-secondary);
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Swarm Post Styles */
.swarm-post-wrapper {
  border-bottom: 1px solid var(--border);
}

.swarm-post-card {
  padding: 16px;
  border: none;
  border-radius: 0;
  background: transparent;
}

.swarm-post-card:hover {
  background: var(--background-secondary);
}

.swarm-post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.swarm-post-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.swarm-post-author {
  font-weight: 600;
  font-size: 15px;
  color: var(--foreground);
}

.swarm-post-handle {
  font-size: 13px;
  color: var(--foreground-tertiary);
}

.swarm-post-content {
  font-size: 15px;
  line-height: 1.5;
  color: var(--foreground);
  white-space: pre-wrap;
  word-break: break-word;
}

.swarm-post-media {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.swarm-post-media img {
  width: 100%;
  border-radius: var(--radius-md);
  max-height: 300px;
  object-fit: cover;
}

.swarm-post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 13px;
  color: var(--foreground-tertiary);
}

.swarm-post-stats {
  color: var(--foreground-secondary);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background-color: transparent;
  border-radius: var(--radius-full);
}

/* Show scrollbar thumb when hovering over the scrollable element */
*:hover::-webkit-scrollbar-thumb {
  background-color: var(--foreground-tertiary);
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--foreground-secondary);
}

/* Link Preview Styles */
.link-preview-card {
  display: block;
  margin-top: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-decoration: none;
  background: var(--background-secondary);
  transition: border-color 0.2s;
}

.link-preview-card:hover {
  border-color: var(--accent);
}

.link-preview-image img {
  width: 100%;
  height: auto;
  max-height: 400px;
  display: block;
  object-fit: contain;
  background: var(--background-tertiary);
  border-bottom: 1px solid var(--border);
}

.link-preview-video video {
  width: 100%;
  max-height: 480px;
  display: block;
  background: #000;
  border-bottom: 1px solid var(--border);
}

.link-preview-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  background: var(--border);
}

.link-preview-gallery.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.link-preview-gallery-item {
  position: relative;
  background: var(--background-tertiary);
  min-height: 140px;
}

.link-preview-gallery.compact .link-preview-gallery-item {
  min-height: 80px;
}

.link-preview-gallery-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.link-preview-gallery-more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
}

.link-preview-info {
  padding: 12px;
}

.link-preview-title {
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 4px;
  font-size: 15px;
}

.link-preview-description {
  font-size: 13px;
  color: var(--foreground-secondary);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.link-preview-url {
  font-size: 12px;
  color: var(--foreground-tertiary);
  text-transform: lowercase;
}

/* Compose Preview */
.compose-link-preview {
  margin-top: 12px;
  position: relative;
}

.compose-link-preview-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  font-size: 12px;
}

.link-preview-card.mini {
  display: flex;
  max-height: none;
}

.link-preview-card.mini .link-preview-image {
  width: 80px;
  min-width: 80px;
  height: 80px;
  overflow: hidden;
}

.link-preview-card.mini .link-preview-image img,
.link-preview-card.mini .link-preview-image video {
  height: 80px;
  width: 80px;
  object-fit: cover;
  border-bottom: none;
  border-right: 1px solid var(--border);
}

.link-preview-card.mini .link-preview-video {
  width: 120px;
  min-width: 120px;
}

.link-preview-card.mini .link-preview-video video {
  height: 100%;
  min-height: 80px;
  border-bottom: none;
  border-right: 1px solid var(--border);
}

.link-preview-card.mini .link-preview-gallery {
  width: 120px;
  min-width: 120px;
  border-right: 1px solid var(--border);
}

.link-preview-card.mini .link-preview-info {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Reply Styles */
.post-reply-to {
  font-size: 13px;
  color: var(--foreground-tertiary);
  margin-bottom: 8px;
}

.post-reply-to a {
  color: var(--accent);
  font-weight: 500;
}

.compose-reply-target {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--background-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  margin-bottom: 12px;
}

.compose-reply-info {
  font-size: 13px;
  color: var(--foreground-secondary);
}

.compose-reply-handle {
  color: var(--accent);
  font-weight: 600;
}

.compose-reply-cancel {
  background: transparent;
  border: none;
  color: var(--foreground-tertiary);
  font-size: 12px;
  cursor: pointer;
  padding: 4px;
}

.compose-reply-cancel:hover {
  color: var(--error);
}

/* Clickable Post Card */
.post {
  position: relative;
}

.post-link-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.post-header,
.post-reply-to,
.post-media-grid,
.link-preview-card,
.post-actions {
  position: relative;
  z-index: 2;
}

.post-content {
  position: relative;
  z-index: 0;
}

/* Post Detail Styles */
.post.detail {
  padding: 24px;
}

.post.detail .post-content {
  font-size: 18px;
  line-height: 1.6;
}

.post.detail .post-time {
  font-size: 14px;
}

/* Thread view styles */
.thread-line {
  margin-left: 20px;
  border-left: 1px solid var(--border);
}


/* Big Emojis! */
.post-content img.emoji,
.compose-input img.emoji {
  display: inline;
  height: 2.5em;
  width: 2.5em;
  margin: 0 0.05em 0 0.1em;
  vertical-align: -0.5em;
}

/* Hide right sidebar layout adjustment */
.layout.hide-right-sidebar {
  max-width: 1600px;
  padding: 0 24px;
}

.layout.hide-right-sidebar .main {
  max-width: none;
  border-right: none;
}
