: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);
}

#welcomeGate .welcome-gate-card,
#termsGate .welcome-gate-card {
  box-sizing: border-box;
  max-height: 100%;
  min-height: 0;
  overflow: auto;
}

.welcome-brand-logo {
  display: block;
  width: min(100%, 22rem);
  height: auto;
  max-height: 32vh;
  margin: 0 auto 0.9rem;
  border-radius: 0.75rem;
  object-fit: contain;
  background: #000;
}

.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;
}

.registration-details:not([hidden]) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 0.5rem;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
}

.registration-details p {
  grid-column: 1 / -1;
}

.registration-details label {
  display: grid;
  gap: 0.2rem;
}

.registration-details input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  padding: 0.45rem;
  font: inherit;
}

.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;
  text-decoration: none;
}

.brand:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.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,
.mobile-tab-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;
}

.mobile-tab-btn[data-unread] {
  position: relative;
}

.notifications-panel {
  position: absolute;
  display: flex;
  flex-direction: column;
  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;
  flex: none;
  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;
  min-height: 0;
  flex: 0 1 auto;
  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;
  text-align: left;
}

.notification-item p,
.notification-item span {
  display: block;
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink);
}

.notification-item small {
  color: var(--muted);
  font-size: 0.74rem;
}

button.notification-item {
  cursor: pointer;
}

button.notification-item:hover,
button.notification-item:focus-visible {
  border-color: #8a3500;
}

.notification-unread {
  border-left: 3px solid #8a3500;
}

.notification-device {
  display: grid;
  flex: none;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.notification-device summary {
  cursor: pointer;
  color: #8a3500;
  font-weight: 700;
}

.notification-device ol {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
}

.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;
}

.right-panel {
  position: static;
}

.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;
}

@media (min-width: 701px) and (any-pointer: fine) and (any-hover: hover) {
  body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  .topbar {
    flex: none;
  }

  .layout {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
  }

  .layout > .panel,
  .feed > .app-section {
    min-height: 0;
    align-content: start;
    overflow: auto;
    overscroll-behavior-y: contain;
  }

  .layout > .panel {
    position: static;
    align-self: stretch;
  }

  .feed {
    grid-template-rows: minmax(0, 1fr);
    min-height: 0;
  }
}

.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 {
  min-width: 0;
  padding-top: 2.85rem;
}

.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;
}

#homeProfileBio {
  width: fit-content;
  max-width: calc(100% - 2.2rem);
  margin: 0.65rem 1.1rem;
  color: #a43800;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (forced-colors: none) {
  @supports (background-clip: text) {
    #homeProfileBio {
      background-image: linear-gradient(90deg, #a43800 30%, #815900);
      background-clip: text;
      color: transparent;
    }
  }
}

.profile-hero-bio-form {
  display: grid;
  gap: 0.45rem;
  padding: 0.75rem 1rem;
}

.profile-hero-bio-form textarea {
  min-width: 0;
  font: inherit;
  resize: vertical;
}

.profile-hero-stats {
  margin-top: 0.45rem;
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  color: #3b311f;
  font-size: 0.86rem;
}

.profile-hero-stats strong {
  font-size: 0.95rem;
}

.profile-hero-stats button {
  border: 0;
  padding: 0.3rem 0;
  background: none;
  color: inherit;
  font: inherit;
}

.profile-hero-stats button:enabled {
  color: #853401;
  text-decoration: underline;
  cursor: pointer;
}

.profile-follow-dialog {
  width: min(30rem, calc(100% - 2rem));
  max-height: 80dvh;
  padding: 1rem;
}

.profile-follow-dialog::backdrop {
  background: rgba(24, 15, 10, 0.52);
}

.profile-follow-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.profile-follow-header h2 {
  margin: 0;
}

#profileFollowList {
  list-style: none;
  padding: 0;
}

#profileFollowList button {
  text-align: left;
  overflow-wrap: anywhere;
}

.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 {
  scroll-margin-top: 6rem;
  padding: 0.65rem;
}

.composer-toggle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.25rem 0.5rem;
  border: 0;
  border-radius: 1rem;
  background: var(--surface-soft);
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.composer-toggle .story-avatar {
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
}

#composerFields:not([hidden]) { margin-top: 0.65rem; }
#closeComposerBtn { margin-top: 0.5rem; }

