/* =========================================================================
   Filing Clarity for Advisors — LIGHT THEME (content area only)
   Design north star: "WSJ mobile app married to the Morning Brief email."
   The TOP NAV (_app_header.html) stays DARK and is intentionally excluded —
   these tokens live on :root but the header ships its own self-contained CSS.
   ========================================================================= */

:root{
  /* content surfaces */
  --bg:#F8F9FA;
  --card:#FFFFFF;
  --panel:#FFFFFF;
  --border:#E5E7EB;
  --divider:#F3F4F6;
  --alt-row:#FAFAFA;
  --row-hover:#F0FDF9;
  /* text */
  --text:#111827;
  --muted:#6B7280;
  --meta:#9CA3AF;
  /* brand + change colors */
  --accent:#00b386;
  --up:#059669;
  --down:#DC2626;
  --flat:#6B7280;
}

/* Content shell -> light. The dark top nav is a sibling include and keeps its
   own colors; we only repaint the app content region. */
body{background:var(--bg);color:var(--text);}
main.wrap,main.main-content{background:var(--bg);color:var(--text);}
a{color:var(--accent);}

/* =========================================================================
   MOBILE HORIZONTAL-OVERFLOW GUARD (T51)
   At a 375px viewport the document rendered ~945px wide (mobile got a
   horizontal scrollbar). Root cause: wide multi-column data tables
   (Institutional Ownership / peer-comparison / SEC filings / command-center
   feed) render at their min-content width — with no fixed layout and no
   bounded scroll wrapper they force their container, and thus the whole
   document, past the viewport. Fix at the root: (1) clamp the page box so no
   child can push the DOCUMENT past 100%, using overflow-x:clip (page-level
   clip only — does NOT create a scroll container, so position:sticky and the
   intentionally-scrollable tab strip keep working); (2) make content tables
   shrink-to-fit and scroll WITHIN their own bounded box instead of expanding
   the page; (3) let long unbroken strings wrap. No content is clipped: wide
   tables become horizontally scrollable inside their card, not off-page. */
/* (1) PAGE-LEVEL CLAMP — the primary guarantee. overflow-x:clip at the page
   root forces documentElement.scrollWidth == viewport width and, unlike
   overflow-x:hidden/auto, does NOT establish a scroll container, so
   position:sticky, tooltips and absolutely-positioned dropdowns that reach
   within the page are unaffected. box-sizing so fixed widths include padding. */
html,body{max-width:100%;overflow-x:clip;}
*{box-sizing:border-box;}
/* (2) Content tables never exceed their container. */
main.main-content table,main.wrap table{max-width:100%;}
/* (3) The specific wide data tables scroll WITHIN their own box so nothing is
   clipped off-page. Scoped to table hosts that contain NO absolutely-positioned
   popovers (setting overflow-x:auto also computes overflow-y to auto, which
   would clip a popover — so #summary/.sum-card-body are deliberately excluded;
   the page-level clip above still protects them). */
main.main-content #filings-body,
main.main-content #ownership,
main.main-content #marketpulse{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;}
/* Long unbroken tokens (URLs, wide labels) in wrapping text blocks break
   rather than forcing width. (Single-line ellipsis rows keep their nowrap.) */
main.main-content .cc-what,main.main-content .ccd-sum{overflow-wrap:anywhere;}

/* ---- generic panels / cards -> clean white, thin dividers, no heavy borders ---- */
.card,.ac-card,.wa-card,.etf-card,.news-bar,.cc,table.cc,.empty,.qv-empty{
  background:var(--card);border-color:var(--border);
  box-shadow:0 1px 2px rgba(16,24,40,.04);
}
.muted,.cc-sub,.qv-sub,.wa-sub{color:var(--muted);}

/* ---- typography hierarchy (AlphaSense-style density) ---- */
.rl-ticker{font-size:15px;font-weight:700;color:var(--accent);letter-spacing:.01em;}
.rl-company{font-size:12px;color:var(--muted);}
.rl-signal{font-size:14px;color:var(--text);}
.rl-meta{font-size:12px;color:var(--meta);}

.chg-pos{color:var(--up)!important;font-variant-numeric:tabular-nums;}
.chg-neg{color:var(--down)!important;font-variant-numeric:tabular-nums;}
.chg-flat{color:var(--flat)!important;font-variant-numeric:tabular-nums;}

