/* Cariboo styles — warm, clean, mobile-first. */

/* Reset + base */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.6; color: var(--ink); background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }

/* Consistent form-control base */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
select,
textarea {
  min-height: 44px;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  font-size: 1rem;
  line-height: 1.5;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: var(--focus-ring);
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.25rem;
}

select::-ms-expand { display: none; }

a { color: var(--teal); text-decoration: none; text-underline-offset: 0.15em; }
a:hover { text-decoration: underline; text-decoration-color: var(--teal-dark); }

:focus-visible { outline: none; }
button:focus-visible,
[tabindex]:focus-visible { box-shadow: var(--focus-ring); }
a:focus-visible { text-decoration: underline; text-decoration-color: var(--teal-dark); }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }

/* Variables — Caribbean palette + 4px spacing + layered shadows */
:root {
  /* Brand */
  --coral: #E63946;
  --coral-dark: #C1121F;
  --coral-soft: #FFE6E7;

  --teal: #1D7A8C;
  --teal-dark: #155F6D;
  --teal-soft: #E6F4F1;

  --gold: #F4A261;
  --gold-dark: #C47A3B;
  --gold-soft: #FFF6E6;

  /* Neutrals */
  --sand: #F2EBE3;
  --warm-sand: #FAF7F2;
  --cream: #FBF8F3;
  --warm-white: #FAFAF7;
  --card: #FFFFFF;
  --paper: #FFFFFF;

  --border: #E8E6E1;
  --border-subtle: #F0EDE7;
  --ink: #1F2937;
  --ink-strong: #111827;
  --ink-muted: #6B7280;
  --muted: #6B7280;

  --success: #059669;
  --success-soft: #D1FAE5;
  --danger: #DC2626;
  --danger-soft: #FEE2E2;

  /* Radii — unified around 8–12 px for UI surfaces */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Layered shadows */
  --shadow-sm: 0 1px 2px rgba(31, 41, 55, 0.05), 0 1px 1px rgba(31, 41, 55, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(31, 41, 55, 0.08), 0 2px 4px -2px rgba(31, 41, 55, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(31, 41, 55, 0.08), 0 4px 6px -4px rgba(31, 41, 55, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(31, 41, 55, 0.10), 0 8px 10px -6px rgba(31, 41, 55, 0.04);

  /* Spacing scale — 4 px base */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */

  /* Motion */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --focus-ring: 0 0 0 3px rgba(29, 122, 140, 0.25);

  --page-bg: var(--cream);
  --container: 1440px;
}

/* Layout primitives */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 1rem; }
.narrow { max-width: 720px; }
.row { display: flex; flex-direction: column; gap: 1rem; }
.grid { display: grid; gap: 1rem; }
.stack > * + * { margin-top: 1rem; }

/* Typography */
h1, .h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }
h2, .h2 { font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.2; font-weight: 700; }
h3, .h3 { font-size: clamp(1.125rem, 2vw, 1.35rem); line-height: 1.3; font-weight: 700; }
.muted { color: var(--muted); }
.lead { font-size: 1.125rem; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Header & navigation */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.92); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 64px; }
.logo { display: inline-flex; align-items: center; }
.logo:hover { text-decoration: none; }
.logo-img { height: 32px; width: auto; display: block; }
.logo-img-lg { height: 64px; }
.logo-wordmark-img { height: 28px; width: auto; display: block; }
.nav-toggle { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; background: none; border: 1px solid var(--border); border-radius: var(--radius-md); cursor: pointer; }
.nav-toggle:focus-visible { box-shadow: var(--focus-ring); }
.hamburger, .hamburger::before, .hamburger::after { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; }
.hamburger { position: relative; }
.hamburger::before, .hamburger::after { content: ''; position: absolute; left: 0; }
.hamburger::before { top: -7px; } .hamburger::after { top: 7px; }
.main-nav { position: fixed; inset: 64px 0 auto 0; background: var(--card); border-bottom: 1px solid var(--border); padding: 1rem; display: none; flex-direction: column; gap: 1rem; box-shadow: var(--shadow-md); }
.main-nav.open { display: flex; }
.nav-list { display: flex; flex-direction: column; gap: 0.5rem; }
.nav-list a { display: block; padding: 0.5rem 0; color: var(--ink); font-weight: 500; }
.nav-cta { color: var(--coral) !important; font-weight: 700 !important; }
.has-dropdown { position: relative; }
.nav-dropdown-trigger { width: 100%; text-align: left; background: none; border: none; padding: 0.5rem 0; font-weight: 500; cursor: pointer; }
.dropdown { display: none; flex-direction: column; gap: 0.25rem; padding-left: 1rem; }
.dropdown.open { display: flex; }
.header-tools { display: flex; flex-direction: column; gap: var(--space-3); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.country-picker select, .user-menu select { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-md); background-color: var(--warm-white); }
.user-menu { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.header-tools .btn { min-height: 44px; }

/* Locale switch */
.locale-switch { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--warm-white); }
.locale-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 44px; padding: 0.35rem 0.6rem; font-size: 0.8rem; font-weight: 700; color: var(--muted); background: transparent; transition: background-color var(--transition-fast), color var(--transition-fast); }
.locale-btn:hover { text-decoration: none; background: var(--border); color: var(--ink); }
.locale-btn.active { background: var(--teal); color: #fff; }
.locale-btn:focus-visible { box-shadow: var(--focus-ring); }

/* Currency conversion inline note */
.price-usd-conversion { font-size: 0.85em; font-weight: 500; margin-left: 0.35rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.5;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-base), background-color var(--transition-base), border-color var(--transition-base);
}
.btn:hover { text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible { box-shadow: var(--focus-ring); }
.btn-primary { background: var(--coral); color: #fff; border-color: var(--coral); box-shadow: 0 2px 4px rgba(230, 57, 70, 0.15); }
.btn-primary:hover { background: var(--coral-dark); border-color: var(--coral-dark); box-shadow: 0 4px 8px rgba(230, 57, 70, 0.18); }
.btn-secondary { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn-secondary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn-ghost { background: transparent; color: var(--teal); border-color: var(--border); }
.btn-ghost:hover { background: var(--warm-white); border-color: var(--border); }
.btn-danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-lg { min-height: 48px; padding: 0.85rem 1.5rem; font-size: 1.05rem; }
.btn-sm { min-height: 36px; padding: 0.35rem 0.65rem; font-size: 0.875rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.inline-form { display: inline; }

/* Hero */
.hero { padding: 3rem 0; background: linear-gradient(135deg, var(--warm-white) 0%, var(--cream) 100%); text-align: center; }
.hero-title { color: var(--teal); margin-bottom: 0.75rem; }
.hero-subtitle { color: var(--muted); max-width: 560px; margin: 0 auto 1.5rem; }
.hero-search { display: flex; flex-direction: column; gap: var(--space-3); max-width: 680px; margin: 0 auto; background: var(--card); padding: var(--space-3); border-radius: var(--radius-xl); box-shadow: var(--shadow-xl); }
.hero-search .search-input, .hero-search .search-select { padding: 0.85rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background-color: var(--warm-white); width: 100%; }
.search-input:focus, .search-select:focus { outline: none; border-color: var(--teal); box-shadow: var(--focus-ring); }

/* Features */
.features { padding: 2.5rem 0; }
.feature-grid { display: grid; gap: 1.25rem; }
.feature-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; text-align: center; box-shadow: var(--shadow-sm); }
.feature-icon { display: inline-block; font-size: 2rem; margin-bottom: 0.75rem; }
.feature-card h2 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.feature-card p { color: var(--muted); font-size: 0.95rem; }

/* Sections */
.categories-section, .recent-listings { padding: 2rem 0; }
.section-header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.link-arrow { font-weight: 600; }

/* Category tiles */
.category-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: var(--space-3); }
.category-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-5) var(--space-3); text-align: center; color: var(--ink); transition: transform var(--transition-fast), box-shadow var(--transition-base), border-color var(--transition-fast), background-color var(--transition-fast); position: relative; }
.category-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); text-decoration: none; background: var(--warm-sand); border-color: var(--border-subtle); }
.category-tile:focus-visible { box-shadow: var(--shadow-md), var(--focus-ring); }
.category-icon { font-size: 1.75rem; line-height: 1; }
.category-name { font-weight: 600; font-size: 0.9rem; }

