/* Cascade layers keep the previous section order: identical precedence,
   explicit structure. */
@layer tokens, base, topbar, layout, cards, kpis, buttons, chips, tables, tabs, dossier, callouts, forms, states, chart, dialog, responsive, print, docreader, legend, landing;

@layer tokens {
  /* OpenBloomb workspace. Plain CSS, no build step; tokens first, components after. */

  :root {
    color-scheme: light;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto,
      "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono",
      monospace;

    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-2: #f1f3f6;
    --surface-3: #e8ebf0;
    --border: #dde2e8;
    --border-strong: #c3cbd5;
    --text: #0f1720;
    --text-2: #435061;
    --text-3: #5f6b7a;
    --accent: #1f5fbf;
    --accent-hover: #184d9c;
    --accent-text: #ffffff;
    --accent-soft: #e8f0fc;
    --hero-grid: rgba(31, 95, 191, 0.06);
    --focus: #2a78d6;
    --series: #2a78d6;
    --grid: #e6e9ee;
    --axis: #b9c1cc;
    --shadow: 0 1px 2px rgba(15, 23, 32, 0.06), 0 1px 1px rgba(15, 23, 32, 0.04);
    --shadow-pop: 0 12px 32px rgba(15, 23, 32, 0.16);

    --ok: #11703f;
    --ok-bg: #e5f4eb;
    --warn: #855400;
    --warn-bg: #fcf1d7;
    --bad: #b42318;
    --bad-bg: #fdeceb;
    --info: #1f5fbf;
    --info-bg: #e8f0fc;
    --neutral: #4b5665;
    --neutral-bg: #eceff3;

    --radius: 8px;
    --radius-sm: 6px;
    --topbar-h: 56px;
    --gutter: clamp(16px, 3vw, 32px);
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      color-scheme: dark;
      --bg: #0c1016;
      --surface: #131a22;
      --surface-2: #19212b;
      --surface-3: #212b37;
      --border: #273240;
      --border-strong: #384656;
      --text: #e7edf3;
      --text-2: #aab6c3;
      --text-3: #8b98a7;
      --accent: #5b9cf0;
      --accent-hover: #7cb1f4;
      --accent-text: #0b1420;
      --accent-soft: rgba(91, 156, 240, 0.14);
      --hero-grid: rgba(91, 156, 240, 0.07);
      --focus: #5b9cf0;
      --series: #3987e5;
      --grid: #222c38;
      --axis: #3d4a5a;
      --shadow: none;
      --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.5);
      --ok: #57c98f;
      --ok-bg: rgba(87, 201, 143, 0.13);
      --warn: #e3b448;
      --warn-bg: rgba(227, 180, 72, 0.13);
      --bad: #f47b72;
      --bad-bg: rgba(244, 123, 114, 0.13);
      --info: #6fa9f3;
      --info-bg: rgba(111, 169, 243, 0.13);
      --neutral: #aab6c3;
      --neutral-bg: rgba(170, 182, 195, 0.12);
    }
  }

  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0c1016;
    --surface: #131a22;
    --surface-2: #19212b;
    --surface-3: #212b37;
    --border: #273240;
    --border-strong: #384656;
    --text: #e7edf3;
    --text-2: #aab6c3;
    --text-3: #8b98a7;
    --accent: #5b9cf0;
    --accent-hover: #7cb1f4;
    --accent-text: #0b1420;
    --accent-soft: rgba(91, 156, 240, 0.14);
    --hero-grid: rgba(91, 156, 240, 0.07);
    --focus: #5b9cf0;
    --series: #3987e5;
    --grid: #222c38;
    --axis: #3d4a5a;
    --shadow: none;
    --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.5);
    --ok: #57c98f;
    --ok-bg: rgba(87, 201, 143, 0.13);
    --warn: #e3b448;
    --warn-bg: rgba(227, 180, 72, 0.13);
    --bad: #f47b72;
    --bad-bg: rgba(244, 123, 114, 0.13);
    --info: #6fa9f3;
    --info-bg: rgba(111, 169, 243, 0.13);
    --neutral: #aab6c3;
    --neutral-bg: rgba(170, 182, 195, 0.12);
  }
}

