:root {
  --nx-blue: #007aff;
  --nx-bg: #ffffff;
  --nx-accent: #f5f5f7;
  --nx-text: #1d1d1f;
  --nx-gray: #86868b;
  --nx-border: #d2d2d7;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  background-color: var(--nx-bg);
  color: var(--nx-text);
  line-height: 1.5;
  max-width: 100%;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html {
  max-width: 100%;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 10%;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--nx-border);
  position: sticky;
  top: 0;
  z-index: 100;
  will-change: transform;
  transform: translateZ(0);
}

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--nx-text);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.nav-links a {
  color: var(--nx-text);
  text-decoration: none;
  margin-left: 25px;
  font-size: 0.95rem;
  font-weight: 500;
}

.btn-api {
  background: #ffffff;
  color: #111827 !important;
  border: 1px solid #d1d5db;
  padding: 6px 15px;
  border-radius: 999px;
  font-weight: 500;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-api:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #111827 !important;
}

.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--nx-border);
  background: #fff;
}

.profile-menu {
  position: relative;
  display: inline-block;
}

.profile-dropdown {
  position: absolute;
  right: 0;
  top: 120%;
  background: #ffffff;
  border: 1px solid var(--nx-border);
  border-radius: 12px;
  padding: 10px;
  min-width: 180px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  display: none;
  z-index: 200;
}

.profile-dropdown .menu-item,
.profile-dropdown .btn-logout {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
}

.profile-dropdown .menu-item {
  background: #f5f5f7;
  color: var(--nx-text);
}

.profile-dropdown .menu-item:hover {
  background: #ececf0;
}

.profile-dropdown .menu-item-muted {
  color: var(--nx-text);
  cursor: pointer;
}

.profile-dropdown .menu-item-muted:hover {
  background: #ececf0;
}

.profile-dropdown .btn-logout {
  margin-bottom: 0;
  background: #f5f5f7;
  color: var(--nx-text);
  border: 1px solid var(--nx-border);
}

.profile-dropdown .btn-logout:hover {
  background: #ececf0;
}

.hero {
  text-align: center;
  padding: 100px 20px;
  background: radial-gradient(circle at top, #f0f7ff 0%, #ffffff 100%);
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 15px;
  letter-spacing: -1px;
  font-weight: 800;
}

.hero p {
  color: var(--nx-gray);
  font-size: 1.4rem;
  max-width: 700px;
  margin: 0 auto;
}

.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 20px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 60px;
}

.content-section h2 {
  font-size: 2rem;
  margin-bottom: 30px;
}

.content-section .cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 25px;
}

/* Landing ecosystem layout: centered container + centered grid */
#landing .main-container {
  display: block;
  padding-top: 12px;
}

#landing .ecosystem-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

#landing .ecosystem-section h2 {
  text-align: center;
  margin: 0 0 22px;
}

#landing .ecosystem-logos {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 24px;
  justify-items: center;
  align-items: start;
  margin-top: 18px;
  margin-bottom: 32px;
}

#landing .ecosystem-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 6px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transition: transform .2s ease, opacity .2s ease;
}

#landing .ecosystem-logo img {
  height: 44px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
  display: block;
}

#landing .ecosystem-logo:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}

#landing .ecosystem-logo span {
  font-size: 13px;
  font-weight: 600;
  color: var(--nx-text);
  text-align: center;
}

.card {
  background: var(--nx-accent);
  border-radius: 18px;
  padding: 25px;
  border: 1px solid transparent;
  transition: 0.3s;
}

.card:hover {
  border-color: var(--nx-border);
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.tag-api {
  background: #e1f0ff;
  color: var(--nx-blue);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
}

.badge {
  background: #eff6ff;
  color: #2563eb;
  font-weight: 600;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
}

.auth-box {
  display: none;
  position: absolute;
  z-index: 150;
  width: 360px;
  max-width: calc(100vw - 40px);
}

.auth-card {
  background: #ffffff;
  padding: 26px;
  border-radius: 24px;
  border: 1px solid var(--nx-border);
  height: fit-content;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.auth-card h3 {
  margin: 0;
}

.muted {
  color: var(--nx-gray);
  font-size: 0.92rem;
}

.switch-text {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--nx-gray);
}

.auth-card .switch-text a {
  color: #374151;
  text-decoration: none;
  font-weight: 500;
}

.auth-card .switch-text a:hover {
  color: #111827;
  text-decoration: underline;
}

#authMessage {
  margin-top: 15px;
  font-size: 0.9rem;
  color: var(--nx-gray);
}

#authMessage.ok {
  color: #0f8f44;
}

#authMessage.bad {
  color: #cf2a42;
}

input,
select,
textarea {
  width: 100%;
  padding: 14px;
  margin: 12px 0;
  border-radius: 10px;
  border: 1px solid var(--nx-border);
  background: var(--nx-accent);
  font-size: 1rem;
  box-sizing: border-box;
  font-family: inherit;
}

textarea {
  resize: vertical;
  min-height: 68px;
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--nx-accent);
  border: 1px solid var(--nx-border);
  color: var(--nx-text);
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
  margin-top: 10px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.btn-primary:hover {
  background: #ececf0;
  border-color: #c8c8cf;
}

.btn-primary.secondary {
  background: var(--nx-accent);
  border: 1px solid var(--nx-border);
  color: var(--nx-text);
}

.button-stack {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.register-nav {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 8px;
  margin-top: 8px;
}

.register-nav .btn-primary {
  margin-top: 0;
}

.btn-back-arrow {
  padding: 0;
  font-size: 1.2rem;
  line-height: 1;
}

.token-block {
  margin-top: 8px;
}

.token-block label {
  font-size: 0.85rem;
  color: var(--nx-gray);
}

#apiResult {
  margin: 12px 0 0;
  padding: 12px;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 120px;
  font-size: 0.82rem;
  overflow: auto;
}

