/* Shared styles for index.html and compare.html. */
  :root {
    color-scheme: light;
    --page: #f9f9f7;
    --surface: #fcfcfb;
    --text-1: #0b0b0b;
    --text-2: #52514e;
    --muted: #6b6a65;  /* AA contrast (4.5:1+) on every light surface */
    --grid: #e1e0d9;
    --axis: #c3c2b7;
    --border: rgba(11,11,11,0.10);
    --accent: #2166b8;         /* text, links, borders: 5:1+ on light surfaces */
    --accent-strong: #2166b8;  /* backgrounds under white text: 5.7:1 */
    --series-1: #2a78d6;
    --series-2: #eb6834;
    --series-3: #1baf7a;
    --good: #0ca30c;
    --good-text: #006300;
    --warning: #fab219;
    --quote: #94560a;  /* warm amber for the start-page quotes: reads as text, not a link (5.7:1 on cards) */
    --critical: #d03b3b;
    --critical-text: #c22f2f;
    --info: #898781;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      color-scheme: dark;
      --page: #0d0d0d; --surface: #1a1a19; --text-1: #ffffff; --text-2: #c3c2b7;
      --grid: #2c2c2a; --axis: #383835; --border: rgba(255,255,255,0.10);
      --accent: #6da7ec; --accent-strong: #256abf; --muted: #9a988f; --critical-text: #ef7f7f; --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
      --good-text: #0ca30c; --quote: #f0b44c;
    }
  }
  :root[data-theme="dark"] {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --text-1: #ffffff; --text-2: #c3c2b7;
    --grid: #2c2c2a; --axis: #383835; --border: rgba(255,255,255,0.10);
    --accent: #6da7ec; --accent-strong: #256abf; --muted: #9a988f; --critical-text: #ef7f7f; --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
    --good-text: #0ca30c; --quote: #f0b44c;
  }
  * { box-sizing: border-box; }
  body {
    margin: 0; background: var(--page); color: var(--text-1);
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  }
  main { max-width: 1120px; margin: 0 auto; padding: 32px 16px 64px; }
  h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -0.01em; }
  h2 { font-size: 18px; margin: 40px 0 12px; }
  .sub { color: var(--text-2); margin: 0 0 24px; }
  .search { margin: 4px 0 0; padding: 18px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); box-shadow: 0 6px 24px -12px color-mix(in srgb, var(--accent) 45%, transparent); }
  .search-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 700; font-size: 15px; margin-bottom: 10px; }
  .kbd-hint { color: var(--muted); font-weight: 400; font-size: 12px; }
  kbd { font: 600 11px/1 system-ui, sans-serif; padding: 2px 6px; border: 1px solid var(--axis); border-bottom-width: 2px; border-radius: 4px; background: var(--surface); color: var(--text-2); }
  form { display: flex; gap: 10px; }
  .search-field { position: relative; flex: 1 1 auto; min-width: 0; max-width: 520px; }
  /* company suggestions under the search box */
  .suggest { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20; margin: 0; padding: 4px; list-style: none;
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .35);
    max-height: 340px; overflow-y: auto; min-width: min(320px, calc(100vw - 48px)); }  /* wide enough for names in narrow boxes */
  .suggest li { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
  .suggest li b { flex: 0 0 64px; color: var(--text-1); }
  .suggest li span { color: var(--text-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .suggest li:hover, .suggest li[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
  .search-icon { position: absolute; left: 14px; top: 50%; width: 22px; height: 22px; transform: translateY(-50%); color: var(--accent); pointer-events: none; }
  input[type=text] {
    width: 100%; height: 56px; padding: 0 16px 0 46px; font-size: 20px; font-weight: 600; letter-spacing: .02em;
    border: 2px solid var(--accent); border-radius: 12px; background: var(--surface); color: var(--text-1);
    transition: box-shadow .15s;
  }
  input[type=text]::placeholder { color: var(--muted); font-weight: 400; letter-spacing: 0; }
  input[type=text]:focus { outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
  #go { height: 56px; padding: 0 26px; font-size: 17px; border-radius: 12px; }
  .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--muted); align-items: center; }
  .chip { background: var(--surface); color: var(--text-1); border: 1px solid var(--border); padding: 5px 12px; font-weight: 600; font-size: 13px; border-radius: 999px; }
  .chip:hover { border-color: var(--accent); color: var(--accent); }
  .chip.chip-clear { font-weight: 500; color: var(--muted); border-style: dashed; }
  @media (max-width: 600px) {
    .search { padding: 14px; }
    .kbd-hint { display: none; }
    input[type=text] { height: 52px; font-size: 18px; }
    #go { height: 52px; padding: 0 18px; }
  }
  button {
    padding: 10px 20px; font-size: 15px; font-weight: 600; border: 0; border-radius: 8px;
    background: var(--accent-strong); color: #fff; cursor: pointer;
  }
  button:disabled { opacity: .6; cursor: not-allowed; }
  .search-hint { margin: 8px 0 0; font-size: 14px; font-weight: 600; color: var(--accent); }
  .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--muted); align-items: center; }
  .chip { background: transparent; color: var(--text-2); border: 1px solid var(--border); padding: 3px 10px; font-weight: 500; font-size: 13px; border-radius: 999px; }
  .chip:hover { border-color: var(--axis); }
  .card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
  .error { border-color: var(--critical); color: var(--text-1); margin-top: 24px; }
  .company { margin-top: 32px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
  .company h2 { margin: 0; font-size: 22px; }
  .company .meta { color: var(--text-2); font-size: 14px; }
  .company a { color: var(--accent); }
  .tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
  .tile .label { color: var(--text-2); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
  .tile .value { font-size: 28px; font-weight: 650; margin: 4px 0 2px; }
  .tile .trend { font-weight: 600; font-size: 14px; }
  .tile .detail { color: var(--text-2); font-size: 13px; }
  .up { color: var(--good-text); } .down { color: var(--critical-text); } .flat { color: var(--text-2); }
  .score { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; font-size: 14px; color: var(--text-2); }
  .flags { display: grid; gap: 8px; }
  .flag { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; padding: 12px 14px; }
  .flag .icon { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; }
  .flag.critical .icon { background: var(--critical); }
  .flag.warning .icon { background: var(--warning); color: #0b0b0b; }
  .flag.good .icon { background: var(--good); }
  .flag.info .icon { background: var(--info); }
  .flag .title { font-weight: 600; }
  .flag .sev { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-right: 6px; color: var(--text-2); }
  .flag .why { color: var(--text-2); font-size: 14px; }
  .charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: 12px; }
  .chart-card h3 { margin: 0 0 2px; font-size: 15px; }
  .chart-card p { margin: 0 0 10px; color: var(--text-2); font-size: 13px; }
  .chart-box { position: relative; height: 260px; }
  .table-wrap { overflow-x: auto; position: relative; }  /* relative: keeps .sr-only text inside the scroll box */
  table { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
  th, td { padding: 6px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--grid); }
  th:first-child, td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); }
  thead th { color: var(--text-2); font-weight: 600; }
  .note { color: var(--muted); font-size: 12px; margin-top: 24px; }
  .loading { margin-top: 24px; color: var(--text-2); }
  .section-note { color: var(--text-2); margin: -4px 0 12px; font-size: 14px; }
  .muted { color: var(--muted); font-weight: 400; }
  .section-note a { color: var(--accent); }
  .price-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 12px; }
  .price-row label { font-weight: 600; font-size: 14px; }
  .price-row input { width: 160px; padding: 8px 12px; font-size: 15px; border: 1px solid var(--axis); border-radius: 8px; background: var(--page); color: var(--text-1); }
  .price-hint { color: var(--text-2); font-size: 13px; flex: 1 1 240px; }
  .price-links { white-space: nowrap; }
  .price-links a { color: var(--accent); font-weight: 600; text-decoration: none; }
  .price-links a:hover { text-decoration: underline; }
  .value-tiles { margin-bottom: 12px; }
  /* "Compared with its industry" card */
  .industry { margin-top: 12px; }
  .industry h3 { margin: 0 0 2px; font-size: 15px; }
  .ind-group { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
  .ind-table { width: 100%; border-collapse: collapse; font-size: 14px; }
  .ind-table th, .ind-table td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--grid); }
  .ind-table thead th { font-size: 12px; color: var(--muted); font-weight: 600; }
  .ind-table tbody th { font-weight: 500; }
  .ind-pos { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--axis); color: var(--text-2); white-space: nowrap; }
  .industry .note { margin: 10px 0 0; }
  .ind-wrap { overflow-x: auto; }  /* the table never widens the page */
  /* phones: each row becomes a small block (measure, then both values labelled, then where it stands);
     the column headings stay for screen readers */
  @media (max-width: 600px) {
    .ind-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .ind-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--grid); }
    .ind-table th, .ind-table td { border: 0; padding: 0; }
    .ind-table tbody th { grid-column: 1 / -1; font-weight: 600; }
    .ind-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 12px; }
    .ind-table td:last-child { grid-column: 1 / -1; }
  }
  /* "Latest 12 months" card under the Overview trend tiles */
  .ttm { margin-top: 12px; }
  .ttm h3 { margin: 0 0 10px; font-size: 15px; }
  .ttm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
  .ttm-item .label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
  .ttm-item .value { font-size: 22px; font-weight: 700; margin: 2px 0; }
  .ttm-item .detail { font-size: 13px; color: var(--text-2); }
  .ttm-item .trend { display: inline; font-weight: 600; }
  .ttm .note { margin: 10px 0 0; }
  .assumptions { margin-bottom: 12px; }
  .assumptions summary { cursor: pointer; font-weight: 600; font-size: 14px; }
  .assume-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px 16px; margin-top: 12px; align-items: end; }
  .assume-grid label { font-size: 13px; color: var(--text-2); grid-row: 1; }
  .assume-grid input { grid-row: 2; width: 100%; max-width: 160px; padding: 8px 12px; font-size: 15px; border: 1px solid var(--axis); border-radius: 8px; background: var(--page); color: var(--text-1); }
  .assume-note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
  .assume-reset { margin-left: 8px; padding: 4px 12px; font-size: 13px; border: 1px solid var(--accent); border-radius: 999px; background: transparent; color: var(--accent); cursor: pointer; }
  .value-tiles .value { font-size: 24px; }
  .value-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 12px; }
  /* the Piotroski and Lynch cards span the full width, their tests in two columns where there's room */
  .value-grid .piotroski, .value-grid .wide { grid-column: 1 / -1; }
  .value-step { margin-top: 24px; }
  .value-step > h3 { margin: 0 0 4px; font-size: 17px; }
  .value-step > p.muted { margin: 0 0 12px; font-size: 14px; }
  .piotroski #piotroskiChecks, .wide .checks-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); column-gap: 24px; }
  .checklist h3 { margin: 0; font-size: 16px; }
  .checklist .src { margin: 2px 0 10px; color: var(--muted); font-size: 13px; }
  .checks-score { font-size: 14px; color: var(--text-2); margin-bottom: 8px; }
  .checks-score b { color: var(--text-1); font-size: 18px; }
  .check { display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--grid); }
  .check .st { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; margin-top: 1px; }
  .check.pass .st { background: var(--good); }
  .check.fail .st { background: var(--critical); }
  .check.na .st, .check.price .st { background: transparent; border: 1.5px solid var(--axis); color: var(--muted); }
  .check .name { font-weight: 600; font-size: 14px; }
  .check .tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); margin-left: 6px; }
  .check .rule { color: var(--muted); font-size: 13px; }
  .check .actual { color: var(--text-2); font-size: 13px; }
  .history-tiles { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); margin-bottom: 12px; } /* six tiles: 3 + 3 on a desktop */
  .history-tiles .value { font-size: 24px; }
  .history-tiles .status { font-size: 13px; font-weight: 600; }
  .filter-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
  .chip[aria-pressed="true"] { background: var(--accent-strong); color: #fff; border-color: var(--accent-strong); }
  .event { display: grid; grid-template-columns: 92px 1fr auto; gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--grid); align-items: baseline; font-size: 14px; }
  .event .date { color: var(--text-2); font-variant-numeric: tabular-nums; }
  .event .kind { font-weight: 600; }
  .event .kind::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; background: var(--info); vertical-align: 1px; }
  .event.critical .kind::before { background: var(--critical); }
  .event.warning .kind::before { background: var(--warning); }
  .event .desc { color: var(--text-2); font-size: 13px; }
  .event .official { color: var(--muted); font-size: 12px; margin-top: 2px; } /* the SEC's own title, word for word */
  .event a { color: var(--accent); white-space: nowrap; font-size: 13px; }
  .empty { color: var(--text-2); padding: 12px 0; border-top: 1px solid var(--grid); }
  .more { margin-top: 10px; }
  @media (max-width: 600px) { .event { grid-template-columns: 1fr auto; } .event .date { grid-column: 1 / -1; } }
  /* Insider trades (SEC history tab) */
  .insiders .loading-note { margin: 0; color: var(--text-2); font-size: 14px; }
  .insiders .note:first-child { margin-top: 0; font-size: 13px; color: var(--text-2); }
  .insider-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; margin: 12px 0; }
  .insider-total { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
  .insider-total .label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
  .insider-total .value { font-size: 24px; font-weight: 700; }
  .insider-total .detail { font-size: 13px; color: var(--text-2); }
  .insider-signal { margin: 0 0 12px; padding: 8px 12px; border-left: 3px solid var(--good); background: var(--surface); color: var(--text-1); font-size: 14px; }
  .insider-table td, .insider-table th { text-align: left; }
  .insider-table .num { text-align: right; }
  .insider-table .who { display: block; font-weight: 600; }
  .insider-table .role { display: block; color: var(--muted); font-size: 12px; white-space: normal; max-width: 260px; }
  .insider-table .trade.buy { color: var(--good-text, var(--accent)); font-weight: 600; }
  .insider-table .tag { font-size: 11px; color: var(--text-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 6px; }
  .insider-table a { color: var(--accent); }
  .growth td:nth-child(n+4) { font-weight: 600; }
  .growth .yr { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 4px; }
  .growth .nm { color: var(--text-2); font-weight: 400; }
  .guide { margin-top: 16px; padding: 0; overflow: hidden; transition: border-color .15s; }
  .guide:has(summary:hover) { border-color: var(--accent); }
  .guide summary { cursor: pointer; padding: 12px 14px 12px 16px; font-weight: 600; font-size: 15px; list-style: none;
    display: flex; align-items: center; gap: 12px; border-radius: 12px; }
  .guide summary::-webkit-details-marker { display: none; }
  .guide summary:hover { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
  .guide summary:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
  .guide-icon { flex: 0 0 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
    background: var(--accent-strong); color: #fff; font: 700 15px/1 system-ui, sans-serif; }
  .guide-title { flex: 1 1 auto; }
  .guide-toggle { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
    border: 1px solid var(--accent); color: var(--accent); font-size: 13px; font-weight: 600; white-space: nowrap; }
  .guide summary:hover .guide-toggle { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
  .guide-toggle svg { transition: transform .2s; }
  .guide[open] .guide-toggle svg { transform: rotate(180deg); }
  .guide .when-open, .guide[open] .when-closed { display: none; }
  .guide[open] .when-open { display: inline; }
  .guide[open] summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
  /* the guide starts collapsed: on the start page "Show guide" pulses gently three times so it gets noticed, then stops
     (no endless flashing, and none at all for people who turn motion off) */
  .guide:not([open]):not(.has-results) .guide-toggle { animation: guide-pulse 1.6s ease-out .8s 3; }
  @keyframes guide-pulse {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
    70% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 0%, transparent); }
    100% { box-shadow: 0 0 0 0 transparent; }
  }
  @media (prefers-reduced-motion: reduce) { .guide-toggle svg, .guide { transition: none; } .guide-toggle { animation: none !important; } }
  .guide-intro { margin: 0 18px 10px; color: var(--text-2); font-size: 14px; }
  .guide-try { color: var(--accent); font-weight: 600; }
  .guide.has-results .guide-try { display: none; }
  .guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 10px; padding: 0 18px 4px; }  /* seven cards: 4 + 3 on a desktop */
  .guide-item { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; text-align: left; padding: 14px; border-radius: 12px;
    background: var(--surface); color: var(--text-1); border: 1px solid var(--border); font: inherit; cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; }
  .guide-item:hover, .guide-item:focus-visible { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 6px 18px -12px color-mix(in srgb, var(--accent) 60%, transparent); }
  .gi-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
  .gi-icon svg, .tab-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .gi-body { display: grid; gap: 4px; }
  .gi-title { font-weight: 700; font-size: 15px; }
  .gi-text { color: var(--text-2); font-size: 14px; line-height: 1.45; }
  .gi-go { color: var(--accent); font-size: 13px; font-weight: 600; margin-top: 2px; }
  .gi-go .go-open, .guide.has-results .gi-go .go-example { display: none; }
  .guide.has-results .gi-go .go-open { display: inline; }
  .guide-notes { list-style: none; margin: 14px 18px 18px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 10px; }
  .guide-notes li { padding: 10px 12px; border-radius: 10px; background: var(--page); color: var(--text-2); font-size: 13px; line-height: 1.45; }
  .guide-notes strong { display: block; color: var(--text-1); font-size: 13px; margin-bottom: 2px; }
  .tabbar [role=tab] { display: inline-flex; align-items: center; gap: 6px; }
  .tab-icon { width: 16px; height: 16px; }

  .glance { margin-top: 16px; padding: 6px 8px; display: grid; }
  .glance-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 8px 10px 4px; }
  .glance-head h2 { margin: 0; font-size: 17px; }
  .glance-head .muted { font-size: 13px; }
  .panel-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--grid); }
  .panel-nav button { background: var(--surface); color: var(--text-1); border: 1px solid var(--border); font-weight: 600; font-size: 14px; padding: 10px 14px; }
  .panel-nav button:hover { border-color: var(--axis); }
  .panel-nav .next { margin-left: auto; background: var(--accent-strong); color: #fff; border-color: var(--accent-strong); }
  #glance { display: grid; }
  .glance-row { width: 100%; display: grid; grid-template-columns: 26px 150px 1fr auto; gap: 10px; align-items: center; padding: 9px 10px; border: 0; background: none; color: var(--text-1); font: inherit; text-align: left; cursor: pointer; border-radius: 8px; }
  #glance .glance-row { border-top: 1px solid var(--grid); border-radius: 0; }
  .glance-row:hover { background: var(--page); }
  .glance-row .st { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; background: var(--info); }
  .glance-row.good .st { background: var(--good); }
  .glance-row.warning .st { background: var(--warning); color: #0b0b0b; }
  .glance-row.critical .st { background: var(--critical); }
  .glance-row .what { color: var(--text-2); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
  .glance-row .say { font-size: 15px; }
  .glance-row .go { color: var(--accent); font-size: 13px; white-space: nowrap; }

  .tabbar { position: sticky; top: 0; z-index: 5; display: flex; gap: 4px; overflow-x: auto; margin: 20px 0 12px; padding: 8px 0; background: var(--page); border-bottom: 1px solid var(--grid); scrollbar-width: none; }
  .tabbar::-webkit-scrollbar { display: none; }
  .tabbar.more-right { -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent); }
  .tabbar.more-left { -webkit-mask-image: linear-gradient(to left, #000 82%, transparent); mask-image: linear-gradient(to left, #000 82%, transparent); }
  .tabbar.more-left.more-right { -webkit-mask-image: linear-gradient(to right, transparent, #000 15%, #000 85%, transparent); mask-image: linear-gradient(to right, transparent, #000 15%, #000 85%, transparent); }
  .tabbar [role=tab] { flex: 0 0 auto; background: none; color: var(--text-2); font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 8px; }
  .tabbar [role=tab]:hover { color: var(--text-1); background: var(--surface); }
  .tabbar [role=tab][aria-selected=true] { color: #fff; background: var(--accent-strong); }
  .tabbar .badge:empty { display: none; }
  .tabbar .badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; font-size: 12px; line-height: 18px; background: var(--critical); color: #fff; }
  .panel-h { font-size: 15px; margin: 24px 0 8px; }
  .panel > .section-note:first-child { margin-top: 0; }
  @media (max-width: 600px) {
    .glance-row { grid-template-columns: 24px 1fr auto; }
    .glance-row .what { grid-column: 2 / 4; font-size: 12px; }
    .glance-row .say { grid-column: 2 / 3; }
    .glance-row .go { font-size: 0; }
    .glance-row .go::after { content: "›"; font-size: 22px; }
  }
  .spark { display: block; width: 100%; height: 34px; margin: 8px 0 2px; }
  .spark path { fill: none; stroke: var(--series-1); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
  .spark circle { fill: var(--series-1); }
  .spark .zero { stroke: var(--axis); stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
  .tile .value, table, .glance-row .say { font-variant-numeric: tabular-nums; }
  abbr[title] { text-decoration: underline dotted; text-underline-offset: 2px; cursor: help; }
  .flag-group h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 22px 0 8px; }
  .flag-group:first-child h3 { margin-top: 4px; }
  .flag-group .count { font-size: 12px; font-weight: 700; min-width: 20px; text-align: center; padding: 1px 6px; border-radius: 10px; background: var(--grid); color: var(--text-2); }
  .flags { gap: 0; }
  .flag-group .flag + .flag { margin-top: 8px; }
  .flag .help { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--grid); font-size: 13px; color: var(--text-2); }
  .flag .help strong { color: var(--text-1); font-weight: 600; }
  .empty-group { color: var(--text-2); }
  .meter { height: 6px; margin-top: 8px; border-radius: 3px; background: var(--grid); overflow: hidden; }
  .meter span { display: block; height: 100%; border-radius: 3px; background: var(--good); }
  tr.group th { text-align: left; padding-top: 14px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); background: var(--surface); }
  th.latest, td.latest { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); font-weight: 600; }
  #glance .glance-row.critical { box-shadow: inset 3px 0 0 var(--critical); }
  #glance .glance-row.warning { box-shadow: inset 3px 0 0 var(--warning); }
  .glossary { margin-top: 24px; padding: 0; }
  .glossary summary { cursor: pointer; padding: 12px 16px; font-weight: 600; }
  .glossary dl { margin: 0; padding: 0 16px 16px; display: grid; grid-template-columns: minmax(140px, max-content) 1fr; gap: 8px 16px; font-size: 14px; }
  .glossary dt { font-weight: 600; }
  .glossary dd { margin: 0; color: var(--text-2); }
  @media (max-width: 600px) { .glossary dl { grid-template-columns: 1fr; gap: 2px; } .glossary dd { margin-bottom: 8px; } }
  .top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
  /* the title keeps a readable width; on a phone the buttons move to their own row instead of squeezing it */
  .top h1 { flex: 1 1 220px; }
  .top-actions { margin-left: auto; }
  .lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 2px; background: var(--surface); }
  .lang-switch button { background: none; color: var(--text-2); font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 999px; }
  .lang-switch button[aria-pressed="true"] { background: var(--accent-strong); color: #fff; }
  .table-wrap:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
  .stale-note { margin: 8px 0 0; padding: 8px 12px; font-size: 13px; border-left: 3px solid var(--warning); background: var(--page); border-radius: 0 6px 6px 0; }
  .company-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
  .company-actions .compare-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14px;
    text-decoration: none; color: #fff; background: var(--accent-strong); border: 1px solid var(--accent-strong); }
  .company-actions .compare-btn:hover { filter: brightness(1.08); }
  .company-actions .compare-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
  .hidden { display: none; }
  /* disclaimer.html: readable line length, clear section headings */
  .legal { max-width: 760px; margin: 8px 0 16px; padding: 20px 24px; }
  .legal h2 { margin: 0 0 8px; font-size: 22px; }
  .legal h3 { margin: 20px 0 4px; font-size: 16px; }
  .legal p { margin: 0; line-height: 1.6; color: var(--text-1); }
  .legal .legal-source { margin-top: 20px; font-size: 13px; color: var(--text-2); }
  .disclaimer a { color: var(--accent); white-space: nowrap; }
  .disclaimer { margin: 24px 0 0; padding: 10px 14px; font-size: 13px; color: var(--text-2); border-left: 3px solid var(--warning); background: var(--surface); border-radius: 0 8px 8px 0; }
  /* start-page quote of the day */
  .quotes { margin: 16px 0; }
  .quotes-title { margin: 0 0 10px; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
  .quote { margin: 0; padding: 12px 16px; border-left: 3px solid var(--quote); }
  .quote blockquote { margin: 0; font-size: 16px; line-height: 1.45; font-style: italic; font-weight: 500; color: var(--quote); }
  .quote figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); }
  footer { max-width: 1120px; margin: 0 auto; padding: 24px 16px 40px; border-top: 1px solid var(--grid); color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
  footer a { color: var(--text-2); }
  /* the author credit stands out in the accent colour; the underline stays so it reads as a link, not just coloured text */
  footer a.author { color: var(--accent); font-weight: 600; text-underline-offset: 2px; }
  /* the site's own links (How we calculate, Disclaimer, Source on GitHub) in the link colour; the SEC EDGAR credit stays muted */
  footer [data-i18n="ui.footer.legal"] a, footer [data-i18n="ui.footer.built"] a { color: var(--accent); }
  footer a.author:hover { text-decoration-thickness: 2px; }
  @media (max-width: 600px) {
    main { padding-top: 20px; }
    h1 { font-size: 22px; }
    .tile .value { font-size: 24px; }
    .chart-box { height: 220px; }
  }

/* ---------- compare page ---------- */
  .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; }
  .home-link { color: inherit; text-decoration: none; }
  .home-link:hover { color: var(--accent); }
  .back-link { display: inline-block; margin: -12px 0 16px; color: var(--accent); font-weight: 600; font-size: 14px; }
  .cmp-pickers { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: start; }
  .cmp-slot { min-width: 0; }
  .cmp-form input[type=text] { font-size: 18px; height: 50px; }
  .cmp-swap { align-self: center; margin-top: 18px; background: var(--surface); color: var(--text-1); border: 1px solid var(--border); padding: 8px 14px; border-radius: 999px; font-weight: 600; }
  .cmp-swap:hover { border-color: var(--accent); color: var(--accent); }
  .cmp-status { min-height: 1.5em; margin: 8px 0 0; font-size: 14px; color: var(--text-2); }
  .cmp-status.error-text { color: var(--critical-text); font-weight: 600; }
  .cmp-empty { margin-top: 24px; color: var(--text-2); text-align: center; padding: 28px 18px; }
  .cmp-result { margin-top: 24px; }
  .cmp-cards, .cmp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .cmp-cards { margin-top: 12px; }
  .cmp-card h2, .cmp-two h3 { margin: 0 0 4px; font-size: 18px; display: flex; align-items: center; gap: 8px; }
  .cmp-card .meta { color: var(--text-2); font-size: 13px; }
  .cmp-card a { display: inline-block; margin-top: 8px; color: var(--accent); font-weight: 600; font-size: 14px; }
  .cmp-table td { text-align: left; white-space: normal; min-width: 120px; }
  .cmp-table th[scope=row] { white-space: normal; min-width: 150px; font-weight: 500; }
  .cmp-table thead th { font-size: 14px; color: var(--text-1); font-weight: 700; text-align: left; }
  .cmp-table tr.group th { text-align: left; padding-top: 14px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }
  .cmp-table td.fav { font-weight: 700; }
  .fav-dot { color: var(--good-text); font-size: 11px; vertical-align: 1px; }
  .glance-cell .st, .check-cell .st { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; font-weight: 800; color: #fff; background: var(--info); margin-right: 4px; }
  .glance-cell.good .st, .check-cell.pass .st { background: var(--good); }
  .glance-cell.warning .st { background: var(--warning); color: #0b0b0b; }
  .glance-cell.critical .st, .check-cell.fail .st { background: var(--critical); }
  .cmp-prices { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; margin-bottom: 12px; }
  .cmp-prices-label { font-weight: 600; width: 100%; }
  .cmp-price { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .cmp-price label { font-weight: 700; min-width: 48px; }
  .cmp-price input { width: 120px; height: 38px; padding: 0 10px; font-size: 15px; border: 1px solid var(--axis); border-radius: 8px; background: var(--surface); color: var(--text-1); }
  .cmp-caveats .stale-note { margin: 0 0 8px; }
  .cmp-flags { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
  .cmp-flags li { padding: 8px 10px; border-left: 3px solid var(--warning); background: var(--page); border-radius: 0 6px 6px 0; font-weight: 600; font-size: 14px; }
  .cmp-flags li.critical { border-left-color: var(--critical); }
  .cmp-flags .sev { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); margin-right: 4px; }
  .cmp-flags .why { font-weight: 400; color: var(--text-2); font-size: 13px; margin-top: 2px; }
  .cmp-two .count { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 10px; background: var(--grid); color: var(--text-2); }
  @media (max-width: 720px) {
    .cmp-pickers { grid-template-columns: 1fr; }
    .cmp-swap { justify-self: start; margin-top: 0; }
    .cmp-cards, .cmp-two { grid-template-columns: 1fr; }
    .cmp-price .price-links { white-space: normal; flex-basis: 100%; }
    .cmp-price { min-width: 0; }
  }

/* ---------- header: home button ---------- */
  .top-actions { display: flex; align-items: center; gap: 10px; }
  .home-btn, .nav-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
              color: var(--text-2); font-size: 13px; font-weight: 700; text-decoration: none; }
  .home-btn[hidden] { display: none; }  /* on the start page Home would only reload it */
  .home-btn svg, .nav-btn svg { width: 16px; height: 16px; }
  .home-btn:hover, .nav-btn:hover { color: var(--accent); border-color: var(--accent); }
  .home-btn:focus-visible, .nav-btn:focus-visible, .home-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- My portfolio (portfolio.html) ---------- */
.page-title { margin: 4px 0 0; font-size: 22px; }
.portfolio-page .search form { display: flex; gap: 8px; }
.company-actions .portfolio-add { font-weight: 600; }
.pf-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pf-table th, .pf-table td { padding: 8px 8px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.pf-table th[scope="row"], .pf-table thead th:first-child { text-align: left; white-space: normal; min-width: 140px; }
.pf-table thead th { vertical-align: bottom; font-size: 12px; color: var(--text-2); }
.pf-table tfoot th, .pf-table tfoot td { font-weight: 600; border-top: 2px solid var(--border); }
.pf-sort { all: unset; cursor: pointer; white-space: normal; max-width: 110px; display: inline-block; text-align: inherit; }
.pf-sort:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.pf-years { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.pf-cell.good, .pf-swatch.good { color: var(--good-text, var(--good)); }
.pf-cell.bad, .pf-swatch.bad { color: var(--critical-text, var(--critical)); }
.pf-cell.good { background: color-mix(in srgb, var(--good) 12%, transparent); }
.pf-cell.bad { background: color-mix(in srgb, var(--critical) 12%, transparent); }
.pf-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; background: currentColor; }
.pf-remove { display: inline-grid; place-items: center; padding: 0; min-width: 0; background: none; border: 1px solid var(--border); border-radius: 999px; width: 28px; height: 28px; font-size: 13px; line-height: 1; cursor: pointer; color: var(--text-2); }
.pf-remove:hover { color: var(--critical); border-color: var(--critical); }
.pf-remove:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
#pfClear { margin: 10px 0 12px; }
#pfResult { margin-top: 16px; }
.pf-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 12px; }
.pf-tools #pfClear { margin: 0; }
.pf-shared-title { margin: 0 0 4px; font-size: 16px; }
#pfSharedStatus:empty, #pfStatus:empty { display: none; }
.pf-table th[scope="row"] a { color: var(--accent); }
/* the company column stays in view while the measures scroll sideways (phones) */
.pf-table th[scope="row"], .pf-table thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
/* very narrow screens: "My portfolio" in the header shrinks to its icon (the text stays for screen readers), so the
   buttons still fit on one row */
@media (max-width: 360px) {
  .nav-btn { padding: 5px 8px; }
  .nav-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- S&P 500 picker (sp500.html) and its results (sp500-view.html) ---------- */
.top-actions { flex-wrap: wrap; justify-content: flex-end; row-gap: 8px; }
.nav-btn[aria-current="page"] { color: var(--accent); border-color: var(--accent); }
.sp-filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.sp-field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.sp-field input, .sp-field select { font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text-1); }
.sp-field input:focus-visible, .sp-field select:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.sp-count { margin: 10px 0 6px; font-size: 13px; }
/* about 12 rows visible; the whole list scrolls inside the card */
.sp-list { max-height: 520px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.sp-list:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sp-rows { list-style: none; margin: 0; padding: 0; }
.sp-row { display: flex; align-items: center; gap: 10px; padding: 0 12px; border-bottom: 1px solid var(--border); min-height: 42px; }
.sp-row:last-child { border-bottom: 0; }
.sp-row.on { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.sp-row input { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.sp-row label { flex: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 10px 0; cursor: pointer; }
.sp-row input:disabled + label { cursor: not-allowed; color: var(--muted); }
.sp-name { font-weight: 600; }
.sp-ticker { font-size: 13px; color: var(--text-2); }
.sp-sector { margin-left: auto; font-size: 12px; color: var(--muted); }
.sp-none { padding: 16px; margin: 0; }
/* the selection stays in reach while the list scrolls */
.sp-bar { position: sticky; bottom: 8px; z-index: 2; margin-top: 12px; box-shadow: 0 4px 18px rgb(0 0 0 / 12%); }
.sp-bar-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.sp-picked-title { margin: 0; font-size: 16px; }
.sp-chips-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.sp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-chips:empty { display: none; }
#spStatus:empty { display: none; }
.sp-show { display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14px;
  background: var(--accent-strong); color: #fff; text-decoration: none; }
.sp-show[aria-disabled="true"] { background: var(--border); color: var(--text-2); pointer-events: none; }
.sp-show { border: 0; cursor: pointer; font-family: inherit; }
.sp-show:hover { filter: brightness(1.08); }
.sp-show:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
#spHint, #spStatus { margin: 8px 0 0; }
#spClear[hidden] { display: none; }
.spv-actions .back-link { margin: 0; }
.spv-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0; }
@media (max-width: 560px) { #spHint { display: none; } .sp-filters { grid-template-columns: 1fr; } .sp-sector { margin-left: 0; width: 100%; } .sp-list { max-height: 60vh; } }
#spvStatus:empty { display: none; }
.csv-row { display: flex; justify-content: flex-end; margin: 0 0 8px; }
.spv-buttons { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---------- How we calculate (methodology.html) ---------- */
.meth-toc ul { margin: 6px 0 0; padding-left: 18px; columns: 2 220px; }
.meth-toc h3 { margin: 0; font-size: 15px; }
.meth-toc li { margin: 0; }
.meth-toc a { display: inline-block; padding: 4px 0; min-height: 24px; }
.meth-section { margin-top: 12px; }
.meth-section h3 { margin: 0 0 8px; font-size: 18px; scroll-margin-top: 12px; }
.meth-section h4 { margin: 18px 0 2px; font-size: 15px; }
.meth-section h5 { margin: 12px 0 4px; font-size: 13px; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.meth-section ul { padding-left: 18px; }
.meth-section li { margin: 4px 0; }
.meth-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.meth-table th, .meth-table td { text-align: left; vertical-align: top; padding: 7px 10px; border-bottom: 1px solid var(--border); white-space: normal; }
.meth-table thead th { font-size: 12px; color: var(--text-2); }
.meth-table tbody th[scope="row"] { font-weight: 600; width: 34%; }
.meth-table tr.group th { background: var(--surface-2, transparent); font-size: 13px; padding-top: 14px; }
.meth-sev { font-size: 12px; font-weight: 700; white-space: nowrap; }
.meth-sev.critical { color: var(--critical-text); }
.meth-sev.warning { color: var(--warning-text, var(--text-1)); }
.meth-sev.good { color: var(--good-text); }
.meth-sev.info { color: var(--text-2); }

/* ---------- Funds page (funds.html) ---------- */
.fund-add label { display: block; font-weight: 600; margin-bottom: 6px; }
.fund-add-row { display: flex; gap: 8px; flex-wrap: wrap; }
.fund-add-row input { flex: 1 1 220px; min-width: 0; padding: 10px 12px; font-size: 16px; border: 1px solid var(--axis); border-radius: 8px; background: var(--page); color: var(--text-1); text-transform: uppercase; }
.fund-add-row input::placeholder { text-transform: none; }
.fund-add .sp-chips { margin-top: 10px; }
.fund-h { margin: 0 0 10px; font-size: 16px; }
.fund-result .fund-h + .fund-mix, #fundMixTitle { margin-top: 18px; }
.fund-table thead th { vertical-align: bottom; }
.fund-table .fund-tk { display: block; font-size: 14px; color: var(--text-1); font-weight: 700; }
.fund-table .fund-name, .fund-table .fund-class { display: block; font-weight: 500; white-space: normal; max-width: 220px; margin-left: auto; }
.fund-table tbody td { white-space: nowrap; }
.fund-table td.fav { font-weight: 700; }
.fund-mix { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.fund-mix-card h4 { margin: 0 0 8px; font-size: 14px; }
.fund-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fund-bars li { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 3.5em; gap: 8px; align-items: center; font-size: 13px; }
.fund-bar-label { overflow-wrap: anywhere; }
.fund-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.fund-bar > span { display: block; height: 100%; background: var(--accent); }
.fund-bar-pct { text-align: right; font-variant-numeric: tabular-nums; }
.fund-help dl { margin: 10px 0 0; }
.fund-help dt { font-weight: 600; margin-top: 8px; }
.fund-help dd { margin: 2px 0 0; color: var(--text-2); }
.portfolio-page form.fund-add { display: block; }
.fund-add .chips { margin-top: 10px; }
.fund-table td .fund-vs { display: block; font-size: 12px; white-space: normal; max-width: 200px; margin-left: auto; }
@media (max-width: 600px) {
  .fund-table th[scope="row"] { min-width: 96px; max-width: 120px; font-size: 13px; }
  .fund-table th, .fund-table td { padding: 8px 6px; }
  .fund-table .fund-name, .fund-table .fund-class, .fund-table td .fund-vs { max-width: 140px; }
}
.fund-top { margin-bottom: 18px; }
.fund-holdings { counter-reset: holding; }
.fund-holdings li { counter-increment: holding; }
.fund-holdings .fund-bar-label::before { content: counter(holding) ". "; color: var(--text-2); font-variant-numeric: tabular-nums; }
.fund-overlap { display: grid; gap: 14px; margin-bottom: 18px; }
.fund-overlap-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.fund-overlap-row .fund-bar { display: block; height: 10px; }
.fund-overlap-row p { margin: 4px 0 0; font-size: 13px; }
.fund-growth { margin-bottom: 18px; }
.fund-growth figure { margin: 0; }
.fund-chart { width: 100%; height: 120px; display: block; }
.fund-chart polyline { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.fund-chart-fund { stroke: var(--accent); }
.fund-chart-index { stroke: var(--text-2); stroke-dasharray: 4 3; }
.fund-chart-base { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.fund-growth figcaption { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; margin-top: 6px; }
.fund-key::before { content: ""; display: inline-block; width: 14px; height: 0; border-top: 2px solid var(--accent); vertical-align: middle; margin-right: 6px; }
.fund-key.index::before { border-top: 2px dashed var(--text-2); }
.fund-key-note { flex-basis: 100%; }

/* Share: LinkedIn · X · Gmail (src/share.ts) */
.share { margin-top: 10px; font-size: 14px; }
.share a { font-weight: 600; }
#cmpShare .share, #fundShare .share { margin: 0 0 12px; }

/* All companies (companies.html) */
.co-filters { grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 700px) { .co-filters { grid-template-columns: 1fr; } }
.co-filters .sp-field { min-width: 0; }
.co-filters select, .co-filters input { width: 100%; min-width: 0; max-width: 100%; text-overflow: ellipsis; }
.co-table .co-ind { display: none; }
/* phones: the industry goes under the name, so ticker and exchange fit beside it */
@media (max-width: 600px) {
  .co-table th:nth-child(4), .co-table td:nth-child(4) { display: none; }
  .co-table th[scope="row"] { min-width: 0; }
  .co-table .co-ind { display: block; font-weight: 400; font-size: 12px; color: var(--text-2); margin-top: 2px; }
}
.co-table td, .co-table th[scope="row"] { text-align: left; white-space: normal; }
.co-table th[scope="col"] { text-align: left; }
.co-table td:nth-child(2) { font-variant-numeric: tabular-nums; white-space: nowrap; }
.co-more { margin-top: 12px; }
