/* ============================================================
   CARENEST — Modern Stylesheet v3
   Warm organic + clean modern: earthy tones, crisp UI
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,600;0,700;1,500&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* ── Root Variables ─────────────────────────────────────── */
:root {
  --bg:        #f8f4ef;
  --bg2:       #efe9de;
  --surface:   #fffcf8;
  --border:    #e2d5c3;
  --border2:   #d0c0a8;
  --text:      #1e140a;
  --text2:     #5a3e28;
  --text3:     #967860;
  --accent:    #c04515;
  --accent2:   #e09020;
  --accent-lt: #fdf0e8;
  --green:     #2e6644;
  --green-lt:  #d0e8d8;
  --amber:     #d89020;
  --amber-lt:  #fef3d0;
  --red-lt:    #fde8de;
  --purple:    #7040c0;
  --purple-lt: #f0e8fc;
  --shadow-sm: 0 2px 8px rgba(50,20,0,.07);
  --shadow:    0 4px 20px rgba(50,20,0,.10);
  --shadow-lg: 0 12px 40px rgba(50,20,0,.16);
  --shadow-xl: 0 24px 60px rgba(50,20,0,.20);
  --r:         16px;
  --r-sm:      10px;
  --r-xs:      6px;
  --font-head: 'Playfair Display', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --navbar-h:  64px;
  --sidebar-w: 260px;
}

/* ── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font-family: var(--font-body); font-size: 15px; }
::selection { background: rgba(192,69,21,.18); }

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; font-weight: 700; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 200;
  height: var(--navbar-h);
  background: rgba(248,244,239,.94);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  padding: 0 clamp(16px, 4%, 40px);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.navbar-brand {
  font-family: var(--font-head);
  font-size: 1.5rem; font-weight: 700;
  color: var(--accent); letter-spacing: -.02em;
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap; flex-shrink: 0;
}
.navbar-brand i { font-size: 1.1rem; }
.navbar-links { display: flex; align-items: center; gap: 6px; }
.navbar-links a { color: var(--text2); font-size: .88rem; font-weight: 500; transition: color .2s; padding: 4px 6px; border-radius: var(--r-xs); }
.navbar-links a:hover { color: var(--accent); }
.btn-nav {
  background: var(--accent); color: white !important;
  padding: 8px 18px; border-radius: 50px;
  transition: background .2s, transform .15s, box-shadow .2s; font-weight: 600 !important;
}
.btn-nav:hover { background: #a03010; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(192,69,21,.35); }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 50px; padding: 4px 12px 4px 4px;
  cursor: pointer; transition: border-color .2s;
}
.user-chip:hover { border-color: var(--border2); }
.user-chip .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--amber));
  color: white; display: grid; place-items: center;
  font-size: .7rem; font-weight: 700;
}
.user-chip span { font-size: .83rem; color: var(--text2); font-weight: 500; }

/* Mobile hamburger */
.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 6px;
  border-radius: var(--r-xs);
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text2); border-radius: 2px; transition: all .25s; }
.nav-toggle:hover span { background: var(--accent); }

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  padding: clamp(40px, 8vw, 90px) clamp(20px, 5%, 60px);
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 60px; align-items: center;
  max-width: 1280px; margin: 0 auto;
}
.hero-text .tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--amber-lt); color: var(--amber);
  border: 1px solid #f0c860; border-radius: 50px;
  font-size: .75rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; padding: 5px 14px; margin-bottom: 20px;
}
.hero-text h1 { color: var(--text); margin-bottom: 18px; }
.hero-text h1 em { color: var(--accent); font-style: italic; }
.hero-text p { color: var(--text2); font-size: 1.05rem; max-width: 480px; margin-bottom: 32px; line-height: 1.75; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-visual { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hero-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 20px; box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s;
}
.hero-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.hero-card:nth-child(1) { grid-column: span 2; background: linear-gradient(135deg, #fff9f2 0%, #fef2e0 100%); }
.hero-card .icon { font-size: 1.8rem; margin-bottom: 8px; }
.hero-card h4 { margin-bottom: 4px; font-size: .95rem; }
.hero-card p { font-size: .8rem; color: var(--text3); }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: 50px;
  font-size: .88rem; font-weight: 600; cursor: pointer;
  border: none; transition: all .2s; text-decoration: none;
  white-space: nowrap; letter-spacing: .01em;
}
.btn i { font-size: .9em; flex-shrink: 0; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: #a03010; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(192,69,21,.35); }
.btn-secondary { background: var(--bg2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); border-color: var(--border2); }
.btn-green { background: var(--green); color: white; }
.btn-green:hover { background: #1e5030; transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-outline:hover { background: var(--accent); color: white; }
.btn-ghost { background: transparent; color: var(--text2); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg2); }
.btn-sm { padding: 7px 14px; font-size: .78rem; }
.btn-block { width: 100%; justify-content: center; }

/* ── Stats Bar ──────────────────────────────────────────── */
.stats-bar {
  background: var(--text); color: white;
  padding: 24px clamp(20px, 5%, 60px);
  display: flex; gap: clamp(24px, 6vw, 80px); justify-content: center; flex-wrap: wrap;
}
.stat-item { text-align: center; }
.stat-item .num { font-family: var(--font-head); font-size: 2.2rem; font-weight: 700; color: var(--amber); }
.stat-item .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; opacity: .6; margin-top: 2px; }

/* ── Section ────────────────────────────────────────────── */
.section { padding: clamp(40px, 7vw, 72px) clamp(20px, 5%, 60px); max-width: 1280px; margin: 0 auto; }
.section-title { margin-bottom: 8px; }
.section-sub { color: var(--text3); margin-bottom: 36px; }

/* ── Cards Grid ─────────────────────────────────────────── */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 20px; }

.listing-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform .25s, box-shadow .25s, border-color .2s;
  display: flex; flex-direction: column;
}
.listing-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--border2); }
.listing-card .card-img {
  height: 185px; background: var(--bg2);
  display: flex; align-items: center; justify-content: center;
  font-size: 3.5rem; position: relative; overflow: hidden;
}
.listing-card .card-img img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.card-badge {
  position: absolute; top: 12px; left: 12px;
  background: white; border-radius: 50px;
  font-size: .69rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; padding: 3px 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.card-badge.food { color: var(--green); background: var(--green-lt); }
.card-badge.animal { color: var(--purple); background: var(--purple-lt); }
.proximity-badge {
  position: absolute; top: 12px; right: 12px;
  background: var(--accent); color: white; border-radius: 50px;
  font-size: .66rem; font-weight: 600; padding: 3px 9px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.proximity-badge.same-city { background: var(--green); }
.proximity-badge.same-region { background: var(--amber); color: var(--text); }
.card-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.card-title { font-family: var(--font-head); font-size: 1.05rem; font-weight: 700; line-height: 1.3; }
.card-desc { font-size: .82rem; color: var(--text2); flex: 1; line-height: 1.55; }
.card-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.meta-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; color: var(--text3);
  background: var(--bg2); padding: 2px 8px; border-radius: 50px; border: 1px solid var(--border);
}
.card-footer {
  padding: 10px 16px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(239,233,222,.35);
}
.poster-info { display: flex; align-items: center; gap: 8px; }
.poster-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--amber));
  color: white; display: grid; place-items: center; font-size: .64rem; font-weight: 700;
}
.poster-name { font-size: .75rem; color: var(--text3); }

