/* ============================================
   KAROHA.NET — Mobile App Design System
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ---- CSS Variables ---- */
:root {
  --primary:       #7c3aed;
  --primary-light: #9f5ef8;
  --primary-dark:  #5b21b6;
  --secondary:     #ec4899;
  --accent:        #06b6d4;
  --success:       #10b981;
  --warning:       #f59e0b;
  --danger:        #ef4444;

  --bg:       #07070f;
  --bg2:      #0e0e1c;
  --bg3:      #181828;
  --surface:  #141422;
  --surface2: #1c1c30;
  --surface3: #22223a;

  --text:   #f0f0ff;
  --text-2: #9898c0;
  --text-3: #555580;
  --border: #252540;
  --border-light: #353560;

  --grad-primary: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
  --grad-accent:  linear-gradient(135deg, #06b6d4 0%, #7c3aed 100%);
  --grad-warm:    linear-gradient(135deg, #f59e0b 0%, #ec4899 100%);
  --glass:        rgba(255,255,255,0.04);
  --glass-border: rgba(255,255,255,0.08);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --shadow:    0 2px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.7);
  --glow:      0 0 28px rgba(124,58,237,0.35);
  --glow-pink: 0 0 28px rgba(236,72,153,0.35);

  --header-h:    60px;
  --bottom-nav-h: 72px;
  --transition:  0.22s cubic-bezier(0.4,0,0.2,1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, select, textarea { font: inherit; color: inherit; }
ul { list-style: none; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 2px; }

/* ============================================
   APP HEADER (top bar — minimal)
   ============================================ */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  height: var(--header-h);
  background: rgba(7,7,15,0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--glass-border);
  display: flex; align-items: center;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top, 0px);
}
.app-header-inner {
  width: 100%; max-width: 720px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
}
.app-logo {
  display: flex; align-items: center; gap: 9px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.35rem; font-weight: 700;
}
.app-logo .logo-icon {
  width: 34px; height: 34px;
  background: var(--grad-primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.logo-text { background: var(--grad-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.logo-dot  { color: var(--secondary); -webkit-text-fill-color: var(--secondary); font-size: 0.85rem; }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.header-icon-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--glass); border: 1px solid var(--glass-border);
  color: var(--text-2); font-size: 1.1rem;
  transition: var(--transition); position: relative;
}
.header-icon-btn:hover { background: var(--surface2); color: var(--text); }
.header-badge {
  position: absolute; top: -4px; right: -4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--danger); color: white;
  font-size: 0.62rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}

/* User avatar in header */
.header-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--primary); object-fit: cover; cursor: pointer;
}

/* Page offset for header */
.page-content {
  padding-top: calc(var(--header-h) + 16px);
  max-width: 720px;
  margin: 0 auto;
  padding-left: 14px;
  padding-right: 14px;
}

/* ============================================
   BOTTOM NAVIGATION
   ============================================ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 900;
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(7,7,15,0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: space-around;
  padding-top: 6px;
}
.nav-tab {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px; padding: 6px 4px;
  color: var(--text-3); cursor: pointer;
  transition: var(--transition); position: relative;
  -webkit-tap-highlight-color: transparent;
  min-height: 52px;
}
.nav-tab svg { transition: var(--transition); }
.nav-tab span { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.01em; transition: var(--transition); }
.nav-tab.active { color: var(--primary); }
.nav-tab.active svg { filter: drop-shadow(0 0 6px rgba(124,58,237,0.7)); }
.nav-tab:active { transform: scale(0.92); }

/* Center POST tab — special */
.nav-tab-post {
  flex: 1; display: flex; align-items: center; justify-content: center;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.nav-tab-post-btn {
  width: 52px; height: 52px; border-radius: 16px;
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--glow);
  transition: var(--transition);
  margin-bottom: 2px;
}
.nav-tab-post-btn svg { transition: var(--transition); }
.nav-tab-post:active .nav-tab-post-btn { transform: scale(0.9); }

/* Badge on nav tab */
.nav-badge {
  position: absolute; top: 4px; right: calc(50% - 18px);
  min-width: 16px; height: 16px; border-radius: 99px;
  background: var(--danger); color: white;
  font-size: 0.6rem; font-weight: 700; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: var(--radius-sm);
  font-size: 0.95rem; font-weight: 600;
  transition: var(--transition); white-space: nowrap; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: var(--grad-primary); color: white; box-shadow: var(--glow); }
.btn-primary:active { transform: scale(0.97); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:active { background: rgba(124,58,237,0.1); }
.btn-ghost { background: var(--glass); color: var(--text-2); border: 1px solid var(--glass-border); }
.btn-ghost:active { background: var(--surface2); }
.btn-sm { padding: 8px 16px; font-size: 0.83rem; border-radius: var(--radius-xs); }
.btn-lg { padding: 16px 32px; font-size: 1.05rem; }
.btn-danger { background: var(--danger); color: white; }
.btn-block { width: 100%; }

/* ============================================
   HOME HERO — App Style
   ============================================ */
.home-hero {
  padding: 8px 0 20px;
  position: relative;
}
.home-hero-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 10% 60%, rgba(124,58,237,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 90% 10%, rgba(236,72,153,0.08) 0%, transparent 50%);
}
.home-hero-content { position: relative; z-index: 1; }

.home-greeting {
  font-size: 0.85rem; color: var(--text-3); font-weight: 500; margin-bottom: 2px;
}
.home-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em;
  margin-bottom: 16px; line-height: 1.2;
}
.home-title .grad {
  background: var(--grad-primary);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* App Search Bar */
.app-search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.app-search-bar input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 0.92rem; color: var(--text);
}
.app-search-bar input::placeholder { color: var(--text-3); }
.app-search-bar svg { color: var(--text-3); flex-shrink: 0; }
.app-search-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: var(--transition);
}
.app-search-btn:active { transform: scale(0.93); }

