:root {
  --bg: #000000;
  --bg-elevated: #000000;
  --bg-card: #000000;
  --bg-hover: rgba(255, 255, 255, 0.05);
  --bg-panel: #000000;
  --border: rgba(61, 160, 253, 0.22);
  --border-strong: rgba(61, 160, 253, 0.45);
  --text: #faf6f6;
  --text-muted: rgba(250, 246, 246, 0.62);
  --brand: #3da0fd;
  --brand-soft: rgba(61, 160, 253, 0.35);
  --brand-glow: rgba(61, 160, 253, 0.18);
  --brand-hover: #2a8de8;
  --brand-light: #6bb8ff;
  --accent: #3da0fd;
  --accent-hover: #2a8de8;
  --like: #3da0fd;
  --on-brand: #000000;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --sidebar: 260px;
  --right: 320px;
  --feed-max: 640px;
  --font: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --mobile-nav-height: calc(68px + env(safe-area-inset-bottom, 0px));
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
img { display: block; max-width: 100%; }

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--right);
  max-width: 1280px;
  margin: 0 auto;
}

.sidebar-left {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 16px 14px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border-right: 1px solid var(--border);
  background: var(--bg);
}

.brand {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius);
  margin: 0 0 16px;
}
.brand:hover { background: var(--bg-hover); }

.brand-logo {
  width: min(140px, 100%);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px var(--brand-glow));
}

.nav-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 600;
  transition: background .2s, color .2s, transform .15s;
  border: 1px solid transparent;
  width: 100%;
}
.nav-item-icon {
  flex-shrink: 0;
  width: 26px;
  text-align: center;
  font-size: 20px;
  line-height: 1;
}
.nav-item-label { min-width: 0; }
.nav-item svg { width: 26px; height: 26px; fill: currentColor; }
.nav-item:hover {
  background: var(--bg-hover);
  border-color: var(--border);
}
.nav-item.active {
  font-weight: 800;
  color: var(--text);
  background: var(--brand-glow);
  border-color: var(--border-strong);
}

.btn-post {
  margin: 12px 0 20px;
  width: 100%;
  max-width: none;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  color: var(--on-brand);
  font-size: 16px;
  font-weight: 800;
  padding: 14px 20px;
  cursor: pointer;
  box-shadow: 0 8px 24px var(--brand-glow);
  letter-spacing: 0.01em;
}
.btn-post:hover {
  background: linear-gradient(135deg, var(--brand-hover), var(--brand));
  transform: translateY(-1px);
}

.account-mini {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  width: 100%;
  cursor: pointer;
}
.account-mini:hover { background: var(--bg-hover); }
.account-menu-btn {
  flex-shrink: 0;
  padding: 8px;
  font-size: 16px;
}
.header-profile-edit-btn {
  display: none;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
@media (min-width: 691px) {
  .header-profile-edit-btn:not([hidden]) {
    display: inline-flex;
  }
}
.logout-btn {
  margin-left: auto;
  padding: 8px 12px;
  font-size: 13px;
  white-space: nowrap;
  color: var(--text-muted);
}
.logout-btn:hover { color: var(--text); }

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 32px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.auth-logo { margin-bottom: 8px; text-align: center; }
.auth-logo-img {
  width: min(240px, 80vw);
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}
.auth-logo .brand-text { font-size: 32px; color: var(--brand); }
.auth-card h1 { margin: 16px 0 8px; font-size: 28px; }
.auth-sub { color: var(--text-muted); margin: 0 0 24px; }
.auth-hint { color: var(--text-muted); font-size: 12px; margin: -8px 0 16px; }
.auth-card label {
  display: block;
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 14px;
}
.auth-card input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text);
}
.auth-submit { width: 100%; padding: 14px; font-size: 16px; margin-top: 8px; }
.auth-switch { text-align: center; margin: 20px 0 12px; }
.auth-switch button {
  border: 0;
  background: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 15px;
}
.auth-demo { text-align: center; color: var(--text-muted); font-size: 13px; }
.auth-demo code { color: var(--text); }
.auth-error {
  color: var(--on-brand);
  background: var(--accent);
  padding: 10px 12px;
  border-radius: 8px;
  text-align: center;
  margin-top: 12px;
}

.auth-google-wrap { margin-top: 4px; }
.auth-google-wrap--locked {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.2);
}
.auth-human-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
  user-select: none;
}
.auth-human-check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
  accent-color: var(--brand, #3da0fd);
  cursor: pointer;
}
.auth-google-btn-host {
  display: flex;
  justify-content: center;
  min-height: 44px;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
  margin: 20px 0 16px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border, rgba(0, 0, 0, 0.12));
}
.auth-google-missing { margin-top: 16px; text-align: center; }
.auth-google-missing code { font-size: 12px; }

#verifyFields .auth-submit { margin-top: 8px; }
#verifyFields .icon-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  color: var(--accent);
}

.install-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  z-index: 250;
  padding: 10px 12px;
  transform: translateY(calc(100% + 24px));
  transition: transform 0.25s ease;
  pointer-events: none;
}
.install-banner.visible {
  transform: translateY(0);
  pointer-events: auto;
}
.install-banner-inner {
  max-width: 640px;
  margin: 0 auto;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
}
.install-banner-main {
  flex: 1;
  min-width: 0;
}
.install-banner-main strong {
  display: block;
  font-size: 15px;
  margin-bottom: 2px;
}
.install-banner-main p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.35;
}
.install-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.install-banner-actions .btn-primary {
  white-space: nowrap;
  padding: 10px 14px;
  font-size: 14px;
}
.install-banner-close {
  min-width: 36px;
  min-height: 36px;
  padding: 0;
}

.install-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: end center;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}
.install-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.72);
  cursor: pointer;
}
.install-modal-panel {
  position: relative;
  width: min(100%, 420px);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 18px 18px 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}
.install-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.install-modal-header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}
.install-modal-close {
  flex-shrink: 0;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
}
.install-modal-lead {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.4;
}
.install-modal-steps {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.install-modal-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.install-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 14px;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.install-step-text {
  flex: 1;
  font-size: 15px;
  line-height: 1.45;
  padding-top: 3px;
}
.install-modal-done {
  width: 100%;
  padding: 12px 18px;
}
body.install-modal-open {
  overflow: hidden;
}

@media (min-width: 691px) {
  .install-banner {
    bottom: 16px;
  }
}

.follow-btn.following { color: var(--accent); border-color: var(--accent); }
.suggestion-row button.following { opacity: 0.7; }

.account-mini:hover { background: var(--bg-hover); }
.account-meta { display: flex; flex-direction: column; line-height: 1.2; }
.account-meta span { color: var(--text-muted); font-size: 14px; }

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  object-fit: cover;
}

