:root {
  --bg: #fff8ef;
  --surface: #ffffff;
  --surface-soft: #fff2de;
  --ink: #2a1b0f;
  --muted: #7b5a3f;
  --orange: #ff7a00;
  --orange-deep: #ef5e00;
  --yellow: #ffcc29;
  --line: #ffd49f;
  --shadow: 0 12px 30px rgba(255, 122, 0, 0.12);
  --shadow-soft: 0 10px 24px rgba(24, 16, 10, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: radial-gradient(circle at 20% -10%, #ffe7bf 0, var(--bg) 35%, #fff 100%);
  color: var(--ink);
}

.welcome-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: rgba(24, 15, 10, 0.52);
  padding: 1rem;
}

.welcome-gate.hidden {
  display: none;
}

.welcome-gate-card {
  width: min(640px, 100%);
  border-radius: 1rem;
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(31, 16, 6, 0.32);
  background: #fffdf9;
  padding: 1.2rem;
}

.welcome-gate-kicker {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--orange-deep);
}

.welcome-gate-card h2 {
  margin: 0.5rem 0 0.45rem;
}

.welcome-gate-card p {
  margin: 0;
  color: var(--muted);
}

.terms-card {
  display: grid;
  gap: 0.75rem;
}

.terms-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  color: var(--ink);
  font-size: 0.92rem;
}

.terms-checkbox input {
  margin-top: 0.2rem;
}

.lang-switch,
.gate-actions {
  margin-top: 0.9rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.72rem 1.1rem;
  background: linear-gradient(90deg, var(--orange-deep), var(--orange), var(--yellow));
  box-shadow: 0 10px 25px rgba(239, 94, 0, 0.28);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand h1,
.brand p {
  margin: 0;
  color: #fff;
}

.brand h1 {
  font-size: 1.1rem;
  font-weight: 800;
}

.brand p {
  font-size: 0.75rem;
  opacity: 0.9;
}

.brand-mark {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--orange-deep);
  font-weight: 800;
}

.brand-logo {
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.9);
}

.search {
  flex: 1;
  max-width: 640px;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.58rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 0.95rem;
}

