/* ── Home page (v2: prompt-first) ────────────────────── */
/* Ensure [hidden] always wins even against display:flex/inline-flex rules */
.home-page [hidden] { display: none !important; }

.home-page {
  overflow: hidden;
  /* dvh = dynamic viewport height: matches the actually-visible area on mobile
     (excluding the collapsing URL/tab bar) so the footer's flex layout always
     pins it to the real bottom edge. 100vh is the fallback for older browsers. */
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}
/* Desktop: let the page scroll vertically when zoom/viewport is too short
   to fit the carousel cards' full height (90%+ zoom on average laptops).
   Mobile is unchanged — keeps the strict 100dvh single-screen layout. */
@media (min-width: 721px) {
  .home-page {
    overflow: visible;
    height: auto;
    min-height: 100dvh;
  }
}

/* White background on home page only */
.home-page {
  background: #fff;
}

/* Interactive dot grid canvas */
#homeGrid {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Ensure all page content sits above the canvas */
.home-top-left,
.home-top-right,
.home-main,
.home-footer,
.auth-modal {
  position: relative;
  z-index: 1;
}

/* Top-left VERA logo */
.home-top-left {
  position: absolute;
  top: 16px;
  left: 20px;
  z-index: 10;
}
.home-logo {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--cyan);     /* VERA in brand cyan */
  text-decoration: none;
}
.home-logo sup {
  font-size: 0.5em;
  font-weight: 700;
  vertical-align: super;
  color: #7c3aed;         /* AI in solid purple */
}

/* Top-right sign-in icon / user greeting */
.home-top-right {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
}
.home-signin-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 99px;
  padding: 7px 10px;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.home-signin-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(0, 148, 212, 0.06);
}
.home-user-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  padding: 7px 14px;
  border: 1.5px solid var(--border);
  border-radius: 99px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, color 0.15s;
}
.home-user-link:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}
.home-user-link[hidden] { display: none; }
.nav-login {
  font-size: 17px;
  font-weight: 600;
  padding: 6px 16px;
  border: 1.5px solid var(--border);
  border-radius: 99px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.nav-login:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(0, 148, 212, 0.05);
}

.home-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* ── Hero ────────────────────────────────────────────── */
.home-hero {
  position: relative;
  padding: 154px 24px 16px;   /* extra 100px top padding on desktop */
  text-align: center;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
}

.home-prompt-wrap {
  margin-top: 70px;   /* desktop — extra 20px below the headline */
}

.home-glow {
  position: absolute;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(0, 148, 212, 0.18) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
  animation: home-glow-drift 10s ease-in-out infinite alternate;
}
@keyframes home-glow-drift {
  from { transform: translateX(-50%) scale(1); opacity: 0.7; }
  to   { transform: translateX(-45%) scale(1.1); opacity: 1; }
}

.home-eyebrow {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--cyan);
  margin-bottom: 8px;
}