.feed-column {
  position: relative;
  min-height: 100vh;
  max-width: var(--feed-max);
  width: 100%;
  margin: 0 auto;
  padding: 12px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.feed-column.view-transition {
  animation: viewFadeIn .24s ease;
}
@keyframes viewFadeIn {
  from { opacity: .72; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.feed-header {
  position: sticky;
  top: 12px;
  z-index: 10;
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  background: rgba(0, 0, 0, 0.82);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 8px 12px;
  min-height: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}
.feed-tabs {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 6px;
  background: var(--bg-card);
  border-radius: var(--radius-pill);
  padding: 4px;
  border: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.feed-tabs::-webkit-scrollbar { display: none; }
.feed-tab {
  flex: 1 0 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 8px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  position: relative;
  transition: background .2s, color .2s, box-shadow .2s;
}
.feed-tab:hover { color: var(--text); }
.feed-tab.active {
  color: var(--on-brand);
  font-weight: 800;
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  box-shadow: 0 4px 14px var(--brand-glow);
}
.feed-tab.active::after { display: none; }
.feed-header-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.feed-admin-btn {
  font-size: 0.78rem;
  font-weight: 700;
  color: #3da0fd;
  border: 1px solid rgba(61, 160, 253, 0.45);
  border-radius: 999px;
  padding: 6px 10px;
  white-space: nowrap;
}
.feed-view-title {
  flex: 1;
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}
.feed-view-title[hidden] { display: none; }
.feed-tabs[hidden] { display: none; }
.profile-menu-trigger {
  border: 0;
  background: transparent;
  padding: 0;
  border-radius: 12px;
  cursor: pointer;
}
.profile-menu-trigger .avatar {
  border: 2px solid var(--border-strong);
}
.profile-menu-trigger:hover .avatar,
.profile-menu-trigger:focus-visible .avatar {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.composer {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.composer.composer-drag-over {
  border-color: #ea580c;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.25);
  background: rgba(234, 88, 12, 0.06);
}
.composer-body { flex: 1; }
.composer-editor-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.composer-format-bar {
  display: flex;
  align-items: center;
  gap: 4px;
}
.compose-bold-btn,
.compose-format-btn {
  min-width: 36px;
  height: 32px;
  padding: 0 10px;
  font-size: 15px;
  line-height: 1;
  border-radius: 8px;
}
.compose-format-btn strong {
  font-weight: 800;
}
.compose-format-btn em {
  font-style: italic;
  font-weight: 700;
}
.compose-format-u {
  text-decoration: underline;
  font-weight: 700;
}
.compose-format-btn.is-active {
  background: rgba(234, 88, 12, 0.18);
  border-color: #ea580c;
  color: #ea580c;
  box-shadow: 0 0 0 1px rgba(234, 88, 12, 0.35);
}
.compose-format-btn.is-active strong,
.compose-format-btn.is-active em,
.compose-format-btn.is-active .compose-format-u {
  color: #ea580c;
}
.composer textarea,
.compose-rich-editor {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  resize: none;
  font-size: 20px;
  outline: none;
  min-height: 52px;
}
.compose-rich-editor {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-y: auto;
  max-height: 40vh;
}
.compose-rich-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}
.compose-rich-editor strong {
  font-weight: 800;
}
.compose-rich-editor em {
  font-style: italic;
}
.compose-rich-editor u {
  text-decoration: underline;
}
.composer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}
.composer-tools,
.composer-submit {
  display: flex;
  align-items: center;
  gap: 8px;
}
.composer-media-btn {
  font-size: 20px;
  line-height: 1;
}
.composer-media-preview,
.composer-embed-preview {
  margin-top: 12px;
}
.composer-embed-preview .post-embed {
  margin: 0;
}
.composer-media-preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  max-width: 320px;
}
.composer-media-item {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}
.composer-media-item img,
.composer-media-item video {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  background: #000;
}
.composer-media-remove {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  padding: 8px 14px;
  cursor: pointer;
}
@media (max-width: 768px) {
  .composer-media-item video {
    max-height: min(52vh, 360px);
  }
  .composer-media-remove {
    min-height: 44px;
    padding: 10px 16px;
  }
}
.char-counter { font-size: 14px; color: var(--text-muted); min-width: 2.5em; }
.char-counter.warn { color: var(--accent); }
.char-counter.over { color: #ff6b6b; font-weight: 700; }

.btn-primary {
  border: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  color: var(--on-brand);
  font-weight: 800;
  padding: 10px 18px;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--brand-glow);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--brand-hover), var(--brand));
  transform: translateY(-1px);
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.feed { display: flex; flex-direction: column; gap: 12px; }

.post {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  padding: 16px;
  --post-bleed: 60px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.28);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.post:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.38);
}

.post-author-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 48px;
}
.post-avatar-btn {
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  line-height: 0;
}
.post-avatar-btn .avatar {
  display: block;
}
.post-follow-stats {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  text-align: center;
}
.post-follow-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}
.post-follow-stat-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.post-follow-stat-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: lowercase;
}