.mobile-create-dialog {
  width: min(26rem, calc(100% - 2rem));
  margin: auto auto max(4.75rem, calc(env(safe-area-inset-bottom) + 4rem));
  padding: 1rem;
}

.mobile-create-dialog[open] {
  display: grid;
  gap: 0.65rem;
}

.mobile-create-dialog h2 {
  margin: 0;
  font-size: 1rem;
}

.mobile-create-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.mobile-create-dialog button {
  min-height: 44px;
}

.report-shield {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}

#communityReportForm {
  display: grid;
  gap: 0.5rem;
}

#communityReportDetails {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  font: inherit;
}

.community-report-details {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-moderation-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.discussion-status:empty {
  display: none;
}

.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;
}

.upload-cancel {
  margin-block: 0.45rem;
  justify-self: start;
  min-height: 44px;
}

.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;
}

.post-photo-carousel {
  min-width: 0;
  width: 100%;
}

.post-photo-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.post-photo-track > img {
  box-sizing: border-box;
  flex: 0 0 100%;
  min-width: 0;
  scroll-snap-align: start;
  object-fit: contain;
}

.post-photo-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.post-photo-controls button[aria-disabled="true"] {
  opacity: 0.5;
  cursor: default;
}

.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 { min-width: 0; }
.stories-heading { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.stories-heading h2 { margin: 0; font-size: 0.95rem; }
.story-arrows { display: flex; gap: 0.3rem; }
.stories-track {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 0.45rem 0.25rem;
}
.story-circle {
  display: grid;
  place-items: center;
  gap: 0.3rem;
  flex: 0 0 5rem;
  width: 5rem;
  padding: 0.2rem;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: center;
  font: inherit;
  font-size: 0.76rem;
  cursor: pointer;
  scroll-snap-align: start;
}
.story-circle > span:last-child {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.story-avatar {
  box-sizing: border-box;
  position: relative;
  width: 3.65rem;
  height: 3.65rem;
  display: grid;
  place-items: center;
  border: 3px solid transparent;
  border-radius: 50%;
  background: var(--surface-soft);
  color: inherit;
}
.story-avatar.is-new { border-color: #db5a20; }
.story-avatar.is-seen { border-color: #9a8d83; }
.story-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.story-plus {
  position: absolute;
  right: -0.15rem;
  bottom: -0.1rem;
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: #a94218;
  color: white;
  font-size: 1rem;
  font-weight: bold;
}
#storiesStatus:empty, #storyViewerStatus:empty { display: none; }
#storyCreateForm { display: grid; gap: 0.6rem; }
#storyFile { width: 100%; }
#storyViewer {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  overflow: hidden;
  margin: 0;
  padding: max(0.75rem, env(safe-area-inset-top)) 0.75rem max(0.75rem, env(safe-area-inset-bottom));
  border: 0;
  background: #181412;
  color: white;
}
#storyViewer[open] { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto auto; gap: 0.55rem; }
#storyViewer header, #storyViewer footer { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
#storyFire { min-width: 44px; min-height: 44px; font-size: 1.25rem; touch-action: manipulation; }
#storyFire.has-fire { background: #8d330d; border-color: #fa8c42; color: white; }
#storyFireFeedback { margin-inline-end: auto; font-size: 0.9rem; }
.story-fire-flame, .story-fire-glow { position: absolute; pointer-events: none; }
.story-fire-flame {
  z-index: 2;
  bottom: 0.4rem;
  inset-inline-start: 0.65rem;
  font-size: 1.65rem;
  line-height: 1;
  animation: story-fire-rise 800ms ease-out both;
}
.story-fire-flame.has-sparks {
  inset-inline-start: 1.4rem;
  text-shadow: -0.75rem 0.48rem 0.4rem #ff7200;
}
.story-fire-flame.has-sparks::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0.4rem;
  width: 0.2rem;
  height: 0.2rem;
  border-radius: 50%;
  background: #ffd18a;
  box-shadow: 1.7rem 0.25rem #ff963d, 2.15rem -0.5rem #ffb360, -0.5rem 1rem #ff963d;
}
.story-fire-glow {
  z-index: 1;
  inset: 0;
  border-radius: 0.75rem;
  box-shadow: inset 0 0 1.25rem #b84d2370;
  animation: story-fire-glow 750ms ease-out both;
}
@keyframes story-fire-rise {
  from { opacity: 0; transform: translateY(0) scale(0.7); }
  20% { opacity: 1; }
  to { opacity: 0; transform: translate(0.9rem, min(-3rem, -22dvh)) scale(1.05); }
}
@keyframes story-fire-glow {
  from, to { opacity: 0; }
  30% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .story-fire-flame, .story-fire-glow { display: none; }
}
#storyProgress { width: 100%; accent-color: #fa8c42; }
#storyMedia {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
}
#storyMedia img, #storyMedia video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
#storyViewerStatus { margin: 0; text-align: center; }

.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-view-count,
.post > .post-popular-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid #e7c4a4;
  border-radius: 999px;
  background: #fff3e4;
  color: #693a17;
  font-size: 0.75rem;
  font-weight: 650;
  white-space: nowrap;
}

