:root {
  --bg: #f2f5f9;
  --surface: #ffffff;
  --surface-soft: #f7fafc;
  --ink: #102235;
  --ink-soft: #5a6d80;
  --accent: #0a7a6a;
  --accent-strong: #075f52;
  --line: #d9e2ec;
  --danger: #b23b3b;
  --shadow: 0 14px 40px rgba(16, 34, 53, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(70rem 40rem at -10% -15%, rgba(10, 122, 106, 0.18), transparent 70%),
    radial-gradient(56rem 30rem at 110% -10%, rgba(7, 95, 82, 0.16), transparent 65%),
    linear-gradient(180deg, #edf2f7 0%, #f8fbfd 35%, #f2f5f9 100%);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 2.8rem 1.5rem 2.2rem;
  background: linear-gradient(128deg, #052636 0%, #0b4a59 58%, #076f64 100%);
  color: #eef9f9;
}

.hero-glow {
  position: absolute;
  width: 26rem;
  height: 26rem;
  right: -6rem;
  top: -9rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(185, 250, 227, 0.45) 0%, rgba(185, 250, 227, 0) 70%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 70rem;
  margin: 0 auto;
  animation: riseIn 420ms ease-out;
}

.eyebrow {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}

.hero h1 {
  margin: 0.5rem 0 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: clamp(2.1rem, 4vw, 3.45rem);
  line-height: 1.05;
}

.hero p {
  margin: 0.85rem 0 0;
  max-width: 44rem;
  opacity: 0.93;
}

.status-message {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.9rem;
}

main {
  width: min(1160px, calc(100% - 2rem));
  margin: -1.3rem auto 0;
  padding-bottom: 1.2rem;
}

.summary-panel,
.table-section,
.changes {
  background: var(--surface);
  border-radius: 1.2rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.2rem;
  padding: 1.35rem;
  border: 1px solid rgba(255, 255, 255, 0.75);
  animation: riseIn 500ms ease-out;
}

.summary-header,
.section-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
}

.summary-header h2,
.section-header h2 {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 1.3rem;
}

.section-note {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.filters label,
.control-group label {
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.filters select,
.filters button,
.quick-controls input,
.quick-controls select {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.64rem 0.85rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}

.filters button {
  border: 0;
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.filters button:hover {
  filter: brightness(1.05);
}

.quick-controls {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.8rem;
}

.control-group {
  display: grid;
  gap: 0.35rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.metric {
  padding: 0.85rem;
  border-radius: 0.9rem;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
  text-align: center;
}

.metric span:first-child {
  display: block;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--accent-strong);
}

.metric span:last-child {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.insights-grid {
  margin-top: 0.85rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.insight-card {
  padding: 0.9rem;
  border-radius: 0.9rem;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.insight-card h3 {
  margin: 0;
  font-size: 0.93rem;
  color: var(--ink-soft);
  font-weight: 600;
}

.insight-value {
  margin: 0.65rem 0 0;
  font-size: 1.07rem;
  font-weight: 700;
}

.chart-card {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.chart-card h3 {
  margin: 0;
  font-size: 1rem;
}

.map-card {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.map-header h3 {
  margin: 0;
  font-size: 1rem;
}

#listingsMap {
  margin-top: 0.8rem;
  width: 100%;
  height: 360px;
  border-radius: 0.8rem;
  border: 1px solid #dbe5ef;
  overflow: hidden;
  background: linear-gradient(180deg, #f3f8fb 0%, #eef5f7 100%);
}

.map-popup {
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 0.88rem;
  line-height: 1.35;
}

.map-popup .map-popup-title {
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.map-popup .map-popup-meta {
  color: var(--ink-soft);
  margin-bottom: 0.3rem;
}

.summary-meta {
  margin: 0.45rem 0 0.8rem;
  color: var(--ink-soft);
}

#priceTrendChart {
  width: 100%;
  height: 260px;
  display: block;
  border-radius: 0.7rem;
  background: linear-gradient(180deg, #ffffff 0%, #f5fbf9 100%);
}

.table-responsive {
  overflow-x: auto;
  margin-top: 0.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

th,
td {
  padding: 0.85rem;
  border-bottom: 1px solid #e4ebf2;
  text-align: left;
}

th {
  background: #f4f8fb;
  color: #294153;
  font-weight: 700;
  cursor: pointer;
}

tbody tr {
  transition: background-color 0.2s ease;
}

tbody tr:hover {
  background: #f8fcfd;
}

.site-badge {
  display: inline-block;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-strong);
  background: rgba(10, 122, 106, 0.12);
  border: 1px solid rgba(10, 122, 106, 0.22);
}

a {
  color: var(--accent-strong);
  text-underline-offset: 2px;
}

a:hover {
  color: #06463d;
}

.changes {
  min-height: 180px;
}

#changeLog {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.change-card {
  padding: 0.95rem;
  border-radius: 0.9rem;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
}

.change-card strong {
  display: inline-block;
  margin-bottom: 0.55rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #1b5164;
}

.change-card time {
  color: var(--ink-soft);
  display: block;
  margin-top: 0.7rem;
  font-size: 0.88rem;
}

.empty-state {
  border: 1px dashed var(--line);
  background: #fbfdff;
  border-radius: 0.9rem;
  padding: 1rem;
  text-align: center;
  color: var(--ink-soft);
}

footer {
  text-align: center;
  padding: 0.8rem 1rem 1.25rem;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

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

@media (max-width: 980px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .quick-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hero {
    padding-top: 2.2rem;
  }

  main {
    width: calc(100% - 1rem);
    margin-top: -0.9rem;
  }

  .summary-panel,
  .table-section,
  .changes {
    padding: 1rem;
  }

  .summary-header,
  .filters,
  .section-header {
    flex-direction: column;
    align-items: stretch;
  }

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

  th,
  td {
    padding: 0.72rem;
  }

  #listingsMap {
    height: 290px;
  }
}
