/* Search-engine pages (scripts/seo.py): the same tokens as the app, a plain reading layout. */
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); }
.seo-top { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 14px max(16px, calc((100vw - 980px) / 2)); border-bottom: 1px solid var(--line); background: var(--surface); }
.seo-brand { font-weight: 600; font-size: 17px; color: var(--ink); text-decoration: none; }
.seo-top nav { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.seo-top nav a { color: var(--ink-2); text-decoration: none; }
.seo { max-width: 980px; margin: 0 auto; padding: 24px 16px 48px; }
.seo h1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.2; letter-spacing: -.01em; margin: 6px 0 10px; }
.seo h2 { font-size: 20px; margin: 30px 0 10px; }
.seo .lead { color: var(--ink-2); max-width: 75ch; }
.seo .crumbs { font-size: 13px; color: var(--muted); margin: 0; }
.seo .crumbs a { color: var(--muted); }
.seo-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 18px 0; }
.seo-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.seo-tile span { display: block; font-size: 12.5px; color: var(--muted); }
.seo-tile b { display: block; font-size: 22px; font-weight: 600; margin-top: 4px; }
.seo-cta { display: inline-block; background: var(--ink); color: var(--bg); text-decoration: none; padding: 10px 16px; border-radius: 8px; font-weight: 500; margin-right: 10px; }
.seo-cta:hover { background: var(--accent); color: #fff; }
.seo blockquote { margin: 0; padding: 10px 14px; border-left: 3px solid var(--line); color: var(--ink-2); background: var(--surface); border-radius: 0 8px 8px 0; }
/* tables: the generated ones scroll sideways in their .tbl-wrap; a table of an app view drawn on the page
   (web/seo-embed.js, e.g. fair value) keeps the view's own sizing: a minimum width from the page made it wider than its
   column, and the page wider than a phone */
.seo table { border-collapse: collapse; width: 100%; font-size: 14px; }
.seo th, .seo td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.seo .tbl-wrap { overflow-x: auto; }
.seo .tbl-wrap th, .seo .tbl-wrap td { white-space: nowrap; }
/* a cell allowed to wrap (the signals list, scripts/seo_hub.py) keeps a readable width: in a table wider than a phone it
   got the width of its longest word, one word a line, rows 300px tall */
.seo .tbl-wrap td [style*="white-space:normal"], .seo .tbl-wrap td [style*="white-space: normal"] { display: inline-block; min-width: 20em; }
/* a name that may wrap (scripts/seo_daily.py): a company's or a holder's, so a six-column table keeps its figures in view */
.seo .tbl-wrap td .wrap { white-space: normal; display: inline-block; min-width: 9em; max-width: 22em; }
@media (max-width: 640px) { .seo .tbl-wrap td .wrap { white-space: nowrap; min-width: 0; max-width: none; } }   /* a phone scrolls the table sideways anyway: one line a row */
.seo th { background: var(--surface-2); font-size: 12px; color: var(--muted); font-weight: 500; }
.seo td.num, .seo th.num { text-align: right; font-family: var(--mono); font-size: 13px; }
.seo-list { padding-left: 18px; line-height: 1.9; }
.seo .muted { color: var(--muted); font-size: 13.5px; }
.seo-foot { max-width: 980px; margin: 0 auto; padding: 16px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.seo-chart { box-sizing: border-box; width: min(1280px, calc(100vw - 32px)); margin: 18px 0 10px calc(50% - min(640px, 50vw - 16px)); background: #fcfcfb; border: 1px solid var(--line); border-radius: 12px; padding: 8px; overflow-x: auto; }
.seo-chart svg { display: block; width: 100%; height: auto; min-width: 860px; }
.seo-chart:not([data-src]) svg { min-width: 0; }          /* a line chart in a chart box (13F pages) scales; only Sankeys keep 860px */
.seo-chart > p { margin: 40px 0; text-align: center; }

/* the topic pages' links to each other (scripts/seo_topics.py) */
.seo-more { margin: 4px 0 16px; font-size: 14px; line-height: 1.8; }
.seo-more b { color: var(--ink); }
.seo-more-main { margin-top: 28px; }
.seo h3 { font-size: 16px; margin: 18px 0 4px; }
.seo-themes{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:10px;margin:10px 0}
.seo-theme{display:block;border:1px solid var(--line,#d6d3cc);border-radius:8px;overflow:hidden;text-decoration:none;color:inherit}
.seo-theme img{display:block;width:100%;height:auto;background:#fbfaf7}.seo-theme span{display:block;padding:6px 9px;font-size:13px}
.seo-svg svg{display:block}.seo-live{margin-top:18px}
.seo-sk-modes{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}.seo-sk-modes button{cursor:pointer;padding:6px 10px;border:1px solid #a7b2bc;border-radius:7px;background:transparent;color:inherit;font:inherit;font-size:13px}
.seo-sk-modes button[aria-pressed="true"]{background:#184a68;color:#fff;border-color:#184a68}.seo-sk-notes ul{margin:4px 0 0 18px}.seo-sk-notes h3{margin:8px 0 2px;font-size:15px}
/* two companies' Sankeys (scripts/seo_compare.py): one under the other, each as wide as a chart on any page; in two
   columns each showed about half of its chart, or overflowed the page when it kept the chart width (CL vs EL) */
.seo-two{display:block}
.seo-two > div + div{margin-top:26px}
.seo-two h3{margin:4px 0;font-size:16px}

/* ---- 2026-10 look: cards, the headline, sign colours, a contents bar, collapsible interactive views ---- */
.seo { max-width: 1040px; }
.seo h2 { position: relative; padding-left: 12px; scroll-margin-top: 64px; }
.seo h2::before { content: ''; position: absolute; left: 0; top: .2em; bottom: .2em; width: 4px; border-radius: 2px; background: var(--accent); }
.seo h1 + .muted, .seo h1 + p.muted { margin-top: -4px; }
.seo-hl { margin: 14px 0 6px; padding: 14px 18px; border-radius: 12px; font-size: 18px; line-height: 1.5; background: var(--surface);
  border: 1px solid var(--line); border-left: 6px solid var(--accent); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.seo-hl.down { border-left-color: #c0563d; }
.seo-hl > span { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 99px; background: var(--surface-2); font: 600 12.5px/1.8 var(--mono); vertical-align: 2px; }
.seo-hl b { font-weight: 650; }
.seo-tile { box-shadow: 0 1px 2px rgba(0,0,0,.04); transition: transform .12s ease; }
.seo-tile:hover { transform: translateY(-1px); }
.seo-tile.up b { color: #17734a; }
.seo-tile.down b { color: #b8432f; }
.seo-toc { position: sticky; top: 0; z-index: 5; display: flex; gap: 6px; overflow-x: auto; margin: 6px -16px 4px; padding: 8px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.seo-toc a { flex: none; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 13.5px; text-decoration: none; }
.seo-toc a:hover { border-color: var(--accent); color: var(--accent); }
.seo-note { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px 18px; }
.seo-note p { margin: 12px 0; }
/* drawn charts as cards (light, like the Sankey, so the dark text reads in dark mode too) */
figure.seo-svg { margin: 14px 0; padding: 14px 16px 10px; background: #fcfcfb; color: #2b2b2b; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
figure.seo-svg figcaption { margin-top: 6px; color: #666561; }
.seo-grid figure.seo-svg { break-inside: avoid; }
/* tables: scroll sideways inside their box, never the page */
.seo .tbl-wrap, .seo .tablebox { overflow-x: auto; max-width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin: 12px 0; }
.seo .tbl-wrap table, .seo .tablebox table { margin: 0; }
.seo tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 35%, transparent); }
.seo tbody tr:hover td { background: var(--accent-soft, #dcebe2); }
/* interactive views: one row each, opened to draw */
details.seo-live { margin: 10px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow-x: auto; max-width: 100%; }
details.seo-live > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-weight: 600; font-size: 16px; }
details.seo-live > summary::-webkit-details-marker { display: none; }
details.seo-live > summary::after { content: '▸'; margin-left: auto; color: var(--muted); transition: transform .15s; }
details.seo-live[open] > summary::after { transform: rotate(90deg); }
details.seo-live[open] > summary { border-bottom: 1px solid var(--line); }
details.seo-live > :not(summary) { padding: 0 14px; }
.seo-ic { font-size: 20px; }
.seo-tap { font: 500 11px/1.8 var(--mono); padding: 0 8px; border-radius: 99px; background: var(--accent-soft, #dcebe2); color: var(--accent-ink, #0f5134); }
.seo-live table { font-size: 13px; }
@media (max-width: 700px) {
  .seo { padding: 16px 14px 40px; }
  .seo h2 { font-size: 18px; }
  .seo-tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .seo-tile b { font-size: 19px; }
  .seo-hl { font-size: 16px; padding: 12px 14px; }
  .seo-chart { position: relative; }
  .seo-chart::after { content: '← swipe →'; position: sticky; left: 0; display: block; text-align: center; font: 500 11px var(--mono); color: var(--muted); padding-top: 4px; }
  figure.seo-svg { padding: 10px 8px 6px; margin: 10px -4px; }
}
.seo-themes { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
@media (max-width: 700px) {
  .seo-toc { margin: 6px -14px 4px; padding: 8px 14px; }
  figure.seo-svg { overflow-x: auto; }
  figure.seo-svg svg { min-width: 560px; }           /* legible labels: the chart scrolls sideways instead of shrinking */
  .seo-chart:not([data-src]) svg { min-width: 600px; }  /* the 13F line chart too */
}
@media (max-width: 605px) {   /* narrower than a drawn chart's 560px: the rest of it is a swipe away; say so, as under a Sankey */
  figure.seo-svg::after { content: '← swipe →'; position: sticky; left: 0; display: block; text-align: center; font: 500 11px var(--mono); color: var(--muted); padding-top: 4px; }
}

/* the company's Sankey as a picture: image search, saving and sharing */
.seo-share { margin: 14px 0 6px; max-width: 560px; }
.seo-share img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; background: #fbfaf7; }
.seo-share figcaption { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

.seo-embed { margin-top: 8px; font-size: 13px; }
.seo-embed summary { cursor: pointer; color: var(--accent); }
.seo-embed label { display: block; margin: 8px 0 3px; color: var(--muted); }
.seo-embed textarea { width: 100%; font: 12px/1.4 var(--mono, monospace); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--surface); color: var(--ink); resize: vertical; }
.seo h3 { font-size: 15px; margin: 14px 0 4px; }
.seo tr.me td { background: color-mix(in srgb, var(--accent, #17734a) 10%, var(--surface)); font-weight: 600; }
/* a long list folded by group (the comparison index: one industry at a time) */
details.seo-fold { margin: 4px 0; border-bottom: 1px solid var(--line); }
details.seo-fold > summary { cursor: pointer; padding: 8px 0; font-size: 15px; }
details.seo-fold > summary b { font-weight: 600; }
details.seo-fold > ul { margin: 0 0 10px; }

.seo-follow { margin: 28px 0 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 14px; }
.seo-follow p { margin: 4px 0; }
.seo-follow .seo-cite { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.seo-traps { margin: 10px 0 16px; padding: 10px 14px; border: 1px solid var(--line); border-left: 3px solid var(--accent, #2a78d6); border-radius: 8px; background: var(--surface); font-size: 14px; }
.seo-traps ul { margin: 6px 0; padding-left: 18px; } .seo-traps li { margin: 3px 0; }
.trap-id { font-family: var(--mono, monospace); font-size: 12px; color: var(--muted); margin-right: 4px; }
.trap-st { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); vertical-align: middle; }
.trap-st.trig { color: #b42318; border-color: #f0b4ad; background: #fff3f1; } .trap-st.rev { color: #8a5a00; border-color: #efd59a; background: #fff8e6; } .trap-st.ok { color: #17734a; border-color: #b7dfc9; background: #effaf3; }
.trap-card { margin: 10px 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); } .trap-card.trig { border-left: 3px solid #b42318; } .trap-card.rev { border-left: 3px solid #d9822b; }
.seo h3 .trap-st { margin-left: 6px; }
@media (prefers-color-scheme: dark) { .trap-st.trig { background: #3a1d1a; } .trap-st.rev { background: #3a2f12; } .trap-st.ok { background: #14301f; } }
.pr-btns .btn { margin: 4px 6px 4px 0; } .pr-btns .btn.pr-ok { border-color: #17734a; color: #17734a; } .pr-btns .btn[disabled] { opacity: .7; }
.trap-chart-box { margin: 10px 0 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.trap-chart-box svg text { fill: currentColor; } .trap-chart-box .tc-readings label { margin-right: 12px; } .trap-chart-box input[type=number] { font: inherit; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: inherit; }
#trap-note textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: inherit; }