.post-follow-stat-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}
.post-follow-stat-btn:hover .post-follow-stat-num {
  color: var(--brand);
}
.post-follow-stats--horizontal {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  width: auto;
}
.post-follow-stats--horizontal .post-follow-stat {
  flex-direction: row;
  align-items: baseline;
  gap: 4px;
}
.post-follow-stats--horizontal .post-follow-stat-label {
  font-size: 11px;
}
.post-action-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.action-count-link {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 6px;
  min-height: 44px;
  border-radius: var(--radius);
}
.action-count-link:hover,
.action-count-link.reposted {
  color: var(--accent);
}
.user-list-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.user-list-modal[hidden] {
  display: none !important;
}
.user-list-modal-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}
.user-list-modal-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  max-height: min(70vh, 520px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.user-list-modal-title {
  margin: 0;
  font-size: 18px;
}
.user-list-modal-body {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.user-list-modal-close {
  align-self: flex-end;
}
.user-list-modal-row .icon-btn.following {
  color: var(--brand);
}
.user-bot-badge {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

.post-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}
.post-header-main {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
  min-width: 0;
}
.post-header-aside {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.post-header-aside .post-follow-stats {
  margin-right: 2px;
}
.post-header strong { font-size: 15px; }
.post-header span, .post-header time { color: var(--text-muted); font-size: 15px; }
.post-edited { color: var(--text-muted); font-size: 13px; }
.post-owner-actions {
  display: inline-flex;
  gap: 6px;
}
.post-owner-actions .action-btn {
  padding: 10px 12px;
  font-size: 18px;
  min-width: 44px;
  min-height: 44px;
}
.action-btn.danger:hover { color: #ff6b6b; background: rgba(255, 107, 107, 0.15); }

.repost-label {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}
.repost-card {
  margin: 8px 0 12px;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
}
.repost-card-header {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.repost-card-header strong { font-size: 14px; }
.repost-card-header span,
.repost-card-header time {
  color: var(--text-muted);
  font-size: 14px;
}
.repost-unavailable {
  color: var(--text-muted);
  font-size: 14px;
  font-style: italic;
}

.edit-form { margin: 8px 0 12px; }
.edit-form textarea,
.edit-form .edit-rich-editor {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  padding: 12px;
  resize: vertical;
  outline: none;
  font-size: 16px;
}
.edit-form .edit-rich-editor {
  min-height: 120px;
  max-height: 50vh;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.edit-form .edit-rich-editor strong {
  font-weight: 800;
}
.edit-form .edit-rich-editor em {
  font-style: italic;
}
.edit-form .edit-rich-editor u {
  text-decoration: underline;
}
.edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.edit-window-hint {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
}
.edit-media-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.edit-media-label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
}
.edit-media-empty {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
}
.edit-media-preview {
  margin-bottom: 8px;
}
.edit-media-preview video,
.edit-media-preview img {
  max-width: 100%;
  border-radius: 12px;
}
.edit-media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.post-content { margin: 4px 0 12px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }

.post > div:not(.post-author-side) {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.post > div:not(.post-author-side) .post-embed--landscape,
.post > div:not(.post-author-side) .post-embed--card,
.post > div:not(.post-author-side) .post-media,
.post > div:not(.post-author-side) .post-video,
.post > div:not(.post-author-side) .post-layout-visual,
.post > div:not(.post-author-side) .repost-card .post-embed--landscape,
.post > div:not(.post-author-side) .repost-card .post-media {
  width: calc(100% + var(--post-bleed));
  max-width: calc(100% + var(--post-bleed));
  margin-left: calc(-1 * var(--post-bleed));
  margin-right: 0;
}

.post > div:not(.post-author-side) .post-embed--portrait,
.post > div:not(.post-author-side) .post-embed--square,
.post > div:not(.post-author-side) .post-embed--ratio-4-5 {
  margin-left: auto;
  margin-right: auto;
}

.post-embed,
.post-video {
  margin-top: 12px;
  margin-bottom: 12px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}

.post-embed-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #000;
  display: grid;
  place-items: center;
}

.post-embed-frame > iframe,
.post-embed-frame > .post-embed-poster,
.post-embed-frame > .post-embed-poster--activate,
.post-embed-frame > .post-embed-lazy-play {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  position: relative;
  inset: auto;
}

.post-embed-frame iframe,
.post-video iframe {
  display: block;
  border: 0;
}

/* Landscape 16:9 — YouTube, Vimeo, Twitch, Facebook video */
.post-embed--landscape,
.post-video {
  width: 100%;
}
.post-embed--landscape .post-embed-frame {
  aspect-ratio: 16 / 9;
}

/* Portrait 9:16 — TikTok, Reels, Shorts, Facebook Reel */
.post-embed--portrait {
  width: min(100%, 360px);
  margin-inline: auto;
}
.post-embed--portrait .post-embed-frame {
  aspect-ratio: 9 / 16;
  max-height: min(78vh, 680px);
}

/* Instagram feed post 4:5 */
.post-embed--ratio-4-5 {
  width: min(100%, 420px);
  margin-inline: auto;
}
.post-embed--ratio-4-5 .post-embed-frame {
  aspect-ratio: 4 / 5;
}

/* Square 1:1 */
.post-embed--square {
  width: min(100%, 420px);
  margin-inline: auto;
}
.post-embed--square .post-embed-frame {
  aspect-ratio: 1 / 1;
}

/* X / Facebook text posts — flexible card height */
.post-embed--card {
  width: min(100%, 560px);
  margin-inline: auto;
}
.post-embed--card .post-embed-frame {
  min-height: 480px;
}
.post-embed--card .post-embed-frame iframe {
  min-height: 480px;
  height: 520px;
}
.post-embed--card-twitter .post-embed-frame {
  min-height: 520px;
}
.post-embed--card-twitter .post-embed-frame iframe {
  min-height: 520px;
  height: 520px;
}
.post-embed--card-facebook {
  width: min(100%, 500px);
}
.post-embed--card-facebook .post-embed-frame {
  aspect-ratio: 4 / 5;
  min-height: 0;
  max-height: min(78vh, 680px);
}
.post-embed--card-facebook .post-embed-frame iframe {
  min-height: 0;
  height: 100%;
}

/* Spotify compact player */
.post-embed--spotify {
  width: 100%;
}
.post-embed--spotify .post-embed-frame {
  height: 152px;
  aspect-ratio: auto;
  background: var(--bg);
}

.post-embed-open {
  display: block;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--accent);
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.post-embed-open:hover {
  background: var(--bg-hover);
}

.post-embed--link {
  padding: 14px 16px;
  background: var(--bg);
}
.post-embed--link a {
  color: var(--accent);
  word-break: break-all;
}

.post-embed--has-poster .post-embed-frame {
  background: #000;
}
.post-embed-poster,
.post-embed-poster--activate {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: #000;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.post-embed-poster img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}
.post-embed--has-poster .post-embed-frame iframe {
  background: #000;
}
.post-embed--poster-only .post-embed-frame iframe {
  display: none;
}
.post-embed--lazy-video:not(.post-embed--active) .post-embed-frame iframe {
  display: none;
}
.post-embed-poster--activate {
  z-index: 2;
}
.post-embed-lazy-play {
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
.post-embed--active .post-embed-lazy-play,
.post-embed--active .post-embed-poster--activate {
  display: none;
}
.post-embed-poster-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.85);
  pointer-events: none;
}
.post-embed-poster-play::after {
  content: '';
  position: absolute;
  left: 22px;
  top: 16px;
  border-style: solid;
  border-width: 12px 0 12px 18px;
  border-color: transparent transparent transparent #fff;
}

.post.post--highlight {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 16px;
}

.post-media {
  margin-top: 12px;
  margin-bottom: 12px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 100%;
}

.post-media-inner {
  width: 100%;
  height: 100%;
  min-height: 120px;
  display: grid;
  place-items: center;
}

.post-media-inner img,
.post-media-inner video {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: min(85vh, 900px);
  object-fit: contain;
  object-position: center;
  background: #000;
}

.post-media--portrait {
  aspect-ratio: 9 / 16;
  width: min(100%, 340px);
  max-height: min(78vh, 680px);
  margin-inline: auto;
}

.post-media--landscape {
  aspect-ratio: 16 / 9;
  width: 100%;
}

.post-media--ratio-4-5 {
  aspect-ratio: 4 / 5;
  width: min(100%, 420px);
  margin-inline: auto;
}

.post-media--square {
  aspect-ratio: 1 / 1;
  width: min(100%, 420px);
  margin-inline: auto;
}

.post-media--native {
  width: min(100%, 520px);
  margin-inline: auto;
  max-height: min(85vh, 900px);
}

.post-media--pending {
  width: min(100%, 520px);
  margin-inline: auto;
  min-height: 120px;
}

.post-layout-picker {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
}

.post-layout-picker__option {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  color: var(--text-muted);
  user-select: none;
}

.post-content strong {
  font-weight: 800;
}

.post-content em,
.comment-content em {
  font-style: italic;
}

.post-content u,
.comment-content u {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.comment-content strong {
  font-weight: 800;
}

.post-content .text-link,
.comment-content .text-link {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-content .text-link:hover,
.comment-content .text-link:hover {
  color: #1d4ed8;
}

.post-content .text-mention,
.comment-content .text-mention {
  display: inline;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  font: inherit;
  color: #2563eb;
  text-decoration: none;
  cursor: pointer;
}

.post-content .text-mention:hover,
.comment-content .text-mention:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.untag-self-banner {
  margin: 0 0 8px;
}

.untag-self-btn {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
}

.untag-self-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}

.composer-format-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.composer-format-hint code {
  font-size: 12px;
  color: var(--text);
}

.post-layout-picker__option:has(input:checked) {
  border-color: var(--accent);
  color: var(--text);
  background: var(--brand-glow);
}

.post-layout-picker__option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.post-layout--1 {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.post-layout--1 .post-content {
  margin: 0 0 4px;
  order: 0;
}

.post-layout--1 .post-layout-visual {
  order: 1;
}

.post-layout--2 {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.post-layout--2 .post-content {
  margin-top: 4px;
}

.post-layout--3 {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.post-layout--3 .post-layout-visual {
  flex: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.post-layout--3 .post-media {
  margin: 0;
  width: 100% !important;
}

.post-layout--3 .post-content {
  flex: 1;
  min-width: 0;
  margin-top: 0;
  align-self: center;
}

.composer-media-preview-wrap.post-layout--1,
.composer-media-preview-wrap.post-layout--2 {
  flex-direction: column;
}

.composer-media-preview-wrap.post-layout--3 {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
}

.composer-media-preview-wrap.post-layout--3 .composer-media-item {
  flex: 0 0 min(42%, 160px);
}

.composer-media-preview-wrap .post-layout-picker {
  flex-basis: 100%;
}

.composer-media-item .post-media,
.edit-media-preview .post-media {
  margin: 0;
}

@media (max-width: 540px) {
  .post-layout--3 {
    flex-direction: column;
  }
  .post-layout--3 .post-layout-visual {
    flex: none;
    max-width: min(100%, 280px);
    margin-inline: auto;
  }
  .post-layout--3 .post-content {
    align-self: stretch;
  }
}

.post-media img,
.post-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #000;
}

.composer-media-item .post-media-inner,
.edit-media-preview .post-media-inner {
  min-height: 80px;
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  color: var(--text-muted);
  margin-top: 4px;
}
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 17px;
  min-width: 48px;
  min-height: 48px;
  line-height: 1;
}
.action-btn span {
  font-size: 15px;
  font-weight: 600;
}
.action-btn:hover { color: var(--accent); background: var(--brand-glow); }
.action-btn.liked { color: var(--like); }
.action-btn.reposted { color: var(--accent); }
.action-btn.active { color: var(--accent); }

.post-comments { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.comment {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
}
.avatar-sm { width: 32px; height: 32px; }
.avatar-xs { width: 28px; height: 28px; }
.comment-header {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
}
.comment-header strong { font-size: 14px; }
.comment-header span, .comment-header time { color: var(--text-muted); font-size: 13px; }
.comment-content { font-size: 14px; line-height: 1.4; }
.comment-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}
.comment-like-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.comment-like-btn.active,
.comment-like-btn:hover {
  color: var(--brand);
}
.comment-body { flex: 1; min-width: 0; }
.comment-reply-quote {
  margin: 6px 0;
  padding: 6px 10px;
  border-left: 3px solid var(--brand);
  border-radius: 6px;
  background: rgba(61, 160, 253, 0.08);
  font-size: 13px;
  color: var(--text-muted);
}
.comment-reply-quote strong { color: var(--text); }
.comment-reply-btn {
  margin-top: 6px;
  border: none;
  background: transparent;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}
.comment-reply-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.comment-reply-clear {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: var(--text-muted);
}

.comment-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.comment-form input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  padding: 8px 12px;
  outline: none;
}
.comment-form .btn-primary { padding: 8px 14px; }

.profile-panel,
.settings-panel,
.admin-panel {
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.admin-panel-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 800;
}
.admin-panel-note {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.45;
}
.admin-panel-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.admin-tab {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 700;
  cursor: pointer;
}
.admin-tab.active {
  border-color: rgba(61, 160, 253, 0.55);
  background: rgba(61, 160, 253, 0.12);
  color: #3da0fd;
}
.admin-tab-panel[hidden] { display: none !important; }
.admin-conversations-list {
  display: grid;
  gap: 8px;
}
.admin-conversation-row {
  display: grid;
  gap: 4px;
  text-align: left;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
}
.admin-conversation-row:hover {
  border-color: rgba(61, 160, 253, 0.45);
}
.admin-conversation-participants { font-weight: 700; }
.admin-conversation-stats,
.admin-conversation-time {
  font-size: 13px;
  color: var(--text-muted);
}
.admin-archive-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
}
.admin-archive-messages {
  display: grid;
  gap: 10px;
  max-height: min(60vh, 520px);
  overflow-y: auto;
}
.admin-archive-msg {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}
.admin-archive-msg.is-deleted {
  border-color: rgba(61, 160, 253, 0.35);
}
.admin-archive-msg-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13px;
}
.admin-archive-delete-msg {
  margin-left: auto;
  font-size: 16px;
}
.admin-archive-deleted {
  color: #3da0fd;
  font-weight: 700;
  font-size: 12px;
}
.admin-archive-e2e {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.admin-archive-media {
  display: block;
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  margin-top: 6px;
}
.admin-filter-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
}
.admin-filter-label select {
  max-width: 280px;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
}
.admin-posts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-post-row {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}
.admin-post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.admin-post-meta strong {
  color: var(--text);
}
.admin-post-snippet {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}
.admin-rating-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.admin-rating-label {
  font-size: 13px;
  font-weight: 600;
}
.admin-rate-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.admin-rate-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.admin-rate-btn.active,
.admin-rate-btn:hover {
  border-color: var(--brand);
  background: rgba(61, 160, 253, 0.15);
  color: var(--brand);
}
.admin-effective-rating {
  font-size: 12px;
  color: var(--text-muted);
}
.admin-empty {
  margin: 0;
  color: var(--text-muted);
}
.admin-facebook-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.admin-facebook-controls,
.admin-facebook-stats,
.admin-facebook-add-page,
.admin-facebook-add-post,
.admin-facebook-pages,
.admin-facebook-recent {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}
.admin-facebook-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.admin-facebook-toggle {
  flex: 1 1 240px;
}
.admin-facebook-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
}
.admin-facebook-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.admin-facebook-form-row input[type="url"],
.admin-facebook-form-row input[type="text"],
.admin-facebook-form-row input[type="number"],
.admin-facebook-form-row select {
  flex: 1 1 220px;
  min-width: 180px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.admin-facebook-form-row select {
  flex: 0 1 140px;
  min-width: 120px;
}
.admin-facebook-type-hint {
  margin: 8px 0 0;
  font-size: 13px;
}
.admin-facebook-type-badge {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(61, 160, 253, 0.15);
  color: var(--brand);
  vertical-align: middle;
}
.admin-facebook-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.admin-facebook-test-box {
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: rgba(61, 160, 253, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-facebook-test-box h4 {
  margin: 0;
  font-size: 1rem;
}
.admin-fb-test-btn {
  align-self: flex-start;
  min-width: 220px;
}
.admin-facebook-test-hint {
  margin: 0;
  color: var(--brand-light);
}
.admin-facebook-error code {
  font-size: 12px;
}
.admin-facebook-page-list,
.admin-facebook-recent-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-facebook-page-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.15);
}
.admin-facebook-page-item .text-link {
  display: block;
  word-break: break-all;
  font-size: 13px;
  margin-top: 4px;
}
.admin-facebook-page-meta {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}
.admin-facebook-recent-list li {
  font-size: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.admin-facebook-recent-list li:last-child {
  border-bottom: 0;
}
.admin-facebook-panel h4 {
  margin: 0 0 4px;
  font-size: 15px;
}
.admin-post-row--recent {
  cursor: pointer;
}
.admin-post-row--recent:hover {
  border-color: rgba(61, 160, 253, 0.35);
}
.admin-post-row--recent .admin-post-meta time {
  font-size: 13px;
  color: var(--text-muted);
}
.admin-repost-badge {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}
.admin-recent-rating {
  font-size: 12px;
  color: var(--brand);
}
.post-header .post-handle-link {
  font: inherit;
  font-weight: 800;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.post-header .post-handle-link:hover {
  color: var(--brand);
  text-decoration: underline;
}
.user-profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.user-profile-avatar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.user-profile-avatar-col .post-follow-stats {
  min-width: 56px;
}
.user-profile-handle {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
}
.user-profile-email {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}
.user-profile-admin-rating {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.user-profile-admin-rating-label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.user-profile-admin-rating-meta {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}
.user-profile-clear-rating {
  margin-top: 8px;
  font-size: 12px;
}
.profile-feed {
  margin-top: 12px;
}
.profile-feed-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 800;
}
.feed-column:not(.view-home) #feed,
.feed-column:not(.view-home) #composer {
  display: none !important;
}
.profile-posts-panel {
  margin-top: 16px;
}
.profile-edit-avatar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 16px;
}
.profile-avatar-main {
  min-width: 0;
}
.profile-avatar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 16px;
}
.profile-avatar-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.profile-avatar-pick-label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}
.profile-avatar-pick-label.is-busy {
  opacity: 0.7;
  pointer-events: none;
}
.profile-avatar-status {
  min-height: 1.25em;
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--text-muted);
}
.profile-avatar-status.is-error {
  color: #f87171;
}
.profile-avatar-status.is-ok {
  color: #86efac;
}
.profile-handle-readonly {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 800;
}
.profile-form-title {
  margin: 0 0 16px;
  font-size: 20px;
}
.profile-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
.profile-advanced {
  margin: 12px 0 16px;
  color: var(--text-muted);
  font-size: 14px;
}
.profile-advanced summary {
  cursor: pointer;
  margin-bottom: 8px;
}
.profile-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.profile-tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  position: relative;
  transition: background .2s, color .2s, box-shadow .2s;
}
.profile-tab:hover { color: var(--text); }
.profile-tab.active {
  color: var(--on-brand);
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  box-shadow: 0 4px 14px var(--brand-glow);
}
.profile-tab.active::after { display: none; }
.profile-feed { padding: 0; }
.profile-settings { padding: 16px; }
.profile-avatar { width: 80px; height: 80px; border-radius: 18px; }
.profile-header h2 { margin: 0 0 8px; }
.profile-note { margin: 0; color: var(--text-muted); font-size: 14px; }
.profile-form label {
  display: block;
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 14px;
}
.profile-form input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}
.profile-form .btn-primary { margin-top: 8px; padding: 12px 20px; }
.profile-form .icon-btn { margin: 0; }
.profile-private {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
}
.profile-private p { margin: 8px 0; }
.profile-private strong { color: var(--text); }

