/* Global Fiscal Explorer. Loaded after /assets/theme.css, site.css and tool.css (the Econvitals tool shell: page top,
   tabs, Detail ▸, control box, the Copy-link footer) and overriding it where this page needs its own: buttons that keep
   one fixed size but take two lines (long labels), the chart frame and download row, number chips, warning boxes, the
   summary, two-way and reference tables. Every color is the house palette from theme.css. */
:root {
  --ui: var(--mf-font); --serif: var(--mf-font);
  --ink: var(--mf-ink); --muted: #6b6b6b; --line: #e4e4e4; --line-strong: #cfcfcf; --card: #ffffff; --chip: #f4f5f7;
  --link: var(--mf-blue); --sel: var(--mf-blue);
  --core: #9a9385;
}
body { background: var(--mf-bg); }
.tool-wrap { max-width: 1240px; }
a { color: var(--link); }

/* the page top and each tab's opening paragraph */
.tool-desc { max-width: 980px; }   /* the standard size and gray (tool.css); only the measure is this page’s */
.tool-asof, .tool-related { max-width: 980px; }
.tabdesc { font-size: 15.5px; line-height: 1.6; max-width: 980px; margin: 4px 0 14px; }
.ev-tabs button { width: 200px; }   /* wider than the standard 168px: “Productivity scenarios” is cut off at 168 */
@media (max-width: 600px) { .ev-tabs button { width: calc(50% - 1px); } }

