/* The Explorer's own styles, loaded after the site's /site.css (which owns the
   header, section bar and footer). Tokens follow the SQX brand kit's blue and
   neutrals (site.css :root); the class colours are classes.css's. The page
   is light only, as the site is. */
:root {
  color-scheme: light;
  --blue: var(--accent);
  --ink: #1A2430;
  --muted: #444C55;
  --na: #5F6870;
  --page: #FFFFFF;
  --panel: #FFFFFF;
  --panel-2: #E7E9EF;
  --line: #D3D7DF;
  --accent-bg: #EEF1F5;
  --warn: #B7791F;
  --warn-ink: #7A5200;
  --kept: var(--accent);
  --removed: #B8C0C8;
  --focus: var(--accent);
  --pin-bg: #EEF1F5;
  --head: 'Roboto', system-ui, 'Segoe UI', sans-serif;
  --body: 'Roboto', system-ui, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
button { font: inherit; cursor: pointer; color: inherit; }
a { color: var(--blue); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.link-btn { background: none; border: 0; color: var(--blue); padding: 0; text-decoration: underline; }

/* class identity */
.c-corporate_bond { --c: var(--c-corporate_bond); }
.c-municipal_bond { --c: var(--c-municipal_bond); }
.c-government_bond { --c: var(--c-government_bond); }
.c-structured_note { --c: var(--c-structured_note); }
.c-cd { --c: var(--c-cd); }
.c-fund { --c: var(--c-fund); }
.c-alternative_investment { --c: var(--c-alternative_investment); }
.c-equity { --c: var(--c-equity); }
.c-index { --c: var(--c-index); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 3px; vertical-align: 1px; }


/* The site footer starts below the first screen: the list and the detail view
   each take at least the window under the bars, so the rows and sections that
   fill in after the first paint never move the footer where a reader sees it. */
.layout, .detail-view { min-height: calc(100vh - var(--chrome-h, 128px)); }
.layout { max-width: 1440px; margin: 0 auto; padding: 16px 32px 40px; display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }

/* rail: its own scroll only when taller than the window */
.rail { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px 16px 16px; position: sticky; top: calc(var(--chrome-offset, 0px) + 12px); max-height: calc(100vh - 24px - var(--chrome-offset, 0px)); overflow-y: auto; scrollbar-gutter: stable; transition: top 0.22s ease-out; }
.rail-head { display: flex; align-items: baseline; gap: 8px; }
.rail-head h2 { font: 700 18px var(--head); margin: 0; color: var(--navy); flex: 1; }
.rail-close { display: none; }
/* the fields the box searches, above it: wraps in the rail's width, where a placeholder is cut */
.search-label { display: block; margin-top: 10px; font-size: 14px; line-height: 1.35; color: var(--muted); }
.search input { width: 100%; margin: 4px 0 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; font: inherit; background: var(--panel); color: var(--ink); }
.rail-sec { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.rail-sec h3, .rail-sec summary { font: 700 14px var(--head); color: var(--navy); margin: 0 0 6px; }
.rail-sec summary { cursor: pointer; list-style-position: outside; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 3px 10px; font-size: 13px; min-height: 30px; }
.chip .n { color: var(--muted); margin-left: 4px; font-variant-numeric: tabular-nums; }
.option-filter { width: 100%; box-sizing: border-box; margin: 0 0 6px; padding: 5px 8px; font-size: 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: inherit; }
.show-all { margin-top: 6px; border: 0; background: none; padding: 4px 0; color: var(--blue); font-size: 13px; cursor: pointer; min-height: 30px; }
.show-all:focus-visible, .option-filter:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.effect-sentence { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--accent-bg); border-color: var(--blue); color: var(--blue); font-weight: 600; }

.facet { margin: 8px 0 14px; }
.facet-label { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
/* Range sliders: two triangular handles pointing inward on a
   thin track, the two ends' values printed above it. */
.ds-labels { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; margin-bottom: 2px; }
.facet.is-set .ds-labels { color: var(--ink); }
.ds { position: relative; height: 20px; }
/* The track is the wrapper's, so a lifted handle's input never paints over the other handle. */
.ds::before { content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 4px; border-radius: 2px; background: var(--line); }
.ds input[type="range"] { position: absolute; inset: 0; width: 100%; height: 20px; margin: 0; background: transparent; pointer-events: none; -webkit-appearance: none; appearance: none; }
.ds input[type="range"]:focus { outline: none; }
.ds input::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: transparent; }
.ds input::-moz-range-track { height: 4px; border-radius: 2px; background: transparent; }
.ds input::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; margin-top: -5px; border: 0; border-radius: 0; background: var(--blue); cursor: pointer; pointer-events: auto; }
.ds input::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 0; background: var(--blue); cursor: pointer; pointer-events: auto; }
.ds .ds-lo::-webkit-slider-thumb { clip-path: polygon(0 0, 100% 50%, 0 100%); }
.ds .ds-hi::-webkit-slider-thumb { clip-path: polygon(100% 0, 0 50%, 100% 100%); }
.ds .ds-lo::-moz-range-thumb { clip-path: polygon(0 0, 100% 50%, 0 100%); }
.ds .ds-hi::-moz-range-thumb { clip-path: polygon(100% 0, 0 50%, 100% 100%); }
.ds input:hover::-webkit-slider-thumb { filter: brightness(1.3); }
.ds input:focus-visible::-webkit-slider-thumb { background: var(--ink); }
.ds input:focus-visible::-moz-range-thumb { background: var(--ink); }
.unknown-toggle { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 6px; }
.facet.is-set > .facet-label > span:first-child { color: var(--blue); }

