/* Web fonts served by the site (site/fonts/LICENSE.md): AEM Sans = Carlito, AEM Serif = TeX Gyre Pagella, Latin subsets. */
@font-face { font-family: "AEM Sans"; src: url("../fonts/aem-sans-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "AEM Sans"; src: url("../fonts/aem-sans-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "AEM Serif"; src: url("../fonts/aem-serif-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "AEM Serif"; src: url("../fonts/aem-serif-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "AEM Serif"; src: url("../fonts/aem-serif-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

/* Argentina Economic Monitor — Economic Order theme
 *
 * Brand palette (EO): charcoal #36454F, copper #B87333, sage #87A96B,
 * sky #5B9BD5, terracotta #D4745E, lavender #8E7AB5.
 *
 * Rules
 *  - Text and links use charcoal (light) / paper (dark). Copper is ~3.8:1
 *    on white: fine for lines, buttons and large headings, not small text.
 *  - Chart series order is fixed: copper, sky, sage, lavender. Copper and
 *    terracotta are too close to tell apart (validated), so terracotta is
 *    reserved for highlights/annotations and never used as a series.
 *  - Change these tokens to re-skin the site; app.js reads them for charts.
 */

:root {
  --eo-charcoal: #36454F;
  --eo-copper: #B87333;
  --eo-sage: #87A96B;
  --eo-sky: #5B9BD5;
  --eo-terracotta: #D4745E;
  --eo-lavender: #8E7AB5;

  --bg: #FBFAF7;
  --surface: #FFFFFF;
  --surface-2: #F3F1EC;
  --ink: #36454F;
  --ink-2: #5A6872;
  --ink-3: #85909A;
  --rule: #E3E0D9;
  --grid: #ECE9E3;
  --accent: #B87333;
  --accent-ink: #8F5523;     /* copper darkened to 5.6:1 for small accent text */
  --focus: #5B9BD5;
  --pos: #4F7A3A;
  --neg: #B4513C;
  --warn-bg: #FBF0E4;

  --series-1: #B87333;
  --series-2: #5B9BD5;
  --series-3: #87A96B;
  --series-4: #8E7AB5;
  --series-5: #C9A227;
  --series-6: #C96B7E;
  --series-7: #3E9C9A;
  --series-8: #6C7A89;
  --highlight: #D4745E;
  --band: rgba(54, 69, 79, .07);       /* shaded periods on charts */

  --font-body: "AEM Serif", "Palatino Linotype", Palatino, "Book Antiqua", "TeX Gyre Pagella", Georgia, serif;
  --font-ui: "AEM Sans", Calibri, Carlito, "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(54, 69, 79, .06), 0 4px 16px rgba(54, 69, 79, .05);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161D22; --surface: #1E262C; --surface-2: #26313A;
    --ink: #EEF1F3; --ink-2: #B9C2C9; --ink-3: #8A959E;
    --rule: #34414B; --grid: #2C3841;
    --accent: #C98A4F; --accent-ink: #E0A46C;
    --pos: #9CC27F; --neg: #E58C77; --warn-bg: #3A2F25;
    --series-1: #C98A4F; --series-2: #6FA9DD; --series-3: #93B477; --series-4: #A08DC4; --series-5: #D4B24A; --series-6: #D8899A; --series-7: #5BB5B2; --series-8: #8E9BA8;
    --band: rgba(238, 241, 243, .07);
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161D22; --surface: #1E262C; --surface-2: #26313A;
  --ink: #EEF1F3; --ink-2: #B9C2C9; --ink-3: #8A959E;
  --rule: #34414B; --grid: #2C3841;
  --accent: #C98A4F; --accent-ink: #E0A46C;
  --pos: #9CC27F; --neg: #E58C77; --warn-bg: #3A2F25;
  --series-1: #C98A4F; --series-2: #6FA9DD; --series-3: #93B477; --series-4: #A08DC4; --series-5: #D4B24A; --series-6: #D8899A; --series-7: #5BB5B2; --series-8: #8E9BA8;
  --band: rgba(238, 241, 243, .07);
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 17px; line-height: 1.55;
}
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); background: var(--surface); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; flex-direction: column; text-decoration: none; padding: 10px 0; }
.brand-name { font-family: var(--font-ui); font-weight: 700; font-size: 20px; letter-spacing: .01em; color: var(--ink); }
.brand-name::before { content: ""; display: inline-block; width: 22px; height: 22px; background: url("../img/logo.svg") center / contain no-repeat; margin-right: 8px; vertical-align: -4px; }
:root[data-theme="dark"] .brand-name::before { filter: drop-shadow(0 0 0.5px rgba(255,255,255,.6)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-name::before { filter: drop-shadow(0 0 0.5px rgba(255,255,255,.6)); } }
.brand-by { font-family: var(--font-ui); font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; margin-left: 30px; }  /* logo (22px) + gap (8px): aligns with the name */
.nav { display: flex; gap: 4px; flex: 1; align-items: center; font-family: var(--font-ui); font-size: 15px; }
.nav a, .nav-trigger { text-decoration: none; padding: 6px 10px; border-radius: 6px; color: var(--ink-2); white-space: nowrap; }
.nav a:hover, .nav-trigger:hover { color: var(--ink); }
.nav a[aria-current="page"], .nav-trigger.is-current { color: var(--ink); background: var(--surface-2); }
.nav-menu { position: relative; }
.nav-trigger { font: inherit; border: 0; background: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.nav-trigger .caret { font-size: 11px; color: var(--ink-3); transition: transform .15s; }
.nav-trigger[aria-expanded="true"] .caret { transform: rotate(180deg); }
.nav-trigger:focus-visible, .nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.nav-panel { position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; display: grid; grid-template-columns: repeat(3, minmax(180px, auto));
  gap: 6px 22px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .12); }
.nav-panel[hidden] { display: none; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); padding: 4px 10px 6px; }
.nav-panel a { display: block; }
.nav-panel a:hover { background: var(--surface-2); }
.nav .soon { color: var(--ink-3); padding: 6px 10px; white-space: nowrap; cursor: default; }
.header-tools { display: flex; gap: 8px; align-items: center; }

/* Buttons & segmented controls */
.btn, .seg button, .chip {
  font-family: var(--font-ui); font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--rule); border-radius: 6px;
  padding: 5px 10px; cursor: pointer; line-height: 1.3;
}
.btn:hover, .chip:hover { border-color: var(--ink-3); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover { filter: brightness(.95); color: #fff; }
.icon-btn { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 7px; padding: 2px; background: var(--surface-2); }
.seg button { border: 0; background: transparent; color: var(--ink-2); padding: 4px 10px; border-radius: 5px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--rule); font-weight: 600; }
.seg button:disabled { color: var(--ink-3); opacity: .55; cursor: not-allowed; }
.chip { border-radius: 999px; padding: 3px 10px 3px 8px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.chip .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--rule); }
.chip[aria-pressed="true"] { border-color: var(--ink-2); font-weight: 600; }

.select { font-family: var(--font-ui); font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 4px 8px; max-width: 100%; }
.select:disabled { opacity: .5; }
.base-pick { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; font-family: var(--font-ui); font-size: 14px; color: var(--ink-2); }
.btn.toggle[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); font-weight: 600; }