@media (max-width: 1020px) {
  .main-container {
    grid-template-columns: 1fr;
  }

  .content-section .cards {
    grid-template-columns: 1fr;
  }

  #landing .ecosystem-section {
    padding: 0 20px;
  }

  #landing .ecosystem-logos {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
  }

  .hero h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 740px) {
  #landing .ecosystem-section h2 {
    margin-bottom: 16px;
  }

  #landing .ecosystem-logos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #landing .ecosystem-logo {
    padding: 8px 4px;
  }

  #landing .ecosystem-logo img {
    height: 42px;
  }

  .home-hero-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-post-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

.site-footer {
  border-top: 1px solid var(--nx-border);
  background: #ffffff;
  margin-top: 40px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--nx-gray);
  font-size: 0.88rem;
}

.footer-brand .footer-title {
  color: var(--nx-text);
  font-size: 0.95rem;
  font-weight: 400;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--nx-gray);
  text-decoration: none;
  font-size: 0.88rem;
}

.footer-links a:hover {
  color: var(--nx-blue);
}

.home-wrap {
  width: min(100%, 980px);
  max-width: 980px;
  margin: 0 auto;
  padding: 0 clamp(12px, 3vw, 20px) 80px;
  box-sizing: border-box;
}

#homeWrap {
  display: none;
}

#landing {
  display: block;
}

html.nx-has-token #homeWrap {
  display: block;
}

html.nx-has-token #landing {
  display: none;
}

.home-hero {
  text-align: left;
  margin-bottom: 26px;
}

.home-hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-hero h1 {
  margin: 0;
  font-size: 2.2rem;
  letter-spacing: -0.6px;
}

.home-hero p {
  margin: 8px 0 0;
  color: var(--nx-gray);
  font-size: 1.05rem;
}

.home-post-feedback {
  margin-top: 10px;
  min-height: 20px;
  color: var(--nx-gray);
  font-size: 0.92rem;
}

.home-post-feedback.ok {
  color: #0f8f44;
}

.home-post-feedback.error {
  color: #b42318;
}

.home-create-post-btn {
  border: 1px solid var(--nx-border);
  background: #f5f5f7;
  color: var(--nx-text);
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 700;
}

.home-create-post-btn:hover {
  border-color: var(--nx-blue);
  color: var(--nx-blue);
}

.home-post-modal {
  position: fixed;
  inset: 0;
  z-index: 220;
  background: rgba(10, 20, 35, 0.46);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.home-post-modal[hidden] {
  display: none !important;
}

.home-post-modal-card {
  width: min(680px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--nx-border);
  border-radius: 16px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.14);
}

.home-post-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--nx-border);
}

.home-post-modal-head h2 {
  margin: 0;
  font-size: 1.12rem;
}

.home-post-close {
  border: 1px solid var(--nx-border);
  background: #f5f5f7;
  color: var(--nx-text);
  border-radius: 9px;
  width: 34px;
  height: 34px;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}

.home-post-modal-body {
  padding: 14px 16px;
}

.home-post-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.88rem;
}

.home-post-caption {
  width: 100%;
  min-height: 100px;
  border: 1px solid var(--nx-border);
  border-radius: 12px;
  padding: 10px 12px;
  resize: vertical;
  margin-bottom: 12px;
  font: inherit;
  font-size: 0.92rem;
}

.home-post-file {
  width: 100%;
  margin-bottom: 6px;
}

.home-post-hint {
  margin-bottom: 12px;
  color: var(--nx-gray);
  font-size: 0.82rem;
}

.home-post-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.home-post-preview-item {
  border: 1px solid var(--nx-border);
  border-radius: 10px;
  background: #f5f5f7;
  overflow: hidden;
}

.home-post-preview-item img,
.home-post-preview-item video {
  width: 100%;
  height: 84px;
  object-fit: cover;
  display: block;
}

