/* =============================================================================
   macro-pages.css — Iter 25IO
   Economic Data › GDP (and, in Phase 3, Financial) on /markets. Uses the site
   tokens from style.css. Chart colours: validated dark categorical palette
   (dataviz reference), checked against --bg-card (#1c1c20).
   ============================================================================= */
.mp-page {
  --mp-blue: #3987e5;      /* 1-quarter bars, series 1 */
  --mp-orange: #d95926;    /* 4-quarter line, series 2 */
  --mp-aqua: #199e70;
  --mp-yellow: #c98500;
  --mp-magenta: #d55181;
  --mp-gap: 16px;
  color: var(--text-primary);
}

.mp-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 10px; }
.mp-title { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.mp-meta { font-size: var(--fs-xs); color: var(--text-muted); }
.mp-meta b { color: var(--text-secondary); font-weight: 600; }

/* ── Fixed in-page section menu ──────────────────────────────────────────
   CSS sticky can't work here: .main / .dashboard / body all set
   overflow-x: hidden (style.css), which makes them scroll containers. So
   macro-pages.js pins the menu with position: fixed under whatever fixed
   header is on screen, and the slot keeps its height while pinned. */
.mp-secnav-slot { position: relative; min-height: 46px; margin: 0 0 8px; }
.mp-secnav {
  display: flex;
  gap: 6px;
  padding: 8px 0;
  background: var(--mi-stuck-bg, rgba(19,19,22,0.94));
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  z-index: 150;
}
.mp-secnav.is-pinned { position: fixed; box-shadow: 0 6px 14px rgba(0,0,0,0.35); }
.mp-secnav::-webkit-scrollbar { display: none; }
.mp-pill {
  flex: 0 0 auto;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-secondary);
  font: 600 12px/1.2 var(--font-body);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.mp-pill:hover { color: var(--text-primary); border-color: var(--text-muted); }
.mp-pill[aria-current="true"] { background: var(--accent-teal); border-color: var(--accent-teal); color: #fff; }
.mp-pill:focus-visible { outline: 2px solid var(--accent-teal); outline-offset: 2px; }

.mp-section { padding-top: 6px; margin-bottom: 28px; }
.mp-section > h2 { font-size: var(--fs-lg); font-weight: 650; margin: 8px 0 4px; }
.mp-section > .mp-sub { font-size: var(--fs-xs); color: var(--text-muted); margin: 0 0 12px; }

.mp-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; }
.mp-grid { display: grid; gap: var(--mp-gap); }
.mp-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mp-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .mp-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .mp-grid-2, .mp-grid-3 { grid-template-columns: minmax(0, 1fr); } }