.profile-blocked {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.profile-blocked h3 { margin: 0 0 12px; font-size: 18px; }

.notifications-panel,
.messages-panel,
.explore-panel,
.admin-panel {
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.notifications-note {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.45;
}
.notifications-status {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.45;
}
.notifications-status.ok { border-color: rgba(0, 186, 124, 0.4); color: #00ba7c; }
.notifications-status.warn { border-color: rgba(255, 173, 31, 0.4); color: #ffad1f; }
.notifications-status.error { border-color: rgba(255, 107, 107, 0.4); color: #ff6b6b; }
.notification-settings {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  cursor: pointer;
}
.toggle-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
.notification-settings .btn-primary { margin-top: 16px; }

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--brand);
  color: #111;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
}
.nav-badge[hidden] {
  display: none !important;
}
.mobile-nav .nav-badge-mobile {
  position: absolute;
  top: 2px;
  right: 2px;
  margin: 0;
  min-width: 16px;
  height: 16px;
  font-size: 10px;
}
.mobile-nav a {
  position: relative;
}
.notifications-inbox-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.notifications-inbox-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}
.notifications-divider {
  margin: 20px 0;
  border: none;
  border-top: 1px solid var(--border);
}
.notifications-inbox-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.notification-inbox-row {
  display: flex;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.notification-inbox-row.unread {
  border-color: rgba(61, 160, 253, 0.45);
  background: rgba(61, 160, 253, 0.08);
}
.notification-inbox-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.notification-inbox-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.notification-inbox-type {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand);
}
.notification-inbox-title {
  font-size: 14px;
}
.notification-inbox-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.35;
  word-break: break-word;
}
.notification-inbox-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.notifications-inbox-empty {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 14px;
}
.conversation-row.has-unread {
  border-color: rgba(61, 160, 253, 0.4);
  background: rgba(61, 160, 253, 0.06);
}
.conversation-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.conversation-unread-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid var(--bg);
}
.conversation-preview-unread {
  color: var(--brand);
  font-weight: 700;
}
#enablePushBtn { margin-bottom: 16px; width: 100%; }
#testPushBtn { margin-bottom: 16px; width: 100%; }

