/* ==========================================================================
 * QILNATROX DESIGN SYSTEM — Authentic X (Twitter) & Threads Parity
 * Verified Specs:
 *  - X Web: 600px centered feed column, 1265px max shell, 290-350px sticky rail
 *  - Threads: Monochrome ink, 1000px full-pill chrome, 42px avatar gutter,
 *             continuous 2px threadline, glass frosted headers.
 *  - Colors: Pure white (#ffffff), OLED black (#000000), Real X Dim (#15202b)
 *  - Typography: Native SF Pro / Chirp stack, tabular numerals, 1.43 line-height
 * ========================================================================== */

:root {
  /* Surface & Canvas (Light) */
  --bg-canvas: #ffffff;
  --bg-card: #ffffff;
  --bg-surface: #f7f9f9;
  --bg-hover: rgba(15, 20, 25, 0.05);
  --bg-active: rgba(15, 20, 25, 0.08);
  --bg-modal: #ffffff;

  /* Typography */
  --text-primary: #0f1419;
  --text-secondary: #536471;
  --text-muted: #8b98a5;

  /* Borders & Dividers */
  --border-subtle: rgba(0, 0, 0, 0.07);
  --border-card: #cfd9de;
  --threadline: #cfd9de;

  /* Accent & Action Colors */
  --accent: #1d9bf0;
  --accent-hover: #1a8cd8;
  --accent-tint: rgba(29, 155, 240, 0.1);
  --badge-blue: #1d9bf0;
  --like: #f91880;
  --like-hover-bg: rgba(249, 24, 128, 0.1);
  --heart-active: #f91880;
  --repost: #00ba7c;
  --repost-hover-bg: rgba(0, 186, 124, 0.1);

  /* Buttons & CTAs */
  --btn-pill-bg: #0f1419;
  --btn-pill-text: #ffffff;
  --btn-pill-hover: #272c30;

  /* Overlays & Frosted Glass */
  --scrim: rgba(0, 0, 0, 0.45);
  --header-glass: rgba(255, 255, 255, 0.85);
  --elevation-shadow: 0 8px 30px rgba(0, 0, 0, 0.08), 0 0 1px rgba(0, 0, 0, 0.14);
  --elevation-modal: 0 20px 50px rgba(0, 0, 0, 0.18), 0 0 1px rgba(0, 0, 0, 0.12);

  /* Dimensions & Motion Springs */
  --feed-width: 600px;
  --gutter-width: 42px;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --spring-soft: cubic-bezier(0.16, 1, 0.3, 1);
  --tap-dur: 200ms;
  --font-stack: -apple-system, BlinkMacSystemFont, "TwitterChirp", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ==========================================================================
 * Dark Mode (True OLED Black — Threads / X Lights Out parity)
 * ========================================================================== */
html[data-theme="dark"] {
  --bg-canvas: #000000;
  --bg-card: #000000;
  --bg-surface: #121212;
  --bg-hover: rgba(255, 255, 255, 0.06);
  --bg-active: rgba(255, 255, 255, 0.1);
  --bg-modal: #101010;

  --text-primary: #f7f9f9;
  --text-secondary: #71767b;
  --text-muted: #536471;

  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-card: #2f3336;
  --threadline: #2f3336;

  --accent-tint: rgba(29, 155, 240, 0.12);
  --like-hover-bg: rgba(249, 24, 128, 0.12);
  --repost-hover-bg: rgba(0, 186, 124, 0.12);

  --btn-pill-bg: #eff3f4;
  --btn-pill-text: #0f1419;
  --btn-pill-hover: #d7dbdc;

  --scrim: rgba(91, 112, 131, 0.4);
  --header-glass: rgba(0, 0, 0, 0.82);
  --elevation-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  --elevation-modal: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px #2f3336;
}

/* ==========================================================================
 * Dim Theme (Beloved Twitter Dark Blue Slate Parity)
 * ========================================================================== */
html[data-theme="dim"] {
  --bg-canvas: #15202b;
  --bg-card: #15202b;
  --bg-surface: #1e2732;
  --bg-hover: rgba(255, 255, 255, 0.06);
  --bg-active: rgba(255, 255, 255, 0.1);
  --bg-modal: #1e2732;

  --text-primary: #f7f9f9;
  --text-secondary: #8b98a5;
  --text-muted: #6e767d;

  --border-subtle: #273340;
  --border-card: #38444d;
  --threadline: #38444d;

  --accent-tint: rgba(29, 155, 240, 0.12);
  --like-hover-bg: rgba(249, 24, 128, 0.12);
  --repost-hover-bg: rgba(0, 186, 124, 0.12);

  --btn-pill-bg: #eff3f4;
  --btn-pill-text: #15202b;
  --btn-pill-hover: #d7dbdc;

  --scrim: rgba(0, 0, 0, 0.55);
  --header-glass: rgba(21, 32, 43, 0.85);
  --elevation-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  --elevation-modal: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px #38444d;
}

/* System dark mode fallback */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not([data-theme="dim"]) {
    --bg-canvas: #000000;
    --bg-card: #000000;
    --bg-surface: #121212;
    --bg-hover: rgba(255, 255, 255, 0.06);
    --bg-active: rgba(255, 255, 255, 0.1);
    --bg-modal: #101010;
    --text-primary: #f7f9f9;
    --text-secondary: #71767b;
    --text-muted: #536471;
    --border-subtle: rgba(255, 255, 255, 0.09);
    --border-card: #2f3336;
    --threadline: #2f3336;
    --accent-tint: rgba(29, 155, 240, 0.12);
    --like-hover-bg: rgba(249, 24, 128, 0.12);
    --repost-hover-bg: rgba(0, 186, 124, 0.12);
    --btn-pill-bg: #eff3f4;
    --btn-pill-text: #0f1419;
    --btn-pill-hover: #d7dbdc;
    --scrim: rgba(91, 112, 131, 0.4);
    --header-glass: rgba(0, 0, 0, 0.82);
    --elevation-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    --elevation-modal: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px #2f3336;
  }
}

