/*
Theme Name: StockFlash Daily
Theme URI: https://stockflashdaily.com/
Description: Editorial finance theme for StockFlash Daily: market briefing bar, E-E-A-T article components, CLS-safe ad slots.
Version: 1.9.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: stockflashdaily
*/

:root {
  --navy: #0F172A;
  --blue: #2563EB;
  --blue-dark: #1D4ED8;
  --bg: #F8FAFC;
  --text: #1E293B;
  --muted: #64748B;
  --line: #E2E8F0;
  --white: #FFFFFF;
  --gain: #16A34A;      /* fills/icons only: 3.3:1 on white fails AA for text */
  --gain-text: #15803D; /* 5.0:1 on white */
  --loss: #DC2626;      /* 4.8:1 on white, OK for text */
  /* Theme-aware roles (dark values in the Dark mode block): --navy/--white stay brand constants for dark bands and text on blue */
  --ink: #0F172A;       /* headings */
  --surface: #FFFFFF;   /* cards, header, panels */
  --link: #2563EB;
  --tint: #EFF6FF;      /* chips, callouts */
  --tint-line: #BFDBFE;
  --tint-text: #1D4ED8;
  --field: #CBD5E1;     /* input borders */
  --radius: 10px;
  --wrap: 1240px;
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 18px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.2vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.45rem, 2.8vw, 1.9rem); font-weight: 750; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid #93C5FD; outline-offset: 2px; }
[hidden] { display: none !important; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; width: auto; height: auto; clip: auto; z-index: 100; background: var(--surface); padding: 8px 14px; border-radius: 8px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.section { padding: clamp(56px, 8vw, 88px) 0; }
.section--tight { padding: clamp(24px, 4vw, 40px) 0 clamp(56px, 8vw, 88px); }
.section--white { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--link); margin-bottom: 12px; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--muted); max-width: 62ch; }
.section-head { max-width: 680px; margin-bottom: 36px; }
.rail-title { font-size: .8rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); border-top: 3px solid var(--ink); padding-top: 10px; margin: 0 0 12px; }
.more { display: inline-block; font-weight: 650; margin-top: 8px; }

