*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

button svg {
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
}

/* App Shell */
.app-shell {
  display: flex;
  min-height: 100dvh;
}

/* Desktop Sidebar */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  z-index: 30;
}

.brand-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 10px 18px;
  text-align: left;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  color: var(--text);
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-weight: 500;
  font-size: 15px;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.nav-item:hover {
  background: var(--surface-elevated);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 600;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.side-create-btn {
  margin-top: 14px;
  width: 100%;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
  font-size: 14.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.14s var(--ease), background-color 0.16s ease;
}

.side-create-btn:hover {
  background: var(--accent-hover);
}

.side-create-btn:active {
  transform: scale(0.98);
}

.side-create-btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.upload-add svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.hero-close svg {
  width: 16px;
  height: 16px;
}

.dock-create svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.side-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.theme-segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
  border-radius: var(--radius-xs);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
}

.theme-seg-btn {
  height: 28px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.theme-seg-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.side-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  text-align: left;
  transition: background-color 0.15s ease;
}

.side-user-card:hover {
  background: var(--surface-hover);
}

/* Main Content */
.main-area {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* Mobile Header */
.mobile-header {
  display: none;
}

.mobile-dock {
  display: none;
}

/* Desktop Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
}

.topbar-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: flex-end;
  max-width: 560px;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 340px;
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-3);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 38px;
  padding: 0 32px 0 36px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  font-size: 14px;
  outline: none;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.search-input:focus {
  border-color: var(--border-strong);
  background: var(--surface);
}

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-2);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Page Container */
.page-content {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 28px 40px;
  flex: 1;
}

/* Buttons & Controls */
.btn {
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: transform 0.12s var(--ease), background-color 0.16s ease, opacity 0.16s ease;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

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

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-elevated);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-elevated);
  color: var(--text);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: var(--radius-xs);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.15s ease;
}

.icon-btn:hover {
  background: var(--surface-elevated);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* Guest Presentation Hero */
.hero-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
  align-items: center;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 12px;
}

.hero-title {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.hero-desc {
  margin: 10px 0 18px;
  font-size: 15px;
  color: var(--text-2);
  max-width: 56ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-pillars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pillar-card {
  padding: 13px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
}

.pillar-title {
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pillar-sub {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.35;
}

.hero-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero-close:hover {
  background: var(--surface-elevated);
  color: var(--text);
}

/* Chips / Filters */
.chips-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.chips-row::-webkit-scrollbar {
  display: none;
}

.chip {
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.chip.active {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
  font-weight: 600;
}

.filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.filter-inputs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.mini-input,
.mini-select {
  height: 34px;
  padding: 0 11px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  outline: none;
}

.mini-input {
  width: 118px;
}

/* Market Grid */
.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(236px, 1fr));
  gap: 16px;
}

.listing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s var(--ease), border-color 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
}

.listing-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.listing-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--surface-elevated);
  overflow: hidden;
}

.listing-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s var(--ease);
}

.listing-card:hover .listing-media img {
  transform: scale(1.03);
}

.listing-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-3);
  font-size: 12px;
}

