/* design_system.css — the ONE source of truth for tokens and components.
   Read design/DESIGN_SYSTEM.md first. Served at /design_system.css (both modes).

   ★ ONE fluid scale. Every size token is clamp(floor, a + b·vw, ceiling) on the
     SAME interpolation: floor at a 390px viewport, ceiling at 1920px. Text,
     cards, bars and gauges therefore grow together on large screens and shrink
     together on phones. A new size is a new token on this range, never a px.
   ★ Colours carry meaning (below). A colour is chosen for what it says, not
     for how it looks: red = adverse / sell-off, green = supportive / rally,
     amber = mixed or conflicting, cyan = information / active, grey = no signal.
   ★ No animation, no transition. The only motion on the site is the side
     panel's scroll to a section, done in JS and skipped under prefers-reduced-motion. */

:root {
  /* ── Colour: surfaces ── */
  --ds-canvas: #000000;          /* PM View page */
  --ds-bg: #07090E;              /* Macro Data page */
  --ds-header: #0B0E14;
  --ds-surface: #10141C;         /* card */
  --ds-surface-2: #161B25;       /* inner block inside a card */
  --ds-surface-3: #131822;       /* button, inactive tab */
  --ds-border: #1D2430;          /* card edge */
  --ds-border-2: #2A3342;        /* control edge, quiet tile */
  --ds-rule: #171D28;            /* row separator */
  --ds-track: #232A37;           /* empty bar / gauge track */

  /* ── Colour: text, in reading order ── */
  --ds-text: #EEF1F6;            /* the subject: titles, levels — read first */
  --ds-text-2: #D7DCE6;          /* body sentences */
  --ds-text-3: #A9B1C1;          /* secondary lines */
  --ds-muted: #8C95A8;           /* dates, units, notes */
  --ds-faint: #4A5466;           /* dividers in text, disabled */

  /* ── Colour: meaning ── */
  --ds-red: #FF4D6A;             /* adverse · sell-off · rising yield, spread or vol */
  --ds-red-text: #FF8FA0;        /* red as text on a dark surface */
  --ds-red-text-strong: #FFC2CC; /* red text on a strong red tint */
  --ds-red-tint: rgba(255, 77, 106, 0.10);   --ds-red-edge: rgba(255, 77, 106, 0.24);
  --ds-red-tint-strong: rgba(255, 77, 106, 0.24); --ds-red-edge-strong: rgba(255, 77, 106, 0.60);
  --ds-red-soft: rgba(255, 77, 106, 0.16);
  --ds-green: #00C97A;           /* supportive · rally · falling yield, spread or vol */
  --ds-green-text: #5FE0AC;
  --ds-green-text-strong: #A8F0D2;
  --ds-green-tint: rgba(0, 201, 122, 0.10);   --ds-green-edge: rgba(0, 201, 122, 0.24);
  --ds-green-tint-strong: rgba(0, 201, 122, 0.22); --ds-green-edge-strong: rgba(0, 201, 122, 0.55);
  --ds-green-soft: rgba(0, 201, 122, 0.16);
  --ds-amber: #F5A623;           /* mixed · chains disagree · on watch */
  --ds-amber-soft: rgba(245, 166, 35, 0.16);
  --ds-cyan: #4CC9F0;            /* information · active tab · link · no call */
  --ds-cyan-soft: rgba(76, 201, 240, 0.12);
  --ds-grey: #8C95A8;            /* no signal · quiet */
  --ds-zone-red: #6A2433;        /* gauge zones (flat bar on phones) */
  --ds-zone-amber: #7A5A16;
  --ds-zone-green: #1F6A48;
  --ds-on-red: #14060A;          /* text on a solid red tag */
  --ds-on-green: #04140D;

  /* ── Type ── */
  --ds-font: 'Plus Jakarta Sans', system-ui, sans-serif;
  --ds-mono: 'IBM Plex Mono', ui-monospace, monospace;

  /* ── The fluid scale: floor @390px → ceiling @1920px ── */
  --ds-fs-2xs: clamp(9px, 8.490px + 0.1307vw, 11px);      /* tags inside tiles */
  --ds-fs-xs: clamp(10.5px, 9.863px + 0.1634vw, 13px);     /* table heads, legends */
  --ds-fs-sm: clamp(12px, 11.363px + 0.1634vw, 14.5px);    /* secondary lines, table cells */
  --ds-fs-md: clamp(13.5px, 12.735px + 0.1961vw, 16.5px);  /* body; card SUBJECT title */
  --ds-fs-lg: clamp(16px, 14.980px + 0.2614vw, 20px);      /* card STATE / verdict (slightly larger) */
  --ds-fs-xl: clamp(20px, 17.451px + 0.6536vw, 30px);      /* section heading */
  --ds-fs-2xl: clamp(24px, 19.412px + 1.1765vw, 42px);     /* big number */
  --ds-fs-3xl: clamp(28px, 20.863px + 1.8301vw, 56px);     /* the regime name */
  --ds-sp-1: clamp(4px, 3.490px + 0.1307vw, 6px);
  --ds-sp-2: clamp(8px, 6.980px + 0.2614vw, 12px);
  --ds-sp-3: clamp(12px, 10.471px + 0.3922vw, 18px);
  --ds-sp-4: clamp(16px, 13.451px + 0.6536vw, 26px);
  --ds-sp-5: clamp(22px, 18.431px + 0.9150vw, 36px);
  --ds-sp-6: clamp(26px, 19.373px + 1.6993vw, 52px);       /* between sections */
  --ds-gutter: clamp(16px, 9.882px + 1.5686vw, 40px);      /* page side padding (16px on phones) */
  --ds-r-sm: clamp(8px, 7.490px + 0.1307vw, 10px);
  --ds-r-md: clamp(12px, 10.980px + 0.2614vw, 16px);
  --ds-r-lg: clamp(14px, 12.471px + 0.3922vw, 20px);
  --ds-r-xl: clamp(16px, 13.961px + 0.5229vw, 24px);
  --ds-r-pill: 999px;
  --ds-bar: clamp(8px, 6.980px + 0.2614vw, 12px);          /* bar and gauge thickness */
  --ds-tap: clamp(44px, 42.980px + 0.2614vw, 48px);        /* minimum touch target */
  --ds-content-max: 1600px;
  /* PM View (design/pm_view_layout.html, every width): fixed by spec, not fluid.
     Session 51: the phone tree's own tokens (section and card gaps, card padding,
     card title, the 40px regime name, the 150px half-dial) went with it. */
  --ds-pm-radius: 12px;
  --ds-pm-fs-sec: 22px;           /* page title */
  --ds-pm-fs-verdict: 17px;       /* strip distance, Market stress state, curve regime */
  --ds-pm-chart-h: 150px;         /* yield-curve chart */
  /* PM View wide layout (Session 50, design/pm_view_layout.html, 760px and wider): fixed by spec.
     The container is Macro Data's (.main: 1600px, 24px sides); body 13.5px and notes 12.5px read
     the type scale (--ds-type-*, Session 54); the strip distance and state words --ds-pm-fs-verdict (17px). */
  --ds-pmw-gap: 14px;             /* between blocks */
  --ds-pmw-fs-head: 13px;         /* title row, right side */
  --ds-pmw-fs-regime: 22px;       /* the regime name */
  --ds-pmw-fs-verdict: 15px;      /* verdict word */
  --ds-pmw-fs-cval: 12px;         /* curve chart: point values */
  --ds-pmw-fs-axis: 11px;         /* curve chart: tenors */
  --ds-pmw-gauge-w: 170px; --ds-pmw-gauge-h: 92px;   /* Market stress half-dial */
  --ds-pmw-bar: 6px;              /* confidence, score and priced bars */
  --ds-pmw-track: 8px;            /* spread bars */
  --ds-pmw-table-min: 900px;      /* a table narrower than this scrolls inside its panel (760–1179px) */
  /* ONE type scale for PM View and Macro Data, at EVERY width (Session 53 phones, Session 54
     every width) — from design/pm_view_layout.html and design/macro_data_layout.html. A title is
     bigger than the rows under it. Never set one of these sizes elsewhere. */
  --ds-type-sec: 15px;            /* section title, mono capitals, with its cyan bar */
  --ds-type-sec-bar: 17px;        /* that bar's height */
  --ds-type-sec-note: 12.5px;     /* the note at the right of a title */
  --ds-type-body: 14px;           /* body text */
  --ds-type-label: 14.5px;        /* a row label */
  --ds-type-fig: 14px;            /* figures in table cells, mono */
  --ds-type-th: 11px;             /* column headers; a stacked cell's column name */
  --ds-type-note: 13px;           /* secondary notes */
  --ds-type-chip: 12px;           /* chips and pills */
  /* Macro Data below 760px (Session 52, design/macro_data_layout.html) */
  /* Session 53: every column, the reference's widths (minimums); the table slides inside its wrapper */
  --ds-mdp-col-name: 138px; --ds-mdp-col-spot: 74px; --ds-mdp-col-asof: 66px; --ds-mdp-col-chg: 68px; --ds-mdp-col-prev: 68px;
  --ds-mdp-col-m1: 74px; --ds-mdp-col-trend: 64px; --ds-mdp-col-period: 64px; --ds-mdp-col-lohi: 66px; --ds-mdp-col-range: 72px;
  --ds-mdp-pill-min: 58px;        /* the spot pill, so the column aligns */
  --ds-mdp-draw-w: 46px;          /* the trend line and the range bar in their columns */
  --ds-mdp-fs-brand: 13px;        /* the MACROMOVE wordmark in the sticky row */
  --ds-mdp-fs-tab: 10.5px;        /* the page tabs */

  /* ── Macro Data, Session 44 (values approved on the mock) ── */
  --ds-panel: #141A25;           /* panels: one step lighter than the page (--ds-bg) */
  --ds-panel-border: #252D3B;    /* the same hairline everywhere */
  --ds-row-rule: #222938;        /* row divider inside a panel */
  --ds-red-pale: #C48A93;        /* Chg: a small move against the row's own range */
  --ds-green-pale: #7DB39C;
  --ds-red-strong-fg: #FFE1E6;   /* Chg: a large move — the number on a filled pill */
  --ds-red-strong-bg: rgba(255, 77, 106, 0.32);
  --ds-green-strong-fg: #DFFAEF;
  --ds-green-strong-bg: rgba(95, 224, 172, 0.28);
  --ds-late: #F5A623;            /* As of: a date older than today */
  --ds-neutral-mark: #C5CBD8;    /* Range dot and sparkline of rows with no good or bad direction */
  --ds-neutral-shade: rgba(197, 203, 216, 0.08);         /* their Spot shading */
  --ds-neutral-shade-strong: rgba(197, 203, 216, 0.16);
  --ds-sec-bar: #4CC9F0;         /* every section bar: the interface cyan */
  --ds-mark-edge: #4A5568;       /* "1Y low / 1Y high" mark */
  --ds-backdrop: rgba(7, 9, 14, 0.6);   /* behind the side panel under 900px */
  /* Table type: tables scroll inside their box rather than scale, so these are fixed */
  --ds-fs-name: 13.5px;          /* instrument names (the tiles' sans) */
  --ds-fs-asof: 11.5px;
  --ds-fs-mark: 11px;
  --ds-cell-x: 10px;             /* horizontal cell padding in the template (Session 54: the reference's) */
  /* One column template for every instrument table (widths at 1440px) */
  /* Session 54 (design/macro_data_layout.html): numeric columns fixed; the spare width goes to
     Instrument (minmax(name-min, 1.2fr)) and Range (minmax(range-min, 1fr)) */
  --ds-col-spot: 86px; --ds-col-asof: 74px; --ds-col-chg: 88px; --ds-col-prev: 86px; --ds-col-m1: 92px;
  --ds-col-trend: 98px; --ds-col-wtd: 86px; --ds-col-mtd: 86px; --ds-col-ytd: 92px; --ds-col-lo: 86px; --ds-col-hi: 86px;
  --ds-col-name-min: 190px;
  --ds-col-range-min: 130px;
  --ds-spark-max: 120px;          /* the trend sparkline, at most */
  --ds-measure: 63ch;             /* running prose: about 95 characters a line (Session 54; a ch is wider than an average character) */
  /* central bank rates, from 760px (Session 56, the reference): five columns spread across the panel —
     each a minimum and a share of the width (1 · 1 · 1 · 0.7 · 1.5) */
  --ds-cb-bank-min: 130px; --ds-cb-rate-min: 110px; --ds-cb-meet-min: 150px; --ds-cb-dir-min: 90px; --ds-cb-pricing-min: 170px;
  /* the fixed columns (862px) + two flexible columns of at least the Instrument minimum */
  --ds-mt-min: calc(var(--ds-col-spot) + var(--ds-col-asof) + var(--ds-col-chg) + var(--ds-col-prev) + var(--ds-col-m1) + var(--ds-col-trend)
    + var(--ds-col-wtd) + var(--ds-col-mtd) + var(--ds-col-ytd) + var(--ds-col-lo) + var(--ds-col-hi) + var(--ds-col-name-min) + var(--ds-col-range-min));
  --ds-side-w: 248px;            /* side panel */
  --ds-side-btn: 36px;           /* its header button */
}