/* the control box: one control per row, label above */
.ev-panel { display: block; padding: 14px 18px 8px; }
.ev-panel .ctl { margin: 0 0 14px; }
.ev-panel .lbl { display: block; margin-bottom: 7px; }
.ev-more { margin: 2px 0 6px; }
.ev-more-body { padding-top: 10px; }
.modtag { display: inline-block; margin-left: 8px; font-size: 10.5px; letter-spacing: .04em; text-transform: none; font-weight: 600; color: var(--mf-red);
  border: 1px solid color-mix(in srgb, var(--mf-red) 45%, #fff); background: color-mix(in srgb, var(--mf-red) 7%, #fff); border-radius: 999px; padding: 0 8px; vertical-align: 1px; }
.hint { font-size: 12.5px; line-height: 1.45; color: var(--muted); margin: 7px 0 0; max-width: 640px; }
.casehint { max-width: 780px; }
.ev-panel select { font-family: inherit; font-size: 13.5px; height: 38px; width: 420px; max-width: 100%; border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; padding: 0 8px; }

/* buttons: ONE fixed size (160 × 44, two lines for the long labels), separate tiles, house-blue when chosen.
   Overrides tool.css's joined .seg bar, whose one-line buttons would cut these labels off. */
.seg { display: grid; grid-template-columns: repeat(auto-fill, 160px); gap: 6px; border: 0; border-radius: 0; overflow: visible; max-width: 100%; width: auto; }
.seg.two { grid-template-columns: repeat(2, 160px); }
.seg.three { grid-template-columns: repeat(3, 160px); }
.seg.four { grid-template-columns: repeat(4, 160px); }
.seg button, .seg button:last-child { font-family: inherit; font-size: 13px; width: 160px; height: 44px; border: 1px solid var(--line-strong); border-radius: 5px;
  background: #fff; color: var(--ink); cursor: pointer; padding: 0 6px; white-space: normal; line-height: 1.15; overflow: hidden; text-overflow: clip; }
.seg button:hover { border-color: var(--mf-blue); }
.seg button[aria-pressed="true"] { background: var(--mf-blue); border-color: var(--mf-blue); color: #fff; font-weight: 600; }
.seg button .lbl-short { display: none; }
.seg button:disabled { color: #9a9a9a; border-style: dashed; background: #f6f6f6; cursor: default; }
.chips button { width: 64px; height: 34px; font-variant-numeric: tabular-nums; }
.chips button[aria-pressed="true"] { font-weight: 600; }

/* results */
/* warnings: the light red of the shell's .tool-warn pill, as a box because they run to several lines */
.warnbox { font-size: 13px; line-height: 1.5; color: var(--mf-ink); background: color-mix(in srgb, var(--mf-red) 9%, var(--mf-bg)); border: 1px solid color-mix(in srgb, var(--mf-red) 38%, var(--mf-bg)); border-radius: 6px; padding: 9px 12px; margin: 10px 0; }
#warn:empty { display: none; }
.ctx { font-size: 13px; color: var(--muted); text-align: center; margin: 4px 0 8px; }
.biglegend { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; font-size: 12.5px; margin: 6px 0 4px; }

/* charts */
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 8px; }
.chartbox { border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px 4px; background: #fff; min-width: 0; }
.chart { min-height: 200px; }
.rf-fig { margin: 0; }
.rf-title { font-size: 17px; font-weight: 700; text-align: center; margin-bottom: 2px; line-height: 1.3; text-wrap: balance; }
.rf-units { font-size: 11.5px; color: var(--ink); text-align: center; line-height: 1.45; margin-bottom: 6px; }
.rf-plot svg { max-width: 100%; height: auto; overflow: visible; display: block; }
.rf-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: center; margin-top: 6px; font-size: 11.5px; line-height: 1.4; }
.rf-item { display: inline-flex; align-items: center; gap: 6px; }
.rf-swatch { width: 18px; height: 3px; border-radius: 1px; display: inline-block; flex: none; }
.rf-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 9.5px; color: var(--muted); }
.rf-src { font-style: italic; }
.rf-empty { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 180px; font-size: 13px; color: var(--muted); background: #fafafa; border-radius: 4px; padding: 12px; }
/* the download row: one centered row of three equal buttons under each chart */
.chartbox .ev-dlbar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-width: 540px; margin: 8px auto 6px; }
.chartbox .ev-dlbar .ev-dl { width: 100%; height: 34px; white-space: normal; line-height: 1.1; font-family: inherit; }

/* tables: every column centered, headers and values */
.tablewrap { overflow-x: auto; margin: 14px 0 6px; -webkit-overflow-scrolling: touch; }
.tablecap { font-size: 16px; font-weight: 700; text-align: center; margin: 18px 0 2px; }
.tablesub { font-size: 11.5px; text-align: center; color: var(--ink); margin: 0 auto 4px; max-width: 980px; }
table.num { border-collapse: collapse; margin: 0 auto; font-size: 13px; }
table.num td:not(.lab) { font-variant-numeric: tabular-nums; }
table.num th, table.num td { text-align: center; vertical-align: middle; padding: 6px 9px; border-bottom: 1px solid var(--line); }
table.num thead th { font-weight: 600; color: var(--ink); border-bottom: 1px solid var(--line-strong); }
table.num td.lab { min-width: 220px; max-width: 320px; line-height: 1.35; }
table.num td.lab .u { display: block; font-size: 11px; color: var(--muted); }
table.num td.lab .rf-swatch { vertical-align: middle; }
table.num td.err { color: var(--muted); font-style: italic; }
table.num tr.sel td { font-weight: 600; }
table.num.xt td { min-width: 58px; }
table.num.xt th { font-size: 12px; }
table.num.params { font-size: 12px; }
table.num.params td.note { min-width: 260px; max-width: 380px; line-height: 1.4; font-size: 11.5px; }
#casetable { margin-top: 18px; }

/* About: prose and the reference tables */
.prose { max-width: 820px; font-size: 17px; line-height: 1.65; }
.prose h2 { font-size: clamp(23px, 3vw, 28px); font-weight: 700; margin: 30px 0 10px; }
.prose h3 { font-size: 20px; margin: 24px 0 8px; }
.prose p { margin: 0 0 14px; }
.prose ul { margin: 0 0 16px; padding-left: 1.3em; }
.prose li { margin: 0 0 10px; }
.prose li ul { margin: 8px 0 0; }
.prose li li { margin: 0 0 6px; }
.prose p.under { font-size: 15.5px; }
.refpanel { border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px 12px; margin: 26px 0 10px; }
.panel-h { font-size: 22px; font-weight: 700; margin: 2px 0 10px; }
.gridnote { font-size: 13px; line-height: 1.5; color: #404040; background: var(--chip); border-radius: 5px; padding: 8px 12px; margin: 0 0 10px; max-width: 900px; }

@media (max-width: 820px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .ev-panel { padding: 12px 12px 6px; }
  .seg, .seg.two, .seg.three, .seg.four { grid-template-columns: repeat(auto-fill, 104px); width: auto; }
  .seg button, .seg button:last-child, .seg button:nth-child(odd) { width: 104px; font-size: 12px; border: 1px solid var(--line-strong); margin-bottom: 0; }
  .seg button[aria-pressed="true"] { border-color: var(--mf-blue); }
  .seg button .lbl-full { display: none; }
  .seg button .lbl-short { display: inline; }
  .chips button { width: 56px; }
  .chartbox { padding: 10px 8px 4px; }
  .chartbox .ev-dlbar .ev-dl { font-size: 11px; height: 40px; }
  table.num td.lab { min-width: 160px; }
  .refpanel { padding: 14px 12px 10px; }
  .prose { font-size: 16px; }
}
