/* THE PHONE LAYOUTS (mobile phase 1a, 2026-11-17; design handoff sections 1, 2, 4.4 and 5.3; Simple and Advanced; PHONES ONLY).
   Every rule in this sheet is written under html[data-layout="phone-portrait"], html[data-layout="phone-landscape"] or
   html[data-layout^="phone"], the attribute the head sets before the first paint (index.html zenaLayoutBoot, the one
   definition of the four layouts). Nothing here names tablet or desktop, so a tablet and a desktop read none of it and are
   what they were. The one block that is not under the attribute is the four safe-area tokens below, which draw nothing.
   test_layout_definition holds both lines.
   THE ONE DESKTOP DIFFERENCE, intended (decision 3): the handoff's phone-landscape query has no width cap, so a desktop
   window made 500px tall or shorter is phone-landscape too and gets the one-row header.
   Colours are the --z-* tokens only (the theme moves to "mid" in its own change); sizes the handoff does not name are the
   page's own tokens. No rule fades anything.
   Sections: 0 tokens · 1 phone landscape: the one-row header · 2 phone landscape: what the header replaces ·
   3 safe areas · 4 the viewport's real height · 5 fields type at 16px · 6 sheets on a phone held sideways */

/* ── 0. tokens: the safe-area insets, so a rule reads a token and a test can set one (a browser cannot emulate a notch) ── */
:root{--z-safe-top:env(safe-area-inset-top,0px);--z-safe-right:env(safe-area-inset-right,0px);--z-safe-bottom:env(safe-area-inset-bottom,0px);--z-safe-left:env(safe-area-inset-left,0px)}

/* ── 1. PHONE LANDSCAPE: ONE HEADER ROW, 48px ──────────────────────────────────────────────────────────────────────────
   Confirmed on an iPhone: on its side a phone got the desktop page, and the header, the category row and the banner took
   about 70% of a 393px screen. Here the header is one 48px row and everything else gives its height to the page:
     mark · News / Markets (one segmented control) · the category button (All, a sheet) · search (an icon) · account
   The bottom tab bar is not drawn (its destinations are the segmented control), nor the first-visit banner, the
   ticker or the category row; "Prices paused" keeps its strip. A market page keeps a 44px place after the control for the
   open-markets switcher (handoff 6.5), which is later work. The row is padded by the notch on either side. */
html:root[data-layout="phone-landscape"][data-tier=free]{--za-header-h:48px;--za-tabbar-h:0px;--za-topics-h:0px}
html:root[data-layout="phone-landscape"][data-tier=free] body .nav{box-sizing:border-box;flex-wrap:nowrap;gap:8px;row-gap:0;height:48px;min-height:48px;padding:2px max(12px,var(--z-safe-right)) 2px max(12px,var(--z-safe-left))}
html:root[data-layout="phone-landscape"][data-tier=free] body .nav .nav-l{flex:0 1 auto;min-width:0;gap:8px}
html:root[data-layout="phone-landscape"][data-tier=free] body .nav a.brand{flex:none}
/* the three destinations: a segmented control, the open one on the soft accent (no underline: the row has no room under it) */
html:root[data-layout="phone-landscape"][data-tier=free] body .nav .zsh-tabs-top{display:flex;align-items:center;gap:2px;flex:none;box-sizing:border-box;height:44px;padding:2px;border-radius:var(--z-radius-ctl);background:var(--z-raised)}
html:root[data-layout="phone-landscape"][data-tier=free] body .nav .zsh-tabs-top>button{position:relative;box-sizing:border-box;height:40px;min-height:40px;padding:0 12px;border:0;border-radius:calc(var(--z-radius-ctl) - 2px);background:none;color:var(--z-title);font:500 14px/20px var(--sans);white-space:nowrap}
html:root[data-layout="phone-landscape"][data-tier=free] body .nav .zsh-tabs-top>button[aria-current=page]{background:var(--z-accent-soft);font-weight:600}
html:root[data-layout="phone-landscape"][data-tier=free] body .nav .zsh-tabs-top>button::after{content:none}
html:root[data-layout="phone-landscape"][data-tier=free] body .nav .zsh-tabs-top>button::before{content:'';position:absolute;inset:-2px 0}   /* the hit area is the row's 44px */
/* Research (main, 2026-11-23: a plain link to /research after News and Markets, never marked current): on its side it is
   the control's third segment, drawn as the two tabs are, so it is a 40px target in the 44px row and not desktop's link */