/* ── No motion (the side panel's scroll to a section is the only smooth scroll, in JS, off under reduced motion) ── */
#page-macro *, #page-macro *::before, #page-macro *::after,
#page-pm *, #page-pm *::before, #page-pm *::after,
.header, .header * { animation: none !important; transition: none !important; }

/* ── Components ─────────────────────────────────────────────────────────── */

/* Card — the base container. Subject first (.ds-card-title, white), state second. */
.ds-card { display: flex; flex-direction: column; gap: var(--ds-sp-3); min-width: 0;
  padding: var(--ds-sp-3) var(--ds-sp-4); border-radius: var(--ds-r-lg);
  background: var(--ds-surface); border: 1px solid var(--ds-border); }
.ds-card-title { font-family: var(--ds-font); font-size: var(--ds-fs-md); font-weight: 700; color: var(--ds-text); line-height: 1.3; }
.ds-card-state { font-family: var(--ds-font); font-size: var(--ds-fs-lg); font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; }
.ds-card-line { font-family: var(--ds-font); font-size: var(--ds-fs-sm); color: var(--ds-text-3); line-height: 1.4; }

/* Verdict card — a card whose state is a verdict. Compact; two columns on phones. */
.ds-vcard { gap: var(--ds-sp-1); padding: var(--ds-sp-3); border-radius: var(--ds-r-md); }
.ds-vcard .ds-card-line { margin-top: var(--ds-sp-1); }
.ds-vgrid { display: grid; gap: var(--ds-sp-2); grid-template-columns: repeat(4, minmax(0, 1fr)); }   /* 8 verdicts → 4 × 2, no orphan row */
@media (max-width: 700px) { .ds-vgrid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* Tile — a small figure: label, level, change. Quiet by default; .ds-tile--up/down tint it. */
.ds-tile { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: var(--ds-sp-2) var(--ds-sp-2);
  border-radius: var(--ds-r-md); background: var(--ds-surface); border: 1px solid var(--ds-border);
  color: inherit; text-decoration: none; font-family: var(--ds-font); }
.ds-tile-label { font-size: var(--ds-fs-md); font-weight: 700; color: var(--ds-text); line-height: 1.25; }   /* the title: white, bold */
.ds-tile-level { font-family: var(--ds-mono); font-size: var(--ds-fs-md); font-weight: 400; color: var(--ds-text); }  /* same size as the title, regular */
.ds-tile-chg { font-family: var(--ds-mono); font-size: var(--ds-fs-xs); color: var(--ds-muted); }                /* smaller than both */

/* Pill — a short state word. Soft tint for state, outline for meta. */
.ds-pill { display: inline-flex; align-items: center; gap: var(--ds-sp-1); padding: 2px var(--ds-sp-2);
  border-radius: var(--ds-r-pill); font-family: var(--ds-font); font-size: var(--ds-fs-xs); font-weight: 700; white-space: nowrap; }
.ds-pill--red { background: var(--ds-red-soft); color: var(--ds-red-text); }
.ds-pill--green { background: var(--ds-green-soft); color: var(--ds-green-text); }
.ds-pill--amber { background: var(--ds-amber-soft); color: var(--ds-amber); }
.ds-pill--cyan { background: var(--ds-cyan-soft); color: var(--ds-cyan); }
.ds-pill--grey { background: var(--ds-surface-2); color: var(--ds-text-3); }

/* Section header — mono caps label (Macro Data) or a sans heading (PM View). */
.ds-sec { display: flex; flex-direction: column; gap: var(--ds-sp-2); min-width: 0; }
.ds-sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--ds-sp-1) var(--ds-sp-3); }
.ds-sec-label { margin: 0; font-family: var(--ds-mono); font-size: var(--ds-fs-sm); font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ds-text-2); }
.ds-sec-title { margin: 0; font-family: var(--ds-font); font-size: var(--ds-fs-xl); font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; color: var(--ds-text); }
.ds-sec-sub { margin: 0; font-family: var(--ds-font); font-size: var(--ds-fs-sm); color: var(--ds-muted); }