/* ── Auth Pages ─────────────────────────────────────────── */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: clamp(40px,6vw,80px) clamp(24px,5vw,60px); overflow-y: auto; }
.auth-visual {
  background: linear-gradient(155deg, #1a0e06 0%, #2a1206 35%, #102218 100%);
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; padding: 60px 40px;
}
.auth-visual-content { position: relative; z-index: 2; text-align: center; color: white; max-width: 380px; }
.auth-visual h2 { font-family: var(--font-head); font-size: 2.2rem; color: white; margin-bottom: 14px; }
.auth-visual p { color: rgba(255,255,255,.65); font-size: .95rem; line-height: 1.7; }
.auth-orbs { position: absolute; inset: 0; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; background: radial-gradient(circle, rgba(192,69,21,.45), transparent 70%); }
.orb:nth-child(1) { width: 450px; height: 450px; top: -120px; right: -120px; }
.orb:nth-child(2) { width: 350px; height: 350px; bottom: -100px; left: -100px; background: radial-gradient(circle, rgba(46,102,68,.55), transparent 70%); }
.auth-form-wrapper { width: 100%; max-width: 460px; }
.auth-form-wrapper .brand { font-family: var(--font-head); font-size: 1.4rem; color: var(--accent); margin-bottom: 30px; display: flex; align-items: center; gap: 8px; }
.auth-form-wrapper h2 { font-family: var(--font-head); font-size: 1.9rem; margin-bottom: 6px; }
.auth-form-wrapper .sub { color: var(--text3); margin-bottom: 28px; font-size: .9rem; }

/* ── Form Elements ──────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.form-group label { font-size: .78rem; font-weight: 600; color: var(--text2); letter-spacing: .03em; text-transform: uppercase; }
.form-control {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm); background: white;
  color: var(--text); outline: none;
  transition: border-color .2s, box-shadow .2s; font-size: .92rem;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(192,69,21,.1); }
.form-control::placeholder { color: var(--text3); opacity: .7; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-hint { font-size: .75rem; color: var(--text3); }
.alert {
  padding: 12px 16px; border-radius: var(--r-sm);
  font-size: .85rem; margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert i { margin-top: 1px; flex-shrink: 0; }
.alert-error  { background: var(--red-lt);   color: #b03010; border: 1px solid #f0c0b0; }
.alert-success{ background: var(--green-lt); color: #1e5030; border: 1px solid #a0c8b0; }

/* ── Dashboard ──────────────────────────────────────────── */
.dashboard-layout { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: calc(100vh - var(--navbar-h)); }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 24px 0;
  position: sticky; top: var(--navbar-h);
  height: calc(100vh - var(--navbar-h)); overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.sidebar-user { padding: 0 18px 20px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.sidebar-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--amber));
  color: white; display: grid; place-items: center;
  font-family: var(--font-head); font-size: 1.2rem; font-weight: 700; margin-bottom: 10px;
}
.sidebar-user .name { font-weight: 700; font-size: .9rem; }
.sidebar-user .loc { font-size: .76rem; color: var(--text3); display: flex; align-items: center; gap: 4px; margin-top: 3px; }
.sidebar-nav { padding: 0 8px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--text2); font-size: .86rem; font-weight: 500;
  cursor: pointer; transition: all .15s; text-decoration: none; margin-bottom: 2px;
}
.nav-item:hover { background: var(--bg2); color: var(--text); }
.nav-item.active { background: var(--accent-lt); color: var(--accent); font-weight: 600; }
.nav-icon { font-size: .88rem; width: 20px; text-align: center; flex-shrink: 0; color: var(--text3); }
.nav-item.active .nav-icon, .nav-item:hover .nav-icon { color: inherit; }
.nav-section-title { font-size: .64rem; text-transform: uppercase; letter-spacing: .12em; color: var(--text3); padding: 14px 20px 5px; font-weight: 700; }
.main-content { padding: clamp(20px, 3vw, 36px) clamp(16px, 4vw, 40px); min-width: 0; }

/* ── Suggestions Banner ─────────────────────────────────── */
.suggestions-banner {
  background: linear-gradient(135deg, #122018 0%, #1e0c04 60%, #102218 100%);
  border-radius: var(--r); padding: 22px 26px; margin-bottom: 28px;
  color: white; position: relative; overflow: hidden;
}
.suggestions-banner::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.025'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.suggestions-banner h3 { color: white; font-family: var(--font-head); margin-bottom: 4px; font-size: 1.15rem; }
.suggestions-banner p { color: rgba(255,255,255,.65); font-size: .85rem; }
.location-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
  border-radius: 50px; padding: 4px 12px;
  font-size: .76rem; color: rgba(255,255,255,.85); margin-top: 10px;
}

/* ── Filter Tabs ────────────────────────────────────────── */
.filter-tabs { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.filter-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 50px; font-size: .83rem; font-weight: 600;
  border: 1.5px solid var(--border); background: white; color: var(--text2);
  cursor: pointer; transition: all .15s; text-decoration: none;
}
.filter-tab:hover { border-color: var(--border2); color: var(--text); }
.filter-tab.active { background: var(--accent); color: white; border-color: var(--accent); }
.filter-tab.food-tab.active { background: var(--green); border-color: var(--green); }
.filter-tab.animal-tab.active { background: var(--purple); border-color: var(--purple); }