/* Stats Chips */
.stats-chips {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: none;
}
.stats-chips::-webkit-scrollbar { display: none; }
.stat-chip {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-full);
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.78rem; font-weight: 600; color: var(--text-2);
  white-space: nowrap;
}
.stat-chip .chip-num {
  background: var(--grad-primary);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  font-weight: 800;
}

/* ============================================
   CATEGORY PILLS — Horizontal Scroll
   ============================================ */
.cat-pills {
  display: flex; gap: 8px;
  overflow-x: auto; padding: 2px 0 8px;
  scrollbar-width: none; margin-bottom: 4px;
}
.cat-pills::-webkit-scrollbar { display: none; }
.cat-pill {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 7px;
  padding: 10px 18px; border-radius: var(--radius-full);
  background: var(--surface); border: 1.5px solid var(--border);
  font-size: 0.85rem; font-weight: 600; color: var(--text-2);
  cursor: pointer; transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.cat-pill.active {
  background: var(--grad-primary); border-color: transparent;
  color: white; box-shadow: var(--glow);
}
.cat-pill:active { transform: scale(0.95); }

/* Category feature cards (big) */
.cat-cards-row {
  display: flex; gap: 12px; overflow-x: auto; padding: 4px 0 8px;
  scrollbar-width: none;
}
.cat-cards-row::-webkit-scrollbar { display: none; }
.cat-feature-card {
  flex-shrink: 0; width: 140px; border-radius: var(--radius-lg);
  padding: 20px 16px; cursor: pointer;
  transition: var(--transition);
  position: relative; overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  -webkit-tap-highlight-color: transparent;
}
.cat-feature-card:active { transform: scale(0.96); }
.cat-feature-card .cat-icon { font-size: 2rem; margin-bottom: 8px; }
.cat-feature-card .cat-name { font-weight: 700; font-size: 0.88rem; margin-bottom: 2px; }
.cat-feature-card .cat-count { font-size: 0.73rem; color: var(--text-3); }
.cat-feature-card.room { background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(124,58,237,0.05)); border-color: rgba(124,58,237,0.25); }
.cat-feature-card.pg   { background: linear-gradient(135deg, rgba(236,72,153,0.15), rgba(236,72,153,0.05)); border-color: rgba(236,72,153,0.25); }
.cat-feature-card.job  { background: linear-gradient(135deg, rgba(6,182,212,0.15),  rgba(6,182,212,0.05));  border-color: rgba(6,182,212,0.25);  }

/* ============================================
   SECTION HEADER
   ============================================ */
.sec-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; padding-top: 8px;
}
.sec-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em;
}
.sec-title .grad {
  background: var(--grad-primary);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.sec-more {
  font-size: 0.8rem; font-weight: 600; color: var(--primary);
  display: flex; align-items: center; gap: 3px;
}

/* Filter tabs */
.filter-tabs {
  display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px;
  scrollbar-width: none; margin-bottom: 4px;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  flex-shrink: 0; padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.82rem; font-weight: 600;
  background: var(--surface); border: 1.5px solid var(--border);
  color: var(--text-2); cursor: pointer; transition: var(--transition);
}
.tab-btn.active {
  background: var(--primary); border-color: var(--primary);
  color: white; box-shadow: var(--glow);
}
.tab-btn:active { transform: scale(0.95); }

/* ============================================
   LISTING CARDS — App Style
   ============================================ */
.listings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 520px) {
  .listings-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .listings-grid { grid-template-columns: repeat(3, 1fr); }
}

.listing-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  cursor: pointer; transition: var(--transition);
  position: relative; -webkit-tap-highlight-color: transparent;
}
.listing-card:active { transform: scale(0.98); border-color: var(--border-light); }

.card-img-wrap { position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--bg3); }
.card-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.listing-card:hover .card-img-wrap img { transform: scale(1.04); }
.card-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 8px;
}
.placeholder-icon { font-size: 2.5rem; opacity: 0.4; }

/* Badge on card */
.badge {
  position: absolute; top: 10px; left: 10px;
  padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.02em;
  backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.15);
}
.badge-room { background: rgba(124,58,237,0.85); color: white; }
.badge-pg   { background: rgba(236,72,153,0.85); color: white; }
.badge-job  { background: rgba(6,182,212,0.85);  color: white; }

/* Save button */
.save-btn {
  position: absolute; top: 10px; right: 10px;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); border: 1px solid rgba(255,255,255,0.1);
  transition: var(--transition);
}
.save-btn.saved { color: var(--danger); }
.save-btn svg { width: 16px; height: 16px; }
.save-btn:active { transform: scale(0.88); }

/* Card body */
.card-body { padding: 12px 14px 14px; }
.card-price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem; font-weight: 700; color: var(--primary);
  margin-bottom: 4px;
}
.card-title {
  font-size: 0.9rem; font-weight: 600; line-height: 1.35;
  margin-bottom: 5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-location {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.77rem; color: var(--text-3); margin-bottom: 8px;
}
.card-amenities { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.amenity-tag {
  padding: 3px 8px; border-radius: var(--radius-full);
  background: var(--bg3); border: 1px solid var(--border);
  font-size: 0.68rem; color: var(--text-3);
}
.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 10px; border-top: 1px solid var(--border);
}
.card-poster { display: flex; align-items: center; gap: 6px; }
.poster-avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; background: var(--bg3); }
.card-poster span { font-size: 0.75rem; color: var(--text-2); font-weight: 500; }
.card-time { font-size: 0.72rem; color: var(--text-3); }

/* ============================================
   CITY CHIPS
   ============================================ */
.city-chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px;
  scrollbar-width: none;
}
.city-chips::-webkit-scrollbar { display: none; }
.city-chip {
  flex-shrink: 0; padding: 7px 16px;
  border-radius: var(--radius-full);
  background: var(--surface); border: 1.5px solid var(--border);
  font-size: 0.8rem; font-weight: 600; color: var(--text-2);
  cursor: pointer; transition: var(--transition);
}
.city-chip.active, .city-chip:active {
  border-color: var(--primary); color: var(--primary);
  background: rgba(124,58,237,0.1);
}

