/* GALBC R9.71.33 — Responsive layout consolidation.
   Visual only: retain the original inputs, buttons, listeners, data, and calculations.
   This stylesheet loads AFTER all legacy and selector styles. */

/* A child may be a wide table, but it must not widen the entire document. */
#galbc-test #gt-main,
#galbc-test #gt-main .bi-dashboard,
#galbc-test #gt-main .bi-content,
#galbc-test #gt-main .bi-layout,
#galbc-test #gt-main .panel,
#galbc-test #gt-main .health-app,
#galbc-test #gt-main .compare113 {
  min-width:0; max-width:100%; box-sizing:border-box;
}

/* Analíticos uses one shared toolbar in Alimentación, Biomasa, Biometrías,
   Canastas, Agua, Comparativo de ciclos, Cosechas and other standard views.
   Old rules made its children display:contents with inflexible 180/132px widths.
   Restoring the actual wrappers prevents date fields from being clipped. */
#galbc-test #gt-main #an98-toolbar {
  display:flex!important; flex-direction:column!important; align-items:stretch!important;
  grid-template-columns:none!important; gap:10px!important;
  width:100%!important; max-width:100%!important; min-width:0!important;
  padding:10px 12px!important; box-sizing:border-box!important;
}
#galbc-test #gt-main #an98-toolbar .an98-left {
  display:flex!important; flex-flow:row wrap!important; gap:10px!important;
  min-width:0!important; width:100%!important; align-items:end!important;
}
#galbc-test #gt-main #an98-toolbar .an98-query,
#galbc-test #gt-main #an98-toolbar .an98-dates {
  display:flex!important; flex-flow:row wrap!important; align-items:end!important;
  gap:9px!important; min-width:0!important; max-width:100%!important;
}
#galbc-test #gt-main #an98-toolbar .an98-query > label {
  width:auto!important; min-width:0!important; max-width:100%!important;
  flex:0 1 200px!important;
}
#galbc-test #gt-main #an98-toolbar .an98-cycles {
  min-width:0!important; max-width:100%!important; flex:0 1 auto!important;
}
#galbc-test #gt-main #an98-toolbar .an98-cycles > [role=group] {
  display:flex!important; flex-flow:row nowrap!important; gap:5px!important;
  max-width:100%!important; overflow-x:auto!important;
}
#galbc-test #gt-main #an98-toolbar .an98-dates > label {
  width:auto!important; min-width:0!important; max-width:none!important;
  flex:1 1 154px!important;
}
#galbc-test #gt-main #an98-toolbar label > input,
#galbc-test #gt-main #an98-toolbar label > select {
  box-sizing:border-box!important; min-width:0!important; width:100%!important;
  max-width:100%!important;
}
#galbc-test #gt-main #an98-toolbar .an98-right {
  min-width:0!important; width:100%!important; max-width:100%!important;
  border-left:0!important; border-top:1px solid #e1eaf0!important;
  padding:8px 0 0!important; margin:0!important;
}
/* One continuous, independently swipeable farm/pond row, with the trigger
   immediately AFTER Raceways. Never a separate right-aligned slot. */
#galbc-test #gt-main #an98-toolbar .an98-right > [role=group] {
  display:flex!important; flex-flow:row nowrap!important; flex-wrap:nowrap!important;
  justify-content:flex-start!important; align-items:center!important;
  gap:5px!important; width:100%!important; max-width:100%!important;
  min-width:0!important; overflow-x:auto!important; overflow-y:hidden!important;
  box-sizing:border-box!important; padding:2px 0 7px!important;
  -webkit-overflow-scrolling:touch; overscroll-behavior-x:contain; scrollbar-width:thin;
}
#galbc-test #gt-main #an98-toolbar .an98-right > [role=group] > * {
  flex:0 0 auto!important; white-space:nowrap!important; min-width:0!important;
}
#galbc-test #gt-main #an98-toolbar #galbc-pond-selector121 {
  margin-left:0!important; order:initial!important; flex:0 0 auto!important;
}
/* The identical selector applies to Salud/Patología without reintroducing the sidebar. */
#galbc-test #gt-main .health-app.h-standard-analytics .h-standard-toolbar,
#galbc-test #gt-main .health-app.h-standard-analytics .h-standard-toolbar > .row {
  min-width:0!important; max-width:100%!important;
}
#galbc-test #gt-main.galbc-unified .health-app.h-standard-analytics .h-standard-toolbar > .row {
  display:flex!important; flex-flow:row nowrap!important;
  overflow-x:auto!important; overflow-y:hidden!important;
  width:100%!important; max-width:100%!important; scrollbar-width:thin;
  -webkit-overflow-scrolling:touch;
}
#galbc-test #gt-main .health-app .h-filters {min-width:0; max-width:100%;}
#galbc-test #gt-main .health-app .h-filters label {min-width:0; max-width:100%;}
#galbc-test #gt-main .health-app .h-filters :is(input,select) {min-width:0;max-width:100%;}

