:root {
  --ink: #0f172a;
  --muted: #5f6b7a;
  --paper: #f6f4f0;
  --cream: #ffffff;
  --line: #e6e2db;
  --accent: #e4572e;
  --accent-2: #0f766e;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 8px 20px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 800px at 10% -10%, #fff0d6 0, transparent 60%),
    radial-gradient(900px 600px at 90% 0%, #e7f4f1 0, transparent 55%),
    var(--paper);
}

header {
  padding: 56px 24px 20px;
  max-width: 1440px;
  margin: 0 auto;
}

h1 {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: clamp(34px, 5vw, 56px);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--muted);
  font-size: 16px;
  max-width: 720px;
  line-height: 1.5;
}

.nav {
  display: flex;
  gap: 12px;
  margin: 22px 0 10px;
  flex-wrap: wrap;
}

.nav-link {
  text-decoration: none;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #ffffff;
  transition: all 0.2s ease;
}

.nav-link.is-active {
  color: var(--ink);
  border-color: #e6d8c6;
  box-shadow: var(--shadow-soft);
}

main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 24px 64px;
}

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

.card .value {
  font-size: 28px;
  font-weight: 600;
}

.section {
  margin-top: 26px;
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}


.panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.filters {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.tabs {
  display: inline-flex;
  gap: 8px;
  background: #f3efe8;
  border-radius: 999px;
  padding: 4px;
}

.tab {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab.is-active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.tab-note {
  font-size: 13px;
  color: var(--muted);
}

.map-wrap {
  position: relative;
}

.map {
  height: 540px;
  border-radius: 14px;
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.map-legend {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  box-shadow: var(--shadow);
  min-width: 160px;
  z-index: 3;
}

.map-info {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  min-width: 190px;
  z-index: 3;
}

.map-info-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
}

.map-info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.map-info-row:last-child {
  margin-bottom: 0;
}

.map-info-value {
  color: var(--ink);
  font-weight: 600;
}

.map-info {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  min-width: 190px;
}

.map-info-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
}

.map-info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.map-info-row:last-child {
  margin-bottom: 0;
}

.map-info-value {
  color: var(--ink);
  font-weight: 600;
}

.legend-row {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.legend-row:last-child {
  margin-bottom: 0;
}

.legend-swatch {
  width: 16px;
  height: 12px;
  border-radius: 4px;
  border: 1px solid rgba(15, 20, 26, 0.15);
}

.status {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.footer {
  max-width: 1440px;
  margin: 0 auto 32px;
  padding: 0 24px 32px;
  color: var(--muted);
  font-size: 12px;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.status.is-loading {
  position: relative;
  overflow: hidden;
  color: transparent;
  background: #f3efe8;
  border: 1px solid var(--line);
  border-radius: 10px;
  height: 36px;
}

.status.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  animation: shimmer 1.6s ease-in-out infinite;
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

.info p {
  margin: 0 0 12px;
  color: var(--muted);
}

.hint {
  padding: 12px;
  background: #f9f3ea;
  border: 1px dashed #e6d8c6;
  border-radius: 12px;
  font-size: 12px;
  color: var(--muted);
}

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

  .map {
    height: 420px;
  }

  .tabs {
    width: 100%;
    justify-content: space-between;
  }
}
