/* Keep apply/reset reachable independently of the filter's scrollable controls. */
body.ph-vm-listing.ph-filter-enhanced .left-sidebar form > .cp-filter-actions {
  display: none !important;
}

body.ph-vm-listing .ph-filter-action-dock {
  box-sizing: border-box;
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  margin-top: 10px;
}

body.ph-vm-listing .left-sidebar .ph-visible-filter-actions {
  box-sizing: border-box;
  display: flex !important;
  flex-direction: row;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  margin: 0 !important;
  padding: 10px 0 0;
  border-top: 1px solid #d8e5ed;
  background: #fff;
}

body.ph-vm-listing .left-sidebar .ph-visible-filter-actions .cp-filter-submit,
body.ph-vm-listing .left-sidebar .ph-visible-filter-actions .cp-filter-reset {
  box-sizing: border-box;
  flex: 1 1 50%;
  width: auto;
  min-width: 0;
  min-height: 44px;
  padding: 9px 6px !important;
  font-size: 13px;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
}

body.ph-vm-listing .left-sidebar .ph-visible-filter-actions .cp-filter-reset { order: 1; }
body.ph-vm-listing .left-sidebar .ph-visible-filter-actions .cp-filter-submit { order: 2; }

@media (min-width: 761px) {
  body.ph-vm-listing .left-sidebar .ph-visible-filter-actions.is-floating {
    position: fixed;
    z-index: 30;
    left: var(--ph-action-left);
    bottom: 18px;
    width: var(--ph-action-width);
    max-width: calc(100vw - 16px);
    padding: 10px 8px;
    border: 1px solid #d8e5ed;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(12, 56, 84, .16);
  }
}

@media (max-width: 760px) {
  body.ph-vm-listing .ph-filter-action-dock { display: none; }
  body.ph-vm-listing.ph-filter-enhanced #main > .left-sidebar {
    box-sizing: border-box;
    max-width: min(354px, calc(100vw - 24px)) !important;
  }
  body.ph-vm-listing #main > .left-sidebar > .ph-visible-filter-actions {
    position: static;
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    margin: 0 !important;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    min-height: calc(60px + env(safe-area-inset-bottom));
    border-radius: 0;
  }
  body.ph-vm-listing.ph-filter-enhanced #main > .left-sidebar > .box {
    min-width: 0;
    min-height: 0;
    scroll-padding-bottom: 12px;
  }
}
