@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap");

/* ============================================================
   iCarValue — design tokens
   ============================================================ */
:root {
  --font-display: "Manrope", "Segoe UI", sans-serif;
  --font-body: "DM Sans", "Segoe UI", sans-serif;

  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --surface-muted: #f1f3f5;
  --line: #e5e7eb;
  --line-strong: #d1d5db;

  --text: #16181d;
  --text-soft: #374151;
  --muted: #6b7280;

  --primary: #e1232a;
  --primary-strong: #bf1c22;
  --primary-soft: rgba(225, 35, 42, 0.10);

  --secondary: #16181d;
  --success: #15a05f;
  --danger: #dc2626;
  --warning: #f59e0b;

  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-md: 0 6px 18px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 24px 48px rgba(16, 24, 40, 0.14);

  /* --- Navbar (light / frosted-neumorphism) --- */
  --nav-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(245, 245, 245, 0.82));
  --nav-text: #222222;
  --nav-text-dim: #5b5f66;
  --nav-border: rgba(15, 17, 21, 0.08);
  --nav-tray: rgba(255, 255, 255, 0.55);
  --nav-hover: rgba(15, 17, 21, 0.05);
  --nav-edge: rgba(225, 35, 42, 0.55);
  --nav-edge-soft: rgba(225, 35, 42, 0.20);
  --nav-shadow:
    0 18px 38px -20px rgba(20, 22, 30, 0.40),
    0 6px 16px -10px rgba(20, 22, 30, 0.20),
    0 3px 18px -6px var(--nav-edge-soft);
  --nav-inset: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -1px 0 rgba(15, 17, 21, 0.04);
  --nav-logo-filter: none;
  --nav-carbon: 0;
  --nav-glass-blur: 18px;
  --nav-badge-ring: #ffffff;
}

body.dark {
  --bg: #0f1115;
  --surface: #181b22;
  --surface-2: #1d212a;
  --surface-muted: #20242e;
  --line: #2a2f3a;
  --line-strong: #3a414f;
  --text: #f3f5f8;
  --text-soft: #d3d8e0;
  --muted: #9aa3b2;
  --primary: #f04148;
  --primary-strong: #ff5c62;
  --primary-soft: rgba(240, 65, 72, 0.16);
  --secondary: #f3f5f8;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 22px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 26px 55px rgba(0, 0, 0, 0.55);

  /* --- Navbar (dark / carbon-glass + neon edge) --- */
  --nav-surface: linear-gradient(180deg, rgba(17, 17, 17, 0.82), rgba(5, 5, 5, 0.86));
  --nav-text: #ffffff;
  --nav-text-dim: rgba(255, 255, 255, 0.60);
  --nav-border: rgba(255, 255, 255, 0.09);
  --nav-tray: rgba(255, 255, 255, 0.045);
  --nav-hover: rgba(255, 255, 255, 0.07);
  --nav-edge: rgba(240, 65, 72, 0.90);
  --nav-edge-soft: rgba(240, 65, 72, 0.42);
  --nav-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 26px 60px -22px rgba(0, 0, 0, 0.95),
    0 8px 30px -8px var(--nav-edge-soft);
  --nav-inset: inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 -1px 0 rgba(0, 0, 0, 0.6);
  --nav-logo-filter: brightness(0) invert(1);
  --nav-carbon: 1;
  --nav-glass-blur: 22px;
  --nav-badge-ring: #0a0a0a;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  transition: background-color 450ms ease, color 450ms ease;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button,
a {
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin-top: 0;
}

p {
  margin-top: 0;
}

/* ============================================================
   Header — premium floating "F1 dashboard" pod
   ============================================================ */
.topbar {
  position: sticky;
  top: 14px;
  z-index: 50;
  width: min(100% - 30px, 1340px);
  margin: 14px auto 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 12px 9px 11px;
  border-radius: 30px;
  background: var(--nav-surface);
  -webkit-backdrop-filter: blur(var(--nav-glass-blur)) saturate(150%);
  backdrop-filter: blur(var(--nav-glass-blur)) saturate(150%);
  border: 1px solid var(--nav-border);
  box-shadow: var(--nav-shadow);
  isolation: isolate;
  transition: transform 380ms cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 500ms ease, background 500ms ease, border-color 500ms ease;
}

/* Neon-red gradient edge ring (thin in light, luminous in dark) */
.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(115deg,
    var(--nav-edge) 0%,
    transparent 26%,
    transparent 74%,
    var(--nav-edge) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
  opacity: 0.85;
  transition: opacity 500ms ease;
}

/* Carbon-fiber weave + glass reflection (carbon fades out in light mode) */
.topbar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0) 38%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.28) 0 1px, transparent 1px 4px);
  background-size: auto, 5px 5px, 5px 5px;
  opacity: calc(0.45 + var(--nav-carbon) * 0.55);
  pointer-events: none;
  z-index: -1;
}

body:not(.dark) .topbar::after {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 42%);
}

.topbar:hover {
  transform: translateY(-3px);
}

.topbar:hover::before {
  opacity: 1;
}

.topbar > * {
  position: relative;
  z-index: 1;
}

/* Brand logo (image lockup) */
.brand {
  display: inline-flex;
  align-items: center;
  padding: 2px 0;
  line-height: 0;
}

.brand-logo {
  display: block;
  height: 40px;
  width: auto;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Illuminated curved container around the logo */
.topbar .brand {
  position: relative;
  padding: 7px 20px;
  border-radius: 20px;
  background: var(--nav-tray);
  border: 1px solid var(--nav-border);
  box-shadow: var(--nav-inset);
  overflow: hidden;
  flex-shrink: 0;
}

.topbar .brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 140% at 8% 50%, var(--nav-edge-soft), transparent 62%);
  opacity: 0.9;
  pointer-events: none;
}

.topbar .brand::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--nav-edge), transparent);
  filter: blur(0.4px);
  opacity: 0.7;
}

.topbar .brand-logo {
  position: relative;
  height: 34px;
  filter: var(--nav-logo-filter);
  transition: filter 450ms ease;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
  margin: 0 auto;
}

.nav-links a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 7px 12px 6px;
  color: var(--nav-text-dim);
  font-weight: 600;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 13px;
  white-space: nowrap;
}

.nav-links a .nav-ico {
  display: inline-flex;
}

.nav-links a .nav-ico svg {
  width: 21px;
  height: 21px;
  stroke-width: 1.9;
  transition: transform 200ms ease, filter 200ms ease;
}

.nav-links a:hover {
  color: var(--nav-text);
  background: var(--nav-hover);
}

.nav-links a:hover .nav-ico svg {
  transform: translateY(-2px);
  filter: drop-shadow(0 0 7px var(--nav-edge));
}

.nav-links a.active {
  color: var(--primary);
}

.nav-links a.active .nav-ico svg {
  filter: drop-shadow(0 0 9px var(--nav-edge));
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: -1px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  box-shadow: 0 0 12px 1px var(--nav-edge), 0 0 5px var(--primary);
}

/* Grouped glass control tray on the right */
.topbar-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  padding: 5px;
  border-radius: 18px;
  background: var(--nav-tray);
  border: 1px solid var(--nav-border);
  box-shadow: var(--nav-inset);
  flex-shrink: 0;
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--nav-text);
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--nav-hover);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 0 14px -2px var(--nav-edge-soft);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

/* Hamburger trigger for the mobile nav drawer; hidden on desktop where
   .nav-links renders inline (shown at max-width: 880px, see Responsive). */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--nav-text);
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle:hover {
  background: var(--nav-hover);
  color: var(--primary);
}

.nav-toggle svg {
  width: 22px;
  height: 22px;
}

#themeToggle svg {
  transition: transform 500ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

body.dark #themeToggle svg {
  transform: rotate(-150deg);
}

.icon-badge {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--nav-badge-ring);
}

/* Auth zone is visually separated from the icon cluster by a divider */
.topbar-actions #authActionLink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px 0 16px;
  margin-left: 5px;
  border-radius: 12px;
  border: 1px solid var(--nav-edge-soft);
  background: transparent;
  color: var(--nav-text);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  position: relative;
}

.topbar-actions #authActionLink::before {
  content: "";
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background: var(--primary);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E") center / contain no-repeat;
}