@layer base { /* Base */


  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: calc(var(--topbar-h) + 16px);
  }

  body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.5 var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
  }

  h1,
  h2,
  h3,
  h4 {
    margin: 0;
    line-height: 1.25;
    font-weight: 600;
    letter-spacing: -0.01em;
  }

  h1 {
    font-size: clamp(20px, 2.4vw, 26px);
  }

  h2 {
    font-size: 16px;
  }

  h3 {
    font-size: 14px;
  }

  p {
    margin: 0;
  }

  a {
    color: var(--accent);
    text-decoration: none;
  }

  a:hover {
    text-decoration: underline;
  }

  code,
  .mono {
    font-family: var(--font-mono);
    font-size: 0.92em;
    font-variant-numeric: tabular-nums;
  }

  button,
  input,
  select {
    font: inherit;
    color: inherit;
  }

  :focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
  }

  [hidden] {
    display: none !important;
  }

  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .skip-link {
    position: absolute;
    left: 8px;
    top: -48px;
    z-index: 100;
    padding: 8px 14px;
    background: var(--accent);
    color: var(--accent-text);
    border-radius: var(--radius-sm);
  }

  .skip-link:focus {
    top: 8px;
  }

  .muted {
    color: var(--text-3);
  }

  .small {
    font-size: 12.5px;
  }
}

@layer topbar { /* Top bar */


  .topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }

  .topbar-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: var(--topbar-h);
    padding: 8px var(--gutter);
    max-width: 1440px;
    margin: 0 auto;
  }

  .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
  }

  .brand:hover {
    text-decoration: none;
  }

  .brand-mark {
    width: 26px;
    height: 26px;
    flex: none;
  }

  .brand-mark rect {
    fill: var(--accent);
  }

  .brand-mark path {
    stroke: var(--accent-text);
  }

  .brand-sub {
    font-weight: 500;
    color: var(--text-3);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding-left: 10px;
    border-left: 1px solid var(--border);
  }

  .search {
    flex: 1;
    max-width: 560px;
    display: flex;
    position: relative;
  }

  .search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    color: var(--text-3);
    pointer-events: none;
  }

  .search input {
    width: 100%;
    height: 38px;
    padding: 0 44px 0 34px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-family: var(--font-mono);
    font-size: 13.5px;
    text-transform: uppercase;
  }

  .search input::placeholder {
    font-family: var(--font-sans);
    text-transform: none;
    color: var(--text-3);
  }

  .search input:focus {
    background: var(--surface);
    border-color: var(--focus);
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-soft);
  }

  .kbd {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font: 11px/1 var(--font-mono);
    color: var(--text-3);
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    padding: 3px 6px;
    pointer-events: none;
  }

  .topnav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
  }

  .topnav a {
    color: var(--text-2);
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    font-weight: 500;
  }

  .topnav a:hover {
    background: var(--surface-2);
    color: var(--text);
    text-decoration: none;
  }

  .topnav a[aria-current="page"] {
    color: var(--text);
    background: var(--surface-3);
  }

  .icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
  }

  .icon-btn:hover {
    background: var(--surface-2);
    color: var(--text);
  }

  .icon-btn svg {
    width: 18px;
    height: 18px;
  }

  .scope-bar {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--text-2);
  }

  .scope-bar-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    align-items: center;
    max-width: 1440px;
    margin: 0 auto;
    padding: 6px var(--gutter);
  }

  .scope-bar strong {
    color: var(--text);
    font-weight: 600;
  }

  .freshness {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
  }
}

@layer layout { /* Layout */


  main {
    flex: 1;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px var(--gutter) 48px;
  }

  main:focus {
    outline: none;
  }

  .page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
  }

  .page-head p {
    color: var(--text-2);
    margin-top: 6px;
    max-width: 760px;
  }

  .eyebrow {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 6px;
  }

  .crumbs {
    font-size: 12.5px;
    color: var(--text-3);
    margin-bottom: 8px;
  }

  .crumbs a {
    color: var(--text-3);
  }

  .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .grid {
    display: grid;
    gap: 16px;
  }

  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid-main-side {
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  }

  .stack > * + * {
    margin-top: 16px;
  }

  .footer {
    border-top: 1px solid var(--border);
    color: var(--text-3);
    font-size: 12px;
  }

  .footer-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 14px var(--gutter);
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    justify-content: space-between;
  }
}