html:root[data-layout="phone-landscape"][data-tier=free] body .nav .zsh-tabs-top>a{position:relative;display:inline-flex;align-items:center;box-sizing:border-box;height:40px;min-height:40px;padding:0 12px;border-radius:calc(var(--z-radius-ctl) - 2px);color:var(--z-title);font:500 14px/20px var(--sans);text-decoration:none;white-space:nowrap}
html:root[data-layout="phone-landscape"][data-tier=free] body .nav .zsh-tabs-top>a::after{content:none}
html:root[data-layout="phone-landscape"][data-tier=free] body .nav .zsh-tabs-top>a::before{content:'';position:absolute;inset:-2px 0}
/* the category button: the row of topics as one control. It names the chosen topic; phone-layout.js opens the sheet. */
html:root[data-layout="phone-landscape"][data-tier=free]:is([data-za-mode=news],[data-za-mode=markets]) body .nav .zl-cats{position:relative;display:inline-flex!important;align-items:center;gap:4px;flex:none;min-width:44px;max-width:16ch;box-sizing:border-box;height:40px;padding:0 10px 0 14px;border:0;border-radius:999px;background:var(--z-raised-2);color:var(--z-title);font:500 14px/20px var(--sans);letter-spacing:0;white-space:nowrap;cursor:pointer;-webkit-tap-highlight-color:transparent}
html:root[data-layout="phone-landscape"][data-tier=free] body .nav .zl-cats>span{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}
html:root[data-layout="phone-landscape"][data-tier=free] body .nav .zl-cats>svg{flex:none;width:14px;height:14px}
html:root[data-layout="phone-landscape"][data-tier=free] body .nav .zl-cats::before{content:'';position:absolute;inset:-2px 0}
html:root[data-layout="phone-landscape"][data-tier=free] body .nav .zl-cats:focus-visible{outline:2px solid var(--z-accent);outline-offset:2px}
/* a market page: the switcher's place, kept so the row does not move when the switcher arrives */
html:root[data-layout="phone-landscape"][data-tier=free][data-za-mode=market] body .nav .zl-switcher-slot{display:block!important;flex:none;width:44px;height:44px}
/* search: an icon, 44px. The field is still there (it is the read-only control that opens the search palette), laid over
   the icon and not drawn; its "/" key hint is not shown where there are no keys. */
html:root[data-layout="phone-landscape"][data-tier=free] body .nav .prompt{position:relative;display:grid;place-items:center;flex:none;box-sizing:border-box;width:44px;min-width:44px;max-width:44px;height:44px;margin:0 0 0 auto;padding:0;border-radius:var(--z-radius-ctl);background:none!important;box-shadow:none}
html:root[data-layout="phone-landscape"][data-tier=free] body .nav .prompt:focus-within{box-shadow:0 0 0 2px var(--z-accent)}
html:root[data-layout="phone-landscape"][data-tier=free] body .nav .prompt>.si{position:static;width:20px;height:20px;margin:0;color:var(--z-title)}
html:root[data-layout="phone-landscape"][data-tier=free] body .nav .prompt>#cmd{position:absolute;inset:0;box-sizing:border-box;width:100%;height:100%;min-width:0;margin:0;padding:0;border:0;background:none;color:transparent;opacity:0;cursor:pointer}
html:root[data-layout="phone-landscape"][data-tier=free] body .nav .prompt>:is(.pkbd,.cmdsug){display:none!important}
/* the account: its icon, 44px (a signed-in reader's short name, as on a phone held upright) */
/* Filter (News only; phone-layout.js FILTER): an icon, 44px, after search; a dot when a filter is on */
html:root[data-layout="phone-landscape"][data-tier=free] body .nav .zl-filter:not([hidden]){position:relative;display:grid;place-items:center;flex:none;box-sizing:border-box;width:44px;height:44px;padding:0;border:0;border-radius:var(--z-radius-ctl);background:none;color:var(--z-title);cursor:pointer;-webkit-tap-highlight-color:transparent}
html:root[data-layout="phone-landscape"][data-tier=free] body .nav .zl-filter>svg{width:20px;height:20px}
html:root[data-layout="phone-landscape"][data-tier=free] body .nav .zl-filter:focus-visible{outline:2px solid var(--z-accent);outline-offset:2px}
html:root[data-layout="phone-landscape"][data-tier=free] body .nav .zl-filter>i{display:none;position:absolute;top:10px;right:10px;width:8px;height:8px;border-radius:50%;background:var(--z-accent)}
html:root[data-layout="phone-landscape"][data-tier=free] body .nav .zl-filter[data-zw-filtered]>i{display:block}
html:root[data-layout="phone-landscape"][data-tier=free] body .nav .zsh-account-btn{flex:none;width:44px;height:44px;min-height:44px;padding:0;justify-content:center;background:none}
html:root[data-layout="phone-landscape"][data-tier=free] body .nav .zsh-account-btn>span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
html:root[data-layout="phone-landscape"][data-tier=free] body .nav .zsh-account-btn[data-signed-in]{width:auto;padding:0 8px}
html:root[data-layout="phone-landscape"][data-tier=free] body .nav .zsh-account-btn[data-signed-in]>span{position:static;width:auto;height:auto;clip-path:none;max-width:9ch;overflow:hidden;text-overflow:ellipsis;font:600 13px/18px var(--sans)}
html:root[data-layout="phone-landscape"][data-tier=free] body .nav .zsh-account-btn[data-signed-in]>svg{display:none}

/* ── 2. PHONE LANDSCAPE: WHAT THE ONE ROW REPLACES ─────────────────────────────────────────────────────────────────────
   Not drawn: the bottom tab bar, the category row (it is the header's button), the first-visit banner and the ticker.
   The board's spacer for the laid-over category row goes with the row, so the page starts under the header. */