/* Table — a bordered box that scrolls on its own; the page never scrolls sideways. */
.ds-table-box { max-width: 100%; overflow-x: auto; border-radius: var(--ds-r-md); border: 1px solid var(--ds-border); background: var(--ds-surface); }

/* Button — mono, 44px touch target. */
.ds-btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--ds-tap); padding: 0 var(--ds-sp-3);
  border-radius: var(--ds-r-sm); border: 1px solid var(--ds-border-2); background: var(--ds-surface-3); color: var(--ds-cyan);
  font-family: var(--ds-mono); font-size: var(--ds-fs-sm); font-weight: 500; cursor: pointer; text-decoration: none; }
.ds-btn:hover { color: var(--ds-text); border-color: var(--ds-cyan); }
.ds-btn:focus-visible, .ds-tile:focus-visible { outline: 2px solid var(--ds-cyan); outline-offset: 2px; }

/* Colour words */
.ds-red { color: var(--ds-red); } .ds-green { color: var(--ds-green); } .ds-amber { color: var(--ds-amber); }
.ds-cyan { color: var(--ds-cyan); } .ds-grey { color: var(--ds-grey); }

/* ── Existing Macro Data tables take the tokens (no structural change) ── */
#page-macro { background: var(--ds-bg); }
#page-macro .section-title { color: var(--ds-text-2); }
#page-macro table { background: var(--ds-surface); border-color: var(--ds-border); }
#page-macro thead th { background: var(--ds-header); color: var(--ds-muted); border-bottom-color: var(--ds-border); }
#page-macro tbody td { border-bottom-color: var(--ds-rule); }
#page-macro tbody td:first-child { background: var(--ds-surface); color: var(--ds-text); }
#page-macro tbody tr:hover td, #page-macro tbody tr:hover td:first-child { background: var(--ds-surface-2); }
#page-macro .pos { color: var(--ds-green-text); }
#page-macro .neg { color: var(--ds-red-text); }
#page-macro .table-wrap { max-width: 100%; overflow-x: auto; }

