
  :root {
    --sans:  'Inter', 'Noto Sans TC', system-ui, sans-serif;
    --mono:  'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  }

  /* ── Theme tokens (Stage 4) ───────────────────────────────────────────
     Three scopes, in this order:
       :root, :root[data-theme="light"]        → light, and a pinned light
       @media dark  :root:not([data-theme=light]) → OS dark, unless pinned light
       :root[data-theme="dark"]                → a pinned dark, beats the OS
     The [data-theme] selectors are (0,2,0); the media rule's :not() is also
     (0,2,0) but cannot match a pinned light, and the pinned-dark rule is last
     — so a manual choice wins in BOTH directions.

     Every colour below is measured, not eyeballed. Text pairs clear WCAG AA
     (4.5:1); marks clear 3:1 against their surface where the geometry allows.
     The firm palette (--cat-N) was designed with the dataviz skill's method
     and validated with its contrast/CVD validator — see the report in the
     Stage 4 commit message for the numbers. */
  :root, :root[data-theme="light"] {
    color-scheme: light;
    --table-heading: #DCE7F4;
    --bg:    #D5DFEA;
    --card:  #FFFFFF;
    --field: #E8EEF6;
    --ink:   #102748;
    --muted: #435975;
    --rule:  #B8C7DA;
    --table-frame: #8398B2;
    --track: #E1EAF4;
    --accent: #173F73;
    --accent-ink:     #FFFFFF;   /* text on accent */
    --accent-soft:    #DBE8F9;   /* tinted chip / active-nav surface        */
    --accent-on-soft: #153862;   /* text on selected controls */
    --accent-border:  #7899C1;
    /* Near-black: one token clears 3:1 on every surface a focused control
       can sit on (card 17.9, bg 16.7, field 16.4). outline-offset puts the
       ring on the page, never on the control's own fill. */
    --focus: #0f172a;
    --scroll-hover: #cbd2dd;
    /* Event types are categorical, not valenced — kept distinguishable. */
    --evt-appoint-bg: #e2f3e7;  --evt-appoint-ink: #186334;  /* 6.34:1 */
    --evt-switch-bg:  #e7eeff;  --evt-switch-ink:  #1b4bcc;  /* 6.18:1 */
    --evt-resign-bg:  #fceaea;  --evt-resign-ink:  #a32a26;  /* 6.20:1 */
    --chart-1: #214E86;  --chart-2: #AF592B;
    --big4-mark: #234673;  --other-mark: #B1C2D7;

    /* Firm identity — each firm's own brand colour, sourced from that firm's
       stylesheet or logo. Slots are bound to firms in
       templates/firm_brand_colours.csv, never to rank, so a data update
       cannot repaint EY green. Members of a network share the network's
       colour, as they already share its monogram.

       Identical in both themes: a brand colour is not a theme variable. Where
       a fill is under 3:1 against its card — EY and Deloitte on white, the
       navies on the dark card — the boundary comes from --swatch-edge rather
       than from distorting the colour.

       Slots 1-10 are sampled from logos HughY supplied (templates/brand_logos/)
       and are used bit-exact, except BDO which drops 0.007 in lightness so
       white text on it reaches 4.5:1. Earlier values for KPMG, PwC and
       Zhonghui came from the firms' global sites and were wrong against those
       logos by 0.152, 0.091 and 0.087 dE. Slots 11-12 have no supplied logo
       and keep their earlier sourcing.

       No separation nudging: fidelity won. It costs less than expected —
       worst pair 0.0790 (Zhonghui / Forvis Mazars), nothing in the
       indistinguishable range, and the worst ink-on-fill is 4.51:1. Under
       simulated colour-vision deficiency this beats both palettes it
       replaces: no pair under 0.06 for protanopia or deuteranopia, one for
       tritanopia. */
    --cat-1:  #ffe600;  --cat-1-ink:  #0d1117;  /* EY             exact */
    --cat-2:  #86bc25;  --cat-2-ink:  #0d1117;  /* Deloitte       exact */
    --cat-3:  #1e49e2;  --cat-3-ink:  #ffffff;  /* KPMG           exact */
    --cat-4:  #fe4f06;  --cat-4-ink:  #0d1117;  /* PwC            exact */
    --cat-5:  #ea1438;  --cat-5-ink:  #ffffff;  /* BDO      dE .008, AA */
    --cat-6:  #014099;  --cat-6-ink:  #ffffff;  /* Zhonghui Anda  exact */
    --cat-7:  #005a77;  --cat-7-ink:  #ffffff;  /* HLB            exact */
    --cat-8:  #3b75bd;  --cat-8-ink:  #ffffff;  /* Prism HK       exact */
    --cat-9:  #171c8f;  --cat-9-ink:  #ffffff;  /* Forvis Mazars  exact */
    --cat-10: #203062;  --cat-10-ink: #ffffff;  /* ShineWing      exact */
    --cat-11: #00a2de;  --cat-11-ink: #0d1117;  /* Rongcheng HK — no logo
                                                   supplied; earlier source */
    --cat-12: #9d0a0e;  --cat-12-ink: #ffffff;  /* McMillan Woods — no logo
                                                   supplied; its own dark
                                                   facet, the mid one sits
                                                   0.018 from BDO           */
    /* Boundary for any coloured swatch, so a fill that is pale on white or
       dark on the dark card still has an edge. 3.07:1 against the card. */
    --swatch-edge: #8a94a3;
    /* The ~258 remaining firms keep their hash hue but take lightness and
       chroma from here, so one place decides how the tail reads. Low chroma
       on purpose: past 12 slots hue stops identifying anyone, and the
       monogram + the firm name beside it carry identity. Worst ink contrast
       across all 189 hues present in the data: 6.40:1. */
    --tail-l: 0.68;  --tail-c: 0.045;  --tail-ink: #0d1117;
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      color-scheme: dark;
      --table-heading: #172C47;
      --bg:    #091525;
      --card:  #243954;
      --field: #192D47;
      --ink:   #F2F6FD;
      --muted: #C3D0E3;
      --rule:  #516A88;
      --table-frame: #758CA8;
      --track: #344C68;
      --accent: #AACBFF;
      --accent-ink:     #0C2141;
      --accent-soft:    #304C70;
      --accent-on-soft: #E1EDFF;
      --accent-border:  #7798C3;
      --focus: #cfe0ff;
      --scroll-hover: #3a4557;
      --evt-appoint-bg: #152c1e;  --evt-appoint-ink: #7cd096;
      --evt-switch-bg:  #1c2942;  --evt-switch-ink:  #a8c4ff;
      --evt-resign-bg:  #33191a;  --evt-resign-ink:  #f0a09c;
      --chart-1: #9CC2FF;  --chart-2: #F4A771;
      --big4-mark: #A8C9F6;  --other-mark: #577294;
      /* --cat-N is deliberately NOT overridden here: a firm's brand colour
         is the same colour in the dark theme. Only the boundary changes. */
      --swatch-edge: #6b7686;
      --tail-l: 0.52;  --tail-c: 0.05;  --tail-ink: #ffffff;
    }
  }

  :root[data-theme="dark"] {
    color-scheme: dark;
    --table-heading: #172C47;
    --bg:    #091525;
    --card:  #243954;
    --field: #192D47;
    --ink:   #F2F6FD;
    --muted: #C3D0E3;
    --rule:  #516A88;
    --table-frame: #758CA8;
    --track: #344C68;
    --accent: #AACBFF;
    --accent-ink:     #0C2141;
    --accent-soft:    #304C70;
    --accent-on-soft: #E1EDFF;
    --accent-border:  #7798C3;
    --focus: #cfe0ff;
    --scroll-hover: #3a4557;
    --evt-appoint-bg: #152c1e;  --evt-appoint-ink: #7cd096;
    --evt-switch-bg:  #1c2942;  --evt-switch-ink:  #a8c4ff;
    --evt-resign-bg:  #33191a;  --evt-resign-ink:  #f0a09c;
    --chart-1: #9CC2FF;  --chart-2: #F4A771;
    --big4-mark: #A8C9F6;  --other-mark: #577294;
    /* --cat-N is deliberately NOT overridden here: a firm's brand colour
       is the same colour in the dark theme. Only the boundary changes. */
    --swatch-edge: #6b7686;
    --tail-l: 0.52;  --tail-c: 0.05;  --tail-ink: #ffffff;
  }
  *, *::before, *::after { box-sizing: border-box; }
  html, body {
    margin: 0; padding: 0;
    background: var(--bg); color: var(--ink);
    font-family: var(--sans); font-size: 14px;
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  }
  body { min-height: 100vh; display: flex; flex-direction: column; }
  #root { display: contents; }

  h1, h2, h3, h4 { font-family: inherit; font-weight: 600; }
  a { color: var(--accent); text-decoration: none; }
  button { font-family: inherit; cursor: pointer; }

  /* Focus visibility (WCAG 2.4.7, 1.4.11). outline rather than box-shadow so
     the ring survives forced-colours / high-contrast mode. */
  a:focus-visible,
  button:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible,
  summary:focus-visible,
  [tabindex]:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
  }
  /* main is a skip-link target, not a control — draw its ring inside so a
     full-width region can never push the page into horizontal scroll.
     Matched on main[tabindex] so it outweighs the [tabindex] rule above. */
  main[tabindex]:focus-visible { outline-offset: -2px; }

  /* Visually hidden, still announced. */
  .sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; border: 0;
    overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
    white-space: nowrap;
  }

  .announcement-link { color: var(--accent); font-size: 13px; text-underline-offset: 2px; }

  /* Skip link — off-screen until focused. A button, not an anchor: the app is
     hash-routed, so an href="#..." target would be parsed as a route. */
  .skip-link {
    position: fixed; top: 8px; left: 8px; z-index: 300;
    transform: translateY(-250%);
    padding: 10px 16px; border-radius: 8px;
    border: 1px solid var(--rule); background: var(--card); color: var(--ink);
    box-shadow: 0 6px 18px rgba(15,23,42,0.18);
    font-size: 13px; font-weight: 500;
  }
  .skip-link:focus { transform: translateY(0); }

  /* Sortable column header. The click target is a real button so sorting is
     keyboard-reachable; the reset keeps it looking like plain header text. */
  .th-sort {
    display: block; width: 100%;
    appearance: none; background: none; border: 0; margin: 0; padding: 0;
    font: inherit; color: inherit;
    letter-spacing: inherit; text-transform: inherit; text-align: inherit;
    cursor: pointer; user-select: none;
  }

  /* Buttons */
  .btn-primary {
    padding: 8px 14px; border-radius: 10px;
    border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
    font-size: 13px; font-weight: 500;
  }
  .btn-primary:hover { filter: brightness(1.08); }
  .btn-ghost {
    padding: 8px 14px; border-radius: 10px;
    border: 1px solid var(--rule); background: var(--card); color: var(--ink);
    font-size: 13px;
  }
  .btn-ghost:hover { background: var(--field); }

  /* Page-title action group — pushed to the right of the heading it sits
     beside. Reset in the narrow query, where the row wraps. */
  .title-actions { margin-left: auto; }

  /* Interactive rows */
  .issuer-row { transition: background 0.12s; }
  .issuer-row:hover { background: var(--field); }
  .firm-chip { transition: background 0.12s; }
  .firm-chip:hover { background: var(--accent-soft); }
  .firm-row:hover { background: var(--field); }
  .firm-card { transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s; }
  .firm-card:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(15,23,42,0.06); border-color: var(--accent-border); }
  .spotlight-row { transition: background 0.12s; }
  .spotlight-row:hover,
  .spotlight-row[aria-selected="true"] { background: var(--field); }
  /* aria-activedescendant keeps DOM focus in the input, so the highlighted
     row needs its own outline — :focus-visible never fires on it. */
  .spotlight-row[aria-selected="true"] {
    outline: 2px solid var(--focus); outline-offset: -2px;
  }

  /* Density modifiers */
  body.density-compact main { padding: 16px 22px !important; gap: 12px !important; }
  body.density-compact main > * { font-size: 13px; }
  body.density-compact main h1 { font-size: 22px !important; }
  body.density-comfy main { padding: 32px 28px !important; gap: 24px !important; }

  /* Scrollbar polish */
  *::-webkit-scrollbar { width: 10px; height: 10px; }
  *::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 10px; }
  *::-webkit-scrollbar-thumb:hover { background: var(--scroll-hover); }

  /* ── Responsive shell (Stage 3) ───────────────────────────────────────
     One breakpoint (768px) for the whole app. app.jsx's useIsNarrow()
     hook mirrors this exact value for the handful of decisions CSS can't
     make (card list vs. table rows) — everything else lives here. */
  .app-header { padding: 14px 28px; gap: 24px; }
  .app-main   { padding: 24px 28px; }

  /* Nav: single line, horizontally scrollable, scrollbar hidden. Stays on
     the header's one row at every width — it shrinks/scrolls rather than
     wrapping the header onto a second row. */
  .app-nav { overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
  .app-nav::-webkit-scrollbar { display: none; }

  /* Search button: full width with visible label on desktop. On narrow
     (below) the label is hidden and the button collapses to its icon;
     TopBar only supplies aria-label once that happens, so the accessible
     name is never shorter than currently-visible text (WCAG 2.5.3).
     The search field yields space before the navigation. */
  .search-btn { width: 340px; min-width: 120px; flex-shrink: 20; }

  /* Theme control: text on desktop, one glyph per state on narrow — the
     three labels plus the language toggle do not fit a 375px header. Same
     deal as .search-btn above: TopBar supplies aria-label only while the
     text is hidden, so the accessible name never contradicts a visible
     one. */
  .theme-glyph { display: none; }
  @media (max-width: 768px) {
    .theme-label { display: none; }
    .theme-glyph { display: inline; }
  }

  /* KPI strips / two-column card rows, collapsed for narrow viewports.
     min-width:0 on every one of these: each sits as a flex item of #pie-main
     (or, for grid-donut, of a Card's flex column), and a flex item's default
     min-width:auto floors it at its content's min-content size — measured:
     without this, .grid-pair still rendered ~400px wide at a 375px viewport
     (single 1fr track sized by its cards' content) even after the cards'
     own contents were fixed, because the grid *container itself* was never
     told it could shrink below what its children asked for. */
  .grid-home-kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); min-width: 0; }
  .market-donut { width: 100%; max-width: 220px; }
  .market-donut svg { display: block; width: 100%; height: auto; }
  .engagement-counts summary { cursor: pointer; color: var(--accent); width: fit-content; }
  .engagement-counts p { margin: 8px 0; }
  .engagement-counts ul { margin: 0; padding-inline-start: 18px; }
  .grid-kpi5  { grid-template-columns: repeat(5, 1fr); min-width: 0; }
  .grid-split { grid-template-columns: 1.1fr 1fr; min-width: 0; }
  .grid-donut { grid-template-columns: 220px 1fr; min-width: 0; }
  .grid-kpi4  { grid-template-columns: repeat(4, 1fr); min-width: 0; }
  .grid-pair  { grid-template-columns: 1fr 1fr; min-width: 0; }

  /* Filter-bar search inputs (Issuers, IPO list). */
  .filter-search { width: 380px; }

  /* The three "big table" cards (Issuers, Auditors, AuditorPage clients).
     flex-basis 0 so the card contributes ~nothing to #pie-main's own
     natural height and instead grows to fill whatever's left of the
     viewport; min-height 0 overrides the flex default that would
     otherwise floor it at the table's full, unclipped content height. */
  .table-card-fill { flex: 1 1 0; min-height: 0; }
  /* Keep positioned screen-reader labels inside the scrolling table. */
  .table-scroll, .table-scroll-x { position: relative; }
  .table-scroll { flex: 1 1 0; min-height: 0; overflow: auto; }

  /* Small secondary tables (≤ ~15 rows): scroll horizontally in place
     rather than growing the page. min-width:0 lets this flex item shrink
     below its <table>'s content width instead of flooring at it;
     max-width:100% is the actual cap — a percentage max-width doesn't
     feed back into the ancestor chain's own intrinsic-size computation
     the way the table's natural width would, so it breaks the circular
     "container sized by the thing it's supposed to constrain" loop. */
  .table-scroll-x { overflow-x: auto; min-width: 0; max-width: 100%; }

  /* Fixed-pixel-width chart SVGs (LineChart/GroupedBars, from
     primitives.jsx) have the same circular-sizing problem: their `width`
     attribute is a presentational hint, but with no CSS `width` of its
     own the browser still uses that attribute as the intrinsic size
     candidate when sizing this wrapper, so the wrapper (and everything
     above it) grows to fit the chart instead of the chart shrinking to
     fit its wrapper. An explicit CSS `width: 100%` on the svg (a real
     author rule, not a presentational attribute) beats that hint outright
     and isn't itself content that can inflate an ancestor — `height:auto`
     keeps the aspect ratio via the SVG's own viewBox. */
  .chart-fluid { min-width: 0; }
  .chart-fluid svg { display: block; width: 100%; height: auto; }

  /* Narrow-viewport card list — stands in for the four big tables above.
     A real <ul>/<li> list (with an accessible name on the <ul>) so it
     still announces sensibly once the table's own caption/scope/
     aria-sort semantics are gone. */
  .card-list { list-style: none; margin: 0; padding: 0; }
  .card-list-item { padding: 14px 16px; border-top: 1px solid var(--rule); }
  .card-list-item:first-child { border-top: none; }
  .card-list-title { font-weight: 500; margin-bottom: 8px; }
  .card-list-field { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 3px 0; font-size: 13px; }
  .card-list-label { color: var(--muted); flex-shrink: 0; }
  .card-list-value { text-align: right; min-width: 0; }

  @media (max-width: 768px) {
    .app-header { padding: 10px 12px; gap: 10px; }
    /* width:100% + min-width:0, scoped to narrow only: measured empirically
       (a real browser, real computed styles), not reasoned from the CSS
       alone — min-width:0 was NOT sufficient by itself. main is body's flex
       column item with margin:0 auto; without an explicit width its sizing
       falls back to its content's intrinsic size (Stats' two-chart row
       rendered main ~400px+padding wide at a 375px viewport, poking past
       body's edge, even with min-width:0 on every element in the chain down
       to the chart svg). width:100% gives main a genuinely *definite* size
       to resolve against body, which is in turn what lets grid-pair's 1fr
       track — and everything nested under it — actually shrink instead of
       falling back to max-content sizing.
       Scoped inside this query, not on the base rule: the auto side-margins
       above make main shrink-to-fit its content (capped at max-width:1440px)
       on wide viewports, which is the pre-existing desktop look. An
       unconditional width:100% instead forces main to the full 1440px cap
       any time content is narrower than that — measured regression, e.g.
       Auditors' main went 1036px → 1440px at 1920px wide. Desktop needs no
       fix here; only narrow viewports were ever overflowing. */
    .app-main   { padding: 16px 14px; width: 100%; min-width: 0; }
    /* The header holds one row at every width by design — but once the theme
       control arrived there is no room left for the nav at phone widths, and
       flexbox resolves that by shrinking it to ~18px around 402px of content.
       No horizontal page scroll, so the overflow checks pass; the site is
       simply unnavigable. Give the nav its own full-width row here instead. */
    .app-header { flex-wrap: wrap; row-gap: 8px; }
    .app-nav { order: 99; flex-basis: 100%; margin-left: 0; }
    .search-btn { width: auto; min-width: auto; }
    .search-btn-label { display: none; }
    /* Desktop right-aligns the page action against the title. Once it wraps
       onto its own line, that same auto margin strands it at the right edge
       under a left-aligned heading. */
    .title-actions { margin-left: 0; }
    .grid-kpi5, .grid-home-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-split, .grid-donut, .grid-kpi4, .grid-pair { grid-template-columns: 1fr; }
    .filter-search { width: 100%; }
    /* Reset the fill treatment: at this width the card holds CardList
       (natural content height), not the internally-scrolling table, so
       it should flow with the page instead of being squeezed to fit
       whatever's left of the viewport. */
    .table-card-fill { flex: none; min-height: auto; }
  }

  .app-header {
    color: var(--ink);
    --card: #102B50; --ink: #F7FAFF; --field: #233F65; --muted: #D2E0F2;
    --rule: #597599; --accent: #C5DDFF; --accent-ink: #102B50;
    --accent-soft: #DBE9FC; --accent-on-soft: #122F55; --focus: #ffe09b;
  }
  .app-header button[aria-pressed="true"] { background: var(--accent-soft) !important; color: var(--accent-on-soft) !important; }
  .brand-home { display: inline-flex; align-items: center; flex: none; gap: 10px; color: var(--ink); }
  .brand-tile {
    width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
    background: var(--accent); color: var(--accent-ink);
    font-weight: 700; font-size: 12px; letter-spacing: 0.5px;
  }
  .brand-text { font-weight: 600; font-size: 15px; white-space: nowrap; }
  @media (max-width: 560px) { .brand-home .brand-text { display: none; } }
  @media (min-width: 1221px) { .app-nav { flex-shrink: 0; } }
  @media (min-width: 1221px) and (max-width: 1500px) { .app-header { gap: 10px; } }
  @media (min-width: 769px) and (max-width: 1220px) {
    .app-header { flex-wrap: wrap; row-gap: 6px; }
    .app-nav { order: 99; flex-basis: 100%; }
  }
  .app-nav [aria-current="page"] { box-shadow: inset 0 -3px #86AFE3; }
  .app-main { width: 100%; min-width: 0; }
  .app-main h1 { font-size: clamp(25px, 2.4vw, 34px) !important; line-height: 1.18; }
  .data-panel { border-radius: 8px !important; }
  .data-panel > header { border-bottom: 2px solid var(--rule); padding-bottom: 12px; }
  .data-panel table { font-size: 14px !important; }
  .data-panel thead tr { background: var(--table-heading) !important; color: var(--ink) !important; font-size: 12px !important; }
  .data-panel thead th { vertical-align: middle; padding-top: 10px !important; padding-bottom: 10px !important; }
  .data-panel thead th:first-child, .data-panel tbody td:first-child { padding-left: 8px !important; }
  .table-scroll { scrollbar-gutter: stable; }
  .grid-home-kpi, .grid-kpi4, .grid-kpi5 {
    gap: 0 !important; background: var(--card); border: 1px solid var(--table-frame);
    border-top: 4px solid var(--accent); border-radius: 7px; overflow: hidden;
  }
  .kpi-cell + .kpi-cell { border-inline-start: 1px solid var(--rule); }
  .kpi-cell > :first-child { font-size: 14px !important; font-weight: 600 !important; color: var(--ink) !important; }
  .text-action { background: none; color: var(--accent); border: 0; padding: 4px; font-size: 14px; font-weight: 600; }
  .scope-select, .jump-action { background: var(--card); color: var(--ink); border: 1px solid var(--table-frame); border-radius: 6px; padding: 8px 12px; font: inherit; }
  .jump-action { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
  .mobile-label { display: none; }
  .quarter-chart { overflow-x: auto; }
  .industry-select option { background-color: var(--card); color: var(--ink); }
  .industry-select option:checked { background-color: var(--accent-soft); color: var(--accent-on-soft); }
  .industry-select option:is(:hover, :focus-visible) { background-color: var(--accent); color: var(--accent-ink); }
  @supports (appearance: base-select) {
    .industry-select, .industry-select::picker(select) { appearance: base-select; }
    .industry-select::picker(select) {
      color: var(--ink); background: var(--card); border: 1px solid var(--table-frame);
      border-radius: 8px; max-height: min(55vh, 24rem); overflow-y: auto;
    }
    .industry-select option { padding: 7px 12px; }
  }
  .data-panel > .issuer-pager { margin-block: 8px; }
  .issuer-pager { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
  .issuer-pager > span { margin-right: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
  .issuer-pager button:disabled { opacity: 0.48; cursor: default; }
  .issuer-pager select { scroll-margin-top: 130px; }
  .network-members { background: var(--card); border: 1px solid var(--rule); border-radius: 6px; padding: 10px 18px; }
  .network-members summary { color: var(--accent); cursor: pointer; font-weight: 600; }
  .network-members > div { display: flex; flex-wrap: wrap; gap: 12px; margin-block: 12px 4px; }
  .trend-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
  .trend-controls strong { font-size: 18px; }
  .trend-controls span { color: var(--muted); }
  .trend-controls button[aria-pressed="true"] { box-shadow: inset 0 -3px var(--accent) !important; }
  .ipo-analysis { display: grid; grid-template-columns: minmax(0,0.95fr) minmax(0,1.05fr); gap: 16px; align-items: start; }
  .ipo-charts { display: grid; min-width: 0; gap: 16px; }
  .chart-fluid text { font-family: var(--sans); font-weight: 500; }
  .firm-chip { max-width: 100%; }
  .firm-ranking { display: grid; row-gap: 10px; }
  .firm-ranking a { display: grid; grid-template-columns: 22px minmax(0,1fr) minmax(55px,.4fr) 44px 52px; align-items: center; column-gap: 10px; padding: 4px; color: var(--ink); }
  .rank-name { display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
  .rank-track { height: 7px; background: var(--field); border-radius: 2px; }
  .rank-track span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
  .rank-number { font-variant-numeric: tabular-nums; text-align: right; }
  .rank-secondary { color: var(--muted); font-size: 13px; }
  .grid-split { align-items: start; }
  @media (min-width: 769px) and (max-width: 1180px) {
    .grid-donut { grid-template-columns: 1fr; }
    .app-header { gap: 8px; }
  }
  @media (max-width: 768px) {
    .grid-home-kpi, .grid-kpi4, .grid-kpi5 { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .kpi-cell { padding: 12px !important; }
    .kpi-cell:nth-child(n+3) { border-top: 1px solid var(--rule); }
    .kpi-cell:nth-child(odd) { border-inline-start: 0; }
    .grid-kpi5 .kpi-cell:last-child { grid-column: 1 / -1; }
    .issuer-identity, .firm-identity { display: grid !important; grid-template-columns: auto minmax(0,1fr); gap: 12px !important; padding: 16px !important; }
    .issuer-identity > :last-child { grid-column: 1 / -1; border-top: 1px solid var(--rule); padding-top: 12px; }
    .mobile-label { display: inline; }
    .recent-moves table, .recent-moves tbody { display: block; }
    .recent-moves thead { display: none; }
    .recent-moves tbody tr { display: grid; grid-template-columns: auto 1fr auto; column-gap: 8px; row-gap: 6px; padding: 12px 0; }
    .recent-moves tbody td { padding: 0 !important; }
    .recent-moves tbody td:first-child { grid-area: 1 / 1 / 2 / 3; padding: 0 !important; }
    .recent-moves tbody td:nth-child(2) { grid-area: 2 / 1; }
    .recent-moves tbody td:nth-child(3) { grid-area: 2 / 2 / 3 / 4; font-weight: 600; }
    .recent-moves tbody td:nth-child(4) { grid-area: 3 / 1 / 4 / 4; }
    .recent-moves tbody td:nth-child(4) > span { flex-wrap: wrap; }
    .recent-moves tbody td:nth-child(5) { grid-area: 1 / 3; }
    .issuer-timeline > div { flex-direction: column; align-items: start; gap: 6px !important; }
    .issuer-timeline > div > div { max-width: 100%; }
    .card-list-value, .card-list-title { overflow-wrap: anywhere; }
    .card-list-field { align-items: baseline; }
    .firm-chip span[title] { white-space: normal !important; }
    .ipo-analysis { grid-template-columns: minmax(0,1fr); }
    .trend-controls > div { margin-left: 0 !important; }
    .firm-ranking a { grid-template-columns: 18px minmax(0,1fr) 36px 44px; gap: 6px; }
    .rank-track { display: none; }
    .industry-summary table, .industry-summary tbody { display: block; }
    .industry-summary thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
    .industry-summary tbody tr { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 3px 8px; padding: 9px 0; }
    .industry-summary tbody td { padding: 2px 0 !important; text-align: start !important; }
    .industry-summary tbody td:first-child { font-weight: 600; }
    .industry-summary tbody td:nth-child(3) { grid-column: 2; grid-row: 1; }
    .industry-summary tbody td:last-child { grid-column: 1 / -1; }
  }
  .first-visit { background: var(--accent-soft); color: var(--ink); border-bottom: 1px solid var(--rule); }
  .visit-inner { max-width: 1440px; margin: auto; padding: 14px clamp(14px, 2.4vw, 28px) 16px; }
  .visit-heading, .visit-actions { display: flex; align-items: center; gap: 16px; }
  .visit-heading { justify-content: space-between; }
  .visit-heading h2 { margin: 0; font-size: 17px; }
  .visit-close { background: transparent; color: inherit; border: 0; font-size: 23px; padding: 0 8px; min-height: 32px; }
  .visit-inner p { max-width: 920px; margin: 3px 0 12px; font-size: 14px; line-height: 1.6; }
  .visit-actions a, .sources-page a, .report-link, footer a { color: var(--accent); text-underline-offset: 3px; }
  .report-link { display: inline-block; margin-inline-start: 18px; }
  .sources-page { width: min(100%, 760px); margin-inline: auto; }
  .sources-page h1 { margin: 0 0 18px; }
  .source-panel { background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: clamp(16px,3vw,28px); margin-bottom: 16px; }
  .source-panel h2 { margin: 0; font-size: 18px; }
  .source-panel p { line-height: 1.65; margin: 10px 0; }
  .source-panel p + h2 { margin-top: 22px; }
  .correction-form { scroll-margin-top: 80px; }
  .correction-form fieldset { display: grid; gap: 14px; padding: 0; border: 0; margin: 14px 0; min-width: 0; }
  .correction-form label { display: grid; gap: 6px; font-weight: 500; }
  .correction-form input:not([hidden]), .correction-form textarea { width: 100%; font: inherit; font-weight: 400; background: var(--field); color: var(--ink); border: 1px solid var(--table-frame); border-radius: 6px; padding: 8px; }
  .correction-form textarea { resize: vertical; }
  .correction-form dd { margin: 4px 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
  .form-note { font-size: 13px; color: var(--muted); }