/* ==========================================================================
 * Global Resets & Fundamentals
 * ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden],
.modal-backdrop[hidden],
.menu-sheet[hidden],
.sheet-scrim[hidden],
.toast-pill[hidden] {
  display: none !important;
}

html, body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-stack);
  font-size: 15px;
  line-height: 21.5px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: contain;
}

a {
  color: inherit;
  text-decoration: none;
  touch-action: manipulation;
}

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s var(--spring-soft), background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

button:active {
  transform: scale(0.96);
}

input, textarea {
  font-family: inherit;
  color: inherit;
}

::selection {
  background-color: var(--text-primary);
  color: var(--bg-canvas);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ==========================================================================
 * Application Layout & Shell
 * ========================================================================== */
.threads-app {
  max-width: 1265px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Desktop App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-glass);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  height: 56px;
  width: 100%;
}

.header-inner {
  max-width: 1265px;
  margin: 0 auto;
  padding: 0 16px;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.header-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  width: fit-content;
}

.wordmark {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--text-primary);
  user-select: none;
}

.header-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.nav-tab {
  width: 58px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--text-secondary);
  position: relative;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-tab:hover {
  color: var(--text-primary);
  background-color: var(--bg-hover);
}

.nav-tab.active {
  color: var(--text-primary);
}

.nav-tab.active::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--text-primary);
}

.nav-dot {
  position: absolute;
  top: 8px;
  right: 14px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--heart-active);
  box-shadow: 0 0 0 2px var(--bg-canvas);
  pointer-events: none;
}
.nav-dot[hidden] { display: none; }

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.icon-action {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text-secondary);
}

.icon-action:hover {
  color: var(--text-primary);
  background-color: var(--bg-hover);
}

/* Theme Icon Toggle */
html[data-theme="dark"] .sun-icon,
html[data-theme="dim"] .sun-icon { display: block; }
html[data-theme="dark"] .moon-icon,
html[data-theme="dim"] .moon-icon { display: none; }
html:not([data-theme="dark"]):not([data-theme="dim"]) .sun-icon { display: none; }
html:not([data-theme="dark"]):not([data-theme="dim"]) .moon-icon { display: block; }