/* Intro */
.intro { padding: 36px 0 8px; }
.intro h1 { font-family: var(--font-ui); font-size: clamp(26px, 4vw, 34px); line-height: 1.15; margin: 0 0 8px; }
.intro p { margin: 0; color: var(--ink-2); max-width: 70ch; }
.meta-line { font-family: var(--font-ui); font-size: 13px; color: var(--ink-3); margin-top: 10px; }

/* In-page section menu (topic pages) */
.section-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 0; font-family: var(--font-ui); font-size: 14px; }
.section-nav a { text-decoration: none; color: var(--ink-2); border: 1px solid var(--rule); border-radius: 999px; padding: 3px 12px; background: var(--surface); }
.section-nav a:hover { color: var(--ink); border-color: var(--ink-3); }
.card { scroll-margin-top: 84px; }

/* Methodology page */
.prose { max-width: 76ch; margin: 24px 0 56px; line-height: 1.6; }
.prose h2 { font-family: var(--font-ui); font-size: 22px; margin: 36px 0 8px; color: var(--accent-ink); scroll-margin-top: 84px; }
.prose dt { font-family: var(--font-ui); font-weight: 600; margin-top: 10px; }
.prose dd { margin: 2px 0 0 0; color: var(--ink-2); }
.prose li { margin: 4px 0; }
.prose .formula { font-family: var(--font-body); background: var(--surface-2); border-radius: 6px; padding: 8px 14px; overflow-x: auto; }
.prose .refs li { color: var(--ink-2); }
.prose .cite { background: var(--surface-2); border-left: 3px solid var(--accent); border-radius: 4px; padding: 8px 14px; font-size: .95em; }
.toc { display: flex; flex-wrap: wrap; gap: 6px; font-family: var(--font-ui); font-size: 14px; }
.toc a { text-decoration: none; color: var(--ink-2); border: 1px solid var(--rule); border-radius: 999px; padding: 3px 12px; background: var(--surface); }
.toc a:hover { color: var(--ink); border-color: var(--ink-3); }