@layer cards { /* Cards */


  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 0;
  }

  .card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
  }

  .card-head .sub {
    color: var(--text-3);
    font-size: 12.5px;
    margin-top: 2px;
  }

  .card-body {
    padding: 16px 18px;
  }

  .card-body.flush {
    padding: 0;
  }

  .card-body > * + * {
    margin-top: 12px;
  }

  .card-foot {
    padding: 10px 18px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
  }
}

@layer kpis { /* KPI tiles */


  .kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
  }

  .kpi {
    padding: 14px 18px;
  }

  .kpi-label {
    font-size: 12px;
    color: var(--text-3);
    font-weight: 500;
  }

  .kpi-value {
    font-size: 24px;
    font-weight: 600;
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
  }

  .kpi-sub {
    font-size: 12px;
    color: var(--text-2);
    margin-top: 2px;
  }
}

@layer buttons { /* Buttons */


  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
  }

  .btn:hover {
    background: var(--surface-2);
    text-decoration: none;
  }

  .btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
  }

  .btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-text);
  }

  .btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
  }

  .btn-ghost {
    border-color: transparent;
    background: transparent;
    color: var(--text-2);
  }

  .btn-sm {
    height: 28px;
    padding: 0 10px;
    font-size: 12.5px;
  }

  .btn svg {
    width: 15px;
    height: 15px;
  }
}

@layer chips { /* Chips */


  .chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
    white-space: nowrap;
    color: var(--neutral);
    background: var(--neutral-bg);
  }

  .chip::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex: none;
  }

  .chip-ok {
    color: var(--ok);
    background: var(--ok-bg);
  }

  .chip-warn {
    color: var(--warn);
    background: var(--warn-bg);
  }

  .chip-warn::before {
    border-radius: 1px;
    transform: rotate(45deg);
  }

  .chip-bad {
    color: var(--bad);
    background: var(--bad-bg);
  }

  .chip-bad::before {
    border-radius: 1px;
  }

  .chip-info {
    color: var(--info);
    background: var(--info-bg);
  }

  .chip-neutral::before {
    background: transparent;
    border: 1.5px solid currentColor;
  }

  .chip-help {
    color: inherit;
    opacity: 0.55;
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    flex: none;
  }

  .chip-help:hover {
    opacity: 1;
  }

  .tag {
    display: inline-block;
    padding: 1px 7px;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    font: 500 12px/18px var(--font-mono);
    color: var(--text-2);
    white-space: nowrap;
  }

  .chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
  }
}