html:root[data-layout="phone-landscape"][data-tier=free] body .zsh-tabbar{display:none!important}
html:root[data-layout="phone-landscape"][data-tier=free] body #pnlBoard>.pnl-h.zc-board-header,
html:root[data-layout="phone-landscape"][data-tier=free] body #zaCoach,
html:root[data-layout="phone-landscape"][data-tier=free] body .zn-market-ticker{display:none!important}
html:root[data-layout="phone-landscape"][data-tier=free] body #bfBoard::before{content:none!important;display:none!important;height:0!important}
html:root[data-layout="phone-landscape"][data-tier=free] body #bfBoard{scroll-padding-top:8px}
html:root[data-layout="phone-landscape"][data-tier=free] body #main>.bfwrap{padding-top:0;padding-bottom:0}
/* the board's own strip row holds the open-markets menu and the ticker; with the ticker gone and no market open it is an
   empty 42px band under the header, so it goes (with a market open its menu stays, until the header's switcher arrives) */
html:root[data-layout="phone-landscape"][data-tier=free] body #main:not(.zc-market-page)>.ztabs.zc-free-tabs[data-market-nav=board]:not(:has(>.zc-workspaces:not([data-empty=true]))){display:none!important}

/* ── 3. SAFE AREAS ─────────────────────────────────────────────────────────────────────────────────────────────────────
   The page is drawn edge to edge (viewport-fit=cover). Held sideways, an iPhone's notch is 59px of one side and the home
   bar 21px of the bottom, and until now the page had no left or right inset anywhere: words and controls ran under the
   notch. The header is padded above (section 1); here the page under it keeps clear of both sides and the bottom, and
   whatever is pinned to the bottom of a phone held either way stands above the home bar.
   EVERY TIER (2026-11-19, the handoff check): viewport-fit=cover draws the whole document under the notch, the
   institutional desk's too, so its insets cannot be the free view's alone (the desk on its side had its rail and its
   logo under the notch). What stays free-only is what restyles the free view's own shell (sections 1, 2 and 11: the
   one-row header, the tab bar, the topic row, the document scrolling): the desk draws its own header and rail, and is
   not redesigned in phase 1. */
html:root[data-layout="phone-landscape"] body>.view{box-sizing:border-box;padding-left:var(--z-safe-left);padding-right:var(--z-safe-right);padding-bottom:var(--z-safe-bottom)}
html:root[data-layout="phone-landscape"] body>.banner{padding-left:max(12px,var(--z-safe-left));padding-right:max(12px,var(--z-safe-right))}
html[data-layout^="phone"] #ztoast{margin-left:var(--z-safe-left);margin-right:var(--z-safe-right)}
html[data-layout="phone-landscape"] #ztoast{bottom:calc(var(--z-safe-bottom) + 18px)}
/* the desk's own header (two rows: search, then its controls) keeps clear of the notch on both sides */
html:root[data-layout="phone-landscape"]:not([data-tier=free]) body>.nav{padding-left:max(var(--z-space-gutter),var(--z-safe-left));padding-right:max(var(--z-space-gutter),var(--z-safe-right))}
html[data-layout^="phone"] .zc-load-fail{margin-bottom:var(--z-safe-bottom)}
/* a market page's Yes and No bar (markets-calm.css: fixed, the full width, above the tab bar). Sideways there is no tab
   bar: it stands at the foot, its buttons clear of the notch and above the home bar (found in 1b: its ends were 16px
   from each edge, and a test that clipped it by #main's box, which does not clip a fixed bar, had not seen it) */
html:root[data-layout="phone-landscape"][data-tier=free] body #main.zc-market-page>.zmc-bar{bottom:0;padding-left:max(var(--z-space-gutter),var(--z-safe-left));padding-right:max(var(--z-space-gutter),var(--z-safe-right));padding-bottom:calc(var(--z-gap-inline) + var(--z-safe-bottom))}

/* ── 4. THE VIEWPORT'S REAL HEIGHT ─────────────────────────────────────────────────────────────────────────────────────
   100vh on a phone is the screen with the browser's bars away, so a sheet sized by it ends under the toolbar. On a phone
   the overlays a reader meets are sized by the height there is now (dvh). Each rule below is an existing overlay's own
   rule with vh read as dvh and nothing else changed (the file and rule it replaces are named); test_phone_viewport_units
   holds the list to every overlay a phone reader can open. */
/* the outcome picker (market-context.css "PHONE: the outcome list") */
html[data-layout^="phone"] #main.zc-market-page.zc-workspace .zc-market-choice.zc-header-outcome-choice{max-height:min(78dvh,560px,calc(100dvh - var(--za-tabbar-h,0px) - 64px))!important}
html[data-layout^="phone"] body .zc-om{max-height:min(78dvh,560px,calc(100dvh - var(--za-tabbar-h,0px) - 64px))}
/* sign-in, Venues, a venue's trade and connect cards, profile (index.html .zwcard) */
html[data-layout^="phone"] body .zwcard{max-height:calc(100dvh - 32px)}
/* the ticket (index.html #tktCard) and the venue box (index.html .vbox) */
html[data-layout^="phone"] body #tktCard{max-height:calc(100dvh - 36px)}
html[data-layout^="phone"] body .vbox{max-height:88dvh}
/* chart options (markets-calm.css dialog.zmc-sheet: 80vh to 700px wide, min(80vh,560px) wider; on a phone, at most 500px
   tall on its side, the two are the same height, so one twin) */