.home-post-preview-item span {
  display: block;
  padding: 6px;
  font-size: 0.74rem;
  color: var(--nx-gray);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-post-modal-actions {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--nx-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.home-post-secondary,
.home-post-primary {
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 700;
}

.home-post-secondary {
  border: 1px solid var(--nx-border);
  background: #f5f5f7;
  color: var(--nx-text);
}

.home-post-primary {
  border: 1px solid var(--nx-blue);
  background: var(--nx-blue);
  color: #fff;
}

.feed {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

.home-feed.home-feed-reels {
  --nx-reels-card-width: min(920px, calc(100vw - 36px));
  width: 100%;
  max-width: none;
  margin: -6px auto 0;
  padding: 14px 0;
  box-sizing: border-box;
  position: relative;
  display: grid;
  place-items: center;
  gap: 10px;
  overflow-x: clip;
}

.home-feed.home-feed-reels .feed-card-frame {
  position: relative;
  width: var(--nx-reels-card-width);
  max-width: calc(100vw - 36px);
  margin-inline: auto;
  height: min(76vh, 860px);
  border-radius: 20px;
  overflow: hidden;
  background: #f9fbff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
  isolation: isolate;
  z-index: 1;
}

.home-feed.home-feed-reels .home-feed-list {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.home-feed.home-feed-reels .feed-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: translateY(14%);
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 1;
}

.home-feed.home-feed-reels .home-feed-list.feed-initializing .feed-slide {
  transition: none;
}

.home-feed.home-feed-reels .feed-slide.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  z-index: 3;
}

.home-feed.home-feed-reels .feed-slide.enter-from-bottom {
  opacity: 0;
  transform: translateY(14%);
  z-index: 4;
}

.home-feed.home-feed-reels .feed-slide.enter-from-top {
  opacity: 0;
  transform: translateY(-14%);
  z-index: 4;
}

.home-feed.home-feed-reels .feed-slide.exit-to-top {
  opacity: 0;
  transform: translateY(-12%);
  pointer-events: none;
  z-index: 2;
}

.home-feed.home-feed-reels .feed-slide.exit-to-bottom {
  opacity: 0;
  transform: translateY(12%);
  pointer-events: none;
  z-index: 2;
}

.home-feed.home-feed-reels .feed-slide-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.home-feed.home-feed-reels .feed-slide-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.home-feed.home-feed-reels .feed-slide-media-track {
  width: 100%;
  height: 100%;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.home-feed.home-feed-reels .feed-slide-media-track::-webkit-scrollbar {
  display: none;
}

.home-feed.home-feed-reels .feed-slide-media-item {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  scroll-snap-align: center;
  background: #eef2f8;
}

.home-feed.home-feed-reels .feed-media-shell {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: #eef2f8;
}

.home-feed.home-feed-reels .feed-slide-media-item img,
.home-feed.home-feed-reels .feed-slide-media-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.home-feed.home-feed-reels .feed-slide-media-item.is-loaded img,
.home-feed.home-feed-reels .feed-slide-media-item.is-loaded video {
  opacity: 1;
}

.home-feed.home-feed-reels .feed-slide-media-item.is-loaded .media-skeleton {
  opacity: 0;
  visibility: hidden;
}

.home-feed.home-feed-reels .feed-slide-media-item.is-error .media-skeleton {
  background: linear-gradient(120deg, #e2e8f0 0%, #f1f5f9 100%);
  opacity: 1;
}

.home-feed.home-feed-reels .feed-slide-text {
  display: grid;
  width: 100%;
  height: 100%;
  place-content: center;
  gap: 10px;
  padding: 34px;
  text-align: center;
  background: radial-gradient(110% 140% at 8% 6%, #ffffff 0%, #f5f8fe 54%, #eaf0f9 100%);
  color: #0f172a;
}

.home-feed.home-feed-reels .feed-slide-text h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748b;
}

.home-feed.home-feed-reels .feed-slide-text p {
  margin: 0;
  font-size: clamp(1rem, 1.8vw, 1.34rem);
  line-height: 1.62;
  font-weight: 600;
  color: #1e293b;
  max-width: 56ch;
}

.home-feed.home-feed-reels .feed-loading-state {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 26px;
  text-align: center;
  background: linear-gradient(140deg, #f7f9fd 0%, #eef3fb 54%, #e7edf8 100%);
}

.home-feed.home-feed-reels .feed-loading-spinner {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 2px solid #d5deec;
  border-top-color: #64748b;
  animation: feedSpin 0.9s linear infinite;
}

.home-feed.home-feed-reels .feed-loading-text {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #475569;
}

.home-feed.home-feed-reels .feed-loading-state.is-empty .feed-loading-spinner,
.home-feed.home-feed-reels .feed-loading-state.is-error .feed-loading-spinner {
  display: none;
}

.home-feed.home-feed-reels .feed-loading-state.is-error .feed-loading-text {
  color: #b91c1c;
}

.home-feed.home-feed-reels .feed-loading-state.is-empty .feed-loading-text {
  color: #475569;
}

.home-feed.home-feed-reels .feed-slide-shade {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(to top, rgba(2, 6, 23, 0.84) 0%, rgba(2, 6, 23, 0.44) 26%, rgba(2, 6, 23, 0.16) 50%, rgba(2, 6, 23, 0.0) 70%),
    linear-gradient(to bottom, rgba(2, 6, 23, 0.18) 0%, rgba(2, 6, 23, 0.0) 18%);
  pointer-events: none;
}

.home-feed.home-feed-reels .home-feed-state {
  flex: 1 1 auto;
  width: auto;
  min-height: 28px;
  margin: 0;
  padding: 8px 2px;
  border-radius: 0;
  background: transparent;
  color: #334155;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
}

.home-feed.home-feed-reels .home-feed-toolbar {
  width: var(--nx-reels-card-width);
  max-width: calc(100vw - 36px);
  min-height: 44px;
  margin: 0 auto;
  padding: 0 12px;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.96);
  border: 1px solid rgba(203, 213, 225, 0.58);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-feed.home-feed-reels .home-feed-toolbar-menu {
  position: relative;
  flex: 0 0 auto;
}

.home-feed.home-feed-reels .home-feed-menu-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: #ffffff;
  color: #334155;
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

.home-feed.home-feed-reels .home-feed-menu-btn:hover {
  background: #f8fafc;
}

.home-feed.home-feed-reels .home-feed-menu-btn[aria-expanded="true"] {
  border-color: rgba(37, 99, 235, 0.4);
  color: #1d4ed8;
}

.home-feed.home-feed-reels .home-feed-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 12;
  min-width: min(252px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(203, 213, 225, 0.72);
  background: #ffffff;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.14);
}

.home-feed.home-feed-reels .home-feed-menu-item {
  width: 100%;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #0f172a;
  text-align: left;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.3;
  padding: 10px 12px;
  cursor: pointer;
}

.home-feed.home-feed-reels .home-feed-menu-item:hover {
  background: #f1f5f9;
}

.home-feed.home-feed-reels .feed-meta {
  position: absolute;
  left: 18px;
  right: 88px;
  bottom: 20px;
  z-index: 3;
  color: #f8fafc;
  text-shadow: 0 2px 12px rgba(2, 6, 23, 0.56);
}

.home-feed.home-feed-reels .feed-meta * {
  color: inherit;
}

.home-feed.home-feed-reels .feed-meta a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
}

.home-feed.home-feed-reels .feed-meta-time {
  margin-left: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.92;
}

.home-feed.home-feed-reels .feed-meta-caption {
  margin-top: 10px;
  font-size: 1rem;
  line-height: 1.5;
  color: #f1f5f9;
  max-width: 62ch;
  white-space: pre-wrap;
  word-break: break-word;
}

.home-feed.home-feed-reels .feed-actions {
  position: absolute;
  right: 14px;
  bottom: 116px;
  z-index: 3;
  display: grid;
  gap: 12px;
  justify-items: center;
}

.home-feed.home-feed-reels .feed-action {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(10, 15, 26, 0.54);
  color: #ffffff;
  font-size: 17px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.home-feed.home-feed-reels .feed-action-unmute {
  min-width: 70px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.home-feed.home-feed-reels .feed-media-count {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(9, 14, 24, 0.58);
  color: #ffffff;
  padding: 5px 11px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.home-feed.home-feed-reels .home-feed-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: max-content;
  flex-wrap: nowrap;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(8, 13, 22, 0.46);
  backdrop-filter: blur(8px);
}

.home-feed.home-feed-reels .home-feed-switch-overlay {
  position: absolute;
  top: 76px;
  left: 0;
  right: 0;
  width: var(--nx-reels-card-width);
  max-width: calc(100vw - 36px);
  margin: 0 auto;
  z-index: 7;
  padding: 0 16px;
  border: 0;
  background: transparent;
  backdrop-filter: none;
}

@media (max-width: 640px) {
  body.home-feed-mode {
    overflow-x: hidden;
  }

  .home-feed.home-feed-reels {
    --nx-reels-card-width: calc(100vw - 20px);
    padding: 10px;
  }

  .home-feed.home-feed-reels .feed-card-frame,
  .home-feed.home-feed-reels .home-feed-toolbar {
    max-width: calc(100vw - 20px);
  }

  .home-feed.home-feed-reels .home-feed-toolbar {
    padding: 0 10px;
  }

  .home-feed.home-feed-reels .home-feed-menu {
    right: 0;
    min-width: min(232px, calc(100vw - 20px));
    max-width: calc(100vw - 20px);
  }

  .home-feed.home-feed-reels .home-feed-switch-overlay {
    left: 10px;
    right: 10px;
    max-width: none;
  }

  .home-feed.home-feed-reels .home-feed-switch {
    width: 100%;
    flex-wrap: wrap;
  }
}

.home-feed.home-feed-reels .home-feed-pill {
  border: 1px solid rgba(226, 232, 240, 0.38);
  border-radius: 999px;
  background: rgba(8, 13, 22, 0.6);
  color: #e2e8f0;
  min-height: 38px;
  padding: 9px 15px;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  cursor: pointer;
}

.home-feed.home-feed-reels .home-feed-pill.is-active {
  background: #ffffff;
  border-color: #ffffff;
  color: #0f172a;
}

.home-feed.home-feed-reels .media-skeleton {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(100deg, #e7ecf5 22%, #f8fbff 36%, #e7ecf5 50%);
  background-size: 220% 100%;
  animation: mediaShimmer 1.15s linear infinite;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.home-feed.home-feed-reels .home-feed-user-tag {
  margin-top: 9px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(241, 245, 249, 0.92);
}

.home-create-fab {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 16;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
  font-size: 1.9rem;
  line-height: 1;
  font-weight: 500;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.22);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.home-create-fab:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.28);
}

.home-create-fab:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

@keyframes feedSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}


.media-skeleton {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(100deg, #e2e8f0 24%, #f8fafc 36%, #e2e8f0 48%);
  background-size: 220% 100%;
  animation: mediaShimmer 1.1s linear infinite;
}


@keyframes mediaShimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}


.home-chat-pill {
  position: fixed;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 14;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 10px 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.home-chat-pill[aria-expanded="true"] {
  background: rgba(17, 24, 39, 0.92);
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 18px 38px rgba(2, 6, 23, 0.32);
}

.home-chat-pill[aria-expanded="true"] .home-chat-pill-icon {
  background: rgba(59, 130, 246, 0.16);
  color: #dbeafe;
}

.home-chat-pill-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font-size: 14px;
  border-radius: 999px;
  color: #334155;
  background: #e2e8f0;
}

.home-chat-pill-label {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.home-chat-pill-badge {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffffff;
  background: #ef4444;
}

.home-chat-pill-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #0f172a;
  background: linear-gradient(135deg, #bfdbfe 0%, #93c5fd 100%);
  border: 1px solid rgba(30, 64, 175, 0.16);
}

.home-messages-drawer {
  position: fixed;
  inset: 0;
  z-index: 95;
  pointer-events: none;
  will-change: opacity;
  transform: translateZ(0);
}

.home-messages-drawer.is-open {
  pointer-events: auto;
}

.home-messages-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.18);
  opacity: 0;
  transition: opacity 0.26s ease;
}

.home-messages-drawer.is-open .home-messages-backdrop {
  opacity: 1;
}

.home-messages-panel {
  position: absolute;
  top: 100px;
  left: 18px;
  bottom: 18px;
  width: min(372px, calc(100vw - 36px));
  display: flex;
  flex-direction: column;
  border-radius: 28px;
  border: 1px solid rgba(71, 85, 105, 0.5);
  background: #1f2937;
  color: #e2e8f0;
  box-shadow: 0 24px 54px rgba(2, 6, 23, 0.34);
  backdrop-filter: blur(14px);
  overflow: hidden;
  transform: translateX(calc(-100% - 24px));
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.26s ease;
  will-change: transform, opacity;
}

.home-messages-drawer.is-open .home-messages-panel {
  transform: translateX(0);
  opacity: 1;
}

.home-messages-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.home-messages-heading {
  min-width: 0;
}

.home-messages-eyebrow {
  margin: 0 0 2px;
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-messages-title-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.home-messages-title {
  margin: 0;
  font-size: 1.42rem;
  line-height: 0.98;
  letter-spacing: -0.03em;
  color: #f8fafc;
}

.home-messages-header-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.home-messages-total-badge {
  min-width: 28px;
  height: 28px;
  padding: 0 9px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.16);
  color: #dbeafe;
  font-size: 0.76rem;
  font-weight: 800;
}

.home-messages-status-control {
  border: 1px solid rgba(71, 85, 105, 0.68);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #e2e8f0;
  height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  cursor: pointer;
}

.home-messages-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.home-messages-status-dot.is-online { background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16); }
.home-messages-status-dot.is-busy { background: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14); }
.home-messages-status-dot.is-away { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14); }
.home-messages-status-dot.is-invisible { background: #94a3b8; box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.14); }

.home-messages-status-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #f8fafc;
}

.home-messages-status-caret {
  color: #94a3b8;
  font-size: 0.62rem;
}

.home-messages-close {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.62);
  color: #f8fafc;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.home-messages-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 10px 14px 0;
}

