*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg:           #f5f7fa;
  --surface:      #f8fafc;
  --card:         #ffffff;
  --border:       #e8edf2;
  --border-focus: #93c5fd;
  --accent:       #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #eff6ff;
  --accent-muted: #bfdbfe;
  --success:      #16a34a;
  --success-light:#f0fdf4;
  --success-border:#b8e0c8;
  --warning:      #d97706;
  --danger:       #dc2626;
  --danger-light: #fef2f2;
  --text:         #1a2332;
  --text-2:       #4a5568;
  --muted:        #718096;
  --muted-2:      #94a3b8;
  --navy:         #1a2332;
  --radius:       10px;
  --radius-lg:    14px;
  --radius-full:  999px;
  --shadow-xs:    0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:       0 2px 8px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md:    0 6px 20px rgba(0,0,0,0.10);
  --shadow-lg:    0 12px 40px rgba(0,0,0,0.14);
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--accent-hover); }
img { display: block; }

/* ── Top Nav ─────────────────────────────────────────────────────────────── */
.top-nav {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 2.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 62px;
  position: sticky;
  top: 0;
  z-index: 200;
}
.top-nav .logo {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--navy, #1a2332);
  letter-spacing: -0.3px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}
.top-nav .logo-icon {
  width: 30px; height: 30px;
  background: #1a2332;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}
.top-nav .logo .logo-accent { color: var(--accent); }
.top-nav .logo:hover { text-decoration: none; }
.top-nav .spacer { flex: 1; }
.top-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin-left: 0.5rem;
}
.top-nav .nav-link {
  font-size: 0.875rem;
  color: var(--text-2, #4a5568);
  font-weight: 500;
  transition: color 0.15s;
  white-space: nowrap;
}
.top-nav .nav-link:hover { color: var(--text); text-decoration: none; }
.top-nav .btn-nav {
  background: var(--accent);
  color: #fff !important;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(37,99,235,0.28);
}
.top-nav .btn-nav:hover { background: var(--accent-hover); box-shadow: 0 4px 14px rgba(37,99,235,0.35); text-decoration: none; }
/* Hamburger button — hidden on desktop, shown when nav collapses */
.hamburger {
  display: none;
  background: transparent;
  border: 0;
  padding: 0.4rem;
  margin-left: 0.4rem;
  color: var(--text-2);
  cursor: pointer;
  border-radius: var(--radius);
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.hamburger:hover { background: var(--surface); color: var(--text); }
.hamburger svg { width: 24px; height: 24px; display: block; }
.nav-show-mobile { display: none; }

/* Slide-out drawer */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 300;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.drawer-overlay.open { display: block; opacity: 1; }
.drawer {
  position: fixed;
  top: 0; bottom: 0;
  right: 0;
  width: min(82vw, 300px);
  background: var(--card);
  z-index: 301;
  display: none;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.18);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.drawer.open { display: flex; }
.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
}
.drawer-title { font-weight: 800; font-size: 0.95rem; color: var(--text); }
.drawer-close {
  background: transparent; border: 0;
  font-size: 1.6rem; line-height: 1;
  color: var(--muted); cursor: pointer;
  padding: 0.1rem 0.55rem; border-radius: var(--radius);
}
.drawer-close:hover { background: var(--surface); color: var(--text); }
.drawer-nav { display: flex; flex-direction: column; padding: 0.5rem 0; }
.drawer-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  font-size: 0.92rem; font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: background 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.drawer-item:hover { background: var(--surface); text-decoration: none; }
.drawer-item.danger { color: var(--danger); }
.drawer-item svg { width: 20px; height: 20px; flex-shrink: 0; stroke-width: 2; }
.drawer-divider { height: 1px; background: var(--border); margin: 0.25rem 0; }

/* ── Top-nav narrow layout (< 900px) ──────────────────────────────────────── */
@media (max-width: 900px) {
  .top-nav { padding: 0 1rem; height: 62px; gap: 0; }
  .top-nav .nav-hide-mobile { display: none !important; }
  .top-nav .nav-show-mobile { display: inline-flex !important; }
  .top-nav .btn-nav { font-size: 0.8rem; padding: 0.45rem 1rem; }
  /* Keep Log In visible, just shrink it */
  .top-nav .nav-login-compact { font-size: 0.8rem; padding: 0.35rem 0.7rem; }
}
@media (max-width: 380px) {
  .top-nav .logo { font-size: 0.95rem; }
}

/* ── Bottom Tab Bar ───────────────────────────────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav-inner { display: flex; height: 56px; }
.bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted-2);
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  position: relative;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.bn-item:hover, .bn-item.active { color: var(--accent); text-decoration: none; }
.bn-item svg { width: 22px; height: 22px; stroke-width: 1.6; flex-shrink: 0; }
.bn-sell .bn-icon {
  width: 40px; height: 40px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(37,99,235,0.35);
  transition: background 0.15s, box-shadow 0.15s;
}
.bn-sell:active .bn-icon { background: var(--accent-hover); box-shadow: none; }
.bn-sell svg { stroke: #fff; width: 20px; height: 20px; stroke-width: 2.2; }
.bn-sell { color: var(--muted-2); }
.bn-badge {
  position: absolute;
  top: 4px; right: calc(50% - 20px);
  background: var(--danger);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--card);
  line-height: 1;
}
@media (max-width: 900px) {
  .bottom-nav { display: block; }
  body { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
  #toast { bottom: calc(70px + env(safe-area-inset-bottom, 0px)) !important; }
}
@media (max-width: 360px) {
  .bn-item { font-size: 0.6rem; }
  .bn-item svg { width: 20px; height: 20px; }
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
.container { max-width: 1060px; margin: 0 auto; padding: 1.5rem 1.25rem; }
@media (max-width: 640px) { .container { padding: 1rem; } }

/* ── Browse Grid ─────────────────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }
@media (max-width: 500px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; } }
@media (max-width: 360px) { .grid { grid-template-columns: 1fr; } }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s, transform 0.2s;
}
a.card:hover, .card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.10), 0 1px 4px rgba(0,0,0,0.05); transform: translateY(-2px); text-decoration: none; }
.card img { width: 100%; aspect-ratio: 3/4; object-fit: cover; background: var(--surface); }
.card-body { padding: 0.75rem; }
.card-title {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text);
  margin-bottom: 0.3rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.35;
}
.card-sub { font-size: 0.75rem; color: var(--muted); margin-bottom: 0.5rem; }
.card-price { font-size: 1.05rem; font-weight: 800; color: var(--text); letter-spacing: -0.3px; }
.card-drop { font-size: 0.72rem; color: var(--muted); }
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.69rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  color: var(--accent);
  margin-right: 0.2rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge-gray { background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
.badge-green { background: var(--success-light); color: var(--success); }
.badge-amber { background: #fffbeb; color: var(--warning); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s, opacity 0.15s;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  line-height: 1.25;
  font-family: inherit;
}
.btn:active { transform: scale(0.97); }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 3px rgba(37,99,235,0.25); border-radius: var(--radius-full); }
.btn-primary:hover { background: var(--accent-hover); color: #fff; box-shadow: 0 3px 10px rgba(37,99,235,0.3); }
.btn-secondary { background: var(--accent-light); color: var(--accent); }
.btn-secondary:hover { background: var(--accent-muted); color: var(--accent-hover); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text-2); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-sm { padding: 0.38rem 0.85rem; font-size: 0.8rem; border-radius: 8px; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-block { width: 100%; }
.btn-icon { padding: 0.5rem; border-radius: var(--radius); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-2);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
input, select, textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.925rem;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394a3b8' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}
textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.form-hint { font-size: 0.78rem; color: var(--muted); margin-top: 0.3rem; }
@media (max-width: 640px) { .form-row, .form-row-3 { grid-template-columns: 1fr; } }
/* Prevent iOS auto-zoom on input focus */
@media (max-width: 640px) {
  input, select, textarea { font-size: 16px; }
}

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}
.alert-error { background: var(--danger-light); border: 1px solid #fca5a5; color: #991b1b; }
.alert-success { background: var(--success-light); border: 1px solid #86efac; color: #166534; }
.alert-info { background: var(--accent-light); border: 1px solid var(--accent-muted); color: #1e40af; }
.alert-warning { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }

/* ── Page sections ───────────────────────────────────────────────────────── */
.page-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 1.25rem;
  line-height: 1.15;
}
.section-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 3.5rem 1rem;
  font-size: 0.9rem;
  line-height: 1.7;
}
.empty strong { display: block; font-size: 1rem; color: var(--text-2); margin-bottom: 0.35rem; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ── Filter bar ──────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  box-shadow: var(--shadow-xs);
}
.filter-bar input, .filter-bar select { width: auto; flex: 1; min-width: 110px; background: var(--surface); }

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 1.5px solid var(--border); margin-bottom: 1.25rem; gap: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 0.6rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1.5px;
  transition: color 0.15s;
  white-space: nowrap;
  user-select: none;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Listing detail ───────────────────────────────────────────────────────── */
.listing-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
@media (max-width: 640px) { .listing-detail { grid-template-columns: 1fr; gap: 1.5rem; } }
#main-img { transition: opacity 0.15s; }
.detail-price { font-size: 2.2rem; font-weight: 900; color: var(--text); letter-spacing: -1.5px; line-height: 1; }
.detail-meta { font-size: 0.85rem; color: var(--muted); line-height: 2; }
.detail-meta strong { color: var(--text-2); font-weight: 600; }
.offer-list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.75rem; }
.offer-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--surface);
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  border: 1px solid var(--border);
}
.offer-row .amount { font-weight: 700; }
.offer-row .spacer { flex: 1; }

