/* Compact main dashboard filter toolbar. Desktop only; mobile stays unchanged. */
@media (min-width: 768px) {
  .gp-ui[data-workspace="main"] #filter-form .filter-form__primary {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    align-content: flex-start !important;
    gap: 8px !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    grid-template-areas: none !important;
    width: 100% !important;
  }

  .gp-ui[data-workspace="main"] #filter-form .filter-form__date-row {
    grid-area: auto !important;
    flex: 0 0 390px !important;
    display: flex !important;
    width: 390px !important;
    min-width: 390px !important;
    max-width: 390px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    margin: 0 !important;
    padding: 0 8px !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-radius: 10px !important;
  }

  .gp-ui[data-workspace="main"] #filter-form .filter-form__date-field {
    min-width: 0 !important;
    max-width: none !important;
    flex: 1 1 0 !important;
  }

  .gp-ui[data-workspace="main"] #filter-form .filter-form__dropdown-row {
    grid-area: auto !important;
    display: flex !important;
    flex: 0 0 auto !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px !important;
    width: max-content !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
  }

  .gp-ui[data-workspace="main"] #filter-form .filter-form__dropdown-row > .filter-form__dropdown-wrap {
    display: flex !important;
    flex: 0 0 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 44px !important;
    align-items: center !important;
    grid-column: auto !important;
    grid-row: auto !important;
    grid-area: auto !important;
  }
  .gp-ui[data-workspace="main"] #filter-form .filter-form__dropdown-row > .filter-form__dropdown-wrap:has(#channel_selector_btn) {
    width: 184px !important;
    order: 1 !important;
  }
  .gp-ui[data-workspace="main"] #filter-form .filter-form__dropdown-row > .filter-form__dropdown-wrap:has(#sort-select) {
    width: 180px !important;
    order: 2 !important;
  }
  .gp-ui[data-workspace="main"] #filter-form .filter-form__dropdown-row > .filter-form__dropdown-wrap:has(#geo_selector_btn) {
    width: 44px !important;
    order: 3 !important;
  }
  .gp-ui[data-workspace="main"] #filter-form .filter-form__dropdown-row > .filter-form__dropdown-wrap:has(#period-preset-select) {
    width: 44px !important;
    order: 4 !important;
  }

  .gp-ui[data-workspace="main"] #filter-form .filter-form__dropdown-row :is(.dropdown, .filter-form__sort-field, .filter-form__preset-field, .gp-select) {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
  }

  .gp-ui[data-workspace="main"] #filter-form .filter-form__dropdown-row :is(#channel_selector_btn, #geo_selector_btn, .gp-select-trigger) {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    border-radius: 10px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
  }

  .gp-ui[data-workspace="main"] #filter-form .filter-form__sort-actions {
    grid-area: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    justify-self: auto !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
  }
  .gp-ui[data-workspace="main"] #filter-form .filter-form__actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    width: max-content !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
  }
  .gp-ui[data-workspace="main"] #filter-form .filter-form__actions > :is(a.filter-form__action-button, button#filter-form__action-button, button#gp-refresh-main) {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 44px !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 22px !important;
    line-height: 1 !important;
    border-radius: 10px !important;
  }
  .gp-ui[data-workspace="main"] #filter-form .filter-form__actions > .gp-statistics-segments {
    display: block !important;
    grid-area: auto !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
  }
  .gp-ui[data-workspace="main"] #filter-form #gp-groups-trigger {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 108px !important;
    max-width: none !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 0 12px !important;
    border-radius: 10px !important;
    white-space: nowrap !important;
  }
}

/* Shared control surface: consistent borders and radius in both themes. */
@media (min-width: 768px) {
  .gp-ui[data-workspace="main"] #filter-form :is(
    .filter-form__date-row,
    #channel_selector_btn,
    #geo_selector_btn,
    .filter-form__sort-field .gp-select-trigger,
    .filter-form__preset-field .gp-select-trigger,
    .filter-form__actions > .filter-form__action-button,
    #gp-groups-trigger
  ) {
    background: var(--gp-panel) !important;
    border: 1px solid var(--gp-border) !important;
    color: var(--gp-fg) !important;
    border-radius: 10px !important;
    box-shadow: none !important;
  }
}

/* Match the GEO checkbox: one CSS-drawn tick, never a second ✓ glyph. */
.gp-ui[data-workspace="main"] #filter-form #gp-groups-menu .gp-groups-option input[type="checkbox"] {
  -webkit-appearance: none !important;
  appearance: none !important;
  position: relative !important;
  display: inline-block !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  flex: 0 0 18px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1.5px solid var(--gp-input-border) !important;
  border-radius: 5px !important;
  background: var(--gp-panel) !important;
  box-shadow: none !important;
  cursor: pointer;
}
.gp-ui[data-workspace="main"] #filter-form #gp-groups-menu .gp-groups-option input[type="checkbox"]:checked {
  background: var(--gp-fg) !important;
  border-color: var(--gp-fg) !important;
}
.gp-ui[data-workspace="main"] #filter-form #gp-groups-menu .gp-groups-option input[type="checkbox"]::before {
  content: none !important;
}
.gp-ui[data-workspace="main"] #filter-form #gp-groups-menu .gp-groups-option input[type="checkbox"]:checked::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  left: 5px !important;
  top: 1px !important;
  width: 5px !important;
  height: 10px !important;
  border: solid var(--gp-bg) !important;
  border-width: 0 2px 2px 0 !important;
  border-radius: 0 !important;
  transform: rotate(45deg) !important;
  font-size: 0 !important;
  line-height: 0 !important;
  text-decoration: none !important;
}

/* Refresh is icon-only regardless of desktop screen width or OS. */
.gp-ui[data-workspace="main"] #filter-form #gp-refresh-main .gp-main-refresh__label {
  display: none !important;
}