html[data-layout^="phone"] body dialog.zmc-sheet{max-height:80dvh}
/* search suggestions (index.html .cmdsug, and .nav .cmdsug to 600px wide) */
html[data-layout="phone-portrait"] body .nav .cmdsug{max-height:70dvh}
html[data-layout="phone-landscape"] body .cmdsug{max-height:min(58dvh,420px)}
/* the board's filter list and venue menu (index.html), a market page's venue comparison (workspace-ui.css) */
html[data-layout^="phone"] body #pnlBoard.bfopen .pnl-tabs{max-height:70dvh}
html[data-layout^="phone"] body .pnl-h .bmenu.bmven{max-height:min(70dvh,560px)}
html[data-layout^="phone"] body .zc-market-venues .zc-venue-comparison{max-height:60dvh}
/* the chart's dialogs, menus and pickers (index.html pxUI) */
html[data-layout^="phone"] body .pxui-dlg{max-height:min(660px,calc(100dvh - 48px))}
html[data-layout^="phone"] body .pxind-dlg{height:min(560px,calc(100dvh - 48px))}
html[data-layout^="phone"] body :is(.pxui-menu:not(.pxui-sub),.pxui-pop){max-height:72dvh!important}   /* the phone rule of index.html, on both phone layouts */
html[data-layout^="phone"] body .pxmkpop .pxmkl{max-height:min(360px,60dvh)}
html[data-layout^="phone"] body .pxpall{max-height:min(420px,62dvh)}
html[data-layout^="phone"] body .pxtzpop .pxtzl{max-height:min(340px,55dvh)}
/* the save picker and the board's open-markets list (market-context.css) */
html[data-layout^="phone"] body .zc-save-picker{max-height:70dvh}
html[data-layout^="phone"] body .zc-workspace-list{max-height:60dvh}
/* Ask's guided path scrim (ask-path.css .za-scrim) */
html[data-layout^="phone"] body .za-scrim{height:100dvh}

/* ── 5. FIELDS TYPE AT 16px ────────────────────────────────────────────────────────────────────────────────────────────
   Confirmed on an iPhone: Safari zooms the page when a field under 16px takes the focus (sign-in was 13px), and never
   zooms back. On a phone every field a reader types in or picks from is 16px at least; the page never forbids zoom
   (no maximum-scale). Tablet and desktop keep their sizes in phase 1 (decision 6; an iPad zooms the same way: a tablet-
   phase test). The header's search control is not listed: it is a read-only button over an icon here. */
html[data-layout^="phone"] body :is(input:not([type=checkbox],[type=radio],[type=range],[type=button],[type=submit],[type=reset],[type=color],[type=file],[type=image],[type=hidden]),textarea,select,[contenteditable="true"],[contenteditable=""],[contenteditable="plaintext-only"]){font-size:16px!important}

/* ── 6. SHEETS ON A PHONE HELD SIDEWAYS ────────────────────────────────────────────────────────────────────────────────
   343px of height is no room for a sheet from the bottom. The account sheet and the category sheet are a panel on the
   right edge, the full height, 400px at most, clear of the notch and the home bar; they scroll inside. Back, a swipe to
   the right, the scrim, Escape and the close control close them (zena-sheets.js). */
html[data-layout="phone-landscape"] dialog.zsh-sheet{inset:0 0 0 auto;box-sizing:border-box;width:min(400px,100vw);max-width:100vw;height:100dvh;max-height:100dvh;padding:8px var(--z-safe-right) calc(12px + var(--z-safe-bottom)) 0;border-radius:var(--z-radius-card) 0 0 var(--z-radius-card)}
html[data-layout="phone-landscape"] dialog.zsh-sheet::backdrop{background:rgba(0,0,0,.55)}
html[data-layout^="phone"] dialog.zsh-sheet .zsh-seg>button{min-height:44px}
/* the category sheet's rows: the chosen one is marked the way every chosen chip is */
html[data-layout^="phone"] dialog.zl-cat-sheet .zsh-row[aria-pressed=true]{background:var(--z-accent-soft);font-weight:600}

/* ── 7. TEXT IS THE SIZE IT WAS WRITTEN AT ─────────────────────────────────────────────────────────────────────────────
   Confirmed on an iPhone (1a review): iOS Safari enlarges text when a phone turns on its side unless the page says not to.
   The terminal never said, so held sideways every word grew: a News card's words outgrew the card and pushed its action
   buttons (Read report among them) out of its bottom, and the 48px header's contents spilled over a market page's title. A
   browser that does not enlarge (Playwright's Chromium and WebKit among them) reads this as nothing. */
html[data-layout^="phone"]{-webkit-text-size-adjust:100%;text-size-adjust:100%}

/* ── 8. SEARCH ON A PHONE HELD SIDEWAYS ────────────────────────────────────────────────────────────────────────────────
   Confirmed on an iPhone: sideways with the keyboard up, the keyboard and Safari's form bar leave about 100px, and the
   search kept its centred desktop box, so its field and results were off the part that shows. Here the search is the
   whole width of the part that shows (command-center.js fitPalette keeps --zn-vvt and --zn-vvh at the visual
   viewport): the field and a Close control in one 44px row at its top, the results scrolling between it and the
   keyboard, the scopes when there is room for them (phone-layout.js sets data-zl-tight under 200px), clear of the notch.
   Back, Escape and Close close it (zena-sheets.js takes every phone dialog). Upright is as it was. */
