/* Navy palette: shared overrides loaded last on every page.
   Colours: page #FFFFFF, cards #F4F4F2, lines #E2E3E1, sidebar/headings #102A4C,
   selected/primary #254361, body #25313D, labels #374151, tertiary #4B5563,
   up #1E8A5A, down #D0453B. */
:root{--accent:#254361;--head:#102A4C;--tertiary:#4B5563;--spark:#6B7280}
html:not([data-theme="dark"]) body{background:#fff;background-image:none}

/* Headings, tickers and primary figures in midnight navy */
html:not([data-theme="dark"]) :is(h1,h2,h3,h4,.ticker,.sym,.symbol,.stock-name,.big,.value,.price,.index-value,.last){color:var(--head)}
html:not([data-theme="dark"]) :is(.nav-a,.kicker,.eyebrow,.label){color:#374151}

/* Typography: calmer weights and consistent heading sizes */
b,strong{font-weight:600}
h1{font-size:clamp(22px,2.4vw,28px);font-weight:600;letter-spacing:-.01em}
h2{font-size:clamp(18px,1.8vw,22px);font-weight:600;letter-spacing:-.005em}
h3{font-size:16px;font-weight:600}
::placeholder{color:#374151;opacity:.75}

/* Light shadows only */
html:not([data-theme="dark"]) :is(.card,.panel,.box,.index-card,.tile,.section,.market-heatmap,.sentiment-card){box-shadow:none!important}

/* Primary buttons and selected controls: muted navy, white text */
html :is(.btn,.primary,button.primary,.hot-popup-open,.mini.approve,.admin-tabs button[aria-selected="true"],.tab[aria-current="page"],.ranges button[aria-pressed="true"],.pill[aria-pressed="true"],.level[aria-pressed="true"],.picker .pk-list button.cur,.seg button[aria-pressed="true"],.seg button.active){background:var(--accent)!important;border-color:var(--accent)!important;color:#fff!important}
.login-card button,body.login button[type="submit"]{background:var(--accent);color:#fff}

/* Sidebar: solid midnight navy, selected item muted navy with white text */
.sn-side,.side{background:#102A4C!important}
.sn-nav a.active,.nav a.active,.side-tabs button.active{background:#254361!important;color:#fff!important}
.sn-nav a.active svg,.nav a.active svg{color:#fff!important}

/* Market-status badge: neutral grey pill with white text */
#market-session{display:inline-block;background:#6B7280;color:#fff!important;border-radius:999px;padding:3px 10px;font-size:11px;font-weight:600;letter-spacing:.04em}

/* Heatmap on a light surface */
html:not([data-theme="dark"]) .market-heatmap-grid{background:#fff;border-color:#E2E3E1}
html:not([data-theme="dark"]) .heatmap-sector{background:#fff;border-color:#fff}
html:not([data-theme="dark"]) .heatmap-sector-label{color:#102A4C}
.heatmap-stock{border-color:rgba(255,255,255,.7)}
.hm-down,.heatmap-legend .hm-red{background:#E07A70;color:#fff}
.hm-strong-down{background:#D0453B;color:#fff}
.hm-soft-down{background:#F6D3CF;color:#102A4C}
.hm-flat-stock,.heatmap-legend .hm-flat{background:#E5E7EB;color:#102A4C}
.hm-soft-up{background:#CDEBD9;color:#102A4C}
.hm-up,.heatmap-legend .hm-green{background:#3FA06F;color:#fff}
.hm-strong-up{background:#1E8A5A;color:#fff}
.heatmap-stock:hover,.heatmap-stock:focus-visible{filter:brightness(.96);outline-color:#102A4C}

/* More breathing room inside panels */
html :is(.card,.panel,.index-card){padding-block:max(18px,1em)}

/* Cards nested inside a panel sit on white so the panel stays distinct */
html:not([data-theme="dark"]) :is(.index-card,.mover-card){background:#fff}
#index-source{color:#4B5563}
/* Sign-in page */
.shell form button{background:var(--accent)!important;color:#fff!important}
.kicker,.eyebrow,.shell .link-button,.shell .form-success{color:var(--accent)!important}
.shell .card{border:1px solid #E2E3E1}
.heatmap-legend i{width:18px}

/* Figures: a touch heavier with aligned digits so numbers read crisply */
:is(.up,.down,.positive,.negative,.pos,.neg,.mv-up,.mv-down){font-weight:600}
td,.num,.mv-num{font-weight:500;font-variant-numeric:tabular-nums}
td:first-child{font-weight:inherit}

/* Sidebar: unselected items brighter so they read clearly next to the selected one */
:is(.sn-nav a:not(.active),.sn-nav .mt-btn,.nav a:not(.active),.side-tabs button:not(.active),.mt-fly a:not(.active)){color:#E6EAF0!important}
.side-label{color:#AEB8C6!important}
/* Menu labels stay on one line */
:is(.nav a,.sn-nav a,.mt-fly a,.ct-item,.in-item) span{white-space:nowrap}

/* Account section of the menu spans the full width like the main items (phone drawer) */
.side .acct-nav{align-self:stretch;width:auto}
.side .acct-nav a{box-sizing:border-box;width:100%}
/* Funds page menu: logout and disclaimer flow after the items instead of overlapping them */
.side:has(.side-disclaimer){display:flex;flex-direction:column;overflow-y:auto}
.side:has(.side-disclaimer) .logout{position:static;order:8;width:100%;margin:16px 0 16px}
.side:has(.side-disclaimer) .side-disclaimer{position:static;order:9;margin-top:auto}

/* Standard hover shade: every clickable item (links, buttons, tabs, tiles) darkens slightly
   under the pointer. Drawn as a background-image layer so each item keeps its own colour. */
:root{--hover-shade:rgba(16,42,76,.07)}
html[data-theme="dark"],.side,.sn-side{--hover-shade:rgba(255,255,255,.09)}
/* Filled navy buttons and selected controls lighten instead, so the change shows on dark fills */
html :is(.btn,.primary,.mini.approve,[aria-pressed="true"],[aria-selected="true"],.tab[aria-current="page"],.seg button.active,.side-logout,.sn-out){--hover-shade:rgba(255,255,255,.14)}
@media (hover:hover){
html:not(#hover-std) body :is(a[href],button:not(:disabled),[role="button"],[role="tab"],summary,label[for],label:has(input),[onclick],.clickable):hover,html:not(#hover-std) body tr.link:hover>td{background-image:linear-gradient(var(--hover-shade),var(--hover-shade))!important}
}

/* NEW badges in the menu line up at the end of each row, whatever the label length */
:is(.nav a,.sn-nav a):has(>em){padding-inline-end:6px!important}:is(.nav a,.sn-nav a):has(>em)>span{flex:1 1 auto;min-width:0}:is(.nav a,.sn-nav a)>em{flex:none;margin-inline-start:-4px!important;padding:1px 4px!important;letter-spacing:.02em!important}

/* Dark mode readability: light-theme colours that disappear on navy */
html[data-theme="dark"] :is(.lbl,.eyebrow,.kicker,.side-label){color:#9FB3CC!important}
html[data-theme="dark"] .notice.neutral,html[data-theme="dark"] .notice.neutral a{color:#C3CBD6}
html[data-theme="dark"] .multiple-head{background:#1B2E48!important}
html[data-theme="dark"] .multiple-head span{color:#AEB8C6!important}
html[data-theme="dark"] :is(.down,.neg,.negative,.mv-down,td .down){color:#F0776C}
html[data-theme="dark"] :is(.heatmap-stock.hm-soft-up,.heatmap-stock.hm-soft-down,.heatmap-stock.hm-flat-stock) *{color:#102A4C!important}
html[data-theme="dark"] .fear-greed i,html[data-theme="dark"] .sentiment-card i{color:#9FB3CC}
html[data-theme="dark"] .betatag{background:#254361!important;color:#fff!important}
html[data-theme="dark"] button .arrow{color:#C3CBD6}
/* Financial Results page in dark mode */
html[data-theme="dark"] :is(.tapnote,.sec-title,.snap h2.bn,.topic b,.bk .tk2){color:#E8ECF1}
html[data-theme="dark"] .bk{background:#15233A;border-color:#2A4466}
html[data-theme="dark"] .bk:hover{background:#1F3550;border-color:#7FA6D6}
html[data-theme="dark"] .bk[aria-pressed="true"]{background:#254361;border-color:#7FA6D6}
html[data-theme="dark"] .bk .gr.up{color:#4CC28A}html[data-theme="dark"] .bk .gr.down{color:#F0776C}
html[data-theme="dark"] .wchip{background:#15233A;color:#C3CBD6}
html[data-theme="dark"] .snap{--head:#E8ECF1;--accent:#7FA6D6;--ink:#D7DEE7;--muted:#AEB8C6;--line:#2A4466;--card:#15233A;--up:#4CC28A;--down:#F0776C;--upbg:rgba(76,194,138,.16);--downbg:rgba(240,119,108,.16)}
html[data-theme="dark"] .snap :is(.hero,.note,.seg .t,details.segd ul){background:#1B2E48}
html[data-theme="dark"] .snap :is(.tk,.q i){background:#254361}
html[data-theme="dark"] .snap .seg .t span{background:#7FA6D6}
html[data-theme="dark"] .snap .pill.flat{background:#2A4466}
html[data-theme="dark"] .movers h2 i{color:#0B1626}
html[data-theme="dark"] :is(i,em,.fg-state)[style*="--fg-z2"]{color:#8FA9CC!important}
html[data-theme="dark"] .snap [style*="#102A4C"]{background:#3A72B8!important}