/* Home: one card per topic */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin: 24px 0 48px; }
.topic-card { display: block; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.topic-card:hover { border-color: var(--accent); }
.topic-card h2 { font-family: var(--font-ui); font-size: 22px; margin: 0 0 6px; color: var(--accent-ink); }
.topic-card p { margin: 0 0 8px; color: var(--ink-2); }
.topic-card .topic-list { font-family: var(--font-ui); font-size: 13px; color: var(--ink-3); margin: 0; }

/* Headline tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 24px 0 8px; }
.tile { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); text-decoration: none; display: block; }
.tile:hover { border-color: var(--ink-3); color: inherit; }
.tile-label { font-family: var(--font-ui); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.tile-value { font-family: var(--font-ui); font-size: 34px; font-weight: 700; line-height: 1.1; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.tile-value.pos { color: var(--pos); } .tile-value.neg { color: var(--neg); }
.tile-sub { font-family: var(--font-ui); font-size: 13px; color: var(--ink-3); }

/* Topic sections and cards */
.topic { padding: 28px 0 8px; scroll-margin-top: 80px; }
.topic > h2 { font-family: var(--font-ui); font-size: 24px; margin: 0 0 4px; }
.topic > p { margin: 0 0 16px; color: var(--ink-2); max-width: 75ch; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 18px 12px; min-width: 0; scroll-margin-top: 80px; }
.card.wide { grid-column: 1 / -1; }
.card h3 { font-family: var(--font-ui); font-size: 19px; margin: 0; line-height: 1.25; }
.card .desc { margin: 4px 0 12px; color: var(--ink-2); font-size: 15px; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.controls .spacer { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.chips-note { font-family: var(--font-ui); font-size: 12px; color: var(--ink-3); }
.chart { width: 100%; height: 340px; }
.chart.tall { height: 470px; }
.card-foot { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; border-top: 1px solid var(--rule); margin-top: 6px; padding-top: 10px; font-family: var(--font-ui); font-size: 13px; color: var(--ink-3); }
.card-foot .actions { display: flex; gap: 6px; }
.status-badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--accent-ink); margin-left: 6px; }
.summary-line { font-family: var(--font-ui); font-size: 14px; color: var(--ink-2); margin: 2px 0 6px; }
.summary-line b { color: var(--ink); font-weight: 600; }
.summary-line .sw { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin: 0 5px 2px 0; border-radius: 2px; }
.summary-line .sw.dashed { background: none !important; border-top: 2px dashed currentColor; height: 0; }
.episode-key { font-family: var(--font-ui); font-size: 12.5px; color: var(--ink-2); margin: 0 0 6px; padding-left: 20px; }
.episode-key li::marker { color: var(--highlight); font-weight: 700; }
.band-key { display: flex; flex-wrap: wrap; gap: 4px 18px; font-family: var(--font-ui); font-size: 12.5px; color: var(--ink-2); margin: 0 0 4px; }
.band-key > span { display: inline-flex; align-items: center; gap: 6px; }
.band-sw { display: inline-block; width: 18px; height: 12px; background: var(--band); border-radius: 2px; }
.band-sw.outline { background: none; border: 1.2px dotted var(--ink-3); }
.hint { font-family: var(--font-ui); font-size: 13px; color: var(--ink-3); margin: 0 0 4px; min-height: 1em; }

.term-stats { margin-top: 10px; font-family: var(--font-ui); font-size: 13px; }
.term-stats .table-scroll { max-height: none; }
.term-stats td.pres { white-space: nowrap; font-weight: 600; }
.term-stats td.pres .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.term-stats .at { color: var(--ink-3); font-size: 12px; }
.chart.tall-ish { height: 400px; }

details.table-view { margin-top: 8px; font-family: var(--font-ui); font-size: 13px; }
details.table-view summary { cursor: pointer; color: var(--ink-2); }
.table-scroll { max-height: 280px; overflow: auto; margin-top: 6px; border: 1px solid var(--rule); border-radius: 6px; }
.table-scroll.flat { max-height: none; }
table.statement td.pres { white-space: normal; min-width: 220px; }
table.statement tr.st-bold td { font-weight: 700; color: var(--ink); }
table.statement tr.rule td { border-top: 1px solid var(--rule); }
table.statement tr.st-head td { font-family: var(--font-ui); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding-top: 12px; }
table.statement td.st-delta { color: var(--ink-2); }
.rer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 10px 0 4px; }
.rer-tile { border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; background: var(--surface); }
.rer-k { font-family: var(--font-ui); font-size: 12px; color: var(--ink-3); }
.rer-v { font-family: var(--font-ui); font-size: 26px; font-weight: 700; color: var(--ink); margin: 4px 0; font-variant-numeric: tabular-nums; }
.rer-s { font-family: var(--font-ui); font-size: 12px; color: var(--ink-2); }
.rer-caveats p { margin: 6px 0; }
.rer-two { gap: 12px; flex-wrap: wrap; }
.rer-two[hidden], .inline-select[hidden] { display: none; }
.rer-two input[type=range] { accent-color: var(--accent); }
.rer-two input[type=range] { width: 110px; vertical-align: middle; }
.inline-select input[type=date] { font: inherit; }
@media (max-width: 860px) { .rer-grid { grid-template-columns: repeat(2, 1fr); } }
.inline-select { font-family: var(--font-ui); font-size: 14px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
table.data { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 4px 10px; text-align: right; border-bottom: 1px solid var(--grid); white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th { position: sticky; top: 0; background: var(--surface-2); color: var(--ink-2); font-weight: 600; }

/* Footer */
.site-footer { margin-top: 48px; border-top: 1px solid var(--rule); background: var(--surface); padding: 28px 0 40px; font-size: 15px; color: var(--ink-2); }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.site-footer h4 { font-family: var(--font-ui); font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); margin: 0 0 6px; }
.site-footer p { margin: 0 0 8px; }

.loading, .error-box { font-family: var(--font-ui); color: var(--ink-3); padding: 40px 0; text-align: center; }
.error-box { color: var(--neg); }

@media (max-width: 860px) {
  .cards { grid-template-columns: 1fr; }
  .site-footer .cols { grid-template-columns: 1fr; }
  .chart { height: 300px; } .chart.tall { height: 520px; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .brand-by { display: none; }
  .site-header .wrap { gap: 0 12px; }
  .brand { flex: 1; }
  .nav { order: 3; flex-basis: 100%; margin: 0 -10px; padding-bottom: 6px; }
  .nav-panel { grid-template-columns: 1fr; width: calc(100vw - 32px); max-height: 70vh; overflow-y: auto; }
  .card { padding: 14px 12px 10px; }
  .tile-value { font-size: 28px; }
}
@media print {
  .site-header, .controls, .card-foot .actions, .chips, .term-stats { margin-top: 10px; font-family: var(--font-ui); font-size: 13px; }
.term-stats .table-scroll { max-height: none; }
.term-stats td.pres { white-space: nowrap; font-weight: 600; }
.term-stats td.pres .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.term-stats .at { color: var(--ink-3); font-size: 12px; }
.chart.tall-ish { height: 400px; }

details.table-view { display: none; }
  .card { break-inside: avoid; box-shadow: none; }
}

/* Net reserves: estimate caveat and line-by-line construction table */
.caveat { font-family: var(--font-ui); font-size: 13px; color: var(--ink-2); background: var(--warn-bg); border-left: 3px solid var(--accent); border-radius: 4px; padding: 8px 12px; margin: 4px 0 10px; }
.breakdown { margin: 14px 0 6px; }
.breakdown-title { font-family: var(--font-ui); font-size: 14px; font-weight: 600; margin: 0 0 6px; color: var(--ink); }
.breakdown table.data td:not(:first-child), .breakdown table.data th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.breakdown tr.total td { border-top: 2px solid var(--ink-3); }
.breakdown table.data td:first-child { white-space: normal; min-width: 14em; }
.breakdown .table-scroll { max-height: none; }

/* BCRA balance sheet table */
.bs-guide { font-family: var(--font-ui); font-size: 13px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--rule); border-radius: 6px; padding: 8px 12px; margin: 8px 0; }
.bs-guide summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.bs-guide ul { margin: 6px 0 2px; padding-left: 18px; }
.bs-guide li { margin: 4px 0; }
.bs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .bs-grid { grid-template-columns: 1fr; } }
.bs-side .table-scroll { max-height: none; }
table.data.bs td:first-child { white-space: normal; min-width: 13em; }
table.data.bs tr.main td { font-weight: 600; }
table.data.bs tr.total td { font-weight: 700; border-top: 2px solid var(--ink-3); }
table.data.bs tr.less td { font-style: italic; color: var(--ink-3); }
.bs-notes { margin-top: 8px; }
@media (max-width: 600px) { table.data.bs td:first-child { min-width: 9em; } }
table.data.top td:nth-child(2) { white-space: normal; min-width: 14em; text-align: left; }
table.data.top th { white-space: normal; vertical-align: bottom; min-width: 6em; }
table.data.top tr.bench td { font-weight: 600; }
table.data.top tr.bench.first td { border-top: 2px solid var(--ink-3); }
table.data.top .at { color: var(--ink-3); font-size: 12px; }
.top10 { max-height: none; }
table.data.bs tr.computed td { font-style: italic; }

