/* Keep the model finder genuinely paginated. A later card layout must not
   override the hidden state applied by registry.min.js to cards after item 15. */
html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template
  .models-grid#modelsGrid > .model-card[data-pg-registry-card][hidden],
html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template
  .models-grid#modelsGrid > [data-pg-registry-card][hidden] {
  display: none !important;
}

/* Replace the legacy four-row reserve with content-driven model summaries. */
html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template
  .models-grid#modelsGrid > .model-card[data-pg-registry-card] {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 6px !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 10px 12px !important;
}

html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template
  .models-grid#modelsGrid .model-identity {
  align-items: center !important;
  gap: 3px 7px !important;
}

html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template
  .models-grid#modelsGrid .model-identity h2 {
  font-size: 14px !important;
  line-height: 1.25 !important;
}

html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template
  .models-grid#modelsGrid .model-select-link {
  width: 100% !important;
  min-height: 38px !important;
  align-self: stretch !important;
  padding: 6px 8px !important;
  font-size: 11px !important;
}

/* Keep the finder controls compact and selectable without a horizontal brand rail. */
html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template .filter-panel:has([data-pg-registry-search]) {
  display: grid !important;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 2fr) !important;
  align-items: end !important;
  gap: 14px !important;
  margin-bottom: 10px !important;
  padding: 16px !important;
}

html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template .filter-panel .filter-group,
html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template .filter-panel .pg-filter-disclosure {
  min-width: 0 !important;
}

html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template .pg-filter-disclosure-fields {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  align-items: end !important;
  gap: 12px !important;
  min-width: 0 !important;
}

html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template .pg-filter-disclosure-fields .filter-group label {
  margin-bottom: 5px !important;
  font-size: 10px !important;
  line-height: 1.25 !important;
}

html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template .pg-filter-disclosure-fields .input-control {
  min-width: 0 !important;
  min-height: 42px !important;
  padding: 9px 10px !important;
  font-size: 12px !important;
  text-overflow: ellipsis;
}

html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template .pg-filter-panel-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 8px;
}

html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template [data-pg-registry-clear] {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid rgba(195, 210, 227, .2);
  border-radius: 8px;
  background: transparent;
  color: #C3D2E3;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template [data-pg-registry-clear][hidden] {
  display: none !important;
}

html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template .pg-active-filter-count {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  margin-left: 8px;
  padding: 0 6px;
  border-radius: 99px;
  background: #109CFF;
  color: #071522;
  font-size: 11px;
  font-weight: 800;
}

html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template .pg-active-filter-count[hidden] {
  display: none !important;
}

html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template .pg-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
}

html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template .pg-active-filters[hidden] {
  display: none !important;
}

html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template .pg-active-filter-chip {
  display: inline-flex;
  max-width: 100%;
  min-height: 28px;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid rgba(16, 156, 255, .24);
  border-radius: 999px;
  background: rgba(16, 156, 255, .08);
  color: #C3D2E3;
  font-size: 11px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

@media (min-width: 769px) and (max-width: 1023px) {
  html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template .filter-panel:has([data-pg-registry-search]) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  }

  html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template .filter-panel > .pg-filter-disclosure {
    display: block !important;
    grid-column: 2 !important;
  }

  html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template .pg-filter-disclosure-fields {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
  }
}

@media (min-width: 1024px) {
  html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template .filter-panel > .pg-filter-disclosure {
    display: block !important;
    grid-column: 2 !important;
    min-width: 0 !important;
  }
}

@media (max-width: 768px) {
  html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template .filter-panel:has([data-pg-registry-search]) {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
    padding: 12px !important;
  }

  html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template .filter-panel > .pg-filter-disclosure {
    display: block !important;
    grid-column: auto !important;
  }

  html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template .pg-filter-disclosure > summary {
    display: flex !important;
    min-height: 42px !important;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    border: 1px solid rgba(195, 210, 227, .18);
    border-radius: 9px;
    background: #071522;
    color: #E8F1FA;
    font-size: 13px;
    font-weight: 700;
    list-style: none;
    cursor: pointer;
  }

  html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template .pg-filter-disclosure > summary::-webkit-details-marker {
    display: none !important;
  }

  html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template .pg-filter-disclosure-fields {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
    padding: 10px 10px 0 !important;
  }

  html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template .pg-filter-panel-actions {
    padding: 0 10px 10px;
  }
}

/* Keep the first results close to their controls; the base hero bottom spacing
   was leaving a blank band before the model count on both desktop and mobile. */
html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template
  main#main > .page-hero:has([data-pg-registry-search]) {
  padding-bottom: 14px !important;
  margin-bottom: 10px !important;
}

html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template
  .filter-panel:has([data-pg-registry-search]) {
  margin-bottom: 8px !important;
}

/* Four columns fit inside the capped wide desktop content area. */
@media (min-width: 1600px) {
  html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template
    .models-grid#modelsGrid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}