html[data-layout="phone-landscape"] body #znPalette[open]{position:fixed;inset:auto 0 auto 0;top:var(--zn-vvt,0px);box-sizing:border-box;display:flex;flex-direction:column;width:100%;max-width:none;height:var(--zn-vvh,100dvh);max-height:var(--zn-vvh,100dvh);margin:0;padding:0 var(--z-safe-right) 0 var(--z-safe-left);border:0;border-radius:0;animation:none}
html[data-layout="phone-landscape"] body #znPalette[open]>.zn-query-row{flex:none;display:flex;align-items:center;gap:8px;min-height:44px;padding:0 4px 0 12px;border-bottom:1px solid var(--z-hairline)}
html[data-layout="phone-landscape"] body #znPalette[open] #znQuery{flex:1 1 auto;min-width:0;height:44px}
html[data-layout="phone-landscape"] body #znPalette[open]>.zn-scopes{flex:none;min-height:40px;padding-top:2px;padding-bottom:2px}
html[data-layout="phone-landscape"] body #znPalette[open][data-zl-tight]>.zn-scopes,html[data-layout="phone-landscape"] body #znPalette[open]>.zn-command-footer{display:none}
html[data-layout="phone-landscape"] body #znPalette[open]>#znResults{flex:1 1 auto;min-height:0;max-height:none;overflow-y:auto;overscroll-behavior:contain}
/* "esc" names a key a phone does not have, and on a touch screen command-center.css hid it, so the search had no close
   control at all, upright or sideways. On a phone it is shown, reads Close, and is a 44px target (its label was already
   "Close search"). */
html[data-layout^="phone"] body #znPalette .zn-escape{flex:none;display:inline-flex!important;align-items:center;justify-content:center;min-width:64px;height:44px;padding:0 12px;border:0;background:none;font-size:0!important;color:var(--z-title)}
html[data-layout^="phone"] body #znPalette .zn-escape::after{content:"Close";font:500 16px/20px var(--sans)}

/* ── 9. SHEETS, NOT POPOVERS, ON A PHONE HELD SIDEWAYS ─────────────────────────────────────────────────────────────────
   Confirmed on an iPhone: upright, a phone's outcome picker is a sheet from the bottom (market-context.css, under 600px
   wide), but sideways the phone is 852px wide and got the desktop's 400px popover anchored to the header box, over the
   price and cut off at the bottom. Sideways it is the same sheet as upright, the full width under the notch's padding,
   from the bottom (the tab bar is not drawn), with the grab handle "Markets for this story" has; Back, a swipe down, the
   scrim and its x close it (zena-sheets.js). Upright it gains the handle and nothing else. */
html[data-layout="phone-landscape"] #main.zc-market-page.zc-workspace .zc-market-choice.zc-header-outcome-choice{left:0!important;right:0!important;top:auto!important;bottom:0!important;width:100%!important;max-width:100%!important;max-height:calc(100dvh - 24px)!important;box-sizing:border-box;padding-left:var(--z-safe-left);padding-right:var(--z-safe-right);border-width:1px 0 0!important;border-radius:var(--z-radius-card) var(--z-radius-card) 0 0!important;animation-name:zc-om-sheet-in}
html[data-layout="phone-landscape"] #main .zc-om-backdrop{display:block;position:fixed;inset:0;z-index:79;background:rgba(0,0,0,.5);touch-action:none;animation:zc-om-fade 150ms ease both}
html[data-layout="phone-landscape"] #main .zc-market-choice.zc-header-outcome-choice.zc-om-leaving{animation-name:zc-om-sheet-out!important}
html[data-layout="phone-landscape"] body .zc-om{max-height:calc(100dvh - 40px);padding-bottom:var(--z-safe-bottom)}
html[data-layout="phone-landscape"] body .zc-om-head{min-height:48px}
html[data-layout="phone-landscape"] body .zc-om-close{width:44px;height:44px}
html[data-layout^="phone"] #main.zc-market-page.zc-workspace .zc-market-choice.zc-header-outcome-choice::before{content:"";display:block;flex:none;width:36px;height:4px;margin:8px auto 0;border-radius:2px;background:var(--z-hairline-strong)}
/* News's "Markets for this story" sheet is the full width: sideways its rows keep clear of the notch */
html[data-layout="phone-landscape"][data-zw-sheet-open] body #pnlBoard #bfBoard .zw-page .zw-workspace:has(>.zw-feed)>.zw-markets{padding-left:max(16px,var(--z-safe-left))!important;padding-right:max(16px,var(--z-safe-right))!important}
html[data-layout="phone-landscape"][data-zw-sheet-open] body #pnlBoard #bfBoard .zw-page .zw-markets[data-zw-sheet]>.zw-sheet-head{margin-left:calc(-1 * max(16px,var(--z-safe-left)));margin-right:calc(-1 * max(16px,var(--z-safe-right)));padding-left:max(16px,var(--z-safe-left));padding-right:max(16px,var(--z-safe-right))}
/* Sign-in (index.html #zaOv, #zaCard) is a centred card with no height limit: sideways it was taller than the 300px that
   shows, cut off at both ends (its mark above, its terms below), and with the keyboard up the email field went under it.
   Sideways the overlay covers what shows above the keyboard (--zl-vvt, --zl-vvh: phone-layout.js) and scrolls; the card
   is centred by auto margins, which never push it past the top, clear of the notch. */