.blocked-list { list-style: none; margin: 0; padding: 0; }
.blocked-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.blocked-row span { flex: 1; }
.blocked-empty { color: var(--text-muted); font-size: 14px; padding: 8px 0; }

.messages-note {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 0 16px;
  line-height: 1.4;
}
.new-chat-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}
.new-chat-search-wrap {
  position: relative;
}
.new-chat-search-wrap input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 10px 12px;
}
.new-chat-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.new-chat-section-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.new-chat-user-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.new-chat-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
}
.new-chat-user-row:hover { background: var(--bg-hover); }
.new-chat-user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.new-chat-user-meta span {
  color: var(--text-muted);
  font-size: 13px;
}
.new-chat-empty {
  color: var(--text-muted);
  font-size: 14px;
  padding: 8px 4px;
}
.conversation-list { display: flex; flex-direction: column; gap: 8px; }
.conversation-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  text-align: left;
}
.conversation-row:hover { background: var(--bg-hover); }
.conversation-meta { display: flex; flex-direction: column; gap: 4px; }
.conversation-meta span { color: var(--text-muted); font-size: 13px; }
.chat-view { display: flex; flex-direction: column; min-height: 420px; }
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.chat-header-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.chat-typing {
  font-size: 12px;
  color: var(--brand);
  font-weight: 600;
}
.chat-search-bar {
  margin-bottom: 8px;
}
.chat-search-bar input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 8px 10px;
}
.messages-list-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.messages-tab-btn.active {
  border-color: var(--brand);
  color: var(--brand);
}
.chat-header-menu {
  position: relative;
}
.chat-header-menu-btn {
  list-style: none;
  cursor: pointer;
}
.chat-header-menu-btn::-webkit-details-marker {
  display: none;
}
.chat-header-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 6;
  min-width: 200px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chat-header-menu-panel button {
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
}
.chat-header-menu-panel button:hover {
  background: var(--bg-hover);
}
.chat-msg-action-label {
  margin: 4px 10px 0;
  font-size: 11px;
  color: var(--text-muted);
}
.chat-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.chat-reaction-chip {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
}
.chat-reaction-chip.active {
  border-color: var(--brand);
  background: rgba(61, 160, 253, 0.12);
}
.chat-reaction-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 0;
}
.chat-audio {
  width: min(260px, 100%);
  margin-top: 4px;
}
#chatVoiceBtn.recording {
  color: #e74c3c;
  animation: chat-voice-pulse 1s infinite;
}
@keyframes chat-voice-pulse {
  50% { opacity: 0.55; }
}
.chat-messages {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0 16px;
  max-height: 50vh;
}
.chat-bubble {
  max-width: 80%;
  padding: 10px 12px;
  border-radius: 14px;
  line-height: 1.4;
  word-break: break-word;
}
.chat-bubble time {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
}
.chat-bubble.mine {
  align-self: flex-end;
  background: var(--accent);
  color: var(--on-brand);
}
.chat-bubble.mine time { color: rgba(0, 0, 0, 0.55); }
.chat-bubble.theirs {
  align-self: flex-start;
  background: var(--bg);
  border: 1px solid var(--border);
}
.chat-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.chat-form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.chat-form-tools {
  display: flex;
  gap: 4px;
}
.chat-form input[type="text"] {
  flex: 1;
  min-width: 120px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  padding: 10px 12px;
}
.chat-media-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  margin-bottom: 8px;
}
.chat-media-preview img,
.chat-media-preview video {
  max-width: 120px;
  max-height: 80px;
  border-radius: var(--radius);
  object-fit: cover;
}
.chat-bubble.deleted {
  opacity: 0.85;
  font-style: italic;
}
.chat-deleted-msg {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}
.chat-bubble-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}
.chat-bubble-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chat-read-receipt {
  font-size: 11px;
  letter-spacing: -2px;
  opacity: 0.65;
}
.chat-bubble.mine .chat-read-receipt--read {
  color: #1a8f4c;
  opacity: 1;
}
.chat-bubble.mine .chat-read-receipt--delivered {
  opacity: 0.55;
}
.chat-day-separator {
  display: flex;
  justify-content: center;
  margin: 12px 0;
}
.chat-day-separator span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.chat-reply-preview {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}
.chat-reply-preview-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.chat-reply-preview-label {
  font-weight: 700;
  color: var(--brand);
  flex-shrink: 0;
}
.chat-reply-preview-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
}
.chat-reply-quote {
  margin: 0 0 8px;
  padding: 6px 10px;
  border-left: 3px solid var(--brand);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.06);
  font-size: 13px;
}
.chat-bubble.mine .chat-reply-quote {
  background: rgba(0, 0, 0, 0.08);
}
.chat-reply-quote-who {
  display: block;
  font-weight: 700;
  font-size: 11px;
  margin-bottom: 2px;
  color: var(--brand);
}
.chat-edited-label {
  margin: 6px 0 0;
  font-size: 11px;
  font-style: italic;
  opacity: 0.75;
}
.chat-bubble.mine .chat-edited-label {
  color: rgba(0, 0, 0, 0.55);
}
.chat-edit-form textarea {
  width: 100%;
  min-width: 180px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: inherit;
  padding: 8px;
  font: inherit;
  resize: vertical;
}
.chat-edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}
.chat-edit-actions .btn-primary {
  padding: 6px 12px;
  font-size: 13px;
}
.chat-msg-menu {
  position: relative;
}
.chat-msg-menu-btn {
  list-style: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--text-muted);
}
.chat-msg-menu-btn::-webkit-details-marker {
  display: none;
}
.chat-msg-menu-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 4px);
  z-index: 5;
  min-width: 180px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chat-bubble.theirs .chat-msg-menu-panel {
  right: auto;
  left: 0;
}
.chat-msg-action {
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.chat-msg-action:hover {
  background: var(--bg-hover);
}
.chat-msg-action.danger {
  color: #e74c3c;
}
.chat-file,
.chat-file-pending {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  text-decoration: none;
  word-break: break-word;
}
.chat-bubble.mine .chat-file {
  background: rgba(0, 0, 0, 0.12);
  color: inherit;
}
.chat-delete-msg {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 11px;
  opacity: 0.75;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.chat-delete-msg:hover {
  opacity: 1;
}
.chat-media {
  display: block;
  max-width: min(100%, 280px);
  margin-top: 6px;
  border-radius: var(--radius);
}
.chat-media video {
  width: 100%;
  max-height: 240px;
}

.sidebar-user-results {
  margin-top: 10px;
}
.user-search-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.user-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}
.user-search-main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  padding: 0;
  font: inherit;
}
.explore-panel {
  padding: 16px 0 24px;
  animation: viewFadeIn .24s ease;
}
.explore-suggestions {
  margin-top: 20px;
}
.explore-suggestions-title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 800;
}
.explore-title {
  margin: 0 0 8px;
  font-size: 1.25rem;
}
.explore-hint {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 14px;
}
.explore-search-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  font: inherit;
}
.user-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.user-search-main small.user-search-email {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: normal;
}
.admin-post-user-actions {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  margin-left: 8px;
}
.admin-post-delete:hover {
  color: #ff6b6b;
}

