/* FoodCare FoodBorne Pathogen Guide v0.17.4 - layout hardening / category-first search */

/* -------------------------------------------------------------------------
 * Category -> food hierarchy. The category selector is always a distinct
 * control and never shares the same line box with the product input.
 * ---------------------------------------------------------------------- */
.fbp-food-hierarchy-search{
  display:grid!important;
  grid-template-columns:minmax(145px,.72fr) minmax(210px,1.28fr)!important;
  grid-template-rows:auto auto!important;
  column-gap:9.4px!important;
  row-gap:4.7px!important;
  align-items:end!important;
  min-width:0!important;
  width:100%!important;
  max-width:100%!important;
  position:relative!important;
  overflow:visible!important;
  box-sizing:border-box!important;
}
.fbp-food-hierarchy-search>*{min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
.fbp-food-hierarchy-search>.fbp-food-category-field{grid-column:1!important;grid-row:1/3!important;display:grid!important;grid-template-rows:auto minmax(42px,auto)!important;gap:4.7px!important;align-self:stretch!important;margin:0!important}
.fbp-food-hierarchy-search>.fbp-food-product-field{grid-column:2!important;grid-row:1!important;display:block!important;margin:0!important;align-self:end!important}
.fbp-food-hierarchy-search>.fbp-search-with-clear{grid-column:2!important;grid-row:2!important;margin:0!important}
.fbp-food-hierarchy-search select,.fbp-food-hierarchy-search input[type="search"]{width:100%!important;min-width:0!important;max-width:100%!important;height:41.36px!important;min-height:41.36px!important;box-sizing:border-box!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
.fbp-food-hierarchy-search>.fbp-async-food-menu{grid-column:2!important;top:calc(100% + 5px)!important}
.fbp-food-search-wrap>.fbp-food-search-help{grid-column:1/-1!important;margin-top:2.82px!important}

/* -------------------------------------------------------------------------
 * Encyclopedia. Top controls use their own row; actions no longer squeeze
 * Category/Property. Advanced fields remain fixed and equal width.
 * ---------------------------------------------------------------------- */
.fbp-pathogen-search-surface{
  display:grid!important;
  grid-template-columns:minmax(360px,2.2fr) minmax(205px,.85fr) minmax(220px,.9fr)!important;
  gap:11.28px 13.16px!important;
  align-items:end!important;
  overflow:visible!important;
  padding:13.16px!important;
  box-sizing:border-box!important;
}
.fbp-pathogen-search-surface>*{min-width:0!important;max-width:100%!important;box-sizing:border-box!important;margin:0!important}
.fbp-pathogen-search-surface>.fbp-search-field{grid-column:1!important;grid-row:1!important}
.fbp-pathogen-search-surface>label:nth-of-type(1){grid-column:2!important;grid-row:1!important}
.fbp-pathogen-search-surface>label:nth-of-type(2){grid-column:3!important;grid-row:1!important}
.fbp-pathogen-search-surface label select,.fbp-pathogen-search-surface label input{width:100%!important;min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
.fbp-pathogen-search-actions{grid-column:1/-1!important;grid-row:2!important;display:flex!important;justify-content:flex-end!important;gap:7.52px!important;min-width:0!important}
.fbp-pathogen-search-actions button{flex:0 0 auto!important;min-width:142px!important;max-width:190px!important}
.fbp-pathogen-quick-categories{grid-column:1/-1!important;grid-row:3!important;display:flex!important;flex-wrap:wrap!important;gap:6.58px!important;overflow:visible!important;min-width:0!important}
.fbp-pathogen-advanced{grid-column:1/-1!important;grid-row:4!important;display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:9.4px!important;align-items:end!important;padding:13.16px!important;overflow:hidden!important;box-sizing:border-box!important}
.fbp-pathogen-advanced[hidden]{display:none!important}
.fbp-pathogen-advanced label{display:grid!important;grid-template-rows:auto 44px!important;gap:5.64px!important;min-width:0!important;max-width:100%!important;margin:0!important;overflow:hidden!important}
.fbp-pathogen-advanced label:nth-of-type(5){grid-column:5/7!important}
.fbp-pathogen-advanced input,.fbp-pathogen-advanced select{width:100%!important;min-width:0!important;max-width:100%!important;height:41.36px!important;box-sizing:border-box!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;font-size:12px!important}
.fbp-pathogen-advanced p{grid-column:1/-1!important;margin:1.88px 0 0!important;min-width:0!important;overflow-wrap:anywhere!important}
.fbp-pathogen-result-count{grid-column:1/-1!important;grid-row:5!important;justify-self:end!important;margin:0!important;padding:0 1.88px!important}
/* Card actions aligned at the absolute bottom of every card. */
.fbp-pathogen-card{display:flex!important;flex-direction:column!important;height:100%!important;min-width:0!important}
.fbp-pathogen-card .fbp-library-view{margin-top:auto!important;align-self:flex-start!important}
.fbp-pathogen-card>.fbp-primary:last-child,.fbp-pathogen-card>button:last-child{margin-top:auto!important;align-self:flex-start!important}

/* -------------------------------------------------------------------------
 * Shared maps filters. Product hierarchy, pathogen and free text are row 1;
 * actions are row 2 and can never cover an input.
 * ---------------------------------------------------------------------- */
.fbp-map-shared-filters{
  display:grid!important;
  grid-template-columns:repeat(12,minmax(0,1fr))!important;
  grid-template-rows:auto auto!important;
  gap:9.4px 11.28px!important;
  align-items:end!important;
  overflow:visible!important;
  padding:13.16px!important;
  box-sizing:border-box!important;
}
.fbp-map-shared-filters>*{min-width:0!important;max-width:100%!important;box-sizing:border-box!important;position:relative!important;margin:0!important}
.fbp-map-shared-filters>.fbp-outbreak-product-wrap{grid-column:1/6!important;grid-row:1!important}
.fbp-map-shared-filters>label:nth-of-type(1){grid-column:6/9!important;grid-row:1!important}
.fbp-map-shared-filters>label:nth-of-type(2){grid-column:9/13!important;grid-row:1!important}
.fbp-map-shared-filters>.fbp-map-search-both{grid-column:7/9!important;grid-row:2!important}
.fbp-map-shared-filters>.fbp-outbreak-current{grid-column:9/11!important;grid-row:2!important}
.fbp-map-shared-filters>.fbp-outbreak-show-all{grid-column:11/13!important;grid-row:2!important}
.fbp-map-shared-filters>button{width:100%!important;min-width:0!important;max-width:100%!important;white-space:normal!important}

/* USA map internal filter controls remain legible even in the half-width panel. */
.fbp-map-controls{display:grid!important;grid-template-columns:minmax(190px,.9fr) minmax(0,1.5fr)!important;gap:9.4px!important;align-items:center!important;overflow:visible!important;min-width:0!important}
.fbp-map-controls>label{min-width:0!important;max-width:100%!important}
.fbp-map-controls select{width:100%!important;min-width:0!important;max-width:100%!important}
.fbp-map-metrics{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:5.64px!important;min-width:0!important;max-width:100%!important}
.fbp-map-metrics button{min-width:0!important;max-width:100%!important;padding:8.46px 6.58px!important;font-size:11px!important;line-height:1.15!important;white-space:normal!important;overflow-wrap:anywhere!important}
.fbp-map-statbar{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:7.52px!important;min-width:0!important}
.fbp-map-statbar>span{min-width:0!important;padding:9.4px 7.52px!important}.fbp-map-statbar small{white-space:normal!important;overflow-wrap:anywhere!important}

/* EU metric bar and tooltips. The last metric (Deaths) must always fit. */
.fbp-eu-map-controls{display:flex!important;align-items:center!important;flex-wrap:wrap!important;gap:6.58px!important;min-width:0!important;max-width:100%!important;overflow:visible!important;padding:8.46px 9.4px!important}
.fbp-eu-map-controls>span{flex:0 0 auto!important}.fbp-eu-map-controls button{flex:0 1 auto!important;min-width:86px!important;max-width:100%!important;padding:7.52px 11.28px!important;white-space:nowrap!important}
.leaflet-tooltip.fbp-map-tooltip{max-width:min(390px,calc(100vw - 40px))!important;white-space:normal!important;overflow:visible!important}
.fbp-map-tip{min-width:230px!important;max-width:360px!important;white-space:normal!important;line-height:1.4!important;overflow-wrap:anywhere!important}
.fbp-map-tip>span{display:block!important;white-space:normal!important;overflow-wrap:anywhere!important;margin-top:3.76px!important}
.fbp-map-tip>div{display:flex!important;align-items:baseline!important;gap:9.4px!important;min-width:0!important}.fbp-map-tip>div small{white-space:normal!important}

/* -------------------------------------------------------------------------
 * Evidence Explorer. Two stable rows: category/product + query, then sources
 * + actions. Food selection can trigger search without the far-right button.
 * ---------------------------------------------------------------------- */
.fbp-evidence-toolbar{
  display:grid!important;
  grid-template-columns:minmax(410px,1.25fr) minmax(320px,1fr)!important;
  gap:9.4px 13.16px!important;
  align-items:end!important;
  overflow:visible!important;
  padding:13.16px!important;
  box-sizing:border-box!important;
}
.fbp-evidence-toolbar>*{min-width:0!important;max-width:100%!important;box-sizing:border-box!important;margin:0!important;position:relative!important}
.fbp-evidence-toolbar>.fbp-evidence-food-wrap{grid-column:1!important;grid-row:1!important}
.fbp-evidence-toolbar>label{grid-column:2!important;grid-row:1!important}
.fbp-evidence-source-tabs{grid-column:1!important;grid-row:2!important;display:flex!important;flex-wrap:wrap!important;gap:5.64px!important;align-self:center!important}
.fbp-evidence-toolbar-actions{grid-column:2!important;grid-row:2!important;display:flex!important;gap:6.58px!important;justify-content:flex-end!important;align-items:center!important;min-width:0!important}
.fbp-evidence-toolbar-actions button{flex:0 1 auto!important;min-width:120px!important;max-width:180px!important}
.fbp-evidence-context-note{padding:9.4px 11.28px!important;border:1px solid #e7d49b!important;border-radius:10.34px!important;background:#fff9e9!important;color:#6f5b27!important;line-height:1.5!important;margin:7.52px 0 11.28px!important}
.fbp-evidence-broader{margin:13.16px 0!important;border:1px solid #dbe4f2!important;border-radius:13.16px!important;background:#fbfcff!important;padding:9.4px 11.28px!important}.fbp-evidence-broader>summary{cursor:pointer!important;color:#23457d!important;font-weight:850!important}.fbp-evidence-broader>summary span{display:inline-flex!important;min-width:26px!important;height:22.56px!important;align-items:center!important;justify-content:center!important;margin-left:6.58px!important;border-radius:939.06px!important;background:#edf3fc!important}
.fbp-evidence-match-scope{display:inline-flex!important;align-items:center!important;max-width:100%!important;padding:3.76px 6.58px!important;border-radius:939.06px!important;background:#edf4ff!important;color:#31588f!important;font-size:9.5px!important;font-weight:800!important;white-space:normal!important}

/* -------------------------------------------------------------------------
 * Regulatory Explorer. Category/product gets room; text, binding and clear do
 * not share physical space.
 * ---------------------------------------------------------------------- */
.fbp-reg-search-surface{
  display:grid!important;
  grid-template-columns:repeat(12,minmax(0,1fr))!important;
  grid-template-rows:auto auto!important;
  gap:9.4px 11.28px!important;
  align-items:end!important;
  overflow:visible!important;
  padding:13.16px!important;
  box-sizing:border-box!important;
}
.fbp-reg-search-surface>*{min-width:0!important;max-width:100%!important;box-sizing:border-box!important;position:relative!important;margin:0!important;left:auto!important;right:auto!important;top:auto!important;transform:none!important}
.fbp-reg-search-surface>.fbp-reg-food-wrap{grid-column:1/6!important;grid-row:1!important}
.fbp-reg-search-surface>label:nth-of-type(1){grid-column:6/10!important;grid-row:1!important}
.fbp-reg-search-surface>label:nth-of-type(2){grid-column:10/13!important;grid-row:1!important}
.fbp-reg-search-surface>.fbp-reg-clear{grid-column:10/13!important;grid-row:2!important;width:100%!important;min-width:0!important}
.fbp-reg-search-surface select,.fbp-reg-search-surface input{width:100%!important;min-width:0!important;max-width:100%!important;box-sizing:border-box!important}

/* -------------------------------------------------------------------------
 * Environmental Monitoring and Sampling product selectors use the same stable
 * category-first geometry.
 * ---------------------------------------------------------------------- */
.fbp-env-profile-actions{display:grid!important;grid-template-columns:minmax(480px,1fr) minmax(230px,auto)!important;gap:11.28px!important;align-items:end!important;min-width:0!important;width:100%!important;overflow:visible!important}
.fbp-env-profile-actions>*{min-width:0!important;max-width:100%!important;box-sizing:border-box!important}.fbp-env-profile-actions>.fbp-environment-profile-run{width:100%!important;min-height:41.36px!important;white-space:normal!important}
.fbp-sampling-search-surface{display:grid!important;grid-template-columns:minmax(450px,1.25fr) minmax(360px,1fr) auto!important;gap:11.28px!important;align-items:end!important;overflow:visible!important}.fbp-sampling-search-surface>*{min-width:0!important;max-width:100%!important;box-sizing:border-box!important}.fbp-sampling-result-count{align-self:center!important;white-space:nowrap!important}

/* -------------------------------------------------------------------------
 * Analysis header: keep the good structure but reduce unused hero height and
 * make the current product unmistakable.
 * ---------------------------------------------------------------------- */
body.fbp-analysis-context .fbp-topbar-v171{padding-top:13.16px!important;padding-bottom:9.4px!important;row-gap:7.52px!important}
body.fbp-analysis-context .fbp-brand-intro p{margin-top:6.58px!important;margin-bottom:6.58px!important;max-width:760px!important}
body.fbp-analysis-context .fbp-scope-note-v171{margin-top:5.64px!important}
.fbp-analysis-shell-head{min-height:50.76px!important;padding:8.46px 13.16px!important;gap:11.28px!important;align-items:center!important}.fbp-analysis-shell-head>div{display:grid!important;grid-template-columns:auto minmax(0,1fr)!important;align-items:center!important;gap:7.52px!important;min-width:0!important}.fbp-analysis-shell-head small{white-space:nowrap!important;margin:0!important}.fbp-analysis-shell-head strong{display:inline-flex!important;align-items:center!important;min-width:0!important;max-width:100%!important;padding:3.76px 8.46px!important;border-radius:939.06px!important;background:rgba(255,255,255,.14)!important;font-size:12px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}

/* -------------------------------------------------------------------------
 * Moderate responsive steps. We wrap BEFORE controls collide, not after.
 * ---------------------------------------------------------------------- */
@media(max-width:1450px){
  .fbp-pathogen-search-surface{grid-template-columns:minmax(320px,1.6fr) minmax(180px,.8fr) minmax(190px,.85fr)!important}
  .fbp-pathogen-advanced{grid-template-columns:repeat(3,minmax(0,1fr))!important}.fbp-pathogen-advanced label:nth-of-type(5){grid-column:2/4!important}
  .fbp-map-shared-filters>.fbp-outbreak-product-wrap{grid-column:1/7!important}.fbp-map-shared-filters>label:nth-of-type(1){grid-column:7/10!important}.fbp-map-shared-filters>label:nth-of-type(2){grid-column:10/13!important}.fbp-map-shared-filters>.fbp-map-search-both{grid-column:7/9!important}.fbp-map-shared-filters>.fbp-outbreak-current{grid-column:9/11!important}.fbp-map-shared-filters>.fbp-outbreak-show-all{grid-column:11/13!important}
  .fbp-map-controls{grid-template-columns:1fr!important}.fbp-map-metrics{grid-template-columns:repeat(4,minmax(0,1fr))!important}
}
@media(max-width:1180px){
  .fbp-pathogen-search-surface{grid-template-columns:repeat(2,minmax(0,1fr))!important}.fbp-pathogen-search-surface>.fbp-search-field{grid-column:1/-1!important}.fbp-pathogen-search-surface>label:nth-of-type(1){grid-column:1!important;grid-row:2!important}.fbp-pathogen-search-surface>label:nth-of-type(2){grid-column:2!important;grid-row:2!important}.fbp-pathogen-search-actions{grid-row:3!important}.fbp-pathogen-quick-categories{grid-row:4!important}.fbp-pathogen-advanced{grid-row:5!important}.fbp-pathogen-result-count{grid-row:6!important}
  .fbp-map-shared-filters>.fbp-outbreak-product-wrap{grid-column:1/7!important}.fbp-map-shared-filters>label:nth-of-type(1){grid-column:7/13!important}.fbp-map-shared-filters>label:nth-of-type(2){grid-column:1/13!important;grid-row:2!important}.fbp-map-shared-filters>.fbp-map-search-both{grid-column:5/7!important;grid-row:3!important}.fbp-map-shared-filters>.fbp-outbreak-current{grid-column:7/10!important;grid-row:3!important}.fbp-map-shared-filters>.fbp-outbreak-show-all{grid-column:10/13!important;grid-row:3!important}
  .fbp-evidence-toolbar{grid-template-columns:1fr!important}.fbp-evidence-toolbar>.fbp-evidence-food-wrap,.fbp-evidence-toolbar>label,.fbp-evidence-source-tabs,.fbp-evidence-toolbar-actions{grid-column:1!important;grid-row:auto!important}.fbp-evidence-toolbar-actions{justify-content:flex-start!important}
  .fbp-reg-search-surface>.fbp-reg-food-wrap{grid-column:1/7!important}.fbp-reg-search-surface>label:nth-of-type(1){grid-column:7/13!important}.fbp-reg-search-surface>label:nth-of-type(2){grid-column:1/7!important;grid-row:2!important}.fbp-reg-search-surface>.fbp-reg-clear{grid-column:7/13!important;grid-row:2!important}
  .fbp-env-profile-actions,.fbp-sampling-search-surface{grid-template-columns:1fr!important}.fbp-env-profile-actions>*,.fbp-sampling-search-surface>*{grid-column:1!important}
}
@media(max-width:760px){
  .fbp-food-hierarchy-search{grid-template-columns:1fr!important}.fbp-food-hierarchy-search>.fbp-food-category-field,.fbp-food-hierarchy-search>.fbp-food-product-field,.fbp-food-hierarchy-search>.fbp-search-with-clear{grid-column:1!important;grid-row:auto!important}.fbp-food-hierarchy-search>.fbp-async-food-menu{grid-column:1!important}
  .fbp-pathogen-search-surface{grid-template-columns:1fr!important;padding:9.4px!important}.fbp-pathogen-search-surface>*{grid-column:1!important;grid-row:auto!important}.fbp-pathogen-search-actions{display:grid!important;grid-template-columns:1fr 1fr!important}.fbp-pathogen-search-actions button{min-width:0!important;max-width:none!important}.fbp-pathogen-advanced{grid-template-columns:1fr!important}.fbp-pathogen-advanced label:nth-of-type(5){grid-column:1!important}
  .fbp-map-shared-filters{grid-template-columns:1fr!important}.fbp-map-shared-filters>*{grid-column:1!important;grid-row:auto!important}.fbp-map-controls{grid-template-columns:1fr!important}.fbp-map-metrics{grid-template-columns:repeat(2,minmax(0,1fr))!important}.fbp-map-statbar{grid-template-columns:repeat(2,minmax(0,1fr))!important}.fbp-eu-map-controls button{flex:1 1 calc(50% - 7px)!important;min-width:0!important}
  .fbp-reg-search-surface{grid-template-columns:1fr!important}.fbp-reg-search-surface>*{grid-column:1!important;grid-row:auto!important}.fbp-reg-search-surface>.fbp-reg-clear{grid-column:1!important;grid-row:auto!important}
  .fbp-evidence-toolbar-actions{display:grid!important;grid-template-columns:1fr 1fr!important}.fbp-evidence-toolbar-actions button{max-width:none!important;width:100%!important}
  .fbp-analysis-shell-head>div{grid-template-columns:1fr!important;gap:2.82px!important}.fbp-analysis-shell-head strong{justify-self:start!important;max-width:100%!important}
}
