/* Public map only: native labels keep both text and whitespace clickable. */
#controls .checkbox label { cursor: pointer; }
.camp-filter-toggle { display: none; }
#colonyPanel { zoom: 1 !important; box-sizing: border-box; overflow: auto; overscroll-behavior: contain; }
#colonyPanel.affm-report-positioning { visibility: hidden; }
#colonyPanel .camp-enter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  min-height: 44px;
  width: auto;
  padding: 10px 16px;
  border: 1px solid #315f43;
  border-radius: 4px;
  color: #315f43;
  background: #fff;
  font-weight: 700;
}
#colonyPanel .camp-enter-count:hover,
#colonyPanel .camp-enter-count:focus { background: #e8eee5; color: #315f43; }

@media (max-width: 576px) {
  #controls {
    width: 148px !important;
    padding: 4px 6px;
    zoom: 1;
    opacity: .96;
    cursor: default;
  }
  #controls h4:empty { display: none; }
  #controls .camp-filter-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px;
    align-items: center;
  }
  #controls .camp-filter-header .full-label { display: none !important; }
  #controls .camp-filter-header .short-label { display: inline !important; }
  #controls .camp-filter-header .checkbox label { min-height: 44px; white-space: nowrap; }
  #controls .camp-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    width: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #294332;
    font-size: 23px;
    touch-action: manipulation;
  }
  #controls .camp-filter-toggle:focus-visible { outline: 2px solid #416750; }
  #controls.camp-filters-open .camp-filter-toggle > span { transform: rotate(180deg); }
  #controls .camp-filter-body { display: none; }
  #controls.camp-filters-open .camp-filter-body { display: block; }
  #controls .shiny-input-container { max-width: 100%; }
  #controls .form-group:has(> .checkbox),
  #controls .checkbox { margin: 0; }
  #controls .checkbox label {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 36px;
    padding: 4px 2px;
    margin: 0;
    gap: 6px;
    font-size: 13px;
    line-height: 1.2;
    touch-action: manipulation;
  }
  #controls .checkbox input[type="checkbox"] {
    position: static;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
    accent-color: #416750;
  }
  #controls .checkbox label:focus-within {
    outline: 2px solid #416750;
    outline-offset: -2px;
  }
  #controls .checkbox label > span { min-width: 0; }
  #controls .checkbox label > span > span[style] { margin-right: 4px !important; }
  #controls .date-range-disclosure { margin-top: 2px; padding-top: 0; }
  #controls .date-range-disclosure-toggle {
    min-height: 36px;
    justify-content: center;
    touch-action: manipulation;
  }
  #controls .date-range-show-label,
  #controls .date-range-hide-label { display: none !important; }
  /* Only expand the panel when the user actually opens date controls. */
  #controls.camp-filters-open:has(#dateRangeControlsDisclosure[open]),
  #controls.camp-filters-open.expanded-mobile { width: min(300px, calc(100vw - 28px)) !important; }
  #controls:not(.camp-filters-open) { width: 148px !important; }
}

/* One checkbox column and a separate swatch/text grid keep wrapped species
   names aligned with their first line, including the Christmas Island label. */
#controls h4:empty { display: none; }
#controls .shiny-input-container, #controls .checkbox { margin: 0; }
#controls .checkbox label {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  min-height: 28px;
  width: 100%;
  margin: 0;
  padding: 4px 0;
  font-size: 14px;
  line-height: 20px;
}
#controls .checkbox input[type="checkbox"] {
  position: static;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  cursor: pointer;
}
#controls .checkbox label > span { flex: 1; min-width: 0; }
#controls .affm-species-label {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  column-gap: 8px;
  align-items: start;
}
#controls .affm-species-swatch { display: block; width: 12px; height: 12px; margin-top: 4px; }
#controls .affm-species-label > .full-label,
#controls .affm-species-label > .short-label { grid-column: 2; grid-row: 1; }

/* Let the bottom panel use its labels' natural widths instead of squeezing
   them into fixed checkbox containers. Dropdown menus remain unclipped. */
#controls2 {
  width: max-content !important;
  max-width: calc(100vw - 20px) !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  padding: 6px 10px !important;
}
#controls2 > .shiny-input-container { flex: 0 0 auto; width: auto !important; min-width: 0; margin: 0 !important; }
#controls2 > .shiny-input-container:first-child { flex: 0 1 190px; width: 190px !important; min-width: 90px; }
#controls2 > hr { flex: 0 0 1px; margin: 0 2px !important; height: 28px !important; }
#controls2 .checkbox { margin: 0; }
#controls2 .checkbox label { display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; line-height: 18px; white-space: nowrap; }
#controls2 .checkbox input[type="checkbox"] { position: static; flex: 0 0 14px; width: 14px; height: 14px; margin: 0; }
#controls2 .full-label, #controls2 .short-label { white-space: nowrap; }
#controls2 .bootstrap-select .dropdown-toggle { min-height: 28px; height: 28px; padding-top: 3px; padding-bottom: 3px; }
@media (max-width: 620px) {
  #controls2 { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 10px !important; width: calc(100vw - 20px) !important; }
  #controls2 > hr { display: none; }
  #controls2 > .shiny-input-container,
  #controls2 > .shiny-input-container:first-child { width: 100% !important; min-width: 0; }
  #controls2 .bootstrap-select { width: 100% !important; }
}
@media (max-width: 576px) {
  #controls .checkbox label { min-height: 36px; padding: 8px 0; font-size: 13px; }
}
