/* ============================================================
   X-inspired UI, dark theme (matches the provided reference: near-black
   surfaces, saturated blue accent, compact rounded right-rail cards).
   ============================================================ */
:root {
  --bg: #000000;
  --bg-gradient: radial-gradient(ellipse 1200px 800px at 15% -10%, #2a1052 0%, transparent 55%),
                 radial-gradient(ellipse 1000px 700px at 100% 0%, #0d2e4d 0%, transparent 50%),
                 radial-gradient(ellipse 1200px 900px at 50% 120%, #3a0d2e 0%, transparent 55%),
                 #000000;
  --surface: #0d0f13;
  --surface-2: #15181e;
  --bg-hover: rgba(255, 255, 255, 0.06);
  --bg-hover-strong: rgba(255, 255, 255, 0.1);
  --text: #e7e9ea;
  --text-secondary: #8b98a5;
  --border: #23262d;
  --blue: #3b82f6;
  --blue-dark: #2f6fe0;
  --blue-tint: rgba(59, 130, 246, 0.15);
  --red: #f4506b;
  --red-tint: rgba(244, 80, 107, 0.14);
  --green: #00d488;
  --green-tint: rgba(0, 212, 136, 0.14);
  --gold: #ffd400;
  --gold-dark: #caa400;
  --gold-tint: rgba(255, 212, 0, 0.12);
  --logo-filter: none;
  --bg-translucent: rgba(0, 0, 0, 0.8);
  --bg-translucent-strong: rgba(0, 0, 0, 0.95);
  --topbar-bg: rgba(13, 8, 20, 0.45);
  --hero-gradient: radial-gradient(circle at 30% 30%, #1a2540, #000);
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg-gradient: radial-gradient(ellipse 1200px 800px at 15% -10%, #e0d4ff 0%, transparent 55%),
                 radial-gradient(ellipse 1000px 700px at 100% 0%, #cfe8ff 0%, transparent 50%),
                 radial-gradient(ellipse 1200px 900px at 50% 120%, #ffd9ec 0%, transparent 55%),
                 #ffffff;
  --surface: #f7f9f9;
  --surface-2: #eff3f4;
  --bg-hover: rgba(15, 20, 25, 0.06);
  --bg-hover-strong: rgba(15, 20, 25, 0.1);
  --text: #0f1419;
  --text-secondary: #536471;
  --border: #eff3f4;
  --logo-filter: invert(1);
  --bg-translucent: rgba(255, 255, 255, 0.85);
  --bg-translucent-strong: rgba(255, 255, 255, 0.95);
  --topbar-bg: rgba(255, 255, 255, 0.45);
  --hero-gradient: radial-gradient(circle at 30% 30%, #dbeafe, #ffffff);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.brand-mark { display: inline-flex; align-items: center; justify-content: center; }
.brand-logo { filter: var(--logo-filter); display: block; }
.pulse-loading { display: flex; justify-content: center; padding: 40px 0; }

.theme-toggle {
  display: flex; align-items: center; gap: 20px; padding: 12px; border-radius: 999px;
  font-size: 17px; font-weight: 500; color: var(--text); background: none; border: none;
  width: fit-content; max-width: 100%; text-align: left;
}
.theme-toggle:hover { background: var(--bg-hover); }
.theme-toggle svg { width: 24px; height: 24px; flex-shrink: 0; }

/* ---- Layout shell ---- */
.shell {
  max-width: 1265px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 275px minmax(0, 600px) 350px;
  min-height: 100vh;
}
.shell.no-right-col { grid-template-columns: 275px minmax(0, 1fr); max-width: none; }
@media (max-width: 1080px) {
  .shell { grid-template-columns: 88px minmax(0, 600px) 350px; }
  .shell.no-right-col { grid-template-columns: 88px 1fr; }
  .col-left .nav-label, .col-left .brand-text, .compose-btn span { display: none; }
  .compose-btn { width: 52px !important; height: 52px; padding: 0 !important; border-radius: 50% !important; }
  .account-chip .acc-info, .account-chip .chip-caret { display: none; }
}
@media (max-width: 990px) { .col-right { display: none !important; } }

/* ---- Mobile: top bar + bottom nav + slide-out drawer (X's actual mobile pattern) ---- */
.mobile-topbar, .mobile-bottom-nav, .mobile-compose-fab, .mobile-drawer, .mobile-drawer-backdrop { display: none; }

@media (max-width: 690px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .shell.no-right-col { grid-template-columns: minmax(0, 1fr); }
  .col-left { display: none !important; }
  .col-center { padding-top: calc(52px + env(safe-area-inset-top)); padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

  .mobile-topbar {
    display: flex; align-items: center; justify-content: center; position: fixed; top: 0; left: 0; right: 0;
    height: calc(52px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top);
    z-index: 40; background: var(--topbar-bg); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
  }
  .mobile-topbar .mobile-avatar-btn { position: absolute; left: 12px; background: none; border: none; padding: 8px; margin: -8px; }
  .mobile-topbar .mobile-avatar-btn img { width: 32px; height: 32px; display: block; }
  .mobile-topbar .mobile-brand { display: flex; align-items: center; }

  .mobile-bottom-nav {
    display: flex; justify-content: space-around; align-items: center; position: fixed; bottom: 0; left: 0; right: 0;
    height: calc(52px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    z-index: 40; background: var(--bg-translucent-strong); backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
  }
  .mobile-bottom-nav a {
    display: flex; align-items: center; justify-content: center; position: relative; color: var(--text); width: 48px; height: 48px; border-radius: 50%;
  }
  .mobile-bottom-nav a.active { color: var(--blue); }
  .mobile-bottom-nav a svg { width: 24px; height: 24px; }
  .mobile-bottom-nav .mobile-nav-badge {
    position: absolute; top: 4px; right: 4px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
    border-radius: 999px; padding: 0 4px; min-width: 15px; text-align: center; display: none;
  }

  .mobile-compose-fab {
    display: flex; align-items: center; justify-content: center; position: fixed; right: 16px;
    bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 40;
    width: 56px; height: 56px; border-radius: 50%; background: var(--blue); color: #fff; border: none; box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  }
  .mobile-compose-fab svg { width: 24px; height: 24px; }

  .mobile-drawer-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 50; }
  .mobile-drawer {
    display: block; position: fixed; top: 0; bottom: 0; left: 0; width: 80%; max-width: 300px; z-index: 51;
    background: var(--surface); border-right: 1px solid var(--border);
    padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
    transform: translateX(-100%); transition: transform 0.2s ease; overflow-y: auto;
  }
  .mobile-drawer.open { transform: translateX(0); }
  .mobile-drawer-header { margin-bottom: 16px; }
  .mobile-drawer-name { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 2px; margin-top: 10px; }
  .mobile-drawer-handle { color: var(--text-secondary); font-size: 14px; display: flex; align-items: center; gap: 4px; }
  .mobile-drawer-handle .chip-caret { transition: transform 0.15s; }
  .mobile-drawer-handle .chip-caret.open { transform: rotate(180deg); }
  .mobile-drawer-switcher-list { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 0 -16px 16px; padding: 4px 0; }
  .mobile-drawer-switcher-list .switcher-item, .mobile-drawer-switcher-list .switcher-action { padding-left: 16px; padding-right: 16px; }
  .mobile-drawer-stats { display: flex; gap: 16px; margin-top: 10px; font-size: 13px; color: var(--text-secondary); }
  .mobile-drawer-stats b { color: var(--text); }
  .mobile-drawer-nav { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 8px; }
  .mobile-drawer-nav a, .mobile-drawer-nav button {
    display: flex; align-items: center; gap: 14px; padding: 12px 8px; border-radius: 8px; width: 100%;
    background: none; border: none; color: var(--text); font-size: 16px; text-align: left;
  }
  .mobile-drawer-nav a:hover, .mobile-drawer-nav button:hover { background: var(--bg-hover); }
  .mobile-drawer-nav svg { width: 22px; height: 22px; flex-shrink: 0; }
  .mobile-drawer-nav .mobile-drawer-danger { color: var(--red); }
}


.col-left {
  border-right: 1px solid var(--border);
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 999px; margin: 4px 4px 8px;
  font-weight: 800; font-size: 20px; letter-spacing: -0.01em; width: fit-content;
}
.brand:hover { background: var(--bg-hover); }

.nav-link {
  display: flex; align-items: center; gap: 20px;
  padding: 12px; border-radius: 999px;
  font-size: 20px; font-weight: 400; color: var(--text);
  width: fit-content; max-width: 100%;
}
.nav-link:hover { background: var(--bg-hover); }
.nav-link.active { font-weight: 700; background: var(--blue-tint); color: var(--text); }
.nav-link svg { width: 26px; height: 26px; flex-shrink: 0; }
.nav-more-btn {
  background: none; border: none; cursor: pointer; font: inherit; text-align: left; width: 100%;
}
.nav-more-wrap { position: relative; }
.nav-more-popover {
  position: absolute; top: 100%; left: 0; margin-top: 4px; z-index: 50;
  display: flex; flex-direction: column; width: 220px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.5); padding: 6px;
}
.nav-more-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  font-weight: 600; font-size: 14px; color: var(--text); text-decoration: none; box-sizing: border-box;
}
.nav-more-item:hover { background: var(--bg-hover); }
.nav-more-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.account-chip-wrap { position: relative; }

/* ---- Sidebar: brand row + collapse toggle (Redesigned layout preview only) ---- */
.brand-row { display: flex; align-items: center; justify-content: space-between; padding: 0 12px; margin-bottom: 8px; }
.sidebar-collapse-btn {
  background: none; border: 1px solid var(--border); border-radius: 50%; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center; color: var(--text-secondary); cursor: pointer; flex-shrink: 0;
}
.sidebar-collapse-btn:hover { background: var(--bg-hover); color: var(--text); }
.sidebar-collapse-btn svg { width: 15px; height: 15px; }

/* ---- Sidebar: collapsed (icon-only) state ---- */
[data-sidebar="collapsed"] .shell { grid-template-columns: 88px minmax(0, 600px) 350px; }
[data-sidebar="collapsed"] .shell.no-right-col { grid-template-columns: 88px minmax(0, 1fr); }
[data-sidebar="collapsed"] .col-left { width: 88px; padding-left: 8px; padding-right: 8px; align-items: center; }
[data-sidebar="collapsed"] .nav-label { display: none; }
[data-sidebar="collapsed"] .nav-link { justify-content: center; gap: 0; width: 52px; height: 52px; padding: 0; position: relative; }
[data-sidebar="collapsed"] .brand-row { flex-direction: column; gap: 10px; padding: 0; }
[data-sidebar="collapsed"] .brand { justify-content: center; }
[data-sidebar="collapsed"] .compose-btn { width: 52px; height: 52px; padding: 0; margin-left: auto; margin-right: auto; }
[data-sidebar="collapsed"] .acc-info, [data-sidebar="collapsed"] .chip-caret { display: none; }
[data-sidebar="collapsed"] .account-chip { justify-content: center; padding: 8px; }
[data-sidebar="collapsed"] .nav-badge { position: absolute; top: 6px; right: 6px; }

/* CSS-only tooltip, shown on hover only while collapsed -- matches the reference design's
   flyout label bubble, simplified since this sidebar's items are all flat (no nested
   sub-items), so a plain tooltip covers it without needing a full flyout menu system. */
[data-sidebar="collapsed"] [data-tooltip] { position: relative; }
[data-sidebar="collapsed"] [data-tooltip]:hover::after {
  content: attr(data-tooltip); position: absolute; left: 100%; top: 50%; transform: translateY(-50%);
  margin-left: 10px; background: #000; color: #fff; padding: 6px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 700; white-space: nowrap; z-index: 50; pointer-events: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}

.compose-btn {
  margin-top: auto; width: 90%;
  background: var(--blue); color: #fff; border: none; border-radius: 999px;
  padding: 15px; font-weight: 700; font-size: 17px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.compose-btn:hover { background: var(--blue-dark); }
.compose-btn svg { width: 20px; height: 20px; flex-shrink: 0; }

.account-chip {
  margin-top: auto; margin-bottom: 8px;
  display: flex; align-items: center; gap: 10px;
  padding: 12px; border-radius: 999px; position: relative;
}
.account-chip:hover { background: var(--bg-hover); }
.acc-info { min-width: 0; flex: 1; }
.chip-caret { flex-shrink: 0; color: var(--text-secondary); }
.chip-caret svg { width: 16px; height: 16px; display: block; }

.col-center { border-right: 1px solid var(--border); min-height: 100vh; min-width: 0; }

.topbar {
  position: sticky; top: 0; background: var(--topbar-bg); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); padding: 12px 16px; z-index: 10;
  display: flex; align-items: center; gap: 20px; justify-content: space-between;
}
.topbar h1 { font-size: 20px; margin: 0; font-weight: 800; }
.topbar-title-wrap { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: none; border: none; color: var(--text); }
.profile-action-icon { width: 40px; height: 40px; border: 1px solid #536471; }
.profile-action-icon:hover { background: var(--bg-hover); }
.icon-btn:hover { background: var(--bg-hover); }
.icon-btn svg { width: 19px; height: 19px; }

.tabbar { display: flex; border-bottom: 1px solid var(--border); }
.tab {
  flex: 1; text-align: center; padding: 16px 0; font-weight: 500; color: var(--text-secondary);
  background: none; border: none; position: relative;
}
.tab:hover { background: var(--bg-hover); }
.tab.active { color: var(--text); font-weight: 700; }
.tab.active::after {
  content: ""; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 56px; height: 4px; border-radius: 4px; background: var(--blue);
}

/* ---- Redesigned layout preview (Settings -> "Try new design") ---- */
[data-design="new"] .tab.active::after { display: none; }
[data-design="new"] .tabbar { border-bottom: none; padding: 6px 8px; gap: 4px; }
[data-design="new"] .tab { border-radius: 999px; padding: 10px 0; }
[data-design="new"] .tab.active { background: var(--blue-tint); color: var(--blue); }

[data-design="new"] .tweet {
  border-radius: 18px; padding: 16px;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
[data-design="new"] .tweet:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.18); }
[data-design="new"] .tweet-actions { max-width: 360px; }

[data-design="new"] .profile-avatar-wrap img.avatar-lg { border: 4px solid var(--surface); box-shadow: 0 0 0 2px var(--blue-tint); }
[data-design="new"] .profile-name { font-size: 22px; }
[data-design="new"] .private-lock-badge { color: var(--text-secondary); }

[data-design="new"] .poll-result-row.leading { border: 2px solid var(--blue); }
[data-design="new"] .poll-result-row.leading .poll-result-bar { background: var(--blue-tint); }
[data-design="new"] .poll-result-row.leading .poll-result-label { font-weight: 700; }

/* Quote posts: a flat left-border strip -> a proper nested card matching the outer post's
   own rounded-card treatment, so a quote reads as "a post inside a post" instead of a link. */
[data-design="new"] .link-embed {
  border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; margin: 8px 0 4px;
  background: var(--surface-2);
}
[data-design="new"] .link-embed:hover { background: var(--bg-hover); border-color: var(--text-secondary); }
[data-design="new"] .link-embed-media { border-radius: 12px; max-height: 220px; }

/* Co-posts: the overlapping-avatar stack gets a touch more separation and a subtle ring,
   matching the redesigned profile avatar treatment elsewhere in the new design. */
[data-design="new"] .copost-avatar-stack { width: 56px; }
[data-design="new"] .copost-avatar-stack img { width: 36px; height: 36px; }
[data-design="new"] .copost-avatar-stack img:first-child { border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border); }
[data-design="new"] .copost-avatar-stack img:last-child { left: 20px; top: 8px; }
[data-design="new"] .copost-trigger.tweet-name:hover, [data-design="new"] .copost-trigger.tweet-handle:hover { color: var(--blue); text-decoration: none; }

/* Composer */
[data-design="new"] .composer-modal { border-radius: 24px; }
[data-design="new"] .composer-footer { border-top: none; margin-top: 4px; padding-top: 6px; }
[data-design="new"] .composer-tools { gap: 6px; background: var(--surface-2); border-radius: 999px; padding: 4px 6px; }
[data-design="new"] .composer-tools .icon-btn:hover { background: var(--blue-tint); }
[data-design="new"] #composer-submit { font-weight: 800; }
[data-design="new"] #composer-text { font-size: 17px; }

/* Composer modal: more breathing room throughout. .composer has an inline padding set in the
   markup (padding:0 16px), which beats a plain class rule -- !important is deliberate here,
   not fighting user styles, just overriding our own static inline attribute. */
[data-design="new"] .composer-modal { max-width: 640px; }
[data-design="new"] .composer-topbar { padding: 14px 20px 0; }
[data-design="new"] .composer-modal .composer { padding: 20px 24px !important; gap: 16px; }
[data-design="new"] .composer-modal .avatar.avatar-sm { width: 48px; height: 48px; }
[data-design="new"] .composer-modal #composer-text { min-height: 110px; line-height: 1.5; }
[data-design="new"] .composer-modal .composer-footer { padding-top: 16px; margin-top: 16px; }
[data-design="new"] .composer-modal .composer-tools { padding: 6px 8px; }

/* Notifications: flat rows -> spaced cards, matching the redesigned post cards */
[data-design="new"] .notif-row {
  border-bottom: none; border: 0.5px solid var(--border); border-radius: 16px;
  margin: 0 12px 10px; padding: 14px 16px;
}
[data-design="new"] .notif-row.unread { background: var(--surface-1); border-color: var(--blue); }
[data-design="new"] .notif-icon { width: 40px; height: 40px; }

/* Modals in general: more depth, more breathing room */
[data-design="new"] .modal-backdrop { background: rgba(0,0,0,0.75); }
[data-design="new"] .modal { border-radius: 20px; padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
[data-design="new"] .modal h2 { font-size: 20px; }

/* Home feed composer prompt: quick-access icons, only visible in the new design */
.composer-prompt-icons { display: none; }
[data-design="new"] .composer {
  align-items: flex-start; padding: 14px 16px 10px; border-bottom: none;
  border-radius: 16px; border: 0.5px solid var(--border); margin: 8px 12px;
}
[data-design="new"] .composer-prompt-icons {
  display: flex; gap: 4px; margin-top: 8px; padding-top: 8px; border-top: 0.5px solid var(--border);
}
[data-design="new"] .composer-prompt-icons .icon-btn { color: var(--blue); }
[data-design="new"] .composer-prompt-icons .icon-btn:hover { background: var(--blue-tint); }

/* App-frame look: the shell becomes a rounded elevated card floating on the existing page
   gradient, instead of blending edge-to-edge into it. */
[data-design="new"] .shell {
  background: var(--surface); border-radius: 24px; margin: 16px auto;
  max-width: 1300px; box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}
[data-design="new"] .col-center { min-height: 100vh; }
[data-design="new"] .col-left { border-radius: 24px 0 0 24px; }
[data-design="new"] .col-right { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding-top: 16px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
[data-design="new"] .col-right::-webkit-scrollbar { width: 6px; }
[data-design="new"] .col-right::-webkit-scrollbar-track { background: transparent; }
[data-design="new"] .col-right::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
[data-design="new"] .col-right::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* Sidebar: active nav item becomes a solid, high-contrast pill instead of a tinted one --
   uses --text/--surface so it auto-inverts correctly in both light and dark mode. */
[data-design="new"] .nav-link.active { background: var(--text); color: var(--surface); }

/* Home feed cards get a subtle neutral grey background, matching a clean flat aesthetic rather
   than color-coding by position. */
[data-design="new"] #feed-list > .tweet,
[data-design="new"] #feed-list > div .tweet { background: var(--surface-2); border-color: transparent; }

/* Suggestions and composer's primary action become solid monochrome pills, matching the
   reference's black "Follow"/"Send" buttons -- theme-safe via --text/--surface. */
[data-design="new"] .follow-suggest { background: var(--text); color: var(--surface); border: none; }
[data-design="new"] .follow-suggest:hover { opacity: 0.85; }
[data-design="new"] #composer-submit:not(:disabled) { background: var(--text); color: var(--surface); }
[data-design="new"] #composer-submit:not(:disabled):hover { opacity: 0.85; }

/* ---- Staff panel redesign ---- */
[data-design="new"] .stats-grid { gap: 12px; }
[data-design="new"] .stat-card {
  border-radius: 16px; padding: 16px; border-color: transparent; background: var(--surface-2);
  transition: transform 0.15s, box-shadow 0.15s;
}
[data-design="new"] .stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.15); }
[data-design="new"] .stat-card-value { font-size: 26px; }
[data-design="new"] #staff-tab-content .member-row {
  border: 1px solid var(--border); border-bottom: 1px solid var(--border); border-radius: 14px;
  margin: 0 16px 8px; padding: 12px 14px;
}
[data-design="new"] #staff-tab-content .member-row:hover { background: var(--surface-2); }
[data-design="new"] #staff-tab-content .report-row {
  border: 1px solid var(--border); border-radius: 16px; margin: 0 16px 12px; padding-top: 12px; overflow: hidden;
}
[data-design="new"] #staff-tab-content .report-row .member-row { border: none; margin: 0; border-radius: 0; }
[data-design="new"] .staff-edit-btn { border-radius: 999px; }

/* ---- Homepage: a further pass on top of the earlier card/framing work ---- */
[data-design="new"] #feed-list > .tweet:hover,
[data-design="new"] #feed-list > div .tweet:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,0.2); }
[data-design="new"] .infinite-scroll-sentinel { padding: 24px 0; }

.col-right { padding: 0 16px; display: flex; flex-direction: column; gap: 16px; }
.search-box {
  margin: 8px 0; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 12px 16px;
  display: flex; align-items: center; gap: 12px; color: var(--text-secondary); font-size: 15px;
}
.search-box svg { width: 18px; height: 18px; flex-shrink: 0; }
.search-box input { background: none; border: none; color: var(--text); font-size: 16px; flex: 1; font-family: var(--font); }
.search-box input:focus { outline: none; }
.search-box input::placeholder { color: var(--text-secondary); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px 16px; }
.panel h3 { font-size: 20px; margin: 4px 0 8px; font-weight: 800; }
.panel-row { padding: 10px 0; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.panel-row:first-of-type { border-top: none; }
.panel-row .label { font-size: 13px; color: var(--text-secondary); }
.panel-row .title { font-weight: 700; font-size: 15px; }
.trend-tag { color: var(--blue); font-weight: 700; }
.trend-count { color: var(--text-secondary); font-size: 13px; }
.suggest-row { display: flex; align-items: center; gap: 10px; }
.suggest-row .btn-secondary { margin-left: auto; padding: 6px 14px; font-size: 13px; }

.discord-panel { display: block; text-decoration: none; transition: background 0.15s; }
.discord-panel:hover { background: var(--surface-2); }
.discord-panel-head { display: flex; align-items: center; gap: 10px; }
.discord-badge {
  width: 32px; height: 32px; border-radius: 50%; background: #5865f2;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.discord-badge svg { width: 18px; height: 18px; }
.discord-panel p { color: var(--text-secondary); font-size: 13px; line-height: 1.5; margin: 8px 0 2px; }
.footer-links { font-size: 13px; color: var(--text-secondary); padding: 4px 8px 20px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.footer-links a { color: var(--text-secondary); }
.footer-links a:hover { text-decoration: underline; }
.footer-links span { color: var(--border); }

.legal-page { padding: 24px; line-height: 1.7; font-size: 15px; color: var(--text); }
.legal-page h1 { font-size: 26px; margin-bottom: 4px; }
.legal-page .updated { color: var(--text-secondary); font-size: 13px; margin-bottom: 24px; }
.legal-page h2 { font-size: 18px; margin: 28px 0 8px; }
.legal-page p, .legal-page li { color: var(--text-secondary); }
.legal-page ul { padding-left: 20px; }

/* ---- Notifications ---- */
.notif-row { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.notif-row.unread { background: var(--blue-tint); }
.notif-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-icon svg { width: 18px; height: 18px; }
.notif-icon.like { background: var(--red-tint); color: var(--red); }
.notif-icon.retweet { background: var(--green-tint); color: var(--green); }
.notif-icon.follow, .notif-icon.reply, .notif-icon.follow_request { background: var(--blue-tint); color: var(--blue); }
.notif-icon.affiliate_request, .notif-icon.affiliate_accepted, .notif-icon.affiliate_granted, .notif-icon.verified { background: var(--gold-tint); color: var(--gold-dark); }
.notif-text { font-size: 14px; line-height: 1.4; }
.notif-preview { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }
.notif-actions { display: flex; gap: 8px; margin-top: 10px; }
.notif-actions .btn-primary, .notif-actions .btn-secondary { padding: 6px 16px; font-size: 14px; }
.nav-badge { background: var(--red); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 6px; }

/* ---- Messages (two-pane layout) ---- */
.messages-topbar { gap: 12px; justify-content: flex-start; }
.messages-topbar #msg-back-btn { display: none; }
.messages-layout { display: flex; height: calc(100vh - 53px); }

.conv-list-pane { width: 100%; max-width: 350px; border-right: 1px solid var(--border); overflow-y: auto; flex-shrink: 0; }
.conv-row { display: flex; gap: 12px; padding: 12px 16px; cursor: pointer; align-items: flex-start; }
.conv-row:hover { background: var(--bg-hover); }
.conv-row.active { background: var(--surface-2); }
.conv-row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.conv-row .conv-name { font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-row .conv-preview { color: var(--text-secondary); font-size: 13px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-row .conv-preview.unread { color: var(--text); font-weight: 600; }
.conv-row .conv-time { color: var(--text-secondary); font-size: 12px; white-space: nowrap; flex-shrink: 0; }
.conv-section-label { padding: 12px 16px 4px; font-size: 12px; font-weight: 800; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.03em; }
.group-avatar-fallback { display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text-secondary); flex-shrink: 0; }
.group-avatar-fallback svg { width: 20px; height: 20px; }
.group-msg-sender { font-size: 12px; font-weight: 700; color: var(--text-secondary); margin-bottom: 2px; }
.conv-badge { position: static; margin-left: 6px; }

.thread-pane { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.thread-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  color: var(--text-secondary); gap: 6px; padding: 20px;
}
.thread-empty svg { width: 56px; height: 56px; opacity: 0.5; margin-bottom: 8px; }
.thread-empty div { font-size: 20px; font-weight: 800; color: var(--text); }
.thread-empty span { font-size: 14px; max-width: 260px; }

.msg-thread-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.msg-thread { display: flex; flex-direction: column; gap: 2px; padding: 16px; flex: 1; overflow-y: auto; }
.msg-bubble { max-width: 70%; padding: 10px 14px; border-radius: 18px; font-size: 14px; line-height: 1.4; word-break: break-word; margin-top: 8px; }
.msg-media { display: block; max-width: 100%; border-radius: 12px; margin-bottom: 6px; }
.msg-bubble.grouped { margin-top: 2px; }
.msg-bubble.mine { align-self: flex-end; background: var(--blue); color: #fff; }
.msg-bubble.mine.grouped { border-bottom-right-radius: 4px; }
.msg-bubble.theirs { align-self: flex-start; background: var(--surface-2); color: var(--text); }
.msg-bubble.theirs.grouped { border-bottom-left-radius: 4px; }
.msg-compose {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border);
  flex-shrink: 0; background: var(--surface);
}
.msg-compose input {
  flex: 1; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
  padding: 12px 16px; color: var(--text); font-family: var(--font); font-size: 14px;
}
.msg-compose input:focus { outline: none; border-color: var(--blue); }
.msg-send-btn {
  width: 38px; height: 38px; border-radius: 50%; background: var(--blue); color: #fff; border: none;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.msg-send-btn:hover { background: var(--blue-dark); }
.msg-send-btn svg { width: 17px; height: 17px; }

@media (max-width: 690px) {
  .conv-list-pane { display: block; max-width: none; }
  .thread-pane { display: none; }
  .messages-layout.thread-open .conv-list-pane { display: none; }
  .messages-layout.thread-open .thread-pane { display: flex; }
  .messages-topbar #msg-back-btn { display: flex; }
  /* .messages-layout's height was a fixed "100vh - 53px" that never accounted for the mobile
     bottom nav also eating into the viewport -- without this, the message compose bar could
     end up rendered behind the fixed bottom nav instead of just above it. Two bars stack here:
     the fixed overlay .mobile-topbar (already excluded via .col-center's own padding-top) and
     this page's own in-flow .messages-topbar sitting above .messages-layout -- both need
     accounting for, plus the fixed bottom nav. */
  .messages-layout {
    height: calc(100vh - calc(52px + env(safe-area-inset-top)) - 56px - calc(52px + env(safe-area-inset-bottom)));
  }
  .msg-compose input { font-size: 16px; padding: 12px 16px; }
  .msg-send-btn { width: 44px; height: 44px; }
  .conv-row { padding: 14px 16px; }
}

.staff-search-row { display: flex; gap: 8px; padding: 16px 16px 0; }
.staff-search-row input {
  flex: 1; background: var(--surface-2); border: 1px solid #3a3d44; border-radius: 8px;
  padding: 12px; color: var(--text); font-family: var(--font); font-size: 16px;
}
.staff-search-row input:focus { border-color: var(--blue); outline: none; }
@media (max-width: 500px) {
  .staff-search-row { flex-direction: column; }
  .staff-search-row #staff-sort { width: 100%; }
}

/* ---- Settings ---- */
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--border); gap: 12px; }
.settings-label { font-weight: 700; font-size: 15px; }
.settings-desc { color: var(--text-secondary); font-size: 13px; margin-top: 2px; }

/* ---- Settings page redesign: grouped cards instead of one long flat list ---- */
.settings-page { max-width: 600px; margin: 0 auto; padding: 8px 0 40px; }
.settings-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; margin: 0 16px 16px; overflow: hidden; }
.settings-card-danger { border-color: var(--red); }
.settings-card-header {
  font-weight: 800; font-size: 13px; padding: 14px 16px 10px; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.04em; display: flex; align-items: center; gap: 8px;
}
.settings-card-header svg { width: 15px; height: 15px; flex-shrink: 0; }
.settings-card-body { padding: 0 16px 16px; }
.settings-card .settings-row { border-bottom: 1px solid var(--border); }
.settings-card .settings-row:last-child { border-bottom: none; }
.settings-input { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px; color: var(--text); font-family: var(--font); }
.settings-pro-tag { color: #ffd400; font-size: 11px; font-weight: 800; margin-left: 4px; }

/* ---- Compose ---- */
.composer { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; }
.composer textarea {
  width: 100%; background: transparent; border: none; color: var(--text);
  font-size: 20px; font-family: var(--font); resize: none; min-height: 52px; overflow-y: hidden;
  transition: height 0.1s ease;
}
.composer textarea::placeholder { color: var(--text-secondary); }
.composer textarea:focus { outline: none; }
.composer-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; border-top: 1px solid var(--border); padding-top: 10px; }
.char-count { font-size: 13px; color: var(--text-secondary); }
.char-count.warn { color: var(--gold); }
.char-count.over { color: var(--red); }
.btn-primary {
  background: var(--blue); color: #fff; border: none; border-radius: 999px;
  padding: 9px 20px; font-weight: 700; font-size: 15px;
}
.btn-primary:hover { background: var(--blue-dark); }
.btn-secondary svg, .btn-primary svg {
  width: 16px; height: 16px; flex-shrink: 0; vertical-align: -3px; display: inline-block;
}
.btn-primary:disabled { opacity: 0.5; cursor: default; }
.btn-secondary {
  background: transparent; border: 1px solid #3a3d44; color: var(--text);
  border-radius: 999px; padding: 8px 16px; font-weight: 700; font-size: 14px;
}
.btn-secondary:hover { background: var(--bg-hover); }
.as-org-select {
  background: var(--surface-2); color: var(--blue); border: 1px solid #3a3d44;
  border-radius: 999px; padding: 6px 14px 6px 10px; font-size: 13px; font-weight: 700;
}

/* ---- Composer modal (X-style) ---- */
.composer-modal { max-width: 600px; padding: 0; }
.composer-topbar { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; }
.audience-btn {
  background: none; border: 1px solid var(--blue); color: var(--blue); border-radius: 999px;
  padding: 4px 12px 4px 14px; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px;
  margin-bottom: 8px; position: relative;
}
.audience-btn svg { width: 14px; height: 14px; }
.audience-menu {
  position: absolute; top: 32px; left: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,0.5); z-index: 10; overflow: hidden; width: 260px;
}
.audience-option {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: none; border: none;
  color: var(--text); font-size: 14px; text-align: left;
}
.audience-option:hover { background: var(--bg-hover); }
.audience-option svg { width: 18px; height: 18px; color: var(--blue); flex-shrink: 0; }
.composer-reply-note { display: flex; align-items: center; gap: 6px; color: var(--blue); font-size: 13px; padding: 8px 0; }
.composer-reply-note svg { width: 16px; height: 16px; }
.composer-tools { display: flex; gap: 2px; }
.composer-tools .icon-btn { color: var(--blue); width: 34px; height: 34px; }
.composer-tools .icon-btn svg { width: 20px; height: 20px; }
.emoji-picker { display: none; grid-template-columns: repeat(8, 1fr); gap: 4px; padding: 10px 0; border-top: 1px solid var(--border); margin-top: 8px; }
.emoji-option { background: none; border: none; font-size: 20px; padding: 6px; border-radius: 8px; cursor: pointer; }
.emoji-option:hover { background: var(--bg-hover); }
.media-preview-wrap { position: relative; margin: 8px 0; border-radius: 16px; overflow: hidden; }
.media-preview-wrap img { width: 100%; max-height: 300px; object-fit: cover; display: block; }
.media-remove {
  position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,0.75); color: #fff; border: none;
  border-radius: 50%; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
}
.media-remove svg { width: 16px; height: 16px; }
.media-uploading { padding: 20px 0; }

/* ---- GIF picker ---- */
.gif-panel { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; max-height: 320px; overflow-y: auto; }

.btn-secondary.danger { color: var(--red); border-color: #5c2530; }
.btn-secondary.danger:hover { background: var(--red-tint); }

/* ---- Poll editor (composer) ---- */
.poll-editor { border: 1px solid var(--border); border-radius: 16px; padding: 12px; margin: 8px 0; }
.poll-option-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.poll-option-input {
  flex: 1; background: var(--surface-2); border: 1px solid #3a3d44; border-radius: 8px;
  padding: 10px 12px; color: var(--text); font-family: var(--font); font-size: 14px;
}
.poll-option-input:focus { outline: none; border-color: var(--blue); }
.poll-option-remove {
  background: none; border: none; color: var(--text-secondary); width: 28px; height: 28px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.poll-option-remove svg { width: 16px; height: 16px; }
.poll-option-remove:hover { background: var(--bg-hover); color: var(--red); }
.poll-editor-footer { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }

/* ---- Poll display (feed) ---- */
.poll-box { margin: 4px 0 8px; }
.poll-vote-btn {
  display: block; width: 100%; text-align: left; background: none; border: 1px solid var(--blue);
  color: var(--blue); border-radius: 999px; padding: 10px 14px; font-weight: 600; font-size: 14px;
  margin-bottom: 8px;
}
.poll-vote-btn:hover { background: var(--blue-tint); }
.poll-result-row {
  position: relative; border-radius: 999px; overflow: hidden; margin-bottom: 8px; background: var(--surface-2);
  border: 1px solid var(--border);
}
.poll-result-row.my-vote { border-color: var(--blue); }
.poll-result-bar { position: absolute; inset: 0; background: var(--blue-tint); border-radius: 999px; z-index: 0; }
.poll-result-label {
  position: relative; z-index: 1; display: flex; justify-content: space-between; padding: 10px 14px;
  font-size: 14px; font-weight: 600; color: var(--text);
}
.poll-meta { color: var(--text-secondary); font-size: 13px; margin-top: 2px; }

.gif-search-box { margin-bottom: 8px; }
.gif-search-box input {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 14px; color: var(--text); font-family: var(--font); font-size: 14px;
}
.gif-search-box input:focus { outline: none; border-color: var(--blue); }
.gif-results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gif-result { background: var(--surface-2); border: none; border-radius: 8px; overflow: hidden; padding: 0; aspect-ratio: 1; cursor: pointer; }
.gif-result img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- Profile photo/banner upload ---- */
.upload-preview { position: relative; border-radius: 12px; overflow: hidden; }
.upload-preview.banner-preview { height: 120px; background: var(--surface-2); }
.upload-preview.banner-preview img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.upload-preview.avatar-preview { display: flex; align-items: center; gap: 12px; background: none; }
.upload-trigger {
  position: relative; z-index: 1; font-size: 13px; padding: 6px 12px;
}
.upload-preview.banner-preview .upload-trigger { position: absolute; bottom: 10px; left: 10px; background: rgba(0,0,0,0.6); color: #fff; border: none; }

/* ---- Avatars ---- */
.avatar { object-fit: cover; background: #222; flex-shrink: 0; }
.avatar-circle { border-radius: 50%; }
.avatar-square { border-radius: 22%; }
.avatar-sm { width: 40px; height: 40px; }
.avatar-md { width: 48px; height: 48px; }
.avatar-lg { width: 133px; height: 133px; border: 4px solid var(--bg); }
.avatar-xs { width: 18px; height: 18px; }

/* ---- Badges ---- */
.badge-check { display: inline-block; vertical-align: -3px; cursor: pointer; }
.affiliate-badge {
  display: inline-flex; vertical-align: -4px; width: 18px; height: 18px; border-radius: 6px;
  overflow: hidden; border: 1px solid var(--border); margin-left: 1px; cursor: pointer;
}
.affiliate-badge img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Tweet card ---- */
.tweet {
  padding: 14px 16px; display: flex; gap: 12px; margin: 0 8px 10px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border);
  transition: border-color 0.15s, transform 0.15s;
  animation: tweet-fade-in 0.25s ease;
}
.tweet:hover { border-color: var(--blue); }
@keyframes tweet-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-fade-in { animation: page-fade-in 0.2s ease; }
@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.tweet:hover { background: rgba(255,255,255,0.02); }
.tweet-body { flex: 1; min-width: 0; }
.retweet-note {
  font-size: 13px; color: var(--text-secondary); font-weight: 700;
  display: flex; align-items: center; gap: 6px; margin: 0 0 4px 28px;
}
.retweet-note svg { width: 14px; height: 14px; flex-shrink: 0; }
.tweet-head { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

/* ---- Co-posts ---- */
.copost-avatar-stack { position: relative; width: 52px; height: 40px; flex-shrink: 0; background: none; border: none; padding: 0; cursor: pointer; }
.copost-avatar-stack img { position: absolute; top: 0; width: 34px; height: 34px; }
.copost-avatar-stack img:first-child { left: 0; z-index: 2; border: 2px solid var(--surface); border-radius: 50%; }
.copost-avatar-stack img:last-child { left: 18px; top: 6px; z-index: 1; }
.copost-trigger.tweet-name, .copost-trigger.tweet-handle { color: inherit; }
.copost-trigger.tweet-name:hover, .copost-trigger.tweet-handle:hover { text-decoration: underline; }
.copost-trigger.tweet-name { font-weight: 800; }
.copost-trigger.tweet-handle { color: var(--text-secondary); }
.copost-editor { margin: 8px 0; padding: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.copost-editor-head { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; }
.copost-editor-head svg { width: 15px; height: 15px; }
.copost-editor #copost-username-input { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; color: var(--text); font-family: var(--font); }
.copost-chip-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.copost-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--blue-tint); color: var(--blue); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 13px; font-weight: 600; }
.copost-chip button { background: none; border: none; color: inherit; display: flex; align-items: center; cursor: pointer; padding: 2px; }
.copost-chip button svg { width: 12px; height: 12px; }
.tweet-name { font-weight: 700; font-size: 15px; }
.tweet-name:hover { text-decoration: underline; }
.tweet-handle, .tweet-time { color: var(--text-secondary); font-size: 15px; }
.ad-tag {
  display: inline-block; font-size: 12px; font-weight: 700; color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; vertical-align: middle;
}
.ad-admin-row { border-bottom: 1px solid var(--border); }
.ad-admin-edit { padding: 12px 16px; }
.report-row { border-bottom: 1px solid var(--border); padding-top: 12px; }
.report-meta { display: flex; align-items: center; gap: 8px; padding: 0 16px 8px; flex-wrap: wrap; }
.report-reason-tag { background: var(--red-tint); color: var(--red); font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.report-target { padding: 0 16px; }
.suspended-tag { background: var(--red-tint); color: var(--red); font-size: 11px; font-weight: 800; padding: 2px 6px; border-radius: 4px; margin-left: 4px; }
.tweet-via { color: var(--text-secondary); font-size: 13px; margin-top: -2px; }
.tweet-org-tag {
  font-size: 12px; color: var(--gold-dark); border: 1px solid #4a3d00; background: var(--gold-tint);
  border-radius: 999px; padding: 1px 8px; margin-left: 2px; display: inline-flex; align-items: center; gap: 3px;
}

.tweet-more-wrap { margin-left: auto; position: relative; }
.tweet-more-btn {
  background: none; border: none; color: var(--text-secondary); width: 30px; height: 30px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tweet-more-btn svg { width: 18px; height: 18px; }
.tweet-more-btn:hover { color: var(--blue); background: var(--blue-tint); }
.tweet-more-menu {
  position: absolute; top: 32px; right: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,0.5); z-index: 20; overflow: hidden; min-width: 200px;
}
.tweet-more-option {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: none; border: none;
  color: var(--text); font-size: 14px; font-weight: 600; text-align: left;
}
.tweet-more-option svg { width: 18px; height: 18px; flex-shrink: 0; }
.tweet-more-option:hover { background: var(--bg-hover); }
.tweet-more-option.danger { color: var(--red); }
.tweet-more-option.danger:hover { background: var(--red-tint); }
.tweet-content { font-size: 15px; line-height: 20px; white-space: pre-wrap; word-break: break-word; margin: 2px 0 8px; }
.show-more-link { display: block; color: var(--blue); font-weight: 600; margin-top: 2px; }
.show-more-link:hover { text-decoration: underline; }

/* ---- @mention autocomplete ---- */
.mention-dropdown {
  position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; z-index: 30;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.5); overflow: hidden; max-height: 260px; overflow-y: auto;
}
.mention-option { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; }
.mention-option.highlighted, .mention-option:hover { background: var(--bg-hover); }
.mention-name { font-weight: 700; font-size: 14px; }
.mention-handle { color: var(--text-secondary); font-size: 13px; }

/* ---- Thread connector (self-reply chain) ---- */
.tweet.thread-has-continuation { position: relative; }
.tweet.thread-has-continuation::after,
.tweet.thread-connected::before {
  content: ""; position: absolute; left: 34px; width: 2px; background: var(--border); pointer-events: none;
}
.tweet.thread-has-continuation::after { top: 56px; bottom: -10px; }
.tweet.thread-connected::before { top: -10px; height: 24px; }
.tweet-media { max-width: 100%; max-height: 500px; border-radius: 16px; border: 1px solid var(--border); margin-bottom: 8px; display: block; object-fit: cover; cursor: zoom-in; }

/* ---- Image lightbox ---- */
.lightbox-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.92); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 32px;
  animation: lightbox-fade-in 0.15s ease-out;
}
@keyframes lightbox-fade-in { from { opacity: 0; } to { opacity: 1; } }
.lightbox-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.lightbox-close {
  position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: none; color: #fff; display: flex; align-items: center;
  justify-content: center; cursor: pointer;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }
.lightbox-close svg { width: 22px; height: 22px; }
.reply-perm-note { display: flex; align-items: center; gap: 6px; color: var(--text-secondary); font-size: 13px; margin-bottom: 8px; }
.community-note { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 4px 0 8px; background: var(--surface-2); }
.community-note-label { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; color: var(--text); margin-bottom: 4px; }
.community-note-label svg { width: 15px; height: 15px; color: var(--blue); }
.community-note-body { font-size: 14px; line-height: 1.4; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.reply-perm-note svg { width: 14px; height: 14px; }

/* ---- Rich embed card for links to another post on this site ---- */
.link-embed {
  border: 1px solid var(--border); border-left: 3px solid var(--blue); border-radius: 12px;
  padding: 12px 14px; margin: 4px 0 8px; cursor: pointer; background: var(--surface);
}
.link-embed:hover { background: var(--bg-hover); }
.link-embed-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; flex-wrap: wrap; }
.link-embed-name { font-weight: 700; font-size: 14px; }
.link-embed-handle { color: var(--text-secondary); font-size: 13px; }
.talent-link-embed { cursor: default; }
.talent-link-embed:hover { background: var(--surface); }
.talent-embed-actions-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.talent-link-embed-message-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.link-embed-text { font-size: 14px; line-height: 1.4; color: var(--text); margin-bottom: 6px; white-space: pre-wrap; word-break: break-word; }
.link-embed-media { max-width: 100%; max-height: 260px; border-radius: 8px; display: block; margin-bottom: 6px; object-fit: cover; }
.link-embed-footer { display: flex; align-items: center; gap: 6px; color: var(--text-secondary); font-size: 12px; }
.event-link-icon { display: inline-flex; flex-shrink: 0; color: var(--blue); }
.event-link-icon svg { width: 16px; height: 16px; display: block; }

/* ---- YouTube embeds ---- */
.youtube-card { display: block; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; margin-top: 8px; text-decoration: none; }
.youtube-thumb-wrap { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; }
.youtube-thumb-wrap img, .youtube-thumb-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.youtube-play-btn {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 64px; height: 64px; border-radius: 50%; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center; color: #fff;
  transition: background 0.15s, transform 0.15s;
}
.youtube-card:hover .youtube-play-btn { background: #f00; transform: translate(-50%, -50%) scale(1.08); }
.youtube-play-btn svg { width: 30px; height: 30px; }
.youtube-card-title { padding: 10px 14px; font-weight: 700; font-size: 14px; color: var(--text); background: var(--surface-2); }

.watch-player { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; }
.watch-player iframe, .watch-player video { width: 100%; height: 100%; border: none; }
.watch-info { padding: 16px; border-bottom: 1px solid var(--border); }
.watch-title { font-size: 20px; font-weight: 800; margin-bottom: 12px; }
.watch-author-row { display: flex; align-items: center; gap: 10px; }
.watch-author-row a { text-decoration: none; color: inherit; }
.watch-description { white-space: pre-wrap; color: var(--text-secondary); font-size: 14px; line-height: 1.5; margin-top: 12px; max-height: 160px; overflow-y: auto; }
#watch-actions .tweet-actions { padding: 4px 16px 12px; border-bottom: 1px solid var(--border); }
.link-embed-footer .brand-mark svg, .link-embed-footer .brand-logo { width: 16px; height: 16px; }

.tweet-actions { display: flex; justify-content: space-between; max-width: 425px; margin-top: 2px; }
.tweet-action {
  display: flex; align-items: center; gap: 4px; background: none; border: none;
  color: var(--text-secondary); font-size: 13px; padding: 6px 6px; border-radius: 999px;
}
.tweet-action svg { width: 18px; height: 18px; }
.tweet-action:hover { color: var(--blue); background: var(--blue-tint); }
.tweet-action.like:hover, .tweet-action.like.active { color: var(--red); background: var(--red-tint); }
.tweet-action.like.like-pop svg { animation: like-pop 0.4s ease; }
@keyframes like-pop {
  0% { transform: scale(1); }
  30% { transform: scale(1.35); }
  50% { transform: scale(0.9); }
  100% { transform: scale(1); }
}
.tweet-action.retweet:hover, .tweet-action.retweet.active { color: var(--green); background: var(--green-tint); }
.tweet-action.bookmark:hover, .tweet-action.bookmark.active { color: var(--blue); background: var(--blue-tint); }
.tweet-action.pin-btn:hover, .tweet-action.pin-btn.active { color: var(--gold-dark); background: var(--gold-tint); }
.tweet-action.active svg path { fill: currentColor; }
.tweet-action.delete-btn:hover { color: var(--red); background: var(--red-tint); }

/* ---- Profile ---- */
.profile-banner { height: 200px; background: linear-gradient(135deg, #1a1d24, #0d0f13); position: relative; }
.profile-header { padding: 0 16px 12px; position: relative; }
.profile-avatar-wrap { margin-top: -67px; display: flex; justify-content: space-between; align-items: flex-end; }
.profile-name { font-size: 20px; font-weight: 800; margin: 12px 0 0; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.private-lock-badge { display: inline-flex; color: var(--text-secondary); }
.private-lock-badge svg { width: 16px; height: 16px; }

.private-gate {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 60px 24px; color: var(--text-secondary); gap: 8px;
}
.private-gate svg { width: 44px; height: 44px; opacity: 0.6; margin-bottom: 8px; }
.private-gate-title { font-size: 20px; font-weight: 800; color: var(--text); }
.private-gate-desc { max-width: 320px; font-size: 14px; }
.profile-handle { color: var(--text-secondary); font-size: 15px; }
.profile-bio { margin: 12px 0; font-size: 15px; line-height: 20px; }
.profile-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--text-secondary); font-size: 14px; margin-bottom: 10px; }
.profile-meta span { display: flex; align-items: center; gap: 5px; }
.profile-meta svg { width: 16px; height: 16px; }
.profile-roblox-tag svg path { fill: var(--text-secondary); }
.profile-stats { display: flex; gap: 20px; font-size: 14px; color: var(--text-secondary); }
.profile-stats b { color: var(--text); font-weight: 700; }
.stat-btn { background: none; border: none; color: var(--text-secondary); font-size: 14px; padding: 0; display: flex; gap: 4px; }
.stat-btn:hover b { text-decoration: underline; }
.stat-btn b { color: var(--text); font-weight: 700; }
.tier-pill {
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; display: inline-flex; align-items: center; gap: 4px;
}
.tier-pill.full { color: var(--gold-dark); background: var(--gold-tint); border: 1px solid #4a3d00; }
.tier-pill.standard { color: var(--text-secondary); background: var(--surface-2); border: 1px solid var(--border); }

.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 2px; }
.media-grid-item { display: block; aspect-ratio: 1; overflow: hidden; }
.media-grid-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- Auth / empty states ---- */
.hero { display: flex; align-items: stretch; min-height: 100vh; }
.hero-left { flex: 1.2; background: var(--hero-gradient); display: flex; align-items: center; justify-content: center; }
.hero-right { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 40px; max-width: 500px; }
.hero-right h1 { font-size: 56px; margin: 0 0 32px; letter-spacing: -0.02em; }
.hero-right h2 { font-size: 26px; margin: 32px 0 16px; font-weight: 800; }
@media (max-width: 800px) { .hero-left { display: none; } .hero-right { max-width: none; margin: 0 auto; } }

.social-btn {
  border: 1px solid #3a3d44; border-radius: 999px; padding: 11px 24px; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; gap: 10px; justify-content: center; background: var(--surface); color: var(--text);
  width: 100%; margin-bottom: 12px;
}
.social-btn:hover { background: var(--bg-hover); }
.social-btn.discord { background: #5865f2; color: #fff; border: none; }
.social-btn.discord:hover { filter: brightness(1.08); }
.social-btn.roblox { background: #000; color: #fff; border: none; }
.social-btn.roblox:hover { filter: brightness(1.3); }
.hero-divider { display: flex; align-items: center; gap: 12px; color: var(--text-secondary); font-size: 13px; margin: 4px 0 16px; }
.hero-divider::before, .hero-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.empty { padding: 60px 20px; text-align: center; color: var(--text-secondary); }

/* ---- Forms / modals ---- */
.form-field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 13px; color: var(--text-secondary); font-weight: 700; }
.form-field input, .form-field textarea, .form-field select {
  background: var(--surface-2); border: 1px solid #3a3d44; border-radius: 8px; padding: 12px;
  color: var(--text); font-family: var(--font); font-size: 16px;
}
.form-field input:focus, .form-field textarea:focus { border-color: var(--blue); outline: none; }
.form-error { color: var(--red); font-size: 13px; margin-top: -6px; margin-bottom: 10px; }
.form-hint { font-size: 13px; color: var(--text-secondary); margin: -8px 0 14px; line-height: 1.4; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px; width: 100%; max-width: 460px; max-height: 85vh; overflow-y: auto; }

/* On mobile, ordinary modals become native-feeling bottom sheets (full width, rounded top
   corners only, anchored to the bottom edge) instead of a small floating centered box.
   Excludes the auth split-screen modal, which already has its own tuned stacked mobile layout. */
@media (max-width: 690px) {
  .modal-backdrop:not(.auth-modal-backdrop) { align-items: flex-end; padding: 0; }
  .modal-backdrop:not(.auth-modal-backdrop) > .modal:not(.auth-modal-split) {
    border-radius: 20px 20px 0 0; max-width: none; max-height: 92vh;
    animation: modal-sheet-up 0.2s ease-out;
  }
  /* Composer manages its own internal padding (topbar/body/footer each pad themselves) --
     only the structural sizing above applies to it, not this outer padding. */
  .modal-backdrop:not(.auth-modal-backdrop) > .modal:not(.auth-modal-split):not(.composer-modal) {
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  }
  .composer-modal { padding-bottom: env(safe-area-inset-bottom); }
}

/* Touch targets: comfortable on mobile, still compact on desktop where mouse precision is
   fine. .tweet-action and .icon-btn render on every single post/toolbar, so undersized
   targets here are one of the most common sources of mis-taps in a dense feed. */
@media (max-width: 690px) {
  .icon-btn { width: 40px; height: 40px; }
  .tweet-action { padding: 10px 8px; }
  .tweet-action svg { width: 19px; height: 19px; }
  .poll-vote-btn { padding: 12px 14px; }
}

/* Tabbar: same equal-width stretch as before when a few tabs comfortably fit (home feed,
   profile tabs), but becomes a horizontally scrollable strip instead of squeezing tab labels
   into illegible slivers when there are many (the staff panel has 8). */
@media (max-width: 690px) {
  .tabbar { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabbar::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; padding: 14px 16px; }
}
@keyframes modal-sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ---- External link confirmation ---- */
.external-link-modal { padding: 0; overflow: hidden; }
.external-link-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 0; }
.external-link-head h2 { font-size: 20px; font-weight: 800; margin: 0; }
.external-link-body { padding: 12px 20px 20px; }
.external-link-body p { margin: 0 0 8px; color: var(--text-secondary); }
.external-link-url { color: var(--text) !important; font-weight: 700; word-break: break-all; }
.external-link-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--border); }
.external-link-actions .btn-secondary, .external-link-actions .btn-primary { padding: 10px 20px; }
.modal h2 { margin-top: 0; font-size: 20px; }
.onboarding-modal { max-width: 420px; }
.modal-tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.modal-tab { flex: 1; padding: 10px 0; background: none; border: none; font-weight: 700; color: var(--text-secondary); border-bottom: 3px solid transparent; }
.modal-tab.active { color: var(--text); border-bottom-color: var(--blue); }

.member-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }

.auth-modal-backdrop { background: rgba(0,0,0,0.75); }

/* ---- Auth modal: full split-screen layout (visual panel + form panel) ---- */
.auth-modal-split { display: flex; padding: 0; max-width: 900px; width: 100%; overflow: hidden; max-height: 90vh; }
.auth-modal-close { position: absolute; top: 14px; right: 14px; z-index: 3; background: rgba(0,0,0,0.35); color: #fff; }
.auth-modal-close:hover { background: rgba(0,0,0,0.55); }
.auth-modal-visual {
  flex: 1; min-width: 0; background: var(--bg-gradient); position: relative;
  display: flex; align-items: flex-end; padding: 28px;
}
.auth-modal-visual-content { position: relative; z-index: 1; color: var(--text); }
.auth-modal-visual-content .brand-mark, .auth-modal-visual-content svg { color: var(--text); }
.auth-modal-tagline { font-size: 14px; color: var(--text-secondary); margin-top: 10px; max-width: 260px; line-height: 1.5; }
.auth-modal-form-panel { flex: 1.1; min-width: 0; background: var(--surface); padding: 40px; overflow-y: auto; position: relative; }
.auth-form-heading { font-size: 26px; font-weight: 800; margin: 0 0 4px; }
.auth-form-subtext { color: var(--text-secondary); font-size: 14px; margin-bottom: 22px; }
.auth-modal-form-panel .form-field input { background: var(--surface-2); border: 1px solid transparent; }
.auth-modal-form-panel .form-field input:focus { border-color: var(--blue); background: var(--surface); }
.auth-submit-btn {
  width: 100%; padding: 14px; border-radius: 999px; font-size: 15px; margin-top: 6px;
  background: var(--text); color: var(--surface); border: none; font-weight: 700; cursor: pointer;
}
.auth-submit-btn:hover { opacity: 0.88; }
.auth-toggle-line { text-align: center; font-size: 14px; color: var(--text-secondary); margin: 14px 0 20px; }
.auth-toggle-line a { color: var(--blue); font-weight: 600; }
.auth-toggle-line a:hover { text-decoration: underline; }
.auth-forgot-line { text-align: center; font-size: 13px; margin-top: 8px; }
.auth-forgot-line a { color: var(--text-secondary); }
.auth-forgot-line a:hover { color: var(--text); text-decoration: underline; }
.auth-divider { margin: 0 0 14px; }
.auth-modal-form-panel .social-btn { margin: 0; }

.auth-otp-row { display: flex; gap: 8px; margin: 4px 0 14px; }
.auth-otp-box {
  width: 100%; aspect-ratio: 1; text-align: center; font-size: 20px; font-weight: 700;
  border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}
.auth-otp-box:focus { border-color: var(--blue); outline: none; }
.auth-otp-meta { font-size: 13px; color: var(--text-secondary); margin-bottom: 18px; }
.auth-otp-back { margin-bottom: 12px; }

@media (max-width: 640px) {
  .auth-modal-split { flex-direction: column; max-height: 92vh; }
  .auth-modal-visual { flex: none; height: 130px; padding: 16px; }
  .auth-modal-tagline { display: none; }
  .auth-modal-form-panel { padding: 24px; }
}

/* ---- Logged-out landing page: full-width marketing style (nav bar + centered hero), not
   the form-visible-immediately split layout this replaced ---- */
.marketing-landing { min-height: 100vh; width: 100%; background: var(--bg-gradient); display: flex; flex-direction: column; }
.marketing-nav { display: flex; align-items: center; justify-content: space-between; padding: 20px 40px; gap: 24px; }
.marketing-nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 18px; }
.marketing-nav-links { display: flex; align-items: center; gap: 28px; flex: 1; justify-content: center; }
.marketing-nav-links a { color: var(--text-secondary); text-decoration: none; font-weight: 600; font-size: 15px; }
.marketing-nav-links a:hover { color: var(--text); }
.marketing-nav-actions { display: flex; align-items: center; gap: 10px; }
.marketing-hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px; }
.marketing-hero-wordmark { display: block; width: 320px; max-width: 100%; height: auto; filter: var(--logo-filter); margin-bottom: 28px; }
.marketing-hero-sub { color: var(--text-secondary); font-size: 16px; line-height: 1.6; max-width: 480px; margin-bottom: 28px; }
.marketing-hero-cta { padding: 14px 32px; font-size: 16px; }

@media (max-width: 780px) {
  .marketing-nav { padding: 16px 20px; }
  .marketing-nav-links { display: none; }
  .marketing-nav-brand span { display: none; }
  .marketing-hero-wordmark { width: 240px; }
  .marketing-hero-sub { font-size: 14px; }
}
.role-tag { font-size: 11px; color: var(--text-secondary); border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px; margin-left: auto; }
.status-tag { font-size: 11px; border-radius: 999px; padding: 2px 8px; margin-left: 8px; font-weight: 700; }
.status-tag.active { color: var(--green); background: var(--green-tint); }
.status-tag.pending { color: var(--gold-dark); background: var(--gold-tint); }
.status-tag.suspended { color: var(--red); background: var(--red-tint); }
.row-menu { display: flex; gap: 6px; margin-left: 8px; }
.row-menu button { background: none; border: 1px solid var(--border); color: var(--text-secondary); border-radius: 999px; padding: 3px 10px; font-size: 11px; }
.row-menu button:hover { color: var(--text); border-color: var(--text-secondary); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--border); color: var(--text); padding: 12px 20px; border-radius: 999px; font-size: 14px; z-index: 100; }
.admin-btn { background: var(--gold); color: #2b2200; border: none; border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 13px; }
.link-blue { color: var(--blue); }
.hashmoji-img { width: 18px; height: 18px; display: inline-block; vertical-align: -4px; object-fit: contain; }
#hm-new-zone { max-width: 140px; }
#hm-new-zone .ev-upload-empty { padding: 14px 10px; }
#hm-new-zone .ev-upload-preview { max-height: 80px; }
.link-blue:hover { text-decoration: underline; }
.section-label { font-size: 15px; font-weight: 800; margin: 4px 0 8px; }

/* ---- Staff panel: stats overview ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; padding: 0 16px 8px; }
.stat-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.infinite-scroll-sentinel { display: flex; justify-content: center; padding: 16px 0; min-height: 1px; }
.stat-card-value { font-size: 22px; font-weight: 800; }
.stat-card-label { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.stats-top-list { padding: 0 16px 8px; }
.stats-top-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border);
  text-decoration: none; color: inherit; font-size: 13px;
}
.stats-top-row:last-child { border-bottom: none; }
.stats-top-count { font-weight: 800; color: var(--blue); min-width: 24px; text-align: right; flex-shrink: 0; }
.stats-top-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-top-author { color: var(--text-secondary); flex-shrink: 0; }

/* ---- Account switcher popover ---- */
.switcher-popover {
  position: absolute; bottom: 66px; left: 0; width: 300px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 8px 28px rgba(0,0,0,0.5);
  z-index: 40; overflow: hidden; padding: 8px 0;
}
.switcher-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.switcher-item:hover { background: var(--bg-hover); }
.switcher-item .check { margin-left: auto; color: var(--blue); flex-shrink: 0; }
.switcher-item .check svg { width: 20px; height: 20px; display: block; }
.switcher-name { font-weight: 700; font-size: 15px; color: var(--text); }
.switcher-type { color: var(--text-secondary); font-size: 13px; margin-top: 1px; }
.switcher-divider { height: 1px; background: var(--border); margin: 6px 0; }
.switcher-action {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; font-weight: 600; font-size: 15px;
  color: var(--text); text-decoration: none;
}
.switcher-action:hover { background: var(--bg-hover); }
.switcher-action svg { width: 20px; height: 20px; flex-shrink: 0; }
.switcher-action.danger { color: var(--red); }
.switcher-action.link-blue { color: var(--blue); }

/* ---- Verification info popover ---- */
.verify-popover {
  position: fixed; z-index: 60; width: 280px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; box-shadow: 0 8px 28px rgba(0,0,0,0.5); font-size: 13px; color: var(--text-secondary);
}
.verify-popover .vp-title { color: var(--text); font-weight: 700; font-size: 14px; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }

/* Placed last deliberately so it wins regardless of which context (modal vs landing page)
   a chain of stacked social login buttons appears in. */
.social-btn + .social-btn { margin-top: 8px; }

/* ---- Stories row ---- */
.stories-row { display: flex; gap: 14px; padding: 12px 16px; overflow-x: auto; border-bottom: 1px solid var(--border); scrollbar-width: none; }
.stories-row::-webkit-scrollbar { display: none; }
.story-circle-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; width: 64px; cursor: pointer; }
.story-circle {
  width: 60px; height: 60px; border-radius: 50%; padding: 2.5px; position: relative;
  background: var(--border); /* fallback ring for "no story" / already-seen state */
}
.story-circle.unseen { background: linear-gradient(45deg, #1d4ed8, #3b82f6, #8b5cf6, #a855f7); }
.story-circle.no-story { background: var(--border); }
.story-circle img {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block;
  border: 2.5px solid var(--surface);
}
.story-add-badge {
  position: absolute; bottom: -2px; right: -2px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
}
.story-add-badge svg { width: 12px; height: 12px; }
.story-circle-label { font-size: 12px; color: var(--text-secondary); max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Full-screen story viewer ---- */
.story-viewer-backdrop {
  position: fixed; inset: 0; background: #000; z-index: 90;
  display: flex; align-items: center; justify-content: center;
}
.story-viewer { position: relative; width: 100%; max-width: 420px; height: 100%; max-height: 100vh; background: #000; }
.story-progress-row { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 2; display: flex; gap: 4px; }
.story-progress-seg { flex: 1; height: 2.5px; background: rgba(255,255,255,0.35); border-radius: 999px; overflow: hidden; }
.story-progress-fill { height: 100%; width: 0; background: #fff; }
.story-progress-fill.done { width: 100%; }
.story-progress-fill.active { animation: story-fill linear forwards; }
@keyframes story-fill { from { width: 0; } to { width: 100%; } }
.story-viewer-header {
  position: absolute; top: 24px; left: 10px; right: 10px; z-index: 2;
  display: flex; align-items: center; gap: 8px; color: #fff;
}
.story-viewer-time { font-size: 13px; color: rgba(255,255,255,0.7); }
.story-viewer-header .icon-btn { color: #fff; }
.story-viewer-media { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.story-viewer-media img, .story-viewer-media video { max-width: 100%; max-height: 100%; object-fit: contain; }
.story-tap-zone { position: absolute; top: 0; bottom: 0; width: 35%; z-index: 1; }
.story-tap-left { left: 0; }
.story-tap-right { right: 0; }
.story-viewer-footer { position: absolute; bottom: 20px; left: 16px; right: 16px; z-index: 2; display: flex; justify-content: flex-end; }
.story-like-btn { color: #fff; background: rgba(0,0,0,0.3); }
.story-like-btn.liked { color: #f4364c; }
.story-like-btn.liked svg { fill: #f4364c; }
.story-like-count { display: flex; align-items: center; gap: 6px; color: #fff; font-size: 13px; background: rgba(0,0,0,0.3); padding: 6px 12px; border-radius: 999px; }
.story-like-count svg { width: 14px; height: 14px; fill: #f4364c; stroke: #f4364c; }

/* Profile page: a gradient ring around the avatar when the account has an active story --
   applied to a dedicated wrapping span rather than the <img> itself, since ::before/::after
   support on replaced elements like <img> is inconsistent across browsers. */
.story-ring-wrap { display: inline-block; border-radius: 50%; position: relative; }
.story-ring-wrap::before {
  content: ""; position: absolute; inset: -5px; z-index: -1; border-radius: 50%;
  background: linear-gradient(45deg, #1d4ed8, #3b82f6, #8b5cf6, #a855f7);
}

/* ---- Events ---- */
.event-card {
  display: block; border-bottom: 1px solid var(--border); padding: 12px 16px; text-decoration: none;
  color: var(--text); transition: background 0.1s;
}
.event-card:hover { background: var(--bg-hover); }
.event-card-graphic { width: 100%; max-height: 200px; object-fit: cover; border-radius: 12px; margin-bottom: 10px; }
.event-card-date { font-size: 12px; font-weight: 700; color: var(--blue); text-transform: uppercase; letter-spacing: 0.02em; margin-bottom: 4px; }
.event-card-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.event-card-host { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); text-decoration: none; }
.event-card-rsvp { font-size: 12px; color: var(--text-secondary); margin-top: 6px; }
.event-card.compact { padding: 10px 16px; }
.event-card.compact .event-card-title { font-size: 14px; margin-bottom: 4px; }

.tonight-panel { border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.tonight-header { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; padding: 14px 16px 4px; }
.tonight-header svg { width: 18px; height: 18px; color: var(--blue); }
.tonight-group-label { font-size: 12px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.02em; padding: 10px 16px 2px; }

.event-detail-graphic { width: 100%; max-height: 320px; object-fit: cover; display: block; }
.event-datetime { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-secondary); margin-bottom: 6px; }
.event-datetime svg { width: 16px; height: 16px; }
.event-countdown { font-size: 15px; font-weight: 700; color: var(--blue); margin-bottom: 8px; }
.event-matchcard { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.event-match-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.event-match-row:last-child { border-bottom: none; }
.event-match-num { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--text-secondary); flex-shrink: 0; }
/* ---- Create/edit event modal ---- */
.ev-upload-zone {
  border: 1.5px dashed var(--border); border-radius: 12px; cursor: pointer; overflow: hidden;
  position: relative; transition: border-color 0.15s, background 0.15s;
}
.ev-upload-zone:hover { border-color: var(--blue); background: var(--blue-tint); }
.ev-upload-zone.has-image { border: 1px solid var(--border); cursor: default; }
.ev-upload-zone.has-image:hover { background: none; border-color: var(--border); }
.ev-upload-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 24px 12px; color: var(--text-secondary); font-size: 13px;
}
.ev-upload-empty svg { width: 22px; height: 22px; }
.ev-upload-preview { width: 100%; max-height: 160px; object-fit: cover; display: block; }
.ev-upload-remove {
  position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,0.55); color: #fff; border: none; display: flex; align-items: center;
  justify-content: center; cursor: pointer;
}
.ev-upload-remove:hover { background: rgba(0,0,0,0.75); }
.ev-upload-remove svg { width: 15px; height: 15px; }

.ev-match-edit-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ev-match-edit-num {
  width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--text-secondary);
}
.ev-match-edit-row input { flex: 1; }
.ev-match-edit-row .icon-btn { width: 30px; height: 30px; color: var(--text-secondary); flex-shrink: 0; }
.ev-match-edit-row .icon-btn:hover { color: var(--red); background: var(--red-tint); }

.ev-add-row-btn {
  display: inline-flex; align-items: center; gap: 5px; background: none; border: none; cursor: pointer;
  color: var(--blue); font-size: 13px; font-weight: 700; padding: 6px 2px; margin-top: 2px;
}
.ev-add-row-btn:hover { text-decoration: underline; }
.ev-add-row-btn svg { width: 15px; height: 15px; }

.event-cohosts-row { display: flex; align-items: center; gap: 6px; color: var(--text-secondary); font-size: 13px; }
.event-cohosts-row svg { width: 14px; height: 14px; }
.event-cohosts-row a { color: var(--text-secondary); font-weight: 700; text-decoration: none; }
.event-cohosts-row a:hover { text-decoration: underline; color: var(--text); }

.event-watch-btn {
  display: inline-flex; align-items: center; gap: 8px; background: var(--blue); color: #fff;
  font-weight: 700; font-size: 14px; padding: 11px 20px; border-radius: 999px; text-decoration: none;
  margin: 10px 0; transition: opacity 0.15s;
}
.event-watch-btn:hover { opacity: 0.88; }
.event-watch-btn svg { width: 17px; height: 17px; }

.event-rsvp-row { display: flex; gap: 10px; margin-bottom: 16px; }
.event-rsvp-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--surface-2); border: 1.5px solid var(--border); border-radius: 12px;
  padding: 12px; font-size: 14px; font-weight: 700; color: var(--text); cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.event-rsvp-btn svg { width: 17px; height: 17px; }
.event-rsvp-btn:hover { border-color: var(--text-secondary); }
.event-rsvp-btn.active { background: var(--amber-tint, rgba(240,169,95,0.15)); border-color: var(--amber, #f0a95f); color: var(--amber, #f0a95f); }
.event-rsvp-btn.going.active { background: var(--green-tint); border-color: var(--green); color: var(--green); }
.event-rsvp-count {
  background: rgba(127,127,127,0.18); border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 700;
}

.event-host-actions { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 16px; margin-top: 8px; }
.event-host-actions .btn-secondary { display: inline-flex; align-items: center; gap: 6px; }

/* ---- Talent Hub ---- */
.talent-filters { display: flex; gap: 8px; padding: 12px 16px; flex-wrap: wrap; }
.talent-filters select {
  flex: 1; min-width: 140px; background: var(--surface-2); border: 1px solid #3a3d44;
  border-radius: 8px; padding: 10px 12px; color: var(--text); font-family: var(--font); font-size: 14px;
  font-weight: 700; cursor: pointer;
}
.talent-filters select:focus { border-color: var(--blue); outline: none; }

/* ---- Portfolio tab ---- */
.portfolio-add-row { padding: 16px 16px 4px; }
.portfolio-add-row .btn-secondary { display: inline-flex; align-items: center; gap: 6px; }
.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; padding: 16px; }
.portfolio-card { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.portfolio-card-image { width: 100%; height: 140px; object-fit: cover; display: block; background: var(--surface-2); }
.portfolio-card-noimage { display: flex; align-items: center; justify-content: center; color: var(--text-secondary); }
.portfolio-card-noimage svg { width: 28px; height: 28px; }
.portfolio-card-body { padding: 12px; }
.portfolio-card-category { font-size: 11px; font-weight: 700; color: var(--blue); text-transform: uppercase; letter-spacing: 0.02em; margin-bottom: 4px; }
.portfolio-card-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.portfolio-card-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.4; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.portfolio-card-actions { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.portfolio-card-link { display: inline-flex; align-items: center; gap: 4px; color: var(--blue); text-decoration: none; font-weight: 700; }
.portfolio-card-link svg { width: 14px; height: 14px; }
.portfolio-card-link:hover { text-decoration: underline; }
.portfolio-card-edit, .portfolio-card-delete { background: none; border: none; color: var(--text-secondary); font-weight: 700; cursor: pointer; padding: 0; }
.portfolio-card-edit:hover { color: var(--text); }
.portfolio-card-delete:hover { color: var(--red); }

/* ---- Talent Hub ---- */
.talent-card { border-bottom: 1px solid var(--border); padding: 14px 16px; }
.talent-card-top { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.talent-type-badge { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.02em; }
.talent-type-badge.seeking { background: var(--blue-tint); color: var(--blue); }
.talent-type-badge.recruiting { background: var(--green-tint); color: var(--green); }
.talent-category-badge { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-secondary); }
.talent-card-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.talent-card-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.4; white-space: pre-wrap; word-break: break-word; margin-bottom: 4px; }
.talent-card-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.talent-card-link {
  display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700;
  color: var(--blue); text-decoration: none; background: var(--blue-tint); padding: 5px 10px; border-radius: 999px;
}
.talent-card-link:hover { text-decoration: underline; }
.talent-card-link svg { width: 13px; height: 13px; flex-shrink: 0; }
.talent-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.talent-card-actions .btn-secondary { display: inline-flex; align-items: center; gap: 6px; }
.talent-status-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700;
  padding: 5px 12px; border-radius: 999px; margin: 6px 0; width: fit-content;
  background: var(--blue-tint); color: var(--blue);
}
.talent-status-badge svg { width: 14px; height: 14px; }
.talent-status-badge.not_available { background: var(--surface-2); color: var(--text-secondary); }
.talent-status-badge.open_media, .talent-status-badge.open_commentary, .talent-status-badge.open_commissions { background: var(--green-tint); color: var(--green); }
.talent-status-badge.looking_fed { background: rgba(240,169,95,0.15); color: #f0a95f; }
