/* Alts Terminal responsive layer (Moses, 2026-09-30).
   This file is deliberately loaded after each page's own styles. Desktop rules
   remain in their owning stylesheets; everything here is tablet-sized or less. */

.mobile-menu-button,
.mobile-rail-close,
.mobile-rail-scrim { display: none; }

@media (max-width: 1024px) {
  html { min-width: 0; overflow-x: clip; }
  body { min-width: 0; overflow-x: clip; font-size: max(14px, 1em); }
  img, svg, canvas, video { max-width: 100%; height: auto; }
  .shell { display: block; min-width: 0; }
  .main, main, .content, .body, .wrap, .page, .workspace { min-width: 0; max-width: 100%; }
  .content, .wrap { padding-left: 16px; padding-right: 16px; }

  /* The navigation rail becomes a keyboard- and touch-accessible drawer. */
  .rail, .site-rail {
    position: fixed !important; z-index: 1002 !important; inset: 0 auto 0 0;
    width: min(86vw, 320px) !important; height: 100dvh !important;
    transform: translateX(-105%); transition: transform .2s ease;
    box-shadow: 12px 0 32px rgba(7, 23, 20, .28);
  }
  body.mobile-rail-open .rail, body.mobile-rail-open .site-rail { transform: translateX(0); }
  body.has-site-rail { padding-left: 0 !important; }
  body.has-site-rail .banner { left: 0 !important; }
  .mobile-menu-button, .mobile-rail-close {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 44px; min-height: 44px; border: 1px solid var(--line-strong, #C6D6D1);
    border-radius: 8px; background: #fff; color: var(--ink, #0C1F1C);
    font: 600 14px/1 "IBM Plex Sans", system-ui, sans-serif; cursor: pointer;
  }
  .mobile-menu-button { position: fixed; z-index: 1000; top: 6px; left: 8px; box-shadow: 0 2px 8px rgba(7,23,20,.14); }
  .mobile-rail-close { position: absolute; top: 8px; right: 8px; color: #fff; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.35); }
  .mobile-rail-scrim { position: fixed; z-index: 1001; inset: 0; border: 0; background: rgba(7,23,20,.48); }
  body.mobile-rail-open .mobile-rail-scrim { display: block; }
  body.mobile-rail-open { overflow: hidden; }

  /* The shared suite rules use fixed desktop heights; mobile rows and their
     separate link/caret controls each retain a 44px touch area. */
  html body #suite-nav .railitem {
    min-height: 44px !important; height: auto !important;
  }
  html body #suite-nav .suite-head-label {
    display: flex; align-items: center; min-height: 44px !important;
  }
  html body #suite-nav .suite-caret-btn {
    flex: 0 0 44px; width: 44px; height: 44px; min-width: 44px; min-height: 44px;
  }
  html body .site-rail .site-mark { min-height: 44px; }

  /* Header controls retain their desktop order, using additional rows. */
  .topbar { height: auto !important; min-height: 56px; padding: 6px 10px 6px 60px !important; flex-wrap: wrap; gap: 8px !important; }
  .topbar .search { flex: 1 1 220px !important; min-width: 140px !important; }
  .topbar .topsel { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
  .topbar .topsel > *, .topbar .f, .topbar .mpick, .topbar .mpick-btn { max-width: 100% !important; }
  .topbar .topsel .f.mpick .mpick-btn,
  .topbar .topsel .f.mpick.fundpick .mpick-btn { width: min(100%, 320px) !important; min-height: 44px; }
  .topbar .spacer { display: none; }
  .topbar button, .topbar a, .topbar input, .topbar select { min-height: 44px; }

  /* Tab bars own their overflow instead of widening the document. */
  [role="tablist"], .tabs, .tabstrip, .tab-strip, .ind-tabs, .deal-tabs, .subnav {
    display: flex !important; flex-wrap: nowrap !important; max-width: 100%;
    overflow-x: auto; overflow-y: hidden; overscroll-behavior-inline: contain;
    scrollbar-width: thin; -webkit-overflow-scrolling: touch;
  }
  [role="tablist"] > *:not(.slider), .tabs > *, .tabstrip > *:not(.slider), .tab-strip > *, .ind-tabs > *, .deal-tabs > *, .subnav > * {
    flex: 0 0 auto; min-height: 44px;
  }
  /* The fund underline is also a tab-strip child.  It must remain a two-pixel
     indicator rather than becoming a 44px green tile over the active label. */
  .tabstrip > .slider { min-height: 0 !important; pointer-events: none; }

  /* Dense figures collapse predictably; wide data remains available by pan. */
  .kpis, .kpi-grid, .metrics, .stat-grid, .score-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  table { display: block; width: max-content; min-width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table th:first-child, table td:first-child { position: sticky; left: 0; z-index: 2; background: inherit; box-shadow: 1px 0 var(--line, #DDE6E3); }
  table thead th:first-child { z-index: 4; background: var(--ink, #0C1F1C); color: #fff; }
  .tscroll, .table-scroll, .table-wrap, .tablebox { max-width: 100%; overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  .chart, .chartbox, [class*="chart"], [class*="Chart"] { max-width: 100% !important; min-width: 0 !important; }

  /* Dialogs and the AI surfaces always leave room for an reachable close control. */
  dialog, [role="dialog"], .modal, .popover, .dropdown, .search-results,
  .chat, .chat-pane, .chatpanel, #chat-panel, #chatPane, .explain-popover {
    max-width: calc(100vw - 24px) !important; max-height: calc(100dvh - 24px) !important;
  }
  dialog, [role="dialog"], .modal, .chat, .chat-pane, .chatpanel, #chat-panel, #chatPane { inset: 12px !important; width: auto !important; transform: none !important; }
  button, select, input:not([type="hidden"]), summary, a.btn, .btn, .railitem { min-height: 44px; }
  p, li, td, dd, label, input, select, button { font-size: max(14px, 1em); }
}

@media (max-width: 600px) {
  /* Phone controls occupy layout space instead of covering data. */
  .mobile-menu-button { position: relative; inset: auto; margin: 6px 8px; }
  .topbar { position: static; padding-left: 10px !important; }
  .content, .wrap, .body { padding-left: 16px; padding-right: 16px; }
  /* Figure cards keep two to a row (the 1024 px rule above); one per row only below 340 px, see the end of this file. */
  .topbar .asof { margin-left: 0; }
  h1 { overflow-wrap: anywhere; }

  /* Keep the market action below its title instead of compressing both into
     the first row. Other entity headers retain their desktop order. */
  .entity .id:has(.navrow) { flex-wrap: wrap; }
  .entity .id:has(.navrow) .navrow { flex: 1 0 100%; width: 100%; }
  .entity .id:has(.navrow) .navrow .btn { width: 100%; }
  .entity .id:has(> .actions) { flex-wrap: wrap; }
  .entity .id:has(> .actions) > .avatar + div { flex-basis: 0; flex-grow: 1; min-width: 0; }
  .entity .id > .actions { flex: 1 0 100%; justify-content: flex-end; margin-left: 0; }

  /* feature-tour.js places the first-visit hint after the top bar on phones;
     it participates in layout and therefore cannot obscure the page title. */
  .ftour-hint.mobile-flow {
    position: relative !important; inset: auto !important; box-sizing: border-box;
    width: calc(100% - 24px); max-width: none !important; margin: 8px 12px;
  }
}

@media(max-width:900px){
  .selection-context{margin:8px 12px;gap:8px;padding:12px}
  .selection-context>span{flex:1 1 100%}
  .selection-context .btn{margin-left:0}
  .table-actions{width:100%;margin-left:0;justify-content:flex-end}
  .table-actions button,.table-tools>.how{min-height:44px}
}

/* The phone and tablet use the desktop data, with layout changes confined to
   narrow screens. Every hidden wide-table column remains reachable by scrolling. */
@media (max-width: 1024px) {
  .shell, .main { width: 100%; max-width: 100%; min-width: 0; }
  .main > *, .content > *, .panel, details.section, .card, .ov-band,
  .aiband, .dd-panel, .ir, .live-block { min-width: 0; max-width: 100%; }
  .content { box-sizing: border-box; }

  .rail, .site-rail {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
  .rail .mark { min-height: 56px; padding-right: 64px; }
  .rail .mark .t, .rail .rail-group, .rail .rail-origin,
  .rail .railitem > span:first-child { display: block !important; }
  html body #suite-nav .railitem { justify-content: flex-start; }
  body.mobile-rail-open { overscroll-behavior: contain; }
  .mobile-menu-button:focus-visible, .mobile-rail-close:focus-visible {
    outline: 3px solid var(--jade, #0D8568);
    outline-offset: 2px;
  }

  /* The menu sits inside the top bar, alongside search. */
  body.has-mobile-topbar-menu .topbar {
    padding: 8px 12px !important;
    align-items: center;
    flex-wrap: wrap !important;
    box-sizing: border-box;
    width: 100%;
  }
  body.has-mobile-topbar-menu .topbar > .mobile-menu-button {
    position: static;
    inset: auto;
    flex: 0 0 44px;
    margin: 0;
  }
  body.has-mobile-topbar-menu .topbar .search {
    flex: 1 1 180px !important;
    width: auto !important;
    min-width: min(170px, calc(100vw - 96px)) !important;
  }
  html body .topbar .topsel { flex: 1 0 100% !important; width: 100%; min-width: 0; }
  html body .topbar .topsel > .f { min-width: 0; }
  .topbar .asof { white-space: normal; min-width: 0; }
  .topbar .search-results { z-index: 80; }

  .entity { padding: 12px 14px 0; }
  .entity .id, .entity .facts, .entity .actions { min-width: 0; max-width: 100%; }
  .entity .id > :not(.avatar) { min-width: 0; }
  .entity h1 { font-size: clamp(20px, 3vw, 26px); overflow-wrap: anywhere; }
  .entity .tabstrip { max-width: 100%; scroll-padding-inline: 12px; }
  .entity .tabstrip > .tab { margin-right: 16px; white-space: nowrap; }

  .panels.two, .ov-band .ov-cols2, .aiband .cols2,
  .dd-panel .dd-cols, .ir-readers, .vs {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .panel, .card, .block, details.section, .dd-panel { overflow-wrap: break-word; }
  .table-tools, .table-actions, .ctlbar, .dd-panel .dd-rtoc,
  .dd-panel .dd-actions, .dd-panel .dd-rtoc-tools {
    flex-wrap: wrap;
    max-width: 100%;
  }

  /* A scrollable wrapper is the viewport. The table keeps all its cells and
     natural column widths, including the market-moves comparison. */
  .table-wrap, .tablebox, .tscroll, .table-scroll {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: auto;
    overscroll-behavior-inline: contain;
  }
  :is(.table-wrap, .tablebox, .tscroll, .table-scroll) > table {
    display: table !important;
    width: max-content !important;
    min-width: 100% !important;
    max-width: none !important;
    table-layout: auto !important;
    overflow: visible;
  }
  html body .table-wrap[data-table="market-moves"] table {
    display: table !important;
    width: max-content !important;
    max-width: none !important;
    table-layout: auto !important;
  }
  html body .table-wrap[data-table="market-moves"] :is(th, td):nth-child(2) {
    display: table-cell !important;
  }
  .table-wrap tbody td:first-child,
  .tablebox tbody td:first-child { background: var(--panel, #fff); }
  :is(.table-wrap, .tablebox, .tscroll, .table-scroll, table):focus-visible {
    outline: 2px solid var(--jade, #0D8568);
    outline-offset: -2px;
  }
  .chart, .chartbox, .chart-panel, .chart-wrap,
  .fp-chart, .simple-chat-table { min-width: 0; max-width: 100%; }
  .simple-chat-table { overflow-x: auto; }
  .dd-panel .dd-rtoc-tools { margin-left: 0; }
  .dd-panel .dd-report, .ir, .ir-card { box-sizing: border-box; }
}

@media (max-width: 600px) {
  /* Top bar, three rows at most (P9, 140 px at 390 px): menu, search and the icon buttons share row one; the manager and
     fund choosers share row two; the source date takes row three. The row order is set with `order`, not by moving markup. */
  html body .topbar, html body header.topbar, html body.has-mobile-topbar-menu .topbar {
    padding: 6px 8px !important; gap: 6px !important; min-height: 0; align-items: center;
  }
  body.has-mobile-topbar-menu .topbar > .mobile-menu-button { order: 0; flex: 0 0 44px; }
  body.has-mobile-topbar-menu .topbar .search,
  html body header.topbar > .search {
    order: 1; flex: 1 1 0 !important; min-width: 0 !important; width: auto !important;
  }
  html body .topbar > :is(.btn, button, a):not(.mobile-menu-button) { order: 2; flex: 0 0 auto; }
  html body header.topbar .topsel {
    order: 3; flex: 1 0 100% !important; width: 100%; display: flex; flex-wrap: nowrap; gap: 6px; align-items: stretch;
  }
  html body header.topbar .topsel:empty { display: none; }
  html body header.topbar .topsel .f,
  html body header.topbar .topsel .f.mpick {
    flex: 1 1 0 !important; width: auto !important; min-width: 0 !important; max-width: none !important;
  }
  html body header.topbar .topsel .f.mpick .mpick-btn,
  html body header.topbar .topsel .f.mpick .mpick-btn[aria-haspopup] {
    flex: 1 1 auto !important; width: 100% !important; min-width: 0 !important; max-width: none !important;
    height: auto !important; min-height: 44px;
  }
  html body .topbar .asof { order: 4; flex: 1 0 100%; margin: 0; padding: 0 2px; white-space: normal; }
  .entity .id { flex-wrap: wrap; }
  .entity .id .stat, .entity .id .actions { flex: 1 1 100%; text-align: left; }
  .entity .actions { justify-content: flex-start; }
  .entity .tabstrip { margin-top: 12px; }
  .entity .tabstrip > .tab { padding-bottom: 10px; }
  .content, .wrap { padding-left: 16px; padding-right: 16px; }

  /* The chooser floats inside the phone viewport instead of leaving its right edge. */
  html body .mpick-panel {
    position: fixed !important;
    inset: max(68px, env(safe-area-inset-top, 0px)) 10px auto !important;
    width: auto !important;
    max-width: none !important;
    max-height: calc(100dvh - 82px);
    overflow-y: auto;
    box-sizing: border-box;
  }
  .mpick-panel .mrow {
    grid-template-columns: 66px minmax(0, 1fr);
    grid-template-areas: "k n" "k s" "tag tag";
    min-height: 44px;
  }
  .mpick-panel .mfilters { align-items: stretch; }
  .mpick-panel .mfilters :is(select, input) { min-height: 44px; max-width: 100%; }

  .dd-panel .dd-rtoc { padding: 10px 12px; gap: 8px; }
  .dd-panel .dd-rtoc-tools, .dd-panel .dd-actions { width: 100%; }
  .dd-panel .dd-rtoc-tools > *, .dd-panel .dd-actions > * { min-height: 44px; }
  .ir-card, .ir-verdict { overflow-wrap: anywhere; }

  /* The Consult control remains reachable on long reports. Last-row space is
     reserved so the control cannot cover a chart or a table at the page foot. */
  html body .simple-chat-dock {
    position: fixed;
    inset: auto 12px calc(12px + env(safe-area-inset-bottom, 0px)) auto;
    width: max-content;
    max-width: calc(100vw - 24px);
    margin: 0;
  }
  html body .simple-chat-launch {
    min-height: 48px;
    padding: 9px 14px;
    font-size: 14px !important;
  }
  html body .content { padding-bottom: calc(138px + env(safe-area-inset-bottom, 0px)) !important; }
  html body #simple-chat-drawer {
    height: 100dvh !important;
    min-height: 0 !important;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-sizing: border-box;
  }
  .simple-chat-head { flex-wrap: wrap; }
  .simple-chat-thread { min-height: 0; }
  .simple-chat-form { flex-shrink: 0; }
}

/* ---------------------------------------------------------------- phone shell, round of 2026-10-13
   Every rule below sits behind the 600 px phone width; the 1280 px layout is untouched. */

/* A tab strip that scrolls fades the edge that hides more tabs. The fade follows the strip's own scroll position
   (scroll-driven animation), so the left edge fades only after a swipe and the right edge stops fading at the end.
   A browser without scroll-driven animation shows the strip without a fade. */
@property --tab-fade-l { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --tab-fade-r { syntax: "<length>"; inherits: false; initial-value: 0px; }
@keyframes tab-edge-fade {
  0%   { --tab-fade-l: 0px;  --tab-fade-r: 32px; }
  4%   { --tab-fade-l: 32px; --tab-fade-r: 32px; }
  96%  { --tab-fade-l: 32px; --tab-fade-r: 32px; }
  100% { --tab-fade-l: 32px; --tab-fade-r: 0px; }
}

@media (max-width: 600px) {
  @supports (animation-timeline: scroll()) {
    [role="tablist"]:not(.ov-tabs), .tabs, .tabstrip, .tab-strip, .deal-tabs, .subnav {
      -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--tab-fade-l), #000 calc(100% - var(--tab-fade-r)), transparent 100%);
      mask-image: linear-gradient(90deg, transparent 0, #000 var(--tab-fade-l), #000 calc(100% - var(--tab-fade-r)), transparent 100%);
      animation: tab-edge-fade linear both;
      animation-timeline: scroll(self inline);
    }
  }
  /* The industry report tabs wrap onto further rows, so every tab shows without a swipe. */
  .ind-tabs { flex-wrap: wrap !important; overflow: visible !important; column-gap: 4px; }
  .ind-tabs > * { flex: 1 1 auto !important; }

  /* Figure cards: two to a row down to 340 px. */
  .kpi { min-width: 0; }
  html body .kpi .v { overflow-wrap: anywhere; }
  html body .kpi :is(.l, .r) { font-size: 12px !important; letter-spacing: .04em; }

  /* Information buttons keep their 15 to 19 px circle and take a 44 px square: the square is a transparent border, the circle
     is the padding box (background) with a ring drawn inside it by an inset shadow, and a negative margin gives the
     layout back the room the border takes. --xm is the circle's diameter; --xm-ring is the ring colour of each context. */
  html body .xmark {
    --xm: 19px; --xm-ring: var(--line-strong, #AEC2BB);
    box-sizing: border-box; width: 44px !important; height: 44px !important; padding: 0 !important;
    border: calc((44px - var(--xm)) / 2) solid transparent !important; background-clip: padding-box;
    box-shadow: inset 0 0 0 1px var(--xm-ring);
    margin: calc((var(--xm) - 44px) / 2) !important;
  }
  html body .xmark:is(:hover, :focus-visible) { --xm-ring: var(--jade, #0D8568); }
  html body .xmark.quiet { --xm-ring: var(--line, #C9D8D3); }
  html body .xmark.undocumented { --xm-ring: var(--amber-line, #E0C27A); }
  html body .xmark.info-btn { margin-left: calc((var(--xm) - 44px) / 2 + 6px) !important; }
  html body .blurb .xmark { margin-left: calc((var(--xm) - 44px) / 2 + 2px) !important; }
  html body :is(.aiband, .panel.ai) .xmark { --xm-ring: rgba(255, 255, 255, .3); }
  html body :is(.aiband, .panel.ai) .xmark:is(:hover, :focus-visible) { --xm-ring: var(--signal, #35D6A0); }
  html body thead th .xmark { --xm: 15px; --xm-ring: rgba(255, 255, 255, .35); }
  html body thead th .xmark:is(:hover, :focus-visible) { --xm-ring: var(--signal, #35D6A0); }
  html body thead th .thl + .xmark {
    margin-left: calc((var(--xm) - 44px) / 2 - 16px) !important; margin-right: calc((var(--xm) - 44px) / 2) !important;
  }

  /* Fact chips and links keep their look and take a 44 px square the same way. */
  /* Moses, 2026-10-13, on his phone: the tags under an AI note showed as pale boxes over the text, and an opened tag
   * as a large green pill over the line. The tag keeps its desktop size and look; its 44 px tap area is an unpainted
   * layer around it, so nothing covers the words beside it. */
  html body :is(a, button).factchip { position: relative; min-height: 0 !important; min-width: 0 !important; }
  html body :is(a, button).factchip::after {
    content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: 44px;
    transform: translate(-50%, -50%); background: none; border: 0;
  }
  /* A link that is the action of a table row (Read the investigation report) was 18 px tall: it takes a 44 px row. */
  html body a.row-action-link { display: flex !important; align-items: center; min-height: 44px; margin-top: 0 !important; }
  /* A source link that is the value of a field line in a stacked table (17 px tall) takes a 28 px tap area through an
   * unpainted layer, so the lines keep their spacing. */
  html body table[data-tf-form="stack"] td a[href]:not(.row-action-link, .factchip, .btn) { position: relative; }
  html body table[data-tf-form="stack"] td a[href]:not(.row-action-link, .factchip, .btn)::after {
    content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 28px; transform: translateY(-50%);
    background: none; border: 0;
  }

  /* Tick boxes and option buttons: a 22 px box inside a 44 px square, drawn the same way. */
  html body :is(input[type="checkbox"], input[type="radio"]) {
    -webkit-appearance: none; appearance: none; flex: none;
    box-sizing: border-box; width: 44px; height: 44px; min-height: 44px; margin: -11px; padding: 0;
    border: 11px solid transparent; border-radius: 15px; background: #fff padding-box;
    box-shadow: inset 0 0 0 1.5px #5F7A73; cursor: pointer;
  }
  html body input[type="radio"] { border-radius: 50%; }
  html body input[type="checkbox"]:checked {
    background: var(--jade, #0D8568) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.2 8.4 6.5 11.6 12.8 4.6' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat padding-box;
    box-shadow: inset 0 0 0 1.5px var(--jade-dark, #0a6b55);
  }
  html body input[type="radio"]:checked {
    background: radial-gradient(circle, var(--jade, #0D8568) 0 5px, #fff 5.5px) padding-box;
    box-shadow: inset 0 0 0 1.5px var(--jade-dark, #0a6b55);
  }
  html body :is(input[type="checkbox"], input[type="radio"]):focus-visible { outline: 2px solid var(--jade, #0D8568); outline-offset: -3px; }

  /* Small text: the explain button and the industry report labels reach 12 px. */
  html body :is(button.how, .how) { font-size: 13px !important; }
  /* The Explain pill sets 11.5 px with a heavier selector (cortex-explain.js): on a phone it reads at the 12 px floor.
   * The pill centres its star by flex, so the size change leaves the star level with the word. */
  html body button.how.cortex-explain { font-size: 12px !important; }
  html body :is(header.top .kick, .chip, .kpi .l, .ind-kpi .l, .bottom .kick, .side-toc .toc-title, .fold-tag, .reading .lab,
    .comment-head, .src-chev, .ind-block, sup.cite, sup.tag-sep, header.top .notice, .src-lines, .ind-facts, .ind-kpi .r,
    .ind-sec .sn) { font-size: 12px !important; letter-spacing: .04em; }

  /* Screen-reader labels stay hidden by clipping alone; their old no-wrap box with hidden overflow read as a cut label. */
  .fold-word, .dd-sr { overflow: visible !important; white-space: normal !important; }

  /* Text floor. css/type-scale.css sets every size with !important inside :where() (weight 0), so a plain rule cannot lift
     text. These rules carry html body and !important, which outweigh it: body text of the main column reads 15 px, and the
     smallest text is 12 px (type-scale's own smallest step is 12.5 px; the sub-12 sizes were the pages that load no
     type-scale, handled above). Roles that set their own small size, table cells and the dialogs keep theirs. */
  html body :is(.content, #content) :is(p, li, dd, blockquote):not(.shows, .hint, .note, .cap, .meta, .snip, .sub, .crumb,
    .origin, .footer-note, .live-meta, .xhint, .small, .kicker, .eyebrow, .tag, .chip, .badge, .pill, .factchip,
    [class*="ov-"], [class*="fv-"]):not(td *, th *, .table-wrap *, .xcard *, .simple-chat-drawer *) {
    font-size: 15px !important; line-height: 1.5 !important;
  }
  html body :is(small, figcaption, caption, .shows, .hint, .note, .cap, .meta, .snip, .crumb, .footer-note, .live-meta) {
    font-size: 12.5px !important;
  }

  /* Side gutters: the entity block and the page body keep 16 px on each side. */
  html body :is(.content, #content, .wrap) { padding-left: 16px !important; padding-right: 16px !important; }
  html body .entity { padding-left: 16px !important; padding-right: 16px !important; }

  /* Chart cards: the plot takes the full card width. app.css gives a chart outside a section card 12 px of side padding,
     which left 306 px of plot in a 332 px card. */
  html body .chart:not(.spark) { padding-left: 0 !important; padding-right: 0 !important; }

  /* Labels that were cut with an ellipsis wrap on a phone. */
  html body :is(.topbar .chip, .mpick-btn .t, .railitem, .railitem > span:first-child, .fv-bar-kind, .fp-chart-name,
    .mfo-peer-name) {
    white-space: normal !important; text-overflow: clip !important; overflow-wrap: anywhere;
  }

  /* Section heads: the title sits left with the information button and the Explain pill on its right, on one row; the
     section text takes the row under it. The pill and the button keep 44 px tap areas. */
  html body details.section > summary { flex-wrap: wrap; align-items: center; column-gap: 8px; row-gap: 2px; }
  html body details.section > summary > .fold-ctl { order: 0; }
  html body details.section > summary > h2 { order: 1; flex: 1 1 0 !important; min-width: 0; overflow-wrap: anywhere; }
  html body details.section > summary > .sec-tools {
    order: 2; margin-left: auto; flex: 0 0 auto; flex-wrap: nowrap; justify-content: flex-end; gap: 6px; min-width: 0;
  }
  html body details.section > summary > .sec-tools > :is(button, a, .how, .btn, .cortex-explain, .ab-inline) { min-height: 44px; }
  html body details.section > summary > .snip { order: 3; flex: 1 0 100%; }
}

@media (max-width: 339px) {
  .kpis, .kpi-grid, .metrics, .stat-grid, .score-grid { grid-template-columns: 1fr !important; }
}

@media print {
  .mobile-menu-button, .mobile-rail-close, .mobile-rail-scrim { display: none !important; }
  .table-wrap table { width: 100% !important; max-width: 100% !important; }
}
