/* ================================================================
   FoodMate — Design System v3
   Editorial / Napolix-inspired aesthetic in green tones
   Bebas Neue for display, Inter for body
   Palette: #00B050 · #E8F5E9 · #006633 · white
   ================================================================ */

:root {
  --primary:        #00B050;
  --primary-hover:  #009944;
  --primary-light:  #E8F5E9;
  --primary-lighter:#F1FAF2;
  --primary-dark:   #006633;

  --text:       #0c180c;
  --text-muted: #526052;
  --text-light: #8a9e8a;
  --border:     #dce8dc;
  --bg:         #f7faf7;
  --white:      #ffffff;

  --shadow-sm:    0 1px 2px rgba(0,0,0,0.04);
  --shadow:       0 1px 4px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.05);
  --shadow-hover: 0 4px 8px rgba(0,0,0,0.08), 0 12px 32px rgba(0,0,0,0.09);
  --shadow-lg:    0 10px 40px rgba(0,0,0,0.13);

  --radius:    1rem;
  --radius-sm: 0.5rem;
  --radius-lg: 1.5rem;

  --font-display: 'Bebas Neue', 'Arial Narrow', sans-serif;
  --font-body:    'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --transition: 0.18s ease;

  /* Navbar height — used by browse + add-listing layouts */
  --navbar-h: 84px;
}

/* ── Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  margin: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

h1, h2, h3, h4, h5, h6 { font-family: var(--font-body); }

/* ── Navbar ───────────────────────────────────────── */
.navbar-fm {
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 16px rgba(0,0,0,0.14);
}

/* Three-column inner: left | center | right */
.navbar-fm-inner {
  display: flex;
  align-items: center;
  min-height: var(--navbar-h);
  padding: 0.9rem 0;
  position: relative;    /* anchor for absolute logo */
}

/* Left column — nav links */
.nav-fm-left {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Right column — action items */
.nav-fm-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* CENTER logo — absolutely positioned so it stays truly centered
   regardless of how many items are in left / right columns       */
.nav-fm-brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  line-height: 0;
  text-decoration: none;
  z-index: 1;
}
.nav-fm-logo {
  height: 70px;
  width: auto;
  display: block;
}

/* ── Nav text links (Bebas Neue, white, uppercase) ── */
.nav-fm-link {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.88) !important;
  text-decoration: none !important;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}
.nav-fm-link:hover,
.nav-fm-link.active {
  color: white !important;
  background: rgba(255,255,255,0.14);
}

/* ── White pill button with green text ── */
.nav-fm-pill {
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 700;
  background: white;
  color: var(--primary) !important;
  padding: 0.48rem 1.2rem;
  border-radius: 100px;
  text-decoration: none !important;
  white-space: nowrap;
  letter-spacing: 0.01em;
  transition: all var(--transition);
  border: none;
}
.nav-fm-pill:hover {
  background: #f0fff4;
  color: var(--primary-dark) !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.14);
}

/* ── User chip — translucent white ── */
.nav-user-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.9rem;
  border-radius: 100px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.28);
  color: white !important;
  text-decoration: none !important;
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--transition);
}
.nav-user-chip:hover { background: rgba(255,255,255,0.26); }

.nav-avatar {
  width: 24px;
  height: 24px;
  background: white;
  color: var(--primary);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  flex-shrink: 0;
}

/* ── Mobile hamburger ── */
.nav-fm-toggle {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 0.4rem;
  margin-left: auto;
}
.nav-fm-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: all var(--transition);
}

/* ── Mobile dropdown menu ── */
.nav-fm-mobile-menu {
  background: var(--primary-dark);
  border-top: 1px solid rgba(255,255,255,0.12);
}
.nav-fm-mobile-link {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.9) !important;
  padding: 0.85rem 1.5rem;
  text-decoration: none !important;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: background var(--transition);
  line-height: 1;
}
.nav-fm-mobile-link:hover { background: rgba(255,255,255,0.08); color: white !important; }
.nav-fm-mobile-link:last-child { border-bottom: none; }

/* ── Home Hero ─────────────────────────────────────── */
.home-hero {
  background: var(--white);
  padding: 6rem 0 5rem;
}
.home-hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.home-headline {
  font-family: var(--font-display);
  font-size: clamp(4rem, 7vw, 6.5rem);
  line-height: 0.92;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 1.5rem;
}
.home-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 2.25rem;
  max-width: 400px;
}
.home-cta-row {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  align-items: center;
}
.btn-home-primary {
  display: inline-block;
  background: var(--primary);
  color: white !important;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.9rem 2rem;
  border-radius: 100px;
  text-decoration: none !important;
  transition: all var(--transition);
  white-space: nowrap;
  box-shadow: 0 4px 18px rgba(0,176,80,0.28);
}
.btn-home-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,176,80,0.36);
}
.btn-home-outline {
  display: inline-block;
  background: transparent;
  color: var(--text) !important;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.75rem;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  text-decoration: none !important;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-home-outline:hover {
  border-color: var(--primary);
  color: var(--primary) !important;
  background: var(--primary-lighter);
}
.home-hero-img-wrap {
  position: relative;
  width: 100%;
}
.home-hero-img {
  width: 100%;
  height: 500px;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: 0 16px 64px rgba(0,0,0,0.14);
  display: block;
}
.home-hero-badge {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  background: white;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.55rem 1.1rem;
  border-radius: 100px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  white-space: nowrap;
}

/* ── How It Works ───────────────────────────────────── */
.home-how {
  background: var(--white);
  padding: 6rem 0;
  border-top: 1px solid var(--border);
}
.home-section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: 0.02em;
  color: var(--text);
  line-height: 1;
  margin-bottom: 3rem;
}
.home-section-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
}
.home-step-num {
  font-family: var(--font-display);
  font-size: 5rem;
  line-height: 1;
  color: var(--primary);
  opacity: 0.3;
  margin-bottom: -0.5rem;
  letter-spacing: -0.02em;
}
.home-step-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  letter-spacing: 0.03em;
  color: var(--text);
  margin-bottom: 0.75rem;
  line-height: 1.1;
}
.home-step-body {
  font-size: 0.93rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 280px;
}