.topbar-actions #authActionLink:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 8px 20px -6px var(--nav-edge), 0 0 0 1px var(--primary);
  transform: translateY(-1px);
}

.topbar-actions #authActionLink:hover::before {
  background: #fff;
}


/* Auth-injected signup link rendered as the solid red CTA */
.topbar-actions a[data-auth-injected] {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 18px;
  margin-left: 3px;
  border-radius: 12px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow: 0 8px 20px -8px var(--nav-edge);
}

.topbar-actions a[data-auth-injected]:hover {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
  transform: translateY(-1px);
}

/* Account menu: opened from #authActionLink once signed in, holds the
   secondary/profile links (settings, legal, logout) kept out of the main nav. */
.account-menu-trigger {
  cursor: pointer;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 5px;
  display: flex;
  flex-direction: column;
  min-width: 190px;
  padding: 6px;
  border-radius: 14px;
  background: var(--nav-surface);
  border: 1px solid var(--nav-border);
  box-shadow: var(--nav-shadow);
  -webkit-backdrop-filter: blur(var(--nav-glass-blur)) saturate(150%);
  backdrop-filter: blur(var(--nav-glass-blur)) saturate(150%);
  z-index: 60;
}

.account-menu-panel a,
.account-menu-panel button {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--nav-text);
  font-size: 0.86rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.account-menu-panel a:hover,
.account-menu-panel button:hover {
  background: var(--nav-hover);
  color: var(--primary);
}

.account-menu-panel button#accountMenuLogout {
  color: var(--primary);
}

/* ============================================================
   Buttons
   ============================================================ */
.primary-btn,
.ghost-btn,
.danger-btn,
.whatsapp-btn,
.inline-search-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  white-space: nowrap;
}

.primary-btn {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 10px 22px rgba(225, 35, 42, 0.22);
}

.primary-btn:hover {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
  transform: translateY(-1px);
}

.ghost-btn,
.inline-search-link {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--text);
}

.ghost-btn:hover,
.inline-search-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.danger-btn {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.danger-btn:hover {
  filter: brightness(0.94);
}

.whatsapp-btn {
  background: #1faf60;
  border-color: #1faf60;
  color: #fff;
}

.whatsapp-btn:hover {
  filter: brightness(0.95);
}

.btn-icon {
  width: 18px;
  height: 18px;
}

.primary-btn:disabled,
.ghost-btn:disabled,
.danger-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-spinner {
  width: 14px;
  height: 14px;
  flex: none;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  animation: icv-spin 0.7s linear infinite;
}

.ghost-btn .btn-spinner {
  border-color: rgba(14, 18, 24, 0.18);
  border-top-color: var(--primary);
}

@keyframes icv-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================
   Verification banner + status helpers
   ============================================================ */
.verify-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 20px;
  background: rgba(245, 158, 11, 0.14);
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
  color: #92400e;
  font-size: 0.88rem;
  text-align: center;
}

.verify-banner strong {
  font-weight: 700;
}

.verify-banner .link-btn {
  font-weight: 700;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  font-size: inherit;
  font-family: inherit;
  padding: 0;
}

.verify-banner .link-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  text-decoration: none;
}

.form-message.success {
  color: var(--success);
}

.form-message.error {
  color: var(--danger);
}

.verify-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 6px 0 16px;
}

.verify-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  background: var(--danger);
  flex: none;
  /* The dot flips the instant a verification is confirmed, with no page
     refresh; easing the colour change makes that read as a deliberate state
     change rather than a flicker. */
  transition: background-color 180ms ease-in-out;
}

.verify-dot.ok {
  background: var(--success);
}

.is-hidden {
  display: none !important;
}

.verify-gate {
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  margin-bottom: 16px;
}

.verify-gate p {
  margin: 0 0 10px;
  color: #92400e;
}

/* ============================================================
   Layout shell
   ============================================================ */
.page-wrap {
  width: min(1200px, calc(100% - 40px));
  margin: 48px auto 72px;
  display: grid;
  gap: 32px;
}

.home-shell {
  gap: 56px;
}

.panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: 28px;
}

.panel-lifted {
  box-shadow: var(--shadow-md);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.section-head h1,
.section-head h2 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
}

.inline-link {
  color: var(--primary);
  font-weight: 700;
}

.muted-text {
  color: var(--muted);
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 560px;
  overflow: hidden;
  background: #0b0c0e;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("uploads/live-2.jpg");
  background-size: cover;
  background-position: center right;
  transform: scale(1.04);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 9, 11, 0.92) 0%, rgba(8, 9, 11, 0.72) 42%, rgba(8, 9, 11, 0.32) 72%, rgba(8, 9, 11, 0.18) 100%),
    linear-gradient(180deg, rgba(8, 9, 11, 0.2), rgba(8, 9, 11, 0.55));
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 84px max(20px, calc((100% - 1200px) / 2)) 128px;
  color: #fff;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  font-size: 0.86rem;
  font-weight: 600;
  color: #fff;
}

.hero-badge::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(225, 35, 42, 0.3);
}

.hero h1 {
  max-width: 16ch;
  margin: 22px 0 0;
  color: #fff;
  font-size: clamp(2.5rem, 5.4vw, 4.4rem);
  font-weight: 800;
  line-height: 1.03;
  letter-spacing: -0.035em;
}

.hero h1 .accent {
  color: var(--primary);
}

.hero-lead {
  max-width: 50ch;
  margin: 22px 0 0;
  font-size: 1.1rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.82);
}

.hero-features {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 34px;
}

.hero-feature {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
}

.hero-feature span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
}

.hero-feature svg {
  width: 20px;
  height: 20px;
  color: #fff;
}

/* ============================================================
   Search bar (overlapping hero)
   ============================================================ */
.search-bar-wrap {
  position: relative;
  z-index: 10;
  width: min(1200px, calc(100% - 40px));
  margin: -68px auto 0;
}

.marketplace-search {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr auto;
  gap: 18px;
  align-items: end;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.search-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.search-field > span {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-soft);
}

.search-field input,
.search-field select {
  min-height: 50px;
}

.search-submit {
  min-height: 50px;
  padding: 0 26px;
  align-self: end;
}

/* ============================================================
   Forms
   ============================================================ */
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  padding: 13px 14px;
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: #9ca3af;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

textarea {
  min-height: 130px;
  resize: vertical;
}

label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
}

.filters-grid,
.form-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.full-width {
  grid-column: 1 / -1;
}

.inline-actions,
.filter-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.image-uploader {
  display: grid;
  gap: 12px;
}

.image-dropzone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 150px;
  padding: 22px;
  border: 2px dashed rgba(225, 35, 42, 0.35);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  color: var(--text-soft);
  text-align: center;
  cursor: pointer;
}

.image-dropzone.is-dragging {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.image-dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.image-dropzone strong {
  font-size: 1rem;
  color: var(--text);
}

.image-dropzone span,
.form-message {
  color: var(--muted);
  font-size: 0.88rem;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
}

.image-preview {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.image-preview.is-cover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.image-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 1.25 / 1;
  object-fit: cover;
}

.cover-chip {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(14, 18, 24, 0.76);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.image-preview-actions {
  display: flex;
  gap: 6px;
  padding: 8px;
}

.mini-icon-btn {
  flex: 1;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.mini-icon-btn.danger {
  color: var(--danger);
}

.image-preview progress {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 48px;
  width: calc(100% - 16px);
}

.listing-edit-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(7, 10, 15, 0.58);
}

.listing-edit-card {
  position: relative;
  z-index: 1;
  width: min(780px, 100%);
  max-height: min(90vh, 860px);
  overflow-y: auto;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.listing-edit-card h2 {
  margin-top: 0;
}

.modal-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ============================================================
   Category section
   ============================================================ */
.category-rack.panel {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
}

.category-rack .section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
}

.category-rack .section-head h2::after {
  content: "";
  display: block;
  width: 60px;
  height: 4px;
  margin-top: 14px;
  border-radius: 2px;
  background: var(--primary);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.category-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.category-photo {
  position: relative;
  aspect-ratio: 16 / 10;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-muted);
}

.category-icon {
  position: absolute;
  left: 18px;
  bottom: -22px;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary-soft);
  border: 3px solid var(--surface);
  color: var(--primary);
}

.category-icon svg {
  width: 22px;
  height: 22px;
}

.category-info {
  padding: 30px 18px 20px;
}

.category-info strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.18rem;
  color: var(--text);
}