html[data-layout="phone-landscape"] body #zaOv.on{top:var(--zl-vvt,0px);bottom:auto;height:var(--zl-vvh,100dvh);box-sizing:border-box;align-items:flex-start;overflow-y:auto;overscroll-behavior:contain;padding:8px var(--z-safe-right) calc(8px + var(--z-safe-bottom)) var(--z-safe-left)}
html[data-layout="phone-landscape"] body #zaOv.on>#zaCard{flex:none;margin:auto}
/* a market page's Context reader is a centred box 16px from each edge: sideways it keeps clear of the notch */
html[data-layout="phone-landscape"] body dialog.zmb-reader{width:calc(100vw - 2 * max(16px,var(--z-safe-left),var(--z-safe-right)));max-height:calc(100dvh - 16px)}

/* 10. A NEWS CARD ON ITS SIDE (iPhone review round 2, 2026-11-19; Simple and Advanced, phone landscape). Both faults were in
   the News landscape layout before 1a (news-feed.css "A PHONE ON ITS SIDE", 2026-11-16); 1a's notch padding narrowed the
   words' column, so headlines reached the cut more often.
   - A share line's chart (news-story-graphics.js .zg-company) drew no line: the subject row and the 64px logo tile took the
     drawing's 137px, the plot measured 0px, and its labels ("Story 1:18 PM ET", "Since 11:48 AM ET", "H $111.68", the
     dates) landed on each other. Sideways the subject row (it repeats the company's name) and the tile go, the name stays
     one line, and the plot keeps a floor. phone-layout.js then hides any label that still overlaps another or runs past
     the drawing, lowest first (high/low marks, the window's label, the story's time, the dates): data-zl-hide.
   - The headline was cut mid-line by its heading's max-height, with no ellipsis: its text is a <button>, and WebKit does
     not line-clamp a button (and news-dom.js patches each live edition back to the page's own markup, so a wrapper would
     not stay). The heading holds whole lines, 3 or what fits (data-zl-lines on the card, from phone-layout.js), and when
     the text runs past them (data-zl-cut) an ellipsis in the card's own colour closes the last line. Tapping it opens the report, which carries
     the whole headline; the whole text stays in the page for a screen reader. */
html:root[data-layout="phone-landscape"] body #pnlBoard #bfBoard .zw-page .zw-feed .zk-graphic:has(>.zg-company)>.zk-subject,
html:root[data-layout="phone-landscape"] body #pnlBoard #bfBoard .zw-page .zw-feed .zg-company>.zg-company-head>.zg-company-logo{display:none!important}
html:root[data-layout="phone-landscape"] body #pnlBoard #bfBoard .zw-page .zw-feed .zg-company>.zg-company-head{min-height:0!important}
html:root[data-layout="phone-landscape"] body #pnlBoard #bfBoard .zw-page .zw-feed .zg-company>.zg-company-head>.zg-company-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
html:root[data-layout="phone-landscape"] body #pnlBoard #bfBoard .zw-page .zw-feed .zg-company>.zg-series>svg{min-height:calc(var(--sp-5) * 2)}
html:root[data-layout="phone-landscape"] body #pnlBoard #bfBoard .zw-page .zw-feed .zk-graphic [data-zl-hide]{visibility:hidden!important}
html:root[data-layout="phone-landscape"] body #pnlBoard #bfBoard .zw-page .zw-feed>.zw-slot>.zw-focus>.zw-story-header h2{position:relative;max-height:3lh!important;overflow:hidden!important}
/* the button's own clamp (news-feed.css, chart cards: Chromium draws it, WebKit does not) gives way to the heading's, so one
   ellipsis closes the headline in both engines (the class twice outweighs that rule's :has()) */
html:root[data-layout="phone-landscape"] body #pnlBoard #bfBoard .zw-page .zw-feed>.zw-slot>.zw-focus>.zw-story-header h2>.zw-headline-report.zw-headline-report.zw-headline-report{display:block!important;-webkit-line-clamp:none!important;line-clamp:none!important;overflow:visible!important}
html:root[data-layout="phone-landscape"] body #pnlBoard #bfBoard .zw-page .zw-feed>.zw-slot>.zw-focus[data-zl-lines="2"]>.zw-story-header h2{max-height:2lh!important}
html:root[data-layout="phone-landscape"] body #pnlBoard #bfBoard .zw-page .zw-feed>.zw-slot>.zw-focus[data-zl-lines="1"]>.zw-story-header h2{max-height:1lh!important}
/* a headline given fewer lines gives up the header's bottom padding first (18px: two lines then fit where they did not);
   down to one line, the header no longer shrinks under that line */
html:root[data-layout="phone-landscape"] body #pnlBoard #bfBoard .zw-page .zw-feed>.zw-slot>.zw-focus[data-zl-lines]>.zw-story-header{padding-bottom:var(--sp-1)!important}
html:root[data-layout="phone-landscape"] body #pnlBoard #bfBoard .zw-page .zw-feed>.zw-slot>.zw-focus[data-zl-lines="1"]>.zw-story-header{flex-shrink:0!important}
/* at one line the category line and the byline go too, as News's own short-card step does (news-feed.css data-zw-drop):
   a card that has let its drawing go (data-zw-tight) shows both, and at 280px they pushed the actions out of the card */