/* Mobile Header */
.mobile-header {
  display: none;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-glass);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  height: 52px;
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
}

.mobile-nav-home-btn,
.mobile-menu-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--text-primary);
  border-radius: 50%;
}

.mobile-nav-home-btn:hover,
.mobile-menu-btn:hover {
  background-color: var(--bg-hover);
}

.mobile-logo-btn {
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-logo-btn .wordmark {
  font-size: 17px;
}

/* Main Container & Column Widths */
.content-row {
  width: 100%;
}

.feed-container {
  width: 100%;
  max-width: var(--feed-width);
  margin: 0 auto;
  min-height: calc(100vh - 56px);
  padding: 0 0 90px;
}

/* Desktop 3-Column Layout */
@media (min-width: 1024px) {
  .content-row {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 32px;
    max-width: 990px;
    margin: 0 auto;
  }

  .content-row .feed-container {
    margin: 0;
    border-left: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
  }

  .right-rail {
    display: block;
    width: 300px;
    flex: none;
    position: sticky;
    top: 68px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    scrollbar-width: thin;
    padding: 8px 0 60px;
  }
}

@media (min-width: 1280px) {
  .content-row {
    max-width: 1050px;
    gap: 36px;
  }
  .right-rail {
    width: 350px;
  }
}

/* View Panels */
.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
  animation: viewFadeIn 0.16s var(--spring-soft);
}

@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
 * Feed Header Tabs & Spring Indicator (X / Threads parity)
 * ========================================================================== */
.feed-tabs-bar {
  display: flex;
  position: sticky;
  top: 56px;
  z-index: 40;
  background: var(--header-glass);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  height: 52px;
}

.feed-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-secondary);
  height: 100%;
  position: relative;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.feed-tab:hover {
  color: var(--text-primary);
  background-color: var(--bg-hover);
}

.feed-tab.active {
  color: var(--text-primary);
}

/* Authentic underline indicator */
.tab-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  width: 50%;
  background: transparent;
  pointer-events: none;
  transition: transform 0.28s var(--spring);
}

.tab-indicator::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 4px;
  background-color: var(--accent);
  border-radius: 9999px 9999px 0 0;
}

/* Subpage Navigation (Back to Feed Bar) */
.subpage-nav-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  height: 53px;
  position: sticky;
  top: 56px;
  z-index: 45;
  background: var(--header-glass);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
}

.subpage-back-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text-primary);
  background: transparent;
  border: 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.subpage-back-btn:hover {
  background-color: var(--bg-hover);
}

/* ==========================================================================
 * Quick Inline Composer (Threads "Start a thread..." banner)
 * ========================================================================== */
.inline-composer {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.inline-composer:hover {
  background-color: var(--bg-hover);
}

.composer-avatar-slot {
  flex: none;
}

.composer-input-slot {
  flex: 1;
  min-width: 0;
}

.composer-placeholder {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 20px;
  user-select: none;
}

.post-pill-btn {
  background-color: var(--btn-pill-bg);
  color: var(--btn-pill-text);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 8px 18px;
  border-radius: 9999px;
  border: 0;
  min-height: 34px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.post-pill-btn:not(:disabled):hover {
  background-color: var(--btn-pill-hover);
  opacity: 0.94;
}

.post-pill-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

/* ==========================================================================
 * Feed List, Thread Card & Side-By-Side Layout
 * ========================================================================== */
.threads-feed {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Crucial Fix: Thread card is a 2-column flexbox container */
.thread-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  cursor: pointer;
  background-color: transparent;
  transition: background-color 0.15s ease;
  content-visibility: auto;
  contain-intrinsic-size: auto 140px;
  overflow-anchor: none;
}

.thread-card:hover {
  background-color: var(--bg-hover);
}

/* Gutter Column: Houses Avatar & Centered Threadline */
.card-gutter {
  flex: 0 0 var(--gutter-width);
  width: var(--gutter-width);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  align-self: stretch;
}

.card-threadline {
  position: absolute;
  top: 44px;
  bottom: -15px;
  width: 2px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--threadline);
  border-radius: 9999px;
  pointer-events: none;
}

.thread-card:last-child .card-threadline {
  display: none;
}

/* Avatars: High-End Circular Badge with Subtle Ring */
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #475569 0%, #1e293b 100%);
  flex: none;
  user-select: none;
  box-shadow: 0 0 0 1px var(--border-subtle);
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  box-shadow: 0 0 0 2px var(--border-subtle);
  overflow: hidden;
  flex: none;
}

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