.post-view-count.hidden,
.post > .post-popular-badge.hidden {
  display: none;
}

.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 {
  min-width: 0;
}

.suggested-profile-link {
  display: block;
  border: 0;
  background: none;
  padding: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.suggested-profile-link:hover {
  text-decoration: underline;
}

.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;
}

.reels-grid.has-reels {
  height: clamp(14rem, calc(100vh - 10rem), 46rem);
  height: clamp(14rem, calc(100dvh - 10rem), 46rem);
  grid-auto-rows: 100%;
  gap: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory;
  touch-action: pan-y;
}

.reels-grid.has-reels > .reel-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.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 video,
.gallery-card img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 0.75rem;
  border: 1px solid var(--line);
  background: #fffaf1;
}

.reels-grid.has-reels .reel-card video {
  height: 100%;
  max-height: none;
  min-height: 0;
  object-fit: contain;
  background: #211811;
  pointer-events: none;
}

.post-video-preview,
.reel-surface {
  position: relative;
  min-height: 0;
}

.post-video-preview {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #211811;
  border-radius: 0.75rem;
  cursor: pointer;
}

.post-video-preview video {
  display: block;
  aspect-ratio: 16 / 9;
  background: #211811;
  pointer-events: none;
}

.post-video-preview span,
.reel-media-error {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  padding: 0.55rem 0.85rem;
  border-radius: 0.7rem;
  color: white;
  background: #211811;
  pointer-events: none;
}

.reel-expand {
  position: absolute;
  inset: 0;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  cursor: pointer;
  touch-action: pan-y;
}

html.reel-viewer-open,
html.reel-viewer-open body {
  overflow: hidden;
}

.reel-viewer {
  width: min(44rem, 100%);
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: auto;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: #211811;
}

.reel-viewer.is-expanded {
  position: fixed;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
}

.reel-viewer.is-expanded .reel-viewer-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  justify-content: flex-end;
  padding-right: max(0.75rem, env(safe-area-inset-right));
  padding-left: max(0.75rem, env(safe-area-inset-left));
  background: linear-gradient(rgb(0 0 0 / 70%), transparent);
  pointer-events: none;
}

.reel-viewer.is-expanded .reel-viewer-header button {
  pointer-events: auto;
}

.reel-viewer.is-expanded .reel-viewer-header span,
.reel-viewer.is-expanded .reel-viewer-header strong,
.reel-viewer.is-expanded .reel-meta,
.reel-viewer.is-expanded .reel-open-btn {
  display: none;
}

.reel-viewer.is-expanded .reel-card {
  position: relative;
  grid-template-rows: minmax(0, 1fr);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #000;
}

.reel-viewer.is-expanded .reel-surface video {
  display: block;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  background: #000;
}

@media (orientation: portrait) and (max-width: 600px) {
  .reel-viewer.is-expanded .reel-surface video.is-portrait {
    object-fit: cover;
  }
}

.reel-viewer.is-expanded .reel-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: min(10rem, 55%);
  background: linear-gradient(transparent, rgb(0 0 0 / 85%));
  pointer-events: none;
}

.reel-viewer.is-expanded .reel-actions {
  position: absolute;
  z-index: 1;
  inset: auto 0 0;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0.5rem max(0.5rem, env(safe-area-inset-right)) 0.5rem max(0.5rem, env(safe-area-inset-left));
  overflow-wrap: anywhere;
  pointer-events: none;
}

