/* layout.css (lane RSP, 2026-11-14; owner: "why is the system not screen optimized").
   LAYOUT ONLY: the page grid, containers, breakpoints, panel and column widths, map and canvas sizing, scroll regions, reading
   widths and stage heights of every redesigned screen (.ainx). Colour, type faces, tables, tiles, headers and legends belong to
   the component styles (redesign.css, tokens_p17.css and each view), not here.

   The screens write their layout as inline styles with fixed pixel values, so a rule here that changes one carries !important;
   that is the only reason the word appears. Every size class is one block:

     phone     up to 640 px    read only: one column, no 3D stage, every panel in reading order, the bar on two rows
     tablet    641 to 1100 px  the screen scrolls; the head is two columns; the map and the main list share a row, the rest follow
     laptop    1101 to 1799 px the design as drawn (1280, 1366, 1440, 1536), with panels kept inside their stage
     wide      1800 px and up  side panels and the reading text widen with the window, page screens keep a centred measure
     ultra     2300 px and up  the same, one step further

   Sizes checked by fcp/tests_p13_responsive.py and the walk responsive_census.js: 390, 1024, 1280, 1366, 1440, 1536, 1920, 2560. */

:root{
  /* the tokens: one place for every layout length */
  --lay-pad:14px;                              /* the screen's gutter */
  --lay-gap:12px;                              /* between panels */
  --lay-rail:330px;                            /* a side list on a map stage (Nation) */
  --lay-rail-list:360px;                       /* the work list beside a map (Your accounts, Alerts) */
  --lay-rail-card:380px;                       /* the open card beside a map */
  --lay-panel:610px;                           /* the wide list panel on a state stage */
  --lay-read:72ch;                             /* the longest line of reading text */
  --lay-page:1760px;                           /* the widest a page screen (no map) grows */
  --lay-stage-h:clamp(300px,52vh,640px);       /* a map stage when the screen scrolls */
  --lay-panel-h:min(72vh,640px);               /* a stacked panel that keeps its own scroll */
  --lay-head-h:min(44vh,380px);                /* a head of cells when the screen scrolls */
}
/* lane OP3: on a laptop under 1500 px the Nation rails give the map 60 px (the national map was a thumbnail at 1280 and 1366) */
@media (min-width:1101px) and (max-width:1500px){:root{--lay-rail:300px}}
@media (min-width:1800px){:root{--lay-pad:16px;--lay-gap:14px;--lay-rail:370px;--lay-rail-list:400px;--lay-rail-card:440px;--lay-panel:680px}}
@media (min-width:2300px){:root{--lay-pad:20px;--lay-gap:16px;--lay-rail:440px;--lay-rail-list:460px;--lay-rail-card:520px;--lay-panel:820px}}

/* ---------- every size ---------- */
/* the gutter and the gap follow the tokens (14 and 12 px on a laptop, as drawn) */
.ainx[style*="left:0;right:0;bottom:0"]{padding:var(--lay-pad)!important;gap:var(--lay-gap)!important}
/* reading text never runs past the measure, however wide its cell */
.ainx [data-ainx-snote],.ainx [data-ainx-hero-note],.ainx [data-ainx-windownote],.ainx [data-ns-lead],.ainx [data-ns-why],.ainx [data-ns-rules],.ainx [data-ainx-readas],
.ainx [data-ainx-boundary] [data-ainx-stagebar]+div,.ainx [data-cmh] p,.ainx [data-cmh-note]{max-width:var(--lay-read)}
/* lane OP3: the named reading blocks keep to the measure (census op3_before: 97 to 209 characters at 1920 and 2560); the note and caption
   blocks matched by their ink are in views/answer.css, since a layout rule names no colour */