/* ============================================
   BROWSE PAGE
   ============================================ */
.browse-filters {
  position: sticky; top: var(--header-h); z-index: 100;
  background: rgba(7,7,15,0.96); backdrop-filter: blur(20px);
  padding: 10px 14px; margin: 0 -14px;
  border-bottom: 1px solid var(--glass-border);
}
.browse-search-row {
  display: flex; gap: 8px; margin-bottom: 10px;
}
.browse-search-row .app-search-bar { flex: 1; margin-bottom: 0; }
.filter-btn {
  width: 46px; height: 46px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); flex-shrink: 0; transition: var(--transition);
}
.filter-btn.active { background: rgba(124,58,237,0.15); border-color: var(--primary); color: var(--primary); }

/* Advanced filter drawer */
.filter-drawer {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
  margin-bottom: 12px; display: none;
}
.filter-drawer.open { display: block; }
.filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.filter-group label { font-size: 0.75rem; color: var(--text-3); font-weight: 600; margin-bottom: 4px; display: block; }
.filter-select, .filter-input {
  width: 100%; padding: 9px 12px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 0.85rem; outline: none; transition: var(--transition);
}
.filter-select:focus, .filter-input:focus { border-color: var(--primary); }
.filter-select option { background: var(--bg3); }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 8px; padding: 20px 0 8px; }
.page-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.85rem; font-weight: 600; color: var(--text-2);
  transition: var(--transition);
}
.page-btn.active { background: var(--primary); border-color: var(--primary); color: white; }
.page-btn:active { transform: scale(0.93); }

/* ============================================
   LISTING DETAIL PAGE
   ============================================ */
.detail-page { padding: 0; }

.detail-gallery { position: relative; aspect-ratio: 4/3; overflow: hidden; border-radius: 0 0 var(--radius-xl) var(--radius-xl); background: var(--bg3); }
.gallery-main { width: 100%; height: 100%; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-no-img {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  font-size: 4rem;
}
.gallery-thumbs {
  display: flex; gap: 6px; padding: 10px 14px 0;
  overflow-x: auto; scrollbar-width: none;
}
.gallery-thumbs::-webkit-scrollbar { display: none; }
.gallery-thumb {
  flex-shrink: 0; width: 52px; height: 52px; border-radius: var(--radius-sm);
  overflow: hidden; border: 2px solid transparent; cursor: pointer;
  transition: var(--transition);
}
.gallery-thumb.active { border-color: var(--primary); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Back + actions bar overlay on gallery */
.detail-topbar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent);
}
.detail-back-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  color: white; border: 1px solid rgba(255,255,255,0.15);
}
.detail-topbar-actions { display: flex; gap: 8px; }

.detail-body { padding: 16px 14px 0; }

.detail-price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem; font-weight: 800; color: var(--primary);
  margin-bottom: 4px;
}
.detail-title {
  font-size: 1.1rem; font-weight: 700; line-height: 1.35;
  margin-bottom: 10px;
}
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.detail-meta-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.8rem; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border);
  padding: 5px 11px; border-radius: var(--radius-full);
}
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.detail-tag {
  padding: 5px 12px; border-radius: var(--radius-full);
  background: var(--bg3); border: 1px solid var(--border);
  font-size: 0.78rem; color: var(--text-2);
}
.detail-desc {
  font-size: 0.9rem; color: var(--text-2); line-height: 1.7;
  margin-bottom: 16px; white-space: pre-wrap;
}
.detail-amenities { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.detail-amenity {
  padding: 6px 14px; border-radius: var(--radius-full);
  background: rgba(124,58,237,0.1); border: 1px solid rgba(124,58,237,0.25);
  font-size: 0.8rem; color: var(--primary-light); font-weight: 500;
}

/* Poster card */
.poster-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 12px;
}
.poster-avatar-lg {
  width: 50px; height: 50px; border-radius: 50%;
  border: 2px solid var(--primary); object-fit: cover;
  background: var(--bg3); flex-shrink: 0;
}
.poster-name { font-weight: 700; font-size: 0.95rem; }
.poster-since { font-size: 0.75rem; color: var(--text-3); margin-top: 2px; }

/* Contact buttons (sticky at bottom of detail page) */
.detail-contact-bar {
  position: sticky; bottom: calc(var(--bottom-nav-h) + 8px + env(safe-area-inset-bottom, 0px));
  left: 0; right: 0; z-index: 200;
  padding: 12px 14px;
  background: rgba(7,7,15,0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  display: flex; gap: 10px;
  margin: 0 -14px;
}
.whatsapp-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px; border-radius: var(--radius);
  background: #25d366; color: white;
  font-size: 0.92rem; font-weight: 700;
  transition: var(--transition);
}
.whatsapp-btn:active { transform: scale(0.97); }
.call-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px; border-radius: var(--radius);
  background: var(--surface); border: 1.5px solid var(--border);
  color: var(--text); font-size: 0.92rem; font-weight: 700;
  transition: var(--transition);
}
.call-btn:active { transform: scale(0.97); }

/* Related section */
.related-section { padding: 20px 0 8px; }

/* Views badge */
.views-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: var(--radius-full);
  background: var(--bg3); font-size: 0.75rem; color: var(--text-3);
}
.share-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-full);
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.8rem; color: var(--text-2); cursor: pointer; transition: var(--transition);
}
.share-btn:active { border-color: var(--primary); color: var(--primary); }
.share-btn.saved { color: var(--danger); border-color: var(--danger); }

/* ============================================
   FORMS (Post Ad, Auth)
   ============================================ */
.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 20px;
  margin-bottom: 16px;
}
.form-card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem; font-weight: 700; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px; color: var(--text-2);
}
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 0.82rem; font-weight: 600;
  color: var(--text-2); margin-bottom: 7px;
}
.form-label span { color: var(--danger); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 13px 14px;
  background: var(--bg3); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 0.92rem; outline: none; transition: var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}
