/* ==========================================================
   Base
   ========================================================== */

* {
  box-sizing: border-box;
}

html,
body,
#map {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111827;
  background: #f3f4f6;
}

/* ==========================================================
   Map
   ========================================================== */

#map {
  position: fixed;
  inset: 0;
  z-index: 0;
}

/* ==========================================================
   Floating UI
   ========================================================== */

.ui {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
}

.card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(8px);
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #24734a;
}

.intro-card h1 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  line-height: 1.2;
}

.intro-card p,
.info-card p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
}

.info-card {
  max-height: min(62vh, 520px);
  overflow: auto;
}

.info-card h2 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  line-height: 1.2;
}

.muted {
  color: #6b7280;
}

/* ==========================================================
   Selected area info
   ========================================================== */

.area-info h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.25;
}

.area-description {
  margin: 0 0 12px;
  color: #374151;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ==========================================================
   GIS attributes
   ========================================================== */

.gis-details {
  margin-top: 12px;
  border-top: 1px solid #e5e7eb;
  padding-top: 10px;
}

.gis-details summary {
  cursor: pointer;
  color: #245c3b;
  font-size: 0.85rem;
  font-weight: 700;
  user-select: none;
}

.gis-details summary:hover {
  color: #123b25;
}

.attributes-list {
  margin: 10px 0 0;
  display: grid;
  gap: 8px;
}

.attribute-row {
  display: grid;
  gap: 2px;
}

.attribute-row dt {
  color: #6b7280;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.attribute-row dd {
  margin: 0;
  color: #111827;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

/* ==========================================================
   Feedback
   ========================================================== */

.error-message {
  color: #991b1b;
}

.error-message code {
  background: #fee2e2;
  padding: 1px 4px;
  border-radius: 4px;
}

/* ==========================================================
   Leaflet small tweaks
   ========================================================== */

.leaflet-control-attribution {
  font-size: 11px;
}

.leaflet-container {
  font-family: inherit;
}

/* ==========================================================
   Responsive
   ========================================================== */

@media (max-width: 640px) {
  .ui {
    top: 10px;
    left: 10px;
    right: 10px;
    width: auto;
  }

  .card {
    border-radius: 10px;
    padding: 12px 14px;
  }

  .intro-card h1 {
    font-size: 1rem;
  }

  .info-card {
    max-height: 48vh;
  }
}