/* ── Chat ────────────────────────────────────────────────────────────────── */
.bubble {
  max-width: 72%;
  padding: 0.6rem 0.9rem;
  border-radius: 16px;
  font-size: 0.875rem;
  line-height: 1.5;
  word-break: break-word;
}
.bubble.mine { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble.theirs { background: var(--card); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; box-shadow: var(--shadow-xs); }
.bubble-name { font-size: 0.7rem; font-weight: 700; margin-bottom: 0.2rem; opacity: 0.65; }
.bubble-time { font-size: 0.67rem; opacity: 0.55; margin-top: 0.3rem; text-align: right; }

/* ── Misc ────────────────────────────────────────────────────────────────── */
.price-drop-timer { font-size: 0.75rem; color: var(--warning); font-weight: 700; }
#toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
  max-width: calc(100vw - 2rem);
}
#toast.show { opacity: 1; }

/* ── Thumb strip ─────────────────────────────────────────────────────────── */
.thumb-btn { transition: border-color 0.15s, opacity 0.15s !important; }
.thumb-btn:hover { border-color: var(--accent) !important; opacity: 0.85; }

/* ── Nav auth area ────────────────────────────────────────────────────────── */
#nav-auth { display: inline-flex; align-items: center; gap: 0.5rem; }

/* Icon circle buttons (messages, notifications) */
.nav-icon-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  border: none;
  flex-shrink: 0;
}
.nav-icon-btn:hover { background: var(--border); color: var(--text); text-decoration: none; }
.nav-icon-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-icon-btn.nav-notif-blocked {
  background: #fef3c7;
  color: #b45309;
}
.nav-icon-btn.nav-notif-blocked:hover {
  background: #fde68a;
  color: #92400e;
}

