/*
 * FoodBorne Pathogen Guide v0.19.5 - containment trial
 * Base: user-approved v0.19.4.
 * Purpose: remove right-side clipping without globally scaling the GUI.
 * Scientific calculations, datasets, table content and external application bounds are unchanged.
 */

/* Internal sections must use the width actually provided by the plugin shell, never a second viewport width. */
.fbp-analysis-shell,
.fbp-results-panel,
.fbp-static-diagnostics,
.fbp-app-main{
  box-sizing:border-box!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  margin-left:auto!important;
  margin-right:auto!important;
}

.fbp-workspace,
.fbp-tool-view,
.fbp-library-shell,
.fbp-library-sampling,
.fbp-results-panel,
.fbp-static-diagnostics,
.fbp-analysis-shell,
.fbp-risk-legend,
.fbp-scoring-algorithm{
  box-sizing:border-box!important;
  min-width:0!important;
  max-width:100%!important;
}

/* The old clip rule hid content. Child components now own their overflow explicitly. */
.fbp-workspace{overflow-x:visible!important}

/* Risk-class cards: preserve readable card sizes and reflow instead of clipping the last card. */
.fbp-results-panel .fbp-kpis{
  display:grid!important;
  grid-template-columns:repeat(6,minmax(0,1fr))!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
}
.fbp-results-panel .fbp-kpi{min-width:0!important;max-width:100%!important}
.fbp-results-panel .fbp-kpi>*{min-width:0!important;max-width:100%!important}

/* Evidence summary cards: same containment principle. */
.fbp-analysis-evidence-usage{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
}
.fbp-analysis-evidence-bubble{min-width:0!important;max-width:100%!important;overflow-wrap:anywhere!important}