.form-select option { background: var(--bg3); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: 0.75rem; color: var(--text-3); margin-top: 5px; }
.form-error {
  font-size: 0.82rem; color: var(--danger); margin-top: 6px;
  padding: 8px 12px; background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2); border-radius: var(--radius-sm);
  display: none;
}
.form-error.show { display: block; }

/* Type toggle */
.type-toggle { display: flex; gap: 8px; margin-bottom: 0; }
.type-btn {
  flex: 1; padding: 12px 8px; border-radius: var(--radius);
  background: var(--bg3); border: 2px solid var(--border);
  font-size: 0.85rem; font-weight: 600; color: var(--text-2);
  text-align: center; cursor: pointer; transition: var(--transition);
}
.type-btn.active { border-color: var(--primary); color: var(--primary); background: rgba(124,58,237,0.1); }

/* Image upload */
.img-upload-area {
  border: 2px dashed var(--border); border-radius: var(--radius-lg);
  padding: 24px; text-align: center; cursor: pointer;
  transition: var(--transition);
}
.img-upload-area:hover, .img-upload-area.drag-over {
  border-color: var(--primary); background: rgba(124,58,237,0.05);
}
.img-upload-icon { font-size: 2rem; margin-bottom: 8px; }
.img-upload-text { font-size: 0.85rem; color: var(--text-3); }
.img-previews { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.img-preview {
  width: 70px; height: 70px; border-radius: var(--radius-sm);
  overflow: hidden; position: relative; border: 2px solid var(--border);
}
.img-preview img { width: 100%; height: 100%; object-fit: cover; }
.img-preview-rm {
  position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--danger); color: white;
  font-size: 0.65rem; display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

/* Amenities */
.amenities-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.amenity-check {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  background: var(--bg3); border: 1.5px solid var(--border);
  cursor: pointer; transition: var(--transition); font-size: 0.82rem;
  -webkit-tap-highlight-color: transparent;
}
.amenity-check.checked { border-color: var(--primary); background: rgba(124,58,237,0.1); color: var(--primary); }
.amenity-check input { display: none; }

/* ============================================
   AUTH PAGE
   ============================================ */
.auth-page {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 80px 16px 32px;
}
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 28px 24px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  text-align: center; margin-bottom: 24px;
}
.auth-logo .logo-icon {
  width: 56px; height: 56px; border-radius: 18px;
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; margin: 0 auto 12px;
}
.auth-logo h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem; font-weight: 800;
}
.auth-logo p { font-size: 0.85rem; color: var(--text-3); margin-top: 4px; }

.auth-tabs {
  display: flex; background: var(--bg3); border-radius: var(--radius-sm);
  padding: 4px; margin-bottom: 22px; gap: 4px;
}
.auth-tab {
  flex: 1; padding: 9px; border-radius: var(--radius-xs);
  text-align: center; font-size: 0.88rem; font-weight: 600;
  cursor: pointer; color: var(--text-3); transition: var(--transition);
}
.auth-tab.active { background: var(--primary); color: white; box-shadow: var(--glow); }

.auth-form { display: none; }
.auth-form.active { display: block; }
.auth-submit {
  width: 100%; margin-top: 4px; padding: 14px;
  background: var(--grad-primary); color: white;
  font-size: 0.95rem; font-weight: 700; border-radius: var(--radius);
  box-shadow: var(--glow); transition: var(--transition);
}
.auth-submit:active { transform: scale(0.98); }
.auth-divider {
  text-align: center; position: relative; margin: 18px 0;
  font-size: 0.78rem; color: var(--text-3);
}
.auth-divider::before {
  content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px;
  background: var(--border); transform: translateY(-50%); z-index: 0;
}
.auth-divider span, .auth-divider {
  background: var(--surface); padding: 0 12px; position: relative; z-index: 1;
}

/* ============================================
   PROFILE PAGE
   ============================================ */
.profile-hero {
  padding: 12px 0 20px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 10px;
}
.profile-avatar-xl {
  width: 80px; height: 80px; border-radius: 50%;
  border: 3px solid var(--primary); object-fit: cover;
  background: var(--bg3); box-shadow: var(--glow);
}
.profile-name { font-family: 'Space Grotesk', sans-serif; font-size: 1.2rem; font-weight: 800; }
.profile-email { font-size: 0.82rem; color: var(--text-3); }
.profile-phone { font-size: 0.8rem; color: var(--text-3); margin-top: 2px; }

/* Stats strip */
.stats-strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 20px;
}
.stat-item {
  padding: 14px 8px; text-align: center;
  border-right: 1px solid var(--border);
}
.stat-item:last-child { border-right: none; }
.stat-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem; font-weight: 800;
  background: var(--grad-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-lbl { font-size: 0.65rem; color: var(--text-3); margin-top: 2px; font-weight: 500; }

/* Profile tabs */
.profile-tabs {
  display: flex; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 4px; gap: 4px; margin-bottom: 18px;
}
.profile-tab {
  flex: 1; padding: 9px 6px; text-align: center; border-radius: var(--radius-sm);
  font-size: 0.78rem; font-weight: 600; color: var(--text-3);
  cursor: pointer; transition: var(--transition);
}
.profile-tab.active { background: var(--primary); color: white; box-shadow: var(--glow); }

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.karoha-toast {
  position: fixed; bottom: calc(var(--bottom-nav-h) + 16px + env(safe-area-inset-bottom, 0px));
  left: 50%; transform: translateX(-50%) translateY(20px);
  z-index: 9999; opacity: 0; transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: calc(100vw - 32px); width: max-content;
  pointer-events: none;
}
.karoha-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.karoha-toast > div, .karoha-toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: var(--radius-full);
  background: var(--surface3); border: 1px solid var(--border-light);
  backdrop-filter: blur(20px); font-size: 0.88rem; font-weight: 600;
  box-shadow: var(--shadow-lg);
}
.toast-success { border-color: rgba(16,185,129,0.4); }
.toast-error   { border-color: rgba(239,68,68,0.4);  }
.toast-info    { border-color: rgba(6,182,212,0.4);   }
.toast-icon { font-size: 1rem; }