.home-title {
  font-size: clamp(28px, 4vw, 50px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.home-title-grad {
  background: linear-gradient(120deg, var(--cyan) 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* Brand identity: VERA = cyan, AI = solid purple (consistent across the app) */
.home-title-brand {
  color: var(--cyan);
}
.home-title-sup {
  font-size: 0.35em;
  font-weight: 700;
  vertical-align: super;
  color: #7c3aed;
  letter-spacing: 0.5px;
}

.home-sub {
  font-size: 18px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto 14px;
}
.home-sub-word {
  color: var(--cyan);
  font-weight: 700;
  font-size: 1.15em;
  display: inline-block;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.home-sub-word.cycling-out {
  opacity: 0;
  transform: translateY(-6px);
}

/* Focus mode — blur everything except title, prompt, chips */
.home-eyebrow,
.home-sub,
.home-carousel-section,
.home-footer,
.home-glow {
  transition: filter 0.3s ease, opacity 0.3s ease;
}
.home-page.prompt-focused .home-eyebrow,
.home-page.prompt-focused .home-sub,
.home-page.prompt-focused .home-carousel-section,
.home-page.prompt-focused .home-footer,
.home-page.prompt-focused .home-glow {
  filter: blur(4px);
  opacity: 0.25;
  pointer-events: none;
}

/* Prompt box */
.home-prompt {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 14px 14px 14px 20px;
  box-shadow: 0 4px 24px rgba(0, 100, 180, 0.08);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.home-prompt:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 6px 28px rgba(0, 148, 212, 0.18);
}

.home-prompt-input {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 19px;
  line-height: 1.5;
  color: var(--text);
  background: transparent;
  max-height: 200px;
  padding: 4px 0;
}
.home-prompt-input::placeholder {
  color: var(--muted);
}

.home-prompt-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  background: var(--cyan);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
}
.home-prompt-btn:hover  { background: #0080ba; }
.home-prompt-btn:active { transform: scale(0.95); }
.home-prompt-btn:disabled {
  background: var(--border);
  cursor: not-allowed;
}

/* Example chips */
.home-examples {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.home-examples-label {
  font-size: 16px;
  color: var(--muted);
}
.home-chip {
  font-size: 16px;
  padding: 6px 14px;
  background: rgba(0, 148, 212, 0.07);
  border: 1px solid rgba(0, 148, 212, 0.18);
  color: var(--text);
  border-radius: 99px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.home-chip:hover {
  background: rgba(0, 148, 212, 0.14);
  border-color: var(--cyan);
}
/* Desktop and mobile each render their own set of example chips —
   different label lengths suit each viewport. */
.home-chip--mobile  { display: none; }
@media (max-width: 720px) {
  .home-chip--desktop { display: none; }
  .home-chip--mobile  { display: inline-block; }
}

/* ── Carousel ────────────────────────────────────────── */
.home-carousel-section {
  padding: 10px 0 0;
  margin-top: auto;
}

.home-carousel-head {
  text-align: center;
  padding: 0 24px;
  margin-bottom: 10px;
}
.home-carousel-head h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 2px;
  color: var(--text);
}
.home-carousel-head p {
  font-size: 16px;
  color: var(--muted);
}

.home-carousel-wrap {
  width: 100%;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to right, transparent 0, #000 60px, #000 calc(100% - 60px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 60px, #000 calc(100% - 60px), transparent 100%);
}

.home-carousel-track {
  display: flex;
  gap: 16px;
  padding: 8px 0;
  width: max-content;
  will-change: transform;
}

/* Listing card */
.home-card {
  flex-shrink: 0;
  width: 260px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.home-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(0, 100, 180, 0.14);
  border-color: var(--cyan);
}
.home-card-photo-wrap {
  position: relative;
}
.home-card-photo-status {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 3;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.28);
  pointer-events: none;
}
.home-card-photo-status--active  { background: #047857; }
.home-card-photo-status--pending { background: #b45309; }
.home-card-photo-status--sold    { background: #475569; }
.home-card-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e8eef3;
  display: block;
}
.home-card-img-fallback {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #dee7ee 0%, #c4d3df 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0, 100, 180, 0.4);
  font-size: 32px;
  font-weight: 700;
}
.home-card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.home-card-price {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  font-family: 'Space Mono', monospace;
}
.home-card-addr {
  font-size: 16px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-card-meta {
  font-size: 14px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  margin-top: 2px;
}
.home-card-mls {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  font-family: monospace;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Price-change banner overlay on carousel card photos (top-left).
   Mirrors listing.css .price-banner — red for reductions, orange for
   increases. Shows when OriginalListPrice differs from ListPrice. */
.price-banner {
  position: absolute;
  top: 10px; left: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
  pointer-events: none;
  text-transform: uppercase;
  white-space: nowrap;
}
.price-banner--drop     { background: #dc2626; }
.price-banner--increase { background: #ea580c; }
.home-card-meta span:not(:last-child)::after {
  content: " ·";
  color: var(--border);
  margin-left: 8px;
}
/* Hover overlay — AI summary */
.home-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(0, 18, 50, 0.95) 55%, rgba(0, 18, 50, 0.25) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px 14px;
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
  border-radius: 14px;
}
@media (min-width: 721px) {
  .home-card-overlay {
    background: linear-gradient(to bottom, rgba(0, 18, 50, 0.94) 0%, rgba(0, 18, 50, 0.88) 100%);
    justify-content: flex-start;
    padding: 16px 16px 18px;
    gap: 10px;
  }
  .home-card-overlay-label {
    font-size: 13px;
    margin-bottom: 0;
    flex-shrink: 0;
  }
  .home-card-overlay-text {
    font-size: 14.5px;
    line-height: 1.45;
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
}
.home-card:hover .home-card-overlay,
.home-card--touched .home-card-overlay {
  opacity: 1;
}
.home-card-overlay-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--cyan);
  margin-bottom: 5px;
}
.home-card-overlay-text {
  font-size: 13px;
  font-weight: 400;
  color: #fff;
  line-height: 1.55;
}

.home-card-overlay-mls {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 8px;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--cyan);
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(125,211,252,0.4);
  border-radius: 4px;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.15s, color 0.15s;
  align-self: flex-start;
}
.home-card-overlay-mls:hover {
  background: rgba(125,211,252,0.15);
}
.home-card-overlay-mls--copied {
  color: #4ade80;
  border-color: rgba(74,222,128,0.5);
  background: rgba(74,222,128,0.12);
}

.home-card-skeleton {
  flex-shrink: 0;
  width: 260px;
  height: 280px;
  background: linear-gradient(90deg, #eef2f6 0%, #f7f9fb 50%, #eef2f6 100%);
  background-size: 200% 100%;
  border-radius: 14px;
  animation: home-skel-shimmer 1.6s ease-in-out infinite;
}
@keyframes home-skel-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ── Auth modal ──────────────────────────────────────── */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-modal[hidden] { display: none; }

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 26, 46, 0.55);
  backdrop-filter: blur(4px);
}

.auth-modal-panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 18px;
  padding: 28px 28px 22px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  animation: auth-modal-pop 0.18s ease-out;
}
@keyframes auth-modal-pop {
  from { transform: scale(0.96); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.auth-modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: transparent;
  border: none;
  font-size: 31px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
}
.auth-modal-close:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.05);
}

.auth-modal-head {
  text-align: center;
  margin-bottom: 18px;
}
.auth-modal-logo {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--cyan) 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 8px;
}
.auth-modal-tagline {
  font-size: 17px;
  color: var(--muted);
  margin-bottom: 10px;
}
.auth-modal-prompt-echo {
  font-size: 16px;
  font-style: italic;
  color: var(--text);
  background: rgba(0, 148, 212, 0.07);
  border-left: 3px solid var(--cyan);
  padding: 8px 12px;
  border-radius: 6px;
  margin: 8px 0 0;
  text-align: left;
  max-height: 80px;
  overflow: hidden;
}
.auth-modal-prompt-echo:empty { display: none; }

.auth-modal-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
}
.auth-modal-tab {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
  padding: 10px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.auth-modal-tab.active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

.auth-modal-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auth-modal-form[hidden] { display: none !important; }

/* Password field with eye toggle */
.auth-pw-wrap {
  position: relative;
}
.auth-pw-wrap input {
  width: 100%;
  padding-right: 44px;
  box-sizing: border-box;
}
.auth-pw-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
  display: flex;
  align-items: center;
  line-height: 1;
}
.auth-pw-eye:hover { color: var(--text); }
.auth-pw-eye svg[hidden] { display: none !important; }

/* Remember me checkbox */
.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.auth-remember input[type=checkbox] {
  width: 15px;
  height: 15px;
  accent-color: var(--cyan);
  cursor: pointer;
  padding: 0;
  border: none;
}
/* Terms agree row */
.auth-agent-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.auth-agent-label input[type=checkbox] {
  width: 15px;
  height: 15px;
  accent-color: var(--cyan);
  cursor: pointer;
  flex-shrink: 0;
}

.auth-terms-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.auth-terms-label input[type=checkbox] {
  width: 15px;
  height: 15px;
  accent-color: var(--cyan);
  cursor: pointer;
  flex-shrink: 0;
}
.auth-terms-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  color: var(--cyan);
  cursor: pointer;
  text-decoration: underline;
}
.auth-terms-link:hover { opacity: 0.75; }

.auth-modal-form input {
  width: 100%;
  padding: 11px 14px;
  font-size: 17px;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s;
}
.auth-modal-form input:focus { border-color: var(--cyan); }

.auth-modal-submit {
  width: 100%;
  padding: 12px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  background: var(--cyan);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.15s;
}
.auth-modal-submit:hover { background: #0080ba; }
.auth-modal-submit:disabled { background: var(--border); cursor: wait; }

.auth-modal-msg {
  font-size: 16px;
  text-align: center;
  margin: 4px 0 0;
  min-height: 18px;
}
.auth-modal-msg.error   { color: #ef4444; }
.auth-modal-msg.success { color: #22c55e; }

.auth-modal-footnote {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-top: 14px;
}

/* Footer — flex-shrink:0 keeps it at its natural height even when the parent
   runs short; combined with .home-page using 100dvh + .home-main flex:1, the
   footer (and its cyan top divider) always sits flush with the bottom edge. */
.home-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px;
  border-top: 3px solid var(--cyan);
  background: #fff;
  flex: 0 0 auto;
  margin-top: auto;
}
.home-footer small { color: var(--muted); font-size: 12px; }

.home-footer-links {
  display: flex;
  gap: 18px;
  align-items: center;
}
.home-footer-link {
  font-size: 12px;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: color 0.15s;
}
.home-footer-link:hover { color: var(--cyan); }

/* Legal modals (Terms / Policy) */
.home-legal-panel {
  max-height: 75vh;
  overflow-y: auto;
}
.home-legal-body {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.75;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Inquiry textarea */
.home-inquiry-textarea {
  width: 100%;
  padding: 11px 14px;
  font-size: 17px;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  outline: none;
  resize: vertical;
  transition: border-color 0.15s;
  min-height: 90px;
  box-sizing: border-box;
}
.home-inquiry-textarea:focus { border-color: var(--cyan); }

/* Mobile */
@media (max-width: 720px) {
  /* Push hero below the absolute logo + user-link bar — +25px so the
     headline block sits clearly lower under the top nav. */
  .home-hero { padding: 88px 16px 12px; }
  /* Eyebrow text on mobile — smaller font + tighter letter-spacing so the
     full "Virtual Electronic Real Estate Application" fits on one line
     without colliding with the logo/user-link bar above. */
  .home-eyebrow {
    font-size: 10px;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
  }
  /* Mobile is tight on vertical space in the strict 100dvh layout — trimmed
     to 36px so the carousel card's MLS# line clears the footer. */
  .home-prompt-wrap { margin-top: 36px; }
  /* Tighten logo and user-link for smaller screens */
  .home-logo { font-size: 15px; }
  .home-top-left { top: 14px; left: 14px; }
  .home-top-right { top: 14px; right: 14px; }

  .home-prompt { padding: 10px 10px 10px 14px; }
  /* Cap the textarea height on mobile so a long/prefilled prompt can't push the
     carousel cards off the bottom of the strict 100dvh layout (which clips their
     price/beds/baths/mls). It scrolls internally past this cap instead. */
  .home-prompt-input { font-size: 18px; max-height: 96px; }
  .home-carousel-head h2 { font-size: 19px; }
  .home-card { width: 200px; }
  .home-card-skeleton { width: 200px; height: 220px; }
  /* Squat the card image on mobile so the cards take ~30px less vertical
     space — frees enough room for the carousel section's padding-bottom
     to actually push the cards clear of the cyan footer divider. With
     overflow:hidden + 100dvh on .home-page the prior padding-bottom was
     just being clipped instead of creating a visible gap. */
  .home-card-img,
  .home-card-img-fallback { aspect-ratio: 5 / 3; }
  /* Breathing room between the carousel cards and the footer. Kept modest so
     the card's MLS# line stays inside the strict 100dvh layout (overflow:hidden
     was clipping it when this padding was larger). */
  .home-carousel-section { padding-bottom: 16px; }
  /* Compact card body on mobile so MLS# clears the footer */
  .home-card-body { padding: 8px 10px; gap: 2px; }
  .home-card-price { font-size: 17px; }
  .home-card-addr { font-size: 13px; }
  .home-card-meta { font-size: 12px; gap: 5px; margin-top: 1px; }
  .home-card-mls { font-size: 10px; margin-top: 2px; }
  .auth-modal-panel { padding: 22px 20px 18px; }

  /* Mobile: the strict 100dvh layout doesn't leave room for the status pill
     below the meta row — it ends up clipped by the page footer. Float the
     pill onto the top-left of the image as a corner badge instead. */
  .home-card-status {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    margin: 0;
    padding: 3px 8px;
    font-size: 9px;
    letter-spacing: 0.5px;
    box-shadow: 0 1px 4px rgba(0, 18, 50, 0.25);
  }

  /* Tighten footer link gaps on mobile to prevent text wrapping */
  .home-footer-links { gap: 10px; }
}

/* ── Cockpit Door — saved search-criteria presets ─────────────────── */
.cockpit-trigger {
  flex-shrink: 0;
  width: 40px; height: 40px;
  margin-right: 8px;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: color .15s, border-color .15s, background .15s;
}
.cockpit-trigger:hover { color: var(--cyan); border-color: var(--cyan); background: var(--cyan-dim); }

.cockpit-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(15, 30, 50, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.cockpit-overlay[hidden] { display: none !important; }
.cockpit-window {
  position: relative;
  width: 100%; max-width: 520px;
  max-height: 88vh; overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 40, 80, .22);
  color: var(--text);
  backdrop-filter: blur(8px);
}
.cockpit-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.cockpit-title { font-size: 17px; font-weight: 600; margin: 0; }
.cockpit-close {
  width: 30px; height: 30px;
  border: none; background: transparent;
  font-size: 24px; line-height: 1; color: var(--muted);
  cursor: pointer; border-radius: 8px;
}
.cockpit-close:hover { background: var(--bg); color: var(--text); }
.cockpit-body { padding: 16px 20px; }
.cockpit-intro { font-size: 13px; color: var(--muted); margin: 0 0 14px; line-height: 1.5; }

.cockpit-preset-row { display: flex; gap: 8px; margin-bottom: 16px; }
.cockpit-select {
  flex: 1; min-width: 0;
  padding: 9px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text); font-size: 14px;
  font-family: inherit;
}
.cockpit-select:focus { outline: none; border-color: var(--cyan); }

.cockpit-label {
  display: block;
  font-size: 13px; font-weight: 600; color: var(--text);
  margin-bottom: 16px;
}
.cockpit-input {
  width: 100%; box-sizing: border-box;
  margin-top: 6px;
  padding: 9px 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text); font-size: 14px;
  font-family: inherit;
}
.cockpit-input:focus { outline: none; border-color: var(--cyan); }

.cockpit-group {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}
.cockpit-group-title {
  font-size: 13px; font-weight: 700; color: var(--cyan);
  text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: 12px;
}
.cockpit-field {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text);
  margin-bottom: 10px;
  white-space: nowrap;
}
.cockpit-field:last-child { margin-bottom: 0; }
.cockpit-field > .cockpit-input { flex: 1; margin-top: 0; min-width: 0; }

.cockpit-nice-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.cockpit-nice-row { display: flex; align-items: center; gap: 8px; }
.cockpit-nice-row > .cockpit-input { margin-top: 0; }
.cockpit-nice-remove {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border: 1px solid var(--border);
  background: transparent; color: var(--muted);
  border-radius: 8px; font-size: 18px; line-height: 1;
  cursor: pointer;
}
.cockpit-nice-remove:hover { border-color: #f44336; color: #f44336; }

.cockpit-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}
.cockpit-dirty-tag { font-size: 12px; color: var(--muted); margin-right: auto; }

.cockpit-btn-primary {
  padding: 9px 18px; border: none; border-radius: 9px;
  background: var(--cyan); color: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: opacity .15s;
}
.cockpit-btn-primary:hover { opacity: .88; }
.cockpit-btn-secondary {
  padding: 9px 14px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--bg); color: var(--text);
  font-size: 14px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.cockpit-btn-secondary:hover { border-color: var(--cyan); }
.cockpit-btn-danger {
  padding: 9px 14px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--bg); color: var(--muted);
  font-size: 14px; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.cockpit-btn-danger:hover { border-color: #f44336; color: #f44336; }

.cockpit-confirm {
  position: absolute; inset: 0;
  background: rgba(15, 30, 50, .35);
  display: flex; align-items: center; justify-content: center;
  border-radius: 16px;
}
.cockpit-confirm[hidden] { display: none !important; }
.cockpit-confirm-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  width: 320px; max-width: 90%;
  box-shadow: 0 8px 32px rgba(0, 40, 80, .25);
}
.cockpit-confirm-text { font-size: 15px; font-weight: 600; margin: 0 0 14px; }
.cockpit-confirm-remind {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted); margin-bottom: 16px;
  cursor: pointer;
}
.cockpit-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
