/* ==========================================================================
   BizzPress — market widgets layer (assets/css/bp-markets.css)
   Ticker, home overview card, index cards, Market Buzz table, sector strip and the Sectors widget.
   Markup: includes/partials/markets/*.php · behaviour: assets/js/markets.js · contract: docs/design-spec.md §5.
   Builds on bizzpress.css (tokens, .bt-card, .bt-chip, .bt-pill, .bt-idx-card, .bt-table, .bt-gauge,
   .bt-sparkline, .bt-heatmap, .bt-segtabs, .bt-chiptabs, .bt-icontabs). Colours are tokens only, so dark
   mode works without extra rules.
   ========================================================================== */

/* ---- 0. Shared bits ---------------------------------------------------------------------------- */
[data-mw][hidden], [data-mw] [hidden] { display: none !important; }
.bt-tri { width: 10px; height: 10px; fill: currentColor; flex-shrink: 0; vertical-align: -1px; }
.bt-chg { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; white-space: nowrap; }
.bt-chg.flat { color: var(--bt-muted); }
.bt-pill .bt-tri { width: 9px; height: 9px; }
.bt-flip-y { transform: scaleY(-1); }
.bt-mkt-updated { font-size: 12px; font-weight: 500; color: var(--bt-grey); white-space: nowrap; }

/* ---- 1. Ticker (header strip, 36px) -------------------------------------------------------------- */
.bt-ticker { height: 36px; overflow: hidden; background: var(--bt-surface); border-bottom: 1px solid var(--bt-line); }
.bt-ticker__in { display: flex; height: 36px; overflow: hidden; }
.bt-ticker__track { display: flex; flex-shrink: 0; min-width: 100%; margin: 0; padding: 0; list-style: none; animation: bt-marquee 70s linear infinite; }
@keyframes bt-marquee { from { transform: translateX(0); } to { transform: translateX(-100%); } }
.bt-ticker__item { flex-shrink: 0; }
.bt-ticker__item a { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 18px; border-right: 1px solid var(--bt-line); color: var(--bt-ink); font-size: 12px; line-height: 1; white-space: nowrap; }
.bt-ticker__item .nm { font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.bt-ticker__item .px { font-weight: 600; }
.bt-ticker__item .bt-chg { font-size: 12px; }
.bt-ticker__item a:hover .nm { color: var(--bt-link); }
@media (max-width: 919px) {
  .bt-ticker__in { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .bt-ticker__in::-webkit-scrollbar { display: none; }
  .bt-ticker__track { min-width: 0; animation: none; }
  .bt-ticker__track--dup { display: none; }
  .bt-ticker__item a { padding: 0 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .bt-ticker__in { overflow-x: auto; }
  .bt-ticker__track { min-width: 0; animation: none; }
  .bt-ticker__track--dup { display: none; }
}

/* ---- 2. Home overview card: MARKET NEWS | MARKET PULSE | INDICES ------------------------------------ */
.bt-mkt-overview { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1.1fr); }
.bt-mkt-col { min-width: 0; padding: 16px 18px 18px; }
.bt-mkt-col + .bt-mkt-col { border-left: 1px solid var(--bt-line); }
.bt-mkt-col .bt-colhead { margin-bottom: 12px; }
/* market news */
.bt-mkt-lead h3 { margin: 8px 0 6px; font-size: 18px; font-weight: 700; line-height: 1.45; }
.bt-mkt-lead h3 a:hover { color: var(--bt-link); }
.bt-mkt-lead .excerpt { margin: 0; font-size: 13px; line-height: 1.5; color: var(--bt-muted); }
.bt-mkt-rows { margin: 10px 0 0; padding: 0; list-style: none; }
.bt-mkt-rows li { padding: 9px 0; border-top: 1px solid var(--bt-line); font-size: 14px; font-weight: 500; line-height: 1.45; }
.bt-mkt-rows li:last-child { padding-bottom: 0; }
.bt-mkt-rows a:hover { color: var(--bt-link); }
/* market pulse */
.bt-gauge__counts { margin: 4px 0 0; font-size: 13px; font-weight: 500; color: var(--bt-ink); }
.bt-gauge__dot.up { border-color: var(--bt-up); }
.bt-gauge__dot.down { border-color: var(--bt-down); }
.bt-mkt-pulse .bt-segtabs { margin: 14px 0 8px; }
.bt-movers { margin: 0; padding: 0; list-style: none; }
.bt-movers li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--bt-line); font-size: 14px; line-height: 1.3; }
.bt-movers li:last-child { border-bottom: 0; padding-bottom: 0; }
.bt-movers .rk { width: 18px; flex-shrink: 0; font-size: 12px; font-weight: 700; color: var(--bt-muted); }
.bt-movers .nm { flex: 1; min-width: 0; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.bt-movers .px { font-weight: 500; white-space: nowrap; }
.bt-movers__empty { display: block; color: var(--bt-muted); }
/* indices */
.bt-mkt-indices .bt-chiptabs { margin-bottom: 4px; }
.bt-mkt-idx { margin-top: 10px; }
.bt-mkt-idx__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bt-mkt-idx__name { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--bt-muted); }
.bt-mkt-idx__val { margin-top: 2px; font-size: 28px; font-weight: 700; line-height: 1.15; }
.bt-mkt-idx__chg { margin-bottom: 8px; font-size: 14px; }
.bt-mkt-idx .bt-sparkline { height: 90px; }
.bt-mkt-heathead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 8px; }
.bt-mkt-heathead h3 { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--bt-muted); }
.bt-mkt-heattoggle { padding: 2px 0; border: 0; background: none; font: 500 12px/1.3 var(--bt-font); color: var(--bt-link); cursor: pointer; }
.bt-mkt-heattoggle:hover { text-decoration: underline; }
@media (max-width: 1100px) and (min-width: 921px) { .bt-mkt-col { padding: 14px 14px 16px; } }
@media (max-width: 920px) {
  .bt-mkt-overview { grid-template-columns: minmax(0, 1fr); gap: var(--bt-gap); background: none; border: 0; }
  .bt-mkt-col, .bt-mkt-col + .bt-mkt-col { background: var(--bt-surface); border: 1px solid var(--bt-line); }
}