/* ============================================
   CONTACT MODAL
   ============================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  width: 100%; max-width: 520px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 20px 20px calc(28px + env(safe-area-inset-bottom, 0px));
  position: relative; animation: slideUpSheet 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90dvh; overflow-y: auto;
}
@keyframes slideUpSheet {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.modal-handle {
  width: 40px; height: 4px; border-radius: 2px;
  background: var(--border-light); margin: 0 auto 16px;
}
.modal-close {
  position: absolute; top: 14px; right: 16px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg3); border: 1px solid var(--border);
  font-size: 0.85rem; color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
}
.modal-poster {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
  padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.modal-poster img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: var(--bg3); }
.modal-poster-name { font-weight: 700; font-size: 0.95rem; }
.modal-poster-listing { font-size: 0.78rem; color: var(--text-3); margin-top: 2px; }
.modal-phone-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 12px;
}
.modal-phone-num { font-family: 'Space Grotesk'; font-size: 1rem; font-weight: 700; letter-spacing: 1px; }
.reveal-btn {
  font-size: 0.75rem; font-weight: 700; color: var(--primary);
  padding: 5px 12px; border-radius: var(--radius-full);
  background: rgba(124,58,237,0.1); border: 1px solid rgba(124,58,237,0.25);
}
.modal-warn {
  display: flex; align-items: flex-start; gap: 8px;
  background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 14px;
  font-size: 0.78rem; color: var(--warning); line-height: 1.5;
}
.modal-actions { display: flex; flex-direction: column; gap: 10px; }
.modal-wa-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px; border-radius: var(--radius);
  background: #25d366; color: white; font-size: 0.92rem; font-weight: 700;
  transition: var(--transition);
}
.modal-wa-btn:active { transform: scale(0.97); }
.modal-chat-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px; border-radius: var(--radius);
  background: var(--surface2); border: 1.5px solid var(--border-light);
  color: var(--text); font-size: 0.88rem; font-weight: 600;
  transition: var(--transition);
}
.modal-chat-btn:active { transform: scale(0.97); }
.modal-login-prompt { text-align: center; padding: 16px 0; }
.modal-login-prompt .lock-icon { font-size: 2.5rem; margin-bottom: 12px; }
.modal-login-prompt h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.modal-login-prompt p { font-size: 0.82rem; color: var(--text-2); margin-bottom: 16px; }
.btn-row { display: flex; gap: 10px; justify-content: center; }

/* Chat input */
.chat-input-wrap { margin-top: 14px; display: none; }
.chat-input-wrap label { font-size: 0.8rem; font-weight: 600; color: var(--text-2); margin-bottom: 7px; display: block; }
.chat-textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--bg3); border: 1.5px solid var(--border);
  color: var(--text); min-height: 90px; resize: vertical;
  outline: none; transition: var(--transition);
}
.chat-textarea:focus { border-color: var(--primary); }
.chat-send-btn {
  width: 100%; margin-top: 10px; padding: 13px;
  background: var(--grad-primary); color: white;
  font-size: 0.9rem; font-weight: 700; border-radius: var(--radius);
  box-shadow: var(--glow); transition: var(--transition);
}
.chat-send-btn:active { transform: scale(0.97); }
.chat-send-btn:disabled { opacity: 0.6; }

/* ============================================
   MESSAGES INBOX
   ============================================ */
.msg-list { display: flex; flex-direction: column; gap: 10px; }
.msg-thread-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px;
  cursor: pointer; display: flex; gap: 12px; align-items: center;
  transition: var(--transition);
}
.msg-thread-card:active { transform: scale(0.98); background: var(--surface2); }
.msg-thread-card.unread { border-color: rgba(124,58,237,0.35); }
.convo-messages {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 380px; overflow-y: auto; padding: 4px 0; margin-bottom: 16px;
}
.msg-bubble { max-width: 80%; padding: 10px 14px; border-radius: 18px; font-size: 0.88rem; line-height: 1.5; }
.msg-bubble.mine { background: var(--grad-primary); color: white; border-radius: 18px 18px 4px 18px; align-self: flex-end; }
.msg-bubble.theirs { background: var(--surface2); color: var(--text); border-radius: 18px 18px 18px 4px; align-self: flex-start; }
.convo-reply { display: flex; gap: 10px; align-items: flex-end; }
.convo-reply textarea {
  flex: 1; padding: 10px 14px; border-radius: var(--radius); background: var(--bg3);
  border: 1px solid var(--border); color: var(--text); font: inherit; resize: none; height: 52px; outline: none;
}

/* ============================================
   LOADER / EMPTY STATE
   ============================================ */