/* Card Content Column */
.card-main {
  flex: 1;
  min-width: 0;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.card-author-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  min-width: 0;
}

.card-author-handle {
  font-weight: 750;
  font-size: 15px;
  line-height: 20px;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-author-handle:hover {
  text-decoration: underline;
}

.verified-badge {
  color: var(--badge-blue);
  display: inline-flex;
  align-items: center;
  flex: none;
}

.card-timestamp {
  font-size: 14.5px;
  line-height: 20px;
  color: var(--text-secondary);
  font-weight: 400;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.card-timestamp:hover {
  text-decoration: underline;
}

.card-menu-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text-secondary);
  margin-right: -6px;
}

.card-menu-btn:hover {
  color: var(--accent);
  background-color: var(--accent-tint);
}

.card-body-text {
  font-size: 15px;
  line-height: 21.5px;
  color: var(--text-primary);
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: pre-wrap;
  margin: 3px 0 10px;
}

.card-body-text a {
  color: var(--accent);
  text-decoration: none;
}

.card-body-text a:hover {
  text-decoration: underline;
}

/* ==========================================================================
 * Card Action Row & Authentic Micro-Interactions (Like/Repost/Reply/Share)
 * ========================================================================== */
.card-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 425px;
  margin: 2px 0 -4px -8px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 36px;
  height: 34px;
  padding: 0 8px;
  border-radius: 9999px;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 16px;
  position: relative;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.action-btn svg {
  width: 18.75px;
  height: 18.75px;
  display: block;
  flex: none;
  transition: transform 0.18s var(--spring);
}

/* Specific Action Color States */
.action-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.action-btn[data-action="reply"]:hover {
  color: var(--accent);
  background-color: var(--accent-tint);
}

.action-btn[data-action="repost"]:hover {
  color: var(--repost);
  background-color: var(--repost-hover-bg);
}

.action-btn[data-action="like"]:hover {
  color: var(--like);
  background-color: var(--like-hover-bg);
}

.action-btn[data-action="share"]:hover {
  color: var(--accent);
  background-color: var(--accent-tint);
}

/* Active Liked State */
.action-btn.liked {
  color: var(--like);
}

.action-btn.liked svg {
  fill: var(--like);
  stroke: var(--like);
}

/* Twitter/X Heart Pop Spring */
.action-btn.pop svg {
  animation: heartPop 0.42s var(--spring) forwards;
}