.listing-badges-top {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.badge-glass {
  background: rgba(15, 15, 18, 0.72);
  color: #FFFFFF;
  backdrop-filter: blur(8px);
}

.badge-reserved {
  background: var(--warn-soft);
  color: var(--warn);
  backdrop-filter: blur(8px);
}

.badge-sold {
  background: var(--danger-soft);
  color: var(--danger);
  backdrop-filter: blur(8px);
}

.fav-float-btn {
  pointer-events: auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(15, 15, 18, 0.65);
  color: #FFFFFF;
  backdrop-filter: blur(8px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  transition: transform 0.14s ease, background-color 0.14s ease;
}

.fav-float-btn:hover {
  transform: scale(1.08);
}

.fav-float-btn.active {
  color: #EF4444;
  background: #FFFFFF;
}

.listing-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.listing-price {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.listing-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.listing-meta {
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
}

/* Club Feed Layout */
.club-layout {
  display: grid;
  grid-template-columns: minmax(0, 680px) 310px;
  gap: 24px;
  justify-content: center;
  align-items: start;
}

.club-right-col {
  position: sticky;
  top: calc(var(--topbar-h) + 20px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.side-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.side-panel-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  margin: 0 0 12px;
}

/* Stories Strip */
.stories-strip {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  margin-bottom: 12px;
  scrollbar-width: none;
}

.stories-strip::-webkit-scrollbar {
  display: none;
}

.story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 68px;
  flex-shrink: 0;
}

.story-ring {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  padding: 2.5px;
  border: 2px solid var(--text);
  position: relative;
}

.story-ring.add {
  border-style: dashed;
  border-color: var(--border-strong);
}

.story-plus {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-fg);
  border: 2px solid var(--bg);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.story-name {
  font-size: 11.5px;
  color: var(--text-2);
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-empty-hint {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 60px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  font-size: 12.5px;
  color: var(--text-2);
}

.story-empty-hint strong {
  color: var(--text);
  font-size: 13px;
}

/* Post Card */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.post-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-align: left;
}

.post-caption {
  font-size: 14.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 12px;
}

.tag-link,
.mention-link {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 2px;
}

.post-carousel {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-elevated);
  margin-bottom: 12px;
}

.post-carousel-img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(10, 10, 12, 0.62);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}

.carousel-nav.prev { left: 10px; }
.carousel-nav.next { right: 10px; }

.carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  background: rgba(10, 10, 12, 0.55);
}

.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
}

.carousel-dot.active {
  background: #FFFFFF;
  width: 14px;
  border-radius: 99px;
}

.attached-lot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  margin-bottom: 12px;
  text-align: left;
  width: 100%;
}

.attached-lot img {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.action-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  padding: 4px 6px;
  border-radius: 8px;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.action-stat:hover {
  background: var(--surface-elevated);
  color: var(--text);
}

.action-stat.liked {
  color: #EF4444;
}

.action-stat.reposted {
  color: var(--ok);
}

/* Avatar & Trust */
.avatar {
  border-radius: 50%;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  text-transform: uppercase;
}

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

.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--verified);
  flex-shrink: 0;
}

.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  background: var(--surface-elevated);
  color: var(--text-2);
  border: 1px solid var(--border);
}

.trust-pill.warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: transparent;
}

.trust-pill.risk {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}

/* Chats Desktop Split + Mobile */
.chats-shell {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  height: calc(100dvh - var(--topbar-h) - 44px);
  min-height: 540px;
  overflow: hidden;
}

.chats-list-pane {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chats-pane-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chats-scroll {
  flex: 1;
  overflow-y: auto;
}

.chat-row {
  width: 100%;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.14s ease;
}

.chat-row:hover {
  background: var(--surface-elevated);
}

.chat-row.active {
  background: var(--accent-soft);
}

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

.chat-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 3px;
}

.chat-preview {
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-thread-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
}

.chat-thread-head {
  padding: 12px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-back-btn {
  display: none;
}

.messages-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg-row {
  display: flex;
  flex-direction: column;
  max-width: min(76%, 460px);
}

.msg-row.out {
  align-self: flex-end;
  align-items: flex-end;
}

.msg-row.in {
  align-self: flex-start;
  align-items: flex-start;
}

.msg-bubble {
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.4;
  word-break: break-word;
  border: 1px solid var(--border);
}

.msg-row.out .msg-bubble {
  background: var(--bubble-out);
  color: var(--bubble-out-fg);
  border-color: transparent;
  border-bottom-right-radius: 5px;
}

.msg-row.in .msg-bubble {
  background: var(--bubble-in);
  color: var(--bubble-in-fg);
  border-bottom-left-radius: 5px;
}

.msg-time {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-3);
}

.msg-payload-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 210px;
}

.msg-photo {
  border-radius: 11px;
  max-width: 260px;
  max-height: 300px;
  object-fit: cover;
}