.loader-wrap {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; gap: 14px; grid-column: 1/-1;
}
.spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--primary);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-wrap p { font-size: 0.85rem; color: var(--text-3); }
.empty-state {
  text-align: center; padding: 60px 20px; grid-column: 1/-1;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.empty-icon { font-size: 3rem; opacity: 0.5; }
.empty-state h3 { font-size: 1rem; font-weight: 700; }
.empty-state p { font-size: 0.85rem; color: var(--text-2); }

/* ============================================
   DROPDOWN
   ============================================ */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 180px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px; z-index: 500; display: none;
  box-shadow: var(--shadow-lg);
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 0.88rem; cursor: pointer; transition: var(--transition); color: var(--text-2);
}
.dropdown-item:hover { background: var(--surface3); color: var(--text); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 24px 16px; margin-bottom: 0;
}
.footer-bottom { text-align: center; font-size: 0.78rem; color: var(--text-3); }
.footer-bottom .grad {
  background: var(--grad-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes slideUp   { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn    { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn   { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes pulse     { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.6; transform: scale(0.85); } }

.animate-on-scroll { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.animate-on-scroll.visible { opacity: 1; transform: translateY(0); }
.stagger-grid .listing-card:nth-child(1) { animation-delay: 0.05s; }
.stagger-grid .listing-card:nth-child(2) { animation-delay: 0.10s; }
.stagger-grid .listing-card:nth-child(3) { animation-delay: 0.15s; }
.stagger-grid .listing-card:nth-child(4) { animation-delay: 0.20s; }
.stagger-grid .listing-card:nth-child(5) { animation-delay: 0.25s; }
.stagger-grid .listing-card:nth-child(6) { animation-delay: 0.30s; }

/* Gradient text helper */
.grad { background: var(--grad-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* ============================================
   DESKTOP OVERRIDE (> 768px)
   ============================================ */
@media (min-width: 768px) {
  :root { --header-h: 64px; }
  .page-content {
    max-width: 1060px;
    padding-left: 32px;
    padding-right: 32px;
    padding-top: calc(var(--header-h) + 24px);
  }
  .app-header { height: var(--header-h); padding: 0 32px; }
  .app-header-inner { max-width: 1060px; }

  /* Hide bottom nav, restore body padding */
  .bottom-nav { display: none !important; }
  body { padding-bottom: 0; }

  /* Desktop top navbar links */
  .desktop-nav-links {
    display: flex !important; align-items: center; gap: 2px; margin-left: 24px;
  }
  .desktop-nav-links a {
    padding: 7px 14px; border-radius: var(--radius-sm);
    font-size: 0.875rem; font-weight: 500; color: var(--text-2);
    transition: var(--transition); white-space: nowrap;
  }
  .desktop-nav-links a:hover { color: var(--text); background: var(--glass); }
  .desktop-nav-links a.active { color: var(--primary); background: rgba(124,58,237,0.1); }
  .desktop-nav-links .post-link {
    background: var(--grad-primary); color: white !important;
    padding: 8px 18px; border-radius: var(--radius-full);
    font-weight: 700; box-shadow: var(--glow); margin-left: 6px;
  }
  .desktop-nav-links .post-link:hover { opacity: 0.9; }

  /* Desktop user area in header */
  .desktop-user-area { display: flex !important; align-items: center; gap: 10px; margin-left: 16px; }
  .desktop-user-area .nav-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary); cursor: pointer; }
  .desktop-user-area .nav-name { font-size: 0.85rem; font-weight: 600; color: var(--text-2); }

  /* Listings grid */
  .listings-grid { gap: 20px; }

  /* Listing detail — 2 column sidebar layout */
  .detail-page-wrap {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 28px;
    align-items: start;
    max-width: 1060px;
    margin: 0 auto;
    padding: calc(var(--header-h) + 24px) 32px 40px;
  }
  .detail-main-col { min-width: 0; }
  .detail-sidebar-col {
    position: sticky; top: calc(var(--header-h) + 16px);
  }
  .detail-sidebar-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-xl); padding: 22px;
    box-shadow: var(--shadow);
  }
  .detail-sidebar-card .detail-price { font-size: 1.5rem; margin-bottom: 8px; }
  .detail-sidebar-card .detail-title { font-size: 0.95rem; margin-bottom: 14px; color: var(--text-2); }
  .detail-contact-bar {
    position: static; background: none; border: none;
    padding: 0; margin: 0; flex-direction: column; gap: 10px;
  }
  .detail-gallery { border-radius: var(--radius-xl); aspect-ratio: 16/9; }
  .detail-gallery .gallery-main { border-radius: var(--radius-xl); aspect-ratio: 16/9; }

  /* Browse filters */
  .browse-filters { top: var(--header-h); }

  /* Modal centered on desktop */
  .modal-box { border-radius: var(--radius-xl); max-width: 480px; margin: auto; }
  .modal-overlay { align-items: center; }

  /* Profile */
  .profile-layout-desktop {
    display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: start;
  }
  .profile-sidebar-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-xl); padding: 24px;
    position: sticky; top: calc(var(--header-h) + 16px);
  }
  .profile-sidebar-card .profile-hero { padding: 0 0 16px; }

  /* Form sections wider */
  .form-section { border-radius: var(--radius-xl); }
}

@media (min-width: 1200px) {
  .page-content { max-width: 1200px; }
  .app-header-inner { max-width: 1200px; }
  .detail-page-wrap { max-width: 1200px; padding-left: 40px; padding-right: 40px; }
}

/* ============================================
   POST-AD SPECIFIC
   ============================================ */
.post-ad-header {
  padding: 8px 0 20px;
}
.post-ad-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem; font-weight: 800;
}

/* ============================================
   REPORT BTN
   ============================================ */
.report-btn { background: none; border: none; color: var(--text-3); font-size: 0.78rem; cursor: pointer; padding: 4px 0; }
.report-btn:hover { color: var(--danger); }

/* ============================================
   BACK BUTTON
   ============================================ */
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-2); font-size: 0.88rem; margin-bottom: 16px;
  cursor: pointer; padding: 8px 0;
}
.back-btn:active { color: var(--text); }

/* ============================================
   PHOTO UPLOAD — Feature Image
   ============================================ */
.img-preview-grid {
  display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px;
}
.img-preview-item {
  position: relative; width: 90px; height: 90px;
  border-radius: var(--radius-sm); overflow: visible;
  border: 2px solid var(--border); transition: var(--transition);
  flex-shrink: 0;
}
.img-preview-item.featured {
  border-color: #f59e0b; box-shadow: 0 0 0 2px rgba(245,158,11,0.35);
}
.img-preview-item img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: calc(var(--radius-sm) - 2px);
  display: block;
}
.img-remove {
  position: absolute; top: -8px; right: -8px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--danger); color: white;
  font-size: 0.7rem; display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 2; border: 2px solid var(--bg);
  transition: var(--transition);
}
.img-remove:hover { transform: scale(1.15); }
.img-feature-btn {
  position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface3); border: 2px solid var(--border);
  color: var(--text-3); font-size: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 2; transition: var(--transition);
}
.img-feature-btn:hover { background: var(--surface2); }
.img-preview-item.featured .img-feature-btn {
  background: #f59e0b; border-color: #f59e0b; color: white;
}
.featured-badge {
  position: absolute; top: 4px; left: 4px;
  background: #f59e0b; color: white;
  font-size: 0.58rem; font-weight: 800;
  padding: 2px 6px; border-radius: var(--radius-full);
  letter-spacing: 0.04em; pointer-events: none;
}
.upload-icon { font-size: 2rem; margin-bottom: 8px; }
.upload-text { font-size: 0.85rem; color: var(--text-2); }