/* ── Nowcast cards ─────────────────────────────────────────────────────── */
.mp-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.mp-stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 12px 10px; text-align: center; }
.mp-stat--hero { border-color: var(--accent-teal); box-shadow: inset 0 0 0 1px var(--accent-teal); }
.mp-stat-label { font-size: 11px; font-weight: 600; color: var(--text-muted); letter-spacing: .02em; }
.mp-stat-value { font-size: 24px; font-weight: 750; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.mp-stat-sub { font-size: 11px; color: var(--text-muted); }
.mp-badge { display: inline-block; margin-top: 6px; padding: 1px 7px; border-radius: var(--radius-pill); border: 1px solid var(--accent-teal); color: var(--accent-teal); font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.mp-note { font-size: var(--fs-xs); color: var(--text-secondary); margin: 10px 0 0; line-height: 1.5; }
.mp-note + .mp-note { margin-top: 4px; }

/* ── Toggles ───────────────────────────────────────────────────────────── */
.mp-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.mp-seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-pill); overflow: hidden; }
.mp-seg button { background: transparent; border: 0; color: var(--text-secondary); font: 600 12px/1 var(--font-body); padding: 7px 14px; cursor: pointer; }
.mp-seg button + button { border-left: 1px solid var(--border); }
.mp-seg button[aria-pressed="true"] { background: var(--accent-teal); color: #fff; }
.mp-seg button:focus-visible { outline: 2px solid var(--accent-teal); outline-offset: -2px; }

/* ── Tables ────────────────────────────────────────────────────────────── */
.mp-table-wrap { overflow-x: auto; }
.mp-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums lining-nums; font-size: 13px; }
.mp-table th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.mp-table th:first-child, .mp-table td:first-child { text-align: left; }
.mp-table td { padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--border-subtle); white-space: nowrap; }
.mp-table td:first-child { white-space: normal; min-width: 180px; }
.mp-table tr.mp-group td { color: var(--text-muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; padding-top: 12px; }
.mp-table tr.mp-strong td { font-weight: 700; }
.mp-table .ind1 { padding-left: 18px; }
.mp-table .ind2 { padding-left: 34px; color: var(--text-secondary); }
.mp-table .neg { color: var(--red); }
.mp-table .mp-dim { color: var(--text-muted); font-size: 11px; }
.mp-foot { font-size: 11px; color: var(--text-muted); margin: 8px 0 0; line-height: 1.5; }

/* ── Charts ────────────────────────────────────────────────────────────── */
.mp-chart { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 12px 8px; min-width: 0; }
.mp-chart h3 { font-size: 14px; font-weight: 650; margin: 0 0 2px; }
.mp-chart .mp-chart-sub { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
.mp-canvas { position: relative; height: 220px; }
.mp-canvas--tall { height: 280px; }
.mp-canvas--small { height: 170px; }
.mp-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11px; color: var(--text-secondary); margin-top: 6px; }
.mp-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.mp-legend i.line { height: 2px; border-radius: 1px; vertical-align: 3px; }
.mp-group-title { font-size: 13px; font-weight: 700; color: var(--text-secondary); margin: 18px 0 8px; letter-spacing: .02em; }
.mp-src { font-size: 11px; color: var(--text-muted); margin-top: 10px; line-height: 1.5; }

.mp-loading, .mp-error { padding: 40px 0; text-align: center; color: var(--text-muted); font-size: 14px; }

@media (max-width: 700px) {
  .mp-canvas { height: 200px; }
  .mp-canvas--tall { height: 240px; }
  .mp-stat-value { font-size: 20px; }
  .mp-table { font-size: 12px; }
  .mp-table td:first-child { min-width: 140px; }
}

/* ── Financial page (Iter 25IP) ─────────────────────────────────────────── */
.mp-probs { display: grid; gap: 6px; }
.mp-prob { display: grid; grid-template-columns: 96px 1fr 44px; align-items: center; gap: 8px; font-size: 12px; }
.mp-prob-l { color: var(--text-secondary); white-space: nowrap; }
.mp-prob-bar { height: 10px; background: var(--bg-tertiary); border-radius: var(--radius-pill); overflow: hidden; }
.mp-prob-bar i { display: block; height: 100%; background: var(--mp-blue); border-radius: var(--radius-pill); }
.mp-prob-v { text-align: right; font-variant-numeric: tabular-nums; }
.mp-cards--wide { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.mp-pred { text-align: left; }
.mp-pred .mp-stat-label { min-height: 30px; line-height: 1.35; }

/* ── Info buttons, AI commentary card, info panel groups (Iter 25IQ) ───── */
.mp-title, .mp-section > h2 { display: flex; align-items: center; gap: 8px; }
.mp-info-btn { flex: 0 0 auto; width: 22px; height: 22px; }
.mp-ai { background: var(--bg-card); border: 1px solid var(--border); border-left: 3px solid var(--accent-teal); border-radius: var(--radius-md); padding: 12px 16px 10px; margin: 0 0 12px; }
.mp-ai-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.mp-ai-tag { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-teal); }
.mp-ai-top .mp-info-btn { width: 20px; height: 20px; }
.mp-ai-top .mp-info-btn svg { width: 12px; height: 12px; }
.mp-ai-when { margin-left: auto; font-size: 11px; color: var(--text-muted); }
.mp-ai-head { font-size: 15px; font-weight: 650; line-height: 1.4; margin: 0 0 6px; color: var(--text-primary); }
.mp-ai-points { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.55; color: var(--text-secondary); }
.mp-ai-points li + li { margin-top: 3px; }
.mp-ai-foot { font-size: 11px; color: var(--text-muted); margin: 8px 0 0; }
.mp-info-group + .mp-info-group { margin-top: 18px; }
.mp-info-group-title { font-size: 13px; font-weight: 700; color: var(--accent-teal, #4f98a3); margin: 0 0 2px; padding-top: 4px; }
.mp-info-when { font-size: 11.5px; color: #9ca3af; line-height: 1.5; margin: 2px 0 0; }
@media (max-width: 700px) { .mp-ai-head { font-size: 14px; } .mp-ai { padding: 10px 12px 8px; } }