/* Listing cards */
.listing-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-4); }
.listing-card { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform var(--transition-fast), box-shadow var(--transition-base), border-color var(--transition-fast); }
.listing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-subtle); }
.listing-card:has(.card-link:focus-visible) { box-shadow: var(--shadow-md), var(--focus-ring); }
.card-link { display: block; color: inherit; }
.card-link:hover { text-decoration: none; }
.card-image { position: relative; aspect-ratio: 4/3; background: var(--warm-white); overflow: hidden; }
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: var(--space-3) var(--space-4); }
.card-title { font-size: 1rem; font-weight: 600; line-height: 1.35; margin-bottom: var(--space-1); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-price { font-size: 1.1rem; font-weight: 700; color: var(--teal); margin-bottom: var(--space-1); }
.price-contact { color: var(--muted); font-weight: 500; }
.card-location, .card-meta { font-size: 0.85rem; color: var(--muted); }
.card-meta { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-1); }
.favorite-btn { position: absolute; top: var(--space-2); right: var(--space-2); width: 36px; height: 36px; border-radius: 50%; border: none; background: rgba(255,255,255,0.95); color: var(--coral); font-size: 1.25rem; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform var(--transition-fast), background-color var(--transition-fast); }
.favorite-btn:hover { background: #fff; transform: scale(1.08); }
.favorite-btn:focus-visible { box-shadow: var(--focus-ring); }
.favorite-btn[aria-pressed="true"] { color: var(--coral); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.2rem 0.5rem; border-radius: 999px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.badge-cash { position: absolute; bottom: 0.5rem; left: 0.5rem; background: var(--gold); color: #3d2612; }
.badge-reach { position: absolute; top: 0.5rem; left: 0.5rem; background: var(--teal); color: #fff; }
.badge-island { background: #e6f4f1; color: var(--teal-dark); }
.badge-premium { background: #fde8e9; color: var(--coral-dark); }
.badge-success { background: #d1fae5; color: var(--success); }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: var(--danger); }

/* Listing detail */
.breadcrumbs { padding: 1rem 0; font-size: 0.875rem; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs span[aria-hidden="true"] { margin: 0 0.35rem; }
.listing-detail { padding-bottom: 3rem; }
.listing-detail-grid { display: grid; gap: 1.5rem; }
.gallery-main { margin: 0; background: var(--warm-white); border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4/3; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 0.5rem; margin-top: 0.75rem; overflow-x: auto; }
.thumb { flex: 0 0 72px; height: 72px; border: 2px solid transparent; border-radius: var(--radius-md); overflow: hidden; padding: 0; background: var(--warm-white); cursor: pointer; transition: border-color var(--transition-fast), box-shadow var(--transition-fast); }
.thumb:focus-visible { box-shadow: var(--focus-ring); }
.thumb.active { border-color: var(--teal); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.listing-header { margin-bottom: 1rem; }
.listing-price { font-size: 1.75rem; font-weight: 800; color: var(--teal); margin: 0.5rem 0; }
.listing-location { color: var(--muted); margin-bottom: 0.5rem; }
.listing-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; color: var(--muted); font-size: 0.875rem; }
.attributes-card, .description-card, .seller-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; margin-top: 1rem; }
.attributes-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 0.75rem 1rem; }
.attribute dt { font-size: 0.8rem; color: var(--muted); text-transform: capitalize; }
.attribute dd { font-weight: 600; margin: 0; }
.seller-badge { display: flex; align-items: center; gap: 0.75rem; }
.seller-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--teal); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem; }
.seller-name { font-weight: 700; display: flex; align-items: center; gap: 0.35rem; }
.seller-meta { font-size: 0.875rem; color: var(--muted); }
.verified-chips { display: flex; gap: 0.35rem; margin-top: 0.35rem; }
.chip { font-size: 0.75rem; background: #e6f4f1; color: var(--teal-dark); padding: 0.15rem 0.4rem; border-radius: 999px; }
.action-buttons { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-3); margin-top: var(--space-6); }
.report-link { margin-top: 1rem; font-size: 0.85rem; }

/* Forms */
.form { display: flex; flex-direction: column; gap: var(--space-5); }
.field { display: flex; flex-direction: column; gap: var(--space-1); }
.field label { font-weight: 600; font-size: 0.95rem; color: var(--ink-strong); }
.field input, .field select, .field textarea { padding: 0.65rem 0.85rem; border: 1px solid var(--border); border-radius: var(--radius-md); background-color: var(--card); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--teal); box-shadow: var(--focus-ring); }
.field-hint { font-size: 0.8rem; color: var(--muted); }
.field-error { font-size: 0.8rem; color: var(--danger); font-weight: 500; }
.field.is-error input, .field.is-error select, .field.is-error textarea { border-color: var(--danger); background-color: var(--danger-soft); }
.radio-group { display: flex; flex-direction: column; gap: var(--space-2); }
.radio-label { display: flex; align-items: center; gap: var(--space-2); font-weight: 500; cursor: pointer; }
.radio-label input:focus-visible { box-shadow: var(--focus-ring); }
.field-checkbox label { display: flex; align-items: flex-start; gap: var(--space-2); font-weight: 500; cursor: pointer; }
.field-checkbox input:focus-visible { box-shadow: var(--focus-ring); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-4); }
.price-inputs { display: flex; align-items: center; gap: var(--space-2); }
.price-inputs input { flex: 1; }

.dynamic-fieldset { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1rem; margin: 0; }
.dynamic-fieldset legend { font-weight: 700; padding: 0 0.5rem; }

/* Auth */
.auth-page { display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; min-height: 70vh; }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2rem; box-shadow: var(--shadow-md); }
.auth-header { text-align: center; margin-bottom: 1.5rem; }
.auth-header .logo-img-lg { margin-bottom: 0.5rem; }
.auth-header .logo-wordmark-img { margin: 0 auto 0.75rem; }
.auth-header h1 { font-size: 1.5rem; margin-top: 0.5rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: 0.95rem; color: var(--muted); }

/* Dashboard */
.dashboard { padding: var(--space-6) 0 var(--space-12); }
.dashboard-header { display: flex; flex-direction: column; gap: var(--space-4); margin-bottom: var(--space-6); }
.tabs { display: flex; gap: var(--space-1); overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: var(--space-5); }
.tab { padding: 0.75rem 1rem; background: none; border: none; border-bottom: 2px solid transparent; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; border-radius: var(--radius-sm) var(--radius-sm) 0 0; transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast); }
.tab:hover { color: var(--teal); background: var(--teal-soft); }
.tab.active { color: var(--teal); border-bottom-color: var(--teal); }
.tab:focus-visible { box-shadow: var(--focus-ring); }
.tab-panel[hidden] { display: none; }
.thread-list { display: flex; flex-direction: column; gap: 0.75rem; }
.thread-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); }
.thread-item a { display: block; padding: 1rem; color: inherit; }
.thread-title { font-weight: 600; }
.thread-meta { font-size: 0.875rem; color: var(--muted); }
.subscription-status-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; margin-bottom: 1.5rem; }
.tier-grid { display: grid; gap: 1rem; margin-bottom: 1.5rem; }
.tier-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; text-align: center; }
.tier-price { font-size: 1.75rem; font-weight: 800; color: var(--teal); }
.tier-price .period { font-size: 1rem; font-weight: 500; color: var(--muted); }
.tier-limit { margin-bottom: 1rem; }
.data-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.data-table th, .data-table td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.data-table th { background: var(--warm-white); font-weight: 700; }