.reel-viewer.is-expanded .reel-actions button {
  min-height: 2.5rem;
  padding-inline: 0.45rem;
  font-size: 0.75rem;
  line-height: 1.1;
  background: rgb(25 25 25 / 88%);
  border-color: rgb(255 255 255 / 35%);
  color: #fff;
  pointer-events: auto;
}

.reel-viewer.is-expanded .reel-actions .reel-comment-btn {
  padding-right: 1.6rem;
}

.reel-viewer.is-expanded .reel-actions button.is-active {
  background: #942f12;
}

.reel-viewer.is-expanded .reel-viewer-frame {
  grid-template-rows: minmax(0, 1fr) auto;
  background: #101010;
}

.reel-viewer-frame {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  background: #211811;
}

.reel-viewer-frame:fullscreen {
  width: 100%;
  height: 100%;
}

.reel-viewer-status {
  position: absolute;
  z-index: 2;
  inset: max(3.5rem, calc(env(safe-area-inset-top) + 3rem)) 1rem auto;
  width: min(26rem, calc(100% - 2rem));
  box-sizing: border-box;
  margin: 0 auto;
  padding: 0.55rem 0.8rem;
  border-radius: 0.65rem;
  color: #fff;
  background: rgb(20 20 20 / 92%);
  font-size: 0.85rem;
  pointer-events: none;
}

.reel-comments-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgb(0 0 0 / 45%);
}

.reel-comments {
  box-sizing: border-box;
  width: min(44rem, 100%);
  max-height: min(75%, var(--reel-comments-visible-height, 100%));
  margin-bottom: var(--reel-comments-bottom, 0px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 0.5rem;
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: 1rem 1rem 0 0;
  padding: 0.75rem max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
  background: #fffdf9;
}

.reel-comments header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.reel-comments h2 {
  font-size: 1.1rem;
  margin: 0;
}

.reel-comments-thread {
  grid-row: 2;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#reelCommentsStatus {
  grid-row: 3;
  overflow-wrap: anywhere;
}

.reel-comments .comment-composer {
  grid-row: 4;
}

.reel-comments input {
  min-width: 0;
  font-size: max(16px, 1rem);
}

.reel-viewer-toolbar,
.reel-viewer-volume {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.reel-viewer-toolbar {
  justify-content: space-between;
  padding: 0.4rem max(0.65rem, env(safe-area-inset-right)) max(0.4rem, env(safe-area-inset-bottom)) max(0.65rem, env(safe-area-inset-left));
  color: #fff;
}

.reel-viewer-volume {
  flex: 1;
  min-width: 0;
}

.reel-viewer-volume input {
  width: min(100%, 10rem);
  min-width: 0;
  accent-color: #ff9f43;
}

#reelViewerFullscreen {
  flex: none;
}

@media (orientation: landscape) and (max-height: 500px) {
  .reel-viewer.is-expanded .reel-viewer-frame {
    grid-template-rows: minmax(0, 1fr);
  }

  .reel-viewer.is-expanded .reel-viewer-toolbar {
    position: absolute;
    z-index: 1;
    inset: auto 0 0;
    padding-bottom: calc(0.4rem + env(safe-area-inset-bottom));
    pointer-events: none;
  }

  .reel-viewer.is-expanded .reel-viewer-toolbar input,
  .reel-viewer.is-expanded .reel-viewer-toolbar button {
    pointer-events: auto;
  }

  .reel-viewer.is-expanded .reel-actions {
    bottom: calc(3.1rem + env(safe-area-inset-bottom));
  }

  .reel-viewer.is-expanded .reel-card::after {
    height: min(9rem, 55%);
  }
}

.reel-viewer::backdrop {
  background: rgba(0, 0, 0, 0.85);
}

.reel-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: max(0.5rem, env(safe-area-inset-top)) 0.75rem 0.5rem;
  color: #fff;
}

.reel-viewer .reels-grid.has-reels {
  height: 100%;
}

.reel-viewer .reel-card {
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
}

