:root,
[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-elevated: #171717;
  --surface: rgba(0, 0, 0, 0.8);
  --surface-soft: rgba(255, 255, 255, 0.05);
  --surface-card: rgba(23, 23, 23, 0.9);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f5f5f5;
  --text-secondary: #a3a3a3;
  --text-muted: #737373;
  --accent: #ffffff;
  --accent-text: #171717;
  --accent-hover: #e5e5e5;
  --badge-cyan: rgba(8, 145, 178, 0.9);
  --badge-indigo: rgba(49, 46, 129, 0.9);
  --focus: rgba(255, 255, 255, 0.35);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  --overlay: rgba(0, 0, 0, 0.55);
  --map-filter: none;
  --heart-active: #f43f5e;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f4f4f5;
  --bg-elevated: #ffffff;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-soft: rgba(0, 0, 0, 0.04);
  --surface-card: #ffffff;
  --border: rgba(0, 0, 0, 0.1);
  --border-strong: rgba(0, 0, 0, 0.16);
  --text: #171717;
  --text-secondary: #525252;
  --text-muted: #737373;
  --accent: #171717;
  --accent-text: #ffffff;
  --accent-hover: #262626;
  --badge-cyan: #0891b2;
  --badge-indigo: #3730a3;
  --focus: rgba(23, 23, 23, 0.3);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  --overlay: rgba(0, 0, 0, 0.4);
  --map-filter: grayscale(0.15);
  --heart-active: #e11d48;
  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: "Geist", "Manrope", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  transition: background-color 0.25s ease, color 0.25s ease;
}

@media (min-width: 768px) {
  body {
    padding-bottom: 0;
  }
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.font-geist {
  font-family: "Geist", "Manrope", ui-sans-serif, system-ui, sans-serif !important;
}

.ev-page {
  max-width: 80rem;
  margin-inline: auto;
  padding-inline: 1rem;
  padding-top: 0.5rem;
}

.ev-hero-title {
  font-size: clamp(1.75rem, 7vw, 2.35rem);
  line-height: 1.1;
  max-width: 16ch;
}

@media (min-width: 640px) {
  .ev-hero-title {
    font-size: clamp(2.5rem, 6vw, 3.75rem);
    max-width: 18ch;
  }
}

@media (min-width: 1024px) {
  .ev-hero-title {
    font-size: clamp(3.5rem, 5.2vw, 5rem);
    max-width: none;
  }
}

.ev-hero-search {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 1.25rem;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(18px);
}

.ev-hero-search-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.ev-hero-search-grid .ev-hero-q {
  grid-column: 1 / -1;
}

.ev-hero-search-grid .ev-hero-submit {
  grid-column: 1 / -1;
  min-height: 44px;
}

.ev-hero-search .ev-input,
.ev-hero-search .ev-select {
  min-height: 44px;
  font-size: 0.875rem;
}

.ev-hero-search .ev-chip {
  min-height: 32px;
  padding: 0.25rem 0.625rem;
  font-size: 0.6875rem;
}

@media (min-width: 640px) {
  .ev-hero-search {
    margin-top: 1rem;
    padding: 1rem;
  }

  .ev-hero-search-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .ev-hero-media {
    position: relative;
  }

  .ev-hero-search {
    position: absolute;
    left: 1.5rem;
    right: 1.5rem;
    bottom: 1.5rem;
    margin-top: 0;
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.12);
  }

  [data-theme="light"] .ev-hero-search {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(0, 0, 0, 0.08);
  }

  .ev-hero-search-grid {
    grid-template-columns: 1.4fr 1fr 1fr 0.9fr auto;
  }

  .ev-hero-search-grid .ev-hero-q,
  .ev-hero-search-grid .ev-hero-submit {
    grid-column: auto;
  }

  .ev-hero-caption {
    padding-bottom: 10.5rem;
  }
}

@media (min-width: 640px) {
  .ev-page {
    padding-inline: 1.5rem;
  }
}

.ev-panel {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  backdrop-filter: blur(16px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 12px 24px -12px rgba(0, 0, 0, 0.45);
}

@media (min-width: 640px) {
  .ev-panel {
    border-radius: 40px;
  }
}

.ev-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03), transparent);
}

[data-theme="light"] .ev-panel::before {
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.2), transparent);
}

.ev-panel-inner {
  position: relative;
  padding: 1.5rem;
}

@media (min-width: 640px) {
  .ev-panel-inner {
    padding: 2rem;
  }
}

.ev-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.625rem 1rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}

.ev-btn:hover {
  background: color-mix(in srgb, var(--surface-soft) 70%, var(--text) 8%);
}

.ev-btn:active {
  transform: scale(0.98);
}

.ev-btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: transparent;
}

.ev-btn-primary:hover {
  background: var(--accent-hover);
}

.ev-btn-ghost {
  background: transparent;
}

.ev-btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 9999px;
}

.ev-input,
.ev-select {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 0.875rem 0.75rem 2.5rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
}

.ev-input::placeholder {
  color: var(--text-muted);
}

.ev-select {
  appearance: none;
  padding-right: 2.5rem;
}

.ev-field {
  position: relative;
}

.ev-field-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: inline-flex;
}

.ev-field-chevron {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.ev-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 36px;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ev-chip.is-active,
.ev-chip[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--text);
  border-color: var(--border-strong);
}