/* Browse */
.browse-layout { display: grid; gap: 1.5rem; padding: 1.5rem 0 3rem; }
.browse-sidebar { order: 2; }
.browse-results { order: 1; }
.filters { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; display: flex; flex-direction: column; gap: 1.25rem; }
.filter-group h3 { font-size: 0.95rem; margin-bottom: var(--space-2); }
.filter-group select, .filter-group input[type="number"] { width: 100%; padding: 0.65rem 0.85rem; border: 1px solid var(--border); border-radius: var(--radius-md); background-color: var(--card); }
.filter-group select:focus, .filter-group input[type="number"]:focus { outline: none; border-color: var(--teal); box-shadow: var(--focus-ring); }
.results-header { margin-bottom: 1.25rem; }
.results-header h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 1.5rem; }
.heading-country { font-weight: 500; color: var(--muted); font-size: 1rem; }
.results-count, .search-term { color: var(--muted); margin-top: 0.25rem; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 0.5rem; margin-top: 1.5rem; flex-wrap: wrap; }
.page-numbers { display: flex; gap: 0.25rem; }
.page-link { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 0.6rem; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--card); color: var(--ink); font-weight: 600; transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast); }
.page-link:hover:not(.current):not(.disabled) { background: var(--warm-white); border-color: var(--teal); color: var(--teal); text-decoration: none; }
.page-link:focus-visible { box-shadow: var(--focus-ring); }
.page-link.current { background: var(--teal); color: #fff; border-color: var(--teal); }
.page-link.disabled { opacity: 0.5; cursor: not-allowed; }

/* Segment hero search (cars / motorcycles) */
.segment-hero { background: linear-gradient(135deg, var(--warm-white) 0%, var(--cream) 100%); padding: 2.5rem 0 2rem; border-bottom: 1px solid var(--border); }
.segment-hero__header { text-align: center; margin-bottom: 1.5rem; }
.segment-hero__title { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem; color: var(--teal); font-size: clamp(1.75rem, 4vw, 2.5rem); }
.segment-hero__subtitle { color: var(--muted); margin-top: 0.35rem; }
.segment-search { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; box-shadow: var(--shadow-lg); }
.segment-search__grid { display: grid; gap: 1rem 1.25rem; grid-template-columns: 1fr; }
.segment-field { display: flex; flex-direction: column; gap: 0.35rem; }
.segment-field label { font-size: 0.85rem; font-weight: 600; color: var(--ink); }
.segment-field input, .segment-field select { padding: 0.65rem 0.85rem; border: 1px solid var(--border); border-radius: var(--radius-md); background-color: var(--warm-white); width: 100%; }
.segment-field input:focus, .segment-field select:focus { outline: none; border-color: var(--teal); box-shadow: var(--focus-ring); }
.segment-field .mileage-unit { margin-top: 0.5rem; }
.range-inputs { display: flex; align-items: center; gap: 0.5rem; }
.range-inputs input { flex: 1; min-width: 0; }
.range-inputs span { color: var(--muted); font-size: 0.9rem; }
.segment-search__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-5); padding-top: var(--space-5); border-top: 1px solid var(--border); }
.segment-results { padding: 1.5rem 0 3rem; }
.results-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.results-toolbar .results-count { color: var(--muted); margin: 0; }
.sort-control { display: flex; align-items: center; gap: 0.5rem; }
.sort-control label { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.sort-control select { padding: 0.65rem 0.85rem; border: 1px solid var(--border); border-radius: var(--radius-md); background-color: var(--card); }
.sort-control select:focus { outline: none; border-color: var(--teal); box-shadow: var(--focus-ring); }

@media (min-width: 640px) {
  .segment-search__grid { grid-template-columns: repeat(2, 1fr); }
  .segment-field--make, .segment-field--model, .segment-field--category, .segment-field--country { grid-column: span 1; }
  .segment-field--year, .segment-field--price { grid-column: span 1; }
  .segment-field--mileage, .segment-field--transmission, .segment-field--fuel, .segment-field--reach { grid-column: span 1; }
}

@media (min-width: 1024px) {
  .segment-search__grid { grid-template-columns: repeat(4, 1fr); }
  .segment-field--category, .segment-field--country, .segment-field--make, .segment-field--model { grid-column: span 1; }
  .segment-field--year { grid-column: span 1; }
  .segment-field--price { grid-column: span 1; }
  .segment-field--mileage { grid-column: span 1; }
  .segment-field--transmission, .segment-field--fuel, .segment-field--reach { grid-column: span 1; }
}

/* Callouts & alerts */
.callout { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.callout-cash { background: #fffbeb; border-color: var(--gold); }
.callout-info { background: #eff6ff; border-color: #93c5fd; }
.callout.hidden { display: none; }
.flash-container { position: fixed; top: 76px; right: 1rem; left: 1rem; z-index: 200; display: flex; flex-direction: column; gap: 0.5rem; pointer-events: none; }
.alert { pointer-events: auto; padding: 0.85rem 1rem; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: space-between; gap: 1rem; box-shadow: var(--shadow-md); }
.alert-info { background: #eff6ff; color: #1e3a8a; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-close { background: none; border: none; font-size: 1.25rem; cursor: pointer; color: inherit; }

/* Modals */
.modal { position: fixed; inset: 0; z-index: 300; width: 100%; height: 100%; border: none; padding: 1rem; background: transparent; }
.modal[open] { display: flex; align-items: center; justify-content: center; background: rgba(31,41,55,0.5); }
.modal::backdrop { background: rgba(31,41,55,0.5); }
.modal-content { background: var(--card); border-radius: var(--radius-lg); padding: 1.5rem; width: 100%; max-width: 460px; box-shadow: var(--shadow-lg); }
.modal-content h2 { margin-bottom: 0.5rem; }
.modal-content .field { margin-top: 1rem; }
.modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: var(--space-3); margin-top: var(--space-5); }

/* Empty states */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-icon { font-size: 3rem; }
.empty-state h2 { color: var(--ink); margin: 0.75rem 0 0.5rem; }
.empty-state .btn { margin-top: 1rem; }

/* Sell banner */
.sell-banner { background: var(--teal); color: #fff; padding: 2rem 0; margin-top: 1rem; }
.sell-banner-inner { display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; }
.sell-banner h2 { color: #fff; }
.sell-banner p { opacity: 0.9; }
.sell-banner .btn-secondary { background: #fff; color: var(--teal); }

/* Footer */
.site-footer { background: var(--warm-white); border-top: 1px solid var(--border); padding: var(--space-10) 0 var(--space-6); }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-6); margin-bottom: var(--space-8); }
.footer-brand .tagline { color: var(--muted); margin-top: var(--space-1); }
.footer-links h3 { font-size: 1rem; margin-bottom: var(--space-2); color: var(--ink-strong); }
.footer-links a { display: block; padding: 0.2rem 0; color: var(--muted); font-size: 0.95rem; transition: color var(--transition-fast); }
.footer-links a:hover { color: var(--teal); text-decoration: none; }
.footer-small { border-top: 1px solid var(--border); padding-top: var(--space-5); font-size: 0.85rem; color: var(--muted); }
.footer-small p + p { margin-top: var(--space-1); }

/* Content pages */
.content-page { padding: 1.5rem 0 3rem; }
.content-page h2 { margin-top: 1.5rem; margin-bottom: 0.75rem; }
.content-page ol, .content-page ul { padding-left: 1.25rem; margin-bottom: 1rem; }
.content-page ol { list-style: decimal; }
.content-page ul { list-style: disc; }
.content-page li { margin-bottom: 0.35rem; }

/* Utilities */
.flex { display: flex; } .gap-1 { gap: 0.5rem; } .gap-2 { gap: 1rem; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.hidden { display: none !important; }

/* Chat / messaging thread */
.conversation-page {
  position: relative;
  padding-bottom: 0;
}

.thread-header {
  position: sticky;
  top: 64px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  margin-bottom: 0.5rem;
  background: var(--page-bg);
  border-bottom: 1px solid var(--border);
}

.thread-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.thread-back:hover { background: var(--warm-white); text-decoration: none; }

.thread-contact {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.thread-avatar { width: 40px; height: 40px; font-size: 1rem; flex-shrink: 0; }

.thread-info { min-width: 0; }

.thread-name {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.thread-country {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border);
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
}

.thread-header .verified-chips { margin-top: 0.2rem; }

/* Listing context pill above thread */
.listing-context-pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .15s ease;
}

.listing-context-pill:hover {
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.listing-context-pill img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--warm-white);
  flex-shrink: 0;
}

.pill-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.pill-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill-price {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--teal);
}

/* Conversation thread */
.conversation-thread {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem 0 160px;
}

.message-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  max-width: 100%;
}

.message-row--mine { justify-content: flex-end; }
.message-row--theirs { justify-content: flex-start; }

.message-row:last-child,
.chat-empty { scroll-margin-bottom: 150px; }

.message-avatar,
.message-avatar-spacer {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 0.25rem;
}

.message-avatar {
  background: var(--teal);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.message-avatar-spacer { background: transparent; }

.message-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-width: calc(100% - 40px);
  min-width: 0;
}

.message-row--mine .message-content { align-items: flex-end; }
.message-row--theirs .message-content { align-items: flex-start; }

.message-name {
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: 0.25rem;
}

.message-bubble {
  position: relative;
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
  line-height: 1.45;
  word-wrap: break-word;
  max-width: 100%;
}

.bubble--mine {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  color: #fff;
  border-radius: 18px 18px 18px 4px;
}

.bubble--theirs {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 1px 2px rgba(31,41,55,0.04);
  border-radius: 18px 18px 4px 18px;
}

.message-body {
  margin: 0;
  white-space: pre-wrap;
}

.message-time {
  display: block;
  font-size: 0.7rem;
  margin-top: 0.35rem;
  opacity: 0.85;
}

.bubble--mine .message-time {
  text-align: right;
  color: rgba(255,255,255,0.9);
}

.bubble--theirs .message-time {
  text-align: left;
  color: var(--muted);
}

.message-read {
  font-size: 0.7rem;
  color: var(--muted);
  margin-right: 0.25rem;
}

.message-row--theirs .message-read { display: none; }

.day-separator {
  position: relative;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0.75rem 0 0.25rem;
}

.day-separator span {
  position: relative;
  z-index: 1;
  background: var(--page-bg);
  padding: 0 0.6rem;
}

.day-separator::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--border);
  z-index: 0;
}

/* Empty state inside chat */
.chat-empty {
  margin: auto 0;
  padding: 2rem 1rem;
}

/* Composer */
.conversation-composer {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  padding: 0.75rem 0 calc(0.75rem + env(safe-area-inset-bottom));
  background: var(--page-bg);
  border-top: 1px solid var(--border);
}

.composer-field {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, border-color .2s ease;
}

.composer-field:focus-within {
  box-shadow: var(--shadow-md);
  border-color: var(--teal);
}

.conversation-composer textarea {
  flex: 1 1 auto;
  resize: none;
  border: 0;
  background: transparent;
  padding: 0.45rem 0.5rem;
  max-height: 120px;
  line-height: 1.4;
}

.conversation-composer textarea:focus {
  outline: none;
  box-shadow: none;
}

.composer-send {
  flex: 0 0 auto;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
}

.composer-hint {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin-top: 0.4rem;
}

/* Responsive chat */
@media (min-width: 640px) {
  .message-content { max-width: 420px; }
  .bubble--mine { border-radius: 20px 20px 20px 6px; }
  .bubble--theirs { border-radius: 20px 20px 6px 20px; }
}

@media (min-width: 1024px) {
  .thread-header { top: 72px; }
  .message-content { max-width: 520px; }
}

/* Responsive */
@media (min-width: 640px) {
  .hero-search { flex-direction: row; }
  .hero-search .search-input { flex: 1; }
  .feature-grid { grid-template-columns: repeat(3,1fr); }
  .category-grid { grid-template-columns: repeat(3,1fr); }
  .listing-grid { grid-template-columns: repeat(2,1fr); }
  .row-2 { flex-direction: row; }
  .row-2 > * { flex: 1; }
  .action-buttons { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sell-banner-inner { flex-direction: row; align-items: center; justify-content: space-between; }
  .tier-grid { grid-template-columns: repeat(3,1fr); }
}

@media (min-width: 1024px) {
  .nav-toggle { display: none; }
  .main-nav { position: static; display: flex !important; flex-direction: row; align-items: center; justify-content: space-between; flex: 1; padding: 0; border: none; box-shadow: none; margin-left: 2rem; }
  .nav-list { flex-direction: row; align-items: center; gap: 1.25rem; }
  .dropdown { position: absolute; top: 100%; left: 0; min-width: 220px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.5rem; box-shadow: var(--shadow-md); padding-left: 0.5rem; }
  .header-tools { flex-direction: row; align-items: center; padding-top: 0; border-top: none; }
  .category-grid { grid-template-columns: repeat(4,1fr); }
  .listing-grid { grid-template-columns: repeat(3,1fr); }
  .listing-grid.compact { grid-template-columns: repeat(2,1fr); }
  .listing-detail-grid { grid-template-columns: 1.2fr 0.8fr; align-items: start; }
  .browse-layout { grid-template-columns: 260px 1fr; }
  .browse-sidebar { order: 1; }
  .browse-results { order: 2; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

@media (min-width: 1280px) {
  .listing-grid { grid-template-columns: repeat(4,1fr); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* === Dealership portal === */
.page-dealership { background: linear-gradient(180deg, var(--warm-white) 0%, var(--cream) 240px); }

.dealership { padding: 1.5rem 0 3rem; }

.dealership-hero {
  display: grid;
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

.dealership-hero__text h1 { color: var(--teal); margin-bottom: 0.35rem; }
.dealership-hero__text .lead { max-width: 560px; }

.subscription-summary {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
}

.subscription-summary__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.subscription-summary__tier { text-transform: uppercase; }

.subscription-summary__expiry {
  font-size: 0.875rem;
  color: var(--muted);
}

.subscription-summary__usage { margin-bottom: 1rem; }

.subscription-summary__usage-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.subscription-summary__usage-label { color: var(--muted); }
.subscription-summary__usage-count { font-weight: 700; }

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal) 0%, var(--gold) 100%);
  border-radius: 999px;
  transition: width .4s ease;
}

.subscription-summary__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.subscription-summary__credits {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  background: #e6f4f1;
  color: var(--teal-dark);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
}

.subscription-summary__credits--low {
  background: #fee2e2;
  color: var(--danger);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}

.stat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-tile__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.stat-tile__value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.stat-tile__context {
  font-size: 0.8rem;
  color: var(--muted);
}

.stat-tile--warning { border-color: var(--gold); background: #fffbeb; }
.stat-tile--warning .stat-tile__value { color: #92400e; }

.stat-tile--success { border-color: #10b981; background: #f0fdf4; }
.stat-tile--success .stat-tile__value { color: var(--success); }

.dealership-listings .section-header { margin-bottom: 1rem; }

.warning-banner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
  background: #fffbeb;
  border: 1px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}

.warning-banner p { color: #78350f; }

.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.category-filter__pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.45rem 0.9rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.category-filter__pill:hover {
  background: var(--warm-white);
  text-decoration: none;
}

.category-filter__pill:focus-visible {
  box-shadow: var(--focus-ring);
}

.category-filter__pill--active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.listings-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.listings-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.listings-table th,
.listings-table td {
  padding: 0.85rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.listings-table th {
  background: var(--warm-white);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.listings-table tbody tr:last-child td { border-bottom: none; }

.listings-table__row { transition: background .15s ease; }
.listings-table__row:hover { background: var(--warm-white); }

.listings-table__row--featured { background: #fffbeb; }
.listings-table__row--featured:hover { background: #fef3c7; }

.listings-table__listing {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 240px;
}

.listings-table__thumb {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--warm-white);
  border: 1px solid var(--border);
}

.listings-table__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.listings-table__details { min-width: 0; }

.listings-table__title {
  display: block;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}

.listings-table__title:hover { text-decoration: underline; }

.listings-table__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
}

.listings-table__country {
  color: var(--muted);
  font-weight: 500;
}

.listings-table__price {
  font-weight: 700;
  color: var(--teal);
  white-space: nowrap;
}

.listings-table__status,
.listings-table__reach,
.listings-table__expiry,
.listings-table__views,
.listings-table__actions {
  white-space: nowrap;
}

.listings-table__badges { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.listings-table__reach .badge,
.listings-table__reach .badge-reach { background: var(--teal); color: #fff; position: static; }

.badge--featured {
  background: linear-gradient(135deg, #fde68a 0%, var(--gold) 100%);
  color: #3d2612;
}

.badge--expiring {
  background: #fef3c7;
  color: #92400e;
}

.badge--sold {
  background: #d1fae5;
  color: var(--success);
}

.btn--showcase {
  background: linear-gradient(135deg, var(--coral) 0%, #f4a261 100%);
  color: #fff;
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(230, 57, 70, 0.2);
}

.btn--showcase:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--coral-dark) 0%, #e08a4a 100%);
  box-shadow: 0 4px 10px rgba(230, 57, 70, 0.25);
}

.btn--showcase:disabled {
  background: var(--border);
  color: var(--muted);
  box-shadow: none;
  opacity: 0.7;
  cursor: not-allowed;
}

.btn--unshowcase {
  background: var(--card);
  color: var(--muted);
  border-color: var(--border);
}

.btn--unshowcase:hover {
  background: #fee2e2;
  color: var(--danger);
  border-color: var(--danger);
}

.showcase-hint {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

@media (min-width: 481px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 640px) {
  .warning-banner { flex-direction: row; align-items: center; justify-content: space-between; }
}

@media (min-width: 769px) {
  .dealership-hero { grid-template-columns: 1fr 360px; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .dealership-hero { grid-template-columns: 1fr 420px; }
  .stats-grid { grid-template-columns: repeat(6, 1fr); }
  .stat-tile { padding: 1.25rem; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* === New variables for sold / admin accents === */
:root {
  --sold: var(--coral);
  --sold-soft: #fde8e9;
  --sold-text: var(--coral-dark);
}

/* === Real Estate header submenu === */
.nav-submenu {
  min-width: 260px;
}

.nav-submenu li a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
}

.nav-submenu li a:hover {
  background: var(--warm-white);
  text-decoration: none;
}

.dropdown-separator {
  height: 1px;
  margin: 0.4rem 0.75rem;
  background: var(--border);
}

.nav-admin-link {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--coral) !important;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--coral);
  border-radius: var(--radius-md);
}

.nav-admin-link:hover {
  background: var(--coral);
  color: #fff !important;
  text-decoration: none;
}

.nav-admin-link:focus-visible {
  box-shadow: var(--focus-ring);
}

@media (min-width: 1024px) {
  .nav-submenu {
    min-width: 280px;
    padding: 0.5rem;
  }
}

/* === Find a home page === */
.find-a-home {
  padding: 1.5rem 0 3rem;
}

.find-a-home__grid {
  display: grid;
  gap: 1.5rem;
}

.re-hero {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #e6f4f1 0%, var(--warm-white) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.re-hero__title {
  color: var(--teal);
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  margin-bottom: 0.35rem;
}

.re-hero__subtitle {
  color: var(--muted);
  max-width: 640px;
  margin-bottom: 0.75rem;
}

.re-hero__stat {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--teal-dark);
  background: #fff;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

/* Filter rail */
.filter-rail {
  order: 2;
}

.filter-rail__card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.filter-rail__title {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.filter-group {
  margin-bottom: 1.25rem;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.filter-input,
.filter-select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--card);
}

.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: var(--focus-ring);
}

.range-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.range-inputs .filter-input {
  flex: 1;
  min-width: 0;
}

.range-inputs span {
  color: var(--muted);
  font-size: 0.9rem;
}

.price-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* Segmented control (Rent / Buy / Both) */
.segmented {
  display: inline-flex;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--warm-white);
}

.segmented input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.segmented label {
  flex: 1;
  text-align: center;
  padding: 0.55rem 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.segmented label:not(:last-child) {
  border-right: 1px solid var(--border);
}

.segmented input:checked + label {
  background: var(--teal);
  color: #fff;
}

.segmented input:focus-visible + label {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--teal);
}

/* Chip group (property type) */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip-toggle {
  position: relative;
}

.chip-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.chip-toggle label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.75rem;
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.chip-toggle:has(input:checked) label,
.chip-toggle input:checked + label {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.chip-toggle input:focus-visible + label {
  outline: none;
  box-shadow: 0 0 0 2px var(--teal);
}

/* Quick chips (rooms) */
.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.quick-chip {
  padding: 0.3rem 0.7rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

.quick-chip:hover {
  background: var(--warm-white);
  border-color: var(--teal);
  color: var(--teal);
}

/* Checkbox helpers */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  cursor: pointer;
}

/* Find a home results */
.find-a-home__results {
  order: 1;
}

.results-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.results-toolbar__count {
  font-weight: 700;
  color: var(--ink);
}

.results-toolbar__count span {
  color: var(--muted);
  font-weight: 500;
}

.results-sort {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.results-sort label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.sold-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--border);
}

.sold-section__title {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

/* === Sold affordance on cards === */
.listing-card.is-sold .card-image img {
  filter: grayscale(0.6);
  opacity: 0.85;
}

.listing-card.is-sold .card-title,
.listing-card.is-sold .card-price {
  opacity: 0.9;
}

.sold-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--sold);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  box-shadow: var(--shadow-sm);
}

.card-sold-meta {
  font-size: 0.8rem;
  color: var(--sold-text);
  font-weight: 600;
  margin-top: 0.25rem;
}

/* === Listing detail sold banner === */
.sold-banner {
  background: var(--sold-soft);
  border: 1px solid var(--sold);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.sold-banner p {
  margin: 0;
  color: var(--sold-text);
  font-weight: 700;
}

/* === Admin dashboard === */
.admin-dashboard {
  padding: 1.5rem 0 3rem;
}

.admin-dashboard__title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 1.25rem;
  color: var(--ink);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-card--accent {
  border-color: var(--teal);
  background: #e6f4f1;
}

.kpi-card--coral {
  border-color: var(--coral);
  background: var(--sold-soft);
}

.stat-number {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.35rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.kpi-card--accent .stat-number {
  color: var(--teal-dark);
}

.kpi-card--coral .stat-number {
  color: var(--coral-dark);
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Admin filters */
.admin-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.admin-filter {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 140px;
  flex: 1 1 auto;
}

.admin-filter label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.admin-filter input,
.admin-filter select {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--card);
}

.admin-filter input:focus,
.admin-filter select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: var(--focus-ring);
}

/* Admin tables */
.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.admin-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table th {
  position: sticky;
  top: 0;
  background: var(--warm-white);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
  z-index: 1;
}

.admin-table tbody tr:nth-child(even) {
  background: rgba(251, 248, 243, 0.6);
}

.admin-table tbody tr:hover {
  background: var(--warm-white);
}

.admin-table .numeric {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.admin-table .sort-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: inherit;
  text-decoration: none;
}

.admin-table .sort-link:hover {
  text-decoration: underline;
}

.admin-table .thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--warm-white);
  border: 1px solid var(--border);
}

.admin-table .title-cell {
  font-weight: 600;
  color: var(--ink);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-table .title-cell a {
  color: inherit;
}

.admin-table .title-cell a:hover {
  color: var(--teal);
}

.admin-section {
  margin-bottom: 2rem;
}

.admin-section__title {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--ink);
}

.delta-positive {
  color: var(--success);
}

.delta-negative {
  color: var(--danger);
}

.delta-zero {
  color: var(--muted);
}

/* Responsive Find a home / admin */
@media (min-width: 1024px) {
  .find-a-home__grid {
    grid-template-columns: 300px 1fr;
    align-items: start;
  }

  .filter-rail {
    order: 1;
    position: sticky;
    top: 80px;
    align-self: start;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
  }

  .find-a-home__results {
    order: 2;
  }

  .kpi-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (min-width: 1280px) {
  .find-a-home__grid {
    grid-template-columns: 340px 1fr;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Find a home — top search panel layout
   ========================================================================== */

.find-a-home > * + * {
  margin-top: 1.5rem;
}

.re-search-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* Summary bar (visible only when collapsed) */
.re-search-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  background: var(--card);
}

.re-search-summary[hidden] {
  display: none;
}

.re-search-summary__content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  flex: 1;
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.4;
}

.re-search-summary__sep {
  color: var(--muted);
}

.re-search-summary__edit {
  flex-shrink: 0;
}

/* Expandable body */
.re-search-body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows .3s ease, opacity .25s ease;
}

.re-search-panel.is-collapsed .re-search-body {
  grid-template-rows: 0fr;
  opacity: 0;
}

.re-search-body__inner {
  min-height: 0;
  overflow: hidden;
}

.re-search-fields {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.25rem;
}

.re-search-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.re-search-row .filter-group {
  margin-bottom: 0;
}

.re-search-col-full {
  grid-column: 1 / -1;
}

.re-search-row--bottom {
  align-items: center;
}

.re-search-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.re-search-actions .btn {
  flex: 1 1 auto;
}

@media (min-width: 640px) {
  .re-search-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .re-search-row--bottom {
    grid-template-columns: repeat(2, 1fr) auto;
  }
}

@media (min-width: 1024px) {
  .re-search-row {
    grid-template-columns: repeat(4, 1fr);
  }

  .re-search-row--bottom {
    grid-template-columns: repeat(2, 1fr) auto;
  }

  .re-search-actions {
    margin-left: auto;
  }

  .re-search-actions .btn {
    flex: 0 0 auto;
  }
}

/* ==========================================================================
   Admin dashboard header
   ========================================================================== */

.admin-dashboard__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   Listing detail — hero-first layout
   ========================================================================== */

.listing-hero {
  width: 100%;
  margin-bottom: 1.5rem;
}

.listing-hero-main {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--warm-white);
}

.listing-hero-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.listing-hero-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.listing-hero-thumbs .thumb {
  flex: 0 0 80px;
  height: 80px;
}

.listing-detail-stack {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}

/* ==========================================================================
   Mortgage & affordability
   ========================================================================== */

.mortgage-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.mortgage-section__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.mortgage-section__titles h2 {
  margin-bottom: 0.35rem;
}

.mortgage-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--teal);
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

.mortgage-reset:hover {
  background: var(--card);
  border-color: var(--teal);
}

.mortgage-reset svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* Layout: results first in source order so mobile stacks hero -> inputs.
   On desktop, inputs live in the left column and the hero summary on the right. */

.mortgage-grid {
  display: grid;
  gap: 2rem;
}

.mortgage-results {
  grid-area: results;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.mortgage-inputs {
  grid-area: inputs;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Hero result */

.mortgage-hero,
.mortgage-result-total-wrap {
  background: linear-gradient(135deg, var(--warm-white) 0%, #f6f4ef 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
}

.mortgage-hero .mortgage-result-label,
.mortgage-result-total-wrap .mortgage-result-label {
  display: block;
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.mortgage-result-total {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--teal);
  line-height: 1.1;
  margin: 0;
}

.mortgage-hero__meta {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  line-height: 1.4;
}

/* Breakdown list */

.mortgage-breakdown__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

.mortgage-result-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mortgage-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.95rem;
  padding: 0.35rem 0;
}

.mortgage-result-row dt {
  color: var(--muted);
}

.mortgage-result-row dd {
  font-weight: 700;
  margin: 0;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.mortgage-result-row.total {
  padding-top: 0.5rem;
  border-top: 2px solid var(--border);
  font-size: 1.1rem;
}

.mortgage-result-row.total dt,
.mortgage-result-row.total dd {
  color: var(--ink);
}

/* Input groups */

.mortgage-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 0;
}

.mortgage-group__title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.mortgage-group--advanced {
  padding: 0;
  overflow: hidden;
}

.mortgage-group--advanced .mortgage-group__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  padding: 1rem;
  margin: 0;
  cursor: pointer;
  list-style: none;
}

.mortgage-group--advanced .mortgage-group__summary::-webkit-details-marker {
  display: none;
}

.mortgage-group--advanced .mortgage-group__summary::before {
  content: '▸';
  color: var(--teal);
  margin-right: 0.35rem;
  transition: transform .15s ease;
}

.mortgage-group--advanced[open] .mortgage-group__summary::before {
  transform: rotate(90deg);
}

.mortgage-group--advanced .mortgage-group__body {
  padding: 0 1rem 1rem;
  display: grid;
  gap: 1rem;
}

.mortgage-group__hint {
  font-size: 0.85rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
}

.mortgage-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.mortgage-field__helper {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: -0.15rem;
  margin-bottom: 0.35rem;
}

/* Input suffixes (%, yrs, $/mo) */

.input-suffix {
  position: relative;
  display: flex;
  align-items: center;
}

.input-suffix input {
  width: 100%;
  padding-right: 2.75rem;
}

.input-suffix__unit {
  position: absolute;
  right: 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  pointer-events: none;
}

/* Downpayment preset chips */

.mortgage-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.mortgage-preset-chip {
  padding: 0.25rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--teal);
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.mortgage-preset-chip:hover {
  background: #e6f4f1;
  border-color: var(--teal);
}

.mortgage-preset-chip:active {
  background: var(--teal);
  color: #fff;
}

/* Sustainability indicator (now sits next to the income field) */

.mortgage-sustainability {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.mortgage-sustainability__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.mortgage-sustainability__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.mortgage-sustainability__ratio {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--muted);
}

.sustainability-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 700;
}

.sustainability-chip.is-comfortable {
  background: #d1fae5;
  border-color: var(--success);
  color: var(--success);
}

.sustainability-chip.is-stretched {
  background: #fffbeb;
  border-color: var(--gold);
  color: #92400e;
}

.sustainability-chip.is-risky {
  background: #fee2e2;
  border-color: var(--danger);
  color: var(--danger);
}

.sustainability-meter {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.75rem;
}

.sustainability-meter__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success) 0%, var(--gold) 50%, var(--danger) 100%);
  border-radius: 999px;
  transition: width 0.2s ease;
}

.mortgage-disclaimer {
  margin-top: 1rem;
  font-size: 0.8rem;
}

/* Admin mortgage settings */

.admin-mortgage {
  padding: 1.5rem 0 3rem;
}

.admin-mortgage__header {
  margin-bottom: 1rem;
}

.admin-mortgage__header h1 {
  margin-bottom: 0.35rem;
}

.admin-mortgage__meta {
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.admin-mortgage__grid {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

.admin-mortgage-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.admin-mortgage-preview {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.admin-mortgage-preview h2 {
  margin-bottom: 0.35rem;
}

/* Responsive mortgage */

@media (min-width: 769px) {
  .mortgage-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "inputs results";
  }

  .mortgage-result-total {
    font-size: 3rem;
  }

  .admin-mortgage__grid {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

@media (max-width: 768px) {
  .mortgage-grid {
    grid-template-columns: 1fr;
  }

  .mortgage-section {
    padding: 1.25rem;
  }

  .mortgage-result-total {
    font-size: 2.25rem;
  }

  .mortgage-field-row {
    grid-template-columns: 1fr;
  }

  .listing-hero-thumbs {
    flex-wrap: wrap;
  }
}

/* ==========================================================================
   Find a car page
   ========================================================================== */

.find-a-car {
  padding: 1.5rem 0 3rem;
}

.find-a-car__grid {
  display: grid;
  gap: 1.5rem;
}

.find-a-car > * + * {
  margin-top: 1.5rem;
}

.cf-hero {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #eff6ff 0%, var(--warm-white) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.cf-hero__title {
  color: #1d4ed8;
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  margin-bottom: 0.35rem;
}

.cf-hero__subtitle {
  color: var(--muted);
  max-width: 640px;
  margin-bottom: 0.75rem;
}

.cf-hero__stat {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e40af;
  background: #fff;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

/* Find-a-car search panel */

.cf-search-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.cf-search-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  background: var(--card);
}

.cf-search-summary[hidden] {
  display: none;
}

.cf-search-summary__content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  flex: 1;
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.4;
}

.cf-search-summary__sep {
  color: var(--muted);
}

.cf-search-summary__edit {
  flex-shrink: 0;
}

.cf-search-body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows .3s ease, opacity .25s ease;
}

.cf-search-panel.is-collapsed .cf-search-body {
  grid-template-rows: 0fr;
  opacity: 0;
}

.cf-search-body__inner {
  min-height: 0;
  overflow: hidden;
}

.cf-search-fields {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.25rem;
}

.cf-search-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.cf-search-row .filter-group {
  margin-bottom: 0;
}

.cf-search-col-full {
  grid-column: 1 / -1;
}

.cf-search-row--bottom {
  align-items: center;
}

.cf-search-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.cf-search-actions .btn {
  flex: 1 1 auto;
}

.cf-search-panel .chip-toggle input:checked + label,
.cf-search-panel .chip-toggle:has(input:checked) label {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

.cf-search-panel .chip-toggle input:focus-visible + label {
  outline-color: #1d4ed8;
}

@media (min-width: 640px) {
  .cf-search-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .cf-search-row {
    grid-template-columns: repeat(4, 1fr);
  }

  .cf-search-actions {
    margin-left: auto;
  }

  .cf-search-actions .btn {
    flex: 0 0 auto;
  }
}

/* ==========================================================================
   Auto-loan & car financing
   ========================================================================== */

.auto-loan-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.auto-loan-section__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.auto-loan-section__titles h2 {
  margin-bottom: 0.35rem;
}

.auto-loan-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1d4ed8;
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

.auto-loan-reset:hover {
  background: var(--card);
  border-color: #1d4ed8;
}

.auto-loan-reset svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.auto-loan-grid {
  display: grid;
  gap: 2rem;
}

.auto-loan-results {
  grid-area: results;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.auto-loan-inputs {
  grid-area: inputs;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.auto-loan-hero,
.auto-loan-result-total-wrap {
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
}

.auto-loan-hero .auto-loan-result-label,
.auto-loan-result-total-wrap .auto-loan-result-label {
  display: block;
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.auto-loan-result-total {
  font-size: 2.5rem;
  font-weight: 800;
  color: #1d4ed8;
  line-height: 1.1;
  margin: 0;
}

.auto-loan-hero__meta {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  line-height: 1.4;
}

.auto-loan-breakdown__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

.auto-loan-result-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.auto-loan-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.95rem;
  padding: 0.35rem 0;
}

.auto-loan-result-row dt {
  color: var(--muted);
}

.auto-loan-result-row dd {
  font-weight: 700;
  margin: 0;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.auto-loan-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 0;
}

.auto-loan-group__title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.auto-loan-group--advanced {
  padding: 0;
  overflow: hidden;
}

.auto-loan-group--advanced .auto-loan-group__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  padding: 1rem;
  margin: 0;
  cursor: pointer;
  list-style: none;
}

.auto-loan-group--advanced .auto-loan-group__summary::-webkit-details-marker {
  display: none;
}

.auto-loan-group--advanced .auto-loan-group__summary::before {
  content: '▸';
  color: #1d4ed8;
  margin-right: 0.35rem;
  transition: transform .15s ease;
}

.auto-loan-group--advanced[open] .auto-loan-group__summary::before {
  transform: rotate(90deg);
}

.auto-loan-group--advanced .auto-loan-group__body {
  padding: 0 1rem 1rem;
  display: grid;
  gap: 1rem;
}

.auto-loan-group__hint {
  font-size: 0.85rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
}

.auto-loan-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.auto-loan-field__helper {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: -0.15rem;
  margin-bottom: 0.35rem;
}

.auto-loan-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.auto-loan-preset-chip {
  padding: 0.25rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1d4ed8;
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.auto-loan-preset-chip:hover {
  background: #dbeafe;
  border-color: #1d4ed8;
}

.auto-loan-preset-chip:active {
  background: #1d4ed8;
  color: #fff;
}

.auto-loan-sustainability {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.auto-loan-sustainability__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.auto-loan-sustainability__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.auto-loan-sustainability__ratio {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--muted);
}

.auto-loan-sustainability .sustainability-chip.is-comfortable {
  background: #d1fae5;
  border-color: var(--success);
  color: var(--success);
}

.auto-loan-sustainability .sustainability-chip.is-stretched {
  background: #fffbeb;
  border-color: var(--gold);
  color: #92400e;
}

.auto-loan-sustainability .sustainability-chip.is-risky {
  background: #fee2e2;
  border-color: var(--danger);
  color: var(--danger);
}

/* Admin financing settings */

.admin-financing {
  padding: 1.5rem 0 3rem;
}

.admin-financing__header {
  margin-bottom: 1rem;
}

.admin-financing__header h1 {
  margin-bottom: 0.35rem;
}

.admin-financing__meta {
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.admin-financing__grid {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

.admin-financing-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.admin-financing-preview {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.admin-financing-preview h2 {
  margin-bottom: 0.35rem;
}

/* Responsive auto-loan */

@media (min-width: 769px) {
  .auto-loan-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "inputs results";
  }

  .auto-loan-result-total {
    font-size: 3rem;
  }

  .admin-financing__grid {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

@media (max-width: 768px) {
  .auto-loan-grid {
    grid-template-columns: 1fr;
  }

  .auto-loan-section {
    padding: 1.25rem;
  }

  .auto-loan-result-total {
    font-size: 2.25rem;
  }

  .auto-loan-field-row {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Mobile polish (max-width: 768px)
   Keeps the desktop experience unchanged; overrides only for phones and
   large phones/phablets up to 768px.
   ========================================================================== */

@media (max-width: 768px) {
  /* Container: comfortable side gutters and a centered max-width so content
     never feels stretched on larger phones. */
  .container {
    max-width: 640px;
    padding: 0 1.25rem;
  }

  .container.narrow {
    max-width: 600px;
  }

  /* Header */
  .site-header .header-inner {
    min-height: 56px;
    gap: 0.75rem;
  }

  .site-header .logo-img {
    height: 28px;
  }

  .main-nav {
    inset: 56px 0 auto 0;
  }

  .nav-list a {
    padding: 0.75rem 0;
  }

  .header-tools {
    gap: 0.75rem;
  }

  /* Flash messages */
  .flash-container {
    top: 64px;
    right: 1rem;
    left: 1rem;
  }

  /* Hero */
  .hero {
    padding: 2rem 0;
  }

  .hero-search {
    padding: 1rem;
    gap: 0.75rem;
  }

  /* Sections */
  .features {
    padding: 2rem 0;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .feature-card {
    padding: 1.25rem;
  }

  .categories-section,
  .recent-listings {
    padding: 1.5rem 0;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  .section-header h2 {
    font-size: 1.25rem;
  }

  /* Category tiles */
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.875rem;
  }

  .category-tile {
    padding: 1rem 0.5rem;
  }

  .category-icon {
    font-size: 1.5rem;
  }

  .category-name {
    font-size: 0.85rem;
  }

  /* Listing cards */
  .listing-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .listing-card {
    border-radius: var(--radius-md);
  }

  .card-body {
    padding: 0.875rem;
  }

  .card-title {
    font-size: 0.95rem;
  }

  .card-price {
    font-size: 1rem;
  }

  .favorite-btn {
    width: 44px;
    height: 44px;
  }

  /* Listing detail */
  .listing-detail {
    padding-bottom: 2rem;
  }

  .breadcrumbs {
    padding: 0.75rem 0;
    font-size: 0.8rem;
  }

  .listing-hero-main {
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-md);
  }

  .listing-hero-thumbs .thumb {
    flex: 0 0 64px;
    height: 64px;
  }

  .listing-header h1 {
    font-size: 1.5rem;
  }

  .listing-price {
    font-size: 1.5rem;
  }

  .attributes-grid {
    grid-template-columns: 1fr;
  }

  .attributes-card,
  .description-card,
  .seller-card {
    padding: 1rem;
    margin-top: 0.875rem;
  }

  .seller-avatar {
    width: 44px;
    height: 44px;
  }

  .action-buttons {
    flex-direction: column;
    gap: 0.75rem;
  }

  .action-buttons .btn {
    width: 100%;
  }

  /* Browse */
  .browse-layout {
    padding: 1rem 0 2rem;
    gap: 1.25rem;
  }

  .filters {
    padding: 1rem;
    gap: 1rem;
  }

  .results-header {
    margin-bottom: 1rem;
  }

  .results-header h1 {
    font-size: 1.25rem;
  }

  .pagination {
    margin-top: 1.25rem;
  }

  .page-link {
    min-width: 44px;
    height: 44px;
  }

  /* Auth */
  .auth-page {
    padding: 1.5rem 1rem;
    min-height: auto;
  }

  .auth-card {
    padding: 1.5rem;
    border-radius: var(--radius-md);
  }

  .auth-header h1 {
    font-size: 1.35rem;
  }

  /* Forms */
  .form {
    gap: 1rem;
  }

  .field input,
  .field select,
  .field textarea {
    padding: 0.75rem 0.85rem;
  }

  .row-2 {
    flex-direction: column;
    gap: 1rem;
  }

  .price-inputs {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .price-inputs span {
    display: none;
  }

  .form-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .form-actions .btn {
    width: 100%;
  }

  /* Dashboard */
  .dashboard {
    padding: 1rem 0 2rem;
  }

  .dashboard-header {
    gap: 0.75rem;
  }

  .dashboard-header .btn {
    width: 100%;
  }

  .tabs {
    margin-bottom: 1rem;
  }

  .tab {
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
  }

  .thread-item a {
    padding: 0.875rem 1rem;
  }

  .subscription-status-card {
    padding: 1rem;
  }

  .tier-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .tier-card {
    padding: 1rem;
  }

  .tier-price {
    font-size: 1.5rem;
  }

  /* Tables */
  .table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--card);
    box-shadow: inset -16px 0 16px -16px rgba(31, 41, 55, 0.12);
  }

  .table-wrap .data-table {
    min-width: 640px;
    border: 0;
    border-radius: 0;
  }

  .data-table th,
  .data-table td {
    padding: 0.75rem 1rem;
    white-space: nowrap;
  }

  /* Find-a-car / Find-a-home */
  .find-a-car,
  .find-a-home {
    padding: 1rem 0 2rem;
  }

  .cf-hero,
  .re-hero {
    padding: 1.25rem;
  }

  .cf-search-fields,
  .re-search-fields {
    padding: 1rem;
    gap: 1rem;
  }

  .cf-search-summary,
  .re-search-summary {
    padding: 0.75rem 1rem;
  }

  .chip-group {
    gap: 0.35rem;
  }

  .chip-toggle label {
    padding: 0.4rem 0.65rem;
    font-size: 0.8rem;
  }

  .quick-chip {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
  }

  .segmented label {
    padding: 0.5rem 0.4rem;
    font-size: 0.85rem;
  }

  .segment-hero {
    padding: 1.5rem 0 1.25rem;
  }

  .segment-search {
    padding: 1rem;
  }

  .segment-search__actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .segment-search__actions .btn {
    width: 100%;
  }

  .segment-results {
    padding: 1rem 0 2rem;
  }

  .results-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  /* Messaging thread */
  .thread-header {
    top: 56px;
    padding: 0.75rem 0;
  }

  .conversation-thread {
    padding-bottom: 140px;
  }

  .conversation-composer {
    padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom));
  }

  .listing-context-pill {
    padding: 0.5rem 0.75rem;
  }

  .pill-title {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  /* Footer */
  .site-footer {
    padding: 2rem 0 1.25rem;
  }

  .footer-grid {
    gap: 1.25rem;
    margin-bottom: 1.5rem;
  }

  .footer-links a {
    padding: 0.35rem 0;
    font-size: 0.9rem;
  }

  /* Buttons and touch targets */
  .btn {
    min-height: 44px;
  }

  .btn-sm {
    min-height: 44px;
    padding: 0.4rem 0.75rem;
  }

  .locale-btn {
    min-height: 44px;
  }

  /* Sell banner */
  .sell-banner {
    padding: 1.5rem 0;
  }

  .sell-banner-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.875rem;
  }

  .sell-banner .btn {
    width: 100%;
  }

  /* Modals */
  .modal-content {
    padding: 1.25rem;
  }

  /* Empty states */
  .empty-state {
    padding: 2rem 1rem;
  }

  /* Content pages */
  .content-page {
    padding: 1rem 0 2rem;
  }

  .content-page h2 {
    font-size: 1.15rem;
  }

  /* Admin */
  .admin-dashboard {
    padding: 1rem 0 2rem;
  }

  .admin-dashboard__header .btn {
    width: 100%;
  }

  .admin-filters {
    padding: 0.875rem;
    gap: 0.625rem;
  }

  .admin-filter {
    min-width: 120px;
  }

  .warning-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .warning-banner .btn {
    width: 100%;
  }

  /* Page header (dashboard new/edit, payments, subscriptions, content) */
  .page-header {
    margin-bottom: 1rem;
  }

  .page-header h1 {
    font-size: 1.5rem;
  }

  /* Mobile listing-grid alignment: keep cards visually aligned with the
     search/filter box above them on small screens. */
  .recent-listings .listing-grid {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 1rem;
  }

  .segment-results .listing-grid {
    padding: 0 1rem;
  }

  .find-a-car__results .listing-grid,
  .find-a-home__results .listing-grid,
  .browse-results .listing-grid {
    padding: 0 1rem;
  }
}

/* ==========================================================================
   Dual-handle range slider
   ========================================================================== */

.dual-range {
  position: relative;
  width: 100%;
  min-width: 180px;
  padding-top: 1.5rem;
  margin-top: 0.25rem;
  user-select: none;
}

.dual-range__values {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.dual-range__value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  min-width: 3ch;
}

.dual-range__value--max {
  text-align: right;
}

.dual-range__track {
  position: relative;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  cursor: pointer;
}

.dual-range__fill {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--teal);
  border-radius: 999px;
}

.dual-range__thumb {
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  padding: 0;
  margin: 0;
  background: var(--card);
  border: 2px solid var(--teal);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(31, 41, 55, 0.15);
  cursor: grab;
  transform: translate(-50%, -50%);
  touch-action: none;
  transition: left 0.12s ease, transform 0.12s ease;
}

.dual-range__thumb:active {
  cursor: grabbing;
}

.dual-range__thumb:focus-visible {
  outline: 3px solid rgba(29, 122, 140, 0.35);
  outline-offset: 2px;
}

.dual-range.is-dragging .dual-range__thumb {
  transition: none;
}

.dual-range__inputs {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .dual-range__thumb {
    transition: none;
  }
}

/* Very small phones */
@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .section-header h2 {
    font-size: 1.15rem;
  }

  .category-grid {
    gap: 0.75rem;
  }

  .listing-grid {
    gap: 0.875rem;
  }

  .card-body {
    padding: 0.75rem;
  }

  .btn-lg {
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
  }

  .modal-content {
    padding: 1rem;
  }

  .filters {
    padding: 0.875rem;
  }

  .cf-search-fields,
  .re-search-fields {
    padding: 0.875rem;
  }

  .find-a-car,
  .find-a-home {
    padding: 0.75rem 0 1.5rem;
  }

  .find-a-car__results .listing-grid,
  .find-a-home__results .listing-grid,
  .browse-results .listing-grid {
    padding: 0 0.875rem;
  }

  .auth-card {
    padding: 1.25rem;
  }
}

/* ==========================================================================
   Home — comparison landing
   ========================================================================== */

.home-hero {
  padding: 3.5rem 0;
  background: linear-gradient(135deg, var(--warm-white) 0%, var(--teal-soft) 60%, var(--cream) 100%);
}

.home-hero__title {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.home-hero__subtitle {
  max-width: 640px;
}

/* What are you shopping for */
.split-section {
  padding: 2.5rem 0;
}

.split-section__title {
  margin-bottom: 1.25rem;
}

.split-grid {
  display: grid;
  gap: 1.25rem;
}

.split-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast), box-shadow var(--transition-base);
}

.split-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.split-card--cars {
  border-top: 4px solid #1d4ed8;
}

.split-card--homes {
  border-top: 4px solid var(--teal);
}

.split-card__header {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
}

.split-card__icon {
  font-size: 2rem;
  line-height: 1;
}

.split-card__title {
  font-size: 1.35rem;
  margin-bottom: 0.15rem;
}

.split-card__meta {
  font-size: 0.9rem;
  color: var(--muted);
}

.split-card__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.split-card__fields {
  display: grid;
  gap: 1rem;
}

.split-card__pills {
  margin-top: auto;
  padding-top: 0.5rem;
}

.split-card__pills-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.vertical-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.vertical-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.35rem 0.8rem;
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.vertical-pill:hover {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: var(--teal-dark);
  text-decoration: none;
}

.vertical-pill:focus-visible {
  box-shadow: var(--focus-ring);
}

/* Compare financing */
.calculators-section {
  padding: 2.5rem 0;
  background: linear-gradient(135deg, var(--warm-white) 0%, var(--cream) 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.calculators-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.calculators-header .lead {
  max-width: 560px;
  margin: 0.5rem auto 0;
}

.calculators-grid {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

.calculator-card {
  margin-top: 0;
}

.calculator-example {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

/* Trust strip */
.trust-strip {
  padding: 2.5rem 0;
}

.trust-strip__title {
  margin-bottom: 1.25rem;
  text-align: center;
}

.trust-grid {
  display: grid;
  gap: 1rem;
}

.trust-item {
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
}

.trust-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.trust-item h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.trust-item p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Browse by country */
.country-section {
  padding: 2.5rem 0;
}

.country-section__title {
  margin-bottom: 1.25rem;
}

.country-grid {
  display: grid;
  gap: 1rem;
}

.country-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-base), border-color var(--transition-fast);
  color: var(--ink);
}

.country-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--teal);
  text-decoration: none;
}

.country-card:focus-visible {
  box-shadow: var(--shadow-md), var(--focus-ring);
}

.country-card__flag {
  font-size: 2rem;
  line-height: 1;
}

.country-card__name {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 0.35rem;
}

.country-card__count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--teal);
}

.country-card__note {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Responsive home */
@media (min-width: 640px) {
  .split-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .split-card__fields {
    grid-template-columns: repeat(2, 1fr);
  }

  .trust-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .country-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .calculators-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .trust-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .split-section,
  .calculators-section,
  .trust-strip,
  .country-section {
    padding: 3rem 0;
  }
}

/* ==========================================================================
   Responsive home — mobile refinement (≤768px / ≤640px)
   Keeps the desktop experience unchanged; only adjusts the home page on phones
   and large phones. Added at the end so it overrides earlier home rules.
   ========================================================================== */

@media (max-width: 768px) {
  /* Hero */
  .home-hero {
    padding: 2.5rem 0;
  }

  .home-hero__title {
    font-size: clamp(1.75rem, 5vw, 2.25rem);
  }

  .home-hero__subtitle {
    margin-bottom: 1.125rem;
    font-size: clamp(0.95rem, 2.2vw, 1.05rem);
  }

  .home-hero .hero-search {
    padding: 1rem;
    gap: 0.625rem;
    /* Keep the hero search stacked up through tablets — the row layout
       only works once there's room for a wide country select + search
       input + button without crushing the input. Below 769px the country
       select can balloon to 400+px and squeeze the input. */
    flex-direction: column;
  }

  .hero-search .search-input,
  .hero-search .search-select {
    min-height: 44px;
    padding: 0.75rem 0.875rem;
    width: 100%;
  }

  /* Preset chips: enforce the 4-up grid and 44px min-height at this
     breakpoint too, otherwise the chips fall back to ~30px tall and
     become hard to tap between 641–768px. */
  .mortgage-presets,
  .auto-loan-presets {
    display: grid;
    grid-template-columns: repeat(4, minmax(44px, 1fr));
    gap: 0.4rem;
  }

  .mortgage-preset-chip,
  .auto-loan-preset-chip {
    width: 100%;
    min-height: 44px;
    padding: 0.45rem 0.25rem;
  }

  /* Section rhythm */
  .split-section,
  .calculators-section,
  .trust-strip,
  .country-section,
  .recent-listings,
  .sell-banner {
    padding: 2rem 0;
  }

  .split-section__title,
  .trust-strip__title,
  .country-section__title {
    margin-bottom: 1rem;
  }

  .calculators-header {
    margin-bottom: 1rem;
  }

  .calculators-header .lead {
    font-size: clamp(0.9rem, 2vw, 1rem);
  }

  /* Split cards */
  .split-grid {
    gap: 1rem;
  }

  .split-card {
    gap: 1rem;
    padding: 1.25rem;
  }

  .split-card__fields {
    grid-template-columns: 1fr;
    gap: 0.875rem;
  }

  .split-card__fields .field input,
  .split-card__fields .field select {
    min-height: 44px;
  }

  .vertical-pill {
    min-height: 44px;
    padding: 0.45rem 0.9rem;
  }

  /* Calculators */
  .calculators-grid {
    gap: 1.25rem;
  }

  .mortgage-section,
  .auto-loan-section {
    padding: 1.25rem;
    margin-top: 0;
  }

  .mortgage-section__header,
  .auto-loan-section__header {
    margin-bottom: 1rem;
    gap: 0.75rem;
  }

  .mortgage-reset,
  .auto-loan-reset {
    min-height: 44px;
  }

  .mortgage-section__titles h2,
  .auto-loan-section__titles h2 {
    font-size: clamp(1.25rem, 4vw, 1.5rem);
  }

  .mortgage-result-total,
  .auto-loan-result-total {
    font-size: 2.25rem;
  }

  .mortgage-result-row,
  .auto-loan-result-row {
    gap: 0.75rem;
    font-size: 0.9rem;
  }

  .mortgage-group,
  .auto-loan-group {
    padding: 1rem;
  }

  .mortgage-group--advanced .mortgage-group__summary,
  .auto-loan-group--advanced .auto-loan-group__summary {
    min-height: 44px;
    padding: 0.875rem 1rem;
  }

  /* Trust & country */
  .trust-grid,
  .country-grid {
    gap: 0.875rem;
  }

  .trust-grid {
    grid-template-columns: 1fr;
  }

  .trust-item {
    padding: 1rem;
    gap: 0.75rem;
  }

  .country-card {
    padding: 1.125rem;
  }

  /* Sell banner */
  .sell-banner-inner {
    gap: 0.75rem;
  }

  .sell-banner h2 {
    font-size: clamp(1.25rem, 4vw, 1.5rem);
  }
}

@media (max-width: 640px) {
  /* Hero */
  .home-hero {
    padding: 1.75rem 0;
  }

  .home-hero__title {
    font-size: clamp(1.6rem, 6.5vw, 2rem);
  }

  .home-hero__subtitle {
    margin-bottom: 1rem;
  }

  .home-hero .hero-search {
    padding: 0.875rem;
    gap: 0.5rem;
  }

  /* Section rhythm */
  .split-section,
  .calculators-section,
  .trust-strip,
  .country-section,
  .recent-listings,
  .sell-banner {
    padding: 1.75rem 0;
  }

  .split-section__title,
  .trust-strip__title,
  .country-section__title {
    font-size: clamp(1.2rem, 4vw, 1.5rem);
  }

  /* Split cards */
  .split-card {
    padding: 1rem;
    gap: 0.875rem;
  }

  .split-card__icon {
    font-size: 1.75rem;
  }

  .split-card__title {
    font-size: 1.2rem;
  }

  .split-card__meta {
    font-size: 0.85rem;
  }

  /* Calculators */
  .mortgage-section,
  .auto-loan-section {
    padding: 1rem;
  }

  .mortgage-section__titles h2,
  .auto-loan-section__titles h2 {
    font-size: clamp(1.15rem, 4.5vw, 1.4rem);
  }

  .mortgage-result-total,
  .auto-loan-result-total {
    font-size: clamp(1.65rem, 7vw, 2rem);
  }

  .mortgage-hero,
  .auto-loan-hero,
  .mortgage-result-total-wrap,
  .auto-loan-result-total-wrap {
    padding: 1.25rem;
  }

  .mortgage-breakdown__title,
  .auto-loan-breakdown__title {
    font-size: 0.95rem;
  }

  .mortgage-result-row,
  .auto-loan-result-row {
    font-size: 0.875rem;
  }

  .mortgage-field-row,
  .auto-loan-field-row {
    gap: 0.75rem;
  }

  .mortgage-group,
  .auto-loan-group {
    padding: 0.875rem;
  }

  .mortgage-group--advanced .mortgage-group__summary,
  .auto-loan-group--advanced .auto-loan-group__summary {
    padding: 0.75rem 0.875rem;
  }

  .mortgage-group--advanced .mortgage-group__body,
  .auto-loan-group--advanced .auto-loan-group__body {
    padding: 0 0.875rem 0.875rem;
  }

  /* Preset chips — fixed 4-up grid already set in the ≤768px block;
     only the per-chip font-size needs tuning at this width. */
  .mortgage-preset-chip,
  .auto-loan-preset-chip {
    font-size: 0.85rem;
  }

  /* Suffix inputs — keep unit from clipping */
  .mortgage-inputs .input-suffix input,
  .auto-loan-inputs .input-suffix input {
    padding-right: 2.5rem;
  }

  .mortgage-inputs .input-suffix__unit,
  .auto-loan-inputs .input-suffix__unit {
    right: 0.65rem;
    font-size: 0.85rem;
  }

  /* Sustainability meter + chip */
  .mortgage-sustainability,
  .auto-loan-sustainability {
    margin-top: 0.625rem;
    padding-top: 0.625rem;
  }

  .mortgage-sustainability__header,
  .auto-loan-sustainability__header {
    gap: 0.5rem;
    margin-bottom: 0.625rem;
  }

  .sustainability-chip {
    min-height: 44px;
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
  }

  /* Country cards */
  .country-card {
    padding: 1rem;
    gap: 0.25rem;
  }

  .country-card__flag {
    font-size: 1.75rem;
  }

  .country-card__name {
    font-size: 1.05rem;
  }

  .country-card__count,
  .country-card__note {
    font-size: 0.85rem;
  }

  /* Recent listings */
  .recent-listings .listing-grid {
    padding: 0;
    max-width: none;
  }

  /* Sell banner */
  .sell-banner {
    padding: 1.25rem 0;
  }
}

@media (max-width: 480px) {
  .home-hero {
    padding: 1.5rem 0;
  }

  .split-section,
  .calculators-section,
  .trust-strip,
  .country-section,
  .recent-listings,
  .sell-banner {
    padding: 1.5rem 0;
  }
}