.reel-actions {
  margin-top: 0.55rem;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.reel-comment-btn {
  position: relative;
  min-width: 2.8rem;
  min-height: 2.25rem;
  padding-right: 1.6rem;
}

.reel-comment-count {
  position: absolute;
  top: 0.12rem;
  right: 0.16rem;
  box-sizing: border-box;
  min-width: 1.1rem;
  padding: 0 0.2rem;
  border-radius: 999px;
  background: #942f12;
  color: #fff;
  font-size: 0.75rem;
  line-height: 1.1rem;
  text-align: center;
  pointer-events: none;
}

.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-support-link {
  display: inline-block;
  margin-top: 0.5rem;
  text-decoration: none;
}

.settings-support-link:hover {
  text-decoration: underline;
}

.settings-meta {
  font-size: 0.84rem;
  color: var(--muted);
}

.settings-profile-editor {
  display: grid;
  gap: 0.5rem;
}

#settingsMfaSetup {
  grid-template-columns: minmax(0, 1fr);
  overflow-wrap: anywhere;
}

#settingsMfaQr {
  width: 100%;
  max-width: 16rem;
  height: auto;
  image-rendering: pixelated;
}

#settingsMfaVerification {
  min-width: 0;
}


#adminDashboardCard {
  grid-column: 1 / -1;
  min-width: 0;
}

.admin-dashboard-header,
.admin-dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.admin-dashboard-header {
  justify-content: space-between;
}

.admin-dashboard-header h3,
.admin-dashboard-header h4 {
  margin: 0;
}

.admin-dashboard-badge {
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  background: var(--surface-soft);
  color: #7f3200;
  font-size: 0.8rem;
  font-weight: 700;
}

.admin-dashboard-section {
  margin-top: 0.75rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface);
}

.admin-dashboard-section summary {
  cursor: pointer;
  font-weight: 700;
}

.admin-dashboard-section[open] summary {
  margin-bottom: 0.65rem;
}

.admin-dashboard-section #adminMetricsStatus {
  margin: 0.55rem 0 0;
}

#adminAccountsStatus:empty {
  margin: 0;
}

#adminAccountsList:empty {
  display: none;
}

#adminAccountsList {
  list-style: none;
  margin: 0.65rem 0 0;
  padding: 0;
  overflow-wrap: anywhere;
}

#adminAccountsList li {
  border-top: 1px solid var(--line);
  padding: 0.55rem 0;
}

.admin-dashboard-notice,
#adminCampaignPreview {
  padding: 0.65rem;
  border-radius: 0.55rem;
  background: var(--surface-soft);
}

#adminCampaignPreview {
  margin-top: 0.65rem;
  overflow-wrap: anywhere;
}

#adminCampaignSubject {
  margin: 0 0 0.35rem;
}

#adminCampaignBody {
  margin: 0;
  white-space: pre-wrap;
}

.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.admin-metric {
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  padding: 0.5rem 0.6rem;
  background: #fff9f0;
}

.admin-metric strong {
  display: block;
  font-size: 1.35rem;
}

.admin-metric small {
  color: var(--muted);
}

.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;
  overflow-wrap: anywhere;
}

.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 {
  position: relative;
}

.post-actions > summary {
  display: grid;
  place-items: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  font-size: 1.25rem;
  list-style: none;
}

.post-actions > summary::-webkit-details-marker {
  display: none;
}

.post-action-options {
  position: absolute;
  z-index: 2;
  inset-inline-end: 0;
  display: grid;
  gap: 0.3rem;
  min-width: 6rem;
  padding: 0.35rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
}

.post-official-badge {
  color: #8c3e04;
  font-weight: 700;
  font-size: 0.82rem;
}

.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;
  }

  .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;
  }

  .story-arrows { display: none; }
  .composer:not(.composer-open), .composer-toggle { display: none; }

  .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: auto;
    z-index: 60;
  }

  .notifications-list {
    max-height: min(58vh, 360px);
  }



  body.mobile-menu-open {
    overflow: hidden;
  }

  .reels-grid.has-reels {
    height: clamp(14rem, calc(100vh - 15rem), 46rem);
    height: clamp(14rem, calc(100dvh - 15rem), 46rem);
  }
}

@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;
  }
}

#chatMemberSelect {
  width: 100%;
  min-width: 0;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  color: inherit;
  background: #fffaf3;
  font: inherit;
}

#chatMemberPicker {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 0.5rem;
}

#chatMemberSearch,
#chatMemberSelect {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

.chat-shell {
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) minmax(0, 2fr);
  gap: 1rem;
}

.chat-inbox,
.chat-conversation {
  min-width: 0;
}

