.hon-map {
  --hon-ink: #ececec;
  --hon-focus: #ffffff;
  --hon-error: #fca5a5;
  --hon-border: var(--border, #2a2f38);
  --hon-control-border: var(--control-border, #8a8d94);
  --hon-surface: var(--bg, #17191e);
  --hon-hover: rgb(255 255 255 / 0.08);
  --hon-accent: var(--accent, #ececec);
  /* The basemap's land color, under the canvas before tiles draw and under the legend swatches. */
  --hon-land: #4f5d7c;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  height: 100%;
  min-height: 0;
  color: var(--fg, #ececec);
}

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

.hon-map .maplibregl-canvas:focus-visible {
  outline-offset: -3px;
}

.hon-map__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem 1.25rem;
}

.hon-map__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.hon-map__group-label,
.hon-map__hint,
.hon-map__status {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted, #a6a8ad);
}

/* The padding and border are always there, so a notice does not change the map's height. */
.hon-map__status {
  align-self: flex-start;
  min-height: calc(1.5em + 0.25rem + 2px);
  padding: 0.125rem 0.5rem;
  border: 1px solid transparent;
  line-height: 1.5;
}

.hon-map__status[data-tone="notice"] {
  border-color: var(--warning-border, #9a3412);
  background: var(--warning-bg, #2a180a);
  color: var(--warning-fg, #fed7aa);
  font-weight: 600;
}

.hon-map__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--hon-control-border);
  border-radius: 2px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
}

.hon-map__button:hover {
  border-color: var(--hon-accent);
  background: var(--hon-hover);
}

.hon-map__button[aria-pressed="true"] {
  border-color: var(--hon-accent);
  background: var(--hon-accent);
  color: var(--accent-fg, #0a0d12);
}

.hon-map__box {
  flex: 1 1 18rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--hon-accent);
  background: var(--inset, #0f1217);
}

.hon-map__box > summary {
  padding: 0.25rem 0;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.hon-map__form {
  display: grid;
  gap: 0.625rem;
  padding: 0.5rem 0 0.25rem;
}

.hon-map__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.625rem;
}

.hon-map__field {
  display: grid;
  align-content: start;
  gap: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
}

.hon-map__input {
  width: 100%;
  min-height: 2.25rem;
  padding: 0.375rem 0.625rem;
  border: 1px solid var(--hon-control-border);
  border-radius: 2px;
  background: var(--hon-surface);
  color: inherit;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.hon-map__input:focus {
  border-color: var(--hon-accent);
}

.hon-map__input[aria-invalid="true"] {
  border: 2px solid var(--hon-error);
}

.hon-map__error {
  margin: 0;
  color: var(--hon-error);
  font-size: 0.8125rem;
}

.hon-map__error:empty {
  display: none;
}

.hon-map__form .hon-map__button {
  justify-self: start;
}

.hon-map__canvas {
  position: relative;
  flex: 1 1 auto;
  min-height: 20rem;
  overflow: hidden;
  border: 1px solid var(--hon-border);
  background: var(--hon-land);
}

/* MapLibre's controls are white with dark icons; here they are dark with light icons. */
.hon-map .maplibregl-ctrl-group {
  border-radius: 2px;
  background: var(--hon-surface);
  box-shadow: 0 0 0 1px var(--hon-control-border);
}

.hon-map .maplibregl-ctrl-group button + button {
  border-top-color: var(--hon-border);
}

.hon-map .maplibregl-ctrl-group button:not(:disabled):hover {
  background-color: var(--hon-hover);
}

.hon-map .maplibregl-ctrl-group .maplibregl-ctrl-icon {
  filter: invert(1);
}

.hon-map .maplibregl-ctrl-group .hon-map__overview {
  width: auto;
  padding: 0 0.625rem;
  color: var(--hon-ink);
  font: 500 0.75rem/29px var(--font);
  white-space: nowrap;
}

.hon-map .maplibregl-ctrl-scale {
  border-color: var(--hon-ink);
  background: rgb(10 13 18 / 0.7);
  color: var(--hon-ink);
}

.hon-map__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0.125rem 0 0;
  color: var(--muted, #a6a8ad);
  font-size: 0.75rem;
  list-style: none;
}

.hon-map__legend li {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.hon-map__count {
  font-variant-numeric: tabular-nums;
}

.hon-map__swatch {
  flex: none;
  width: 0.875rem;
  height: 0.875rem;
  background-color: var(--hon-land);
}

.hon-map__swatch--aoi {
  border: 3px solid #ffffff;
}

.hon-map__swatch--counted {
  background: linear-gradient(rgb(255 255 255 / 0.16), rgb(255 255 255 / 0.16)), var(--hon-land);
}

.hon-map__swatch--no-data {
  background: repeating-linear-gradient(-45deg, #e2e8f0 0 1.5px, #262d3d 1.5px 5px);
}

.hon-map__swatch--region {
  border: 2px solid #ffffff;
}

.hon-map__swatch--fire {
  width: 0.5rem;
  height: 0.5rem;
  margin: 0 0.1875rem;
  border-radius: 50%;
  background: #ffa31a;
}

.hon-map__fires {
  flex-basis: 100%;
  color: var(--fg, #ececec);
}

.hon-map__swatch--outside {
  background: linear-gradient(rgb(5 7 10 / 0.42), rgb(5 7 10 / 0.42)), var(--hon-land);
}

/* The fire-dot tooltip, dark like the page; MapLibre's own popup is white. */
.hon-popup .maplibregl-popup-content {
  padding: 0.5rem 0.75rem;
  border: 1px solid #3a3f48;
  border-radius: 6px;
  background: #1f2228;
  color: #ececec;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.5);
  font: 0.8125rem/1.45 var(--font, system-ui, sans-serif);
}

.hon-popup .maplibregl-popup-tip {
  display: none;
}

.hon-popup .maplibregl-popup-close-button {
  width: 1.75rem;
  height: 1.75rem;
  color: #ececec;
  font-size: 1.125rem;
}

.hon-popup .maplibregl-popup-close-button:hover {
  background: rgb(255 255 255 / 0.08);
}

.hon-point p {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.hon-point__title {
  padding-right: 1.25rem;
  font-weight: 600;
}

.hon-point p:last-of-type {
  color: #a6a8ad;
}

.hon-point a {
  display: inline-block;
  margin-top: 0.375rem;
  color: #ececec;
}

.hon-map__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