.home-messages-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  padding: 0 4px 0 2px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.28) transparent;
}

.home-messages-list[hidden] {
  display: none !important;
}

.home-messages-list::-webkit-scrollbar {
  width: 8px;
}

.home-messages-list::-webkit-scrollbar-track {
  background: transparent;
}

.home-messages-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.22);
  border-radius: 999px;
}

.home-message-thread-view {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.home-message-thread-view[hidden] {
  display: none !important;
}

.home-message-thread-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 4px 12px;
}

.home-message-thread-back {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(55, 65, 81, 0.42);
  color: #f8fafc;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.home-message-thread-identity {
  min-width: 0;
}

.home-message-thread-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #f8fafc;
}

.home-message-thread-status {
  margin: 2px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #cbd5e1;
  font-size: 0.76rem;
  font-weight: 700;
}

.home-message-thread-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

.home-message-thread-stream {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 2px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.28) transparent;
}

.home-message-thread-stream::-webkit-scrollbar {
  width: 8px;
}

.home-message-thread-stream::-webkit-scrollbar-track {
  background: transparent;
}

.home-message-thread-stream::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.22);
  border-radius: 999px;
}

.home-chat-bubble-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 88%;
}

.home-chat-bubble-row.is-me {
  align-self: flex-end;
}

.home-chat-bubble-row.is-them {
  align-self: flex-start;
}