/* Fiscal: placements table type swatch */
table.data .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; }
table.data.plc { font-size: 13px; }
table.data.plc th { white-space: normal; vertical-align: bottom; }
table.data.plc td:nth-child(2) { text-align: left; }
table.data.sched tr.total td { font-weight: 700; border-top: 2px solid var(--ink-3); }

/* Chips: toggle overlay series (comparison countries) */
.chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 2px; font-family: var(--font-ui); font-size: 12.5px; }
.chip-label { color: var(--ink-3); margin-right: 2px; }
.chip { border: 1px solid var(--rule); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 3px 10px; font: inherit; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); border-color: var(--ink-3); font-weight: 600; }
.chip[aria-pressed="true"]::before { content: "✓ "; }
.chip:hover { border-color: var(--ink-3); }
.band-sw.hatch { background: repeating-linear-gradient(135deg, var(--ink-3) 0 2px, transparent 2px 5px); }
.band-sw.dashline { background: none; height: 0; border-top: 1.5px dashed var(--ink); }

/* Home: summary dashboard */
.dash-host { margin: 24px 0 8px; }
.dash { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px 12px; }
.dash-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.dash-head h2 { font-family: var(--font-ui); font-size: 18px; margin: 0; }
.dash-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dash-table { border-collapse: separate; border-spacing: 0; width: 100%; font-family: var(--font-ui); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.dash-table th, .dash-table td { padding: 5px 8px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--grid); }
.dash-table thead th { color: var(--ink-2); font-weight: 600; border-bottom: 1px solid var(--rule); position: sticky; top: 0; background: var(--surface); }
.dash-table .dash-name { text-align: left; font-weight: 400; position: sticky; left: 0; background: var(--surface); z-index: 1; max-width: 260px; white-space: normal; min-width: 170px; }
.dash-table .dash-name a { color: var(--ink); text-decoration: none; }
.dash-table .dash-name a:hover { text-decoration: underline; }
.dash-table .dash-group th { text-align: left; font-weight: 700; color: var(--ink); background: var(--surface-2); text-transform: uppercase; font-size: 11.5px; letter-spacing: .06em; position: static; }
.dash-table td.na { color: var(--ink-3); font-size: 12px; }
.dash-table .dash-q { font-size: 10px; color: var(--ink-3); margin-left: 3px; vertical-align: super; }
.dash-table .dash-level { color: var(--ink); border-left: 1px solid var(--rule); }
.dash-table .dash-date { display: block; font-size: 11px; color: var(--ink-3); }
.dash-table .dash-spark { color: var(--ink-2); padding-right: 0; }
.dash-tag { font-size: 10.5px; color: var(--ink-3); border: 1px solid var(--rule); border-radius: 4px; padding: 0 4px; margin-left: 6px; }
.dash-tag.warn { color: var(--neg); border-color: var(--neg); }
.dash-table sup { color: var(--ink-3); margin-left: 2px; }
.dash-foot { font-family: var(--font-ui); font-size: 12px; color: var(--ink-3); margin: 10px 0 0; line-height: 1.45; }
.home-sub { font-family: var(--font-ui); font-size: 18px; margin: 28px 0 10px; }
@media (max-width: 640px) {
  .dash { padding: 12px 10px; }
  .dash-table { font-size: 12.5px; }
  .dash-table .dash-name { min-width: 130px; max-width: 150px; }
}