.category-info small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ============================================================
   Vehicle cards
   ============================================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 24px;
}

.vehicle-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.vehicle-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.vehicle-card-photo {
  position: relative;
  overflow: hidden;
  background: var(--surface-muted);
}

.vehicle-card-photo > img {
  width: 100%;
  aspect-ratio: 1.4 / 1;
  object-fit: cover;
  background: var(--surface-muted);
  display: block;
}

.photo-count-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(14, 18, 24, 0.78);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.vehicle-card-body {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.vehicle-card-body h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-soft);
}

.badge.featured {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.3);
}

.badge.verified {
  background: rgba(21, 160, 95, 0.12);
  color: var(--success);
  border-color: rgba(21, 160, 95, 0.26);
}

.badge.boosted {
  background: rgba(59, 130, 246, 0.14);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.3);
}

.price {
  margin: 0;
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
}

.meta-row {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ============================================================
   Editorial band
   ============================================================ */
.editorial-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 28px;
  align-items: center;
}

.editorial-band h2 {
  margin: 0;
  font-size: clamp(1.6rem, 2.8vw, 2.3rem);
}

.editorial-points {
  display: grid;
  gap: 14px;
}

.editorial-points article {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.editorial-points strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.02rem;
}

.editorial-points p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

/* ============================================================
   Price estimator
   ============================================================ */
.estimator-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 28px;
  align-items: center;
}

.estimator-copy h2 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 2.8vw, 2.3rem);
}

.estimator-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.estimator-form-wrap {
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.estimate-result {
  margin: 16px 0 0;
  color: var(--primary);
  font-weight: 700;
}

/* ============================================================
   CTA banner
   ============================================================ */
.cta-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  border: none;
  color: #fff;
  background: linear-gradient(120deg, #16181d 0%, #2a1012 55%, var(--primary) 130%);
}

.cta-banner h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.6rem, 2.8vw, 2.3rem);
}

.cta-banner .eyebrow,
.cta-banner .muted-text {
  color: rgba(255, 255, 255, 0.78);
}

.cta-banner .eyebrow {
  color: #ff9ca0;
}

/* ============================================================
   Browse page
   ============================================================ */
.browse-shell {
  gap: 28px;
}

.browse-banner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.browse-banner h1 {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(1.9rem, 3.6vw, 3rem);
}

.browse-banner-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.browse-pill {
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--text-soft);
}

.browse-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.filter-sidebar {
  position: sticky;
  top: 96px;
}

.sidebar-filters {
  grid-template-columns: 1fr;
}

.browse-results-panel {
  min-width: 0;
}

.browse-results-head {
  align-items: center;
}

.browse-results-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

#resultCount {
  padding: 9px 15px;
  border-radius: 999px;
  background: var(--primary-soft);
  border: 1px solid rgba(225, 35, 42, 0.2);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
}

/* ============================================================
   Vehicle detail
   ============================================================ */
.vehicle-detail {
  display: grid;
  gap: 18px;
}

.listing-gallery {
  display: grid;
  gap: 12px;
}

.gallery-stage {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #11151b;
}

.gallery-main {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  transition: opacity 160ms ease;
  cursor: zoom-in;
}

.gallery-nav,
.fullscreen-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  color: #11151b;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.gallery-nav.prev,
.fullscreen-nav.prev { left: 12px; }
.gallery-nav.next,
.fullscreen-nav.next { right: 12px; }

.gallery-counter,
.fullscreen-counter {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(14, 18, 24, 0.78);
  color: #fff;
  font-weight: 800;
}

.gallery-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x mandatory;
}

.gallery-thumb {
  flex: 0 0 92px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-muted);
  cursor: pointer;
  scroll-snap-align: start;
}

.gallery-thumb.active {
  border-color: var(--primary);
}

.gallery-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1.3 / 1;
  object-fit: cover;
}

.fullscreen-gallery {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(5, 8, 12, 0.96);
  touch-action: none;
}

.fullscreen-gallery img {
  max-width: 94vw;
  max-height: 88vh;
  object-fit: contain;
  transition: transform 120ms ease;
}

.fullscreen-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #11151b;
  font-size: 2rem;
  cursor: pointer;
}

/* ============================================================
   Messages
   ============================================================ */
.messages-layout {
  grid-template-columns: 330px minmax(0, 1fr);
  align-items: start;
}

.conversation-list {
  display: grid;
  gap: 10px;
}

.conversation-item {
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
}

