/* RoomieLink KE v3.1 — Improved & Polished */

:root {
  --blue: #1E40AF;
  --blue-bright: #2563EB;
  --blue-soft: #DBEAFE;
  --blue-light: #EFF6FF;
  --dark: #0F172A;
  --ink: #0F172A;           /* Added: consistent text color */
  --muted: #64748B;
  --line: #E2E8F0;
  --card: #ffffff;
  --bg: #F8FAFC;
  --green: #059669;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 16px rgba(15,23,42,0.08);
  --shadow-lg: 0 10px 28px rgba(15,23,42,0.10);
  --shadow-xl: 0 18px 45px rgba(15,23,42,0.16);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  overflow-x: hidden;
  max-width: 100vw;
  font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--dark);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* --- Body lock when modal is open --- */
body.modal-open {
  overflow: hidden;
}

/* --- Loader / busy state --- */
html.rl-busy body > *:not(#rlGlobalLoader) {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}
html.rl-busy #rlGlobalLoader {
  display: flex !important;
}

a { text-decoration: none; color: inherit; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; display: block; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.navbar-inner {
  max-width: 1120px; margin: 0 auto; height: 64px;
  padding: 0 20px; display: flex; align-items: center;
  justify-content: space-between; gap: 16px;
  position: relative;
}
.logo { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.logo-icon {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--blue-soft); display: grid; place-items: center;
  color: var(--blue); font-size: 17px;
}
.logo-name { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.logo-sub { font-size: 9px; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; }

.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a {
  font-size: 13px; font-weight: 600; color: var(--muted);
  padding: 7px 11px; border-radius: 8px; transition: 0.15s;
}
.nav-links a:hover { color: var(--dark); background: #F1F5F9; }
.nav-links a.active { color: var(--blue); background: var(--blue-soft); }

.nav-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--dark);
  padding: 5px 10px 5px 5px; background: #F1F5F9; border-radius: 999px;
}
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--blue); color: #fff; display: grid; place-items: center;
  font-size: 12px; font-weight: 800;
}

.mobile-menu {
  display: none;
  background: none;
  border: 0;
  font-size: 22px;
  cursor: pointer;
  color: var(--dark);
  padding: 4px 6px;
  border-radius: 6px;
}
.mobile-menu:hover { background: var(--blue-light); }

.mobile-signout {
  display: none;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  border: 0; border-radius: 9px; padding: 10px 16px;
  font-weight: 700; font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-bright); }