/* Embeds: one card, no site chrome */
body[data-page="embed"] { background: var(--surface); }
body[data-page="embed"] .site-header, body[data-page="embed"] .site-footer, body[data-page="embed"] .intro,
body[data-page="embed"] .section-nav, body[data-page="embed"] #tiles { display: none; }
body[data-page="embed"] main.wrap { max-width: none; padding: 0; }
body[data-page="embed"] .cards { display: block; margin: 0; }
body[data-page="embed"] .card { border: 0; box-shadow: none; margin: 0; }
.embed-credit { font-family: var(--font-ui); font-size: 12px; color: var(--ink-3); margin: 8px 0 0; }
.embed-dialog { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.embed-box { background: var(--surface); color: var(--ink); border-radius: var(--radius); padding: 18px 20px; max-width: 620px; width: 100%; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); font-family: var(--font-ui); }
.embed-box h4 { margin: 0 0 6px; font-size: 17px; }
.embed-box p { font-size: 14px; color: var(--ink-2); margin: 0 0 10px; }
.embed-code { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; background: var(--surface-2); color: var(--ink); border: 1px solid var(--rule); border-radius: 6px; padding: 8px; resize: vertical; }
.embed-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.embed-actions .embed-status { color: var(--pos); font-size: 13px; margin-right: auto; }