/* ---- section headers (uppercase 11px + right-aligned count + view-all link) ---- */
.rl-sechead{display:flex;align-items:baseline;gap:10px;margin:22px 0 8px;}
.rl-sechead .rl-sh-title{font-size:11px;font-weight:800;letter-spacing:.07em;text-transform:uppercase;color:var(--muted);}
.rl-sechead .rl-sh-count{font-size:11px;color:var(--meta);font-weight:600;}
.rl-sechead .rl-sh-link{margin-left:auto;font-size:12px;font-weight:700;color:var(--accent);text-decoration:none;white-space:nowrap;}
.rl-sechead .rl-sh-link:hover{text-decoration:underline;}

/* ---- gain-summary bar (top of Total/Client View) ---- */
.rl-gainbar{display:flex;align-items:center;gap:14px;flex-wrap:wrap;background:var(--card);
  border:1px solid var(--border);border-radius:12px;padding:14px 16px;margin:8px 0 6px;
  box-shadow:0 1px 2px rgba(16,24,40,.04);}
.rl-gain-name{font-size:15px;font-weight:800;color:var(--text);}
.rl-gain-pct{font-size:20px;font-weight:800;font-variant-numeric:tabular-nums;}
.rl-gain-sub{font-size:12px;color:var(--muted);}
.rl-gain-alerts{margin-left:auto;display:inline-flex;align-items:center;gap:7px;font-size:12.5px;font-weight:700;
  color:var(--text);background:var(--divider);border:1px solid var(--border);border-radius:999px;padding:6px 13px;}
.rl-gain-alerts .n{color:var(--down);font-weight:800;}
.rl-gain-alerts.calm .n{color:var(--up);}
.rl-gain-monthlink{width:100%;margin-top:2px;font-size:11.5px;font-weight:600;color:var(--muted);}
.rl-gain-monthlink a{color:var(--muted);text-decoration:none;}
.rl-gain-monthlink a:hover{color:var(--accent);}

/* ---- ONE-LINE WATCHLIST ROWS (~52px) ---- */
.rl-rows{background:var(--card);border:1px solid var(--border);border-radius:12px;overflow:hidden;
  box-shadow:0 1px 2px rgba(16,24,40,.04);}
.rl-row{display:grid;grid-template-columns:minmax(0,1.6fr) 78px minmax(0,2fr) 30px;align-items:center;gap:12px;
  min-height:52px;padding:0 14px;border-bottom:1px solid var(--divider);
  text-decoration:none;color:var(--text);cursor:pointer;}