.chat-composer {
  padding: 12px 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.chat-composer .icon-btn {
  flex-shrink: 0;
}

.composer-input {
  flex: 1;
  min-width: 0;
  width: 0;
  min-height: 40px;
  max-height: 120px;
  padding: 9px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  font-size: 14.5px;
  line-height: 1.35;
  resize: none;
  outline: none;
}

/* Profile */
.profile-header-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 18px;
}

.profile-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.stat-box strong {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.stat-box span {
  display: block;
  font-size: 12px;
  color: var(--text-3);
}

/* Modals & Sheets */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(6px);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 640px;
  max-height: 90dvh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-card.wide {
  max-width: 860px;
}

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

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

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  outline: none;
  font-size: 14.5px;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--border-strong);
  background: var(--surface);
}

.textarea {
  min-height: 96px;
  resize: vertical;
}

.listing-detail-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 22px;
  align-items: start;
}

.detail-gallery {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-elevated);
  aspect-ratio: 4 / 3;
}

.detail-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-strip {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  overflow-x: auto;
}

.thumb-btn {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  opacity: 0.65;
  flex-shrink: 0;
}

.thumb-btn.active {
  border-color: var(--accent);
  opacity: 1;
}

.thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Upload Previews */
.upload-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.upload-tile {
  position: relative;
  width: 82px;
  height: 82px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-elevated);
}

.upload-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.upload-add {
  width: 82px;
  height: 82px;
  border-radius: 12px;
  border: 1.5px dashed var(--border-strong);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-2);
  cursor: pointer;
}

/* Empty & Skeleton */
.empty-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 46px 24px;
  text-align: center;
  color: var(--text-2);
}

.skeleton {
  background: linear-gradient(90deg, var(--surface-elevated) 25%, var(--surface-hover) 50%, var(--surface-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Toast */
.toast-wrap {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}

.toast {
  padding: 10px 16px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  word-break: break-word;
  box-shadow: var(--shadow-md);
}

/* Responsive: Tablet & Mobile (< 1024px) */
@media (max-width: 1023px) {
  .sidebar,
  .topbar {
    display: none;
  }

  .main-area {
    margin-left: 0;
    padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom) + 22px);
  }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px;
    padding-top: max(10px, env(safe-area-inset-top));
    background: var(--glass-bg);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border-bottom: 1px solid var(--border);
  }

  .page-content {
    padding: 14px 14px 26px;
  }

  .hero-banner {
    grid-template-columns: 1fr;
    padding: 18px;
    gap: 16px;
  }

  .club-layout {
    grid-template-columns: 1fr;
  }

  .club-right-col {
    display: none;
  }

  .market-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .listing-body {
    padding: 10px 11px 12px;
  }

  .listing-price {
    font-size: 15px;
  }

  .listing-detail-grid {
    grid-template-columns: 1fr;
  }

  /* Mobile Chat Drill-down */
  .chats-shell {
    grid-template-columns: 1fr;
    height: calc(100dvh - 154px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    min-height: 360px;
  }

  .chats-shell:not(.thread-open) .chat-thread-pane {
    display: none;
  }

  .chats-shell.thread-open .chats-list-pane {
    display: none;
  }

  .chats-shell.thread-open .chat-back-btn {
    display: inline-flex;
  }

  body.chat-thread-active .mobile-dock {
    display: none;
  }

  body.chat-thread-active .main-area {
    padding-bottom: 0;
  }

  body.chat-thread-active .page-content {
    padding: 0;
  }

  body.chat-thread-active .chats-shell.thread-open {
    height: calc(100dvh - 54px - env(safe-area-inset-top));
    min-height: 0;
    border-radius: 0;
    border: none;
  }

  .chat-thread-head {
    padding: 10px 12px;
    gap: 8px;
  }

  .messages-scroll {
    padding: 12px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .msg-row {
    max-width: 84%;
  }

  .chat-composer {
    padding: 8px 10px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    gap: 6px;
  }

  .chat-composer .icon-btn {
    width: 36px;
    height: 36px;
  }

  .composer-input {
    font-size: 16px;
    padding: 8px 12px;
    min-height: 38px;
  }

  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .modal-card {
    max-width: 100%;
    max-height: 88dvh;
    border-radius: 22px 22px 0 0;
  }

  .modal-body {
    padding-bottom: max(26px, calc(18px + env(safe-area-inset-bottom)));
    -webkit-overflow-scrolling: touch;
  }

  /* Floating Glass Bottom Dock */
  .mobile-dock {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 40;
    height: var(--dock-h);
    max-width: 460px;
    margin: 0 auto;
    padding: 6px;
    border-radius: var(--radius-pill);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    box-shadow: var(--shadow-md);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    gap: 2px;
  }

  .dock-btn {
    height: 100%;
    border-radius: var(--radius-pill);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-2);
    white-space: nowrap;
    position: relative;
  }

  .dock-btn.active {
    background: var(--accent-soft);
    color: var(--text);
    font-weight: 600;
  }

  .dock-btn svg {
    width: 20px;
    height: 20px;
  }

  .dock-create {
    width: 46px;
    height: 46px;
    margin: 0 auto;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-fg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
  }

  .dock-badge {
    position: absolute;
    top: 4px;
    right: 14%;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 99px;
    background: var(--accent);
    color: var(--accent-fg);
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 420px) {
  .hero-pillars {
    grid-template-columns: 1fr;
  }
}

/* Mobile inline search */
.mobile-search-wrap {
  display: none;
  margin-bottom: 12px;
}

@media (max-width: 1023px) {
  .mobile-search-wrap {
    display: block;
  }
  .mobile-search-wrap .search-box {
    max-width: 100%;
  }
}

/* Chat Reply & Voice Recording Bar */
.reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  background: var(--surface-elevated);
  border-top: 1px solid var(--border);
  font-size: 12.5px;
}

.reply-bar-quote {
  border-left: 2.5px solid var(--accent);
  padding-left: 9px;
  min-width: 0;
  flex: 1;
}

.voice-rec-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.rec-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulseDot 1s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}