html:root[data-layout="phone-landscape"] body #pnlBoard #bfBoard .zw-page .zw-feed>.zw-slot>.zw-focus[data-zl-lines="1"]>.zw-story-header .zw-story-kicker,
html:root[data-layout="phone-landscape"] body #pnlBoard #bfBoard .zw-page .zw-feed>.zw-slot>.zw-focus[data-zl-lines="1"]>.zw-story-header .zw-story-copy>p:has(>.zw-story-byline){display:none!important}
html:root[data-layout="phone-landscape"] body #pnlBoard #bfBoard .zw-page .zw-feed>.zw-slot>.zw-focus[data-zl-cut]>.zw-story-header h2::after{content:"\2026";position:absolute;right:0;bottom:0;height:1lh;padding:0 0 0 var(--sp-1);background:var(--z-raised);pointer-events:none}

/* ── 11. THE PAGE SCROLLS: MARKETS AND A MARKET PAGE (mobile phase 1b, 2026-11-19; Simple and Advanced; phones, both ways) ─
   Safari folds its address bar (and, on its side, its tab bar) only when the DOCUMENT scrolls. The terminal was a fixed
   100%-tall shell with an inner scroller (#bfBoard on Markets, #main on a market page), so the bars never moved and a
   phone on its side kept about 300px of page. Here, on the free view's Markets and market page, the shell stops clipping
   and takes its content's height, and the document is the scroller:
     - the header is sticky at the top; the topic row is sticky under it, in the flow (no spacer), and still slides away
       and back by html[data-za-topics] (index.html ZenaShell.topics now reads the document's scroll here);
     - upright, the tab bar is fixed at the foot and the page is padded by its height;
     - a market page's panes let a swipe that starts in them carry on to the page;
     - the page holds still behind an open sheet (zena-sheets.js data-zs-open, a modal dialog, the outcome sheet).
   News and Ask keep their own scrollers (News: phase 1c). The condition is index.html ZenaLayout.pageScrolls(), which code
   reads through ZenaLayout.scroller(); localStorage zt.pagescroll=off (html[data-zl-inner]) keeps the old scrollers. */
html:root[data-layout^="phone"][data-tier=free]:is([data-za-mode=markets],[data-za-mode=market]):not([data-zl-inner]){height:auto!important;min-height:100%;overflow-y:visible!important;scroll-padding-top:calc(var(--za-header-h) + var(--za-topics-h,0px) + var(--sp-2))}
html:root[data-layout^="phone"][data-tier=free]:is([data-za-mode=markets],[data-za-mode=market]):not([data-zl-inner])>body{height:auto!important;min-height:100%;overflow:visible!important;overflow-x:clip!important}
html:root[data-layout^="phone"][data-tier=free]:is([data-za-mode=markets],[data-za-mode=market]):not([data-zl-inner])>body>#dash.view,
html:root[data-layout^="phone"][data-tier=free]:is([data-za-mode=markets],[data-za-mode=market]):not([data-zl-inner])>body>#dash>.shell,
html:root[data-layout^="phone"][data-tier=free]:is([data-za-mode=markets],[data-za-mode=market]):not([data-zl-inner])>body #main,
html:root[data-layout^="phone"][data-tier=free]:is([data-za-mode=markets],[data-za-mode=market]):not([data-zl-inner])>body #main>.bfwrap,
html:root[data-layout^="phone"][data-tier=free]:is([data-za-mode=markets],[data-za-mode=market]):not([data-zl-inner])>body #pnlBoard,
html:root[data-layout^="phone"][data-tier=free]:is([data-za-mode=markets],[data-za-mode=market]):not([data-zl-inner])>body #bfBoard{overflow:visible!important;height:auto!important;max-height:none!important;min-height:0!important;min-width:0}
/* the header stays at the top */
html:root[data-layout^="phone"][data-tier=free]:is([data-za-mode=markets],[data-za-mode=market]):not([data-zl-inner])>body>.nav{position:sticky!important;top:0!important;z-index:50}
/* the topic row: sticky under the header, in the flow, so the board's spacer for it goes */
html:root[data-layout^="phone"][data-tier=free]:is([data-za-mode=markets],[data-za-mode=market]):not([data-zl-inner])>body #pnlBoard>.zc-board-header{position:sticky!important;top:var(--za-header-h)!important;z-index:40}
html:root[data-layout^="phone"][data-tier=free]:is([data-za-mode=markets],[data-za-mode=market]):not([data-zl-inner])>body #bfBoard::before{display:none!important;height:0!important}
/* THE CATEGORY ROW STAYS (T-20261120-04, handoff 5.3: header 48 and category row 48 are both sticky). The headroom slide
   (html[data-za-topics=away], index.html ZenaShell.topics) carried the row up under the header on the first 10px of the
   reader's scroll down; where the document scrolls the row is sticky and never leaves. */