.rl-row:last-child{border-bottom:none;}
.rl-row:nth-child(even){background:var(--alt-row);}
.rl-row:hover{background:var(--row-hover);}
.rl-row-name{min-width:0;display:flex;flex-direction:column;gap:1px;}
.rl-row-name .top{display:flex;align-items:baseline;gap:8px;min-width:0;}
.rl-row-name .rl-ticker{white-space:nowrap;}
.rl-row-name .rl-company{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.rl-row-chg{text-align:right;font-size:14px;font-weight:700;font-variant-numeric:tabular-nums;}
.rl-row-sig{min-width:0;display:flex;align-items:center;gap:8px;}
.rl-badge{flex:0 0 auto;font-size:10px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;
  border-radius:5px;padding:2px 7px;white-space:nowrap;}
.rl-badge.action{background:rgba(220,38,38,.10);color:#B91C1C;border:1px solid rgba(220,38,38,.28);}
.rl-badge.monitor{background:rgba(217,119,6,.10);color:#B45309;border:1px solid rgba(217,119,6,.28);}
.rl-badge.context{background:rgba(107,114,128,.10);color:#4B5563;border:1px solid rgba(107,114,128,.24);}
.rl-row-hl{font-size:13px;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.rl-row-hl.quiet{color:var(--meta);font-style:italic;}
.rl-row-status{display:flex;align-items:center;justify-content:flex-end;gap:8px;color:var(--meta);}
.rl-dot{width:8px;height:8px;border-radius:50%;flex:0 0 auto;background:var(--flat);}
.rl-dot.new{background:var(--up);}
.rl-dot.ess{background:#D97706;}
.rl-arrow{font-size:13px;color:var(--meta);}
@media(max-width:640px){
  .rl-row{grid-template-columns:minmax(0,1.4fr) 66px minmax(0,1.5fr) 22px;gap:8px;padding:0 12px;}
  .rl-row-hl{display:none;}
}

/* ---- ONE-LINE SIGNAL FEED ROWS (~44px) ---- */
.rl-feed{background:var(--card);border:1px solid var(--border);border-radius:12px;overflow:hidden;
  box-shadow:0 1px 2px rgba(16,24,40,.04);}
.rl-feed-row{display:flex;align-items:center;gap:10px;min-height:44px;padding:0 14px;
  border-bottom:1px solid var(--divider);text-decoration:none;color:var(--text);}
.rl-feed-row:last-child{border-bottom:none;}
.rl-feed-row:hover{background:var(--row-hover);}
.rl-feed-row .rl-dot{flex:0 0 auto;}
.rl-feed-tk{font-size:13px;font-weight:800;color:var(--accent);white-space:nowrap;}
.rl-feed-hl{flex:1 1 auto;min-width:0;font-size:13px;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.rl-feed-date{font-size:12px;color:var(--meta);white-space:nowrap;font-variant-numeric:tabular-nums;}
.rl-feed-arrow{font-size:12px;color:var(--meta);}

/* ---- UPCOMING dated list (~44px) ---- */
.rl-events{background:var(--card);border:1px solid var(--border);border-radius:12px;overflow:hidden;
  box-shadow:0 1px 2px rgba(16,24,40,.04);}
.rl-event-row{display:grid;grid-template-columns:96px 84px 1fr;align-items:center;gap:12px;
  min-height:44px;padding:0 14px;border-bottom:1px solid var(--divider);
  text-decoration:none;color:var(--text);}
.rl-event-row:last-child{border-bottom:none;}
.rl-event-row:hover{background:var(--row-hover);}
.rl-event-date{font-size:12.5px;font-weight:800;color:var(--accent);font-variant-numeric:tabular-nums;}
.rl-event-date small{display:block;font-size:10.5px;color:var(--meta);font-weight:600;}
.rl-event-tk{font-size:13px;font-weight:800;color:var(--text);}
.rl-event-type{font-size:12.5px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.rl-event-type small{color:var(--meta);}

/* ---- subtle "not advice" line ---- */
.rl-notadvice{font-size:11px;color:var(--meta);margin-top:12px;line-height:1.5;}

/* =========================================================================
   RIA DARK-THEME OVERRIDES — repaint the per-view <style> hardcoded darks so
   legacy blocks inherit the light palette. Scoped to content classes only.
   ========================================================================= */
main.wrap table.cc th{background:var(--divider)!important;color:var(--muted)!important;border-color:var(--border)!important;}
main.wrap table.cc td{border-color:var(--divider)!important;color:var(--text)!important;}
main.wrap table.cc{border-color:var(--border)!important;}
main.wrap tr.cc-main:hover{background:var(--row-hover)!important;}
main.wrap tr.cc-detail>td{background:var(--alt-row)!important;}
main.wrap .cc-sect{background:var(--card)!important;border-color:var(--border)!important;color:var(--muted)!important;}
main.wrap .cc-tkr a{color:var(--text)!important;}
main.wrap .cc-co,main.wrap .cc-heldby-lbl,main.wrap .price-stamp{color:var(--muted)!important;}
main.wrap .cc-note{background:rgba(0,179,134,.05)!important;border-color:rgba(0,179,134,.2)!important;color:var(--muted)!important;}

main.wrap .card{background:var(--card)!important;border-color:var(--border)!important;}
main.wrap .card-why,main.wrap .card-head{color:var(--text)!important;}
main.wrap .card-co,main.wrap .card-quiet{color:var(--muted)!important;}
main.wrap .card.up{border-left-color:var(--up)!important;}
main.wrap .card.down{border-left-color:var(--down)!important;}
main.wrap .card.flat{border-left-color:var(--flat)!important;}
main.wrap .card-earn{background:var(--divider)!important;border-color:var(--border)!important;}
main.wrap .card-earn-h{color:var(--text)!important;}
main.wrap .card-earn-q{color:var(--muted)!important;background:rgba(100,116,139,.12)!important;}

main.wrap .hl-row,main.wrap .hd-row{color:var(--text)!important;border-color:var(--divider)!important;}
main.wrap .hl-row:hover,main.wrap .hd-row:hover{background:var(--row-hover)!important;}
main.wrap .hl-co,main.wrap .hd-co,main.wrap .hl-head{color:var(--muted)!important;}
main.wrap .hl-move.up{color:var(--up)!important;}
main.wrap .hl-move.down{color:var(--down)!important;}
main.wrap .hl-chip{background:var(--divider)!important;color:var(--muted)!important;border:1px solid var(--border);}
main.wrap .hl-etf{background:var(--divider)!important;color:var(--muted)!important;border-color:var(--border)!important;}

main.wrap .news-bar{background:var(--card)!important;border-color:var(--border)!important;}
main.wrap .news-bar-title,main.wrap .news-headline{color:var(--text)!important;}
main.wrap .news-item{border-color:var(--divider)!important;}
main.wrap .news-ago{color:var(--meta)!important;}

main.wrap .wa-card{background:var(--card)!important;border-color:var(--border)!important;border-left-color:var(--accent)!important;}
main.wrap .wa-tk{color:var(--text)!important;}
main.wrap .wa-co,main.wrap .wa-expo,main.wrap .wa-note,main.wrap .wa-sub{color:var(--muted)!important;}
main.wrap .wa-chip{background:var(--divider)!important;border-color:var(--border)!important;color:var(--text)!important;}
main.wrap .ac-card{background:var(--card)!important;border-color:var(--border)!important;}
main.wrap .ac-name{color:var(--text)!important;}
main.wrap .ac-mover{color:var(--text)!important;}

main.wrap .btn{background:var(--card)!important;border-color:var(--border)!important;color:var(--text)!important;}
main.wrap .btn:hover{border-color:var(--accent)!important;}
main.wrap .btn-accent{background:var(--accent)!important;border-color:var(--accent)!important;color:#fff!important;}
main.wrap .demo-tag{background:#FEF3C7!important;color:#92400E!important;border-color:#FDE68A!important;}
main.wrap .empty{background:var(--card)!important;border-color:var(--border)!important;color:var(--muted)!important;}

main.wrap h1,main.wrap .cc-head h1,main.wrap .wa-title{color:var(--text)!important;}

/* =========================================================================
   MOBILE — bottom nav + responsive company header + touch targets.
   Bottom nav is hidden on desktop, shown <=768px.
   ========================================================================= */
.rl-bottomnav{display:none;}
@media(max-width:768px){
  .rl-bottomnav{
    display:flex;position:fixed;left:0;right:0;bottom:0;z-index:9000;
    background:#0b1220;border-top:1px solid #1e293b;
    padding:4px 2px calc(4px + env(safe-area-inset-bottom,0px));
    box-shadow:0 -2px 12px rgba(0,0,0,.28);
  }
  .rl-bn-item{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;
    gap:2px;min-height:52px;text-decoration:none;color:#94a3b8;font-size:10px;font-weight:700;position:relative;}
  .rl-bn-item.active{color:#00c9a7;}
  .rl-bn-ic{font-size:18px;line-height:1;}
  .rl-bn-badge{position:absolute;top:4px;left:calc(50% + 6px);min-width:16px;height:16px;
    background:#DC2626;color:#fff;border-radius:8px;font-size:9px;font-weight:800;
    display:flex;align-items:center;justify-content:center;padding:0 4px;}
  body{padding-bottom:72px;}
  /* T32: FAB bottom offset is set in the T25d/T32 block below (bottom:132px) so
     it clears BOTH the bottom nav and the Help bubble; do not re-pin it here. */
  /* hide the secondary top bar (portfolio scope strip) on mobile to reduce chrome */
  .pf-toggle-wrap{display:none!important;}
  /* larger mobile price header */
  .company-header .company-title h1{font-size:34px;}
  /* touch targets */
  .rl-row{min-height:56px;}
  .rl-feed-row,.rl-event-row{min-height:48px;}
  .btn,.rl-sh-link{min-height:44px;display:inline-flex;align-items:center;}
  /* T61: keep the compact inline Draft a real tap target */
  .card-draft{min-height:34px;}
}

/* T61: client signal card is now a link (card-as-Details). Light-theme affordance. */
main.wrap .card[role="link"]{cursor:pointer;}
main.wrap .card[role="link"]:hover{border-color:var(--accent)!important;box-shadow:0 2px 12px rgba(15,23,42,.10);}
main.wrap .card[role="link"]:active{background:var(--panel,#f3f6fb)!important;}
main.wrap .card-draft{border-color:var(--border)!important;color:var(--accent)!important;background:transparent!important;}
main.wrap .card-draft:hover{border-color:var(--accent)!important;background:rgba(37,99,235,.08)!important;}

/* Desktop safety: never let the bottom nav show */
@media(min-width:769px){ .rl-bottomnav{display:none!important;} }

/* =========================================================================
   COMPANY PAGE (dark base.html) — this page keeps the dark app chrome, but
   we add the light-theme structural pieces used by the redesign below.
   ========================================================================= */
/* horizontal-scroll tab bar */
.cd-tabscroll{display:flex;gap:4px;overflow-x:auto;-webkit-overflow-scrolling:touch;
  scrollbar-width:none;-ms-overflow-style:none;flex-wrap:nowrap;padding:2px 20px;border-bottom:1px solid #1e2a3a;}
.cd-tabscroll::-webkit-scrollbar{display:none;height:0;}
/* teal-tinted "Your Notes first" panel */
.cd-notes-first{margin:14px 20px 4px;padding:14px 16px;background:rgba(0,179,134,.06);
  border:1px solid rgba(0,179,134,.28);border-radius:12px;}
.cd-notes-first .lbl{font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.06em;color:#00b386;}
.cd-notes-first .txt{font-size:14px;color:#e2e8f0;line-height:1.6;margin:6px 0 4px;}
.cd-notes-first .empty{font-size:13px;color:#94a3b8;line-height:1.5;margin:6px 0 4px;}
.cd-notes-first a{color:#00c9a7;font-size:12.5px;font-weight:700;text-decoration:none;}
.cd-notes-first a:hover{text-decoration:underline;}
/* sticky draft button */
.cd-sticky-draft{position:fixed;left:50%;transform:translateX(-50%);bottom:16px;z-index:8500;
  display:inline-flex;align-items:center;gap:8px;background:#00b386;color:#fff;font-size:14px;font-weight:800;
  padding:13px 22px;border-radius:999px;text-decoration:none;box-shadow:0 8px 24px rgba(0,179,134,.4);white-space:nowrap;}
.cd-sticky-draft:hover{background:#00a078;color:#fff;}
/* big price header additions */
.cd-backlink{display:inline-block;margin:14px 20px 0;font-size:12.5px;color:#94a3b8;text-decoration:none;}
.cd-backlink:hover{color:#00c9a7;}
.cd-priceblock{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;margin-top:8px;}
.cd-price{font-size:24px;font-weight:800;color:#e2e8f0;font-variant-numeric:tabular-nums;}
.cd-price-chg{font-size:15px;font-weight:800;font-variant-numeric:tabular-nums;}
.cd-price-chg.up{color:#3fb950;}.cd-price-chg.down{color:#f85149;}
.cd-52w{font-size:12px;font-weight:700;color:#f5b23c;background:rgba(245,158,11,.12);
  border:1px solid rgba(245,158,11,.3);border-radius:6px;padding:2px 9px;}

/* =========================================================================
   COMPANY PAGE — LIGHT-THEME REPAINT (T21) + header/tab/FAB/density (T25)
   ROOT CAUSE: company_dashboard.html renders inside <main class="main-content">
   (NOT main.wrap), so the "RIA DARK-THEME OVERRIDES" above (scoped to main.wrap)
   never reach it. The page's own inline <style> blocks hardcode dark cards
   (#0f1729 / #0b1220) which then float on the light #F8F9FA body.
   FIX (no !important pile-on): descendant selectors under .cd-wrap raise
   specificity to (0,2,0), beating the template's single-class inline rules
   (0,1,0) regardless of load order. Top nav is a sibling include -> stays dark.
   ========================================================================= */
.cd-wrap{color:var(--text);}

/* --- generic dark cards -> white --- */
.cd-wrap .sum-card,
.cd-wrap .thesis-section,
.cd-wrap .mn-card,
.cd-wrap .ecycle-q,
.cd-wrap .mp-brief,
.cd-wrap .em-quarter,
.cd-wrap .inline-eco{
  background:var(--card);border-color:var(--border);
  box-shadow:0 1px 2px rgba(16,24,40,.04);
}
.cd-wrap .sum-card-head{background:var(--divider);border-bottom-color:var(--border);}
.cd-wrap .sum-card-title{color:var(--accent);}
.cd-wrap .sum-grip,.cd-wrap .sum-x{color:var(--meta);}

/* --- body / muted text inside cards -> dark on white --- */
.cd-wrap .sum-notes,.cd-wrap .thesis-text{color:var(--text);}
.cd-wrap .sum-muted,.cd-wrap .sum-sig-when,.cd-wrap .fin-trend,
.cd-wrap .fin-mini,.cd-wrap .em-kpi-n,.cd-wrap .mn-context,
.cd-wrap .section-note,.cd-wrap .em-empty-note{color:var(--muted);}
.cd-wrap .sum-sig-hl,.cd-wrap .mn-detail,.cd-wrap .em-headline{color:var(--text);}
.cd-wrap .sum-sig,.cd-wrap .em-kpi{border-bottom-color:var(--divider);}
.cd-wrap .fin-src,.cd-wrap .thesis-updated,.cd-wrap .thesis-empty,
.cd-wrap .thesis-hint,.cd-wrap .sum-hint{color:var(--meta);}
.cd-wrap .sum-link,.cd-wrap .mn-src{color:var(--accent);}
.cd-wrap .sum-topic,.cd-wrap .em-topic{background:var(--divider);color:var(--text);}
.cd-wrap .thesis-label{color:var(--muted);}
.cd-wrap .thesis-edit-btn,.cd-wrap .sum-add-btn{background:var(--card);border-color:var(--border);color:var(--muted);}
.cd-wrap .thesis-edit-btn:hover,.cd-wrap .sum-add-btn:hover{border-color:var(--accent);color:var(--text);}
.cd-wrap .thesis-textarea{background:#fff;border-color:var(--border);color:var(--text);}
.cd-wrap .em-q{color:var(--text);}

/* --- KEY FINANCIALS table: light + tabular numerals + tighter (T25g) --- */
.cd-wrap .fin-table{font-size:12px;}
.cd-wrap .fin-table td{color:var(--text);padding:2.5px 0;font-variant-numeric:tabular-nums;}
.cd-wrap .fin-table td:first-child{color:var(--muted);}
.cd-wrap .fin-table td:last-child{color:var(--text);font-variant-numeric:tabular-nums;}
.cd-wrap .fin-table tr.fin-sep td{border-top-color:var(--border);padding-top:5px;}
.cd-wrap .peer-table td{color:var(--text);border-bottom-color:var(--divider);}
.cd-wrap .peer-table td:first-child{color:var(--muted);}
.cd-wrap .peer-table th{color:var(--muted);border-bottom-color:var(--border);}
.cd-wrap .peer-table tr.peer-self td{color:var(--accent);}
.cd-wrap .sum-card-body{padding:10px 12px;}

/* --- section headings + dividers on the light page --- */
.cd-wrap .company-section{border-bottom-color:var(--border);}
.cd-wrap .company-section h3{color:var(--accent);}
.cd-wrap .company-name{color:var(--muted);}
.cd-wrap .company-sic{color:var(--meta);}
.cd-wrap .no-signals-note{color:var(--muted);}
.cd-wrap .signal-row{border-bottom-color:var(--divider);}
.cd-wrap .signal-headline,.cd-wrap .eco-sig-desc,.cd-wrap .eco-sig-head{color:var(--text);}
.cd-wrap .signal-time,.cd-wrap .eco-sig-when{color:var(--meta);}
.cd-wrap .company-header{border-bottom-color:var(--border);}

/* --- ecosystem list rows on light --- */
.cd-wrap .ecosystem-company-link{color:var(--text);border-bottom-color:var(--divider);}
.cd-wrap .eco-sig-card{border-bottom-color:var(--divider);}
.cd-wrap .eco-sig-co{color:var(--text);}

/* =========================================================================
   T25a — PRICE-LED HEADER (Seeking Alpha style): price is the largest, darkest
   element; % change colored beside it; as-of timestamp beneath; ticker a
   normal-weight label near the company name.
   ========================================================================= */
.cd-wrap .company-title-row h1{font-size:20px;font-weight:600;color:var(--muted);letter-spacing:.02em;}
.cd-wrap .cd-priceblock{align-items:baseline;gap:10px;margin-top:6px;}
.cd-wrap .cd-price{font-size:34px;font-weight:800;color:var(--text);line-height:1.05;}
.cd-wrap .cd-price-chg{font-size:16px;}
.cd-wrap .cd-price-chg.up{color:var(--up);}
.cd-wrap .cd-price-chg.down{color:var(--down);}
.cd-asof{display:block;font-size:11px;color:var(--meta);margin-top:3px;font-variant-numeric:tabular-nums;}
/* T25b — company name on one line, ellipsis past a sensible width */
.cd-wrap .company-name{display:block;max-width:min(480px,86vw);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:15px;}
@media(max-width:640px){
  .cd-wrap .company-title-row h1{font-size:18px;}
  .cd-wrap .cd-price{font-size:30px;}
  .cd-wrap .company-name{max-width:78vw;}
}

/* T25c — tab strip: force ONE horizontally-scrolling row (override the base
   .hub-quick-nav flex-wrap:wrap defined in the template's inline <style>). */
.cd-wrap .hub-quick-nav.cd-tabscroll{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;
  scrollbar-width:none;-ms-overflow-style:none;}
.cd-wrap .hub-quick-nav.cd-tabscroll::-webkit-scrollbar{display:none;height:0;}
.cd-wrap .hub-quick-nav .hub-nav-link{flex:0 0 auto;white-space:nowrap;}
.cd-wrap .hub-nav-label{color:var(--muted);}
.cd-wrap .hub-nav-link{background:var(--card);border-color:var(--border);}
.cd-wrap .hub-nav-link:hover{border-color:var(--accent);background:var(--row-hover);}
.cd-wrap .hub-tab-active{background:var(--accent);border-color:var(--accent);}
.cd-wrap .hub-tab-active .hub-nav-label,.cd-wrap .hub-tab-active .hub-nav-count{color:#fff;}
.cd-wrap .hub-nav-count{color:var(--accent);}

/* T25d — FAB: nudge left so it never sits under the Help bubble (bottom-right)
   or over content; on desktop pin bottom-left of the content column. The draft
   button wins any collision with Help. */
/* T32 — the Help bubble (.chat-widget in base.html) is fixed at bottom:64px /
   right:24px and is ~44px tall (top edge ~108px). Pin the Draft FAB ABOVE it in
   the same right column so the two never overlap and the FAB never sits over the
   Help affordance. The FAB wins the corner; Help stays reachable just beneath. */
.cd-sticky-draft{left:auto;right:20px;transform:none;bottom:120px;z-index:8500;}
/* And reserve bottom space so the fixed FAB never occludes the last content
   block (YOUR NOTES / thesis) on a populated page. 120px(bottom)+~48px(FAB) */
.cd-wrap{padding-bottom:180px;}
@media(max-width:768px){
  /* mobile has a 72px bottom nav + the Help bubble; stack the FAB above both */
  .cd-sticky-draft{right:14px;bottom:132px!important;left:auto;transform:none;font-size:13px;padding:11px 16px;}
  .cd-wrap{padding-bottom:200px;}
}

/* T25e/25f handled in the template (duplicate back-link + widget-instruction copy removed). */

/* T21 polish — content chips/menus inside now-white cards (earnings cycle,
   add-widget dropdown) that were still dark. Nav/help/feedback chrome stays dark. */
.cd-wrap .ecycle-item{background:var(--divider);border-color:var(--border);color:var(--text);}
.cd-wrap a.ecycle-item:hover{border-color:var(--accent);color:var(--accent);}
.cd-wrap .ecycle-item.ecycle-missing{color:var(--meta);}
.cd-wrap .ecycle-date{color:var(--meta);}
.cd-wrap .ecycle-period{color:var(--text);}
.cd-wrap .sum-add-menu{background:var(--card);border-color:var(--border);box-shadow:0 8px 24px rgba(16,24,40,.12);}
.cd-wrap .sum-add-item{color:var(--text);}
.cd-wrap .sum-add-item:hover{background:var(--row-hover);}
.cd-wrap .sum-add-empty{color:var(--meta);}
.cd-wrap .em-kpi-v{color:var(--text);}
.cd-wrap .em-tone{color:var(--up);background:rgba(5,150,105,.10);}
.cd-wrap .mn-filer,.cd-wrap .mn-headline{color:var(--text);}

/* =========================================================================
   T31 — LIGHT-THEME CONTRAST REGRESSION CLEANUP (systematic token pass).
   MAIN-1's conversion repainted card BACKGROUNDS white but left a whole class
   of dark-tuned TEXT/BADGE colors (#cbd5e1 / #94a3b8 / #64748b / #cfd… etc)
   hardcoded in the template's inline <style> blocks, which then float near-
   invisible on the white .cd-wrap cards. Rather than N one-off template edits
   we redefine those content-text/badge colors ONCE under .cd-wrap. Dark chrome
   (top nav, Help bubble, the display:none .alerts-menu popover) is intentionally
   excluded — it keeps its own dark background so its light text stays correct.
   All fg/bg pairs below verified >= WCAG AA 4.5:1 on the white (#FFFFFF) card.
   ========================================================================= */

/* --- SIGNAL-TYPE BADGES: legible + semantic (beat=green / miss=red /
   comment-letter=blue / neutral=slate / peer=violet). The base pill was
   #cbd5e1 on rgba(148,163,184,.14) ~= invisible on white. --- */
.cd-wrap .signal-type-pill{background:rgba(51,65,85,.10);color:#334155;border:1px solid rgba(51,65,85,.20);}      /* 8.8:1 */
.cd-wrap .signal-type-pill.pill-pos{background:rgba(5,150,105,.12);color:#047857;border-color:rgba(5,150,105,.30);}   /* 4.7:1 green */
.cd-wrap .signal-type-pill.pill-neg{background:rgba(220,38,38,.10);color:#B91C1C;border-color:rgba(220,38,38,.28);}   /* 5.5:1 red */
.cd-wrap .signal-type-pill.pill-info{background:rgba(37,99,235,.10);color:#1D4ED8;border-color:rgba(37,99,235,.28);}  /* 5.8:1 blue */
.cd-wrap .signal-type-pill.pill-neutral{background:rgba(51,65,85,.10);color:#334155;border-color:rgba(51,65,85,.20);}/* 8.8:1 slate */
.cd-wrap .signal-type-pill.pill-peer{background:rgba(124,58,237,.10);color:#6D28D9;border-color:rgba(124,58,237,.30);}/* 6.1:1 violet */

/* --- earnings-quarter body text/chips that were dark-tuned --- */
.cd-wrap .em-topic{background:var(--divider);color:var(--text);}
.cd-wrap .em-kpi-t{color:var(--meta);}
.cd-wrap .em-sent{color:var(--muted);border-left-color:var(--border);}
.cd-wrap .em-sent-bullish{border-left-color:var(--up);}
.cd-wrap .em-sent-bearish{border-left-color:var(--down);}

/* --- Key Financials trailing-trend mini strip --- */
.cd-wrap .fin-mini{color:var(--muted);}
.cd-wrap .fin-mini-q{color:var(--text);}

/* --- ecosystem list rows: tickers/strength chips/evidence/source on white --- */
.cd-wrap .eco-sig-tk,.cd-wrap .eco-ticker,.cd-wrap .eco-sig-tk-sm{color:var(--accent);background:rgba(0,179,134,.10);}
.cd-wrap .eco-name{color:var(--text);}
.cd-wrap .ecosystem-group-label{color:var(--muted);}
.cd-wrap .eco-evidence{color:var(--muted);}
.cd-wrap .eco-src-tag{color:var(--muted);border-color:var(--border);}
.cd-wrap .ecosystem-source{color:var(--meta);}
.cd-wrap .eco-high{background:rgba(5,150,105,.14);color:#047857;}     /* 4.8:1 */
.cd-wrap .eco-medium{background:rgba(245,158,11,.16);color:#92400E;}  /* 6.3:1 */
.cd-wrap .eco-low{background:rgba(107,114,128,.14);color:#4B5563;}    /* 6.3:1 */
.cd-wrap .eco-sig-kind.signal{background:rgba(0,179,134,.12);color:#047857;}
.cd-wrap .eco-sig-kind.risk{background:rgba(245,158,11,.16);color:#92400E;}
.cd-wrap .eco-rel-competitor{background:rgba(220,38,38,.10);color:#B91C1C;}
.cd-wrap .eco-rel-supplier{background:rgba(37,99,235,.10);color:#1D4ED8;}
.cd-wrap .eco-rel-customer{background:rgba(5,150,105,.12);color:#047857;}
.cd-wrap .eco-rel-related{background:rgba(107,114,128,.12);color:#4B5563;}

/* --- inline ecosystem (violet) block: white card, dark body text --- */
.cd-wrap .inline-eco-item{color:var(--text);}
.cd-wrap .inline-eco-txt{color:var(--muted);}
.cd-wrap .inline-eco-rel{color:var(--meta);}

/* --- Market Pulse peer-read-through card body text --- */
.cd-wrap .mp-themes-label{color:var(--text);}
.cd-wrap .mp-brief-text{color:var(--text);}
.cd-wrap .mp-peer-stmt{color:var(--muted);}
.cd-wrap .mp-peer-src{color:var(--meta);}

/* --- price-context strap under the header --- */
.cd-wrap .price-context{color:var(--muted);}
.cd-wrap .about-src{color:var(--meta);}

/* --- Risk-context exposures: repaint the dark "stable" box + its text --- */
.cd-wrap .exposure-stable{background:var(--divider);border-left-color:var(--border);}
.cd-wrap .exposure-name{color:var(--text);}
.cd-wrap .exposure-detail{color:var(--muted);}
.cd-wrap .exposure-condition-note{color:var(--muted);}
.cd-wrap .risk-narrative-summary{color:var(--muted);border-top-color:var(--border);}
.cd-wrap .risk-last-addressed{color:var(--meta);}
.cd-wrap .risk-no-exposure,.cd-wrap .risk-no-data{color:var(--muted);}
.cd-wrap .condition-elevated{background:rgba(220,38,38,.12);color:#B91C1C;}
.cd-wrap .condition-moderate{background:rgba(245,158,11,.16);color:#92400E;}