/* ── Available Now ──────────────────────────────────── */
.home-available {
  background: var(--white);
  padding: 6rem 0;
  border-top: 1px solid var(--border);
}
.home-view-all {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}
.home-view-all:hover { color: var(--primary-hover); }
.home-listing-card {
  display: block;
  text-decoration: none !important;
  color: inherit !important;
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.home-listing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.home-listing-img-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--primary-lighter);
}
.home-listing-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.home-listing-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  background: linear-gradient(135deg, var(--primary-lighter), var(--primary-light));
}
.home-listing-cat {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  background: white;
  color: var(--text);
  font-size: 0.73rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.home-listing-body {
  padding: 0.85rem 0.25rem 0.5rem;
}
.home-listing-title {
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.35rem;
  line-height: 1.3;
}
.home-listing-meta {
  font-size: 0.78rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* ── Statement Section ──────────────────────────────── */
.home-statement {
  background: var(--primary);
  padding: 8rem 0;
  text-align: center;
}
.home-statement-text {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 5rem);
  line-height: 1.05;
  color: white;
  letter-spacing: 0.02em;
  margin: 0;
}

/* ── Stats Section ──────────────────────────────────── */
.home-stats {
  background: var(--white);
  padding: 6rem 0;
  border-top: 1px solid var(--border);
}
.home-stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4rem;
  flex-wrap: wrap;
}
.home-stat { text-align: center; }
.home-stat-val {
  display: block;
  font-family: var(--font-display);
  font-size: 4rem;
  line-height: 1;
  color: var(--primary);
  letter-spacing: 0.02em;
  margin-bottom: 0.35rem;
}
.home-stat-lbl {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-light);
}
.home-stat-divider {
  width: 1px;
  height: 60px;
  background: var(--border);
}

/* ── Buttons (regular pages) ──────────────────────── */
.btn {
  border-radius: var(--radius-sm) !important;
  font-weight: 600;
  padding: 0.55rem 1.2rem;
  transition: all var(--transition);
  border: none;
  font-size: 0.9rem;
  font-family: var(--font-body);
}
.btn-primary {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: white !important;
}
.btn-primary:hover {
  background: var(--primary-hover) !important;
  border-color: var(--primary-hover) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,176,80,0.3);
}
.btn-outline-primary {
  color: var(--primary) !important;
  border: 1.5px solid var(--primary) !important;
  background: transparent !important;
}
.btn-outline-primary:hover {
  background: var(--primary-lighter) !important;
  transform: translateY(-1px);
}
.btn-success {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: white !important;
}
.btn-success:hover {
  background: var(--primary-hover) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,176,80,0.3);
}
.btn-outline-danger {
  color: #dc2626 !important;
  border-color: #fca5a5 !important;
  background: transparent !important;
}
.btn-outline-danger:hover {
  background: #fef2f2 !important;
  border-color: #dc2626 !important;
}
.btn-outline-secondary {
  color: var(--text-muted) !important;
  border-color: var(--border) !important;
}
.btn-outline-secondary:hover { background: var(--bg) !important; }
.btn-claim {
  background: #7c3aed !important;
  border-color: #7c3aed !important;
  color: white !important;
  font-size: 1rem !important;
  padding: 0.7rem 1.5rem !important;
}
.btn-claim:hover {
  background: #6d28d9 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(124,58,237,0.3);
}
.btn-lg { padding: 0.7rem 1.75rem !important; font-size: 0.95rem !important; }
.btn-sm { padding: 0.35rem 0.85rem !important; font-size: 0.8rem !important; }

/* ── Cards ────────────────────────────────────────── */
.card {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow) !important;
  background: var(--white);
  overflow: hidden;
}