/* ── Add Listing Form ───────────────────────────────────── */
.type-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 24px; }
.type-option {
  border: 2px solid var(--border); border-radius: var(--r);
  padding: 24px 20px; text-align: center; cursor: pointer;
  transition: all .2s; background: white;
}
.type-option:hover { border-color: var(--border2); box-shadow: var(--shadow); }
.type-option.selected.food { border-color: var(--green); background: linear-gradient(145deg, #f4fbf6, var(--green-lt)); }
.type-option.selected.animal { border-color: var(--purple); background: linear-gradient(145deg, #f8f4ff, var(--purple-lt)); }
.type-option .big-icon { font-size: 2.4rem; margin-bottom: 8px; }
.type-option h4 { font-size: .95rem; margin-bottom: 4px; }
.type-option p { font-size: .77rem; color: var(--text3); }
.section-divider { border: none; border-top: 1px solid var(--border); margin: 22px 0; }
.card-form {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: clamp(18px, 3vw, 28px); box-shadow: var(--shadow-sm);
}
.card-form h3 { font-family: var(--font-head); margin-bottom: 22px; }

/* ── Detail Page Tags ───────────────────────────────────── */
.detail-header { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r); padding: 24px; margin-bottom: 20px; }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 50px; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
}
.tag-food { background: var(--green-lt); color: var(--green); }
.tag-animal { background: var(--purple-lt); color: var(--purple); }
.tag-location { background: var(--amber-lt); color: #906010; }
.tag-nearby { background: var(--red-lt); color: var(--accent); }
.tag-same-city { background: var(--green-lt); color: var(--green); }

/* ── Empty State ────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text3); }
.empty-state .icon { font-size: 3.5rem; margin-bottom: 14px; }
.empty-state h3 { color: var(--text2); margin-bottom: 8px; font-family: var(--font-head); }
.empty-state p { font-size: .9rem; }

/* ── Notification bell / dropdown ──────────────────────── */
.notif-bell { position: relative; display: inline-flex; align-items: center; cursor: pointer; padding: 7px 8px; border-radius: var(--r-xs); transition: background .15s; }
.notif-bell:hover { background: var(--bg2); }
.chat-icon-wrap { position: relative; display: inline-flex; align-items: center; padding: 7px 8px; border-radius: var(--r-xs); color: var(--text2); transition: background .15s; }
.chat-icon-wrap:hover { background: var(--bg2); }
.notif-badge {
  position: absolute; top: 0; right: 0;
  background: var(--accent); color: white; border-radius: 50px;
  font-size: .58rem; font-weight: 700; padding: 0 5px;
  min-width: 17px; height: 17px; line-height: 17px; text-align: center;
  border: 2px solid white; transform: translate(20%, -20%);
}
.notif-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; width: 310px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow-xl); z-index: 9999; overflow: hidden;
}
.notif-item { display: block; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: .82rem; text-decoration: none; transition: background .12s; }
.notif-item:hover { background: var(--bg2); }
.notif-item .ntitle { font-weight: 600; color: var(--text); }
.notif-item .nbody { color: var(--text3); margin-top: 2px; font-size: .78rem; }

/* Search quick bar */
.search-quick {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg2); border: 1.5px solid var(--border);
  border-radius: 50px; padding: 8px 16px; cursor: pointer;
  transition: all .2s; font-size: .86rem; color: var(--text3);
  flex: 1; max-width: 320px;
}
.search-quick:hover { border-color: var(--accent); color: var(--text); background: white; }