.conversation-item:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.chat-window {
  min-height: 360px;
  max-height: 520px;
  overflow-y: auto;
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.chat-bubble {
  max-width: 78%;
  padding: 11px 15px;
  border-radius: 16px;
  line-height: 1.5;
}

.chat-bubble.me {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
}

.chat-bubble.them {
  border: 1px solid var(--line);
  background: var(--surface);
}

.chat-form {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.chat-form input {
  flex: 1;
}

/* ============================================================
   Stats, plans, admin
   ============================================================ */
.stats-grid,
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.stat-card,
.plan-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.stat-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.stat-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.plan-card h2,
.plan-card h3 {
  margin: 0 0 10px;
}

.plan-price {
  display: block;
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
}

.plan-card ul {
  padding-left: 20px;
  margin: 0 0 16px;
  color: var(--text-soft);
}

.plan-card li {
  margin-bottom: 6px;
}

.featured-plan {
  border-color: rgba(225, 35, 42, 0.4);
  box-shadow: 0 16px 36px rgba(225, 35, 42, 0.14);
}

/* ============================================================
   Monetization — pricing, plans, listing fees, promotions
   ------------------------------------------------------------
   Built on the same tokens as the rest of the app so the pricing
   surfaces read as part of iCarValue rather than bolted on.
   ============================================================ */
.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
}

.plan-card ul {
  flex: 1;
}

.plan-card .plan-btn {
  width: 100%;
  justify-content: center;
}

.plan-period {
  font-family: var(--font-body, inherit);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
}

/* The recommended plan is highlighted, never pre-selected or pre-charged —
   the seller still has to choose it deliberately. */
.plan-tag {
  position: absolute;
  top: -11px;
  left: 22px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.plan-tag.is-current-tag {
  left: auto;
  right: 22px;
  background: var(--success, #15a05f);
}

.plan-card.is-current {
  border-color: rgba(21, 160, 95, 0.45);
}

.current-plan-banner:empty {
  display: none;
}

.banner-plan {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
  padding: 18px 20px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.banner-plan.is-active {
  border-color: rgba(21, 160, 95, 0.35);
}

.banner-plan strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.banner-plan p {
  margin: 0;
  max-width: 46ch;
}

.plan-kicker {
  margin: 0 0 2px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.plan-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin: 14px 0 0;
}

.plan-facts div {
  margin: 0;
}

.plan-facts dt {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.plan-facts dd {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text);
}

/* Listing fee / promotion price cards */
.fee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.fee-card {
  padding: 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.fee-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.fee-card p {
  margin: 0;
}

.fee-price {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--primary);
}

.promotions-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 26px;
  margin-top: 8px;
}

.promotions-split h3 {
  margin: 0;
  font-size: 1rem;
}

/* Post-ad listing fee panel */
.listing-fee-panel {
  padding: 16px 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.listing-fee-panel p {
  margin: 8px 0 0;
}

.fee-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.fee-line .fee-label {
  font-weight: 600;
  color: var(--text);
}

.fee-line .fee-amount {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
}

.fee-line.included .fee-amount {
  color: var(--success, #15a05f);
}

.fee-line.warning .fee-label {
  color: var(--danger, #d92d20);
}

/* Dashboard plan panel */
.plan-panel {
  padding: 20px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.plan-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.plan-panel-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
}

.plan-panel p {
  margin: 12px 0 0;
}

.plan-panel .primary-btn,
.plan-panel .ghost-btn {
  margin-top: 16px;
}

.plan-status {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-soft);
}

.plan-status.is-active {
  background: rgba(21, 160, 95, 0.12);
  border-color: rgba(21, 160, 95, 0.28);
  color: var(--success, #15a05f);
}

.plan-status.is-expired {
  background: rgba(217, 45, 32, 0.10);
  border-color: rgba(217, 45, 32, 0.26);
  color: var(--danger, #d92d20);
}

.plan-meter {
  height: 8px;
  margin-top: 14px;
  border-radius: 999px;
  background: var(--surface-muted);
  overflow: hidden;
}

.plan-meter span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.stat-card.warning strong {
  color: var(--danger, #d92d20);
}

/* Dashboard listing promotion strip */
.dashboard-listing {
  display: flex;
  flex-direction: column;
}

.dashboard-listing.is-unpaid .vehicle-card {
  border-color: rgba(217, 45, 32, 0.35);
}

.listing-promo {
  margin-top: -6px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.promo-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.promo-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-soft);
}

.promo-chip.boost {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.28);
  color: #1d4ed8;
}

.promo-chip.featured {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.3);
  color: #b45309;
}

.promo-note {
  margin: 0 0 10px;
  font-size: 0.88rem;
  color: var(--text-soft);
}

.promo-note.warning {
  color: var(--danger, #d92d20);
}

.listing-promo .inline-actions {
  margin-top: 12px;
}

.promo-message {
  margin: 10px 0 0;
  font-size: 0.88rem;
  color: var(--success, #15a05f);
}

.promo-message:empty {
  display: none;
}

.promo-message.is-error {
  color: var(--danger, #d92d20);
}

/* Boost / Featured picker dialog */
.promo-card h3 {
  margin: 22px 0 6px;
  font-size: 1rem;
}

.promo-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.promo-option {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.promo-option:hover:not(:disabled) {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  transform: translateY(-1px);
}

.promo-option:disabled {
  opacity: 0.55;
  cursor: progress;
}

.promo-option.is-included {
  border-color: rgba(21, 160, 95, 0.4);
}

.promo-option-title {
  font-weight: 700;
  color: var(--text);
}

.promo-option-price {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
}

.promo-option.is-included .promo-option-price {
  color: var(--success, #15a05f);
}

.promo-option-meta {
  font-size: 0.82rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .banner-plan,
  .plan-panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .plan-facts {
    gap: 10px 18px;
  }

  .fee-grid,
  .promo-options {
    grid-template-columns: 1fr;
  }

  .listing-promo .inline-actions > * {
    width: 100%;
    justify-content: center;
  }

  .plan-tag,
  .plan-tag.is-current-tag {
    position: static;
    display: inline-block;
    margin-bottom: 10px;
  }
}

/* The tinted chips above use fixed ink colours for contrast on light
   backgrounds; dark mode needs the lighter end of the same hues. */
body.dark .promo-chip.boost {
  background: rgba(96, 165, 250, 0.16);
  border-color: rgba(96, 165, 250, 0.32);
  color: #93c5fd;
}

body.dark .promo-chip.featured {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.32);
  color: #fbbf24;
}

body.dark .plan-status.is-active,
body.dark .fee-line.included .fee-amount,
body.dark .promo-option.is-included .promo-option-price,
body.dark .promo-message {
  color: #4ade80;
}

body.dark .plan-status.is-expired,
body.dark .fee-line.warning .fee-label,
body.dark .promo-note.warning,
body.dark .promo-message.is-error,
body.dark .stat-card.warning strong {
  color: #f87171;
}

.admin-table {
  display: grid;
  gap: 10px;
}

.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.admin-row strong {
  font-family: var(--font-display);
}

.admin-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ============================================================
   Auth pages
   ============================================================ */
.auth-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 0% 0%, rgba(225, 35, 42, 0.08), transparent 38%),
    var(--bg);
}

.auth-card {
  width: min(560px, 100%);
  padding: 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.auth-card h1 {
  margin: 18px 0 8px;
  font-size: 1.9rem;
}

.auth-card .form-grid {
  margin-top: 18px;
}

.auth-card > p {
  color: var(--muted);
}

.brand-auth {
  display: inline-flex;
  margin-bottom: 6px;
}

/* ============================================================
   Prose
   ============================================================ */
.prose h1 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin-bottom: 12px;
}

.prose h2 {
  margin: 26px 0 10px;
  font-size: 1.25rem;
}

.prose p,
.prose li {
  color: var(--text-soft);
  line-height: 1.7;
}

.prose ul {
  padding-left: 22px;
}

.prose li {
  margin-bottom: 6px;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.site-footer-inner {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.site-footer .brand-logo {
  height: 36px;
}

.footer-links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-copy {
  width: 100%;
  text-align: center;
  padding-bottom: 28px;
  color: var(--muted);
  font-size: 0.86rem;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1080px) {
  .editorial-band,
  .estimator-shell,
  .browse-layout {
    grid-template-columns: 1fr;
  }

  .filter-sidebar {
    position: static;
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .marketplace-search {
    grid-template-columns: 1fr 1fr;
  }

  .marketplace-search .search-submit {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 880px) {
  .topbar {
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 24px;
  }

  .topbar .brand {
    order: 1;
  }

  .topbar-actions {
    order: 3;
    margin-left: auto;
  }

  .nav-toggle {
    order: 2;
    display: inline-flex;
    /* Must out-stack .nav-links (z-index: 110 below) so the same button
       still receives taps to close the drawer once it's open, instead of
       being covered by it. */
    position: relative;
    z-index: 111;
  }

  /* Below this breakpoint #mainNav is a slide-in drawer (toggled by
     body.nav-drawer-open) instead of a cramped horizontally-scrolling row. */
  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    /* .topbar has backdrop-filter, which makes it the containing block for
       fixed-position descendants in modern browsers — so top/bottom here
       resolve against the topbar's own (short) box instead of the viewport,
       collapsing the drawer to the header's height. An explicit viewport-unit
       height sidesteps that and forces the intended full-height drawer. */
    height: 100vh;
    height: 100dvh;
    width: min(80vw, 320px);
    margin: 0;
    padding: 96px 18px 24px;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    overflow-y: auto;
    background: var(--nav-surface);
    border-left: 1px solid var(--nav-border);
    box-shadow: var(--nav-shadow);
    -webkit-backdrop-filter: blur(var(--nav-glass-blur)) saturate(150%);
    backdrop-filter: blur(var(--nav-glass-blur)) saturate(150%);
    transform: translateX(100%);
    transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 110;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .nav-links a {
    width: 100%;
  }

  body.nav-drawer-open .nav-links {
    transform: translateX(0);
  }

  .nav-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 220ms ease;
    /* .topbar is its own stacking context (position: sticky + z-index: 50), so
       the open drawer inside it only out-stacks siblings within that context.
       The backdrop must stay below the topbar's z-index at the root level, or
       it paints over the whole header — including the open drawer — and
       swallows every tap on the menu links and the toggle button itself. */
    z-index: 45;
  }

  body.nav-drawer-open .nav-drawer-backdrop {
    opacity: 1;
    visibility: visible;
  }

  /* Elevation-on-hover is a desktop affordance; keep mobile pod static */
  .topbar:hover {
    transform: none;
  }

  .hero {
    min-height: 500px;
  }

  .hero-features {
    gap: 18px;
  }

  .messages-layout {
    grid-template-columns: 1fr;
  }

  .browse-banner,
  .cta-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 620px) {
  .page-wrap {
    width: min(100% - 28px, 1200px);
    margin-top: 36px;
  }

  .home-shell {
    gap: 44px;
  }

  .panel {
    padding: 20px;
  }

  .hero-inner {
    padding-top: 60px;
    padding-bottom: 96px;
  }

  .marketplace-search {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .chat-bubble {
    max-width: 90%;
  }

  .footer-links {
    gap: 14px;
  }
}

@media (max-width: 480px) {
  .inline-actions .primary-btn,
  .inline-actions .ghost-btn,
  .inline-actions .danger-btn,
  .inline-actions .whatsapp-btn {
    flex: 1;
  }

  .topbar .brand {
    padding: 6px 14px;
  }

  .topbar-actions #authActionLink {
    padding: 0 12px;
    font-size: 0.74rem;
  }

  .nav-links a {
    font-size: 0.62rem;
    padding: 6px 10px 5px;
  }
}

/* Responsive logo sizing */
@media (max-width: 620px) {
  .brand-logo,
  .topbar .brand-logo {
    height: 32px;
  }
}

@media (max-width: 400px) {
  .brand-logo,
  .topbar .brand-logo {
    height: 28px;
  }
}

/* International phone field: a country/dial-code selector sitting flush against
   the number input. Defaults to Ghana and wraps cleanly on small screens. */
.phone-field {
  display: flex;
  gap: 8px;
  align-items: stretch;
  width: 100%;
}

.phone-field .phone-country {
  flex: 0 0 auto;
  max-width: 42%;
  min-width: 116px;
}

.phone-field input[type="tel"] {
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 420px) {
  .phone-field {
    flex-wrap: wrap;
  }
  .phone-field .phone-country {
    max-width: 100%;
    flex: 1 1 100%;
  }
}

/* ============================================================
   2026 premium marketplace refinement
   ============================================================ */
:root {
  --bg: #f5f5f2;
  --surface: #ffffff;
  --surface-2: #fafaf8;
  --surface-muted: #efefeb;
  --line: #e5e5df;
  --line-strong: #d4d4cc;
  --text: #171918;
  --text-soft: #343936;
  --muted: #747a76;
  --primary: #d9232e;
  --primary-strong: #b91c25;
  --primary-soft: rgba(217, 35, 46, 0.09);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-sm: 0 1px 2px rgba(21, 24, 22, 0.04), 0 8px 24px rgba(21, 24, 22, 0.04);
  --shadow-md: 0 18px 45px rgba(21, 24, 22, 0.08);
  --shadow-lg: 0 30px 80px rgba(21, 24, 22, 0.14);
}

body.dark {
  --bg: #101311;
  --surface: #181c19;
  --surface-2: #1d211e;
  --surface-muted: #252a26;
  --line: #303630;
  --line-strong: #414941;
  --text: #f4f5f2;
  --text-soft: #d8dcd7;
  --muted: #9ca59d;
  --primary: #ee3c47;
  --primary-strong: #ff5963;
  --primary-soft: rgba(238, 60, 71, 0.14);
}

html {
  background: var(--bg);
}

body {
  background:
    radial-gradient(circle at 7% 4%, rgba(217, 35, 46, 0.04), transparent 24rem),
    var(--bg);
  font-size: 16px;
  letter-spacing: -0.006em;
}

body.nav-drawer-open,
body.filter-drawer-open {
  overflow: hidden;
}

::selection {
  color: #fff;
  background: var(--primary);
}

:focus-visible {
  outline: 3px solid rgba(217, 35, 46, 0.25);
  outline-offset: 3px;
}

h1,
h2,
h3,
h4 {
  letter-spacing: -0.045em;
}

.topbar {
  top: 0;
  width: 100%;
  max-width: none;
  min-height: 76px;
  margin: 0;
  padding: 10px max(24px, calc((100vw - 1280px) / 2));
  gap: 26px;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  border-radius: 0;
  background: rgba(20, 23, 21, 0.96);
  box-shadow: none;
  backdrop-filter: blur(18px);
}

.topbar::before,
.topbar::after {
  display: none;
}

.topbar:hover {
  transform: none;
}

.topbar .brand {
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 0;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: none;
}

.topbar .brand::before,
.topbar .brand::after {
  display: none;
}

.brand-logo,
.topbar .brand-logo {
  height: 36px;
  filter: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: auto;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  mask-image: none;
}

.nav-links a {
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  color: rgba(255,255,255,0.68);
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.nav-links a::before,
.nav-links a::after {
  display: none;
}

.nav-links a:hover,
.nav-links a.active {
  color: #ffffff;
  background: rgba(255,255,255,0.08);
  transform: none;
}

.nav-links a.active {
  box-shadow: inset 0 -2px 0 var(--primary);
}

.nav-ico {
  display: none;
}

.topbar-actions {
  gap: 7px;
  margin-left: 0;
}

.icon-btn,
.nav-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: rgba(255,255,255,0.78);
  background: rgba(255,255,255,0.05);
  box-shadow: none;
}

.icon-btn:hover,
.nav-toggle:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.1);
  transform: translateY(-1px);
}

.icon-badge {
  border-color: #171a18;
  background: var(--primary);
}

.topbar #authActionLink {
  min-height: 40px;
  padding: 0 18px;
  border-color: transparent;
  color: #fff;
  background: var(--primary);
}

.topbar #authActionLink:hover {
  background: var(--primary-strong);
}

.account-menu-panel {
  top: 66px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.verify-banner {
  width: 100%;
  margin: 0;
  border-radius: 0;
  border-width: 0 0 1px;
}

.page-wrap {
  width: min(100% - 48px, 1280px);
  margin: 48px auto 84px;
}

.home-shell {
  gap: 30px;
}

.panel {
  padding: clamp(24px, 3vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.section-head {
  gap: 24px;
  margin-bottom: 26px;
}

.section-head h1,
.section-head h2,
.panel > h1 {
  margin-bottom: 8px;
  font-size: clamp(1.65rem, 2.4vw, 2.35rem);
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.muted-text {
  color: var(--muted);
}

.hero {
  position: relative;
  min-height: 590px;
  margin-top: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(16,18,17,0.96) 0%, rgba(16,18,17,0.78) 45%, rgba(16,18,17,0.18) 100%),
    url("uploads/live-6.jpg") center 56% / cover no-repeat;
}

.hero::before {
  inset: auto 0 0;
  height: 46%;
  background: linear-gradient(180deg, transparent, rgba(11,13,12,0.58));
}

.hero::after {
  inset: 0;
  background: radial-gradient(circle at 73% 38%, rgba(255,255,255,0.08), transparent 26rem);
}

.hero-inner {
  width: min(100% - 48px, 1280px);
  margin: 0 auto;
  padding: 88px 0 150px;
  text-align: left;
}

.hero-badge {
  padding: 8px 12px;
  border-color: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.88);
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
}

.hero h1 {
  max-width: 760px;
  margin: 22px 0 20px;
  color: #fff;
  font-size: clamp(3rem, 6.2vw, 5.8rem);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.hero h1 .accent {
  color: #fff;
}

.hero h1 .accent::after {
  content: "";
  display: block;
  width: 92px;
  height: 5px;
  margin-top: 20px;
  border-radius: 4px;
  background: var(--primary);
}

.hero-lead {
  max-width: 650px;
  color: rgba(255,255,255,0.72);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
}

.hero-features {
  justify-content: flex-start;
  margin-top: 32px;
}

.hero-feature {
  color: rgba(255,255,255,0.82);
}

.hero-feature span {
  color: #fff;
  background: var(--primary);
  box-shadow: none;
}

.search-bar-wrap {
  position: relative;
  z-index: 5;
  width: min(100% - 48px, 1280px);
  margin: -76px auto 0;
}

.marketplace-search {
  grid-template-columns: 1.45fr 0.85fr 0.72fr 0.72fr auto;
  gap: 0;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.search-field {
  min-width: 0;
  padding: 5px 18px;
  border-right: 1px solid var(--line);
}

.search-field > span {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-field input,
.search-field select {
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-weight: 600;
  box-shadow: none;
}

.search-submit {
  align-self: stretch;
  min-width: 128px;
  border-radius: 12px;
}

.primary-btn,
.ghost-btn,
.danger-btn,
.whatsapp-btn,
.search-submit {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 11px;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: none;
}

.primary-btn,
.search-submit {
  border-color: var(--primary);
  background: var(--primary);
}

.primary-btn:hover,
.search-submit:hover {
  border-color: var(--primary-strong);
  background: var(--primary-strong);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(217,35,46,0.18);
}

.ghost-btn {
  border-color: var(--line-strong);
  color: var(--text-soft);
  background: var(--surface);
}

.ghost-btn:hover {
  border-color: var(--text);
  color: var(--text);
  background: var(--surface-2);
  transform: translateY(-1px);
}

.category-rack.panel {
  padding: 34px;
}

.category-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.category-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
  box-shadow: none;
}

.category-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.category-photo {
  height: 132px;
  background-position: center;
}

.category-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(11,13,12,0.46));
}

.category-icon {
  z-index: 1;
  right: 12px;
  bottom: 12px;
  width: 38px;
  height: 38px;
  color: #fff;
  background: var(--primary);
  box-shadow: none;
}

.category-info {
  padding: 15px 16px 17px;
}

.category-info strong {
  font-family: var(--font-display);
  font-size: 0.98rem;
}

.category-info small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
}

.cards-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.vehicle-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: none;
}

.vehicle-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.vehicle-card-photo {
  position: relative;
  height: 226px;
  overflow: hidden;
  background: var(--surface-muted);
}

.vehicle-card-photo > a {
  display: block;
  width: 100%;
  height: 100%;
}

.vehicle-card-photo img,
.vehicle-card-photo > a img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms cubic-bezier(.2,.8,.2,1);
}

.vehicle-card:hover .vehicle-card-photo img {
  transform: scale(1.035);
}

.card-favorite {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 50%;
  color: #242824;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
}

.card-favorite:hover {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
  transform: scale(1.05);
}

.card-favorite svg {
  width: 18px;
  height: 18px;
}

.card-favorite:disabled {
  opacity: 1;
}

.card-badges {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: calc(100% - 72px);
}

.badge {
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: rgba(22,25,23,0.78);
  backdrop-filter: blur(8px);
  font-size: 0.66rem;
  letter-spacing: 0.03em;
}

.badge.featured {
  color: #fff;
  background: var(--primary);
}

.badge.verified {
  color: #173f2f;
  background: #d9f5e7;
}

.badge.boosted {
  color: #fff;
  background: rgba(29, 78, 216, 0.92);
}

.photo-count-badge {
  right: auto;
  left: 14px;
  bottom: 12px;
  border: 0;
  color: #fff;
  background: rgba(20,23,21,0.74);
  backdrop-filter: blur(8px);
}

.vehicle-card-body {
  padding: 19px 20px 20px;
}

.card-kicker {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.vehicle-card-body h3 {
  min-height: 2.5em;
  margin-bottom: 12px;
  font-size: 1.08rem;
  line-height: 1.25;
}

.vehicle-card-body h3 a:hover {
  color: var(--primary);
}

.vehicle-card .price {
  margin: 0 0 16px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
}

.vehicle-specs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.vehicle-specs span {
  min-width: 0;
  padding: 0 8px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 0.74rem;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vehicle-specs span:first-child {
  padding-left: 0;
  text-align: left;
}

.vehicle-specs span:last-child {
  padding-right: 0;
  border-right: 0;
  text-align: right;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  color: var(--muted);
  font-size: 0.73rem;
}

.seller-line {
  overflow: hidden;
  color: var(--text-soft);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.posted-line {
  flex: 0 0 auto;
}

.card-management-actions:empty {
  display: none;
}

.card-management-actions:not(:empty) {
  margin-top: 14px;
}

.editorial-band {
  grid-template-columns: 0.8fr 1.35fr;
  padding: clamp(32px, 5vw, 64px);
  color: #fff;
  background: #191d1a;
  border-color: #191d1a;
}

.editorial-band h2,
.editorial-band .muted-text {
  color: #fff;
}

.editorial-band .muted-text,
.editorial-points p {
  color: rgba(255,255,255,0.62);
}

.editorial-points {
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  background: rgba(255,255,255,0.1);
}

.editorial-points article {
  padding: 24px;
  background: #202521;
}

.estimator-shell {
  align-items: center;
  padding: clamp(30px, 5vw, 58px);
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
}

.cta-banner {
  overflow: hidden;
  padding: clamp(32px, 5vw, 60px);
  background:
    linear-gradient(90deg, rgba(20,23,21,0.96), rgba(20,23,21,0.74)),
    url("uploads/live-2.jpg") center / cover;
}

.browse-shell {
  margin-top: 34px;
}

.browse-banner {
  min-height: 230px;
  padding: clamp(30px, 5vw, 54px);
  color: #fff;
  border: 0;
  background:
    linear-gradient(90deg, rgba(18,21,19,0.96), rgba(18,21,19,0.58)),
    url("uploads/live-10.jpg") center 58% / cover;
}

.browse-banner h1 {
  max-width: 780px;
  color: #fff;
  font-size: clamp(2rem, 4vw, 3.65rem);
}

.browse-pill {
  border-color: rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.84);
  background: rgba(255,255,255,0.08);
}

.browse-layout {
  grid-template-columns: 286px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}

.filter-sidebar {
  position: sticky;
  top: 100px;
  padding: 24px;
}

.sidebar-filters {
  grid-template-columns: 1fr;
  gap: 16px;
}

.filter-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-close,
.mobile-filter-trigger,
.filter-drawer-backdrop {
  display: none;
}

.browse-results-panel {
  min-width: 0;
}

.browse-results-panel .cards-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#resultCount {
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--text-soft);
  background: var(--surface-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

label {
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

input,
select,
textarea {
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--text);
  background: var(--surface);
  box-shadow: none;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #aeb3ae;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  outline: 3px solid var(--primary-soft);
  box-shadow: none;
}

.form-grid,
.filters-grid {
  gap: 18px;
}

.image-dropzone {
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: var(--surface-2);
}

.image-dropzone:hover,
.image-dropzone.is-dragging {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.auth-layout {
  min-height: calc(100vh - 76px);
  padding: 48px 24px;
  background:
    linear-gradient(90deg, rgba(17,20,18,0.9), rgba(17,20,18,0.46)),
    url("uploads/live-6.jpg") center / cover fixed;
}

.auth-card {
  width: min(100%, 500px);
  padding: clamp(28px, 5vw, 46px);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 24px;
  background: rgba(255,255,255,0.96);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
}

body.dark .auth-card {
  border-color: var(--line);
  background: rgba(24,28,25,0.96);
}

.brand-auth .brand-logo {
  height: 44px;
}

.stats-grid,
.pricing-grid {
  gap: 18px;
}

.stat-card,
.plan-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
  box-shadow: none;
}

.featured-plan {
  border: 2px solid var(--primary);
  box-shadow: 0 16px 40px rgba(217,35,46,0.1);
}

.messages-layout {
  gap: 18px;
}

.conversation-list,
.chat-window {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}

.conversation-item {
  border-bottom: 1px solid var(--line);
}

.conversation-item:hover {
  background: var(--surface-muted);
}

.chat-bubble {
  border-radius: 14px 14px 14px 4px;
}

.chat-bubble.me {
  border-radius: 14px 14px 4px 14px;
  background: var(--primary);
}

.vehicle-detail {
  padding: clamp(22px, 3vw, 38px);
}

.gallery-main,
.fullscreen-gallery img {
  border-radius: 18px;
  background: var(--surface-muted);
}

.gallery-thumb {
  border-radius: 10px;
}

.prose {
  max-width: 900px;
  margin-inline: auto;
}

.prose p,
.prose li {
  color: var(--text-soft);
  line-height: 1.8;
}

.site-footer {
  padding-top: 54px;
  color: rgba(255,255,255,0.7);
  background: #151816;
}

.site-footer-inner {
  width: min(100% - 48px, 1280px);
  padding: 0 0 42px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.site-footer .brand {
  padding: 8px 12px;
  border-radius: 10px;
  background: #fff;
}

.site-footer .brand-logo {
  height: 38px;
}

.footer-links a {
  color: rgba(255,255,255,0.68);
}

.footer-links a:hover {
  color: #fff;
}

.footer-copy {
  padding: 24px;
  color: rgba(255,255,255,0.46);
}

@media (max-width: 1080px) {
  .category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .browse-layout {
    display: block;
  }

  .mobile-filter-trigger {
    width: 100%;
    min-height: 48px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    color: var(--text);
    background: var(--surface);
    font-weight: 700;
  }

  .mobile-filter-trigger svg {
    width: 19px;
    height: 19px;
  }

  .filter-sidebar {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 130;
    width: min(90vw, 390px);
    height: 100dvh;
    margin: 0;
    padding: 28px;
    overflow-y: auto;
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    transform: translateX(100%);
    transition: transform 240ms cubic-bezier(.2,.8,.2,1);
  }

  .filter-close {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    background: var(--surface-2);
    font-size: 1.5rem;
  }

  .filter-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 125;
    display: block;
    visibility: hidden;
    opacity: 0;
    background: rgba(9,11,10,0.62);
    transition: opacity 220ms ease, visibility 220ms ease;
  }

  body.filter-drawer-open .filter-sidebar {
    transform: translateX(0);
  }

  body.filter-drawer-open .filter-drawer-backdrop {
    visibility: visible;
    opacity: 1;
  }
}

@media (max-width: 880px) {
  .topbar {
    min-height: 68px;
    padding: 9px 18px;
    flex-wrap: nowrap;
    border-radius: 0;
  }

  .topbar .brand {
    order: 0;
    margin-right: auto;
  }

  .nav-toggle {
    order: 3;
    display: inline-flex;
    position: relative;
    z-index: 111;
  }

  .topbar-actions {
    order: 2;
    margin-left: 0;
  }

  .topbar-actions .icon-btn:not(#themeToggle),
  .topbar-actions #authActionLink {
    display: none !important;
  }

  /* The drawer's own surface, rows and active state are defined once, in the
     "Mobile navigation drawer" section at the end of this file. An earlier
     dark-shell/dark-row treatment used to be repeated here; it was only ever
     neutralised by source order, so a reorder or a dedupe would have brought
     the dark per-row cards back on top of the flat list. Removed rather than
     overridden. */

  .nav-ico {
    width: 20px;
    display: inline-flex;
  }

  .nav-drawer-backdrop {
    background: rgba(9,11,10,0.62);
  }

  .hero {
    min-height: 560px;
  }

  .hero-inner {
    padding: 70px 0 170px;
  }

  .hero h1 {
    max-width: 620px;
  }

  .marketplace-search {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 14px;
  }

  .search-field {
    padding: 5px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
  }

  .marketplace-search .search-submit {
    grid-column: 1 / -1;
  }

  .cards-grid,
  .browse-results-panel .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .page-wrap,
  .hero-inner,
  .search-bar-wrap,
  .site-footer-inner {
    width: min(100% - 28px, 1280px);
  }

  .page-wrap {
    margin-top: 28px;
    margin-bottom: 56px;
  }

  .home-shell {
    gap: 22px;
  }

  .panel,
  .category-rack.panel {
    padding: 22px;
    border-radius: 18px;
  }

  .section-head {
    align-items: flex-start;
  }

  .section-head .ghost-btn {
    width: auto;
  }

  .hero {
    min-height: 610px;
    background-position: 63% center;
  }

  .hero-inner {
    padding: 58px 0 196px;
  }

  .hero h1 {
    margin-top: 18px;
    font-size: clamp(2.75rem, 14vw, 4.2rem);
  }

  .hero-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .hero-feature:last-child {
    grid-column: 1 / -1;
  }

  .search-bar-wrap {
    margin-top: -166px;
  }

  .marketplace-search {
    grid-template-columns: 1fr;
  }

  .search-field {
    min-height: 68px;
  }

  .marketplace-search .search-submit {
    grid-column: auto;
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-photo {
    height: 112px;
  }

  .cards-grid,
  .browse-results-panel .cards-grid {
    grid-template-columns: 1fr;
  }

  .vehicle-card-photo {
    height: 238px;
  }

  .editorial-band,
  .estimator-shell {
    padding: 28px 22px;
  }

  .editorial-points {
    grid-template-columns: 1fr;
  }

  .browse-banner {
    min-height: 290px;
  }

  .browse-banner-pills {
    gap: 7px;
  }

  .auth-layout {
    padding: 24px 14px;
    align-items: flex-start;
  }

  .auth-card {
    margin-top: 20px;
  }

  .inline-actions {
    align-items: stretch;
  }

  .inline-actions > * {
    justify-content: center;
  }
}

@media (max-width: 430px) {
  .topbar {
    padding-inline: 12px;
  }

  .topbar .brand {
    padding: 6px 9px;
  }

  .brand-logo,
  .topbar .brand-logo {
    height: 29px;
  }

  .topbar-actions #themeToggle {
    display: none;
  }

  .hero-features {
    display: none;
  }

  .hero-inner {
    padding-bottom: 180px;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .category-card {
    display: grid;
    grid-template-columns: 112px 1fr;
  }

  .category-photo {
    height: 100%;
    min-height: 100px;
  }

  .vehicle-card-photo {
    height: 218px;
  }

  .card-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

.card-favorite.is-saved {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.listing-empty-state {
  grid-column: 1 / -1;
  min-height: 280px;
  padding: 40px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: var(--surface-2);
}

.empty-state-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--primary);
  background: var(--primary-soft);
}

.empty-state-icon svg {
  width: 28px;
  height: 28px;
}

.listing-empty-state h3 {
  margin-bottom: 8px;
  font-size: 1.18rem;
}

.listing-empty-state p {
  max-width: 440px;
  margin-bottom: 20px;
  color: var(--muted);
}

@media (max-width: 880px) {
  .topbar-actions .icon-btn,
  .topbar-actions a[data-auth-injected] {
    display: none !important;
  }

  .topbar-actions #authActionLink {
    max-width: 150px;
    display: inline-flex !important;
    overflow: hidden;
    padding-inline: 13px;
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 430px) {
  .topbar-actions #authActionLink {
    max-width: 104px;
  }
}

/* Firebase Phone Authentication's invisible reCAPTCHA.
   The container must stay in the DOM — Firebase will not send an SMS if it is
   display:none — but it has no visible content of its own, so it is given no
   layout footprint. Google renders the reCAPTCHA badge itself as a
   viewport-fixed element; the offset below keeps it clear of an iPhone's home
   indicator so it never sits over the page's own controls. */
.recaptcha-holder {
  width: 0;
  height: 0;
}

.grecaptcha-badge {
  z-index: 900;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
}

/* ============================================================
   Mobile navigation drawer (hamburger menu)
   ------------------------------------------------------------
   #mainNav doubles as the inline desktop nav and the mobile slide-in
   drawer. Above 880px only the inline links show. Below it those links
   are hidden and the drawer chrome takes over: a header, the profile
   card, and one flat menu list (.drawer-menu) that carries every
   destination a phone user can reach. The list is deliberately a single
   continuous column — one row per destination, hairline separators, no
   per-row cards — so it reads like a standard settings menu. Colours are
   the site's own tokens: white surface, near-black text, red accents.
   ============================================================ */
.drawer-head,
.drawer-user,
.drawer-menu {
  display: none;
}

@media (max-width: 880px) {
  /* --- Drawer shell --- */
  .nav-links {
    width: min(88vw, 370px);
    padding:
      calc(18px + env(safe-area-inset-top, 0px))
      calc(18px + env(safe-area-inset-right, 0px))
      calc(18px + env(safe-area-inset-bottom, 0px))
      18px;
    gap: 0;
    background: var(--surface);
    border-left: 1px solid var(--line);
    border-radius: 18px 0 0 18px;
    box-shadow: -18px 0 42px rgba(16, 24, 40, 0.18);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    overflow: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  /* Every destination is listed once, inside .drawer-menu, so the inline
     row of desktop links is hidden rather than restyled into the drawer. */
  .nav-links > a {
    display: none !important;
  }

  .nav-drawer-backdrop {
    background: rgba(16, 24, 40, 0.5);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
  }

  /* The drawer carries its own close button, so the hamburger fades out
     while it is open instead of floating over the header. */
  body.nav-drawer-open .nav-toggle {
    opacity: 0;
    pointer-events: none;
  }

  .nav-toggle {
    transition: opacity 200ms ease;
  }

  /* --- Header: logo + close --- */
  .drawer-head {
    order: -3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 0 14px;
    border-bottom: 1px solid var(--line);
    flex: 0 0 auto;
  }

  .drawer-logo {
    height: 32px;
    width: auto;
  }

  .drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface-muted);
    color: var(--text);
    cursor: pointer;
  }

  .drawer-close svg {
    width: 17px;
    height: 17px;
  }

  /* --- Profile card (read-only view of existing account data) --- */
  .drawer-user {
    order: -2;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 0 20px;
    border-bottom: 1px solid var(--line);
    flex: 0 0 auto;
  }

  .drawer-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--primary), var(--primary-strong));
    color: #ffffff;
  }

  .drawer-avatar svg {
    width: 25px;
    height: 25px;
  }

  .drawer-user-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
  }

  .drawer-user-name {
    color: var(--text);
    font-family: var(--font-display);
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .drawer-user-mail {
    color: var(--muted);
    font-size: 0.76rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .drawer-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 4px;
  }

  .drawer-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.01em;
  }

  .drawer-pill svg {
    width: 13px;
    height: 13px;
  }

  .drawer-pill.is-verified {
    background: rgba(21, 160, 95, 0.12);
    color: var(--success);
  }

  .drawer-pill.is-pending {
    background: var(--surface-muted);
    color: var(--muted);
  }

  /* --- The flat menu list --------------------------------------------
     .drawer-menu is the only flexible child of the drawer, so the header
     and profile card stay put while the list itself scrolls. --- */
  .drawer-menu {
    order: -1;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    padding-top: 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .drawer-section {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
  }

  .drawer-section + .drawer-section {
    margin-top: 16px;
  }

  .nav-links .drawer-section h2 {
    margin: 0 0 2px;
    padding: 0 4px;
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  /* One row per destination: icon, label, chevron. No card, no radius, no
     gap — just a hairline between neighbours. */
  .nav-links .drawer-item,
  .nav-links .drawer-signout {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 16px;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 54px;
    padding: 6px 4px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0;
    text-align: left;
    text-transform: none;
    cursor: pointer;
  }

  .nav-links .drawer-section .drawer-item:last-child {
    border-bottom: 0;
  }

  /* The inline nav's hover paints white-on-dark; the flat list stays flat,
     so hover and press are held to the row's own colours. */
  .nav-links .drawer-item:hover,
  .nav-links .drawer-item:active {
    background: transparent;
    box-shadow: none;
    color: var(--text);
    transform: none;
  }

  .nav-links .drawer-item.active:hover,
  .nav-links .drawer-item.active:active,
  .nav-links .drawer-signout:hover {
    background: transparent;
    box-shadow: none;
    color: var(--primary);
    transform: none;
  }

  .nav-links .drawer-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--surface-muted);
    color: var(--muted);
  }

  .nav-links .drawer-item-icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.9;
    transform: none;
    filter: none;
  }

  .nav-links .drawer-item-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Current page: the label and its icon turn red. The row itself stays
     flat — no fill, no bar — so the list keeps reading as one column. */
  .nav-links .drawer-item.active {
    background: transparent;
    box-shadow: none;
    color: var(--primary);
  }

  .nav-links .drawer-item.active .drawer-item-icon {
    background: var(--primary-soft);
    color: var(--primary);
  }

  .nav-links .drawer-item-chevron {
    display: inline-flex;
    justify-self: end;
    color: var(--line-strong);
  }

  .nav-links .drawer-item-chevron svg {
    width: 16px;
    height: 16px;
  }

  /* --- Sign out sits below the list, not in it --- */
  .drawer-signout-wrap {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    flex: 0 0 auto;
  }

  .nav-links .drawer-signout {
    grid-template-columns: 34px minmax(0, 1fr);
    min-height: 48px;
    border-bottom: 0;
    color: var(--primary);
    font-weight: 700;
  }

  .nav-links .drawer-signout .drawer-item-icon {
    background: var(--primary-soft);
    color: var(--primary);
  }
}

/* Shorter phones: keep every row reachable without cramping the header. */
@media (max-width: 880px) and (max-height: 700px) {
  .drawer-user {
    padding: 14px 0 16px;
  }

  .drawer-avatar {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
  }

  .nav-links .drawer-item,
  .nav-links .drawer-signout {
    min-height: 48px;
  }
}

/* Content pages (About, Safety, Terms, Privacy) -----------------------------
   Additive rules only: a lead line under the page title, an h3 level for the
   Privacy Policy's sub-headings, and a flush heading for the "Read Next"
   cross-link rows (which reuse .inline-actions + .ghost-btn). */
.prose .lead-text {
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.prose h3 {
  margin: 18px 0 8px;
  font-size: 1.02rem;
}

.prose .page-links-title {
  margin-top: 0;
}

/* ============================================================
   Theme switching, toasts and favorite state
   ============================================================ */

/* Native UI (scrollbars, date pickers, autofill) follows the page theme. The
   inline boot script sets this before first paint; these rules keep it correct
   if scripting is unavailable. */
:root {
  color-scheme: light;
}

body.dark {
  color-scheme: dark;
}

/* The theme toggle is a primary control, not a secondary shortcut, so it stays
   in the header at every width — the other topbar icons still collapse into the
   drawer below 880px. */
@media (max-width: 880px) {
  .topbar-actions #themeToggle {
    display: inline-flex !important;
  }
}

@media (max-width: 430px) {
  .topbar-actions #themeToggle {
    display: inline-flex !important;
  }
}

