:root {
  --navy: #0e2a4d;
  --navy2: #16406e;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1a2433;
  --muted: #64748b;
  --line: #e2e8f0;
  --green: #0f9d58;
  --red: #d93025;
  --gold: #c9a227;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 42, 77, .08), 0 4px 14px rgba(16, 42, 77, .05);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.55;
}
a { color: var(--navy2); }

/* ---------- status banner ---------- */
.beta-tag {
  align-self: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(201, 162, 39, .55);
  border-radius: 5px;
  padding: 1px 6px;
  margin-left: -16px;
}

/* ---------- header / nav ---------- */
.site-header {
  background: linear-gradient(120deg, var(--navy) 0%, var(--navy2) 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(14, 42, 77, .35);
}
/* landscape phones are very short (~390px tall). Two goals: (1) let the pinned
   header scroll away so it doesn't eat a third of the screen forever, and (2)
   drop the low-value top matter — the redundant page title (the header already
   says NANOCAP 100) and the boilerplate description — so the actual index level
   and movers are the first things you see, no scroll. */
@media (max-height: 500px) {
  .site-header { position: static; }
  .split-left h1 { display: none; }
  .split-left .subtitle { display: none; }
}
.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 52px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: baseline; gap: 7px; text-decoration: none; }
.brand .b1 { font-size: 21px; font-weight: 700; letter-spacing: 2.5px; color: #fff; }
.brand .b2 { font-size: 21px; font-weight: 700; color: var(--gold); letter-spacing: 1px; }
.brand .b3 { font-size: 11px; color: #b9c8dd; letter-spacing: 3px; margin-left: 4px; }
nav.main-nav { display: flex; gap: 4px; flex: 1; }
nav.main-nav a {
  color: #d7e2f0;
  text-decoration: none;
  padding: 14px 13px;
  font-size: 14.5px;
  font-weight: 600;
  border-bottom: 3px solid transparent;
}
nav.main-nav a:hover { color: #fff; }
nav.main-nav a.active { color: #fff; border-bottom-color: var(--gold); }
.header-quote { text-align: right; font-variant-numeric: tabular-nums; line-height: 1.25; }
.live-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #2ecc71;
  margin-right: 6px;
  vertical-align: 2px;
  animation: livepulse 2s infinite;
}
@keyframes livepulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.header-quote .hq-level { font-size: 17px; font-weight: 700; }
.header-quote .hq-chg { font-size: 12.5px; font-weight: 600; }

/* ---------- layout ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 18px 20px 36px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 17px 24px;
  margin-bottom: 16px;
}
h1 { font-size: 26px; margin: 0 0 6px; }
h2 { font-size: 19px; margin: 0 0 10px; }
.subtitle { color: var(--muted); margin: 0 0 12px; max-width: 760px; }
.up { color: var(--green); }
.down { color: var(--red); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- hero quote ---------- */
/* level + day-change on line 1, the "quotes as of" line always on its own row
   (flex-basis:100%). Keeping the timestamp on a fixed second line makes the
   hero the SAME height in the loading ("…") and loaded (full number + long
   "Live · quotes as of …") states, so the box never grows/jumps when the quote
   arrives — the timestamp used to fit inline on wide screens but wrap to a new
   line on narrower ones, enlarging the box a second after load. */
.hero { display: flex; column-gap: 24px; row-gap: 3px; align-items: flex-end; flex-wrap: wrap; }
.hero-level { font-size: 44px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.hero-chg { font-size: 19px; font-weight: 700; padding-bottom: 4px; }
.asof { color: var(--muted); font-size: 12.5px; flex-basis: 100%; padding-bottom: 0; }
.stat-row { display: flex; gap: 8px; flex-wrap: nowrap; margin-top: 10px; }
/* on phones the stats are relocated below the chart (direct grid child) — the
   grid gap already separates them, so drop the extra top margin */
.home-split > #stat-row { margin-top: 0; }
.stat {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  flex: 1 1 0;
  min-width: 0;
}
.stat .lbl {
  font-size: 10px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stat .val { font-size: 15.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 820px) {
  /* keep all five stat boxes on ONE line on phones — compact them instead of
     wrapping to 3+2 */
  .stat-row { flex-wrap: nowrap; gap: 6px; }
  .stat { flex: 1 1 0; padding: 5px 4px; }
  .stat .lbl { font-size: 9px; letter-spacing: 0; }
  .stat .val { font-size: 12.5px; }
}

/* ---------- tables ---------- */
table.data { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.data th {
  text-align: right;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  border-bottom: 2px solid var(--line);
  padding: 8px 10px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
table.data th:first-child, table.data td:first-child { text-align: left; }
.th-sm { display: none; }   /* short column headers, shown only on phones */
table.data td { padding: 7px 10px; border-bottom: 1px solid #eef2f6; text-align: right; }
table.data tbody tr:hover { background: #f2f6fb; }
table.data td.tick { font-weight: 700; color: var(--navy2); }
th.sorted-asc::after { content: " \25B4"; }
th.sorted-desc::after { content: " \25BE"; }

/* copy protection on the constituents table */
.nocopy, .nocopy * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
/* keep the constituents table inside the card and let it scroll horizontally
   (like the History tables) instead of spilling past the right edge on phones */
#cons-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table-tools { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.table-tools input[type="search"] {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 14px;
  width: 210px;
}

/* ---------- extended hours ---------- */
.ext-line {
  display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap;
  margin: 10px 0 2px; font-variant-numeric: tabular-nums;
  /* reserve the filled (up to 2-line) height at ALL widths so the "updating…"
     placeholder and the loaded data occupy the same space — otherwise the box
     grows a second after load during pre/post (only mobile reserved it before).
     Harmless when hidden (display:none during regular hours) and centers a
     single line on wide screens. */
  min-height: 62px; align-content: center;
}
.ext-tag {
  font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: #6b5900; background: #fff3cf; border: 1px solid #eadb9e;
  border-radius: 5px; padding: 2px 8px;
}
.ext-lvl { font-size: 21px; font-weight: 700; }
.ext-pct { font-size: 15px; font-weight: 700; }
.ext-movers { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.ext-mover {
  display: flex; align-items: baseline; gap: 8px;
  border: 1px solid var(--line); border-radius: 7px; padding: 7px 11px;
  font-variant-numeric: tabular-nums;
}
.ext-mover .em-tick { font-weight: 700; color: var(--navy2); min-width: 46px; }
.ext-mover .em-pct { font-weight: 700; margin-left: auto; }
.ext-mover.sharp { border-color: var(--gold); border-left: 3px solid var(--gold); background: #fffdf3; }
/* thin = low $ traded; de-emphasise so a big % on tiny volume reads as "unconfirmed" */
.ext-mover.thin { opacity: .56; }

/* ---------- home split: table left, intraday chart right ---------- */
.home-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
}
.split-right { display: flex; flex-direction: column; }
.split-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.split-head .chip-row .chip { padding: 3px 10px; font-size: 12px; }
.cons-scroll {
  max-height: 430px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  scrollbar-gutter: stable;
}
.cons-scroll table.data th,
.cons-scroll table.data td { padding-left: 8px; padding-right: 8px; }
.cons-scroll table.data thead th {
  position: sticky;
  top: 0;
  background: #fff;
  box-shadow: inset 0 -2px 0 var(--line);
  z-index: 1;
}
.split-right .chart-box.split-chart { flex: 1; min-height: 220px; }
.split-left h1 { font-size: 23px; margin-bottom: 4px; }
.split-left .subtitle { font-size: 13.5px; margin: 0 0 12px; }
@media (max-width: 820px) {
  /* minmax(0,1fr) not bare 1fr: the implicit min-width:auto on a 1fr track lets
     the chart canvas keep a stale (landscape) width after a rotate and force the
     column wider than the screen — the "half screen / chart split by a line" bug */
  .home-split { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .split-right .chart-box.split-chart { height: 205px; flex: none; }
  /* Keep the range chips (1D/1M/6M/1Y) on their own line from first paint.
     The chart title starts short ("Intraday") and grows once the live date
     loads ("Intraday — Jul 8, 2026, updates live"); with the chips sharing the
     title's line they'd jump from the right to a wrapped second line. Forcing a
     full-width basis pins them below the title (left) so they never move. */
  .split-head { row-gap: 4px; }
  .split-head #chart-range { flex-basis: 100%; }
}

/* movers card is relocated under the pre/post quote line on phones — both
   portrait (narrow) and landscape (short) — see index.html. Restyle it as a
   compact inset block, not a card-in-card. */
@media (max-width: 820px), (max-height: 500px) {
  .split-left #ext-movers-card {
    margin: 0 0 14px;
    padding: 10px 12px;
    box-shadow: none;
  }
  .split-left #ext-movers-card h2 { font-size: 15px; margin: 0 0 8px; }
  .split-left #ext-movers-card #ext-movers-sub { display: none; }  /* threshold note: desktop only */
  .split-left #ext-movers-card .ext-mover { padding: 5px 9px; }
}

/* ---------- chart controls ---------- */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
}
.chip.on { color: #fff; border-color: transparent; }
/* active range / year buttons are near-black so they stay distinct from the
   navy Nanocap 100 line + series chip */
.chip.range.on, .chip.yr.on { background: #1e2530; }
.chip .s-short { display: none; }   /* full series names on desktop; ticker-only on phone */

/* Charts page compaction — applies to a phone in portrait (narrow) AND to any
   short viewport (landscape phone). Short description (≤2 lines), ticker-only
   series chips, tighter chip rows; the chart itself is height-fitted to the
   viewport in charts.html so the chart + its legend fit without scrolling. */
@media (max-width: 640px), (max-height: 520px) {
  #cmp-sub {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; margin-bottom: 8px;
  }
  #series-row .s-full { display: none; }
  #series-row .s-short { display: inline; }
  #range-row, #series-row { gap: 6px; margin-bottom: 8px; }
  #range-row .chip, #series-row .chip { padding: 4px 10px; font-size: 12.5px; }
}
/* Landscape phones are very short — drop the page title and description entirely,
   and slim the header to a single compact row (it otherwise wraps to ~116px and
   eats a third of the screen), so the chart + legend get the height. */
@media (max-height: 520px) {
  .wrap > .card > h1 { display: none; }
  #cmp-sub { display: none; }
  .site-header { position: static; }
  .header-inner { flex-wrap: nowrap; min-height: 0; padding: 3px 12px; gap: 14px; }
  .header-quote { display: none; }
  nav.main-nav { flex-wrap: nowrap; flex: 1; }
  nav.main-nav a { padding: 7px 9px; }
  .brand .b3 { display: none; }
}
.chart-box { position: relative; height: 430px; }
.chart-box.short { height: 300px; }

/* ---------- racing ---------- */
.race-row { display: grid; grid-template-columns: 44px 74px 1fr 86px; gap: 10px; align-items: center; padding: 7px 0; }
.race-pos { font-weight: 700; color: var(--muted); font-size: 15px; text-align: center; }
.race-pos.p1 { color: var(--gold); font-size: 19px; }
.race-pos.p2 { color: #8c9bb0; font-size: 17px; }
.race-pos.p3 { color: #b0782f; font-size: 16px; }
.race-tick { font-weight: 700; color: var(--navy2); }
.race-track { background: #eef2f7; border-radius: 6px; height: 22px; overflow: hidden; }
.race-bar { height: 100%; border-radius: 6px; width: 0; transition: width 1.1s cubic-bezier(.2,.7,.3,1); }
.race-bar.gain { background: linear-gradient(90deg, #17b866, #0f9d58); }
.race-bar.loss { background: linear-gradient(90deg, #f26b5e, #d93025); }
.race-val { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- YTD bar-chart race ---------- */
.race-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.race-date {
  font-size: 24px; font-weight: 800; color: var(--navy);
  font-variant-numeric: tabular-nums; letter-spacing: .3px; white-space: nowrap;
  margin: 0 0 8px;   /* sits directly above the chart it labels */
}
.race-chart { position: relative; overflow: hidden; }
.rbar {
  position: absolute; left: 0; right: 0; height: 26px; display: flex; align-items: center; gap: 7px;
  transition: top .5s cubic-bezier(.35, 0, .25, 1), opacity .35s;
  font-variant-numeric: tabular-nums;
}
.rbar-rank { width: 22px; text-align: right; color: var(--muted); font-size: 12px; flex: none; }
.rbar-tick { width: 56px; font-weight: 700; color: var(--navy2); font-size: 15.5px; white-space: nowrap; flex: none; }
/* the value: the primary thing to read — big, bold, colored, right after the
   ticker and in a fixed-width column so it stays vertically aligned row-to-row */
.rbar-val {
  flex: none; width: 68px; text-align: right; font-weight: 800; font-size: 17px;
  white-space: nowrap; font-variant-numeric: tabular-nums; margin-right: 4px;
}
.rbar-val.up { color: var(--green); }
.rbar-val.down { color: var(--red); }
.rbar-barwrap { position: relative; flex: 1; height: 100%; min-width: 0; }
.rbar-fill {
  position: absolute; left: 0; top: 4px; bottom: 4px; min-width: 2px; border-radius: 0 5px 5px 0;
  opacity: .88; transition: background .3s;
}
.rbar-fill.up { background: linear-gradient(90deg, #2bbf74, #0f9d58); }
.rbar-fill.down { background: linear-gradient(90deg, #f2994a, #d93025); }
.race-controls { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.race-controls input[type=range] { flex: 1; accent-color: var(--navy2); }
#race-play { min-width: 84px; text-align: center; }
.race-years { margin-bottom: 12px; }
@media (max-width: 640px) {
  .race-date { font-size: 19px; }
  .rbar-tick { width: 48px; font-size: 14px; }
  .rbar-val { font-size: 15px; width: 56px; }
  /* the whole race + its play/scrub line should fit one portrait screen. Show
     ALL the years (wrap to a second line if they don't fit one) rather than
     scrolling them off-screen — the chart auto-sizes to absorb the extra row. */
  .race-years { flex-wrap: wrap; gap: 6px; margin-bottom: 8px !important; }
  .race-years .chip { padding: 4px 10px; font-size: 12.5px; }
  .race-card { padding-top: 10px; padding-bottom: 12px; }
  .race-card .race-head { margin-bottom: 6px; }
  .race-card .subtitle { font-size: 13px; }
  .race-controls { margin-top: 10px; }
}

/* ---------- daily closes month blocks ---------- */
.month-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
  align-items: start;
}
.month-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fdfefe;
}
.month-title {
  background: var(--navy2);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-align: center;
  padding: 6px 4px;
}
.month-block table.data { font-size: 13px; }
.month-block table.data th { cursor: default; padding: 5px 8px; }
.month-block table.data td { padding: 3.5px 8px; }

/* PC: show 5 months per row so the daily-closes grid fills the full width like
   the two summary tables above. Compact the cells (and shrink CHG a touch) so
   the 2-decimal Close never gets clipped in the narrower 5-wide blocks. */
@media (min-width: 900px) {
  .month-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
  .month-block table.data th,
  .month-block table.data td { padding-left: 5px; padding-right: 5px; white-space: nowrap; }
  .month-block table.data th:nth-child(2),
  .month-block table.data td:nth-child(2) { font-size: 12px; padding-left: 3px; padding-right: 3px; }
}

.expand-row td { background: #fff8e6; border-top: 2px solid var(--gold); }

/* ---------- ticker chips (index changes) ---------- */
.tchip {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 2px 8px;
  border-radius: 5px;
  margin: 1px 0;
  background: #eef2f7;
  color: var(--navy2);
}
.tchip.in { background: #e3f5ec; color: #0b7a44; }
.tchip.out { background: #fdeae8; color: #b3271e; text-decoration: line-through; }

/* ---------- heatmap ---------- */
table.heat td { text-align: center; font-size: 13px; padding: 6px 4px; border-radius: 4px; min-width: 52px; }
table.heat th { font-size: 12px; color: var(--muted); padding: 6px 4px; }

/* ---------- history page ---------- */
.page-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin: 2px 2px 14px;
}
.page-head h1 { margin: 0; }
.skip-idx { font-size: 13.5px; white-space: nowrap; }
/* Annual performance + Monthly returns: equal-size boxes side by side, both
   visible without scrolling on desktop. Stacks on narrow screens. */
.hist-summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.hist-summary > .card { margin-bottom: 16px; }
/* compact the heatmap + annual table so all columns fit a half-width card */
.hist-summary table.heat td { min-width: 32px; font-size: 12px; padding: 5px 2px; }
.hist-summary table.heat th { min-width: 32px; font-size: 11px; padding: 5px 2px; }
.hist-summary table.data th, .hist-summary table.data td { padding: 5px 5px; font-size: 12.5px; }
@media (max-width: 760px) {
  /* stack Annual over Monthly, each full width and at its NATURAL height (Annual
     is short, leaving the heatmap room to be fully visible without scrolling) */
  .hist-summary { grid-template-columns: 1fr; gap: 0; }
  .hist-summary table.heat td { min-width: 40px; font-size: 11.5px; }
}
/* phone: drop the 3 least-critical benchmark columns (RSP/TLT/GLD) from the
   Annual table so the remaining 6 (Year · Nano 100 · SPY · IWM · IWC · QQQ) stay
   readable at full size. The Monthly heatmap keeps all 12 months, just compacted
   to fit the phone width. */
@media (max-width: 640px) {
  #annual-table th:nth-child(n + 7), #annual-table td:nth-child(n + 7) { display: none; }
  /* portrait: give all THREE history tables one shared width. Trim the card
     side-padding so the widest one (the 14-column heatmap) fits without
     side-scroll, then stretch the annual table and fill the daily grid to match. */
  .hist-summary .card, .card.hist-daily { padding-left: 8px; padding-right: 8px; }
  .hist-summary table.data, .hist-summary table.heat { width: 100%; }
  .month-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}
@media (max-width: 480px) {
  /* pull the two tables up so the heatmap's last row clears the phone's bottom
     browser bar: shorter rows + tighter card/header spacing (font unchanged) */
  .hist-summary .card { padding-top: 10px; padding-bottom: 10px; }
  .hist-summary h2 { margin-bottom: 5px; font-size: 17px; }
  .hist-summary table.data th, .hist-summary table.data td { padding: 2px 2px; font-size: 12px; }
  .hist-summary table.heat td, .hist-summary table.heat th { min-width: 0; padding: 2px 1px; font-size: 10px; letter-spacing: -.2px; }
}

/* ---------- footer ---------- */
.site-footer {
  background: var(--navy);
  color: #b9c8dd;
  margin-top: 30px;
  font-size: 13.5px;
}
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 26px 20px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: #e3ecf7; }
.back-to-top {
  display: block; text-align: center; padding: 13px 10px; font-size: 13.5px; font-weight: 600;
  color: #cdd9ea; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.14);
}
.back-to-top:hover { color: #fff; }

/* two-column blocks (racing, etc.) — stack on narrow screens */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; }

@media (max-width: 760px) {
  .hero-level { font-size: 40px; }
  .header-quote { display: none; }
  nav.main-nav a { padding: 14px 9px; }
}

/* ---------- phones ---------- */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .wrap { padding: 12px 12px 24px; }
  .card { padding: 13px 14px; margin-bottom: 12px; }
  h1 { font-size: 22px; }

  /* header: brand + beta together on row 1, then nav full-width below it.
     (brand stays auto-width, not 100%, so the "beta" chip sits on the same line
     right after "NANOCAP 100" instead of wrapping to its own row) */
  .header-inner { padding: 6px 12px; gap: 6px; min-height: 0; justify-content: center; }
  .brand { justify-content: center; }
  nav.main-nav { flex-basis: 100%; justify-content: center; flex-wrap: wrap; gap: 0; flex: none; }
  nav.main-nav a { padding: 9px 12px; font-size: 14px; }
  .brand .b1, .brand .b2 { font-size: 18px; }
  .brand .b3 { display: none; }
  .beta-tag { align-self: center; margin-left: 0; }

  /* hero — tighten the whitespace around the level and slim the description so
     the quote + performance stats sit high on the page (visible without scroll) */
  .split-left .subtitle { font-size: 13px; margin: 0 0 8px; }
  .hero-level { font-size: 34px; }
  /* keep the level↔change horizontal gap, but pull the "quotes as of" line
     tight under the number (row-gap, not the full gap) */
  .hero { column-gap: 12px; row-gap: 2px; margin-bottom: 0; }
  .hero-chg { font-size: 17px; padding-bottom: 0; }
  .hero .asof { padding-bottom: 0; }

  /* two-column blocks stack */
  .two-col { grid-template-columns: 1fr; gap: 8px; }

  /* constituents table: drop the two least-critical columns so the core
     (Ticker · Price · Day% · Volume · Last Trade) fits without side-scrolling */
  #cons-table th:nth-child(4), #cons-table td:nth-child(4),   /* MTD % */
  #cons-table th:nth-child(7), #cons-table td:nth-child(7) {  /* Mkt Cap */
    display: none;
  }
  table.data th, table.data td { padding: 6px 6px; font-size: 13.5px; }
  /* short "Vol" header so the Volume column stays narrow, giving the Last Trade
     timestamp room to show full AM/PM instead of being clipped */
  #cons-table .th-lg { display: none; }
  #cons-table .th-sm { display: inline; }
  #cons-table td:nth-child(6) { white-space: nowrap; }   /* Last Trade — keep on one line */
  .table-tools { gap: 8px; }
  .table-tools input[type="search"] { width: 100%; flex: 1 1 140px; }

  /* daily-close month blocks: one per row is fine, keep them readable */
  .month-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  /* tighten the 3 columns (Date · Chg · Close) so they fit inside the block —
     the block clips overflow, which was cutting the last decimal off the
     right-aligned Close on narrow (2-column) portrait phones */
  .month-block table.data th,
  .month-block table.data td { padding-left: 4px; padding-right: 4px; white-space: nowrap; }

  /* wide tables (history annual, heatmap, changes) scroll horizontally */
  table.heat td { min-width: 40px; font-size: 11.5px; padding: 5px 3px; }

  .footer-inner { flex-direction: column; gap: 12px; }
  .footer-inner > div[style] { text-align: left !important; }
}

/* very narrow phones — shrink the one-line stat boxes a touch more so all five
   still fit without overflow */
@media (max-width: 400px) {
  .hero-level { font-size: 34px; }
  .stat { padding: 5px 3px; }
  .stat .lbl { font-size: 8.5px; }
  .stat .val { font-size: 11.5px; }
}

/* ---------- constituent info-card (Home table → click a ticker) ---------- */
.ct-info { cursor: pointer; color: var(--navy2); font-weight: 700; }
.ct-info:hover { text-decoration: underline; }
.info-pop-back { position: fixed; inset: 0; background: rgba(0,0,0,.28); opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 60; }
.info-pop-back.open { opacity: 1; pointer-events: auto; }
.info-pop { position: fixed; z-index: 61; width: 300px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 12px 34px rgba(0,0,0,.18); padding: 13px 16px 15px; opacity: 0; transform: translateY(4px);
  pointer-events: none; transition: opacity .14s, transform .14s; }
.info-pop.open { opacity: 1; transform: none; pointer-events: auto; }
.ic-head { display: flex; align-items: center; }
.ic-tick { font-weight: 800; font-size: 17px; color: var(--navy2); letter-spacing: .3px; }
.ic-x { margin-left: auto; border: none; background: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 2px; }
.ic-name { font-size: 14px; font-weight: 600; margin-top: 1px; }
.ic-meta { display: flex; flex-wrap: wrap; gap: 3px 10px; margin: 6px 0 11px; font-size: 12.5px; color: var(--muted); }
.ic-country { font-weight: 600; }
.ic-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px 10px; }
.ic-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.ic-val { font-size: 14px; font-weight: 600; margin-top: 1px; }
@media (max-width: 640px) {
  .info-pop { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: 100%; max-width: 100%;
    border-radius: 15px 15px 0 0; transform: translateY(100%); padding: 16px 18px 24px; }
  .info-pop.open { transform: none; }
}
