/* MeritX Markets detail pages (Indices / Stocks / ETFs) — TradingView-style:
   sticky left rail of live tiles + section tabs switching the main table.
   Shares --mxc-* theme tokens so light/dark just work. */

/* Highlight colour for section/group/region labels: the exact brand indigo #2708A0
   on light; a legible tint on dark (near-black) so the small labels stay readable.
   (:root is the site's dark default; [data-theme="light"] overrides for light.) */
:root                { --mkt-hl:#4969FF; }   /* dark: bright blue reads on near-black */
[data-theme="light"] { --mkt-hl:#2708A0; }   /* light: brand navy on the light ground */

.mkd-status { display:inline-flex; align-items:center; gap:8px; margin-top:14px;
  font:600 12px/1 var(--font-mono, "JetBrains Mono", monospace); letter-spacing:.02em; color:var(--mxc-text-2); }
.mkd-status__dot { width:8px; height:8px; border-radius:50%; background:var(--mxc-muted); flex:none;
  box-shadow:0 0 0 4px color-mix(in srgb, var(--mxc-muted) 22%, transparent); }
.mkd-status__dot.is-open  { background:var(--mxc-green); box-shadow:0 0 0 4px color-mix(in srgb, var(--mxc-green) 22%, transparent); }
.mkd-status__dot.is-closed{ background:var(--mxc-red);   box-shadow:0 0 0 4px color-mix(in srgb, var(--mxc-red) 22%, transparent); }

/* section tabs */
.mkd-tabs { display:flex; gap:4px; flex-wrap:wrap; margin:22px 0 16px; padding:6px; border-radius:14px;
  background:color-mix(in srgb, var(--mxc-surface) 82%, transparent); border:1px solid var(--mxc-border); }
.mkd-tab { font-size:13px; font-weight:600; color:var(--mxc-text-2); background:none; border:0; cursor:pointer;
  padding:8px 14px; border-radius:9px; white-space:nowrap; transition:background .15s, color .15s; }
.mkd-tab:hover { background:var(--mxc-hover, rgba(120,120,140,.1)); color:var(--mxc-text); }
.mkd-tab.is-on { background:var(--mx-indigo, #33058d); color:#fff; }

/* layout: rail + content */
.mkd-layout { display:grid; grid-template-columns:288px 1fr; gap:20px; align-items:start; }
.mkd-rail { position:sticky; top:78px; display:flex; flex-direction:column; gap:9px; }
.mkd-rail__h { font:700 10px/1 var(--font-mono, monospace); letter-spacing:.16em; text-transform:uppercase; color:var(--mkt-hl, #2708A0); margin:0 2px 2px; }
.mkd-railtile { display:flex; align-items:center; justify-content:space-between; gap:10px; cursor:pointer;
  border:1px solid var(--mxc-border); border-radius:12px; padding:10px 13px; background:var(--mxc-surface);
  transition:border-color .15s, transform .1s; }
.mkd-railtile:hover { border-color:color-mix(in srgb, var(--mx-indigo,#33058d) 45%, var(--mxc-border)); transform:translateX(2px); }
.mkd-railtile__l { min-width:0; }
.mkd-railtile__name { font-size:12.5px; font-weight:700; color:var(--mxc-text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mkd-railtile__val { font:700 13px/1.3 var(--font-mono, monospace); color:var(--mxc-text-2); }
.mkd-railtile__chg { font:700 12px/1 var(--font-mono, monospace); text-align:right; white-space:nowrap; }
.mkd-railtile.is-dim { opacity:.5; }
.mkd-railcta { text-align:center; font-size:12.5px; font-weight:600; color:var(--mx-indigo,#33058d); text-decoration:none;
  border:1px dashed var(--mxc-border); border-radius:12px; padding:10px; margin-top:2px; }
.mkd-railcta:hover { background:var(--mxc-hover, rgba(120,120,140,.07)); }

/* content */
.mkd-content { min-width:0; }
.mkd-secttl { font-size:15px; font-weight:700; color:var(--mxc-text); margin:0 0 3px; }
.mkd-secsub { font-size:12px; color:var(--mxc-muted); margin:0 0 12px; }
.mkd-empty { color:var(--mxc-muted); font-size:13px; padding:22px 4px; }
.mkd-loading { color:var(--mxc-muted); font-size:13px; padding:22px 4px; }

/* group heading inside a section (e.g. sector rows) */
.mkd-grp { font:700 10px/1 var(--font-mono, monospace); letter-spacing:.14em; text-transform:uppercase;
  color:var(--mkt-hl, #2708A0); padding:14px 14px 6px; border-top:1px solid var(--mxc-border); }
.mkd-grp:first-child { border-top:0; padding-top:2px; }

/* table */
.mkd-table td, .mkd-table th { padding:11px 14px; }
.mkd-table tbody tr.is-click { cursor:pointer; }
.mkd-table tbody tr.is-click:hover { background:var(--mxc-hover, rgba(120,120,140,.07)); }
.mkd-tkr { display:flex; align-items:center; gap:9px; }
.mkd-tkr__ava { width:26px; height:26px; border-radius:7px; flex:none; display:flex; align-items:center; justify-content:center;
  font:800 10px/1 var(--font-mono, monospace); background:color-mix(in srgb, var(--mx-indigo,#33058d) 12%, transparent); color:var(--mx-indigo,#33058d); }
.mkd-tkr__sub { font-size:11px; color:var(--mxc-muted); }
.mkd-num { font-family:var(--font-mono, "JetBrains Mono", monospace); font-weight:700; }
.mkd-up { color:var(--mxc-green) !important; } .mkd-down { color:var(--mxc-red) !important; }
.mkd-foot { font-size:11px; color:var(--mxc-muted); margin-top:14px; line-height:1.6; }

@media (max-width: 639px) {
  .mkd-layout { grid-template-columns:1fr; }
  .mkd-rail { position:static; flex-direction:row; overflow-x:auto; padding-bottom:6px; }
  .mkd-rail__h { display:none; }
  .mkd-railtile { min-width:190px; flex:none; }
  .mkd-railcta { min-width:140px; flex:none; display:flex; align-items:center; justify-content:center; }
}
@media (max-width: 639px) { .mkd-hide-sm { display:none; } }

/* ================= Market summary (indices page) ================= */
.mks-card { border:1px solid var(--mxc-border); border-radius:16px; background:var(--mxc-surface); padding:16px 18px; }
.mks-top { display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; margin-bottom:14px; }
.mks-chips { display:flex; flex-wrap:wrap; gap:7px; }
.mks-chip { display:inline-flex; align-items:center; gap:7px; font-size:12.5px; font-weight:600; cursor:pointer;
  border:1px solid var(--mxc-border); background:none; color:var(--mxc-text-2); padding:6px 11px; border-radius:9px; transition:.14s; }
.mks-chip:hover { border-color:var(--c); color:var(--mxc-text); }
.mks-chip__box { width:13px; height:13px; border-radius:4px; border:1.5px solid var(--c); flex:none; position:relative; }
.mks-chip.is-on { color:var(--mxc-text); border-color:var(--c); }
.mks-chip.is-on .mks-chip__box { background:var(--c); }
.mks-chip.is-on .mks-chip__box:after { content:""; position:absolute; left:3px; top:.5px; width:4px; height:7px; border:solid #fff; border-width:0 2px 2px 0; transform:rotate(42deg); }
.mks-rngs { display:inline-flex; gap:2px; padding:3px; border-radius:9px; background:var(--mxc-hover, rgba(120,120,140,.08)); }
.mks-rng { font-size:12px; font-weight:600; color:var(--mxc-text-2); background:none; border:0; cursor:pointer; padding:5px 11px; border-radius:7px; }
.mks-rng.is-on { background:var(--mx-indigo, #33058d); color:#fff; }
.mks-body { display:grid; grid-template-columns:1fr 288px; gap:18px; align-items:stretch; }
.mks-chart { position:relative; min-height:300px; }
.mks-svg { display:block; height:300px; }
/* Phones: the JS shortens every .mks-svg chart to 175px (measured viewBox, no
   distortion). Drop the desktop 300px height reserve so nothing leaves a dead
   gap. mgbTsy/mgbKey carry an inline height in the markup, hence the override. */
@media (max-width: 639px) {
  .mks-chart { min-height:0; }
  #mgbTsy, #mgbKey { height:auto !important; }
}
.mks-grid { stroke:var(--mxc-border); stroke-width:1; }
.mks-zero { stroke:var(--mxc-muted); stroke-width:1; stroke-dasharray:3 3; opacity:.5; }
.mks-axis { fill:var(--mxc-muted); font-size:9px; font-family:var(--font-mono, monospace); }
/* ---------- corp-bond yield scatter (refined) ---------- */
.mcb-svg { display:block; width:100%; height:100%; }
.mcb-dot { fill:var(--mx-indigo, #33058d); fill-opacity:.5; stroke:var(--mx-indigo, #33058d); stroke-width:1.1; cursor:pointer; transition:fill-opacity .12s; }
.mcb-dot:hover { fill-opacity:.95; }
[data-theme="dark"] .mcb-dot { fill:#8d9dff; stroke:#8d9dff; }
.mcb-dot--top { fill:#C9A227; stroke:#a9790a; fill-opacity:.85; }
[data-theme="dark"] .mcb-dot--top { fill:#ffd700; stroke:#C9A227; }
.mcb-lbl { font:600 10.5px/1 var(--font-sans, "Inter", sans-serif); fill:var(--mxc-text-2);
  paint-order:stroke; stroke:var(--mxc-surface); stroke-width:3px; stroke-linejoin:round; }
.mcb-lead { stroke:var(--mxc-muted); stroke-width:1; opacity:.5; }
.mcb-cap { font:700 9px/1 var(--font-mono, monospace); letter-spacing:.12em; text-transform:uppercase; fill:var(--mxc-muted); }
.mcb-grid-v { stroke:var(--mxc-border); stroke-dasharray:2 5; }

.mks-legend { display:flex; flex-wrap:wrap; gap:14px; margin-top:8px; font-size:12px; color:var(--mxc-text-2); }
.mks-leg { display:inline-flex; align-items:center; gap:6px; }
.mks-leg__dot { width:9px; height:9px; border-radius:50%; }
.mks-list { display:flex; flex-direction:column; gap:2px; border-left:1px solid var(--mxc-border); padding-left:16px; }
.mks-row { display:grid; grid-template-columns:12px 1fr auto; grid-template-rows:auto auto; column-gap:8px; align-items:center;
  text-align:left; background:none; border:0; border-bottom:1px solid var(--mxc-border); cursor:pointer; padding:9px 4px; }
.mks-row:last-child { border-bottom:0; }
.mks-row:hover { background:var(--mxc-hover, rgba(120,120,140,.06)); }
.mks-row__dot { grid-row:1/3; width:10px; height:10px; border-radius:50%; }
.mks-row__name { font-size:12.5px; font-weight:700; color:var(--mxc-text); }
.mks-row__val { grid-row:1/3; text-align:right; font:700 13px/1.2 var(--font-mono, monospace); color:var(--mxc-text); }
.mks-row__chg { grid-column:2/3; font:700 11px/1 var(--font-mono, monospace); }
.mks-row.is-on .mks-row__name { color:var(--mx-indigo, #33058d); }

/* top stories */
.mkt-stories { display:grid; grid-template-columns:repeat(auto-fill, minmax(320px, 1fr)); gap:12px; }
.mkt-storycard { border:1px solid var(--mxc-border); border-radius:13px; padding:14px 16px; background:var(--mxc-surface);
  text-decoration:none; display:flex; flex-direction:column; gap:8px; transition:.15s; }
.mkt-storycard:hover { border-color:#C9A227; transform:translateY(-1px); }
/* on card hover the category badge (ECONOMY, STOCKS…) flips to a gold box with black text; reverts on hover-off */
.mkt-storycard:hover .mnw-cat { background:#C9A227; color:#000; }
.mkt-storycard__title { font-size:14px; font-weight:600; line-height:1.42; color:var(--mxc-text); }
.mkt-storycard__meta { display:flex; align-items:center; gap:8px; font-size:11px; color:var(--mxc-muted); }
.mkt-storycard__src { font-weight:700; color:var(--mx-indigo, #33058d); }
/* cards are now buttons that open the in-app reader — strip native button chrome */
button.mkt-storycard { width:100%; text-align:left; font:inherit; cursor:pointer; }

/* in-app article reader — right slide-over. RSS has no full body, so it shows the
   publisher summary + a link out; the publisher opens only via the button, new tab. */
.mnw-reader { position:fixed; inset:0; z-index:200; visibility:hidden; }
.mnw-reader.is-open { visibility:visible; }
.mnw-reader__backdrop { position:absolute; inset:0; background:rgba(8,6,20,.5); opacity:0; transition:opacity .2s ease; }
.mnw-reader.is-open .mnw-reader__backdrop { opacity:1; }
.mnw-reader__panel { position:absolute; top:0; right:0; height:100%; width:min(440px, 92vw);
  background:var(--mxc-surface); border-left:1px solid var(--mxc-border);
  box-shadow:-18px 0 50px rgba(10,8,24,.28); padding:52px 26px 26px; overflow-y:auto;
  transform:translateX(100%); transition:transform .24s ease; }
.mnw-reader.is-open .mnw-reader__panel { transform:none; }
.mnw-reader__x { position:absolute; top:14px; right:16px; font:700 15px/1 Inter, sans-serif;
  color:var(--mxc-muted); background:none; border:0; cursor:pointer; padding:6px; border-radius:8px; }
.mnw-reader__x:hover { color:var(--mxc-text); background:var(--mxc-hover, rgba(120,120,140,.1)); }
.mnw-reader__tags { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:12px; }
.mnw-reader__title { font-size:21px; font-weight:800; line-height:1.32; margin:0 0 10px; color:var(--mxc-text); }
.mnw-reader__meta { font:600 11px/1 var(--font-mono, monospace); color:var(--mxc-muted); margin-bottom:16px; }
.mnw-reader__desc { font-size:14px; line-height:1.7; color:var(--mxc-text-2); margin:0 0 20px; }
.mnw-reader__foot { margin-top:20px; padding-top:14px; border-top:1px solid var(--mxc-border);
  font:600 10px/1 var(--font-mono, monospace); letter-spacing:.08em; text-transform:uppercase; color:var(--mxc-muted); }

/* FAQ */
.mkt-faq { display:flex; flex-direction:column; gap:8px; }
.mkt-faq__item { border:1px solid var(--mxc-border); border-radius:12px; background:var(--mxc-surface); padding:2px 16px; transition:border-color .15s; }
.mkt-faq__item:hover { border-color:#C9A227; }
.mkt-faq__item summary { cursor:pointer; font-size:14px; font-weight:600; color:var(--mxc-text); padding:13px 0; list-style:none; position:relative; }
.mkt-faq__item summary::-webkit-details-marker { display:none; }
.mkt-faq__item summary:after { content:"+"; position:absolute; right:2px; top:11px; font-size:18px; color:var(--mxc-muted); font-weight:400; }
.mkt-faq__item[open] summary:after { content:"–"; }
.mkt-faq__item p { font-size:13px; line-height:1.6; color:var(--mxc-text-2); margin:0 0 13px; padding-right:20px; }

@media (max-width: 639px) { .mks-body { grid-template-columns:1fr; } .mks-list { border-left:0; padding-left:0; border-top:1px solid var(--mxc-border); padding-top:8px; } }

/* ================= Stocks long-scroll page ================= */
.mst-summary { display:grid; grid-template-columns:1.6fr 1fr; gap:16px; align-items:stretch; }
.mst-chart__top { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:8px; }
.mst-chart__name { font-size:14px; font-weight:700; color:var(--mxc-text); }
.mst-chart__tag { font:600 9px/1 var(--font-mono, monospace); letter-spacing:.1em; color:var(--mxc-muted); border:1px solid var(--mxc-border); border-radius:5px; padding:2px 5px; vertical-align:middle; margin-left:4px; }
.mst-chart__val { font:800 22px/1.2 var(--font-mono, monospace); color:var(--mxc-text); letter-spacing:-.4px; margin-top:2px; }
.mst-chart__chg { font-size:13px; font-weight:700; letter-spacing:0; }
.mst-chart__range { font-size:11px; color:var(--mxc-muted); }
.mst-chart__svg { height:230px; }
.mst-sectorperf-h { font:700 10px/1 var(--font-mono, monospace); letter-spacing:.14em; text-transform:uppercase; color:var(--mkt-hl, #2708A0); margin-bottom:10px; }
.mst-sbar { display:grid; grid-template-columns:92px 1fr 56px; align-items:center; gap:9px; padding:5px 0; cursor:pointer; }
.mst-sbar:hover .mst-sbar__name { color:var(--mx-indigo, #33058d); }
.mst-sbar__name { font-size:12px; font-weight:600; color:var(--mxc-text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mst-sbar__track { height:9px; border-radius:3px; background:var(--mxc-hover, rgba(120,120,140,.1)); overflow:hidden; }
.mst-sbar__fill { display:block; height:100%; border-radius:3px; }
.mst-sbar__fill.up { background:var(--mxc-green); } .mst-sbar__fill.dn { background:var(--mxc-red); }
.mst-sbar__val { font:700 11.5px/1 var(--font-mono, monospace); text-align:right; }

.mst-heat td, .mst-heat th { padding:9px 12px; }
.mst-heat th { font:600 10px/1 var(--font-mono, monospace); letter-spacing:.08em; }

.mst-2col { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.mst-colh { font:700 11px/1 var(--font-mono, monospace); letter-spacing:.1em; text-transform:uppercase; padding:13px 14px 4px; color:var(--mkt-hl, #2708A0); }
.mst-colh--up { color:var(--mxc-green); } .mst-colh--dn { color:var(--mxc-red); }

.mst-act { display:inline-block; font:600 10px/1 var(--font-mono, monospace); letter-spacing:.04em; padding:4px 8px; border-radius:6px; }
.mst-act--gold { background:color-mix(in srgb, #d99b00 16%, transparent); color:#a67700; }
.mst-act--navy { background:color-mix(in srgb, var(--mx-indigo,#33058d) 14%, transparent); color:var(--mx-indigo,#33058d); }
.mst-act--green { background:color-mix(in srgb, var(--mxc-green) 16%, transparent); color:var(--mxc-green); }
.mst-act--nu { background:var(--mxc-hover, rgba(120,120,140,.12)); color:var(--mxc-text-2); }

@media (max-width: 639px) { .mst-summary, .mst-2col { grid-template-columns:1fr; } }
/* Gainers/Losers (and the other stacked grids) were clipping off the right of
   the screen: a grid item defaults to min-width:auto, so a card could not
   shrink below its table's ~355px min-content and overflowed the ~319px
   column — the price/%chg columns fell past the viewport edge. min-width:0
   lets the card shrink to the column; .mx-tablewrap's overflow:auto then keeps
   any residual width scrollable inside the card instead of off-screen. */
@media (max-width: 639px) { .mst-summary > *, .mst-2col > *, .mst-3col > * { min-width:0; } }
/* Phone compaction: movers tables get tighter cells so they fit without a
   horizontal scroll, and the sector heatmap comes down a notch as requested. */
@media (max-width: 639px) {
  #mstGainers td, #mstGainers th, #mstLosers td, #mstLosers th { padding:8px 9px; }
  #mstGainers .mkd-tkr, #mstLosers .mkd-tkr { min-width:0; }
  #mstGainers td:first-child, #mstLosers td:first-child { max-width:150px; overflow:hidden; text-overflow:ellipsis; }
  /* table.mst-heat (0,1,2) to beat pages.css `table.mx-table td/th` which
     otherwise pins the padding back to 9px 12px */
  table.mst-heat td, table.mst-heat th { padding:5px 7px; }
  table.mst-heat th { font-size:9px; letter-spacing:.04em; }
  table.mst-heat td { font-size:11px; }
  /* Corporate actions table: tighter cells + a smaller action badge so it reads
     compact instead of running wide off the card. */
  #mstCorp td, #mstCorp th { padding:7px 9px; font-size:11.5px; }
  #mstCorp .mst-act { padding:3px 6px; font-size:9px; }
}

/* ---- 3-col pulse + compact list rows ---- */
.mst-3col { display:grid; grid-template-columns:repeat(3, 1fr); gap:16px; align-items:start; }
@media (max-width: 639px) { .mst-3col { grid-template-columns:1fr; } }
.mst-lrows { display:flex; flex-direction:column; padding:2px 0 8px; }
/* real logos (mx-logos.js kit) on list rows */
.mx-logowrap { position:relative; display:inline-flex; align-items:center; justify-content:center; border-radius:50%; overflow:hidden; background:#fff; border:1px solid var(--mxc-border); flex:0 0 auto; }
.mx-logowrap img { width:76%; height:76%; object-fit:contain; display:block; }
.mx-logowrap .mx-mono { display:none; width:100%!important; height:100%!important; }
.mx-logowrap.is-fail img { display:none; }
.mx-logowrap.is-fail .mx-mono { display:inline-flex; }
.mx-mono { display:inline-flex; align-items:center; justify-content:center; border-radius:50%; background:rgba(85,50,200,.10); color:var(--mxc-text-2); font-weight:800; font-family:"Inter",sans-serif; flex:0 0 auto; }
.mst-lrow { display:flex; align-items:center; gap:10px; width:100%; padding:9px 14px; background:none; border:0; border-top:1px solid var(--mxc-border); cursor:pointer; text-align:left; font:inherit; color:var(--mxc-text); }
.mst-lrow:first-child { border-top:0; }
.mst-lrow:hover { background:var(--mxc-hover, rgba(120,120,140,.06)); }
.mst-lrow__name { flex:1; min-width:0; display:flex; flex-direction:column; gap:1px; }
.mst-lrow__name > span:first-child { font-size:12.5px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mst-lrow__r { display:flex; flex-direction:column; align-items:flex-end; gap:2px; flex:none; }
.mst-lrow__r b { font:700 12px/1 var(--font-mono, monospace); }
.mst-lrow__r > span { font:600 10.5px/1 var(--font-mono, monospace); color:var(--mxc-muted); }

/* ---- ETF largest bar chart ---- */
.met-bars { display:flex; align-items:flex-end; gap:26px; height:250px; padding:14px 18px 4px; }
.met-bar { flex:1; display:flex; flex-direction:column; align-items:center; gap:8px; height:100%; justify-content:flex-end; cursor:pointer; background:none; border:0; font:inherit; color:var(--mxc-text); }
.met-bar__fill { width:100%; max-width:86px; background:color-mix(in srgb, var(--mx-indigo, #33058d) 78%, transparent); border-radius:8px 8px 0 0; transition:background .15s; }
.met-bar:hover .met-bar__fill { background:var(--mx-indigo, #33058d); }
.met-bar__v { font:700 11px/1 var(--font-mono, monospace); color:var(--mxc-text-2); }
.met-bar__s { font:700 11.5px/1 Inter, sans-serif; padding-bottom:8px; }
/* PHONES — Largest-ETFs turnover bars. 6 flex:1 bars with a 26px gap and default
   min-width:auto could not shrink below their longest ticker ("SILVERBEES"), so
   the row overflowed and the last bar was clipped off-screen. Shrink the gap,
   let each bar go below content width (min-width:0) so flex:1 splits evenly, and
   drop the label/value type. Must sit AFTER the base rules above — a media query
   adds no specificity, so an earlier @media block would lose the source-order
   tie to `.met-bars`/`.met-bar__s` here. Desktop keeps the roomy 26px layout. */
@media (max-width: 639px) {
  .met-bars { gap:8px; height:200px; padding:12px 10px 6px; }
  .met-bar { min-width:0; }
  .met-bar__fill { max-width:52px; }
  .met-bar__v, .met-bar__s { font-size:9px; }
  .met-bar__s { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
}

/* ---- earnings calendar cards ---- */
.mse-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(230px, 1fr)); gap:14px; }
.mse-card { display:flex; flex-direction:column; align-items:flex-start; gap:6px; padding:15px 16px; background:var(--mxc-surface); border:1px solid var(--mxc-border); border-radius:14px; cursor:pointer; text-align:left; font:inherit; transition:border-color .15s, transform .15s; }
.mse-card:hover { border-color:var(--mx-indigo, #33058d); transform:translateY(-1px); }
.mse-card__chip { font:700 10px/1 var(--font-mono, monospace); letter-spacing:.08em; text-transform:uppercase; color:var(--mxc-text-2); background:var(--mxc-hover, rgba(120,120,140,.1)); border-radius:6px; padding:5px 8px; }
.mse-card__chip.is-hot { color:#fff; background:var(--mx-indigo, #33058d); }
.mse-card__chip.is-soon { color:var(--mx-indigo, #33058d); background:color-mix(in srgb, var(--mx-indigo,#33058d) 12%, transparent); }
.mse-card__name { font-size:13px; font-weight:700; color:var(--mxc-text); }
.mse-card__eps { display:flex; gap:16px; margin-top:4px; }
.mse-card__eps > span { display:flex; flex-direction:column; gap:3px; font:600 9.5px/1 var(--font-mono, monospace); letter-spacing:.08em; text-transform:uppercase; color:var(--mxc-muted); }
.mse-card__eps b { font:700 13px/1 var(--font-mono, monospace); color:var(--mxc-text); letter-spacing:0; }

/* ================= ETFs long-scroll (by asset class) ================= */
/* CSS columns (masonry) — cards pack tight, no tall-neighbour gaps */
.met-catgrid { columns:2; column-gap:16px; }
.met-catcard { break-inside:avoid; margin-bottom:16px; }
@media (max-width: 639px) { .met-catgrid { columns:1; } }

/* ================= World / Countries pages ================= */
.mco-flag { display:inline-flex; align-items:center; justify-content:center; min-width:26px; padding:3px 6px; margin-right:9px; background:#C9A227; color:#000; font-size:12px; font-weight:700; line-height:1; letter-spacing:.03em; border-radius:4px; vertical-align:middle; }

/* ---- overlay "+ Add index" ---- */
.mks-card { position:relative; }
.mks-chip--add { color:var(--mx-indigo, #33058d); border:1px dashed color-mix(in srgb, var(--mx-indigo, #33058d) 45%, var(--mxc-border)); font-weight:700; }
.mks-chip--add:hover { border-style:solid; }
.mws-menu { position:absolute; z-index:50; max-height:340px; overflow-y:auto; min-width:290px; background:var(--mxc-surface); border:1px solid var(--mxc-border); border-radius:12px; padding:6px; box-shadow:0 18px 50px rgba(10,8,24,.28); }
.mws-menu[hidden] { display:none; }
.mws-menu__lbl { font:700 9.5px/1 var(--font-mono, monospace); letter-spacing:.12em; text-transform:uppercase; color:var(--mxc-muted); padding:8px 10px 5px; }
.mws-menu button { display:block; width:100%; text-align:left; font:600 12.5px/1.3 Inter, sans-serif; color:var(--mxc-text); background:none; border:0; border-radius:8px; padding:8px 10px; cursor:pointer; }
.mws-menu button:hover { background:var(--mxc-hover, rgba(120,120,140,.08)); color:var(--mx-indigo, #33058d); }

/* ---- country search bar ---- */
.mco-search { position:relative; display:flex; align-items:center; gap:10px; margin-top:16px; max-width:520px; height:46px; padding:0 14px; background:var(--mxc-surface); border:1px solid var(--mxc-border); border-radius:13px; transition:border-color .15s, box-shadow .15s; }
.mco-search:focus-within { border-color:var(--mx-indigo, #33058d); box-shadow:0 0 0 3px color-mix(in srgb, var(--mx-indigo, #33058d) 18%, transparent); }
.mco-search__icon { width:17px; height:17px; color:var(--mxc-muted); flex:none; }
.mco-search input { flex:1; min-width:0; height:100%; font:500 14px/1.2 Inter, sans-serif; color:var(--mxc-text); background:none; border:0; outline:none; }
.mco-search input::placeholder { color:var(--mxc-muted); }
.mco-search input::-webkit-search-cancel-button { display:none; }
.mco-search__clr { flex:none; width:28px; height:28px; display:flex; align-items:center; justify-content:center; font:700 12px/1 Inter, sans-serif; color:var(--mxc-muted); background:var(--mxc-hover, rgba(120,120,140,.12)); border:0; border-radius:8px; cursor:pointer; transition:color .15s; }
.mco-search__clr:hover { color:var(--mxc-text); }
.mco-search__n { flex:none; font:700 10.5px/1 var(--font-mono, monospace); letter-spacing:.06em; color:var(--mx-indigo, #33058d); white-space:nowrap; }

/* ================= Per-country page ================= */
.mcp-title { display:flex; align-items:center; gap:14px; }
.mcp-flag { font-size:40px; line-height:1; }
.mcp-pick { font-weight:700; font-size:30px; line-height:1; color:var(--mxc-muted); background:var(--mxc-hover, rgba(120,120,140,.1)); border:1px solid var(--mxc-border); border-radius:12px; padding:4px 18px; cursor:pointer; transition:color .15s, border-color .15s; }
.mcp-pick:hover { color:var(--mx-indigo, #33058d); border-color:var(--mx-indigo, #33058d); }

/* full-bleed hero glow: hug the extreme top-right corner of the page instead of being
   clipped to the centred .mx-wrap (which left a pale-purple margin short of the edge) */
.mcp-page .mx-hero { background:none; }
[data-theme="light"] .mcp-page main.mx-main {
  background:radial-gradient(1100px 620px at 100% 0, color-mix(in srgb, var(--mx-indigo) 14%, transparent) 0%, transparent 62%);
  background-repeat:no-repeat; }
[data-theme="dark"] .mcp-page main.mx-main {
  background:radial-gradient(1100px 620px at 100% 0, color-mix(in srgb, #4969ff 20%, transparent) 0%, transparent 62%);
  background-repeat:no-repeat; }
.mcp-cards { display:grid; grid-template-columns:repeat(auto-fill, minmax(200px, 1fr)); gap:14px; }
.mcp-card { display:flex; flex-direction:column; align-items:flex-start; gap:5px; padding:15px 16px; background:var(--mxc-surface); border:1px solid var(--mxc-border); border-radius:14px; cursor:pointer; text-align:left; font:inherit; transition:border-color .15s, transform .15s; }
.mcp-card:hover { border-color:var(--mx-indigo, #33058d); transform:translateY(-1px); }
.mcp-card__name { font-size:12.5px; font-weight:700; color:var(--mkt-hl, #2708A0); }
.mcp-card__val { font:800 21px/1.1 var(--font-mono, monospace); color:var(--mxc-text); letter-spacing:-.4px; }
.mcp-card__chg { font:700 12px/1 var(--font-mono, monospace); }
.mcp-perf { display:grid; grid-template-columns:repeat(7, 1fr); gap:8px; margin-top:14px; padding-top:13px; border-top:1px solid var(--mxc-border); }
.mcp-perf__cell { display:flex; flex-direction:column; gap:4px; align-items:center; }
.mcp-perf__lbl { font:600 9.5px/1 var(--font-mono, monospace); letter-spacing:.1em; text-transform:uppercase; color:var(--mxc-muted); }
.mcp-perf__val { font:700 13px/1 var(--font-mono, monospace); }
.mcp-explore { display:flex; gap:12px; flex-wrap:wrap; }
.mcp-explore__lnk { font-size:13px; font-weight:700; color:var(--mx-indigo, #33058d); text-decoration:none; border:1px solid var(--mxc-border); border-radius:10px; padding:10px 16px; transition:border-color .15s; }
.mcp-explore__lnk:hover { border-color:var(--mx-indigo, #33058d); }
@media (max-width: 639px) { .mcp-perf { grid-template-columns:repeat(4, 1fr); } .mcp-flag { font-size:30px; } }

/* ---- select-country modal ---- */
.mcs-overlay { position:fixed; inset:0; z-index:220; background:rgba(10,8,24,.45); backdrop-filter:blur(3px); display:flex; align-items:flex-start; justify-content:center; padding:9vh 16px 16px; }
.mcs-overlay[hidden] { display:none; }  /* author display:flex would otherwise beat the hidden attribute */
.mcs-dialog { width:min(680px, 100%); max-height:78vh; overflow:auto; background:var(--mxc-bg, #fff); border:1px solid var(--mxc-border); border-radius:16px; padding:18px 20px 20px; box-shadow:0 24px 70px rgba(10,8,24,.35); }
.mcs-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.mcs-title { font-size:19px; font-weight:800; color:var(--mxc-text); }
.mcs-close { font:600 14px/1 inherit; color:var(--mxc-muted); background:none; border:0; cursor:pointer; padding:6px; border-radius:8px; }
.mcs-close:hover { color:var(--mxc-text); background:var(--mxc-hover, rgba(120,120,140,.1)); }
.mcs-search { width:100%; font:500 14px/1.2 inherit; color:var(--mxc-text); background:var(--mxc-hover, rgba(120,120,140,.07)); border:1px solid var(--mxc-border); border-radius:10px; padding:10px 13px; margin-bottom:6px; outline:none; }
.mcs-search:focus { border-color:var(--mx-indigo, #33058d); }
.mcs-world { display:flex; align-items:center; gap:9px; font-size:14px; font-weight:700; color:var(--mxc-text); text-decoration:none; padding:11px 10px; border-radius:10px; margin-top:6px; }
.mcs-world:hover { background:var(--mxc-hover, rgba(120,120,140,.08)); }
.mcs-region { font:700 10px/1 var(--font-mono, monospace); letter-spacing:.14em; text-transform:uppercase; color:var(--mkt-hl, #2708A0); padding:14px 10px 6px; }
.mcs-grid { display:grid; grid-template-columns:1fr 1fr; }
.mcs-item { display:flex; align-items:center; font-size:14px; font-weight:600; color:var(--mxc-text); text-decoration:none; padding:10px; border-radius:10px; }
.mcs-item:hover { background:var(--mxc-hover, rgba(120,120,140,.08)); }
.mcs-item.is-current { color:var(--mx-indigo, #33058d); }
@media (max-width: 639px) { .mcs-grid { grid-template-columns:1fr; } }

/* ================= News hub ================= */
.mnw-tabs { display:flex; gap:2px; flex-wrap:wrap; border-bottom:1px solid var(--mxc-border); margin-bottom:14px; }
.mnw-tab { font-size:14px; font-weight:600; color:var(--mxc-muted); background:none; border:0; border-bottom:2px solid transparent; cursor:pointer; padding:10px 14px; margin-bottom:-1px; }
.mnw-tab:hover { color:var(--mxc-text); }
.mnw-tab.is-on { color:var(--mx-indigo, #33058d); border-bottom-color:var(--mx-indigo, #33058d); }
.mnw-subs { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:18px; }
.mnw-subs:empty { display:none; }
.mnw-sub { font-size:12.5px; font-weight:600; color:var(--mxc-text-2); background:var(--mxc-hover, rgba(120,120,140,.08)); border:1px solid transparent; cursor:pointer; padding:6px 13px; border-radius:20px; }
.mnw-sub:hover { color:var(--mxc-text); }
.mnw-sub.is-on { background:var(--mx-indigo, #33058d); color:#fff; }
.mnw-cat { display:inline-block; font:600 9px/1 var(--font-mono, monospace); letter-spacing:.1em; text-transform:uppercase;
  color:#fff; background:#2708A0; border-radius:5px; padding:3px 6px; align-self:flex-start;
  transition:background-color .15s, color .15s; }
/* news category badge: navy -> electric blue in DARK mode only (light keeps #2708A0);
   the gold card-hover state is preserved (higher-specificity rule below). */
[data-theme="dark"] .mnw-cat{ background:#4969FF; }
[data-theme="dark"] .mkt-storycard:hover .mnw-cat{ background:#C9A227; }

/* ---------- two compact sections side by side (Currencies + Largest companies) ----------
   they don't need full width, so pair them into two half-width columns to cut wasted space.
   Stacks back to one column on narrower screens. */
.mx-two-col { display:grid; grid-template-columns:1fr 1fr; gap:34px 28px; align-items:start; margin-top:34px; }
.mx-two-col > .mx-sec { margin-top:0; min-width:0; }   /* min-width:0 lets the tables shrink cleanly */
@media (max-width: 639px){ .mx-two-col { grid-template-columns:1fr; } }


/* =========================================================================
   PHONES — one index per line in the overlay list (.mks-row)
   The desktop grid's auto-placement had gone wrong: .mks-row__dot and
   .mks-row__val both set grid-row:1/3 with no column, so the definite-row
   placement pass handed column 2 to the value, pushed the name out to
   column 3, and left .mks-row__chg no room in column 2 — it dropped into an
   implicit THIRD row (rows computed as 15.2px / 0.4px / 11px). The swatch
   therefore sat on a different line from its own numbers.
   Place all four explicitly on a single row instead. Phone-only: desktop
   keeps the two-line stack it renders today.
   ========================================================================= */
@media (max-width: 639px) {
  .mks-row { grid-template-columns:10px minmax(0,1fr) auto auto; grid-template-rows:auto; column-gap:7px; }
  .mks-row__dot  { grid-area:1 / 1; }
  /* min-width:0 + ellipsis so a long added index shortens instead of overflowing */
  .mks-row__name { grid-area:1 / 2; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .mks-row__val  { grid-area:1 / 3; }
  .mks-row__chg  { grid-area:1 / 4; text-align:right; min-width:46px; }
}

/* =========================================================================
   PHONES — per-country "Major indices" cards two-up
   .mcp-cards was repeat(auto-fill, minmax(200px, 1fr)); two 200px columns need
   more than a phone's ~319px, so it collapsed to one full-width card per row
   and each left ~210px of empty space on its right. Force two columns and bring
   the internals down to the markets-hub index-tile sizes (.mkt-tile) so the two
   pages read consistently. Most countries carry a single index — that lone card
   spans both columns so it stays full-width instead of a stranded half.
   ========================================================================= */
@media (max-width: 639px) {
  .mcp-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .mcp-card { padding: 11px 12px; gap: 4px; border-radius: 12px; }
  .mcp-card:only-child { grid-column: 1 / -1; }
  .mcp-card__name { font-size: 11.5px; }
  .mcp-card__val { font-size: 17px; }
  .mcp-card__chg { font-size: 10.5px; }
}

/* =========================================================================
   Global inflation map — expand button + full-screen pan/zoom viewer
   (markets-economy.js). The inline map keeps its size; tapping it (or the
   corner button) opens a full-screen clone you can drag/scroll around and
   zoom with the +/- controls.
   ========================================================================= */
#ecoMap { position: relative; }
.ecomap-expand {
  position: absolute; top: 8px; right: 8px; z-index: 5;
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--mxc-text-2); background: color-mix(in srgb, var(--mxc-surface) 88%, transparent);
  border: 1px solid var(--mxc-border); border-radius: 9px; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.12); transition: color .15s, border-color .15s;
}
.ecomap-expand:hover { color: var(--mxc-text); border-color: var(--mx-indigo, #33058d); }

html.ecomap-locked { overflow: hidden; }
.ecomap-full { position: fixed; inset: 0; z-index: 6000; display: flex; flex-direction: column;
  background: var(--mxc-bg, #0b0c10); }
[data-theme="light"] .ecomap-full { background: #eef0f4; }
/* grid place-items:center keeps the map centred yet still scrollable in BOTH
   directions once zoomed past the viewport (flex centering would clip the
   overflow on the near side). */
.ecomap-full__scroll {
  flex: 1 1 auto; min-height: 0; overflow: auto; display: grid; place-items: center;
  cursor: grab; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.ecomap-full__inner { width: 100%; }                 /* JS sets width% for zoom */
.ecomap-full__inner svg { display: block; width: 100%; height: auto; }

.ecomap-full__bar {
  position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 6010;
  display: inline-flex; align-items: center; gap: 2px; padding: 5px;
  background: var(--mxc-surface); border: 1px solid var(--mxc-border); border-radius: 13px;
  box-shadow: 0 12px 32px rgba(0,0,0,.3);
}
.ecomap-full__btn {
  width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
  font: 700 22px/1 Inter, sans-serif; color: var(--mxc-text); background: none; border: 0; border-radius: 10px; cursor: pointer;
}
.ecomap-full__btn:hover { background: var(--mxc-hover, rgba(120,120,140,.12)); }
.ecomap-full__z { min-width: 52px; text-align: center; font: 700 12px/1 "JetBrains Mono", monospace; color: var(--mxc-text-2); }
.ecomap-full__x {
  position: fixed; top: 14px; right: 14px; z-index: 6010;
  width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
  font: 700 16px/1 Inter, sans-serif; color: var(--mxc-text); background: var(--mxc-surface);
  border: 1px solid var(--mxc-border); border-radius: 11px; cursor: pointer;
}
.ecomap-full__x:hover { color: var(--mxc-red, #f4564f); border-color: var(--mxc-red, #f4564f); }
.ecomap-full__hint {
  position: fixed; top: 16px; left: 16px; z-index: 6010; pointer-events: none;
  font: 600 11.5px/1.3 Inter, sans-serif; color: var(--mxc-muted);
  background: color-mix(in srgb, var(--mxc-surface) 82%, transparent); padding: 6px 10px; border-radius: 8px;
}
.ecomap-full__tip {
  position: fixed; display: none; pointer-events: none; z-index: 6020;
  background: var(--mxc-surface); border: 1px solid var(--mxc-border); border-radius: 9px; padding: 8px 11px;
  box-shadow: 0 10px 28px rgba(0,0,0,.22); font: 600 12px/1.35 Inter, sans-serif; color: var(--mxc-text); white-space: nowrap;
}
@media (max-width: 639px) { .ecomap-full__hint { display: none; } }
/* in-app full-article reader body (fetched via /api/article) */
.nfr-p { margin: 0 0 12px; font-size: 14.5px; line-height: 1.72; color: var(--mxc-text, #dfe3ea); }
.nfr-p:last-of-type { margin-bottom: 6px; }
.nfr-orig { display: inline-block; margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--mxc-accent, #7aa6ff); text-decoration: none; }
.nfr-orig:hover { text-decoration: underline; }
.nfr-note { margin-top: 10px; font-size: 12.5px; line-height: 1.55; color: var(--mxc-muted, #8a8a9a); }
.nfr-note a { color: var(--mxc-accent, #7aa6ff); font-weight: 600; }