/* ── Badges ───────────────────────────────────────── */
.badge { border-radius: 2rem !important; font-weight: 600; padding: 0.3em 0.75em; }
.badge-available { background: #dcfce7 !important; color: #15803d !important; }
.badge-expired   { background: #fee2e2 !important; color: #b91c1c !important; }
.badge-claimed   { background: #ede9fe !important; color: #6d28d9 !important; }

.cat-badge { border-radius: 2rem; font-size: 0.72rem; font-weight: 600; padding: 0.25em 0.7em; display: inline-block; }
.cat-Fruits      { background: #fff7ed; color: #c2410c; }
.cat-Vegetables  { background: #f0fdf4; color: #15803d; }
.cat-Bread       { background: #fffbeb; color: #b45309; }
.cat-Dairy       { background: #eff6ff; color: #1d4ed8; }
.cat-Cooked-Food { background: #fdf4ff; color: #7e22ce; }
.cat-Beverages   { background: #e0f2fe; color: #0369a1; }
.cat-Other       { background: #f9fafb; color: #374151; }

/* ── Map (default, used on detail + add/edit pages) ─ */
#map {
  height: 400px;
  border-radius: var(--radius);
  overflow: hidden;
}
.leaflet-container { outline: none; }

/* ── Forms ────────────────────────────────────────── */
.form-control, .form-select {
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  padding: 0.6rem 0.9rem !important;
  font-size: 0.9rem !important;
  background: white !important;
  color: var(--text) !important;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: var(--font-body);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(0,176,80,0.12) !important;
  outline: none;
}
.form-label { font-weight: 600; font-size: 0.86rem; color: var(--text); margin-bottom: 0.35rem; }
.form-text  { font-size: 0.78rem; color: var(--text-light); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important; }

/* ── Upload area ──────────────────────────────────── */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  text-align: center;
  cursor: pointer;
  background: var(--bg);
  transition: all var(--transition);
  position: relative;
}
.upload-area:hover { border-color: var(--primary); background: var(--primary-lighter); }
.upload-area input[type=file] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
  width: 100%; height: 100%;
}
.upload-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.upload-area p { margin: 0; font-size: 0.85rem; color: var(--text-muted); }
.upload-preview { margin-top: 0.75rem; border-radius: var(--radius-sm); overflow: hidden; }
.upload-preview img { width: 100%; max-height: 200px; object-fit: cover; display: block; }

/* ── Profile page ─────────────────────────────────── */
.profile-header {
  background: linear-gradient(135deg, var(--primary-lighter), var(--primary-light));
  border: 1px solid #c8e6c9;
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.profile-avatar {
  width: 70px; height: 70px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,176,80,0.3);
}
.profile-avatar-img {
  width: 70px; height: 70px; border-radius: 50%; object-fit: cover;
  flex-shrink: 0; box-shadow: 0 4px 12px rgba(0,176,80,0.3);
  background: transparent; font-size: 0; color: transparent;
}
.profile-avatar-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.profile-avatar-btns { display: flex; gap: 0.4rem; }
.profile-avatar-change-btn {
  background: none; border: 1px solid rgba(255,255,255,0.7); color: white;
  border-radius: 100px; padding: 0.15rem 0.6rem; font-size: 0.7rem;
  cursor: pointer; white-space: nowrap;
}
.profile-avatar-change-btn:hover { background: rgba(255,255,255,0.2); }
.profile-avatar-remove-btn {
  background: none; border: 1px solid rgba(255,255,255,0.4); color: rgba(255,255,255,0.75);
  border-radius: 100px; padding: 0.15rem 0.6rem; font-size: 0.7rem; cursor: pointer;
}
.profile-avatar-remove-btn:hover { color: white; border-color: rgba(255,255,255,0.7); }
/* Image variants for avatar locations */
.nav-avatar-img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; border: 2px solid white; vertical-align: middle; }
.msg-avatar-img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.inbox-avatar-img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-xs-img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 2px; }
/* ── Listing detail ───────────────────────────────── */
.detail-image {
  width: 100%; border-radius: var(--radius);
  max-height: 360px; object-fit: cover;
  box-shadow: var(--shadow); display: block;
  margin-bottom: 1.25rem;
}
.detail-placeholder {
  width: 100%; height: 200px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary-lighter), var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem; margin-bottom: 1.25rem;
}
.detail-meta span {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.87rem; color: var(--text-muted); margin-right: 1.25rem;
}

/* ── Alerts ───────────────────────────────────────── */
.alert { border-radius: var(--radius-sm) !important; border: none !important; font-size: 0.88rem; }
.alert-success { background: #f0fdf4 !important; color: #15803d !important; }
.alert-danger  { background: #fef2f2 !important; color: #b91c1c !important; }
.alert-info    { background: #eff6ff !important; color: #1d4ed8 !important; }
.alert-warning { background: #fffbeb !important; color: #b45309 !important; }

/* ── Misc utilities ───────────────────────────────── */
.page-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  letter-spacing: 0.03em;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0;
}

.empty-state { text-align: center; padding: 3.5rem 1rem; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.empty-state h5 { font-weight: 700; color: var(--text); margin-bottom: 0.4rem; }

footer {
  margin-top: 0; padding: 4rem 0 2.5rem;
  border-top: 1px solid var(--border);
  text-align: center; color: var(--text-light); font-size: 0.83rem;
}

/* ── Add Listing page ─────────────────────────────── */
.add-page-header {
  background: var(--primary);
  padding: 2.5rem 0 2rem;
  margin-bottom: 0;
}
.add-page-header .add-page-title {
  font-family: var(--font-display);
  font-size: 3.5rem;
  letter-spacing: 0.04em;
  color: white;
  line-height: 1;
  margin-bottom: 0.3rem;
}
.add-page-header p {
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  margin: 0;
}

.add-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: calc(100vh - 200px);
  background: white;
}

.add-form-col {
  padding: 2.5rem 2.5rem 2.5rem 0;
  max-width: 540px;
  width: 100%;
  justify-self: end;
}

.add-map-col {
  position: sticky;
  top: var(--navbar-h);
  height: calc(100vh - var(--navbar-h));
  min-height: 500px;
}

.add-map-col #map {
  height: 100% !important;
  border-radius: 0 !important;
  border: none !important;
  border-left: 1px solid var(--border) !important;
  box-shadow: none !important;
}

/* Upload area (add listing) */
.upload-zone {
  border: 2px dashed #c8e6c9;
  border-radius: var(--radius);
  padding: 2.25rem 1.5rem;
  text-align: center;
  cursor: pointer;
  background: var(--primary-lighter);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.upload-zone:hover { border-color: var(--primary); background: var(--primary-light); }
.upload-zone input[type=file] {
  position: absolute; inset: 0; opacity: 0;
  cursor: pointer; width: 100%; height: 100%;
}
.upload-zone-icon {
  font-size: 2.5rem;
  margin-bottom: 0.6rem;
  display: block;
}
.upload-zone-title {
  font-weight: 700; font-size: 0.9rem; color: var(--text); margin-bottom: 0.2rem;
}
.upload-zone-sub {
  font-size: 0.78rem; color: var(--text-light);
}
.upload-zone-preview { margin-top: 0; border-radius: var(--radius-sm); overflow: hidden; }
.upload-zone-preview img {
  width: 100%; max-height: 220px; object-fit: cover; display: block;
  border-radius: var(--radius-sm);
}

/* ── Auth pages (login / register) ───────────────────*/
.auth-wrap {
  min-height: calc(100vh - var(--navbar-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}

.auth-logo {
  margin-bottom: 1.5rem;
}
.auth-logo img { height: 44px; width: auto; }

.auth-headline {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 7vw, 4.25rem);
  line-height: 0.9;
  letter-spacing: 0.03em;
  color: var(--text);
  text-align: center;
  margin-bottom: 0.6rem;
}

.auth-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 2rem;
}

.auth-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.25rem 2rem;
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--border);
}

/* ── Browse page split layout ─────────────────────── */
.browse-wrap {
  display: flex;
  height: calc(100vh - var(--navbar-h));
  overflow: hidden;
  background: #f4f5f2;
}

.browse-sidebar {
  width: 400px;
  min-width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f4f5f2;
  border-right: 1px solid #dde0da;
}

.browse-header {
  padding: 1.4rem 1.25rem 0;
  flex-shrink: 0;
  border-bottom: 1px solid #dde0da;
  background: #f4f5f2;
}

.browse-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: #18191a;
  letter-spacing: 0.02em;
  margin: 0;
  line-height: 1;
}

.browse-add-btn {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 2rem;
  padding: 0.28rem 0.8rem;
  text-decoration: none !important;
  transition: background var(--transition);
  white-space: nowrap;
}
.browse-add-btn:hover { background: #c8e6c9; color: var(--primary-dark); }

.browse-search { position: relative; margin-bottom: 0.85rem; }
.browse-search-icon {
  position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%);
  font-size: 1rem; color: #a0a8a0; pointer-events: none; line-height: 1;
}
.browse-search input {
  width: 100%; background: #fff; border: 1.5px solid #dde0da;
  border-radius: 10px; padding: 0.6rem 2.2rem 0.6rem 2.2rem;
  font-size: 0.86rem; color: #18191a; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: var(--font-body);
}
.browse-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,176,80,0.1);
}
.browse-search input::placeholder { color: #b0b8af; }
.browse-search-clear {
  position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: #a0a8a0;
  font-size: 1.1rem; line-height: 1; cursor: pointer; padding: 0;
  transition: color var(--transition);
}
.browse-search-clear:hover { color: #374151; }

.browse-cats {
  display: flex; gap: 0.35rem; padding-bottom: 0.85rem;
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
}
.browse-cats::-webkit-scrollbar { display: none; }

.browse-cat {
  display: inline-block; white-space: nowrap;
  font-size: 0.76rem; font-weight: 600;
  padding: 0.28rem 0.75rem; border-radius: 2rem;
  border: 1.5px solid #dde0da; background: #fff; color: #6b7a6b;
  text-decoration: none !important; transition: all var(--transition); flex-shrink: 0;
  letter-spacing: 0.01em;
}
.browse-cat:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-lighter); }
.browse-cat.active { background: var(--primary); border-color: var(--primary); color: #fff !important; }

.browse-count {
  font-size: 0.72rem; color: #a0a8a0;
  margin: 0 0 0.85rem; letter-spacing: 0.01em;
}
.browse-count strong { color: #4a5248; font-weight: 700; }

.browse-list {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: #cdd1ca transparent;
}
.browse-list::-webkit-scrollbar { width: 3px; }
.browse-list::-webkit-scrollbar-track { background: transparent; }
.browse-list::-webkit-scrollbar-thumb { background: #cdd1ca; border-radius: 3px; }

.browse-card {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.85rem 1.25rem; border-bottom: 1px solid #eaecea;
  cursor: pointer; text-decoration: none !important; color: #18191a !important;
  background: transparent; transition: background var(--transition); position: relative;
}
.browse-card:last-of-type { border-bottom: none; }
.browse-card:hover { background: rgba(255,255,255,0.75); }
.browse-card.is-active {
  background: #fff;
  border-left: 3px solid var(--primary);
  padding-left: calc(1.25rem - 3px);
}
.browse-card.is-expired { opacity: 0.55; }

.browse-card-thumb {
  width: 46px; height: 46px; border-radius: 10px; flex-shrink: 0;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #E8F5E9, #c8e6c9); font-size: 1.35rem;
}
.browse-card-thumb img { width: 100%; height: 100%; object-fit: cover; }

.browse-card-body { flex: 1; min-width: 0; }

.browse-card-title {
  font-size: 0.87rem; font-weight: 700; color: #18191a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 0.2rem; line-height: 1.3;
}
.browse-card-meta {
  font-size: 0.73rem; color: #7a877a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 0.22rem; line-height: 1.3;
}
.browse-sep { color: #c0c8c0; margin: 0 0.25rem; }
.browse-card-row { display: flex; align-items: center; gap: 0.5rem; }
.browse-cat-tag {
  font-size: 0.66rem; font-weight: 700; color: var(--primary);
  background: var(--primary-lighter); padding: 0.1em 0.55em;
  border-radius: 2rem; letter-spacing: 0.01em;
}
.browse-card-user { font-size: 0.68rem; color: #a8b0a8; }

.browse-status-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; display: block;
}
.browse-status-dot.available { background: var(--primary); }
.browse-status-dot.expired   { background: #dc2626; }
.browse-status-dot.claimed   { background: #7c3aed; }

/* ── Location filter ── */
.loc-filter-row {
  position: relative;
  margin-bottom: 0.65rem;
}
.loc-filter-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #f4f6f3;
  border: 1.5px solid #e0e5df;
  border-radius: 100px;
  padding: 0.3rem 0.5rem 0.3rem 0.75rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.loc-filter-input-wrap:focus-within {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0,176,80,0.1);
}
.loc-filter-icon { font-size: 0.82rem; flex-shrink: 0; line-height: 1; }
.loc-filter-input-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.82rem;
  color: var(--text);
  min-width: 0;
}
.loc-filter-input-wrap input::placeholder { color: #b0b8af; }
#locMyBtn {
  flex-shrink: 0;
  background: var(--primary-lighter);
  border: 1px solid var(--primary-light);
  border-radius: 100px;
  padding: 0.2rem 0.55rem;
  font-size: 0.73rem;
  color: var(--primary);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
#locMyBtn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Filter pills */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
  align-items: center;
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--primary-lighter);
  border: 1px solid var(--primary-light);
  border-radius: 100px;
  padding: 0.18rem 0.6rem;
  font-size: 0.74rem;
  color: #155a2c;
  max-width: 180px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.filter-radius-pill { background: #e6f9ef; border-color: #86efac; }
.filter-pill-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(0,0,0,0.08);
  color: #155a2c;
  text-decoration: none;
  font-size: 0.8rem;
  line-height: 1;
  transition: background 0.12s;
}
.filter-pill-x:hover { background: #f87171; color: #fff; }

/* Radius slider */
.radius-slider-wrap {
  margin-bottom: 0.7rem;
}
.radius-slider-label {
  display: block;
  font-size: 0.77rem;
  color: #6b7466;
  margin-bottom: 0.3rem;
}
.radius-slider {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
  height: 4px;
}
.radius-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: #a8b0a0;
  margin-top: 0.15rem;
  padding: 0 2px;
}

/* Distance badge on browse cards */
.browse-distance-badge {
  font-size: 0.67rem;
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-lighter);
  border-radius: 100px;
  padding: 0.05rem 0.4rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.browse-empty { text-align: center; padding: 3rem 1.5rem; color: #7a877a; }
.browse-empty-icon { font-size: 2.25rem; margin-bottom: 0.75rem; }
.browse-empty-title { font-size: 0.9rem; font-weight: 700; color: #3a453a; margin-bottom: 0.35rem; }
.browse-empty-sub   { font-size: 0.8rem; color: #a0a8a0; margin-bottom: 0.75rem; }

.browse-map { flex: 1; position: relative; overflow: hidden; }
.browse-map #map {
  width: 100% !important; height: 100% !important;
  border-radius: 0 !important; border: none !important; box-shadow: none !important;
}

/* ── Emoji markers (browse map) ───────────────────── */
.fm-wrap { background: transparent !important; border: none !important; }
.fm-pin {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--primary); border: 2.5px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18), 0 1px 3px rgba(0,0,0,0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  will-change: transform; user-select: none;
}
.fm-pin.is-active {
  transform: scale(1.45);
  background: var(--primary-dark);
  box-shadow: 0 5px 20px rgba(0,176,80,0.45), 0 2px 8px rgba(0,0,0,0.15);
}

.fm-popup-wrap .leaflet-popup-content-wrapper {
  border-radius: 14px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06) !important;
  border: 1px solid var(--border) !important;
  padding: 0 !important; overflow: hidden;
}
.fm-popup-wrap .leaflet-popup-content { margin: 0 !important; width: auto !important; }
.fm-popup-wrap .leaflet-popup-tip-container { display: none !important; }

.fm-popup { padding: 1rem 1.1rem; min-width: 190px; }
.fm-popup-title { font-size: 0.88rem; font-weight: 700; color: #18191a; margin-bottom: 0.3rem; line-height: 1.3; }
.fm-popup-meta  { font-size: 0.74rem; color: #7a877a; margin-bottom: 0.2rem; line-height: 1.4; }
.fm-popup-btn {
  display: inline-block; margin-top: 0.6rem; font-size: 0.78rem; font-weight: 700;
  color: #fff !important; background: var(--primary); border-radius: 8px;
  padding: 0.35rem 0.85rem; text-decoration: none !important;
  transition: background var(--transition); letter-spacing: 0.01em;
}
.fm-popup-btn:hover { background: var(--primary-hover); }

/* ── Leaflet popup generic ────────────────────────── */
.leaflet-popup-content-wrapper { border-radius: 12px !important; }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 1024px) { .browse-sidebar { width: 340px; } }

@media (max-width: 992px) {
  .add-layout { grid-template-columns: 1fr; }
  .add-form-col { padding: 2rem 0; max-width: 100%; justify-self: stretch; }
  .add-map-col { height: 400px; position: static; }
  .add-map-col #map { border-left: none !important; border-top: 1px solid var(--border) !important; }
}

/* Mobile navbar: logo snaps back to normal flow, smaller */
@media (max-width: 991px) {
  :root { --navbar-h: 62px; }
  .nav-fm-brand { position: static; transform: none; }
  .navbar-fm-inner { min-height: 62px; padding: 0.6rem 0; }
  .nav-fm-logo { height: 40px; }
}

@media (max-width: 768px) {
  .home-hero { padding: 3.5rem 0 3rem; }
  .home-hero-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .home-hero-img { height: 280px; }
  .home-statement-text { font-size: 2.5rem; }
  .home-stat-divider { display: none; }
  .home-stats-row { gap: 2rem; }
  .home-section-title { margin-bottom: 2rem; }
  .browse-wrap { flex-direction: column; height: auto; overflow: visible; }
  .browse-sidebar { width: 100%; min-width: 0; max-height: 55vh; }
  .browse-map { height: 45vh; flex-shrink: 0; }
  .auth-headline { font-size: 2.5rem; }
  .profile-header { gap: 1rem; }
}

/* ================================================================
   MESSAGING & PICKUP SLOTS
   ================================================================ */

/* ── Navbar unread badge ────────────────────────────── */
.nav-msg-link { position: relative; }
.nav-unread-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: #ef4444; color: white; font-size: 0.62rem; font-weight: 800;
  font-family: var(--font-body);
  min-width: 16px; height: 16px; border-radius: 100px; padding: 0 4px;
  margin-left: 4px; vertical-align: middle; line-height: 1;
}

/* ── Pickup slots on detail page ───────────────────── */
.slots-box {
  background: var(--primary-lighter);
  border: 1px solid var(--primary-light);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.slots-box-title {
  font-size: 0.82rem; font-weight: 700; color: var(--primary);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.65rem;
}
.slots-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.slot-pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: white; border: 1.5px solid var(--primary);
  color: var(--primary); font-size: 0.82rem; font-weight: 600;
  padding: 0.35rem 0.8rem; border-radius: 100px;
}
.slot-pill-btn {
  cursor: pointer; transition: background var(--transition), color var(--transition);
}
.slot-pill-btn:hover { background: var(--primary); color: white; }
.slot-pill-pending {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(40,167,69,0.08); border: 1.5px dashed var(--primary);
  color: var(--primary); font-size: 0.82rem; font-weight: 600;
  padding: 0.35rem 0.8rem; border-radius: 100px; cursor: default;
}
.btn-slot-cancel {
  background: none; border: 1px solid #dc3545; color: #dc3545;
  border-radius: 100px; font-size: 0.72rem; font-weight: 600;
  padding: 0.2rem 0.55rem; cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.btn-slot-cancel:hover { background: #dc3545; color: white; }
.conv-avail-slots { padding: 0.6rem 0 0.2rem; border-top: 1px solid rgba(0,0,0,0.06); }
.conv-avail-slots-label { font-size: 0.75rem; font-weight: 600; color: var(--text-light); }
.slot-pill.slot-taken {
  background: var(--bg); border-color: var(--border);
  color: var(--text-light); text-decoration: line-through;
}
.slot-taken-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-light);
}

/* ── Slot picker (request_slot.html) ───────────────── */
.slot-picker-list { display: flex; flex-direction: column; gap: 0.6rem; }
.slot-picker-option { cursor: pointer; display: block; }
.slot-picker-option input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.slot-picker-card {
  display: flex; align-items: center; gap: 1rem;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 0.9rem 1.1rem; transition: all var(--transition);
  background: white;
}
.slot-picker-option input:checked + .slot-picker-card {
  border-color: var(--primary); background: var(--primary-lighter);
}
.slot-picker-option:hover .slot-picker-card { border-color: var(--primary); }
.slot-picker-day  { font-size: 0.82rem; color: var(--text-muted); min-width: 64px; }
.slot-picker-date { font-weight: 700; flex: 1; }
.slot-picker-time {
  font-family: var(--font-display); font-size: 1.4rem; letter-spacing: 0.03em;
  color: var(--primary);
}

/* ── Conversation page layout ─────────────────────── */
.conv-page {
  display: flex; flex-direction: column;
  height: calc(100vh - var(--navbar-h));
  overflow: hidden;
}
.conv-listing-header {
  background: white; border-bottom: 1px solid var(--border);
  padding: 0.85rem 0; flex-shrink: 0;
}
.conv-confirmed-banner {
  background: #dcfce7; border: 1px solid #86efac;
  color: #166534; border-radius: var(--radius-sm);
  padding: 0.6rem 1rem; font-size: 0.88rem;
}
.conv-messages-wrap {
  flex: 1; overflow-y: auto; padding: 1.5rem 0;
}
.conv-input-bar {
  background: white; border-top: 1px solid var(--border);
  padding: 0.85rem 0; flex-shrink: 0;
}
.conv-textarea {
  resize: none; border-radius: var(--radius-sm) !important;
  min-height: 42px; max-height: 120px; overflow-y: auto;
  font-size: 0.93rem !important;
}
.conv-propose-form {
  background: var(--primary-lighter); border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
}
.btn-propose-time {
  background: none; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.45rem 0.65rem;
  font-size: 1rem; cursor: pointer; transition: all var(--transition);
  line-height: 1;
}
.btn-propose-time:hover { border-color: var(--primary); background: var(--primary-lighter); }

/* ── Chat bubbles ──────────────────────────────────── */
.msg-row {
  display: flex; align-items: flex-end; gap: 0.5rem;
  margin-bottom: 0.85rem;
}
.msg-row-mine  { flex-direction: row-reverse; }
.msg-row-theirs { flex-direction: row; }
.msg-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  font-size: 0.78rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.msg-bubble {
  max-width: 68%; padding: 0.6rem 0.9rem;
  border-radius: 1.1rem; font-size: 0.9rem; line-height: 1.5;
  word-break: break-word;
}
.msg-bubble-mine {
  background: var(--primary); color: white;
  border-bottom-right-radius: 0.25rem;
}
.msg-bubble-theirs {
  background: white; border: 1px solid var(--border);
  color: var(--text); border-bottom-left-radius: 0.25rem;
}
.msg-time {
  font-size: 0.68rem; color: var(--text-light);
  white-space: nowrap; margin-bottom: 0.15rem;
  align-self: flex-end;
}

/* ── Slot message cards ────────────────────────────── */
.msg-slot-card {
  display: flex; gap: 0.75rem; align-items: flex-start;
  background: white; border: 1.5px solid var(--primary-light);
  border-radius: var(--radius); padding: 0.8rem 1rem;
  max-width: 320px;
}
.msg-slot-card.msg-slot-confirmed {
  background: #dcfce7; border-color: #86efac;
}
.msg-slot-icon { font-size: 1.4rem; flex-shrink: 0; }
.msg-slot-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 0.25rem; }
.msg-slot-time { font-weight: 700; font-size: 0.93rem; color: var(--text); }
.btn-slot-confirm {
  display: inline-block; margin-top: 0.4rem;
  background: var(--primary); color: white; font-size: 0.8rem; font-weight: 700;
  border: none; border-radius: var(--radius-sm); padding: 0.35rem 0.85rem;
  cursor: pointer; transition: background var(--transition);
}
.btn-slot-confirm:hover { background: var(--primary-hover); }

/* ── Inbox (messages.html) ─────────────────────────── */
.inbox-list { display: flex; flex-direction: column; gap: 0; }
.inbox-item {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 1rem 1.1rem; border-radius: var(--radius);
  text-decoration: none !important; color: inherit !important;
  border: 1px solid var(--border); margin-bottom: 0.5rem;
  background: white; transition: box-shadow var(--transition), transform var(--transition);
}
.inbox-item:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.inbox-item-unread { border-left: 3px solid var(--primary); }
.inbox-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary-light); color: var(--primary);
  font-weight: 800; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
}
.inbox-body { flex: 1; min-width: 0; }
.inbox-top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.inbox-name { font-weight: 700; font-size: 0.93rem; cursor: pointer; }
.inbox-name.user-profile-link-js:hover { color: var(--primary); }
.inbox-user-ratings { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0.1rem 0 0.15rem; }
.inbox-time { font-size: 0.72rem; color: var(--text-light); white-space: nowrap; }
.inbox-listing { font-size: 0.8rem; color: var(--text-muted); margin: 0.1rem 0 0.2rem; }
.inbox-preview { font-size: 0.82rem; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-item-unread .inbox-preview { color: var(--text); font-weight: 600; }
.inbox-unread-dot {
  flex-shrink: 0; min-width: 20px; height: 20px;
  background: var(--primary); color: white;
  border-radius: 100px; font-size: 0.7rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.inbox-status-pill {
  flex-shrink: 0; background: #dcfce7; color: #166534;
  font-size: 0.7rem; font-weight: 700; border-radius: 100px;
  padding: 0.2rem 0.6rem; letter-spacing: 0.04em;
}

/* ================================================================
   FAVORITES — heart toggle button
   ================================================================ */

.fav-btn {
  background: none;
  border: none;
  padding: 0.3rem 0.45rem;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: #d1d5d1;
  transition: color var(--transition), transform 0.12s ease;
  border-radius: 50%;
  flex-shrink: 0;
}
.fav-btn:hover { color: #f87171; transform: scale(1.15); }
.fav-btn.fav-active { color: var(--primary); }
.fav-btn.fav-active:hover { color: var(--primary-hover); }

/* Detail page fav button */
.fav-btn-detail {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: white; border: 1.5px solid var(--border);
  border-radius: 100px; padding: 0.45rem 1rem;
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  color: var(--text-muted); transition: all var(--transition);
}
.fav-btn-detail:hover { border-color: var(--primary); color: var(--primary); }
.fav-btn-detail.fav-active {
  background: var(--primary-lighter);
  border-color: var(--primary);
  color: var(--primary);
}
.fav-btn-detail .fav-heart { font-size: 1rem; }

/* Favorites page */
.fav-unavailable-overlay {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.7);
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  font-size: 0.8rem; font-weight: 700; color: var(--text-muted);
  text-align: center; padding: 0.5rem;
}

/* ================================================================
   STAR RATINGS
   ================================================================ */

/* ── User rating chips ─────────────────────────────── */
.user-ratings {
  display: inline-flex; align-items: center; gap: 0.35rem; flex-wrap: wrap;
}
.user-rating-chip {
  display: inline-flex; align-items: center;
  background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.25);
  color: #92400e; border-radius: 100px; padding: 0.1rem 0.45rem;
  font-size: 0.71rem; font-weight: 600; white-space: nowrap;
}
.user-rating-no-ratings {
  font-size: 0.71rem; color: var(--text-light); font-style: italic;
}
.user-profile-link {
  color: inherit; font-weight: 700; text-decoration: none;
}
.user-profile-link:hover { color: var(--primary); text-decoration: underline; }
.user-profile-link-js { cursor: pointer; }
.user-profile-link-js:hover { color: var(--primary); }
.conv-other-user-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem;
  margin-top: 0.2rem; font-size: 0.78rem;
}
.browse-card-user.user-profile-link-js:hover { color: var(--primary); }

.star-btn {
  background: none; border: none; font-size: 1.75rem; cursor: pointer;
  color: #d1d5d1; line-height: 1; padding: 0.1rem;
  transition: color 0.1s ease, transform 0.1s ease;
}
.star-btn.selected, .star-btn.hovered { color: #f59e0b; transform: scale(1.1); }

/* Rating card in conversation */
.rating-card {
  background: var(--primary-lighter);
  border: 1px solid var(--primary-light);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  margin: 1rem 0;
}
.rating-card-title {
  font-size: 0.85rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--primary); margin-bottom: 0.75rem;
}
.rating-already {
  font-size: 0.88rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 0.4rem;
}
.rating-already .stars { color: #f59e0b; }

/* ================================================================
   PROFILE — enhanced stats section
   ================================================================ */

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.profile-stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.profile-stat-card .big-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2.5rem;
  line-height: 1;
  color: var(--primary);
  letter-spacing: 0.02em;
  margin-bottom: 0.25rem;
}
.profile-stat-card .stat-label {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-light);
}
/* ratings panel inside profile header */
.profile-header-ratings {
  display: flex;
  gap: 1.25rem;
  flex-shrink: 0;
  margin-left: auto;
}
.ph-rating-item {
  background: rgba(255,255,255,0.65);
  border: 1px solid rgba(0,176,80,0.2);
  border-radius: var(--radius);
  padding: 0.75rem 1.1rem;
  text-align: center;
  min-width: 100px;
}
.ph-rating-label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}
.ph-rating-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
  margin-bottom: 0.2rem;
}
.ph-rating-meta {
  font-size: 0.7rem;
  color: var(--text-light);
}
@media (max-width: 600px) {
  .profile-header-ratings { flex-direction: column; gap: 0.75rem; margin-left: 0; width: 100%; flex-direction: row; }
  .ph-rating-item { flex: 1; min-width: 0; }
}