.top-actions {
  position: relative;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.mobile-menu-toggle {
  display: none;
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  padding: 0.42rem;
  gap: 0.22rem;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.mobile-menu-toggle span {
  display: block;
  width: 1rem;
  height: 2px;
  border-radius: 999px;
  background: #7f3200;
}

.mobile-menu-toggle.is-open {
  background: #fff0db;
  outline: 1px solid var(--line);
}

.mobile-menu-toggle.is-open span:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}

.mobile-menu-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.is-open span:nth-child(3) {
  transform: translateY(-4px) rotate(-45deg);
}

.mobile-menu-toggle span {
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.icon-btn,
.profile-pill,
.primary-btn,
.react-btn {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.icon-btn {
  position: relative;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
}

.icon-btn[data-unread]:not([data-unread="0"])::after {
  content: attr(data-unread);
  position: absolute;
  top: -0.25rem;
  right: -0.3rem;
  min-width: 1rem;
  height: 1rem;
  border-radius: 999px;
  background: #d72600;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1rem;
  text-align: center;
  padding: 0 0.2rem;
}

.notifications-panel {
  position: absolute;
  top: 2.7rem;
  right: 0;
  width: min(320px, 92vw);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: #fffdf8;
  box-shadow: 0 16px 36px rgba(31, 16, 6, 0.28);
  padding: 0.65rem;
  z-index: 30;
}

.notifications-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.mini-link-btn {
  border: 0;
  background: transparent;
  color: #8a3500;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.notifications-list {
  max-height: 260px;
  overflow: auto;
  display: grid;
  gap: 0.35rem;
}

.notification-item {
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: #fff8ec;
  padding: 0.42rem 0.5rem;
}

.notification-item p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink);
}

.notification-item small {
  color: var(--muted);
  font-size: 0.74rem;
}

.profile-pill {
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  background: #2a1b0f;
  color: #fff;
  font-weight: 600;
}

.profile-pill.alt {
  background: #fff;
  color: #7f3200;
}

.hidden {
  display: none !important;
}

.layout {
  max-width: 1200px;
  margin: 1rem auto;
  padding: 0 1rem 1.5rem;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 270px;
  gap: 1.05rem;
}

.panel {
  position: sticky;
  top: 5.4rem;
  align-self: start;
  display: grid;
  gap: 1rem;
}

.menu {
  display: grid;
  gap: 0.45rem;
}

.menu a {
  text-decoration: none;
  color: var(--ink);
  padding: 0.65rem 0.8rem;
  border-radius: 0.7rem;
  font-weight: 600;
}

.menu a:hover,
.menu a.active {
  background: var(--surface-soft);
  color: var(--orange-deep);
}

.card {
  background: var(--surface);
  border: 1px solid #ffd9ac;
  border-radius: 1rem;
  box-shadow: var(--shadow-soft);
  min-width: 0;
}

.mini-card {
  padding: 0.95rem;
}

.mini-card h3 {
  margin: 0 0 0.4rem;
}

.mini-card p,
.mini-card li {
  color: var(--muted);
}

.mini-card ul {
  margin: 0;
  padding-left: 1.05rem;
  display: grid;
  gap: 0.35rem;
}

.feed {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.app-section {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.app-section.hidden {
  display: none;
}

.app-section.section-enter {
  animation: sectionFadeIn 220ms ease-out;
}

@keyframes sectionFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feed-loading {
  display: grid;
  gap: 0.65rem;
}

.post-skeleton {
  padding: 0.95rem;
  display: grid;
  gap: 0.55rem;
}

.skeleton-avatar {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: linear-gradient(90deg, #f8e3c5 25%, #fff4e5 37%, #f8e3c5 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s infinite;
}

.skeleton-lines {
  display: grid;
  gap: 0.3rem;
}

.skeleton-line {
  display: block;
  height: 0.58rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #f8e3c5 25%, #fff4e5 37%, #f8e3c5 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s infinite;
}

.skeleton-line.w-100 { width: 100%; }
.skeleton-line.w-95 { width: 95%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-70 { width: 70%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-35 { width: 35%; }
.skeleton-line.w-25 { width: 25%; }
.skeleton-line.w-22 { width: 22%; }

.skeleton-media {
  width: 100%;
  height: 150px;
  border-radius: 0.75rem;
  background: linear-gradient(90deg, #f8e3c5 25%, #fff4e5 37%, #f8e3c5 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.section-card {
  padding: 1.05rem;
}

.section-card h2 {
  margin: 0 0 0.35rem;
}

.section-card p {
  margin: 0;
  color: var(--muted);
}

.module-hub {
  padding: 1.05rem;
  display: grid;
  gap: 0.8rem;
}

.module-hub-head h2 {
  margin: 0;
}

.module-hub-head p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.module-hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.module-nav-btn {
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: #fff7ec;
  color: #7f3200;
  font: inherit;
  font-weight: 700;
  padding: 0.62rem 0.72rem;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.module-nav-btn:hover,
.module-nav-btn.is-active {
  border-color: #b14900;
  background: #fff1dc;
  transform: translateY(-1px);
}

.welcome-card {
  padding: 1.2rem;
}

.welcome-kicker {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--orange-deep);
}

.welcome-card h2 {
  margin: 0.42rem 0 0.48rem;
  font-size: 1.45rem;
  line-height: 1.2;
}

.welcome-card p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.welcome-actions {
  margin-top: 0.9rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.secondary-btn {
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  padding: 0.6rem 0.95rem;
  background: #fff;
  color: #7f3200;
  font-weight: 700;
}

.secondary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.secondary-btn.is-active {
  border-color: #b14900;
  background: #fff1dc;
}

.auth-status {
  margin-top: 0.75rem !important;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.profile-hero {
  overflow: visible;
}

.profile-hero-cover {
  min-height: 9.5rem;
  background-color: #eef2f6;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  cursor: pointer;
}

.profile-hero-cover.is-empty::after {
  content: "📷 Tap to add cover photo";
  position: absolute;
  left: 0.7rem;
  bottom: 0.65rem;
  font-size: 0.78rem;
  color: #6a4a1c;
  background: rgba(255, 248, 232, 0.92);
  border: 1px solid #f1cf91;
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
}

.profile-hero-body {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0 1.1rem;
  margin-top: -2.35rem;
  position: relative;
  z-index: 1;
}

.profile-hero-avatar {
  width: 5.35rem;
  height: 5.35rem;
  border-radius: 50%;
  border: 4px solid #fff;
  background: linear-gradient(180deg, #fff9ef, #ffe7bf);
  object-fit: cover;
  object-position: center;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
  flex-shrink: 0;
}

.profile-hero-avatar.is-readonly,
.profile-hero-cover.is-readonly {
  cursor: default;
}

.profile-hero-meta h3 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.2;
  color: var(--ink);
}

.profile-hero-meta p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.profile-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.85rem 1rem 1rem;
}

.profile-hero-status {
  margin: 0;
  padding: 0 1rem 0.95rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.profile-hero-status.is-success {
  color: #0f7a35;
}

.profile-hero-status.is-error {
  color: #a21e18;
}

.composer {
  padding: 1.05rem;
}

.composer.locked {
  opacity: 0.7;
}

.composer h2 {
  margin: 0 0 0.65rem;
  font-size: 1.02rem;
}

.composer textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  padding: 0.8rem;
  resize: vertical;
  min-height: 86px;
  font: inherit;
}

.composer-actions {
  margin-top: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.chips {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.chips span {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  padding: 0.35rem 0.65rem;
}

.chip-btn {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
}

.chip-btn:hover {
  border-color: var(--orange);
}

.hidden-file {
  display: none;
}

.media-preview {
  margin-top: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: #fff8ec;
  padding: 0.65rem;
}

.media-preview img,
.media-preview video {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 0.6rem;
  background: #fff;
}

.media-status {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.post-media {
  margin: 0.7rem 0;
}

.post-media img,
.post-media video {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 0.7rem;
  border: 1px solid var(--line);
  background: #fffdf8;
}

.primary-btn {
  padding: 0.6rem 0.95rem;
  border-radius: 0.7rem;
  background: linear-gradient(90deg, var(--orange-deep), var(--orange), var(--yellow));
  color: #fff;
  font-weight: 700;
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.stories {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.story-card {
  border-radius: 0.95rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, #fff, #ffefdc);
}

.story-card strong {
  display: block;
}

.story-card small {
  color: var(--muted);
}

.for-you-card {
  padding: 0.95rem 1rem;
}

.for-you-head h2 {
  margin: 0;
}

.for-you-head p {
  margin: 0.3rem 0 0.65rem;
  color: var(--muted);
}

.for-you-list {
  display: grid;
  gap: 0.5rem;
}

.for-you-item {
  border: 1px solid #ffdcb2;
  border-radius: 0.75rem;
  background: #fffaf2;
  padding: 0.55rem 0.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.for-you-item strong {
  display: block;
  font-size: 0.9rem;
}

.for-you-item p {
  margin: 0.18rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.for-you-action {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #7f3200;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
}

.for-you-action.following {
  background: #2a1b0f;
  color: #fff;
  border-color: #2a1b0f;
}

.post-list {
  display: grid;
  gap: 0.75rem;
}

.post {
  padding: 0.95rem 1rem 0.9rem;
  border-radius: 1.05rem;
}

.post header {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 0.58rem;
  min-width: 0;
}

.post-author-link,
.comment-author-link,
.reply-author-link {
  cursor: pointer;
}

.post-author-link:focus-visible,
.comment-author-link:focus-visible,
.reply-author-link:focus-visible {
  outline: 2px solid #ff8a1f;
  outline-offset: 2px;
  border-radius: 0.5rem;
}

.post-avatar {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  border: 1px solid #ffc682;
  background: linear-gradient(140deg, #ff9f3b, #ff7a00);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  flex: 0 0 auto;
}

.post-avatar.has-image {
  background: #fff;
  border-color: #ffb970;
}

.post-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.post-meta {
  min-width: 0;
}

.post h3 {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.2;
}

.post header p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.post > p {
  margin: 0.62rem 0 0;
  line-height: 1.5;
  color: #3b2b1d;
}

.post footer {
  margin-top: 0.6rem;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  border-top: 1px solid #ffe2bf;
  padding-top: 0.55rem;
}

.react-btn {
  border-radius: 999px;
  padding: 0.42rem 0.72rem;
  background: #fff6e8;
  color: #5a3a20;
  border: 1px solid var(--line);
  font-weight: 600;
}

.react-btn:hover {
  border-color: var(--orange);
}

.react-btn.is-active {
  border-color: #ef5e00;
  background: #ffe0c2;
  color: #8a3500;
}

.react-btn.like-pop {
  animation: likePop 180ms ease-out;
}

@keyframes likePop {
  0% { transform: scale(1); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.unsupported-media {
  margin-top: 0.7rem;
  border: 1px dashed #ffb45f;
  border-radius: 0.7rem;
  background: #fff8ed;
  padding: 0.65rem;
  color: #7b4b1f;
  font-size: 0.9rem;
}

.unsupported-media a {
  color: #b14900;
  font-weight: 700;
}

.suggested-profiles {
  display: grid;
  gap: 0.5rem;
}

.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: #fffaf3;
}

.profile-meta strong {
  display: block;
  font-size: 0.9rem;
}

.profile-meta small {
  color: var(--muted);
}

.follow-btn {
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: #fff;
  color: #7f3200;
  padding: 0.35rem 0.65rem;
  font-weight: 700;
  cursor: pointer;
}

.follow-btn.following {
  background: #2a1b0f;
  color: #fff;
  border-color: #2a1b0f;
}

.message-threads {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.6rem;
  max-height: 220px;
  overflow: auto;
}

.reels-grid,
.gallery-grid,
.marketplace-list {
  display: grid;
  gap: 0.75rem;
}

.module-loading {
  display: grid;
  gap: 0.7rem;
}

.module-skeleton {
  padding: 0.85rem;
  display: grid;
  gap: 0.55rem;
}

.reel-card,
.gallery-card,
.marketplace-card {
  padding: 0.95rem;
  border-radius: 1rem;
}

.reel-meta {
  margin-bottom: 0.55rem;
}

.reel-meta h3,
.reel-meta p {
  margin: 0;
}

.reel-meta p {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.reel-card video,
.gallery-card img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 0.75rem;
  border: 1px solid var(--line);
  background: #fffaf1;
}

.reel-actions {
  margin-top: 0.55rem;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.gallery-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.marketplace-meta {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.marketplace-owner-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.marketplace-inquiry-item h4 {
  margin: 0 0 0.35rem;
}

.marketplace-inquiry-actions {
  margin-top: 0.45rem;
  display: flex;
  justify-content: flex-end;
}

.marketplace-create-card h3 {
  margin: 0 0 0.55rem;
}

.marketplace-filters-card h3 {
  margin: 0 0 0.55rem;
}

.marketplace-filter-grid {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

.marketplace-filter-grid label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.marketplace-create-grid {
  display: grid;
  gap: 0.55rem;
}

.marketplace-create-grid input,
.marketplace-create-grid textarea,
.marketplace-create-grid select,
.marketplace-filter-grid input,
.marketplace-filter-grid select {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.55rem 0.7rem;
  font: inherit;
  background: #fff;
  color: var(--text);
}

.marketplace-create-grid textarea {
  resize: vertical;
  min-height: 90px;
}

.marketplace-media-preview {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}

.marketplace-preview-item {
  display: grid;
  gap: 0.3rem;
}

.marketplace-preview-controls {
  display: flex;
  gap: 0.25rem;
  justify-content: center;
}

.mini-btn {
  padding: 0.28rem 0.45rem;
  font-size: 0.76rem;
}

.marketplace-media-preview img,
.marketplace-media-preview video,
.marketplace-listing-media img,
.marketplace-listing-media video {
  width: 100%;
  border-radius: 0.7rem;
  border: 1px solid var(--line);
  background: #fffaf1;
}

.marketplace-media-preview img,
.marketplace-listing-media img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.marketplace-media-preview video,
.marketplace-listing-media video {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.marketplace-listing-media {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.marketplace-listing-carousel {
  position: relative;
}

.marketplace-carousel-image {
  width: 100%;
  cursor: zoom-in;
}

.marketplace-carousel-prev,
.marketplace-carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
}

.marketplace-carousel-prev {
  left: 0.45rem;
}

.marketplace-carousel-next {
  right: 0.45rem;
}

.marketplace-carousel-count {
  position: absolute;
  right: 0.45rem;
  bottom: 0.45rem;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border-radius: 0.5rem;
  padding: 0.15rem 0.4rem;
  font-size: 0.74rem;
  line-height: 1.2;
}

.marketplace-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0, 0, 0, 0.88);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.marketplace-lightbox-content {
  position: relative;
  width: min(92vw, 1200px);
  max-height: 92vh;
  display: grid;
  gap: 0.45rem;
  justify-items: center;
}

.marketplace-lightbox-content img {
  width: 100%;
  max-height: calc(92vh - 44px);
  object-fit: contain;
  border-radius: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: #111;
  transform-origin: center center;
  transition: transform 0.12s ease-out;
  touch-action: none;
  cursor: zoom-in;
}

.marketplace-lightbox-content img.is-zoomed {
  cursor: zoom-out;
}

.marketplace-lightbox-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.marketplace-lightbox-controls .secondary-btn {
  pointer-events: auto;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.marketplace-lightbox-controls #marketplaceLightboxPrev {
  left: 0.6rem;
}

.marketplace-lightbox-controls #marketplaceLightboxNext {
  right: 0.6rem;
}

.marketplace-lightbox-close {
  position: absolute;
  right: 0.5rem;
  top: 0.5rem;
}

.marketplace-lightbox-count {
  color: #fff;
  font-size: 0.84rem;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 0.5rem;
  padding: 0.2rem 0.5rem;
}

.settings-grid {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-item {
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 0.75rem;
  background: #fffaf3;
}

.settings-item h3 {
  margin: 0 0 0.25rem;
}

.settings-item p {
  margin: 0 0 0.55rem;
}

.settings-meta {
  font-size: 0.84rem;
  color: var(--muted);
}

.settings-profile-editor {
  display: grid;
  gap: 0.5rem;
}

.settings-profile-editor label {
  display: grid;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.settings-profile-editor input,
.settings-profile-editor textarea {
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  padding: 0.4rem 0.55rem;
  font: inherit;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 0.7rem;
  background: #fffaf3;
  padding: 0.75rem;
  color: var(--muted);
}

.mobile-menu-sheet {
  display: none;
}

.mobile-menu-backdrop {
  display: none;
}

.mobile-menu-links {
  display: grid;
  gap: 0.45rem;
}

.mobile-bottom-nav {
  display: none;
}

.mobile-menu-link {
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: #fff;
  color: #7f3200;
  font-weight: 700;
  font-size: 0.9rem;
  text-align: left;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
}

.mobile-menu-link.is-active {
  border-color: #b14900;
  background: #fff1dc;
}

.mobile-menu-auth {
  display: none;
}

.thread-item {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.5rem;
  background: #fffaf3;
}

.thread-item strong {
  display: block;
  font-size: 0.9rem;
}

.thread-item p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.comment-panel {
  margin-top: 0.7rem;
  border-top: 1px solid var(--line);
  padding-top: 0.65rem;
}

.comment-list {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.6rem;
}

.comment-row {
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: #fff9f0;
  padding: 0.45rem 0.6rem;
}

.comment-row strong {
  display: block;
  font-size: 0.85rem;
}

.comment-row p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.mention-link {
  border: 0;
  background: transparent;
  color: #2f5aa8;
  font-weight: 700;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
}

.mention-link:hover {
  text-decoration: underline;
}

.comment-actions {
  margin-top: 0.35rem;
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.comment-delete-btn {
  font-size: 0.75rem;
  padding: 0.25rem 0.45rem;
}

.comment-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.comment-composer {
  display: flex;
  gap: 0.45rem;
}

.comment-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  padding: 0.42rem 0.56rem;
  font: inherit;
}

.message-composer {
  display: flex;
  gap: 0.45rem;
}

.message-composer input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  padding: 0.45rem 0.6rem;
  font: inherit;
}

.message-peer {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}

.message-peer input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  padding: 0.45rem 0.6rem;
  font: inherit;
}

.profile-avatar-preview {
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  object-fit: cover;
  background: #fff9ef;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.profile-avatar-preview.is-empty {
  background: linear-gradient(180deg, #fff9ef, #ffe7bf);
}

.profile-avatar-preview:focus-visible,
.profile-cover-preview:focus-visible {
  outline: 2px solid #ff8a1f;
  outline-offset: 2px;
}

.profile-avatar-preview:hover,
.profile-cover-preview:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.profile-cover-preview {
  width: 100%;
  min-height: 7rem;
  border-radius: 0.7rem;
  border: 1px solid var(--line);
  background-color: #f6f7f9;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  cursor: pointer;
  position: relative;
}

.profile-cover-preview.is-empty::after {
  content: "📷 Tap to add cover photo";
  position: absolute;
  left: 0.75rem;
  bottom: 0.6rem;
  font-size: 0.78rem;
  color: #6a4a1c;
  background: rgba(255, 248, 232, 0.9);
  border: 1px solid #f1cf91;
  border-radius: 999px;
  padding: 0.18rem 0.48rem;
}

.profile-media-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.profile-editor {
  display: grid;
  gap: 0.5rem;
}

.profile-editor label {
  display: grid;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.profile-editor input,
.profile-editor textarea {
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  padding: 0.4rem 0.55rem;
  font: inherit;
}

.post-actions {
  display: flex;
  gap: 0.35rem;
}

.post-follow-btn {
  font-size: 0.76rem;
  padding: 0.28rem 0.5rem;
}

.post-action-btn {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: #fff6ea;
  color: #8c3e04;
  font-size: 0.78rem;
  padding: 0.28rem 0.5rem;
  cursor: pointer;
}

.reply-list {
  margin-top: 0.35rem;
  display: grid;
  gap: 0.35rem;
}

.reply-row {
  border-left: 2px solid var(--line);
  padding-left: 0.45rem;
}

.reply-composer {
  margin-top: 0.35rem;
  display: flex;
  gap: 0.35rem;
}

.reply-composer input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.35rem 0.45rem;
  font: inherit;
}

@media (max-width: 1080px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .panel {
    position: static;
  }

  .stories {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .module-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .topbar {
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    gap: 0.45rem;
    padding: 0.5rem 0.65rem;
  }

  .brand {
    gap: 0.45rem;
  }

  .brand-mark {
    width: 1.9rem;
    height: 1.9rem;
  }

  .brand h1 {
    font-size: 0.98rem;
  }

  .brand p {
    font-size: 0.68rem;
  }

  .top-actions {
    gap: 0.35rem;
  }

  .icon-btn,
  .mobile-menu-toggle {
    width: 2rem;
    height: 2rem;
  }

  .profile-pill {
    padding: 0.4rem 0.62rem;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .profile-avatar-preview {
    width: 3.6rem;
    height: 3.6rem;
  }

  .profile-cover-preview {
    min-height: 6rem;
  }

  @media (prefers-reduced-motion: reduce) {
    .app-section.section-enter,
    .skeleton-avatar,
    .skeleton-line,
    .skeleton-media {
      animation: none;
    }
  }

  .search {
    order: 3;
    width: 100%;
    padding: 0.45rem 0.6rem;
    gap: 0.45rem;
  }

  .search input {
    font-size: 0.9rem;
  }

  .stories {
    display: flex;
    overflow-x: auto;
    gap: 0.55rem;
    padding-bottom: 0.15rem;
    scroll-snap-type: x mandatory;
  }

  .story-card {
    min-width: min(52vw, 210px);
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .marketplace-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-hub-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .composer-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .post footer {
    position: sticky;
    bottom: 0.35rem;
    z-index: 1;
    background: #fffdf8;
    border: 1px solid #ffe6c8;
    border-radius: 999px;
    padding: 0.38rem 0.4rem;
    justify-content: space-between;
  }

  .post footer .react-btn {
    flex: 1;
    justify-content: center;
    display: inline-flex;
    align-items: center;
  }

  .right-panel {
    display: none;
  }

  .left-panel {
    display: none;
  }

  .layout {
    margin: 0;
    padding: 0.75rem 0.5rem 5.8rem;
  }

  .profile-hero-cover {
    min-height: 8.2rem;
  }

  .profile-hero-body {
    margin-top: -2.45rem;
  }

  .profile-hero-avatar {
    width: 5rem;
    height: 5rem;
  }

  .mobile-menu-toggle {
    display: inline-flex;
  }

  .top-actions .profile-pill {
    display: none !important;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 0.65rem;
    right: 0.65rem;
    bottom: calc(env(safe-area-inset-bottom) + 0.45rem);
    z-index: 55;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.35rem;
    padding: 0.42rem;
    border: 1px solid #ffd8ac;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 12px 28px rgba(31, 16, 6, 0.2);
    backdrop-filter: blur(8px);
  }

  .mobile-tab-btn {
    border: 0;
    background: transparent;
    border-radius: 999px;
    min-height: 2.15rem;
    color: #784118;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .mobile-tab-btn.is-active {
    background: #e8f2ff;
    color: #1d62d8;
  }

  .mobile-menu-sheet {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 42;
    width: min(84vw, 320px);
    padding: calc(4.1rem + env(safe-area-inset-top)) 0.6rem
      calc(0.8rem + env(safe-area-inset-bottom));
    background: rgba(255, 248, 239, 0.98);
    border-right: 1px solid var(--line);
    box-shadow: 24px 0 48px rgba(20, 10, 4, 0.34);
    backdrop-filter: blur(8px);
    display: block;
    transform: translateX(-105%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
  }

  .mobile-menu-auth {
    margin-top: 0.9rem;
    display: grid;
    gap: 0.45rem;
  }

  .mobile-menu-auth .secondary-btn {
    width: 100%;
    text-align: center;
  }

  .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 41;
    border: 0;
    margin: 0;
    padding: 0;
    background: rgba(18, 10, 5, 0.68);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
    display: block;
  }

  .mobile-menu-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu-sheet.is-open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .notifications-panel {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 0.65rem);
    left: 0.5rem;
    right: 0.5rem;
    width: auto;
    max-width: none;
    max-height: min(72vh, 460px);
    overflow: hidden;
    z-index: 60;
  }

  .notifications-list {
    max-height: min(58vh, 360px);
  }

  #communicationsSection .message-peer,
  #communicationsSection .message-composer {
    flex-direction: column;
    align-items: stretch;
  }

  #communicationsSection .message-threads {
    max-height: 52vh;
    overflow: auto;
    padding-bottom: 0.25rem;
  }

  #communicationsSection .message-composer {
    position: sticky;
    bottom: calc(env(safe-area-inset-bottom) + 0.4rem);
    z-index: 3;
    margin-top: 0.6rem;
    background: #fffdf8;
    border: 1px solid #ffe1ba;
    border-radius: 0.8rem;
    padding: 0.45rem;
    box-shadow: 0 8px 18px rgba(31, 16, 6, 0.12);
  }

  body.mobile-menu-open {
    overflow: hidden;
  }

  .reels-grid {
    gap: 0.5rem;
    scroll-snap-type: y mandatory;
  }

  .reel-card {
    min-height: 78vh;
    scroll-snap-align: start;
  }

  .reel-card video {
    max-height: 62vh;
    object-fit: cover;
  }
}

@media (max-width: 420px) {
  .brand p {
    display: none;
  }

  #signupBtn {
    display: none !important;
  }

  .profile-pill {
    padding: 0.36rem 0.52rem;
    font-size: 0.78rem;
  }

  .layout {
    padding: 0.55rem 0.4rem 0.9rem;
  }

  .profile-avatar-preview {
    width: 3.1rem;
    height: 3.1rem;
  }

  .profile-cover-preview {
    min-height: 5.25rem;
  }
}

@media (max-width: 360px) {
  #loginBtn {
    width: 2rem;
    height: 2rem;
    padding: 0;
    border-radius: 50%;
    font-size: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  #loginBtn::before {
    content: "🔐";
    font-size: 0.95rem;
    line-height: 1;
  }
}