.sidebar-right {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 16px 16px 16px 8px;
  overflow: auto;
}

.search-box {
  position: sticky;
  top: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  margin-bottom: 16px;
}
.search-box svg { width: 18px; height: 18px; fill: var(--text-muted); flex-shrink: 0; }
.search-box input {
  border: 0;
  background: transparent;
  color: var(--text);
  width: 100%;
  outline: none;
}

.panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
}
.panel h2 {
  margin: 0;
  padding: 14px 16px;
  font-size: 18px;
  font-weight: 800;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.suggestions { list-style: none; margin: 0; padding: 0; }
.suggestions li {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  cursor: pointer;
}
.suggestions li:hover { background: rgba(255, 255, 255, 0.03); }

.suggestion-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.suggestion-row .avatar {
  flex-shrink: 0;
}
.suggestion-profile-hit {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 10px;
}
.suggestion-profile-hit:hover {
  opacity: 0.92;
}
.suggestion-handle {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.suggestion-follow-btn {
  flex-shrink: 0;
  margin-left: auto;
  border: 0;
  background: var(--accent);
  color: var(--on-brand);
  border-radius: var(--radius);
  font-weight: 800;
  font-size: 18px;
  line-height: 1;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  cursor: pointer;
}
.suggestion-follow-btn.following {
  opacity: 0.75;
}
.suggestion-bot-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: lowercase;
}
.suggestion-following-label {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.94);
  border-top: 1px solid var(--border-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 4px 8px calc(4px + env(safe-area-inset-bottom));
  justify-content: space-around;
  align-items: flex-end;
  z-index: 100;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
}
.mobile-nav a,
.mobile-nav .mobile-nav-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 52px;
  max-width: 72px;
  height: auto;
  min-height: 52px;
  padding: 6px 4px;
  font-size: inherit;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background .2s, border-color .2s, transform .15s;
}
.mobile-nav-icon {
  font-size: 20px;
  line-height: 1;
}
.mobile-nav-label {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-nav a.active .mobile-nav-label {
  color: var(--brand-light);
}
.mobile-nav .mobile-nav-btn {
  background: transparent;
  color: inherit;
  padding: 0;
  cursor: pointer;
}
.mobile-nav a:hover,
.mobile-nav .mobile-nav-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border);
}
.mobile-nav a.active {
  color: #ffffff;
  background: var(--brand-glow);
  border-color: var(--border-strong);
  box-shadow: inset 0 0 0 1px var(--brand-soft);
}
.mobile-nav-install {
  color: var(--accent);
}
.mobile-nav-install[hidden] {
  display: none !important;
}
.mobile-profile-nav {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px;
}
.mobile-profile-nav .avatar {
  border: 2px solid transparent;
  border-radius: 10px;
  width: 24px;
  height: 24px;
}
.mobile-profile-nav.active .avatar,
.mobile-profile-nav[aria-expanded="true"] .avatar {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--brand-glow);
}