/* Heatmap strength scale, dark theme: bizzpress.css fixes light backgrounds for .p1–.p3 / .n1–.n3 while the
   text token turns near-white, so the cells would be unreadable; deeper tints keep the same 4-step scale.
   (Reported to the lead — belongs next to the light values in bizzpress.css.) */
[data-theme="dark"] .bt-heatmap .p1 { background: #163a24; }
[data-theme="dark"] .bt-heatmap .p2 { background: #1b4d2e; }
[data-theme="dark"] .bt-heatmap .p3 { background: #1f6a3b; color: #fff; }
[data-theme="dark"] .bt-heatmap .n1 { background: #3a1618; }
[data-theme="dark"] .bt-heatmap .n2 { background: #5b2226; }
[data-theme="dark"] .bt-heatmap .n3 { background: #8a2a31; color: #fff; }
/* ---- 3. Index cards (Markets band) -------------------------------------------------------------- */
.bt-mkt-cards .bt-idx-card .chg { display: inline-flex; align-items: center; gap: 4px; }
.bt-idx-card--breadth .bt-idx-card__mid { display: flex; align-items: center; gap: 10px; }
.bt-idx-card--breadth .bt-ic { width: 34px; height: 34px; }
.bt-idx-card--breadth .chg { font-weight: 500; color: var(--bt-muted); }

/* ---- 4. Market Buzz ------------------------------------------------------------------------------ */
.bt-buzz__body { padding: 14px 18px 16px; }
.bt-buzz__desc { margin: 0 0 12px; font-size: 14px; line-height: 1.55; color: var(--bt-muted); }
.bt-buzz__tools { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 12px; }
.bt-buzz__filter { flex: 0 1 260px; min-width: 180px; display: block; }
.bt-buzz__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bt-buzz .bt-table { min-width: 520px; }
.bt-buzz .bt-table td.co .sub { margin-top: 2px; font-weight: 500; color: var(--bt-muted); }
.bt-buzz .bt-table td.num b { font-weight: 600; }
.bt-buzz .bt-table .sub.bt-chg { display: flex; justify-content: flex-end; margin-top: 2px; font-size: 12px; }
.bt-buzz .bt-table .bt-note { text-align: center; }
.bt-buzz__foot { margin: 12px 0 0; line-height: 1.5; }
@media (max-width: 600px) {
  .bt-buzz__body { padding: 12px 14px 14px; }
  .bt-icontabs { gap: 4px 12px; }
  .bt-icontabs button { font-size: 12px; }
  .bt-icontabs button svg { width: 28px; height: 28px; }
  .bt-buzz__filter { flex: 1 1 100%; }
}

/* ---- 5. Sector strip + Sectors widget ------------------------------------------------------------ */
.bt-sector-strip .idx { min-width: 0; }
.bt-sector-strip__pill:empty { display: none; }
.bt-sectors__list { margin: 0; padding: 0; list-style: none; }
.bt-sectors__list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--bt-line); font-size: 14px; line-height: 1.3; }
.bt-sectors__list li:last-child { border-bottom: 0; }
.bt-sectors__list .bt-ic { width: 32px; height: 32px; }
.bt-sectors__list .bt-ic svg { width: 16px; height: 16px; }
.bt-sectors__list .nm { flex: 1; min-width: 0; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.bt-sectors__list .val { font-size: 13px; font-weight: 600; white-space: nowrap; }
.bt-sectors__foot { margin: 10px 0 0; }