@keyframes heartPop {
  0% { transform: scale(0.6); }
  50% { transform: scale(1.35); }
  75% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* Expanding Shockwave Ring */
.like-ring {
  position: absolute;
  left: 17px;
  top: 50%;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  margin-top: -11px;
  border-radius: 50%;
  border: 2px solid var(--heart-active);
  pointer-events: none;
  animation: rippleRing 0.42s cubic-bezier(0.2, 0.8, 0.4, 1) forwards;
}

@keyframes rippleRing {
  0% { transform: scale(0.2); opacity: 1; border-width: 3px; }
  60% { border-color: #ff4070; }
  100% { transform: scale(1.6); opacity: 0; border-width: 0.5px; }
}

/* Radial 8-Sparkle Burst */
.like-sparks {
  position: absolute;
  left: 17px;
  top: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 5;
}

.like-sparks i {
  position: absolute;
  left: -2px;
  top: -2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--c, var(--heart-active));
  animation: sparkFly 0.45s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

@keyframes sparkFly {
  0% { transform: translate(0, 0) scale(0.3); opacity: 1; }
  60% { opacity: 0.95; }
  100% { transform: translate(var(--sx, 0), var(--sy, 0)) scale(0.2); opacity: 0; }
}

/* Repost 360 Spin Rebound */
.action-btn.reposted {
  color: var(--repost);
}

.action-btn.reposted svg {
  stroke: var(--repost);
  color: var(--repost);
}

.action-btn.spin svg {
  animation: repostSpin 0.45s var(--spring) forwards;
}

@keyframes repostSpin {
  0% { transform: rotate(0deg) scale(0.85); }
  60% { transform: rotate(210deg) scale(1.2); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Tabular Action Counts & Ticker */
.action-count {
  font-size: 13px;
  line-height: 16px;
  font-weight: 400;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  display: inline-block;
  min-width: 1ch;
}

.action-btn.liked .action-count {
  color: var(--like);
}

.action-btn.reposted .action-count {
  color: var(--repost);
}

.action-count.tick-up {
  animation: tickUp 0.22s var(--spring-soft);
}

.action-count.tick-down {
  animation: tickDown 0.22s var(--spring-soft);
}

@keyframes tickUp {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes tickDown {
  from { transform: translateY(-8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Double-Tap Heart Explosion */
.burst-heart {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  color: var(--heart-active);
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.4));
  z-index: 10;
}

.burst-heart svg {
  width: 72px;
  height: 72px;
  animation: burstHeart 0.65s var(--spring) forwards;
}

.burst-heart svg path {
  fill: var(--heart-active);
  stroke: var(--heart-active);
}

@keyframes burstHeart {
  0% { transform: scale(0); opacity: 0; }
  30% { transform: scale(1.3); opacity: 1; }
  60% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.2) translateY(-12px); opacity: 0; }
}

/* ==========================================================================
 * Nested Replies & Conversation Tree
 * ========================================================================== */
.replies-container {
  margin-top: 8px;
  padding-left: 12px;
  border-left: 2px solid var(--threadline);
  margin-left: 6px;
}

.reply-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
}

.reply-item .user-avatar {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

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

.reply-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.reply-text {
  font-size: 15px;
  line-height: 21px;
  color: var(--text-primary);
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.ancestors {
  border-left: 2px solid var(--threadline);
  margin-left: 20px;
  padding-left: 6px;
}

.mini-reply {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 9999px;
  padding: 4px 10px;
}

.mini-reply:hover {
  color: var(--accent);
  background-color: var(--accent-tint);
}

/* Status / Empty / Up-to-Date Line */
.feed-footer-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 36px 16px 44px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--border-card);
}

.status-dot.pulse {
  background-color: var(--accent);
  animation: pulseDot 1s ease-in-out infinite;
}

@keyframes pulseDot {
  50% { opacity: 0.3; }
}

.empty-state {
  padding: 72px 24px;
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
  color: var(--text-secondary);
}

.empty-state h3 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14.5px;
  line-height: 20px;
}

/* ==========================================================================
 * Floating "See New Posts" Pill (Twitter / Threads style)
 * ========================================================================== */
.new-posts-pill {
  position: sticky;
  top: 116px;
  z-index: 60;
  display: block;
  margin: 0 auto;
  border: 1px solid var(--border-card);
  background-color: var(--bg-modal);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  border-radius: 9999px;
  padding: 9px 20px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: pillFlyIn 0.3s var(--spring);
}

.new-posts-pill[hidden] { display: none; }

.new-posts-pill:hover {
  background-color: var(--bg-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

@keyframes pillFlyIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Pull to Refresh Indicator */
.ptr-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-height: 0;
  overflow: hidden;
  font-size: 13.5px;
  color: var(--text-secondary);
  transition: max-height 0.2s ease, padding 0.2s ease;
}

.ptr-indicator.show {
  max-height: 52px;
  padding: 14px 0 6px;
}

.ptr-spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-card);
  border-top-color: var(--accent);
  animation: ptrSpin 0.7s linear infinite;
}

@keyframes ptrSpin {
  to { transform: rotate(360deg); }
}

/* Skeleton Loading Post */
.skel-card {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.skel-card .user-avatar {
  background: var(--bg-surface);
  box-shadow: none;
}

.skel-lines {
  flex: 1;
}

.skel-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-hover) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: skelShimmer 1.4s ease-in-out infinite;
  margin-bottom: 8px;
}