/* ================================================================
   SYSTEM message in conversation
   ================================================================ */
.msg-system {
  text-align: center; margin: 0.75rem 0;
  font-size: 0.78rem; color: var(--text-muted);
}
.msg-system span {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 100px; padding: 0.25rem 0.9rem;
}

/* ================================================================
   ADDRESS AUTOCOMPLETE DROPDOWN
   ================================================================ */
.addr-suggestions {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 1050;
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  max-height: 220px; overflow-y: auto;
}
.addr-suggestion-item {
  padding: 0.55rem 0.85rem; cursor: pointer;
  font-size: 0.85rem; border-bottom: 1px solid var(--primary-lighter);
  line-height: 1.4; color: var(--text);
  transition: background 0.1s;
}
.addr-suggestion-item:last-child { border-bottom: none; }
.addr-suggestion-item:hover { background: var(--primary-lighter); }
.addr-suggestion-hint { color: #8a9488; font-style: italic; cursor: default; }
.addr-suggestion-hint:hover { background: transparent; }


/* ================================================================
   HANDOVER CONFIRM BAR (conversation confirmed state)
   ================================================================ */
.conv-handover-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: #f0fdf4; border: 1px solid #86efac;
  border-radius: var(--radius-sm); padding: 0.75rem 1rem;
}
.conv-handover-info { flex: 1; font-size: 0.88rem; }
.conv-handover-status { font-size: 0.78rem; }
.btn-handover-confirm {
  background: var(--primary); color: white;
  border: none; border-radius: 100px;
  padding: 0.45rem 1.1rem; font-size: 0.85rem;
  font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background 0.15s;
}
.btn-handover-confirm:hover { background: var(--primary-dark, #007a3d); }

/* ================================================================
   BOOKINGS page section heading
   ================================================================ */
.section-heading {
  font-size: 1.1rem; font-weight: 700; color: var(--text);
  border-bottom: 2px solid var(--primary-light); padding-bottom: 0.4rem;
}
.profile-listings-subheading {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--text-light);
}
