/* Map-specific controls; never renders an invented basemap or coverage radius. */
.demeter-map {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
  min-height: 360px;
  overflow: hidden;
  background: #f3f5f0;
  border-radius: inherit;
  color: #27392f;
}
.demeter-map [hidden] { display: none !important; }
.demeter-map-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  visibility: hidden;
  pointer-events: none;
}
.demeter-map-stage.is-ready {
  z-index: 1;
  visibility: visible;
  pointer-events: auto;
}
.demeter-map-fallback {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  background: #f6f7f3;
}
.map-fallback-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 13px 16px;
  border-bottom: 1px solid #e1e6df;
  background: #fbfcf9;
}
.map-fallback-heading__icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 8px;
  color: #52745d;
  background: #ebf0e7;
  font-size: 24px;
}
.map-fallback-heading strong,
.map-fallback-heading small { display: block; }
.map-fallback-heading strong {
  color: #385443;
  font-size: 13px;
  font-weight: 700;
}
.map-fallback-heading small {
  margin-top: 2px;
  color: #637268;
  font-size: 11px;
  line-height: 1.4;
}
.map-retry-button {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 7px 9px;
  border: 1px solid #bdcfba;
  border-radius: 7px;
  background: #fff;
  color: #345a3d;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}
.map-retry-button:disabled { opacity: .55; cursor: wait; }
.map-retry-button:focus-visible { outline: 3px solid #1e739c; outline-offset: 2px; }
.map-fallback-canvas {
  position: relative;
  flex: 1 1 auto;
  min-height: 260px;
  overflow: hidden;
  background-color: #f5f6f1;
  background-image: radial-gradient(#d9e0d5 .8px, transparent .8px);
  background-size: 20px 20px;
}
.map-fallback-geometry {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
}
.map-fallback-field {
  fill: #91b993;
  fill-opacity: .23;
  stroke: #4b8059;
  stroke-width: 2;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
}
.map-fallback-field.review-visible {
  stroke: #ad721f;
  stroke-width: 2.5;
  stroke-dasharray: 7 4;
  fill: #dbb56e;
  fill-opacity: .16;
}
.map-fallback-field.is-selected {
  stroke: #205738;
  stroke-width: 4;
  fill-opacity: .32;
}
.map-fallback-field:focus-visible {
  outline: none;
  stroke: #13598d;
  stroke-width: 5;
}
.map-fallback-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.map-fallback-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}
.field-map-marker,
.station-map-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid #c6d4c5;
  border-radius: 8px;
  background: #fff;
  color: #284e37;
  box-shadow: 0 2px 8px rgb(24 49 31 / 11%);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.field-map-marker {
  z-index: 10;
  max-width: 160px;
  background: rgb(255 255 255 / 94%);
}
.field-map-marker > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.field-map-marker__review {
  display: none;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 5px;
  background: #fff0d2;
  color: #815218;
  font-weight: 800;
}
.field-map-marker.review-visible .field-map-marker__review { display: grid; }
.field-map-marker.is-selected {
  z-index: 45;
  color: #fff;
  background: #285d3e;
  border-color: #1d4d32;
  box-shadow: 0 0 0 3px rgb(54 110 67 / 16%), 0 3px 12px rgb(22 53 30 / 20%);
}
.field-map-marker.is-focusing { animation: demeter-field-focus 1.4s ease-out; }
@keyframes demeter-field-focus {
  0%, 100% { box-shadow: 0 0 0 3px rgb(54 110 67 / 16%), 0 3px 12px rgb(22 53 30 / 20%); }
  35% { box-shadow: 0 0 0 9px rgb(54 110 67 / 24%), 0 5px 16px rgb(22 53 30 / 25%); }
  65% { box-shadow: 0 0 0 5px rgb(54 110 67 / 12%), 0 3px 12px rgb(22 53 30 / 20%); }
}
.station-map-marker {
  z-index: 30;
  border-color: #b9d0db;
  color: #275c76;
  background: #fff;
  min-width: 72px;
  padding: 7px 9px;
}
.station-map-marker__symbol {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 5px;
  background: #e9f2f7;
}
.station-map-marker__value { font-variant-numeric: tabular-nums; }
.station-map-marker.is-selected {
  z-index: 55;
  border-color: #2b6c88;
  background: #e9f5fb;
  box-shadow: 0 0 0 3px rgb(63 122 153 / 17%), 0 3px 12px rgb(34 69 87 / 15%);
}
.station-map-marker.has-no-data { color: #64716c; border-color: #cdd6cf; }
.station-map-marker.has-no-data .station-map-marker__symbol { background: #eef1ed; }
.field-map-marker:hover,
.station-map-marker:hover { box-shadow: 0 4px 13px rgb(24 49 31 / 19%); }
.field-map-marker:focus-visible,
.station-map-marker:focus-visible,
.map-fallback-tools button:focus-visible {
  outline: 3px solid #1e739c;
  outline-offset: 3px;
}
.map-fallback-tools {
  position: absolute;
  right: 12px;
  top: 80px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #d6ded3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 9px rgb(29 50 30 / 8%);
}
.map-fallback-tools button {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #385243;
  font-size: 22px;
  font-family: inherit;
  cursor: pointer;
}
.map-fallback-tools button + button { border-top: 1px solid #e4e9e0; }
.map-fallback-tools button:hover { background: #eef4e9; }
.map-fallback-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 32px;
  text-align: center;
}
.map-fallback-empty strong { font-size: 16px; color: #365642; }
.map-fallback-empty p { max-width: 320px; margin: 0; font-size: 13px; line-height: 1.6; color: #66746a; }
.demeter-map-notice {
  position: absolute;
  z-index: 70;
  left: 12px;
  bottom: 48px;
  max-width: min(420px, calc(100% - 24px));
  padding: 10px 12px;
  border: 1px solid #d6dfd3;
  border-radius: 9px;
  background: rgb(255 255 255 / 97%);
  color: #4b5d4e;
  box-shadow: 0 4px 15px rgb(29 50 30 / 10%);
  font-size: 12px;
  line-height: 1.5;
}
.demeter-map .maplibregl-ctrl-attrib {
  max-width: 100%;
  font-size: 10px;
  line-height: 1.4;
}
.demeter-map .maplibregl-ctrl-group {
  border: 1px solid #d2dbd0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgb(28 54 32 / 12%);
}
.demeter-map .maplibregl-popup-content {
  padding: 4px;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgb(27 55 36 / 17%);
}
.demeter-map .maplibregl-popup-close-button {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  color: #516959;
}
.demeter-map .map-popup-card { padding: 13px 18px 12px 12px; max-width: 270px; }
.demeter-map .map-popup-card p { overflow-wrap: anywhere; }
.demeter-map .map-popup-alert { color: #815218; background: #fff0d2; }
@media (max-width: 600px) {
  .demeter-map { min-height: 360px; }
  .map-fallback-heading { padding: 11px 12px; gap: 8px; }
  .map-fallback-heading small { max-width: 260px; }
  .map-fallback-heading:has(.map-retry-button:not([hidden])) { flex-wrap: wrap; }
  .map-retry-button { margin-left: 40px; }
  .map-fallback-tools { top: 82px; right: 9px; }
  .field-map-marker { max-width: 126px; font-size: 11px; padding-inline: 8px; }
  .station-map-marker { min-width: 68px; font-size: 11px; gap: 4px; padding-inline: 7px; }
  .map-fallback-empty { padding: 24px; }
  /* Leave room for the provider attribution when its credits wrap to two lines. */
  .map-explorer .map-key,
  .map-explorer .map-legend { bottom: 46px; max-width: calc(100% - 20px); }
  .demeter-map-notice { bottom: 85px; }
}
@media (pointer: coarse) {
  .field-map-marker, .station-map-marker { min-height: 44px; }
  .map-fallback-tools button { width: 44px; height: 44px; }
  .demeter-map .maplibregl-ctrl-group button { width: 40px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .field-map-marker, .station-map-marker { transition: none; }
  .field-map-marker.is-focusing { animation: none; }
}