.skel-line:last-child {
  margin-bottom: 0;
  width: 65%;
}

@keyframes skelShimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ==========================================================================
 * Search View
 * ========================================================================== */
.search-header-box {
  padding: 12px 16px;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--bg-surface);
  border-radius: 9999px;
  padding: 10px 16px;
  border: 1px solid transparent;
  color: var(--text-secondary);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.search-input-wrap:focus-within {
  background-color: var(--bg-card);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  color: var(--accent);
}

.search-input-wrap input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 15px;
  color: var(--text-primary);
}

.search-input-wrap input::placeholder {
  color: var(--text-muted);
}

.search-clear-btn {
  display: grid;
  place-items: center;
  color: var(--text-secondary);
}

.search-tags-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.search-tags-row::-webkit-scrollbar {
  display: none;
}

.search-tag {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border-radius: 9999px;
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.search-tag:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

/* ==========================================================================
 * Activity / Notifications View
 * ========================================================================== */
.activity-header {
  padding: 12px 16px;
}

.section-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
}

.activity-filter-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.activity-filter-pills::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  padding: 7px 18px;
  border-radius: 9999px;
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.filter-pill:hover {
  color: var(--text-primary);
}

.filter-pill.active {
  background-color: var(--btn-pill-bg);
  color: var(--btn-pill-text);
  border-color: var(--btn-pill-bg);
}

.activity-list {
  list-style: none;
  margin-top: 8px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.activity-item:hover {
  background-color: var(--bg-hover);
}

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
}

.act-like {
  color: var(--like);
  background-color: var(--like-hover-bg);
}

.act-repost {
  color: var(--repost);
  background-color: var(--repost-hover-bg);
}

.act-reply {
  color: var(--accent);
  background-color: var(--accent-tint);
}

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

.activity-user {
  font-weight: 700;
  color: var(--text-primary);
}

.activity-text {
  font-size: 14.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.activity-time {
  font-size: 13px;
  color: var(--text-muted);
}

/* ==========================================================================
 * Profile View
 * ========================================================================== */
.profile-header-card {
  padding: 20px 16px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.profile-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.profile-name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.profile-handle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.profile-bio {
  font-size: 15px;
  line-height: 22px;
  color: var(--text-primary);
  margin-bottom: 16px;
  white-space: pre-wrap;
}

.profile-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.meta-dot {
  color: var(--text-muted);
}

.profile-actions-row {
  display: flex;
  gap: 12px;
}

.profile-btn-outline {
  flex: 1;
  padding: 9px 0;
  border: 1px solid var(--border-card);
  border-radius: 12px;
  font-weight: 700;
  font-size: 14.5px;
  text-align: center;
  color: var(--text-primary);
}

.profile-btn-outline:hover {
  background-color: var(--bg-hover);
}

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

.profile-tab {
  flex: 1;
  padding: 15px 0;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-secondary);
  text-align: center;
  position: relative;
}

.profile-tab.active {
  color: var(--text-primary);
}

.profile-tab.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--text-primary);
  border-radius: 9999px 9999px 0 0;
}