/* ── Macro Data components (macro_view.js) ──────────────────────────────── */
.mv-top { max-width: var(--ds-content-max); margin: 0 auto; padding: var(--ds-sp-3) var(--ds-gutter) 0; display: flex; flex-direction: column; gap: var(--ds-sp-5); font-family: var(--ds-font); }
.mv-top:empty { display: none; }
/* What Matters Now */
.mv-wmn { gap: var(--ds-sp-2); }
.mv-wmn-title { color: var(--ds-text); }
.mv-wmn-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: var(--ds-sp-2); align-items: start; }
.mv-wmn-pill { justify-content: center; margin-top: 1px; }
.mv-wmn-text { font-size: var(--ds-fs-md); color: var(--ds-text-2); line-height: 1.45; }
/* Today's moves — tiles. Intensity = |day| against the instrument's own daily σ. */
.mv-grid { display: grid; gap: var(--ds-sp-2); grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1100px) { .mv-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 700px) { .mv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mv-tile { min-height: var(--ds-tap); text-align: left; cursor: pointer; font: inherit; }
.mv-tile:hover { border-color: var(--ds-border-2); }
.mv-open { outline: 2px solid var(--ds-cyan); outline-offset: -1px; }
.mv-selloff-light { background: var(--ds-red-tint); border-color: var(--ds-red-edge); }
.mv-selloff-light .mv-chg { color: var(--ds-red-text); }
.mv-selloff-strong { background: var(--ds-red-tint-strong); border-color: var(--ds-red-edge-strong); }
.mv-selloff-strong .mv-chg { color: var(--ds-red-text-strong); }
.mv-rally-light { background: var(--ds-green-tint); border-color: var(--ds-green-edge); }
.mv-rally-light .mv-chg { color: var(--ds-green-text); }
.mv-rally-strong { background: var(--ds-green-tint-strong); border-color: var(--ds-green-edge-strong); }
.mv-rally-strong .mv-chg { color: var(--ds-green-text-strong); }
.mv-tile-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--ds-sp-1); flex-wrap: wrap; }
.mv-tile-na { font-size: var(--ds-fs-sm); font-weight: 700; color: var(--ds-text-3); }
.mv-tag { padding: 1px 5px; border-radius: 4px; font-size: var(--ds-fs-2xs); font-weight: 800; letter-spacing: 0.06em; }
.mv-tag-selloff { background: var(--ds-red); color: var(--ds-on-red); }
.mv-tag-rally { background: var(--ds-green); color: var(--ds-on-green); }
/* 1-year extreme mark on a tile (Session 44): neutral, never a direction colour */
.mv-ext { display: inline-block; margin-left: var(--ds-sp-1); padding: 0 var(--ds-sp-1); border: 1px solid var(--ds-mark-edge); border-radius: var(--ds-r-pill); font-family: var(--ds-font); font-size: var(--ds-fs-mark); font-weight: 700; color: var(--ds-text-2); vertical-align: middle; letter-spacing: 0; }
/* Central bank table: the date of the market pricing figure */
.cb-asof { margin-left: var(--ds-sp-1); color: var(--ds-muted); }
/* A tile older than its market's latest trading day: its date, no tag. */
.mv-tile-date { font-size: var(--ds-fs-2xs); color: var(--ds-muted); letter-spacing: 0.02em; }
.mv-legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-sp-1) var(--ds-sp-3); font-size: var(--ds-fs-xs); color: var(--ds-text-3); }
.mv-key { display: inline-flex; align-items: center; gap: var(--ds-sp-1); }
.mv-key-sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.mv-key-selloff { background: var(--ds-red); } .mv-key-rally { background: var(--ds-green); } .mv-key-quiet { background: var(--ds-border-2); }
/* Detail panel — in place under the grid, one at a time */
.mv-detail-slot:empty { display: none; }
.mv-detail { gap: var(--ds-sp-2); }
.mv-detail-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--ds-sp-1) var(--ds-sp-3); }
.mv-dgrid { display: grid; gap: var(--ds-sp-2); grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 700px) { .mv-dgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mv-dcell { display: flex; flex-direction: column; gap: 2px; padding: var(--ds-sp-2); border-radius: var(--ds-r-sm); background: var(--ds-surface-2); min-width: 0; }
.mv-dval { font-family: var(--ds-mono); font-size: var(--ds-fs-md); font-weight: 400; color: var(--ds-text); }   /* never larger than the card title */
.mv-detail-foot { display: flex; justify-content: flex-end; }
/* "See full table": the row is highlighted statically (no fade), then cleared */
#page-macro tr.mrow-hl td, #page-macro tr.mrow-hl td:first-child { background: var(--ds-cyan-soft) !important; }

/* Central Bank Rates — Session 56, design/macro_data_layout.html: from 760px five columns spread
   across the panel (each a minimum and a share); the central bank at the left, current rate, next
   meeting with its countdown, direction centred, market pricing at the right. The markup stays a
   table; rows display: contents. Below 760px: two-line rows (macro_dashboard.html). Sizes: the type
   scale only — the bank name a row label (sans), every figure mono, the meeting and pricing muted. */
@media (min-width: 760px) {
  #page-macro .cb-table { display: grid; grid-template-columns: minmax(var(--ds-cb-bank-min), 1fr) minmax(var(--ds-cb-rate-min), 1fr) minmax(var(--ds-cb-meet-min), 1fr)
    minmax(var(--ds-cb-dir-min), 0.7fr) minmax(var(--ds-cb-pricing-min), 1.5fr); width: 100%; }
  #page-macro .cb-table thead, #page-macro .cb-table tbody, #page-macro .cb-table tr { display: contents; }
  #page-macro .cb-table th, #page-macro .cb-table td { display: flex; align-items: center; justify-content: flex-end; gap: 0.35em; min-width: 0; padding: 8px 14px; white-space: nowrap; }
  #page-macro .cb-table th:nth-child(1), #page-macro .cb-table td.cb-bank { justify-content: flex-start; }
  #page-macro .cb-table th:nth-child(4), #page-macro .cb-table td.cb-col-dir { justify-content: center; }
  #page-macro .cb-table thead th { font-family: var(--ds-mono); font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; }
  #page-macro .cb-table td { font-family: var(--ds-mono); font-weight: 600; }
  #page-macro .cb-table td.cb-bank { font-family: var(--ds-font); font-weight: 600; color: var(--ds-text); }
  #page-macro .cb-table td.cb-meet, #page-macro .cb-table td.cb-pricing { font-weight: 500; color: var(--ds-muted); }
  #page-macro .cb-table td.cb-meet .mt-note { font-family: inherit; font-size: inherit; color: var(--ds-muted); }   /* the countdown reads as the date beside it */
  #page-macro .cb-table td.cb-col-dir { font-family: var(--ds-font); }
}
/* Session 54 · the type scale at every width (was below 760px only, Session 53) */
#page-macro .section-header { margin-bottom: 8px; padding: 0; }
#page-macro .section-title { font-family: var(--ds-mono); font-size: var(--ds-type-sec); font-weight: 600; letter-spacing: 0.12em; color: var(--ds-text); }
#page-macro .section-accent { flex: none; height: var(--ds-type-sec-bar); }
#page-macro .ds-sec-label { display: flex; align-items: center; gap: 10px; font-size: var(--ds-type-sec); letter-spacing: 0.12em; color: var(--ds-text); }
#page-macro .ds-sec-label::before { content: ""; flex: none; width: 4px; height: var(--ds-type-sec-bar); border-radius: 2px; background: var(--ds-sec-bar); }
#page-macro .ds-sec-sub, #page-macro .section-header .mt-slide-hint { font-size: var(--ds-type-sec-note); }
#page-macro .mv-wmn-text { font-size: var(--ds-type-body); }
#page-macro .mt-defs, #page-macro .mt-foot, #page-macro .mv-legend, #page-macro .mv-legend .ds-sec-sub, #page-macro .mt-yc { font-size: var(--ds-type-note); }
#page-macro .mv-wmn-pill, #page-macro .mv-tag, #page-macro .mv-ext, #page-macro .mt-yc-badge { font-size: var(--ds-type-chip); }
#page-macro table.mt thead th, #page-macro .cb-table thead th { font-size: var(--ds-type-th); }
#page-macro table.mt td, #page-macro .cb-table td { font-size: var(--ds-type-fig); }
#page-macro table.mt td .mt-asof { font-size: inherit; }
#page-macro table.mt td.mt-name, #page-macro .cb-table td.cb-bank { font-size: var(--ds-type-label); }
#page-macro table.mt td .mt-unit, #page-macro table.mt td .mt-note { font-size: var(--ds-type-note); }
/* Session 54 · running prose — about 95 characters a line, left-aligned (What Matters Now, the
   legend under the tiles). Table rows and tiles are not prose. */