.admin-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-elevated);
  border: 1px dashed var(--border-strong);
  margin-top: 10px;
}

.notif-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-elevated);
}

/* Showroom Intro & Post Polish */
.showroom-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 18px;
  margin-bottom: 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}

.showroom-intro-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.showroom-intro-sub {
  margin-top: 3px;
  font-size: 13px;
  color: var(--text-2);
}

.post-card {
  transition: border-color 0.16s ease;
}

.post-card:hover {
  border-color: var(--border-strong);
}

.post-card.highlighted {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.attached-lot {
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.attached-lot:hover {
  border-color: var(--border-strong);
}

@media (max-width: 520px) {
  .post-actions {
    gap: 10px;
  }
}

/* Notifications Badge, Matched Users & Calls */
.notif-btn {
  position: relative;
}

.notif-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--danger);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}

.toast.clickable {
  pointer-events: auto;
  cursor: pointer;
}

.matched-users-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 0 14px;
  margin-bottom: 12px;
  scrollbar-width: none;
}

.matched-users-strip::-webkit-scrollbar {
  display: none;
}

.matched-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: left;
  flex-shrink: 0;
  transition: border-color 0.14s ease;
}

.matched-user-pill:hover {
  border-color: var(--border-strong);
}

.call-card {
  max-width: 360px;
  padding: 28px 22px;
  text-align: center;
  align-items: center;
  gap: 16px;
}

.call-avatar-ring {
  padding: 6px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: callPulse 1.6s infinite ease-in-out;
}

@keyframes callPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.25); }
  50% { box-shadow: 0 0 0 12px rgba(255, 255, 255, 0); }
}

.call-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
}

.call-circle-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.call-circle-btn.accept {
  background: var(--ok);
  color: #FFFFFF;
}

.call-circle-btn.decline {
  background: var(--danger);
  color: #FFFFFF;
}

.call-circle-btn.mute {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  color: var(--text);
}

.call-circle-btn.mute.active {
  background: var(--accent);
  color: var(--accent-fg);
}