/* Capture's own control is already scrollable: retain this behavior even when
   the optional floating selector cannot be mounted (e.g. no available ponds). */
@media (max-width:820px) {
 #galbc-test #gt-main .bi-filters > .row {
  display:flex!important; flex-flow:row nowrap!important; flex-wrap:nowrap!important;
  align-items:center!important; justify-content:flex-start!important;
  min-width:0!important; width:100%!important; max-width:100%!important;
  overflow-x:auto!important; overflow-y:hidden!important; gap:5px!important;
  overscroll-behavior-x:contain; -webkit-overflow-scrolling:touch;
 }
 #galbc-test #gt-main .bi-filters > .row > * {
  flex:0 0 auto!important; white-space:nowrap!important;
 }
}
/* Phone layout: query/cycles on their own row and two date controls side-by-side.
   A single date takes full width; date inputs may shrink below their native min. */
@media (max-width:700px) {
 #galbc-test #gt-main #an98-toolbar {
  padding:9px 9px!important; gap:8px!important;
 }
 #galbc-test #gt-main #an98-toolbar .an98-left {
  display:grid!important; grid-template-columns:minmax(0,1fr)!important;
  gap:7px!important;
 }
 #galbc-test #gt-main #an98-toolbar .an98-query {
  display:flex!important; flex-wrap:wrap!important; gap:7px!important;
  width:100%!important;
 }
 #galbc-test #gt-main #an98-toolbar .an98-query > label {
  flex:1 1 145px!important; width:auto!important;
 }
 #galbc-test #gt-main #an98-toolbar .an98-cycles {
  flex:0 1 auto!important;
 }
 #galbc-test #gt-main #an98-toolbar .an98-dates {
  display:grid!important; grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:7px!important; width:100%!important;
 }
 #galbc-test #gt-main #an98-toolbar .an98-dates > label {
  display:flex!important; width:100%!important; flex:auto!important;
  min-width:0!important; max-width:100%!important;
 }
 #galbc-test #gt-main #an98-toolbar .an98-dates > label:only-child {
  grid-column:1 / -1;
 }
 #galbc-test #gt-main #an98-toolbar .an98-toolbar input,
 #galbc-test #gt-main #an98-toolbar .an98-dates input {
  min-width:0!important; max-width:100%!important; width:100%!important;
  padding:7px 5px!important; font-size:14px!important;
 }
 #galbc-test #gt-main #an98-toolbar .an98-right {padding-top:6px!important;}
 #galbc-test #gt-main :is(.scroll,.scroll106,.harvest-scroll,.bc40-table,.h-read-table,.ration-table) {
  max-width:100%!important; min-width:0!important; overflow-x:auto;
  -webkit-overflow-scrolling:touch; overscroll-behavior-x:contain;
 }
 #galbc-test #gt-main .compare113 :is(.cp-chart,.cmp115-card,.cp-plot,.cmp115-plot) {
  max-width:100%!important; min-width:0!important; box-sizing:border-box;
 }
 #galbc-test #gt-main .compare113 :is(svg,.cp-plot svg,.cmp115-plot svg) {
  max-width:100%!important;
 }
 /* Modal has its own scroll and does not extend past the viewport on rotation. */
 #galbc-pond-dialog121, .galbc-native-food-dialog121,
 .compare113-dialog, #pending-dialog {
  box-sizing:border-box!important; max-width:calc(100vw - 20px)!important;
  max-height:calc(100dvh - 22px)!important; overflow-y:auto!important;
 }
}
/* Tiny phones and browser text zoom: date fields stack rather than clip. */
@media (max-width:340px) {
 #galbc-test #gt-main #an98-toolbar .an98-dates {
  grid-template-columns:minmax(0,1fr)!important;
 }
}
/* Compare correlations and estimate vs. harvested: allow their native cards
   to use the width of the chart region, without altering their SVG datasets. */
#galbc-test #gt-main .compare113 .cmp115-card {
  max-width:100%!important; min-width:0!important;
}
#galbc-test #gt-main .compare113 .cmp115-legend {
  display:flex!important; flex-flow:row nowrap!important; flex-wrap:nowrap!important;
  max-width:100%!important; overflow-x:auto!important; overflow-y:hidden!important;
  white-space:nowrap!important; -webkit-overflow-scrolling:touch;
}
#galbc-test #gt-main .compare113 .cmp115-legend > * {
  flex:0 0 auto!important;
}