#page-macro .mv-wmn-text, #page-macro .mv-legend > .ds-sec-sub { max-width: var(--ds-measure); text-align: left; }
/* Session 57: the footnotes under the tables are not capped — they run 100–130 characters and take the width they need */
/* Session 55 · the legend above the first table is not prose: definition items, "term: meaning",
   wrapping across the full width (no cap); below 760px one per line (macro_dashboard.html) */
#page-macro .mt-defs { display: flex; flex-wrap: wrap; gap: 6px 26px; margin: 0 0 var(--ds-sp-3); font-family: var(--ds-font); color: var(--ds-muted); line-height: 1.5; }
#page-macro .mt-def-t { font-weight: 600; color: var(--ds-text-2); }
#page-macro .mt-def-t::after { content: ":"; color: var(--ds-muted); }
#page-macro .mt-rl-phone .mt-def-t::after { content: none; }   /* the slide item is a sentence, not a term */
/* Central Bank Rates — phone: Bank · Rate · Next meeting · Priced, nothing cropped */
.cb-h-short, .cb-meet-short { display: none; }
@media (max-width: 700px) {
  .cb-col-dir { display: none; }
  .cb-h-long, .cb-meet-long { display: none; }
  .cb-h-short, .cb-meet-short { display: inline; }
  #page-macro .cb-table th, #page-macro .cb-table td { padding: 6px 6px; white-space: normal; }
  #page-macro .cb-table td:first-child { position: static; }
}
@media (max-width: 700px) { #page-macro .main { padding-left: var(--ds-gutter); padding-right: var(--ds-gutter); } }

/* Admin pages (ALM, Framework): wide legacy content scrolls inside its own box,
   never the page body. CSS only — no markup or text change. */
#page-alm, #page-framework { max-width: 100%; overflow-x: auto; }
.mv-dlabel { font-size: var(--ds-fs-xs); font-weight: 600; color: var(--ds-muted); }   /* Day / Week / Month: labels, not titles */

/* ── Macro Data, Session 44: one table template, panels, colours ───────────── */
/* Panels: one step lighter than the page, one hairline, no gradient, no gloss. */
#page-macro .table-wrap { background: var(--ds-panel); border: 1px solid var(--ds-panel-border); border-radius: var(--ds-r-md); }
#page-macro table { background: transparent; border: 0; border-radius: 0; }
#page-macro thead th { background: var(--ds-panel); border-bottom: 1px solid var(--ds-panel-border); }
#page-macro tbody td { border-bottom: 1px solid var(--ds-row-rule); }
#page-macro tbody tr:last-child td { border-bottom: 0; }
#page-macro tbody td:first-child { background: var(--ds-panel); }
#page-macro .ds-card, #page-macro .mv-quiet { background: var(--ds-panel); border-color: var(--ds-panel-border); }
#page-macro .skeleton { background: var(--ds-surface-2); animation: none; width: var(--ds-col-spot); }
/* Section bars: one cyan bar, 4 x 16 */
#page-macro .section-accent { width: 4px; height: 16px; border-radius: 2px; background: var(--ds-sec-bar); }
/* The column template: same order, same widths in every table */
#page-macro table.mt { table-layout: fixed; width: 100%; min-width: var(--ds-mt-min); }
.mt col.mt-c-spot { width: var(--ds-col-spot); } .mt col.mt-c-asof { width: var(--ds-col-asof); } .mt col.mt-c-chg { width: var(--ds-col-chg); }
.mt col.mt-c-prev { width: var(--ds-col-prev); } .mt col.mt-c-m1 { width: var(--ds-col-m1); } .mt col.mt-c-trend { width: var(--ds-col-trend); }
.mt col.mt-c-wtd { width: var(--ds-col-wtd); } .mt col.mt-c-mtd { width: var(--ds-col-mtd); } .mt col.mt-c-ytd { width: var(--ds-col-ytd); }
.mt col.mt-c-lo { width: var(--ds-col-lo); } .mt col.mt-c-hi { width: var(--ds-col-hi); }
#page-macro table.mt th, #page-macro table.mt td { padding-left: var(--ds-cell-x); padding-right: var(--ds-cell-x); overflow: hidden; text-overflow: ellipsis; }
#page-macro table.mt th:first-child, #page-macro table.mt td:first-child { padding-left: var(--ds-sp-2); }
#page-macro table.mt .spark-cell { display: table-cell !important; padding: 0 var(--ds-cell-x); width: auto; min-width: 0; }
/* Session 54 · from 760px the table is laid out as a grid (rows display: contents): the reference's
   template — Instrument minmax(190px, 1.2fr), Range minmax(130px, 1fr), every other column fixed.
   The markup stays a table; below 760px it stays one (the phone's sliding table). */
@media (min-width: 760px) {
  #page-macro table.mt { display: grid; grid-template-columns: minmax(var(--ds-col-name-min), 1.2fr) var(--ds-col-spot) var(--ds-col-asof) var(--ds-col-chg)
    var(--ds-col-prev) var(--ds-col-m1) var(--ds-col-trend) var(--ds-col-wtd) var(--ds-col-mtd) var(--ds-col-ytd) var(--ds-col-lo) minmax(var(--ds-col-range-min), 1fr) var(--ds-col-hi); }
  #page-macro table.mt colgroup { display: none; }
  #page-macro table.mt thead, #page-macro table.mt tbody, #page-macro table.mt tr { display: contents; }
  /* a cell: centred vertically; its inline children kept apart by a gap (a flex box drops the spaces between them) */
  #page-macro table.mt th, #page-macro table.mt td { display: flex; align-items: center; justify-content: flex-end; gap: 0.35em; min-width: 0; }
  #page-macro table.mt tr > .spark-cell { display: flex !important; }
  #page-macro table.mt th:first-child, #page-macro table.mt td:first-child { justify-content: flex-start; flex-wrap: wrap; }
  #page-macro table.mt td.mt-wide { grid-column: 2 / -1; justify-content: flex-start; flex-wrap: wrap; }
  #page-macro table.mt td[colspan="13"] { grid-column: 1 / -1; justify-content: center; }
  /* b · the range bar fills its own column; c · the trend line keeps its column, at most 120px */
  #page-macro table.mt td:nth-child(12) { padding-left: 16px; }
  #page-macro table.mt .range-bar { flex: 1; width: auto; min-width: 48px; }
  #page-macro table.mt .spark-cell canvas { max-width: min(100%, var(--ds-spark-max)); }
}
/* Instrument names: the tiles' sans; numbers and column heads stay mono */
#page-macro table td.mt-name { font-family: var(--ds-font); font-size: var(--ds-fs-name); font-weight: 700; color: var(--ds-text); white-space: normal; text-overflow: clip; line-height: 1.3; }
#page-macro .mt-unit { font-family: var(--ds-mono); font-size: var(--ds-fs-asof); font-weight: 400; color: var(--ds-muted); }
#page-macro .mt-note { font-family: var(--ds-font); font-size: var(--ds-fs-asof); font-weight: 400; color: var(--ds-muted); }
#page-macro td.mt-wide { text-align: left; white-space: normal; }
/* As of: its own column; today's date muted, an older date amber */
#page-macro .mt-asof { font-size: var(--ds-fs-asof); color: var(--ds-muted); }
#page-macro .mt-asof.mt-late { color: var(--ds-late); font-weight: 600; }
/* Changes. Rows with no good or bad direction (slopes, Gilt-UST): normal light text, never grey. */
#page-macro .flat { color: var(--ds-text-2); }
/* Chg strength, the tiles' rule: pale, normal, strong (a filled pill) */
#page-macro .chg-pale.pos { color: var(--ds-green-pale); }
#page-macro .chg-pale.neg { color: var(--ds-red-pale); }
#page-macro .chg-strong { display: inline-block; padding: 0 4px; border-radius: 4px; font-weight: 600; }
#page-macro .chg-strong.pos { color: var(--ds-green-strong-fg); background: var(--ds-green-strong-bg); }
#page-macro .chg-strong.neg { color: var(--ds-red-strong-fg); background: var(--ds-red-strong-bg); }
/* Neutral Spot shading (slopes, Gilt-UST): near either extreme, no colour of direction */
#page-macro .heat-n { --heat: var(--ds-neutral-shade); background: var(--heat); }
#page-macro .heat-n-extreme { --heat: var(--ds-neutral-shade-strong); background: var(--heat); }
/* Lines around the tables: footnotes, yield-curve regime lines (the legend: .mt-defs) */
#page-macro .mt-foot { margin: calc(-1 * var(--ds-sp-2)) 0 var(--ds-sp-4) var(--ds-sp-1); font-family: var(--ds-font); font-size: var(--ds-fs-xs); color: var(--ds-muted); }
#page-macro .mt-yc { margin: 0 0 var(--ds-sp-2) var(--ds-sp-1); font-size: var(--ds-fs-xs); cursor: help; }
#page-macro .mt-yc-title { color: var(--ds-text-3); letter-spacing: 0.06em; }
#page-macro .mt-yc-badge { padding: 2px 8px; border-radius: 3px; font-weight: 700; letter-spacing: 0.06em; }
#page-macro .mt-yc-detail { color: var(--ds-muted); margin-left: var(--ds-sp-1); }