/* Home: new data and upcoming releases */
.timeline { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0 8px; }
.timeline > div { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); }
.timeline h3 { font-family: var(--font-ui); font-size: 15px; margin: 0 0 8px; }
.tl-list { list-style: none; margin: 0; padding: 0; font-family: var(--font-ui); font-size: 14px; }
.tl-list li { padding: 4px 0; border-bottom: 1px solid var(--grid); display: flex; gap: 10px; align-items: baseline; }
.tl-list li:last-child { border-bottom: 0; }
.tl-date { color: var(--ink-3); font-size: 12.5px; min-width: 84px; font-variant-numeric: tabular-nums; }
.tl-list a { color: var(--ink); }
.tl-sub { color: var(--ink-3); font-size: 12.5px; }
.tl-none { font-family: var(--font-ui); font-size: 13px; color: var(--ink-3); margin: 0; }
@media (max-width: 760px) { .timeline { grid-template-columns: 1fr; } }

/* Narrow screens: segmented controls wrap; wide tables in text scroll inside their box */
.seg { flex-wrap: wrap; max-width: 100%; }
.prose table { display: block; max-width: 100%; overflow-x: auto; }

/* Site share menu (header) and footer social links */
.header-tools { position: relative; }
.share-menu { position: absolute; top: calc(100% + 6px); width: 180px; z-index: 60; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.12); padding: 4px; font-family: var(--font-ui); font-size: 14px; }
.share-menu a, .share-menu button { display: block; text-align: left; padding: 7px 10px; border-radius: 5px; color: var(--ink); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; }
.share-menu a:hover, .share-menu button:hover, .share-menu a:focus-visible, .share-menu button:focus-visible { background: var(--surface-2); }
.site-footer .social-links { font-family: var(--font-ui); font-size: 14px; }
@media (max-width: 520px) {
  .brand-name { font-size: 16px; line-height: 1.25; }
  .header-tools { gap: 5px; }
  .header-tools .btn:not(.icon-btn) { padding-left: 8px; padding-right: 8px; font-size: 13px; }
  .header-tools .icon-btn { width: 30px; height: 30px; }
}