.chat-presence {
  grid-column: 1 / -1;
  min-width: 0;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.65rem;
}

.chat-presence-list {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0.25rem;
}

.chat-presence-entry {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  width: 5rem;
  padding: 0.25rem;
  border: 0;
  border-radius: 0.55rem;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.8rem;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.chat-presence-entry:hover {
  background: #ffe9cb;
}

.chat-presence-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 3rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #54331f;
  color: #fffaf3;
  font-weight: 700;
}

.chat-presence-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.chat-presence-avatar::after {
  content: "";
  position: absolute;
  inset: auto 0 0 auto;
  width: 0.7rem;
  aspect-ratio: 1;
  border: 2px solid #fffaf3;
  border-radius: 50%;
  background: #17743d;
}

.chat-conversation {
  border-inline-start: 1px solid var(--line);
  padding-inline-start: 1rem;
}

.chat-inbox-list {
  display: grid;
  gap: 0.35rem;
  list-style: none;
  padding: 0;
  max-height: 55vh;
  overflow: auto;
}

.chat-inbox-entry {
  display: grid;
  gap: 0.25rem;
  width: 100%;
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid transparent;
  border-radius: 0.8rem;
  background: #fffaf3;
  color: inherit;
  text-align: start;
  font: inherit;
  cursor: pointer;
}

.chat-inbox-entry:hover,
.chat-inbox-entry[aria-current="true"] {
  background: #ffe9cb;
  border-color: #bf7c3a;
}

.chat-inbox-entry strong,
.chat-inbox-entry span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-inbox-entry span {
  color: var(--muted);
  font-size: 0.84rem;
}

.chat-shell #chatBackToInbox,
.chat-shell[data-chat-view="inbox"] .message-threads,
.chat-shell[data-chat-view="inbox"] .message-composer,
.chat-shell[data-chat-view="inbox"] #commChatStatus {
  display: none;
}

.chat-shell[data-chat-view="inbox"] .chat-conversation h3 {
  color: var(--muted);
}

.chat-shell .message-threads {
  max-height: min(38dvh, 24rem);
  align-content: start;
  padding: 0.3rem;
  overscroll-behavior-y: contain;
}

.chat-shell .message-threads:empty {
  display: none;
}

.chat-shell .message-composer {
  margin-top: 0.75rem;
}

.chat-shell .thread-item {
  justify-self: start;
  max-width: min(84%, 32rem);
  border-radius: 1rem 1rem 1rem 0.25rem;
  background: #f7efe4;
  overflow-wrap: anywhere;
}

.chat-shell .thread-item.chat-mine {
  justify-self: end;
  border-radius: 1rem 1rem 0.25rem 1rem;
  background: #54331f;
  color: #fffaf3;
}

.chat-shell .thread-item p {
  color: inherit;
  white-space: pre-wrap;
  font-size: 0.95rem;
}

.chat-fire {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin-top: 0.35rem;
  min-width: 1.75rem;
  min-height: 1.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffaf3;
  font: inherit;
}

button.chat-fire {
  cursor: pointer;
  min-width: 2rem;
  min-height: 2rem;
  opacity: 0;
  pointer-events: none;
}

.chat-fire-revealed button.chat-fire,
button.chat-fire:focus-visible,
button.chat-fire[aria-pressed="true"] {
  opacity: 1;
  pointer-events: auto;
}

@media (any-hover: hover) {
  .thread-item:hover button.chat-fire {
    opacity: 1;
    pointer-events: auto;
  }
}

.chat-fire[aria-pressed="true"] {
  border-color: #bf7c3a;
  background: #ffe9cb;
}

.chat-fire[aria-disabled="true"] {
  opacity: 0.6;
  cursor: wait;
}

.chat-shell .message-composer input {
  min-width: 0;
  font-size: 1rem;
}

@media (max-width: 700px) {
  .chat-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .chat-shell .chat-conversation {
    border: 0;
    padding: 0;
  }

  .chat-shell[data-chat-view="inbox"] .chat-conversation,
  .chat-shell[data-chat-view="conversation"] .chat-presence,
  .chat-shell[data-chat-view="conversation"] .chat-inbox {
    display: none;
  }

  .chat-shell[data-chat-view="conversation"] #chatBackToInbox {
    display: inline-flex;
  }
}