/* ==========================================================================
 * Composer Modal & Dialogs
 * ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: var(--scrim);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 16px;
  animation: modalFadeBackdrop 0.18s ease;
}

@keyframes modalFadeBackdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  width: 100%;
  max-width: 600px;
  background-color: var(--bg-modal);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  box-shadow: var(--elevation-modal);
  overflow: hidden;
  animation: modalScaleUp 0.22s var(--spring-soft);
}

@keyframes modalScaleUp {
  from { transform: scale(0.95) translateY(12px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.modal-cancel-btn {
  font-size: 15px;
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 9999px;
}

.modal-cancel-btn:hover {
  background-color: var(--bg-hover);
}

.modal-done-btn {
  font-size: 15px;
  font-weight: 700;
}

.modal-form {
  padding: 16px;
}

/* Crucial Fix: Two-Column Composition Grid in Modal */
.modal-body-thread {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.thread-author-col {
  flex: 0 0 var(--gutter-width);
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: stretch;
}

.thread-stem-line {
  flex: 1;
  width: 2px;
  background-color: var(--threadline);
  margin-top: 8px;
  min-height: 40px;
  border-radius: 1px;
}

.thread-input-col {
  flex: 1;
  min-width: 0;
}

.thread-author-name {
  font-weight: 750;
  font-size: 15px;
  margin-bottom: 6px;
}

.modal-body-thread textarea {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 18px;
  line-height: 24px;
  resize: none;
  min-height: 110px;
  caret-color: var(--accent);
}

.modal-body-thread textarea::placeholder {
  color: var(--text-muted);
}

.modal-tools-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.audience-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.char-count-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.char-counter {
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.char-ring {
  flex: none;
  display: block;
}

.char-ring .ring-fg {
  transition: stroke-dashoffset 0.15s ease, stroke 0.15s ease;
}

/* Reply Parent Context Preview */
.reply-parent-context {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.threadline-connector {
  flex: 1;
  width: 2px;
  background-color: var(--threadline);
  margin-top: 6px;
  border-radius: 1px;
}

.parent-text-preview {
  font-size: 14.5px;
  line-height: 20px;
  color: var(--text-secondary);
}

/* Edit Profile Modal */
.edit-profile-form {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-row input,
.form-row textarea {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-card);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 15px;
  outline: 0;
  transition: border-color 0.15s ease;
}

.form-row input:focus,
.form-row textarea:focus {
  border-color: var(--text-primary);
}

/* ==========================================================================
 * Floating Compose Button & Bottom Sheet (Mobile)
 * ========================================================================== */
.floating-compose-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background-color: var(--btn-pill-bg);
  color: var(--btn-pill-text);
  display: grid;
  place-items: center;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
  z-index: 90;
  transition: transform 0.18s var(--spring), box-shadow 0.18s ease;
}

.floating-compose-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.3);
}

.floating-compose-btn:active {
  transform: scale(0.94);
}

/* Mobile Bottom Navigation Bar */
.mobile-nav-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: var(--header-glass);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-top: 1px solid var(--border-subtle);
  z-index: 100;
  padding: 0 12px env(safe-area-inset-bottom);
  align-items: center;
  justify-content: space-around;
}

.m-nav-tab {
  width: 48px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  position: relative;
}

.m-nav-tab.active {
  color: var(--text-primary);
}

.m-nav-tab.active::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-primary);
}

/* ==========================================================================
 * Menu Sheets, Popovers & Dialogs
 * ========================================================================== */
.menu-sheet {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(440px, calc(100vw - 24px));
  background-color: var(--bg-modal);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  z-index: 250;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  padding: 8px;
  animation: sheetPopUp 0.24s var(--spring-soft);
}