@layer tables { /* Tables */


  .table-wrap {
    position: relative; /* contains absolutely positioned .sr-only text inside scrolled tables */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
  }

  th,
  td {
    text-align: left;
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
  }

  th {
    position: sticky;
    top: 0;
    background: var(--surface-2);
    color: var(--text-2);
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1;
  }

  tbody tr:last-child td {
    border-bottom: 0;
  }

  tbody tr:hover td {
    background: var(--surface-2);
  }

  td.num,
  th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
  }

  td.nowrap {
    white-space: nowrap;
  }

  tr.clickable {
    cursor: pointer;
  }

  .table-sticky-first th:first-child,
  .table-sticky-first td:first-child {
    position: sticky;
    left: 0;
    background: var(--surface);
    z-index: 2;
    box-shadow: 1px 0 0 var(--border);
  }

  .table-sticky-first th:first-child {
    background: var(--surface-2);
    z-index: 3;
  }

  .table-sticky-first tbody tr:hover td:first-child {
    background: var(--surface-2);
  }

  .flag-yes {
    color: var(--ok);
    font-weight: 600;
  }

  .flag-no {
    color: var(--text-3);
  }

  .matrix td,
  .matrix th {
    text-align: center;
    padding: 7px 8px;
  }

  .matrix th:first-child,
  .matrix td:first-child {
    text-align: left;
    min-width: 220px;
  }

  /* Key–value lists */

  .kv {
    display: grid;
    grid-template-columns: minmax(160px, 34%) minmax(0, 1fr);
    margin: 0;
  }

  .kv > div {
    display: contents;
  }

  .kv dt,
  .kv dd {
    margin: 0;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    min-width: 0;
  }

  .kv > div:last-child dt,
  .kv > div:last-child dd {
    border-bottom: 0;
  }

  .kv dt {
    color: var(--text-2);
    padding-right: 16px;
  }

  .kv dt .native {
    display: block;
    font: 11px/1.4 var(--font-mono);
    color: var(--text-3);
    margin-top: 1px;
  }

  .kv dd {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    align-items: baseline;
    justify-content: space-between;
    overflow-wrap: anywhere;
  }

  .kv .value {
    font-family: var(--font-mono);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
  }

  .verbatim,
  .kv .value {
    white-space: pre-wrap; /* official strings keep their exact spacing (e.g. FISN) */
  }

  .kv .value.text {
    font-family: var(--font-sans);
    font-size: 14px;
  }

  .unknown {
    color: var(--text-3);
    font-style: italic;
    font-family: var(--font-sans);
  }

  .group-title {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-3);
    margin: 18px 0 2px;
  }

  .group-title:first-child {
    margin-top: 0;
  }
}

@layer tabs { /* Tabs */


  .tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    margin: 4px 0 20px;
    overflow-x: auto;
    scrollbar-width: none;
    position: sticky;
    top: var(--topbar-h);
    background: var(--bg);
    z-index: 20;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    background: transparent;
    color: var(--text-2);
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
  }

  .tab:hover {
    color: var(--text);
  }

  .tab[aria-selected="true"] {
    color: var(--text);
    border-bottom-color: var(--accent);
  }

  .tab .count {
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--surface-3);
    color: var(--text-2);
    line-height: 18px;
  }
}

@layer dossier { /* Dossier header */


  .dossier-head {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
  }

  .dossier-title {
    min-width: 0;
    flex: 1 1 420px;
  }

  .dossier-title h1 {
    overflow-wrap: anywhere;
  }

  .ident {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: center;
    margin-top: 10px;
    color: var(--text-2);
  }

  .ident .isin {
    font: 600 15px/1 var(--font-mono);
    color: var(--text);
    letter-spacing: 0.02em;
  }
}

@layer callouts { /* Callouts & lists */


  .callout {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-2);
  }

  .callout svg {
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 1px;
  }

  .callout-warn {
    background: var(--warn-bg);
    border-color: transparent;
    color: var(--text);
  }

  .callout-warn svg {
    color: var(--warn);
  }

  .callout-info {
    background: var(--info-bg);
    border-color: transparent;
    color: var(--text);
  }

  .callout-info svg {
    color: var(--info);
  }

  .callout-bad {
    background: var(--bad-bg);
    border-color: transparent;
    color: var(--text);
  }

  .callout-bad svg {
    color: var(--bad);
  }

  .notes {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .notes li {
    position: relative;
    padding: 8px 0 8px 18px;
    border-bottom: 1px solid var(--border);
    color: var(--text-2);
  }

  .notes li:last-child {
    border-bottom: 0;
  }

  .notes li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 16px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-3);
  }

  .checklist {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .checklist li {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
  }

  .checklist li:last-child {
    border-bottom: 0;
  }

  .link-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .link-list li {
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    overflow-wrap: anywhere;
    font-size: 13px;
  }

  .link-list li:last-child {
    border-bottom: 0;
  }

  .ext::after {
    content: " ↗";
    font-size: 0.85em;
  }

  details.more > summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 500;
    list-style: none;
  }

  details.more > summary::-webkit-details-marker {
    display: none;
  }

  details.more > summary::before {
    content: "▸ ";
  }

  details.more[open] > summary::before {
    content: "▾ ";
  }
}