/* ============================================
   PROFILE EDIT MODAL
   ============================================ */
.edit-profile-modal {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.edit-profile-modal.hidden { display: none; }
.edit-profile-box {
  width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 24px;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.edit-profile-box h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem; font-weight: 700; margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.avatar-upload-circle {
  width: 80px; height: 80px; border-radius: 50%;
  border: 3px dashed var(--border-light); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; margin: 0 auto 16px; position: relative;
  transition: var(--transition);
}
.avatar-upload-circle:hover { border-color: var(--primary); }
.avatar-upload-circle img { width: 100%; height: 100%; object-fit: cover; }
.avatar-upload-circle .avatar-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: var(--transition); font-size: 1.2rem;
  border-radius: 50%;
}
.avatar-upload-circle:hover .avatar-overlay { opacity: 1; }

/* ============================================
   REALTIME CHAT
   ============================================ */
.chat-window {
  display: flex; flex-direction: column;
  height: 420px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden;
}
.chat-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  background: var(--surface); flex-shrink: 0;
}
.chat-header img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--bg3); }
.chat-header-info .chat-name { font-weight: 700; font-size: 0.88rem; }
.chat-header-info .chat-sub { font-size: 0.72rem; color: var(--text-3); }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 3px; }
.chat-input-bar {
  display: flex; gap: 8px; padding: 10px 12px;
  border-top: 1px solid var(--border); background: var(--surface); flex-shrink: 0;
}
.chat-input-bar input {
  flex: 1; background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px;
  color: var(--text); font-size: 0.88rem; outline: none;
  transition: var(--transition);
}
.chat-input-bar input:focus { border-color: var(--primary); }
.chat-send {
  width: 42px; height: 42px; border-radius: var(--radius);
  background: var(--grad-primary); color: white;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: var(--transition); box-shadow: var(--glow);
}
.chat-send:active { transform: scale(0.9); }
.chat-send:disabled { opacity: 0.5; }
.chat-typing { font-size: 0.72rem; color: var(--text-3); padding: 4px 14px; min-height: 20px; }
.chat-date-divider {
  text-align: center; font-size: 0.7rem; color: var(--text-3);
  padding: 4px 0; margin: 4px 0;
}

/* ============================================
   ADMIN PANEL
   ============================================ */
.admin-layout {
  display: flex; min-height: 100dvh; padding-top: var(--header-h);
}
.admin-sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 20px 12px; position: fixed; top: var(--header-h); bottom: 0;
  overflow-y: auto; z-index: 50;
}
.admin-content {
  flex: 1; margin-left: 220px; padding: 24px 28px 40px;
  min-width: 0;
}
.admin-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500; color: var(--text-2);
  cursor: pointer; transition: var(--transition); margin-bottom: 2px;
}
.admin-nav-item:hover { background: var(--glass); color: var(--text); }
.admin-nav-item.active { background: rgba(124,58,237,0.15); color: var(--primary); font-weight: 700; }
.admin-stat-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px; margin-bottom: 28px;
}
.admin-stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px 16px;
}
.admin-stat-card .num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem; font-weight: 800;
  background: var(--grad-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.admin-stat-card .lbl { font-size: 0.78rem; color: var(--text-3); margin-top: 2px; }
.admin-table-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 24px;
}
.admin-table-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.admin-table-head h3 { font-size: 0.95rem; font-weight: 700; }
table.admin-table {
  width: 100%; border-collapse: collapse; font-size: 0.83rem;
}
table.admin-table th {
  text-align: left; padding: 10px 14px;
  background: var(--bg3); color: var(--text-3);
  font-weight: 600; font-size: 0.75rem; white-space: nowrap;
}
table.admin-table td {
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  color: var(--text-2); vertical-align: middle;
}
table.admin-table tr:last-child td { border-bottom: none; }
table.admin-table tr:hover td { background: var(--glass); }
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 0.72rem; font-weight: 700;
}
.status-active   { background: rgba(16,185,129,0.15); color: var(--success); }
.status-inactive { background: rgba(239,68,68,0.15);  color: var(--danger); }
.status-admin    { background: rgba(124,58,237,0.15); color: var(--primary); }
.admin-action-btn {
  padding: 5px 12px; border-radius: var(--radius-xs);
  font-size: 0.75rem; font-weight: 600; cursor: pointer; transition: var(--transition);
  background: var(--glass); border: 1px solid var(--border); color: var(--text-2);
  margin-right: 4px;
}
.admin-action-btn:hover { background: var(--surface2); color: var(--text); }
.admin-action-btn.danger { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.25); color: var(--danger); }
.admin-action-btn.danger:hover { background: rgba(239,68,68,0.2); }
.admin-search {
  padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); font-size: 0.85rem; outline: none; width: 220px;
}
.admin-search:focus { border-color: var(--primary); }

@media (max-width: 767px) {
  .admin-sidebar { width: 100%; position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; }
  .admin-content { margin-left: 0; padding: 16px; }
  .admin-layout { flex-direction: column; }
}


/* ============================================
   POST-AD PAGE — Form Sections & Steps
   ============================================ */
.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  margin-bottom: 16px;
}
.form-section-title {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 0.95rem;
  margin-bottom: 18px; color: var(--text);
}
.step-num {
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--grad-primary);
  color: white;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 800;
}