.ainx .ax-sub,.ainx .ax-note,.ainx [data-ainx-dclaim],.ainx [data-ainx-dscope],.ainx [data-ainx-askmeans]{max-width:var(--lay-read)}
/* the full national map: the key keeps to the open middle, clear of the events list on the right (census at 1920 and 2560) */
@media (min-width:1101px){#ainx-nation .w5-full [data-ainx-maplegend]{left:calc(var(--lay-rail) + 16px)!important;right:auto!important;max-width:min(600px,calc(100% - 2 * var(--lay-rail) - 32px))!important}}
/* a panel on a stage never grows past the stage: it scrolls inside itself */
.ainx>section>.glass[style*="position:absolute"][style*="top:"]:not([style*="bottom:"]):not([style*="max-height"]){max-height:calc(100% - 52px);overflow-y:auto}
/* the bar: the path gives way before the search or the actions do */
.ainx .cbar .crumbs{flex:0 1 auto}
.ainx .cbar .cb-search{min-width:0!important;flex:1 1 300px!important;max-width:460px}
.ainx .cbar .cb-search input{min-width:48px}

/* ---------- wide and ultra: side panels follow the tokens, page screens keep a measure ---------- */
@media (min-width:1800px){
  /* Nation: the two side panels follow the rail token from 1101 px up (the rule is in the laptop block below) */
  /* State: the list panel */
  #ainx-state .ainx>section>.glass[style*="width:610px"]{width:var(--lay-panel)!important}
  /* Your accounts and Alerts: the work list, the open card, and the plain map between them */
  .ainx [data-ainx-acstage]>[data-ainx-occlude][style*="width:360px"],.ainx [data-ns-stage]>[data-ainx-occlude][style*="width:360px"]{width:var(--lay-rail-list)!important}
  .ainx [data-ainx-acstage]>[data-ainx-occlude][style*="width:380px"],.ainx [data-ns-stage]>[data-ainx-occlude][style*="width:380px"]{width:var(--lay-rail-card)!important}
  .ainx [data-ainx-mapfallback],.ainx [data-ns-mapfallback]{left:calc(var(--lay-rail-list) + 30px)!important;right:calc(var(--lay-rail-card) + 30px)!important}
  /* page screens (no map): the content keeps a centred measure instead of stretching */
  .ainx[data-ainx-teamscreen]>*,.ainx[data-ainx-scorecardscreen]>*,.ainx[data-ainx-casescreen]>*,.ainx[data-ainx-askscreen]>*,.ainx[data-ainx-boundary]>*,.ainx[data-ainx-diseasescreen]>*,.ainx[data-ainx-impactscreen]>*>*{width:100%;max-width:var(--lay-page);margin-left:auto!important;margin-right:auto!important}
  .ainx[data-ainx-impactscreen]>[data-imp-cascade]{max-width:none}
  .ainx [data-cmh]{max-width:var(--lay-page);margin-left:auto;margin-right:auto}
}

/* ---------- wide and ultra: a page screen with no drawing scales up as a whole (lane OP3) ----------
   Census op3_before: at 1920 and 2560 Alerts, Cases, Team, Event impact, Disease outlook and the commodity Home left 26 to 50 percent of
   the width unused with 13 px text on a 27 inch screen. A centred measure alone keeps the emptiness; the house type at 1920 and 2560
   is the laptop type made larger, so the page reads at the same distance and fills its width. Never on a screen holding a canvas (the
   3D stage sizes its drawing buffer from its box and is left as it is). */
@media (min-width:1800px){
  .ainx:is([data-ainx-teamscreen],[data-ainx-scorecardscreen],[data-ainx-casescreen],[data-ainx-askscreen],[data-ainx-boundary],[data-ainx-diseasescreen],[data-ainx-impactscreen],[data-ainx-alertsscreen]):not(:has(canvas)){zoom:1.14}
  body.cmh-on main{max-width:min(2240px,calc(100vw - 48px))!important}   /* the commodity Home is in the page flow, not a fixed screen: it widens instead of scaling (a scaled page ran off the right edge) */
}
@media (min-width:2300px){
  .ainx:is([data-ainx-teamscreen],[data-ainx-scorecardscreen],[data-ainx-casescreen],[data-ainx-askscreen],[data-ainx-boundary],[data-ainx-diseasescreen],[data-ainx-impactscreen],[data-ainx-alertsscreen]):not(:has(canvas)){zoom:1.4}
  body.cmh-on main .ainx[data-cmh]{font-size:16.5px}   /* census 2026-11-15: 39 percent unused at 2560 at 15px */
  /* census gate 2026-11-14: at 2560 the 2240 px cap alone left 320 px empty and the page 41 percent unused; it follows the window */
  body.cmh-on main{max-width:calc(100vw - 48px)!important}
}

/* ---------- laptop and wider: a stage's floating controls keep to their own column ---------- */
@media (min-width:1101px){
  /* the bar (lane OP3, both judges round 1: the search was clipped and its Ctrl K hint ran into Watch): on a laptop the search keeps
     room for its scopes and its box; the late notice and the path give way first */
  .ainx .cbar .cb-search{min-width:330px!important;flex:0 1 460px!important}
  .ainx .cbar .crumbs{min-width:0}
  .ainx .cbar .crumbs li{min-width:0;flex:0 1 auto;overflow:hidden;text-overflow:ellipsis}
  .ainx .cbar .crumbs li button{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:220px;box-sizing:border-box}
  /* State: the "Who operates here" column keeps to the band (it asked for 220 px and the band cut its last rows) and scrolls inside it */
  #ainx-state [data-ainx-statehead]:not([data-ainx-headmin]) [data-ainx-actorcol]{min-height:0!important;height:100%}
  /* Nation (lane OP3, from wide only to every laptop width): the two side panels follow the rail token, and everything placed against
     them; the map is framed against the same token (nation.js fit.live), so the coasts stay in the open middle */
  #ainx-nation .ainx>section>[style*="width:330px"]{width:var(--lay-rail)!important}
  #ainx-nation .w5-att{left:calc(var(--lay-rail) + 12px)!important;right:calc(var(--lay-rail) + 12px)!important}
  #ainx-nation .ainx>section{--w5-lgl:calc(var(--lay-rail) + 16px);--w5-tbr:calc(var(--lay-rail) + 16px)}
  /* State (lane OP3, OPE request 2): the head band stays a band, not a page. It took 300 to 380 px of a laptop window and left the map
     a strip; each column now keeps to the band's height and scrolls on its own, so the map takes the stage */
  /* the band's height is fixed, not grown by the rows as they land: on a screen change it no longer jumps about 120 px at 400 ms */
  #ainx-state [data-ainx-statehead]:not([data-ainx-headmin]){height:clamp(168px,24vh,250px)!important;max-height:none!important;overflow:hidden!important}
  /* the band while the state is read has the same height and the same columns as the band that replaces it (motion clip c1: the
     reading band was about 90 px and four columns, the read one about 215 px and five, so the stage jumped down when the data landed) */
  #ainx-state [data-ainx-sloadhead]{height:clamp(168px,24vh,250px)!important;box-sizing:border-box;grid-template-columns:clamp(150px,12vw,300px) minmax(0,1fr) minmax(0,1.15fr) clamp(220px,17vw,300px) clamp(300px,22vw,360px)!important}
  #ainx-state [data-ainx-statehead]:not([data-ainx-headmin])>div{max-height:clamp(168px,24vh,250px);overflow-y:auto;overscroll-behavior:contain;box-sizing:border-box;padding-top:12px!important;padding-bottom:18px!important;
    -webkit-mask-image:linear-gradient(to bottom,#000 calc(100% - 16px),transparent);mask-image:linear-gradient(to bottom,#000 calc(100% - 16px),transparent)}
  /* State: the lens tabs stay one row. Placed by their centre, they were shrunk to the space right of that point and wrapped into
     the map key at 1280 and 1366 when a producer sheet was open; they take their own width (not re-measured since the sheet's
     width was changed in state.js on 2026-11-14) */
  #ainx-state .ainx>section>.pillnav[data-ainx-slenses]{width:max-content;flex-wrap:nowrap}
}
/* lane OP3: on a laptop window (900 px tall or less) the orientation line (roads, rivers, towns, zoom level) stood on the land of a short
   map, over the data (both judges, three rounds); the map keeps the land. The line stays on taller windows. */
@media (min-width:1101px) and (max-height:900px){.ainx [data-ainx-mapnote]{display:none!important}}
/* lane OP3 (census op3_before: Track record's figures under the fold at 1024 to 1366): the verdict of the open signal is one line, not two */
@media (max-height:860px){#ainx-scorecard [data-ns-lead]{font-size:24px!important;margin-top:6px!important}#ainx-scorecard [data-ns-card]>div.cond:nth-child(2){font-size:16px!important;line-height:1.25}}
/* The Nation dock's share is set in nation.js (36 percent since 2026-11-14, lane OPE; `--lay-dock-nation` is its hook). layout.css
   sets no share: a rule here that named the old 46 percent was removed when the view changed. */

/* ---------- laptop: 1280 is the narrowest the drawn design is held at ---------- */
@media (max-width:1320px){
  .ainx .cbar .cb-kbd{display:none}
  .ainx .cbar{gap:6px}
}

/* census gate 2026-11-14 (Disease outlook at 1024, reached with a long path): the search box shrank below its own scopes and box,
   which then ran under Watch. Keeping the box at its contents' width pushed the bar past 1024 on five screens, so on a tablet the
   scopes scroll inside the box (as on a phone) and the path's last step keeps a readable width */
@media (min-width:641px) and (max-width:1100px){
  .ainx .cbar .cb-search{overflow:hidden}
  .ainx .cbar .cb-search .cb-scope{overflow-x:auto;flex:0 1 auto;min-width:0;scrollbar-width:none}
  .ainx .cbar .cb-search input{flex:1 1 48px}
  /* the step's box holds its separator mark too (Your accounts at 1024, measured: the 72 px box plus the 18 px mark ran 18 px past the
     124 px list), so the box is the button's 72 px plus room for the mark */
  .ainx .cbar .crumbs li:last-child,.ainx .cbar .crumbs li:has(>button.cur){min-width:96px;max-width:220px}
  .ainx .cbar .crumbs button.cur{min-width:72px}
  /* the earlier steps give way first (Disease outlook at 1024, measured: the 109 px list held "Nation", which could not shrink, so
     the current step was pushed 34 px past the list's edge); the list keeps room for the current step */
  .ainx .cbar ol.crumbs{min-width:104px}
  .ainx .cbar .crumbs li:not(:last-child):not(:has(>button.cur)){min-width:0;flex:0 1 auto;overflow:hidden}
  /* census 2026-11-15: an earlier step squeezed to 9 px helps no one; on a tablet the path shows its current step and Back leads up */
  .ainx .cbar .crumbs li:not(:last-child):not(:has(>button.cur)){display:none}
  .ainx .cbar .crumbs li:not(:last-child):not(:has(>button.cur)) button{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;box-sizing:border-box}
}

/* ---------- tablet (and phone): the screen scrolls and the stage is laid out in the page ---------- */
@media (max-width:1100px){
  :root{--lay-pad:10px;--lay-gap:10px}
  .ainx[style*="position:fixed"]{overflow-y:auto!important;overflow-x:hidden!important}
  /* the bar: the last two crumbs, a search that shrinks, no shortcut hint */
  .ainx .cbar .cb-kbd,.ainx .cbar .cb-sep{display:none}
  /* census gate 2026-11-14 (Disease outlook at 1024: the search ran under Watch): the path gives way here too, as on a laptop */
  .ainx .cbar .crumbs{min-width:0}
  .ainx .cbar .crumbs li:last-child button{white-space:nowrap}
  .ainx .cbar .crumbs li:nth-last-child(n+3){display:none}
  .ainx .cbar .crumbs li:nth-last-child(2)::before{display:none}
  .ainx .cbar .crumbs li:last-child{flex:0 1 auto;min-width:0}
  .ainx .cbar .crumbs li:last-child button{overflow:hidden;text-overflow:ellipsis;max-width:100%;box-sizing:border-box}
  .ainx .cbar .cb-scope button{padding:6px 5px}
  /* a head of three to five cells becomes two columns; a tall one scrolls inside itself so the answer below stays in reach */
  .ainx>[role=banner][style*="display:grid"],.ainx>[role=group][style*="display:grid"],.ainx>div>[role=banner][style*="display:grid"],.ainx>div>[role=group][style*="display:grid"],
  .ainx>.glass[style*="display:grid"][style*="grid-template-columns"]{grid-template-columns:repeat(2,minmax(0,1fr))!important;max-height:var(--lay-head-h)!important;overflow-y:auto!important;flex:none!important}
  .ainx>[role=banner][style*="display:grid"]>*,.ainx>[role=group][style*="display:grid"]>*,.ainx>div>[role=banner][style*="display:grid"]>*,.ainx>div>[role=group][style*="display:grid"]>*{border-right:0!important;min-width:0}
  /* the stage is a wrapping row in the page: its own controls first, then the map beside the main list, then every other panel
     at full width with its own scroll. The Event impact page's stage (.ipg-stage) is left to its own rules in impact_page.js:
     these rules pushed its event form and its creditor card under the picker at 1024 (seen in the census run "gate") */
  .ainx :is(section[style*="position:relative"]:not(.glass):not([style*="padding:60px"]),[data-ns-stage]:not(.ipg-stage),[data-ainx-acstage]){display:flex!important;flex-flow:row wrap!important;align-items:flex-start!important;align-content:flex-start;gap:var(--lay-gap)!important;
    height:auto!important;min-height:0!important;flex:none!important;overflow:visible!important;background:none!important;border:0!important;padding:0!important}
  .ainx :is(section[style*="position:relative"]:not(.glass):not([style*="padding:60px"]),[data-ns-stage]:not(.ipg-stage),[data-ainx-acstage])>*{position:relative!important;inset:auto!important;left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;transform:none!important;
    width:auto!important;max-width:100%!important;min-width:0!important;flex:0 1 auto;order:-1;box-sizing:border-box;margin:0!important}
  /* the controls keep their own row: a zero-height break follows them, so a panel never climbs up beside the lens tabs */
  .ainx :is(section[style*="position:relative"]:not(.glass):not([style*="padding:60px"]),[data-ns-stage]:not(.ipg-stage),[data-ainx-acstage])::before{content:"";flex:0 0 100%;order:0;height:0;margin-top:calc(-1 * var(--lay-gap))}
  .ainx :is(section[style*="position:relative"]:not(.glass):not([style*="padding:60px"]),[data-ns-stage]:not(.ipg-stage),[data-ainx-acstage])>[aria-hidden="true"]{display:none!important}
  .ainx :is(section[style*="position:relative"]:not(.glass):not([style*="padding:60px"]),[data-ns-stage]:not(.ipg-stage),[data-ainx-acstage])>.pillnav{overflow-x:auto;flex-wrap:nowrap;white-space:nowrap}
  /* every panel: full width, capped, scrolling inside itself */
  .ainx :is(section[style*="position:relative"]:not(.glass):not([style*="padding:60px"]),[data-ns-stage]:not(.ipg-stage),[data-ainx-acstage])>:is(.glass,[data-ainx-occlude]){flex:1 1 100%!important;order:4!important;max-height:var(--lay-panel-h)!important;overflow-y:auto}
  /* the map: a real height, a full row unless a main list stands beside it */
  .ainx :is([data-ainx-nscene3d],[data-ainx-sscene3d],[data-ainx-scene3d],[data-ainx-acscene],[data-ns-scene],[data-ainx-nsvg],[data-ainx-mapfallback],[data-ns-mapfallback]){
    height:var(--lay-stage-h)!important;min-height:0!important;flex:1 1 100%!important;order:2!important;border-radius:12px;overflow:hidden;background:var(--stage);border:1px solid var(--pb)}
  .ainx section:has(>[data-ainx-nscene3d] canvas)>[data-ainx-nsvg]{display:none!important}
  /* the map's own key and buttons were placed against side panels that no longer cover it: they keep inside the map */
  .ainx :is([data-ainx-nscene3d],[data-ainx-sscene3d],[data-ainx-scene3d],[data-ainx-acscene],[data-ns-scene]){--ainx-mapctl-at:calc(50% - 60px)!important;--ainx-mapctl-bottom:12px!important}
  .ainx [data-ainx-maplegend],.ainx [data-ainx-maptable]{left:8px!important;right:auto!important;max-width:calc(100% - 16px)!important}
  /* inner two and three panel bodies become one column */
  .ainx [style*="grid-template-columns:230px minmax(0,1fr) 320px"],.ainx [style*="grid-template-columns:250px minmax(0,1fr) 320px"],.ainx [style*="grid-template-columns:minmax(0,1fr) 340px"],.ainx [style*="grid-template-columns:minmax(0,1fr) 380px"],
  .ainx [style*="grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(300px,400px)"]{grid-template-columns:minmax(0,1fr)!important;flex:none!important;height:auto!important}
  .ainx [role=main],.ainx [data-ainx-card],.ainx [data-ainx-rail]{max-height:none!important}
  /* lane P13FIX: the lender book's side panels draw their content in an absolute box that fills the grid cell. Stacked in one column
     the cell has no height of its own, so "To review first" stood in a 28 px strip over the map (census "gate", network at 1024).
     Stacked, the content takes its own height, capped, and scrolls inside itself. */
  #ainx-inst [data-ainx-anatomy]>:is([data-ainx-left],[data-ainx-right])>div[style*="position:absolute"]{position:relative!important;inset:auto!important;max-height:var(--lay-panel-h)}
}

/* ---------- tablet only: which panel stands beside the map ---------- */
@media (min-width:641px) and (max-width:1100px){
  /* a map beside a panel never collapses: under 340 px it takes a row of its own. The last census run showed the State map at
     1024 squeezed to nothing beside its list, its labels piled at the left edge. NOT MEASURED: added after that run. */
  html .ainx :is(section[style*="position:relative"]:not(.glass):not([style*="padding:60px"]),[data-ns-stage]:not(.ipg-stage),[data-ainx-acstage])>:is([data-ainx-nscene3d],[data-ainx-sscene3d],[data-ainx-scene3d],[data-ainx-acscene],[data-ns-scene],[data-ainx-nsvg]){min-width:min(100%,340px)!important}
  /* Nation: the lens panel, the map and the state list in one row, as on a laptop */
  #ainx-nation .ainx>section>.glass[style*="left:0;top:44px"]{flex:0 0 240px!important;order:1!important;height:var(--lay-stage-h)!important;max-height:none!important;overflow-y:auto!important}
  #ainx-nation .ainx>section>:is([data-ainx-nscene3d],[data-ainx-nsvg]){flex:1 1 0!important}
  #ainx-nation .ainx>section>:is([data-ainx-statelist],[data-ainx-placecard],[data-ainx-physpanel],[data-ainx-ahcard]){flex:0 0 312px!important;order:3!important;height:var(--lay-stage-h)!important;max-height:none!important;overflow-y:auto!important}
  #ainx-nation .w5-att{height:auto!important}
  /* State: the list panel beside the map */
  #ainx-state .ainx>section>.glass[data-ainx-occlude][style*="flex-direction:column"]{flex:1 1 0!important;order:1!important;height:var(--lay-stage-h)!important;max-height:none!important;overflow-y:auto!important}
  #ainx-state .ainx>section:has(>.glass[data-ainx-occlude][style*="flex-direction:column"])>[data-ainx-sscene3d]{flex:1 1 0!important}
  /* Your accounts and Alerts: the work list beside the open card, the map under them; with no card, the list beside the map */
  .ainx :is([data-ainx-acstage],[data-ns-stage])>[data-ainx-occlude][style*="width:360px"]{flex:0 0 340px!important;order:1!important;height:var(--lay-stage-h)!important;max-height:none!important;overflow-y:auto!important}
  .ainx :is([data-ainx-acstage],[data-ns-stage])>[data-ainx-occlude][style*="width:380px"]{flex:1 1 0!important;order:2!important;height:var(--lay-stage-h)!important;max-height:none!important;overflow-y:auto!important}
  .ainx :is([data-ainx-acstage],[data-ns-stage]):not(:has(>[data-ainx-occlude][style*="width:380px"]))>:is([data-ainx-acscene],[data-ns-scene],[data-ainx-mapfallback],[data-ns-mapfallback]){flex:1 1 0!important}
  .ainx :is([data-ainx-acstage],[data-ns-stage]):has(>[data-ainx-occlude][style*="width:380px"])>:is([data-ainx-acscene],[data-ns-scene],[data-ainx-mapfallback],[data-ns-mapfallback]){order:3!important}
  /* Your accounts (merged design): the work list stays beside the opened account, as on a laptop; answer.css made it one column
     with the list first, which put the opened account under the fold at 1024. NOT MEASURED: added after the last census run. */
  #ainx-accts .ainx [data-ainx-acmain]{grid-template-columns:minmax(240px,300px) minmax(0,1fr)!important}
  /* the lender book: the lens's first panel beside the map */
  #ainx-inst .ainx section>:is([data-ainx-stresspanel],[data-ainx-changelog],[data-ainx-casteps]){flex:0 0 320px!important;order:1!important;height:var(--lay-stage-h)!important;max-height:none!important;overflow-y:auto!important}
  #ainx-inst .ainx section:has(>:is([data-ainx-stresspanel],[data-ainx-changelog],[data-ainx-casteps]))>[data-ainx-scene3d]{flex:1 1 0!important}
  /* lane P13FIX (census "gate", first answer below the fold at 1024): the lender book's Borrowers lens stacked its Group by rail first,
     so the list stood about 1,080 px down and an opened borrower's card about 6,500 px down. On a tablet the list and the card share the
     first row, as on a laptop, and the rail follows at full width. */
  #ainx-inst .ainx [style*="grid-template-columns:250px minmax(0,1fr) 320px"]{grid-template-columns:minmax(0,1fr) 300px!important}
  #ainx-inst .ainx [style*="grid-template-columns:250px minmax(0,1fr) 320px"]>[role=main]{grid-column:1;grid-row:1}
  #ainx-inst .ainx [style*="grid-template-columns:250px minmax(0,1fr) 320px"]>[data-ainx-card]{grid-column:2;grid-row:1}
  #ainx-inst .ainx [style*="grid-template-columns:250px minmax(0,1fr) 320px"]>[role=complementary]:not([data-ainx-card]){grid-column:1 / -1;grid-row:2}
  /* Track record: the chosen signal's card, its verdict and its figures, comes before the list of signals (it stood under all of them) */
  #ainx-scorecard [data-ns-stage]>div:has(>[data-ns-card]){order:-2!important;flex:1 1 100%!important}
  #ainx-scorecard [data-ns-stage]>div:has(>[data-ns-list]){flex:1 1 100%!important}
  /* the company screen (lane ENTX): the information column and the map of its state lay themselves out; with Payment Order on, the right column keeps the height */
  .ainx section>[data-ainx-entright]{flex:1 1 0!important;order:2!important;height:var(--lay-stage-h)!important}
}

/* ---------- phone: read only, one column, no 3D stage ---------- */
@media (max-width:640px){
  :root{--lay-pad:8px;--lay-gap:8px}
  /* the bar on two rows: where you are and the actions, then the search */
  .ainx .cbar{flex-wrap:wrap!important;row-gap:6px}
  .ainx .cbar .cb-search{order:9;flex:1 1 100%!important;max-width:none}
  .ainx .cbar .cb-search .cb-scope{overflow-x:auto;flex:0 1 auto;min-width:0}
  .ainx .cbar [data-cb-seatbox]{display:none}
  .ainx .cbar .crumbs li:nth-last-child(n+2){display:none}
  .ainx .cbar .crumbs li:last-child::before{display:none}
  .ainx .cbar .crumbs{flex:1 1 0;min-width:0}
  .ainx .cbar>span[style*="flex:1"]{display:none}
  .ainx .cbar>div[style*="position:relative"]{position:static!important}
  .ainx .cbar .cb-pop{left:0!important;right:0!important;width:auto!important;min-width:0!important}
  /* heads and every grid of cells: one column, at full height, after the answer */
  .ainx>[role=banner][style*="display:grid"],.ainx>[role=group][style*="display:grid"],.ainx>div>[role=banner][style*="display:grid"],.ainx>div>[role=group][style*="display:grid"],
  .ainx>.glass[style*="display:grid"][style*="grid-template-columns"]{grid-template-columns:minmax(0,1fr)!important;max-height:none!important;overflow-y:visible!important}
  .ainx [style*="grid-template-columns:repeat("],.ainx [style*=") minmax(0,"]{grid-template-columns:minmax(0,1fr)!important}
  .ainx>[role=banner],.ainx>[role=group],.ainx>[data-ainx-nloading]{order:5}
  /* the stage is one column: every panel at its full height, in reading order */
  .ainx :is(section[style*="position:relative"]:not(.glass):not([style*="padding:60px"]),[data-ns-stage]:not(.ipg-stage),[data-ainx-acstage]){flex-flow:column nowrap!important;align-items:stretch!important}
  .ainx :is(section[style*="position:relative"]:not(.glass):not([style*="padding:60px"]),[data-ns-stage]:not(.ipg-stage),[data-ainx-acstage])::before{display:none}
  .ainx :is(section[style*="position:relative"]:not(.glass):not([style*="padding:60px"]),[data-ns-stage]:not(.ipg-stage),[data-ainx-acstage])>*{flex:none!important;height:auto!important;max-height:none!important;overflow-y:visible!important}
  /* no 3D stage and no drawn map: the lists and the cards are the screen */
  .ainx :is([data-ainx-nscene3d],[data-ainx-sscene3d],[data-ainx-scene3d],[data-ainx-entmap3d],[data-ainx-acscene],[data-ns-scene],[data-ainx-nsvg],[data-ainx-mapfallback],[data-ns-mapfallback],[data-ainx-expand],[data-ainx-statelabel]),
  .ainx [data-ainx-sec="map"]{display:none!important}
  /* the open card comes before the list it was opened from; the lens panel before the state list */
  .ainx :is([data-ainx-acstage],[data-ns-stage])>[data-ainx-occlude][style*="width:380px"]{order:1!important}
  .ainx :is([data-ainx-acstage],[data-ns-stage])>[data-ainx-occlude][style*="width:360px"]{order:2!important}
  /* Your accounts (merged design): the opened account's card comes before the work list, and the list keeps its own scroll.
     NOT MEASURED: added after the last census run, which showed the card under the whole list on a phone. */
  #ainx-accts .ainx [data-ainx-acmain]>[data-ainx-card]{order:-1}
  #ainx-accts .ainx [data-ainx-acmain]>[data-ainx-worklist]{max-height:60vh;overflow-y:auto}
  /* Track record: one signal per block (status, the name at full width, then the bars and figures) instead of four columns
     a word wide (OPE request 6). NOT MEASURED: added after the last census run. */
  .ainx [style*="grid-template-columns:150px minmax(0,1fr) minmax(150px,230px) minmax(110px,150px)"]{grid-template-columns:minmax(0,1fr)!important}
  /* a wide table scrolls inside itself, the page never does */
  .ainx .tbl,.ainx table{max-width:100%}
  .ainx .w5-sc,.ainx [style*="overflow:auto"]{overflow-x:auto}
  .ainx h1,.ainx .cond{overflow-wrap:anywhere}
}