@layer forms { /* Forms */


  .filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
  }

  .field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
  }

  .field label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
  }

  .field input,
  .field select,
  .select {
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    min-width: 0;
  }

  .field input:focus,
  .field select:focus,
  .select:focus {
    border-color: var(--focus);
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-soft);
  }

  .field-grow {
    flex: 1 1 260px;
  }

  .field-mic input {
    width: 110px;
    text-transform: uppercase;
    font-family: var(--font-mono);
  }
}

@layer states { /* States: empty, error, skeleton */


  .empty {
    padding: 28px 18px;
    text-align: center;
    color: var(--text-3);
  }

  .empty strong {
    display: block;
    color: var(--text-2);
    margin-bottom: 4px;
  }

  .skeleton {
    display: block;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
  }

  @keyframes shimmer {
    from {
      background-position: 200% 0;
    }
    to {
      background-position: -200% 0;
    }
  }

  .loading-note {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-2);
    margin-bottom: 16px;
  }

  .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-strong);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex: none;
  }

  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }

  .pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
  }

  .row-focus > td {
    background: var(--accent-soft);
  }
}

@layer chart { /* Chart */


  .chart-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    align-items: center;
    justify-content: space-between;
  }

  .chart-plot {
    position: relative;
    width: 100%;
    touch-action: pan-y;
  }

  .chart-plot svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
  }

  .chart-plot svg:focus-visible {
    outline-offset: 4px;
  }

  .c-grid {
    stroke: var(--grid);
    stroke-width: 1;
  }

  .c-axis {
    stroke: var(--axis);
    stroke-width: 1;
  }

  .c-tick {
    fill: var(--text-3);
    font: 11px var(--font-sans);
    font-variant-numeric: tabular-nums;
  }

  .c-dot {
    fill: var(--series);
    stroke: var(--surface);
    stroke-width: 2;
  }

  .c-dot-active {
    fill: var(--series);
    stroke: var(--surface);
    stroke-width: 3;
  }

  .c-cross {
    stroke: var(--text-3);
    stroke-width: 1;
    stroke-dasharray: 3 3;
  }

  .c-hit {
    fill: transparent;
    cursor: crosshair;
  }

  .chart-tip {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    min-width: 180px;
    max-width: 260px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-pop);
    font-size: 12px;
    color: var(--text-2);
    pointer-events: none;
  }

  .chart-tip[data-position="left"] { left: 8px; right: auto; }
  .section-gap { margin-top: 16px; }
  .skeleton { height: 14px; width: 40%; margin-top: 12px; }
  .skeleton:first-child { margin-top: 0; }
  .skeleton:nth-child(3n + 2) { width: 77%; }
  .skeleton:nth-child(3n) { width: 59%; }
  .callout a:not(.btn) { text-decoration: underline; text-underline-offset: 2px; }

  .chart-tip strong {
    display: block;
    font-size: 15px;
    color: var(--text);
    font-variant-numeric: tabular-nums;
  }
}

@layer dialog { /* Dialog & toast */


  dialog.evidence {
    width: min(920px, calc(100vw - 32px));
    max-height: calc(100vh - 64px);
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-pop);
  }

  dialog.evidence::backdrop {
    background: rgba(8, 12, 18, 0.55);
  }

  dialog.evidence[open] {
    display: flex;
    flex-direction: column;
  }

  .dialog-body {
    overflow: auto;
    padding: 0;
    flex: 1;
  }

  .dialog-body pre {
    margin: 0;
    padding: 16px 18px;
    font: 12px/1.55 var(--font-mono);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: var(--text-2);
  }

  .toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 60;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    background: var(--text);
    color: var(--bg);
    font-weight: 500;
    box-shadow: var(--shadow-pop);
  }
}