.ev-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.6875rem;
  font-weight: 500;
  color: #fff;
  backdrop-filter: blur(8px);
}

.ev-badge-new { background: var(--badge-cyan); }
.ev-badge-premium { background: var(--badge-indigo); }
.ev-badge-open {
  background: rgba(255, 255, 255, 0.92);
  color: #312e81;
}

[data-theme="light"] .ev-badge-open {
  background: #171717;
  color: #fff;
}

/* Header */
#site-header {
  position: sticky;
  top: 1rem;
  z-index: 50;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  #site-header {
    padding-inline: 1.5rem;
  }
}

.ev-header-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.ev-header-nav {
  display: none;
  align-items: center;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .ev-header-nav {
    display: flex;
  }
}

.ev-header-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.ev-header-nav a:hover,
.ev-header-nav a.is-active {
  color: var(--text);
}

.ev-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ev-mobile-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 1rem;
  left: 1rem;
  padding: 0.75rem;
  border-radius: 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 60;
}

.ev-mobile-menu.is-open {
  display: grid;
  gap: 0.25rem;
}

.ev-mobile-menu a {
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.ev-mobile-menu a:hover,
.ev-mobile-menu a.is-active {
  background: var(--surface-soft);
  color: var(--text);
}

@media (min-width: 768px) {
  .ev-mobile-menu,
  .ev-menu-toggle {
    display: none !important;
  }
}

/* Bottom nav */
#bottom-nav {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.25rem;
  padding: 0.5rem;
  border-radius: 1.5rem;
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

@media (min-width: 768px) {
  #bottom-nav {
    display: none;
  }
}

#bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 52px;
  border-radius: 1rem;
  color: var(--text-muted);
  font-size: 0.625rem;
  font-weight: 500;
}

#bottom-nav a.is-active {
  color: var(--text);
  background: var(--surface-soft);
}

#bottom-nav svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Footer */
#site-footer {
  max-width: 80rem;
  margin: 2.5rem auto 2rem;
  padding-inline: 1rem;
}

@media (min-width: 640px) {
  #site-footer {
    padding-inline: 1.5rem;
  }
}

.ev-footer-sono {
  color: var(--text);
  font-weight: 600;
}

.ev-footer-sono:hover {
  text-decoration: underline;
}

/* Toast */
#toast-root {
  position: fixed;
  left: 50%;
  bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(92vw, 22rem);
  pointer-events: none;
}

@media (min-width: 768px) {
  #toast-root {
    bottom: 1.5rem;
    left: auto;
    right: 1.5rem;
    transform: none;
  }
}

.ev-toast {
  pointer-events: auto;
  padding: 0.875rem 1rem;
  border-radius: 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 0.875rem;
  animation: toast-in 0.25s ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Modal / sheet */
.ev-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.ev-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.ev-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 71;
  max-height: 88dvh;
  overflow: auto;
  padding: 1rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  border-radius: 1.75rem 1.75rem 0 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transform: translateY(110%);
  transition: transform 0.28s ease;
}

.ev-sheet.is-open {
  transform: translateY(0);
}

.ev-sheet-handle {
  width: 2.5rem;
  height: 0.25rem;
  margin: 0.25rem auto 1rem;
  border-radius: 9999px;
  background: var(--border-strong);
}

.ev-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 72;
  width: min(92vw, 28rem);
  max-height: 85dvh;
  overflow: auto;
  padding: 1.25rem;
  border-radius: 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transform: translate(-50%, -46%) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.ev-modal.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

/* Property card */
.ev-card {
  overflow: hidden;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.ev-card:hover {
  border-color: var(--border-strong);
}

.ev-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-elevated);
}

.ev-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.ev-card:hover .ev-card-media img {
  transform: scale(1.03);
}

.ev-heart.is-active svg {
  fill: var(--heart-active);
  stroke: var(--heart-active);
}

.ev-heart.is-active {
  animation: heart-pop 0.35s ease;
}

@keyframes heart-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Sticky CTA on detail (mobile) */
.ev-sticky-cta {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
  z-index: 55;
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 1.25rem;
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

@media (min-width: 768px) {
  .ev-sticky-cta {
    display: none;
  }
}

/* Steps */
.ev-steps {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.ev-step-dot {
  flex: 1;
  height: 0.25rem;
  border-radius: 9999px;
  background: var(--border);
}

.ev-step-dot.is-done,
.ev-step-dot.is-current {
  background: var(--text);
}

.ev-step-dot.is-current {
  opacity: 0.55;
}

/* Empty state */
.ev-empty {
  text-align: center;
  padding: 3rem 1.25rem;
  color: var(--text-secondary);
}

.ev-empty h3 {
  margin: 0.75rem 0 0.35rem;
  color: var(--text);
  font-size: 1.125rem;
}

/* Map */
.leaflet-container {
  background: var(--bg-elevated) !important;
  font: inherit;
  filter: var(--map-filter);
}

.ev-map-preview {
  min-width: 180px;
}

/* Utilities */
.ev-muted { color: var(--text-secondary); }
.ev-dim { color: var(--text-muted); }
.ev-section { margin-top: 2rem; margin-bottom: 2rem; }
.ev-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

body.has-sticky-cta {
  padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 768px) {
  body.has-sticky-cta {
    padding-bottom: 0;
  }
}