.btn-ghost { background: transparent; color: var(--muted); font-weight: 600; }
.btn-ghost:hover { color: var(--dark); background: #F1F5F9; }
.btn-light { background: #fff; border: 1px solid var(--line); color: var(--dark); }
.btn-light:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.btn-dark { background: var(--dark); color: #fff; }
.btn-dark:hover { background: #1E293B; }
.btn-danger { background: #FEE2E2; color: #B91C1C; border: 1px solid #FECACA; }
.btn-danger:hover { background: #FECACA; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(165deg, #EFF6FF 0%, #F8FAFC 50%, #F0F7FF 100%);
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(ellipse 70% 50% at 75% 15%, rgba(37,99,235,0.07), transparent),
    radial-gradient(ellipse 50% 40% at 5% 85%, rgba(30,64,175,0.05), transparent);
  pointer-events: none;
}
.hero-inner {
  position: relative; max-width: 1120px; margin: 0 auto;
  padding: 48px 20px 44px; display: grid;
  grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center;
}
.label { font-size: 11px; font-weight: 800; color: var(--blue); letter-spacing: 0.1em; text-transform: uppercase; }
.hero h1 { font-size: 40px; line-height: 1.12; margin: 10px 0 12px; letter-spacing: -0.03em; font-weight: 800; }
.hero h1 span { color: var(--blue); }
.hero p { color: var(--muted); max-width: 440px; font-size: 15px; }
.hero-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.hero-visual {
  border-radius: 18px; overflow: hidden; background: var(--card);
  box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  aspect-ratio: 4/3; position: relative;
}
.hero-visual img { width: 100%; height: 100%; object-fit: cover; }
.hero-badge {
  position: absolute; bottom: 14px; left: 14px;
  background: rgba(255,255,255,0.96); padding: 7px 12px; border-radius: 9px;
  font-size: 12px; font-weight: 700; color: var(--blue);
  box-shadow: var(--shadow-sm);
}

.search-box {
  background: #fff; border-radius: 14px; padding: 14px; margin-top: 24px;
  box-shadow: var(--shadow-md); border: 1px solid var(--line);
}
.search-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.search-tab {
  padding: 7px 14px; font-size: 13px; font-weight: 700; color: var(--muted);
  background: transparent; border: 0; border-radius: 8px; cursor: pointer;
}
.search-tab.active { color: var(--blue); background: var(--blue-soft); }
.search-fields { display: grid; grid-template-columns: 1.3fr 1fr 1fr auto; gap: 10px; align-items: end; }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.field label {
  display: block; font-size: 10px; color: var(--muted); font-weight: 700;
  margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em;
}
.field select, .field input, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; outline: 0;
  background: #fff; font-size: 13px; font-weight: 600; color: var(--dark);
  padding: 9px 11px; transition: border-color 0.15s, box-shadow 0.15s;
}
.field select:focus, .field input:focus, .field textarea:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft);
}
.field select:disabled, .field input:disabled, .field textarea:disabled {
  background: #F8FAFC; color: var(--muted); cursor: not-allowed;
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: 48px 20px; }
.section-inner { max-width: 1120px; margin: 0 auto; }
.section-header { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 24px; }
.section-header h2 { font-size: 22px; letter-spacing: -0.02em; font-weight: 800; }
.section-header p { color: var(--muted); font-size: 14px; }
.view-all { font-size: 13px; font-weight: 700; color: var(--blue); }
.view-all:hover { text-decoration: underline; }

/* ============================================================
   PROPERTY CARDS
   ============================================================ */
.property-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  align-items: stretch;
}
#listingsGrid,
#homeGrid {
  align-items: stretch;
}

.property-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.property-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.property-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 14px;
}
.property-info .card-actions {
  margin-top: auto;
}

.property-img {
  position: relative;
  height: 180px;
  overflow: hidden;
  cursor: pointer;
  background: var(--blue-light);
}
.property-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.property-card:hover .property-img img {
  transform: scale(1.02);
}

.badge {
  position: absolute; top: 10px; left: 10px;
  padding: 4px 9px; border-radius: 6px;
  color: #fff; font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-verified { background: var(--green); }
.badge-agent { background: var(--blue); }

.property-info h3 { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.location { color: var(--muted); font-size: 12px; margin-top: 2px; }
.price { color: var(--blue); font-size: 17px; font-weight: 800; margin-top: 8px; }

.meta {
  display: flex; gap: 10px; flex-wrap: wrap;
  border-top: 1px solid var(--line);
  margin-top: 10px; padding-top: 10px;
  color: var(--muted); font-size: 11px;
}

.card-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.card-actions button {
  flex: 1;
  min-width: 44px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  transition: 0.15s;
}
.card-actions button:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-light);
}
.card-actions .primary {
  background: var(--dark);
  color: #fff;
  border-color: var(--dark);
}
.card-actions .primary:hover {
  background: #1E293B;
  border-color: #1E293B;
  color: #fff;
}