/* Login / signup have no topbar; the toggle sits in the card's top corner. */
.auth-card {
  position: relative;
}

.auth-theme-toggle {
  position: absolute;
  top: 16px;
  right: 16px;
  color: var(--text-soft);
  background: var(--surface-muted);
  border: 1px solid var(--line);
}

/* --- Brand logo -------------------------------------------------------------
   Light mode uses the dark wordmark (logo.png). Dark mode prefers a white
   wordmark (logo-white.png); when that file has not been added yet, theme.js
   marks the image `is-inverted` and the dark original is whitened here instead,
   so dark mode always stays legible. */
.brand-logo.is-inverted {
  filter: brightness(0) invert(1);
}

/* The header and footer wordmarks sit on a white chip, which a white logo would
   disappear into — in dark mode the chip steps aside. */
body.dark .topbar .brand,
body.dark .site-footer .brand {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

body.dark .topbar {
  background: rgba(14, 17, 15, 0.96);
  border-bottom-color: rgba(255, 255, 255, 0.10);
}

body.dark .site-footer {
  background: #0c0f0d;
}

/* --- Saved state ----------------------------------------------------------- */
.card-favorite.is-saved:hover {
  border-color: var(--primary-strong);
  background: var(--primary-strong);
}

#favoriteBtn.is-saved {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

/* --- Toasts ---------------------------------------------------------------- */
.toast-host {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(92vw, 420px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  font-size: 0.92rem;
  font-weight: 600;
  animation: toast-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.toast-success {
  border-color: rgba(21, 160, 95, 0.4);
  color: var(--success);
}

.toast-error {
  border-color: rgba(220, 38, 38, 0.4);
  color: var(--danger);
}

.toast.is-leaving {
  opacity: 0;
  transition: opacity 280ms ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    animation: none;
  }
}

/* ============================================================
   Live listing counts
   ------------------------------------------------------------
   Every number on these surfaces is counted server-side, so it
   can legitimately be absent (still loading, or the count call
   failed). The states below exist so an unknown number reads as
   unknown rather than as zero.
   ============================================================ */

.hero-stat {
  margin-top: 22px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
  font-size: 0.98rem;
}

.hero-stat strong {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text);
}

.category-info small.category-count {
  margin-top: 2px;
  font-weight: 600;
  color: var(--primary);
}

/* A count that is still in flight shows the placeholder at reduced
   emphasis; one that failed is removed from the flow entirely, which
   is what keeps a wrong "0" off the page. */
[data-count-state="loading"] {
  opacity: 0.45;
}

[data-count-state="error"] {
  display: none !important;
}

.listing-error-state {
  border-style: solid;
  border-color: var(--line-strong);
}

.listing-error-state .empty-state-icon {
  color: var(--danger, #dc2626);
  background: rgba(220, 38, 38, 0.12);
}

/* ============================================================
   Contact channels
   ============================================================ */

.contact-channels {
  list-style: none;
  margin: 18px 0 28px;
  padding: 0;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.contact-channels li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.contact-channel-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--primary);
  background: var(--primary-soft);
}

.contact-channel-icon svg {
  width: 19px;
  height: 19px;
}

.contact-channel-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.contact-channel-body strong {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.contact-channel-body a {
  overflow-wrap: anywhere;
  font-weight: 600;
  color: var(--text);
}

.contact-form-heading {
  margin-bottom: 12px;
  font-size: 1.12rem;
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.92rem;
}

.footer-contact strong {
  margin-bottom: 2px;
  color: var(--text);
}
