/* ============================================================================
   ZC RESIZE FIX - shared stylesheet (R1).
   Everything below is copied BYTE-FOR-BYTE from sandbox/zcprobe/candidate.css,
   the block every measured verdict in sandbox/README.md was produced with; do
   not "tidy" it. Rule 5 (dashboard .chart-sq) does NOT belong here - it ships
   in css/dashboard.css, which only dashboard.asp loads.

   GATE DISCIPLINE: rules 1-3 are GLOBAL and reach every page that includes
   bs5/i_head.asp (~342 files, most of them never benched). Only the height
   chain in rule 4 is opt-in via body.zc-fill.

   CASCADE POSITION WAS MEASURED, NOT ASSUMED: injecting this block inside
   <head> - where the <link> lands, i.e. BEFORE the page-level css/style.css and
   inline <style> that would win specificity ties - versus appending it after
   </head> (how the probes used to inject it) gives the identical 53/60 sweep and
   identical 7 failure signatures. See ZCCSS=head in zcprobe/css.js, 2026-10-10.

   REVERT = delete the one <link> line in bs5/i_head.asp. This file may stay,
   unreferenced and harmless.
   ==========================================================================*/

/* ============================================================================
   RESIZE FIX — candidate change (measured, see ../DESIGN_REFRESH_NOTES.md
   "RESIZE ANALYSIS"). This file is the proposal; probes inject it into every
   frame so the numbers are reproducible. GATE DISCIPLINE: rules 1-3 are
   GLOBAL (they apply to every page the stylesheet reaches); only the height
   chain in rule 4 is opt-in via body.zc-fill.
   ==========================================================================*/

/* 1. iframes are inline-replaced elements: a 7px line-box descender sits under
      EVERY frame on the site (.tabdiv scrollHeight = clientHeight + 7, always).
      Today the pin arithmetic absorbs it; remove the arithmetic without this and
      every host gains a phantom vertical scrollbar. */
iframe { display: block; }

/* 2. The "+12px at rest" class: Bootstrap .row negative gutters with nothing to
      absorb them. Dominant cause is DataTables' own dom row inside the DT3
      container. Zeroing the GUTTER (not just the margin) keeps every pixel where
      it is today -- measured: buttons x=0, search x=1090, cells x=14 unchanged. */
.dt-container > .row,
.dataTables_wrapper > .row { --bs-gutter-x: 0; margin-left: 0 !important; margin-right: 0 !important; }

/* 3. Same disease where a page put .row directly on body, or zeroed a container's
      gutter padding inline. Plain margin-zero is the right form here (no col-width
      children depend on the padding), and it is what the wallboards need. */
body > .row,
[style*="padding: 0"] > .row { margin-left: 0 !important; margin-right: 0 !important; }

/* 4. Height chain, opt-in. :has() is fine -- modern browsers only (owner). */
html:has(body.zc-fill),
html:has(body.zc-fill) body { height: 100%; }

body.zc-fill { margin: 0; display: flex; flex-direction: column; }
/* Neutralize every body-child by default. An inline height:100% or .h-100
 * wrapper ABOVE the layers is inert today (no definite body height) but ARMS
 * the moment zc-fill gives body one - it then eats the viewport and its flex:1
 * layer collapses to 0 or the page gains a phantom scrollbar (measured: status
 * h=0 at y=720, addEvent +24 phantom, workload -56 slack). Rules 4a/4b/4c/4d
 * re-assert the real layers at higher specificity (id/class beat bare > *),
 * so this single line is the whole content-above-the-layers fix. */
body.zc-fill > * { flex: 0 0 auto; height: auto !important; }

/* 4a. shell (index.asp). MEASURED STRUCTURE, not assumption: the navbar lives inside
       form#f, and the .tabdiv layers are SIBLINGS of the form (children of body), so the
       form must keep its natural height and the layers take the remainder. An earlier
       draft of this rule gave form#f height:100%, which pushed every layer 640px below
       the fold -- the hand-written shell fixture had the nesting wrong and hid it. */
body.zc-fill > form#f { flex: 0 0 auto; height: auto; }
body.zc-fill form#f > nav.navbar { flex: 0 0 auto; }
body.zc-fill > .tabdiv { flex: 1 1 auto; min-height: 0; height: auto !important; }
body.zc-fill .tabiframe,
body.zc-fill #woframe,
body.zc-fill #contentiframe { width: 100% !important; height: 100% !important; }

/* 4b. frame-layer hosts. The id list is the closed vocabulary the site actually
       uses (measured: report/detail/filter/parameters/edit/zones/instructions/
       blobFrame/dptFrame/assignFrame/tasksFrame/targetFrame/amFrame/blob/content/map).
       flex:1 + min-height:0 handles hosts that have a toolbar or heading above the
       layers, which plain height:100% gets wrong (status.asp: +60px at rest).
       !important is the transition lever: it beats the inline px the legacy pin
       blocks still write, so pages can be migrated one at a time. Precedent already
       in the repo: absences.asp ships height:100vh !important the same way. */
body.zc-fill > iframe#report, body.zc-fill > iframe#detail, body.zc-fill > iframe#filter,
body.zc-fill > iframe#parameters, body.zc-fill > iframe#edit, body.zc-fill > iframe#zones,
body.zc-fill > iframe#instructions, body.zc-fill > iframe#blobFrame, body.zc-fill > iframe#dptFrame,
body.zc-fill > iframe#assignFrame, body.zc-fill > iframe#tasksFrame, body.zc-fill > iframe#targetFrame,
body.zc-fill > iframe#amFrame, body.zc-fill > iframe#staffFrame, body.zc-fill > iframe#editFrame,
body.zc-fill > iframe#blob,
body.zc-fill > iframe#content,
body.zc-fill > iframe#map {
  flex: 1 1 auto; min-height: 0; width: 100% !important; height: auto !important;
}

/* 4c. .frame-stack hosts (tasks.asp pilot): layers are already absolute +
       visibility:hidden, only the stack's height source changes. The scroll-
       position mechanism is deliberately untouched. */
body.zc-fill > .frame-stack,
body.zc-fill .frame-stack { flex: 1 1 auto; min-height: 0; height: 100% !important; }
body.zc-fill > div#frames { flex: 1 1 auto; min-height: 0; height: 100% !important; }

/* 4a-2: folded into the general child neutralizer above. */

/* 4d. non-frame targets that need the same treatment (healthReport #map,
       library #blob). Verify each live -- a Google Maps container tolerates CSS
       sizing but tile repainting is a live-only check. */
body.zc-fill > div#map, body.zc-fill > div#blob { flex: 1 1 auto; min-height: 0; }