/* ============================================================
   TRUST BADGES
   ============================================================ */
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
.trust-excellent { background: #ECFDF5; color: #047857; }
.trust-strong { background: #EFF6FF; color: #1D4ED8; }
.trust-good { background: #F0FDF4; color: #15803D; }
.trust-fair { background: #FFFBEB; color: #B45309; }

.pill {
  background: #F1F5F9;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* ============================================================
   LOCKED SECTION
   ============================================================ */
.locked-section {
  background: linear-gradient(135deg, var(--blue-light), #fff);
  border: 1px solid var(--blue-soft);
  border-radius: 18px;
  padding: 36px 28px;
  text-align: center;
}
.locked-section .lock-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--blue-soft);
  display: grid; place-items: center;
  margin: 0 auto 14px; font-size: 24px;
}
.locked-section h3 { font-size: 20px; font-weight: 800; margin-bottom: 6px; letter-spacing: -0.02em; }
.locked-section p { color: var(--muted); max-width: 400px; margin: 0 auto 18px; font-size: 14px; }

/* ============================================================
   TRUST GRID
   ============================================================ */
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.trust-item { background: #fff; padding: 20px; border-radius: 12px; border: 1px solid var(--line); }
.trust-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--blue-soft);
  display: grid; place-items: center;
  color: var(--blue); font-weight: 900; font-size: 16px;
}
.trust-item h3 { font-size: 14px; margin-top: 12px; font-weight: 700; }
.trust-item p { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ============================================================
   STATS
   ============================================================ */
.stats { background: var(--dark); padding: 36px 20px; }
.stats-inner {
  max-width: 1120px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center;
}
.stat strong { font-size: 24px; color: #fff; display: block; font-weight: 800; }
.stat span { font-size: 12px; color: #94A3B8; }

/* ============================================================
   CTA
   ============================================================ */
.cta {
  background: var(--blue-light);
  border: 1px solid var(--blue-soft);
  border-radius: 16px;
  padding: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.cta h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.cta p { color: var(--muted); font-size: 14px; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--dark); padding: 48px 20px 24px; color: #fff; }
.footer-inner { max-width: 1120px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 28px; }
.footer h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 12px; color: #94A3B8; font-weight: 700; }
.footer a { display: block; color: #94A3B8; font-size: 13px; margin: 6px 0; transition: color 0.15s; }
.footer a:hover { color: #fff; }
.footer p { color: #94A3B8; font-size: 13px; max-width: 240px; }
.copyright {
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 28px; padding-top: 16px;
  display: flex; justify-content: space-between;
  font-size: 12px; color: #64748B;
}

/* ============================================================
   PAGE HERO
   ============================================================ */
.page-hero {
  background: linear-gradient(180deg, var(--blue-light), var(--bg));
  padding: 32px 20px 24px;
  border-bottom: 1px solid var(--line);
}
.page-hero-inner { max-width: 1120px; margin: 0 auto; }
.page-hero h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 4px; }
.page-hero p { color: var(--muted); font-size: 14px; }

/* ============================================================
   FILTERS
   ============================================================ */
.filters {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(6, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.filters-toggle-bar {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 12px;
  color: var(--ink);
}
.filters-toggle-bar .chev { transition: transform 0.2s; }
.filters-toggle-bar.open .chev { transform: rotate(180deg); }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modalFadeIn 0.2s ease;
}
.modal-overlay.open { display: flex; }

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-box {
  background: #fff;
  border-radius: 16px;
  max-width: 880px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  position: relative;
  padding: 24px;
  animation: modalSlideUp 0.25s ease;
}
@keyframes modalSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-sm { max-width: 420px; }

.modal-close {
  position: absolute;
  right: 14px;
  top: 12px;
  border: 0;
  background: #F1F5F9;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  transition: 0.15s;
}
.modal-close:hover { background: #E2E8F0; }

/* ============================================================
   FORM GROUP
   ============================================================ */
.form-group { margin-bottom: 12px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--muted);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 12px;
  outline: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
.form-group textarea {
  resize: vertical;
  min-height: 60px;
}

.security-note {
  background: var(--blue-light);
  border: 1px solid var(--blue-soft);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 12px;
  color: var(--blue);
  margin-bottom: 14px;
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 90vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 8px;
}
.lb-close, .lb-prev, .lb-next {
  position: absolute;
  background: rgba(255,255,255,0.12);
  border: 0;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  transition: background 0.15s;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover {
  background: rgba(255,255,255,0.22);
}
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* ============================================================
   TOASTS
   ============================================================ */
.toast-wrap {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 400px;
}
.toast {
  background: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: var(--shadow-xl);
  font-size: 13px;
  font-weight: 600;
  border-left: 4px solid var(--green);
  animation: toastSlideIn 0.25s ease;
}
.toast.warn { border-left-color: #D97706; }
.toast.err { border-left-color: #EF4444; }
@keyframes toastSlideIn {
  from { transform: translateX(60px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ============================================================
   COMPARE BAR
   ============================================================ */
.compare-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 12px 20px;
  z-index: 80;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
}
.compare-bar.open { display: block; }
.compare-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.compare-chips { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.chip {
  background: var(--blue-light);
  color: var(--blue);
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================
   PRICING
   ============================================================ */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.price-card {
  background: #fff;
  border-radius: 14px;
  padding: 24px 20px;
  border: 1px solid var(--line);
  text-align: left;
  transition: transform 0.2s, box-shadow 0.2s;
}
.price-card:hover { transform: translateY(-2px); }
.price-card.featured {
  border-color: var(--blue);
  box-shadow: 0 8px 28px rgba(30,64,175,0.10);
  position: relative;
}
.price-card .plan-tag {
  position: absolute;
  top: -10px;
  left: 20px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
}
.price-card h3 { font-size: 15px; font-weight: 700; }
.price-card .amount { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin: 8px 0 4px; }
.price-card .amount span { font-size: 13px; font-weight: 500; color: var(--muted); }
.price-card .plan-desc { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.price-card ul { list-style: none; margin: 14px 0 18px; }
.price-card li { padding: 6px 0; font-size: 13px; color: var(--muted); display: flex; gap: 7px; }
.price-card li::before { content: "✓"; color: var(--green); font-weight: 800; }

/* ============================================================
   SAFETY
   ============================================================ */
.safety-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.safety-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--line);
}
.safety-card h3 { margin-bottom: 10px; font-size: 15px; font-weight: 700; }
.checklist { list-style: none; }
.checklist li { padding: 5px 0; font-size: 13px; color: var(--muted); display: flex; gap: 7px; }
.checklist li::before { content: "☐"; color: var(--blue); }

.safety-inline-warning {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #FFF4F4;
  border: 1px solid #F7D4D4;
  color: #8B3A3A;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 16px;
  font-size: 12px;
  line-height: 1.5;
}
.safety-inline-warning strong {
  font-weight: 800;
  white-space: nowrap;
  color: #A33D3D;
}

/* ============================================================
   MESSAGES
   ============================================================ */
.messages-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
  max-width: 1120px;
  margin: 0 auto;
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.chat-list {
  border-right: 1px solid var(--line);
  overflow-y: auto;
  max-height: 520px;
}
.chat-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  align-items: center;
  transition: background 0.15s;
}
.chat-item:hover,
.chat-item.active { background: var(--blue-light); }
.chat-item-body { flex: 1; min-width: 0; }
.chat-item-top { display: flex; justify-content: space-between; font-size: 13px; }
.chat-item-top span { color: var(--muted); font-size: 11px; }
.chat-item-preview {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.unread-dot {
  background: var(--blue);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.chat-panel { display: flex; flex-direction: column; min-height: 520px; }
.chat-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #F8FAFC;
  min-height: 320px;
}
.msg {
  max-width: 75%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 13px;
  word-wrap: break-word;
}
.msg.them {
  background: #fff;
  border: 1px solid var(--line);
  align-self: flex-start;
}
.msg.me {
  background: var(--blue-soft);
  align-self: flex-end;
}
.msg-time { font-size: 10px; color: var(--muted); margin-top: 4px; }
.chat-input-bar {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.chat-input-bar input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  outline: 0;
}
.chat-input-bar input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
.scam-warn {
  background: #FEF2F2;
  color: #B91C1C;
  padding: 9px 12px;
  font-size: 12px;
  display: none;
}
.scam-warn.show { display: block; }

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: #F8FAFC;
}
.quick-replies button {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  transition: 0.15s;
}
.quick-replies button:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-light);
}

/* ============================================================
   AVATARS
   ============================================================ */
.avatar-md, .avatar-lg {
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  display: grid;
  place-items: center;
  font-weight: 800;
  flex-shrink: 0;
}
.avatar-md { width: 40px; height: 40px; font-size: 14px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }

/* ============================================================
   PROFILE
   ============================================================ */
.profile-grid { display: grid; grid-template-columns: 280px 1fr; gap: 24px; }
.profile-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
}
.profile-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: grid; place-items: center;
  font-size: 28px; font-weight: 800;
  margin-bottom: 12px;
}
.verify-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.verify-row:last-child { border-bottom: 0; }

/* --- Profile editing state --- */
.rl-profile-editing {
  outline: 2px solid rgba(30,64,175,0.12);
  outline-offset: 2px;
}
.rl-profile-editing .profile-field {
  background: #F8FAFC;
  border-color: #94A3B8;
}
.rl-profile-editing .profile-field:focus {
  background: #fff;
  border-color: var(--blue);
}

/* --- Saved listings --- */
.rl-saved-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.rl-saved-row:last-child { border-bottom: 0; }
.rl-saved-row label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.rl-saved-row small { display: block; color: var(--muted); font-size: 11px; }
.rl-save-check {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
  cursor: pointer;
}

/* --- Match cards --- */
.rl-match-clickable {
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.rl-match-clickable:hover {
  background: #EEF4FF !important;
  transform: translateY(-1px);
}

/* ============================================================
   DETAIL MODAL
   ============================================================ */
.detail-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; }
.detail-gallery {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
  cursor: pointer;
}
.detail-side {
  background: var(--blue-light);
  border-radius: 12px;
  padding: 16px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.empty-state p { margin-bottom: 12px; }

/* ============================================================
   COOKIE BAR
   ============================================================ */
.cookie-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: var(--dark);
  color: #fff;
  padding: 14px 20px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
}
.cookie-bar.show { display: block; }
.cookie-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.cookie-inner p { font-size: 13px; color: #CBD5E1; max-width: 640px; }

/* ============================================================
   SAFETY POPUP
   ============================================================ */
.safety-popup-list { list-style: none; margin: 12px 0 18px; }
.safety-popup-list li {
  padding: 8px 0;
  font-size: 14px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}
.safety-popup-list li:last-child { border-bottom: 0; }

/* ============================================================
   STUDENT BADGE
   ============================================================ */
.student-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #EEF2FF;
  color: #4338CA;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #C7D2FE;
}

/* ============================================================
   HOUSE RULES CARD
   ============================================================ */
.house-rules-card {
  background: #F8FAFC;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 10px 0;
  font-size: 12px;
}
.house-rules-card strong { display: block; margin-bottom: 6px; font-size: 12px; }
.house-rules-card ul { margin: 0; padding-left: 16px; color: var(--muted); }
.house-rules-card li { margin: 2px 0; }

/* ============================================================
   HOT DEALS
   ============================================================ */
.hot-deals {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
}
.hot-deals .property-card {
  min-width: 260px;
  max-width: 280px;
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* ============================================================
   SKELETON LOADER
   ============================================================ */
.skeleton-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.skeleton-img {
  height: 160px;
  background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}
.skeleton-line {
  height: 12px;
  border-radius: 6px;
  margin: 10px 14px;
  background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   ROOMMATE FILTER CHIPS
   ============================================================ */
.rm-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.rm-filter-chips label {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: 0.15s;
}
.rm-filter-chips label:hover {
  border-color: var(--blue);
  background: var(--blue-light);
}
.rm-filter-chips input { accent-color: var(--blue); }

/* ============================================================
   ICON BUTTON
   ============================================================ */
.icon-btn {
  flex: 0 0 auto !important;
  width: 36px;
  height: 36px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: 0.15s;
}
.icon-btn:hover {
  border-color: var(--blue);
  background: var(--blue-light);
}
.fav-btn.is-fav {
  border-color: #FECACA;
  background: #FFF1F2 !important;
  color: #DC2626 !important;
  animation: heartPop 0.25s ease;
}
@keyframes heartPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.scam-caution {
  font-size: 11px;
  color: #B45309;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  padding: 6px 8px;
  margin-top: 8px;
}

/* ============================================================
   ACCOUNT MENU (production)
   ============================================================ */
.rl-account-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 4px 9px 4px 5px;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  min-height: 42px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.rl-account-trigger:hover {
  border-color: #94A3B8;
  box-shadow: var(--shadow-sm);
}

.rl-trigger-avatar,
.rl-account-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  overflow: hidden;
  flex-shrink: 0;
}
.rl-trigger-avatar img,
.rl-account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rl-trigger-hamburger { display: none; font-size: 20px; line-height: 1; }
.rl-trigger-name { font-size: 12px; }
.rl-trigger-chevron { font-size: 14px; color: #64748B; }

.rl-account-menu {
  position: absolute;
  right: 16px;
  top: calc(100% + 8px);
  width: 260px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  z-index: 1000;
  overflow: hidden;
  display: none;
}
.rl-account-menu:not(.hidden) { display: block; }

.rl-account-head {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.rl-account-head small {
  display: block;
  color: #64748B;
  font-size: 10px;
  margin-top: 2px;
  word-break: break-all;
}

.rl-account-links { padding: 7px; }
.rl-account-links a,
.rl-account-links button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border: 0;
  background: transparent;
  border-radius: 9px;
  color: var(--ink);
  text-decoration: none;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.rl-account-links a:hover,
.rl-account-links button:hover {
  background: #F8FAFC;
}
.rl-account-links .rl-logout {
  color: #B91C1C;
  border-top: 1px solid var(--line);
  margin-top: 5px;
  padding-top: 13px;
  font-weight: 700;
}

.rl-legacy-hidden { display: none !important; }

/* ============================================================
   ADMIN DASHBOARD
   ============================================================ */
.admin-panel { display: block; }
.admin-panel.hidden { display: none; }

.admin-empty {
  padding: 30px;
  text-align: center;
  color: #8A94A5;
  font-size: 11px;
}

.admin-table-wrap {
  overflow: auto;
  padding: 10px 15px 15px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 690px;
  font-size: 10px;
}
.admin-table th {
  background: #F7F9FC;
  color: #8791A2;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 8px;
  padding: 9px;
  text-align: left;
  font-weight: 700;
}
.admin-table td {
  padding: 9px;
  border-bottom: 1px solid #EEF1F5;
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: 0; }

.admin-status {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 10px;
  font-size: 8px;
  font-weight: 800;
}
.status-active { background: #ECF7E8; color: #57913B; }
.status-pending { background: #FFF5DF; color: #B77916; }
.status-banned,
.status-rejected,
.status-removed { background: #FDEBEC; color: #B84E56; }
.status-featured { background: #E9EEFF; color: #3158C9; }
.status-taken { background: #EEF2F7; color: #596579; }
.status-investigating { background: #FFF4E5; color: #A55B00; }

.admin-action {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 4px;
  padding: 5px 7px;
  font-size: 8px;
  font-weight: 700;
  color: #556071;
  cursor: pointer;
  transition: 0.15s;
}
.admin-action:hover {
  border-color: #B7C5EB;
  color: #2448B8;
}
.admin-action.primary {
  background: #3158D4;
  color: #fff;
  border-color: #3158D4;
}
.admin-action.primary:hover { background: #2448B8; }
.admin-action.danger {
  color: #B84E56;
  border-color: #FECACA;
}
.admin-action.danger:hover {
  background: #FEF2F2;
  border-color: #FCA5A5;
}
.admin-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.admin-link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: #3158D4;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
}
.admin-link-btn:hover { text-decoration: underline; }

/* --- Verification panel rows --- */
.rl-verification-row td {
  padding: 9px;
  border-bottom: 1px solid #EEF1F5;
}
.rl-verification-row .admin-action {
  margin-right: 4px;
}

/* ============================================================
   AUTH STATES
   ============================================================ */
html.rl-auth-pending .nav-right [data-user],
html.rl-auth-pending .nav-right [data-guest],
html.rl-auth-pending .rl-account-trigger,
html.rl-auth-pending .rl-account-menu {
  visibility: hidden;
}
html.rl-auth-pending .profile-gate-dependent {
  visibility: hidden;
}

html.rl-auth-initializing body > *:not(#rlGlobalLoader) {
  visibility: hidden;
}
html.rl-auth-initializing #rlGlobalLoader {
  visibility: visible;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* --- Tablet --- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .property-grid { grid-template-columns: 1fr 1fr; }
  .trust-grid { grid-template-columns: 1fr 1fr; }
  .stats-inner { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters-toggle-bar { display: flex; }
  .filters:not(.filters-open) { display: none; }
  .safety-grid { grid-template-columns: 1fr; }
  .search-fields { grid-template-columns: 1fr 1fr; }
  .messages-layout { grid-template-columns: 1fr; }
  .chat-list { max-height: 200px; border-right: 0; border-bottom: 1px solid var(--line); }
  .profile-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }

  .nav-links { display: none; }
  .mobile-menu { display: block; }
  .nav-links.open {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    left: 12px;
    right: 12px;
    top: 64px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
  }
  .nav-links.open a { display: block; padding: 12px 10px; }
  .nav-links.open .mobile-signout {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    border-top: 1px solid var(--line);
    margin-top: 8px;
    padding: 14px 10px;
    background: transparent;
    color: #C62828;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
  }

  .safety-inline-warning { display: block; }
  .safety-inline-warning strong { display: block; margin-bottom: 3px; }

  .navbar-inner { height: 56px; padding: 0 16px; }
  .nav-right .btn-ghost[data-guest] { display: none; }
  .logo-sub { display: none; }
  .user-chip span[data-name] { display: none; }
  .user-chip { padding: 4px; }

  .rl-account-trigger { padding: 7px 10px; border-radius: 10px; }
  .rl-trigger-hamburger { display: inline-block; }
  .rl-trigger-avatar { display: none; }
  .rl-trigger-name,
  .rl-trigger-chevron { display: none; }
  .rl-account-menu {
    right: 8px;
    top: calc(100% + 6px);
    width: min(290px, calc(100vw - 16px));
  }
  .nav-right { gap: 7px; }
  .mobile-menu.rl-legacy-hidden { display: none !important; }
}

/* --- Mobile --- */
@media (max-width: 640px) {
  .property-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 28px; }
  .filters { grid-template-columns: 1fr; }
  .search-fields { grid-template-columns: 1fr; }
  .trust-grid { grid-template-columns: 1fr; }
  .stats-inner { grid-template-columns: 1fr 1fr; }
  .footer { padding: 32px 16px 20px; }
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }
  .footer p { max-width: 100%; }
  .copyright {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
    text-align: left;
    font-size: 11px;
  }
  .copyright span { display: block; }
  .pricing-grid { grid-template-columns: 1fr; }
  .safety-grid { grid-template-columns: 1fr; }
  .page-hero h1 { font-size: 22px; }

  .rl-saved-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .rl-saved-row > div {
    display: flex;
    flex-direction: column;
  }
  .rl-saved-row .btn { width: 100%; }
}

/* --- Tablet (641-900) --- */
@media (min-width: 641px) and (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.hidden { display: none !important; }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-3 { margin-top: 12px; }
/* V10.2: logged-in mobile header is logo + account avatar only */
@media (max-width: 768px){
  body[data-rl-auth='signed-in'] .nav-links,
  body[data-rl-auth='signed-in'] .nav-right .mobile-menu,
  body[data-rl-auth='signed-in'] .nav-right .rl-legacy-hidden,
  body[data-rl-auth='signed-in'] .nav-right > a:not(#rlAccountTrigger),
  body[data-rl-auth='signed-in'] .nav-right > button:not(#rlAccountTrigger){display:none!important;}
  body[data-rl-auth='signed-in'] .nav-right{display:flex!important;align-items:center;justify-content:flex-end;gap:0;}
  body[data-rl-auth='signed-in'] #rlAccountTrigger{display:flex!important;margin:0!important;}
}

/* V10.3 HEADER: mobile logged-in view is logo + account avatar only. */
@media (max-width: 768px) {
  .mobile-menu, #mobileMenu, .nav-links, .nav-links.open, .mobile-signout { display: none !important; }
  .nav-right { margin-left: auto !important; display: flex !important; align-items: center !important; }
  .rl-account-trigger { display: inline-flex !important; width: 42px !important; height: 42px !important; padding: 0 !important; border-radius: 50% !important; justify-content: center !important; gap: 0 !important; }
  .rl-trigger-avatar { display: grid !important; width: 42px !important; height: 42px !important; border-radius: 50% !important; overflow: hidden !important; }
  .rl-trigger-name, .rl-trigger-chevron, .rl-trigger-hamburger { display: none !important; }
  .rl-account-menu { right: 8px !important; max-width: calc(100vw - 16px) !important; }
}
.rl-mobile-hidden { display: none !important; }