/* ── Side panel (Session 44): the sections of the current page ─────────────── */
.side-toggle { display: inline-flex; align-items: center; justify-content: center; width: var(--ds-side-btn); height: var(--ds-side-btn); padding: 0;
  border-radius: var(--ds-r-sm); border: 1px solid var(--ds-panel-border); background: var(--ds-panel); color: var(--ds-text-2); cursor: pointer; }
.side-toggle:hover, .side-toggle[aria-expanded="true"] { color: var(--ds-cyan); border-color: var(--ds-cyan); }
.side-toggle:focus-visible, .side-link:focus-visible { outline: 2px solid var(--ds-cyan); outline-offset: 2px; }
.side-toggle[hidden] { display: none; }
.side-nav { position: fixed; left: 0; top: var(--side-top, 0); bottom: 0; width: var(--ds-side-w); z-index: 90; overflow-y: auto;
  padding: var(--ds-sp-3) var(--ds-sp-2); background: var(--ds-panel); border-right: 1px solid var(--ds-panel-border); font-family: var(--ds-font); }
.side-nav[hidden] { display: none; }
.side-nav-title { padding: 0 var(--ds-sp-2) var(--ds-sp-2); font-family: var(--ds-mono); font-size: var(--ds-fs-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ds-muted); }
.side-nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.side-link { display: block; padding: 7px var(--ds-sp-2); border-left: 3px solid transparent; border-radius: 0 var(--ds-r-sm) var(--ds-r-sm) 0;
  font-size: var(--ds-fs-sm); font-weight: 600; color: var(--ds-text-3); text-decoration: none; line-height: 1.3; }
.side-link:hover { color: var(--ds-text); background: var(--ds-surface-2); }
.side-link.side-current { color: var(--ds-cyan); border-left-color: var(--ds-cyan); background: var(--ds-cyan-soft); }
.side-backdrop { display: none; }
/* Section targets land below the sticky header */
#page-macro .section, #page-macro .mv-wmn, #page-macro .mv-moves, #page-pm .pmv-sec, #page-pm .section, #page-pm [data-nav] { scroll-margin-top: calc(var(--hdr-h, 64px) + 12px); }
/* Wide screens: the panel pushes the content */
@media (min-width: 900px) {
  body.side-open #page-macro, body.side-open #page-pm { margin-left: var(--ds-side-w); }
}
/* Under 900px: the panel lies over the content (and closes after a click, in JS) */
@media (max-width: 899.98px) {
  .side-nav { z-index: 310; width: min(var(--ds-side-w), 82vw); }
  body.side-open .side-backdrop { display: block; position: fixed; inset: 0; z-index: 300; background: var(--ds-backdrop); }
}
