/* Shared client navigation and overflow corrections. */
/* Candidate only. Qualified selectors support loading in the shared head before page CSS. */

/* Brands use the same search results as the catalog, with their own page wrapper. */
.core-workspace.core-client-brands .catalog-live-results {
  max-height: 430px;
  max-height: min(430px, 60vh);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

/* Match the established 200 x 42 order/catalog navigation variant. */
:is(.content-workspace.client-content-page, .account-workspace.feeds-workspace) .section-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

:is(.content-workspace.client-content-page, .account-workspace.feeds-workspace) .section-tabs a {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 200px;
  width: 200px;
  max-width: 100%;
  height: 42px;
  min-height: 42px;
  margin: 0;
  padding: 5px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

/* Section anchors only; report filters, figures and financial calculations are untouched. */
.stats-workspace nav.stats-section-nav {
  gap: 12px;
}

.stats-workspace nav.stats-section-nav a {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 200px;
  width: 200px;
  max-width: 100%;
  height: 42px;
  min-height: 42px;
  margin: 0;
  padding: 5px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

@media (max-width: 700px) {
  :is(.content-workspace.client-content-page, .account-workspace.feeds-workspace) .section-tabs a {
    flex: 0 1 200px;
    min-width: 0;
  }

  .stats-workspace nav.stats-section-nav a {
    flex: 0 1 200px;
    min-width: 0;
  }

  /* These feed rows are cards here; other mobile tables keep horizontal scrolling. */
  .account-workspace.feeds-workspace .account-table-wrap .account-feed-table tbody tr td:last-child {
    position: static;
    right: auto;
    z-index: auto;
    border-left: 0;
    box-shadow: none;
  }
}

/* Candidate only. Catalog navigation and client invoice filters; no field or admin widths change. */
@media screen {
  .catalog-workspace nav.section-tabs,
  .invoices-workspace.client-invoices-page nav.invoice-link-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0;
    grid-template-columns: none;
  }

  .catalog-workspace nav.section-tabs > a,
  .invoices-workspace.client-invoices-page nav.invoice-link-filters > a {
    box-sizing: border-box;
    display: inline-flex;
    flex: 0 0 200px;
    align-items: center;
    justify-content: center;
    width: 200px;
    max-width: 100%;
    min-width: 0;
    height: 42px;
    min-height: 42px;
    margin: 0;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
  }
}

@media screen and (max-width: 700px) {
  /* Override catalog flex:1/width:auto and the invoice single-column grid. */
  .catalog-workspace nav.section-tabs,
  .invoices-workspace.client-invoices-page nav.invoice-link-filters {
    display: flex;
    grid-template-columns: none;
  }

  .catalog-workspace nav.section-tabs > a,
  .invoices-workspace.client-invoices-page nav.invoice-link-filters > a {
    flex: 0 1 200px;
    width: 200px;
    max-width: 100%;
    min-width: 0;
  }
}

/* Keep catalog selects readable beside fixed-size actions; wrap groups when needed. */
@media screen {
  .catalog-workspace form.catalog-filter-card {
    display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px;
  }
  .catalog-workspace form.catalog-filter-card .catalog-filter-grid {
    display: flex; flex: 1 1 624px; align-items: flex-end; flex-wrap: wrap; gap: 12px;
    min-width: 0; max-width: 100%;
  }
  .catalog-workspace form.catalog-filter-card .catalog-filter-grid > .field {
    flex: 0 0 200px; width: 200px; max-width: 100%; min-width: 0;
  }
  .catalog-workspace form.catalog-filter-card .catalog-filter-grid > .catalog-query-field {
    flex: 1 1 200px; grid-column: auto;
  }
  .catalog-workspace form.catalog-filter-card .catalog-filter-actions {
    flex: 0 1 auto; flex-wrap: wrap; min-width: 0; max-width: 100%; margin-left: auto;
  }
}
@media screen and (max-width: 700px) {
  .catalog-workspace form.catalog-filter-card .catalog-filter-grid > .field {
    flex: 1 1 200px;
  }
  .catalog-workspace form.catalog-filter-card .catalog-filter-actions {
    flex: 1 1 412px; margin-left: 0;
  }
  .catalog-workspace form.catalog-filter-card .catalog-filter-actions .btn {
    flex: 1 1 200px; width: 200px;
  }
}