/* Notifications-blocked modal */
.notif-blocked-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 400;
}
.notif-blocked-overlay.open { display: block; }
.notif-blocked-modal {
  display: none;
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(90vw, 440px);
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  z-index: 401;
  overflow: hidden;
}
.notif-blocked-modal.open { display: block; }
.notif-blocked-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
  font-weight: 800;
  color: var(--text);
  font-size: 0.95rem;
}
.notif-blocked-close {
  background: transparent; border: 0;
  font-size: 1.5rem; line-height: 1;
  color: var(--muted); cursor: pointer;
  padding: 0.1rem 0.55rem; border-radius: 6px;
}
.notif-blocked-close:hover { background: var(--surface); color: var(--text); }
.notif-blocked-body { padding: 1rem 1.15rem 1.25rem; font-size: 0.9rem; color: var(--text-2); line-height: 1.55; }
.notif-blocked-body p { margin: 0 0 0.65rem; }
.notif-blocked-body ol { margin: 0.3rem 0 0 1.2rem; padding: 0; }
.notif-blocked-body li { margin-bottom: 0.25rem; }
.nav-icon-badge {
  position: absolute;
  top: -1px; right: -1px;
  background: var(--danger);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--card);
  line-height: 1;
  pointer-events: none;
}

/* Profile avatar + dropdown */
.nav-avatar-wrap { position: relative; flex-shrink: 0; }
.nav-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700;
  cursor: pointer;
  border: 2.5px solid transparent;
  transition: border-color 0.15s, opacity 0.15s;
  user-select: none;
  letter-spacing: 0.02em;
  overflow: hidden;
}
.nav-avatar:hover { border-color: var(--accent-muted); opacity: 0.9; }
.nav-avatar.open { border-color: var(--accent); }
.nav-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 210px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 400;
  overflow: hidden;
  display: none;
  animation: ddFade 0.12s ease;
}
@keyframes ddFade { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
.nav-dropdown.open { display: block; }
.nav-dd-header {
  padding: 0.85rem 1rem 0.6rem;
  border-bottom: 1px solid var(--border);
}
.nav-dd-name { font-weight: 700; font-size: 0.9rem; color: var(--text); }
.nav-dd-sub  { font-size: 0.75rem; color: var(--muted); margin-top: 0.15rem; }
.nav-dd-item {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.6rem 1rem;
  font-size: 0.875rem; color: var(--text-2); font-weight: 500;
  cursor: pointer; transition: background 0.12s;
  text-decoration: none; border: none; background: none;
  width: 100%; text-align: left; font-family: inherit;
}
.nav-dd-item svg { width: 17px; height: 17px; color: var(--muted); flex-shrink: 0; }
.nav-dd-item:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.nav-dd-divider { border: none; border-top: 1px solid var(--border); margin: 0.3rem 0; }
.nav-dd-item.danger { color: var(--danger); }
.nav-dd-item.danger svg { color: var(--danger); }
.nav-dd-item.danger:hover { background: var(--danger-light); }

/* ── Mobile: listing detail ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  .detail-price { font-size: 1.7rem; }
  .listing-detail { gap: 1rem; }
  .offer-row { flex-wrap: wrap; gap: 0.4rem; }
  .offer-row .spacer { display: none; }
}

/* ── Mobile: page title ──────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .page-title { font-size: 1.35rem; }
  .section-title { margin-top: 1rem; }
}

/* ── Mobile: chat bubbles ────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .bubble { max-width: 86%; font-size: 0.875rem; }
}

/* ── Mobile: buttons full-width in stacked contexts ─────────────────────── */
@media (max-width: 480px) {
  .btn-stack-mobile { width: 100%; justify-content: center; }
  .action-row { flex-direction: column; gap: 0.5rem; }
  .action-row .btn { width: 100%; }
}

/* ── Mobile: card body smaller padding ──────────────────────────────────── */
@media (max-width: 500px) {
  .card-body { padding: 0.6rem; }
  .card-title { font-size: 0.82rem; }
  .card-price { font-size: 0.95rem; }
}

/* ── Mobile: filter bar full-width inputs ────────────────────────────────── */
@media (max-width: 480px) {
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar input, .filter-bar select { width: 100%; min-width: 0; }
}

/* ── Mobile: tabs scroll ─────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .tabs { gap: 0; }
  .tab { padding: 0.55rem 0.8rem; font-size: 0.82rem; }
}

/* ── Mobile: section spacing ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .card { border-radius: var(--radius); }
  .container { padding: 0.85rem 0.85rem; }
}

/* ── Mobile: listing card listing-card-img ───────────────────────────────── */
.listing-card-img { position: relative; }

/* ── Listing card component ──────────────────────────────────────────────── */
.listing-card {
  display: block; color: inherit; text-decoration: none;
  position: relative; border-radius: var(--radius-lg);
  overflow: hidden; background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
  transition: transform 0.2s, box-shadow 0.2s;
}
.listing-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(0,0,0,0.10); text-decoration: none; }
.listing-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity 0.2s; }
.listing-card-img-bg { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.35) 0%, transparent 50%); pointer-events: none; }
.lc-type-pill { position: absolute; top: 8px; left: 8px; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; padding: 3px 8px; border-radius: var(--radius-full); pointer-events: none; }
.lc-pill-sale  { background: rgba(255,255,255,0.92); color: #1a2332; }
.lc-pill-trade { background: rgba(22,163,74,0.88);  color: #fff; }
.lc-pill-both  { background: rgba(217,119,6,0.88);  color: #fff; }
.lc-grade-badge { position: absolute; bottom: 8px; left: 8px; font-size: 0.65rem; font-weight: 800; letter-spacing: 0.03em; background: rgba(0,0,0,0.55); color: #fff; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); padding: 2px 8px; border-radius: var(--radius-full); pointer-events: none; }
.lc-grade-raw { background: rgba(100,116,139,0.7); }
.listing-card-body { padding: 0.75rem 0.875rem 0.875rem; }
.lc-title { font-size: 0.875rem; font-weight: 700; color: var(--text); line-height: 1.35; margin-bottom: 0.2rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lc-meta { font-size: 0.72rem; color: var(--muted); margin-bottom: 0.55rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.4rem; }
.lc-price { font-size: 1.1rem; font-weight: 900; color: var(--text); letter-spacing: -0.4px; line-height: 1; }
.lc-drop { font-size: 0.7rem; color: var(--muted); text-align: right; }
.lc-heart { position: absolute; top: 8px; right: 8px; z-index: 3; width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,0.9); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform 0.15s, background 0.15s; -webkit-tap-highlight-color: transparent; box-shadow: 0 1px 4px rgba(0,0,0,0.14); padding: 0; }
.lc-heart:hover { transform: scale(1.15); background: rgba(255,255,255,1); }
.lc-heart.liked { background: #fee2e2; }
.lc-heart.liked svg path { stroke: #ef4444; fill: #ef4444; }

/* ── Offer/notification banner ───────────────────────────────────────────── */
.offer-banner { display: flex; align-items: center; gap: 0.75rem; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: var(--radius-lg); padding: 0.75rem 1rem; margin-bottom: 1rem; font-size: 0.875rem; color: #15803d; animation: banner-in 0.3s ease; }
@keyframes banner-in { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:none; } }
.offer-banner-icon { font-size: 1.1rem; flex-shrink: 0; }
.offer-banner a { color: #15803d; font-weight: 700; text-decoration: underline; }

/* ── Toggle switch component ─────────────────────────────────────────────── */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 0.85rem 1rem; background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--radius); margin-bottom: 1rem; cursor: pointer; user-select: none; }
.toggle-row:hover { border-color: var(--accent); }
.toggle-label { font-weight: 600; font-size: 0.92rem; }
.toggle-sub { font-size: 0.78rem; color: var(--muted); margin-top: 0.1rem; }
.toggle-switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track { position: absolute; inset: 0; background: #cbd5e1; border-radius: 999px; transition: background 0.2s; }
.toggle-switch input:checked + .toggle-track { background: var(--accent); }
.toggle-thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); pointer-events: none; }
.toggle-switch input:checked ~ .toggle-thumb { transform: translateX(18px); }

/* ── Card type selector ──────────────────────────────────────────────────── */
.ctype-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1.25rem; }
.ctype-btn { display: flex; flex-direction: column; align-items: center; padding: 1rem 0.75rem; gap: 0.35rem; text-align: center; border: 2px solid var(--border); border-radius: var(--radius-lg); background: var(--card); cursor: pointer; user-select: none; transition: border-color 0.15s, background 0.15s, box-shadow 0.15s; }
.ctype-btn .ctype-icon  { font-size: 1.65rem; line-height: 1; }
.ctype-btn .ctype-label { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.ctype-btn .ctype-sub   { font-size: 0.72rem; color: var(--muted); }
.ctype-btn:hover { border-color: var(--accent); background: var(--accent-light); }
.ctype-btn.active { border-color: var(--accent); background: var(--accent-light); box-shadow: 0 0 0 3px rgba(37,99,235,0.10); }
.ctype-btn.active .ctype-label { color: var(--accent); }

/* ── Price drop settings panel ───────────────────────────────────────────── */
.drop-settings { display: none; padding: 1rem; background: var(--success-light); border: 1.5px solid #b8e0c8; border-radius: var(--radius); margin-bottom: 1rem; }
.drop-settings.visible { display: block; }

/* ── Listing type pills ──────────────────────────────────────────────────── */
.type-pills { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; }
.type-pill { flex: 1; text-align: center; padding: 0.55rem; border: 2px solid var(--border); border-radius: var(--radius); font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: all 0.15s; user-select: none; background: var(--card); }
.type-pill.active { border-color: var(--accent); background: var(--accent-light); color: var(--accent); }
.type-pill:hover:not(.active) { border-color: var(--accent); }

/* ── Photo upload slots ──────────────────────────────────────────────────── */
.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 0.5rem; }
.photo-slot { position: relative; aspect-ratio: 3/4; border: 2px dashed var(--border); border-radius: var(--radius); background: #fafaf8; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem; transition: border-color 0.15s, background 0.15s; overflow: hidden; }
.photo-slot:hover { border-color: var(--accent); background: #f0f9f4; }
.photo-slot.filled { border-style: solid; border-color: var(--accent); }
.photo-slot.required-slot { border-color: #aaa; }
.photo-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: calc(var(--radius) - 2px); }
.photo-slot .slot-label { font-size: 0.8rem; font-weight: 700; color: var(--muted); text-align: center; line-height: 1.3; z-index: 1; }
.photo-slot .slot-sub { font-size: 0.72rem; color: #aaa; text-align: center; z-index: 1; }
.photo-slot .slot-icon { font-size: 1.6rem; color: #ccc; z-index: 1; }
.photo-slot .remove-btn { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,0.55); color: #fff; border: none; border-radius: 50%; width: 22px; height: 22px; font-size: 0.8rem; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 2; }
.photo-slot .main-badge { position: absolute; bottom: 6px; left: 6px; background: rgba(0,0,0,0.55); color: #fff; font-size: 0.7rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; z-index: 2; }
.photo-count { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.75rem; }

/* ── Want toggle ─────────────────────────────────────────────────────────── */
.want-toggle { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 0.85rem; background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--radius); margin-bottom: 0.85rem; cursor: pointer; user-select: none; gap: 0.75rem; }
.want-toggle:hover { border-color: var(--accent); }
.want-toggle.on { border-color: var(--accent); background: var(--accent-light); }

/* ── Mobile component tweaks ─────────────────────────────────────────────── */
@media (max-width: 400px) {
  .photo-grid { grid-template-columns: 1fr; }
  .type-pill { padding: 0.6rem 0.4rem; font-size: 0.82rem; }
  .ctype-btn { padding: 0.85rem 0.5rem; }
  .toggle-row { padding: 0.75rem; }
  .want-toggle { padding: 0.65rem 0.75rem; }
}