html:root[data-layout^="phone"][data-tier=free]:is([data-za-mode=markets],[data-za-mode=market]):not([data-zl-inner])[data-za-topics=away]>body #pnlBoard>.zc-board-header{transform:none!important}
/* upright: the tab bar at the foot of the screen, the page padded by it */
html:root[data-layout="phone-portrait"][data-tier=free]:is([data-za-mode=markets],[data-za-mode=market]):not([data-zl-inner])>body{padding-bottom:var(--za-tabbar-h)}
html:root[data-layout="phone-portrait"][data-tier=free]:is([data-za-mode=markets],[data-za-mode=market]):not([data-zl-inner])>body>.zsh-tabbar{position:fixed!important;left:0;right:0;bottom:0;margin:0!important}
/* a swipe that starts in a market page's pane carries on to the page */
html:root[data-layout^="phone"][data-tier=free][data-za-mode=market]:not([data-zl-inner]) body #main :is(.stagebd,.lywrap,.lyrow){overscroll-behavior:auto!important}
/* NEWS STILL MOUNTED: THE BOARD KEEPS THE SCREEN'S HEIGHT (AB-20261125-09, 2026-11-26; phone landscape). A market page
   opened by its address boots through News: for a few frames the mode is already "market" (so the rules above give
   #bfBoard its content's height) while News's page is still in it. News sizes its card frame from the board's own height
   (home-news.js fitWorkspace, on two ResizeObservers), so a taller frame made a taller board and a taller frame again,
   about 1,000px a call (984, 1986, 2988 ...), until WebKit stopped with "ResizeObserver loop completed with undelivered
   notifications". While News's workspace is in the board, the board is the height News is drawn at, the screen under the
   header, whatever it holds (flex:none too: the board is a .pnl-b flex item, and its flex-basis would otherwise size it
   from its content and pass over the height). Markets and a market page never hold .zw-workspace, so this draws nothing there. */
html:root[data-layout="phone-landscape"][data-tier=free]:is([data-za-mode=markets],[data-za-mode=market]):not([data-zl-inner])>body #bfBoard:has(.zw-workspace){flex:none!important;height:calc(100dvh - var(--za-header-h) - var(--za-topics-h,0px))!important}
/* Upright the same boot loops the same way (390x844, a market page by its address: 982px and growing, the same WebKit
   error). News is drawn there between the header and the tab bar, so that is the board's height while it is in it. */
html:root[data-layout="phone-portrait"][data-tier=free]:is([data-za-mode=markets],[data-za-mode=market]):not([data-zl-inner])>body #bfBoard:has(.zw-workspace){flex:none!important;height:calc(100dvh - var(--za-header-h) - var(--za-tabbar-h))!important}
/* the page holds still behind a sheet */
html:root[data-layout^="phone"][data-tier=free]:is([data-za-mode=markets],[data-za-mode=market]):not([data-zl-inner])[data-zs-open],
html:root[data-layout^="phone"][data-tier=free]:is([data-za-mode=markets],[data-za-mode=market]):not([data-zl-inner]).zc-om-sheet,
html:root[data-layout^="phone"][data-tier=free]:is([data-za-mode=markets],[data-za-mode=market]):not([data-zl-inner]):has(dialog:modal){overflow:hidden!important}

/* ── 12. SIDEWAYS, TWO OR MORE OPEN MARKETS: THE STRIP TAKES ITS OWN ROW (T-20261120-04; Simple and Advanced; phone landscape) ─
   markets-calm.css gives the strip of open markets a row under the back row only up to 700px, where it was drawn across
   Save and the Advanced switch. A phone on its side is 667 to 932 wide: past 700 the strip ran under both (852x393, three
   tabs: tabs to x=814, Save at 663-707, Advanced at 721-840). The same rule, for the landscape layout at any width: Back,
   Save and Advanced stay in the top row at their 44px targets, and the strip is the row below. */
html[data-layout="phone-landscape"][data-tier=free] body #main.zc-market-page>.ztabs.zc-free-tabs:has(.ztabwrap>:nth-child(2)){grid-template-rows:48px 44px!important;height:auto!important;row-gap:0;padding-bottom:4px}
html[data-layout="phone-landscape"][data-tier=free] body #main.zc-market-page>.ztabs.zc-free-tabs:has(.ztabwrap>:nth-child(2))>.ztlist{grid-row:2;grid-column:1/-1;height:44px;min-width:0}
html[data-layout="phone-landscape"][data-tier=free] body #main.zc-market-page>.ztabs.zc-free-tabs:has(.ztabwrap>:nth-child(2))>.zc-board-return{grid-row:1}
html[data-layout="phone-landscape"][data-tier=free] body #main.zc-market-page>.ztabs.zc-free-tabs:has(.ztabwrap>:nth-child(2)) .ztabwrap{gap:8px;align-items:center}
html:root[data-layout="phone-landscape"][data-tier=free] body #main#main.zc-market-page>.ztabs.zc-free-tabs:has(.ztabwrap>:nth-child(2)) .zc-market-tab{flex:0 0 calc(50% - 4px)!important;min-width:0!important;max-width:none!important;height:40px;border:0!important;border-radius:var(--z-radius-ctl,10px)!important;background:var(--z-raised)!important;box-shadow:none!important}
html:root[data-layout="phone-landscape"][data-tier=free] body #main#main.zc-market-page>.ztabs.zc-free-tabs:has(.ztabwrap>:nth-child(2)) .zc-market-tab.is-active{background:var(--z-accent-soft)!important}