/* Statement tables: sections fold under their heading */
.st-fold { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.st-fold:hover { color: var(--accent-ink); }
.st-caret { display: inline-block; width: 1em; color: var(--ink-3); }
/* Switch between related cards (e.g. exports, imports, balance) */
.card-switch { margin: 0 0 10px; }
/* Long option texts never push a select past the screen edge */
.base-pick { max-width: 100%; }
.base-pick select, .inline-select select { min-width: 0; max-width: min(100%, calc(100vw - 150px)); text-overflow: ellipsis; }
.inline-select { max-width: 100%; }
/* A chart's own buttons when a card has two charts */
.card-foot.chart-actions { border-top: 0; margin: 2px 0 12px; padding-top: 0; }
/* Dashboard: 12-month change standing in for a missing seasonally adjusted change */
.dash-table td.dash-fb { font-style: italic; }
/* Chips in panel and component cards use the interface font */
.chips { font-family: var(--font-ui); font-size: 13px; }

/* EMAE trend-cycle in real time: second line in release cells */
table.data .muted { color: var(--ink-3); font-size: 0.85em; }
table.data.turns th { white-space: normal; vertical-align: bottom; line-height: 1.25; }
table.data.turns th, table.data.turns td { padding-left: 8px; padding-right: 8px; }

/* NGDP card: controls and charts shown per view */
.seg[hidden], .chart[hidden], .hint[hidden], input[hidden] { display: none; }
.controls[hidden] { display: none; }

/* Skip link: hidden until focused from the keyboard */
.skip-link { position: absolute; left: 8px; top: -48px; z-index: 100; padding: 8px 12px; background: var(--surface); color: var(--ink); border: 1px solid var(--rule); border-radius: 6px; font-family: var(--font-ui); font-size: 14px; }
.skip-link:focus { top: 8px; }
main:focus { outline: none; }
/* 404 page */
.notfound { max-width: 640px; margin: 64px auto; font-family: var(--font-ui); }
.notfound h1 { font-family: var(--font-serif, inherit); }
.notfound ul { line-height: 1.9; }

/* Beta tag and note */
.beta-tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border: 1px solid var(--accent); border-radius: 4px; color: var(--accent-ink); font-family: var(--font-ui); font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; vertical-align: 2px; }
.beta-note { margin-top: 6px; font-family: var(--font-ui); font-size: 13px; color: var(--ink-3); }

/* Site search */
.site-search { position: relative; }
.search-input { width: 210px; font: inherit; font-family: var(--font-ui); font-size: 14px; padding: 6px 10px; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); color: var(--ink); }
.search-input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.search-toggle { display: none; }
.search-results { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; width: 340px; max-width: calc(100vw - 24px); margin: 0; padding: 4px 0; list-style: none;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); font-family: var(--font-ui); }
.search-results[hidden] { display: none; }
.search-results li { display: flex; flex-direction: column; gap: 1px; padding: 7px 12px; cursor: pointer; }
.search-results li.active, .search-results li:hover { background: var(--grid); }
.sr-title { font-size: 14px; color: var(--ink); }
.sr-where { font-size: 12px; color: var(--ink-3); }
.sr-empty { font-size: 13px; color: var(--ink-3); cursor: default !important; }
@media (max-width: 900px) {
  .search-toggle { display: inline-flex; }
  .search-panel { display: none; position: fixed; left: 12px; right: 12px; top: var(--search-top, 64px); z-index: 60; }
  .site-search.open .search-panel { display: block; }
  .search-input { width: 100%; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
  .search-results { position: static; width: 100%; margin-top: 4px; }
}

.how-list { padding-left: 1.2em; }
.how-list li { margin-bottom: .5em; }
kbd { font-family: var(--font-ui); font-size: .85em; padding: 1px 5px; border: 1px solid var(--rule); border-radius: 4px; background: var(--surface); }