/* ── Stars / Ratings ────────────────────────────────────── */
.stars { display: inline-flex; gap: 1px; line-height: 1; }
.star { font-size: .88rem; }
.star.full  { color: var(--amber); }
.star.half  { color: var(--amber); opacity: .65; }
.star.empty { color: #ddd; }
.rating-count { font-size: .73rem; color: var(--text3); margin-left: 3px; }

/* Badge */
.badge {
  background: var(--accent); color: white;
  border-radius: 50px; font-size: .62rem; font-weight: 700;
  padding: 1px 6px; min-width: 17px; text-align: center;
  display: inline-block; line-height: 16px; vertical-align: middle;
}

/* ── Chat ───────────────────────────────────────────────── */
.chat-wrap { display:flex;flex-direction:column;height:calc(100vh - var(--navbar-h)); }
.chat-header { background:var(--surface);border-bottom:1px solid var(--border);padding:14px 20px;display:flex;align-items:center;gap:12px;flex-shrink:0; }
.chat-messages { flex:1;overflow-y:auto;padding:20px;display:flex;flex-direction:column;gap:10px;background:var(--bg); }
.msg { max-width:72%;word-break:break-word; }
.msg.mine  { align-self:flex-end; }
.msg.theirs{ align-self:flex-start; }
.bubble { padding:10px 14px;border-radius:18px;font-size:.88rem;line-height:1.5; }
.mine   .bubble { background:var(--accent);color:white;border-bottom-right-radius:4px; }
.theirs .bubble { background:white;color:var(--text);border:1px solid var(--border);border-bottom-left-radius:4px; }
.msg-time { font-size:.67rem;margin-top:3px;color:var(--text3); }
.mine .msg-time { text-align:right; }
.chat-input { background:var(--surface);border-top:1px solid var(--border);padding:12px 16px;display:flex;gap:10px;flex-shrink:0; }
.chat-input textarea { flex:1;resize:none;border:1.5px solid var(--border);border-radius:24px;padding:10px 16px;font-size:.9rem;outline:none;max-height:120px;transition:border-color .2s; }
.chat-input textarea:focus { border-color:var(--accent); }
.send-btn { width:44px;height:44px;border-radius:50%;background:var(--accent);border:none;cursor:pointer;display:grid;place-items:center;color:white;font-size:1.1rem;transition:background .2s;flex-shrink:0; }
.send-btn:hover { background:#a03010; }

/* ── PWA Banner ─────────────────────────────────────────── */
.pwa-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 999;
  background: var(--text); color: white;
  padding: 14px 20px; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; flex-wrap: wrap;
  box-shadow: 0 -4px 24px rgba(0,0,0,.22); animation: slideUp .4s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
.pwa-banner p { font-size: .85rem; color: rgba(255,255,255,.82); flex: 1; }
.pwa-banner .pwa-actions { display: flex; gap: 8px; }

/* ── Utilities ──────────────────────────────────────────── */
.text-muted { color: var(--text3); }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 28px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 28px; }
.flex { display: flex; } .items-center { align-items: center; } .gap-2 { gap: 16px; }
.hidden { display: none !important; }
.spinner {
  width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.3);
  border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.fade-in { animation: fadeIn .45s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.fade-in-1 { animation-delay: .06s; }
.fade-in-2 { animation-delay: .12s; }
.fade-in-3 { animation-delay: .18s; }
.fade-in-4 { animation-delay: .24s; }

/* Sidebar backdrop for mobile */
.sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 149; backdrop-filter: blur(2px);
}
.sidebar-backdrop.active { display: block; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  :root { --sidebar-w: 240px; }
}

@media (max-width: 840px) {
  .hero { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-panel { padding: 40px 24px; }

  /* Sidebar as slide-in drawer */
  .dashboard-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: var(--navbar-h); left: 0; bottom: 0;
    width: var(--sidebar-w); z-index: 150;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    box-shadow: var(--shadow-xl);
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { padding: 20px 16px; }
  .nav-toggle { display: flex; }
  .navbar-links { gap: 4px; }
  .user-chip span { display: none; }
  .search-quick { max-width: 200px; }
  .search-quick span { display: none; }
}

@media (max-width: 600px) {
  :root { --navbar-h: 58px; }
  .navbar { padding: 0 14px; }
  .navbar-brand { font-size: 1.25rem; }
  .search-quick { display: none; }
  .stats-bar { gap: 20px; padding: 18px 16px; }
  .stat-item .num { font-size: 1.7rem; }
  .cards-grid { grid-template-columns: 1fr; gap: 14px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .type-selector { grid-template-columns: 1fr; }
  .listing-card .card-img { height: 160px; }
  .auth-form-wrapper h2 { font-size: 1.6rem; }
  .suggestions-banner { padding: 16px 18px; }
  .btn { padding: 10px 18px; font-size: .85rem; }
  .filter-tabs { gap: 6px; }
  .filter-tab { padding: 6px 12px; font-size: .8rem; }
}

@media (max-width: 380px) {
  h1 { font-size: 1.75rem; }
  .cards-grid { gap: 12px; }
}

@media (hover: none) {
  .listing-card:hover, .hero-card:hover { transform: none; box-shadow: var(--shadow-sm); }
  .btn-primary:hover { transform: none; box-shadow: none; }
}

@media print {
  .navbar, .sidebar, .pwa-banner, .filter-tabs { display: none; }
  .dashboard-layout { grid-template-columns: 1fr; }
  .main-content { padding: 0; }
}