.home-chat-bubble {
  border-radius: 18px;
  padding: 12px 14px;
  font-size: 0.86rem;
  line-height: 1.5;
  color: #f8fafc;
  box-shadow: 0 10px 18px rgba(2, 6, 23, 0.14);
}

.home-chat-bubble-row.is-them .home-chat-bubble {
  background: linear-gradient(180deg, rgba(75, 85, 99, 0.82) 0%, rgba(31, 41, 55, 0.96) 100%);
}

.home-chat-bubble-row.is-me .home-chat-bubble {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.26) 0%, rgba(37, 99, 235, 0.18) 100%), rgba(30, 41, 59, 0.96);
}

.home-chat-bubble-time {
  font-size: 0.7rem;
  font-weight: 700;
  color: #94a3b8;
  padding: 0 6px;
}

.home-chat-bubble-row.is-me .home-chat-bubble-time {
  align-self: flex-end;
}

.home-message-thread-compose {
  padding: 12px 0 0;
}

.home-message-thread-compose-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(31, 41, 55, 0.82);
  padding: 8px 8px 8px 14px;
}

.home-message-thread-input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f8fafc;
  font: inherit;
  font-size: 0.86rem;
}

.home-message-thread-input::placeholder {
  color: #94a3b8;
}

.home-message-thread-send {
  border: 1px solid rgba(96, 165, 250, 0.24);
  border-radius: 14px;
  background: rgba(59, 130, 246, 0.16);
  color: #dbeafe;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 10px 14px;
  cursor: pointer;
}

.home-message-thread {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(55, 65, 81, 0.64) 0%, rgba(31, 41, 55, 0.88) 100%);
  color: inherit;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.home-message-thread:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.16);
  background: linear-gradient(180deg, rgba(75, 85, 99, 0.74) 0%, rgba(31, 41, 55, 0.94) 100%);
  box-shadow: 0 12px 20px rgba(2, 6, 23, 0.2);
}

.home-message-thread.is-active {
  border-color: rgba(255, 255, 255, 0.18);
  background: linear-gradient(180deg, rgba(75, 85, 99, 0.9) 0%, rgba(31, 41, 55, 0.98) 100%);
  box-shadow: 0 14px 26px rgba(2, 6, 23, 0.24);
}

.home-message-thread.is-unread {
  background: linear-gradient(180deg, rgba(75, 85, 99, 0.82) 0%, rgba(31, 41, 55, 0.96) 100%);
}