/* Header */
.ticker-bar { display: flex; align-items: center; background: var(--navy); }
.ticker { flex: 1; min-width: 0; min-height: 46px; overflow: hidden; }
.status-pill--bar { color: #E2E8F0; font-size: .78rem; padding: 0 16px; border-left: 1px solid #1E293B; align-self: stretch; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.admin-bar .site-header { top: 32px; }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: var(--header-h); }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--ink); letter-spacing: -0.02em; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 30px; height: 30px; border-radius: 7px; background: var(--blue); display: grid; place-items: center; flex: none; }
.logo-mark svg { width: 18px; height: 18px; }
.logo em { font-style: normal; color: var(--link); }
.drawer { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a { color: var(--text); font-weight: 550; font-size: .95rem; padding: 8px 11px; border-radius: 8px; white-space: nowrap; }
.nav a:hover { background: var(--bg); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--link); background: var(--tint); }
.site-search { display: flex; align-items: center; border: 1px solid var(--field); border-radius: 999px; background: var(--bg); padding: 0 4px 0 14px; width: 200px; flex: none; }
.site-search input { font: inherit; font-size: .9rem; border: 0; background: transparent; min-width: 0; flex: 1; padding: 8px 0; color: var(--text); }
.site-search input:focus { outline: none; }
.site-search:focus-within { outline: 3px solid var(--tint-line); border-color: var(--link); }
.site-search button, .menu-toggle { display: grid; place-items: center; width: 36px; height: 36px; border: 0; background: transparent; color: var(--ink); border-radius: 999px; cursor: pointer; flex: none; }
.site-search svg, .menu-toggle svg { width: 20px; height: 20px; }
.menu-toggle { display: none; margin-left: auto; width: 44px; height: 44px; border-radius: 8px; }
.menu-toggle .icon-close, .menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

/* Market briefing bar */
.briefing { background: var(--surface); border-bottom: 1px solid var(--line); }
.briefing .wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 24px; align-items: center; padding-top: 10px; padding-bottom: 10px; }
.status { display: flex; flex-direction: column; gap: 2px; font-size: .8rem; color: var(--muted); }
.status-pill { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 700; color: var(--ink); white-space: nowrap; }
.status-pill::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.status-pill[data-state="open"]::before { background: var(--gain); box-shadow: 0 0 0 4px #DCFCE7; }
.status-pill[data-state="pre"]::before, .status-pill[data-state="after"]::before { background: #D97706; }
.status-pill[data-state="closed"]::before { background: var(--loss); }
.indices { min-height: 72px; min-width: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 650; font-size: 1rem; padding: 14px 22px; border-radius: 8px; border: 1px solid transparent; text-align: center; }
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--blue); color: var(--white); }
.btn--primary:hover { background: var(--blue-dark); }
.btn--light { background: var(--white); color: var(--navy); }
.btn--light:hover { background: #E2E8F0; }

/* Home: hero + sentiment */
.home-top { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 24px; align-items: stretch; }
.hero-card { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--navy); color: #CBD5E1; border-radius: 14px; overflow: hidden; }
.hero-card .thumb { display: block; align-self: center; } /* covers carry baked-in titles: keep full 1200x630 frame, never crop */
.hero-card .thumb img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; }
.hero-body { padding: clamp(24px, 3vw, 36px); display: flex; flex-direction: column; gap: 12px; }
.hero-body h1 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); margin: 0; }
.hero-body h1 a { color: var(--white); }
.hero-body p { margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-body .meta .tag, .hero-body .more { color: #93C5FD; }
.hero-body .meta { color: #94A3B8; }
.sentiment { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 18px 12px; display: flex; flex-direction: column; min-width: 0; }
.sentiment .gauge { flex: 1; min-height: 340px; }

/* Home: Editor's Choice + Latest Flash */
.home-cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.choice .card:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.choice .card:first-child h3 { font-size: 1.45rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card .thumb img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; }
/* No featured image: navy candlestick pattern + category label */
.thumb--fallback { display: flex; align-items: flex-end; aspect-ratio: 1200 / 630; padding: 14px 16px; background: var(--navy) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 126'%3E%3Cg stroke-width='2'%3E%3Cpath stroke='%2322C55E' d='M20 70v36M52 52v34M116 40v30M180 24v34'/%3E%3Cpath stroke='%23EF4444' d='M36 60v40M84 44v44M148 30v42M212 20v30'/%3E%3C/g%3E%3Cg%3E%3Crect fill='%2322C55E' x='16' y='78' width='8' height='20'/%3E%3Crect fill='%23EF4444' x='32' y='66' width='8' height='26'/%3E%3Crect fill='%2322C55E' x='48' y='58' width='8' height='20'/%3E%3Crect fill='%23EF4444' x='80' y='50' width='8' height='30'/%3E%3Crect fill='%2322C55E' x='112' y='46' width='8' height='18'/%3E%3Crect fill='%23EF4444' x='144' y='36' width='8' height='28'/%3E%3Crect fill='%2322C55E' x='176' y='30' width='8' height='22'/%3E%3Crect fill='%23EF4444' x='208' y='24' width='8' height='20'/%3E%3C/g%3E%3Cpath fill='none' stroke='%233B82F6' stroke-width='2' d='M0 104 40 88 80 92 120 64 160 70 200 40 240 30'/%3E%3C/svg%3E") center / cover no-repeat; }
.thumb--fallback span { font-size: .72rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: #fff; background: rgba(15, 23, 42, .85); border-radius: 6px; padding: 4px 8px; }
.thumb--fallback:hover { text-decoration: none; }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; }
.card h3 { font-size: 1.1rem; margin: 0; line-height: 1.3; }
.card h3 a { color: var(--ink); }
.card p { color: var(--muted); margin: 0; font-size: .95rem; line-height: 1.55; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .78rem; color: var(--muted); }
.meta .tag { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--link); }
.flash { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.flash > li { position: relative; padding: 0 0 20px 20px; }
.flash > li::before { content: ''; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--blue); }
.flash > li.flash-ad { padding-left: 16px; }
.flash > li.flash-ad::before { display: none; }
.flash time { font-size: .78rem; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; }
.flash h3 { font-size: 1rem; line-height: 1.35; margin: 2px 0 0; }
.flash h3 a { color: var(--ink); }
.side-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-top: 24px; }
.side-box .rail-title { border-top: 0; padding-top: 0; }
.movers { min-height: 440px; }
.home-cols > div > .side-box:first-child { margin-top: 0; }
.widget-note { font-size: .75rem; color: var(--muted); margin: 8px 0 0; }

.topic-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.topic-col h3 { font-size: 1rem; border-top: 3px solid var(--blue); padding-top: 12px; }
.topic-col h3 a, .topic-col li a, .side-list a { color: var(--ink); font-weight: 600; }
.topic-col ul, .side-list { list-style: none; margin: 0 0 8px; padding: 0; }
.topic-col li, .side-list li { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .92rem; line-height: 1.4; }
.side-list li:last-child { border-bottom: 0; }

.standards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.standards div { border-top: 3px solid var(--ink); padding-top: 18px; }
.standards p { color: var(--muted); margin: 0; }
.faq { max-width: 820px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; }
.faq summary { cursor: pointer; list-style: none; padding: 20px 56px 20px 24px; font-weight: 650; color: var(--ink); position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 24px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; font-weight: 400; color: var(--link); }
.faq details[open] summary::after { content: '\2212'; }
.faq details p { padding: 0 24px 20px; margin: 0; color: var(--muted); }
.cta { background: var(--navy); color: #CBD5E1; border-radius: 14px; padding: clamp(32px, 5vw, 56px); display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap; }
.cta h2 { color: var(--white); margin-bottom: 8px; }
.cta p { margin: 0; max-width: 56ch; }

/* Ad slots: min-height reserves space so ads don't shift the layout (CLS) */
.ad-slot { display: grid; place-items: center; width: 100%; overflow: hidden; }
.ad-slot--placeholder { background: #F1F5F9; border: 1px dashed var(--field); border-radius: 8px; color: var(--muted); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; }
.ad-slot--leader { min-height: 90px; }
.ad-slot--infeed { min-height: 120px; }
.ad-slot--article { min-height: 250px; margin: 24px 0; }
/* In-article: 32px clearance so a responsive ad never sits flush against text (mis-click guard) */
.adsense-in-article-wrapper { margin: 32px 0; clear: both; }
.adsense-in-article-wrapper .ad-slot--article { margin: 0; }
.adsense-in-article-wrapper + h2 { margin-top: 0; }
.ad-slot--rect { min-height: 250px; max-width: 300px; margin: 0 auto; }
.ad-slot--sky { min-height: 600px; max-width: 300px; margin: 0 auto; }
.ad-row { padding-top: 24px; }

/* Article layout: main + sticky rail */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; align-items: start; }
.rail { display: flex; flex-direction: column; gap: 24px; align-self: stretch; }
.rail .side-box { margin-top: 0; }
.rail-sticky { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 24px; }
.toc { max-height: calc(100vh - 120px); overflow-y: auto; }
.rail-sticky:has(.ad-slot--sky) .toc { max-height: calc(100vh - 750px); min-height: 160px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc li a { display: block; padding: 6px 0 6px 14px; font-size: .88rem; line-height: 1.4; color: var(--text); }
.toc li a:hover { color: var(--link); text-decoration: none; }
.toc .toc-sub a { padding-left: 28px; font-size: .82rem; color: var(--muted); }
.article-body h2, .article-body h3 { scroll-margin-top: 90px; }
.toc li a.is-active { color: var(--link); font-weight: 650; border-left: 2px solid var(--link); margin-left: -2px; }
.toc-inline { display: none; border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; margin: 24px 0; }
.toc-inline summary { cursor: pointer; font-weight: 700; color: var(--ink); }
.toc-inline summary span { font-weight: 400; color: var(--muted); font-size: .9em; }
.toc-inline ol { list-style: none; margin: 10px 0 4px; padding: 0; }
.toc-inline li a { display: block; padding: 6px 0; color: var(--text); overflow-wrap: anywhere; }
.toc-inline .toc-sub a { padding-left: 14px; font-size: .9em; color: var(--muted); }
.toc-inline a.is-active { color: var(--link); font-weight: 650; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .85rem; color: var(--muted); margin-bottom: 16px; }
.article-head h1 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); }
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--muted); font-size: .9rem; margin-bottom: 16px; }
.byline a { color: var(--ink); font-weight: 650; }
.article-hero { margin: 20px 0 8px; }
.article-hero img { width: 100%; border-radius: var(--radius); aspect-ratio: 1200 / 630; object-fit: cover; }
.tickers { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.tickers a { display: inline-block; font-size: .82rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--tint-text); background: var(--tint); border: 1px solid var(--tint-line); border-radius: 999px; padding: 3px 12px; }
.tickers a:hover { background: var(--blue); color: var(--white); text-decoration: none; }
.tickers--bottom { margin-top: 32px; }

