.wdfk {
  --wdfk-ink: var(--ap-ink, #17241d);
  --wdfk-forest: var(--ap-forest, #1f3a2c);
  --wdfk-ivory: var(--ap-ivory, #f5f1e6);
  --wdfk-bronze: var(--ap-bronze-l, #d2b48c);
  --wdfk-bronze-deep: var(--ap-bronze-deep, #85603a);
  --wdfk-light: var(--ap-on-dark, #f2efe4);
  --wdfk-line: color-mix(in srgb, currentColor 24%, transparent);
  --wdfk-heat-low: #fff000;
  --wdfk-heat-medium: #ff8500;
  --wdfk-heat-high: #ff0033;
  --wdfk-sans: var(--ap-sans, "Manrope", system-ui, sans-serif);
  --wdfk-padding: clamp(.75rem, 3vw, 2.5rem);
  --wdfk-map-inset: clamp(.25rem, .85vw, .75rem);
  box-sizing: border-box;
  container-type: inline-size;
  width: 100%;
  margin: clamp(.75rem, 2vw, 1.5rem) auto;
  padding: .75rem var(--wdfk-padding);
  background: transparent;
  font: 400 1rem/1.5 var(--wdfk-sans);
  text-align: start;
}

.wdfk-header {
  margin-block-end: .75rem;
}

.wdfk-map {
  /* Give the map more room than the text and fields inside the panel. */
  margin-inline: calc(var(--wdfk-map-inset) - var(--wdfk-padding));
}

.wdfk-baits:not([hidden]) {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--wdfk-line);
  border-radius: 14px;
}

.wdfk-bait-chart {
  mask-image: radial-gradient(circle closest-side, transparent 57%, #000 58%);
  width: min(100%, 12rem);
  aspect-ratio: 1;
  border-radius: 50%;
  margin: .75rem auto;
}

.wdfk-baits .wdfk-bait-values {
  list-style: none;
  padding: 0;
  margin: .65rem 0;
}

.wdfk-bait-values li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .55em;
  align-items: baseline;
}

.wdfk-bait-values li > span:first-of-type { overflow-wrap: anywhere; }

.wdfk-bait-percent {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.wdfk-bait-values li::before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  border-radius: 50%;
  background: var(--wdfk-bait-color);
}

@container (min-width: 55rem) {
  .wdfk-map-layout:has(.wdfk-baits:not([hidden])) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(14rem, 25%);
    align-items: start;
    gap: 1rem;
  }
  .wdfk-map-layout:has(.wdfk-baits:not([hidden])) .wdfk-map { margin-inline: 0; }
  .wdfk-baits:not([hidden]) { margin-top: 0; }
}

.wdfk .wdfk-map svg {
  display: block;
  width: 100%;
  height: auto;
  margin-inline: auto;
}

@media (min-width: 768px) {
  .wdfk .wdfk-map svg {
    /* Reserve space for the menu and controls, then convert height to width using the SVG aspect ratio. */
    max-width: calc(clamp(13rem, 100svh - var(--ap-nav-h, 0px) - 19rem, 35rem) * 1.74648);
  }
}

.wdfk-labels circle {
  fill: var(--wdfk-bronze-deep);
  stroke: var(--wdfk-ivory);
  stroke-width: .9px;
}

.wdfk-labels text {
  fill: #fff;
  font: 600 16px/1 var(--wdfk-sans);
  text-anchor: middle;
  pointer-events: none;
}

.wdfk-ready .wdfk-labels circle {
  cursor: pointer;
}

.wdfk-ready .wdfk-labels g:not(.wdfk-selected):hover circle {
  stroke-width: 1.35px;
}

.wdfk-labels .wdfk-selected circle {
  fill: var(--wdfk-forest);
  stroke: var(--wdfk-ivory);
  stroke-width: 2px;
}

.wdfk-caption {
  padding: .75rem 0 0;
  text-align: start;
}

.wdfk-legend, .wdfk-detail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
}

.wdfk-legend {
  font-size: .88rem;
  padding-block: .15rem .6rem;
  border-bottom: 1px solid var(--wdfk-line);
}

.wdfk-period {
  padding: .25rem .75rem;
  border: 1px solid var(--wdfk-line);
  border-radius: 999px;
  font-weight: 700;
  margin-inline-start: auto;
}

.wdfk-detail {
  align-items: end;
  margin-block-start: .65rem;
}

.wdfk-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: .75rem 1rem;
  align-items: end;
  min-width: 0;
  max-width: 100%;
  padding: .7rem;
  border: 1px solid var(--wdfk-line);
  border-radius: var(--ap-r-md, 14px);
}

.wdfk .wdfk-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .35rem;
  flex: 1 1 8.75rem;
  min-width: 0;
  margin: 0;
  font-size: .83rem;
  font-weight: 700;
}

.wdfk .wdfk-detail .wdfk-field {
  flex-basis: 13rem;
  max-width: 18rem;
}

.wdfk .wdfk-field[hidden],
.wdfk .wdfk-filters[hidden],
.wdfk-status:empty {
  display: none;
}

.wdfk .wdfk-field :is(select, input, .wdfk-species-control) {
  /* The caption and its control each occupy their own grid row, including in Elementor. */
  position: static;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: .55rem .9rem;
  border: 1px solid var(--wdfk-bronze);
  border-radius: 999px;
  background-color: var(--wdfk-ivory);
  color: var(--wdfk-ink);
  font: 600 1rem/1.25 var(--wdfk-sans);
}

.wdfk .wdfk-field .wdfk-species-control {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .7rem;
  border-radius: var(--ap-r-md, 14px);
}

.wdfk-species-name { overflow-wrap: anywhere; }

.wdfk-species-control::after {
  width: .45rem;
  height: .45rem;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: translateY(-25%) rotate(45deg);
  content: "";
}

/* The visible value can wrap while the native select still handles touch and keyboard input. */
.wdfk .wdfk-field .wdfk-species-control select {
  position: absolute;
  inset: 0;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.wdfk .wdfk-field .wdfk-place { transition: none; }

.wdfk .wdfk-field .wdfk-place.wdfk-selected {
  background-color: var(--wdfk-forest);
  color: var(--wdfk-light);
}

.wdfk .wdfk-place option {
  background-color: var(--wdfk-ivory);
  color: var(--wdfk-ink);
}

.wdfk-status {
  flex: 1 1 12rem;
  padding: .65rem 0;
  font-weight: 600;
}

.wdfk :is(select, input):focus-visible,
.wdfk-species-control:focus-within {
  outline: 2px solid var(--wdfk-bronze);
  outline-offset: 2px;
}

.wdfk-legend .wdfk-low::before,
.wdfk-legend .wdfk-medium::before,
.wdfk-legend .wdfk-high::before {
  display: inline-block;
  width: .75em;
  height: .75em;
  margin-inline-end: .3em;
  border: 1px solid var(--wdfk-bronze);
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--wdfk-swatch);
  content: "";
}

.wdfk-low { --wdfk-swatch: var(--wdfk-heat-low); }
.wdfk-medium { --wdfk-swatch: var(--wdfk-heat-medium); }
.wdfk-high { --wdfk-swatch: var(--wdfk-heat-high); }

@container (max-width: 48rem) {
  /* Give the fish names their own row when the date picker also needs room. */
  .wdfk-date:not([hidden]) + .wdfk-field { grid-column: 1 / -1; }
}

@container (max-width: 29rem) {
  .wdfk .wdfk-detail .wdfk-field,
  .wdfk-status {
    flex-basis: 100%;
    max-width: none;
  }
}