/* Risk legend and 5x5 matrix: no hidden fifth column. */
.fbp-risk-legend-grid{
  grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(340px,1.15fr)!important;
  width:100%!important;
  min-width:0!important;
}
.fbp-risk-legend-grid>div{min-width:0!important;max-width:100%!important;overflow:hidden!important}
.fbp-risk-legend .fbp-matrix{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  table-layout:fixed!important;
  border-collapse:collapse!important;
}
.fbp-risk-legend .fbp-matrix th,
.fbp-risk-legend .fbp-matrix td{
  min-width:0!important;
  width:auto!important;
  padding-left:6px!important;
  padding-right:6px!important;
  text-align:center!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.fbp-risk-legend .fbp-matrix th:first-child{width:42%!important;text-align:center!important}
.fbp-risk-legend .fbp-matrix+ p{display:flex!important;flex-wrap:wrap!important;gap:6px!important;max-width:100%!important}

/* Scientific Wide Table: one authoritative geometry and horizontal scrolling only inside the table. */
.fbp-results-panel .fbp-table-wrap{
  display:block!important;
  box-sizing:border-box!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  max-height:none!important;
  overflow-x:auto!important;
  overflow-y:visible!important;
  overscroll-behavior-inline:contain!important;
  -webkit-overflow-scrolling:touch!important;
  scrollbar-gutter:stable!important;
}
.fbp-results-panel .fbp-risk-table{
  display:table!important;
  width:max(100%,1660px)!important;
  min-width:1660px!important;
  max-width:none!important;
  table-layout:fixed!important;
  border-collapse:separate!important;
  border-spacing:0!important;
}
.fbp-results-panel .fbp-risk-table thead{display:table-header-group!important}
.fbp-results-panel .fbp-risk-table tbody{display:table-row-group!important}
.fbp-results-panel .fbp-risk-table tr{display:table-row!important;width:auto!important}
.fbp-results-panel .fbp-risk-table th,
.fbp-results-panel .fbp-risk-table td{
  display:table-cell!important;
  box-sizing:border-box!important;
  min-width:0!important;
  max-width:none!important;
  width:auto!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
}
.fbp-results-panel .fbp-risk-table col.c-hazard{width:13%!important}
.fbp-results-panel .fbp-risk-table col.c-limits{width:6%!important}
.fbp-results-panel .fbp-risk-table col.c-growth{width:8%!important}
.fbp-results-panel .fbp-risk-table col.c-controls{width:6%!important}
.fbp-results-panel .fbp-risk-table col.c-persistence{width:6%!important}
.fbp-results-panel .fbp-risk-table col.c-frequency{width:22%!important}
.fbp-results-panel .fbp-risk-table col.c-severity{width:10%!important}
.fbp-results-panel .fbp-risk-table col.c-risk{width:9%!important}
.fbp-results-panel .fbp-risk-table col.c-legal{width:20%!important}

/* Sticky identity and evidence columns for wide-table navigation. */
@media (min-width:1200px){
  .fbp-results-panel .fbp-risk-table th:first-child,
  .fbp-results-panel .fbp-risk-table td:first-child{
    position:sticky!important;
    left:0!important;
    z-index:12!important;
    background:#fff!important;
    box-shadow:7px 0 14px rgba(20,51,101,.09)!important;
  }
  .fbp-results-panel .fbp-risk-table thead th:first-child{
    z-index:32!important;
    background:#eaf0f8!important;
  }
  .fbp-results-panel .fbp-risk-table th:last-child,
  .fbp-results-panel .fbp-risk-table td:last-child{
    position:sticky!important;
    right:0!important;
    z-index:11!important;
    background:#fff!important;
    box-shadow:-7px 0 14px rgba(20,51,101,.09)!important;
  }
  .fbp-results-panel .fbp-risk-table thead th:last-child{
    z-index:31!important;
    background:#eaf0f8!important;
  }
}

/* Synchronized top scrollbar inserted by public-containment-v195.js. */
.fbp-table-scroll-top{
  display:none;
  box-sizing:border-box;
  width:100%;
  max-width:100%;
  height:18px;
  overflow-x:auto;
  overflow-y:hidden;
  margin:0 0 7px;
  border:1px solid #dce4ef;
  border-radius:8px;
  background:#f2f6fb;
  scrollbar-color:#8192aa #edf2f7;
}
.fbp-table-scroll-top.is-scrollable{display:block}
.fbp-table-scroll-top>div{height:1px;min-width:100%}
.fbp-table-scroll-top::-webkit-scrollbar,
.fbp-results-panel .fbp-table-wrap::-webkit-scrollbar{height:12px}
.fbp-table-scroll-top::-webkit-scrollbar-track,
.fbp-results-panel .fbp-table-wrap::-webkit-scrollbar-track{background:#edf2f7;border-radius:999px}
.fbp-table-scroll-top::-webkit-scrollbar-thumb,
.fbp-results-panel .fbp-table-wrap::-webkit-scrollbar-thumb{background:#8192aa;border:3px solid #edf2f7;border-radius:999px}

/* Risk Analysis workspace: actions and tabs no longer compete for the same horizontal line. */
.fbp-analysis-shell-head{
  box-sizing:border-box!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:center!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
}
.fbp-analysis-shell-head>div:first-child{min-width:0!important}
.fbp-analysis-shell-actions{
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:8px!important;
  min-width:0!important;
  max-width:100%!important;
}
.fbp-analysis-shell-actions>*{
  box-sizing:border-box!important;
  min-width:0!important;
  max-width:100%!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
}
.fbp-analysis-nav{
  box-sizing:border-box!important;
  display:grid!important;
  grid-template-columns:repeat(7,minmax(0,1fr))!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  overflow:visible!important;
}
.fbp-analysis-nav button{
  min-width:0!important;
  max-width:100%!important;
  width:100%!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
}

/* Algorithm cards: intentional 3x2 layout on normal desktop, 6 only on truly wide screens. */
.fbp-algo-steps{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  width:100%!important;
  min-width:0!important;
}
.fbp-algo-steps article{min-width:0!important;max-width:100%!important;overflow-wrap:anywhere!important}

/* General containment for panels known to carry long scientific text. */
.fbp-results-note,
.fbp-result-versionline,
.fbp-legal-cell,
.fbp-scientific-layers,
.fbp-evidence-card,
.fbp-frequency-why,
.fbp-severity-evidence{
  box-sizing:border-box!important;
  min-width:0!important;
  max-width:100%!important;
  overflow-wrap:anywhere!important;
}

/* Responsive reflow based on available viewport; no global visual scaling. */
@media (max-width:1680px){
  .fbp-results-panel .fbp-kpis{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .fbp-analysis-nav{grid-template-columns:repeat(4,minmax(0,1fr))!important}
}
@media (max-width:1500px){
  .fbp-analysis-evidence-usage{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .fbp-risk-legend-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .fbp-risk-legend-grid>div:nth-child(3){grid-column:1/-1!important}
  .fbp-risk-legend-grid>div:nth-child(3) .fbp-matrix{max-width:760px!important;margin-inline:auto!important}
}
@media (min-width:1840px){
  .fbp-algo-steps{grid-template-columns:repeat(6,minmax(0,1fr))!important}
}
@media (max-width:1320px){
  .fbp-analysis-shell-head{grid-template-columns:1fr!important;align-items:start!important}
  .fbp-analysis-shell-actions{justify-content:flex-start!important;width:100%!important}
  .fbp-analysis-nav{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .fbp-algo-steps{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media (max-width:900px){
  .fbp-results-panel .fbp-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .fbp-analysis-evidence-usage{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .fbp-risk-legend-grid{grid-template-columns:1fr!important}
  .fbp-risk-legend-grid>div:nth-child(3){grid-column:auto!important}
  .fbp-analysis-nav{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .fbp-algo-steps{grid-template-columns:1fr!important}
  .fbp-results-panel .fbp-risk-table{width:1660px!important;min-width:1660px!important}
  .fbp-results-panel .fbp-risk-table th:last-child,
  .fbp-results-panel .fbp-risk-table td:last-child{position:static!important;box-shadow:none!important}
}
@media (max-width:560px){
  .fbp-results-panel .fbp-kpis,
  .fbp-analysis-evidence-usage,
  .fbp-analysis-nav{grid-template-columns:1fr!important}
  .fbp-analysis-shell-actions{display:grid!important;grid-template-columns:1fr!important}
  .fbp-analysis-shell-actions>*{width:100%!important;text-align:center!important;justify-content:center!important}
}