.profile-menu {
  position: fixed;
  inset: 0;
  z-index: 300;
}
.profile-menu[hidden] { display: none; }
.profile-menu-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}
.profile-menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(320px, 88vw);
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  animation: profile-menu-in .22s ease;
}
@keyframes profile-menu-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.profile-menu-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}
.profile-menu-close {
  align-self: flex-end;
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}
.profile-menu-avatar {
  width: 64px;
  height: 64px;
  border-radius: 16px;
}
.profile-menu-header strong {
  display: block;
  font-size: 18px;
}
.profile-menu-email {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 14px;
}
.profile-menu-nav {
  display: flex;
  flex-direction: column;
  padding: 8px;
}
.profile-menu-item {
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 16px;
  padding: 14px 16px;
  border-radius: var(--radius);
  cursor: pointer;
}
.profile-menu-item:hover,
.profile-menu-item:focus-visible {
  background: var(--bg-hover);
}
.profile-menu-item.danger { color: #ff6b6b; }

body.profile-menu-open { overflow: hidden; }

.icon-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: var(--radius);
  padding: 6px 12px;
  cursor: pointer;
}
.icon-btn:hover { background: var(--bg-hover); }

.app-confirm[hidden] { display: none !important; }
body.app-confirm-open { overflow: hidden; }
.app-confirm {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.app-confirm-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.72);
  cursor: pointer;
}
.app-confirm-panel {
  position: relative;
  width: min(360px, 100%);
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(61, 160, 253, 0.35);
  background: var(--bg-elevated);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.app-confirm-title {
  margin: 0 0 10px;
  font-size: 1.1rem;
  color: #3da0fd;
}
.app-confirm-message {
  margin: 0 0 18px;
  line-height: 1.45;
  color: var(--text);
}
.app-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.image-crop-modal[hidden] {
  display: none !important;
}
body.image-crop-open {
  overflow: hidden;
}
.image-crop-modal {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.image-crop-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.78);
  cursor: pointer;
}
.image-crop-panel {
  position: relative;
  width: min(520px, 100%);
  max-height: min(92vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(61, 160, 253, 0.35);
  background: var(--bg-elevated);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.image-crop-title {
  margin: 0 0 6px;
  font-size: 1.1rem;
  color: #3da0fd;
}
.image-crop-hint {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}
.image-crop-aspects {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.image-crop-aspect.is-active {
  border-color: #ea580c;
  color: #ea580c;
  background: rgba(234, 88, 12, 0.12);
}
.image-crop-stage-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: min(46vh, 340px);
  margin-bottom: 12px;
  border-radius: 12px;
  overflow: hidden;
  background: #0f0f10;
}
.image-crop-zoom-float {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.image-crop-zoom-btn {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.image-crop-zoom-btn:hover:not(:disabled) {
  border-color: #ea580c;
  color: #fdba74;
}
.image-crop-zoom-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.image-crop-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 8px;
  overflow: hidden;
  box-sizing: border-box;
}
.image-crop-frame {
  position: relative;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px #ea580c;
}
.image-crop-frame:active {
  cursor: grabbing;
}
.image-crop-frame img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  will-change: transform;
  user-select: none;
  pointer-events: none;
}
.image-crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  padding-top: 4px;
}
.composer-media-crop {
  margin-top: 8px;
  margin-right: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
}
.composer-media-crop:hover {
  border-color: var(--accent);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%) translateY(20px);
  background: var(--accent);
  color: var(--on-brand);
  padding: 12px 20px;
  border-radius: var(--radius);
  opacity: 0;
  pointer-events: none;
  transition: .25s ease;
  z-index: 200;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.empty-state-cta { margin-top: 4px; }

@media (min-width: 691px) {
  .profile-menu-trigger { display: inline-flex; }
}

@media (max-width: 1100px) {
  .app { grid-template-columns: 88px minmax(0, 1fr); }
  .sidebar-right { display: none; }
  .account-meta { display: none; }
  .nav-item {
    font-size: 11px;
    line-height: 1.25;
    padding: 10px 6px;
    text-align: center;
    justify-content: center;
  }
  .btn-post {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    padding: 0;
    margin: 8px auto 16px;
    font-size: 0;
    color: transparent;
  }
  .btn-post::after {
    content: "+";
    font-size: 28px;
    color: var(--on-brand);
    line-height: 1;
  }
}

@media (max-width: 690px) {
  .feed-install-btn { display: none; }
  .app {
    grid-template-columns: 1fr;
    max-width: 100%;
  }
  .sidebar-left { display: none; }
  body {
    overflow-x: hidden;
    padding-bottom: var(--mobile-nav-height);
  }
  .feed-column {
    max-width: none;
    min-height: auto;
    padding: 8px 10px calc(var(--mobile-nav-height) + 12px);
    gap: 10px;
  }
  .feed-header {
    top: 0;
    flex-wrap: wrap;
    align-items: center;
    padding: 6px 8px;
    gap: 8px;
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.88);
  }
  .feed-view-title {
    order: 0;
    flex: 1;
    min-width: 0;
    font-size: 18px;
  }
  .feed-header-actions {
    order: 1;
    margin-left: auto;
  }
  .feed-tabs {
    order: 2;
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    gap: 4px;
    padding: 3px;
  }
  .feed-tab {
    font-size: 12px;
    padding: 10px 6px;
    white-space: nowrap;
    min-height: 40px;
  }
  .composer {
    padding: 12px;
    gap: 10px;
  }
  .composer textarea,
  .compose-rich-editor {
    font-size: 16px;
    min-height: 44px;
  }
  .composer-actions {
    flex-wrap: wrap;
    gap: 8px;
  }
  .composer-submit {
    margin-left: auto;
  }
  .post {
    padding: 12px;
    gap: 10px;
    grid-template-columns: 40px 1fr;
  }
  .post-header .action-btn {
    min-width: 36px;
    min-height: 36px;
    padding: 6px 8px;
    font-size: 15px;
  }
  .post-actions {
    gap: 4px;
    justify-content: space-between;
  }
  .post-actions .action-btn {
    min-width: 40px;
    min-height: 40px;
    padding: 8px 6px;
    font-size: 15px;
    flex: 1;
  }
  .post-actions .action-btn span {
    font-size: 13px;
  }
  .messages-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: calc(100dvh - var(--mobile-nav-height) - 76px);
    max-height: calc(100dvh - var(--mobile-nav-height) - 76px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
  }
  .messages-panel.chat-open {
    overflow: hidden;
    padding-bottom: 0;
  }
  .new-chat-panel {
    flex-shrink: 0;
    margin-bottom: 0;
  }
  .conversation-list {
    flex-shrink: 0;
  }
  .chat-view {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .messages-panel.chat-open .chat-view {
    min-height: calc(100dvh - var(--mobile-nav-height) - 68px);
  }
  .chat-messages {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .chat-form {
    flex-shrink: 0;
    margin-top: auto;
    position: sticky;
    bottom: 0;
    z-index: 5;
    background: var(--bg);
    padding-top: 10px;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
  }
  .chat-form .btn-primary {
    white-space: nowrap;
    padding: 10px 14px;
  }
  .chat-bubble {
    max-width: 88%;
  }
  .mobile-nav {
    display: flex;
    gap: 0;
    padding: 4px 2px calc(4px + env(safe-area-inset-bottom));
    justify-content: space-between;
  }
  .mobile-nav a,
  .mobile-nav .mobile-nav-btn {
    width: auto;
    flex: 1;
    max-width: none;
    min-height: 52px;
    height: auto;
    border-radius: 12px;
  }
  .mobile-nav-label {
    font-size: 9px;
  }
  .fab-compose {
    display: inline-flex;
  }
  .toast {
    bottom: calc(var(--mobile-nav-height) + 12px);
    max-width: calc(100vw - 32px);
    text-align: center;
  }
  .install-banner {
    bottom: calc(var(--mobile-nav-height) + 4px);
  }
  .notifications-panel,
  .profile-panel,
  .profile-settings {
    padding: 12px;
  }
}

.feed-skeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.skeleton-post {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.02);
}
.skeleton-avatar,
.skeleton-line {
  background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(252,132,0,.12) 50%, rgba(255,255,255,.04) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.2s ease-in-out infinite;
  border-radius: 999px;
}
.skeleton-avatar {
  width: 48px;
  height: 48px;
}
.skeleton-lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}
.skeleton-line {
  height: 12px;
  border-radius: 8px;
}
.skeleton-line.w40 { width: 40%; }
.skeleton-line.w90 { width: 90%; }
.skeleton-line.w70 { width: 70%; }
@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.pull-refresh-indicator {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -120%);
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.88);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
  transition: transform .15s ease;
}
.pull-refresh-indicator.is-refreshing .pull-refresh-spinner {
  animation: pullSpin .8s linear infinite;
}
.pull-refresh-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
}
@keyframes pullSpin {
  to { transform: rotate(360deg); }
}

.scroll-top-btn {
  position: fixed;
  right: 16px;
  bottom: calc(var(--mobile-nav-height) + 76px);
  z-index: 90;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.88);
  color: var(--brand-light);
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  transition: transform .2s, opacity .2s;
}
.scroll-top-btn:hover {
  transform: translateY(-2px);
}
@media (min-width: 691px) {
  .scroll-top-btn {
    bottom: 24px;
    right: max(16px, calc(50% - 640px));
  }
}

.fab-compose {
  display: none;
  position: fixed;
  right: 16px;
  bottom: calc(var(--mobile-nav-height) + 16px);
  z-index: 95;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  color: var(--on-brand);
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 28px var(--brand-glow);
  transition: transform .2s;
}
.fab-compose:hover { transform: scale(1.05); }

.feed-load-sentinel {
  height: 1px;
  margin: 0;
  pointer-events: none;
}

@media (max-width: 1100px) {
  .nav-item-label { display: none; }
  .nav-item {
    flex-direction: column;
    gap: 4px;
    font-size: 0;
    padding: 10px 6px;
  }
  .nav-item-icon { font-size: 22px; }
  .nav-item .nav-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 10px;
  }
  .nav-item { position: relative; }
}
