/* The stock panel (static/stockpanel.js), plus the logos and sector dots the screener and the portfolio share
   (static/grades.js). biz.css tokens; square corners; the masthead's black band. No letter grades (Nov 26). */

/* ---------- shared: logos, sector dots ---------- */
.lg { position: relative; display: inline-block; flex: 0 0 auto; vertical-align: middle; overflow: hidden; background: #fff; box-shadow: inset 0 0 0 1px var(--rail); }
.lg img { position: absolute; inset: 0; width: 100%; height: 100%; padding: 3px; box-sizing: border-box; object-fit: contain; background: #fff; }
.lg.lg-dark, .lg.lg-dark img { background: #1F1F1F; }
.lg-tile { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font: 800 10px/1 var(--sans); letter-spacing: .02em; }
.sec-dot { display: inline-block; width: 8px; height: 8px; margin: 0 5px 1px 0; vertical-align: middle; }

/* ---------- the drawer: most of the screen on desktop, all of it on tablets and phones ---------- */
.sp-root[hidden] { display: none; }
.sp-dim { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .45); }
.sp { position: fixed; z-index: 61; top: 0; right: 0; bottom: 0; width: max(78vw, min(1080px, 100vw)); max-width: 100vw; overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper); color: var(--ink); outline: none; box-shadow: -2px 0 0 var(--ink); animation: sp-in .18s ease-out; }
@keyframes sp-in { from { transform: translateX(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sp { animation: none; } }
html.sp-lock, html.sp-lock body { overflow: hidden; }
.sp-in { padding: 0 0 56px; }
.sp-band { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 14px; height: 52px; padding: 0 28px; background: #000; color: #fff; }
.sp-brand img { display: block; height: 18px; width: auto; }
.sp-kind { font: 600 14px/1 var(--sans); color: #A8A8A8; border-left: 1px solid #3A3A3A; padding-left: 14px; }
.sp-x { appearance: none; margin-left: auto; border: 1px solid #fff; background: #000; color: #fff; width: 38px; height: 38px; font-size: 24px; line-height: 1; cursor: pointer; }
.sp-x:hover { background: #fff; color: #000; }
.sp-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 22px; align-items: center; padding: 24px 28px 20px; border-bottom: 2px solid var(--ink);
  background: linear-gradient(90deg, color-mix(in srgb, var(--sec) 10%, #fff), #fff 60%); }
.sp-logo { display: block; width: 64px; height: 64px; }
.sp-tk { margin: 0; font-size: 14px; color: var(--quiet); }
.sp-tk b { color: var(--ink); font-weight: 800; margin-right: 8px; }
.sp-head h2 { margin: 2px 0 6px; font: 800 clamp(28px, 3.2vw, 44px)/1.02 var(--sans); letter-spacing: -.035em; }
.sp-px { margin: 0; font-size: 15px; font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.sp-px b { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.sp-px small { font-size: 13px; color: var(--quiet); }
.sp-chg { display: inline-block; padding: 3px 8px; font-weight: 800; font-size: 15px; background: var(--wash); }
.sp-chg.up { background: var(--up-bg); color: var(--up); } .sp-chg.down { background: var(--down-bg); color: var(--down); }
.sp-acts { display: flex; flex-wrap: wrap; gap: 8px; align-self: start; }
.sp-acts .btn { padding: 10px 16px; font-size: 15px; }
.sp-acts .btn.alt { padding: 9px 14px; }
.sp-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(320px, 1fr); gap: 0 40px; padding: 0 28px; }
.sp-sec { margin: 26px 0 0; }
.sp-sec h3 { margin: 0 0 10px; padding-top: 10px; border-top: 4px solid var(--ink); font: 800 21px/1.15 var(--sans); letter-spacing: -.015em; }
.sp-sec .note { font-size: 13px; margin: 0 0 10px; color: var(--quiet); }
.sp dt { font-size: 12px; color: var(--quiet); }
.sp dd { margin: 2px 0 0; font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.sp-chart { margin: 0; min-height: 380px; }
.sp-rets { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--rail); }
.sp-rets > div { padding: 10px 8px; border-right: 1px solid var(--rail); text-align: center; }
.sp-rets > div:last-child { border-right: 0; }
.sp-rets > div.up { background: #F1F8F3; } .sp-rets > div.down { background: #FCF1F2; }
.sp-facts, .sp-pos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; margin: 0; }
.sp-facts > div, .sp-pos > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--rail); min-width: 0; }
.sp-facts dd, .sp-pos dd { margin: 0; text-align: right; }
.sp-facts dt, .sp-pos dt { font-size: 13px; }
.sp-posc { background: var(--wash); margin-left: -14px; margin-right: -14px; padding: 0 14px 14px; }
.sp-poschart { margin-top: 12px; }
.sp-poschart svg { display: block; overflow: visible; }
.sp-poschart text { font: 11px var(--sans); fill: var(--quiet); }
.sp-poschart .gr { stroke: var(--rail); }
.sp-poschart .px { fill: none; stroke: var(--ink); stroke-width: 2; }
.sp-poschart .cost { stroke: var(--ink); stroke-dasharray: 5 4; }
.sp-poschart .costt, .sp-poschart .buyt { fill: var(--ink); font-weight: 700; }
.sp-poschart .sh-up { fill: #CDEBD5; } .sp-poschart .sh-dn { fill: #F6CCD2; }
.sp-poschart .buy { fill: var(--ink); }
/* Financials: the company page's charts (boxed, latest value big, house colour, newest bar highlighted) */
.sp-finbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 14px; margin: 0 0 12px; }
.sp-fins { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.sp-fc { margin: 0; border: 1px solid var(--ink); padding: 12px 14px 8px; background: var(--paper); min-width: 0; }
.sp-fc figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 10px; margin-bottom: 6px; }
.sp-fc .fc-t { font-size: 14px; font-weight: 700; }
.sp-fc .fc-now { font-size: 12px; color: var(--quiet); }
.sp-fc .fc-now b { font-size: 19px; color: var(--ink); font-weight: 800; letter-spacing: -.02em; margin-right: 2px; }
.sp-fc .fc-trend { margin-left: 8px; font-weight: 700; }
.sp-fc .fc-trend.up { color: var(--up); } .sp-fc .fc-trend.down { color: var(--down); }
.sp-fc svg { display: block; width: 100%; height: auto; overflow: visible; }
.sp-fc path.pos { fill: #1D3557; } .sp-fc path.last { fill: var(--hl); stroke: var(--ink); stroke-width: 1.2; } .sp-fc path.neg { fill: var(--down); }
.sp-fc .col:hover path.pos { fill: #4A90C2; }
.sp-fc .base { stroke: var(--ink); stroke-width: 1; }
.sp-fc text.yr { font: 10px var(--sans); fill: var(--quiet); }
/* ---------- Nov 24: the parts that load after the first paint (trading, about, coming up, dividends, valuation,
   peers, analysts, insiders, Congress, funds, filings, news). Each says where it comes from in .sp-src. ---------- */
.sp-src { margin: 10px 0 0; font-size: 12px; line-height: 1.45; color: var(--quiet); }
.sp-src a, .sp-sec .note a, .sp-desc a { color: var(--cite); }
.sp-sec[hidden] { display: none; }
.sp-sec .sm { display: block; font-size: 12px; font-weight: 400; color: var(--quiet); }
.sp-kv { margin: 0; }
.sp-kv > div { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--rail); min-width: 0; }
.sp-kv dt { font-size: 13px; flex: 0 0 auto; }
.sp-kv dd { margin: 0; text-align: right; font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
.sp-kv dd .sm { display: inline; margin-left: 4px; }
.sp-kv dd a { color: var(--ink); }
.sp-desc { margin: 0 0 10px; font-size: 15px; line-height: 1.5; }
.sp-lead { margin: 0 0 8px; font-size: 15px; }
.sp-sub { margin: 14px 0 4px; font-size: 13px; font-weight: 700; }
/* 52-week range and volume */
.sp-range { margin: 4px 0 12px; }
.sp-rbar { position: relative; height: 10px; background: linear-gradient(90deg, #F6CCD2, var(--rail) 50%, #CDEBD5); }
.sp-rbar i { position: absolute; top: -5px; width: 4px; height: 20px; margin-left: -2px; background: var(--ink); }
.sp-rlab { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 12px; color: var(--quiet); font-variant-numeric: tabular-nums; }
.sp-rlab b { color: var(--ink); font-size: 14px; }
.sp-rlab .r { text-align: right; } .sp-rlab .c { text-align: center; }
.sp-vol { display: grid; gap: 6px; margin: 12px 0 0; font-size: 13px; }
.sp-vbar { position: relative; display: block; height: 8px; background: var(--rail); }
.sp-vbar i { position: absolute; left: 0; top: 0; bottom: 0; background: #1D3557; }
.sp-vbar b { position: absolute; top: -4px; width: 2px; height: 16px; background: var(--ink); }
/* Tables inside the panel */
.sp-tw { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sp-tbl { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.sp-tbl caption { text-align: left; font-size: 12px; color: var(--quiet); padding: 0 0 4px; }
.sp-tbl th, .sp-tbl td { text-align: left; padding: 7px 8px 7px 0; border-bottom: 1px solid var(--rail); vertical-align: top; }
.sp-tbl thead th { font-size: 12px; font-weight: 600; color: var(--quiet); border-bottom: 2px solid var(--ink); white-space: nowrap; }
.sp-tbl tbody th { font-weight: 700; }
.sp-tbl tbody th a { color: var(--ink); }
.sp-tbl .n { text-align: right; padding-right: 0; padding-left: 8px; white-space: nowrap; }
.sp-tbl .d { white-space: nowrap; color: var(--quiet); }
.sp-tbl td.up { color: var(--up); font-weight: 700; } .sp-tbl td.down { color: var(--down); font-weight: 700; }
.sp-tbl td .sm { display: block; }
/* Valuation against the sector: the sector's 10th-90th percentile band, its median and the stock */
.sp-valt td.c2 { vertical-align: middle; }
.sp-valt td.c2:last-child { width: 30%; padding-left: 14px; }
.sp-valt td.x { color: var(--quiet); }
.sp-strip { position: relative; display: block; height: 14px; }
.sp-strip .band { position: absolute; top: 4px; height: 6px; background: var(--faint); }
.sp-strip .med { position: absolute; top: 0; width: 2px; height: 14px; margin-left: -1px; background: var(--quiet); }
.sp-strip b { position: absolute; top: 2px; width: 10px; height: 10px; margin-left: -5px; background: #1D3557; border: 1px solid var(--paper); box-shadow: 0 0 0 1px #1D3557; }
.sp-valt tbody tr[title] th { text-decoration: underline dotted var(--faint); text-underline-offset: 4px; cursor: help; }
/* Peers */
.sp-peers tbody th { min-width: 150px; }
.sp-peers tbody th .lg { float: left; margin: 1px 8px 0 0; }
.sp-peers tbody th .sm { max-width: 24ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-peers tr[data-peer] { cursor: pointer; }
.sp-peers tr[data-peer]:hover > *, .sp-peers tr[data-peer]:focus-visible > * { background: var(--wash); }
.sp-peers tr.me > * { background: #FFF8CC; }
.sp-peers thead th:last-child { padding-left: 12px; }
/* Analysts: buy / hold / sell and the price-target range */
.sp-stack { display: flex; height: 12px; background: var(--rail); }
.sp-stack i { display: block; height: 100%; }
.sp-stack .b, .sp-stackl .b::before { background: #0B6B2E; } .sp-stack .h, .sp-stackl .h::before { background: #B8B8B2; } .sp-stack .s, .sp-stackl .s::before { background: var(--down); }
.sp-stackl { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 12px; font-size: 13px; }
.sp-stackl span::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 5px; }
.sp-tgt { position: relative; height: 16px; margin: 6px 0 0; background: linear-gradient(var(--rail), var(--rail)) no-repeat 0 7px / 100% 2px; }
.sp-tgt .band { position: absolute; top: 4px; height: 8px; background: #A8C4DE; }
.sp-tgt .mean { position: absolute; top: 0; width: 2px; height: 16px; margin-left: -1px; background: #1D3557; }
.sp-tgt b { position: absolute; top: 2px; width: 12px; height: 12px; margin-left: -6px; background: var(--hl); border: 1.5px solid var(--ink); }
/* Coming up, filings, news, big holders */
.sp-ev, .sp-fil, .sp-news, .sp-hold { list-style: none; margin: 0; padding: 0; }
.sp-ev li { display: grid; grid-template-columns: minmax(0, 9.5em) minmax(0, 1fr); gap: 2px 12px; padding: 8px 0; border-bottom: 1px solid var(--rail); font-size: 14px; }
.sp-ev li .sm { grid-column: 2; }
.sp-fil li { display: grid; grid-template-columns: 7.5em 4.2em minmax(0, 1fr); gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--rail); font-size: 14px; }
.sp-fil .d { color: var(--quiet); font-size: 13px; font-variant-numeric: tabular-nums; }
.sp-fil .f { font-weight: 800; font-size: 12px; align-self: center; }
.sp-fil a, .sp-news a, .sp-hold a { color: var(--ink); }
.sp-news li { padding: 9px 0; border-bottom: 1px solid var(--rail); font-size: 15px; font-weight: 700; line-height: 1.3; }
.sp-hold li { padding: 7px 0; border-bottom: 1px solid var(--rail); font-size: 14px; font-weight: 700; }
/* Dividends: the yearly chart beside the latest payments */
.sp-divs { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; margin-top: 12px; align-items: start; }
.sp-divs > :only-child { grid-column: 1 / -1; }
.sp-divs:empty { display: none; }
.sp-foot { margin: 34px 28px 0; padding-top: 14px; border-top: 4px solid var(--ink); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.sp-foot .note { margin: 0; font-size: 13px; color: var(--quiet); }
@media (max-width: 1100px) {
  .sp { width: 100vw; box-shadow: none; }
  .sp-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .sp-band { padding: 0 16px; }
  .sp-head { grid-template-columns: auto minmax(0, 1fr); padding: 18px 16px; }
  .sp-acts { grid-column: 1 / -1; }
  .sp-logo { width: 48px; height: 48px; }
  .sp-grid { padding: 0 16px; }
  .sp-rets { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sp-rets > div:nth-child(4) { border-right: 0; }
  .sp-fins { grid-template-columns: minmax(0, 1fr); }
  .sp-posc { margin-left: -16px; margin-right: -16px; padding: 0 16px 14px; }
  .sp-foot { margin: 30px 16px 0; }
  .sp-divs { grid-template-columns: minmax(0, 1fr); }
  .sp-valt td.c2, .sp-valt th.c2, .sp-peers .c2, .sp-hist .c2 { display: none; }
  .sp-ev li { grid-template-columns: minmax(0, 1fr); }
  .sp-ev li .sm { grid-column: auto; }
  .sp-fil li { grid-template-columns: 6.8em minmax(0, 1fr); }
  .sp-fil .f { display: none; }
}

/* Nov 26: against the sector (grouped), history */
.sp-valt tr.sp-grp th { padding: 14px 0 5px; font-size: 12px; font-weight: 800; color: var(--ink); border-bottom: 1px solid var(--ink); }
.sp-valt tbody:first-of-type tr.sp-grp th { padding-top: 6px; }
.sp-valt td.x .sm { display: inline; color: var(--quiet); }
.sp-fc .fc-note { flex-basis: 100%; font-size: 12px; color: var(--quiet); }
.sp-fc .fc-note b { color: var(--ink); font-weight: 800; }
.sp-grow { margin: 0 0 16px; }
.sp-grow td .chg { font-weight: 700; }
.sp-grow td .chg.up { color: var(--up); } .sp-grow td .chg.down { color: var(--down); }
.sp-hfins { margin: 0 0 16px; }
.sp-hist { margin: 0 0 6px; }
.sp-hist tbody th .sm { display: block; font-weight: 400; color: var(--quiet); }
.sp-hist tbody tr:first-child > * { background: var(--hl); }