.article-body { max-width: 72ch; font-size: 1.05rem; line-height: 1.75; }
.article-body p, .article-body ul, .article-body ol { margin: 0 0 1.5em; }
.article-body h2 { font-size: clamp(1.35rem, 2.4vw, 1.65rem); margin: 1.8em 0 .6em; }
.article-body h3 { margin: 1.5em 0 .5em; }
.article-body li { margin-bottom: .5em; }
.article-body table { width: 100%; border-collapse: collapse; font-size: .92rem; line-height: 1.5; margin: 0 0 1.5em; display: block; overflow-x: auto; }
.article-body th, .article-body td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.takeaways { background: var(--tint); border-left: 4px solid var(--blue); border-radius: 0 var(--radius) var(--radius) 0; padding: 20px 24px; margin: 8px 0 2em; font-size: 1rem; line-height: 1.6; }
.takeaways-title { font-size: .8rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); margin: 0 0 8px !important; }
.takeaways ul { margin: 0 !important; padding-left: 1.2em; }

/* E-E-A-T components */
.eeat { display: flex; flex-direction: column; gap: 16px; margin-top: 32px; max-width: 72ch; }
.author-card { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.author-card img { width: 72px; height: 72px; border-radius: 50%; }
.author-card .label { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0; }
.author-card h2 { font-size: 1.15rem; margin: 2px 0 0; }
.author-card .role { color: var(--tint-text); font-weight: 650; font-size: .9rem; margin: 0 0 8px; }
.author-card p { font-size: .95rem; line-height: 1.6; margin: 0 0 8px; }
.author-card .links { font-size: .88rem; margin: 0; }
.fact-check { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 650; color: var(--gain-text); background: #F0FDF4; border: 1px solid #BBF7D0; border-radius: 999px; padding: 4px 12px 4px 8px; }
.fact-check svg { width: 16px; height: 16px; flex: none; }
.fact-check a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.fact-check--row { border-radius: var(--radius); padding: 12px 16px; font-weight: 500; color: #14532D; }
.disclaimer-box { background: #FFFBEB; border: 1px solid #FCD34D; border-left: 5px solid #D97706; border-radius: var(--radius); padding: 18px 20px; font-size: .92rem; line-height: 1.6; color: #451A03; }
.disclaimer-box strong { display: block; color: #78350F; font-size: 1rem; margin-bottom: 4px; }
.disclaimer-box p { margin: 0; }

.related { margin-top: 48px; }
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

/* Archives, pages */
.page-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: clamp(40px, 6vw, 64px) 0; }
.page-head p { color: var(--muted); max-width: 62ch; margin: 0; }
.prose { max-width: 72ch; line-height: 1.75; }
.prose h2 { margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.pagination { margin-top: 40px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.pagination .page-numbers { padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-weight: 600; }
.pagination .current { background: var(--navy); color: var(--white); border-color: var(--navy); }
.topic-section { padding: 32px 0; border-bottom: 1px solid var(--line); }
.topic-section:first-of-type { padding-top: 0; }
.filter-bar { margin-top: 20px; max-width: 520px; }
.filter-bar input { width: 100%; font: inherit; font-size: 16px; padding: 12px 16px; border: 1px solid var(--field); border-radius: 999px; background: var(--bg); color: var(--text); }
.filter-bar input:focus { outline: 3px solid var(--tint-line); border-color: var(--link); }
.filter-empty { color: var(--muted); }

/* Newsletter */
.newsletter { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--blue); border-radius: var(--radius); padding: 22px; }
.newsletter h2 { font-size: 1.15rem; margin: 0 0 6px; }
.newsletter p { font-size: .92rem; color: var(--muted); margin: 0 0 12px; }
.newsletter form, .nl-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.newsletter input { flex: 1 1 180px; min-width: 0; font: inherit; font-size: 16px; padding: 11px 14px; border: 1px solid var(--field); border-radius: 8px; }
.newsletter .btn { flex: 1 0 auto; padding: 11px 18px; }
.newsletter .fine { font-size: .78rem; margin: 10px 0 0; }
.newsletter--wide { margin-bottom: 32px; padding: clamp(24px, 4vw, 40px); }
.newsletter--wide h2 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); }
.newsletter--wide form, .newsletter--wide .nl-actions { max-width: 520px; }
.btn--outline { background: none; color: var(--link); border: 1px solid var(--line); }
.btn--outline:hover { border-color: var(--link); }
.cmp-notice { font-size: .92rem; color: var(--muted); background: var(--tint); border-radius: 8px; padding: 14px 16px; margin: 8px 0 0; }
.cmp-asof { font-size: .78rem; color: var(--muted); margin: 10px 0 0; }

/* Footer */
.site-footer { background: var(--navy); color: #94A3B8; font-size: .9rem; padding: 56px 0 32px; }
.site-footer .logo { color: var(--white); margin-bottom: 12px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr); gap: 40px; }
.site-footer h2 { color: var(--white); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.footer-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.site-footer a { color: #CBD5E1; }
.disclaimer { border-top: 1px solid #1E293B; margin-top: 40px; padding-top: 24px; font-size: .8rem; line-height: 1.6; }

/* Market tools: tabs, heatmap, countdowns */
.calendar-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 24px; align-items: start; }
.calendar-cols .side-box { margin-top: 0; }
.watchlist-slot:empty + .side-box { margin-top: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px 0 12px; }
.tabs [role="tab"] { font: inherit; font-size: .85rem; font-weight: 700; color: var(--muted); background: none; border: 0; border-bottom: 3px solid transparent; padding: 8px 12px 9px; margin-bottom: -1px; cursor: pointer; }
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--link); }
.tabs [role="tab"]:focus-visible { outline: 3px solid var(--tint-line); }
.wrap--wide { max-width: 1800px; }
/* Heatmap scales with the screen: 680px floor, ~full viewport under the sticky header on big monitors */
.heatmap { width: 100%; height: clamp(680px, calc(100vh - 150px), 1100px) !important; /* TradingView sets inline height:100% */ overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.heatmap .tradingview-widget-container__widget { height: 100%; }
.cd-list { list-style: none; margin: 0; padding: 0; }
.cd-list li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.cd-list li[hidden] { display: none; }
.cd-day { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--tint-text); background: var(--tint); border-radius: 6px; text-align: center; padding: 3px 0; font-size: .8rem; }
.cd-list .is-soon .cd-day { color: var(--white); background: var(--blue); }
.cd-what { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.cd-what small { color: var(--muted); font-size: .78rem; }
.cd-list time { font-size: .78rem; color: var(--muted); white-space: nowrap; }

/* Calendar page: month grid + expandable event list. Event colors per filter group (--pbg fill, --pfg text/dot). */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.cal-side .side-box { margin-top: 0; }
.cal-toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 18px; }
.cal-toolbar[hidden], .cal-month[hidden], .cal-list[hidden], .cal-item[hidden] { display: none; }
.cal-month-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.cal-month-title { margin: 0; font-size: 1.25rem; }
.cal-nav { font: inherit; font-size: 1.4rem; line-height: 1; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; }
.cal-nav:disabled { opacity: .35; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.cal-dow { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: center; padding-bottom: 2px; }
.cal-cell { font: inherit; color: var(--text); text-align: left; min-height: 96px; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.cal-cell:hover { border-color: var(--link); }
.cal-cell[aria-pressed="true"] { outline: 2px solid var(--link); outline-offset: -1px; }
.cal-cell.is-past { opacity: .55; }
.cal-num { font-size: .82rem; font-weight: 700; font-variant-numeric: tabular-nums; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-cell.is-today .cal-num { background: var(--blue); color: var(--white); }
.cal-pill, .cal-badge { --pbg: var(--tint); --pfg: var(--tint-text); background: var(--pbg); color: var(--pfg); font-size: .7rem; font-weight: 700; border-radius: 4px; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cal-pill--inflation, .cal-badge--inflation { --pbg: #FEF3C7; --pfg: #92400E; }
.cal-pill--jobs, .cal-badge--jobs { --pbg: #DCFCE7; --pfg: #166534; }
.cal-pill--growth, .cal-badge--growth { --pbg: #EDE9FE; --pfg: #5B21B6; }
.cal-pill--earnings, .cal-badge--earnings { --pbg: #CCFBF1; --pfg: #115E59; }
.cal-pill--market, .cal-badge--market { --pbg: #F1F5F9; --pfg: #475569; }
.cal-day { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.cal-day h3 { margin: 0 0 4px; font-size: 1rem; }
.cal-list { list-style: none; margin: 0; padding: 0; }
.cal-item { border-bottom: 1px solid var(--line); }
.cal-item.is-past summary { opacity: .65; }
.cal-item summary { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; cursor: pointer; list-style: none; }
.cal-item summary::-webkit-details-marker { display: none; }
.cal-item summary:focus-visible { outline: 3px solid var(--tint-line); }
.cal-badge { text-align: center; padding: 4px 6px; }
.cal-what { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.cal-what small { color: var(--muted); font-size: .8rem; }
.cal-when { font-size: .78rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.cal-when::after { content: " \25BE"; font-weight: 400; }
.cal-item details[open] .cal-when::after { content: " \25B4"; }
.cal-detail { padding: 0 0 16px 96px; font-size: .93rem; line-height: 1.6; }
.cal-detail p { margin: 0 0 10px; }
.cal-reading { background: var(--tint); border-left: 3px solid var(--link); border-radius: 6px; padding: 8px 12px; font-weight: 650; color: var(--ink); }
.cal-links-title { font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px !important; }
.cal-links { margin: 0 0 10px; padding-left: 18px; }
.cal-links li { margin-bottom: 4px; }
.cal-source { font-size: .85rem; }
[data-theme="dark"] .cal-pill--inflation, [data-theme="dark"] .cal-badge--inflation { --pbg: #422006; --pfg: #FCD34D; }
[data-theme="dark"] .cal-pill--jobs, [data-theme="dark"] .cal-badge--jobs { --pbg: #052E16; --pfg: #86EFAC; }
[data-theme="dark"] .cal-pill--growth, [data-theme="dark"] .cal-badge--growth { --pbg: #2E1065; --pfg: #C4B5FD; }
[data-theme="dark"] .cal-pill--earnings, [data-theme="dark"] .cal-badge--earnings { --pbg: #042F2E; --pfg: #5EEAD4; }
[data-theme="dark"] .cal-pill--market, [data-theme="dark"] .cal-badge--market { --pbg: #334155; --pfg: #CBD5E1; }

/* Tech desk: outside headlines under the post grid */
.headlines { margin-top: 32px; }
.headline-list { list-style: none; margin: 0; padding: 0; }
.headline-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.headline-list a { font-weight: 650; color: var(--ink); }
.headline-list small { display: block; margin-top: 2px; color: var(--muted); font-size: .78rem; }

/* Watchlist: docked card on wide screens, off-canvas drawer + floating button elsewhere */
.watchlist { background: var(--surface); padding: 20px; }
.watchlist.is-docked { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 24px; }
.rail .watchlist.is-docked { margin-bottom: 0; }
.watchlist:not(.is-docked) { position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: min(360px, 88vw); overflow-y: auto; box-shadow: -8px 0 32px rgba(15, 23, 42, .18); transform: translateX(100%); visibility: hidden; transition: transform .25s ease, visibility 0s .25s; }
.watchlist.is-open { transform: none; visibility: visible; transition: transform .25s ease; }
.wl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.wl-head .rail-title { border-top: 0; padding-top: 0; }
.wl-close { display: none; font-size: 1.6rem; line-height: 1; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 4px; margin-top: -6px; }
.watchlist:not(.is-docked) .wl-close { display: block; }
.wl-add { display: flex; gap: 8px; }
.wl-add input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 9px 12px; border: 1px solid var(--field); border-radius: 8px; text-transform: uppercase; }
.wl-add input:focus { outline: 3px solid var(--tint-line); border-color: var(--link); }
.wl-add button { flex: none; width: 44px; font-size: 1.3rem; font-weight: 700; color: var(--white); background: var(--blue); border: 0; border-radius: 8px; cursor: pointer; }
.wl-add { position: relative; }
.wl-suggest { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60; list-style: none; margin: 0; padding: 4px 0; max-height: min(320px, 60vh); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 28px rgba(15, 23, 42, .18); }
.wl-suggest li { display: grid; grid-template-columns: minmax(3.5em, auto) 1fr auto; align-items: baseline; gap: 10px; padding: 8px 12px; font-size: .85rem; cursor: pointer; }
.wl-suggest li[aria-selected="true"] { background: var(--tint); }
.wl-suggest b { color: var(--ink); }
.wl-suggest mark { background: none; color: var(--link); }
.wl-suggest span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.wl-suggest small { font-size: .7rem; font-weight: 650; color: var(--muted); }
.wl-suggest .wl-none { display: block; cursor: default; color: var(--muted); }
.wl-add input { text-transform: none; }
.wl-error { color: var(--loss); font-size: .82rem; margin: 8px 0 0; }
.wl-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; padding: 0; }
.wl-chips li { display: inline-flex; align-items: center; font-size: .82rem; font-weight: 700; color: var(--tint-text); background: var(--tint); border: 1px solid var(--tint-line); border-radius: 999px; padding: 2px 4px 2px 12px; }
.wl-chips button { font-size: 1.05rem; line-height: 1; color: var(--muted); background: none; border: 0; cursor: pointer; padding: 2px 6px; min-width: 24px; min-height: 24px; }
.wl-chips button:hover { color: var(--loss); }
.wl-quotes { min-height: 120px; }
.wl-fab { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 700; font-size: .9rem; color: var(--white); background: var(--navy); border: 0; border-radius: 999px; padding: 12px 18px; box-shadow: 0 6px 20px rgba(15, 23, 42, .3); cursor: pointer; }
.wl-fab svg { width: 18px; height: 18px; }
.wl-docked .wl-fab { display: none; }
.wl-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(15, 23, 42, .45); }
.wl-lock { overflow: hidden; }

/* Dividend calculator */
.calc { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 32px; align-items: start; margin-bottom: 40px; }
.calc-form { margin-top: 0; display: grid; gap: 6px; }
.calc-form label { font-size: .88rem; font-weight: 650; margin-top: 8px; }
.calc-form input[type="number"], .calc-form select { font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--field); border-radius: 8px; width: 100%; font-variant-numeric: tabular-nums; }
.calc-form input:focus, .calc-form select:focus { outline: 3px solid var(--tint-line); border-color: var(--link); }
.calc-form .calc-check { display: flex; align-items: center; gap: 8px; font-weight: 550; margin-top: 14px; }
.calc-check input { width: 18px; height: 18px; accent-color: var(--link); }
.calc-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 20px; }
.calc-stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.calc-stats dt { font-size: .78rem; color: var(--muted); }
.calc-stats dd { margin: 4px 0 0; font-size: clamp(1.2rem, 2.4vw, 1.6rem); font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.calc-stats div:first-child dd { color: var(--gain-text); }
.calc-chart { display: block; width: 100%; height: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.calc-chart text { font-size: 11px; fill: var(--muted); }
.calc-chart .grid { stroke: var(--line); }
.bar-contrib, .sw--contrib { fill: var(--tint-line); background: var(--tint-line); }
.bar-growth, .sw--growth { fill: var(--blue); background: var(--blue); }
.calc-legend { font-size: .82rem; color: var(--muted); margin: 10px 0 0; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin: 0 6px 0 12px; }
.sw:first-child { margin-left: 0; }
.article-body + .newsletter--wide, .layout .newsletter--wide { margin-top: 32px; }

/* Dark mode toggle (header) */
.theme-toggle { display: grid; place-items: center; width: 40px; height: 40px; flex: none; order: 1; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer; }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun, [data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

/* Heatmap controls: index / grouping / timeframe / box size segments, ticker lookup */
.hm-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 12px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; }
.seg button { font: inherit; font-size: .82rem; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--muted); background: none; border: 0; border-radius: 6px; padding: 5px 11px; min-height: 32px; cursor: pointer; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { color: var(--white); background: var(--blue); }
.hm-search { display: flex; gap: 6px; margin-left: auto; }
.hm-search input { width: 160px; min-width: 0; font: inherit; font-size: 16px; padding: 6px 12px; border: 1px solid var(--field); border-radius: 8px; background: var(--surface); color: var(--text); text-transform: uppercase; }
.hm-search input::placeholder, .cmp-form input::placeholder { text-transform: none; }
.hm-search input:focus { outline: 3px solid var(--tint-line); border-color: var(--link); }
.hm-search .btn { padding: 6px 16px; font-size: .9rem; }
.hm-lookup { margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.hm-scroll { position: relative; scroll-margin-top: var(--hdr, 60px); }
/* Locked until clicked so wheel/touch scroll the page instead of zooming the map */
.hm-shield { position: absolute; inset: 0; z-index: 2; display: flex; align-items: flex-end; justify-content: center; padding: 0 12px 18px; background: none; border: 0; cursor: pointer; }
.hm-shield span { background: rgba(15, 23, 42, .85); color: #fff; font-size: .85rem; font-weight: 600; padding: 8px 14px; border-radius: 999px; opacity: 0; transition: opacity .2s; }
.hm-shield:hover span, .hm-shield:focus-visible span { opacity: 1; }
.hm-done { display: none; position: absolute; top: 10px; right: 10px; z-index: 2; padding: 6px 14px; font-size: .85rem; }
.hm-scroll.is-live .hm-shield { display: none; }
.hm-scroll.is-live .hm-done { display: inline-flex; }
@media (hover: none) { .hm-shield span { opacity: 1; } }

/* Compare tool */
.cmp-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: end; margin: 0 0 24px; }
.cmp-form label { display: grid; gap: 4px; font-size: .85rem; font-weight: 650; min-width: 0; }
.cmp-form input { min-width: 0; font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--field); border-radius: 8px; background: var(--surface); color: var(--text); text-transform: uppercase; }
.cmp-form input:focus { outline: 3px solid var(--tint-line); border-color: var(--link); }
.cmp-form .btn { padding: 11px 22px; }
.cmp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; }
.cmp-card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--blue); border-radius: var(--radius); padding: 18px 20px 14px; }
.cmp-card h2 { font-size: 1.35rem; margin: 0; }
.cmp-name { font-size: .85rem; color: var(--muted); margin: 0 0 10px; min-height: 1.4em; }
.cmp-card dl { margin: 0; }
.cmp-card dl div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; line-height: 1.4; }
.cmp-card dt { color: var(--muted); }
.cmp-card dd { margin: 0 0 0 auto; font-weight: 750; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cmp-card dd.is-gain { color: var(--gain-text); }
.cmp-card dd.is-loss { color: var(--loss); }
.cmp-chart-title { margin-top: 40px; }
.cmp-chart { height: 460px !important; /* autosize chart needs a sized box */ border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cmp-chart .tradingview-widget-container__widget { height: 100%; }
.cmp-chart ~ .prose { margin-top: 32px; }

/* Dark mode: palette from the brief (bg #0F172A, surface #1E293B, text #F8FAFC, primary #2563EB, gain #16A34A, loss #DC2626).
   Text-sized links/gain/loss use lighter tints of the same hues so they stay readable (>= 4.5:1) on the dark surface. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0F172A;
  --surface: #1E293B;
  --text: #F8FAFC;
  --ink: #F8FAFC;
  --muted: #94A3B8;
  --line: #334155;
  --link: #60A5FA;
  --tint: #172554;
  --tint-line: #1E40AF;
  --tint-text: #93C5FD;
  --field: #475569;
  --gain-text: #4ADE80;
  --loss: #F87171;
}
[data-theme="dark"] iframe { color-scheme: light; } /* must match the widget documents, or the browser paints an opaque canvas behind them */
[data-theme="dark"] .ticker-bar, [data-theme="dark"] .site-footer { background: #020617; }
[data-theme="dark"] .hero-card, [data-theme="dark"] .cta { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
[data-theme="dark"] .wl-fab { background: var(--blue); }
[data-theme="dark"] .status-pill[data-state="open"]::before { box-shadow: 0 0 0 4px #14532D; }
[data-theme="dark"] .fact-check { background: #052E16; border-color: #166534; }
[data-theme="dark"] .fact-check--row { color: #BBF7D0; }
[data-theme="dark"] .disclaimer-box { background: #271C06; border-color: #854D0E; border-left-color: #D97706; color: #FDE68A; }
[data-theme="dark"] .disclaimer-box strong { color: #FCD34D; }
[data-theme="dark"] .ad-slot--placeholder { background: var(--surface); }

@media (max-width: 1180px) {
  .site-search { width: 160px; }
  .nav a { padding: 8px 8px; }
}
@media (max-width: 1080px) {
  .home-top, .home-cols { grid-template-columns: minmax(0, 1fr); }
  .sentiment .gauge { min-height: 300px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .rail { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); align-items: start; }
  .rail-sticky { display: none; }
  .toc-inline { display: block; }
  .topic-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  /* nav + search move into a drawer below the header row */
  .site-header .wrap { flex-wrap: wrap; }
  .menu-toggle { display: grid; }
  .drawer { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 12px; padding: 4px 0 16px; }
  .drawer.is-open { display: flex; }
  .nav { flex-direction: column; margin: 0; }
  .nav a { padding: 12px 10px; font-size: 1rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .site-search { width: 100%; order: -1; }
  .site-search input { font-size: 16px; padding: 10px 0; } /* 16px stops iOS zoom-on-focus */
  .theme-toggle { order: 0; margin-left: auto; }
  .menu-toggle { order: 1; margin-left: 0; }
  .drawer { order: 2; }
}
@media (max-width: 860px) {
  .hero-card, .choice .card:first-child { grid-template-columns: minmax(0, 1fr); }
  .hero-card .thumb { align-self: stretch; }
  .card-grid, .related-grid, .standards { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .calc { grid-template-columns: minmax(0, 1fr); }
  .cal-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .wrap { padding: 0 18px; }
  .article-body { font-size: 1rem; }
  .briefing .wrap { grid-template-columns: minmax(0, 1fr); }
  .status-pill--bar { padding: 0 12px; font-size: .72rem; }
  .choice, .topic-cols { grid-template-columns: minmax(0, 1fr); }
  .author-card { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .cta .btn { width: 100%; }
  .takeaways { padding: 16px 18px; }
  /* Phones: edge-to-edge and exactly one screen tall under the sticky header, like the TradingView app (no panning) */
  .hm-scroll { margin: 0 -18px; border-radius: 0; }
  .heatmap { height: calc(100svh - var(--hdr, 60px)) !important; border-width: 1px 0; border-radius: 0; }
  .hm-controls .seg { flex: 1 1 auto; }
  .hm-controls .seg button { flex: 1 1 auto; padding: 5px 8px; }
  .hm-search { margin-left: 0; width: 100%; }
  .hm-search input { flex: 1; width: auto; }
  .cmp-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cmp-form .btn { grid-column: 1 / -1; }
  .cmp-chart { height: 380px !important; }
  .calc-stats { grid-template-columns: minmax(0, 1fr); }
  .calc-chart text { font-size: 22px; } /* SVG units: the 640-wide chart is drawn at ~half size here */
  .wl-fab { padding: 14px; }
  .wl-fab span { display: none; } /* icon-only so it covers less content; aria name comes from aria-label */
  /* Calendar: day cells show colored dots instead of labels; the tapped day's events open below the grid */
  .cal-grid { gap: 4px; }
  .cal-cell { min-height: 56px; flex-flow: row wrap; align-content: flex-start; gap: 3px; padding: 4px; }
  .cal-num { flex-basis: 100%; width: auto; height: 22px; justify-content: start; padding-left: 2px; }
  .cal-cell.is-today .cal-num { width: 22px; flex-basis: auto; margin-right: 100%; justify-content: center; padding-left: 0; }
  .cal-pill { font-size: 0; width: 8px; height: 8px; padding: 0; border-radius: 50%; background: var(--pfg); }
  .cal-item summary { grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; }
  .cal-badge { font-size: .66rem; padding: 3px 4px; }
  .cal-detail { padding-left: 0; }
  .cal-filter { overflow-x: auto; flex-wrap: nowrap; max-width: 100%; }
  .cal-filter button { white-space: nowrap; }
}
@media (max-width: 782px) { .admin-bar .site-header { top: 0; } }