/* Form grid layout (2-col on wider screens) */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-full { grid-column: 1 / -1; }
@media (max-width: 480px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-full { grid-column: 1; }
}

/* ---- Category Type Selector ---- */
.type-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.type-option { display: none; }   /* hide native radio */
.type-label {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 14px 8px;
  border: 2px solid var(--border); border-radius: var(--radius-lg);
  cursor: pointer; transition: var(--transition);
  background: var(--bg3); text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.type-label:hover { border-color: rgba(124,58,237,0.4); background: rgba(124,58,237,0.04); }
.type-option:checked + .type-label {
  border-color: var(--primary);
  background: rgba(124,58,237,0.1);
  color: var(--primary);
}
.type-icon { font-size: 1.8rem; line-height: 1; }
.type-name { font-weight: 700; font-size: 0.82rem; }

/* ---- Amenity Pills (checkbox-based) ---- */
.amenity-check { display: none; }   /* hide native checkbox */
.amenity-pill {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  background: var(--bg3); border: 1.5px solid var(--border);
  cursor: pointer; transition: var(--transition);
  font-size: 0.8rem; text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.amenity-pill:hover { border-color: rgba(124,58,237,0.4); }
.amenity-check:checked + .amenity-pill {
  border-color: var(--primary);
  background: rgba(124,58,237,0.1);
  color: var(--primary);
}

/* ---- Upload area icon/text aliases ---- */
.upload-icon { font-size: 2rem; margin-bottom: 8px; }
.upload-text  { font-size: 0.85rem; color: var(--text-3); }
.img-upload-area input[type="file"] { display: none; }


/* ============================================
   FULL-PAGE CHAT  (chat.html — WhatsApp style)
   ============================================ */

/* Body override for chat page */
.chat-page-body {
  padding: 0 !important;
  overflow: hidden;
}
.chat-page-body .bottom-nav,
.chat-page-body .app-header { display: none !important; }

/* Outer wrapper — full viewport height */
.cp-wrap {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  height: -webkit-fill-available;
  max-height: 100dvh;
  background: var(--bg);
  overflow: hidden;
}

/* ── Header ── */
.cp-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-height: 62px;
  z-index: 10;
}
.cp-back {
  width: 36px; height: 36px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: none; border: none;
  color: var(--text); cursor: pointer;
  transition: var(--transition);
}
.cp-back:hover { background: var(--glass); }

.cp-header-avatar-wrap {
  position: relative; flex-shrink: 0;
}
.cp-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  object-fit: cover; background: var(--bg3);
  border: 2px solid var(--border);
  display: block;
}
.cp-online-dot {
  position: absolute; bottom: 1px; right: 1px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--surface);
}

.cp-header-info { flex: 1; min-width: 0; }
.cp-header-name {
  font-weight: 700; font-size: 0.92rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cp-header-listing {
  font-size: 0.72rem; color: var(--primary);
  text-decoration: none; display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 1px;
}
.cp-header-listing:hover { text-decoration: underline; }

.cp-header-actions { flex-shrink: 0; }
.cp-listing-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--text-2);
  transition: var(--transition);
}
.cp-listing-btn:hover { background: var(--glass); color: var(--text); }

/* Name shimmer skeleton */
.cp-name-shimmer {
  display: inline-block; width: 100px; height: 14px;
  background: var(--glass);
  border-radius: var(--radius-xs);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0%   { opacity: 0.4; }
  50%  { opacity: 0.9; }
  100% { opacity: 0.4; }
}

/* ── Messages area ── */
.cp-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scroll-behavior: smooth;
  background: var(--bg);
}
.cp-msgs::-webkit-scrollbar { width: 3px; }
.cp-msgs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Loading */
.cp-loading {
  flex: 1; display: flex;
  align-items: center; justify-content: center;
  padding: 40px 0;
}

/* Empty state */
.cp-empty {
  flex: 1;
  flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; color: var(--text-2);
  padding: 40px 20px;
  display: none;
}
.cp-empty.show { display: flex; }

/* Date separator */
.cp-date-sep {
  align-self: center;
  font-size: 0.7rem; color: var(--text-3);
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 3px 12px;
  margin: 8px 0;
}

/* ── Bubbles ── */
.cp-bubble {
  max-width: 74%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: bubbleIn 0.18s ease;
}
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cp-bubble.mine   { align-self: flex-end;   align-items: flex-end; }
.cp-bubble.theirs { align-self: flex-start; align-items: flex-start; }
.cp-bubble.sending { opacity: 0.65; }

.cp-text {
  padding: 10px 14px;
  font-size: 0.9rem; line-height: 1.5;
  word-break: break-word; white-space: pre-wrap;
}
.cp-bubble.mine .cp-text {
  background: var(--grad-primary);
  color: white;
  border-radius: 18px 18px 4px 18px;
}
.cp-bubble.theirs .cp-text {
  background: var(--surface2);
  color: var(--text);
  border-radius: 18px 18px 18px 4px;
}

.cp-time {
  font-size: 0.63rem; color: var(--text-3);
  padding: 0 6px; display: flex; align-items: center; gap: 3px;
}
.cp-tick { color: #53d769; font-size: 0.7rem; }

/* ── Input bar ── */
.cp-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.cp-input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 11px 18px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
  min-width: 0;
}
.cp-input:focus { border-color: var(--primary); }
.cp-input::placeholder { color: var(--text-3); }

.cp-send {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--grad-primary);
  color: white;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: none; cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--glow);
}
.cp-send:hover  { transform: scale(1.05); }
.cp-send:active { transform: scale(0.92); }
.cp-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Desktop — slightly wider bubbles and padding */
@media (min-width: 768px) {
  .cp-wrap { max-width: 700px; margin: 0 auto; }
  .cp-bubble { max-width: 60%; }
  .cp-msgs { padding: 20px 24px; }
}