/* results */
.results { min-width: 0; }
.results-bar { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.page-title { font: 700 30px/1.15 var(--head); color: var(--ink); margin: 0; }
.count { font: 500 16px var(--head); color: var(--muted); flex: 1; font-variant-numeric: tabular-nums; }
.filters-btn { display: none; }
.ghost-btn { background: var(--panel); border: 1px solid var(--blue); color: var(--blue); border-radius: 4px; padding: 6px 12px; font-size: 14px; min-height: 36px; }
.api-btn-foot { display: none; }
.api { margin: 10px 0 0; padding: 8px 10px; background: var(--sqx-ink, #1A2430); color: #EAF2FA; border-radius: 4px; font: 13px var(--mono, ui-monospace, monospace); white-space: pre-wrap; word-break: break-all; }
.hint { margin: 10px 0 0; font-size: 14px; color: var(--muted); }

/* effect rows */
.effects { margin: 10px 0 12px; display: grid; gap: 8px; }
.effects:empty { display: none; }
.effect { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px 8px 12px; }
.effect-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.effect-label { background: none; border: 0; padding: 0; text-align: left; color: var(--navy); font: 500 14px var(--head); cursor: default; }
.remove { background: none; border: 0; color: var(--muted); font-size: 18px; line-height: 1; width: 32px; height: 32px; border-radius: 50%; }
.remove:hover { background: var(--panel-2); color: var(--ink); }
.bar { display: flex; gap: 2px; height: 10px; margin: 6px 0 5px; }
.seg { min-width: 3px; border-radius: 2px; }
.seg.kept { background: var(--kept); }
.seg.removed { background: var(--removed); }
.seg.silent { background: var(--c); }
.seg.hidden { background: repeating-linear-gradient(135deg, var(--warn) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--warn); }
.effect-nums { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.key.kept { background: var(--kept); }
.key.removed { background: var(--removed); }
.key.hidden { background: repeating-linear-gradient(135deg, var(--warn) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--warn); }
.passthrough { font-size: 14px; color: var(--ink); padding: 2px 2px; }

/* table: on a desktop the table keeps every column (app.js layoutColumns) and its
   box scrolls it, both ways, as the funds site's list does (sqxray fund-map's table
   pane): the box is no taller than the window under the site's bars (the rail's
   height), so its sideways scrollbar is on screen, and the header sticks to the
   box's top. A phone's table fits its width (one Key figures cell): its box does
   not scroll, and the header sticks to the page, under the site's bars while they
   show (--chrome-offset, set by the header script). */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  overflow: auto; max-height: calc(100vh - 24px - var(--chrome-offset, 0px)); }
/* The Instrument column's floor: app.js sets the table's minimum width to the other
   columns' widths (below) and this, and the box scrolls a wider table sideways.
   160px holds the widest class badge and a name's first words, and leaves a 1920px
   window's table, beside the rail and the preview pane, every column of a list of
   all classes without scrolling. A longer name ends in an ellipsis, its full text
   in the link's title. */
.table-wrap { --name-min: 160px; }
/* A list redrawn at a new height adds or removes the page's scrollbar, which would
   move the table and the panes beside it; a reserved gutter keeps them still. */
html:has(.table-wrap) { scrollbar-gutter: stable; }
.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; table-layout: fixed; font-variant-numeric: tabular-nums; }
.grid th { position: sticky; top: 0; transition: top 0.22s ease-out; z-index: 1; background: var(--blue); color: #fff; text-align: left; font: 500 13px var(--head); padding: 8px 10px; white-space: nowrap; }
.grid th:first-child { border-top-left-radius: 5px; }
.grid th.col-name { width: auto; }
.grid th:last-child { border-top-right-radius: 5px; }
.grid th.col-class { width: 128px; }
.grid th.col-isin { width: 112px; }  /* a 12-character ISIN at 12px (letters wider than digits) plus the cell padding */
.grid th.date { width: 100px; }
.grid th.num { width: 84px; }
/* a figure too wide for its column wraps at its space rather than cut: a non-dollar
   size's currency over the figure ("MXN" / "200B"), a long price's basis under it
   ("1,294,000.00" / "KRW") */
.grid td.size, .grid td.price { white-space: normal; line-height: 1.25; }
.grid th.price { width: 112px; }  /* "50,000.00 /unit" and "729.00 TWD" fit; the cell ellipsis never reaches the basis */
.grid th.col-detail { width: 180px; }  /* a note's 160 px cushion drawing plus the cell padding */
.grid th.col-mobile { width: 42%; }
.grid th button { background: none; border: 0; color: inherit; font: inherit; padding: 0; }
.grid th[aria-sort] button::after { content: " ▲"; font-size: 10px; }
.grid th[aria-sort="descending"] button::after { content: " ▼"; }
.grid .num { text-align: right; }
/* A note's Cushion (cushion.js): a bar per threshold from today's level (the
   centre line). Green is the favourable side of a coupon, protection or digital
   threshold, red the other; yellow is a level at or above the autocall trigger
   (the note calls on its next call date). The red is the explorer's own (--bad).
   Each bar's threshold letter (C, A, P, D) at its outer end is muted ink, not the
   bar's colour, which at 8 px would be too faint in yellow (--cushion-k).
   The page is light only; the dark values wait for a dark theme to set them. */
:root { --gain: #1e9a55; --wait: #c79400; --below: var(--bad); --cushion-k: var(--muted); }
:root[data-theme="dark"] { --gain: #42bd78; --wait: #e5b52e; --below: #e66767; --cushion-k: #aeb6bf; }
.cushion { display: inline-block; vertical-align: middle; line-height: 0; }
.cushion-svg { display: block; width: 160px; max-width: 100%; height: auto; }
.cushion-now { stroke: var(--ink); stroke-width: 2; }
.cushion-k { fill: var(--cushion-k); font: 500 8px/1 var(--body); }
/* the hit box: the whole drawing, so the tooltip shows between the bars too */
.cushion-hit { fill: transparent; pointer-events: all; }
.cushion-text { color: var(--muted); }
.grid td { padding: 6px 10px; border-top: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid tr.row td:first-child { box-shadow: inset 3px 0 0 var(--c); }
.grid tbody tr.row:hover td { background: var(--accent-bg); }
/* the preview pane (detail.js): the row it shows, and the row the reader pinned */
.grid tbody tr.row.peeked td { background: var(--accent-bg); }
.grid tbody tr.row.pinned td { background: var(--pin-bg); }
.grid tbody tr.row.pinned td:first-child { box-shadow: inset 5px 0 0 var(--c); }
.peek { display: none; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px 16px 16px;
  position: sticky; top: calc(var(--chrome-offset, 0px) + 12px); max-height: calc(100vh - 24px - var(--chrome-offset, 0px)); overflow-y: auto; min-width: 0; transition: top 0.22s ease-out; }
.peek-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.peek-pin { font-size: 12px; color: var(--blue); border: 1px solid var(--blue); border-radius: 10px; padding: 0 8px; }
.peek-title { font: 500 20px/1.25 var(--head); margin: 8px 0 4px; text-wrap: balance; overflow-wrap: anywhere; }
.peek .detail-ids { margin: 0 0 6px; }
.peek-open { display: inline-block; margin: 2px 0 12px; font-weight: 600; }
.peek .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.peek .card { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 12px 0 0; margin-top: 14px; }
.peek-more { display: flex; flex-direction: column; gap: 2px; margin: 14px 0 0; border-top: 1px solid var(--line); padding-top: 10px; }
.peek-hint { margin-top: 12px; }
/* The pane's 330px leaves a 1440px window's table room for the ISIN column beside
   it with a classic page scrollbar (15-17px) as well as an overlay one; the rail
   keeps its 280px, which its own scrollbar gutter already narrows. */
@media (min-width: 1400px) {
  .layout { max-width: 1880px; grid-template-columns: 280px minmax(0, 1fr) 330px; }
  .peek { display: block; }
  .grid tbody tr.row { cursor: pointer; }
}
.inst { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--ink); text-decoration: none; }
a.name:hover, a.name:focus-visible { color: var(--blue); text-decoration: underline; }
/* identifiers are data, not code: the body font with tabular figures (site.css
   --mono is for code only) */
.isin { flex: none; font: 12px var(--body); font-variant-numeric: tabular-nums; color: var(--muted); }
/* an exchange symbol, the identifier most readers search by */
.ticker { flex: none; font: 600 12px var(--body); color: var(--navy); }
.count .order { font: 400 14px var(--body); }
/* the ISIN, class badge and key figure a table without their columns (a phone's)
   draws under the name (app.js renderBody); each wraps onto the next line when it does not fit */
.sub { display: flex; font-size: 12px; color: var(--muted); margin-top: 2px; gap: 2px 8px; flex-wrap: wrap; align-items: baseline; min-width: 0; }
.sub:empty { display: none; }
.sub .badge { flex: none; }
/* a flex row gets no ellipsis from the cell, so the key figure carries its own */
/* sub-type: a one-class list's type under the name, which a phone keeps (its
   figures cell leaves the type out); sub-detail: the key figure, which a phone hides */
.sub-detail, .sub-type { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { display: inline-block; font: 12px var(--body); padding: 0 7px; border-radius: 10px; background: var(--panel-2); color: var(--navy); }
.basis { color: var(--muted); font-size: 12px; }
.na { color: var(--na); }
.unk { color: var(--muted); text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
/* A licensed-data stub (explorer_teaser.py): a withheld figure's marker, and the
   offer drawn over a muted, empty plot where the price chart sits. The button is
   the site's own (site.css .site-btn). */
.lic { color: var(--muted); font-size: 12px; white-space: nowrap; cursor: help; }
/* a narrow figure column wraps the marker onto two lines rather than cut it */
.grid td .lic { display: inline-block; max-width: 100%; white-space: normal; line-height: 1.2; vertical-align: middle; }
.stub-plot { display: flex; align-items: center; justify-content: center; min-height: 240px; padding: 28px 16px;
  border: 1px solid var(--line); border-radius: 4px;
  background: repeating-linear-gradient(to bottom, transparent 0 47px, var(--line) 47px 48px), var(--accent-bg); }
.stub-offer { max-width: 30rem; background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 18px 20px; text-align: center; }
.card .stub-msg { margin: 0 0 14px; font-size: 15px; line-height: 1.5; color: var(--ink); }
.stub-cta { display: inline-block; margin-top: 0; }
.peek .stub-plot { min-height: 0; padding: 16px 12px; }
.divider td { background: var(--panel-2); color: var(--navy); font: 600 13px var(--head); padding: 5px 10px; }
.foot { color: var(--muted); font-size: 13px; }
.foot p { margin: 10px 0; }
.fine { max-width: 90ch; }


@media (prefers-reduced-motion: reduce) { .rail, .peek, .grid th { transition: none; } }

/* phone: the rail becomes a sheet over the results */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; padding: 12px 16px 32px; }
  /* above the site's pinned header (z-index 20), whose bar would cover the sheet's close button */
  .rail { display: none; position: fixed; inset: 0; z-index: 30; border-radius: 0; max-height: none; top: 0; }
  body.rail-open .rail { display: block; }
  body.rail-open { overflow: hidden; }
  .rail-close { display: inline-block; background: var(--blue); color: #fff; border: 0; border-radius: 4px; padding: 6px 12px; min-height: 40px; }
  .page-title { font-size: 24px; }
  /* the count on a line of its own: beside the title and the Filters button it wraps
     to a height its text sets, which moves the table when the list arrives */
  .count { order: 1; flex-basis: 100%; }
  .filters-btn { display: inline-block; background: var(--blue); color: #fff; border: 0; border-radius: 4px; padding: 8px 16px; min-height: 40px; font-weight: 600; }
  .api-btn { display: none; }
  .api-btn-foot { display: inline-block; }
  .sub-detail { display: none; }
  .foot .fine { font-size: 14px; }  /* the phone text floor; the footnote is body text */
  .table-wrap { overflow: visible; max-height: none; }
  .grid th { top: var(--chrome-offset, 0px); }
  .grid th.col-name { width: 58%; }
  .grid td.col-mobile { white-space: normal; font-size: 13px; }
  .col-mobile .fig { display: inline-block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
  .col-mobile .fig-cushion { display: block; margin-top: 3px; }
  .inst { flex-direction: column; gap: 0; }
  .inst .name { width: 100%; }
  .effect-nums { gap: 2px 12px; display: none; }
  .effect.open .effect-nums { display: flex; }
  .effect-label { cursor: pointer; }
  .effect-label::after { content: " ▾"; color: var(--muted); }
  .effect.open .effect-label::after { content: " ▴"; }
}

/* detail page: the list's layout hides, the instrument's sections show */
body.view-detail .layout { display: none; }
/* a site whose list page another app draws (meta explorer-list "none", app.js NO_LIST)
   shows no list, from the first paint */
html:has(> head meta[name="explorer-list"][content="none"]) .layout { display: none; }
/* the list's views (app.js addView): the tab strip sits on the list's column edges,
   and a view other than the list draws in the pane in its place */
.view-tabs, .view-pane { width: 100%; box-sizing: border-box; max-width: 1440px; margin: 0 auto; padding: 12px 32px 0; }
.view-tabs .detail-tabs { margin-bottom: 0; }
.view-pane { padding-bottom: 40px; min-height: calc(100vh - var(--chrome-h, 128px)); }
.view-tabs[hidden], .view-pane[hidden], body.view-detail .view-tabs, body.view-detail .view-pane, body.view-other .layout { display: none; }
@media (min-width: 1400px) { .view-tabs, .view-pane { max-width: 1880px; } }
@media (max-width: 860px) { .view-tabs, .view-pane { padding-left: 16px; padding-right: 16px; } }
.detail-view { max-width: 1180px; margin: 0 auto; padding: 16px 32px 48px; }
.detail-head { margin-bottom: 14px; }
.crumbs { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.crumbs a { font-weight: 600; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs a.badge { font-weight: 400; color: var(--navy); }
.detail-api-row { margin-top: 8px; }
.detail-api-row .api { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-title { font: 700 26px/1.2 var(--head); color: var(--navy); margin: 8px 0 4px; }
.detail-ids { margin: 0; color: var(--muted); font-size: 14px; }
.detail-ids .desc { color: var(--ink); }
.detail-head .badge { border-left: 3px solid var(--c); border-radius: 0 10px 10px 0; }
.loading { color: var(--muted); white-space: pre; }
/* ".", ". .", ". . .", then "." again: the 2nd and 3rd dots show in turn and keep their
   room while hidden, so the line never changes width */
.loading-dot { animation: 1.2s steps(1, end) infinite; }
.loading-dot:nth-child(2) { animation-name: loading-dot-2; }
.loading-dot:nth-child(3) { animation-name: loading-dot-3; }
@keyframes loading-dot-2 { 0% { visibility: hidden; } 33.3% { visibility: visible; } }
@keyframes loading-dot-3 { 0% { visibility: hidden; } 66.7% { visibility: visible; } }
@media (prefers-reduced-motion: reduce) { .loading-dot { animation: none; } }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px 16px 14px; min-width: 0; }
.card.wide { grid-column: 1 / -1; }
/* the headline beside a fund's title (detail.js headlineTiles): its figures as tiles,
   two by two, in place of Key facts; the exit cost, SQX's own figure, outlined */
.detail-headline { display: grid; grid-template-columns: minmax(0, 1fr) var(--tiles-w, auto); gap: 12px var(--tiles-gap, 28px); align-items: start; }
/* a fund's header keeps the tiles' column from the first paint: the server's HTML
   (explorer_pages.summary_html) and a page drawn before its document draw no tiles,
   and the title and ids keep the width they will have beside them, so the tiles'
   arrival moves no line (test_unified_explorer_layout_shift.sh) */
@media (min-width: 861px) {
  .detail-head.c-fund { --tiles-w: 368px; --tiles-gap: 28px; }
  .detail-head.c-fund > .detail-title, .detail-head.c-fund > .detail-ids, .detail-head.c-fund > .share-classes, .detail-head.c-fund > .detail-api-row {
    max-width: calc(100% - var(--tiles-w) - var(--tiles-gap)); }
}
.detail-tiles { display: grid; grid-template-columns: repeat(2, minmax(150px, 1fr)); gap: 8px; margin-top: 8px; }
.detail-tile { display: flex; flex-direction: column; min-width: 0; background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; padding: 9px 13px 10px; }
.detail-tile.tile-own { border-color: var(--blue); box-shadow: inset 0 3px 0 var(--blue); }
.tile-label { font: 600 11px/1.3 var(--head); letter-spacing: var(--tracking-caps, 0.08em); text-transform: uppercase; color: var(--blue); }
.tile-value { font: 700 20px/1.25 var(--head); color: var(--ink); margin-top: 3px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile-value .rating-band { vertical-align: middle; }
.tile-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
/* a narrow section alone between wide ones (detail.js pairColumns) */
.card.solo { grid-column: 1 / -1; }
/* a tab bar (app.js views): the bar wraps on a phone, so every tab stays in sight */
.detail-tabs { display: flex; flex-wrap: wrap; gap: 0 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.detail-tab { background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px;
  padding: 10px 14px 8px; font: 600 15px/1.3 var(--head); color: var(--blue); }
.detail-tab:hover { color: var(--navy); }
.detail-tab[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--blue); }
/* every section on one page beside a navigation pane (detail.js onePage): the pane
   stays in view on a desktop; on a phone it is a scrolling row of the groups */
.detail-page { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 22px; margin-top: 18px; align-items: start; }
.detail-nav { position: sticky; top: calc(var(--chrome-offset, 0px) + 12px); max-height: calc(100vh - 24px - var(--chrome-offset, 0px));
  overflow-y: auto; transition: top 0.22s ease-out; font: 500 13px/1.35 var(--head); }
.detail-nav ol { list-style: none; margin: 0; padding: 0; }
.detail-nav > ol > li { margin: 0 0 2px; }
.detail-nav li.nav-group { margin-top: 10px; }
.detail-nav li.nav-group > a { font-weight: 700; color: var(--navy); text-transform: uppercase; font-size: 11px; letter-spacing: var(--tracking-caps, 0.08em); }
.detail-nav a, .detail-nav a:visited { display: block; padding: 4px 10px; border-left: 3px solid transparent; color: var(--blue); text-decoration: none; }
.detail-nav a:hover { color: var(--navy); background: var(--panel); }
.detail-nav li[data-for].on > a { color: var(--navy); border-left-color: var(--blue); background: var(--panel); }
.detail-main > .cards + .detail-group, .detail-group + .detail-group { margin-top: 26px; }
.group-title { font: 700 13px var(--head); text-transform: uppercase; letter-spacing: var(--tracking-caps, 0.08em); color: var(--blue);
  border-bottom: 1px solid var(--line); padding-bottom: 6px; margin: 0 0 12px; }
.detail-group, .detail-main .card { scroll-margin-top: calc(var(--chrome-offset, 0px) + 64px); }
/* a fund's share classes (detail.js shareClasses) */
.share-classes { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.share-classes .pill { font: 600 12px/1 var(--head); padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--blue); background: var(--panel); text-decoration: none; }
.share-classes a.pill:hover { border-color: var(--blue); color: var(--navy); }
.share-classes .pill[aria-current] { background: var(--blue); border-color: var(--blue); color: #fff; }
.share-classes span.pill:not([aria-current]) { color: var(--muted); }
@media (max-width: 860px) {
  .detail-page { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .detail-nav { top: var(--chrome-offset, 0px); z-index: 2; background: var(--page); border-bottom: 1px solid var(--line);
    max-height: none; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .detail-nav > ol { display: flex; gap: 2px; white-space: nowrap; }
  .detail-nav > ol > li[data-for], .detail-nav li.nav-group > ol { display: none; }
  .detail-nav li.nav-group { margin: 0; }
  .detail-nav li.nav-group > a { padding: 9px 10px; border-left: 0; border-bottom: 3px solid transparent; }
  .detail-nav li.nav-group.on > a { border-bottom-color: var(--blue); }
}
.card h2 { font: 700 16px var(--head); color: var(--navy); margin: 0 0 10px; }
.card h3 { font: 600 14px var(--head); color: var(--navy); margin: 12px 0 6px; }
.card p { margin: 6px 0; }
.source { color: var(--muted); font-size: 12px; margin-top: 10px !important; }
.lede { font-size: 14px; color: var(--ink); max-width: 80ch; }
.fine { color: var(--muted); font-size: 12px; }
.kv { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: 4px 16px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px 16px; }
.stat-row { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-bottom: 8px; }
.stat { display: flex; flex-direction: column; min-width: 0; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font: 500 18px var(--head); color: var(--ink); }
.stat-sub { font-size: 12px; color: var(--muted); }
.chart-title { font-size: 13px; color: var(--muted); margin: 10px 0 2px !important; }
.chart-wrap { position: relative; }
.chart { display: block; overflow: visible; }
.chart:focus-visible { outline-offset: 4px; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--muted); font: 11px var(--body); font-variant-numeric: tabular-nums; }
.chart .tick-sub { font-size: 10px; }
.chart .pt-label { fill: var(--ink); font: 600 10.5px var(--body); font-variant-numeric: tabular-nums; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; }
.chart .ptitle, .chart .vlabel, .chart .hlabel { fill: var(--muted); font: 11px var(--body); }
.chart .hair { stroke: var(--muted); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: crosshair; }
/* series roles: the class colour for the instrument itself, a fixed categorical
   order for underliers (the site's chart palette, slot by slot, never cycled past 8),
   ink for the evaluation curve, muted dashes for thresholds and references */
:root {
  --u1: var(--chart-1, #005388); --u2: var(--chart-2, #C4561F); --u3: var(--chart-3, #12876A); --u4: var(--chart-4, #8B4FB8);
  --u5: var(--chart-5, #8D6E00); --u6: var(--chart-6, #C2336B); --u7: var(--chart-7, #4B5563); --u8: var(--chart-8, #2AA3C9);
  --good: var(--chart-up, #12876A); --bad: var(--chart-down, #B3261E); --barrier: var(--chart-5, #8D6E00); --trigger: var(--chart-4, #8B4FB8);
}
.ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ln.thin { stroke-width: 1.4; opacity: .75; }
.ln.bold { stroke-width: 3; }
.s-c { stroke: var(--c, var(--blue)); }
.area.s-c { fill: var(--c, var(--blue)); stroke: none; opacity: .1; }
.u1 { stroke: var(--u1); } .u2 { stroke: var(--u2); } .u3 { stroke: var(--u3); } .u4 { stroke: var(--u4); }
.u5 { stroke: var(--u5); } .u6 { stroke: var(--u6); } .u7 { stroke: var(--u7); } .u8 { stroke: var(--u8); }
.s-ink { stroke: var(--ink); }
.s-ref { stroke: var(--na); stroke-width: 1; }
.s-ref.dashed { stroke-dasharray: 5 4; stroke-width: 1.5; }
.s-ref.dotted { stroke-dasharray: 2 3; }
.s-barrier { stroke: var(--barrier); stroke-width: 1.5; stroke-dasharray: 3 3; }
.s-trigger { stroke: var(--trigger); stroke-width: 1.5; stroke-dasharray: 8 3 2 3; }
.s-next { stroke: var(--sqx-ink, #1A2430); stroke-width: 1; stroke-dasharray: 5 4; }
.chart .vlabel.s-next, .chart .vlabel.s-ink { fill: var(--ink); }
.chart .hlabel.s-trigger, .chart .vlabel.s-trigger { fill: var(--trigger); }
.chart .vlabel.s-barrier { fill: var(--barrier); }
/* A label takes its series class for colour; that class also carries the line's
   stroke, which SVG text would draw around every glyph. */
.chart text.vlabel, .chart text.hlabel { stroke: none; }
.mk { stroke: var(--panel); stroke-width: 1.5; }
.mk.s-c { fill: var(--c, var(--blue)); }
.mk.s-good { fill: var(--good); } .mk.s-call { fill: var(--trigger); } .mk.s-ink { fill: var(--ink); }
.mk-x.s-bad { stroke: var(--bad); stroke-width: 2.5; fill: none; }
.mk-tick { stroke: var(--muted); stroke-width: 1.5; }
/* a muni's MBIS records (market_activity, series_bonds): the categorical palette's
   first three slots in order, each side with its own marker shape */
.mk.s-offer { fill: var(--u1); } .mk.s-bid { fill: var(--u2); } .mk.s-trade { fill: var(--u3); }
/* a quote beyond the chart's range, drawn at its edge (detail.js sideLayers) */
.mk.off { fill: var(--panel); stroke-width: 2; } .mk.off.s-offer { stroke: var(--u1); } .mk.off.s-bid { stroke: var(--u2); } .mk.off.s-trade { stroke: var(--u3); }
/* market_activity's and series_bonds' marks, area by par (detail.js sideLayers maxPar): filled see-through
   and outlined in the side's colour, so overlapping quotes stay visible through each other */
.mk.sz { fill-opacity: .4; stroke-width: 1; } .mk.sz.s-offer { stroke: var(--u1); } .mk.sz.s-bid { stroke: var(--u2); } .mk.sz.s-trade { stroke: var(--u3); }
.mk.sz.off { fill-opacity: 0; stroke-width: 1.5; }
.mk.sz.s-size { fill: var(--muted); stroke: var(--muted); }
/* series_bonds' marks fill fainter: every bond's quotes of a day share one x, so they overlap more */
.card[data-component="series_bonds"] .mk.sz { fill-opacity: .28; }
.card[data-component="series_bonds"] .mk.sz.off { fill-opacity: 0; }
.fill-good { fill: var(--good); opacity: .16; stroke: none; }
.fill-bad { fill: var(--bad); opacity: .14; stroke: none; }
.band.future { fill: var(--muted); opacity: .07; }
.band.ended { fill: var(--muted); opacity: .14; }
.swatch { flex: none; overflow: visible; }
.legend-item { display: inline-flex; align-items: center; gap: 4px; }
.legend { margin: 4px 0 2px; }
.tip { position: absolute; pointer-events: none; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 4px 8px; font-size: 12px; box-shadow: 0 2px 6px rgba(0,0,0,.12); display: flex; flex-direction: column; white-space: nowrap; }
.tip strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.tip span { color: var(--muted); }
.tip .tip-title { color: var(--ink); font-weight: 600; margin-bottom: 2px; }
.tip .tip-row { display: flex; align-items: center; gap: 4px; }
.tip .tip-row strong { color: var(--ink); margin-left: auto; padding-left: 8px; }
.legend { display: flex; align-items: center; gap: 6px 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.table-view summary { cursor: pointer; font-size: 13px; color: var(--blue); margin-top: 8px; }
.dtable-wrap { overflow-x: auto; }
.dtable { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.dtable th { text-align: left; font: 500 12px var(--head); color: var(--muted); border-bottom: 1px solid var(--line); padding: 4px 8px 4px 0; white-space: nowrap; }
.dtable td { border-bottom: 1px solid var(--line); padding: 4px 8px 4px 0; vertical-align: top; }
.dtable .num { text-align: right; }
.dtable tr.past td { color: var(--muted); }
.dtable tr.next td { background: var(--accent-bg); font-weight: 600; }
.more-btn { margin-top: 8px; }
.plain-list { margin: 0; padding-left: 18px; font-size: 14px; }
.site-btn { display: inline-block; text-decoration: none; }
.detail-missing { padding: 24px 0; }
@media (max-width: 860px) {
  .detail-view { padding: 12px 16px 32px; }
  .detail-title { font-size: 21px; }
  /* the row above the title stays one line (its height is the server's, explorer_pages.py)
     and inside the screen: the steps keep their links, the position in the results
     gives way, and the class badge shortens to fit */
  .crumbs > a:first-child, .stepper { flex: none; }
  .stepper .step-at { display: none; }
  .crumbs .badge { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .detail-tab { padding: 8px 10px 7px; font-size: 14px; }
  .detail-headline { grid-template-columns: minmax(0, 1fr); }
  .detail-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 4px; }
  .tile-value { font-size: 18px; }
  .kv { grid-template-columns: minmax(0, 40%) minmax(0, 1fr); gap: 4px 10px; }
}
.tip[hidden] { display: none; }
.pair { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.pair .col { display: grid; gap: 14px; min-width: 0; }
.dtable td { white-space: nowrap; }
/* a value with no space in it (a filing URL) breaks inside its cell rather than
   widening the table past its card */
.dtable td.wrap { white-space: normal; min-width: 12ch; overflow-wrap: anywhere; }
.dtable th.wrap { white-space: normal; }

/* bars: each labelled with its value */
.vbars { display: flex; align-items: stretch; gap: 6px; height: 150px; margin: 6px 0 4px; }
.vbar { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; }
.vbar-track { flex: 1; width: 70%; max-width: 44px; display: flex; align-items: flex-end; }
.vbar-fill { display: block; width: 100%; background: var(--c, var(--blue)); border-radius: 3px 3px 0 0; min-height: 1px; }
.vbar.dim .vbar-fill { background: var(--removed); }
.vbar-value { font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.vbar-label { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.vbars.signed .vbar-track { position: relative; align-items: stretch; }
.vbars.signed .vbar-fill { position: absolute; bottom: 50%; }
.vbars.signed .vbar.neg .vbar-fill { top: 50%; bottom: auto; border-radius: 0 0 3px 3px; background: var(--bad); }
.vbars.signed .vbar-track { border-bottom: 0; background: linear-gradient(var(--line), var(--line)) 0 50% / 100% 1px no-repeat; }
.hbars { display: grid; gap: 3px; margin: 6px 0 4px; font-size: 12px; }
.hbar { display: grid; grid-template-columns: minmax(70px, 38%) minmax(0, 1fr) 52px; gap: 8px; align-items: center; }
.hbar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.hbar-track { height: 10px; background: var(--panel-2); border-radius: 2px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; background: var(--c, var(--blue)); }
.hbar.dim .hbar-fill { background: var(--removed); }
.hbar.dim .hbar-label { color: var(--muted); }
.hbar-value { text-align: right; font-variant-numeric: tabular-nums; }
.hbar.neg .hbar-fill { background: var(--bad); }
/* an index page's paired blocks (the period table and the calendar years; the notes
   by issuer and by payoff): side by side where they fit */
.index-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px 32px; align-items: start; }
.index-split h3 { margin-top: 0; }
/* an index section's subsections stand apart from the rows inside them */
.card[data-component^="index_"] h3 { margin-top: 28px; }
.card[data-component="index_returns"] .index-split h3 { margin-top: 0; }
.card[data-component^="index_"] .source { max-width: 75ch; }
/* a stacked table on a phone (detail.js table stack): the first cell on its own line,
   the others under it, each after its column's label */
@media (max-width: 860px) { .card[data-component^="index_"] .source { font-size: 14px; } }
@media (max-width: 600px) {
  .dtable.stack thead { display: none; }
  .dtable.stack tr { display: block; padding: 6px 0; border-bottom: 1px solid var(--line); }
  .dtable.stack td { display: inline-block; border: 0; padding: 0 12px 0 0; white-space: normal; text-align: left; min-width: 0; }
  .dtable.stack td:first-child { display: block; padding-bottom: 2px; }
  .dtable.stack td:not(:first-child)::before { content: attr(data-label) " "; color: var(--muted); }
  .dtable.stack tr.next { background: var(--accent-bg); }
  .dtable.stack tr.next td { background: none; }
}
.ret-ann { display: block; color: var(--muted); font-size: 12px; }
.minis { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 8px 24px; }
.mini h3 { margin-top: 4px; }
/* fund rating and style box */
.rating-row { display: flex; align-items: center; gap: 12px; }
.rating-band { display: inline-flex; gap: 4px; }
.pip { width: 14px; height: 14px; border-radius: 3px; border: 1.5px solid var(--line); }
.pip.on { background: var(--c, var(--blue)); border-color: var(--c, var(--blue)); }
.pip.on.prov { opacity: .6; }
.rating-num { font: 700 18px var(--head); color: var(--ink); }
.stylebox { display: grid; grid-template-columns: max-content repeat(3, minmax(0, 1fr)); gap: 3px; max-width: 360px; font-size: 12px; }
.sb-h { color: var(--muted); padding: 2px 6px; align-self: center; }
.sb-cell { text-align: center; padding: 10px 4px; border-radius: 3px; font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--c, var(--blue)) calc(var(--w) * 70%), var(--panel-2)); }
.sb-cell.on { outline: 2px solid var(--ink); outline-offset: -2px; font-weight: 600; }
.cov { font-size: 11px; color: var(--muted); white-space: nowrap; }
.cov.low { color: var(--warn-ink); }

/* equity style box (detail.js fundEquityStyle). Weight: the 3x3 grid shaded by
   bucket in the class's own hue, light to dark, as the bond box beside it is shaded,
   so both boxes of a fund page read in one hue; ink on the three light steps and
   white on the darkest (contrast 6.4:1 and up, and 4.8:1, on the fund hue). Map: color and glow show each holding on the page's own surface. */
.esb-view { --esb-glow-gutter: 16px; container-type: inline-size; margin-top: 6px; }
.esb-layout { max-width: 480px; }
.esb-chart { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: var(--esb-glow-gutter);
  padding: 10px var(--esb-glow-gutter) var(--esb-glow-gutter) 10px; color: var(--muted); font-size: 11px; font-weight: 600; }
.esb-x { grid-area: 1 / 2; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); text-align: center; }
.esb-y { grid-area: 2 / 1; display: grid; grid-template-rows: repeat(3, minmax(0, 1fr)); align-items: center; text-align: right; }
.esb-square { grid-area: 2 / 2; position: relative; aspect-ratio: 1; }
.esb-grid, .esb-plot { position: absolute; inset: 0; }
.esb-grid { display: grid; grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 3px; }
.esb-gr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
.esb-cell { display: flex; align-items: center; justify-content: center; border-radius: 3px;
  font: 600 17px/1 var(--head); font-variant-numeric: tabular-nums; color: var(--ink); }
.esb-b0 { background: color-mix(in srgb, var(--c, var(--blue)) 10%, var(--panel)); }
.esb-b1 { background: color-mix(in srgb, var(--c, var(--blue)) 32%, var(--panel)); }
.esb-b2 { background: color-mix(in srgb, var(--c, var(--blue)) 62%, var(--panel)); }
.esb-b3 { background: var(--c, var(--blue)); }
.esb-cell.esb-b3 { color: #fff; }
.esb-cell.on { outline: 2px solid var(--ink); outline-offset: -2px; }
.esb-legend { margin-top: 8px; }
.esb-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12px;
  color: var(--muted); font-variant-numeric: tabular-nums; }
.esb-key-h { font-weight: 600; color: var(--ink); }
.esb-key-row { display: flex; align-items: center; gap: 8px; }
.esb-sw { width: 18px; height: 14px; border-radius: 2px; border: 1px solid var(--line); }
.esb-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.esb-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 3px 10px 3px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 12px; }
.esb-chip i, .esb-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.esb-chip em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.esb-chip[aria-pressed="false"] { opacity: .45; }
.esb-all { font-size: 12px; margin-left: 4px; }
.esb-all:disabled { color: var(--muted); opacity: .75; cursor: default; text-decoration: none; }
.esb-plot { touch-action: manipulation; }
.esb-plot canvas, .esb-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.esb-plot canvas { inset: calc(-1 * var(--esb-glow-gutter)); width: calc(100% + 2 * var(--esb-glow-gutter)); height: calc(100% + 2 * var(--esb-glow-gutter)); pointer-events: none; }
.esb-plot svg { pointer-events: none; overflow: visible; }
.esb-rule { stroke: var(--line); stroke-width: 1; }
.esb-edge { fill: none; stroke: var(--muted); stroke-width: 1; }
.esb-center { fill: #fff; stroke: #182337; stroke-width: 2; stroke-linejoin: round; paint-order: stroke; }
.esb-pick { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.esb-tip { z-index: 3; box-sizing: border-box; width: max-content; max-width: min(240px, 100%); white-space: normal; }
.esb-tip .esb-dot { margin-right: 5px; }
.esb-view-note { margin: 8px 0 0; }
@container (min-width: 720px) {
  .esb-layout { display: grid; grid-template-columns: 480px minmax(0, 1fr); align-items: start; gap: 16px; max-width: none; }
  .esb-legend { margin-top: 35px; }
}
@container (max-width: 480px) {
  /* the sector filter as a two-column key, not twelve rows of pills */
  .esb-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
  .esb-chip { border: 0; background: none; border-radius: 4px; min-height: 26px; padding: 2px 2px; text-align: left; }
  .esb-all { grid-column: 1 / -1; justify-self: start; margin: 4px 0 0; }
}

/* timeline range buttons, result stepper, the document's JSON */
.range-row { display: flex; gap: 6px; margin: 4px 0 6px; }
.range-btn { background: var(--panel); border: 1px solid var(--line); color: var(--ink); border-radius: 4px; padding: 3px 10px; font-size: 13px; min-height: 30px; }
.range-btn[aria-pressed="true"] { border-color: var(--blue); color: var(--blue); font-weight: 600; }
.stepper { margin-left: auto; display: flex; gap: 12px; align-items: center; font-size: 14px; }
.stepper a { text-decoration: none; font-weight: 600; }
.stepper .step-off { color: var(--muted); }
.stepper .step-at { color: var(--muted); font-variant-numeric: tabular-nums; }
.doc-json { margin-top: 16px; }
.doc-json pre.json { max-height: 480px; overflow: auto; font-size: 12px; background: var(--panel); border: 1px solid var(--line); padding: 8px; white-space: pre; }
/* other dealers' prices beside the note's main dealer */
.s-dealer1 { stroke: var(--sqx-ink, #1A2430); stroke-width: 1.4; stroke-dasharray: 5 3; }
.s-dealer2 { stroke: var(--barrier); stroke-width: 1.4; stroke-dasharray: 2 2; }
.s-dealer3 { stroke: var(--muted); stroke-width: 1.4; stroke-dasharray: 8 3; }
/* a rate-linked note's reference rates, one colour per leg */
.s-rate1 { stroke: var(--u1); stroke-width: 1.4; }
.s-rate2 { stroke: var(--u3); stroke-width: 1.4; }
.s-rate3 { stroke: var(--u2); stroke-width: 1.4; }
/* SQX's evaluated note price: a thin line over two soft translucent ranges, the
   80% range blurred at its edges so it reads as uncertainty, not a boundary */
:root { --eval: var(--chart-4, #8B4FB8); }
.s-eval { stroke: var(--eval); stroke-width: 1.3; }
.mk.s-eval { fill: var(--eval); stroke: var(--panel); stroke-width: 1; }
.ribbon { stroke: none; }
.ribbon.ev80 { fill: var(--eval); opacity: .13; filter: blur(1.5px); }
.ribbon.ev50 { fill: var(--eval); opacity: .22; }
.swatch .ribbon.ev80 { filter: none; }
/* the evaluated price's breakdown under the timeline */
.model-breakdown { margin-top: 12px; }
.model-breakdown summary { font-weight: 600; cursor: pointer; }
.breakdown-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 24px; margin: 8px 0; }
.breakdown-grid h4 { margin: 0 0 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
/* a column is ~260px and its labels are long, so the label wraps and the value (a short
   number) keeps its width on one line; .kv's max-content label column would take the
   whole width and break each value one character per line */
.breakdown-grid .kv { grid-template-columns: minmax(0, 1fr) max-content; }
.breakdown-grid .kv dd { overflow-wrap: normal; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
/* the fee medians a fund's net expense ratio is drawn against, narrowest cohort first */
.s-med-category { stroke: var(--u1); stroke-width: 1.6; }
.s-med-vehicle { stroke: var(--u3); stroke-width: 1.6; stroke-dasharray: 6 3; }
.s-med-all { stroke: var(--na); stroke-width: 1.6; stroke-dasharray: 2 3; }
.mk.s-med-category { fill: var(--u1); } .mk.s-med-vehicle { fill: var(--u3); } .mk.s-med-all { fill: var(--na); }
.mk.mk-med { stroke-dasharray: none; stroke-width: 1; }
/* a fund's growth of 10,000 (the class is .s-c bold) against its comparands, and its
   monthly flows; dash patterns tell the lines apart without colour */
.s-cmp-category { stroke: var(--u1); stroke-width: 1.6; }
.s-cmp-index { stroke: var(--u3); stroke-width: 1.6; stroke-dasharray: 6 3; }
.mk.s-cmp-category { fill: var(--u1); } .mk.s-cmp-index { fill: var(--u3); stroke-dasharray: none; }
.s-flow-sales { stroke: var(--u1); stroke-width: 1.6; }
.s-flow-redemptions { stroke: var(--u2); stroke-width: 1.6; stroke-dasharray: 6 3; }
.s-flow-reinvest { stroke: var(--u4); stroke-width: 1.4; stroke-dasharray: 2 3; }
.mk.s-flow-sales { fill: var(--u1); } .mk.s-flow-redemptions { fill: var(--u2); stroke-dasharray: none; }
.mk.s-flow-reinvest { fill: var(--u4); stroke-dasharray: none; }
.pbar.s-flow-in, .swatch .s-flow-in { fill: var(--good); stroke: none; }
.pbar.s-flow-out, .swatch .s-flow-out { fill: var(--bad); stroke: none; }
.pbar.s-volume, .swatch .s-volume { fill: var(--u1); stroke: none; }
/* the fund's fee waiver: the gap between its gross and net ratios */
.s-waived { fill: var(--c, var(--blue)); stroke: none; opacity: .18; }
/* a cohort's middle half (25th to 75th percentile) */
.s-spread { fill: var(--u1); stroke: none; opacity: .12; }
.spread-wrap { position: relative; }
.chart .spread-head { fill: var(--ink); font: 600 12px var(--body); }
.chart .spread-label { fill: var(--muted); font: 11px var(--body); }
.spread-whisker { stroke: var(--na); stroke-width: 1.5; }
.spread-box { fill: var(--panel-2); stroke: var(--na); stroke-width: 1; }
.spread-median, .mk-tick.spread-median { stroke: var(--ink); stroke-width: 2; }
.spread-row:focus { outline: none; }
.spread-row:focus .hit { fill: var(--accent-bg); }
.more-data { margin: 8px 0 0; font-size: 14px; }
/* the timeline's range slider */
.range-slider { margin-top: 4px; touch-action: none; }
.chart.strip .strip-bg { fill: var(--panel-2); }
.chart.strip .strip-win { fill: var(--blue); opacity: .12; stroke: var(--blue); stroke-width: 1; cursor: grab; }
.chart.strip .strip-handle { fill: var(--panel); stroke: var(--blue); stroke-width: 1.5; cursor: ew-resize; }
.chart.strip .strip-handle:focus-visible { outline: 2px solid var(--blue); }
.chart.strip .strip-hit { fill: transparent; cursor: ew-resize; }
/* on a phone a section's heading folds it */
.card-toggle { all: unset; font: inherit; color: inherit; }
@media (max-width: 860px) {
  .card-toggle { cursor: pointer; display: flex; justify-content: space-between; width: 100%; }
  .card-toggle::after { content: "▾"; color: var(--muted); }
  .card.collapsed .card-toggle::after { content: "▸"; }
  .card.collapsed > :not(h2) { display: none; }
}
/* the search's suggestions */
.suggest { list-style: none; margin: 0; padding: 4px 0; position: absolute; left: 16px; right: 16px; z-index: 5;
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,.12); max-height: 320px; overflow-y: auto; }
.suggest .sg { display: flex; gap: 8px; align-items: center; padding: 6px 10px; cursor: pointer; font-size: 14px; }
.suggest .sg.active, .suggest .sg:hover { background: var(--accent-bg); }
.suggest .sg-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.suggest .isin { color: var(--muted); font-size: 12px; }
/* The headline facts an instrument page is sent with (explorer_pages.py), shown
   until detail.js draws the page, and to a reader that runs no script. */
.page-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 16px 0; font-variant-numeric: tabular-nums; }
.page-facts dt { color: var(--muted); }
.page-facts dd { margin: 0; }
/* The facts are for a reader without scripts; with them the sections take their place,
   drawn into the space below the header rather than over facts that would vanish. */
@media (scripting: enabled) { .page-facts { display: none; } }

/* A note whose terms are pending (detail.js termsPending) and the extraction it
   offers (live_extract.js). */
.terms-pending > p:first-child { margin-top: 0; }
.live-extract { margin-top: 10px; padding: 12px 14px; border-radius: 6px; background: var(--accent-bg); }
.live-extract > p { max-width: 68ch; }
.live-btn { background: var(--blue); color: #fff; border: 1px solid var(--blue); border-radius: 4px; padding: 8px 16px;
  font: 600 14px var(--head); min-height: 44px; cursor: pointer; }
.live-btn:hover { filter: brightness(1.08); }
.live-btn:disabled { opacity: .55; cursor: default; filter: none; }
.live-btn[hidden] { display: none; }
.live-cancel { background: none; border: 0; color: var(--muted); font: inherit; min-height: 44px; padding: 0 8px; cursor: pointer; }
.live-step { display: grid; gap: 10px; max-width: 520px; margin-top: 4px; }
.live-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.live-field { display: grid; gap: 4px; }
.live-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: var(--tracking-caps, 0.08em); }
.live-field input { padding: 9px 10px; border: 1px solid var(--line); border-radius: 4px; font: inherit; font-size: 16px;
  background: var(--panel); color: var(--ink); min-width: 0; }
.live-field input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.live-code { font-variant-numeric: tabular-nums; letter-spacing: .4em; max-width: 12ch; }
.live-actions { display: flex; gap: 10px; align-items: center; }
.live-err { color: #A4262C; font-size: 13px; min-height: 0; margin: 0 !important; }
.live-err:empty { display: none; }
.live-status:not(:empty) { margin-top: 10px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; }
.live-stage { font-variant-numeric: tabular-nums; color: var(--blue); }
.live-pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); margin-right: 8px;
  vertical-align: middle; animation: live-pulse 1.4s ease-in-out infinite; }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .live-pulse { animation: none; } }
.live-fine { color: var(--muted); font-size: 12px; }
@media (max-width: 520px) { .live-row { grid-template-columns: 1fr; } }

/* GTAX sectors (detail.js gtaxPie): three rings, sector > industry > subindustry.
   The seven sector hues are the site's chart hues in order (validated together:
   dataviz validate_palette.js, light); sectors past the seventh share the neutral.
   Rings wear their sector's hue in alternating lighter shades; weight no issuer
   code places is a light grey. */
.gtax-block { margin-bottom: 18px; }
/* a link inside a heading wears the heading's colour, so it is underlined to read as one */
.gtax-block h3 a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.gtax { display: flex; flex-wrap: wrap; gap: 20px 28px; align-items: flex-start; }
.gtax-chart { position: relative; flex: 0 1 340px; width: 100%; max-width: 340px; }
.gtax-pie { display: block; width: 100%; height: auto; overflow: visible; touch-action: manipulation; }
.gx-0 { --c: #155E91; } .gx-1 { --c: var(--chart-2, #C4561F); } .gx-2 { --c: var(--chart-3, #12876A); }
.gx-3 { --c: var(--chart-4, #8B4FB8); } .gx-4 { --c: var(--chart-5, #8D6E00); } .gx-5 { --c: var(--chart-6, #C2336B); }
.gx-6 { --c: var(--chart-8, #2AA3C9); } .gx-o { --c: var(--chart-7, #4B5563); }
.gx-x-cash { --c: #9AA5B1; } .gx-x-derivative { --c: #B9C1CA; } .gx-x-unattributed { --c: #D8DDE3; }
path.gx { fill: var(--c); stroke: var(--panel, #fff); stroke-width: 1; transition: opacity .12s; }
path.gx-d0 { stroke-width: 2; }
path.gx-d1.gx-sh0 { fill-opacity: .74; } path.gx-d1.gx-sh1 { fill-opacity: .58; }
path.gx-d2.gx-sh0 { fill-opacity: .46; } path.gx-d2.gx-sh1 { fill-opacity: .32; }
.gtax-pie.focus path.gx:not(.on) { opacity: .2; }
.gx-pct { fill: #fff; font: 700 13px/1 var(--head, inherit); pointer-events: none; }
.gx-pct.gx-6 { fill: var(--ink); }
.gtax-keys { flex: 1 1 220px; min-width: 200px; max-width: 380px; display: grid; gap: 1px; }
.gtax-key { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border: 0; border-radius: 3px; background: none;
  font: inherit; font-size: 13px; color: var(--ink); text-align: left; cursor: default; }
.gtax-key:hover, .gtax-key:focus-visible { background: var(--accent-bg); }
.gtax-key strong { margin-left: auto; padding-left: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.gx-chip { flex: none; width: 12px; height: 12px; border-radius: 2px; background: var(--c); }
@media (max-width: 600px) {
  .gtax-chart { flex-basis: 100%; max-width: 100%; }
  .gtax-keys { max-width: none; }
}
/* trailing returns against category peers (detail.js trailingStrips): a strip per
   horizon on one shared axis. The peers are faint muted dots on a canvas (its colour
   is read from --na), the fund the class colour with a surface ring, the median ink. */
.tstrips { margin-top: 4px; }
.tstrip { margin-top: 8px; }
.tstrip-head { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tstrip-name { color: var(--ink); font-weight: 600; }
.tstrip-value { color: var(--ink); font-weight: 600; }
.tstrip-plot canvas, .tstrip-plot svg { position: absolute; left: 0; top: 0; }
.tstrip-plot svg:focus { outline: none; }
.tstrip-plot svg:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.tstrip-axis { margin-top: 2px; }
.chart .tstrip-median, .mk-tick.tstrip-median { stroke: var(--ink); stroke-width: 2; }
.chart .tstrip-zero { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.mk.tstrip-fund { stroke: var(--panel); stroke-width: 2; }
.chart .tstrip-off { fill: var(--muted); font: 11px var(--body); font-variant-numeric: tabular-nums; }
.chart .tstrip-pick { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.mk.tstrip-peer-key { fill: var(--na); fill-opacity: .4; stroke: none; }
.tstrip-plot .tip { left: 0; max-width: min(320px, 100%); text-align: left; white-space: normal; z-index: 2; }
.tstrip-plot .tip-row strong { margin-left: 0; padding-left: 0; }