.home-message-avatar {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 0.88rem;
  font-weight: 800;
  color: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.avatar-coral { background: linear-gradient(135deg, #f97316 0%, #ea580c 100%); }
.avatar-sky { background: linear-gradient(135deg, #38bdf8 0%, #2563eb 100%); }
.avatar-violet { background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%); }
.avatar-amber { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.avatar-mint { background: linear-gradient(135deg, #34d399 0%, #059669 100%); }
.avatar-rose { background: linear-gradient(135deg, #fb7185 0%, #e11d48 100%); }
.avatar-slate { background: linear-gradient(135deg, #64748b 0%, #334155 100%); }
.avatar-gold { background: linear-gradient(135deg, #facc15 0%, #ca8a04 100%); }
.avatar-indigo { background: linear-gradient(135deg, #818cf8 0%, #4f46e5 100%); }
.avatar-pearl { background: linear-gradient(135deg, #cbd5e1 0%, #64748b 100%); }
.avatar-cyan { background: linear-gradient(135deg, #22d3ee 0%, #0891b2 100%); }
.avatar-lime { background: linear-gradient(135deg, #a3e635 0%, #65a30d 100%); }

.home-message-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.home-message-topline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.home-message-name {
  min-width: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #f8fafc;
}

.home-message-time {
  flex: 0 0 auto;
  color: #94a3b8;
  font-size: 0.74rem;
  font-weight: 700;
}

.home-message-preview {
  display: block;
  color: #cbd5e1;
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-message-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.home-message-pin {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-message-unread-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #60a5fa;
  box-shadow: 0 0 0 6px rgba(96, 165, 250, 0.12);
}

.home-message-unread-pill {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #2563eb;
  color: #eff6ff;
  font-size: 0.7rem;
  font-weight: 800;
}

.home-messages-compose {
  padding: 16px;
  border-top: 1px solid rgba(71, 85, 105, 0.34);
  background: rgba(8, 13, 22, 0.6);
}

.home-messages-compose-btn {
  width: 100%;
  border: 1px solid rgba(71, 85, 105, 0.6);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.94);
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.home-messages-compose-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(96, 165, 250, 0.38);
  background: rgba(17, 24, 39, 0.96);
}

.home-messages-compose-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(59, 130, 246, 0.16);
  color: #dbeafe;
  font-weight: 800;
}

.home-messages-compose-text {
  font-size: 0.9rem;
  font-weight: 700;
  color: #e2e8f0;
}

@media (max-width: 740px) {
  .home-wrap {
    padding-top: 20px;
  }

  .home-hero {
    margin-bottom: 12px;
  }

  .home-hero p {
    font-size: 0.94rem;
    margin-top: 6px;
  }

  .home-chat-pill {
    left: 12px;
    bottom: 12px;
    height: 44px;
    gap: 8px;
    padding: 0 9px 0 10px;
  }

  .home-chat-pill-label {
    font-size: 0.84rem;
  }

  .home-chat-pill-avatar {
    width: 24px;
    height: 24px;
    font-size: 0.72rem;
  }

  .home-create-fab {
    right: 12px;
    bottom: 12px;
    width: 50px;
    height: 50px;
    font-size: 1.65rem;
  }

  .home-messages-panel {
    top: 74px;
    left: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
    border-radius: 24px;
  }

  .home-messages-header,
  .home-messages-body,
  .home-messages-compose {
    padding-left: 14px;
    padding-right: 14px;
  }

  .home-messages-header {
    padding-top: 12px;
    padding-bottom: 10px;
    gap: 10px;
  }

  .home-messages-title {
    font-size: 1.24rem;
  }

  .home-messages-header-meta {
    gap: 6px;
  }

  .home-messages-status-control {
    height: 30px;
    padding: 0 9px;
    gap: 7px;
  }

  .home-messages-status-label {
    font-size: 0.74rem;
  }

  .home-message-thread {
    border-radius: 18px;
    padding: 11px;
  }

  .home-message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }
}

.home-news {
  display: grid;
  gap: 18px;
}

.home-token {
  margin-bottom: 18px;
  background: #ffffff;
  border: 1px solid var(--nx-border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.04);
}

.home-token-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-token-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.home-token-sub {
  margin: 8px 0 10px;
  color: var(--nx-gray);
  font-size: 0.92rem;
}

.home-token-copy {
  border: 1px solid var(--nx-border);
  background: #f5f5f7;
  color: var(--nx-text);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
}

.home-token-copy:hover {
  border-color: var(--nx-blue);
  color: var(--nx-blue);
}

#homeAccessToken {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 90px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 0.82rem;
}

.home-news-card {
  background: #ffffff;
  border: 1px solid var(--nx-border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.04);
}

.home-news-tag {
  display: inline-flex;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--nx-blue);
  background: #e9f3ff;
  border-radius: 8px;
  padding: 5px 9px;
}

.home-news-card h2 {
  margin: 10px 0 8px;
  font-size: 1.35rem;
  letter-spacing: -0.3px;
}

.home-news-card p {
  margin: 0;
  color: #374151;
}

.home-news-meta {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--nx-gray);
}

.nx-not-found {
  max-width: 960px;
  margin: 0 auto;
  padding: 72px 20px 90px;
}

.nx-not-found h1 {
  margin: 0;
  font-size: 3rem;
  letter-spacing: -1px;
}

.nx-not-found p {
  margin-top: 10px;
  color: var(--nx-gray);
}

.profile-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 42px 20px 80px;
}

.profile-cover {
  height: 180px;
  border: 1px solid var(--nx-border);
  border-radius: 18px;
  margin-bottom: 18px;
  background:
    radial-gradient(circle at 20% 20%, rgba(0, 122, 255, 0.2), transparent 35%),
    radial-gradient(circle at 80% 80%, rgba(131, 56, 236, 0.16), transparent 35%),
    linear-gradient(135deg, #f0f7ff 0%, #ffffff 100%);
  background-size: cover;
  background-position: center;
}

.profile-hero {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 34px;
  align-items: center;
  border-bottom: 1px solid var(--nx-border);
  padding-bottom: 28px;
}

.profile-avatar-shell {
  width: 160px;
  height: 160px;
  margin: 0 auto;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from 140deg, #ff7a18, #ff0068, #8338ec, #3a86ff, #ff7a18);
}

.profile-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  background: #fff;
  border: 4px solid #fff;
}

.profile-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-head h1 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.profile-handle-row {
  margin: 8px 0 0;
  color: var(--nx-gray);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-status {
  border: 1px solid var(--nx-border);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.75rem;
  line-height: 1.2;
  color: #374151;
  background: var(--nx-accent);
  text-transform: capitalize;
}

.profile-action {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 10px;
  padding: 8px 12px;
  background: #111827;
  color: #fff;
}

.profile-action.secondary {
  background: #f3f4f6;
  color: #111827;
}

.profile-stats {
  display: flex;
  gap: 20px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.profile-stats span {
  color: #374151;
}

.profile-stats strong {
  color: #111827;
}

.profile-bio {
  margin: 12px 0 6px;
  color: #1f2937;
}

.profile-meta {
  margin: 0;
  color: var(--nx-gray);
  font-size: 0.9rem;
}

.profile-links {
  margin: 8px 0 0;
}

.profile-website {
  color: var(--nx-blue);
  text-decoration: none;
  word-break: break-all;
}

.profile-website:hover {
  text-decoration: underline;
}

.profile-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.profile-tab {
  border: 1px solid var(--nx-border);
  background: #fff;
  color: #111827;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
}

.profile-tab.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.profile-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.post-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.post-media {
  aspect-ratio: 1/1;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 122, 24, 0.45), transparent 35%),
    radial-gradient(circle at 80% 80%, rgba(131, 56, 236, 0.35), transparent 35%),
    linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.post-ribbon {
  margin: 8px;
  padding: 4px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.75);
  color: #fff;
}

.post-meta {
  padding: 8px 10px;
  font-size: 0.78rem;
  color: #4b5563;
}

.profile-empty {
  border: 1px dashed #d1d5db;
  border-radius: 14px;
  padding: 22px;
  text-align: center;
}

.profile-empty h2 {
  margin: 0 0 8px;
}

@media (max-width: 900px) {
  .profile-hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .profile-head {
    justify-content: center;
  }

  .profile-stats {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .feed .feed-media img,
  .feed .feed-media video {
    max-height: 240px;
  }
}

@media (max-width: 740px) {
  .profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Hybrid profile (production) */
.nx-profile-layout {
  max-width: 1220px;
  margin: 0 auto;
  padding: 26px 20px 80px;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 14px;
}

.nx-profile-sidebar,
.nx-profile-main {
  border: 1px solid var(--nx-border);
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.nx-profile-sidebar {
  padding: 16px;
  position: sticky;
  top: 84px;
  align-self: start;
}

.nx-profile-cover {
  height: 124px;
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 24%, rgba(255, 255, 255, 0.38), transparent 32%),
    radial-gradient(circle at 82% 76%, rgba(255, 255, 255, 0.24), transparent 36%),
    linear-gradient(125deg, #e9f3ff 0%, #dcecff 52%, #f8fbff 100%);
  border: 1px solid var(--nx-border);
}

.nx-profile-more {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border: 1px solid var(--nx-border);
  border-radius: 10px;
  background: #f5f5f7;
  color: #111827;
  cursor: pointer;
}

.nx-profile-more:focus-visible {
  outline: 2px solid var(--nx-blue);
  outline-offset: 2px;
}

.nx-profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  margin-top: -52px;
  position: relative;
  z-index: 1;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

.nx-profile-name {
  margin: 10px 0 2px;
  font-size: 1.34rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.nx-profile-handle-row {
  color: var(--nx-gray);
  font-weight: 700;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nx-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0f8f44;
  box-shadow: 0 0 0 4px rgba(15, 143, 68, 0.14);
}

.nx-profile-bio {
  margin-top: 12px;
  color: #374151;
  font-size: 0.9rem;
  line-height: 1.45;
}

.nx-profile-actions {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.nx-action-btn {
  border: 1px solid var(--nx-border);
  background: #f5f5f7;
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #111827;
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, background-color .18s ease;
}

.nx-action-btn:hover {
  transform: translateY(-1px);
  border-color: var(--nx-blue);
  background: #e9f3ff;
}

.nx-profile-meta {
  margin-top: 14px;
  display: grid;
  gap: 7px;
}

.nx-meta-line {
  margin: 0;
  border: 1px dashed var(--nx-border);
  border-radius: 10px;
  padding: 8px 10px;
  background: #f5f5f7;
  color: #4b5563;
  font-size: 0.84rem;
}

.nx-profile-website {
  color: var(--nx-blue);
  text-decoration: none;
  word-break: break-all;
}

.nx-profile-main {
  overflow: hidden;
}

.nx-profile-head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--nx-border);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 66px;
  z-index: 5;
}

.nx-profile-stats {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.nx-stat-card.profile-tab {
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 14px 10px;
  text-align: center;
  background: #f5f5f7;
  color: #1d1d1f;
  cursor: pointer;
  transition: 0.3s;
}

.nx-stat-card.profile-tab strong {
  display: block;
  font-size: 1.2rem;
}

.nx-stat-card.profile-tab span {
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .72rem;
  color: #1d1d1f;
  font-weight: 700;
}

.nx-stat-card.profile-tab:hover,
.nx-stat-card.profile-tab.active {
  border-color: var(--nx-border);
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.nx-profile-grid {
  margin-top: 0;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.nx-profile-grid .post-card {
  transition: transform .2s ease, box-shadow .2s ease;
}

.nx-profile-grid .post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

@media (max-width: 1020px) {
  .nx-profile-layout {
    grid-template-columns: 1fr;
  }

  .nx-profile-sidebar {
    position: static;
  }
}

@media (max-width: 740px) {
  .nx-profile-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nx-stat-card.profile-tab {
    padding: 12px 8px;
  }

  .nx-stat-card.profile-tab strong {
    font-size: 1.04rem;
  }

  .nx-stat-card.profile-tab span {
    font-size: .64rem;
  }

  .nx-profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Restored exact profile_hybrid5 visual language (scoped) */
.nx-profile-page {
  --bg: radial-gradient(circle at top, #f0f7ff 0%, #ffffff 100%);
  --card: #ffffff;
  --border: #d2d2d7;
  --shadow: 0 10px 24px rgba(0, 0, 0, 0.04);
  --text: #1d1d1f;
  --muted: #86868b;
  --text-muted: #86868b;
  --primary: #007aff;
  --primary-soft: #eff6ff;
  --radius: 18px;
  --ok: #0f8f44;
  box-sizing: border-box;
}

.nx-profile-page * {
  box-sizing: border-box;
}

.nx-profile-page {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 16px;
  color: var(--text);
  background: var(--bg);
}

.nx-profile-page.layout,
.nx-profile-page .layout {
  width: 100%;
  display: grid;
  grid-template-columns: 320px minmax(600px, 880px);
  gap: 24px;
  justify-content: center;
}

.nx-profile-page .sidebar,
.nx-profile-page .main {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.nx-profile-page .sidebar {
  padding: 16px;
  position: sticky;
  top: 84px;
  align-self: start;
}

.nx-profile-page .main {
  overflow: hidden;
  align-self: start;
  display: flex;
  flex-direction: column;
}

.nx-profile-page .cover {
  height: 120px;
  border-radius: calc(var(--radius) - 2px);
  background: linear-gradient(120deg, #e9f3ff 0%, var(--primary-soft) 100%);
  position: relative;
  overflow: hidden;
}

.nx-profile-page .cover::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 10% 30%, rgba(255, 255, 255, 0.42), transparent 30%),
    radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.22), transparent 35%);
}

.nx-profile-page .avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--card);
  margin-top: -52px;
  position: relative;
  z-index: 1;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.nx-profile-page .name {
  margin: 10px 0 2px;
  font-size: 1.36rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.nx-profile-page .username {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nx-profile-page .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(22, 199, 132, 0.16);
}

.nx-profile-page .bio {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.89rem;
  line-height: 1.45;
}

.nx-profile-page .quick-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.nx-profile-page .quick {
  border: 1px solid var(--border);
  background: #f5f5f7;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background-color .18s ease;
}

.nx-profile-page .quick:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  background: var(--primary-soft);
}

.nx-profile-page .quick .i {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  flex-shrink: 0;
}

.nx-profile-page .meta-list {
  margin-top: 14px;
  display: grid;
  gap: 7px;
  font-size: 0.83rem;
  color: var(--muted);
}

.nx-profile-page .meta-item {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  background: #f5f5f7;
}

.nx-profile-page .meta-item a {
  color: var(--primary);
  text-decoration: none;
}

.nx-profile-page .meta-item a:hover {
  text-decoration: underline;
}

.nx-profile-page .main-head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  position: relative;
  top: auto;
  z-index: 1;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.86);
}

.nx-profile-page .close {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 10;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f5f5f7;
  color: var(--text);
  width: 36px;
  height: 36px;
  font-size: 16px;
  cursor: pointer;
}

.nx-profile-page .profile-more-menu {
  position: absolute;
  right: 12px;
  bottom: 56px;
  z-index: 15;
  min-width: 128px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 6px;
}

.nx-profile-page .profile-more-menu[hidden] {
  display: none !important;
}

.nx-profile-page .profile-more-menu button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #b42318;
  font-weight: 600;
  font-size: 0.84rem;
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
}

.nx-profile-page .profile-more-menu button:hover {
  background: #fff2f0;
}

.nx-profile-page .stat-row {
  margin-top: 10px;
  width: 100%;
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.nx-profile-page .stat {
  box-sizing: border-box;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 14px 10px;
  width: 100%;
  min-width: 0;
  height: 84px;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  background: #f5f5f7;
  color: var(--text);
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.nx-profile-page .stat:hover,
.nx-profile-page .stat.active,
.nx-profile-page .stat.is-active {
  border-color: var(--border);
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.nx-profile-page .stat b {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
}

.nx-profile-page .stat small {
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .72rem;
  color: var(--text);
  font-weight: 700;
}

.nx-profile-page .panel {
  padding: 24px 14px 14px;
  min-height: 320px;
  animation: nx-profile-appear .25s ease;
}

@keyframes nx-profile-appear {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.nx-profile-page .grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.nx-profile-page .tile {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
  aspect-ratio: 1/1;
  position: relative;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.nx-profile-page .tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .22s ease;
}

.nx-profile-page .tile.tile-text {
  background: #f5f5f7;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.nx-profile-page .tile-text-content {
  width: 100%;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.35;
  text-align: left;
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 8;
  line-clamp: 8;
  -webkit-box-orient: vertical;
}

.nx-profile-page .tile:hover {
  transform: translateY(-3px);
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.nx-profile-page .tile:hover img {
  transform: scale(1.04);
}

.nx-profile-page .tile-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: .67rem;
  font-weight: 700;
  color: #fff;
  background: rgba(12, 16, 40, .75);
}

.nx-profile-page .empty-state {
  grid-column: 1 / -1;
  margin-top: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  padding: 0 0 40px 0;
  color: var(--muted);
}

.nx-profile-page .empty-title {
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  margin-bottom: 6px;
}

.nx-profile-page .empty-sub {
  font-size: 14px;
  color: var(--text-muted, var(--muted));
}

.nx-profile-page .quick:focus-visible,
.nx-profile-page .close:focus-visible,
.nx-profile-page .stat:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.nx-profile-lightbox {
  position: fixed;
  inset: 0;
  z-index: 280;
  background: rgba(8, 12, 26, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.nx-profile-lightbox[hidden] {
  display: none !important;
}

.nx-profile-lightbox-stage {
  max-width: min(1100px, 96vw);
  max-height: 88vh;
}

.nx-profile-lightbox-stage img,
.nx-profile-lightbox-stage video {
  max-width: 100%;
  max-height: 88vh;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: #0f172a;
  display: block;
}

.nx-profile-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(15, 23, 42, 0.6);
  color: #fff;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

@media (max-width: 1020px) {
  .nx-profile-page.layout,
  .nx-profile-page .layout {
    grid-template-columns: 1fr;
  }

  .nx-profile-page .sidebar {
    position: static;
  }
}

@media (max-width: 640px) {
  .nx-profile-page .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nx-profile-page .stat {
    padding: 14px 10px;
  }

  .nx-profile-page .stat b {
    font-size: 1.04rem;
  }

  .nx-profile-page .stat small {
    font-size: .64rem;
  }
}