@layer responsive { /* Responsive */


  @media (max-width: 1100px) {
    .kpis {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .grid-3 {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .grid-main-side {
      grid-template-columns: minmax(0, 1fr);
    }
  }

  @media (max-width: 760px) {
    :root {
      --topbar-h: 104px;
    }
    .topbar-inner {
      flex-wrap: wrap;
      gap: 8px 12px;
    }
    .brand-sub {
      display: none;
    }
    .search {
      order: 3;
      flex-basis: 100%;
      max-width: none;
    }
    .search input {
      font-size: 16px; /* prevents iOS zoom-on-focus */
      height: 40px;
    }
    .kbd {
      display: none;
    }
    .grid-2,
    .grid-3 {
      grid-template-columns: minmax(0, 1fr);
    }
    .freshness {
      margin-left: 0;
    }
    .kv {
      grid-template-columns: minmax(0, 1fr);
    }
    .kv dt {
      border-bottom: 0;
      padding-bottom: 0;
    }
    .field input,
    .field select {
      font-size: 16px;
      height: 40px;
    }
    .field-mic input {
      width: 100%;
    }
    .filters .field {
      flex: 1 1 140px;
    }
    .filters .btn {
      height: 40px;
      flex: 1 1 100%;
    }
    .card-head,
    .card-body {
      padding-left: 14px;
      padding-right: 14px;
    }
    th,
    td {
      padding: 8px 10px;
    }
  }

  @media (max-width: 480px) {
    .kpis {
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: 10px;
    }
    .kpi {
      padding: 12px;
    }
    .kpi-value {
      font-size: 20px;
    }
    .topnav {
      flex-wrap: wrap;
      row-gap: 0;
    }
    .topnav a {
      padding: 6px 8px;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }

  @media (forced-colors: active) {
    .chip {
      border: 1px solid CanvasText;
    }
    .tab[aria-selected="true"] {
      border-bottom-color: Highlight;
    }
  }
}

@layer print { /* Print: a dossier prints as one document */


  @media print {
    :root {
      color-scheme: light;
    }
    body {
      background: #fff;
      color: #000;
      font-size: 11px;
    }
    .topbar,
    .tabs,
    .actions,
    .footer,
    .skip-link,
    .btn,
    .chart-tip,
    .no-print {
      display: none !important;
    }
    .scope-bar {
      border: 0;
      background: none;
    }
    main {
      padding: 0;
      max-width: none;
    }
    [role="tabpanel"][hidden] {
      display: block !important;
    }
    [role="tabpanel"] {
      break-before: page;
    }
    [role="tabpanel"]:first-of-type {
      break-before: auto;
    }
    .card {
      box-shadow: none;
      break-inside: avoid;
      border-color: #bbb;
    }
    th {
      position: static;
    }
    .table-wrap {
      overflow: visible;
    }
    a.ext::after {
      content: " (" attr(href) ")";
      font-size: 9px;
      color: #555;
    }
  }
}

@layer docreader { /* Document reader */


  .doc-text {
    margin: 0;
    max-height: 75vh;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font: 13px/1.6 var(--font-mono);
    color: var(--text);
  }

  .strong {
    font-weight: 700;
  }

  .linklike {
    border: 0;
    padding: 0;
    background: none;
    color: var(--text-3);
    font: inherit;
    cursor: pointer;
  }

  .linklike:hover {
    text-decoration: underline;
  }
}

@layer legend { /* Favourites, issuer line, legend */


  .star[aria-pressed="true"] {
    color: var(--warn);
    border-color: var(--warn);
  }

  .star-icon,
  .star-inline {
    color: var(--warn);
    font-size: 15px;
    line-height: 1;
  }

  .issuer-line {
    margin-top: 6px;
    color: var(--text-2);
  }

  .hero-search {position: relative; display:flex; gap:12px; max-width:760px; margin:24px 0;}
  .hero-search input {font-size:1.2rem; min-width:0; flex:1; padding:16px;
    background:var(--surface); color:var(--text); border:1px solid var(--border-strong);
    border-radius:var(--radius-sm);}
  .suggestions {position:absolute; left:0; right:0; top:100%; z-index:40; margin:4px 0;
    padding:4px; list-style:none; background:var(--surface); color:var(--text);
    border:1px solid var(--border); border-radius:8px; box-shadow:0 8px 24px #0003;
    max-height:320px; overflow:auto;}
  .suggestions li {padding:10px; cursor:pointer; overflow-wrap:anywhere;}
  .suggestions [aria-selected="true"] {outline:2px solid var(--accent); outline-offset:-2px;}
  .market-label {display:block;}
  .follow-options {display:flex; align-items:center; flex-wrap:wrap; gap:8px;}
  .follow-options input {width:auto;}
  @media(max-width:600px) {.hero-search {flex-wrap:wrap;} .hero-search input {width:100%;}}

  details.legend > summary {
    cursor: pointer;
    list-style: none;
    border-bottom: 0;
  }

  details.legend > summary::-webkit-details-marker {
    display: none;
  }

  details.legend[open] > summary {
    border-bottom: 1px solid var(--border);
  }

  .legend .checklist li {
    justify-content: flex-start;
  }
}

@layer landing { /* Home landing, project page and public edition */
  [data-edition="public"] [data-private] {
    display: none !important;
  }

  .hero {
    position: relative;
    margin: 8px 0 32px;
    padding: clamp(24px, 5vw, 56px) clamp(20px, 4vw, 48px);
    border: 1px solid var(--border);
    border-radius: 14px;
    background:
      linear-gradient(var(--hero-grid) 1px, transparent 1px) 0 0 / 32px 32px,
      linear-gradient(90deg, var(--hero-grid) 1px, transparent 1px) 0 0 / 32px 32px,
      radial-gradient(120% 140% at 100% 0%, var(--accent-soft), transparent 60%),
      var(--surface);
    overflow: hidden;
  }

  .hero h1 {
    font-size: clamp(1.75rem, 3.6vw, 2.75rem);
    line-height: 1.12;
    letter-spacing: -0.02em;
    max-width: 30ch;
    text-wrap: balance;
  }

  .hero-lead {
    margin-top: 14px;
    max-width: 68ch;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-2);
  }

  .hero .hero-search {
    margin: 28px 0 16px;
  }

  .hero .hero-search input {
    box-shadow: var(--shadow-pop);
  }

  .hero .hero-search .btn {
    align-self: stretch;
    height: auto;
    padding: 0 24px;
    font-size: 1rem;
  }

  .hero-examples {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
  }

  .example-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .example {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    text-decoration: none;
  }

  .example:hover,
  .example:focus-visible {
    border-color: var(--accent);
    background: var(--accent-soft);
  }

  .example-kind {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--surface-3);
    color: var(--text-2);
    font-size: 11.5px;
    font-weight: 600;
  }

  .example-note {
    color: var(--text-3);
  }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, max-content));
    gap: 12px 48px;
    margin: 32px 0 0;
    padding-top: 24px;
    border-top: 1px solid var(--border);
  }

  .hero-stat {
    display: flex;
    flex-direction: column-reverse;
    gap: 2px;
  }

  .hero-stat dd {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
  }

  .hero-stat dt {
    color: var(--text-3);
    font-size: 13px;
  }

  .how {
    margin: 40px 0 8px;
  }

  .how h2 {
    font-size: 1.25rem;
    margin-bottom: 16px;
  }

  .how-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: none;
  }

  .how-steps li {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
  }

  .how-steps h3 {
    margin: 10px 0 6px;
    font-size: 1rem;
  }

  .how-steps p {
    color: var(--text-2);
    font-size: 13.5px;
    line-height: 1.55;
  }

  .how-index {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    font-size: 13px;
  }

  .how-more {
    margin-top: 16px;
  }

  .prose > * + * {
    margin-top: 10px;
  }

  .prose ul,
  ul.prose {
    padding-left: 20px;
    line-height: 1.6;
  }

  ul.prose li + li {
    margin-top: 6px;
  }

  @media (max-width: 960px) {
    .how-steps {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  @media (max-width: 600px) {
    .how-steps,
    .hero-stats {
      grid-template-columns: minmax(0, 1fr);
    }

    .hero-stats {
      gap: 14px;
    }

    .example-note {
      display: none;
    }

    .hero .hero-search {
      flex-direction: column;
    }

    .hero .hero-search .btn {
      min-height: 44px;
    }
  }
}