@keyframes sheetPopUp {
  from { transform: translate(-50%, 40px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.menu-sheet-inner {
  display: flex;
  flex-direction: column;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 650;
  border-radius: 12px;
  color: var(--text-primary);
}

.menu-item:hover {
  background-color: var(--bg-hover);
}

.menu-value {
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 14px;
}

.menu-divider {
  height: 1px;
  background-color: var(--border-subtle);
  margin: 4px 8px;
}

.menu-item.close-item {
  justify-content: center;
  color: var(--text-secondary);
  margin-top: 4px;
}

.sheet-scrim {
  position: fixed;
  inset: 0;
  background-color: var(--scrim);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 240;
}

/* Context Menu Popover */
.post-menu-pop {
  position: absolute;
  z-index: 400;
  width: 220px;
  background-color: var(--bg-modal);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  padding: 6px;
  animation: menuPopIn 0.18s var(--spring-soft);
}

@keyframes menuPopIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.post-menu-pop button {
  display: flex;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  font-size: 14.5px;
  font-weight: 650;
  border-radius: 10px;
  color: var(--text-primary);
}

.post-menu-pop button:hover {
  background-color: var(--bg-hover);
}

.post-menu-pop button.danger {
  color: var(--heart-active);
}

/* ==========================================================================
 * Toast Pill (Twitter-Grade Floating Notification)
 * ========================================================================== */
.toast-pill {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--btn-pill-bg);
  color: var(--btn-pill-text);
  font-size: 14px;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: 9999px;
  z-index: 300;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  animation: toastFlyIn 0.32s var(--spring);
}

.toast-pill.leaving {
  animation: toastFlyOut 0.2s ease forwards;
}

@keyframes toastFlyIn {
  from { opacity: 0; transform: translate(-50%, 16px) scale(0.92); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes toastFlyOut {
  to { opacity: 0; transform: translate(-50%, 10px) scale(0.95); }
}

/* ==========================================================================
 * Right Rail (Desktop Trends, Search, Earth Card)
 * ========================================================================== */
.rail-search {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--bg-surface);
  border: 1px solid transparent;
  border-radius: 9999px;
  padding: 11px 18px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.rail-search:focus-within {
  background-color: var(--bg-card);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  color: var(--accent);
}

.rail-search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 14.5px;
  min-width: 0;
}

.rail-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 16px;
}

.rail-card h3 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 10px;
}

.rail-card p {
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}

.trend-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trend-chip {
  border: 1px solid var(--border-card);
  border-radius: 9999px;
  padding: 7px 14px;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text-primary);
  background-color: var(--bg-card);
  cursor: pointer;
}

.trend-chip:hover {
  background-color: var(--bg-hover);
}

.trend-chip span {
  color: var(--text-muted);
  font-weight: 400;
}

.trend-empty {
  font-size: 13.5px;
  color: var(--text-muted);
}

/* Earth View / Globe Rail Card */
.earth-card {
  padding: 14px;
}

.earth-card[hidden] { display: none; }

.earth-view {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: #000000 radial-gradient(circle at 50% 0%, #1a1a1c 0%, #000000 75%);
}

.earth-view canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 1.6s ease;
}

.earth-view canvas.ready {
  opacity: 1;
}

.earth-caption {
  margin: 10px 2px 0;
  font-size: 12.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 4px 6px;
}

.rail-links a {
  font-size: 12.5px;
  color: var(--text-muted);
}

.rail-links a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* ==========================================================================
 * Responsive Breakpoints & Mobile Parity
 * ========================================================================== */
@media (max-width: 720px) {
  .app-header {
    display: none;
  }

  .mobile-header {
    display: flex;
  }

  .mobile-nav-bar {
    display: flex;
  }

  .feed-tabs-bar {
    top: 52px;
  }

  .new-posts-pill {
    top: 110px;
  }

  .feed-container {
    padding-top: 0;
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }

  .floating-compose-btn {
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    right: 18px;
  }

  /* Native Mobile Bottom Sheet Transformation */
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal-card {
    border-radius: 22px 22px 0 0;
    max-width: 100%;
    border-bottom: 0;
    animation: sheetSlideUp 0.28s var(--spring-soft);
  }

  .modal-card::before {
    content: "";
    display: block;
    width: 38px;
    height: 4.5px;
    border-radius: 9999px;
    background-color: var(--border-card);
    margin: 8px auto 2px;
  }

  @keyframes sheetSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .post-menu-pop.sheet {
    position: fixed;
    left: 12px !important;
    right: 12px;
    top: auto !important;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: auto;
  }
}

/* ==========================================================================
 * Accessibility & Reduced Motion
 * ========================================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 500;
  background-color: var(--text-primary);
  color: var(--bg-canvas);
  font-size: 14px;
  font-weight: 700;
  border-radius: 9999px;
  padding: 9px 18px;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
}

.thread-card.kb-focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 14px;
  background-color: var(--bg-hover) !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html, body {
    overscroll-behavior-y: auto;
  }
}